From 02de097319ab7a4764c02300b95af1701208f0c4 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Thu, 4 Apr 2024 13:35:03 -0400 Subject: [PATCH] chore: update telescope (#89) * chore: update telescope * update deps --- packages/api/package.json | 4 +- packages/api/proto/google/api/http.proto | 379 +++ packages/api/scripts/codegen.js | 2 +- packages/api/src/codegen/binary.ts | 534 +++++ .../cosmos/app/module/v1alpha1/module.ts | 12 +- .../src/codegen/cosmos/app/v1alpha1/config.ts | 46 +- .../src/codegen/cosmos/app/v1alpha1/module.ts | 79 +- .../cosmos/app/v1alpha1/query.rpc.Query.ts | 4 +- .../src/codegen/cosmos/app/v1alpha1/query.ts | 33 +- .../src/codegen/cosmos/auth/v1beta1/auth.ts | 253 +- .../codegen/cosmos/auth/v1beta1/genesis.ts | 23 +- .../codegen/cosmos/auth/v1beta1/query.lcd.ts | 2 +- .../cosmos/auth/v1beta1/query.rpc.Query.ts | 20 +- .../src/codegen/cosmos/auth/v1beta1/query.ts | 359 +-- .../src/codegen/cosmos/authz/v1beta1/authz.ts | 126 +- .../src/codegen/cosmos/authz/v1beta1/event.ts | 72 +- .../codegen/cosmos/authz/v1beta1/genesis.ts | 19 +- .../codegen/cosmos/authz/v1beta1/query.lcd.ts | 2 +- .../cosmos/authz/v1beta1/query.rpc.Query.ts | 8 +- .../src/codegen/cosmos/authz/v1beta1/query.ts | 186 +- .../cosmos/authz/v1beta1/tx.rpc.msg.ts | 8 +- .../src/codegen/cosmos/authz/v1beta1/tx.ts | 146 +- .../src/codegen/cosmos/bank/v1beta1/authz.ts | 23 +- .../src/codegen/cosmos/bank/v1beta1/bank.ts | 231 +- .../codegen/cosmos/bank/v1beta1/genesis.ts | 60 +- .../codegen/cosmos/bank/v1beta1/query.lcd.ts | 2 +- .../cosmos/bank/v1beta1/query.rpc.Query.ts | 20 +- .../src/codegen/cosmos/bank/v1beta1/query.ts | 432 ++-- .../codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts | 6 +- .../api/src/codegen/cosmos/bank/v1beta1/tx.ts | 78 +- .../codegen/cosmos/base/abci/v1beta1/abci.ts | 556 +++-- .../src/codegen/cosmos/base/kv/v1beta1/kv.ts | 46 +- .../cosmos/base/node/v1beta1/query.lcd.ts | 2 +- .../base/node/v1beta1/query.rpc.Service.ts | 4 +- .../codegen/cosmos/base/node/v1beta1/query.ts | 31 +- .../cosmos/base/query/v1beta1/pagination.ts | 130 +- .../base/reflection/v1beta1/reflection.ts | 65 +- .../base/reflection/v2alpha1/reflection.ts | 570 +++-- .../cosmos/base/snapshots/v1beta1/snapshot.ts | 291 ++- .../cosmos/base/store/v1beta1/commit_info.ts | 111 +- .../cosmos/base/store/v1beta1/listening.ts | 143 +- .../base/tendermint/v1beta1/query.lcd.ts | 2 +- .../tendermint/v1beta1/query.rpc.Service.ts | 16 +- .../cosmos/base/tendermint/v1beta1/query.ts | 780 ++++--- .../cosmos/base/tendermint/v1beta1/types.ts | 170 +- .../src/codegen/cosmos/base/v1beta1/coin.ts | 94 +- packages/api/src/codegen/cosmos/bundle.ts | 326 +-- .../cosmos/capability/v1beta1/capability.ts | 83 +- .../cosmos/capability/v1beta1/genesis.ts | 84 +- packages/api/src/codegen/cosmos/client.ts | 2 +- .../codegen/cosmos/crisis/v1beta1/genesis.ts | 19 +- .../cosmos/crisis/v1beta1/tx.rpc.msg.ts | 4 +- .../src/codegen/cosmos/crisis/v1beta1/tx.ts | 47 +- .../src/codegen/cosmos/crypto/ed25519/keys.ts | 40 +- .../api/src/codegen/cosmos/crypto/hd/v1/hd.ts | 53 +- .../cosmos/crypto/keyring/v1/record.ts | 105 +- .../codegen/cosmos/crypto/multisig/keys.ts | 27 +- .../crypto/multisig/v1beta1/multisig.ts | 48 +- .../codegen/cosmos/crypto/secp256k1/keys.ts | 40 +- .../codegen/cosmos/crypto/secp256r1/keys.ts | 40 +- .../distribution/v1beta1/distribution.ts | 435 ++-- .../cosmos/distribution/v1beta1/genesis.ts | 320 +-- .../cosmos/distribution/v1beta1/query.lcd.ts | 2 +- .../distribution/v1beta1/query.rpc.Query.ts | 20 +- .../cosmos/distribution/v1beta1/query.ts | 388 ++-- .../cosmos/distribution/v1beta1/tx.rpc.msg.ts | 10 +- .../codegen/cosmos/distribution/v1beta1/tx.ts | 154 +- .../cosmos/evidence/v1beta1/evidence.ts | 81 +- .../cosmos/evidence/v1beta1/genesis.ts | 19 +- .../cosmos/evidence/v1beta1/query.lcd.ts | 2 +- .../evidence/v1beta1/query.rpc.Query.ts | 6 +- .../codegen/cosmos/evidence/v1beta1/query.ts | 88 +- .../cosmos/evidence/v1beta1/tx.rpc.msg.ts | 4 +- .../src/codegen/cosmos/evidence/v1beta1/tx.ts | 54 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 156 +- .../cosmos/feegrant/v1beta1/genesis.ts | 19 +- .../cosmos/feegrant/v1beta1/query.lcd.ts | 2 +- .../feegrant/v1beta1/query.rpc.Query.ts | 8 +- .../codegen/cosmos/feegrant/v1beta1/query.ts | 162 +- .../cosmos/feegrant/v1beta1/tx.rpc.msg.ts | 6 +- .../src/codegen/cosmos/feegrant/v1beta1/tx.ts | 96 +- .../codegen/cosmos/genutil/v1beta1/genesis.ts | 21 +- .../api/src/codegen/cosmos/gov/v1/genesis.ts | 87 +- packages/api/src/codegen/cosmos/gov/v1/gov.ts | 378 +-- .../src/codegen/cosmos/gov/v1/query.lcd.ts | 2 +- .../codegen/cosmos/gov/v1/query.rpc.Query.ts | 18 +- .../api/src/codegen/cosmos/gov/v1/query.ts | 522 +++-- .../src/codegen/cosmos/gov/v1/tx.rpc.msg.ts | 12 +- packages/api/src/codegen/cosmos/gov/v1/tx.ts | 314 +-- .../src/codegen/cosmos/gov/v1beta1/genesis.ts | 69 +- .../api/src/codegen/cosmos/gov/v1beta1/gov.ts | 398 ++-- .../codegen/cosmos/gov/v1beta1/query.lcd.ts | 2 +- .../cosmos/gov/v1beta1/query.rpc.Query.ts | 18 +- .../src/codegen/cosmos/gov/v1beta1/query.ts | 480 ++-- .../codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts | 10 +- .../api/src/codegen/cosmos/gov/v1beta1/tx.ts | 255 ++- .../api/src/codegen/cosmos/group/v1/events.ts | 313 +-- .../src/codegen/cosmos/group/v1/genesis.ts | 117 +- .../src/codegen/cosmos/group/v1/query.lcd.ts | 2 +- .../cosmos/group/v1/query.rpc.Query.ts | 28 +- .../api/src/codegen/cosmos/group/v1/query.ts | 766 ++++--- .../src/codegen/cosmos/group/v1/tx.rpc.msg.ts | 30 +- .../api/src/codegen/cosmos/group/v1/tx.ts | 923 ++++---- .../api/src/codegen/cosmos/group/v1/types.ts | 693 +++--- packages/api/src/codegen/cosmos/lcd.ts | 2 +- .../codegen/cosmos/mint/v1beta1/genesis.ts | 21 +- .../src/codegen/cosmos/mint/v1beta1/mint.ts | 131 +- .../codegen/cosmos/mint/v1beta1/query.lcd.ts | 2 +- .../cosmos/mint/v1beta1/query.rpc.Query.ts | 8 +- .../src/codegen/cosmos/mint/v1beta1/query.ts | 85 +- .../src/codegen/cosmos/nft/v1beta1/event.ts | 115 +- .../src/codegen/cosmos/nft/v1beta1/genesis.ts | 50 +- .../api/src/codegen/cosmos/nft/v1beta1/nft.ts | 120 +- .../codegen/cosmos/nft/v1beta1/query.lcd.ts | 2 +- .../cosmos/nft/v1beta1/query.rpc.Query.ts | 16 +- .../src/codegen/cosmos/nft/v1beta1/query.ts | 366 +-- .../codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts | 4 +- .../api/src/codegen/cosmos/nft/v1beta1/tx.ts | 55 +- .../cosmos/orm/module/v1alpha1/module.ts | 12 +- packages/api/src/codegen/cosmos/orm/v1/orm.ts | 118 +- .../src/codegen/cosmos/orm/v1alpha1/schema.ts | 64 +- .../codegen/cosmos/params/v1beta1/params.ts | 74 +- .../cosmos/params/v1beta1/query.lcd.ts | 2 +- .../cosmos/params/v1beta1/query.rpc.Query.ts | 6 +- .../codegen/cosmos/params/v1beta1/query.ts | 96 +- .../cosmos/slashing/v1beta1/genesis.ts | 122 +- .../cosmos/slashing/v1beta1/query.lcd.ts | 2 +- .../slashing/v1beta1/query.rpc.Query.ts | 8 +- .../codegen/cosmos/slashing/v1beta1/query.ts | 109 +- .../cosmos/slashing/v1beta1/slashing.ts | 178 +- .../cosmos/slashing/v1beta1/tx.rpc.msg.ts | 4 +- .../src/codegen/cosmos/slashing/v1beta1/tx.ts | 29 +- .../codegen/cosmos/staking/v1beta1/authz.ts | 60 +- .../codegen/cosmos/staking/v1beta1/genesis.ts | 108 +- .../cosmos/staking/v1beta1/query.lcd.ts | 2 +- .../cosmos/staking/v1beta1/query.rpc.Query.ts | 30 +- .../codegen/cosmos/staking/v1beta1/query.ts | 684 +++--- .../codegen/cosmos/staking/v1beta1/staking.ts | 789 ++++--- .../cosmos/staking/v1beta1/tx.rpc.msg.ts | 14 +- .../src/codegen/cosmos/staking/v1beta1/tx.ts | 379 +-- .../cosmos/tx/signing/v1beta1/signing.ts | 149 +- .../codegen/cosmos/tx/v1beta1/service.lcd.ts | 2 +- .../cosmos/tx/v1beta1/service.rpc.Service.ts | 12 +- .../src/codegen/cosmos/tx/v1beta1/service.ts | 398 ++-- .../api/src/codegen/cosmos/tx/v1beta1/tx.ts | 577 +++-- .../cosmos/upgrade/v1beta1/query.lcd.ts | 2 +- .../cosmos/upgrade/v1beta1/query.rpc.Query.ts | 12 +- .../codegen/cosmos/upgrade/v1beta1/query.ts | 208 +- .../cosmos/upgrade/v1beta1/tx.rpc.msg.ts | 6 +- .../src/codegen/cosmos/upgrade/v1beta1/tx.ts | 64 +- .../codegen/cosmos/upgrade/v1beta1/upgrade.ts | 182 +- .../cosmos/vesting/v1beta1/tx.rpc.msg.ts | 8 +- .../src/codegen/cosmos/vesting/v1beta1/tx.ts | 189 +- .../codegen/cosmos/vesting/v1beta1/vesting.ts | 246 +- .../api/src/codegen/cosmos_proto/cosmos.ts | 64 +- packages/api/src/codegen/google/api/http.ts | 1423 ++++++++++++ packages/api/src/codegen/google/bundle.ts | 16 +- .../api/src/codegen/google/protobuf/any.ts | 15 +- .../src/codegen/google/protobuf/descriptor.ts | 1287 ++++++----- .../src/codegen/google/protobuf/duration.ts | 35 +- .../src/codegen/google/protobuf/timestamp.ts | 37 +- packages/api/src/codegen/helpers.ts | 345 +-- .../ibc/applications/transfer/v1/genesis.ts | 31 +- .../ibc/applications/transfer/v1/query.lcd.ts | 2 +- .../transfer/v1/query.rpc.Query.ts | 12 +- .../ibc/applications/transfer/v1/query.ts | 205 +- .../ibc/applications/transfer/v1/transfer.ts | 56 +- .../applications/transfer/v1/tx.rpc.msg.ts | 4 +- .../ibc/applications/transfer/v1/tx.ts | 91 +- packages/api/src/codegen/ibc/bundle.ts | 70 +- packages/api/src/codegen/ibc/client.ts | 2 +- .../src/codegen/ibc/core/client/v1/client.ts | 237 +- .../src/codegen/ibc/core/client/v1/genesis.ts | 121 +- .../codegen/ibc/core/client/v1/query.lcd.ts | 2 +- .../ibc/core/client/v1/query.rpc.Query.ts | 20 +- .../src/codegen/ibc/core/client/v1/query.ts | 447 ++-- .../codegen/ibc/core/client/v1/tx.rpc.msg.ts | 10 +- .../api/src/codegen/ibc/core/client/v1/tx.ts | 206 +- packages/api/src/codegen/ibc/lcd.ts | 2 +- packages/api/src/codegen/index.ts | 7 +- packages/api/src/codegen/regen/bundle.ts | 196 +- packages/api/src/codegen/regen/client.ts | 2 +- .../api/src/codegen/regen/data/v1/events.ts | 128 +- .../src/codegen/regen/data/v1/query.lcd.ts | 2 +- .../codegen/regen/data/v1/query.rpc.Query.ts | 24 +- .../api/src/codegen/regen/data/v1/query.ts | 691 +++--- .../api/src/codegen/regen/data/v1/state.ts | 193 +- .../src/codegen/regen/data/v1/tx.rpc.msg.ts | 10 +- packages/api/src/codegen/regen/data/v1/tx.ts | 237 +- .../api/src/codegen/regen/data/v1/types.ts | 138 +- .../regen/ecocredit/basket/v1/events.ts | 149 +- .../regen/ecocredit/basket/v1/query.lcd.ts | 2 +- .../ecocredit/basket/v1/query.rpc.Query.ts | 12 +- .../regen/ecocredit/basket/v1/query.ts | 345 +-- .../regen/ecocredit/basket/v1/state.ts | 222 +- .../regen/ecocredit/basket/v1/tx.rpc.msg.ts | 14 +- .../codegen/regen/ecocredit/basket/v1/tx.ts | 367 +-- .../regen/ecocredit/basket/v1/types.ts | 68 +- .../regen/ecocredit/marketplace/v1/events.ts | 182 +- .../ecocredit/marketplace/v1/query.lcd.ts | 2 +- .../marketplace/v1/query.rpc.Query.ts | 12 +- .../regen/ecocredit/marketplace/v1/query.ts | 363 +-- .../regen/ecocredit/marketplace/v1/state.ts | 233 +- .../ecocredit/marketplace/v1/tx.rpc.msg.ts | 14 +- .../regen/ecocredit/marketplace/v1/tx.ts | 474 ++-- .../regen/ecocredit/marketplace/v1/types.ts | 39 +- .../ecocredit/orderbook/v1alpha1/memory.ts | 330 +-- .../src/codegen/regen/ecocredit/v1/events.ts | 534 +++-- .../codegen/regen/ecocredit/v1/query.lcd.ts | 2 +- .../regen/ecocredit/v1/query.rpc.Query.ts | 54 +- .../src/codegen/regen/ecocredit/v1/query.ts | 1443 +++++++----- .../src/codegen/regen/ecocredit/v1/state.ts | 860 ++++--- .../codegen/regen/ecocredit/v1/tx.rpc.msg.ts | 48 +- .../api/src/codegen/regen/ecocredit/v1/tx.ts | 1278 ++++++----- .../src/codegen/regen/ecocredit/v1/types.ts | 244 +- .../regen/ecocredit/v1alpha1/events.ts | 233 +- .../regen/ecocredit/v1alpha1/genesis.ts | 125 +- .../regen/ecocredit/v1alpha1/query.lcd.ts | 2 +- .../ecocredit/v1alpha1/query.rpc.Query.ts | 18 +- .../codegen/regen/ecocredit/v1alpha1/query.ts | 344 +-- .../regen/ecocredit/v1alpha1/tx.rpc.msg.ts | 18 +- .../codegen/regen/ecocredit/v1alpha1/tx.ts | 546 +++-- .../codegen/regen/ecocredit/v1alpha1/types.ts | 297 ++- .../src/codegen/regen/intertx/v1/query.lcd.ts | 2 +- .../regen/intertx/v1/query.rpc.Query.ts | 4 +- .../api/src/codegen/regen/intertx/v1/query.ts | 48 +- .../codegen/regen/intertx/v1/tx.rpc.msg.ts | 6 +- .../api/src/codegen/regen/intertx/v1/tx.ts | 92 +- packages/api/src/codegen/regen/lcd.ts | 2 +- .../api/src/codegen/tendermint/abci/types.ts | 2040 ++++++++++------- packages/api/src/codegen/tendermint/bundle.ts | 38 +- .../api/src/codegen/tendermint/crypto/keys.ts | 29 +- .../src/codegen/tendermint/crypto/proof.ts | 195 +- .../src/codegen/tendermint/libs/bits/types.ts | 61 +- .../api/src/codegen/tendermint/p2p/types.ts | 216 +- .../api/src/codegen/tendermint/types/block.ts | 35 +- .../src/codegen/tendermint/types/evidence.ts | 212 +- .../src/codegen/tendermint/types/params.ts | 290 +-- .../api/src/codegen/tendermint/types/types.ts | 671 +++--- .../src/codegen/tendermint/types/validator.ts | 171 +- .../src/codegen/tendermint/version/types.ts | 106 +- packages/api/src/codegen/utf8.ts | 148 ++ packages/api/src/codegen/varint.ts | 488 ++++ yarn.lock | 500 ++-- 244 files changed, 24720 insertions(+), 16386 deletions(-) create mode 100644 packages/api/proto/google/api/http.proto create mode 100644 packages/api/src/codegen/binary.ts create mode 100644 packages/api/src/codegen/google/api/http.ts create mode 100644 packages/api/src/codegen/utf8.ts create mode 100644 packages/api/src/codegen/varint.ts diff --git a/packages/api/package.json b/packages/api/package.json index 6ed5990c..3d7e4e19 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -39,7 +39,7 @@ "@cosmjs/proto-signing": "^0.31.0", "@cosmjs/stargate": "^0.31.0", "@cosmjs/tendermint-rpc": "^0.31.0", - "@osmonauts/lcd": "^0.11.1", + "@cosmology/lcd": "^0.13.3", "protobufjs": "^7.2.4" }, "devDependencies": { @@ -55,7 +55,7 @@ "@babel/plugin-transform-runtime": "^7.22.5", "@babel/preset-env": "^7.22.5", "@babel/preset-typescript": "^7.22.5", - "@osmonauts/telescope": "^0.99.0", + "@cosmology/telescope": "^1.5.2", "babel-core": "7.0.0-bridge.0", "babel-watch": "^7.8.0", "cross-env": "^7.0.3", diff --git a/packages/api/proto/google/api/http.proto b/packages/api/proto/google/api/http.proto new file mode 100644 index 00000000..31d867a2 --- /dev/null +++ b/packages/api/proto/google/api/http.proto @@ -0,0 +1,379 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They +// are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL +// query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP +// request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax + // details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/packages/api/scripts/codegen.js b/packages/api/scripts/codegen.js index ffe89103..c5cb8c8a 100644 --- a/packages/api/scripts/codegen.js +++ b/packages/api/scripts/codegen.js @@ -1,5 +1,5 @@ import { join } from 'path'; -import telescope from '@osmonauts/telescope'; +import telescope from '@cosmology/telescope'; import { sync as rimraf } from 'rimraf'; import { AMINO_MAP } from './aminos'; diff --git a/packages/api/src/codegen/binary.ts b/packages/api/src/codegen/binary.ts new file mode 100644 index 00000000..e42d4d12 --- /dev/null +++ b/packages/api/src/codegen/binary.ts @@ -0,0 +1,534 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.5.2 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- + +// Code generated by the command line utilities is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +import { utf8Length, utf8Read, utf8Write } from "./utf8"; +import { + int64ToString, + readInt32, + readUInt32, + uInt64ToString, + varint32read, + varint64read, + writeVarint32, + writeVarint64, + int64FromString, + int64Length, + writeFixed32, + writeByte, + zzDecode, + zzEncode, +} from "./varint"; + +export enum WireType { + Varint = 0, + + Fixed64 = 1, + + Bytes = 2, + + Fixed32 = 5, +} + +// Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} + +export class BinaryReader implements IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + + assertBounds(): void { + if (this.pos > this.len) throw new RangeError("premature EOF"); + } + + constructor(buf?: ArrayLike) { + this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0); + this.pos = 0; + this.type = 0; + this.len = this.buf.length; + } + + tag(): [number, WireType, number] { + const tag = this.uint32(), + fieldNo = tag >>> 3, + wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error( + "illegal tag: field no " + fieldNo + " wire type " + wireType + ); + return [fieldNo, wireType, tag]; + } + + skip(length?: number) { + if (typeof length === "number") { + if (this.pos + length > this.len) throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + } + + skipType(wireType: number) { + switch (wireType) { + case WireType.Varint: + this.skip(); + break; + case WireType.Fixed64: + this.skip(8); + break; + case WireType.Bytes: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case WireType.Fixed32: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + } + + uint32(): number { + return varint32read.bind(this)(); + } + + int32(): number { + return this.uint32() | 0; + } + + sint32(): number { + const num = this.uint32(); + return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding + } + + fixed32(): number { + const val = readUInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + sfixed32(): number { + const val = readInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + int64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(int64ToString(lo, hi)); + } + + uint64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(uInt64ToString(lo, hi)); + } + + sint64(): bigint { + let [lo, hi] = varint64read.bind(this)(); + // zig zag + [lo, hi] = zzDecode(lo, hi); + return BigInt(int64ToString(lo, hi)); + } + + fixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(uInt64ToString(lo, hi)); + } + sfixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(int64ToString(lo, hi)); + } + + float(): number { + throw new Error("float not supported"); + } + + double(): number { + throw new Error("double not supported"); + } + + bool(): boolean { + const [lo, hi] = varint64read.bind(this)(); + return lo !== 0 || hi !== 0; + } + + bytes(): Uint8Array { + const len = this.uint32(), + start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + + string(): string { + const bytes = this.bytes(); + return utf8Read(bytes, 0, bytes.length); + } +} + +// Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} + +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} + +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; + len: number; + val: T; + next?: IOp; + + constructor( + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, + len: number, + val: T + ) { + this.fn = fn; + this.len = len; + this.val = val; + } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } +} + +class State { + head: IOp; + tail: IOp; + len: number; + next: State | null; + + constructor(writer: BinaryWriter) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } +} + +export class BinaryWriter implements IBinaryWriter { + len = 0; + head: IOp; + tail: IOp; + states: State | null; + + constructor() { + this.head = new Op(null, 0, 0); + this.tail = this.head; + this.states = null; + } + + static create() { + return new BinaryWriter(); + } + + static alloc(size: number): Uint8Array | number[] { + if (typeof Uint8Array !== "undefined") { + return pool( + (size) => new Uint8Array(size), + Uint8Array.prototype.subarray + )(size); + } else { + return new Array(size); + } + } + + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, + len: number, + val: T + ) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + } + + finish(): Uint8Array { + let head = this.head.next, + pos = 0; + const buf = BinaryWriter.alloc(this.len); + while (head) { + head.proceed(buf, pos); + pos += head.len; + head = head.next; + } + return buf as Uint8Array; + } + + fork(): BinaryWriter { + this.states = new State(this); + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + return this; + } + + reset(): BinaryWriter { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + } + return this; + } + + ldelim(): BinaryWriter { + const head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + } + + tag(fieldNo: number, type: WireType): BinaryWriter { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + + uint32(value: number): BinaryWriter { + this.len += (this.tail = this.tail.next = + new Op( + writeVarint32, + (value = value >>> 0) < 128 + ? 1 + : value < 16384 + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, + value + )).len; + return this; + } + + int32(value: number): BinaryWriter { + return value < 0 + ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec + : this.uint32(value); + } + + sint32(value: number): BinaryWriter { + return this.uint32(((value << 1) ^ (value >> 31)) >>> 0); + } + + int64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + // uint64 is the same with int64 + uint64 = BinaryWriter.prototype.int64; + + sint64(value: string | number | bigint): BinaryWriter { + let { lo, hi } = int64FromString(value.toString()); + // zig zag + [lo, hi] = zzEncode(lo, hi); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + fixed64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi); + } + + // sfixed64 is the same with fixed64 + sfixed64 = BinaryWriter.prototype.fixed64; + + bool(value: boolean): BinaryWriter { + return this._push(writeByte, 1, value ? 1 : 0); + } + + fixed32(value: number): BinaryWriter { + return this._push(writeFixed32, 4, value >>> 0); + } + + // sfixed32 is the same with fixed32 + sfixed32 = BinaryWriter.prototype.fixed32; + + float(value: number): BinaryWriter { + throw new Error("float not supported" + value); + } + + double(value: number): BinaryWriter { + throw new Error("double not supported" + value); + } + + bytes(value: Uint8Array): BinaryWriter { + const len = value.length >>> 0; + if (!len) return this._push(writeByte, 1, 0); + return this.uint32(len)._push(writeBytes, len, value); + } + + string(value: string): BinaryWriter { + const len = utf8Length(value); + return len + ? this.uint32(len)._push(utf8Write, len, value) + : this._push(writeByte, 1, 0); + } +} + +function writeBytes( + val: Uint8Array | number[], + buf: Uint8Array | number[], + pos: number +) { + if (typeof Uint8Array !== "undefined") { + (buf as Uint8Array).set(val, pos); + } else { + for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i]; + } +} + +function pool( + alloc: (size: number) => Uint8Array, + slice: (begin?: number, end?: number) => Uint8Array, + size?: number +): (size: number) => Uint8Array { + const SIZE = size || 8192; + const MAX = SIZE >>> 1; + let slab: Uint8Array | null = null; + let offset = SIZE; + return function pool_alloc(size): Uint8Array { + if (size < 1 || size > MAX) return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + const buf: Uint8Array = slice.call(slab, offset, (offset += size)); + if (offset & 7) + // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +function indexOutOfRange(reader: BinaryReader, writeLength?: number) { + return RangeError( + "index out of range: " + + reader.pos + + " + " + + (writeLength || 1) + + " > " + + reader.len + ); +} diff --git a/packages/api/src/codegen/cosmos/app/module/v1alpha1/module.ts b/packages/api/src/codegen/cosmos/app/module/v1alpha1/module.ts index d3149025..462ad6e1 100644 --- a/packages/api/src/codegen/cosmos/app/module/v1alpha1/module.ts +++ b/packages/api/src/codegen/cosmos/app/module/v1alpha1/module.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; /** Module is the module config object for the cosmos.app v1 app module. */ export interface Module {} export interface ModuleProtoMsg { @@ -17,11 +17,12 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.module.v1alpha1.Module", + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -46,7 +47,8 @@ export const Module = { return message; }, fromAmino(_: ModuleAmino): Module { - return {}; + const message = createBaseModule(); + return message; }, toAmino(_: Module): ModuleAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/app/v1alpha1/config.ts b/packages/api/src/codegen/cosmos/app/v1alpha1/config.ts index 490506bf..addaed85 100644 --- a/packages/api/src/codegen/cosmos/app/v1alpha1/config.ts +++ b/packages/api/src/codegen/cosmos/app/v1alpha1/config.ts @@ -1,5 +1,5 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * Config represents the configuration for a Cosmos SDK ABCI app. @@ -29,7 +29,7 @@ export interface ConfigProtoMsg { */ export interface ConfigAmino { /** modules are the module configurations for the app. */ - modules: ModuleConfigAmino[]; + modules?: ModuleConfigAmino[]; } export interface ConfigAminoMsg { type: "cosmos-sdk/Config"; @@ -66,7 +66,7 @@ export interface ModuleConfig { * config is the config object for the module. Module config messages should * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. */ - config: Any; + config?: Any; } export interface ModuleConfigProtoMsg { typeUrl: "/cosmos.app.v1alpha1.ModuleConfig"; @@ -86,7 +86,7 @@ export interface ModuleConfigAmino { * that the v1 module had. Note: modules should provide info on which versions * they can migrate from in the ModuleDescriptor.can_migration_from field. */ - name: string; + name?: string; /** * config is the config object for the module. Module config messages should * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. @@ -100,7 +100,7 @@ export interface ModuleConfigAminoMsg { /** ModuleConfig is a module configuration for an app. */ export interface ModuleConfigSDKType { name: string; - config: AnySDKType; + config?: AnySDKType; } function createBaseConfig(): Config { return { @@ -108,14 +108,15 @@ function createBaseConfig(): Config { }; } export const Config = { - encode(message: Config, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.v1alpha1.Config", + encode(message: Config, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.modules) { ModuleConfig.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Config { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Config { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfig(); while (reader.pos < end) { @@ -151,16 +152,16 @@ export const Config = { return message; }, fromAmino(object: ConfigAmino): Config { - return { - modules: Array.isArray(object?.modules) ? object.modules.map((e: any) => ModuleConfig.fromAmino(e)) : [] - }; + const message = createBaseConfig(); + message.modules = object.modules?.map(e => ModuleConfig.fromAmino(e)) || []; + return message; }, toAmino(message: Config): ConfigAmino { const obj: any = {}; if (message.modules) { obj.modules = message.modules.map(e => e ? ModuleConfig.toAmino(e) : undefined); } else { - obj.modules = []; + obj.modules = message.modules; } return obj; }, @@ -193,7 +194,8 @@ function createBaseModuleConfig(): ModuleConfig { }; } export const ModuleConfig = { - encode(message: ModuleConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.v1alpha1.ModuleConfig", + encode(message: ModuleConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -202,8 +204,8 @@ export const ModuleConfig = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleConfig(); while (reader.pos < end) { @@ -241,14 +243,18 @@ export const ModuleConfig = { return message; }, fromAmino(object: ModuleConfigAmino): ModuleConfig { - return { - name: object.name, - config: object?.config ? Any.fromAmino(object.config) : undefined - }; + const message = createBaseModuleConfig(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.config !== undefined && object.config !== null) { + message.config = Any.fromAmino(object.config); + } + return message; }, toAmino(message: ModuleConfig): ModuleConfigAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; obj.config = message.config ? Any.toAmino(message.config) : undefined; return obj; }, diff --git a/packages/api/src/codegen/cosmos/app/v1alpha1/module.ts b/packages/api/src/codegen/cosmos/app/v1alpha1/module.ts index b6ae5f68..43aa136d 100644 --- a/packages/api/src/codegen/cosmos/app/v1alpha1/module.ts +++ b/packages/api/src/codegen/cosmos/app/v1alpha1/module.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** ModuleDescriptor describes an app module. */ export interface ModuleDescriptor { @@ -37,14 +37,14 @@ export interface ModuleDescriptorAmino { * module in the runtime module registry. It is required to make debugging * of configuration errors easier for users. */ - go_import: string; + go_import?: string; /** * use_package refers to a protobuf package that this module * uses and exposes to the world. In an app, only one module should "use" * or own a single protobuf package. It is assumed that the module uses * all of the .proto files in a single package. */ - use_package: PackageReferenceAmino[]; + use_package?: PackageReferenceAmino[]; /** * can_migrate_from defines which module versions this module can migrate * state from. The framework will check that one module version is able to @@ -54,7 +54,7 @@ export interface ModuleDescriptorAmino { * declares it can migrate from v1, the framework knows how to migrate * from v1 to v3, assuming all 3 module versions are registered at runtime. */ - can_migrate_from: MigrateFromInfoAmino[]; + can_migrate_from?: MigrateFromInfoAmino[]; } export interface ModuleDescriptorAminoMsg { type: "cosmos-sdk/ModuleDescriptor"; @@ -116,7 +116,7 @@ export interface PackageReferenceProtoMsg { /** PackageReference is a reference to a protobuf package used by a module. */ export interface PackageReferenceAmino { /** name is the fully-qualified name of the package. */ - name: string; + name?: string; /** * revision is the optional revision of the package that is being used. * Protobuf packages used in Cosmos should generally have a major version @@ -154,7 +154,7 @@ export interface PackageReferenceAmino { * are important good client UX * * protobuf files are changed in backwards and forwards compatible ways */ - revision: number; + revision?: number; } export interface PackageReferenceAminoMsg { type: "cosmos-sdk/PackageReference"; @@ -189,7 +189,7 @@ export interface MigrateFromInfoAmino { * module is the fully-qualified protobuf name of the module config object * for the previous module version, ex: "cosmos.group.module.v1.Module". */ - module: string; + module?: string; } export interface MigrateFromInfoAminoMsg { type: "cosmos-sdk/MigrateFromInfo"; @@ -210,7 +210,8 @@ function createBaseModuleDescriptor(): ModuleDescriptor { }; } export const ModuleDescriptor = { - encode(message: ModuleDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + encode(message: ModuleDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.goImport !== "") { writer.uint32(10).string(message.goImport); } @@ -222,8 +223,8 @@ export const ModuleDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleDescriptor(); while (reader.pos < end) { @@ -275,24 +276,26 @@ export const ModuleDescriptor = { return message; }, fromAmino(object: ModuleDescriptorAmino): ModuleDescriptor { - return { - goImport: object.go_import, - usePackage: Array.isArray(object?.use_package) ? object.use_package.map((e: any) => PackageReference.fromAmino(e)) : [], - canMigrateFrom: Array.isArray(object?.can_migrate_from) ? object.can_migrate_from.map((e: any) => MigrateFromInfo.fromAmino(e)) : [] - }; + const message = createBaseModuleDescriptor(); + if (object.go_import !== undefined && object.go_import !== null) { + message.goImport = object.go_import; + } + message.usePackage = object.use_package?.map(e => PackageReference.fromAmino(e)) || []; + message.canMigrateFrom = object.can_migrate_from?.map(e => MigrateFromInfo.fromAmino(e)) || []; + return message; }, toAmino(message: ModuleDescriptor): ModuleDescriptorAmino { const obj: any = {}; - obj.go_import = message.goImport; + obj.go_import = message.goImport === "" ? undefined : message.goImport; if (message.usePackage) { obj.use_package = message.usePackage.map(e => e ? PackageReference.toAmino(e) : undefined); } else { - obj.use_package = []; + obj.use_package = message.usePackage; } if (message.canMigrateFrom) { obj.can_migrate_from = message.canMigrateFrom.map(e => e ? MigrateFromInfo.toAmino(e) : undefined); } else { - obj.can_migrate_from = []; + obj.can_migrate_from = message.canMigrateFrom; } return obj; }, @@ -325,7 +328,8 @@ function createBasePackageReference(): PackageReference { }; } export const PackageReference = { - encode(message: PackageReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + encode(message: PackageReference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -334,8 +338,8 @@ export const PackageReference = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PackageReference { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PackageReference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePackageReference(); while (reader.pos < end) { @@ -373,15 +377,19 @@ export const PackageReference = { return message; }, fromAmino(object: PackageReferenceAmino): PackageReference { - return { - name: object.name, - revision: object.revision - }; + const message = createBasePackageReference(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.revision !== undefined && object.revision !== null) { + message.revision = object.revision; + } + return message; }, toAmino(message: PackageReference): PackageReferenceAmino { const obj: any = {}; - obj.name = message.name; - obj.revision = message.revision; + obj.name = message.name === "" ? undefined : message.name; + obj.revision = message.revision === 0 ? undefined : message.revision; return obj; }, fromAminoMsg(object: PackageReferenceAminoMsg): PackageReference { @@ -412,14 +420,15 @@ function createBaseMigrateFromInfo(): MigrateFromInfo { }; } export const MigrateFromInfo = { - encode(message: MigrateFromInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + encode(message: MigrateFromInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.module !== "") { writer.uint32(10).string(message.module); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MigrateFromInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MigrateFromInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMigrateFromInfo(); while (reader.pos < end) { @@ -451,13 +460,15 @@ export const MigrateFromInfo = { return message; }, fromAmino(object: MigrateFromInfoAmino): MigrateFromInfo { - return { - module: object.module - }; + const message = createBaseMigrateFromInfo(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + return message; }, toAmino(message: MigrateFromInfo): MigrateFromInfoAmino { const obj: any = {}; - obj.module = message.module; + obj.module = message.module === "" ? undefined : message.module; return obj; }, fromAminoMsg(object: MigrateFromInfoAminoMsg): MigrateFromInfo { diff --git a/packages/api/src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts index d981a2aa..7aaf4092 100644 --- a/packages/api/src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryConfigRequest, QueryConfigResponse } from "./query"; /** Query is the app module query service. */ @@ -16,7 +16,7 @@ export class QueryClientImpl implements Query { config(request: QueryConfigRequest = {}): Promise { const data = QueryConfigRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.app.v1alpha1.Query", "Config", data); - return promise.then(data => QueryConfigResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryConfigResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/app/v1alpha1/query.ts b/packages/api/src/codegen/cosmos/app/v1alpha1/query.ts index f18300c0..33f9e4ce 100644 --- a/packages/api/src/codegen/cosmos/app/v1alpha1/query.ts +++ b/packages/api/src/codegen/cosmos/app/v1alpha1/query.ts @@ -1,5 +1,5 @@ import { Config, ConfigAmino, ConfigSDKType } from "./config"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** QueryConfigRequest is the Query/Config request type. */ export interface QueryConfigRequest {} @@ -18,7 +18,7 @@ export interface QueryConfigRequestSDKType {} /** QueryConfigRequest is the Query/Config response type. */ export interface QueryConfigResponse { /** config is the current app config. */ - config: Config; + config?: Config; } export interface QueryConfigResponseProtoMsg { typeUrl: "/cosmos.app.v1alpha1.QueryConfigResponse"; @@ -35,17 +35,18 @@ export interface QueryConfigResponseAminoMsg { } /** QueryConfigRequest is the Query/Config response type. */ export interface QueryConfigResponseSDKType { - config: ConfigSDKType; + config?: ConfigSDKType; } function createBaseQueryConfigRequest(): QueryConfigRequest { return {}; } export const QueryConfigRequest = { - encode(_: QueryConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigRequest", + encode(_: QueryConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConfigRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConfigRequest(); while (reader.pos < end) { @@ -70,7 +71,8 @@ export const QueryConfigRequest = { return message; }, fromAmino(_: QueryConfigRequestAmino): QueryConfigRequest { - return {}; + const message = createBaseQueryConfigRequest(); + return message; }, toAmino(_: QueryConfigRequest): QueryConfigRequestAmino { const obj: any = {}; @@ -100,18 +102,19 @@ export const QueryConfigRequest = { }; function createBaseQueryConfigResponse(): QueryConfigResponse { return { - config: Config.fromPartial({}) + config: undefined }; } export const QueryConfigResponse = { - encode(message: QueryConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigResponse", + encode(message: QueryConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.config !== undefined) { Config.encode(message.config, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConfigResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConfigResponse(); while (reader.pos < end) { @@ -143,9 +146,11 @@ export const QueryConfigResponse = { return message; }, fromAmino(object: QueryConfigResponseAmino): QueryConfigResponse { - return { - config: object?.config ? Config.fromAmino(object.config) : undefined - }; + const message = createBaseQueryConfigResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = Config.fromAmino(object.config); + } + return message; }, toAmino(message: QueryConfigResponse): QueryConfigResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/auth/v1beta1/auth.ts b/packages/api/src/codegen/cosmos/auth/v1beta1/auth.ts index 5a5e90b4..8c7e85af 100644 --- a/packages/api/src/codegen/cosmos/auth/v1beta1/auth.ts +++ b/packages/api/src/codegen/cosmos/auth/v1beta1/auth.ts @@ -1,17 +1,17 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** * BaseAccount defines a base account type. It contains all the necessary fields * for basic account functionality. Any custom account type should extend this * type for additional functionality (e.g. vesting). */ export interface BaseAccount { - $typeUrl?: string; + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; address: string; - pubKey: Any; - accountNumber: Long; - sequence: Long; + pubKey?: Any; + accountNumber: bigint; + sequence: bigint; } export interface BaseAccountProtoMsg { typeUrl: "/cosmos.auth.v1beta1.BaseAccount"; @@ -23,10 +23,10 @@ export interface BaseAccountProtoMsg { * type for additional functionality (e.g. vesting). */ export interface BaseAccountAmino { - address: string; + address?: string; pub_key?: AnyAmino; - account_number: string; - sequence: string; + account_number?: string; + sequence?: string; } export interface BaseAccountAminoMsg { type: "cosmos-sdk/BaseAccount"; @@ -38,16 +38,16 @@ export interface BaseAccountAminoMsg { * type for additional functionality (e.g. vesting). */ export interface BaseAccountSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; address: string; - pub_key: AnySDKType; - account_number: Long; - sequence: Long; + pub_key?: AnySDKType; + account_number: bigint; + sequence: bigint; } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { - $typeUrl?: string; - baseAccount: BaseAccount; + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + baseAccount?: BaseAccount; name: string; permissions: string[]; } @@ -58,8 +58,8 @@ export interface ModuleAccountProtoMsg { /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccountAmino { base_account?: BaseAccountAmino; - name: string; - permissions: string[]; + name?: string; + permissions?: string[]; } export interface ModuleAccountAminoMsg { type: "cosmos-sdk/ModuleAccount"; @@ -67,18 +67,18 @@ export interface ModuleAccountAminoMsg { } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccountSDKType { - $typeUrl?: string; - base_account: BaseAccountSDKType; + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + base_account?: BaseAccountSDKType; name: string; permissions: string[]; } /** Params defines the parameters for the auth module. */ export interface Params { - maxMemoCharacters: Long; - txSigLimit: Long; - txSizeCostPerByte: Long; - sigVerifyCostEd25519: Long; - sigVerifyCostSecp256k1: Long; + maxMemoCharacters: bigint; + txSigLimit: bigint; + txSizeCostPerByte: bigint; + sigVerifyCostEd25519: bigint; + sigVerifyCostSecp256k1: bigint; } export interface ParamsProtoMsg { typeUrl: "/cosmos.auth.v1beta1.Params"; @@ -86,11 +86,11 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the auth module. */ export interface ParamsAmino { - max_memo_characters: string; - tx_sig_limit: string; - tx_size_cost_per_byte: string; - sig_verify_cost_ed25519: string; - sig_verify_cost_secp256k1: string; + max_memo_characters?: string; + tx_sig_limit?: string; + tx_size_cost_per_byte?: string; + sig_verify_cost_ed25519?: string; + sig_verify_cost_secp256k1?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -98,39 +98,40 @@ export interface ParamsAminoMsg { } /** Params defines the parameters for the auth module. */ export interface ParamsSDKType { - max_memo_characters: Long; - tx_sig_limit: Long; - tx_size_cost_per_byte: Long; - sig_verify_cost_ed25519: Long; - sig_verify_cost_secp256k1: Long; + max_memo_characters: bigint; + tx_sig_limit: bigint; + tx_size_cost_per_byte: bigint; + sig_verify_cost_ed25519: bigint; + sig_verify_cost_secp256k1: bigint; } function createBaseBaseAccount(): BaseAccount { return { $typeUrl: "/cosmos.auth.v1beta1.BaseAccount", address: "", pubKey: undefined, - accountNumber: Long.UZERO, - sequence: Long.UZERO + accountNumber: BigInt(0), + sequence: BigInt(0) }; } export const BaseAccount = { - encode(message: BaseAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + encode(message: BaseAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pubKey !== undefined) { Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (!message.accountNumber.isZero()) { + if (message.accountNumber !== BigInt(0)) { writer.uint32(24).uint64(message.accountNumber); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(32).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BaseAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBaseAccount(); while (reader.pos < end) { @@ -143,10 +144,10 @@ export const BaseAccount = { message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: - message.accountNumber = (reader.uint64() as Long); + message.accountNumber = reader.uint64(); break; case 4: - message.sequence = (reader.uint64() as Long); + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -159,40 +160,48 @@ export const BaseAccount = { return { address: isSet(object.address) ? String(object.address) : "", pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, - accountNumber: isSet(object.accountNumber) ? Long.fromValue(object.accountNumber) : Long.UZERO, - sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO + accountNumber: isSet(object.accountNumber) ? BigInt(object.accountNumber.toString()) : BigInt(0), + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) }; }, toJSON(message: BaseAccount): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); - message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): BaseAccount { const message = createBaseBaseAccount(); message.address = object.address ?? ""; message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; - message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? Long.fromValue(object.accountNumber) : Long.UZERO; - message.sequence = object.sequence !== undefined && object.sequence !== null ? Long.fromValue(object.sequence) : Long.UZERO; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); return message; }, fromAmino(object: BaseAccountAmino): BaseAccount { - return { - address: object.address, - pubKey: object?.pub_key ? Any.fromAmino(object.pub_key) : undefined, - accountNumber: Long.fromString(object.account_number), - sequence: Long.fromString(object.sequence) - }; + const message = createBaseBaseAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: BaseAccount): BaseAccountAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; - obj.account_number = message.accountNumber ? message.accountNumber.toString() : undefined; - obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; return obj; }, fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { @@ -220,13 +229,14 @@ export const BaseAccount = { function createBaseModuleAccount(): ModuleAccount { return { $typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", - baseAccount: BaseAccount.fromPartial({}), + baseAccount: undefined, name: "", permissions: [] }; } export const ModuleAccount = { - encode(message: ModuleAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + encode(message: ModuleAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } @@ -238,8 +248,8 @@ export const ModuleAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleAccount(); while (reader.pos < end) { @@ -287,20 +297,24 @@ export const ModuleAccount = { return message; }, fromAmino(object: ModuleAccountAmino): ModuleAccount { - return { - baseAccount: object?.base_account ? BaseAccount.fromAmino(object.base_account) : undefined, - name: object.name, - permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => e) : [] - }; + const message = createBaseModuleAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.permissions = object.permissions?.map(e => e) || []; + return message; }, toAmino(message: ModuleAccount): ModuleAccountAmino { const obj: any = {}; obj.base_account = message.baseAccount ? BaseAccount.toAmino(message.baseAccount) : undefined; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; if (message.permissions) { obj.permissions = message.permissions.map(e => e); } else { - obj.permissions = []; + obj.permissions = message.permissions; } return obj; }, @@ -328,53 +342,54 @@ export const ModuleAccount = { }; function createBaseParams(): Params { return { - maxMemoCharacters: Long.UZERO, - txSigLimit: Long.UZERO, - txSizeCostPerByte: Long.UZERO, - sigVerifyCostEd25519: Long.UZERO, - sigVerifyCostSecp256k1: Long.UZERO + maxMemoCharacters: BigInt(0), + txSigLimit: BigInt(0), + txSizeCostPerByte: BigInt(0), + sigVerifyCostEd25519: BigInt(0), + sigVerifyCostSecp256k1: BigInt(0) }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxMemoCharacters.isZero()) { + typeUrl: "/cosmos.auth.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxMemoCharacters !== BigInt(0)) { writer.uint32(8).uint64(message.maxMemoCharacters); } - if (!message.txSigLimit.isZero()) { + if (message.txSigLimit !== BigInt(0)) { writer.uint32(16).uint64(message.txSigLimit); } - if (!message.txSizeCostPerByte.isZero()) { + if (message.txSizeCostPerByte !== BigInt(0)) { writer.uint32(24).uint64(message.txSizeCostPerByte); } - if (!message.sigVerifyCostEd25519.isZero()) { + if (message.sigVerifyCostEd25519 !== BigInt(0)) { writer.uint32(32).uint64(message.sigVerifyCostEd25519); } - if (!message.sigVerifyCostSecp256k1.isZero()) { + if (message.sigVerifyCostSecp256k1 !== BigInt(0)) { writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxMemoCharacters = (reader.uint64() as Long); + message.maxMemoCharacters = reader.uint64(); break; case 2: - message.txSigLimit = (reader.uint64() as Long); + message.txSigLimit = reader.uint64(); break; case 3: - message.txSizeCostPerByte = (reader.uint64() as Long); + message.txSizeCostPerByte = reader.uint64(); break; case 4: - message.sigVerifyCostEd25519 = (reader.uint64() as Long); + message.sigVerifyCostEd25519 = reader.uint64(); break; case 5: - message.sigVerifyCostSecp256k1 = (reader.uint64() as Long); + message.sigVerifyCostSecp256k1 = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -385,47 +400,57 @@ export const Params = { }, fromJSON(object: any): Params { return { - maxMemoCharacters: isSet(object.maxMemoCharacters) ? Long.fromValue(object.maxMemoCharacters) : Long.UZERO, - txSigLimit: isSet(object.txSigLimit) ? Long.fromValue(object.txSigLimit) : Long.UZERO, - txSizeCostPerByte: isSet(object.txSizeCostPerByte) ? Long.fromValue(object.txSizeCostPerByte) : Long.UZERO, - sigVerifyCostEd25519: isSet(object.sigVerifyCostEd25519) ? Long.fromValue(object.sigVerifyCostEd25519) : Long.UZERO, - sigVerifyCostSecp256k1: isSet(object.sigVerifyCostSecp256k1) ? Long.fromValue(object.sigVerifyCostSecp256k1) : Long.UZERO + maxMemoCharacters: isSet(object.maxMemoCharacters) ? BigInt(object.maxMemoCharacters.toString()) : BigInt(0), + txSigLimit: isSet(object.txSigLimit) ? BigInt(object.txSigLimit.toString()) : BigInt(0), + txSizeCostPerByte: isSet(object.txSizeCostPerByte) ? BigInt(object.txSizeCostPerByte.toString()) : BigInt(0), + sigVerifyCostEd25519: isSet(object.sigVerifyCostEd25519) ? BigInt(object.sigVerifyCostEd25519.toString()) : BigInt(0), + sigVerifyCostSecp256k1: isSet(object.sigVerifyCostSecp256k1) ? BigInt(object.sigVerifyCostSecp256k1.toString()) : BigInt(0) }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.maxMemoCharacters !== undefined && (obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString()); - message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString()); - message.txSizeCostPerByte !== undefined && (obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString()); - message.sigVerifyCostEd25519 !== undefined && (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || Long.UZERO).toString()); - message.sigVerifyCostSecp256k1 !== undefined && (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || Long.UZERO).toString()); + message.maxMemoCharacters !== undefined && (obj.maxMemoCharacters = (message.maxMemoCharacters || BigInt(0)).toString()); + message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || BigInt(0)).toString()); + message.txSizeCostPerByte !== undefined && (obj.txSizeCostPerByte = (message.txSizeCostPerByte || BigInt(0)).toString()); + message.sigVerifyCostEd25519 !== undefined && (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || BigInt(0)).toString()); + message.sigVerifyCostSecp256k1 !== undefined && (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Params { const message = createBaseParams(); - message.maxMemoCharacters = object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null ? Long.fromValue(object.maxMemoCharacters) : Long.UZERO; - message.txSigLimit = object.txSigLimit !== undefined && object.txSigLimit !== null ? Long.fromValue(object.txSigLimit) : Long.UZERO; - message.txSizeCostPerByte = object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null ? Long.fromValue(object.txSizeCostPerByte) : Long.UZERO; - message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null ? Long.fromValue(object.sigVerifyCostEd25519) : Long.UZERO; - message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null ? Long.fromValue(object.sigVerifyCostSecp256k1) : Long.UZERO; + message.maxMemoCharacters = object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null ? BigInt(object.maxMemoCharacters.toString()) : BigInt(0); + message.txSigLimit = object.txSigLimit !== undefined && object.txSigLimit !== null ? BigInt(object.txSigLimit.toString()) : BigInt(0); + message.txSizeCostPerByte = object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null ? BigInt(object.txSizeCostPerByte.toString()) : BigInt(0); + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null ? BigInt(object.sigVerifyCostEd25519.toString()) : BigInt(0); + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null ? BigInt(object.sigVerifyCostSecp256k1.toString()) : BigInt(0); return message; }, fromAmino(object: ParamsAmino): Params { - return { - maxMemoCharacters: Long.fromString(object.max_memo_characters), - txSigLimit: Long.fromString(object.tx_sig_limit), - txSizeCostPerByte: Long.fromString(object.tx_size_cost_per_byte), - sigVerifyCostEd25519: Long.fromString(object.sig_verify_cost_ed25519), - sigVerifyCostSecp256k1: Long.fromString(object.sig_verify_cost_secp256k1) - }; + const message = createBaseParams(); + if (object.max_memo_characters !== undefined && object.max_memo_characters !== null) { + message.maxMemoCharacters = BigInt(object.max_memo_characters); + } + if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { + message.txSigLimit = BigInt(object.tx_sig_limit); + } + if (object.tx_size_cost_per_byte !== undefined && object.tx_size_cost_per_byte !== null) { + message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); + } + if (object.sig_verify_cost_ed25519 !== undefined && object.sig_verify_cost_ed25519 !== null) { + message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); + } + if (object.sig_verify_cost_secp256k1 !== undefined && object.sig_verify_cost_secp256k1 !== null) { + message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.max_memo_characters = message.maxMemoCharacters ? message.maxMemoCharacters.toString() : undefined; - obj.tx_sig_limit = message.txSigLimit ? message.txSigLimit.toString() : undefined; - obj.tx_size_cost_per_byte = message.txSizeCostPerByte ? message.txSizeCostPerByte.toString() : undefined; - obj.sig_verify_cost_ed25519 = message.sigVerifyCostEd25519 ? message.sigVerifyCostEd25519.toString() : undefined; - obj.sig_verify_cost_secp256k1 = message.sigVerifyCostSecp256k1 ? message.sigVerifyCostSecp256k1.toString() : undefined; + obj.max_memo_characters = message.maxMemoCharacters !== BigInt(0) ? message.maxMemoCharacters.toString() : undefined; + obj.tx_sig_limit = message.txSigLimit !== BigInt(0) ? message.txSigLimit.toString() : undefined; + obj.tx_size_cost_per_byte = message.txSizeCostPerByte !== BigInt(0) ? message.txSizeCostPerByte.toString() : undefined; + obj.sig_verify_cost_ed25519 = message.sigVerifyCostEd25519 !== BigInt(0) ? message.sigVerifyCostEd25519.toString() : undefined; + obj.sig_verify_cost_secp256k1 = message.sigVerifyCostSecp256k1 !== BigInt(0) ? message.sigVerifyCostSecp256k1.toString() : undefined; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/api/src/codegen/cosmos/auth/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/auth/v1beta1/genesis.ts index 7efebfa0..ee4869df 100644 --- a/packages/api/src/codegen/cosmos/auth/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/auth/v1beta1/genesis.ts @@ -1,6 +1,6 @@ import { Params, ParamsAmino, ParamsSDKType } from "./auth"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { @@ -18,7 +18,7 @@ export interface GenesisStateAmino { /** params defines all the paramaters of the module. */ params?: ParamsAmino; /** accounts are the accounts present at genesis. */ - accounts: AnyAmino[]; + accounts?: AnyAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -36,7 +36,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -45,8 +46,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -88,10 +89,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.accounts = object.accounts?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -99,7 +102,7 @@ export const GenesisState = { if (message.accounts) { obj.accounts = message.accounts.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.accounts = []; + obj.accounts = message.accounts; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/auth/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/auth/v1beta1/query.lcd.ts index d093cdc4..48a724b1 100644 --- a/packages/api/src/codegen/cosmos/auth/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/auth/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryAccountsRequest, QueryAccountsResponseSDKType, QueryAccountRequest, QueryAccountResponseSDKType, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryModuleAccountsRequest, QueryModuleAccountsResponseSDKType, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponseSDKType, Bech32PrefixRequest, Bech32PrefixResponseSDKType, AddressBytesToStringRequest, AddressBytesToStringResponseSDKType, AddressStringToBytesRequest, AddressStringToBytesResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts index 49287afd..c57bccdd 100644 --- a/packages/api/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -66,47 +66,47 @@ export class QueryClientImpl implements Query { }): Promise { const data = QueryAccountsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data); - return promise.then(data => QueryAccountsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAccountsResponse.decode(new BinaryReader(data))); } account(request: QueryAccountRequest): Promise { const data = QueryAccountRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); - return promise.then(data => QueryAccountResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAccountResponse.decode(new BinaryReader(data))); } accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { const data = QueryAccountAddressByIDRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountAddressByID", data); - return promise.then(data => QueryAccountAddressByIDResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAccountAddressByIDResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } moduleAccounts(request: QueryModuleAccountsRequest = {}): Promise { const data = QueryModuleAccountsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccounts", data); - return promise.then(data => QueryModuleAccountsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryModuleAccountsResponse.decode(new BinaryReader(data))); } moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise { const data = QueryModuleAccountByNameRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccountByName", data); - return promise.then(data => QueryModuleAccountByNameResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryModuleAccountByNameResponse.decode(new BinaryReader(data))); } bech32Prefix(request: Bech32PrefixRequest = {}): Promise { const data = Bech32PrefixRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Bech32Prefix", data); - return promise.then(data => Bech32PrefixResponse.decode(new _m0.Reader(data))); + return promise.then(data => Bech32PrefixResponse.decode(new BinaryReader(data))); } addressBytesToString(request: AddressBytesToStringRequest): Promise { const data = AddressBytesToStringRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressBytesToString", data); - return promise.then(data => AddressBytesToStringResponse.decode(new _m0.Reader(data))); + return promise.then(data => AddressBytesToStringResponse.decode(new BinaryReader(data))); } addressStringToBytes(request: AddressStringToBytesRequest): Promise { const data = AddressStringToBytesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressStringToBytes", data); - return promise.then(data => AddressStringToBytesResponse.decode(new _m0.Reader(data))); + return promise.then(data => AddressStringToBytesResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/auth/v1beta1/query.ts b/packages/api/src/codegen/cosmos/auth/v1beta1/query.ts index 90bb7018..7e0c7e69 100644 --- a/packages/api/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/auth/v1beta1/query.ts @@ -1,8 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountSDKType, ModuleAccount, ModuleAccountProtoMsg, ModuleAccountSDKType } from "./auth"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. * @@ -10,7 +10,7 @@ import * as _m0 from "protobufjs/minimal"; */ export interface QueryAccountsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAccountsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; @@ -35,7 +35,7 @@ export interface QueryAccountsRequestAminoMsg { * Since: cosmos-sdk 0.43 */ export interface QueryAccountsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAccountsResponse is the response type for the Query/Accounts RPC method. @@ -46,7 +46,7 @@ export interface QueryAccountsResponse { /** accounts are the existing accounts */ accounts: (BaseAccount & Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAccountsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; @@ -62,7 +62,7 @@ export type QueryAccountsResponseEncoded = Omit>> 3) { case 1: - message.accounts.push((AccountI_InterfaceDecoder(reader) as Any)); + message.accounts.push((Any.decode(reader, reader.uint32()) as Any)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -661,17 +665,19 @@ export const QueryAccountsResponse = { return message; }, fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => AccountI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => AccountI_FromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { const obj: any = {}; if (message.accounts) { obj.accounts = message.accounts.map(e => e ? AccountI_ToAmino((e as Any)) : undefined); } else { - obj.accounts = []; + obj.accounts = message.accounts; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -704,14 +710,15 @@ function createBaseQueryAccountRequest(): QueryAccountRequest { }; } export const QueryAccountRequest = { - encode(message: QueryAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest", + encode(message: QueryAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountRequest(); while (reader.pos < end) { @@ -743,13 +750,15 @@ export const QueryAccountRequest = { return message; }, fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest { - return { - address: object.address - }; + const message = createBaseQueryAccountRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryAccountRequest): QueryAccountRequestAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: QueryAccountRequestAminoMsg): QueryAccountRequest { @@ -780,14 +789,15 @@ function createBaseQueryAccountResponse(): QueryAccountResponse { }; } export const QueryAccountResponse = { - encode(message: QueryAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== undefined) { Any.encode((message.account as Any), writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountResponse(); while (reader.pos < end) { @@ -819,9 +829,11 @@ export const QueryAccountResponse = { return message; }, fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse { - return { - account: object?.account ? AccountI_FromAmino(object.account) : undefined - }; + const message = createBaseQueryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = AccountI_FromAmino(object.account); + } + return message; }, toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { const obj: any = {}; @@ -854,11 +866,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -883,7 +896,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -917,14 +931,15 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -956,9 +971,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -991,11 +1008,12 @@ function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { return {}; } export const QueryModuleAccountsRequest = { - encode(_: QueryModuleAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + encode(_: QueryModuleAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountsRequest(); while (reader.pos < end) { @@ -1020,7 +1038,8 @@ export const QueryModuleAccountsRequest = { return message; }, fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { - return {}; + const message = createBaseQueryModuleAccountsRequest(); + return message; }, toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { const obj: any = {}; @@ -1054,21 +1073,22 @@ function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { }; } export const QueryModuleAccountsResponse = { - encode(message: QueryModuleAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push((ModuleAccountI_InterfaceDecoder(reader) as Any)); + message.accounts.push((Any.decode(reader, reader.uint32()) as Any)); break; default: reader.skipType(tag & 7); @@ -1097,16 +1117,16 @@ export const QueryModuleAccountsResponse = { return message; }, fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => ModuleAccountI_FromAmino(e)) : [] - }; + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => ModuleAccountI_FromAmino(e)) || []; + return message; }, toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { const obj: any = {}; if (message.accounts) { obj.accounts = message.accounts.map(e => e ? ModuleAccountI_ToAmino((e as Any)) : undefined); } else { - obj.accounts = []; + obj.accounts = message.accounts; } return obj; }, @@ -1138,14 +1158,15 @@ function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRe }; } export const QueryModuleAccountByNameRequest = { - encode(message: QueryModuleAccountByNameRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + encode(message: QueryModuleAccountByNameRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountByNameRequest(); while (reader.pos < end) { @@ -1177,13 +1198,15 @@ export const QueryModuleAccountByNameRequest = { return message; }, fromAmino(object: QueryModuleAccountByNameRequestAmino): QueryModuleAccountByNameRequest { - return { - name: object.name - }; + const message = createBaseQueryModuleAccountByNameRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; return obj; }, fromAminoMsg(object: QueryModuleAccountByNameRequestAminoMsg): QueryModuleAccountByNameRequest { @@ -1214,14 +1237,15 @@ function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameR }; } export const QueryModuleAccountByNameResponse = { - encode(message: QueryModuleAccountByNameResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== undefined) { Any.encode((message.account as Any), writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountByNameResponse(); while (reader.pos < end) { @@ -1253,9 +1277,11 @@ export const QueryModuleAccountByNameResponse = { return message; }, fromAmino(object: QueryModuleAccountByNameResponseAmino): QueryModuleAccountByNameResponse { - return { - account: object?.account ? ModuleAccountI_FromAmino(object.account) : undefined - }; + const message = createBaseQueryModuleAccountByNameResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = ModuleAccountI_FromAmino(object.account); + } + return message; }, toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { const obj: any = {}; @@ -1288,11 +1314,12 @@ function createBaseBech32PrefixRequest(): Bech32PrefixRequest { return {}; } export const Bech32PrefixRequest = { - encode(_: Bech32PrefixRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + encode(_: Bech32PrefixRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Bech32PrefixRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBech32PrefixRequest(); while (reader.pos < end) { @@ -1317,7 +1344,8 @@ export const Bech32PrefixRequest = { return message; }, fromAmino(_: Bech32PrefixRequestAmino): Bech32PrefixRequest { - return {}; + const message = createBaseBech32PrefixRequest(); + return message; }, toAmino(_: Bech32PrefixRequest): Bech32PrefixRequestAmino { const obj: any = {}; @@ -1351,14 +1379,15 @@ function createBaseBech32PrefixResponse(): Bech32PrefixResponse { }; } export const Bech32PrefixResponse = { - encode(message: Bech32PrefixResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + encode(message: Bech32PrefixResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bech32Prefix !== "") { writer.uint32(10).string(message.bech32Prefix); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Bech32PrefixResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBech32PrefixResponse(); while (reader.pos < end) { @@ -1390,13 +1419,15 @@ export const Bech32PrefixResponse = { return message; }, fromAmino(object: Bech32PrefixResponseAmino): Bech32PrefixResponse { - return { - bech32Prefix: object.bech32_prefix - }; + const message = createBaseBech32PrefixResponse(); + if (object.bech32_prefix !== undefined && object.bech32_prefix !== null) { + message.bech32Prefix = object.bech32_prefix; + } + return message; }, toAmino(message: Bech32PrefixResponse): Bech32PrefixResponseAmino { const obj: any = {}; - obj.bech32_prefix = message.bech32Prefix; + obj.bech32_prefix = message.bech32Prefix === "" ? undefined : message.bech32Prefix; return obj; }, fromAminoMsg(object: Bech32PrefixResponseAminoMsg): Bech32PrefixResponse { @@ -1427,14 +1458,15 @@ function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { }; } export const AddressBytesToStringRequest = { - encode(message: AddressBytesToStringRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + encode(message: AddressBytesToStringRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressBytes.length !== 0) { writer.uint32(10).bytes(message.addressBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressBytesToStringRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressBytesToStringRequest(); while (reader.pos < end) { @@ -1466,13 +1498,15 @@ export const AddressBytesToStringRequest = { return message; }, fromAmino(object: AddressBytesToStringRequestAmino): AddressBytesToStringRequest { - return { - addressBytes: object.address_bytes - }; + const message = createBaseAddressBytesToStringRequest(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; }, toAmino(message: AddressBytesToStringRequest): AddressBytesToStringRequestAmino { const obj: any = {}; - obj.address_bytes = message.addressBytes; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; return obj; }, fromAminoMsg(object: AddressBytesToStringRequestAminoMsg): AddressBytesToStringRequest { @@ -1503,14 +1537,15 @@ function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse }; } export const AddressBytesToStringResponse = { - encode(message: AddressBytesToStringResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + encode(message: AddressBytesToStringResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressString !== "") { writer.uint32(10).string(message.addressString); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressBytesToStringResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressBytesToStringResponse(); while (reader.pos < end) { @@ -1542,13 +1577,15 @@ export const AddressBytesToStringResponse = { return message; }, fromAmino(object: AddressBytesToStringResponseAmino): AddressBytesToStringResponse { - return { - addressString: object.address_string - }; + const message = createBaseAddressBytesToStringResponse(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; }, toAmino(message: AddressBytesToStringResponse): AddressBytesToStringResponseAmino { const obj: any = {}; - obj.address_string = message.addressString; + obj.address_string = message.addressString === "" ? undefined : message.addressString; return obj; }, fromAminoMsg(object: AddressBytesToStringResponseAminoMsg): AddressBytesToStringResponse { @@ -1579,14 +1616,15 @@ function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { }; } export const AddressStringToBytesRequest = { - encode(message: AddressStringToBytesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + encode(message: AddressStringToBytesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressString !== "") { writer.uint32(10).string(message.addressString); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressStringToBytesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressStringToBytesRequest(); while (reader.pos < end) { @@ -1618,13 +1656,15 @@ export const AddressStringToBytesRequest = { return message; }, fromAmino(object: AddressStringToBytesRequestAmino): AddressStringToBytesRequest { - return { - addressString: object.address_string - }; + const message = createBaseAddressStringToBytesRequest(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; }, toAmino(message: AddressStringToBytesRequest): AddressStringToBytesRequestAmino { const obj: any = {}; - obj.address_string = message.addressString; + obj.address_string = message.addressString === "" ? undefined : message.addressString; return obj; }, fromAminoMsg(object: AddressStringToBytesRequestAminoMsg): AddressStringToBytesRequest { @@ -1655,14 +1695,15 @@ function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse }; } export const AddressStringToBytesResponse = { - encode(message: AddressStringToBytesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + encode(message: AddressStringToBytesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressBytes.length !== 0) { writer.uint32(10).bytes(message.addressBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressStringToBytesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressStringToBytesResponse(); while (reader.pos < end) { @@ -1694,13 +1735,15 @@ export const AddressStringToBytesResponse = { return message; }, fromAmino(object: AddressStringToBytesResponseAmino): AddressStringToBytesResponse { - return { - addressBytes: object.address_bytes - }; + const message = createBaseAddressStringToBytesResponse(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; }, toAmino(message: AddressStringToBytesResponse): AddressStringToBytesResponseAmino { const obj: any = {}; - obj.address_bytes = message.addressBytes; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; return obj; }, fromAminoMsg(object: AddressStringToBytesResponseAminoMsg): AddressStringToBytesResponse { @@ -1727,25 +1770,26 @@ export const AddressStringToBytesResponse = { }; function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { return { - id: Long.ZERO + id: BigInt(0) }; } export const QueryAccountAddressByIDRequest = { - encode(message: QueryAccountAddressByIDRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + encode(message: QueryAccountAddressByIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).int64(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountAddressByIDRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.int64() as Long); + message.id = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1756,27 +1800,29 @@ export const QueryAccountAddressByIDRequest = { }, fromJSON(object: any): QueryAccountAddressByIDRequest { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) }; }, toJSON(message: QueryAccountAddressByIDRequest): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.ZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryAccountAddressByIDRequest { const message = createBaseQueryAccountAddressByIDRequest(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.ZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); return message; }, fromAmino(object: QueryAccountAddressByIDRequestAmino): QueryAccountAddressByIDRequest { - return { - id: Long.fromString(object.id) - }; + const message = createBaseQueryAccountAddressByIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; }, toAmino(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; return obj; }, fromAminoMsg(object: QueryAccountAddressByIDRequestAminoMsg): QueryAccountAddressByIDRequest { @@ -1807,14 +1853,15 @@ function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDRes }; } export const QueryAccountAddressByIDResponse = { - encode(message: QueryAccountAddressByIDResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + encode(message: QueryAccountAddressByIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.accountAddress !== "") { writer.uint32(10).string(message.accountAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountAddressByIDResponse(); while (reader.pos < end) { @@ -1846,13 +1893,15 @@ export const QueryAccountAddressByIDResponse = { return message; }, fromAmino(object: QueryAccountAddressByIDResponseAmino): QueryAccountAddressByIDResponse { - return { - accountAddress: object.account_address - }; + const message = createBaseQueryAccountAddressByIDResponse(); + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; }, toAmino(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseAmino { const obj: any = {}; - obj.account_address = message.accountAddress; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; return obj; }, fromAminoMsg(object: QueryAccountAddressByIDResponseAminoMsg): QueryAccountAddressByIDResponse { @@ -1877,8 +1926,8 @@ export const QueryAccountAddressByIDResponse = { }; } }; -export const AccountI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): BaseAccount | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const AccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BaseAccount | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.auth.v1beta1.BaseAccount": @@ -1887,7 +1936,7 @@ export const AccountI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): BaseA return data; } }; -export const AccountI_FromAmino = (content: AnyAmino) => { +export const AccountI_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/BaseAccount": return Any.fromPartial({ @@ -1903,14 +1952,14 @@ export const AccountI_ToAmino = (content: Any) => { case "/cosmos.auth.v1beta1.BaseAccount": return { type: "cosmos-sdk/BaseAccount", - value: BaseAccount.toAmino(BaseAccount.decode(content.value)) + value: BaseAccount.toAmino(BaseAccount.decode(content.value, undefined)) }; default: return Any.toAmino(content); } }; -export const ModuleAccountI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): ModuleAccount | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const ModuleAccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): ModuleAccount | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.auth.v1beta1.ModuleAccount": @@ -1919,7 +1968,7 @@ export const ModuleAccountI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): return data; } }; -export const ModuleAccountI_FromAmino = (content: AnyAmino) => { +export const ModuleAccountI_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/ModuleAccount": return Any.fromPartial({ @@ -1935,7 +1984,7 @@ export const ModuleAccountI_ToAmino = (content: Any) => { case "/cosmos.auth.v1beta1.ModuleAccount": return { type: "cosmos-sdk/ModuleAccount", - value: ModuleAccount.toAmino(ModuleAccount.decode(content.value)) + value: ModuleAccount.toAmino(ModuleAccount.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/authz.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/authz.ts index c979f5ae..fa504705 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -1,15 +1,15 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { SendAuthorization, SendAuthorizationProtoMsg, SendAuthorizationSDKType } from "../../bank/v1beta1/authz"; import { StakeAuthorization, StakeAuthorizationProtoMsg, StakeAuthorizationSDKType } from "../../staking/v1beta1/authz"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** * GenericAuthorization gives the grantee unrestricted permissions to execute * the provided method on behalf of the granter's account. */ export interface GenericAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ msg: string; } @@ -23,7 +23,7 @@ export interface GenericAuthorizationProtoMsg { */ export interface GenericAuthorizationAmino { /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ - msg: string; + msg?: string; } export interface GenericAuthorizationAminoMsg { type: "cosmos-sdk/GenericAuthorization"; @@ -34,7 +34,7 @@ export interface GenericAuthorizationAminoMsg { * the provided method on behalf of the granter's account. */ export interface GenericAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; msg: string; } /** @@ -42,7 +42,7 @@ export interface GenericAuthorizationSDKType { * the provide method with expiration time. */ export interface Grant { - authorization: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; + authorization?: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; /** * time when the grant will expire and will be pruned. If null, then the grant * doesn't have a time expiration (other conditions in `authorization` @@ -68,7 +68,7 @@ export interface GrantAmino { * doesn't have a time expiration (other conditions in `authorization` * may apply to invalidate the grant) */ - expiration?: TimestampAmino; + expiration?: string; } export interface GrantAminoMsg { type: "cosmos-sdk/Grant"; @@ -79,7 +79,7 @@ export interface GrantAminoMsg { * the provide method with expiration time. */ export interface GrantSDKType { - authorization: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined; + authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined; expiration?: TimestampSDKType; } /** @@ -89,8 +89,8 @@ export interface GrantSDKType { export interface GrantAuthorization { granter: string; grantee: string; - authorization: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; - expiration: Timestamp; + authorization?: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; + expiration?: Timestamp; } export interface GrantAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; @@ -104,10 +104,10 @@ export type GrantAuthorizationEncoded = Omit e) : [] - }; + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; + return message; }, toAmino(message: GrantQueueItem): GrantQueueItemAmino { const obj: any = {}; if (message.msgTypeUrls) { obj.msg_type_urls = message.msgTypeUrls.map(e => e); } else { - obj.msg_type_urls = []; + obj.msg_type_urls = message.msgTypeUrls; } return obj; }, @@ -506,8 +524,8 @@ export const GrantQueueItem = { }; } }; -export const Authorization_InterfaceDecoder = (input: _m0.Reader | Uint8Array): GenericAuthorization | SendAuthorization | StakeAuthorization | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Authorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): GenericAuthorization | SendAuthorization | StakeAuthorization | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.authz.v1beta1.GenericAuthorization": @@ -520,7 +538,7 @@ export const Authorization_InterfaceDecoder = (input: _m0.Reader | Uint8Array): return data; } }; -export const Authorization_FromAmino = (content: AnyAmino) => { +export const Authorization_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/GenericAuthorization": return Any.fromPartial({ @@ -546,17 +564,17 @@ export const Authorization_ToAmino = (content: Any) => { case "/cosmos.authz.v1beta1.GenericAuthorization": return { type: "cosmos-sdk/GenericAuthorization", - value: GenericAuthorization.toAmino(GenericAuthorization.decode(content.value)) + value: GenericAuthorization.toAmino(GenericAuthorization.decode(content.value, undefined)) }; case "/cosmos.bank.v1beta1.SendAuthorization": return { type: "cosmos-sdk/SendAuthorization", - value: SendAuthorization.toAmino(SendAuthorization.decode(content.value)) + value: SendAuthorization.toAmino(SendAuthorization.decode(content.value, undefined)) }; case "/cosmos.staking.v1beta1.StakeAuthorization": return { type: "cosmos-sdk/StakeAuthorization", - value: StakeAuthorization.toAmino(StakeAuthorization.decode(content.value)) + value: StakeAuthorization.toAmino(StakeAuthorization.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/event.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/event.ts index 49e433a6..cdf6602d 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/event.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/event.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** EventGrant is emitted on Msg/Grant */ export interface EventGrant { @@ -16,11 +16,11 @@ export interface EventGrantProtoMsg { /** EventGrant is emitted on Msg/Grant */ export interface EventGrantAmino { /** Msg type URL for which an autorization is granted */ - msg_type_url: string; + msg_type_url?: string; /** Granter account address */ - granter: string; + granter?: string; /** Grantee account address */ - grantee: string; + grantee?: string; } export interface EventGrantAminoMsg { type: "cosmos-sdk/EventGrant"; @@ -48,11 +48,11 @@ export interface EventRevokeProtoMsg { /** EventRevoke is emitted on Msg/Revoke */ export interface EventRevokeAmino { /** Msg type URL for which an autorization is revoked */ - msg_type_url: string; + msg_type_url?: string; /** Granter account address */ - granter: string; + granter?: string; /** Grantee account address */ - grantee: string; + grantee?: string; } export interface EventRevokeAminoMsg { type: "cosmos-sdk/EventRevoke"; @@ -72,7 +72,8 @@ function createBaseEventGrant(): EventGrant { }; } export const EventGrant = { - encode(message: EventGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.EventGrant", + encode(message: EventGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgTypeUrl !== "") { writer.uint32(18).string(message.msgTypeUrl); } @@ -84,8 +85,8 @@ export const EventGrant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventGrant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventGrant(); while (reader.pos < end) { @@ -129,17 +130,23 @@ export const EventGrant = { return message; }, fromAmino(object: EventGrantAmino): EventGrant { - return { - msgTypeUrl: object.msg_type_url, - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseEventGrant(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: EventGrant): EventGrantAmino { const obj: any = {}; - obj.msg_type_url = message.msgTypeUrl; - obj.granter = message.granter; - obj.grantee = message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; return obj; }, fromAminoMsg(object: EventGrantAminoMsg): EventGrant { @@ -172,7 +179,8 @@ function createBaseEventRevoke(): EventRevoke { }; } export const EventRevoke = { - encode(message: EventRevoke, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.EventRevoke", + encode(message: EventRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgTypeUrl !== "") { writer.uint32(18).string(message.msgTypeUrl); } @@ -184,8 +192,8 @@ export const EventRevoke = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventRevoke { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventRevoke(); while (reader.pos < end) { @@ -229,17 +237,23 @@ export const EventRevoke = { return message; }, fromAmino(object: EventRevokeAmino): EventRevoke { - return { - msgTypeUrl: object.msg_type_url, - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseEventRevoke(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: EventRevoke): EventRevokeAmino { const obj: any = {}; - obj.msg_type_url = message.msgTypeUrl; - obj.granter = message.granter; - obj.grantee = message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; return obj; }, fromAminoMsg(object: EventRevokeAminoMsg): EventRevoke { diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/genesis.ts index cbe11128..2162ab34 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/genesis.ts @@ -1,5 +1,5 @@ import { GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the authz module's genesis state. */ export interface GenesisState { authorization: GrantAuthorization[]; @@ -10,7 +10,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the authz module's genesis state. */ export interface GenesisStateAmino { - authorization: GrantAuthorizationAmino[]; + authorization?: GrantAuthorizationAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -26,14 +26,15 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.authorization) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -69,16 +70,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - authorization: Array.isArray(object?.authorization) ? object.authorization.map((e: any) => GrantAuthorization.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.authorization = object.authorization?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; if (message.authorization) { obj.authorization = message.authorization.map(e => e ? GrantAuthorization.toAmino(e) : undefined); } else { - obj.authorization = []; + obj.authorization = message.authorization; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/query.lcd.ts index 1bebcdd1..e5699e32 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryGrantsRequest, QueryGrantsResponseSDKType, QueryGranterGrantsRequest, QueryGranterGrantsResponseSDKType, QueryGranteeGrantsRequest, QueryGranteeGrantsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts index e5212aaf..f42a05d8 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -30,17 +30,17 @@ export class QueryClientImpl implements Query { grants(request: QueryGrantsRequest): Promise { const data = QueryGrantsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "Grants", data); - return promise.then(data => QueryGrantsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGrantsResponse.decode(new BinaryReader(data))); } granterGrants(request: QueryGranterGrantsRequest): Promise { const data = QueryGranterGrantsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranterGrants", data); - return promise.then(data => QueryGranterGrantsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGranterGrantsResponse.decode(new BinaryReader(data))); } granteeGrants(request: QueryGranteeGrantsRequest): Promise { const data = QueryGranteeGrantsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranteeGrants", data); - return promise.then(data => QueryGranteeGrantsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGranteeGrantsResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/query.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/query.ts index 18752a98..99645180 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Grant, GrantAmino, GrantSDKType, GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequest { @@ -9,7 +9,7 @@ export interface QueryGrantsRequest { /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ msgTypeUrl: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest"; @@ -17,10 +17,10 @@ export interface QueryGrantsRequestProtoMsg { } /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequestAmino { - granter: string; - grantee: string; + granter?: string; + grantee?: string; /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ - msg_type_url: string; + msg_type_url?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -33,14 +33,14 @@ export interface QueryGrantsRequestSDKType { granter: string; grantee: string; msg_type_url: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponse { /** authorizations is a list of grants granted for grantee by granter. */ grants: Grant[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse"; @@ -49,7 +49,7 @@ export interface QueryGrantsResponseProtoMsg { /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseAmino { /** authorizations is a list of grants granted for grantee by granter. */ - grants: GrantAmino[]; + grants?: GrantAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -60,13 +60,13 @@ export interface QueryGrantsResponseAminoMsg { /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseSDKType { grants: GrantSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequest { granter: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGranterGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest"; @@ -74,7 +74,7 @@ export interface QueryGranterGrantsRequestProtoMsg { } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestAmino { - granter: string; + granter?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -85,14 +85,14 @@ export interface QueryGranterGrantsRequestAminoMsg { /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestSDKType { granter: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponse { /** grants is a list of grants granted by the granter. */ grants: GrantAuthorization[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGranterGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse"; @@ -101,7 +101,7 @@ export interface QueryGranterGrantsResponseProtoMsg { /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseAmino { /** grants is a list of grants granted by the granter. */ - grants: GrantAuthorizationAmino[]; + grants?: GrantAuthorizationAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -112,13 +112,13 @@ export interface QueryGranterGrantsResponseAminoMsg { /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequest { grantee: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGranteeGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest"; @@ -126,7 +126,7 @@ export interface QueryGranteeGrantsRequestProtoMsg { } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestAmino { - grantee: string; + grantee?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -137,14 +137,14 @@ export interface QueryGranteeGrantsRequestAminoMsg { /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestSDKType { grantee: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponse { /** grants is a list of grants granted to the grantee. */ grants: GrantAuthorization[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGranteeGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse"; @@ -153,7 +153,7 @@ export interface QueryGranteeGrantsResponseProtoMsg { /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseAmino { /** grants is a list of grants granted to the grantee. */ - grants: GrantAuthorizationAmino[]; + grants?: GrantAuthorizationAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -164,18 +164,19 @@ export interface QueryGranteeGrantsResponseAminoMsg { /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryGrantsRequest(): QueryGrantsRequest { return { granter: "", grantee: "", msgTypeUrl: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGrantsRequest = { - encode(message: QueryGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest", + encode(message: QueryGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -190,8 +191,8 @@ export const QueryGrantsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGrantsRequest(); while (reader.pos < end) { @@ -241,18 +242,26 @@ export const QueryGrantsRequest = { return message; }, fromAmino(object: QueryGrantsRequestAmino): QueryGrantsRequest { - return { - granter: object.granter, - grantee: object.grantee, - msgTypeUrl: object.msg_type_url, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGrantsRequest): QueryGrantsRequestAmino { const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; - obj.msg_type_url = message.msgTypeUrl; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -281,11 +290,12 @@ export const QueryGrantsRequest = { function createBaseQueryGrantsResponse(): QueryGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGrantsResponse = { - encode(message: QueryGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse", + encode(message: QueryGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -294,8 +304,8 @@ export const QueryGrantsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGrantsResponse(); while (reader.pos < end) { @@ -337,17 +347,19 @@ export const QueryGrantsResponse = { return message; }, fromAmino(object: QueryGrantsResponseAmino): QueryGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => Grant.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGrantsResponse(); + message.grants = object.grants?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGrantsResponse): QueryGrantsResponseAmino { const obj: any = {}; if (message.grants) { obj.grants = message.grants.map(e => e ? Grant.toAmino(e) : undefined); } else { - obj.grants = []; + obj.grants = message.grants; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -377,11 +389,12 @@ export const QueryGrantsResponse = { function createBaseQueryGranterGrantsRequest(): QueryGranterGrantsRequest { return { granter: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGranterGrantsRequest = { - encode(message: QueryGranterGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest", + encode(message: QueryGranterGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -390,8 +403,8 @@ export const QueryGranterGrantsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranterGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranterGrantsRequest(); while (reader.pos < end) { @@ -429,14 +442,18 @@ export const QueryGranterGrantsRequest = { return message; }, fromAmino(object: QueryGranterGrantsRequestAmino): QueryGranterGrantsRequest { - return { - granter: object.granter, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranterGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAmino { const obj: any = {}; - obj.granter = message.granter; + obj.granter = message.granter === "" ? undefined : message.granter; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -465,11 +482,12 @@ export const QueryGranterGrantsRequest = { function createBaseQueryGranterGrantsResponse(): QueryGranterGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGranterGrantsResponse = { - encode(message: QueryGranterGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse", + encode(message: QueryGranterGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -478,8 +496,8 @@ export const QueryGranterGrantsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranterGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranterGrantsResponse(); while (reader.pos < end) { @@ -521,17 +539,19 @@ export const QueryGranterGrantsResponse = { return message; }, fromAmino(object: QueryGranterGrantsResponseAmino): QueryGranterGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranterGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseAmino { const obj: any = {}; if (message.grants) { obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); } else { - obj.grants = []; + obj.grants = message.grants; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -561,11 +581,12 @@ export const QueryGranterGrantsResponse = { function createBaseQueryGranteeGrantsRequest(): QueryGranteeGrantsRequest { return { grantee: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGranteeGrantsRequest = { - encode(message: QueryGranteeGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest", + encode(message: QueryGranteeGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } @@ -574,8 +595,8 @@ export const QueryGranteeGrantsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranteeGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranteeGrantsRequest(); while (reader.pos < end) { @@ -613,14 +634,18 @@ export const QueryGranteeGrantsRequest = { return message; }, fromAmino(object: QueryGranteeGrantsRequestAmino): QueryGranteeGrantsRequest { - return { - grantee: object.grantee, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranteeGrantsRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAmino { const obj: any = {}; - obj.grantee = message.grantee; + obj.grantee = message.grantee === "" ? undefined : message.grantee; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -649,11 +674,12 @@ export const QueryGranteeGrantsRequest = { function createBaseQueryGranteeGrantsResponse(): QueryGranteeGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGranteeGrantsResponse = { - encode(message: QueryGranteeGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse", + encode(message: QueryGranteeGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -662,8 +688,8 @@ export const QueryGranteeGrantsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranteeGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranteeGrantsResponse(); while (reader.pos < end) { @@ -705,17 +731,19 @@ export const QueryGranteeGrantsResponse = { return message; }, fromAmino(object: QueryGranteeGrantsResponseAmino): QueryGranteeGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranteeGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseAmino { const obj: any = {}; if (message.grants) { obj.grants = message.grants.map(e => e ? GrantAuthorization.toAmino(e) : undefined); } else { - obj.grants = []; + obj.grants = message.grants; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts index 6e5e5ef5..4f5bb4ee 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgGrant, MsgGrantResponse, MsgExec, MsgExecResponse, MsgRevoke, MsgRevokeResponse } from "./tx"; /** Msg defines the authz Msg service. */ export interface Msg { @@ -33,16 +33,16 @@ export class MsgClientImpl implements Msg { grant(request: MsgGrant): Promise { const data = MsgGrant.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Grant", data); - return promise.then(data => MsgGrantResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgGrantResponse.decode(new BinaryReader(data))); } exec(request: MsgExec): Promise { const data = MsgExec.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Exec", data); - return promise.then(data => MsgExecResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); } revoke(request: MsgRevoke): Promise { const data = MsgRevoke.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data); - return promise.then(data => MsgRevokeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRevokeResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/authz/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/authz/v1beta1/tx.ts index 4c4287ba..6b4b9c57 100644 --- a/packages/api/src/codegen/cosmos/authz/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/authz/v1beta1/tx.ts @@ -1,6 +1,6 @@ import { Grant, GrantAmino, GrantSDKType } from "./authz"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee @@ -20,8 +20,8 @@ export interface MsgGrantProtoMsg { * on behalf of the granter with the provided expiration time. */ export interface MsgGrantAmino { - granter: string; - grantee: string; + granter?: string; + grantee?: string; grant?: GrantAmino; } export interface MsgGrantAminoMsg { @@ -47,7 +47,7 @@ export interface MsgExecResponseProtoMsg { } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponseAmino { - results: Uint8Array[]; + results?: string[]; } export interface MsgExecResponseAminoMsg { type: "cosmos-sdk/MsgExecResponse"; @@ -89,13 +89,13 @@ export type MsgExecEncoded = Omit & { * one signer corresponding to the granter of the authorization. */ export interface MsgExecAmino { - grantee: string; + grantee?: string; /** * Authorization Msg requests to execute. Each msg must implement Authorization interface * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ - msgs: AnyAmino[]; + msgs?: AnyAmino[]; } export interface MsgExecAminoMsg { type: "cosmos-sdk/MsgExec"; @@ -142,9 +142,9 @@ export interface MsgRevokeProtoMsg { * granter's account with that has been granted to the grantee. */ export interface MsgRevokeAmino { - granter: string; - grantee: string; - msg_type_url: string; + granter?: string; + grantee?: string; + msg_type_url?: string; } export interface MsgRevokeAminoMsg { type: "cosmos-sdk/MsgRevoke"; @@ -181,7 +181,8 @@ function createBaseMsgGrant(): MsgGrant { }; } export const MsgGrant = { - encode(message: MsgGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + encode(message: MsgGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -193,8 +194,8 @@ export const MsgGrant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrant(); while (reader.pos < end) { @@ -238,16 +239,22 @@ export const MsgGrant = { return message; }, fromAmino(object: MsgGrantAmino): MsgGrant { - return { - granter: object.granter, - grantee: object.grantee, - grant: object?.grant ? Grant.fromAmino(object.grant) : undefined - }; + const message = createBaseMsgGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.grant !== undefined && object.grant !== null) { + message.grant = Grant.fromAmino(object.grant); + } + return message; }, toAmino(message: MsgGrant): MsgGrantAmino { const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; obj.grant = message.grant ? Grant.toAmino(message.grant) : undefined; return obj; }, @@ -279,14 +286,15 @@ function createBaseMsgExecResponse(): MsgExecResponse { }; } export const MsgExecResponse = { - encode(message: MsgExecResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.results) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecResponse(); while (reader.pos < end) { @@ -322,16 +330,16 @@ export const MsgExecResponse = { return message; }, fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - return { - results: Array.isArray(object?.results) ? object.results.map((e: any) => e) : [] - }; + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: MsgExecResponse): MsgExecResponseAmino { const obj: any = {}; if (message.results) { - obj.results = message.results.map(e => e); + obj.results = message.results.map(e => base64FromBytes(e)); } else { - obj.results = []; + obj.results = message.results; } return obj; }, @@ -364,7 +372,8 @@ function createBaseMsgExec(): MsgExec { }; } export const MsgExec = { - encode(message: MsgExec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } @@ -373,8 +382,8 @@ export const MsgExec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExec(); while (reader.pos < end) { @@ -384,7 +393,7 @@ export const MsgExec = { message.grantee = reader.string(); break; case 2: - message.msgs.push((Sdk_MsgauthzAuthorization_InterfaceDecoder(reader) as Any)); + message.msgs.push((Any.decode(reader, reader.uint32()) as Any)); break; default: reader.skipType(tag & 7); @@ -416,18 +425,20 @@ export const MsgExec = { return message; }, fromAmino(object: MsgExecAmino): MsgExec { - return { - grantee: object.grantee, - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => Sdk_MsgauthzAuthorization_FromAmino(e)) : [] - }; + const message = createBaseMsgExec(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + message.msgs = object.msgs?.map(e => Sdk_MsgauthzAuthorization_FromAmino(e)) || []; + return message; }, toAmino(message: MsgExec): MsgExecAmino { const obj: any = {}; - obj.grantee = message.grantee; + obj.grantee = message.grantee === "" ? undefined : message.grantee; if (message.msgs) { obj.msgs = message.msgs.map(e => e ? Sdk_MsgauthzAuthorization_ToAmino((e as Any)) : undefined); } else { - obj.msgs = []; + obj.msgs = message.msgs; } return obj; }, @@ -457,11 +468,12 @@ function createBaseMsgGrantResponse(): MsgGrantResponse { return {}; } export const MsgGrantResponse = { - encode(_: MsgGrantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrantResponse(); while (reader.pos < end) { @@ -486,7 +498,8 @@ export const MsgGrantResponse = { return message; }, fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { - return {}; + const message = createBaseMsgGrantResponse(); + return message; }, toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { const obj: any = {}; @@ -522,7 +535,8 @@ function createBaseMsgRevoke(): MsgRevoke { }; } export const MsgRevoke = { - encode(message: MsgRevoke, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + encode(message: MsgRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -534,8 +548,8 @@ export const MsgRevoke = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevoke { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevoke(); while (reader.pos < end) { @@ -579,17 +593,23 @@ export const MsgRevoke = { return message; }, fromAmino(object: MsgRevokeAmino): MsgRevoke { - return { - granter: object.granter, - grantee: object.grantee, - msgTypeUrl: object.msg_type_url - }; + const message = createBaseMsgRevoke(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; }, toAmino(message: MsgRevoke): MsgRevokeAmino { const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; - obj.msg_type_url = message.msgTypeUrl; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; return obj; }, fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { @@ -618,11 +638,12 @@ function createBaseMsgRevokeResponse(): MsgRevokeResponse { return {}; } export const MsgRevokeResponse = { - encode(_: MsgRevokeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevokeResponse(); while (reader.pos < end) { @@ -647,7 +668,8 @@ export const MsgRevokeResponse = { return message; }, fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { - return {}; + const message = createBaseMsgRevokeResponse(); + return message; }, toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { const obj: any = {}; @@ -675,29 +697,29 @@ export const MsgRevokeResponse = { }; } }; -export const Sdk_Msg_InterfaceDecoder = (input: _m0.Reader | Uint8Array): Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Sdk_Msg_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { default: return data; } }; -export const Sdk_Msg_FromAmino = (content: AnyAmino) => { +export const Sdk_Msg_FromAmino = (content: AnyAmino): Any => { return Any.fromAmino(content); }; export const Sdk_Msg_ToAmino = (content: Any) => { return Any.toAmino(content); }; -export const Authz_Authorization_InterfaceDecoder = (input: _m0.Reader | Uint8Array): Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Authz_Authorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { default: return data; } }; -export const Authz_Authorization_FromAmino = (content: AnyAmino) => { +export const Authz_Authorization_FromAmino = (content: AnyAmino): Any => { return Any.fromAmino(content); }; export const Authz_Authorization_ToAmino = (content: Any) => { diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/authz.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/authz.ts index aad50666..91031a6a 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/authz.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/authz.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; /** * SendAuthorization allows the grantee to spend up to spend_limit coins from * the granter's account. @@ -7,7 +7,7 @@ import * as _m0 from "protobufjs/minimal"; * Since: cosmos-sdk 0.43 */ export interface SendAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; spendLimit: Coin[]; } export interface SendAuthorizationProtoMsg { @@ -21,7 +21,7 @@ export interface SendAuthorizationProtoMsg { * Since: cosmos-sdk 0.43 */ export interface SendAuthorizationAmino { - spend_limit: CoinAmino[]; + spend_limit?: CoinAmino[]; } export interface SendAuthorizationAminoMsg { type: "cosmos-sdk/SendAuthorization"; @@ -34,7 +34,7 @@ export interface SendAuthorizationAminoMsg { * Since: cosmos-sdk 0.43 */ export interface SendAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; spend_limit: CoinSDKType[]; } function createBaseSendAuthorization(): SendAuthorization { @@ -44,14 +44,15 @@ function createBaseSendAuthorization(): SendAuthorization { }; } export const SendAuthorization = { - encode(message: SendAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", + encode(message: SendAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SendAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSendAuthorization(); while (reader.pos < end) { @@ -87,16 +88,16 @@ export const SendAuthorization = { return message; }, fromAmino(object: SendAuthorizationAmino): SendAuthorization { - return { - spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSendAuthorization(); + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: SendAuthorization): SendAuthorizationAmino { const obj: any = {}; if (message.spendLimit) { obj.spend_limit = message.spendLimit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.spend_limit = []; + obj.spend_limit = message.spendLimit; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/bank.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/bank.ts index 42c95444..40b19057 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/bank.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/bank.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** Params defines the parameters for the bank module. */ export interface Params { @@ -12,8 +12,8 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the bank module. */ export interface ParamsAmino { - send_enabled: SendEnabledAmino[]; - default_send_enabled: boolean; + send_enabled?: SendEnabledAmino[]; + default_send_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -41,8 +41,8 @@ export interface SendEnabledProtoMsg { * sendable). */ export interface SendEnabledAmino { - denom: string; - enabled: boolean; + denom?: string; + enabled?: boolean; } export interface SendEnabledAminoMsg { type: "cosmos-sdk/SendEnabled"; @@ -67,8 +67,8 @@ export interface InputProtoMsg { } /** Input models transaction input. */ export interface InputAmino { - address: string; - coins: CoinAmino[]; + address?: string; + coins?: CoinAmino[]; } export interface InputAminoMsg { type: "cosmos-sdk/Input"; @@ -90,8 +90,8 @@ export interface OutputProtoMsg { } /** Output models transaction outputs. */ export interface OutputAmino { - address: string; - coins: CoinAmino[]; + address?: string; + coins?: CoinAmino[]; } export interface OutputAminoMsg { type: "cosmos-sdk/Output"; @@ -109,7 +109,7 @@ export interface OutputSDKType { */ /** @deprecated */ export interface Supply { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; total: Coin[]; } export interface SupplyProtoMsg { @@ -123,7 +123,7 @@ export interface SupplyProtoMsg { */ /** @deprecated */ export interface SupplyAmino { - total: CoinAmino[]; + total?: CoinAmino[]; } export interface SupplyAminoMsg { type: "cosmos-sdk/Supply"; @@ -136,7 +136,7 @@ export interface SupplyAminoMsg { */ /** @deprecated */ export interface SupplySDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; total: CoinSDKType[]; } /** @@ -167,7 +167,7 @@ export interface DenomUnitProtoMsg { */ export interface DenomUnitAmino { /** denom represents the string name of the given denom unit (e.g uatom). */ - denom: string; + denom?: string; /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom @@ -175,9 +175,9 @@ export interface DenomUnitAmino { * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ - exponent: number; + exponent?: number; /** aliases is a list of string aliases for the given denom */ - aliases: string[]; + aliases?: string[]; } export interface DenomUnitAminoMsg { type: "cosmos-sdk/DenomUnit"; @@ -243,42 +243,42 @@ export interface MetadataProtoMsg { * a basic token. */ export interface MetadataAmino { - description: string; + description?: string; /** denom_units represents the list of DenomUnit's for a given coin */ - denom_units: DenomUnitAmino[]; + denom_units?: DenomUnitAmino[]; /** base represents the base denom (should be the DenomUnit with exponent = 0). */ - base: string; + base?: string; /** * display indicates the suggested denom that should be * displayed in clients. */ - display: string; + display?: string; /** * name defines the name of the token (eg: Cosmos Atom) * * Since: cosmos-sdk 0.43 */ - name: string; + name?: string; /** * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can * be the same as the display. * * Since: cosmos-sdk 0.43 */ - symbol: string; + symbol?: string; /** * URI to a document (on or off-chain) that contains additional information. Optional. * * Since: cosmos-sdk 0.46 */ - uri: string; + uri?: string; /** * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that * the document didn't change. Optional. * * Since: cosmos-sdk 0.46 */ - uri_hash: string; + uri_hash?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -305,7 +305,8 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.sendEnabled) { SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -314,8 +315,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -357,19 +358,21 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - sendEnabled: Array.isArray(object?.send_enabled) ? object.send_enabled.map((e: any) => SendEnabled.fromAmino(e)) : [], - defaultSendEnabled: object.default_send_enabled - }; + const message = createBaseParams(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.default_send_enabled !== undefined && object.default_send_enabled !== null) { + message.defaultSendEnabled = object.default_send_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; if (message.sendEnabled) { obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); } else { - obj.send_enabled = []; + obj.send_enabled = message.sendEnabled; } - obj.default_send_enabled = message.defaultSendEnabled; + obj.default_send_enabled = message.defaultSendEnabled === false ? undefined : message.defaultSendEnabled; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -401,7 +404,8 @@ function createBaseSendEnabled(): SendEnabled { }; } export const SendEnabled = { - encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + encode(message: SendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -410,8 +414,8 @@ export const SendEnabled = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSendEnabled(); while (reader.pos < end) { @@ -449,15 +453,19 @@ export const SendEnabled = { return message; }, fromAmino(object: SendEnabledAmino): SendEnabled { - return { - denom: object.denom, - enabled: object.enabled - }; + const message = createBaseSendEnabled(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: SendEnabled): SendEnabledAmino { const obj: any = {}; - obj.denom = message.denom; - obj.enabled = message.enabled; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.enabled = message.enabled === false ? undefined : message.enabled; return obj; }, fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled { @@ -489,7 +497,8 @@ function createBaseInput(): Input { }; } export const Input = { - encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.Input", + encode(message: Input, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -498,8 +507,8 @@ export const Input = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Input { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Input { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInput(); while (reader.pos < end) { @@ -541,18 +550,20 @@ export const Input = { return message; }, fromAmino(object: InputAmino): Input { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseInput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Input): InputAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.coins = []; + obj.coins = message.coins; } return obj; }, @@ -585,7 +596,8 @@ function createBaseOutput(): Output { }; } export const Output = { - encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.Output", + encode(message: Output, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -594,8 +606,8 @@ export const Output = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Output { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Output { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOutput(); while (reader.pos < end) { @@ -637,18 +649,20 @@ export const Output = { return message; }, fromAmino(object: OutputAmino): Output { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseOutput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Output): OutputAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.coins = []; + obj.coins = message.coins; } return obj; }, @@ -681,14 +695,15 @@ function createBaseSupply(): Supply { }; } export const Supply = { - encode(message: Supply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.Supply", + encode(message: Supply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.total) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Supply { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSupply(); while (reader.pos < end) { @@ -724,16 +739,16 @@ export const Supply = { return message; }, fromAmino(object: SupplyAmino): Supply { - return { - total: Array.isArray(object?.total) ? object.total.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Supply): SupplyAmino { const obj: any = {}; if (message.total) { obj.total = message.total.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.total = []; + obj.total = message.total; } return obj; }, @@ -767,7 +782,8 @@ function createBaseDenomUnit(): DenomUnit { }; } export const DenomUnit = { - encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + encode(message: DenomUnit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -779,8 +795,8 @@ export const DenomUnit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDenomUnit(); while (reader.pos < end) { @@ -828,20 +844,24 @@ export const DenomUnit = { return message; }, fromAmino(object: DenomUnitAmino): DenomUnit { - return { - denom: object.denom, - exponent: object.exponent, - aliases: Array.isArray(object?.aliases) ? object.aliases.map((e: any) => e) : [] - }; + const message = createBaseDenomUnit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + message.aliases = object.aliases?.map(e => e) || []; + return message; }, toAmino(message: DenomUnit): DenomUnitAmino { const obj: any = {}; - obj.denom = message.denom; - obj.exponent = message.exponent; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; if (message.aliases) { obj.aliases = message.aliases.map(e => e); } else { - obj.aliases = []; + obj.aliases = message.aliases; } return obj; }, @@ -880,7 +900,8 @@ function createBaseMetadata(): Metadata { }; } export const Metadata = { - encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.Metadata", + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== "") { writer.uint32(10).string(message.description); } @@ -907,8 +928,8 @@ export const Metadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMetadata(); while (reader.pos < end) { @@ -986,31 +1007,45 @@ export const Metadata = { return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - description: object.description, - denomUnits: Array.isArray(object?.denom_units) ? object.denom_units.map((e: any) => DenomUnit.fromAmino(e)) : [], - base: object.base, - display: object.display, - name: object.name, - symbol: object.symbol, - uri: object.uri, - uriHash: object.uri_hash - }; + const message = createBaseMetadata(); + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomUnits = object.denom_units?.map(e => DenomUnit.fromAmino(e)) || []; + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; - obj.description = message.description; + obj.description = message.description === "" ? undefined : message.description; if (message.denomUnits) { obj.denom_units = message.denomUnits.map(e => e ? DenomUnit.toAmino(e) : undefined); } else { - obj.denom_units = []; + obj.denom_units = message.denomUnits; } - obj.base = message.base; - obj.display = message.display; - obj.name = message.name; - obj.symbol = message.symbol; - obj.uri = message.uri; - obj.uri_hash = message.uriHash; + obj.base = message.base === "" ? undefined : message.base; + obj.display = message.display === "" ? undefined : message.display; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.uri = message.uri === "" ? undefined : message.uri; + obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash; return obj; }, fromAminoMsg(object: MetadataAminoMsg): Metadata { diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/genesis.ts index de5c1696..4e42195d 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/genesis.ts @@ -1,6 +1,6 @@ import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { @@ -25,14 +25,14 @@ export interface GenesisStateAmino { /** params defines all the paramaters of the module. */ params?: ParamsAmino; /** balances is an array containing the balances of all the accounts. */ - balances: BalanceAmino[]; + balances?: BalanceAmino[]; /** * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ - supply: CoinAmino[]; + supply?: CoinAmino[]; /** denom_metadata defines the metadata of the differents coins. */ - denom_metadata: MetadataAmino[]; + denom_metadata?: MetadataAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -65,9 +65,9 @@ export interface BalanceProtoMsg { */ export interface BalanceAmino { /** address is the address of the balance holder. */ - address: string; + address?: string; /** coins defines the different coins this balance holds. */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface BalanceAminoMsg { type: "cosmos-sdk/Balance"; @@ -90,7 +90,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -105,8 +106,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -168,12 +169,14 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Balance.fromAmino(e)) : [], - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - denomMetadata: Array.isArray(object?.denom_metadata) ? object.denom_metadata.map((e: any) => Metadata.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + message.denomMetadata = object.denom_metadata?.map(e => Metadata.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -181,17 +184,17 @@ export const GenesisState = { if (message.balances) { obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } if (message.supply) { obj.supply = message.supply.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.supply = []; + obj.supply = message.supply; } if (message.denomMetadata) { obj.denom_metadata = message.denomMetadata.map(e => e ? Metadata.toAmino(e) : undefined); } else { - obj.denom_metadata = []; + obj.denom_metadata = message.denomMetadata; } return obj; }, @@ -224,7 +227,8 @@ function createBaseBalance(): Balance { }; } export const Balance = { - encode(message: Balance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.Balance", + encode(message: Balance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -233,8 +237,8 @@ export const Balance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Balance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Balance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBalance(); while (reader.pos < end) { @@ -276,18 +280,20 @@ export const Balance = { return message; }, fromAmino(object: BalanceAmino): Balance { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseBalance(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Balance): BalanceAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.coins = []; + obj.coins = message.coins; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/query.lcd.ts index e4a56325..7d03aba4 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QuerySpendableBalancesRequest, QuerySpendableBalancesResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataResponseSDKType, QueryDenomOwnersRequest, QueryDenomOwnersResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts index f0478022..b2ca89cb 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -53,51 +53,51 @@ export class QueryClientImpl implements Query { balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data); - return promise.then(data => QueryBalanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBalanceResponse.decode(new BinaryReader(data))); } allBalances(request: QueryAllBalancesRequest): Promise { const data = QueryAllBalancesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); - return promise.then(data => QueryAllBalancesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllBalancesResponse.decode(new BinaryReader(data))); } spendableBalances(request: QuerySpendableBalancesRequest): Promise { const data = QuerySpendableBalancesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalances", data); - return promise.then(data => QuerySpendableBalancesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySpendableBalancesResponse.decode(new BinaryReader(data))); } totalSupply(request: QueryTotalSupplyRequest = { pagination: undefined }): Promise { const data = QueryTotalSupplyRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data); - return promise.then(data => QueryTotalSupplyResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryTotalSupplyResponse.decode(new BinaryReader(data))); } supplyOf(request: QuerySupplyOfRequest): Promise { const data = QuerySupplyOfRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data); - return promise.then(data => QuerySupplyOfResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySupplyOfResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } denomMetadata(request: QueryDenomMetadataRequest): Promise { const data = QueryDenomMetadataRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data); - return promise.then(data => QueryDenomMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDenomMetadataResponse.decode(new BinaryReader(data))); } denomsMetadata(request: QueryDenomsMetadataRequest = { pagination: undefined }): Promise { const data = QueryDenomsMetadataRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); - return promise.then(data => QueryDenomsMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDenomsMetadataResponse.decode(new BinaryReader(data))); } denomOwners(request: QueryDenomOwnersRequest): Promise { const data = QueryDenomOwnersRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwners", data); - return promise.then(data => QueryDenomOwnersResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDenomOwnersResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/query.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/query.ts index 0364074f..7ed02ef3 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/query.ts @@ -1,7 +1,7 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { @@ -17,9 +17,9 @@ export interface QueryBalanceRequestProtoMsg { /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequestAmino { /** address is the address to query balances for. */ - address: string; + address?: string; /** denom is the coin denom to query balances for. */ - denom: string; + denom?: string; } export interface QueryBalanceRequestAminoMsg { type: "cosmos-sdk/QueryBalanceRequest"; @@ -33,7 +33,7 @@ export interface QueryBalanceRequestSDKType { /** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponse { /** balance is the balance of the coin. */ - balance: Coin; + balance?: Coin; } export interface QueryBalanceResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; @@ -50,14 +50,14 @@ export interface QueryBalanceResponseAminoMsg { } /** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponseSDKType { - balance: CoinSDKType; + balance?: CoinSDKType; } /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequest { /** address is the address to query balances for. */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest"; @@ -66,7 +66,7 @@ export interface QueryAllBalancesRequestProtoMsg { /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestAmino { /** address is the address to query balances for. */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -77,7 +77,7 @@ export interface QueryAllBalancesRequestAminoMsg { /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC @@ -87,7 +87,7 @@ export interface QueryAllBalancesResponse { /** balances is the balances of all the coins. */ balances: Coin[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; @@ -99,7 +99,7 @@ export interface QueryAllBalancesResponseProtoMsg { */ export interface QueryAllBalancesResponseAmino { /** balances is the balances of all the coins. */ - balances: CoinAmino[]; + balances?: CoinAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -113,7 +113,7 @@ export interface QueryAllBalancesResponseAminoMsg { */ export interface QueryAllBalancesResponseSDKType { balances: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying @@ -125,7 +125,7 @@ export interface QuerySpendableBalancesRequest { /** address is the address to query spendable balances for. */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QuerySpendableBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; @@ -139,7 +139,7 @@ export interface QuerySpendableBalancesRequestProtoMsg { */ export interface QuerySpendableBalancesRequestAmino { /** address is the address to query spendable balances for. */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -155,7 +155,7 @@ export interface QuerySpendableBalancesRequestAminoMsg { */ export interface QuerySpendableBalancesRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying @@ -167,7 +167,7 @@ export interface QuerySpendableBalancesResponse { /** balances is the spendable balances of all the coins. */ balances: Coin[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QuerySpendableBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; @@ -181,7 +181,7 @@ export interface QuerySpendableBalancesResponseProtoMsg { */ export interface QuerySpendableBalancesResponseAmino { /** balances is the spendable balances of all the coins. */ - balances: CoinAmino[]; + balances?: CoinAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -197,7 +197,7 @@ export interface QuerySpendableBalancesResponseAminoMsg { */ export interface QuerySpendableBalancesResponseSDKType { balances: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC @@ -209,7 +209,7 @@ export interface QueryTotalSupplyRequest { * * Since: cosmos-sdk 0.43 */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryTotalSupplyRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; @@ -236,7 +236,7 @@ export interface QueryTotalSupplyRequestAminoMsg { * method. */ export interface QueryTotalSupplyRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC @@ -250,7 +250,7 @@ export interface QueryTotalSupplyResponse { * * Since: cosmos-sdk 0.43 */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryTotalSupplyResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; @@ -262,7 +262,7 @@ export interface QueryTotalSupplyResponseProtoMsg { */ export interface QueryTotalSupplyResponseAmino { /** supply is the supply of the coins */ - supply: CoinAmino[]; + supply?: CoinAmino[]; /** * pagination defines the pagination in the response. * @@ -280,7 +280,7 @@ export interface QueryTotalSupplyResponseAminoMsg { */ export interface QueryTotalSupplyResponseSDKType { supply: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequest { @@ -294,7 +294,7 @@ export interface QuerySupplyOfRequestProtoMsg { /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequestAmino { /** denom is the coin denom to query balances for. */ - denom: string; + denom?: string; } export interface QuerySupplyOfRequestAminoMsg { type: "cosmos-sdk/QuerySupplyOfRequest"; @@ -363,7 +363,7 @@ export interface QueryParamsResponseSDKType { /** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ export interface QueryDenomsMetadataRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDenomsMetadataRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; @@ -380,7 +380,7 @@ export interface QueryDenomsMetadataRequestAminoMsg { } /** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ export interface QueryDenomsMetadataRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC @@ -390,7 +390,7 @@ export interface QueryDenomsMetadataResponse { /** metadata provides the client information for all the registered tokens. */ metadatas: Metadata[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDenomsMetadataResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; @@ -402,7 +402,7 @@ export interface QueryDenomsMetadataResponseProtoMsg { */ export interface QueryDenomsMetadataResponseAmino { /** metadata provides the client information for all the registered tokens. */ - metadatas: MetadataAmino[]; + metadatas?: MetadataAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -416,7 +416,7 @@ export interface QueryDenomsMetadataResponseAminoMsg { */ export interface QueryDenomsMetadataResponseSDKType { metadatas: MetadataSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequest { @@ -430,7 +430,7 @@ export interface QueryDenomMetadataRequestProtoMsg { /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequestAmino { /** denom is the coin denom to query the metadata for. */ - denom: string; + denom?: string; } export interface QueryDenomMetadataRequestAminoMsg { type: "cosmos-sdk/QueryDenomMetadataRequest"; @@ -480,7 +480,7 @@ export interface QueryDenomOwnersRequest { /** denom defines the coin denomination to query all account holders for. */ denom: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDenomOwnersRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest"; @@ -493,7 +493,7 @@ export interface QueryDenomOwnersRequestProtoMsg { */ export interface QueryDenomOwnersRequestAmino { /** denom defines the coin denomination to query all account holders for. */ - denom: string; + denom?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -508,7 +508,7 @@ export interface QueryDenomOwnersRequestAminoMsg { */ export interface QueryDenomOwnersRequestSDKType { denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * DenomOwner defines structure representing an account that owns or holds a @@ -536,7 +536,7 @@ export interface DenomOwnerProtoMsg { */ export interface DenomOwnerAmino { /** address defines the address that owns a particular denomination. */ - address: string; + address?: string; /** balance is the balance of the denominated coin for an account. */ balance?: CoinAmino; } @@ -563,7 +563,7 @@ export interface DenomOwnerSDKType { export interface QueryDenomOwnersResponse { denomOwners: DenomOwner[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDenomOwnersResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse"; @@ -575,7 +575,7 @@ export interface QueryDenomOwnersResponseProtoMsg { * Since: cosmos-sdk 0.46 */ export interface QueryDenomOwnersResponseAmino { - denom_owners: DenomOwnerAmino[]; + denom_owners?: DenomOwnerAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -590,7 +590,7 @@ export interface QueryDenomOwnersResponseAminoMsg { */ export interface QueryDenomOwnersResponseSDKType { denom_owners: DenomOwnerSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryBalanceRequest(): QueryBalanceRequest { return { @@ -599,7 +599,8 @@ function createBaseQueryBalanceRequest(): QueryBalanceRequest { }; } export const QueryBalanceRequest = { - encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -608,8 +609,8 @@ export const QueryBalanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceRequest(); while (reader.pos < end) { @@ -647,15 +648,19 @@ export const QueryBalanceRequest = { return message; }, fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { - return { - address: object.address, - denom: object.denom - }; + const message = createBaseQueryBalanceRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { const obj: any = {}; - obj.address = message.address; - obj.denom = message.denom; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: QueryBalanceRequestAminoMsg): QueryBalanceRequest { @@ -686,14 +691,15 @@ function createBaseQueryBalanceResponse(): QueryBalanceResponse { }; } export const QueryBalanceResponse = { - encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.balance !== undefined) { Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceResponse(); while (reader.pos < end) { @@ -725,9 +731,11 @@ export const QueryBalanceResponse = { return message; }, fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { - return { - balance: object?.balance ? Coin.fromAmino(object.balance) : undefined - }; + const message = createBaseQueryBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; }, toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { const obj: any = {}; @@ -759,11 +767,12 @@ export const QueryBalanceResponse = { function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesRequest = { - encode(message: QueryAllBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + encode(message: QueryAllBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -772,8 +781,8 @@ export const QueryAllBalancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllBalancesRequest(); while (reader.pos < end) { @@ -811,14 +820,18 @@ export const QueryAllBalancesRequest = { return message; }, fromAmino(object: QueryAllBalancesRequestAmino): QueryAllBalancesRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllBalancesRequest): QueryAllBalancesRequestAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -847,11 +860,12 @@ export const QueryAllBalancesRequest = { function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { return { balances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesResponse = { - encode(message: QueryAllBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + encode(message: QueryAllBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -860,8 +874,8 @@ export const QueryAllBalancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllBalancesResponse(); while (reader.pos < end) { @@ -903,17 +917,19 @@ export const QueryAllBalancesResponse = { return message; }, fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { - return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { const obj: any = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -943,11 +959,12 @@ export const QueryAllBalancesResponse = { function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QuerySpendableBalancesRequest = { - encode(message: QuerySpendableBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + encode(message: QuerySpendableBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -956,8 +973,8 @@ export const QuerySpendableBalancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySpendableBalancesRequest(); while (reader.pos < end) { @@ -995,14 +1012,18 @@ export const QuerySpendableBalancesRequest = { return message; }, fromAmino(object: QuerySpendableBalancesRequestAmino): QuerySpendableBalancesRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySpendableBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1031,11 +1052,12 @@ export const QuerySpendableBalancesRequest = { function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { return { balances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QuerySpendableBalancesResponse = { - encode(message: QuerySpendableBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + encode(message: QuerySpendableBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1044,8 +1066,8 @@ export const QuerySpendableBalancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySpendableBalancesResponse(); while (reader.pos < end) { @@ -1087,17 +1109,19 @@ export const QuerySpendableBalancesResponse = { return message; }, fromAmino(object: QuerySpendableBalancesResponseAmino): QuerySpendableBalancesResponse { - return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAmino { const obj: any = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1126,18 +1150,19 @@ export const QuerySpendableBalancesResponse = { }; function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyRequest = { - encode(message: QueryTotalSupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + encode(message: QueryTotalSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalSupplyRequest(); while (reader.pos < end) { @@ -1169,9 +1194,11 @@ export const QueryTotalSupplyRequest = { return message; }, fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { const obj: any = {}; @@ -1203,11 +1230,12 @@ export const QueryTotalSupplyRequest = { function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { return { supply: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyResponse = { - encode(message: QueryTotalSupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + encode(message: QueryTotalSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.supply) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1216,8 +1244,8 @@ export const QueryTotalSupplyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalSupplyResponse(); while (reader.pos < end) { @@ -1259,17 +1287,19 @@ export const QueryTotalSupplyResponse = { return message; }, fromAmino(object: QueryTotalSupplyResponseAmino): QueryTotalSupplyResponse { - return { - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAmino { const obj: any = {}; if (message.supply) { obj.supply = message.supply.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.supply = []; + obj.supply = message.supply; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1302,14 +1332,15 @@ function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { }; } export const QuerySupplyOfRequest = { - encode(message: QuerySupplyOfRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + encode(message: QuerySupplyOfRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyOfRequest(); while (reader.pos < end) { @@ -1341,13 +1372,15 @@ export const QuerySupplyOfRequest = { return message; }, fromAmino(object: QuerySupplyOfRequestAmino): QuerySupplyOfRequest { - return { - denom: object.denom - }; + const message = createBaseQuerySupplyOfRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QuerySupplyOfRequest): QuerySupplyOfRequestAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: QuerySupplyOfRequestAminoMsg): QuerySupplyOfRequest { @@ -1374,18 +1407,19 @@ export const QuerySupplyOfRequest = { }; function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { return { - amount: undefined + amount: Coin.fromPartial({}) }; } export const QuerySupplyOfResponse = { - encode(message: QuerySupplyOfResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + encode(message: QuerySupplyOfResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyOfResponse(); while (reader.pos < end) { @@ -1417,9 +1451,11 @@ export const QuerySupplyOfResponse = { return message; }, fromAmino(object: QuerySupplyOfResponseAmino): QuerySupplyOfResponse { - return { - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseQuerySupplyOfResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { const obj: any = {}; @@ -1452,11 +1488,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -1481,7 +1518,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -1515,14 +1553,15 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -1554,9 +1593,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -1587,18 +1628,19 @@ export const QueryParamsResponse = { }; function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDenomsMetadataRequest = { - encode(message: QueryDenomsMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + encode(message: QueryDenomsMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomsMetadataRequest(); while (reader.pos < end) { @@ -1630,9 +1672,11 @@ export const QueryDenomsMetadataRequest = { return message; }, fromAmino(object: QueryDenomsMetadataRequestAmino): QueryDenomsMetadataRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomsMetadataRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAmino { const obj: any = {}; @@ -1664,11 +1708,12 @@ export const QueryDenomsMetadataRequest = { function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { return { metadatas: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDenomsMetadataResponse = { - encode(message: QueryDenomsMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + encode(message: QueryDenomsMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.metadatas) { Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1677,8 +1722,8 @@ export const QueryDenomsMetadataResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomsMetadataResponse(); while (reader.pos < end) { @@ -1720,17 +1765,19 @@ export const QueryDenomsMetadataResponse = { return message; }, fromAmino(object: QueryDenomsMetadataResponseAmino): QueryDenomsMetadataResponse { - return { - metadatas: Array.isArray(object?.metadatas) ? object.metadatas.map((e: any) => Metadata.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAmino { const obj: any = {}; if (message.metadatas) { obj.metadatas = message.metadatas.map(e => e ? Metadata.toAmino(e) : undefined); } else { - obj.metadatas = []; + obj.metadatas = message.metadatas; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1763,14 +1810,15 @@ function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { }; } export const QueryDenomMetadataRequest = { - encode(message: QueryDenomMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + encode(message: QueryDenomMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomMetadataRequest(); while (reader.pos < end) { @@ -1802,13 +1850,15 @@ export const QueryDenomMetadataRequest = { return message; }, fromAmino(object: QueryDenomMetadataRequestAmino): QueryDenomMetadataRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: QueryDenomMetadataRequestAminoMsg): QueryDenomMetadataRequest { @@ -1839,14 +1889,15 @@ function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { }; } export const QueryDenomMetadataResponse = { - encode(message: QueryDenomMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + encode(message: QueryDenomMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.metadata !== undefined) { Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomMetadataResponse(); while (reader.pos < end) { @@ -1878,9 +1929,11 @@ export const QueryDenomMetadataResponse = { return message; }, fromAmino(object: QueryDenomMetadataResponseAmino): QueryDenomMetadataResponse { - return { - metadata: object?.metadata ? Metadata.fromAmino(object.metadata) : undefined - }; + const message = createBaseQueryDenomMetadataResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; }, toAmino(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAmino { const obj: any = {}; @@ -1912,11 +1965,12 @@ export const QueryDenomMetadataResponse = { function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { return { denom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDenomOwnersRequest = { - encode(message: QueryDenomOwnersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + encode(message: QueryDenomOwnersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -1925,8 +1979,8 @@ export const QueryDenomOwnersRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomOwnersRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomOwnersRequest(); while (reader.pos < end) { @@ -1964,14 +2018,18 @@ export const QueryDenomOwnersRequest = { return message; }, fromAmino(object: QueryDenomOwnersRequestAmino): QueryDenomOwnersRequest { - return { - denom: object.denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomOwnersRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2000,11 +2058,12 @@ export const QueryDenomOwnersRequest = { function createBaseDenomOwner(): DenomOwner { return { address: "", - balance: undefined + balance: Coin.fromPartial({}) }; } export const DenomOwner = { - encode(message: DenomOwner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + encode(message: DenomOwner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -2013,8 +2072,8 @@ export const DenomOwner = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DenomOwner { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DenomOwner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDenomOwner(); while (reader.pos < end) { @@ -2052,14 +2111,18 @@ export const DenomOwner = { return message; }, fromAmino(object: DenomOwnerAmino): DenomOwner { - return { - address: object.address, - balance: object?.balance ? Coin.fromAmino(object.balance) : undefined - }; + const message = createBaseDenomOwner(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; }, toAmino(message: DenomOwner): DenomOwnerAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; return obj; }, @@ -2088,11 +2151,12 @@ export const DenomOwner = { function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { return { denomOwners: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDenomOwnersResponse = { - encode(message: QueryDenomOwnersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + encode(message: QueryDenomOwnersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denomOwners) { DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2101,8 +2165,8 @@ export const QueryDenomOwnersResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomOwnersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomOwnersResponse(); while (reader.pos < end) { @@ -2144,17 +2208,19 @@ export const QueryDenomOwnersResponse = { return message; }, fromAmino(object: QueryDenomOwnersResponseAmino): QueryDenomOwnersResponse { - return { - denomOwners: Array.isArray(object?.denom_owners) ? object.denom_owners.map((e: any) => DenomOwner.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denom_owners?.map(e => DenomOwner.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAmino { const obj: any = {}; if (message.denomOwners) { obj.denom_owners = message.denomOwners.map(e => e ? DenomOwner.toAmino(e) : undefined); } else { - obj.denom_owners = []; + obj.denom_owners = message.denomOwners; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts index c345f9af..370da8f4 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { @@ -18,11 +18,11 @@ export class MsgClientImpl implements Msg { send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); - return promise.then(data => MsgSendResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSendResponse.decode(new BinaryReader(data))); } multiSend(request: MsgMultiSend): Promise { const data = MsgMultiSend.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); - return promise.then(data => MsgMultiSendResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgMultiSendResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/bank/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/bank/v1beta1/tx.ts index 08b57e4c..36477137 100644 --- a/packages/api/src/codegen/cosmos/bank/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/bank/v1beta1/tx.ts @@ -1,6 +1,6 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType } from "./bank"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { @@ -14,9 +14,9 @@ export interface MsgSendProtoMsg { } /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSendAmino { - from_address: string; - to_address: string; - amount: CoinAmino[]; + from_address?: string; + to_address?: string; + amount?: CoinAmino[]; } export interface MsgSendAminoMsg { type: "cosmos-sdk/MsgSend"; @@ -53,8 +53,8 @@ export interface MsgMultiSendProtoMsg { } /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSendAmino { - inputs: InputAmino[]; - outputs: OutputAmino[]; + inputs?: InputAmino[]; + outputs?: OutputAmino[]; } export interface MsgMultiSendAminoMsg { type: "cosmos-sdk/MsgMultiSend"; @@ -87,7 +87,8 @@ function createBaseMsgSend(): MsgSend { }; } export const MsgSend = { - encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } @@ -99,8 +100,8 @@ export const MsgSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend(); while (reader.pos < end) { @@ -148,20 +149,24 @@ export const MsgSend = { return message; }, fromAmino(object: MsgSendAmino): MsgSend { - return { - fromAddress: object.from_address, - toAddress: object.to_address, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgSend(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSend): MsgSendAmino { const obj: any = {}; - obj.from_address = message.fromAddress; - obj.to_address = message.toAddress; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -191,11 +196,12 @@ function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse", + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendResponse(); while (reader.pos < end) { @@ -220,7 +226,8 @@ export const MsgSendResponse = { return message; }, fromAmino(_: MsgSendResponseAmino): MsgSendResponse { - return {}; + const message = createBaseMsgSendResponse(); + return message; }, toAmino(_: MsgSendResponse): MsgSendResponseAmino { const obj: any = {}; @@ -255,7 +262,8 @@ function createBaseMsgMultiSend(): MsgMultiSend { }; } export const MsgMultiSend = { - encode(message: MsgMultiSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + encode(message: MsgMultiSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.inputs) { Input.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -264,8 +272,8 @@ export const MsgMultiSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMultiSend(); while (reader.pos < end) { @@ -311,22 +319,22 @@ export const MsgMultiSend = { return message; }, fromAmino(object: MsgMultiSendAmino): MsgMultiSend { - return { - inputs: Array.isArray(object?.inputs) ? object.inputs.map((e: any) => Input.fromAmino(e)) : [], - outputs: Array.isArray(object?.outputs) ? object.outputs.map((e: any) => Output.fromAmino(e)) : [] - }; + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromAmino(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromAmino(e)) || []; + return message; }, toAmino(message: MsgMultiSend): MsgMultiSendAmino { const obj: any = {}; if (message.inputs) { obj.inputs = message.inputs.map(e => e ? Input.toAmino(e) : undefined); } else { - obj.inputs = []; + obj.inputs = message.inputs; } if (message.outputs) { obj.outputs = message.outputs.map(e => e ? Output.toAmino(e) : undefined); } else { - obj.outputs = []; + obj.outputs = message.outputs; } return obj; }, @@ -356,11 +364,12 @@ function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { return {}; } export const MsgMultiSendResponse = { - encode(_: MsgMultiSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + encode(_: MsgMultiSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMultiSendResponse(); while (reader.pos < end) { @@ -385,7 +394,8 @@ export const MsgMultiSendResponse = { return message; }, fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { - return {}; + const message = createBaseMsgMultiSendResponse(); + return message; }, toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/base/abci/v1beta1/abci.ts b/packages/api/src/codegen/cosmos/base/abci/v1beta1/abci.ts index ca5f6c9c..bd5ed191 100644 --- a/packages/api/src/codegen/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/api/src/codegen/cosmos/base/abci/v1beta1/abci.ts @@ -1,14 +1,14 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Event, EventAmino, EventSDKType } from "../../../../tendermint/abci/types"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * TxResponse defines a structure containing relevant tx data and metadata. The * tags are stringified and the log is JSON decoded. */ export interface TxResponse { /** The block height */ - height: Long; + height: bigint; /** The transaction hash. */ txhash: string; /** Namespace for the Code */ @@ -27,11 +27,11 @@ export interface TxResponse { /** Additional information. May be non-deterministic. */ info: string; /** Amount of gas requested for transaction. */ - gasWanted: Long; + gasWanted: bigint; /** Amount of gas consumed by transaction. */ - gasUsed: Long; + gasUsed: bigint; /** The request transaction bytes. */ - tx: Any; + tx?: Any; /** * Time of the previous block. For heights > 1, it's the weighted median of * the timestamps of the valid votes in the block.LastCommit. For height == 1, @@ -58,28 +58,28 @@ export interface TxResponseProtoMsg { */ export interface TxResponseAmino { /** The block height */ - height: string; + height?: string; /** The transaction hash. */ - txhash: string; + txhash?: string; /** Namespace for the Code */ - codespace: string; + codespace?: string; /** Response code. */ - code: number; + code?: number; /** Result bytes, if any. */ - data: string; + data?: string; /** * The output of the application's logger (raw string). May be * non-deterministic. */ - raw_log: string; + raw_log?: string; /** The output of the application's logger (typed). May be non-deterministic. */ - logs: ABCIMessageLogAmino[]; + logs?: ABCIMessageLogAmino[]; /** Additional information. May be non-deterministic. */ - info: string; + info?: string; /** Amount of gas requested for transaction. */ - gas_wanted: string; + gas_wanted?: string; /** Amount of gas consumed by transaction. */ - gas_used: string; + gas_used?: string; /** The request transaction bytes. */ tx?: AnyAmino; /** @@ -87,7 +87,7 @@ export interface TxResponseAmino { * the timestamps of the valid votes in the block.LastCommit. For height == 1, * it's genesis time. */ - timestamp: string; + timestamp?: string; /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those @@ -96,7 +96,7 @@ export interface TxResponseAmino { * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 */ - events: EventAmino[]; + events?: EventAmino[]; } export interface TxResponseAminoMsg { type: "cosmos-sdk/TxResponse"; @@ -107,7 +107,7 @@ export interface TxResponseAminoMsg { * tags are stringified and the log is JSON decoded. */ export interface TxResponseSDKType { - height: Long; + height: bigint; txhash: string; codespace: string; code: number; @@ -115,9 +115,9 @@ export interface TxResponseSDKType { raw_log: string; logs: ABCIMessageLogSDKType[]; info: string; - gas_wanted: Long; - gas_used: Long; - tx: AnySDKType; + gas_wanted: bigint; + gas_used: bigint; + tx?: AnySDKType; timestamp: string; events: EventSDKType[]; } @@ -138,12 +138,12 @@ export interface ABCIMessageLogProtoMsg { /** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ export interface ABCIMessageLogAmino { msg_index: number; - log: string; + log?: string; /** * Events contains a slice of Event objects that were emitted during some * execution. */ - events: StringEventAmino[]; + events?: StringEventAmino[]; } export interface ABCIMessageLogAminoMsg { type: "cosmos-sdk/ABCIMessageLog"; @@ -172,8 +172,8 @@ export interface StringEventProtoMsg { * contain key/value pairs that are strings instead of raw bytes. */ export interface StringEventAmino { - type: string; - attributes: AttributeAmino[]; + type?: string; + attributes?: AttributeAmino[]; } export interface StringEventAminoMsg { type: "cosmos-sdk/StringEvent"; @@ -204,8 +204,8 @@ export interface AttributeProtoMsg { * strings instead of raw bytes. */ export interface AttributeAmino { - key: string; - value: string; + key?: string; + value?: string; } export interface AttributeAminoMsg { type: "cosmos-sdk/Attribute"; @@ -222,9 +222,9 @@ export interface AttributeSDKType { /** GasInfo defines tx execution gas context. */ export interface GasInfo { /** GasWanted is the maximum units of work we allow this tx to perform. */ - gasWanted: Long; + gasWanted: bigint; /** GasUsed is the amount of gas actually consumed. */ - gasUsed: Long; + gasUsed: bigint; } export interface GasInfoProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.GasInfo"; @@ -233,9 +233,9 @@ export interface GasInfoProtoMsg { /** GasInfo defines tx execution gas context. */ export interface GasInfoAmino { /** GasWanted is the maximum units of work we allow this tx to perform. */ - gas_wanted: string; + gas_wanted?: string; /** GasUsed is the amount of gas actually consumed. */ - gas_used: string; + gas_used?: string; } export interface GasInfoAminoMsg { type: "cosmos-sdk/GasInfo"; @@ -243,8 +243,8 @@ export interface GasInfoAminoMsg { } /** GasInfo defines tx execution gas context. */ export interface GasInfoSDKType { - gas_wanted: Long; - gas_used: Long; + gas_wanted: bigint; + gas_used: bigint; } /** Result is the union of ResponseFormat and ResponseCheckTx. */ export interface Result { @@ -283,20 +283,20 @@ export interface ResultAmino { * because it also contains the Msg response typeURL. */ /** @deprecated */ - data: Uint8Array; + data?: string; /** Log contains the log information from message or handler execution. */ - log: string; + log?: string; /** * Events contains a slice of Event objects that were emitted during message * or handler execution. */ - events: EventAmino[]; + events?: EventAmino[]; /** * msg_responses contains the Msg handler responses type packed in Anys. * * Since: cosmos-sdk 0.46 */ - msg_responses: AnyAmino[]; + msg_responses?: AnyAmino[]; } export interface ResultAminoMsg { type: "cosmos-sdk/Result"; @@ -316,7 +316,7 @@ export interface ResultSDKType { */ export interface SimulationResponse { gasInfo: GasInfo; - result: Result; + result?: Result; } export interface SimulationResponseProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; @@ -340,7 +340,7 @@ export interface SimulationResponseAminoMsg { */ export interface SimulationResponseSDKType { gas_info: GasInfoSDKType; - result: ResultSDKType; + result?: ResultSDKType; } /** * MsgData defines the data returned in a Result object during message @@ -361,8 +361,8 @@ export interface MsgDataProtoMsg { */ /** @deprecated */ export interface MsgDataAmino { - msg_type: string; - data: Uint8Array; + msg_type?: string; + data?: string; } export interface MsgDataAminoMsg { type: "cosmos-sdk/MsgData"; @@ -403,13 +403,13 @@ export interface TxMsgDataProtoMsg { export interface TxMsgDataAmino { /** data field is deprecated and not populated. */ /** @deprecated */ - data: MsgDataAmino[]; + data?: MsgDataAmino[]; /** * msg_responses contains the Msg handler responses packed into Anys. * * Since: cosmos-sdk 0.46 */ - msg_responses: AnyAmino[]; + msg_responses?: AnyAmino[]; } export interface TxMsgDataAminoMsg { type: "cosmos-sdk/TxMsgData"; @@ -427,15 +427,15 @@ export interface TxMsgDataSDKType { /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { /** Count of all txs */ - totalCount: Long; + totalCount: bigint; /** Count of txs in current page */ - count: Long; + count: bigint; /** Index of current page, start from 1 */ - pageNumber: Long; + pageNumber: bigint; /** Count of total pages */ - pageTotal: Long; + pageTotal: bigint; /** Max count txs per page */ - limit: Long; + limit: bigint; /** List of txs in current page */ txs: TxResponse[]; } @@ -446,17 +446,17 @@ export interface SearchTxsResultProtoMsg { /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResultAmino { /** Count of all txs */ - total_count: string; + total_count?: string; /** Count of txs in current page */ - count: string; + count?: string; /** Index of current page, start from 1 */ - page_number: string; + page_number?: string; /** Count of total pages */ - page_total: string; + page_total?: string; /** Max count txs per page */ - limit: string; + limit?: string; /** List of txs in current page */ - txs: TxResponseAmino[]; + txs?: TxResponseAmino[]; } export interface SearchTxsResultAminoMsg { type: "cosmos-sdk/SearchTxsResult"; @@ -464,16 +464,16 @@ export interface SearchTxsResultAminoMsg { } /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResultSDKType { - total_count: Long; - count: Long; - page_number: Long; - page_total: Long; - limit: Long; + total_count: bigint; + count: bigint; + page_number: bigint; + page_total: bigint; + limit: bigint; txs: TxResponseSDKType[]; } function createBaseTxResponse(): TxResponse { return { - height: Long.ZERO, + height: BigInt(0), txhash: "", codespace: "", code: 0, @@ -481,16 +481,17 @@ function createBaseTxResponse(): TxResponse { rawLog: "", logs: [], info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, + gasWanted: BigInt(0), + gasUsed: BigInt(0), tx: undefined, timestamp: "", events: [] }; } export const TxResponse = { - encode(message: TxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + encode(message: TxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.txhash !== "") { @@ -514,10 +515,10 @@ export const TxResponse = { if (message.info !== "") { writer.uint32(66).string(message.info); } - if (!message.gasWanted.isZero()) { + if (message.gasWanted !== BigInt(0)) { writer.uint32(72).int64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(80).int64(message.gasUsed); } if (message.tx !== undefined) { @@ -531,15 +532,15 @@ export const TxResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 2: message.txhash = reader.string(); @@ -563,10 +564,10 @@ export const TxResponse = { message.info = reader.string(); break; case 9: - message.gasWanted = (reader.int64() as Long); + message.gasWanted = reader.int64(); break; case 10: - message.gasUsed = (reader.int64() as Long); + message.gasUsed = reader.int64(); break; case 11: message.tx = Any.decode(reader, reader.uint32()); @@ -586,7 +587,7 @@ export const TxResponse = { }, fromJSON(object: any): TxResponse { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), txhash: isSet(object.txhash) ? String(object.txhash) : "", codespace: isSet(object.codespace) ? String(object.codespace) : "", code: isSet(object.code) ? Number(object.code) : 0, @@ -594,8 +595,8 @@ export const TxResponse = { rawLog: isSet(object.rawLog) ? String(object.rawLog) : "", logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => ABCIMessageLog.fromJSON(e)) : [], info: isSet(object.info) ? String(object.info) : "", - gasWanted: isSet(object.gasWanted) ? Long.fromValue(object.gasWanted) : Long.ZERO, - gasUsed: isSet(object.gasUsed) ? Long.fromValue(object.gasUsed) : Long.ZERO, + gasWanted: isSet(object.gasWanted) ? BigInt(object.gasWanted.toString()) : BigInt(0), + gasUsed: isSet(object.gasUsed) ? BigInt(object.gasUsed.toString()) : BigInt(0), tx: isSet(object.tx) ? Any.fromJSON(object.tx) : undefined, timestamp: isSet(object.timestamp) ? String(object.timestamp) : "", events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] @@ -603,7 +604,7 @@ export const TxResponse = { }, toJSON(message: TxResponse): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.txhash !== undefined && (obj.txhash = message.txhash); message.codespace !== undefined && (obj.codespace = message.codespace); message.code !== undefined && (obj.code = Math.round(message.code)); @@ -615,8 +616,8 @@ export const TxResponse = { obj.logs = []; } message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).toString()); message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); message.timestamp !== undefined && (obj.timestamp = message.timestamp); if (message.events) { @@ -628,7 +629,7 @@ export const TxResponse = { }, fromPartial(object: Partial): TxResponse { const message = createBaseTxResponse(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.txhash = object.txhash ?? ""; message.codespace = object.codespace ?? ""; message.code = object.code ?? 0; @@ -636,52 +637,74 @@ export const TxResponse = { message.rawLog = object.rawLog ?? ""; message.logs = object.logs?.map(e => ABCIMessageLog.fromPartial(e)) || []; message.info = object.info ?? ""; - message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? Long.fromValue(object.gasWanted) : Long.ZERO; - message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? Long.fromValue(object.gasUsed) : Long.ZERO; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); message.tx = object.tx !== undefined && object.tx !== null ? Any.fromPartial(object.tx) : undefined; message.timestamp = object.timestamp ?? ""; message.events = object.events?.map(e => Event.fromPartial(e)) || []; return message; }, fromAmino(object: TxResponseAmino): TxResponse { - return { - height: Long.fromString(object.height), - txhash: object.txhash, - codespace: object.codespace, - code: object.code, - data: object.data, - rawLog: object.raw_log, - logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => ABCIMessageLog.fromAmino(e)) : [], - info: object.info, - gasWanted: Long.fromString(object.gas_wanted), - gasUsed: Long.fromString(object.gas_used), - tx: object?.tx ? Any.fromAmino(object.tx) : undefined, - timestamp: object.timestamp, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseTxResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.raw_log !== undefined && object.raw_log !== null) { + message.rawLog = object.raw_log; + } + message.logs = object.logs?.map(e => ABCIMessageLog.fromAmino(e)) || []; + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromAmino(object.tx); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: TxResponse): TxResponseAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; - obj.txhash = message.txhash; - obj.codespace = message.codespace; - obj.code = message.code; - obj.data = message.data; - obj.raw_log = message.rawLog; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.txhash = message.txhash === "" ? undefined : message.txhash; + obj.codespace = message.codespace === "" ? undefined : message.codespace; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data === "" ? undefined : message.data; + obj.raw_log = message.rawLog === "" ? undefined : message.rawLog; if (message.logs) { obj.logs = message.logs.map(e => e ? ABCIMessageLog.toAmino(e) : undefined); } else { - obj.logs = []; + obj.logs = message.logs; } - obj.info = message.info; - obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; - obj.gas_used = message.gasUsed ? message.gasUsed.toString() : undefined; + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; obj.tx = message.tx ? Any.toAmino(message.tx) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp === "" ? undefined : message.timestamp; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { - obj.events = []; + obj.events = message.events; } return obj; }, @@ -715,7 +738,8 @@ function createBaseABCIMessageLog(): ABCIMessageLog { }; } export const ABCIMessageLog = { - encode(message: ABCIMessageLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + encode(message: ABCIMessageLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgIndex !== 0) { writer.uint32(8).uint32(message.msgIndex); } @@ -727,8 +751,8 @@ export const ABCIMessageLog = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ABCIMessageLog { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ABCIMessageLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseABCIMessageLog(); while (reader.pos < end) { @@ -776,20 +800,24 @@ export const ABCIMessageLog = { return message; }, fromAmino(object: ABCIMessageLogAmino): ABCIMessageLog { - return { - msgIndex: object.msg_index, - log: object.log, - events: Array.isArray(object?.events) ? object.events.map((e: any) => StringEvent.fromAmino(e)) : [] - }; + const message = createBaseABCIMessageLog(); + if (object.msg_index !== undefined && object.msg_index !== null) { + message.msgIndex = object.msg_index; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => StringEvent.fromAmino(e)) || []; + return message; }, toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { const obj: any = {}; - obj.msg_index = message.msgIndex; - obj.log = message.log; + obj.msg_index = message.msgIndex ?? 0; + obj.log = message.log === "" ? undefined : message.log; if (message.events) { obj.events = message.events.map(e => e ? StringEvent.toAmino(e) : undefined); } else { - obj.events = []; + obj.events = message.events; } return obj; }, @@ -822,7 +850,8 @@ function createBaseStringEvent(): StringEvent { }; } export const StringEvent = { - encode(message: StringEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + encode(message: StringEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -831,8 +860,8 @@ export const StringEvent = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StringEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StringEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStringEvent(); while (reader.pos < end) { @@ -874,18 +903,20 @@ export const StringEvent = { return message; }, fromAmino(object: StringEventAmino): StringEvent { - return { - type: object.type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromAmino(e)) : [] - }; + const message = createBaseStringEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => Attribute.fromAmino(e)) || []; + return message; }, toAmino(message: StringEvent): StringEventAmino { const obj: any = {}; - obj.type = message.type; + obj.type = message.type === "" ? undefined : message.type; if (message.attributes) { obj.attributes = message.attributes.map(e => e ? Attribute.toAmino(e) : undefined); } else { - obj.attributes = []; + obj.attributes = message.attributes; } return obj; }, @@ -918,7 +949,8 @@ function createBaseAttribute(): Attribute { }; } export const Attribute = { - encode(message: Attribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + encode(message: Attribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -927,8 +959,8 @@ export const Attribute = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Attribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAttribute(); while (reader.pos < end) { @@ -966,15 +998,19 @@ export const Attribute = { return message; }, fromAmino(object: AttributeAmino): Attribute { - return { - key: object.key, - value: object.value - }; + const message = createBaseAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; }, toAmino(message: Attribute): AttributeAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; return obj; }, fromAminoMsg(object: AttributeAminoMsg): Attribute { @@ -1001,32 +1037,33 @@ export const Attribute = { }; function createBaseGasInfo(): GasInfo { return { - gasWanted: Long.UZERO, - gasUsed: Long.UZERO + gasWanted: BigInt(0), + gasUsed: BigInt(0) }; } export const GasInfo = { - encode(message: GasInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.gasWanted.isZero()) { + typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + encode(message: GasInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasWanted !== BigInt(0)) { writer.uint32(8).uint64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(16).uint64(message.gasUsed); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GasInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GasInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGasInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gasWanted = (reader.uint64() as Long); + message.gasWanted = reader.uint64(); break; case 2: - message.gasUsed = (reader.uint64() as Long); + message.gasUsed = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1037,32 +1074,36 @@ export const GasInfo = { }, fromJSON(object: any): GasInfo { return { - gasWanted: isSet(object.gasWanted) ? Long.fromValue(object.gasWanted) : Long.UZERO, - gasUsed: isSet(object.gasUsed) ? Long.fromValue(object.gasUsed) : Long.UZERO + gasWanted: isSet(object.gasWanted) ? BigInt(object.gasWanted.toString()) : BigInt(0), + gasUsed: isSet(object.gasUsed) ? BigInt(object.gasUsed.toString()) : BigInt(0) }; }, toJSON(message: GasInfo): unknown { const obj: any = {}; - message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString()); - message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.UZERO).toString()); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): GasInfo { const message = createBaseGasInfo(); - message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? Long.fromValue(object.gasWanted) : Long.UZERO; - message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? Long.fromValue(object.gasUsed) : Long.UZERO; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); return message; }, fromAmino(object: GasInfoAmino): GasInfo { - return { - gasWanted: Long.fromString(object.gas_wanted), - gasUsed: Long.fromString(object.gas_used) - }; + const message = createBaseGasInfo(); + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + return message; }, toAmino(message: GasInfo): GasInfoAmino { const obj: any = {}; - obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; - obj.gas_used = message.gasUsed ? message.gasUsed.toString() : undefined; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; return obj; }, fromAminoMsg(object: GasInfoAminoMsg): GasInfo { @@ -1096,7 +1137,8 @@ function createBaseResult(): Result { }; } export const Result = { - encode(message: Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.abci.v1beta1.Result", + encode(message: Result, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } @@ -1111,8 +1153,8 @@ export const Result = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Result { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Result { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResult(); while (reader.pos < end) { @@ -1170,26 +1212,30 @@ export const Result = { return message; }, fromAmino(object: ResultAmino): Result { - return { - data: object.data, - log: object.log, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - msgResponses: Array.isArray(object?.msg_responses) ? object.msg_responses.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseResult(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: Result): ResultAmino { const obj: any = {}; - obj.data = message.data; - obj.log = message.log; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { - obj.events = []; + obj.events = message.events; } if (message.msgResponses) { obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.msg_responses = []; + obj.msg_responses = message.msgResponses; } return obj; }, @@ -1218,11 +1264,12 @@ export const Result = { function createBaseSimulationResponse(): SimulationResponse { return { gasInfo: GasInfo.fromPartial({}), - result: Result.fromPartial({}) + result: undefined }; } export const SimulationResponse = { - encode(message: SimulationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + encode(message: SimulationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gasInfo !== undefined) { GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); } @@ -1231,8 +1278,8 @@ export const SimulationResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimulationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimulationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimulationResponse(); while (reader.pos < end) { @@ -1270,10 +1317,14 @@ export const SimulationResponse = { return message; }, fromAmino(object: SimulationResponseAmino): SimulationResponse { - return { - gasInfo: object?.gas_info ? GasInfo.fromAmino(object.gas_info) : undefined, - result: object?.result ? Result.fromAmino(object.result) : undefined - }; + const message = createBaseSimulationResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; }, toAmino(message: SimulationResponse): SimulationResponseAmino { const obj: any = {}; @@ -1310,7 +1361,8 @@ function createBaseMsgData(): MsgData { }; } export const MsgData = { - encode(message: MsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + encode(message: MsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgType !== "") { writer.uint32(10).string(message.msgType); } @@ -1319,8 +1371,8 @@ export const MsgData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgData(); while (reader.pos < end) { @@ -1358,15 +1410,19 @@ export const MsgData = { return message; }, fromAmino(object: MsgDataAmino): MsgData { - return { - msgType: object.msg_type, - data: object.data - }; + const message = createBaseMsgData(); + if (object.msg_type !== undefined && object.msg_type !== null) { + message.msgType = object.msg_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: MsgData): MsgDataAmino { const obj: any = {}; - obj.msg_type = message.msgType; - obj.data = message.data; + obj.msg_type = message.msgType === "" ? undefined : message.msgType; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: MsgDataAminoMsg): MsgData { @@ -1398,7 +1454,8 @@ function createBaseTxMsgData(): TxMsgData { }; } export const TxMsgData = { - encode(message: TxMsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + encode(message: TxMsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1407,8 +1464,8 @@ export const TxMsgData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxMsgData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxMsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxMsgData(); while (reader.pos < end) { @@ -1454,22 +1511,22 @@ export const TxMsgData = { return message; }, fromAmino(object: TxMsgDataAmino): TxMsgData { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => MsgData.fromAmino(e)) : [], - msgResponses: Array.isArray(object?.msg_responses) ? object.msg_responses.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseTxMsgData(); + message.data = object.data?.map(e => MsgData.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: TxMsgData): TxMsgDataAmino { const obj: any = {}; if (message.data) { obj.data = message.data.map(e => e ? MsgData.toAmino(e) : undefined); } else { - obj.data = []; + obj.data = message.data; } if (message.msgResponses) { obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.msg_responses = []; + obj.msg_responses = message.msgResponses; } return obj; }, @@ -1497,29 +1554,30 @@ export const TxMsgData = { }; function createBaseSearchTxsResult(): SearchTxsResult { return { - totalCount: Long.UZERO, - count: Long.UZERO, - pageNumber: Long.UZERO, - pageTotal: Long.UZERO, - limit: Long.UZERO, + totalCount: BigInt(0), + count: BigInt(0), + pageNumber: BigInt(0), + pageTotal: BigInt(0), + limit: BigInt(0), txs: [] }; } export const SearchTxsResult = { - encode(message: SearchTxsResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.totalCount.isZero()) { + typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + encode(message: SearchTxsResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalCount !== BigInt(0)) { writer.uint32(8).uint64(message.totalCount); } - if (!message.count.isZero()) { + if (message.count !== BigInt(0)) { writer.uint32(16).uint64(message.count); } - if (!message.pageNumber.isZero()) { + if (message.pageNumber !== BigInt(0)) { writer.uint32(24).uint64(message.pageNumber); } - if (!message.pageTotal.isZero()) { + if (message.pageTotal !== BigInt(0)) { writer.uint32(32).uint64(message.pageTotal); } - if (!message.limit.isZero()) { + if (message.limit !== BigInt(0)) { writer.uint32(40).uint64(message.limit); } for (const v of message.txs) { @@ -1527,27 +1585,27 @@ export const SearchTxsResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SearchTxsResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SearchTxsResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSearchTxsResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.totalCount = (reader.uint64() as Long); + message.totalCount = reader.uint64(); break; case 2: - message.count = (reader.uint64() as Long); + message.count = reader.uint64(); break; case 3: - message.pageNumber = (reader.uint64() as Long); + message.pageNumber = reader.uint64(); break; case 4: - message.pageTotal = (reader.uint64() as Long); + message.pageTotal = reader.uint64(); break; case 5: - message.limit = (reader.uint64() as Long); + message.limit = reader.uint64(); break; case 6: message.txs.push(TxResponse.decode(reader, reader.uint32())); @@ -1561,21 +1619,21 @@ export const SearchTxsResult = { }, fromJSON(object: any): SearchTxsResult { return { - totalCount: isSet(object.totalCount) ? Long.fromValue(object.totalCount) : Long.UZERO, - count: isSet(object.count) ? Long.fromValue(object.count) : Long.UZERO, - pageNumber: isSet(object.pageNumber) ? Long.fromValue(object.pageNumber) : Long.UZERO, - pageTotal: isSet(object.pageTotal) ? Long.fromValue(object.pageTotal) : Long.UZERO, - limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO, + totalCount: isSet(object.totalCount) ? BigInt(object.totalCount.toString()) : BigInt(0), + count: isSet(object.count) ? BigInt(object.count.toString()) : BigInt(0), + pageNumber: isSet(object.pageNumber) ? BigInt(object.pageNumber.toString()) : BigInt(0), + pageTotal: isSet(object.pageTotal) ? BigInt(object.pageTotal.toString()) : BigInt(0), + limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0), txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => TxResponse.fromJSON(e)) : [] }; }, toJSON(message: SearchTxsResult): unknown { const obj: any = {}; - message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString()); - message.count !== undefined && (obj.count = (message.count || Long.UZERO).toString()); - message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || Long.UZERO).toString()); - message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.totalCount !== undefined && (obj.totalCount = (message.totalCount || BigInt(0)).toString()); + message.count !== undefined && (obj.count = (message.count || BigInt(0)).toString()); + message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || BigInt(0)).toString()); + message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); if (message.txs) { obj.txs = message.txs.map(e => e ? TxResponse.toJSON(e) : undefined); } else { @@ -1585,35 +1643,45 @@ export const SearchTxsResult = { }, fromPartial(object: Partial): SearchTxsResult { const message = createBaseSearchTxsResult(); - message.totalCount = object.totalCount !== undefined && object.totalCount !== null ? Long.fromValue(object.totalCount) : Long.UZERO; - message.count = object.count !== undefined && object.count !== null ? Long.fromValue(object.count) : Long.UZERO; - message.pageNumber = object.pageNumber !== undefined && object.pageNumber !== null ? Long.fromValue(object.pageNumber) : Long.UZERO; - message.pageTotal = object.pageTotal !== undefined && object.pageTotal !== null ? Long.fromValue(object.pageTotal) : Long.UZERO; - message.limit = object.limit !== undefined && object.limit !== null ? Long.fromValue(object.limit) : Long.UZERO; + message.totalCount = object.totalCount !== undefined && object.totalCount !== null ? BigInt(object.totalCount.toString()) : BigInt(0); + message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0); + message.pageNumber = object.pageNumber !== undefined && object.pageNumber !== null ? BigInt(object.pageNumber.toString()) : BigInt(0); + message.pageTotal = object.pageTotal !== undefined && object.pageTotal !== null ? BigInt(object.pageTotal.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); message.txs = object.txs?.map(e => TxResponse.fromPartial(e)) || []; return message; }, fromAmino(object: SearchTxsResultAmino): SearchTxsResult { - return { - totalCount: Long.fromString(object.total_count), - count: Long.fromString(object.count), - pageNumber: Long.fromString(object.page_number), - pageTotal: Long.fromString(object.page_total), - limit: Long.fromString(object.limit), - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => TxResponse.fromAmino(e)) : [] - }; + const message = createBaseSearchTxsResult(); + if (object.total_count !== undefined && object.total_count !== null) { + message.totalCount = BigInt(object.total_count); + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + if (object.page_number !== undefined && object.page_number !== null) { + message.pageNumber = BigInt(object.page_number); + } + if (object.page_total !== undefined && object.page_total !== null) { + message.pageTotal = BigInt(object.page_total); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + message.txs = object.txs?.map(e => TxResponse.fromAmino(e)) || []; + return message; }, toAmino(message: SearchTxsResult): SearchTxsResultAmino { const obj: any = {}; - obj.total_count = message.totalCount ? message.totalCount.toString() : undefined; - obj.count = message.count ? message.count.toString() : undefined; - obj.page_number = message.pageNumber ? message.pageNumber.toString() : undefined; - obj.page_total = message.pageTotal ? message.pageTotal.toString() : undefined; - obj.limit = message.limit ? message.limit.toString() : undefined; + obj.total_count = message.totalCount !== BigInt(0) ? message.totalCount.toString() : undefined; + obj.count = message.count !== BigInt(0) ? message.count.toString() : undefined; + obj.page_number = message.pageNumber !== BigInt(0) ? message.pageNumber.toString() : undefined; + obj.page_total = message.pageTotal !== BigInt(0) ? message.pageTotal.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; if (message.txs) { obj.txs = message.txs.map(e => e ? TxResponse.toAmino(e) : undefined); } else { - obj.txs = []; + obj.txs = message.txs; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/base/kv/v1beta1/kv.ts b/packages/api/src/codegen/cosmos/base/kv/v1beta1/kv.ts index 78107e5c..f10db41f 100644 --- a/packages/api/src/codegen/cosmos/base/kv/v1beta1/kv.ts +++ b/packages/api/src/codegen/cosmos/base/kv/v1beta1/kv.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** Pairs defines a repeated slice of Pair objects. */ export interface Pairs { @@ -10,7 +10,7 @@ export interface PairsProtoMsg { } /** Pairs defines a repeated slice of Pair objects. */ export interface PairsAmino { - pairs: PairAmino[]; + pairs?: PairAmino[]; } export interface PairsAminoMsg { type: "cosmos-sdk/Pairs"; @@ -31,8 +31,8 @@ export interface PairProtoMsg { } /** Pair defines a key/value bytes tuple. */ export interface PairAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; } export interface PairAminoMsg { type: "cosmos-sdk/Pair"; @@ -49,14 +49,15 @@ function createBasePairs(): Pairs { }; } export const Pairs = { - encode(message: Pairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.kv.v1beta1.Pairs", + encode(message: Pairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pairs) { Pair.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Pairs { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Pairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePairs(); while (reader.pos < end) { @@ -92,16 +93,16 @@ export const Pairs = { return message; }, fromAmino(object: PairsAmino): Pairs { - return { - pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => Pair.fromAmino(e)) : [] - }; + const message = createBasePairs(); + message.pairs = object.pairs?.map(e => Pair.fromAmino(e)) || []; + return message; }, toAmino(message: Pairs): PairsAmino { const obj: any = {}; if (message.pairs) { obj.pairs = message.pairs.map(e => e ? Pair.toAmino(e) : undefined); } else { - obj.pairs = []; + obj.pairs = message.pairs; } return obj; }, @@ -134,7 +135,8 @@ function createBasePair(): Pair { }; } export const Pair = { - encode(message: Pair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.kv.v1beta1.Pair", + encode(message: Pair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -143,8 +145,8 @@ export const Pair = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Pair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Pair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePair(); while (reader.pos < end) { @@ -182,15 +184,19 @@ export const Pair = { return message; }, fromAmino(object: PairAmino): Pair { - return { - key: object.key, - value: object.value - }; + const message = createBasePair(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: Pair): PairAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: PairAminoMsg): Pair { diff --git a/packages/api/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts index a02308e9..4d1214c6 100644 --- a/packages/api/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { ConfigRequest, ConfigResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts b/packages/api/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts index 92c37fa2..1651b097 100644 --- a/packages/api/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts +++ b/packages/api/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { ConfigRequest, ConfigResponse } from "./query"; /** Service defines the gRPC querier service for node related queries. */ @@ -16,7 +16,7 @@ export class ServiceClientImpl implements Service { config(request: ConfigRequest = {}): Promise { const data = ConfigRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Config", data); - return promise.then(data => ConfigResponse.decode(new _m0.Reader(data))); + return promise.then(data => ConfigResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/base/node/v1beta1/query.ts b/packages/api/src/codegen/cosmos/base/node/v1beta1/query.ts index 48530976..a4a99aa0 100644 --- a/packages/api/src/codegen/cosmos/base/node/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/base/node/v1beta1/query.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** ConfigRequest defines the request structure for the Config gRPC query. */ export interface ConfigRequest {} @@ -24,7 +24,7 @@ export interface ConfigResponseProtoMsg { } /** ConfigResponse defines the response structure for the Config gRPC query. */ export interface ConfigResponseAmino { - minimum_gas_price: string; + minimum_gas_price?: string; } export interface ConfigResponseAminoMsg { type: "cosmos-sdk/ConfigResponse"; @@ -38,11 +38,12 @@ function createBaseConfigRequest(): ConfigRequest { return {}; } export const ConfigRequest = { - encode(_: ConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.node.v1beta1.ConfigRequest", + encode(_: ConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConfigRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfigRequest(); while (reader.pos < end) { @@ -67,7 +68,8 @@ export const ConfigRequest = { return message; }, fromAmino(_: ConfigRequestAmino): ConfigRequest { - return {}; + const message = createBaseConfigRequest(); + return message; }, toAmino(_: ConfigRequest): ConfigRequestAmino { const obj: any = {}; @@ -101,14 +103,15 @@ function createBaseConfigResponse(): ConfigResponse { }; } export const ConfigResponse = { - encode(message: ConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.node.v1beta1.ConfigResponse", + encode(message: ConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minimumGasPrice !== "") { writer.uint32(10).string(message.minimumGasPrice); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConfigResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfigResponse(); while (reader.pos < end) { @@ -140,13 +143,15 @@ export const ConfigResponse = { return message; }, fromAmino(object: ConfigResponseAmino): ConfigResponse { - return { - minimumGasPrice: object.minimum_gas_price - }; + const message = createBaseConfigResponse(); + if (object.minimum_gas_price !== undefined && object.minimum_gas_price !== null) { + message.minimumGasPrice = object.minimum_gas_price; + } + return message; }, toAmino(message: ConfigResponse): ConfigResponseAmino { const obj: any = {}; - obj.minimum_gas_price = message.minimumGasPrice; + obj.minimum_gas_price = message.minimumGasPrice === "" ? undefined : message.minimumGasPrice; return obj; }, fromAminoMsg(object: ConfigResponseAminoMsg): ConfigResponse { diff --git a/packages/api/src/codegen/cosmos/base/query/v1beta1/pagination.ts b/packages/api/src/codegen/cosmos/base/query/v1beta1/pagination.ts index 0906f88e..0a99d0d5 100644 --- a/packages/api/src/codegen/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/api/src/codegen/cosmos/base/query/v1beta1/pagination.ts @@ -1,5 +1,5 @@ -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * PageRequest is to be embedded in gRPC request messages for efficient * pagination. Ex: @@ -21,12 +21,12 @@ export interface PageRequest { * It is less efficient than using key. Only one of offset or key should * be set. */ - offset: Long; + offset: bigint; /** * limit is the total number of results to be returned in the result page. * If left empty it will default to a value to be set by each app. */ - limit: Long; + limit: bigint; /** * count_total is set to true to indicate that the result set should include * a count of the total number of items available for pagination in UIs. @@ -60,31 +60,31 @@ export interface PageRequestAmino { * querying the next page most efficiently. Only one of offset or key * should be set. */ - key: Uint8Array; + key?: string; /** * offset is a numeric offset that can be used when key is unavailable. * It is less efficient than using key. Only one of offset or key should * be set. */ - offset: string; + offset?: string; /** * limit is the total number of results to be returned in the result page. * If left empty it will default to a value to be set by each app. */ - limit: string; + limit?: string; /** * count_total is set to true to indicate that the result set should include * a count of the total number of items available for pagination in UIs. * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + count_total?: boolean; /** * reverse is set to true if results are to be returned in the descending order. * * Since: cosmos-sdk 0.43 */ - reverse: boolean; + reverse?: boolean; } export interface PageRequestAminoMsg { type: "cosmos-sdk/PageRequest"; @@ -101,8 +101,8 @@ export interface PageRequestAminoMsg { */ export interface PageRequestSDKType { key: Uint8Array; - offset: Long; - limit: Long; + offset: bigint; + limit: bigint; count_total: boolean; reverse: boolean; } @@ -126,7 +126,7 @@ export interface PageResponse { * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise */ - total: Long; + total: bigint; } export interface PageResponseProtoMsg { typeUrl: "/cosmos.base.query.v1beta1.PageResponse"; @@ -147,12 +147,12 @@ export interface PageResponseAmino { * query the next page most efficiently. It will be empty if * there are no more results. */ - next_key: Uint8Array; + next_key?: string; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise */ - total: string; + total?: string; } export interface PageResponseAminoMsg { type: "cosmos-sdk/PageResponse"; @@ -169,26 +169,27 @@ export interface PageResponseAminoMsg { */ export interface PageResponseSDKType { next_key: Uint8Array; - total: Long; + total: bigint; } function createBasePageRequest(): PageRequest { return { key: new Uint8Array(), - offset: Long.UZERO, - limit: Long.UZERO, + offset: BigInt(0), + limit: BigInt(0), countTotal: false, reverse: false }; } export const PageRequest = { - encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + encode(message: PageRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } - if (!message.offset.isZero()) { + if (message.offset !== BigInt(0)) { writer.uint32(16).uint64(message.offset); } - if (!message.limit.isZero()) { + if (message.limit !== BigInt(0)) { writer.uint32(24).uint64(message.limit); } if (message.countTotal === true) { @@ -199,8 +200,8 @@ export const PageRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePageRequest(); while (reader.pos < end) { @@ -210,10 +211,10 @@ export const PageRequest = { message.key = reader.bytes(); break; case 2: - message.offset = (reader.uint64() as Long); + message.offset = reader.uint64(); break; case 3: - message.limit = (reader.uint64() as Long); + message.limit = reader.uint64(); break; case 4: message.countTotal = reader.bool(); @@ -231,8 +232,8 @@ export const PageRequest = { fromJSON(object: any): PageRequest { return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), - offset: isSet(object.offset) ? Long.fromValue(object.offset) : Long.UZERO, - limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO, + offset: isSet(object.offset) ? BigInt(object.offset.toString()) : BigInt(0), + limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0), countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false, reverse: isSet(object.reverse) ? Boolean(object.reverse) : false }; @@ -240,8 +241,8 @@ export const PageRequest = { toJSON(message: PageRequest): unknown { const obj: any = {}; message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.offset !== undefined && (obj.offset = (message.offset || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; @@ -249,28 +250,38 @@ export const PageRequest = { fromPartial(object: Partial): PageRequest { const message = createBasePageRequest(); message.key = object.key ?? new Uint8Array(); - message.offset = object.offset !== undefined && object.offset !== null ? Long.fromValue(object.offset) : Long.UZERO; - message.limit = object.limit !== undefined && object.limit !== null ? Long.fromValue(object.limit) : Long.UZERO; + message.offset = object.offset !== undefined && object.offset !== null ? BigInt(object.offset.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); message.countTotal = object.countTotal ?? false; message.reverse = object.reverse ?? false; return message; }, fromAmino(object: PageRequestAmino): PageRequest { - return { - key: object.key, - offset: Long.fromString(object.offset), - limit: Long.fromString(object.limit), - countTotal: object.count_total, - reverse: object.reverse - }; + const message = createBasePageRequest(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = BigInt(object.offset); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.count_total !== undefined && object.count_total !== null) { + message.countTotal = object.count_total; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } + return message; }, toAmino(message: PageRequest): PageRequestAmino { const obj: any = {}; - obj.key = message.key; - 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.key = message.key ? base64FromBytes(message.key) : undefined; + 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 { @@ -298,21 +309,22 @@ export const PageRequest = { function createBasePageResponse(): PageResponse { return { nextKey: new Uint8Array(), - total: Long.UZERO + total: BigInt(0) }; } export const PageResponse = { - encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + encode(message: PageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.nextKey.length !== 0) { writer.uint32(10).bytes(message.nextKey); } - if (!message.total.isZero()) { + if (message.total !== BigInt(0)) { writer.uint32(16).uint64(message.total); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePageResponse(); while (reader.pos < end) { @@ -322,7 +334,7 @@ export const PageResponse = { message.nextKey = reader.bytes(); break; case 2: - message.total = (reader.uint64() as Long); + message.total = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -334,31 +346,35 @@ export const PageResponse = { fromJSON(object: any): PageResponse { return { nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), - total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO + total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0) }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; message.nextKey !== undefined && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); - message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): PageResponse { const message = createBasePageResponse(); message.nextKey = object.nextKey ?? new Uint8Array(); - message.total = object.total !== undefined && object.total !== null ? Long.fromValue(object.total) : Long.UZERO; + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); return message; }, fromAmino(object: PageResponseAmino): PageResponse { - return { - nextKey: object.next_key, - total: Long.fromString(object.total) - }; + const message = createBasePageResponse(); + if (object.next_key !== undefined && object.next_key !== null) { + message.nextKey = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; }, toAmino(message: PageResponse): PageResponseAmino { const obj: any = {}; - obj.next_key = message.nextKey; - obj.total = message.total ? message.total.toString() : undefined; + obj.next_key = message.nextKey ? base64FromBytes(message.nextKey) : undefined; + obj.total = message.total !== BigInt(0) ? message.total.toString() : undefined; return obj; }, fromAminoMsg(object: PageResponseAminoMsg): PageResponse { diff --git a/packages/api/src/codegen/cosmos/base/reflection/v1beta1/reflection.ts b/packages/api/src/codegen/cosmos/base/reflection/v1beta1/reflection.ts index e27701c1..f0e10758 100644 --- a/packages/api/src/codegen/cosmos/base/reflection/v1beta1/reflection.ts +++ b/packages/api/src/codegen/cosmos/base/reflection/v1beta1/reflection.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ export interface ListAllInterfacesRequest {} @@ -26,7 +26,7 @@ export interface ListAllInterfacesResponseProtoMsg { /** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */ export interface ListAllInterfacesResponseAmino { /** interface_names is an array of all the registered interfaces. */ - interface_names: string[]; + interface_names?: string[]; } export interface ListAllInterfacesResponseAminoMsg { type: "cosmos-sdk/ListAllInterfacesResponse"; @@ -54,7 +54,7 @@ export interface ListImplementationsRequestProtoMsg { */ export interface ListImplementationsRequestAmino { /** interface_name defines the interface to query the implementations for. */ - interface_name: string; + interface_name?: string; } export interface ListImplementationsRequestAminoMsg { type: "cosmos-sdk/ListImplementationsRequest"; @@ -83,7 +83,7 @@ export interface ListImplementationsResponseProtoMsg { * RPC. */ export interface ListImplementationsResponseAmino { - implementation_message_names: string[]; + implementation_message_names?: string[]; } export interface ListImplementationsResponseAminoMsg { type: "cosmos-sdk/ListImplementationsResponse"; @@ -100,11 +100,12 @@ function createBaseListAllInterfacesRequest(): ListAllInterfacesRequest { return {}; } export const ListAllInterfacesRequest = { - encode(_: ListAllInterfacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest", + encode(_: ListAllInterfacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListAllInterfacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListAllInterfacesRequest(); while (reader.pos < end) { @@ -129,7 +130,8 @@ export const ListAllInterfacesRequest = { return message; }, fromAmino(_: ListAllInterfacesRequestAmino): ListAllInterfacesRequest { - return {}; + const message = createBaseListAllInterfacesRequest(); + return message; }, toAmino(_: ListAllInterfacesRequest): ListAllInterfacesRequestAmino { const obj: any = {}; @@ -163,14 +165,15 @@ function createBaseListAllInterfacesResponse(): ListAllInterfacesResponse { }; } export const ListAllInterfacesResponse = { - encode(message: ListAllInterfacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse", + encode(message: ListAllInterfacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.interfaceNames) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListAllInterfacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListAllInterfacesResponse(); while (reader.pos < end) { @@ -206,16 +209,16 @@ export const ListAllInterfacesResponse = { return message; }, fromAmino(object: ListAllInterfacesResponseAmino): ListAllInterfacesResponse { - return { - interfaceNames: Array.isArray(object?.interface_names) ? object.interface_names.map((e: any) => e) : [] - }; + const message = createBaseListAllInterfacesResponse(); + message.interfaceNames = object.interface_names?.map(e => e) || []; + return message; }, toAmino(message: ListAllInterfacesResponse): ListAllInterfacesResponseAmino { const obj: any = {}; if (message.interfaceNames) { obj.interface_names = message.interfaceNames.map(e => e); } else { - obj.interface_names = []; + obj.interface_names = message.interfaceNames; } return obj; }, @@ -247,14 +250,15 @@ function createBaseListImplementationsRequest(): ListImplementationsRequest { }; } export const ListImplementationsRequest = { - encode(message: ListImplementationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsRequest", + encode(message: ListImplementationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.interfaceName !== "") { writer.uint32(10).string(message.interfaceName); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListImplementationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListImplementationsRequest(); while (reader.pos < end) { @@ -286,13 +290,15 @@ export const ListImplementationsRequest = { return message; }, fromAmino(object: ListImplementationsRequestAmino): ListImplementationsRequest { - return { - interfaceName: object.interface_name - }; + const message = createBaseListImplementationsRequest(); + if (object.interface_name !== undefined && object.interface_name !== null) { + message.interfaceName = object.interface_name; + } + return message; }, toAmino(message: ListImplementationsRequest): ListImplementationsRequestAmino { const obj: any = {}; - obj.interface_name = message.interfaceName; + obj.interface_name = message.interfaceName === "" ? undefined : message.interfaceName; return obj; }, fromAminoMsg(object: ListImplementationsRequestAminoMsg): ListImplementationsRequest { @@ -323,14 +329,15 @@ function createBaseListImplementationsResponse(): ListImplementationsResponse { }; } export const ListImplementationsResponse = { - encode(message: ListImplementationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsResponse", + encode(message: ListImplementationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.implementationMessageNames) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListImplementationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListImplementationsResponse(); while (reader.pos < end) { @@ -366,16 +373,16 @@ export const ListImplementationsResponse = { return message; }, fromAmino(object: ListImplementationsResponseAmino): ListImplementationsResponse { - return { - implementationMessageNames: Array.isArray(object?.implementation_message_names) ? object.implementation_message_names.map((e: any) => e) : [] - }; + const message = createBaseListImplementationsResponse(); + message.implementationMessageNames = object.implementation_message_names?.map(e => e) || []; + return message; }, toAmino(message: ListImplementationsResponse): ListImplementationsResponseAmino { const obj: any = {}; if (message.implementationMessageNames) { obj.implementation_message_names = message.implementationMessageNames.map(e => e); } else { - obj.implementation_message_names = []; + obj.implementation_message_names = message.implementationMessageNames; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts b/packages/api/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts index 9f6bca9a..2299f569 100644 --- a/packages/api/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts +++ b/packages/api/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** AppDescriptor describes a cosmos-sdk based application */ export interface AppDescriptor { @@ -6,17 +6,17 @@ export interface AppDescriptor { * AuthnDescriptor provides information on how to authenticate transactions on the application * NOTE: experimental and subject to change in future releases. */ - authn: AuthnDescriptor; + authn?: AuthnDescriptor; /** chain provides the chain descriptor */ - chain: ChainDescriptor; + chain?: ChainDescriptor; /** codec provides metadata information regarding codec related types */ - codec: CodecDescriptor; + codec?: CodecDescriptor; /** configuration provides metadata information regarding the sdk.Config type */ - configuration: ConfigurationDescriptor; + configuration?: ConfigurationDescriptor; /** query_services provides metadata information regarding the available queriable endpoints */ - queryServices: QueryServicesDescriptor; + queryServices?: QueryServicesDescriptor; /** tx provides metadata information regarding how to send transactions to the given application */ - tx: TxDescriptor; + tx?: TxDescriptor; } export interface AppDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor"; @@ -46,12 +46,12 @@ export interface AppDescriptorAminoMsg { } /** AppDescriptor describes a cosmos-sdk based application */ export interface AppDescriptorSDKType { - authn: AuthnDescriptorSDKType; - chain: ChainDescriptorSDKType; - codec: CodecDescriptorSDKType; - configuration: ConfigurationDescriptorSDKType; - query_services: QueryServicesDescriptorSDKType; - tx: TxDescriptorSDKType; + authn?: AuthnDescriptorSDKType; + chain?: ChainDescriptorSDKType; + codec?: CodecDescriptorSDKType; + configuration?: ConfigurationDescriptorSDKType; + query_services?: QueryServicesDescriptorSDKType; + tx?: TxDescriptorSDKType; } /** TxDescriptor describes the accepted transaction type */ export interface TxDescriptor { @@ -75,9 +75,9 @@ export interface TxDescriptorAmino { * it is not meant to support polymorphism of transaction types, it is supposed to be used by * reflection clients to understand if they can handle a specific transaction type in an application. */ - fullname: string; + fullname?: string; /** msgs lists the accepted application messages (sdk.Msg) */ - msgs: MsgDescriptorAmino[]; + msgs?: MsgDescriptorAmino[]; } export interface TxDescriptorAminoMsg { type: "cosmos-sdk/TxDescriptor"; @@ -106,7 +106,7 @@ export interface AuthnDescriptorProtoMsg { */ export interface AuthnDescriptorAmino { /** sign_modes defines the supported signature algorithm */ - sign_modes: SigningModeDescriptorAmino[]; + sign_modes?: SigningModeDescriptorAmino[]; } export interface AuthnDescriptorAminoMsg { type: "cosmos-sdk/AuthnDescriptor"; @@ -148,14 +148,14 @@ export interface SigningModeDescriptorProtoMsg { */ export interface SigningModeDescriptorAmino { /** name defines the unique name of the signing mode */ - name: string; + name?: string; /** number is the unique int32 identifier for the sign_mode enum */ - number: number; + number?: number; /** * authn_info_provider_method_fullname defines the fullname of the method to call to get * the metadata required to authenticate using the provided sign_modes */ - authn_info_provider_method_fullname: string; + authn_info_provider_method_fullname?: string; } export interface SigningModeDescriptorAminoMsg { type: "cosmos-sdk/SigningModeDescriptor"; @@ -184,7 +184,7 @@ export interface ChainDescriptorProtoMsg { /** ChainDescriptor describes chain information of the application */ export interface ChainDescriptorAmino { /** id is the chain id */ - id: string; + id?: string; } export interface ChainDescriptorAminoMsg { type: "cosmos-sdk/ChainDescriptor"; @@ -206,7 +206,7 @@ export interface CodecDescriptorProtoMsg { /** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ export interface CodecDescriptorAmino { /** interfaces is a list of the registerted interfaces descriptors */ - interfaces: InterfaceDescriptorAmino[]; + interfaces?: InterfaceDescriptorAmino[]; } export interface CodecDescriptorAminoMsg { type: "cosmos-sdk/CodecDescriptor"; @@ -235,14 +235,14 @@ export interface InterfaceDescriptorProtoMsg { /** InterfaceDescriptor describes the implementation of an interface */ export interface InterfaceDescriptorAmino { /** fullname is the name of the interface */ - fullname: string; + fullname?: string; /** * interface_accepting_messages contains information regarding the proto messages which contain the interface as * google.protobuf.Any field */ - interface_accepting_messages: InterfaceAcceptingMessageDescriptorAmino[]; + interface_accepting_messages?: InterfaceAcceptingMessageDescriptorAmino[]; /** interface_implementers is a list of the descriptors of the interface implementers */ - interface_implementers: InterfaceImplementerDescriptorAmino[]; + interface_implementers?: InterfaceImplementerDescriptorAmino[]; } export interface InterfaceDescriptorAminoMsg { type: "cosmos-sdk/InterfaceDescriptor"; @@ -273,14 +273,14 @@ export interface InterfaceImplementerDescriptorProtoMsg { /** InterfaceImplementerDescriptor describes an interface implementer */ export interface InterfaceImplementerDescriptorAmino { /** fullname is the protobuf queryable name of the interface implementer */ - fullname: string; + fullname?: string; /** * type_url defines the type URL used when marshalling the type as any * this is required so we can provide type safe google.protobuf.Any marshalling and * unmarshalling, making sure that we don't accept just 'any' type * in our interface fields */ - type_url: string; + type_url?: string; } export interface InterfaceImplementerDescriptorAminoMsg { type: "cosmos-sdk/InterfaceImplementerDescriptor"; @@ -315,13 +315,13 @@ export interface InterfaceAcceptingMessageDescriptorProtoMsg { */ export interface InterfaceAcceptingMessageDescriptorAmino { /** fullname is the protobuf fullname of the type containing the interface */ - fullname: string; + fullname?: string; /** * field_descriptor_names is a list of the protobuf name (not fullname) of the field * which contains the interface as google.protobuf.Any (the interface is the same, but * it can be in multiple fields of the same proto message) */ - field_descriptor_names: string[]; + field_descriptor_names?: string[]; } export interface InterfaceAcceptingMessageDescriptorAminoMsg { type: "cosmos-sdk/InterfaceAcceptingMessageDescriptor"; @@ -347,7 +347,7 @@ export interface ConfigurationDescriptorProtoMsg { /** ConfigurationDescriptor contains metadata information on the sdk.Config */ export interface ConfigurationDescriptorAmino { /** bech32_account_address_prefix is the account address prefix */ - bech32_account_address_prefix: string; + bech32_account_address_prefix?: string; } export interface ConfigurationDescriptorAminoMsg { type: "cosmos-sdk/ConfigurationDescriptor"; @@ -369,7 +369,7 @@ export interface MsgDescriptorProtoMsg { /** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ export interface MsgDescriptorAmino { /** msg_type_url contains the TypeURL of a sdk.Msg. */ - msg_type_url: string; + msg_type_url?: string; } export interface MsgDescriptorAminoMsg { type: "cosmos-sdk/MsgDescriptor"; @@ -396,7 +396,7 @@ export interface GetAuthnDescriptorRequestSDKType {} /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponse { /** authn describes how to authenticate to the application when sending transactions */ - authn: AuthnDescriptor; + authn?: AuthnDescriptor; } export interface GetAuthnDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse"; @@ -413,7 +413,7 @@ export interface GetAuthnDescriptorResponseAminoMsg { } /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponseSDKType { - authn: AuthnDescriptorSDKType; + authn?: AuthnDescriptorSDKType; } /** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ export interface GetChainDescriptorRequest {} @@ -432,7 +432,7 @@ export interface GetChainDescriptorRequestSDKType {} /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponse { /** chain describes application chain information */ - chain: ChainDescriptor; + chain?: ChainDescriptor; } export interface GetChainDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse"; @@ -449,7 +449,7 @@ export interface GetChainDescriptorResponseAminoMsg { } /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponseSDKType { - chain: ChainDescriptorSDKType; + chain?: ChainDescriptorSDKType; } /** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ export interface GetCodecDescriptorRequest {} @@ -468,7 +468,7 @@ export interface GetCodecDescriptorRequestSDKType {} /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponse { /** codec describes the application codec such as registered interfaces and implementations */ - codec: CodecDescriptor; + codec?: CodecDescriptor; } export interface GetCodecDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse"; @@ -485,7 +485,7 @@ export interface GetCodecDescriptorResponseAminoMsg { } /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponseSDKType { - codec: CodecDescriptorSDKType; + codec?: CodecDescriptorSDKType; } /** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorRequest {} @@ -504,7 +504,7 @@ export interface GetConfigurationDescriptorRequestSDKType {} /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponse { /** config describes the application's sdk.Config */ - config: ConfigurationDescriptor; + config?: ConfigurationDescriptor; } export interface GetConfigurationDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse"; @@ -521,7 +521,7 @@ export interface GetConfigurationDescriptorResponseAminoMsg { } /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponseSDKType { - config: ConfigurationDescriptorSDKType; + config?: ConfigurationDescriptorSDKType; } /** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorRequest {} @@ -540,7 +540,7 @@ export interface GetQueryServicesDescriptorRequestSDKType {} /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponse { /** queries provides information on the available queryable services */ - queries: QueryServicesDescriptor; + queries?: QueryServicesDescriptor; } export interface GetQueryServicesDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse"; @@ -557,7 +557,7 @@ export interface GetQueryServicesDescriptorResponseAminoMsg { } /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponseSDKType { - queries: QueryServicesDescriptorSDKType; + queries?: QueryServicesDescriptorSDKType; } /** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ export interface GetTxDescriptorRequest {} @@ -579,7 +579,7 @@ export interface GetTxDescriptorResponse { * tx provides information on msgs that can be forwarded to the application * alongside the accepted transaction protobuf type */ - tx: TxDescriptor; + tx?: TxDescriptor; } export interface GetTxDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse"; @@ -599,7 +599,7 @@ export interface GetTxDescriptorResponseAminoMsg { } /** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ export interface GetTxDescriptorResponseSDKType { - tx: TxDescriptorSDKType; + tx?: TxDescriptorSDKType; } /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptor { @@ -613,7 +613,7 @@ export interface QueryServicesDescriptorProtoMsg { /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptorAmino { /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ - query_services: QueryServiceDescriptorAmino[]; + query_services?: QueryServiceDescriptorAmino[]; } export interface QueryServicesDescriptorAminoMsg { type: "cosmos-sdk/QueryServicesDescriptor"; @@ -639,11 +639,11 @@ export interface QueryServiceDescriptorProtoMsg { /** QueryServiceDescriptor describes a cosmos-sdk queryable service */ export interface QueryServiceDescriptorAmino { /** fullname is the protobuf fullname of the service descriptor */ - fullname: string; + fullname?: string; /** is_module describes if this service is actually exposed by an application's module */ - is_module: boolean; + is_module?: boolean; /** methods provides a list of query service methods */ - methods: QueryMethodDescriptorAmino[]; + methods?: QueryMethodDescriptorAmino[]; } export interface QueryServiceDescriptorAminoMsg { type: "cosmos-sdk/QueryServiceDescriptor"; @@ -680,12 +680,12 @@ export interface QueryMethodDescriptorProtoMsg { */ export interface QueryMethodDescriptorAmino { /** name is the protobuf name (not fullname) of the method */ - name: string; + name?: string; /** * full_query_path is the path that can be used to query * this method via tendermint abci.Query */ - full_query_path: string; + full_query_path?: string; } export interface QueryMethodDescriptorAminoMsg { type: "cosmos-sdk/QueryMethodDescriptor"; @@ -702,16 +702,17 @@ export interface QueryMethodDescriptorSDKType { } function createBaseAppDescriptor(): AppDescriptor { return { - authn: AuthnDescriptor.fromPartial({}), - chain: ChainDescriptor.fromPartial({}), - codec: CodecDescriptor.fromPartial({}), - configuration: ConfigurationDescriptor.fromPartial({}), - queryServices: QueryServicesDescriptor.fromPartial({}), - tx: TxDescriptor.fromPartial({}) + authn: undefined, + chain: undefined, + codec: undefined, + configuration: undefined, + queryServices: undefined, + tx: undefined }; } export const AppDescriptor = { - encode(message: AppDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor", + encode(message: AppDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authn !== undefined) { AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); } @@ -732,8 +733,8 @@ export const AppDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AppDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AppDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppDescriptor(); while (reader.pos < end) { @@ -795,14 +796,26 @@ export const AppDescriptor = { return message; }, fromAmino(object: AppDescriptorAmino): AppDescriptor { - return { - authn: object?.authn ? AuthnDescriptor.fromAmino(object.authn) : undefined, - chain: object?.chain ? ChainDescriptor.fromAmino(object.chain) : undefined, - codec: object?.codec ? CodecDescriptor.fromAmino(object.codec) : undefined, - configuration: object?.configuration ? ConfigurationDescriptor.fromAmino(object.configuration) : undefined, - queryServices: object?.query_services ? QueryServicesDescriptor.fromAmino(object.query_services) : undefined, - tx: object?.tx ? TxDescriptor.fromAmino(object.tx) : undefined - }; + const message = createBaseAppDescriptor(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + if (object.configuration !== undefined && object.configuration !== null) { + message.configuration = ConfigurationDescriptor.fromAmino(object.configuration); + } + if (object.query_services !== undefined && object.query_services !== null) { + message.queryServices = QueryServicesDescriptor.fromAmino(object.query_services); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; }, toAmino(message: AppDescriptor): AppDescriptorAmino { const obj: any = {}; @@ -843,7 +856,8 @@ function createBaseTxDescriptor(): TxDescriptor { }; } export const TxDescriptor = { - encode(message: TxDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.TxDescriptor", + encode(message: TxDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); } @@ -852,8 +866,8 @@ export const TxDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxDescriptor(); while (reader.pos < end) { @@ -895,18 +909,20 @@ export const TxDescriptor = { return message; }, fromAmino(object: TxDescriptorAmino): TxDescriptor { - return { - fullname: object.fullname, - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => MsgDescriptor.fromAmino(e)) : [] - }; + const message = createBaseTxDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.msgs = object.msgs?.map(e => MsgDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: TxDescriptor): TxDescriptorAmino { const obj: any = {}; - obj.fullname = message.fullname; + obj.fullname = message.fullname === "" ? undefined : message.fullname; if (message.msgs) { obj.msgs = message.msgs.map(e => e ? MsgDescriptor.toAmino(e) : undefined); } else { - obj.msgs = []; + obj.msgs = message.msgs; } return obj; }, @@ -938,14 +954,15 @@ function createBaseAuthnDescriptor(): AuthnDescriptor { }; } export const AuthnDescriptor = { - encode(message: AuthnDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.AuthnDescriptor", + encode(message: AuthnDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signModes) { SigningModeDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AuthnDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AuthnDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAuthnDescriptor(); while (reader.pos < end) { @@ -981,16 +998,16 @@ export const AuthnDescriptor = { return message; }, fromAmino(object: AuthnDescriptorAmino): AuthnDescriptor { - return { - signModes: Array.isArray(object?.sign_modes) ? object.sign_modes.map((e: any) => SigningModeDescriptor.fromAmino(e)) : [] - }; + const message = createBaseAuthnDescriptor(); + message.signModes = object.sign_modes?.map(e => SigningModeDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: AuthnDescriptor): AuthnDescriptorAmino { const obj: any = {}; if (message.signModes) { obj.sign_modes = message.signModes.map(e => e ? SigningModeDescriptor.toAmino(e) : undefined); } else { - obj.sign_modes = []; + obj.sign_modes = message.signModes; } return obj; }, @@ -1024,7 +1041,8 @@ function createBaseSigningModeDescriptor(): SigningModeDescriptor { }; } export const SigningModeDescriptor = { - encode(message: SigningModeDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor", + encode(message: SigningModeDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1036,8 +1054,8 @@ export const SigningModeDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SigningModeDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SigningModeDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSigningModeDescriptor(); while (reader.pos < end) { @@ -1081,17 +1099,23 @@ export const SigningModeDescriptor = { return message; }, fromAmino(object: SigningModeDescriptorAmino): SigningModeDescriptor { - return { - name: object.name, - number: object.number, - authnInfoProviderMethodFullname: object.authn_info_provider_method_fullname - }; + const message = createBaseSigningModeDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.authn_info_provider_method_fullname !== undefined && object.authn_info_provider_method_fullname !== null) { + message.authnInfoProviderMethodFullname = object.authn_info_provider_method_fullname; + } + return message; }, toAmino(message: SigningModeDescriptor): SigningModeDescriptorAmino { const obj: any = {}; - obj.name = message.name; - obj.number = message.number; - obj.authn_info_provider_method_fullname = message.authnInfoProviderMethodFullname; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.authn_info_provider_method_fullname = message.authnInfoProviderMethodFullname === "" ? undefined : message.authnInfoProviderMethodFullname; return obj; }, fromAminoMsg(object: SigningModeDescriptorAminoMsg): SigningModeDescriptor { @@ -1122,14 +1146,15 @@ function createBaseChainDescriptor(): ChainDescriptor { }; } export const ChainDescriptor = { - encode(message: ChainDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.ChainDescriptor", + encode(message: ChainDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ChainDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ChainDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseChainDescriptor(); while (reader.pos < end) { @@ -1161,13 +1186,15 @@ export const ChainDescriptor = { return message; }, fromAmino(object: ChainDescriptorAmino): ChainDescriptor { - return { - id: object.id - }; + const message = createBaseChainDescriptor(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; }, toAmino(message: ChainDescriptor): ChainDescriptorAmino { const obj: any = {}; - obj.id = message.id; + obj.id = message.id === "" ? undefined : message.id; return obj; }, fromAminoMsg(object: ChainDescriptorAminoMsg): ChainDescriptor { @@ -1198,14 +1225,15 @@ function createBaseCodecDescriptor(): CodecDescriptor { }; } export const CodecDescriptor = { - encode(message: CodecDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.CodecDescriptor", + encode(message: CodecDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.interfaces) { InterfaceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CodecDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CodecDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCodecDescriptor(); while (reader.pos < end) { @@ -1241,16 +1269,16 @@ export const CodecDescriptor = { return message; }, fromAmino(object: CodecDescriptorAmino): CodecDescriptor { - return { - interfaces: Array.isArray(object?.interfaces) ? object.interfaces.map((e: any) => InterfaceDescriptor.fromAmino(e)) : [] - }; + const message = createBaseCodecDescriptor(); + message.interfaces = object.interfaces?.map(e => InterfaceDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: CodecDescriptor): CodecDescriptorAmino { const obj: any = {}; if (message.interfaces) { obj.interfaces = message.interfaces.map(e => e ? InterfaceDescriptor.toAmino(e) : undefined); } else { - obj.interfaces = []; + obj.interfaces = message.interfaces; } return obj; }, @@ -1284,7 +1312,8 @@ function createBaseInterfaceDescriptor(): InterfaceDescriptor { }; } export const InterfaceDescriptor = { - encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor", + encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); } @@ -1296,8 +1325,8 @@ export const InterfaceDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInterfaceDescriptor(); while (reader.pos < end) { @@ -1349,24 +1378,26 @@ export const InterfaceDescriptor = { return message; }, fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - return { - fullname: object.fullname, - interfaceAcceptingMessages: Array.isArray(object?.interface_accepting_messages) ? object.interface_accepting_messages.map((e: any) => InterfaceAcceptingMessageDescriptor.fromAmino(e)) : [], - interfaceImplementers: Array.isArray(object?.interface_implementers) ? object.interface_implementers.map((e: any) => InterfaceImplementerDescriptor.fromAmino(e)) : [] - }; + const message = createBaseInterfaceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.interfaceAcceptingMessages = object.interface_accepting_messages?.map(e => InterfaceAcceptingMessageDescriptor.fromAmino(e)) || []; + message.interfaceImplementers = object.interface_implementers?.map(e => InterfaceImplementerDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { const obj: any = {}; - obj.fullname = message.fullname; + obj.fullname = message.fullname === "" ? undefined : message.fullname; if (message.interfaceAcceptingMessages) { obj.interface_accepting_messages = message.interfaceAcceptingMessages.map(e => e ? InterfaceAcceptingMessageDescriptor.toAmino(e) : undefined); } else { - obj.interface_accepting_messages = []; + obj.interface_accepting_messages = message.interfaceAcceptingMessages; } if (message.interfaceImplementers) { obj.interface_implementers = message.interfaceImplementers.map(e => e ? InterfaceImplementerDescriptor.toAmino(e) : undefined); } else { - obj.interface_implementers = []; + obj.interface_implementers = message.interfaceImplementers; } return obj; }, @@ -1399,7 +1430,8 @@ function createBaseInterfaceImplementerDescriptor(): InterfaceImplementerDescrip }; } export const InterfaceImplementerDescriptor = { - encode(message: InterfaceImplementerDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", + encode(message: InterfaceImplementerDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); } @@ -1408,8 +1440,8 @@ export const InterfaceImplementerDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceImplementerDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceImplementerDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInterfaceImplementerDescriptor(); while (reader.pos < end) { @@ -1447,15 +1479,19 @@ export const InterfaceImplementerDescriptor = { return message; }, fromAmino(object: InterfaceImplementerDescriptorAmino): InterfaceImplementerDescriptor { - return { - fullname: object.fullname, - typeUrl: object.type_url - }; + const message = createBaseInterfaceImplementerDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.type_url !== undefined && object.type_url !== null) { + message.typeUrl = object.type_url; + } + return message; }, toAmino(message: InterfaceImplementerDescriptor): InterfaceImplementerDescriptorAmino { const obj: any = {}; - obj.fullname = message.fullname; - obj.type_url = message.typeUrl; + obj.fullname = message.fullname === "" ? undefined : message.fullname; + obj.type_url = message.typeUrl === "" ? undefined : message.typeUrl; return obj; }, fromAminoMsg(object: InterfaceImplementerDescriptorAminoMsg): InterfaceImplementerDescriptor { @@ -1487,7 +1523,8 @@ function createBaseInterfaceAcceptingMessageDescriptor(): InterfaceAcceptingMess }; } export const InterfaceAcceptingMessageDescriptor = { - encode(message: InterfaceAcceptingMessageDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", + encode(message: InterfaceAcceptingMessageDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); } @@ -1496,8 +1533,8 @@ export const InterfaceAcceptingMessageDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceAcceptingMessageDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceAcceptingMessageDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInterfaceAcceptingMessageDescriptor(); while (reader.pos < end) { @@ -1539,18 +1576,20 @@ export const InterfaceAcceptingMessageDescriptor = { return message; }, fromAmino(object: InterfaceAcceptingMessageDescriptorAmino): InterfaceAcceptingMessageDescriptor { - return { - fullname: object.fullname, - fieldDescriptorNames: Array.isArray(object?.field_descriptor_names) ? object.field_descriptor_names.map((e: any) => e) : [] - }; + const message = createBaseInterfaceAcceptingMessageDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.fieldDescriptorNames = object.field_descriptor_names?.map(e => e) || []; + return message; }, toAmino(message: InterfaceAcceptingMessageDescriptor): InterfaceAcceptingMessageDescriptorAmino { const obj: any = {}; - obj.fullname = message.fullname; + obj.fullname = message.fullname === "" ? undefined : message.fullname; if (message.fieldDescriptorNames) { obj.field_descriptor_names = message.fieldDescriptorNames.map(e => e); } else { - obj.field_descriptor_names = []; + obj.field_descriptor_names = message.fieldDescriptorNames; } return obj; }, @@ -1582,14 +1621,15 @@ function createBaseConfigurationDescriptor(): ConfigurationDescriptor { }; } export const ConfigurationDescriptor = { - encode(message: ConfigurationDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor", + encode(message: ConfigurationDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bech32AccountAddressPrefix !== "") { writer.uint32(10).string(message.bech32AccountAddressPrefix); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConfigurationDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConfigurationDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfigurationDescriptor(); while (reader.pos < end) { @@ -1621,13 +1661,15 @@ export const ConfigurationDescriptor = { return message; }, fromAmino(object: ConfigurationDescriptorAmino): ConfigurationDescriptor { - return { - bech32AccountAddressPrefix: object.bech32_account_address_prefix - }; + const message = createBaseConfigurationDescriptor(); + if (object.bech32_account_address_prefix !== undefined && object.bech32_account_address_prefix !== null) { + message.bech32AccountAddressPrefix = object.bech32_account_address_prefix; + } + return message; }, toAmino(message: ConfigurationDescriptor): ConfigurationDescriptorAmino { const obj: any = {}; - obj.bech32_account_address_prefix = message.bech32AccountAddressPrefix; + obj.bech32_account_address_prefix = message.bech32AccountAddressPrefix === "" ? undefined : message.bech32AccountAddressPrefix; return obj; }, fromAminoMsg(object: ConfigurationDescriptorAminoMsg): ConfigurationDescriptor { @@ -1658,14 +1700,15 @@ function createBaseMsgDescriptor(): MsgDescriptor { }; } export const MsgDescriptor = { - encode(message: MsgDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.MsgDescriptor", + encode(message: MsgDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgTypeUrl !== "") { writer.uint32(10).string(message.msgTypeUrl); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDescriptor(); while (reader.pos < end) { @@ -1697,13 +1740,15 @@ export const MsgDescriptor = { return message; }, fromAmino(object: MsgDescriptorAmino): MsgDescriptor { - return { - msgTypeUrl: object.msg_type_url - }; + const message = createBaseMsgDescriptor(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; }, toAmino(message: MsgDescriptor): MsgDescriptorAmino { const obj: any = {}; - obj.msg_type_url = message.msgTypeUrl; + obj.msg_type_url = message.msgTypeUrl === "" ? undefined : message.msgTypeUrl; return obj; }, fromAminoMsg(object: MsgDescriptorAminoMsg): MsgDescriptor { @@ -1732,11 +1777,12 @@ function createBaseGetAuthnDescriptorRequest(): GetAuthnDescriptorRequest { return {}; } export const GetAuthnDescriptorRequest = { - encode(_: GetAuthnDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest", + encode(_: GetAuthnDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetAuthnDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetAuthnDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetAuthnDescriptorRequest(); while (reader.pos < end) { @@ -1761,7 +1807,8 @@ export const GetAuthnDescriptorRequest = { return message; }, fromAmino(_: GetAuthnDescriptorRequestAmino): GetAuthnDescriptorRequest { - return {}; + const message = createBaseGetAuthnDescriptorRequest(); + return message; }, toAmino(_: GetAuthnDescriptorRequest): GetAuthnDescriptorRequestAmino { const obj: any = {}; @@ -1791,18 +1838,19 @@ export const GetAuthnDescriptorRequest = { }; function createBaseGetAuthnDescriptorResponse(): GetAuthnDescriptorResponse { return { - authn: AuthnDescriptor.fromPartial({}) + authn: undefined }; } export const GetAuthnDescriptorResponse = { - encode(message: GetAuthnDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse", + encode(message: GetAuthnDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authn !== undefined) { AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetAuthnDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetAuthnDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetAuthnDescriptorResponse(); while (reader.pos < end) { @@ -1834,9 +1882,11 @@ export const GetAuthnDescriptorResponse = { return message; }, fromAmino(object: GetAuthnDescriptorResponseAmino): GetAuthnDescriptorResponse { - return { - authn: object?.authn ? AuthnDescriptor.fromAmino(object.authn) : undefined - }; + const message = createBaseGetAuthnDescriptorResponse(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + return message; }, toAmino(message: GetAuthnDescriptorResponse): GetAuthnDescriptorResponseAmino { const obj: any = {}; @@ -1869,11 +1919,12 @@ function createBaseGetChainDescriptorRequest(): GetChainDescriptorRequest { return {}; } export const GetChainDescriptorRequest = { - encode(_: GetChainDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest", + encode(_: GetChainDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetChainDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetChainDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetChainDescriptorRequest(); while (reader.pos < end) { @@ -1898,7 +1949,8 @@ export const GetChainDescriptorRequest = { return message; }, fromAmino(_: GetChainDescriptorRequestAmino): GetChainDescriptorRequest { - return {}; + const message = createBaseGetChainDescriptorRequest(); + return message; }, toAmino(_: GetChainDescriptorRequest): GetChainDescriptorRequestAmino { const obj: any = {}; @@ -1928,18 +1980,19 @@ export const GetChainDescriptorRequest = { }; function createBaseGetChainDescriptorResponse(): GetChainDescriptorResponse { return { - chain: ChainDescriptor.fromPartial({}) + chain: undefined }; } export const GetChainDescriptorResponse = { - encode(message: GetChainDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse", + encode(message: GetChainDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chain !== undefined) { ChainDescriptor.encode(message.chain, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetChainDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetChainDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetChainDescriptorResponse(); while (reader.pos < end) { @@ -1971,9 +2024,11 @@ export const GetChainDescriptorResponse = { return message; }, fromAmino(object: GetChainDescriptorResponseAmino): GetChainDescriptorResponse { - return { - chain: object?.chain ? ChainDescriptor.fromAmino(object.chain) : undefined - }; + const message = createBaseGetChainDescriptorResponse(); + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + return message; }, toAmino(message: GetChainDescriptorResponse): GetChainDescriptorResponseAmino { const obj: any = {}; @@ -2006,11 +2061,12 @@ function createBaseGetCodecDescriptorRequest(): GetCodecDescriptorRequest { return {}; } export const GetCodecDescriptorRequest = { - encode(_: GetCodecDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest", + encode(_: GetCodecDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetCodecDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetCodecDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetCodecDescriptorRequest(); while (reader.pos < end) { @@ -2035,7 +2091,8 @@ export const GetCodecDescriptorRequest = { return message; }, fromAmino(_: GetCodecDescriptorRequestAmino): GetCodecDescriptorRequest { - return {}; + const message = createBaseGetCodecDescriptorRequest(); + return message; }, toAmino(_: GetCodecDescriptorRequest): GetCodecDescriptorRequestAmino { const obj: any = {}; @@ -2065,18 +2122,19 @@ export const GetCodecDescriptorRequest = { }; function createBaseGetCodecDescriptorResponse(): GetCodecDescriptorResponse { return { - codec: CodecDescriptor.fromPartial({}) + codec: undefined }; } export const GetCodecDescriptorResponse = { - encode(message: GetCodecDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse", + encode(message: GetCodecDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codec !== undefined) { CodecDescriptor.encode(message.codec, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetCodecDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetCodecDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetCodecDescriptorResponse(); while (reader.pos < end) { @@ -2108,9 +2166,11 @@ export const GetCodecDescriptorResponse = { return message; }, fromAmino(object: GetCodecDescriptorResponseAmino): GetCodecDescriptorResponse { - return { - codec: object?.codec ? CodecDescriptor.fromAmino(object.codec) : undefined - }; + const message = createBaseGetCodecDescriptorResponse(); + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + return message; }, toAmino(message: GetCodecDescriptorResponse): GetCodecDescriptorResponseAmino { const obj: any = {}; @@ -2143,11 +2203,12 @@ function createBaseGetConfigurationDescriptorRequest(): GetConfigurationDescript return {}; } export const GetConfigurationDescriptorRequest = { - encode(_: GetConfigurationDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest", + encode(_: GetConfigurationDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetConfigurationDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetConfigurationDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetConfigurationDescriptorRequest(); while (reader.pos < end) { @@ -2172,7 +2233,8 @@ export const GetConfigurationDescriptorRequest = { return message; }, fromAmino(_: GetConfigurationDescriptorRequestAmino): GetConfigurationDescriptorRequest { - return {}; + const message = createBaseGetConfigurationDescriptorRequest(); + return message; }, toAmino(_: GetConfigurationDescriptorRequest): GetConfigurationDescriptorRequestAmino { const obj: any = {}; @@ -2202,18 +2264,19 @@ export const GetConfigurationDescriptorRequest = { }; function createBaseGetConfigurationDescriptorResponse(): GetConfigurationDescriptorResponse { return { - config: ConfigurationDescriptor.fromPartial({}) + config: undefined }; } export const GetConfigurationDescriptorResponse = { - encode(message: GetConfigurationDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse", + encode(message: GetConfigurationDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.config !== undefined) { ConfigurationDescriptor.encode(message.config, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetConfigurationDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetConfigurationDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetConfigurationDescriptorResponse(); while (reader.pos < end) { @@ -2245,9 +2308,11 @@ export const GetConfigurationDescriptorResponse = { return message; }, fromAmino(object: GetConfigurationDescriptorResponseAmino): GetConfigurationDescriptorResponse { - return { - config: object?.config ? ConfigurationDescriptor.fromAmino(object.config) : undefined - }; + const message = createBaseGetConfigurationDescriptorResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = ConfigurationDescriptor.fromAmino(object.config); + } + return message; }, toAmino(message: GetConfigurationDescriptorResponse): GetConfigurationDescriptorResponseAmino { const obj: any = {}; @@ -2280,11 +2345,12 @@ function createBaseGetQueryServicesDescriptorRequest(): GetQueryServicesDescript return {}; } export const GetQueryServicesDescriptorRequest = { - encode(_: GetQueryServicesDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest", + encode(_: GetQueryServicesDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetQueryServicesDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetQueryServicesDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetQueryServicesDescriptorRequest(); while (reader.pos < end) { @@ -2309,7 +2375,8 @@ export const GetQueryServicesDescriptorRequest = { return message; }, fromAmino(_: GetQueryServicesDescriptorRequestAmino): GetQueryServicesDescriptorRequest { - return {}; + const message = createBaseGetQueryServicesDescriptorRequest(); + return message; }, toAmino(_: GetQueryServicesDescriptorRequest): GetQueryServicesDescriptorRequestAmino { const obj: any = {}; @@ -2339,18 +2406,19 @@ export const GetQueryServicesDescriptorRequest = { }; function createBaseGetQueryServicesDescriptorResponse(): GetQueryServicesDescriptorResponse { return { - queries: QueryServicesDescriptor.fromPartial({}) + queries: undefined }; } export const GetQueryServicesDescriptorResponse = { - encode(message: GetQueryServicesDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse", + encode(message: GetQueryServicesDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.queries !== undefined) { QueryServicesDescriptor.encode(message.queries, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetQueryServicesDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetQueryServicesDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetQueryServicesDescriptorResponse(); while (reader.pos < end) { @@ -2382,9 +2450,11 @@ export const GetQueryServicesDescriptorResponse = { return message; }, fromAmino(object: GetQueryServicesDescriptorResponseAmino): GetQueryServicesDescriptorResponse { - return { - queries: object?.queries ? QueryServicesDescriptor.fromAmino(object.queries) : undefined - }; + const message = createBaseGetQueryServicesDescriptorResponse(); + if (object.queries !== undefined && object.queries !== null) { + message.queries = QueryServicesDescriptor.fromAmino(object.queries); + } + return message; }, toAmino(message: GetQueryServicesDescriptorResponse): GetQueryServicesDescriptorResponseAmino { const obj: any = {}; @@ -2417,11 +2487,12 @@ function createBaseGetTxDescriptorRequest(): GetTxDescriptorRequest { return {}; } export const GetTxDescriptorRequest = { - encode(_: GetTxDescriptorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest", + encode(_: GetTxDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxDescriptorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxDescriptorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxDescriptorRequest(); while (reader.pos < end) { @@ -2446,7 +2517,8 @@ export const GetTxDescriptorRequest = { return message; }, fromAmino(_: GetTxDescriptorRequestAmino): GetTxDescriptorRequest { - return {}; + const message = createBaseGetTxDescriptorRequest(); + return message; }, toAmino(_: GetTxDescriptorRequest): GetTxDescriptorRequestAmino { const obj: any = {}; @@ -2476,18 +2548,19 @@ export const GetTxDescriptorRequest = { }; function createBaseGetTxDescriptorResponse(): GetTxDescriptorResponse { return { - tx: TxDescriptor.fromPartial({}) + tx: undefined }; } export const GetTxDescriptorResponse = { - encode(message: GetTxDescriptorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse", + encode(message: GetTxDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { TxDescriptor.encode(message.tx, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxDescriptorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxDescriptorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxDescriptorResponse(); while (reader.pos < end) { @@ -2519,9 +2592,11 @@ export const GetTxDescriptorResponse = { return message; }, fromAmino(object: GetTxDescriptorResponseAmino): GetTxDescriptorResponse { - return { - tx: object?.tx ? TxDescriptor.fromAmino(object.tx) : undefined - }; + const message = createBaseGetTxDescriptorResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; }, toAmino(message: GetTxDescriptorResponse): GetTxDescriptorResponseAmino { const obj: any = {}; @@ -2556,14 +2631,15 @@ function createBaseQueryServicesDescriptor(): QueryServicesDescriptor { }; } export const QueryServicesDescriptor = { - encode(message: QueryServicesDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor", + encode(message: QueryServicesDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.queryServices) { QueryServiceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryServicesDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryServicesDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryServicesDescriptor(); while (reader.pos < end) { @@ -2599,16 +2675,16 @@ export const QueryServicesDescriptor = { return message; }, fromAmino(object: QueryServicesDescriptorAmino): QueryServicesDescriptor { - return { - queryServices: Array.isArray(object?.query_services) ? object.query_services.map((e: any) => QueryServiceDescriptor.fromAmino(e)) : [] - }; + const message = createBaseQueryServicesDescriptor(); + message.queryServices = object.query_services?.map(e => QueryServiceDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: QueryServicesDescriptor): QueryServicesDescriptorAmino { const obj: any = {}; if (message.queryServices) { obj.query_services = message.queryServices.map(e => e ? QueryServiceDescriptor.toAmino(e) : undefined); } else { - obj.query_services = []; + obj.query_services = message.queryServices; } return obj; }, @@ -2642,7 +2718,8 @@ function createBaseQueryServiceDescriptor(): QueryServiceDescriptor { }; } export const QueryServiceDescriptor = { - encode(message: QueryServiceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor", + encode(message: QueryServiceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); } @@ -2654,8 +2731,8 @@ export const QueryServiceDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryServiceDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryServiceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryServiceDescriptor(); while (reader.pos < end) { @@ -2703,20 +2780,24 @@ export const QueryServiceDescriptor = { return message; }, fromAmino(object: QueryServiceDescriptorAmino): QueryServiceDescriptor { - return { - fullname: object.fullname, - isModule: object.is_module, - methods: Array.isArray(object?.methods) ? object.methods.map((e: any) => QueryMethodDescriptor.fromAmino(e)) : [] - }; + const message = createBaseQueryServiceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.is_module !== undefined && object.is_module !== null) { + message.isModule = object.is_module; + } + message.methods = object.methods?.map(e => QueryMethodDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: QueryServiceDescriptor): QueryServiceDescriptorAmino { const obj: any = {}; - obj.fullname = message.fullname; - obj.is_module = message.isModule; + obj.fullname = message.fullname === "" ? undefined : message.fullname; + obj.is_module = message.isModule === false ? undefined : message.isModule; if (message.methods) { obj.methods = message.methods.map(e => e ? QueryMethodDescriptor.toAmino(e) : undefined); } else { - obj.methods = []; + obj.methods = message.methods; } return obj; }, @@ -2749,7 +2830,8 @@ function createBaseQueryMethodDescriptor(): QueryMethodDescriptor { }; } export const QueryMethodDescriptor = { - encode(message: QueryMethodDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor", + encode(message: QueryMethodDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2758,8 +2840,8 @@ export const QueryMethodDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryMethodDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryMethodDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryMethodDescriptor(); while (reader.pos < end) { @@ -2797,15 +2879,19 @@ export const QueryMethodDescriptor = { return message; }, fromAmino(object: QueryMethodDescriptorAmino): QueryMethodDescriptor { - return { - name: object.name, - fullQueryPath: object.full_query_path - }; + const message = createBaseQueryMethodDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.full_query_path !== undefined && object.full_query_path !== null) { + message.fullQueryPath = object.full_query_path; + } + return message; }, toAmino(message: QueryMethodDescriptor): QueryMethodDescriptorAmino { const obj: any = {}; - obj.name = message.name; - obj.full_query_path = message.fullQueryPath; + obj.name = message.name === "" ? undefined : message.name; + obj.full_query_path = message.fullQueryPath === "" ? undefined : message.fullQueryPath; return obj; }, fromAminoMsg(object: QueryMethodDescriptorAminoMsg): QueryMethodDescriptor { diff --git a/packages/api/src/codegen/cosmos/base/snapshots/v1beta1/snapshot.ts b/packages/api/src/codegen/cosmos/base/snapshots/v1beta1/snapshot.ts index 6619304e..2d87d820 100644 --- a/packages/api/src/codegen/cosmos/base/snapshots/v1beta1/snapshot.ts +++ b/packages/api/src/codegen/cosmos/base/snapshots/v1beta1/snapshot.ts @@ -1,8 +1,8 @@ -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** Snapshot contains Tendermint state sync snapshot info. */ export interface Snapshot { - height: Long; + height: bigint; format: number; chunks: number; hash: Uint8Array; @@ -14,10 +14,10 @@ export interface SnapshotProtoMsg { } /** Snapshot contains Tendermint state sync snapshot info. */ export interface SnapshotAmino { - height: string; - format: number; - chunks: number; - hash: Uint8Array; + height?: string; + format?: number; + chunks?: number; + hash?: string; metadata?: MetadataAmino; } export interface SnapshotAminoMsg { @@ -26,7 +26,7 @@ export interface SnapshotAminoMsg { } /** Snapshot contains Tendermint state sync snapshot info. */ export interface SnapshotSDKType { - height: Long; + height: bigint; format: number; chunks: number; hash: Uint8Array; @@ -44,7 +44,7 @@ export interface MetadataProtoMsg { /** Metadata contains SDK-specific snapshot metadata. */ export interface MetadataAmino { /** SHA-256 chunk hashes */ - chunk_hashes: Uint8Array[]; + chunk_hashes?: string[]; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -119,7 +119,7 @@ export interface SnapshotStoreItemProtoMsg { * Since: cosmos-sdk 0.46 */ export interface SnapshotStoreItemAmino { - name: string; + name?: string; } export interface SnapshotStoreItemAminoMsg { type: "cosmos-sdk/SnapshotStoreItem"; @@ -142,7 +142,7 @@ export interface SnapshotIAVLItem { key: Uint8Array; value: Uint8Array; /** version is block height */ - version: Long; + version: bigint; /** height is depth of the tree. */ height: number; } @@ -156,12 +156,12 @@ export interface SnapshotIAVLItemProtoMsg { * Since: cosmos-sdk 0.46 */ export interface SnapshotIAVLItemAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; /** version is block height */ - version: string; + version?: string; /** height is depth of the tree. */ - height: number; + height?: number; } export interface SnapshotIAVLItemAminoMsg { type: "cosmos-sdk/SnapshotIAVLItem"; @@ -175,7 +175,7 @@ export interface SnapshotIAVLItemAminoMsg { export interface SnapshotIAVLItemSDKType { key: Uint8Array; value: Uint8Array; - version: Long; + version: bigint; height: number; } /** @@ -197,8 +197,8 @@ export interface SnapshotExtensionMetaProtoMsg { * Since: cosmos-sdk 0.46 */ export interface SnapshotExtensionMetaAmino { - name: string; - format: number; + name?: string; + format?: number; } export interface SnapshotExtensionMetaAminoMsg { type: "cosmos-sdk/SnapshotExtensionMeta"; @@ -231,7 +231,7 @@ export interface SnapshotExtensionPayloadProtoMsg { * Since: cosmos-sdk 0.46 */ export interface SnapshotExtensionPayloadAmino { - payload: Uint8Array; + payload?: string; } export interface SnapshotExtensionPayloadAminoMsg { type: "cosmos-sdk/SnapshotExtensionPayload"; @@ -264,8 +264,8 @@ export interface SnapshotKVItemProtoMsg { * Since: cosmos-sdk 0.46 */ export interface SnapshotKVItemAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; } export interface SnapshotKVItemAminoMsg { type: "cosmos-sdk/SnapshotKVItem"; @@ -298,7 +298,7 @@ export interface SnapshotSchemaProtoMsg { * Since: cosmos-sdk 0.46 */ export interface SnapshotSchemaAmino { - keys: Uint8Array[]; + keys?: string[]; } export interface SnapshotSchemaAminoMsg { type: "cosmos-sdk/SnapshotSchema"; @@ -314,7 +314,7 @@ export interface SnapshotSchemaSDKType { } function createBaseSnapshot(): Snapshot { return { - height: Long.UZERO, + height: BigInt(0), format: 0, chunks: 0, hash: new Uint8Array(), @@ -322,8 +322,9 @@ function createBaseSnapshot(): Snapshot { }; } export const Snapshot = { - encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.base.snapshots.v1beta1.Snapshot", + encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { @@ -340,15 +341,15 @@ export const Snapshot = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.uint64() as Long); + message.height = reader.uint64(); break; case 2: message.format = reader.uint32(); @@ -371,7 +372,7 @@ export const Snapshot = { }, fromJSON(object: any): Snapshot { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), format: isSet(object.format) ? Number(object.format) : 0, chunks: isSet(object.chunks) ? Number(object.chunks) : 0, hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), @@ -380,7 +381,7 @@ export const Snapshot = { }, toJSON(message: Snapshot): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.format !== undefined && (obj.format = Math.round(message.format)); message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); @@ -389,7 +390,7 @@ export const Snapshot = { }, fromPartial(object: Partial): Snapshot { const message = createBaseSnapshot(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.UZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.format = object.format ?? 0; message.chunks = object.chunks ?? 0; message.hash = object.hash ?? new Uint8Array(); @@ -397,20 +398,30 @@ export const Snapshot = { return message; }, fromAmino(object: SnapshotAmino): Snapshot { - return { - height: Long.fromString(object.height), - format: object.format, - chunks: object.chunks, - hash: object.hash, - metadata: object?.metadata ? Metadata.fromAmino(object.metadata) : undefined - }; + const message = createBaseSnapshot(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; }, toAmino(message: Snapshot): SnapshotAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; - obj.format = message.format; - obj.chunks = message.chunks; - obj.hash = message.hash; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunks = message.chunks === 0 ? undefined : message.chunks; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; return obj; }, @@ -442,14 +453,15 @@ function createBaseMetadata(): Metadata { }; } export const Metadata = { - encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.Metadata", + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.chunkHashes) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMetadata(); while (reader.pos < end) { @@ -485,16 +497,16 @@ export const Metadata = { return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - chunkHashes: Array.isArray(object?.chunk_hashes) ? object.chunk_hashes.map((e: any) => e) : [] - }; + const message = createBaseMetadata(); + message.chunkHashes = object.chunk_hashes?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; if (message.chunkHashes) { - obj.chunk_hashes = message.chunkHashes.map(e => e); + obj.chunk_hashes = message.chunkHashes.map(e => base64FromBytes(e)); } else { - obj.chunk_hashes = []; + obj.chunk_hashes = message.chunkHashes; } return obj; }, @@ -531,7 +543,8 @@ function createBaseSnapshotItem(): SnapshotItem { }; } export const SnapshotItem = { - encode(message: SnapshotItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotItem", + encode(message: SnapshotItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.store !== undefined) { SnapshotStoreItem.encode(message.store, writer.uint32(10).fork()).ldelim(); } @@ -552,8 +565,8 @@ export const SnapshotItem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotItem(); while (reader.pos < end) { @@ -615,14 +628,26 @@ export const SnapshotItem = { return message; }, fromAmino(object: SnapshotItemAmino): SnapshotItem { - return { - store: object?.store ? SnapshotStoreItem.fromAmino(object.store) : undefined, - iavl: object?.iavl ? SnapshotIAVLItem.fromAmino(object.iavl) : undefined, - extension: object?.extension ? SnapshotExtensionMeta.fromAmino(object.extension) : undefined, - extensionPayload: object?.extension_payload ? SnapshotExtensionPayload.fromAmino(object.extension_payload) : undefined, - kv: object?.kv ? SnapshotKVItem.fromAmino(object.kv) : undefined, - schema: object?.schema ? SnapshotSchema.fromAmino(object.schema) : undefined - }; + const message = createBaseSnapshotItem(); + if (object.store !== undefined && object.store !== null) { + message.store = SnapshotStoreItem.fromAmino(object.store); + } + if (object.iavl !== undefined && object.iavl !== null) { + message.iavl = SnapshotIAVLItem.fromAmino(object.iavl); + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = SnapshotExtensionMeta.fromAmino(object.extension); + } + if (object.extension_payload !== undefined && object.extension_payload !== null) { + message.extensionPayload = SnapshotExtensionPayload.fromAmino(object.extension_payload); + } + if (object.kv !== undefined && object.kv !== null) { + message.kv = SnapshotKVItem.fromAmino(object.kv); + } + if (object.schema !== undefined && object.schema !== null) { + message.schema = SnapshotSchema.fromAmino(object.schema); + } + return message; }, toAmino(message: SnapshotItem): SnapshotItemAmino { const obj: any = {}; @@ -662,14 +687,15 @@ function createBaseSnapshotStoreItem(): SnapshotStoreItem { }; } export const SnapshotStoreItem = { - encode(message: SnapshotStoreItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotStoreItem", + encode(message: SnapshotStoreItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotStoreItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotStoreItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotStoreItem(); while (reader.pos < end) { @@ -701,13 +727,15 @@ export const SnapshotStoreItem = { return message; }, fromAmino(object: SnapshotStoreItemAmino): SnapshotStoreItem { - return { - name: object.name - }; + const message = createBaseSnapshotStoreItem(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: SnapshotStoreItem): SnapshotStoreItemAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; return obj; }, fromAminoMsg(object: SnapshotStoreItemAminoMsg): SnapshotStoreItem { @@ -736,19 +764,20 @@ function createBaseSnapshotIAVLItem(): SnapshotIAVLItem { return { key: new Uint8Array(), value: new Uint8Array(), - version: Long.ZERO, + version: BigInt(0), height: 0 }; } export const SnapshotIAVLItem = { - encode(message: SnapshotIAVLItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", + encode(message: SnapshotIAVLItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); } - if (!message.version.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(24).int64(message.version); } if (message.height !== 0) { @@ -756,8 +785,8 @@ export const SnapshotIAVLItem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotIAVLItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotIAVLItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotIAVLItem(); while (reader.pos < end) { @@ -770,7 +799,7 @@ export const SnapshotIAVLItem = { message.value = reader.bytes(); break; case 3: - message.version = (reader.int64() as Long); + message.version = reader.int64(); break; case 4: message.height = reader.int32(); @@ -786,7 +815,7 @@ export const SnapshotIAVLItem = { return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), - version: isSet(object.version) ? Long.fromValue(object.version) : Long.ZERO, + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0), height: isSet(object.height) ? Number(object.height) : 0 }; }, @@ -794,7 +823,7 @@ export const SnapshotIAVLItem = { const obj: any = {}; message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.height !== undefined && (obj.height = Math.round(message.height)); return obj; }, @@ -802,24 +831,32 @@ export const SnapshotIAVLItem = { const message = createBaseSnapshotIAVLItem(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); - message.version = object.version !== undefined && object.version !== null ? Long.fromValue(object.version) : Long.ZERO; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); message.height = object.height ?? 0; return message; }, fromAmino(object: SnapshotIAVLItemAmino): SnapshotIAVLItem { - return { - key: object.key, - value: object.value, - version: Long.fromString(object.version), - height: object.height - }; + const message = createBaseSnapshotIAVLItem(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height; + } + return message; }, toAmino(message: SnapshotIAVLItem): SnapshotIAVLItemAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; - obj.version = message.version ? message.version.toString() : undefined; - obj.height = message.height; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.height = message.height === 0 ? undefined : message.height; return obj; }, fromAminoMsg(object: SnapshotIAVLItemAminoMsg): SnapshotIAVLItem { @@ -851,7 +888,8 @@ function createBaseSnapshotExtensionMeta(): SnapshotExtensionMeta { }; } export const SnapshotExtensionMeta = { - encode(message: SnapshotExtensionMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", + encode(message: SnapshotExtensionMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -860,8 +898,8 @@ export const SnapshotExtensionMeta = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotExtensionMeta { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotExtensionMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotExtensionMeta(); while (reader.pos < end) { @@ -899,15 +937,19 @@ export const SnapshotExtensionMeta = { return message; }, fromAmino(object: SnapshotExtensionMetaAmino): SnapshotExtensionMeta { - return { - name: object.name, - format: object.format - }; + const message = createBaseSnapshotExtensionMeta(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + return message; }, toAmino(message: SnapshotExtensionMeta): SnapshotExtensionMetaAmino { const obj: any = {}; - obj.name = message.name; - obj.format = message.format; + obj.name = message.name === "" ? undefined : message.name; + obj.format = message.format === 0 ? undefined : message.format; return obj; }, fromAminoMsg(object: SnapshotExtensionMetaAminoMsg): SnapshotExtensionMeta { @@ -938,14 +980,15 @@ function createBaseSnapshotExtensionPayload(): SnapshotExtensionPayload { }; } export const SnapshotExtensionPayload = { - encode(message: SnapshotExtensionPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", + encode(message: SnapshotExtensionPayload, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.payload.length !== 0) { writer.uint32(10).bytes(message.payload); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotExtensionPayload { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotExtensionPayload { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotExtensionPayload(); while (reader.pos < end) { @@ -977,13 +1020,15 @@ export const SnapshotExtensionPayload = { return message; }, fromAmino(object: SnapshotExtensionPayloadAmino): SnapshotExtensionPayload { - return { - payload: object.payload - }; + const message = createBaseSnapshotExtensionPayload(); + if (object.payload !== undefined && object.payload !== null) { + message.payload = bytesFromBase64(object.payload); + } + return message; }, toAmino(message: SnapshotExtensionPayload): SnapshotExtensionPayloadAmino { const obj: any = {}; - obj.payload = message.payload; + obj.payload = message.payload ? base64FromBytes(message.payload) : undefined; return obj; }, fromAminoMsg(object: SnapshotExtensionPayloadAminoMsg): SnapshotExtensionPayload { @@ -1015,7 +1060,8 @@ function createBaseSnapshotKVItem(): SnapshotKVItem { }; } export const SnapshotKVItem = { - encode(message: SnapshotKVItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotKVItem", + encode(message: SnapshotKVItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -1024,8 +1070,8 @@ export const SnapshotKVItem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotKVItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotKVItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotKVItem(); while (reader.pos < end) { @@ -1063,15 +1109,19 @@ export const SnapshotKVItem = { return message; }, fromAmino(object: SnapshotKVItemAmino): SnapshotKVItem { - return { - key: object.key, - value: object.value - }; + const message = createBaseSnapshotKVItem(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: SnapshotKVItem): SnapshotKVItemAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: SnapshotKVItemAminoMsg): SnapshotKVItem { @@ -1102,14 +1152,15 @@ function createBaseSnapshotSchema(): SnapshotSchema { }; } export const SnapshotSchema = { - encode(message: SnapshotSchema, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.snapshots.v1beta1.SnapshotSchema", + encode(message: SnapshotSchema, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.keys) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotSchema { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotSchema { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotSchema(); while (reader.pos < end) { @@ -1145,16 +1196,16 @@ export const SnapshotSchema = { return message; }, fromAmino(object: SnapshotSchemaAmino): SnapshotSchema { - return { - keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => e) : [] - }; + const message = createBaseSnapshotSchema(); + message.keys = object.keys?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: SnapshotSchema): SnapshotSchemaAmino { const obj: any = {}; if (message.keys) { - obj.keys = message.keys.map(e => e); + obj.keys = message.keys.map(e => base64FromBytes(e)); } else { - obj.keys = []; + obj.keys = message.keys; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/base/store/v1beta1/commit_info.ts b/packages/api/src/codegen/cosmos/base/store/v1beta1/commit_info.ts index 583f1ff1..595af878 100644 --- a/packages/api/src/codegen/cosmos/base/store/v1beta1/commit_info.ts +++ b/packages/api/src/codegen/cosmos/base/store/v1beta1/commit_info.ts @@ -1,11 +1,11 @@ -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * CommitInfo defines commit information used by the multi-store when committing * a version/height. */ export interface CommitInfo { - version: Long; + version: bigint; storeInfos: StoreInfo[]; } export interface CommitInfoProtoMsg { @@ -17,8 +17,8 @@ export interface CommitInfoProtoMsg { * a version/height. */ export interface CommitInfoAmino { - version: string; - store_infos: StoreInfoAmino[]; + version?: string; + store_infos?: StoreInfoAmino[]; } export interface CommitInfoAminoMsg { type: "cosmos-sdk/CommitInfo"; @@ -29,7 +29,7 @@ export interface CommitInfoAminoMsg { * a version/height. */ export interface CommitInfoSDKType { - version: Long; + version: bigint; store_infos: StoreInfoSDKType[]; } /** @@ -49,7 +49,7 @@ export interface StoreInfoProtoMsg { * between a store name and the commit ID. */ export interface StoreInfoAmino { - name: string; + name?: string; commit_id?: CommitIDAmino; } export interface StoreInfoAminoMsg { @@ -69,7 +69,7 @@ export interface StoreInfoSDKType { * committed. */ export interface CommitID { - version: Long; + version: bigint; hash: Uint8Array; } export interface CommitIDProtoMsg { @@ -81,8 +81,8 @@ export interface CommitIDProtoMsg { * committed. */ export interface CommitIDAmino { - version: string; - hash: Uint8Array; + version?: string; + hash?: string; } export interface CommitIDAminoMsg { type: "cosmos-sdk/CommitID"; @@ -93,18 +93,19 @@ export interface CommitIDAminoMsg { * committed. */ export interface CommitIDSDKType { - version: Long; + version: bigint; hash: Uint8Array; } function createBaseCommitInfo(): CommitInfo { return { - version: Long.ZERO, + version: BigInt(0), storeInfos: [] }; } export const CommitInfo = { - encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.version.isZero()) { + typeUrl: "/cosmos.base.store.v1beta1.CommitInfo", + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== BigInt(0)) { writer.uint32(8).int64(message.version); } for (const v of message.storeInfos) { @@ -112,15 +113,15 @@ export const CommitInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = (reader.int64() as Long); + message.version = reader.int64(); break; case 2: message.storeInfos.push(StoreInfo.decode(reader, reader.uint32())); @@ -134,13 +135,13 @@ export const CommitInfo = { }, fromJSON(object: any): CommitInfo { return { - version: isSet(object.version) ? Long.fromValue(object.version) : Long.ZERO, + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0), storeInfos: Array.isArray(object?.storeInfos) ? object.storeInfos.map((e: any) => StoreInfo.fromJSON(e)) : [] }; }, toJSON(message: CommitInfo): unknown { const obj: any = {}; - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); if (message.storeInfos) { obj.storeInfos = message.storeInfos.map(e => e ? StoreInfo.toJSON(e) : undefined); } else { @@ -150,23 +151,25 @@ export const CommitInfo = { }, fromPartial(object: Partial): CommitInfo { const message = createBaseCommitInfo(); - message.version = object.version !== undefined && object.version !== null ? Long.fromValue(object.version) : Long.ZERO; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); message.storeInfos = object.storeInfos?.map(e => StoreInfo.fromPartial(e)) || []; return message; }, fromAmino(object: CommitInfoAmino): CommitInfo { - return { - version: Long.fromString(object.version), - storeInfos: Array.isArray(object?.store_infos) ? object.store_infos.map((e: any) => StoreInfo.fromAmino(e)) : [] - }; + const message = createBaseCommitInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + message.storeInfos = object.store_infos?.map(e => StoreInfo.fromAmino(e)) || []; + return message; }, toAmino(message: CommitInfo): CommitInfoAmino { const obj: any = {}; - obj.version = message.version ? message.version.toString() : undefined; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; if (message.storeInfos) { obj.store_infos = message.storeInfos.map(e => e ? StoreInfo.toAmino(e) : undefined); } else { - obj.store_infos = []; + obj.store_infos = message.storeInfos; } return obj; }, @@ -199,7 +202,8 @@ function createBaseStoreInfo(): StoreInfo { }; } export const StoreInfo = { - encode(message: StoreInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.store.v1beta1.StoreInfo", + encode(message: StoreInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -208,8 +212,8 @@ export const StoreInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StoreInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StoreInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreInfo(); while (reader.pos < end) { @@ -247,14 +251,18 @@ export const StoreInfo = { return message; }, fromAmino(object: StoreInfoAmino): StoreInfo { - return { - name: object.name, - commitId: object?.commit_id ? CommitID.fromAmino(object.commit_id) : undefined - }; + const message = createBaseStoreInfo(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.commit_id !== undefined && object.commit_id !== null) { + message.commitId = CommitID.fromAmino(object.commit_id); + } + return message; }, toAmino(message: StoreInfo): StoreInfoAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; obj.commit_id = message.commitId ? CommitID.toAmino(message.commitId) : undefined; return obj; }, @@ -282,13 +290,14 @@ export const StoreInfo = { }; function createBaseCommitID(): CommitID { return { - version: Long.ZERO, + version: BigInt(0), hash: new Uint8Array() }; } export const CommitID = { - encode(message: CommitID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.version.isZero()) { + typeUrl: "/cosmos.base.store.v1beta1.CommitID", + encode(message: CommitID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== BigInt(0)) { writer.uint32(8).int64(message.version); } if (message.hash.length !== 0) { @@ -296,15 +305,15 @@ export const CommitID = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitID(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = (reader.int64() as Long); + message.version = reader.int64(); break; case 2: message.hash = reader.bytes(); @@ -318,32 +327,36 @@ export const CommitID = { }, fromJSON(object: any): CommitID { return { - version: isSet(object.version) ? Long.fromValue(object.version) : Long.ZERO, + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0), hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array() }; }, toJSON(message: CommitID): unknown { const obj: any = {}; - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, fromPartial(object: Partial): CommitID { const message = createBaseCommitID(); - message.version = object.version !== undefined && object.version !== null ? Long.fromValue(object.version) : Long.ZERO; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); message.hash = object.hash ?? new Uint8Array(); return message; }, fromAmino(object: CommitIDAmino): CommitID { - return { - version: Long.fromString(object.version), - hash: object.hash - }; + const message = createBaseCommitID(); + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; }, toAmino(message: CommitID): CommitIDAmino { const obj: any = {}; - obj.version = message.version ? message.version.toString() : undefined; - obj.hash = message.hash; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; return obj; }, fromAminoMsg(object: CommitIDAminoMsg): CommitID { diff --git a/packages/api/src/codegen/cosmos/base/store/v1beta1/listening.ts b/packages/api/src/codegen/cosmos/base/store/v1beta1/listening.ts index fa2788e2..086b5e7a 100644 --- a/packages/api/src/codegen/cosmos/base/store/v1beta1/listening.ts +++ b/packages/api/src/codegen/cosmos/base/store/v1beta1/listening.ts @@ -1,5 +1,5 @@ import { RequestDeliverTx, RequestDeliverTxAmino, RequestDeliverTxSDKType, ResponseDeliverTx, ResponseDeliverTxAmino, ResponseDeliverTxSDKType, RequestBeginBlock, RequestBeginBlockAmino, RequestBeginBlockSDKType, ResponseBeginBlock, ResponseBeginBlockAmino, ResponseBeginBlockSDKType, RequestEndBlock, RequestEndBlockAmino, RequestEndBlockSDKType, ResponseEndBlock, ResponseEndBlockAmino, ResponseEndBlockSDKType, ResponseCommit, ResponseCommitAmino, ResponseCommitSDKType } from "../../../../tendermint/abci/types"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) @@ -29,11 +29,11 @@ export interface StoreKVPairProtoMsg { */ export interface StoreKVPairAmino { /** the store key for the KVStore this pair originates from */ - store_key: string; + store_key?: string; /** true indicates a delete operation, false indicates a set operation */ - delete: boolean; - key: Uint8Array; - value: Uint8Array; + delete?: boolean; + key?: string; + value?: string; } export interface StoreKVPairAminoMsg { type: "cosmos-sdk/StoreKVPair"; @@ -57,12 +57,12 @@ export interface StoreKVPairSDKType { * the file streamer dump them into files together with the state changes. */ export interface BlockMetadata { - requestBeginBlock: RequestBeginBlock; - responseBeginBlock: ResponseBeginBlock; + requestBeginBlock?: RequestBeginBlock; + responseBeginBlock?: ResponseBeginBlock; deliverTxs: BlockMetadata_DeliverTx[]; - requestEndBlock: RequestEndBlock; - responseEndBlock: ResponseEndBlock; - responseCommit: ResponseCommit; + requestEndBlock?: RequestEndBlock; + responseEndBlock?: ResponseEndBlock; + responseCommit?: ResponseCommit; } export interface BlockMetadataProtoMsg { typeUrl: "/cosmos.base.store.v1beta1.BlockMetadata"; @@ -75,7 +75,7 @@ export interface BlockMetadataProtoMsg { export interface BlockMetadataAmino { request_begin_block?: RequestBeginBlockAmino; response_begin_block?: ResponseBeginBlockAmino; - deliver_txs: BlockMetadata_DeliverTxAmino[]; + deliver_txs?: BlockMetadata_DeliverTxAmino[]; request_end_block?: RequestEndBlockAmino; response_end_block?: ResponseEndBlockAmino; response_commit?: ResponseCommitAmino; @@ -89,17 +89,17 @@ export interface BlockMetadataAminoMsg { * the file streamer dump them into files together with the state changes. */ export interface BlockMetadataSDKType { - request_begin_block: RequestBeginBlockSDKType; - response_begin_block: ResponseBeginBlockSDKType; + request_begin_block?: RequestBeginBlockSDKType; + response_begin_block?: ResponseBeginBlockSDKType; deliver_txs: BlockMetadata_DeliverTxSDKType[]; - request_end_block: RequestEndBlockSDKType; - response_end_block: ResponseEndBlockSDKType; - response_commit: ResponseCommitSDKType; + request_end_block?: RequestEndBlockSDKType; + response_end_block?: ResponseEndBlockSDKType; + response_commit?: ResponseCommitSDKType; } /** DeliverTx encapulate deliver tx request and response. */ export interface BlockMetadata_DeliverTx { - request: RequestDeliverTx; - response: ResponseDeliverTx; + request?: RequestDeliverTx; + response?: ResponseDeliverTx; } export interface BlockMetadata_DeliverTxProtoMsg { typeUrl: "/cosmos.base.store.v1beta1.DeliverTx"; @@ -116,8 +116,8 @@ export interface BlockMetadata_DeliverTxAminoMsg { } /** DeliverTx encapulate deliver tx request and response. */ export interface BlockMetadata_DeliverTxSDKType { - request: RequestDeliverTxSDKType; - response: ResponseDeliverTxSDKType; + request?: RequestDeliverTxSDKType; + response?: ResponseDeliverTxSDKType; } function createBaseStoreKVPair(): StoreKVPair { return { @@ -128,7 +128,8 @@ function createBaseStoreKVPair(): StoreKVPair { }; } export const StoreKVPair = { - encode(message: StoreKVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.store.v1beta1.StoreKVPair", + encode(message: StoreKVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.storeKey !== "") { writer.uint32(10).string(message.storeKey); } @@ -143,8 +144,8 @@ export const StoreKVPair = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StoreKVPair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StoreKVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreKVPair(); while (reader.pos < end) { @@ -194,19 +195,27 @@ export const StoreKVPair = { return message; }, fromAmino(object: StoreKVPairAmino): StoreKVPair { - return { - storeKey: object.store_key, - delete: object.delete, - key: object.key, - value: object.value - }; + const message = createBaseStoreKVPair(); + if (object.store_key !== undefined && object.store_key !== null) { + message.storeKey = object.store_key; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: StoreKVPair): StoreKVPairAmino { const obj: any = {}; - obj.store_key = message.storeKey; - obj.delete = message.delete; - obj.key = message.key; - obj.value = message.value; + obj.store_key = message.storeKey === "" ? undefined : message.storeKey; + obj.delete = message.delete === false ? undefined : message.delete; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: StoreKVPairAminoMsg): StoreKVPair { @@ -233,16 +242,17 @@ export const StoreKVPair = { }; function createBaseBlockMetadata(): BlockMetadata { return { - requestBeginBlock: RequestBeginBlock.fromPartial({}), - responseBeginBlock: ResponseBeginBlock.fromPartial({}), + requestBeginBlock: undefined, + responseBeginBlock: undefined, deliverTxs: [], - requestEndBlock: RequestEndBlock.fromPartial({}), - responseEndBlock: ResponseEndBlock.fromPartial({}), - responseCommit: ResponseCommit.fromPartial({}) + requestEndBlock: undefined, + responseEndBlock: undefined, + responseCommit: undefined }; } export const BlockMetadata = { - encode(message: BlockMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.store.v1beta1.BlockMetadata", + encode(message: BlockMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.requestBeginBlock !== undefined) { RequestBeginBlock.encode(message.requestBeginBlock, writer.uint32(10).fork()).ldelim(); } @@ -263,8 +273,8 @@ export const BlockMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockMetadata(); while (reader.pos < end) { @@ -330,14 +340,24 @@ export const BlockMetadata = { return message; }, fromAmino(object: BlockMetadataAmino): BlockMetadata { - return { - requestBeginBlock: object?.request_begin_block ? RequestBeginBlock.fromAmino(object.request_begin_block) : undefined, - responseBeginBlock: object?.response_begin_block ? ResponseBeginBlock.fromAmino(object.response_begin_block) : undefined, - deliverTxs: Array.isArray(object?.deliver_txs) ? object.deliver_txs.map((e: any) => BlockMetadata_DeliverTx.fromAmino(e)) : [], - requestEndBlock: object?.request_end_block ? RequestEndBlock.fromAmino(object.request_end_block) : undefined, - responseEndBlock: object?.response_end_block ? ResponseEndBlock.fromAmino(object.response_end_block) : undefined, - responseCommit: object?.response_commit ? ResponseCommit.fromAmino(object.response_commit) : undefined - }; + const message = createBaseBlockMetadata(); + if (object.request_begin_block !== undefined && object.request_begin_block !== null) { + message.requestBeginBlock = RequestBeginBlock.fromAmino(object.request_begin_block); + } + if (object.response_begin_block !== undefined && object.response_begin_block !== null) { + message.responseBeginBlock = ResponseBeginBlock.fromAmino(object.response_begin_block); + } + message.deliverTxs = object.deliver_txs?.map(e => BlockMetadata_DeliverTx.fromAmino(e)) || []; + if (object.request_end_block !== undefined && object.request_end_block !== null) { + message.requestEndBlock = RequestEndBlock.fromAmino(object.request_end_block); + } + if (object.response_end_block !== undefined && object.response_end_block !== null) { + message.responseEndBlock = ResponseEndBlock.fromAmino(object.response_end_block); + } + if (object.response_commit !== undefined && object.response_commit !== null) { + message.responseCommit = ResponseCommit.fromAmino(object.response_commit); + } + return message; }, toAmino(message: BlockMetadata): BlockMetadataAmino { const obj: any = {}; @@ -346,7 +366,7 @@ export const BlockMetadata = { if (message.deliverTxs) { obj.deliver_txs = message.deliverTxs.map(e => e ? BlockMetadata_DeliverTx.toAmino(e) : undefined); } else { - obj.deliver_txs = []; + obj.deliver_txs = message.deliverTxs; } obj.request_end_block = message.requestEndBlock ? RequestEndBlock.toAmino(message.requestEndBlock) : undefined; obj.response_end_block = message.responseEndBlock ? ResponseEndBlock.toAmino(message.responseEndBlock) : undefined; @@ -377,12 +397,13 @@ export const BlockMetadata = { }; function createBaseBlockMetadata_DeliverTx(): BlockMetadata_DeliverTx { return { - request: RequestDeliverTx.fromPartial({}), - response: ResponseDeliverTx.fromPartial({}) + request: undefined, + response: undefined }; } export const BlockMetadata_DeliverTx = { - encode(message: BlockMetadata_DeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.store.v1beta1.DeliverTx", + encode(message: BlockMetadata_DeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.request !== undefined) { RequestDeliverTx.encode(message.request, writer.uint32(10).fork()).ldelim(); } @@ -391,8 +412,8 @@ export const BlockMetadata_DeliverTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockMetadata_DeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockMetadata_DeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockMetadata_DeliverTx(); while (reader.pos < end) { @@ -430,10 +451,14 @@ export const BlockMetadata_DeliverTx = { return message; }, fromAmino(object: BlockMetadata_DeliverTxAmino): BlockMetadata_DeliverTx { - return { - request: object?.request ? RequestDeliverTx.fromAmino(object.request) : undefined, - response: object?.response ? ResponseDeliverTx.fromAmino(object.response) : undefined - }; + const message = createBaseBlockMetadata_DeliverTx(); + if (object.request !== undefined && object.request !== null) { + message.request = RequestDeliverTx.fromAmino(object.request); + } + if (object.response !== undefined && object.response !== null) { + message.response = ResponseDeliverTx.fromAmino(object.response); + } + return message; }, toAmino(message: BlockMetadata_DeliverTx): BlockMetadata_DeliverTxAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts index 184c3e01..54b43a1a 100644 --- a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { GetNodeInfoRequest, GetNodeInfoResponseSDKType, GetSyncingRequest, GetSyncingResponseSDKType, GetLatestBlockRequest, GetLatestBlockResponseSDKType, GetBlockByHeightRequest, GetBlockByHeightResponseSDKType, GetLatestValidatorSetRequest, GetLatestValidatorSetResponseSDKType, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponseSDKType, ABCIQueryRequest, ABCIQueryResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts index ed155b79..be59b17f 100644 --- a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts +++ b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; /** Service defines the gRPC querier service for tendermint queries. */ @@ -40,39 +40,39 @@ export class ServiceClientImpl implements Service { getNodeInfo(request: GetNodeInfoRequest = {}): Promise { const data = GetNodeInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetNodeInfo", data); - return promise.then(data => GetNodeInfoResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetNodeInfoResponse.decode(new BinaryReader(data))); } getSyncing(request: GetSyncingRequest = {}): Promise { const data = GetSyncingRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetSyncing", data); - return promise.then(data => GetSyncingResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetSyncingResponse.decode(new BinaryReader(data))); } getLatestBlock(request: GetLatestBlockRequest = {}): Promise { const data = GetLatestBlockRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestBlock", data); - return promise.then(data => GetLatestBlockResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetLatestBlockResponse.decode(new BinaryReader(data))); } getBlockByHeight(request: GetBlockByHeightRequest): Promise { const data = GetBlockByHeightRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetBlockByHeight", data); - return promise.then(data => GetBlockByHeightResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetBlockByHeightResponse.decode(new BinaryReader(data))); } getLatestValidatorSet(request: GetLatestValidatorSetRequest = { pagination: undefined }): Promise { const data = GetLatestValidatorSetRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestValidatorSet", data); - return promise.then(data => GetLatestValidatorSetResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetLatestValidatorSetResponse.decode(new BinaryReader(data))); } getValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { const data = GetValidatorSetByHeightRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetValidatorSetByHeight", data); - return promise.then(data => GetValidatorSetByHeightResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetValidatorSetByHeightResponse.decode(new BinaryReader(data))); } aBCIQuery(request: ABCIQueryRequest): Promise { const data = ABCIQueryRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "ABCIQuery", data); - return promise.then(data => ABCIQueryResponse.decode(new _m0.Reader(data))); + return promise.then(data => ABCIQueryResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.ts b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.ts index 2110f0ed..6c9b4dea 100644 --- a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/query.ts @@ -8,16 +8,16 @@ import { Block as Block2 } from "./types"; import { BlockAmino as Block2Amino } from "./types"; import { BlockSDKType as Block2SDKType } from "./types"; import { DefaultNodeInfo, DefaultNodeInfoAmino, DefaultNodeInfoSDKType } from "../../../../tendermint/p2p/types"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * GetValidatorSetByHeightRequest is the request type for the * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequest { - height: Long; + height: bigint; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface GetValidatorSetByHeightRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest"; @@ -28,7 +28,7 @@ export interface GetValidatorSetByHeightRequestProtoMsg { * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequestAmino { - height: string; + height?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -41,18 +41,18 @@ export interface GetValidatorSetByHeightRequestAminoMsg { * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequestSDKType { - height: Long; - pagination: PageRequestSDKType; + height: bigint; + pagination?: PageRequestSDKType; } /** * GetValidatorSetByHeightResponse is the response type for the * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponse { - blockHeight: Long; + blockHeight: bigint; validators: Validator[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface GetValidatorSetByHeightResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse"; @@ -63,8 +63,8 @@ export interface GetValidatorSetByHeightResponseProtoMsg { * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponseAmino { - block_height: string; - validators: ValidatorAmino[]; + block_height?: string; + validators?: ValidatorAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -77,9 +77,9 @@ export interface GetValidatorSetByHeightResponseAminoMsg { * Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponseSDKType { - block_height: Long; + block_height: bigint; validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * GetLatestValidatorSetRequest is the request type for the @@ -87,7 +87,7 @@ export interface GetValidatorSetByHeightResponseSDKType { */ export interface GetLatestValidatorSetRequest { /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface GetLatestValidatorSetRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest"; @@ -110,17 +110,17 @@ export interface GetLatestValidatorSetRequestAminoMsg { * Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * GetLatestValidatorSetResponse is the response type for the * Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponse { - blockHeight: Long; + blockHeight: bigint; validators: Validator[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface GetLatestValidatorSetResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse"; @@ -131,8 +131,8 @@ export interface GetLatestValidatorSetResponseProtoMsg { * Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponseAmino { - block_height: string; - validators: ValidatorAmino[]; + block_height?: string; + validators?: ValidatorAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -145,16 +145,16 @@ export interface GetLatestValidatorSetResponseAminoMsg { * Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponseSDKType { - block_height: Long; + block_height: bigint; validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** Validator is the type for the validator-set. */ export interface Validator { address: string; - pubKey: Any; - votingPower: Long; - proposerPriority: Long; + pubKey?: Any; + votingPower: bigint; + proposerPriority: bigint; } export interface ValidatorProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Validator"; @@ -162,10 +162,10 @@ export interface ValidatorProtoMsg { } /** Validator is the type for the validator-set. */ export interface ValidatorAmino { - address: string; + address?: string; pub_key?: AnyAmino; - voting_power: string; - proposer_priority: string; + voting_power?: string; + proposer_priority?: string; } export interface ValidatorAminoMsg { type: "cosmos-sdk/Validator"; @@ -174,16 +174,16 @@ export interface ValidatorAminoMsg { /** Validator is the type for the validator-set. */ export interface ValidatorSDKType { address: string; - pub_key: AnySDKType; - voting_power: Long; - proposer_priority: Long; + pub_key?: AnySDKType; + voting_power: bigint; + proposer_priority: bigint; } /** * GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight * RPC method. */ export interface GetBlockByHeightRequest { - height: Long; + height: bigint; } export interface GetBlockByHeightRequestProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest"; @@ -194,7 +194,7 @@ export interface GetBlockByHeightRequestProtoMsg { * RPC method. */ export interface GetBlockByHeightRequestAmino { - height: string; + height?: string; } export interface GetBlockByHeightRequestAminoMsg { type: "cosmos-sdk/GetBlockByHeightRequest"; @@ -205,18 +205,18 @@ export interface GetBlockByHeightRequestAminoMsg { * RPC method. */ export interface GetBlockByHeightRequestSDKType { - height: Long; + height: bigint; } /** * GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight * RPC method. */ export interface GetBlockByHeightResponse { - blockId: BlockID; + blockId?: BlockID; /** Deprecated: please use `sdk_block` instead */ - block: Block1; + block?: Block1; /** Since: cosmos-sdk 0.47 */ - sdkBlock: Block2; + sdkBlock?: Block2; } export interface GetBlockByHeightResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse"; @@ -242,9 +242,9 @@ export interface GetBlockByHeightResponseAminoMsg { * RPC method. */ export interface GetBlockByHeightResponseSDKType { - block_id: BlockIDSDKType; - block: Block1SDKType; - sdk_block: Block2SDKType; + block_id?: BlockIDSDKType; + block?: Block1SDKType; + sdk_block?: Block2SDKType; } /** * GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC @@ -274,11 +274,11 @@ export interface GetLatestBlockRequestSDKType {} * method. */ export interface GetLatestBlockResponse { - blockId: BlockID; + blockId?: BlockID; /** Deprecated: please use `sdk_block` instead */ - block: Block1; + block?: Block1; /** Since: cosmos-sdk 0.47 */ - sdkBlock: Block2; + sdkBlock?: Block2; } export interface GetLatestBlockResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse"; @@ -304,9 +304,9 @@ export interface GetLatestBlockResponseAminoMsg { * method. */ export interface GetLatestBlockResponseSDKType { - block_id: BlockIDSDKType; - block: Block1SDKType; - sdk_block: Block2SDKType; + block_id?: BlockIDSDKType; + block?: Block1SDKType; + sdk_block?: Block2SDKType; } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ export interface GetSyncingRequest {} @@ -332,7 +332,7 @@ export interface GetSyncingResponseProtoMsg { } /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ export interface GetSyncingResponseAmino { - syncing: boolean; + syncing?: boolean; } export interface GetSyncingResponseAminoMsg { type: "cosmos-sdk/GetSyncingResponse"; @@ -361,8 +361,8 @@ export interface GetNodeInfoRequestSDKType {} * method. */ export interface GetNodeInfoResponse { - defaultNodeInfo: DefaultNodeInfo; - applicationVersion: VersionInfo; + defaultNodeInfo?: DefaultNodeInfo; + applicationVersion?: VersionInfo; } export interface GetNodeInfoResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse"; @@ -385,8 +385,8 @@ export interface GetNodeInfoResponseAminoMsg { * method. */ export interface GetNodeInfoResponseSDKType { - default_node_info: DefaultNodeInfoSDKType; - application_version: VersionInfoSDKType; + default_node_info?: DefaultNodeInfoSDKType; + application_version?: VersionInfoSDKType; } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfo { @@ -406,15 +406,15 @@ export interface VersionInfoProtoMsg { } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfoAmino { - name: string; - app_name: string; - version: string; - git_commit: string; - build_tags: string; - go_version: string; - build_deps: ModuleAmino[]; + name?: string; + app_name?: string; + version?: string; + git_commit?: string; + build_tags?: string; + go_version?: string; + build_deps?: ModuleAmino[]; /** Since: cosmos-sdk 0.43 */ - cosmos_sdk_version: string; + cosmos_sdk_version?: string; } export interface VersionInfoAminoMsg { type: "cosmos-sdk/VersionInfo"; @@ -447,11 +447,11 @@ export interface ModuleProtoMsg { /** Module is the type for VersionInfo */ export interface ModuleAmino { /** module path */ - path: string; + path?: string; /** module version */ - version: string; + version?: string; /** checksum */ - sum: string; + sum?: string; } export interface ModuleAminoMsg { type: "cosmos-sdk/Module"; @@ -467,7 +467,7 @@ export interface ModuleSDKType { export interface ABCIQueryRequest { data: Uint8Array; path: string; - height: Long; + height: bigint; prove: boolean; } export interface ABCIQueryRequestProtoMsg { @@ -476,10 +476,10 @@ export interface ABCIQueryRequestProtoMsg { } /** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ export interface ABCIQueryRequestAmino { - data: Uint8Array; - path: string; - height: string; - prove: boolean; + data?: string; + path?: string; + height?: string; + prove?: boolean; } export interface ABCIQueryRequestAminoMsg { type: "cosmos-sdk/ABCIQueryRequest"; @@ -489,7 +489,7 @@ export interface ABCIQueryRequestAminoMsg { export interface ABCIQueryRequestSDKType { data: Uint8Array; path: string; - height: Long; + height: bigint; prove: boolean; } /** @@ -505,11 +505,11 @@ export interface ABCIQueryResponse { log: string; /** nondeterministic */ info: string; - index: Long; + index: bigint; key: Uint8Array; value: Uint8Array; - proofOps: ProofOps; - height: Long; + proofOps?: ProofOps; + height: bigint; codespace: string; } export interface ABCIQueryResponseProtoMsg { @@ -524,17 +524,17 @@ export interface ABCIQueryResponseProtoMsg { * Tendermint. */ export interface ABCIQueryResponseAmino { - code: number; + code?: number; /** nondeterministic */ - log: string; + log?: string; /** nondeterministic */ - info: string; - index: string; - key: Uint8Array; - value: Uint8Array; + info?: string; + index?: string; + key?: string; + value?: string; proof_ops?: ProofOpsAmino; - height: string; - codespace: string; + height?: string; + codespace?: string; } export interface ABCIQueryResponseAminoMsg { type: "cosmos-sdk/ABCIQueryResponse"; @@ -551,11 +551,11 @@ export interface ABCIQueryResponseSDKType { code: number; log: string; info: string; - index: Long; + index: bigint; key: Uint8Array; value: Uint8Array; - proof_ops: ProofOpsSDKType; - height: Long; + proof_ops?: ProofOpsSDKType; + height: bigint; codespace: string; } /** @@ -584,9 +584,9 @@ export interface ProofOpProtoMsg { * Tendermint. */ export interface ProofOpAmino { - type: string; - key: Uint8Array; - data: Uint8Array; + type?: string; + key?: string; + data?: string; } export interface ProofOpAminoMsg { type: "cosmos-sdk/ProofOp"; @@ -625,7 +625,7 @@ export interface ProofOpsProtoMsg { * Tendermint. */ export interface ProofOpsAmino { - ops: ProofOpAmino[]; + ops?: ProofOpAmino[]; } export interface ProofOpsAminoMsg { type: "cosmos-sdk/ProofOps"; @@ -642,13 +642,14 @@ export interface ProofOpsSDKType { } function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest { return { - height: Long.ZERO, - pagination: PageRequest.fromPartial({}) + height: BigInt(0), + pagination: undefined }; } export const GetValidatorSetByHeightRequest = { - encode(message: GetValidatorSetByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", + encode(message: GetValidatorSetByHeightRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.pagination !== undefined) { @@ -656,15 +657,15 @@ export const GetValidatorSetByHeightRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -678,31 +679,35 @@ export const GetValidatorSetByHeightRequest = { }, fromJSON(object: any): GetValidatorSetByHeightRequest { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetValidatorSetByHeightRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): GetValidatorSetByHeightRequest { const message = createBaseGetValidatorSetByHeightRequest(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetValidatorSetByHeightRequestAmino): GetValidatorSetByHeightRequest { - return { - height: Long.fromString(object.height), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetValidatorSetByHeightRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: GetValidatorSetByHeightRequest): GetValidatorSetByHeightRequestAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -730,14 +735,15 @@ export const GetValidatorSetByHeightRequest = { }; function createBaseGetValidatorSetByHeightResponse(): GetValidatorSetByHeightResponse { return { - blockHeight: Long.ZERO, + blockHeight: BigInt(0), validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const GetValidatorSetByHeightResponse = { - encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockHeight.isZero()) { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", + encode(message: GetValidatorSetByHeightResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { @@ -748,15 +754,15 @@ export const GetValidatorSetByHeightResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockHeight = (reader.int64() as Long); + message.blockHeight = reader.int64(); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); @@ -773,14 +779,14 @@ export const GetValidatorSetByHeightResponse = { }, fromJSON(object: any): GetValidatorSetByHeightResponse { return { - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, + blockHeight: isSet(object.blockHeight) ? BigInt(object.blockHeight.toString()) : BigInt(0), validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetValidatorSetByHeightResponse): unknown { const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); } else { @@ -791,25 +797,29 @@ export const GetValidatorSetByHeightResponse = { }, fromPartial(object: Partial): GetValidatorSetByHeightResponse { const message = createBaseGetValidatorSetByHeightResponse(); - message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.ZERO; + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetValidatorSetByHeightResponseAmino): GetValidatorSetByHeightResponse { - return { - blockHeight: Long.fromString(object.block_height), - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetValidatorSetByHeightResponse(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: GetValidatorSetByHeightResponse): GetValidatorSetByHeightResponseAmino { const obj: any = {}; - obj.block_height = message.blockHeight ? message.blockHeight.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -838,18 +848,19 @@ export const GetValidatorSetByHeightResponse = { }; function createBaseGetLatestValidatorSetRequest(): GetLatestValidatorSetRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const GetLatestValidatorSetRequest = { - encode(message: GetLatestValidatorSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest", + encode(message: GetLatestValidatorSetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestValidatorSetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetRequest(); while (reader.pos < end) { @@ -881,9 +892,11 @@ export const GetLatestValidatorSetRequest = { return message; }, fromAmino(object: GetLatestValidatorSetRequestAmino): GetLatestValidatorSetRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetLatestValidatorSetRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: GetLatestValidatorSetRequest): GetLatestValidatorSetRequestAmino { const obj: any = {}; @@ -914,14 +927,15 @@ export const GetLatestValidatorSetRequest = { }; function createBaseGetLatestValidatorSetResponse(): GetLatestValidatorSetResponse { return { - blockHeight: Long.ZERO, + blockHeight: BigInt(0), validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const GetLatestValidatorSetResponse = { - encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockHeight.isZero()) { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", + encode(message: GetLatestValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { @@ -932,15 +946,15 @@ export const GetLatestValidatorSetResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestValidatorSetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockHeight = (reader.int64() as Long); + message.blockHeight = reader.int64(); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); @@ -957,14 +971,14 @@ export const GetLatestValidatorSetResponse = { }, fromJSON(object: any): GetLatestValidatorSetResponse { return { - blockHeight: isSet(object.blockHeight) ? Long.fromValue(object.blockHeight) : Long.ZERO, + blockHeight: isSet(object.blockHeight) ? BigInt(object.blockHeight.toString()) : BigInt(0), validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetLatestValidatorSetResponse): unknown { const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); } else { @@ -975,25 +989,29 @@ export const GetLatestValidatorSetResponse = { }, fromPartial(object: Partial): GetLatestValidatorSetResponse { const message = createBaseGetLatestValidatorSetResponse(); - message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.ZERO; + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetLatestValidatorSetResponseAmino): GetLatestValidatorSetResponse { - return { - blockHeight: Long.fromString(object.block_height), - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetLatestValidatorSetResponse(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: GetLatestValidatorSetResponse): GetLatestValidatorSetResponseAmino { const obj: any = {}; - obj.block_height = message.blockHeight ? message.blockHeight.toString() : undefined; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1024,28 +1042,29 @@ function createBaseValidator(): Validator { return { address: "", pubKey: undefined, - votingPower: Long.ZERO, - proposerPriority: Long.ZERO + votingPower: BigInt(0), + proposerPriority: BigInt(0) }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pubKey !== undefined) { Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (!message.votingPower.isZero()) { + if (message.votingPower !== BigInt(0)) { writer.uint32(24).int64(message.votingPower); } - if (!message.proposerPriority.isZero()) { + if (message.proposerPriority !== BigInt(0)) { writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -1058,10 +1077,10 @@ export const Validator = { message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: - message.votingPower = (reader.int64() as Long); + message.votingPower = reader.int64(); break; case 4: - message.proposerPriority = (reader.int64() as Long); + message.proposerPriority = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1074,40 +1093,48 @@ export const Validator = { return { address: isSet(object.address) ? String(object.address) : "", pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, - votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO, - proposerPriority: isSet(object.proposerPriority) ? Long.fromValue(object.proposerPriority) : Long.ZERO + votingPower: isSet(object.votingPower) ? BigInt(object.votingPower.toString()) : BigInt(0), + proposerPriority: isSet(object.proposerPriority) ? BigInt(object.proposerPriority.toString()) : BigInt(0) }; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); - message.proposerPriority !== undefined && (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || BigInt(0)).toString()); + message.proposerPriority !== undefined && (obj.proposerPriority = (message.proposerPriority || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? ""; message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; - message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? Long.fromValue(object.votingPower) : Long.ZERO; - message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? Long.fromValue(object.proposerPriority) : Long.ZERO; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? BigInt(object.proposerPriority.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - address: object.address, - pubKey: object?.pub_key ? Any.fromAmino(object.pub_key) : undefined, - votingPower: Long.fromString(object.voting_power), - proposerPriority: Long.fromString(object.proposer_priority) - }; + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + if (object.proposer_priority !== undefined && object.proposer_priority !== null) { + message.proposerPriority = BigInt(object.proposer_priority); + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; - obj.voting_power = message.votingPower ? message.votingPower.toString() : undefined; - obj.proposer_priority = message.proposerPriority ? message.proposerPriority.toString() : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower.toString() : undefined; + obj.proposer_priority = message.proposerPriority !== BigInt(0) ? message.proposerPriority.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { @@ -1134,25 +1161,26 @@ export const Validator = { }; function createBaseGetBlockByHeightRequest(): GetBlockByHeightRequest { return { - height: Long.ZERO + height: BigInt(0) }; } export const GetBlockByHeightRequest = { - encode(message: GetBlockByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest", + encode(message: GetBlockByHeightRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockByHeightRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1163,27 +1191,29 @@ export const GetBlockByHeightRequest = { }, fromJSON(object: any): GetBlockByHeightRequest { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) }; }, toJSON(message: GetBlockByHeightRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): GetBlockByHeightRequest { const message = createBaseGetBlockByHeightRequest(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: GetBlockByHeightRequestAmino): GetBlockByHeightRequest { - return { - height: Long.fromString(object.height) - }; + const message = createBaseGetBlockByHeightRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: GetBlockByHeightRequest): GetBlockByHeightRequestAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; return obj; }, fromAminoMsg(object: GetBlockByHeightRequestAminoMsg): GetBlockByHeightRequest { @@ -1210,13 +1240,14 @@ export const GetBlockByHeightRequest = { }; function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse { return { - blockId: BlockID.fromPartial({}), - block: Block.fromPartial({}), - sdkBlock: Block.fromPartial({}) + blockId: undefined, + block: undefined, + sdkBlock: undefined }; } export const GetBlockByHeightResponse = { - encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse", + encode(message: GetBlockByHeightResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } @@ -1228,8 +1259,8 @@ export const GetBlockByHeightResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockByHeightResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightResponse(); while (reader.pos < end) { @@ -1273,11 +1304,17 @@ export const GetBlockByHeightResponse = { return message; }, fromAmino(object: GetBlockByHeightResponseAmino): GetBlockByHeightResponse { - return { - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - block: object?.block ? Block1.fromAmino(object.block) : undefined, - sdkBlock: object?.sdk_block ? Block2.fromAmino(object.sdk_block) : undefined - }; + const message = createBaseGetBlockByHeightResponse(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block1.fromAmino(object.block); + } + if (object.sdk_block !== undefined && object.sdk_block !== null) { + message.sdkBlock = Block2.fromAmino(object.sdk_block); + } + return message; }, toAmino(message: GetBlockByHeightResponse): GetBlockByHeightResponseAmino { const obj: any = {}; @@ -1312,11 +1349,12 @@ function createBaseGetLatestBlockRequest(): GetLatestBlockRequest { return {}; } export const GetLatestBlockRequest = { - encode(_: GetLatestBlockRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockRequest", + encode(_: GetLatestBlockRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestBlockRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockRequest(); while (reader.pos < end) { @@ -1341,7 +1379,8 @@ export const GetLatestBlockRequest = { return message; }, fromAmino(_: GetLatestBlockRequestAmino): GetLatestBlockRequest { - return {}; + const message = createBaseGetLatestBlockRequest(); + return message; }, toAmino(_: GetLatestBlockRequest): GetLatestBlockRequestAmino { const obj: any = {}; @@ -1371,13 +1410,14 @@ export const GetLatestBlockRequest = { }; function createBaseGetLatestBlockResponse(): GetLatestBlockResponse { return { - blockId: BlockID.fromPartial({}), - block: Block.fromPartial({}), - sdkBlock: Block.fromPartial({}) + blockId: undefined, + block: undefined, + sdkBlock: undefined }; } export const GetLatestBlockResponse = { - encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse", + encode(message: GetLatestBlockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } @@ -1389,8 +1429,8 @@ export const GetLatestBlockResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestBlockResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockResponse(); while (reader.pos < end) { @@ -1434,11 +1474,17 @@ export const GetLatestBlockResponse = { return message; }, fromAmino(object: GetLatestBlockResponseAmino): GetLatestBlockResponse { - return { - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - block: object?.block ? Block1.fromAmino(object.block) : undefined, - sdkBlock: object?.sdk_block ? Block2.fromAmino(object.sdk_block) : undefined - }; + const message = createBaseGetLatestBlockResponse(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block1.fromAmino(object.block); + } + if (object.sdk_block !== undefined && object.sdk_block !== null) { + message.sdkBlock = Block2.fromAmino(object.sdk_block); + } + return message; }, toAmino(message: GetLatestBlockResponse): GetLatestBlockResponseAmino { const obj: any = {}; @@ -1473,11 +1519,12 @@ function createBaseGetSyncingRequest(): GetSyncingRequest { return {}; } export const GetSyncingRequest = { - encode(_: GetSyncingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingRequest", + encode(_: GetSyncingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetSyncingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingRequest(); while (reader.pos < end) { @@ -1502,7 +1549,8 @@ export const GetSyncingRequest = { return message; }, fromAmino(_: GetSyncingRequestAmino): GetSyncingRequest { - return {}; + const message = createBaseGetSyncingRequest(); + return message; }, toAmino(_: GetSyncingRequest): GetSyncingRequestAmino { const obj: any = {}; @@ -1536,14 +1584,15 @@ function createBaseGetSyncingResponse(): GetSyncingResponse { }; } export const GetSyncingResponse = { - encode(message: GetSyncingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetSyncingResponse", + encode(message: GetSyncingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.syncing === true) { writer.uint32(8).bool(message.syncing); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetSyncingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingResponse(); while (reader.pos < end) { @@ -1575,13 +1624,15 @@ export const GetSyncingResponse = { return message; }, fromAmino(object: GetSyncingResponseAmino): GetSyncingResponse { - return { - syncing: object.syncing - }; + const message = createBaseGetSyncingResponse(); + if (object.syncing !== undefined && object.syncing !== null) { + message.syncing = object.syncing; + } + return message; }, toAmino(message: GetSyncingResponse): GetSyncingResponseAmino { const obj: any = {}; - obj.syncing = message.syncing; + obj.syncing = message.syncing === false ? undefined : message.syncing; return obj; }, fromAminoMsg(object: GetSyncingResponseAminoMsg): GetSyncingResponse { @@ -1610,11 +1661,12 @@ function createBaseGetNodeInfoRequest(): GetNodeInfoRequest { return {}; } export const GetNodeInfoRequest = { - encode(_: GetNodeInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoRequest", + encode(_: GetNodeInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetNodeInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoRequest(); while (reader.pos < end) { @@ -1639,7 +1691,8 @@ export const GetNodeInfoRequest = { return message; }, fromAmino(_: GetNodeInfoRequestAmino): GetNodeInfoRequest { - return {}; + const message = createBaseGetNodeInfoRequest(); + return message; }, toAmino(_: GetNodeInfoRequest): GetNodeInfoRequestAmino { const obj: any = {}; @@ -1669,12 +1722,13 @@ export const GetNodeInfoRequest = { }; function createBaseGetNodeInfoResponse(): GetNodeInfoResponse { return { - defaultNodeInfo: DefaultNodeInfo.fromPartial({}), - applicationVersion: VersionInfo.fromPartial({}) + defaultNodeInfo: undefined, + applicationVersion: undefined }; } export const GetNodeInfoResponse = { - encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse", + encode(message: GetNodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.defaultNodeInfo !== undefined) { DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim(); } @@ -1683,8 +1737,8 @@ export const GetNodeInfoResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetNodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoResponse(); while (reader.pos < end) { @@ -1722,10 +1776,14 @@ export const GetNodeInfoResponse = { return message; }, fromAmino(object: GetNodeInfoResponseAmino): GetNodeInfoResponse { - return { - defaultNodeInfo: object?.default_node_info ? DefaultNodeInfo.fromAmino(object.default_node_info) : undefined, - applicationVersion: object?.application_version ? VersionInfo.fromAmino(object.application_version) : undefined - }; + const message = createBaseGetNodeInfoResponse(); + if (object.default_node_info !== undefined && object.default_node_info !== null) { + message.defaultNodeInfo = DefaultNodeInfo.fromAmino(object.default_node_info); + } + if (object.application_version !== undefined && object.application_version !== null) { + message.applicationVersion = VersionInfo.fromAmino(object.application_version); + } + return message; }, toAmino(message: GetNodeInfoResponse): GetNodeInfoResponseAmino { const obj: any = {}; @@ -1768,7 +1826,8 @@ function createBaseVersionInfo(): VersionInfo { }; } export const VersionInfo = { - encode(message: VersionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.VersionInfo", + encode(message: VersionInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1795,8 +1854,8 @@ export const VersionInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VersionInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VersionInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVersionInfo(); while (reader.pos < end) { @@ -1874,31 +1933,45 @@ export const VersionInfo = { return message; }, fromAmino(object: VersionInfoAmino): VersionInfo { - return { - name: object.name, - appName: object.app_name, - version: object.version, - gitCommit: object.git_commit, - buildTags: object.build_tags, - goVersion: object.go_version, - buildDeps: Array.isArray(object?.build_deps) ? object.build_deps.map((e: any) => Module.fromAmino(e)) : [], - cosmosSdkVersion: object.cosmos_sdk_version - }; + const message = createBaseVersionInfo(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.app_name !== undefined && object.app_name !== null) { + message.appName = object.app_name; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.git_commit !== undefined && object.git_commit !== null) { + message.gitCommit = object.git_commit; + } + if (object.build_tags !== undefined && object.build_tags !== null) { + message.buildTags = object.build_tags; + } + if (object.go_version !== undefined && object.go_version !== null) { + message.goVersion = object.go_version; + } + message.buildDeps = object.build_deps?.map(e => Module.fromAmino(e)) || []; + if (object.cosmos_sdk_version !== undefined && object.cosmos_sdk_version !== null) { + message.cosmosSdkVersion = object.cosmos_sdk_version; + } + return message; }, toAmino(message: VersionInfo): VersionInfoAmino { const obj: any = {}; - obj.name = message.name; - obj.app_name = message.appName; - obj.version = message.version; - obj.git_commit = message.gitCommit; - obj.build_tags = message.buildTags; - obj.go_version = message.goVersion; + obj.name = message.name === "" ? undefined : message.name; + obj.app_name = message.appName === "" ? undefined : message.appName; + obj.version = message.version === "" ? undefined : message.version; + obj.git_commit = message.gitCommit === "" ? undefined : message.gitCommit; + obj.build_tags = message.buildTags === "" ? undefined : message.buildTags; + obj.go_version = message.goVersion === "" ? undefined : message.goVersion; if (message.buildDeps) { obj.build_deps = message.buildDeps.map(e => e ? Module.toAmino(e) : undefined); } else { - obj.build_deps = []; + obj.build_deps = message.buildDeps; } - obj.cosmos_sdk_version = message.cosmosSdkVersion; + obj.cosmos_sdk_version = message.cosmosSdkVersion === "" ? undefined : message.cosmosSdkVersion; return obj; }, fromAminoMsg(object: VersionInfoAminoMsg): VersionInfo { @@ -1931,7 +2004,8 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.Module", + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path !== "") { writer.uint32(10).string(message.path); } @@ -1943,8 +2017,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -1988,17 +2062,23 @@ export const Module = { return message; }, fromAmino(object: ModuleAmino): Module { - return { - path: object.path, - version: object.version, - sum: object.sum - }; + const message = createBaseModule(); + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.sum !== undefined && object.sum !== null) { + message.sum = object.sum; + } + return message; }, toAmino(message: Module): ModuleAmino { const obj: any = {}; - obj.path = message.path; - obj.version = message.version; - obj.sum = message.sum; + obj.path = message.path === "" ? undefined : message.path; + obj.version = message.version === "" ? undefined : message.version; + obj.sum = message.sum === "" ? undefined : message.sum; return obj; }, fromAminoMsg(object: ModuleAminoMsg): Module { @@ -2027,19 +2107,20 @@ function createBaseABCIQueryRequest(): ABCIQueryRequest { return { data: new Uint8Array(), path: "", - height: Long.ZERO, + height: BigInt(0), prove: false }; } export const ABCIQueryRequest = { - encode(message: ABCIQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest", + encode(message: ABCIQueryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.prove === true) { @@ -2047,8 +2128,8 @@ export const ABCIQueryRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ABCIQueryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseABCIQueryRequest(); while (reader.pos < end) { @@ -2061,7 +2142,7 @@ export const ABCIQueryRequest = { message.path = reader.string(); break; case 3: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 4: message.prove = reader.bool(); @@ -2077,7 +2158,7 @@ export const ABCIQueryRequest = { return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), path: isSet(object.path) ? String(object.path) : "", - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), prove: isSet(object.prove) ? Boolean(object.prove) : false }; }, @@ -2085,7 +2166,7 @@ export const ABCIQueryRequest = { const obj: any = {}; message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.path !== undefined && (obj.path = message.path); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.prove !== undefined && (obj.prove = message.prove); return obj; }, @@ -2093,24 +2174,32 @@ export const ABCIQueryRequest = { const message = createBaseABCIQueryRequest(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.prove = object.prove ?? false; return message; }, fromAmino(object: ABCIQueryRequestAmino): ABCIQueryRequest { - return { - data: object.data, - path: object.path, - height: Long.fromString(object.height), - prove: object.prove - }; + const message = createBaseABCIQueryRequest(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } + return message; }, toAmino(message: ABCIQueryRequest): ABCIQueryRequestAmino { const obj: any = {}; - obj.data = message.data; - obj.path = message.path; - obj.height = message.height ? message.height.toString() : undefined; - obj.prove = message.prove; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.path = message.path === "" ? undefined : message.path; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.prove = message.prove === false ? undefined : message.prove; return obj; }, fromAminoMsg(object: ABCIQueryRequestAminoMsg): ABCIQueryRequest { @@ -2140,16 +2229,17 @@ function createBaseABCIQueryResponse(): ABCIQueryResponse { code: 0, log: "", info: "", - index: Long.ZERO, + index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), - proofOps: ProofOps.fromPartial({}), - height: Long.ZERO, + proofOps: undefined, + height: BigInt(0), codespace: "" }; } export const ABCIQueryResponse = { - encode(message: ABCIQueryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse", + encode(message: ABCIQueryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -2159,7 +2249,7 @@ export const ABCIQueryResponse = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.index.isZero()) { + if (message.index !== BigInt(0)) { writer.uint32(40).int64(message.index); } if (message.key.length !== 0) { @@ -2171,7 +2261,7 @@ export const ABCIQueryResponse = { if (message.proofOps !== undefined) { ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(72).int64(message.height); } if (message.codespace !== "") { @@ -2179,8 +2269,8 @@ export const ABCIQueryResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ABCIQueryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseABCIQueryResponse(); while (reader.pos < end) { @@ -2196,7 +2286,7 @@ export const ABCIQueryResponse = { message.info = reader.string(); break; case 5: - message.index = (reader.int64() as Long); + message.index = reader.int64(); break; case 6: message.key = reader.bytes(); @@ -2208,7 +2298,7 @@ export const ABCIQueryResponse = { message.proofOps = ProofOps.decode(reader, reader.uint32()); break; case 9: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 10: message.codespace = reader.string(); @@ -2225,11 +2315,11 @@ export const ABCIQueryResponse = { code: isSet(object.code) ? Number(object.code) : 0, log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", - index: isSet(object.index) ? Long.fromValue(object.index) : Long.ZERO, + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), codespace: isSet(object.codespace) ? String(object.codespace) : "" }; }, @@ -2238,11 +2328,11 @@ export const ABCIQueryResponse = { message.code !== undefined && (obj.code = Math.round(message.code)); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.codespace !== undefined && (obj.codespace = message.codespace); return obj; }, @@ -2251,38 +2341,56 @@ export const ABCIQueryResponse = { message.code = object.code ?? 0; message.log = object.log ?? ""; message.info = object.info ?? ""; - message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.ZERO; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.codespace = object.codespace ?? ""; return message; }, fromAmino(object: ABCIQueryResponseAmino): ABCIQueryResponse { - return { - code: object.code, - log: object.log, - info: object.info, - index: Long.fromString(object.index), - key: object.key, - value: object.value, - proofOps: object?.proof_ops ? ProofOps.fromAmino(object.proof_ops) : undefined, - height: Long.fromString(object.height), - codespace: object.codespace - }; + const message = createBaseABCIQueryResponse(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proof_ops !== undefined && object.proof_ops !== null) { + message.proofOps = ProofOps.fromAmino(object.proof_ops); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; }, toAmino(message: ABCIQueryResponse): ABCIQueryResponseAmino { const obj: any = {}; - obj.code = message.code; - obj.log = message.log; - obj.info = message.info; - obj.index = message.index ? message.index.toString() : undefined; - obj.key = message.key; - obj.value = message.value; + obj.code = message.code === 0 ? undefined : message.code; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; - obj.height = message.height ? message.height.toString() : undefined; - obj.codespace = message.codespace; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.codespace = message.codespace === "" ? undefined : message.codespace; return obj; }, fromAminoMsg(object: ABCIQueryResponseAminoMsg): ABCIQueryResponse { @@ -2315,7 +2423,8 @@ function createBaseProofOp(): ProofOp { }; } export const ProofOp = { - encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp", + encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -2327,8 +2436,8 @@ export const ProofOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOp(); while (reader.pos < end) { @@ -2372,17 +2481,23 @@ export const ProofOp = { return message; }, fromAmino(object: ProofOpAmino): ProofOp { - return { - type: object.type, - key: object.key, - data: object.data - }; + const message = createBaseProofOp(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: ProofOp): ProofOpAmino { const obj: any = {}; - obj.type = message.type; - obj.key = message.key; - obj.data = message.data; + obj.type = message.type === "" ? undefined : message.type; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: ProofOpAminoMsg): ProofOp { @@ -2413,14 +2528,15 @@ function createBaseProofOps(): ProofOps { }; } export const ProofOps = { - encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps", + encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOps(); while (reader.pos < end) { @@ -2456,16 +2572,16 @@ export const ProofOps = { return message; }, fromAmino(object: ProofOpsAmino): ProofOps { - return { - ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromAmino(e)) : [] - }; + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; + return message; }, toAmino(message: ProofOps): ProofOpsAmino { const obj: any = {}; if (message.ops) { obj.ops = message.ops.map(e => e ? ProofOp.toAmino(e) : undefined); } else { - obj.ops = []; + obj.ops = message.ops; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/types.ts b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/types.ts index 2d6cacb7..7d23465b 100644 --- a/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/types.ts +++ b/packages/api/src/codegen/cosmos/base/tendermint/v1beta1/types.ts @@ -1,9 +1,9 @@ import { Data, DataAmino, DataSDKType, Commit, CommitAmino, CommitSDKType, BlockID, BlockIDAmino, BlockIDSDKType } from "../../../../tendermint/types/types"; import { EvidenceList, EvidenceListAmino, EvidenceListSDKType } from "../../../../tendermint/types/evidence"; import { Consensus, ConsensusAmino, ConsensusSDKType } from "../../../../tendermint/version/types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, bytesFromBase64, fromTimestamp, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, fromJsonTimestamp, bytesFromBase64, fromTimestamp, base64FromBytes } from "../../../../helpers"; /** * Block is tendermint type Block, with the Header proposer address * field converted to bech32 string. @@ -12,7 +12,7 @@ export interface Block { header: Header; data: Data; evidence: EvidenceList; - lastCommit: Commit; + lastCommit?: Commit; } export interface BlockProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.Block"; @@ -40,14 +40,14 @@ export interface BlockSDKType { header: HeaderSDKType; data: DataSDKType; evidence: EvidenceListSDKType; - last_commit: CommitSDKType; + last_commit?: CommitSDKType; } /** Header defines the structure of a Tendermint block header. */ export interface Header { /** basic block info */ version: Consensus; chainId: string; - height: Long; + height: bigint; time: Timestamp; /** prev block info */ lastBlockId: BlockID; @@ -80,31 +80,31 @@ export interface HeaderProtoMsg { export interface HeaderAmino { /** basic block info */ version?: ConsensusAmino; - chain_id: string; - height: string; - time?: TimestampAmino; + chain_id?: string; + height?: string; + time?: string; /** prev block info */ last_block_id?: BlockIDAmino; /** hashes of block data */ - last_commit_hash: Uint8Array; - data_hash: Uint8Array; + last_commit_hash?: string; + data_hash?: string; /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; + validators_hash?: string; /** validators for the next block */ - next_validators_hash: Uint8Array; + next_validators_hash?: string; /** consensus params for current block */ - consensus_hash: Uint8Array; + consensus_hash?: string; /** state after txs from the previous block */ - app_hash: Uint8Array; - last_results_hash: Uint8Array; + app_hash?: string; + last_results_hash?: string; /** consensus info */ - evidence_hash: Uint8Array; + evidence_hash?: string; /** * proposer_address is the original block proposer address, formatted as a Bech32 string. * In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string * for better UX. */ - proposer_address: string; + proposer_address?: string; } export interface HeaderAminoMsg { type: "cosmos-sdk/Header"; @@ -114,7 +114,7 @@ export interface HeaderAminoMsg { export interface HeaderSDKType { version: ConsensusSDKType; chain_id: string; - height: Long; + height: bigint; time: TimestampSDKType; last_block_id: BlockIDSDKType; last_commit_hash: Uint8Array; @@ -132,11 +132,12 @@ function createBaseBlock(): Block { header: Header.fromPartial({}), data: Data.fromPartial({}), evidence: EvidenceList.fromPartial({}), - lastCommit: Commit.fromPartial({}) + lastCommit: undefined }; } export const Block = { - encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.Block", + encode(message: Block, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -151,8 +152,8 @@ export const Block = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Block { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Block { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlock(); while (reader.pos < end) { @@ -202,12 +203,20 @@ export const Block = { return message; }, fromAmino(object: BlockAmino): Block { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - data: object?.data ? Data.fromAmino(object.data) : undefined, - evidence: object?.evidence ? EvidenceList.fromAmino(object.evidence) : undefined, - lastCommit: object?.last_commit ? Commit.fromAmino(object.last_commit) : undefined - }; + const message = createBaseBlock(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromAmino(object.data); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromAmino(object.evidence); + } + if (object.last_commit !== undefined && object.last_commit !== null) { + message.lastCommit = Commit.fromAmino(object.last_commit); + } + return message; }, toAmino(message: Block): BlockAmino { const obj: any = {}; @@ -243,8 +252,8 @@ function createBaseHeader(): Header { return { version: Consensus.fromPartial({}), chainId: "", - height: Long.ZERO, - time: undefined, + height: BigInt(0), + time: Timestamp.fromPartial({}), lastBlockId: BlockID.fromPartial({}), lastCommitHash: new Uint8Array(), dataHash: new Uint8Array(), @@ -258,14 +267,15 @@ function createBaseHeader(): Header { }; } export const Header = { - encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.tendermint.v1beta1.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); } if (message.chainId !== "") { writer.uint32(18).string(message.chainId); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { @@ -303,8 +313,8 @@ export const Header = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Header { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeader(); while (reader.pos < end) { @@ -317,7 +327,7 @@ export const Header = { message.chainId = reader.string(); break; case 3: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 4: message.time = Timestamp.decode(reader, reader.uint32()); @@ -363,7 +373,7 @@ export const Header = { return { version: isSet(object.version) ? Consensus.fromJSON(object.version) : undefined, chainId: isSet(object.chainId) ? String(object.chainId) : "", - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, lastBlockId: isSet(object.lastBlockId) ? BlockID.fromJSON(object.lastBlockId) : undefined, lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(), @@ -381,7 +391,7 @@ export const Header = { const obj: any = {}; message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); message.chainId !== undefined && (obj.chainId = message.chainId); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.lastBlockId !== undefined && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); message.lastCommitHash !== undefined && (obj.lastCommitHash = base64FromBytes(message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array())); @@ -399,7 +409,7 @@ export const Header = { const message = createBaseHeader(); message.version = object.version !== undefined && object.version !== null ? Consensus.fromPartial(object.version) : undefined; message.chainId = object.chainId ?? ""; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.time = object.time !== undefined && object.time !== null ? Timestamp.fromPartial(object.time) : undefined; message.lastBlockId = object.lastBlockId !== undefined && object.lastBlockId !== null ? BlockID.fromPartial(object.lastBlockId) : undefined; message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); @@ -414,39 +424,67 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - version: object?.version ? Consensus.fromAmino(object.version) : undefined, - chainId: object.chain_id, - height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, - lastCommitHash: object.last_commit_hash, - dataHash: object.data_hash, - validatorsHash: object.validators_hash, - nextValidatorsHash: object.next_validators_hash, - consensusHash: object.consensus_hash, - appHash: object.app_hash, - lastResultsHash: object.last_results_hash, - evidenceHash: object.evidence_hash, - proposerAddress: object.proposer_address - }; + const message = createBaseHeader(); + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromAmino(object.version); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.last_block_id !== undefined && object.last_block_id !== null) { + message.lastBlockId = BlockID.fromAmino(object.last_block_id); + } + if (object.last_commit_hash !== undefined && object.last_commit_hash !== null) { + message.lastCommitHash = bytesFromBase64(object.last_commit_hash); + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.validators_hash !== undefined && object.validators_hash !== null) { + message.validatorsHash = bytesFromBase64(object.validators_hash); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.consensus_hash !== undefined && object.consensus_hash !== null) { + message.consensusHash = bytesFromBase64(object.consensus_hash); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + if (object.last_results_hash !== undefined && object.last_results_hash !== null) { + message.lastResultsHash = bytesFromBase64(object.last_results_hash); + } + if (object.evidence_hash !== undefined && object.evidence_hash !== null) { + message.evidenceHash = bytesFromBase64(object.evidence_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = object.proposer_address; + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.version = message.version ? Consensus.toAmino(message.version) : undefined; - obj.chain_id = message.chainId; - obj.height = message.height ? message.height.toString() : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; - obj.last_commit_hash = message.lastCommitHash; - obj.data_hash = message.dataHash; - obj.validators_hash = message.validatorsHash; - obj.next_validators_hash = message.nextValidatorsHash; - obj.consensus_hash = message.consensusHash; - obj.app_hash = message.appHash; - obj.last_results_hash = message.lastResultsHash; - obj.evidence_hash = message.evidenceHash; - obj.proposer_address = message.proposerAddress; + obj.last_commit_hash = message.lastCommitHash ? base64FromBytes(message.lastCommitHash) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.validators_hash = message.validatorsHash ? base64FromBytes(message.validatorsHash) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.consensus_hash = message.consensusHash ? base64FromBytes(message.consensusHash) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.last_results_hash = message.lastResultsHash ? base64FromBytes(message.lastResultsHash) : undefined; + obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; + obj.proposer_address = message.proposerAddress === "" ? undefined : message.proposerAddress; return obj; }, fromAminoMsg(object: HeaderAminoMsg): Header { diff --git a/packages/api/src/codegen/cosmos/base/v1beta1/coin.ts b/packages/api/src/codegen/cosmos/base/v1beta1/coin.ts index 35fe822c..dcae3af4 100644 --- a/packages/api/src/codegen/cosmos/base/v1beta1/coin.ts +++ b/packages/api/src/codegen/cosmos/base/v1beta1/coin.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * Coin defines a token with a denomination and an amount. @@ -21,8 +21,8 @@ export interface CoinProtoMsg { * signatures required by gogoproto. */ export interface CoinAmino { - denom: string; - amount: string; + denom?: string; + amount?: string; } export interface CoinAminoMsg { type: "cosmos-sdk/Coin"; @@ -59,8 +59,8 @@ export interface DecCoinProtoMsg { * signatures required by gogoproto. */ export interface DecCoinAmino { - denom: string; - amount: string; + denom?: string; + amount?: string; } export interface DecCoinAminoMsg { type: "cosmos-sdk/DecCoin"; @@ -86,7 +86,7 @@ export interface IntProtoProtoMsg { } /** IntProto defines a Protobuf wrapper around an Int object. */ export interface IntProtoAmino { - int: string; + int?: string; } export interface IntProtoAminoMsg { type: "cosmos-sdk/IntProto"; @@ -106,7 +106,7 @@ export interface DecProtoProtoMsg { } /** DecProto defines a Protobuf wrapper around a Dec object. */ export interface DecProtoAmino { - dec: string; + dec?: string; } export interface DecProtoAminoMsg { type: "cosmos-sdk/DecProto"; @@ -123,7 +123,8 @@ function createBaseCoin(): Coin { }; } export const Coin = { - encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.v1beta1.Coin", + encode(message: Coin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -132,8 +133,8 @@ export const Coin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Coin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCoin(); while (reader.pos < end) { @@ -171,15 +172,19 @@ export const Coin = { return message; }, fromAmino(object: CoinAmino): Coin { - return { - denom: object.denom, - amount: object.amount - }; + const message = createBaseCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: Coin): CoinAmino { 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: CoinAminoMsg): Coin { @@ -211,7 +216,8 @@ function createBaseDecCoin(): DecCoin { }; } export const DecCoin = { - encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.v1beta1.DecCoin", + encode(message: DecCoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -220,8 +226,8 @@ export const DecCoin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDecCoin(); while (reader.pos < end) { @@ -259,15 +265,19 @@ export const DecCoin = { return message; }, fromAmino(object: DecCoinAmino): DecCoin { - return { - denom: object.denom, - amount: object.amount - }; + const message = createBaseDecCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, 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 { @@ -298,14 +308,15 @@ function createBaseIntProto(): IntProto { }; } export const IntProto = { - encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.v1beta1.IntProto", + encode(message: IntProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IntProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIntProto(); while (reader.pos < end) { @@ -337,13 +348,15 @@ export const IntProto = { return message; }, fromAmino(object: IntProtoAmino): IntProto { - return { - int: object.int - }; + const message = createBaseIntProto(); + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } + return message; }, toAmino(message: IntProto): IntProtoAmino { const obj: any = {}; - obj.int = message.int; + obj.int = message.int === "" ? undefined : message.int; return obj; }, fromAminoMsg(object: IntProtoAminoMsg): IntProto { @@ -374,14 +387,15 @@ function createBaseDecProto(): DecProto { }; } export const DecProto = { - encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.base.v1beta1.DecProto", + encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DecProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDecProto(); while (reader.pos < end) { @@ -413,13 +427,15 @@ export const DecProto = { return message; }, fromAmino(object: DecProtoAmino): DecProto { - return { - dec: object.dec - }; + const message = createBaseDecProto(); + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } + return message; }, 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/api/src/codegen/cosmos/bundle.ts b/packages/api/src/codegen/cosmos/bundle.ts index 546d6e8e..673adb5a 100644 --- a/packages/api/src/codegen/cosmos/bundle.ts +++ b/packages/api/src/codegen/cosmos/bundle.ts @@ -94,88 +94,88 @@ import * as _94 from "./upgrade/v1beta1/tx"; import * as _95 from "./upgrade/v1beta1/upgrade"; import * as _96 from "./vesting/v1beta1/tx"; import * as _97 from "./vesting/v1beta1/vesting"; -import * as _151 from "./authz/v1beta1/tx.amino"; -import * as _152 from "./bank/v1beta1/tx.amino"; -import * as _153 from "./crisis/v1beta1/tx.amino"; -import * as _154 from "./distribution/v1beta1/tx.amino"; -import * as _155 from "./evidence/v1beta1/tx.amino"; -import * as _156 from "./feegrant/v1beta1/tx.amino"; -import * as _157 from "./gov/v1/tx.amino"; -import * as _158 from "./gov/v1beta1/tx.amino"; -import * as _159 from "./group/v1/tx.amino"; -import * as _160 from "./nft/v1beta1/tx.amino"; -import * as _161 from "./slashing/v1beta1/tx.amino"; -import * as _162 from "./staking/v1beta1/tx.amino"; -import * as _163 from "./upgrade/v1beta1/tx.amino"; -import * as _164 from "./vesting/v1beta1/tx.amino"; -import * as _165 from "./authz/v1beta1/tx.registry"; -import * as _166 from "./bank/v1beta1/tx.registry"; -import * as _167 from "./crisis/v1beta1/tx.registry"; -import * as _168 from "./distribution/v1beta1/tx.registry"; -import * as _169 from "./evidence/v1beta1/tx.registry"; -import * as _170 from "./feegrant/v1beta1/tx.registry"; -import * as _171 from "./gov/v1/tx.registry"; -import * as _172 from "./gov/v1beta1/tx.registry"; -import * as _173 from "./group/v1/tx.registry"; -import * as _174 from "./nft/v1beta1/tx.registry"; -import * as _175 from "./slashing/v1beta1/tx.registry"; -import * as _176 from "./staking/v1beta1/tx.registry"; -import * as _177 from "./upgrade/v1beta1/tx.registry"; -import * as _178 from "./vesting/v1beta1/tx.registry"; -import * as _179 from "./auth/v1beta1/query.lcd"; -import * as _180 from "./authz/v1beta1/query.lcd"; -import * as _181 from "./bank/v1beta1/query.lcd"; -import * as _182 from "./base/node/v1beta1/query.lcd"; -import * as _183 from "./base/tendermint/v1beta1/query.lcd"; -import * as _184 from "./distribution/v1beta1/query.lcd"; -import * as _185 from "./evidence/v1beta1/query.lcd"; -import * as _186 from "./feegrant/v1beta1/query.lcd"; -import * as _187 from "./gov/v1/query.lcd"; -import * as _188 from "./gov/v1beta1/query.lcd"; -import * as _189 from "./group/v1/query.lcd"; -import * as _190 from "./mint/v1beta1/query.lcd"; -import * as _191 from "./nft/v1beta1/query.lcd"; -import * as _192 from "./params/v1beta1/query.lcd"; -import * as _193 from "./slashing/v1beta1/query.lcd"; -import * as _194 from "./staking/v1beta1/query.lcd"; -import * as _195 from "./tx/v1beta1/service.lcd"; -import * as _196 from "./upgrade/v1beta1/query.lcd"; -import * as _197 from "./app/v1alpha1/query.rpc.Query"; -import * as _198 from "./auth/v1beta1/query.rpc.Query"; -import * as _199 from "./authz/v1beta1/query.rpc.Query"; -import * as _200 from "./bank/v1beta1/query.rpc.Query"; -import * as _201 from "./base/node/v1beta1/query.rpc.Service"; -import * as _202 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _203 from "./distribution/v1beta1/query.rpc.Query"; -import * as _204 from "./evidence/v1beta1/query.rpc.Query"; -import * as _205 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _206 from "./gov/v1/query.rpc.Query"; -import * as _207 from "./gov/v1beta1/query.rpc.Query"; -import * as _208 from "./group/v1/query.rpc.Query"; -import * as _209 from "./mint/v1beta1/query.rpc.Query"; -import * as _210 from "./nft/v1beta1/query.rpc.Query"; -import * as _211 from "./params/v1beta1/query.rpc.Query"; -import * as _212 from "./slashing/v1beta1/query.rpc.Query"; -import * as _213 from "./staking/v1beta1/query.rpc.Query"; -import * as _214 from "./tx/v1beta1/service.rpc.Service"; -import * as _215 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _216 from "./authz/v1beta1/tx.rpc.msg"; -import * as _217 from "./bank/v1beta1/tx.rpc.msg"; -import * as _218 from "./crisis/v1beta1/tx.rpc.msg"; -import * as _219 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _220 from "./evidence/v1beta1/tx.rpc.msg"; -import * as _221 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _222 from "./gov/v1/tx.rpc.msg"; -import * as _223 from "./gov/v1beta1/tx.rpc.msg"; -import * as _224 from "./group/v1/tx.rpc.msg"; -import * as _225 from "./nft/v1beta1/tx.rpc.msg"; -import * as _226 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _227 from "./staking/v1beta1/tx.rpc.msg"; -import * as _228 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _229 from "./vesting/v1beta1/tx.rpc.msg"; -import * as _270 from "./lcd"; -import * as _271 from "./rpc.query"; -import * as _272 from "./rpc.tx"; +import * as _152 from "./authz/v1beta1/tx.amino"; +import * as _153 from "./bank/v1beta1/tx.amino"; +import * as _154 from "./crisis/v1beta1/tx.amino"; +import * as _155 from "./distribution/v1beta1/tx.amino"; +import * as _156 from "./evidence/v1beta1/tx.amino"; +import * as _157 from "./feegrant/v1beta1/tx.amino"; +import * as _158 from "./gov/v1/tx.amino"; +import * as _159 from "./gov/v1beta1/tx.amino"; +import * as _160 from "./group/v1/tx.amino"; +import * as _161 from "./nft/v1beta1/tx.amino"; +import * as _162 from "./slashing/v1beta1/tx.amino"; +import * as _163 from "./staking/v1beta1/tx.amino"; +import * as _164 from "./upgrade/v1beta1/tx.amino"; +import * as _165 from "./vesting/v1beta1/tx.amino"; +import * as _166 from "./authz/v1beta1/tx.registry"; +import * as _167 from "./bank/v1beta1/tx.registry"; +import * as _168 from "./crisis/v1beta1/tx.registry"; +import * as _169 from "./distribution/v1beta1/tx.registry"; +import * as _170 from "./evidence/v1beta1/tx.registry"; +import * as _171 from "./feegrant/v1beta1/tx.registry"; +import * as _172 from "./gov/v1/tx.registry"; +import * as _173 from "./gov/v1beta1/tx.registry"; +import * as _174 from "./group/v1/tx.registry"; +import * as _175 from "./nft/v1beta1/tx.registry"; +import * as _176 from "./slashing/v1beta1/tx.registry"; +import * as _177 from "./staking/v1beta1/tx.registry"; +import * as _178 from "./upgrade/v1beta1/tx.registry"; +import * as _179 from "./vesting/v1beta1/tx.registry"; +import * as _180 from "./auth/v1beta1/query.lcd"; +import * as _181 from "./authz/v1beta1/query.lcd"; +import * as _182 from "./bank/v1beta1/query.lcd"; +import * as _183 from "./base/node/v1beta1/query.lcd"; +import * as _184 from "./base/tendermint/v1beta1/query.lcd"; +import * as _185 from "./distribution/v1beta1/query.lcd"; +import * as _186 from "./evidence/v1beta1/query.lcd"; +import * as _187 from "./feegrant/v1beta1/query.lcd"; +import * as _188 from "./gov/v1/query.lcd"; +import * as _189 from "./gov/v1beta1/query.lcd"; +import * as _190 from "./group/v1/query.lcd"; +import * as _191 from "./mint/v1beta1/query.lcd"; +import * as _192 from "./nft/v1beta1/query.lcd"; +import * as _193 from "./params/v1beta1/query.lcd"; +import * as _194 from "./slashing/v1beta1/query.lcd"; +import * as _195 from "./staking/v1beta1/query.lcd"; +import * as _196 from "./tx/v1beta1/service.lcd"; +import * as _197 from "./upgrade/v1beta1/query.lcd"; +import * as _198 from "./app/v1alpha1/query.rpc.Query"; +import * as _199 from "./auth/v1beta1/query.rpc.Query"; +import * as _200 from "./authz/v1beta1/query.rpc.Query"; +import * as _201 from "./bank/v1beta1/query.rpc.Query"; +import * as _202 from "./base/node/v1beta1/query.rpc.Service"; +import * as _203 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _204 from "./distribution/v1beta1/query.rpc.Query"; +import * as _205 from "./evidence/v1beta1/query.rpc.Query"; +import * as _206 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _207 from "./gov/v1/query.rpc.Query"; +import * as _208 from "./gov/v1beta1/query.rpc.Query"; +import * as _209 from "./group/v1/query.rpc.Query"; +import * as _210 from "./mint/v1beta1/query.rpc.Query"; +import * as _211 from "./nft/v1beta1/query.rpc.Query"; +import * as _212 from "./params/v1beta1/query.rpc.Query"; +import * as _213 from "./slashing/v1beta1/query.rpc.Query"; +import * as _214 from "./staking/v1beta1/query.rpc.Query"; +import * as _215 from "./tx/v1beta1/service.rpc.Service"; +import * as _216 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _217 from "./authz/v1beta1/tx.rpc.msg"; +import * as _218 from "./bank/v1beta1/tx.rpc.msg"; +import * as _219 from "./crisis/v1beta1/tx.rpc.msg"; +import * as _220 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _221 from "./evidence/v1beta1/tx.rpc.msg"; +import * as _222 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _223 from "./gov/v1/tx.rpc.msg"; +import * as _224 from "./gov/v1beta1/tx.rpc.msg"; +import * as _225 from "./group/v1/tx.rpc.msg"; +import * as _226 from "./nft/v1beta1/tx.rpc.msg"; +import * as _227 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _228 from "./staking/v1beta1/tx.rpc.msg"; +import * as _229 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _230 from "./vesting/v1beta1/tx.rpc.msg"; +import * as _271 from "./lcd"; +import * as _272 from "./rpc.query"; +import * as _273 from "./rpc.tx"; export namespace cosmos { export namespace app { export namespace module { @@ -187,7 +187,7 @@ export namespace cosmos { ..._3, ..._4, ..._5, - ..._197 + ..._198 }; } export namespace auth { @@ -195,8 +195,8 @@ export namespace cosmos { ..._6, ..._7, ..._8, - ..._179, - ..._198 + ..._180, + ..._199 }; } export namespace authz { @@ -206,11 +206,11 @@ export namespace cosmos { ..._11, ..._12, ..._13, - ..._151, - ..._165, - ..._180, - ..._199, - ..._216 + ..._152, + ..._166, + ..._181, + ..._200, + ..._217 }; } export namespace bank { @@ -220,11 +220,11 @@ export namespace cosmos { ..._16, ..._17, ..._18, - ..._152, - ..._166, - ..._181, - ..._200, - ..._217 + ..._153, + ..._167, + ..._182, + ..._201, + ..._218 }; } export namespace base { @@ -241,8 +241,8 @@ export namespace cosmos { export namespace node { export const v1beta1 = { ..._21, - ..._182, - ..._201 + ..._183, + ..._202 }; } export namespace query { @@ -273,8 +273,8 @@ export namespace cosmos { export const v1beta1 = { ..._28, ..._29, - ..._183, - ..._202 + ..._184, + ..._203 }; } export const v1beta1 = { @@ -291,9 +291,9 @@ export namespace cosmos { export const v1beta1 = { ..._33, ..._34, - ..._153, - ..._167, - ..._218 + ..._154, + ..._168, + ..._219 }; } export namespace crypto { @@ -326,11 +326,11 @@ export namespace cosmos { ..._42, ..._43, ..._44, - ..._154, - ..._168, - ..._184, - ..._203, - ..._219 + ..._155, + ..._169, + ..._185, + ..._204, + ..._220 }; } export namespace evidence { @@ -339,11 +339,11 @@ export namespace cosmos { ..._46, ..._47, ..._48, - ..._155, - ..._169, - ..._185, - ..._204, - ..._220 + ..._156, + ..._170, + ..._186, + ..._205, + ..._221 }; } export namespace feegrant { @@ -352,11 +352,11 @@ export namespace cosmos { ..._50, ..._51, ..._52, - ..._156, - ..._170, - ..._186, - ..._205, - ..._221 + ..._157, + ..._171, + ..._187, + ..._206, + ..._222 }; } export namespace genutil { @@ -370,22 +370,22 @@ export namespace cosmos { ..._55, ..._56, ..._57, - ..._157, - ..._171, - ..._187, - ..._206, - ..._222 + ..._158, + ..._172, + ..._188, + ..._207, + ..._223 }; export const v1beta1 = { ..._58, ..._59, ..._60, ..._61, - ..._158, - ..._172, - ..._188, - ..._207, - ..._223 + ..._159, + ..._173, + ..._189, + ..._208, + ..._224 }; } export namespace group { @@ -395,11 +395,11 @@ export namespace cosmos { ..._64, ..._65, ..._66, - ..._159, - ..._173, - ..._189, - ..._208, - ..._224 + ..._160, + ..._174, + ..._190, + ..._209, + ..._225 }; } export namespace mint { @@ -407,8 +407,8 @@ export namespace cosmos { ..._67, ..._68, ..._69, - ..._190, - ..._209 + ..._191, + ..._210 }; } export namespace msg { @@ -423,11 +423,11 @@ export namespace cosmos { ..._73, ..._74, ..._75, - ..._160, - ..._174, - ..._191, - ..._210, - ..._225 + ..._161, + ..._175, + ..._192, + ..._211, + ..._226 }; } export namespace orm { @@ -447,8 +447,8 @@ export namespace cosmos { export const v1beta1 = { ..._79, ..._80, - ..._192, - ..._211 + ..._193, + ..._212 }; } export namespace slashing { @@ -457,11 +457,11 @@ export namespace cosmos { ..._82, ..._83, ..._84, - ..._161, - ..._175, - ..._193, - ..._212, - ..._226 + ..._162, + ..._176, + ..._194, + ..._213, + ..._227 }; } export namespace staking { @@ -471,11 +471,11 @@ export namespace cosmos { ..._87, ..._88, ..._89, - ..._162, - ..._176, - ..._194, - ..._213, - ..._227 + ..._163, + ..._177, + ..._195, + ..._214, + ..._228 }; } export namespace tx { @@ -487,8 +487,8 @@ export namespace cosmos { export const v1beta1 = { ..._91, ..._92, - ..._195, - ..._214 + ..._196, + ..._215 }; } export namespace upgrade { @@ -496,25 +496,25 @@ export namespace cosmos { ..._93, ..._94, ..._95, - ..._163, - ..._177, - ..._196, - ..._215, - ..._228 + ..._164, + ..._178, + ..._197, + ..._216, + ..._229 }; } export namespace vesting { export const v1beta1 = { ..._96, ..._97, - ..._164, - ..._178, - ..._229 + ..._165, + ..._179, + ..._230 }; } export const ClientFactory = { - ..._270, ..._271, - ..._272 + ..._272, + ..._273 }; } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/capability/v1beta1/capability.ts b/packages/api/src/codegen/cosmos/capability/v1beta1/capability.ts index 8c8d7372..ff85a857 100644 --- a/packages/api/src/codegen/cosmos/capability/v1beta1/capability.ts +++ b/packages/api/src/codegen/cosmos/capability/v1beta1/capability.ts @@ -1,11 +1,11 @@ -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** * Capability defines an implementation of an object capability. The index * provided to a Capability must be globally unique. */ export interface Capability { - index: Long; + index: bigint; } export interface CapabilityProtoMsg { typeUrl: "/cosmos.capability.v1beta1.Capability"; @@ -16,7 +16,7 @@ export interface CapabilityProtoMsg { * provided to a Capability must be globally unique. */ export interface CapabilityAmino { - index: string; + index?: string; } export interface CapabilityAminoMsg { type: "cosmos-sdk/Capability"; @@ -27,7 +27,7 @@ export interface CapabilityAminoMsg { * provided to a Capability must be globally unique. */ export interface CapabilitySDKType { - index: Long; + index: bigint; } /** * Owner defines a single capability owner. An owner is defined by the name of @@ -46,8 +46,8 @@ export interface OwnerProtoMsg { * capability and the module name. */ export interface OwnerAmino { - module: string; - name: string; + module?: string; + name?: string; } export interface OwnerAminoMsg { type: "cosmos-sdk/Owner"; @@ -77,7 +77,7 @@ export interface CapabilityOwnersProtoMsg { * owners must be unique. */ export interface CapabilityOwnersAmino { - owners: OwnerAmino[]; + owners?: OwnerAmino[]; } export interface CapabilityOwnersAminoMsg { type: "cosmos-sdk/CapabilityOwners"; @@ -92,25 +92,26 @@ export interface CapabilityOwnersSDKType { } function createBaseCapability(): Capability { return { - index: Long.UZERO + index: BigInt(0) }; } export const Capability = { - encode(message: Capability, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + typeUrl: "/cosmos.capability.v1beta1.Capability", + encode(message: Capability, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Capability { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Capability { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCapability(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = (reader.uint64() as Long); + message.index = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -121,27 +122,29 @@ export const Capability = { }, fromJSON(object: any): Capability { return { - index: isSet(object.index) ? Long.fromValue(object.index) : Long.UZERO + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0) }; }, toJSON(message: Capability): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Capability { const message = createBaseCapability(); - message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.UZERO; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); return message; }, fromAmino(object: CapabilityAmino): Capability { - return { - index: Long.fromString(object.index) - }; + const message = createBaseCapability(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + return message; }, toAmino(message: Capability): CapabilityAmino { const obj: any = {}; - obj.index = message.index ? message.index.toString() : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; return obj; }, fromAminoMsg(object: CapabilityAminoMsg): Capability { @@ -173,7 +176,8 @@ function createBaseOwner(): Owner { }; } export const Owner = { - encode(message: Owner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.capability.v1beta1.Owner", + encode(message: Owner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.module !== "") { writer.uint32(10).string(message.module); } @@ -182,8 +186,8 @@ export const Owner = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Owner { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Owner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOwner(); while (reader.pos < end) { @@ -221,15 +225,19 @@ export const Owner = { return message; }, fromAmino(object: OwnerAmino): Owner { - return { - module: object.module, - name: object.name - }; + const message = createBaseOwner(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: Owner): OwnerAmino { const obj: any = {}; - obj.module = message.module; - obj.name = message.name; + obj.module = message.module === "" ? undefined : message.module; + obj.name = message.name === "" ? undefined : message.name; return obj; }, fromAminoMsg(object: OwnerAminoMsg): Owner { @@ -260,14 +268,15 @@ function createBaseCapabilityOwners(): CapabilityOwners { }; } export const CapabilityOwners = { - encode(message: CapabilityOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.capability.v1beta1.CapabilityOwners", + encode(message: CapabilityOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.owners) { Owner.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CapabilityOwners { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CapabilityOwners { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCapabilityOwners(); while (reader.pos < end) { @@ -303,16 +312,16 @@ export const CapabilityOwners = { return message; }, fromAmino(object: CapabilityOwnersAmino): CapabilityOwners { - return { - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => Owner.fromAmino(e)) : [] - }; + const message = createBaseCapabilityOwners(); + message.owners = object.owners?.map(e => Owner.fromAmino(e)) || []; + return message; }, toAmino(message: CapabilityOwners): CapabilityOwnersAmino { const obj: any = {}; if (message.owners) { obj.owners = message.owners.map(e => e ? Owner.toAmino(e) : undefined); } else { - obj.owners = []; + obj.owners = message.owners; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/capability/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/capability/v1beta1/genesis.ts index 24456caf..cee6f5e5 100644 --- a/packages/api/src/codegen/cosmos/capability/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/capability/v1beta1/genesis.ts @@ -1,10 +1,10 @@ import { CapabilityOwners, CapabilityOwnersAmino, CapabilityOwnersSDKType } from "./capability"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwners { /** index is the index of the capability owner. */ - index: Long; + index: bigint; /** index_owners are the owners at the given index. */ indexOwners: CapabilityOwners; } @@ -15,7 +15,7 @@ export interface GenesisOwnersProtoMsg { /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwnersAmino { /** index is the index of the capability owner. */ - index: string; + index?: string; /** index_owners are the owners at the given index. */ index_owners?: CapabilityOwnersAmino; } @@ -25,13 +25,13 @@ export interface GenesisOwnersAminoMsg { } /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwnersSDKType { - index: Long; + index: bigint; index_owners: CapabilityOwnersSDKType; } /** GenesisState defines the capability module's genesis state. */ export interface GenesisState { /** index is the capability global index. */ - index: Long; + index: bigint; /** * owners represents a map from index to owners of the capability index * index key is string to allow amino marshalling. @@ -45,12 +45,12 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the capability module's genesis state. */ export interface GenesisStateAmino { /** index is the capability global index. */ - index: string; + index?: string; /** * owners represents a map from index to owners of the capability index * index key is string to allow amino marshalling. */ - owners: GenesisOwnersAmino[]; + owners?: GenesisOwnersAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -58,18 +58,19 @@ export interface GenesisStateAminoMsg { } /** GenesisState defines the capability module's genesis state. */ export interface GenesisStateSDKType { - index: Long; + index: bigint; owners: GenesisOwnersSDKType[]; } function createBaseGenesisOwners(): GenesisOwners { return { - index: Long.UZERO, + index: BigInt(0), indexOwners: CapabilityOwners.fromPartial({}) }; } export const GenesisOwners = { - encode(message: GenesisOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + typeUrl: "/cosmos.capability.v1beta1.GenesisOwners", + encode(message: GenesisOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); } if (message.indexOwners !== undefined) { @@ -77,15 +78,15 @@ export const GenesisOwners = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisOwners { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisOwners { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisOwners(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = (reader.uint64() as Long); + message.index = reader.uint64(); break; case 2: message.indexOwners = CapabilityOwners.decode(reader, reader.uint32()); @@ -99,31 +100,35 @@ export const GenesisOwners = { }, fromJSON(object: any): GenesisOwners { return { - index: isSet(object.index) ? Long.fromValue(object.index) : Long.UZERO, + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), indexOwners: isSet(object.indexOwners) ? CapabilityOwners.fromJSON(object.indexOwners) : undefined }; }, toJSON(message: GenesisOwners): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.indexOwners !== undefined && (obj.indexOwners = message.indexOwners ? CapabilityOwners.toJSON(message.indexOwners) : undefined); return obj; }, fromPartial(object: Partial): GenesisOwners { const message = createBaseGenesisOwners(); - message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.UZERO; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); message.indexOwners = object.indexOwners !== undefined && object.indexOwners !== null ? CapabilityOwners.fromPartial(object.indexOwners) : undefined; return message; }, fromAmino(object: GenesisOwnersAmino): GenesisOwners { - return { - index: Long.fromString(object.index), - indexOwners: object?.index_owners ? CapabilityOwners.fromAmino(object.index_owners) : undefined - }; + const message = createBaseGenesisOwners(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.index_owners !== undefined && object.index_owners !== null) { + message.indexOwners = CapabilityOwners.fromAmino(object.index_owners); + } + return message; }, toAmino(message: GenesisOwners): GenesisOwnersAmino { const obj: any = {}; - obj.index = message.index ? message.index.toString() : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; obj.index_owners = message.indexOwners ? CapabilityOwners.toAmino(message.indexOwners) : undefined; return obj; }, @@ -151,13 +156,14 @@ export const GenesisOwners = { }; function createBaseGenesisState(): GenesisState { return { - index: Long.UZERO, + index: BigInt(0), owners: [] }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + typeUrl: "/cosmos.capability.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); } for (const v of message.owners) { @@ -165,15 +171,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = (reader.uint64() as Long); + message.index = reader.uint64(); break; case 2: message.owners.push(GenesisOwners.decode(reader, reader.uint32())); @@ -187,13 +193,13 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { return { - index: isSet(object.index) ? Long.fromValue(object.index) : Long.UZERO, + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => GenesisOwners.fromJSON(e)) : [] }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); if (message.owners) { obj.owners = message.owners.map(e => e ? GenesisOwners.toJSON(e) : undefined); } else { @@ -203,23 +209,25 @@ export const GenesisState = { }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); - message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.UZERO; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); message.owners = object.owners?.map(e => GenesisOwners.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - index: Long.fromString(object.index), - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => GenesisOwners.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + message.owners = object.owners?.map(e => GenesisOwners.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.index = message.index ? message.index.toString() : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; if (message.owners) { obj.owners = message.owners.map(e => e ? GenesisOwners.toAmino(e) : undefined); } else { - obj.owners = []; + obj.owners = message.owners; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/client.ts b/packages/api/src/codegen/cosmos/client.ts index 79671b98..d7164686 100644 --- a/packages/api/src/codegen/cosmos/client.ts +++ b/packages/api/src/codegen/cosmos/client.ts @@ -71,7 +71,7 @@ export const getSigningCosmosClient = async ({ aminoTypes } = getSigningCosmosClientOptions(); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/packages/api/src/codegen/cosmos/crisis/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/crisis/v1beta1/genesis.ts index 7de87db3..dc0f9fde 100644 --- a/packages/api/src/codegen/cosmos/crisis/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/crisis/v1beta1/genesis.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** GenesisState defines the crisis module's genesis state. */ export interface GenesisState { @@ -31,18 +31,19 @@ export interface GenesisStateSDKType { } function createBaseGenesisState(): GenesisState { return { - constantFee: undefined + constantFee: Coin.fromPartial({}) }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crisis.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.constantFee !== undefined) { Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -74,9 +75,11 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - constantFee: object?.constant_fee ? Coin.fromAmino(object.constant_fee) : undefined - }; + const message = createBaseGenesisState(); + if (object.constant_fee !== undefined && object.constant_fee !== null) { + message.constantFee = Coin.fromAmino(object.constant_fee); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts index 2c5b0bf6..b0b9ea1f 100644 --- a/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgVerifyInvariant, MsgVerifyInvariantResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { @@ -15,6 +15,6 @@ export class MsgClientImpl implements Msg { verifyInvariant(request: MsgVerifyInvariant): Promise { const data = MsgVerifyInvariant.encode(request).finish(); const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "VerifyInvariant", data); - return promise.then(data => MsgVerifyInvariantResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgVerifyInvariantResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.ts index 6f30f99f..dc827e8d 100644 --- a/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/crisis/v1beta1/tx.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** MsgVerifyInvariant represents a message to verify a particular invariance. */ export interface MsgVerifyInvariant { @@ -12,9 +12,9 @@ export interface MsgVerifyInvariantProtoMsg { } /** MsgVerifyInvariant represents a message to verify a particular invariance. */ export interface MsgVerifyInvariantAmino { - sender: string; - invariant_module_name: string; - invariant_route: string; + sender?: string; + invariant_module_name?: string; + invariant_route?: string; } export interface MsgVerifyInvariantAminoMsg { type: "cosmos-sdk/MsgVerifyInvariant"; @@ -48,7 +48,8 @@ function createBaseMsgVerifyInvariant(): MsgVerifyInvariant { }; } export const MsgVerifyInvariant = { - encode(message: MsgVerifyInvariant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", + encode(message: MsgVerifyInvariant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -60,8 +61,8 @@ export const MsgVerifyInvariant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVerifyInvariant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVerifyInvariant(); while (reader.pos < end) { @@ -105,17 +106,23 @@ export const MsgVerifyInvariant = { return message; }, fromAmino(object: MsgVerifyInvariantAmino): MsgVerifyInvariant { - return { - sender: object.sender, - invariantModuleName: object.invariant_module_name, - invariantRoute: object.invariant_route - }; + const message = createBaseMsgVerifyInvariant(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.invariant_module_name !== undefined && object.invariant_module_name !== null) { + message.invariantModuleName = object.invariant_module_name; + } + if (object.invariant_route !== undefined && object.invariant_route !== null) { + message.invariantRoute = object.invariant_route; + } + return message; }, toAmino(message: MsgVerifyInvariant): MsgVerifyInvariantAmino { const obj: any = {}; - obj.sender = message.sender; - obj.invariant_module_name = message.invariantModuleName; - obj.invariant_route = message.invariantRoute; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.invariant_module_name = message.invariantModuleName === "" ? undefined : message.invariantModuleName; + obj.invariant_route = message.invariantRoute === "" ? undefined : message.invariantRoute; return obj; }, fromAminoMsg(object: MsgVerifyInvariantAminoMsg): MsgVerifyInvariant { @@ -144,11 +151,12 @@ function createBaseMsgVerifyInvariantResponse(): MsgVerifyInvariantResponse { return {}; } export const MsgVerifyInvariantResponse = { - encode(_: MsgVerifyInvariantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariantResponse", + encode(_: MsgVerifyInvariantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariantResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVerifyInvariantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVerifyInvariantResponse(); while (reader.pos < end) { @@ -173,7 +181,8 @@ export const MsgVerifyInvariantResponse = { return message; }, fromAmino(_: MsgVerifyInvariantResponseAmino): MsgVerifyInvariantResponse { - return {}; + const message = createBaseMsgVerifyInvariantResponse(); + return message; }, toAmino(_: MsgVerifyInvariantResponse): MsgVerifyInvariantResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/crypto/ed25519/keys.ts b/packages/api/src/codegen/cosmos/crypto/ed25519/keys.ts index e8a99209..2c41cb75 100644 --- a/packages/api/src/codegen/cosmos/crypto/ed25519/keys.ts +++ b/packages/api/src/codegen/cosmos/crypto/ed25519/keys.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. @@ -22,7 +22,7 @@ export interface PubKeyProtoMsg { * then you must create a new proto message and follow ADR-28 for Address construction. */ export interface PubKeyAmino { - key: Uint8Array; + key?: string; } export interface PubKeyAminoMsg { type: "cosmos-sdk/PubKey"; @@ -54,7 +54,7 @@ export interface PrivKeyProtoMsg { * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. */ export interface PrivKeyAmino { - key: Uint8Array; + key?: string; } export interface PrivKeyAminoMsg { type: "cosmos-sdk/PrivKey"; @@ -73,14 +73,15 @@ function createBasePubKey(): PubKey { }; } export const PubKey = { - encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.ed25519.PubKey", + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePubKey(); while (reader.pos < end) { @@ -112,13 +113,15 @@ export const PubKey = { return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -149,14 +152,15 @@ function createBasePrivKey(): PrivKey { }; } export const PrivKey = { - encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.ed25519.PrivKey", + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePrivKey(); while (reader.pos < end) { @@ -188,13 +192,15 @@ export const PrivKey = { return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - key: object.key - }; + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { diff --git a/packages/api/src/codegen/cosmos/crypto/hd/v1/hd.ts b/packages/api/src/codegen/cosmos/crypto/hd/v1/hd.ts index 798cf272..99d47110 100644 --- a/packages/api/src/codegen/cosmos/crypto/hd/v1/hd.ts +++ b/packages/api/src/codegen/cosmos/crypto/hd/v1/hd.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** BIP44Params is used as path field in ledger item in Record. */ export interface BIP44Params { @@ -23,18 +23,18 @@ export interface BIP44ParamsProtoMsg { /** BIP44Params is used as path field in ledger item in Record. */ export interface BIP44ParamsAmino { /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ - purpose: number; + purpose?: number; /** coin_type is a constant that improves privacy */ - coin_type: number; + coin_type?: number; /** account splits the key space into independent user identities */ - account: number; + account?: number; /** * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal * chain. */ - change: boolean; + change?: boolean; /** address_index is used as child index in BIP32 derivation */ - address_index: number; + address_index?: number; } export interface BIP44ParamsAminoMsg { type: "cosmos-sdk/BIP44Params"; @@ -58,7 +58,8 @@ function createBaseBIP44Params(): BIP44Params { }; } export const BIP44Params = { - encode(message: BIP44Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + encode(message: BIP44Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.purpose !== 0) { writer.uint32(8).uint32(message.purpose); } @@ -76,8 +77,8 @@ export const BIP44Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BIP44Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BIP44Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBIP44Params(); while (reader.pos < end) { @@ -133,21 +134,31 @@ export const BIP44Params = { return message; }, fromAmino(object: BIP44ParamsAmino): BIP44Params { - return { - purpose: object.purpose, - coinType: object.coin_type, - account: object.account, - change: object.change, - addressIndex: object.address_index - }; + const message = createBaseBIP44Params(); + if (object.purpose !== undefined && object.purpose !== null) { + message.purpose = object.purpose; + } + if (object.coin_type !== undefined && object.coin_type !== null) { + message.coinType = object.coin_type; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.change !== undefined && object.change !== null) { + message.change = object.change; + } + if (object.address_index !== undefined && object.address_index !== null) { + message.addressIndex = object.address_index; + } + return message; }, toAmino(message: BIP44Params): BIP44ParamsAmino { const obj: any = {}; - obj.purpose = message.purpose; - obj.coin_type = message.coinType; - obj.account = message.account; - obj.change = message.change; - obj.address_index = message.addressIndex; + obj.purpose = message.purpose === 0 ? undefined : message.purpose; + obj.coin_type = message.coinType === 0 ? undefined : message.coinType; + obj.account = message.account === 0 ? undefined : message.account; + obj.change = message.change === false ? undefined : message.change; + obj.address_index = message.addressIndex === 0 ? undefined : message.addressIndex; return obj; }, fromAminoMsg(object: BIP44ParamsAminoMsg): BIP44Params { diff --git a/packages/api/src/codegen/cosmos/crypto/keyring/v1/record.ts b/packages/api/src/codegen/cosmos/crypto/keyring/v1/record.ts index 9bc1adc7..911bcaf5 100644 --- a/packages/api/src/codegen/cosmos/crypto/keyring/v1/record.ts +++ b/packages/api/src/codegen/cosmos/crypto/keyring/v1/record.ts @@ -1,13 +1,13 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BIP44Params, BIP44ParamsAmino, BIP44ParamsSDKType } from "../../hd/v1/hd"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** Record is used for representing a key in the keyring. */ export interface Record { /** name represents a name of Record */ name: string; /** pub_key represents a public key in any format */ - pubKey: Any; + pubKey?: Any; /** local stores the private key locally. */ local?: Record_Local; /** ledger stores the information about a Ledger key. */ @@ -24,7 +24,7 @@ export interface RecordProtoMsg { /** Record is used for representing a key in the keyring. */ export interface RecordAmino { /** name represents a name of Record */ - name: string; + name?: string; /** pub_key represents a public key in any format */ pub_key?: AnyAmino; /** local stores the private key locally. */ @@ -43,7 +43,7 @@ export interface RecordAminoMsg { /** Record is used for representing a key in the keyring. */ export interface RecordSDKType { name: string; - pub_key: AnySDKType; + pub_key?: AnySDKType; local?: Record_LocalSDKType; ledger?: Record_LedgerSDKType; multi?: Record_MultiSDKType; @@ -54,7 +54,7 @@ export interface RecordSDKType { * Local item */ export interface Record_Local { - privKey: Any; + privKey?: Any; } export interface Record_LocalProtoMsg { typeUrl: "/cosmos.crypto.keyring.v1.Local"; @@ -76,11 +76,11 @@ export interface Record_LocalAminoMsg { * Local item */ export interface Record_LocalSDKType { - priv_key: AnySDKType; + priv_key?: AnySDKType; } /** Ledger item */ export interface Record_Ledger { - path: BIP44Params; + path?: BIP44Params; } export interface Record_LedgerProtoMsg { typeUrl: "/cosmos.crypto.keyring.v1.Ledger"; @@ -96,7 +96,7 @@ export interface Record_LedgerAminoMsg { } /** Ledger item */ export interface Record_LedgerSDKType { - path: BIP44ParamsSDKType; + path?: BIP44ParamsSDKType; } /** Multi item */ export interface Record_Multi {} @@ -137,7 +137,8 @@ function createBaseRecord(): Record { }; } export const Record = { - encode(message: Record, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + encode(message: Record, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -158,8 +159,8 @@ export const Record = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord(); while (reader.pos < end) { @@ -221,18 +222,30 @@ export const Record = { return message; }, fromAmino(object: RecordAmino): Record { - return { - name: object.name, - pubKey: object?.pub_key ? Any.fromAmino(object.pub_key) : undefined, - local: object?.local ? Record_Local.fromAmino(object.local) : undefined, - ledger: object?.ledger ? Record_Ledger.fromAmino(object.ledger) : undefined, - multi: object?.multi ? Record_Multi.fromAmino(object.multi) : undefined, - offline: object?.offline ? Record_Offline.fromAmino(object.offline) : undefined - }; + const message = createBaseRecord(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.local !== undefined && object.local !== null) { + message.local = Record_Local.fromAmino(object.local); + } + if (object.ledger !== undefined && object.ledger !== null) { + message.ledger = Record_Ledger.fromAmino(object.ledger); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = Record_Multi.fromAmino(object.multi); + } + if (object.offline !== undefined && object.offline !== null) { + message.offline = Record_Offline.fromAmino(object.offline); + } + return message; }, toAmino(message: Record): RecordAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; obj.local = message.local ? Record_Local.toAmino(message.local) : undefined; obj.ledger = message.ledger ? Record_Ledger.toAmino(message.ledger) : undefined; @@ -268,14 +281,15 @@ function createBaseRecord_Local(): Record_Local { }; } export const Record_Local = { - encode(message: Record_Local, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + encode(message: Record_Local, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.privKey !== undefined) { Any.encode(message.privKey, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Local { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Local { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Local(); while (reader.pos < end) { @@ -307,9 +321,11 @@ export const Record_Local = { return message; }, fromAmino(object: Record_LocalAmino): Record_Local { - return { - privKey: object?.priv_key ? Any.fromAmino(object.priv_key) : undefined - }; + const message = createBaseRecord_Local(); + if (object.priv_key !== undefined && object.priv_key !== null) { + message.privKey = Any.fromAmino(object.priv_key); + } + return message; }, toAmino(message: Record_Local): Record_LocalAmino { const obj: any = {}; @@ -340,18 +356,19 @@ export const Record_Local = { }; function createBaseRecord_Ledger(): Record_Ledger { return { - path: BIP44Params.fromPartial({}) + path: undefined }; } export const Record_Ledger = { - encode(message: Record_Ledger, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + encode(message: Record_Ledger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path !== undefined) { BIP44Params.encode(message.path, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Ledger { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Ledger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Ledger(); while (reader.pos < end) { @@ -383,9 +400,11 @@ export const Record_Ledger = { return message; }, fromAmino(object: Record_LedgerAmino): Record_Ledger { - return { - path: object?.path ? BIP44Params.fromAmino(object.path) : undefined - }; + const message = createBaseRecord_Ledger(); + if (object.path !== undefined && object.path !== null) { + message.path = BIP44Params.fromAmino(object.path); + } + return message; }, toAmino(message: Record_Ledger): Record_LedgerAmino { const obj: any = {}; @@ -418,11 +437,12 @@ function createBaseRecord_Multi(): Record_Multi { return {}; } export const Record_Multi = { - encode(_: Record_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + encode(_: Record_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Multi(); while (reader.pos < end) { @@ -447,7 +467,8 @@ export const Record_Multi = { return message; }, fromAmino(_: Record_MultiAmino): Record_Multi { - return {}; + const message = createBaseRecord_Multi(); + return message; }, toAmino(_: Record_Multi): Record_MultiAmino { const obj: any = {}; @@ -479,11 +500,12 @@ function createBaseRecord_Offline(): Record_Offline { return {}; } export const Record_Offline = { - encode(_: Record_Offline, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + encode(_: Record_Offline, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Offline { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Offline { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Offline(); while (reader.pos < end) { @@ -508,7 +530,8 @@ export const Record_Offline = { return message; }, fromAmino(_: Record_OfflineAmino): Record_Offline { - return {}; + const message = createBaseRecord_Offline(); + return message; }, toAmino(_: Record_Offline): Record_OfflineAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/crypto/multisig/keys.ts b/packages/api/src/codegen/cosmos/crypto/multisig/keys.ts index 631e75b0..f4e6f332 100644 --- a/packages/api/src/codegen/cosmos/crypto/multisig/keys.ts +++ b/packages/api/src/codegen/cosmos/crypto/multisig/keys.ts @@ -1,5 +1,5 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * LegacyAminoPubKey specifies a public key type @@ -20,8 +20,8 @@ export interface LegacyAminoPubKeyProtoMsg { * it uses legacy amino address rules. */ export interface LegacyAminoPubKeyAmino { - threshold: number; - public_keys: AnyAmino[]; + threshold?: number; + public_keys?: AnyAmino[]; } export interface LegacyAminoPubKeyAminoMsg { type: "cosmos-sdk/LegacyAminoPubKey"; @@ -43,7 +43,8 @@ function createBaseLegacyAminoPubKey(): LegacyAminoPubKey { }; } export const LegacyAminoPubKey = { - encode(message: LegacyAminoPubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.multisig.LegacyAminoPubKey", + encode(message: LegacyAminoPubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.threshold !== 0) { writer.uint32(8).uint32(message.threshold); } @@ -52,8 +53,8 @@ export const LegacyAminoPubKey = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LegacyAminoPubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LegacyAminoPubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLegacyAminoPubKey(); while (reader.pos < end) { @@ -95,18 +96,20 @@ export const LegacyAminoPubKey = { return message; }, fromAmino(object: LegacyAminoPubKeyAmino): LegacyAminoPubKey { - return { - threshold: object.threshold, - publicKeys: Array.isArray(object?.public_keys) ? object.public_keys.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseLegacyAminoPubKey(); + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + message.publicKeys = object.public_keys?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: LegacyAminoPubKey): LegacyAminoPubKeyAmino { const obj: any = {}; - obj.threshold = message.threshold; + obj.threshold = message.threshold === 0 ? undefined : message.threshold; if (message.publicKeys) { obj.public_keys = message.publicKeys.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.public_keys = []; + obj.public_keys = message.publicKeys; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/api/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts index 920a9908..4b9934aa 100644 --- a/packages/api/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/packages/api/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes, isSet } from "../../../../helpers"; /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. @@ -18,7 +18,7 @@ export interface MultiSignatureProtoMsg { * signed and with which modes. */ export interface MultiSignatureAmino { - signatures: Uint8Array[]; + signatures?: string[]; } export interface MultiSignatureAminoMsg { type: "cosmos-sdk/MultiSignature"; @@ -53,8 +53,8 @@ export interface CompactBitArrayProtoMsg { * This is not thread safe, and is not intended for concurrent usage. */ export interface CompactBitArrayAmino { - extra_bits_stored: number; - elems: Uint8Array; + extra_bits_stored?: number; + elems?: string; } export interface CompactBitArrayAminoMsg { type: "cosmos-sdk/CompactBitArray"; @@ -76,14 +76,15 @@ function createBaseMultiSignature(): MultiSignature { }; } export const MultiSignature = { - encode(message: MultiSignature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + encode(message: MultiSignature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signatures) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MultiSignature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMultiSignature(); while (reader.pos < end) { @@ -119,16 +120,16 @@ export const MultiSignature = { return message; }, fromAmino(object: MultiSignatureAmino): MultiSignature { - return { - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: MultiSignature): MultiSignatureAmino { const obj: any = {}; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { - obj.signatures = []; + obj.signatures = message.signatures; } return obj; }, @@ -161,7 +162,8 @@ function createBaseCompactBitArray(): CompactBitArray { }; } export const CompactBitArray = { - encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + encode(message: CompactBitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.extraBitsStored !== 0) { writer.uint32(8).uint32(message.extraBitsStored); } @@ -170,8 +172,8 @@ export const CompactBitArray = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CompactBitArray { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompactBitArray(); while (reader.pos < end) { @@ -209,15 +211,19 @@ export const CompactBitArray = { return message; }, fromAmino(object: CompactBitArrayAmino): CompactBitArray { - return { - extraBitsStored: object.extra_bits_stored, - elems: object.elems - }; + const message = createBaseCompactBitArray(); + if (object.extra_bits_stored !== undefined && object.extra_bits_stored !== null) { + message.extraBitsStored = object.extra_bits_stored; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; }, toAmino(message: CompactBitArray): CompactBitArrayAmino { const obj: any = {}; - obj.extra_bits_stored = message.extraBitsStored; - obj.elems = message.elems; + obj.extra_bits_stored = message.extraBitsStored === 0 ? undefined : message.extraBitsStored; + obj.elems = message.elems ? base64FromBytes(message.elems) : undefined; return obj; }, fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { diff --git a/packages/api/src/codegen/cosmos/crypto/secp256k1/keys.ts b/packages/api/src/codegen/cosmos/crypto/secp256k1/keys.ts index 3e213517..e69ea7cc 100644 --- a/packages/api/src/codegen/cosmos/crypto/secp256k1/keys.ts +++ b/packages/api/src/codegen/cosmos/crypto/secp256k1/keys.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * PubKey defines a secp256k1 public key @@ -22,7 +22,7 @@ export interface PubKeyProtoMsg { * This prefix is followed with the x-coordinate. */ export interface PubKeyAmino { - key: Uint8Array; + key?: string; } export interface PubKeyAminoMsg { type: "cosmos-sdk/PubKey"; @@ -48,7 +48,7 @@ export interface PrivKeyProtoMsg { } /** PrivKey defines a secp256k1 private key. */ export interface PrivKeyAmino { - key: Uint8Array; + key?: string; } export interface PrivKeyAminoMsg { type: "cosmos-sdk/PrivKey"; @@ -64,14 +64,15 @@ function createBasePubKey(): PubKey { }; } export const PubKey = { - encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePubKey(); while (reader.pos < end) { @@ -103,13 +104,15 @@ export const PubKey = { return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -140,14 +143,15 @@ function createBasePrivKey(): PrivKey { }; } export const PrivKey = { - encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePrivKey(); while (reader.pos < end) { @@ -179,13 +183,15 @@ export const PrivKey = { return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - key: object.key - }; + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { diff --git a/packages/api/src/codegen/cosmos/crypto/secp256r1/keys.ts b/packages/api/src/codegen/cosmos/crypto/secp256r1/keys.ts index dcd79e15..912ad72d 100644 --- a/packages/api/src/codegen/cosmos/crypto/secp256r1/keys.ts +++ b/packages/api/src/codegen/cosmos/crypto/secp256r1/keys.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** PubKey defines a secp256r1 ECDSA public key. */ export interface PubKey { @@ -18,7 +18,7 @@ export interface PubKeyAmino { * Point on secp256r1 curve in a compressed representation as specified in section * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 */ - key: Uint8Array; + key?: string; } export interface PubKeyAminoMsg { type: "cosmos-sdk/PubKey"; @@ -40,7 +40,7 @@ export interface PrivKeyProtoMsg { /** PrivKey defines a secp256r1 ECDSA private key. */ export interface PrivKeyAmino { /** secret number serialized using big-endian encoding */ - secret: Uint8Array; + secret?: string; } export interface PrivKeyAminoMsg { type: "cosmos-sdk/PrivKey"; @@ -56,14 +56,15 @@ function createBasePubKey(): PubKey { }; } export const PubKey = { - encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.secp256r1.PubKey", + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePubKey(); while (reader.pos < end) { @@ -95,13 +96,15 @@ export const PubKey = { return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -132,14 +135,15 @@ function createBasePrivKey(): PrivKey { }; } export const PrivKey = { - encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.secret.length !== 0) { writer.uint32(10).bytes(message.secret); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePrivKey(); while (reader.pos < end) { @@ -171,13 +175,15 @@ export const PrivKey = { return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - secret: object.secret - }; + const message = createBasePrivKey(); + if (object.secret !== undefined && object.secret !== null) { + message.secret = bytesFromBase64(object.secret); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.secret = message.secret; + obj.secret = message.secret ? base64FromBytes(message.secret) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { diff --git a/packages/api/src/codegen/cosmos/distribution/v1beta1/distribution.ts b/packages/api/src/codegen/cosmos/distribution/v1beta1/distribution.ts index 884de925..766f3464 100644 --- a/packages/api/src/codegen/cosmos/distribution/v1beta1/distribution.ts +++ b/packages/api/src/codegen/cosmos/distribution/v1beta1/distribution.ts @@ -1,6 +1,7 @@ import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../helpers"; /** Params defines the set of params for the distribution module. */ export interface Params { communityTax: string; @@ -14,10 +15,10 @@ export interface ParamsProtoMsg { } /** Params defines the set of params for the distribution module. */ export interface ParamsAmino { - community_tax: string; - base_proposer_reward: string; - bonus_proposer_reward: string; - withdraw_addr_enabled: boolean; + community_tax?: string; + base_proposer_reward?: string; + bonus_proposer_reward?: string; + withdraw_addr_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -67,8 +68,8 @@ export interface ValidatorHistoricalRewardsProtoMsg { * + one per validator for the zeroeth period, set on initialization */ export interface ValidatorHistoricalRewardsAmino { - cumulative_reward_ratio: DecCoinAmino[]; - reference_count: number; + cumulative_reward_ratio?: DecCoinAmino[]; + reference_count?: number; } export interface ValidatorHistoricalRewardsAminoMsg { type: "cosmos-sdk/ValidatorHistoricalRewards"; @@ -99,7 +100,7 @@ export interface ValidatorHistoricalRewardsSDKType { */ export interface ValidatorCurrentRewards { rewards: DecCoin[]; - period: Long; + period: bigint; } export interface ValidatorCurrentRewardsProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards"; @@ -111,8 +112,8 @@ export interface ValidatorCurrentRewardsProtoMsg { * each block as long as the validator's tokens remain constant. */ export interface ValidatorCurrentRewardsAmino { - rewards: DecCoinAmino[]; - period: string; + rewards?: DecCoinAmino[]; + period?: string; } export interface ValidatorCurrentRewardsAminoMsg { type: "cosmos-sdk/ValidatorCurrentRewards"; @@ -125,7 +126,7 @@ export interface ValidatorCurrentRewardsAminoMsg { */ export interface ValidatorCurrentRewardsSDKType { rewards: DecCoinSDKType[]; - period: Long; + period: bigint; } /** * ValidatorAccumulatedCommission represents accumulated commission @@ -143,7 +144,7 @@ export interface ValidatorAccumulatedCommissionProtoMsg { * for a validator kept as a running counter, can be withdrawn at any time. */ export interface ValidatorAccumulatedCommissionAmino { - commission: DecCoinAmino[]; + commission?: DecCoinAmino[]; } export interface ValidatorAccumulatedCommissionAminoMsg { type: "cosmos-sdk/ValidatorAccumulatedCommission"; @@ -172,7 +173,7 @@ export interface ValidatorOutstandingRewardsProtoMsg { * for a validator inexpensive to track, allows simple sanity checks. */ export interface ValidatorOutstandingRewardsAmino { - rewards: DecCoinAmino[]; + rewards?: DecCoinAmino[]; } export interface ValidatorOutstandingRewardsAminoMsg { type: "cosmos-sdk/ValidatorOutstandingRewards"; @@ -192,7 +193,7 @@ export interface ValidatorOutstandingRewardsSDKType { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEvent { - validatorPeriod: Long; + validatorPeriod: bigint; fraction: string; } export interface ValidatorSlashEventProtoMsg { @@ -206,8 +207,8 @@ export interface ValidatorSlashEventProtoMsg { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEventAmino { - validator_period: string; - fraction: string; + validator_period?: string; + fraction?: string; } export interface ValidatorSlashEventAminoMsg { type: "cosmos-sdk/ValidatorSlashEvent"; @@ -220,7 +221,7 @@ export interface ValidatorSlashEventAminoMsg { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEventSDKType { - validator_period: Long; + validator_period: bigint; fraction: string; } /** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ @@ -233,7 +234,7 @@ export interface ValidatorSlashEventsProtoMsg { } /** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ export interface ValidatorSlashEventsAmino { - validator_slash_events: ValidatorSlashEventAmino[]; + validator_slash_events?: ValidatorSlashEventAmino[]; } export interface ValidatorSlashEventsAminoMsg { type: "cosmos-sdk/ValidatorSlashEvents"; @@ -253,7 +254,7 @@ export interface FeePoolProtoMsg { } /** FeePool is the global fee pool for distribution. */ export interface FeePoolAmino { - community_pool: DecCoinAmino[]; + community_pool?: DecCoinAmino[]; } export interface FeePoolAminoMsg { type: "cosmos-sdk/FeePool"; @@ -269,7 +270,7 @@ export interface FeePoolSDKType { * recipient account. */ export interface CommunityPoolSpendProposal { - $typeUrl?: string; + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; title: string; description: string; recipient: string; @@ -285,10 +286,10 @@ export interface CommunityPoolSpendProposalProtoMsg { * recipient account. */ export interface CommunityPoolSpendProposalAmino { - title: string; - description: string; - recipient: string; - amount: CoinAmino[]; + title?: string; + description?: string; + recipient?: string; + amount?: CoinAmino[]; } export interface CommunityPoolSpendProposalAminoMsg { type: "cosmos-sdk/CommunityPoolSpendProposal"; @@ -300,7 +301,7 @@ export interface CommunityPoolSpendProposalAminoMsg { * recipient account. */ export interface CommunityPoolSpendProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; title: string; description: string; recipient: string; @@ -315,9 +316,9 @@ export interface CommunityPoolSpendProposalSDKType { * thus sdk.Dec is used. */ export interface DelegatorStartingInfo { - previousPeriod: Long; + previousPeriod: bigint; stake: string; - height: Long; + height: bigint; } export interface DelegatorStartingInfoProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo"; @@ -332,8 +333,8 @@ export interface DelegatorStartingInfoProtoMsg { * thus sdk.Dec is used. */ export interface DelegatorStartingInfoAmino { - previous_period: string; - stake: string; + previous_period?: string; + stake?: string; height: string; } export interface DelegatorStartingInfoAminoMsg { @@ -349,9 +350,9 @@ export interface DelegatorStartingInfoAminoMsg { * thus sdk.Dec is used. */ export interface DelegatorStartingInfoSDKType { - previous_period: Long; + previous_period: bigint; stake: string; - height: Long; + height: bigint; } /** * DelegationDelegatorReward represents the properties @@ -370,8 +371,8 @@ export interface DelegationDelegatorRewardProtoMsg { * of a delegator's delegation reward. */ export interface DelegationDelegatorRewardAmino { - validator_address: string; - reward: DecCoinAmino[]; + validator_address?: string; + reward?: DecCoinAmino[]; } export interface DelegationDelegatorRewardAminoMsg { type: "cosmos-sdk/DelegationDelegatorReward"; @@ -390,7 +391,7 @@ export interface DelegationDelegatorRewardSDKType { * with a deposit */ export interface CommunityPoolSpendProposalWithDeposit { - $typeUrl?: string; + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; title: string; description: string; recipient: string; @@ -406,11 +407,11 @@ export interface CommunityPoolSpendProposalWithDepositProtoMsg { * with a deposit */ export interface CommunityPoolSpendProposalWithDepositAmino { - title: string; - description: string; - recipient: string; - amount: string; - deposit: string; + title?: string; + description?: string; + recipient?: string; + amount?: string; + deposit?: string; } export interface CommunityPoolSpendProposalWithDepositAminoMsg { type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit"; @@ -421,7 +422,7 @@ export interface CommunityPoolSpendProposalWithDepositAminoMsg { * with a deposit */ export interface CommunityPoolSpendProposalWithDepositSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; title: string; description: string; recipient: string; @@ -437,36 +438,37 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.communityTax !== "") { - writer.uint32(10).string(message.communityTax); + writer.uint32(10).string(Decimal.fromUserInput(message.communityTax, 18).atomics); } if (message.baseProposerReward !== "") { - writer.uint32(18).string(message.baseProposerReward); + writer.uint32(18).string(Decimal.fromUserInput(message.baseProposerReward, 18).atomics); } if (message.bonusProposerReward !== "") { - writer.uint32(26).string(message.bonusProposerReward); + writer.uint32(26).string(Decimal.fromUserInput(message.bonusProposerReward, 18).atomics); } if (message.withdrawAddrEnabled === true) { writer.uint32(32).bool(message.withdrawAddrEnabled); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.communityTax = reader.string(); + message.communityTax = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 2: - message.baseProposerReward = reader.string(); + message.baseProposerReward = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 3: - message.bonusProposerReward = reader.string(); + message.bonusProposerReward = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 4: message.withdrawAddrEnabled = reader.bool(); @@ -503,19 +505,27 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - communityTax: object.community_tax, - baseProposerReward: object.base_proposer_reward, - bonusProposerReward: object.bonus_proposer_reward, - withdrawAddrEnabled: object.withdraw_addr_enabled - }; + const message = createBaseParams(); + if (object.community_tax !== undefined && object.community_tax !== null) { + message.communityTax = object.community_tax; + } + if (object.base_proposer_reward !== undefined && object.base_proposer_reward !== null) { + message.baseProposerReward = object.base_proposer_reward; + } + if (object.bonus_proposer_reward !== undefined && object.bonus_proposer_reward !== null) { + message.bonusProposerReward = object.bonus_proposer_reward; + } + if (object.withdraw_addr_enabled !== undefined && object.withdraw_addr_enabled !== null) { + message.withdrawAddrEnabled = object.withdraw_addr_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.community_tax = message.communityTax; - obj.base_proposer_reward = message.baseProposerReward; - obj.bonus_proposer_reward = message.bonusProposerReward; - obj.withdraw_addr_enabled = message.withdrawAddrEnabled; + obj.community_tax = message.communityTax === "" ? undefined : message.communityTax; + obj.base_proposer_reward = message.baseProposerReward === "" ? undefined : message.baseProposerReward; + obj.bonus_proposer_reward = message.bonusProposerReward === "" ? undefined : message.bonusProposerReward; + obj.withdraw_addr_enabled = message.withdrawAddrEnabled === false ? undefined : message.withdrawAddrEnabled; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -547,7 +557,8 @@ function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { }; } export const ValidatorHistoricalRewards = { - encode(message: ValidatorHistoricalRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + encode(message: ValidatorHistoricalRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.cumulativeRewardRatio) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -556,8 +567,8 @@ export const ValidatorHistoricalRewards = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorHistoricalRewards(); while (reader.pos < end) { @@ -599,19 +610,21 @@ export const ValidatorHistoricalRewards = { return message; }, fromAmino(object: ValidatorHistoricalRewardsAmino): ValidatorHistoricalRewards { - return { - cumulativeRewardRatio: Array.isArray(object?.cumulative_reward_ratio) ? object.cumulative_reward_ratio.map((e: any) => DecCoin.fromAmino(e)) : [], - referenceCount: object.reference_count - }; + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulative_reward_ratio?.map(e => DecCoin.fromAmino(e)) || []; + if (object.reference_count !== undefined && object.reference_count !== null) { + message.referenceCount = object.reference_count; + } + return message; }, toAmino(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAmino { const obj: any = {}; if (message.cumulativeRewardRatio) { obj.cumulative_reward_ratio = message.cumulativeRewardRatio.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.cumulative_reward_ratio = []; + obj.cumulative_reward_ratio = message.cumulativeRewardRatio; } - obj.reference_count = message.referenceCount; + obj.reference_count = message.referenceCount === 0 ? undefined : message.referenceCount; return obj; }, fromAminoMsg(object: ValidatorHistoricalRewardsAminoMsg): ValidatorHistoricalRewards { @@ -639,21 +652,22 @@ export const ValidatorHistoricalRewards = { function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { return { rewards: [], - period: Long.UZERO + period: BigInt(0) }; } export const ValidatorCurrentRewards = { - encode(message: ValidatorCurrentRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + encode(message: ValidatorCurrentRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (!message.period.isZero()) { + if (message.period !== BigInt(0)) { writer.uint32(16).uint64(message.period); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorCurrentRewards(); while (reader.pos < end) { @@ -663,7 +677,7 @@ export const ValidatorCurrentRewards = { message.rewards.push(DecCoin.decode(reader, reader.uint32())); break; case 2: - message.period = (reader.uint64() as Long); + message.period = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -675,7 +689,7 @@ export const ValidatorCurrentRewards = { fromJSON(object: any): ValidatorCurrentRewards { return { rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [], - period: isSet(object.period) ? Long.fromValue(object.period) : Long.UZERO + period: isSet(object.period) ? BigInt(object.period.toString()) : BigInt(0) }; }, toJSON(message: ValidatorCurrentRewards): unknown { @@ -685,29 +699,31 @@ export const ValidatorCurrentRewards = { } else { obj.rewards = []; } - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ValidatorCurrentRewards { const message = createBaseValidatorCurrentRewards(); message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; - message.period = object.period !== undefined && object.period !== null ? Long.fromValue(object.period) : Long.UZERO; + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [], - period: Long.fromString(object.period) - }; + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + return message; }, toAmino(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAmino { const obj: any = {}; if (message.rewards) { obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.rewards = []; + obj.rewards = message.rewards; } - obj.period = message.period ? message.period.toString() : undefined; + obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorCurrentRewardsAminoMsg): ValidatorCurrentRewards { @@ -738,14 +754,15 @@ function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommiss }; } export const ValidatorAccumulatedCommission = { - encode(message: ValidatorAccumulatedCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + encode(message: ValidatorAccumulatedCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.commission) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorAccumulatedCommission(); while (reader.pos < end) { @@ -781,16 +798,16 @@ export const ValidatorAccumulatedCommission = { return message; }, fromAmino(object: ValidatorAccumulatedCommissionAmino): ValidatorAccumulatedCommission { - return { - commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAmino { const obj: any = {}; if (message.commission) { obj.commission = message.commission.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.commission = []; + obj.commission = message.commission; } return obj; }, @@ -822,14 +839,15 @@ function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { }; } export const ValidatorOutstandingRewards = { - encode(message: ValidatorOutstandingRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + encode(message: ValidatorOutstandingRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorOutstandingRewards(); while (reader.pos < end) { @@ -865,16 +883,16 @@ export const ValidatorOutstandingRewards = { return message; }, fromAmino(object: ValidatorOutstandingRewardsAmino): ValidatorOutstandingRewards { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAmino { const obj: any = {}; if (message.rewards) { obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.rewards = []; + obj.rewards = message.rewards; } return obj; }, @@ -902,32 +920,33 @@ export const ValidatorOutstandingRewards = { }; function createBaseValidatorSlashEvent(): ValidatorSlashEvent { return { - validatorPeriod: Long.UZERO, + validatorPeriod: BigInt(0), fraction: "" }; } export const ValidatorSlashEvent = { - encode(message: ValidatorSlashEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.validatorPeriod.isZero()) { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + encode(message: ValidatorSlashEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorPeriod !== BigInt(0)) { writer.uint32(8).uint64(message.validatorPeriod); } if (message.fraction !== "") { - writer.uint32(18).string(message.fraction); + writer.uint32(18).string(Decimal.fromUserInput(message.fraction, 18).atomics); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSlashEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validatorPeriod = (reader.uint64() as Long); + message.validatorPeriod = reader.uint64(); break; case 2: - message.fraction = reader.string(); + message.fraction = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -938,32 +957,36 @@ export const ValidatorSlashEvent = { }, fromJSON(object: any): ValidatorSlashEvent { return { - validatorPeriod: isSet(object.validatorPeriod) ? Long.fromValue(object.validatorPeriod) : Long.UZERO, + validatorPeriod: isSet(object.validatorPeriod) ? BigInt(object.validatorPeriod.toString()) : BigInt(0), fraction: isSet(object.fraction) ? String(object.fraction) : "" }; }, toJSON(message: ValidatorSlashEvent): unknown { const obj: any = {}; - message.validatorPeriod !== undefined && (obj.validatorPeriod = (message.validatorPeriod || Long.UZERO).toString()); + message.validatorPeriod !== undefined && (obj.validatorPeriod = (message.validatorPeriod || BigInt(0)).toString()); message.fraction !== undefined && (obj.fraction = message.fraction); return obj; }, fromPartial(object: Partial): ValidatorSlashEvent { const message = createBaseValidatorSlashEvent(); - message.validatorPeriod = object.validatorPeriod !== undefined && object.validatorPeriod !== null ? Long.fromValue(object.validatorPeriod) : Long.UZERO; + message.validatorPeriod = object.validatorPeriod !== undefined && object.validatorPeriod !== null ? BigInt(object.validatorPeriod.toString()) : BigInt(0); message.fraction = object.fraction ?? ""; return message; }, fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { - return { - validatorPeriod: Long.fromString(object.validator_period), - fraction: object.fraction - }; + const message = createBaseValidatorSlashEvent(); + if (object.validator_period !== undefined && object.validator_period !== null) { + message.validatorPeriod = BigInt(object.validator_period); + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = object.fraction; + } + return message; }, toAmino(message: ValidatorSlashEvent): ValidatorSlashEventAmino { const obj: any = {}; - obj.validator_period = message.validatorPeriod ? message.validatorPeriod.toString() : undefined; - obj.fraction = message.fraction; + obj.validator_period = message.validatorPeriod !== BigInt(0) ? message.validatorPeriod.toString() : undefined; + obj.fraction = message.fraction === "" ? undefined : message.fraction; return obj; }, fromAminoMsg(object: ValidatorSlashEventAminoMsg): ValidatorSlashEvent { @@ -994,14 +1017,15 @@ function createBaseValidatorSlashEvents(): ValidatorSlashEvents { }; } export const ValidatorSlashEvents = { - encode(message: ValidatorSlashEvents, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + encode(message: ValidatorSlashEvents, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validatorSlashEvents) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvents { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvents { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSlashEvents(); while (reader.pos < end) { @@ -1037,16 +1061,16 @@ export const ValidatorSlashEvents = { return message; }, fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { - return { - validatorSlashEvents: Array.isArray(object?.validator_slash_events) ? object.validator_slash_events.map((e: any) => ValidatorSlashEvent.fromAmino(e)) : [] - }; + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { const obj: any = {}; if (message.validatorSlashEvents) { obj.validator_slash_events = message.validatorSlashEvents.map(e => e ? ValidatorSlashEvent.toAmino(e) : undefined); } else { - obj.validator_slash_events = []; + obj.validator_slash_events = message.validatorSlashEvents; } return obj; }, @@ -1078,14 +1102,15 @@ function createBaseFeePool(): FeePool { }; } export const FeePool = { - encode(message: FeePool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.FeePool", + encode(message: FeePool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.communityPool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FeePool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FeePool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFeePool(); while (reader.pos < end) { @@ -1121,16 +1146,16 @@ export const FeePool = { return message; }, fromAmino(object: FeePoolAmino): FeePool { - return { - communityPool: Array.isArray(object?.community_pool) ? object.community_pool.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseFeePool(); + message.communityPool = object.community_pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: FeePool): FeePoolAmino { const obj: any = {}; if (message.communityPool) { obj.community_pool = message.communityPool.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.community_pool = []; + obj.community_pool = message.communityPool; } return obj; }, @@ -1166,7 +1191,8 @@ function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { }; } export const CommunityPoolSpendProposal = { - encode(message: CommunityPoolSpendProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + encode(message: CommunityPoolSpendProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1181,8 +1207,8 @@ export const CommunityPoolSpendProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommunityPoolSpendProposal(); while (reader.pos < end) { @@ -1236,22 +1262,28 @@ export const CommunityPoolSpendProposal = { return message; }, fromAmino(object: CommunityPoolSpendProposalAmino): CommunityPoolSpendProposal { - return { - title: object.title, - description: object.description, - recipient: object.recipient, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - obj.recipient = message.recipient; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.recipient = message.recipient === "" ? undefined : message.recipient; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -1279,39 +1311,40 @@ export const CommunityPoolSpendProposal = { }; function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { return { - previousPeriod: Long.UZERO, + previousPeriod: BigInt(0), stake: "", - height: Long.UZERO + height: BigInt(0) }; } export const DelegatorStartingInfo = { - encode(message: DelegatorStartingInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.previousPeriod.isZero()) { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + encode(message: DelegatorStartingInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.previousPeriod !== BigInt(0)) { writer.uint32(8).uint64(message.previousPeriod); } if (message.stake !== "") { - writer.uint32(18).string(message.stake); + writer.uint32(18).string(Decimal.fromUserInput(message.stake, 18).atomics); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).uint64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegatorStartingInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.previousPeriod = (reader.uint64() as Long); + message.previousPeriod = reader.uint64(); break; case 2: - message.stake = reader.string(); + message.stake = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 3: - message.height = (reader.uint64() as Long); + message.height = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1322,37 +1355,43 @@ export const DelegatorStartingInfo = { }, fromJSON(object: any): DelegatorStartingInfo { return { - previousPeriod: isSet(object.previousPeriod) ? Long.fromValue(object.previousPeriod) : Long.UZERO, + previousPeriod: isSet(object.previousPeriod) ? BigInt(object.previousPeriod.toString()) : BigInt(0), stake: isSet(object.stake) ? String(object.stake) : "", - height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) }; }, toJSON(message: DelegatorStartingInfo): unknown { const obj: any = {}; - message.previousPeriod !== undefined && (obj.previousPeriod = (message.previousPeriod || Long.UZERO).toString()); + message.previousPeriod !== undefined && (obj.previousPeriod = (message.previousPeriod || BigInt(0)).toString()); message.stake !== undefined && (obj.stake = message.stake); - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): DelegatorStartingInfo { const message = createBaseDelegatorStartingInfo(); - message.previousPeriod = object.previousPeriod !== undefined && object.previousPeriod !== null ? Long.fromValue(object.previousPeriod) : Long.UZERO; + message.previousPeriod = object.previousPeriod !== undefined && object.previousPeriod !== null ? BigInt(object.previousPeriod.toString()) : BigInt(0); message.stake = object.stake ?? ""; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.UZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { - return { - previousPeriod: Long.fromString(object.previous_period), - stake: object.stake, - height: Long.fromString(object.height) - }; + const message = createBaseDelegatorStartingInfo(); + if (object.previous_period !== undefined && object.previous_period !== null) { + message.previousPeriod = BigInt(object.previous_period); + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = object.stake; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { const obj: any = {}; - obj.previous_period = message.previousPeriod ? message.previousPeriod.toString() : undefined; - obj.stake = message.stake; - obj.height = message.height ? message.height.toString() : undefined; + obj.previous_period = message.previousPeriod !== BigInt(0) ? message.previousPeriod.toString() : undefined; + obj.stake = message.stake === "" ? undefined : message.stake; + obj.height = message.height ? message.height.toString() : "0"; return obj; }, fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { @@ -1384,7 +1423,8 @@ function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { }; } export const DelegationDelegatorReward = { - encode(message: DelegationDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + encode(message: DelegationDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -1393,8 +1433,8 @@ export const DelegationDelegatorReward = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegationDelegatorReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegationDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegationDelegatorReward(); while (reader.pos < end) { @@ -1436,18 +1476,20 @@ export const DelegationDelegatorReward = { return message; }, fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { - return { - validatorAddress: object.validator_address, - reward: Array.isArray(object?.reward) ? object.reward.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseDelegationDelegatorReward(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.reward = object.reward?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: DelegationDelegatorReward): DelegationDelegatorRewardAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; if (message.reward) { obj.reward = message.reward.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.reward = []; + obj.reward = message.reward; } return obj; }, @@ -1484,7 +1526,8 @@ function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendPr }; } export const CommunityPoolSpendProposalWithDeposit = { - encode(message: CommunityPoolSpendProposalWithDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + encode(message: CommunityPoolSpendProposalWithDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1502,8 +1545,8 @@ export const CommunityPoolSpendProposalWithDeposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommunityPoolSpendProposalWithDeposit(); while (reader.pos < end) { @@ -1559,21 +1602,31 @@ export const CommunityPoolSpendProposalWithDeposit = { return message; }, fromAmino(object: CommunityPoolSpendProposalWithDepositAmino): CommunityPoolSpendProposalWithDeposit { - return { - title: object.title, - description: object.description, - recipient: object.recipient, - amount: object.amount, - deposit: object.deposit - }; + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = object.deposit; + } + return message; }, toAmino(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - obj.recipient = message.recipient; - obj.amount = message.amount; - obj.deposit = message.deposit; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.deposit = message.deposit === "" ? undefined : message.deposit; return obj; }, fromAminoMsg(object: CommunityPoolSpendProposalWithDepositAminoMsg): CommunityPoolSpendProposalWithDeposit { diff --git a/packages/api/src/codegen/cosmos/distribution/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/distribution/v1beta1/genesis.ts index 952bae7a..a1648c5a 100644 --- a/packages/api/src/codegen/cosmos/distribution/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/distribution/v1beta1/genesis.ts @@ -1,7 +1,7 @@ import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../base/v1beta1/coin"; import { ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorHistoricalRewards, ValidatorHistoricalRewardsAmino, ValidatorHistoricalRewardsSDKType, ValidatorCurrentRewards, ValidatorCurrentRewardsAmino, ValidatorCurrentRewardsSDKType, DelegatorStartingInfo, DelegatorStartingInfoAmino, DelegatorStartingInfoSDKType, ValidatorSlashEvent, ValidatorSlashEventAmino, ValidatorSlashEventSDKType, Params, ParamsAmino, ParamsSDKType, FeePool, FeePoolAmino, FeePoolSDKType } from "./distribution"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** * DelegatorWithdrawInfo is the address for where distributions rewards are * withdrawn to by default this struct is only used at genesis to feed in @@ -24,9 +24,9 @@ export interface DelegatorWithdrawInfoProtoMsg { */ export interface DelegatorWithdrawInfoAmino { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** withdraw_address is the address to withdraw the delegation rewards to. */ - withdraw_address: string; + withdraw_address?: string; } export interface DelegatorWithdrawInfoAminoMsg { type: "cosmos-sdk/DelegatorWithdrawInfo"; @@ -55,9 +55,9 @@ export interface ValidatorOutstandingRewardsRecordProtoMsg { /** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ export interface ValidatorOutstandingRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** outstanding_rewards represents the oustanding rewards of a validator. */ - outstanding_rewards: DecCoinAmino[]; + outstanding_rewards?: DecCoinAmino[]; } export interface ValidatorOutstandingRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorOutstandingRewardsRecord"; @@ -88,7 +88,7 @@ export interface ValidatorAccumulatedCommissionRecordProtoMsg { */ export interface ValidatorAccumulatedCommissionRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** accumulated is the accumulated commission of a validator. */ accumulated?: ValidatorAccumulatedCommissionAmino; } @@ -112,7 +112,7 @@ export interface ValidatorHistoricalRewardsRecord { /** validator_address is the address of the validator. */ validatorAddress: string; /** period defines the period the historical rewards apply to. */ - period: Long; + period: bigint; /** rewards defines the historical rewards of a validator. */ rewards: ValidatorHistoricalRewards; } @@ -126,9 +126,9 @@ export interface ValidatorHistoricalRewardsRecordProtoMsg { */ export interface ValidatorHistoricalRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** period defines the period the historical rewards apply to. */ - period: string; + period?: string; /** rewards defines the historical rewards of a validator. */ rewards?: ValidatorHistoricalRewardsAmino; } @@ -142,7 +142,7 @@ export interface ValidatorHistoricalRewardsRecordAminoMsg { */ export interface ValidatorHistoricalRewardsRecordSDKType { validator_address: string; - period: Long; + period: bigint; rewards: ValidatorHistoricalRewardsSDKType; } /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ @@ -159,7 +159,7 @@ export interface ValidatorCurrentRewardsRecordProtoMsg { /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ export interface ValidatorCurrentRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** rewards defines the current rewards of a validator. */ rewards?: ValidatorCurrentRewardsAmino; } @@ -188,9 +188,9 @@ export interface DelegatorStartingInfoRecordProtoMsg { /** DelegatorStartingInfoRecord used for import / export via genesis json. */ export interface DelegatorStartingInfoRecordAmino { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** starting_info defines the starting info of a delegator. */ starting_info?: DelegatorStartingInfoAmino; } @@ -209,9 +209,9 @@ export interface ValidatorSlashEventRecord { /** validator_address is the address of the validator. */ validatorAddress: string; /** height defines the block height at which the slash event occured. */ - height: Long; + height: bigint; /** period is the period of the slash event. */ - period: Long; + period: bigint; /** validator_slash_event describes the slash event. */ validatorSlashEvent: ValidatorSlashEvent; } @@ -222,11 +222,11 @@ export interface ValidatorSlashEventRecordProtoMsg { /** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** height defines the block height at which the slash event occured. */ - height: string; + height?: string; /** period is the period of the slash event. */ - period: string; + period?: string; /** validator_slash_event describes the slash event. */ validator_slash_event?: ValidatorSlashEventAmino; } @@ -237,8 +237,8 @@ export interface ValidatorSlashEventRecordAminoMsg { /** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecordSDKType { validator_address: string; - height: Long; - period: Long; + height: bigint; + period: bigint; validator_slash_event: ValidatorSlashEventSDKType; } /** GenesisState defines the distribution module's genesis state. */ @@ -275,21 +275,21 @@ export interface GenesisStateAmino { /** fee_pool defines the fee pool at genesis. */ fee_pool?: FeePoolAmino; /** fee_pool defines the delegator withdraw infos at genesis. */ - delegator_withdraw_infos: DelegatorWithdrawInfoAmino[]; + delegator_withdraw_infos?: DelegatorWithdrawInfoAmino[]; /** fee_pool defines the previous proposer at genesis. */ - previous_proposer: string; + previous_proposer?: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ - outstanding_rewards: ValidatorOutstandingRewardsRecordAmino[]; + outstanding_rewards?: ValidatorOutstandingRewardsRecordAmino[]; /** fee_pool defines the accumulated commisions of all validators at genesis. */ - validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordAmino[]; + validator_accumulated_commissions?: ValidatorAccumulatedCommissionRecordAmino[]; /** fee_pool defines the historical rewards of all validators at genesis. */ - validator_historical_rewards: ValidatorHistoricalRewardsRecordAmino[]; + validator_historical_rewards?: ValidatorHistoricalRewardsRecordAmino[]; /** fee_pool defines the current rewards of all validators at genesis. */ - validator_current_rewards: ValidatorCurrentRewardsRecordAmino[]; + validator_current_rewards?: ValidatorCurrentRewardsRecordAmino[]; /** fee_pool defines the delegator starting infos at genesis. */ - delegator_starting_infos: DelegatorStartingInfoRecordAmino[]; + delegator_starting_infos?: DelegatorStartingInfoRecordAmino[]; /** fee_pool defines the validator slash events at genesis. */ - validator_slash_events: ValidatorSlashEventRecordAmino[]; + validator_slash_events?: ValidatorSlashEventRecordAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -315,7 +315,8 @@ function createBaseDelegatorWithdrawInfo(): DelegatorWithdrawInfo { }; } export const DelegatorWithdrawInfo = { - encode(message: DelegatorWithdrawInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorWithdrawInfo", + encode(message: DelegatorWithdrawInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -324,8 +325,8 @@ export const DelegatorWithdrawInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorWithdrawInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorWithdrawInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegatorWithdrawInfo(); while (reader.pos < end) { @@ -363,15 +364,19 @@ export const DelegatorWithdrawInfo = { return message; }, fromAmino(object: DelegatorWithdrawInfoAmino): DelegatorWithdrawInfo { - return { - delegatorAddress: object.delegator_address, - withdrawAddress: object.withdraw_address - }; + const message = createBaseDelegatorWithdrawInfo(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.withdraw_address = message.withdrawAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; return obj; }, fromAminoMsg(object: DelegatorWithdrawInfoAminoMsg): DelegatorWithdrawInfo { @@ -403,7 +408,8 @@ function createBaseValidatorOutstandingRewardsRecord(): ValidatorOutstandingRewa }; } export const ValidatorOutstandingRewardsRecord = { - encode(message: ValidatorOutstandingRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", + encode(message: ValidatorOutstandingRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -412,8 +418,8 @@ export const ValidatorOutstandingRewardsRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorOutstandingRewardsRecord(); while (reader.pos < end) { @@ -455,18 +461,20 @@ export const ValidatorOutstandingRewardsRecord = { return message; }, fromAmino(object: ValidatorOutstandingRewardsRecordAmino): ValidatorOutstandingRewardsRecord { - return { - validatorAddress: object.validator_address, - outstandingRewards: Array.isArray(object?.outstanding_rewards) ? object.outstanding_rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorOutstandingRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorOutstandingRewardsRecord): ValidatorOutstandingRewardsRecordAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; if (message.outstandingRewards) { obj.outstanding_rewards = message.outstandingRewards.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.outstanding_rewards = []; + obj.outstanding_rewards = message.outstandingRewards; } return obj; }, @@ -499,7 +507,8 @@ function createBaseValidatorAccumulatedCommissionRecord(): ValidatorAccumulatedC }; } export const ValidatorAccumulatedCommissionRecord = { - encode(message: ValidatorAccumulatedCommissionRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", + encode(message: ValidatorAccumulatedCommissionRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -508,8 +517,8 @@ export const ValidatorAccumulatedCommissionRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorAccumulatedCommissionRecord(); while (reader.pos < end) { @@ -547,14 +556,18 @@ export const ValidatorAccumulatedCommissionRecord = { return message; }, fromAmino(object: ValidatorAccumulatedCommissionRecordAmino): ValidatorAccumulatedCommissionRecord { - return { - validatorAddress: object.validator_address, - accumulated: object?.accumulated ? ValidatorAccumulatedCommission.fromAmino(object.accumulated) : undefined - }; + const message = createBaseValidatorAccumulatedCommissionRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.accumulated !== undefined && object.accumulated !== null) { + message.accumulated = ValidatorAccumulatedCommission.fromAmino(object.accumulated); + } + return message; }, toAmino(message: ValidatorAccumulatedCommissionRecord): ValidatorAccumulatedCommissionRecordAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : undefined; return obj; }, @@ -583,16 +596,17 @@ export const ValidatorAccumulatedCommissionRecord = { function createBaseValidatorHistoricalRewardsRecord(): ValidatorHistoricalRewardsRecord { return { validatorAddress: "", - period: Long.UZERO, + period: BigInt(0), rewards: ValidatorHistoricalRewards.fromPartial({}) }; } export const ValidatorHistoricalRewardsRecord = { - encode(message: ValidatorHistoricalRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord", + encode(message: ValidatorHistoricalRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } - if (!message.period.isZero()) { + if (message.period !== BigInt(0)) { writer.uint32(16).uint64(message.period); } if (message.rewards !== undefined) { @@ -600,8 +614,8 @@ export const ValidatorHistoricalRewardsRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorHistoricalRewardsRecord(); while (reader.pos < end) { @@ -611,7 +625,7 @@ export const ValidatorHistoricalRewardsRecord = { message.validatorAddress = reader.string(); break; case 2: - message.period = (reader.uint64() as Long); + message.period = reader.uint64(); break; case 3: message.rewards = ValidatorHistoricalRewards.decode(reader, reader.uint32()); @@ -626,35 +640,41 @@ export const ValidatorHistoricalRewardsRecord = { fromJSON(object: any): ValidatorHistoricalRewardsRecord { return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - period: isSet(object.period) ? Long.fromValue(object.period) : Long.UZERO, + period: isSet(object.period) ? BigInt(object.period.toString()) : BigInt(0), rewards: isSet(object.rewards) ? ValidatorHistoricalRewards.fromJSON(object.rewards) : undefined }; }, toJSON(message: ValidatorHistoricalRewardsRecord): unknown { const obj: any = {}; message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); message.rewards !== undefined && (obj.rewards = message.rewards ? ValidatorHistoricalRewards.toJSON(message.rewards) : undefined); return obj; }, fromPartial(object: Partial): ValidatorHistoricalRewardsRecord { const message = createBaseValidatorHistoricalRewardsRecord(); message.validatorAddress = object.validatorAddress ?? ""; - message.period = object.period !== undefined && object.period !== null ? Long.fromValue(object.period) : Long.UZERO; + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); message.rewards = object.rewards !== undefined && object.rewards !== null ? ValidatorHistoricalRewards.fromPartial(object.rewards) : undefined; return message; }, fromAmino(object: ValidatorHistoricalRewardsRecordAmino): ValidatorHistoricalRewardsRecord { - return { - validatorAddress: object.validator_address, - period: Long.fromString(object.period), - rewards: object?.rewards ? ValidatorHistoricalRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseValidatorHistoricalRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorHistoricalRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: ValidatorHistoricalRewardsRecord): ValidatorHistoricalRewardsRecordAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; - obj.period = message.period ? message.period.toString() : undefined; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : undefined; return obj; }, @@ -687,7 +707,8 @@ function createBaseValidatorCurrentRewardsRecord(): ValidatorCurrentRewardsRecor }; } export const ValidatorCurrentRewardsRecord = { - encode(message: ValidatorCurrentRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord", + encode(message: ValidatorCurrentRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -696,8 +717,8 @@ export const ValidatorCurrentRewardsRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorCurrentRewardsRecord(); while (reader.pos < end) { @@ -735,14 +756,18 @@ export const ValidatorCurrentRewardsRecord = { return message; }, fromAmino(object: ValidatorCurrentRewardsRecordAmino): ValidatorCurrentRewardsRecord { - return { - validatorAddress: object.validator_address, - rewards: object?.rewards ? ValidatorCurrentRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseValidatorCurrentRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorCurrentRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: ValidatorCurrentRewardsRecord): ValidatorCurrentRewardsRecordAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : undefined; return obj; }, @@ -776,7 +801,8 @@ function createBaseDelegatorStartingInfoRecord(): DelegatorStartingInfoRecord { }; } export const DelegatorStartingInfoRecord = { - encode(message: DelegatorStartingInfoRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfoRecord", + encode(message: DelegatorStartingInfoRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -788,8 +814,8 @@ export const DelegatorStartingInfoRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfoRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfoRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegatorStartingInfoRecord(); while (reader.pos < end) { @@ -833,16 +859,22 @@ export const DelegatorStartingInfoRecord = { return message; }, fromAmino(object: DelegatorStartingInfoRecordAmino): DelegatorStartingInfoRecord { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - startingInfo: object?.starting_info ? DelegatorStartingInfo.fromAmino(object.starting_info) : undefined - }; + const message = createBaseDelegatorStartingInfoRecord(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_info !== undefined && object.starting_info !== null) { + message.startingInfo = DelegatorStartingInfo.fromAmino(object.starting_info); + } + return message; }, toAmino(message: DelegatorStartingInfoRecord): DelegatorStartingInfoRecordAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : undefined; return obj; }, @@ -871,20 +903,21 @@ export const DelegatorStartingInfoRecord = { function createBaseValidatorSlashEventRecord(): ValidatorSlashEventRecord { return { validatorAddress: "", - height: Long.UZERO, - period: Long.UZERO, + height: BigInt(0), + period: BigInt(0), validatorSlashEvent: ValidatorSlashEvent.fromPartial({}) }; } export const ValidatorSlashEventRecord = { - encode(message: ValidatorSlashEventRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEventRecord", + encode(message: ValidatorSlashEventRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(16).uint64(message.height); } - if (!message.period.isZero()) { + if (message.period !== BigInt(0)) { writer.uint32(24).uint64(message.period); } if (message.validatorSlashEvent !== undefined) { @@ -892,8 +925,8 @@ export const ValidatorSlashEventRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEventRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEventRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSlashEventRecord(); while (reader.pos < end) { @@ -903,10 +936,10 @@ export const ValidatorSlashEventRecord = { message.validatorAddress = reader.string(); break; case 2: - message.height = (reader.uint64() as Long); + message.height = reader.uint64(); break; case 3: - message.period = (reader.uint64() as Long); + message.period = reader.uint64(); break; case 4: message.validatorSlashEvent = ValidatorSlashEvent.decode(reader, reader.uint32()); @@ -921,40 +954,48 @@ export const ValidatorSlashEventRecord = { fromJSON(object: any): ValidatorSlashEventRecord { return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO, - period: isSet(object.period) ? Long.fromValue(object.period) : Long.UZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + period: isSet(object.period) ? BigInt(object.period.toString()) : BigInt(0), validatorSlashEvent: isSet(object.validatorSlashEvent) ? ValidatorSlashEvent.fromJSON(object.validatorSlashEvent) : undefined }; }, toJSON(message: ValidatorSlashEventRecord): unknown { const obj: any = {}; message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); message.validatorSlashEvent !== undefined && (obj.validatorSlashEvent = message.validatorSlashEvent ? ValidatorSlashEvent.toJSON(message.validatorSlashEvent) : undefined); return obj; }, fromPartial(object: Partial): ValidatorSlashEventRecord { const message = createBaseValidatorSlashEventRecord(); message.validatorAddress = object.validatorAddress ?? ""; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.UZERO; - message.period = object.period !== undefined && object.period !== null ? Long.fromValue(object.period) : Long.UZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.period = object.period !== undefined && object.period !== null ? BigInt(object.period.toString()) : BigInt(0); message.validatorSlashEvent = object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null ? ValidatorSlashEvent.fromPartial(object.validatorSlashEvent) : undefined; return message; }, fromAmino(object: ValidatorSlashEventRecordAmino): ValidatorSlashEventRecord { - return { - validatorAddress: object.validator_address, - height: Long.fromString(object.height), - period: Long.fromString(object.period), - validatorSlashEvent: object?.validator_slash_event ? ValidatorSlashEvent.fromAmino(object.validator_slash_event) : undefined - }; + const message = createBaseValidatorSlashEventRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.validator_slash_event !== undefined && object.validator_slash_event !== null) { + message.validatorSlashEvent = ValidatorSlashEvent.fromAmino(object.validator_slash_event); + } + return message; }, toAmino(message: ValidatorSlashEventRecord): ValidatorSlashEventRecordAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; - obj.height = message.height ? message.height.toString() : undefined; - obj.period = message.period ? message.period.toString() : undefined; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : undefined; return obj; }, @@ -995,7 +1036,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -1028,8 +1070,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -1143,18 +1185,24 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - feePool: object?.fee_pool ? FeePool.fromAmino(object.fee_pool) : undefined, - delegatorWithdrawInfos: Array.isArray(object?.delegator_withdraw_infos) ? object.delegator_withdraw_infos.map((e: any) => DelegatorWithdrawInfo.fromAmino(e)) : [], - previousProposer: object.previous_proposer, - outstandingRewards: Array.isArray(object?.outstanding_rewards) ? object.outstanding_rewards.map((e: any) => ValidatorOutstandingRewardsRecord.fromAmino(e)) : [], - validatorAccumulatedCommissions: Array.isArray(object?.validator_accumulated_commissions) ? object.validator_accumulated_commissions.map((e: any) => ValidatorAccumulatedCommissionRecord.fromAmino(e)) : [], - validatorHistoricalRewards: Array.isArray(object?.validator_historical_rewards) ? object.validator_historical_rewards.map((e: any) => ValidatorHistoricalRewardsRecord.fromAmino(e)) : [], - validatorCurrentRewards: Array.isArray(object?.validator_current_rewards) ? object.validator_current_rewards.map((e: any) => ValidatorCurrentRewardsRecord.fromAmino(e)) : [], - delegatorStartingInfos: Array.isArray(object?.delegator_starting_infos) ? object.delegator_starting_infos.map((e: any) => DelegatorStartingInfoRecord.fromAmino(e)) : [], - validatorSlashEvents: Array.isArray(object?.validator_slash_events) ? object.validator_slash_events.map((e: any) => ValidatorSlashEventRecord.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.fee_pool !== undefined && object.fee_pool !== null) { + message.feePool = FeePool.fromAmino(object.fee_pool); + } + message.delegatorWithdrawInfos = object.delegator_withdraw_infos?.map(e => DelegatorWithdrawInfo.fromAmino(e)) || []; + if (object.previous_proposer !== undefined && object.previous_proposer !== null) { + message.previousProposer = object.previous_proposer; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => ValidatorOutstandingRewardsRecord.fromAmino(e)) || []; + message.validatorAccumulatedCommissions = object.validator_accumulated_commissions?.map(e => ValidatorAccumulatedCommissionRecord.fromAmino(e)) || []; + message.validatorHistoricalRewards = object.validator_historical_rewards?.map(e => ValidatorHistoricalRewardsRecord.fromAmino(e)) || []; + message.validatorCurrentRewards = object.validator_current_rewards?.map(e => ValidatorCurrentRewardsRecord.fromAmino(e)) || []; + message.delegatorStartingInfos = object.delegator_starting_infos?.map(e => DelegatorStartingInfoRecord.fromAmino(e)) || []; + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEventRecord.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -1163,38 +1211,38 @@ export const GenesisState = { if (message.delegatorWithdrawInfos) { obj.delegator_withdraw_infos = message.delegatorWithdrawInfos.map(e => e ? DelegatorWithdrawInfo.toAmino(e) : undefined); } else { - obj.delegator_withdraw_infos = []; + obj.delegator_withdraw_infos = message.delegatorWithdrawInfos; } - obj.previous_proposer = message.previousProposer; + obj.previous_proposer = message.previousProposer === "" ? undefined : message.previousProposer; if (message.outstandingRewards) { obj.outstanding_rewards = message.outstandingRewards.map(e => e ? ValidatorOutstandingRewardsRecord.toAmino(e) : undefined); } else { - obj.outstanding_rewards = []; + obj.outstanding_rewards = message.outstandingRewards; } if (message.validatorAccumulatedCommissions) { obj.validator_accumulated_commissions = message.validatorAccumulatedCommissions.map(e => e ? ValidatorAccumulatedCommissionRecord.toAmino(e) : undefined); } else { - obj.validator_accumulated_commissions = []; + obj.validator_accumulated_commissions = message.validatorAccumulatedCommissions; } if (message.validatorHistoricalRewards) { obj.validator_historical_rewards = message.validatorHistoricalRewards.map(e => e ? ValidatorHistoricalRewardsRecord.toAmino(e) : undefined); } else { - obj.validator_historical_rewards = []; + obj.validator_historical_rewards = message.validatorHistoricalRewards; } if (message.validatorCurrentRewards) { obj.validator_current_rewards = message.validatorCurrentRewards.map(e => e ? ValidatorCurrentRewardsRecord.toAmino(e) : undefined); } else { - obj.validator_current_rewards = []; + obj.validator_current_rewards = message.validatorCurrentRewards; } if (message.delegatorStartingInfos) { obj.delegator_starting_infos = message.delegatorStartingInfos.map(e => e ? DelegatorStartingInfoRecord.toAmino(e) : undefined); } else { - obj.delegator_starting_infos = []; + obj.delegator_starting_infos = message.delegatorStartingInfos; } if (message.validatorSlashEvents) { obj.validator_slash_events = message.validatorSlashEvents.map(e => e ? ValidatorSlashEventRecord.toAmino(e) : undefined); } else { - obj.validator_slash_events = []; + obj.validator_slash_events = message.validatorSlashEvents; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts index 6bd99de4..1d0dbb18 100644 --- a/packages/api/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryParamsRequest, QueryParamsResponseSDKType, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponseSDKType, QueryValidatorCommissionRequest, QueryValidatorCommissionResponseSDKType, QueryValidatorSlashesRequest, QueryValidatorSlashesResponseSDKType, QueryDelegationRewardsRequest, QueryDelegationRewardsResponseSDKType, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponseSDKType, QueryCommunityPoolRequest, QueryCommunityPoolResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts index 2fab3cec..6ecc809c 100644 --- a/packages/api/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryParamsRequest, QueryParamsResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; /** Query defines the gRPC querier service for distribution module. */ @@ -43,47 +43,47 @@ export class QueryClientImpl implements Query { params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorOutstandingRewards", data); - return promise.then(data => QueryValidatorOutstandingRewardsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryValidatorOutstandingRewardsResponse.decode(new BinaryReader(data))); } validatorCommission(request: QueryValidatorCommissionRequest): Promise { const data = QueryValidatorCommissionRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorCommission", data); - return promise.then(data => QueryValidatorCommissionResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryValidatorCommissionResponse.decode(new BinaryReader(data))); } validatorSlashes(request: QueryValidatorSlashesRequest): Promise { const data = QueryValidatorSlashesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorSlashes", data); - return promise.then(data => QueryValidatorSlashesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryValidatorSlashesResponse.decode(new BinaryReader(data))); } delegationRewards(request: QueryDelegationRewardsRequest): Promise { const data = QueryDelegationRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationRewards", data); - return promise.then(data => QueryDelegationRewardsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegationRewardsResponse.decode(new BinaryReader(data))); } delegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise { const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationTotalRewards", data); - return promise.then(data => QueryDelegationTotalRewardsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegationTotalRewardsResponse.decode(new BinaryReader(data))); } delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { const data = QueryDelegatorValidatorsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorValidators", data); - return promise.then(data => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegatorValidatorsResponse.decode(new BinaryReader(data))); } delegatorWithdrawAddress(request: QueryDelegatorWithdrawAddressRequest): Promise { const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorWithdrawAddress", data); - return promise.then(data => QueryDelegatorWithdrawAddressResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegatorWithdrawAddressResponse.decode(new BinaryReader(data))); } communityPool(request: QueryCommunityPoolRequest = {}): Promise { const data = QueryCommunityPoolRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "CommunityPool", data); - return promise.then(data => QueryCommunityPoolResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryCommunityPoolResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/distribution/v1beta1/query.ts b/packages/api/src/codegen/cosmos/distribution/v1beta1/query.ts index 719984db..a96aa879 100644 --- a/packages/api/src/codegen/cosmos/distribution/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/distribution/v1beta1/query.ts @@ -1,8 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType, ValidatorOutstandingRewards, ValidatorOutstandingRewardsAmino, ValidatorOutstandingRewardsSDKType, ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorSlashEvent, ValidatorSlashEventAmino, ValidatorSlashEventSDKType, DelegationDelegatorReward, DelegationDelegatorRewardAmino, DelegationDelegatorRewardSDKType } from "./distribution"; import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../base/v1beta1/coin"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -57,7 +57,7 @@ export interface QueryValidatorOutstandingRewardsRequestProtoMsg { */ export interface QueryValidatorOutstandingRewardsRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryValidatorOutstandingRewardsRequestAminoMsg { type: "cosmos-sdk/QueryValidatorOutstandingRewardsRequest"; @@ -117,7 +117,7 @@ export interface QueryValidatorCommissionRequestProtoMsg { */ export interface QueryValidatorCommissionRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryValidatorCommissionRequestAminoMsg { type: "cosmos-sdk/QueryValidatorCommissionRequest"; @@ -169,11 +169,11 @@ export interface QueryValidatorSlashesRequest { /** validator_address defines the validator address to query for. */ validatorAddress: string; /** starting_height defines the optional starting height to query the slashes. */ - startingHeight: Long; + startingHeight: bigint; /** starting_height defines the optional ending height to query the slashes. */ - endingHeight: Long; + endingHeight: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorSlashesRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest"; @@ -185,11 +185,11 @@ export interface QueryValidatorSlashesRequestProtoMsg { */ export interface QueryValidatorSlashesRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; /** starting_height defines the optional starting height to query the slashes. */ - starting_height: string; + starting_height?: string; /** starting_height defines the optional ending height to query the slashes. */ - ending_height: string; + ending_height?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -203,9 +203,9 @@ export interface QueryValidatorSlashesRequestAminoMsg { */ export interface QueryValidatorSlashesRequestSDKType { validator_address: string; - starting_height: Long; - ending_height: Long; - pagination: PageRequestSDKType; + starting_height: bigint; + ending_height: bigint; + pagination?: PageRequestSDKType; } /** * QueryValidatorSlashesResponse is the response type for the @@ -215,7 +215,7 @@ export interface QueryValidatorSlashesResponse { /** slashes defines the slashes the validator received. */ slashes: ValidatorSlashEvent[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorSlashesResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse"; @@ -227,7 +227,7 @@ export interface QueryValidatorSlashesResponseProtoMsg { */ export interface QueryValidatorSlashesResponseAmino { /** slashes defines the slashes the validator received. */ - slashes: ValidatorSlashEventAmino[]; + slashes?: ValidatorSlashEventAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -241,7 +241,7 @@ export interface QueryValidatorSlashesResponseAminoMsg { */ export interface QueryValidatorSlashesResponseSDKType { slashes: ValidatorSlashEventSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegationRewardsRequest is the request type for the @@ -263,9 +263,9 @@ export interface QueryDelegationRewardsRequestProtoMsg { */ export interface QueryDelegationRewardsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryDelegationRewardsRequestAminoMsg { type: "cosmos-sdk/QueryDelegationRewardsRequest"; @@ -297,7 +297,7 @@ export interface QueryDelegationRewardsResponseProtoMsg { */ export interface QueryDelegationRewardsResponseAmino { /** rewards defines the rewards accrued by a delegation. */ - rewards: DecCoinAmino[]; + rewards?: DecCoinAmino[]; } export interface QueryDelegationRewardsResponseAminoMsg { type: "cosmos-sdk/QueryDelegationRewardsResponse"; @@ -328,7 +328,7 @@ export interface QueryDelegationTotalRewardsRequestProtoMsg { */ export interface QueryDelegationTotalRewardsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegationTotalRewardsRequestAminoMsg { type: "cosmos-sdk/QueryDelegationTotalRewardsRequest"; @@ -361,9 +361,9 @@ export interface QueryDelegationTotalRewardsResponseProtoMsg { */ export interface QueryDelegationTotalRewardsResponseAmino { /** rewards defines all the rewards accrued by a delegator. */ - rewards: DelegationDelegatorRewardAmino[]; + rewards?: DelegationDelegatorRewardAmino[]; /** total defines the sum of all the rewards. */ - total: DecCoinAmino[]; + total?: DecCoinAmino[]; } export interface QueryDelegationTotalRewardsResponseAminoMsg { type: "cosmos-sdk/QueryDelegationTotalRewardsResponse"; @@ -395,7 +395,7 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { */ export interface QueryDelegatorValidatorsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegatorValidatorsRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorsRequest"; @@ -426,7 +426,7 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { */ export interface QueryDelegatorValidatorsResponseAmino { /** validators defines the validators a delegator is delegating for. */ - validators: string[]; + validators?: string[]; } export interface QueryDelegatorValidatorsResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorsResponse"; @@ -457,7 +457,7 @@ export interface QueryDelegatorWithdrawAddressRequestProtoMsg { */ export interface QueryDelegatorWithdrawAddressRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegatorWithdrawAddressRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorWithdrawAddressRequest"; @@ -488,7 +488,7 @@ export interface QueryDelegatorWithdrawAddressResponseProtoMsg { */ export interface QueryDelegatorWithdrawAddressResponseAmino { /** withdraw_address defines the delegator address to query for. */ - withdraw_address: string; + withdraw_address?: string; } export interface QueryDelegatorWithdrawAddressResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorWithdrawAddressResponse"; @@ -542,7 +542,7 @@ export interface QueryCommunityPoolResponseProtoMsg { */ export interface QueryCommunityPoolResponseAmino { /** pool defines community pool's coins. */ - pool: DecCoinAmino[]; + pool?: DecCoinAmino[]; } export interface QueryCommunityPoolResponseAminoMsg { type: "cosmos-sdk/QueryCommunityPoolResponse"; @@ -559,11 +559,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -588,7 +589,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -622,14 +624,15 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -661,9 +664,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -698,14 +703,15 @@ function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOuts }; } export const QueryValidatorOutstandingRewardsRequest = { - encode(message: QueryValidatorOutstandingRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", + encode(message: QueryValidatorOutstandingRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorOutstandingRewardsRequest(); while (reader.pos < end) { @@ -737,13 +743,15 @@ export const QueryValidatorOutstandingRewardsRequest = { return message; }, fromAmino(object: QueryValidatorOutstandingRewardsRequestAmino): QueryValidatorOutstandingRewardsRequest { - return { - validatorAddress: object.validator_address - }; + const message = createBaseQueryValidatorOutstandingRewardsRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryValidatorOutstandingRewardsRequest): QueryValidatorOutstandingRewardsRequestAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; return obj; }, fromAminoMsg(object: QueryValidatorOutstandingRewardsRequestAminoMsg): QueryValidatorOutstandingRewardsRequest { @@ -774,14 +782,15 @@ function createBaseQueryValidatorOutstandingRewardsResponse(): QueryValidatorOut }; } export const QueryValidatorOutstandingRewardsResponse = { - encode(message: QueryValidatorOutstandingRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse", + encode(message: QueryValidatorOutstandingRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rewards !== undefined) { ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorOutstandingRewardsResponse(); while (reader.pos < end) { @@ -813,9 +822,11 @@ export const QueryValidatorOutstandingRewardsResponse = { return message; }, fromAmino(object: QueryValidatorOutstandingRewardsResponseAmino): QueryValidatorOutstandingRewardsResponse { - return { - rewards: object?.rewards ? ValidatorOutstandingRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseQueryValidatorOutstandingRewardsResponse(); + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorOutstandingRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: QueryValidatorOutstandingRewardsResponse): QueryValidatorOutstandingRewardsResponseAmino { const obj: any = {}; @@ -850,14 +861,15 @@ function createBaseQueryValidatorCommissionRequest(): QueryValidatorCommissionRe }; } export const QueryValidatorCommissionRequest = { - encode(message: QueryValidatorCommissionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest", + encode(message: QueryValidatorCommissionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorCommissionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorCommissionRequest(); while (reader.pos < end) { @@ -889,13 +901,15 @@ export const QueryValidatorCommissionRequest = { return message; }, fromAmino(object: QueryValidatorCommissionRequestAmino): QueryValidatorCommissionRequest { - return { - validatorAddress: object.validator_address - }; + const message = createBaseQueryValidatorCommissionRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryValidatorCommissionRequest): QueryValidatorCommissionRequestAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; return obj; }, fromAminoMsg(object: QueryValidatorCommissionRequestAminoMsg): QueryValidatorCommissionRequest { @@ -926,14 +940,15 @@ function createBaseQueryValidatorCommissionResponse(): QueryValidatorCommissionR }; } export const QueryValidatorCommissionResponse = { - encode(message: QueryValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse", + encode(message: QueryValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.commission !== undefined) { ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorCommissionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorCommissionResponse(); while (reader.pos < end) { @@ -965,9 +980,11 @@ export const QueryValidatorCommissionResponse = { return message; }, fromAmino(object: QueryValidatorCommissionResponseAmino): QueryValidatorCommissionResponse { - return { - commission: object?.commission ? ValidatorAccumulatedCommission.fromAmino(object.commission) : undefined - }; + const message = createBaseQueryValidatorCommissionResponse(); + if (object.commission !== undefined && object.commission !== null) { + message.commission = ValidatorAccumulatedCommission.fromAmino(object.commission); + } + return message; }, toAmino(message: QueryValidatorCommissionResponse): QueryValidatorCommissionResponseAmino { const obj: any = {}; @@ -999,20 +1016,21 @@ export const QueryValidatorCommissionResponse = { function createBaseQueryValidatorSlashesRequest(): QueryValidatorSlashesRequest { return { validatorAddress: "", - startingHeight: Long.UZERO, - endingHeight: Long.UZERO, - pagination: PageRequest.fromPartial({}) + startingHeight: BigInt(0), + endingHeight: BigInt(0), + pagination: undefined }; } export const QueryValidatorSlashesRequest = { - encode(message: QueryValidatorSlashesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest", + encode(message: QueryValidatorSlashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } - if (!message.startingHeight.isZero()) { + if (message.startingHeight !== BigInt(0)) { writer.uint32(16).uint64(message.startingHeight); } - if (!message.endingHeight.isZero()) { + if (message.endingHeight !== BigInt(0)) { writer.uint32(24).uint64(message.endingHeight); } if (message.pagination !== undefined) { @@ -1020,8 +1038,8 @@ export const QueryValidatorSlashesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorSlashesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorSlashesRequest(); while (reader.pos < end) { @@ -1031,10 +1049,10 @@ export const QueryValidatorSlashesRequest = { message.validatorAddress = reader.string(); break; case 2: - message.startingHeight = (reader.uint64() as Long); + message.startingHeight = reader.uint64(); break; case 3: - message.endingHeight = (reader.uint64() as Long); + message.endingHeight = reader.uint64(); break; case 4: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1049,40 +1067,48 @@ export const QueryValidatorSlashesRequest = { fromJSON(object: any): QueryValidatorSlashesRequest { return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - startingHeight: isSet(object.startingHeight) ? Long.fromValue(object.startingHeight) : Long.UZERO, - endingHeight: isSet(object.endingHeight) ? Long.fromValue(object.endingHeight) : Long.UZERO, + startingHeight: isSet(object.startingHeight) ? BigInt(object.startingHeight.toString()) : BigInt(0), + endingHeight: isSet(object.endingHeight) ? BigInt(object.endingHeight.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryValidatorSlashesRequest): unknown { const obj: any = {}; message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.startingHeight !== undefined && (obj.startingHeight = (message.startingHeight || Long.UZERO).toString()); - message.endingHeight !== undefined && (obj.endingHeight = (message.endingHeight || Long.UZERO).toString()); + message.startingHeight !== undefined && (obj.startingHeight = (message.startingHeight || BigInt(0)).toString()); + message.endingHeight !== undefined && (obj.endingHeight = (message.endingHeight || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryValidatorSlashesRequest { const message = createBaseQueryValidatorSlashesRequest(); message.validatorAddress = object.validatorAddress ?? ""; - message.startingHeight = object.startingHeight !== undefined && object.startingHeight !== null ? Long.fromValue(object.startingHeight) : Long.UZERO; - message.endingHeight = object.endingHeight !== undefined && object.endingHeight !== null ? Long.fromValue(object.endingHeight) : Long.UZERO; + message.startingHeight = object.startingHeight !== undefined && object.startingHeight !== null ? BigInt(object.startingHeight.toString()) : BigInt(0); + message.endingHeight = object.endingHeight !== undefined && object.endingHeight !== null ? BigInt(object.endingHeight.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryValidatorSlashesRequestAmino): QueryValidatorSlashesRequest { - return { - validatorAddress: object.validator_address, - startingHeight: Long.fromString(object.starting_height), - endingHeight: Long.fromString(object.ending_height), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorSlashesRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_height !== undefined && object.starting_height !== null) { + message.startingHeight = BigInt(object.starting_height); + } + if (object.ending_height !== undefined && object.ending_height !== null) { + message.endingHeight = BigInt(object.ending_height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorSlashesRequest): QueryValidatorSlashesRequestAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; - obj.starting_height = message.startingHeight ? message.startingHeight.toString() : undefined; - obj.ending_height = message.endingHeight ? message.endingHeight.toString() : undefined; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.starting_height = message.startingHeight !== BigInt(0) ? message.startingHeight.toString() : undefined; + obj.ending_height = message.endingHeight !== BigInt(0) ? message.endingHeight.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1111,11 +1137,12 @@ export const QueryValidatorSlashesRequest = { function createBaseQueryValidatorSlashesResponse(): QueryValidatorSlashesResponse { return { slashes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorSlashesResponse = { - encode(message: QueryValidatorSlashesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse", + encode(message: QueryValidatorSlashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.slashes) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1124,8 +1151,8 @@ export const QueryValidatorSlashesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorSlashesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorSlashesResponse(); while (reader.pos < end) { @@ -1167,17 +1194,19 @@ export const QueryValidatorSlashesResponse = { return message; }, fromAmino(object: QueryValidatorSlashesResponseAmino): QueryValidatorSlashesResponse { - return { - slashes: Array.isArray(object?.slashes) ? object.slashes.map((e: any) => ValidatorSlashEvent.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorSlashesResponse(); + message.slashes = object.slashes?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorSlashesResponse): QueryValidatorSlashesResponseAmino { const obj: any = {}; if (message.slashes) { obj.slashes = message.slashes.map(e => e ? ValidatorSlashEvent.toAmino(e) : undefined); } else { - obj.slashes = []; + obj.slashes = message.slashes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1211,7 +1240,8 @@ function createBaseQueryDelegationRewardsRequest(): QueryDelegationRewardsReques }; } export const QueryDelegationRewardsRequest = { - encode(message: QueryDelegationRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest", + encode(message: QueryDelegationRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1220,8 +1250,8 @@ export const QueryDelegationRewardsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationRewardsRequest(); while (reader.pos < end) { @@ -1259,15 +1289,19 @@ export const QueryDelegationRewardsRequest = { return message; }, fromAmino(object: QueryDelegationRewardsRequestAmino): QueryDelegationRewardsRequest { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseQueryDelegationRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryDelegationRewardsRequest): QueryDelegationRewardsRequestAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; return obj; }, fromAminoMsg(object: QueryDelegationRewardsRequestAminoMsg): QueryDelegationRewardsRequest { @@ -1298,14 +1332,15 @@ function createBaseQueryDelegationRewardsResponse(): QueryDelegationRewardsRespo }; } export const QueryDelegationRewardsResponse = { - encode(message: QueryDelegationRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse", + encode(message: QueryDelegationRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationRewardsResponse(); while (reader.pos < end) { @@ -1341,16 +1376,16 @@ export const QueryDelegationRewardsResponse = { return message; }, fromAmino(object: QueryDelegationRewardsResponseAmino): QueryDelegationRewardsResponse { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryDelegationRewardsResponse(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryDelegationRewardsResponse): QueryDelegationRewardsResponseAmino { const obj: any = {}; if (message.rewards) { obj.rewards = message.rewards.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.rewards = []; + obj.rewards = message.rewards; } return obj; }, @@ -1382,14 +1417,15 @@ function createBaseQueryDelegationTotalRewardsRequest(): QueryDelegationTotalRew }; } export const QueryDelegationTotalRewardsRequest = { - encode(message: QueryDelegationTotalRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", + encode(message: QueryDelegationTotalRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationTotalRewardsRequest(); while (reader.pos < end) { @@ -1421,13 +1457,15 @@ export const QueryDelegationTotalRewardsRequest = { return message; }, fromAmino(object: QueryDelegationTotalRewardsRequestAmino): QueryDelegationTotalRewardsRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegationTotalRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegationTotalRewardsRequest): QueryDelegationTotalRewardsRequestAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; return obj; }, fromAminoMsg(object: QueryDelegationTotalRewardsRequestAminoMsg): QueryDelegationTotalRewardsRequest { @@ -1459,7 +1497,8 @@ function createBaseQueryDelegationTotalRewardsResponse(): QueryDelegationTotalRe }; } export const QueryDelegationTotalRewardsResponse = { - encode(message: QueryDelegationTotalRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", + encode(message: QueryDelegationTotalRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1468,8 +1507,8 @@ export const QueryDelegationTotalRewardsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationTotalRewardsResponse(); while (reader.pos < end) { @@ -1515,22 +1554,22 @@ export const QueryDelegationTotalRewardsResponse = { return message; }, fromAmino(object: QueryDelegationTotalRewardsResponseAmino): QueryDelegationTotalRewardsResponse { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DelegationDelegatorReward.fromAmino(e)) : [], - total: Array.isArray(object?.total) ? object.total.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryDelegationTotalRewardsResponse(); + message.rewards = object.rewards?.map(e => DelegationDelegatorReward.fromAmino(e)) || []; + message.total = object.total?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryDelegationTotalRewardsResponse): QueryDelegationTotalRewardsResponseAmino { const obj: any = {}; if (message.rewards) { obj.rewards = message.rewards.map(e => e ? DelegationDelegatorReward.toAmino(e) : undefined); } else { - obj.rewards = []; + obj.rewards = message.rewards; } if (message.total) { obj.total = message.total.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.total = []; + obj.total = message.total; } return obj; }, @@ -1562,14 +1601,15 @@ function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRe }; } export const QueryDelegatorValidatorsRequest = { - encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest", + encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsRequest(); while (reader.pos < end) { @@ -1601,13 +1641,15 @@ export const QueryDelegatorValidatorsRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; return obj; }, fromAminoMsg(object: QueryDelegatorValidatorsRequestAminoMsg): QueryDelegatorValidatorsRequest { @@ -1638,14 +1680,15 @@ function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsR }; } export const QueryDelegatorValidatorsResponse = { - encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", + encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsResponse(); while (reader.pos < end) { @@ -1681,16 +1724,16 @@ export const QueryDelegatorValidatorsResponse = { return message; }, fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => e) : [] - }; + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => e) || []; + return message; }, toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { const obj: any = {}; if (message.validators) { obj.validators = message.validators.map(e => e); } else { - obj.validators = []; + obj.validators = message.validators; } return obj; }, @@ -1722,14 +1765,15 @@ function createBaseQueryDelegatorWithdrawAddressRequest(): QueryDelegatorWithdra }; } export const QueryDelegatorWithdrawAddressRequest = { - encode(message: QueryDelegatorWithdrawAddressRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", + encode(message: QueryDelegatorWithdrawAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorWithdrawAddressRequest(); while (reader.pos < end) { @@ -1761,13 +1805,15 @@ export const QueryDelegatorWithdrawAddressRequest = { return message; }, fromAmino(object: QueryDelegatorWithdrawAddressRequestAmino): QueryDelegatorWithdrawAddressRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegatorWithdrawAddressRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegatorWithdrawAddressRequest): QueryDelegatorWithdrawAddressRequestAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; return obj; }, fromAminoMsg(object: QueryDelegatorWithdrawAddressRequestAminoMsg): QueryDelegatorWithdrawAddressRequest { @@ -1798,14 +1844,15 @@ function createBaseQueryDelegatorWithdrawAddressResponse(): QueryDelegatorWithdr }; } export const QueryDelegatorWithdrawAddressResponse = { - encode(message: QueryDelegatorWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", + encode(message: QueryDelegatorWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.withdrawAddress !== "") { writer.uint32(10).string(message.withdrawAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorWithdrawAddressResponse(); while (reader.pos < end) { @@ -1837,13 +1884,15 @@ export const QueryDelegatorWithdrawAddressResponse = { return message; }, fromAmino(object: QueryDelegatorWithdrawAddressResponseAmino): QueryDelegatorWithdrawAddressResponse { - return { - withdrawAddress: object.withdraw_address - }; + const message = createBaseQueryDelegatorWithdrawAddressResponse(); + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: QueryDelegatorWithdrawAddressResponse): QueryDelegatorWithdrawAddressResponseAmino { const obj: any = {}; - obj.withdraw_address = message.withdrawAddress; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; return obj; }, fromAminoMsg(object: QueryDelegatorWithdrawAddressResponseAminoMsg): QueryDelegatorWithdrawAddressResponse { @@ -1872,11 +1921,12 @@ function createBaseQueryCommunityPoolRequest(): QueryCommunityPoolRequest { return {}; } export const QueryCommunityPoolRequest = { - encode(_: QueryCommunityPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolRequest", + encode(_: QueryCommunityPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCommunityPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCommunityPoolRequest(); while (reader.pos < end) { @@ -1901,7 +1951,8 @@ export const QueryCommunityPoolRequest = { return message; }, fromAmino(_: QueryCommunityPoolRequestAmino): QueryCommunityPoolRequest { - return {}; + const message = createBaseQueryCommunityPoolRequest(); + return message; }, toAmino(_: QueryCommunityPoolRequest): QueryCommunityPoolRequestAmino { const obj: any = {}; @@ -1935,14 +1986,15 @@ function createBaseQueryCommunityPoolResponse(): QueryCommunityPoolResponse { }; } export const QueryCommunityPoolResponse = { - encode(message: QueryCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolResponse", + encode(message: QueryCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCommunityPoolResponse(); while (reader.pos < end) { @@ -1978,16 +2030,16 @@ export const QueryCommunityPoolResponse = { return message; }, fromAmino(object: QueryCommunityPoolResponseAmino): QueryCommunityPoolResponse { - return { - pool: Array.isArray(object?.pool) ? object.pool.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryCommunityPoolResponse(); + message.pool = object.pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCommunityPoolResponse): QueryCommunityPoolResponseAmino { const obj: any = {}; if (message.pool) { obj.pool = message.pool.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.pool = []; + obj.pool = message.pool; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts index 95dd6f3b..c66ec3e0 100644 --- a/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse } from "./tx"; /** Msg defines the distribution Msg service. */ export interface Msg { @@ -36,21 +36,21 @@ export class MsgClientImpl implements Msg { setWithdrawAddress(request: MsgSetWithdrawAddress): Promise { const data = MsgSetWithdrawAddress.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data); - return promise.then(data => MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSetWithdrawAddressResponse.decode(new BinaryReader(data))); } withdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise { const data = MsgWithdrawDelegatorReward.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data); - return promise.then(data => MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgWithdrawDelegatorRewardResponse.decode(new BinaryReader(data))); } withdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise { const data = MsgWithdrawValidatorCommission.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data); - return promise.then(data => MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgWithdrawValidatorCommissionResponse.decode(new BinaryReader(data))); } fundCommunityPool(request: MsgFundCommunityPool): Promise { const data = MsgFundCommunityPool.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); - return promise.then(data => MsgFundCommunityPoolResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgFundCommunityPoolResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.ts index 7ef3567b..fd13bc11 100644 --- a/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/distribution/v1beta1/tx.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * MsgSetWithdrawAddress sets the withdraw address for @@ -18,8 +18,8 @@ export interface MsgSetWithdrawAddressProtoMsg { * a delegator (or validator self-delegation). */ export interface MsgSetWithdrawAddressAmino { - delegator_address: string; - withdraw_address: string; + delegator_address?: string; + withdraw_address?: string; } export interface MsgSetWithdrawAddressAminoMsg { type: "cosmos-sdk/MsgModifyWithdrawAddress"; @@ -64,8 +64,8 @@ export interface MsgWithdrawDelegatorRewardProtoMsg { * from a single validator. */ export interface MsgWithdrawDelegatorRewardAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; } export interface MsgWithdrawDelegatorRewardAminoMsg { type: "cosmos-sdk/MsgWithdrawDelegationReward"; @@ -91,7 +91,7 @@ export interface MsgWithdrawDelegatorRewardResponseProtoMsg { /** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ export interface MsgWithdrawDelegatorRewardResponseAmino { /** Since: cosmos-sdk 0.46 */ - amount: CoinAmino[]; + amount?: CoinAmino[]; } export interface MsgWithdrawDelegatorRewardResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; @@ -117,7 +117,7 @@ export interface MsgWithdrawValidatorCommissionProtoMsg { * address. */ export interface MsgWithdrawValidatorCommissionAmino { - validator_address: string; + validator_address?: string; } export interface MsgWithdrawValidatorCommissionAminoMsg { type: "cosmos-sdk/MsgWithdrawValidatorCommission"; @@ -142,7 +142,7 @@ export interface MsgWithdrawValidatorCommissionResponseProtoMsg { /** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ export interface MsgWithdrawValidatorCommissionResponseAmino { /** Since: cosmos-sdk 0.46 */ - amount: CoinAmino[]; + amount?: CoinAmino[]; } export interface MsgWithdrawValidatorCommissionResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; @@ -169,8 +169,8 @@ export interface MsgFundCommunityPoolProtoMsg { * fund the community pool. */ export interface MsgFundCommunityPoolAmino { - amount: CoinAmino[]; - depositor: string; + amount?: CoinAmino[]; + depositor?: string; } export interface MsgFundCommunityPoolAminoMsg { type: "cosmos-sdk/MsgFundCommunityPool"; @@ -205,7 +205,8 @@ function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { }; } export const MsgSetWithdrawAddress = { - encode(message: MsgSetWithdrawAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + encode(message: MsgSetWithdrawAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -214,8 +215,8 @@ export const MsgSetWithdrawAddress = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetWithdrawAddress(); while (reader.pos < end) { @@ -253,15 +254,19 @@ export const MsgSetWithdrawAddress = { return message; }, fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { - return { - delegatorAddress: object.delegator_address, - withdrawAddress: object.withdraw_address - }; + const message = createBaseMsgSetWithdrawAddress(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.withdraw_address = message.withdrawAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.withdraw_address = message.withdrawAddress === "" ? undefined : message.withdrawAddress; return obj; }, fromAminoMsg(object: MsgSetWithdrawAddressAminoMsg): MsgSetWithdrawAddress { @@ -290,11 +295,12 @@ function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressRespons return {}; } export const MsgSetWithdrawAddressResponse = { - encode(_: MsgSetWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + encode(_: MsgSetWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetWithdrawAddressResponse(); while (reader.pos < end) { @@ -319,7 +325,8 @@ export const MsgSetWithdrawAddressResponse = { return message; }, fromAmino(_: MsgSetWithdrawAddressResponseAmino): MsgSetWithdrawAddressResponse { - return {}; + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; }, toAmino(_: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAmino { const obj: any = {}; @@ -354,7 +361,8 @@ function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { }; } export const MsgWithdrawDelegatorReward = { - encode(message: MsgWithdrawDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + encode(message: MsgWithdrawDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -363,8 +371,8 @@ export const MsgWithdrawDelegatorReward = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawDelegatorReward(); while (reader.pos < end) { @@ -402,15 +410,19 @@ export const MsgWithdrawDelegatorReward = { return message; }, fromAmino(object: MsgWithdrawDelegatorRewardAmino): MsgWithdrawDelegatorReward { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseMsgWithdrawDelegatorReward(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; return obj; }, fromAminoMsg(object: MsgWithdrawDelegatorRewardAminoMsg): MsgWithdrawDelegatorReward { @@ -441,14 +453,15 @@ function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRew }; } export const MsgWithdrawDelegatorRewardResponse = { - encode(message: MsgWithdrawDelegatorRewardResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + encode(message: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawDelegatorRewardResponse(); while (reader.pos < end) { @@ -484,16 +497,16 @@ export const MsgWithdrawDelegatorRewardResponse = { return message; }, fromAmino(object: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { const obj: any = {}; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -525,14 +538,15 @@ function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommiss }; } export const MsgWithdrawValidatorCommission = { - encode(message: MsgWithdrawValidatorCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + encode(message: MsgWithdrawValidatorCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawValidatorCommission(); while (reader.pos < end) { @@ -564,13 +578,15 @@ export const MsgWithdrawValidatorCommission = { return message; }, fromAmino(object: MsgWithdrawValidatorCommissionAmino): MsgWithdrawValidatorCommission { - return { - validatorAddress: object.validator_address - }; + const message = createBaseMsgWithdrawValidatorCommission(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAmino { const obj: any = {}; - obj.validator_address = message.validatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; return obj; }, fromAminoMsg(object: MsgWithdrawValidatorCommissionAminoMsg): MsgWithdrawValidatorCommission { @@ -601,14 +617,15 @@ function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidato }; } export const MsgWithdrawValidatorCommissionResponse = { - encode(message: MsgWithdrawValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + encode(message: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawValidatorCommissionResponse(); while (reader.pos < end) { @@ -644,16 +661,16 @@ export const MsgWithdrawValidatorCommissionResponse = { return message; }, fromAmino(object: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { const obj: any = {}; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -686,7 +703,8 @@ function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { }; } export const MsgFundCommunityPool = { - encode(message: MsgFundCommunityPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + encode(message: MsgFundCommunityPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -695,8 +713,8 @@ export const MsgFundCommunityPool = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgFundCommunityPool(); while (reader.pos < end) { @@ -738,19 +756,21 @@ export const MsgFundCommunityPool = { return message; }, fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - depositor: object.depositor - }; + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; }, toAmino(message: MsgFundCommunityPool): MsgFundCommunityPoolAmino { const obj: any = {}; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } - obj.depositor = message.depositor; + obj.depositor = message.depositor === "" ? undefined : message.depositor; return obj; }, fromAminoMsg(object: MsgFundCommunityPoolAminoMsg): MsgFundCommunityPool { @@ -779,11 +799,12 @@ function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse return {}; } export const MsgFundCommunityPoolResponse = { - encode(_: MsgFundCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + encode(_: MsgFundCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgFundCommunityPoolResponse(); while (reader.pos < end) { @@ -808,7 +829,8 @@ export const MsgFundCommunityPoolResponse = { return message; }, fromAmino(_: MsgFundCommunityPoolResponseAmino): MsgFundCommunityPoolResponse { - return {}; + const message = createBaseMsgFundCommunityPoolResponse(); + return message; }, toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/evidence/v1beta1/evidence.ts b/packages/api/src/codegen/cosmos/evidence/v1beta1/evidence.ts index 0ceb1abb..43d1430a 100644 --- a/packages/api/src/codegen/cosmos/evidence/v1beta1/evidence.ts +++ b/packages/api/src/codegen/cosmos/evidence/v1beta1/evidence.ts @@ -1,14 +1,14 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** * Equivocation implements the Evidence interface and defines evidence of double * signing misbehavior. */ export interface Equivocation { - height: Long; + height: bigint; time: Timestamp; - power: Long; + power: bigint; consensusAddress: string; } export interface EquivocationProtoMsg { @@ -20,10 +20,10 @@ export interface EquivocationProtoMsg { * signing misbehavior. */ export interface EquivocationAmino { - height: string; - time?: TimestampAmino; - power: string; - consensus_address: string; + height?: string; + time?: string; + power?: string; + consensus_address?: string; } export interface EquivocationAminoMsg { type: "cosmos-sdk/Equivocation"; @@ -34,28 +34,29 @@ export interface EquivocationAminoMsg { * signing misbehavior. */ export interface EquivocationSDKType { - height: Long; + height: bigint; time: TimestampSDKType; - power: Long; + power: bigint; consensus_address: string; } function createBaseEquivocation(): Equivocation { return { - height: Long.ZERO, - time: undefined, - power: Long.ZERO, + height: BigInt(0), + time: Timestamp.fromPartial({}), + power: BigInt(0), consensusAddress: "" }; } export const Equivocation = { - encode(message: Equivocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.evidence.v1beta1.Equivocation", + encode(message: Equivocation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(message.time, writer.uint32(18).fork()).ldelim(); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(24).int64(message.power); } if (message.consensusAddress !== "") { @@ -63,21 +64,21 @@ export const Equivocation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Equivocation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Equivocation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEquivocation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 2: message.time = Timestamp.decode(reader, reader.uint32()); break; case 3: - message.power = (reader.int64() as Long); + message.power = reader.int64(); break; case 4: message.consensusAddress = reader.string(); @@ -91,42 +92,50 @@ export const Equivocation = { }, fromJSON(object: any): Equivocation { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, - power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO, + power: isSet(object.power) ? BigInt(object.power.toString()) : BigInt(0), consensusAddress: isSet(object.consensusAddress) ? String(object.consensusAddress) : "" }; }, toJSON(message: Equivocation): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); message.consensusAddress !== undefined && (obj.consensusAddress = message.consensusAddress); return obj; }, fromPartial(object: Partial): Equivocation { const message = createBaseEquivocation(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.time = object.time !== undefined && object.time !== null ? Timestamp.fromPartial(object.time) : undefined; - message.power = object.power !== undefined && object.power !== null ? Long.fromValue(object.power) : Long.ZERO; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); message.consensusAddress = object.consensusAddress ?? ""; return message; }, fromAmino(object: EquivocationAmino): Equivocation { - return { - height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - power: Long.fromString(object.power), - consensusAddress: object.consensus_address - }; + const message = createBaseEquivocation(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + if (object.consensus_address !== undefined && object.consensus_address !== null) { + message.consensusAddress = object.consensus_address; + } + return message; }, toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; - obj.power = message.power ? message.power.toString() : undefined; - obj.consensus_address = message.consensusAddress; + obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; + obj.consensus_address = message.consensusAddress === "" ? undefined : message.consensusAddress; return obj; }, fromAminoMsg(object: EquivocationAminoMsg): Equivocation { diff --git a/packages/api/src/codegen/cosmos/evidence/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/evidence/v1beta1/genesis.ts index 67fe4240..6d3c37a3 100644 --- a/packages/api/src/codegen/cosmos/evidence/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/evidence/v1beta1/genesis.ts @@ -1,5 +1,5 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the evidence module's genesis state. */ export interface GenesisState { /** evidence defines all the evidence at genesis. */ @@ -12,7 +12,7 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the evidence module's genesis state. */ export interface GenesisStateAmino { /** evidence defines all the evidence at genesis. */ - evidence: AnyAmino[]; + evidence?: AnyAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -28,14 +28,15 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.evidence.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.evidence) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -71,16 +72,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.evidence = object.evidence?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; if (message.evidence) { obj.evidence = message.evidence.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.evidence = []; + obj.evidence = message.evidence; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts index 0bd37c61..5696b227 100644 --- a/packages/api/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryEvidenceRequest, QueryEvidenceResponseSDKType, QueryAllEvidenceRequest, QueryAllEvidenceResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/evidence/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/evidence/v1beta1/query.rpc.Query.ts index cce9ac1a..8a7959af 100644 --- a/packages/api/src/codegen/cosmos/evidence/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/evidence/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryEvidenceRequest, QueryEvidenceResponse, QueryAllEvidenceRequest, QueryAllEvidenceResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -19,14 +19,14 @@ export class QueryClientImpl implements Query { evidence(request: QueryEvidenceRequest): Promise { const data = QueryEvidenceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "Evidence", data); - return promise.then(data => QueryEvidenceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryEvidenceResponse.decode(new BinaryReader(data))); } allEvidence(request: QueryAllEvidenceRequest = { pagination: undefined }): Promise { const data = QueryAllEvidenceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "AllEvidence", data); - return promise.then(data => QueryAllEvidenceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllEvidenceResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/evidence/v1beta1/query.ts b/packages/api/src/codegen/cosmos/evidence/v1beta1/query.ts index e084df64..fec28cc6 100644 --- a/packages/api/src/codegen/cosmos/evidence/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/evidence/v1beta1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequest { @@ -14,7 +14,7 @@ export interface QueryEvidenceRequestProtoMsg { /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequestAmino { /** evidence_hash defines the hash of the requested evidence. */ - evidence_hash: Uint8Array; + evidence_hash?: string; } export interface QueryEvidenceRequestAminoMsg { type: "cosmos-sdk/QueryEvidenceRequest"; @@ -27,7 +27,7 @@ export interface QueryEvidenceRequestSDKType { /** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ export interface QueryEvidenceResponse { /** evidence returns the requested evidence. */ - evidence: Any; + evidence?: Any; } export interface QueryEvidenceResponseProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryEvidenceResponse"; @@ -44,7 +44,7 @@ export interface QueryEvidenceResponseAminoMsg { } /** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ export interface QueryEvidenceResponseSDKType { - evidence: AnySDKType; + evidence?: AnySDKType; } /** * QueryEvidenceRequest is the request type for the Query/AllEvidence RPC @@ -52,7 +52,7 @@ export interface QueryEvidenceResponseSDKType { */ export interface QueryAllEvidenceRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllEvidenceRequestProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryAllEvidenceRequest"; @@ -75,7 +75,7 @@ export interface QueryAllEvidenceRequestAminoMsg { * method. */ export interface QueryAllEvidenceRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC @@ -85,7 +85,7 @@ export interface QueryAllEvidenceResponse { /** evidence returns all evidences. */ evidence: Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllEvidenceResponseProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryAllEvidenceResponse"; @@ -97,7 +97,7 @@ export interface QueryAllEvidenceResponseProtoMsg { */ export interface QueryAllEvidenceResponseAmino { /** evidence returns all evidences. */ - evidence: AnyAmino[]; + evidence?: AnyAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -111,7 +111,7 @@ export interface QueryAllEvidenceResponseAminoMsg { */ export interface QueryAllEvidenceResponseSDKType { evidence: AnySDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryEvidenceRequest(): QueryEvidenceRequest { return { @@ -119,14 +119,15 @@ function createBaseQueryEvidenceRequest(): QueryEvidenceRequest { }; } export const QueryEvidenceRequest = { - encode(message: QueryEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.evidence.v1beta1.QueryEvidenceRequest", + encode(message: QueryEvidenceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.evidenceHash.length !== 0) { writer.uint32(10).bytes(message.evidenceHash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEvidenceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEvidenceRequest(); while (reader.pos < end) { @@ -158,13 +159,15 @@ export const QueryEvidenceRequest = { return message; }, fromAmino(object: QueryEvidenceRequestAmino): QueryEvidenceRequest { - return { - evidenceHash: object.evidence_hash - }; + const message = createBaseQueryEvidenceRequest(); + if (object.evidence_hash !== undefined && object.evidence_hash !== null) { + message.evidenceHash = bytesFromBase64(object.evidence_hash); + } + return message; }, toAmino(message: QueryEvidenceRequest): QueryEvidenceRequestAmino { const obj: any = {}; - obj.evidence_hash = message.evidenceHash; + obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; return obj; }, fromAminoMsg(object: QueryEvidenceRequestAminoMsg): QueryEvidenceRequest { @@ -195,14 +198,15 @@ function createBaseQueryEvidenceResponse(): QueryEvidenceResponse { }; } export const QueryEvidenceResponse = { - encode(message: QueryEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.evidence.v1beta1.QueryEvidenceResponse", + encode(message: QueryEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.evidence !== undefined) { Any.encode(message.evidence, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEvidenceResponse(); while (reader.pos < end) { @@ -234,9 +238,11 @@ export const QueryEvidenceResponse = { return message; }, fromAmino(object: QueryEvidenceResponseAmino): QueryEvidenceResponse { - return { - evidence: object?.evidence ? Any.fromAmino(object.evidence) : undefined - }; + const message = createBaseQueryEvidenceResponse(); + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = Any.fromAmino(object.evidence); + } + return message; }, toAmino(message: QueryEvidenceResponse): QueryEvidenceResponseAmino { const obj: any = {}; @@ -267,18 +273,19 @@ export const QueryEvidenceResponse = { }; function createBaseQueryAllEvidenceRequest(): QueryAllEvidenceRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllEvidenceRequest = { - encode(message: QueryAllEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.evidence.v1beta1.QueryAllEvidenceRequest", + encode(message: QueryAllEvidenceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllEvidenceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllEvidenceRequest(); while (reader.pos < end) { @@ -310,9 +317,11 @@ export const QueryAllEvidenceRequest = { return message; }, fromAmino(object: QueryAllEvidenceRequestAmino): QueryAllEvidenceRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllEvidenceRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllEvidenceRequest): QueryAllEvidenceRequestAmino { const obj: any = {}; @@ -344,11 +353,12 @@ export const QueryAllEvidenceRequest = { function createBaseQueryAllEvidenceResponse(): QueryAllEvidenceResponse { return { evidence: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllEvidenceResponse = { - encode(message: QueryAllEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.evidence.v1beta1.QueryAllEvidenceResponse", + encode(message: QueryAllEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.evidence) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -357,8 +367,8 @@ export const QueryAllEvidenceResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllEvidenceResponse(); while (reader.pos < end) { @@ -400,17 +410,19 @@ export const QueryAllEvidenceResponse = { return message; }, fromAmino(object: QueryAllEvidenceResponseAmino): QueryAllEvidenceResponse { - return { - evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Any.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllEvidenceResponse(); + message.evidence = object.evidence?.map(e => Any.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllEvidenceResponse): QueryAllEvidenceResponseAmino { const obj: any = {}; if (message.evidence) { obj.evidence = message.evidence.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.evidence = []; + obj.evidence = message.evidence; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; diff --git a/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.rpc.msg.ts index 4ff20e2f..50e7473e 100644 --- a/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgSubmitEvidence, MsgSubmitEvidenceResponse } from "./tx"; /** Msg defines the evidence Msg service. */ export interface Msg { @@ -18,6 +18,6 @@ export class MsgClientImpl implements Msg { submitEvidence(request: MsgSubmitEvidence): Promise { const data = MsgSubmitEvidence.encode(request).finish(); const promise = this.rpc.request("cosmos.evidence.v1beta1.Msg", "SubmitEvidence", data); - return promise.then(data => MsgSubmitEvidenceResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSubmitEvidenceResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.ts index a13c322d..51d1c8ca 100644 --- a/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/evidence/v1beta1/tx.ts @@ -1,5 +1,5 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * MsgSubmitEvidence represents a message that supports submitting arbitrary @@ -7,7 +7,7 @@ import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; */ export interface MsgSubmitEvidence { submitter: string; - evidence: (Any) | undefined; + evidence?: (Any) | undefined; } export interface MsgSubmitEvidenceProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence"; @@ -21,7 +21,7 @@ export type MsgSubmitEvidenceEncoded = Omit & { * Evidence of misbehavior such as equivocation or counterfactual signing. */ export interface MsgSubmitEvidenceAmino { - submitter: string; + submitter?: string; evidence?: AnyAmino; } export interface MsgSubmitEvidenceAminoMsg { @@ -34,7 +34,7 @@ export interface MsgSubmitEvidenceAminoMsg { */ export interface MsgSubmitEvidenceSDKType { submitter: string; - evidence: AnySDKType | undefined; + evidence?: AnySDKType | undefined; } /** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ export interface MsgSubmitEvidenceResponse { @@ -48,7 +48,7 @@ export interface MsgSubmitEvidenceResponseProtoMsg { /** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ export interface MsgSubmitEvidenceResponseAmino { /** hash defines the hash of the evidence. */ - hash: Uint8Array; + hash?: string; } export interface MsgSubmitEvidenceResponseAminoMsg { type: "cosmos-sdk/MsgSubmitEvidenceResponse"; @@ -65,7 +65,8 @@ function createBaseMsgSubmitEvidence(): MsgSubmitEvidence { }; } export const MsgSubmitEvidence = { - encode(message: MsgSubmitEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", + encode(message: MsgSubmitEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.submitter !== "") { writer.uint32(10).string(message.submitter); } @@ -74,8 +75,8 @@ export const MsgSubmitEvidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitEvidence(); while (reader.pos < end) { @@ -113,14 +114,18 @@ export const MsgSubmitEvidence = { return message; }, fromAmino(object: MsgSubmitEvidenceAmino): MsgSubmitEvidence { - return { - submitter: object.submitter, - evidence: object?.evidence ? Evidence_FromAmino(object.evidence) : undefined - }; + const message = createBaseMsgSubmitEvidence(); + if (object.submitter !== undefined && object.submitter !== null) { + message.submitter = object.submitter; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = Evidence_FromAmino(object.evidence); + } + return message; }, toAmino(message: MsgSubmitEvidence): MsgSubmitEvidenceAmino { const obj: any = {}; - obj.submitter = message.submitter; + obj.submitter = message.submitter === "" ? undefined : message.submitter; obj.evidence = message.evidence ? Evidence_ToAmino((message.evidence as Any)) : undefined; return obj; }, @@ -152,14 +157,15 @@ function createBaseMsgSubmitEvidenceResponse(): MsgSubmitEvidenceResponse { }; } export const MsgSubmitEvidenceResponse = { - encode(message: MsgSubmitEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse", + encode(message: MsgSubmitEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitEvidenceResponse(); while (reader.pos < end) { @@ -191,13 +197,15 @@ export const MsgSubmitEvidenceResponse = { return message; }, fromAmino(object: MsgSubmitEvidenceResponseAmino): MsgSubmitEvidenceResponse { - return { - hash: object.hash - }; + const message = createBaseMsgSubmitEvidenceResponse(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; }, toAmino(message: MsgSubmitEvidenceResponse): MsgSubmitEvidenceResponseAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; return obj; }, fromAminoMsg(object: MsgSubmitEvidenceResponseAminoMsg): MsgSubmitEvidenceResponse { @@ -222,15 +230,15 @@ export const MsgSubmitEvidenceResponse = { }; } }; -export const Evidence_InterfaceDecoder = (input: _m0.Reader | Uint8Array): Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Evidence_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { default: return data; } }; -export const Evidence_FromAmino = (content: AnyAmino) => { +export const Evidence_FromAmino = (content: AnyAmino): Any => { return Any.fromAmino(content); }; export const Evidence_ToAmino = (content: Any) => { diff --git a/packages/api/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts b/packages/api/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts index 4e83f3c4..b8d28877 100644 --- a/packages/api/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts +++ b/packages/api/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts @@ -1,15 +1,15 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** * BasicAllowance implements Allowance with a one-time grant of coins * that optionally expires. The grantee can use up to SpendLimit to cover fees. */ export interface BasicAllowance { - $typeUrl?: string; + $typeUrl?: "/cosmos.feegrant.v1beta1.BasicAllowance"; /** * spend_limit specifies the maximum amount of coins that can be spent * by this allowance and will be updated as coins are spent. If it is @@ -17,7 +17,7 @@ export interface BasicAllowance { */ spendLimit: Coin[]; /** expiration specifies an optional time when this allowance expires */ - expiration: Timestamp; + expiration?: Timestamp; } export interface BasicAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance"; @@ -33,9 +33,9 @@ export interface BasicAllowanceAmino { * by this allowance and will be updated as coins are spent. If it is * empty, there is no spend limit and any amount of coins can be spent. */ - spend_limit: CoinAmino[]; + spend_limit?: CoinAmino[]; /** expiration specifies an optional time when this allowance expires */ - expiration?: TimestampAmino; + expiration?: string; } export interface BasicAllowanceAminoMsg { type: "cosmos-sdk/BasicAllowance"; @@ -46,16 +46,16 @@ export interface BasicAllowanceAminoMsg { * that optionally expires. The grantee can use up to SpendLimit to cover fees. */ export interface BasicAllowanceSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.feegrant.v1beta1.BasicAllowance"; spend_limit: CoinSDKType[]; - expiration: TimestampSDKType; + expiration?: TimestampSDKType; } /** * PeriodicAllowance extends Allowance to allow for both a maximum cap, * as well as a limit per time period. */ export interface PeriodicAllowance { - $typeUrl?: string; + $typeUrl?: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; /** basic specifies a struct of `BasicAllowance` */ basic: BasicAllowance; /** @@ -97,15 +97,15 @@ export interface PeriodicAllowanceAmino { * period_spend_limit specifies the maximum number of coins that can be spent * in the period */ - period_spend_limit: CoinAmino[]; + period_spend_limit?: CoinAmino[]; /** period_can_spend is the number of coins left to be spent before the period_reset time */ - period_can_spend: CoinAmino[]; + period_can_spend?: CoinAmino[]; /** * period_reset is the time at which this period resets and a new one begins, * it is calculated from the start time of the first transaction after the * last period ended */ - period_reset?: TimestampAmino; + period_reset?: string; } export interface PeriodicAllowanceAminoMsg { type: "cosmos-sdk/PeriodicAllowance"; @@ -116,7 +116,7 @@ export interface PeriodicAllowanceAminoMsg { * as well as a limit per time period. */ export interface PeriodicAllowanceSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; basic: BasicAllowanceSDKType; period: DurationSDKType; period_spend_limit: CoinSDKType[]; @@ -125,9 +125,9 @@ export interface PeriodicAllowanceSDKType { } /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowance { - $typeUrl?: string; + $typeUrl?: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; /** allowance can be any of basic and periodic fee allowance. */ - allowance: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; + allowance?: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; /** allowed_messages are the messages for which the grantee has the access. */ allowedMessages: string[]; } @@ -143,7 +143,7 @@ export interface AllowedMsgAllowanceAmino { /** allowance can be any of basic and periodic fee allowance. */ allowance?: AnyAmino; /** allowed_messages are the messages for which the grantee has the access. */ - allowed_messages: string[]; + allowed_messages?: string[]; } export interface AllowedMsgAllowanceAminoMsg { type: "cosmos-sdk/AllowedMsgAllowance"; @@ -151,8 +151,8 @@ export interface AllowedMsgAllowanceAminoMsg { } /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowanceSDKType { - $typeUrl?: string; - allowance: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; + $typeUrl?: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; allowed_messages: string[]; } /** Grant is stored in the KVStore to record a grant with full context */ @@ -162,7 +162,7 @@ export interface Grant { /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; /** allowance can be any of basic, periodic, allowed fee allowance. */ - allowance: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; + allowance?: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; } export interface GrantProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.Grant"; @@ -174,9 +174,9 @@ export type GrantEncoded = Omit & { /** Grant is stored in the KVStore to record a grant with full context */ export interface GrantAmino { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter?: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee?: string; /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: AnyAmino; } @@ -188,7 +188,7 @@ export interface GrantAminoMsg { export interface GrantSDKType { granter: string; grantee: string; - allowance: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; } function createBaseBasicAllowance(): BasicAllowance { return { @@ -198,7 +198,8 @@ function createBaseBasicAllowance(): BasicAllowance { }; } export const BasicAllowance = { - encode(message: BasicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + encode(message: BasicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -207,8 +208,8 @@ export const BasicAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasicAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasicAllowance(); while (reader.pos < end) { @@ -250,17 +251,19 @@ export const BasicAllowance = { return message; }, fromAmino(object: BasicAllowanceAmino): BasicAllowance { - return { - spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined - }; + const message = createBaseBasicAllowance(); + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = Timestamp.fromAmino(object.expiration); + } + return message; }, toAmino(message: BasicAllowance): BasicAllowanceAmino { const obj: any = {}; if (message.spendLimit) { obj.spend_limit = message.spendLimit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.spend_limit = []; + obj.spend_limit = message.spendLimit; } obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; return obj; @@ -291,14 +294,15 @@ function createBasePeriodicAllowance(): PeriodicAllowance { return { $typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", basic: BasicAllowance.fromPartial({}), - period: undefined, + period: Duration.fromPartial({}), periodSpendLimit: [], periodCanSpend: [], - periodReset: undefined + periodReset: Timestamp.fromPartial({}) }; } export const PeriodicAllowance = { - encode(message: PeriodicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + encode(message: PeriodicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basic !== undefined) { BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim(); } @@ -316,8 +320,8 @@ export const PeriodicAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePeriodicAllowance(); while (reader.pos < end) { @@ -381,13 +385,19 @@ export const PeriodicAllowance = { return message; }, fromAmino(object: PeriodicAllowanceAmino): PeriodicAllowance { - return { - basic: object?.basic ? BasicAllowance.fromAmino(object.basic) : undefined, - period: object?.period ? Duration.fromAmino(object.period) : undefined, - periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [], - periodReset: object?.period_reset ? Timestamp.fromAmino(object.period_reset) : undefined - }; + const message = createBasePeriodicAllowance(); + if (object.basic !== undefined && object.basic !== null) { + message.basic = BasicAllowance.fromAmino(object.basic); + } + if (object.period !== undefined && object.period !== null) { + message.period = Duration.fromAmino(object.period); + } + message.periodSpendLimit = object.period_spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.periodCanSpend = object.period_can_spend?.map(e => Coin.fromAmino(e)) || []; + if (object.period_reset !== undefined && object.period_reset !== null) { + message.periodReset = Timestamp.fromAmino(object.period_reset); + } + return message; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { const obj: any = {}; @@ -396,12 +406,12 @@ export const PeriodicAllowance = { if (message.periodSpendLimit) { obj.period_spend_limit = message.periodSpendLimit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.period_spend_limit = []; + obj.period_spend_limit = message.periodSpendLimit; } if (message.periodCanSpend) { obj.period_can_spend = message.periodCanSpend.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.period_can_spend = []; + obj.period_can_spend = message.periodCanSpend; } obj.period_reset = message.periodReset ? Timestamp.toAmino(message.periodReset) : undefined; return obj; @@ -436,7 +446,8 @@ function createBaseAllowedMsgAllowance(): AllowedMsgAllowance { }; } export const AllowedMsgAllowance = { - encode(message: AllowedMsgAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + encode(message: AllowedMsgAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowance !== undefined) { Any.encode((message.allowance as Any), writer.uint32(10).fork()).ldelim(); } @@ -445,8 +456,8 @@ export const AllowedMsgAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowedMsgAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowedMsgAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowedMsgAllowance(); while (reader.pos < end) { @@ -488,10 +499,12 @@ export const AllowedMsgAllowance = { return message; }, fromAmino(object: AllowedMsgAllowanceAmino): AllowedMsgAllowance { - return { - allowance: object?.allowance ? FeeAllowanceI_FromAmino(object.allowance) : undefined, - allowedMessages: Array.isArray(object?.allowed_messages) ? object.allowed_messages.map((e: any) => e) : [] - }; + const message = createBaseAllowedMsgAllowance(); + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = FeeAllowanceI_FromAmino(object.allowance); + } + message.allowedMessages = object.allowed_messages?.map(e => e) || []; + return message; }, toAmino(message: AllowedMsgAllowance): AllowedMsgAllowanceAmino { const obj: any = {}; @@ -499,7 +512,7 @@ export const AllowedMsgAllowance = { if (message.allowedMessages) { obj.allowed_messages = message.allowedMessages.map(e => e); } else { - obj.allowed_messages = []; + obj.allowed_messages = message.allowedMessages; } return obj; }, @@ -533,7 +546,8 @@ function createBaseGrant(): Grant { }; } export const Grant = { - encode(message: Grant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.Grant", + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -545,8 +559,8 @@ export const Grant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Grant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGrant(); while (reader.pos < end) { @@ -590,16 +604,22 @@ export const Grant = { return message; }, fromAmino(object: GrantAmino): Grant { - return { - granter: object.granter, - grantee: object.grantee, - allowance: object?.allowance ? FeeAllowanceI_FromAmino(object.allowance) : undefined - }; + const message = createBaseGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = FeeAllowanceI_FromAmino(object.allowance); + } + return message; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; obj.allowance = message.allowance ? FeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; return obj; }, @@ -625,8 +645,8 @@ export const Grant = { }; } }; -export const FeeAllowanceI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const FeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.feegrant.v1beta1.BasicAllowance": @@ -639,7 +659,7 @@ export const FeeAllowanceI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): return data; } }; -export const FeeAllowanceI_FromAmino = (content: AnyAmino) => { +export const FeeAllowanceI_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/BasicAllowance": return Any.fromPartial({ @@ -665,17 +685,17 @@ export const FeeAllowanceI_ToAmino = (content: Any) => { case "/cosmos.feegrant.v1beta1.BasicAllowance": return { type: "cosmos-sdk/BasicAllowance", - value: BasicAllowance.toAmino(BasicAllowance.decode(content.value)) + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined)) }; case "/cosmos.feegrant.v1beta1.PeriodicAllowance": return { type: "cosmos-sdk/PeriodicAllowance", - value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value)) + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined)) }; case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": return { type: "cosmos-sdk/AllowedMsgAllowance", - value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value)) + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/feegrant/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/feegrant/v1beta1/genesis.ts index 3b30e713..de66e5d5 100644 --- a/packages/api/src/codegen/cosmos/feegrant/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/feegrant/v1beta1/genesis.ts @@ -1,5 +1,5 @@ import { Grant, GrantAmino, GrantSDKType } from "./feegrant"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisState { allowances: Grant[]; @@ -10,7 +10,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisStateAmino { - allowances: GrantAmino[]; + allowances?: GrantAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -26,14 +26,15 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -69,16 +70,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; if (message.allowances) { obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); } else { - obj.allowances = []; + obj.allowances = message.allowances; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts index a640e7d2..5649a3eb 100644 --- a/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryAllowanceRequest, QueryAllowanceResponseSDKType, QueryAllowancesRequest, QueryAllowancesResponseSDKType, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts index 5432ae59..cef07797 100644 --- a/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -26,17 +26,17 @@ export class QueryClientImpl implements Query { allowance(request: QueryAllowanceRequest): Promise { const data = QueryAllowanceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowance", data); - return promise.then(data => QueryAllowanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllowanceResponse.decode(new BinaryReader(data))); } allowances(request: QueryAllowancesRequest): Promise { const data = QueryAllowancesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowances", data); - return promise.then(data => QueryAllowancesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllowancesResponse.decode(new BinaryReader(data))); } allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { const data = QueryAllowancesByGranterRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "AllowancesByGranter", data); - return promise.then(data => QueryAllowancesByGranterResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllowancesByGranterResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.ts b/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.ts index baae530a..b1e596fa 100644 --- a/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/feegrant/v1beta1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Grant, GrantAmino, GrantSDKType } from "./feegrant"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ export interface QueryAllowanceRequest { @@ -16,9 +16,9 @@ export interface QueryAllowanceRequestProtoMsg { /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ export interface QueryAllowanceRequestAmino { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter?: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee?: string; } export interface QueryAllowanceRequestAminoMsg { type: "cosmos-sdk/QueryAllowanceRequest"; @@ -32,7 +32,7 @@ export interface QueryAllowanceRequestSDKType { /** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ export interface QueryAllowanceResponse { /** allowance is a allowance granted for grantee by granter. */ - allowance: Grant; + allowance?: Grant; } export interface QueryAllowanceResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse"; @@ -49,13 +49,13 @@ export interface QueryAllowanceResponseAminoMsg { } /** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ export interface QueryAllowanceResponseSDKType { - allowance: GrantSDKType; + allowance?: GrantSDKType; } /** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ export interface QueryAllowancesRequest { grantee: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllowancesRequestProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest"; @@ -63,7 +63,7 @@ export interface QueryAllowancesRequestProtoMsg { } /** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ export interface QueryAllowancesRequestAmino { - grantee: string; + grantee?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -74,14 +74,14 @@ export interface QueryAllowancesRequestAminoMsg { /** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ export interface QueryAllowancesRequestSDKType { grantee: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ export interface QueryAllowancesResponse { /** allowances are allowance's granted for grantee by granter. */ allowances: Grant[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllowancesResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse"; @@ -90,7 +90,7 @@ export interface QueryAllowancesResponseProtoMsg { /** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ export interface QueryAllowancesResponseAmino { /** allowances are allowance's granted for grantee by granter. */ - allowances: GrantAmino[]; + allowances?: GrantAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -101,7 +101,7 @@ export interface QueryAllowancesResponseAminoMsg { /** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ export interface QueryAllowancesResponseSDKType { allowances: GrantSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. @@ -111,7 +111,7 @@ export interface QueryAllowancesResponseSDKType { export interface QueryAllowancesByGranterRequest { granter: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllowancesByGranterRequestProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest"; @@ -123,7 +123,7 @@ export interface QueryAllowancesByGranterRequestProtoMsg { * Since: cosmos-sdk 0.46 */ export interface QueryAllowancesByGranterRequestAmino { - granter: string; + granter?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -138,7 +138,7 @@ export interface QueryAllowancesByGranterRequestAminoMsg { */ export interface QueryAllowancesByGranterRequestSDKType { granter: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. @@ -149,7 +149,7 @@ export interface QueryAllowancesByGranterResponse { /** allowances that have been issued by the granter. */ allowances: Grant[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllowancesByGranterResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse"; @@ -162,7 +162,7 @@ export interface QueryAllowancesByGranterResponseProtoMsg { */ export interface QueryAllowancesByGranterResponseAmino { /** allowances that have been issued by the granter. */ - allowances: GrantAmino[]; + allowances?: GrantAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -177,7 +177,7 @@ export interface QueryAllowancesByGranterResponseAminoMsg { */ export interface QueryAllowancesByGranterResponseSDKType { allowances: GrantSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryAllowanceRequest(): QueryAllowanceRequest { return { @@ -186,7 +186,8 @@ function createBaseQueryAllowanceRequest(): QueryAllowanceRequest { }; } export const QueryAllowanceRequest = { - encode(message: QueryAllowanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest", + encode(message: QueryAllowanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -195,8 +196,8 @@ export const QueryAllowanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowanceRequest(); while (reader.pos < end) { @@ -234,15 +235,19 @@ export const QueryAllowanceRequest = { return message; }, fromAmino(object: QueryAllowanceRequestAmino): QueryAllowanceRequest { - return { - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseQueryAllowanceRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: QueryAllowanceRequest): QueryAllowanceRequestAmino { const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; return obj; }, fromAminoMsg(object: QueryAllowanceRequestAminoMsg): QueryAllowanceRequest { @@ -269,18 +274,19 @@ export const QueryAllowanceRequest = { }; function createBaseQueryAllowanceResponse(): QueryAllowanceResponse { return { - allowance: Grant.fromPartial({}) + allowance: undefined }; } export const QueryAllowanceResponse = { - encode(message: QueryAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse", + encode(message: QueryAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowance !== undefined) { Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowanceResponse(); while (reader.pos < end) { @@ -312,9 +318,11 @@ export const QueryAllowanceResponse = { return message; }, fromAmino(object: QueryAllowanceResponseAmino): QueryAllowanceResponse { - return { - allowance: object?.allowance ? Grant.fromAmino(object.allowance) : undefined - }; + const message = createBaseQueryAllowanceResponse(); + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Grant.fromAmino(object.allowance); + } + return message; }, toAmino(message: QueryAllowanceResponse): QueryAllowanceResponseAmino { const obj: any = {}; @@ -346,11 +354,12 @@ export const QueryAllowanceResponse = { function createBaseQueryAllowancesRequest(): QueryAllowancesRequest { return { grantee: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllowancesRequest = { - encode(message: QueryAllowancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest", + encode(message: QueryAllowancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } @@ -359,8 +368,8 @@ export const QueryAllowancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesRequest(); while (reader.pos < end) { @@ -398,14 +407,18 @@ export const QueryAllowancesRequest = { return message; }, fromAmino(object: QueryAllowancesRequestAmino): QueryAllowancesRequest { - return { - grantee: object.grantee, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowancesRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowancesRequest): QueryAllowancesRequestAmino { const obj: any = {}; - obj.grantee = message.grantee; + obj.grantee = message.grantee === "" ? undefined : message.grantee; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -434,11 +447,12 @@ export const QueryAllowancesRequest = { function createBaseQueryAllowancesResponse(): QueryAllowancesResponse { return { allowances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllowancesResponse = { - encode(message: QueryAllowancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse", + encode(message: QueryAllowancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -447,8 +461,8 @@ export const QueryAllowancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesResponse(); while (reader.pos < end) { @@ -490,17 +504,19 @@ export const QueryAllowancesResponse = { return message; }, fromAmino(object: QueryAllowancesResponseAmino): QueryAllowancesResponse { - return { - allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowancesResponse(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowancesResponse): QueryAllowancesResponseAmino { const obj: any = {}; if (message.allowances) { obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); } else { - obj.allowances = []; + obj.allowances = message.allowances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -530,11 +546,12 @@ export const QueryAllowancesResponse = { function createBaseQueryAllowancesByGranterRequest(): QueryAllowancesByGranterRequest { return { granter: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllowancesByGranterRequest = { - encode(message: QueryAllowancesByGranterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", + encode(message: QueryAllowancesByGranterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -543,8 +560,8 @@ export const QueryAllowancesByGranterRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesByGranterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesByGranterRequest(); while (reader.pos < end) { @@ -582,14 +599,18 @@ export const QueryAllowancesByGranterRequest = { return message; }, fromAmino(object: QueryAllowancesByGranterRequestAmino): QueryAllowancesByGranterRequest { - return { - granter: object.granter, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowancesByGranterRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowancesByGranterRequest): QueryAllowancesByGranterRequestAmino { const obj: any = {}; - obj.granter = message.granter; + obj.granter = message.granter === "" ? undefined : message.granter; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -618,11 +639,12 @@ export const QueryAllowancesByGranterRequest = { function createBaseQueryAllowancesByGranterResponse(): QueryAllowancesByGranterResponse { return { allowances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllowancesByGranterResponse = { - encode(message: QueryAllowancesByGranterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", + encode(message: QueryAllowancesByGranterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -631,8 +653,8 @@ export const QueryAllowancesByGranterResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesByGranterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesByGranterResponse(); while (reader.pos < end) { @@ -674,17 +696,19 @@ export const QueryAllowancesByGranterResponse = { return message; }, fromAmino(object: QueryAllowancesByGranterResponseAmino): QueryAllowancesByGranterResponse { - return { - allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowancesByGranterResponse(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowancesByGranterResponse): QueryAllowancesByGranterResponseAmino { const obj: any = {}; if (message.allowances) { obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); } else { - obj.allowances = []; + obj.allowances = message.allowances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; diff --git a/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts index 0430f9aa..34b65501 100644 --- a/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse } from "./tx"; /** Msg defines the feegrant msg service. */ export interface Msg { @@ -24,11 +24,11 @@ export class MsgClientImpl implements Msg { grantAllowance(request: MsgGrantAllowance): Promise { const data = MsgGrantAllowance.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "GrantAllowance", data); - return promise.then(data => MsgGrantAllowanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgGrantAllowanceResponse.decode(new BinaryReader(data))); } revokeAllowance(request: MsgRevokeAllowance): Promise { const data = MsgRevokeAllowance.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "RevokeAllowance", data); - return promise.then(data => MsgRevokeAllowanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRevokeAllowanceResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.ts index b359ab09..b298431a 100644 --- a/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/feegrant/v1beta1/tx.ts @@ -1,6 +1,6 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BasicAllowance, BasicAllowanceProtoMsg, BasicAllowanceSDKType, PeriodicAllowance, PeriodicAllowanceProtoMsg, PeriodicAllowanceSDKType, AllowedMsgAllowance, AllowedMsgAllowanceProtoMsg, AllowedMsgAllowanceSDKType } from "./feegrant"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * MsgGrantAllowance adds permission for Grantee to spend up to Allowance @@ -12,7 +12,7 @@ export interface MsgGrantAllowance { /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; /** allowance can be any of basic, periodic, allowed fee allowance. */ - allowance: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; + allowance?: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; } export interface MsgGrantAllowanceProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; @@ -27,9 +27,9 @@ export type MsgGrantAllowanceEncoded = Omit & { */ export interface MsgGrantAllowanceAmino { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter?: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee?: string; /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: AnyAmino; } @@ -44,7 +44,7 @@ export interface MsgGrantAllowanceAminoMsg { export interface MsgGrantAllowanceSDKType { granter: string; grantee: string; - allowance: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; } /** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ export interface MsgGrantAllowanceResponse {} @@ -74,9 +74,9 @@ export interface MsgRevokeAllowanceProtoMsg { /** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ export interface MsgRevokeAllowanceAmino { /** granter is the address of the user granting an allowance of their funds. */ - granter: string; + granter?: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee: string; + grantee?: string; } export interface MsgRevokeAllowanceAminoMsg { type: "cosmos-sdk/MsgRevokeAllowance"; @@ -109,7 +109,8 @@ function createBaseMsgGrantAllowance(): MsgGrantAllowance { }; } export const MsgGrantAllowance = { - encode(message: MsgGrantAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + encode(message: MsgGrantAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -121,8 +122,8 @@ export const MsgGrantAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrantAllowance(); while (reader.pos < end) { @@ -166,16 +167,22 @@ export const MsgGrantAllowance = { return message; }, fromAmino(object: MsgGrantAllowanceAmino): MsgGrantAllowance { - return { - granter: object.granter, - grantee: object.grantee, - allowance: object?.allowance ? FeeAllowanceI_FromAmino(object.allowance) : undefined - }; + const message = createBaseMsgGrantAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = FeeAllowanceI_FromAmino(object.allowance); + } + return message; }, toAmino(message: MsgGrantAllowance): MsgGrantAllowanceAmino { const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; obj.allowance = message.allowance ? FeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; return obj; }, @@ -205,11 +212,12 @@ function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { return {}; } export const MsgGrantAllowanceResponse = { - encode(_: MsgGrantAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + encode(_: MsgGrantAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrantAllowanceResponse(); while (reader.pos < end) { @@ -234,7 +242,8 @@ export const MsgGrantAllowanceResponse = { return message; }, fromAmino(_: MsgGrantAllowanceResponseAmino): MsgGrantAllowanceResponse { - return {}; + const message = createBaseMsgGrantAllowanceResponse(); + return message; }, toAmino(_: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAmino { const obj: any = {}; @@ -269,7 +278,8 @@ function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { }; } export const MsgRevokeAllowance = { - encode(message: MsgRevokeAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + encode(message: MsgRevokeAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -278,8 +288,8 @@ export const MsgRevokeAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevokeAllowance(); while (reader.pos < end) { @@ -317,15 +327,19 @@ export const MsgRevokeAllowance = { return message; }, fromAmino(object: MsgRevokeAllowanceAmino): MsgRevokeAllowance { - return { - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseMsgRevokeAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: MsgRevokeAllowance): MsgRevokeAllowanceAmino { const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; return obj; }, fromAminoMsg(object: MsgRevokeAllowanceAminoMsg): MsgRevokeAllowance { @@ -354,11 +368,12 @@ function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { return {}; } export const MsgRevokeAllowanceResponse = { - encode(_: MsgRevokeAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + encode(_: MsgRevokeAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevokeAllowanceResponse(); while (reader.pos < end) { @@ -383,7 +398,8 @@ export const MsgRevokeAllowanceResponse = { return message; }, fromAmino(_: MsgRevokeAllowanceResponseAmino): MsgRevokeAllowanceResponse { - return {}; + const message = createBaseMsgRevokeAllowanceResponse(); + return message; }, toAmino(_: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAmino { const obj: any = {}; @@ -411,8 +427,8 @@ export const MsgRevokeAllowanceResponse = { }; } }; -export const FeeAllowanceI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const FeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.feegrant.v1beta1.BasicAllowance": @@ -425,7 +441,7 @@ export const FeeAllowanceI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): return data; } }; -export const FeeAllowanceI_FromAmino = (content: AnyAmino) => { +export const FeeAllowanceI_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/BasicAllowance": return Any.fromPartial({ @@ -451,17 +467,17 @@ export const FeeAllowanceI_ToAmino = (content: Any) => { case "/cosmos.feegrant.v1beta1.BasicAllowance": return { type: "cosmos-sdk/BasicAllowance", - value: BasicAllowance.toAmino(BasicAllowance.decode(content.value)) + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined)) }; case "/cosmos.feegrant.v1beta1.PeriodicAllowance": return { type: "cosmos-sdk/PeriodicAllowance", - value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value)) + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined)) }; case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": return { type: "cosmos-sdk/AllowedMsgAllowance", - value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value)) + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/genutil/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/genutil/v1beta1/genesis.ts index d13217c7..348e2e75 100644 --- a/packages/api/src/codegen/cosmos/genutil/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/genutil/v1beta1/genesis.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** GenesisState defines the raw genesis transaction in JSON. */ export interface GenesisState { @@ -12,7 +12,7 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the raw genesis transaction in JSON. */ export interface GenesisStateAmino { /** gen_txs defines the genesis transactions. */ - gen_txs: Uint8Array[]; + gen_txs: string[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -28,14 +28,15 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.genutil.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.genTxs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -71,16 +72,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - genTxs: Array.isArray(object?.gen_txs) ? object.gen_txs.map((e: any) => e) : [] - }; + const message = createBaseGenesisState(); + message.genTxs = object.gen_txs?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; if (message.genTxs) { - obj.gen_txs = message.genTxs.map(e => e); + obj.gen_txs = message.genTxs.map(e => base64FromBytes(e)); } else { - obj.gen_txs = []; + obj.gen_txs = message.genTxs; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/gov/v1/genesis.ts b/packages/api/src/codegen/cosmos/gov/v1/genesis.ts index 751535d0..7b332ba5 100644 --- a/packages/api/src/codegen/cosmos/gov/v1/genesis.ts +++ b/packages/api/src/codegen/cosmos/gov/v1/genesis.ts @@ -1,10 +1,10 @@ import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType } from "./gov"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ - startingProposalId: Long; + startingProposalId: bigint; /** deposits defines all the deposits present at genesis. */ deposits: Deposit[]; /** votes defines all the votes present at genesis. */ @@ -12,11 +12,11 @@ export interface GenesisState { /** proposals defines all the proposals present at genesis. */ proposals: Proposal[]; /** params defines all the paramaters of related to deposit. */ - depositParams: DepositParams; + depositParams?: DepositParams; /** params defines all the paramaters of related to voting. */ - votingParams: VotingParams; + votingParams?: VotingParams; /** params defines all the paramaters of related to tally. */ - tallyParams: TallyParams; + tallyParams?: TallyParams; } export interface GenesisStateProtoMsg { typeUrl: "/cosmos.gov.v1.GenesisState"; @@ -25,13 +25,13 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateAmino { /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id: string; + starting_proposal_id?: string; /** deposits defines all the deposits present at genesis. */ - deposits: DepositAmino[]; + deposits?: DepositAmino[]; /** votes defines all the votes present at genesis. */ - votes: VoteAmino[]; + votes?: VoteAmino[]; /** proposals defines all the proposals present at genesis. */ - proposals: ProposalAmino[]; + proposals?: ProposalAmino[]; /** params defines all the paramaters of related to deposit. */ deposit_params?: DepositParamsAmino; /** params defines all the paramaters of related to voting. */ @@ -45,28 +45,29 @@ export interface GenesisStateAminoMsg { } /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateSDKType { - starting_proposal_id: Long; + starting_proposal_id: bigint; deposits: DepositSDKType[]; votes: VoteSDKType[]; proposals: ProposalSDKType[]; - deposit_params: DepositParamsSDKType; - voting_params: VotingParamsSDKType; - tally_params: TallyParamsSDKType; + deposit_params?: DepositParamsSDKType; + voting_params?: VotingParamsSDKType; + tally_params?: TallyParamsSDKType; } function createBaseGenesisState(): GenesisState { return { - startingProposalId: Long.UZERO, + startingProposalId: BigInt(0), deposits: [], votes: [], proposals: [], - depositParams: DepositParams.fromPartial({}), - votingParams: VotingParams.fromPartial({}), - tallyParams: TallyParams.fromPartial({}) + depositParams: undefined, + votingParams: undefined, + tallyParams: undefined }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.startingProposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startingProposalId !== BigInt(0)) { writer.uint32(8).uint64(message.startingProposalId); } for (const v of message.deposits) { @@ -89,15 +90,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startingProposalId = (reader.uint64() as Long); + message.startingProposalId = reader.uint64(); break; case 2: message.deposits.push(Deposit.decode(reader, reader.uint32())); @@ -126,7 +127,7 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { return { - startingProposalId: isSet(object.startingProposalId) ? Long.fromValue(object.startingProposalId) : Long.UZERO, + startingProposalId: isSet(object.startingProposalId) ? BigInt(object.startingProposalId.toString()) : BigInt(0), deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], @@ -137,7 +138,7 @@ export const GenesisState = { }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.startingProposalId !== undefined && (obj.startingProposalId = (message.startingProposalId || Long.UZERO).toString()); + message.startingProposalId !== undefined && (obj.startingProposalId = (message.startingProposalId || BigInt(0)).toString()); if (message.deposits) { obj.deposits = message.deposits.map(e => e ? Deposit.toJSON(e) : undefined); } else { @@ -160,7 +161,7 @@ export const GenesisState = { }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); - message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? Long.fromValue(object.startingProposalId) : Long.UZERO; + message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? BigInt(object.startingProposalId.toString()) : BigInt(0); message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; @@ -170,33 +171,41 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - startingProposalId: Long.fromString(object.starting_proposal_id), - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseGenesisState(); + if (object.starting_proposal_id !== undefined && object.starting_proposal_id !== null) { + message.startingProposalId = BigInt(object.starting_proposal_id); + } + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.starting_proposal_id = message.startingProposalId ? message.startingProposalId.toString() : undefined; + obj.starting_proposal_id = message.startingProposalId !== BigInt(0) ? message.startingProposalId.toString() : undefined; if (message.deposits) { obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); } else { - obj.deposits = []; + obj.deposits = message.deposits; } if (message.votes) { obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } if (message.proposals) { obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); } else { - obj.proposals = []; + obj.proposals = message.proposals; } obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; diff --git a/packages/api/src/codegen/cosmos/gov/v1/gov.ts b/packages/api/src/codegen/cosmos/gov/v1/gov.ts index 97960b17..9f05b531 100644 --- a/packages/api/src/codegen/cosmos/gov/v1/gov.ts +++ b/packages/api/src/codegen/cosmos/gov/v1/gov.ts @@ -1,9 +1,9 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** VoteOption enumerates the valid vote options for a given governance proposal. */ export enum VoteOption { /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ @@ -149,8 +149,8 @@ export interface WeightedVoteOptionProtoMsg { } /** WeightedVoteOption defines a unit of vote for vote split. */ export interface WeightedVoteOptionAmino { - option: VoteOption; - weight: string; + option?: VoteOption; + weight?: string; } export interface WeightedVoteOptionAminoMsg { type: "cosmos-sdk/v1/WeightedVoteOption"; @@ -166,7 +166,7 @@ export interface WeightedVoteOptionSDKType { * proposal. */ export interface Deposit { - proposalId: Long; + proposalId: bigint; depositor: string; amount: Coin[]; } @@ -179,9 +179,9 @@ export interface DepositProtoMsg { * proposal. */ export interface DepositAmino { - proposal_id: string; - depositor: string; - amount: CoinAmino[]; + proposal_id?: string; + depositor?: string; + amount?: CoinAmino[]; } export interface DepositAminoMsg { type: "cosmos-sdk/v1/Deposit"; @@ -192,13 +192,13 @@ export interface DepositAminoMsg { * proposal. */ export interface DepositSDKType { - proposal_id: Long; + proposal_id: bigint; depositor: string; amount: CoinSDKType[]; } /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { - id: Long; + id: bigint; messages: Any[]; status: ProposalStatus; /** @@ -206,12 +206,12 @@ export interface Proposal { * querying a proposal via gRPC, this field is not populated until the * proposal's voting period has ended. */ - finalTallyResult: TallyResult; - submitTime: Timestamp; - depositEndTime: Timestamp; + finalTallyResult?: TallyResult; + submitTime?: Timestamp; + depositEndTime?: Timestamp; totalDeposit: Coin[]; - votingStartTime: Timestamp; - votingEndTime: Timestamp; + votingStartTime?: Timestamp; + votingEndTime?: Timestamp; /** metadata is any arbitrary metadata attached to the proposal. */ metadata: string; } @@ -221,22 +221,22 @@ export interface ProposalProtoMsg { } /** Proposal defines the core field members of a governance proposal. */ export interface ProposalAmino { - id: string; - messages: AnyAmino[]; - status: ProposalStatus; + id?: string; + messages?: AnyAmino[]; + status?: ProposalStatus; /** * final_tally_result is the final tally result of the proposal. When * querying a proposal via gRPC, this field is not populated until the * proposal's voting period has ended. */ final_tally_result?: TallyResultAmino; - submit_time?: TimestampAmino; - deposit_end_time?: TimestampAmino; - total_deposit: CoinAmino[]; - voting_start_time?: TimestampAmino; - voting_end_time?: TimestampAmino; + submit_time?: string; + deposit_end_time?: string; + total_deposit?: CoinAmino[]; + voting_start_time?: string; + voting_end_time?: string; /** metadata is any arbitrary metadata attached to the proposal. */ - metadata: string; + metadata?: string; } export interface ProposalAminoMsg { type: "cosmos-sdk/v1/Proposal"; @@ -244,15 +244,15 @@ export interface ProposalAminoMsg { } /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { - id: Long; + id: bigint; messages: AnySDKType[]; status: ProposalStatus; - final_tally_result: TallyResultSDKType; - submit_time: TimestampSDKType; - deposit_end_time: TimestampSDKType; + final_tally_result?: TallyResultSDKType; + submit_time?: TimestampSDKType; + deposit_end_time?: TimestampSDKType; total_deposit: CoinSDKType[]; - voting_start_time: TimestampSDKType; - voting_end_time: TimestampSDKType; + voting_start_time?: TimestampSDKType; + voting_end_time?: TimestampSDKType; metadata: string; } /** TallyResult defines a standard tally for a governance proposal. */ @@ -268,10 +268,10 @@ export interface TallyResultProtoMsg { } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResultAmino { - yes_count: string; - abstain_count: string; - no_count: string; - no_with_veto_count: string; + yes_count?: string; + abstain_count?: string; + no_count?: string; + no_with_veto_count?: string; } export interface TallyResultAminoMsg { type: "cosmos-sdk/v1/TallyResult"; @@ -289,7 +289,7 @@ export interface TallyResultSDKType { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface Vote { - proposalId: Long; + proposalId: bigint; voter: string; options: WeightedVoteOption[]; /** metadata is any arbitrary metadata to attached to the vote. */ @@ -304,11 +304,11 @@ export interface VoteProtoMsg { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface VoteAmino { - proposal_id: string; - voter: string; - options: WeightedVoteOptionAmino[]; + proposal_id?: string; + voter?: string; + options?: WeightedVoteOptionAmino[]; /** metadata is any arbitrary metadata to attached to the vote. */ - metadata: string; + metadata?: string; } export interface VoteAminoMsg { type: "cosmos-sdk/v1/Vote"; @@ -319,7 +319,7 @@ export interface VoteAminoMsg { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface VoteSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; options: WeightedVoteOptionSDKType[]; metadata: string; @@ -332,7 +332,7 @@ export interface DepositParams { * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 * months. */ - maxDepositPeriod: Duration; + maxDepositPeriod?: Duration; } export interface DepositParamsProtoMsg { typeUrl: "/cosmos.gov.v1.DepositParams"; @@ -341,7 +341,7 @@ export interface DepositParamsProtoMsg { /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsAmino { /** Minimum deposit for a proposal to enter voting period. */ - min_deposit: CoinAmino[]; + min_deposit?: CoinAmino[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 * months. @@ -355,12 +355,12 @@ export interface DepositParamsAminoMsg { /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsSDKType { min_deposit: CoinSDKType[]; - max_deposit_period: DurationSDKType; + max_deposit_period?: DurationSDKType; } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParams { /** Length of the voting period. */ - votingPeriod: Duration; + votingPeriod?: Duration; } export interface VotingParamsProtoMsg { typeUrl: "/cosmos.gov.v1.VotingParams"; @@ -377,7 +377,7 @@ export interface VotingParamsAminoMsg { } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsSDKType { - voting_period: DurationSDKType; + voting_period?: DurationSDKType; } /** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParams { @@ -404,14 +404,14 @@ export interface TallyParamsAmino { * Minimum percentage of total stake needed to vote for a result to be * considered valid. */ - quorum: string; + quorum?: string; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold: string; + threshold?: string; /** * Minimum value of Veto votes to Total votes ratio for proposal to be * vetoed. Default value: 1/3. */ - veto_threshold: string; + veto_threshold?: string; } export interface TallyParamsAminoMsg { type: "cosmos-sdk/v1/TallyParams"; @@ -430,7 +430,8 @@ function createBaseWeightedVoteOption(): WeightedVoteOption { }; } export const WeightedVoteOption = { - encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption", + encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.option !== 0) { writer.uint32(8).int32(message.option); } @@ -439,8 +440,8 @@ export const WeightedVoteOption = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseWeightedVoteOption(); while (reader.pos < end) { @@ -461,7 +462,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -478,15 +479,19 @@ export const WeightedVoteOption = { return message; }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { - return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - weight: object.weight - }; + const message = createBaseWeightedVoteOption(); + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { const obj: any = {}; - obj.option = message.option; - obj.weight = message.weight; + obj.option = message.option === 0 ? undefined : message.option; + obj.weight = message.weight === "" ? undefined : message.weight; return obj; }, fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { @@ -513,14 +518,15 @@ export const WeightedVoteOption = { }; function createBaseDeposit(): Deposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [] }; } export const Deposit = { - encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.Deposit", + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -531,15 +537,15 @@ export const Deposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -556,14 +562,14 @@ export const Deposit = { }, fromJSON(object: any): Deposit { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), depositor: isSet(object.depositor) ? String(object.depositor) : "", amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: Deposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); @@ -574,26 +580,30 @@ export const Deposit = { }, fromPartial(object: Partial): Deposit { const message = createBaseDeposit(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.depositor = object.depositor ?? ""; message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: DepositAmino): Deposit { - return { - proposalId: Long.fromString(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Deposit): DepositAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.depositor = message.depositor; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -621,10 +631,10 @@ export const Deposit = { }; function createBaseProposal(): Proposal { return { - id: Long.UZERO, + id: BigInt(0), messages: [], status: 0, - finalTallyResult: TallyResult.fromPartial({}), + finalTallyResult: undefined, submitTime: undefined, depositEndTime: undefined, totalDeposit: [], @@ -634,8 +644,9 @@ function createBaseProposal(): Proposal { }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/cosmos.gov.v1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } for (const v of message.messages) { @@ -667,15 +678,15 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.messages.push(Any.decode(reader, reader.uint32())); @@ -713,9 +724,9 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? fromJsonTimestamp(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? fromJsonTimestamp(object.depositEndTime) : undefined, @@ -727,7 +738,7 @@ export const Proposal = { }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toJSON(e) : undefined); } else { @@ -749,7 +760,7 @@ export const Proposal = { }, fromPartial(object: Partial): Proposal { const message = createBaseProposal(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; message.status = object.status ?? 0; message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; @@ -762,39 +773,55 @@ export const Proposal = { return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - id: Long.fromString(object.id), - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, - depositEndTime: object?.deposit_end_time ? Timestamp.fromAmino(object.deposit_end_time) : undefined, - totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time ? Timestamp.fromAmino(object.voting_start_time) : undefined, - votingEndTime: object?.voting_end_time ? Timestamp.fromAmino(object.voting_end_time) : undefined, - metadata: object.metadata - }; + const message = createBaseProposal(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = Timestamp.fromAmino(object.submit_time); + } + if (object.deposit_end_time !== undefined && object.deposit_end_time !== null) { + message.depositEndTime = Timestamp.fromAmino(object.deposit_end_time); + } + message.totalDeposit = object.total_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.voting_start_time !== undefined && object.voting_start_time !== null) { + message.votingStartTime = Timestamp.fromAmino(object.voting_start_time); + } + if (object.voting_end_time !== undefined && object.voting_end_time !== null) { + message.votingEndTime = Timestamp.fromAmino(object.voting_end_time); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.messages = []; + obj.messages = message.messages; } - obj.status = message.status; + obj.status = message.status === 0 ? undefined : message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(message.depositEndTime) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.total_deposit = []; + obj.total_deposit = message.totalDeposit; } obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(message.votingStartTime) : undefined; obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(message.votingEndTime) : undefined; - obj.metadata = message.metadata; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -828,7 +855,8 @@ function createBaseTallyResult(): TallyResult { }; } export const TallyResult = { - encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.yesCount !== "") { writer.uint32(10).string(message.yesCount); } @@ -843,8 +871,8 @@ export const TallyResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyResult(); while (reader.pos < end) { @@ -894,19 +922,27 @@ export const TallyResult = { return message; }, fromAmino(object: TallyResultAmino): TallyResult { - return { - yesCount: object.yes_count, - abstainCount: object.abstain_count, - noCount: object.no_count, - noWithVetoCount: object.no_with_veto_count - }; + const message = createBaseTallyResult(); + if (object.yes_count !== undefined && object.yes_count !== null) { + message.yesCount = object.yes_count; + } + if (object.abstain_count !== undefined && object.abstain_count !== null) { + message.abstainCount = object.abstain_count; + } + if (object.no_count !== undefined && object.no_count !== null) { + message.noCount = object.no_count; + } + if (object.no_with_veto_count !== undefined && object.no_with_veto_count !== null) { + message.noWithVetoCount = object.no_with_veto_count; + } + return message; }, toAmino(message: TallyResult): TallyResultAmino { const obj: any = {}; - obj.yes_count = message.yesCount; - obj.abstain_count = message.abstainCount; - obj.no_count = message.noCount; - obj.no_with_veto_count = message.noWithVetoCount; + obj.yes_count = message.yesCount === "" ? undefined : message.yesCount; + obj.abstain_count = message.abstainCount === "" ? undefined : message.abstainCount; + obj.no_count = message.noCount === "" ? undefined : message.noCount; + obj.no_with_veto_count = message.noWithVetoCount === "" ? undefined : message.noWithVetoCount; return obj; }, fromAminoMsg(object: TallyResultAminoMsg): TallyResult { @@ -933,15 +969,16 @@ export const TallyResult = { }; function createBaseVote(): Vote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", options: [], metadata: "" }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -955,15 +992,15 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -983,7 +1020,7 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "" @@ -991,7 +1028,7 @@ export const Vote = { }, toJSON(message: Vote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toJSON(e) : undefined); @@ -1003,30 +1040,36 @@ export const Vote = { }, fromPartial(object: Partial): Vote { const message = createBaseVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; message.metadata = object.metadata ?? ""; return message; }, fromAmino(object: VoteAmino): Vote { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [], - metadata: object.metadata - }; + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); } else { - obj.options = []; + obj.options = message.options; } - obj.metadata = message.metadata; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { @@ -1058,7 +1101,8 @@ function createBaseDepositParams(): DepositParams { }; } export const DepositParams = { - encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.DepositParams", + encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.minDeposit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1067,8 +1111,8 @@ export const DepositParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDepositParams(); while (reader.pos < end) { @@ -1110,17 +1154,19 @@ export const DepositParams = { return message; }, fromAmino(object: DepositParamsAmino): DepositParams { - return { - minDeposit: Array.isArray(object?.min_deposit) ? object.min_deposit.map((e: any) => Coin.fromAmino(e)) : [], - maxDepositPeriod: object?.max_deposit_period ? Duration.fromAmino(object.max_deposit_period) : undefined - }; + const message = createBaseDepositParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + return message; }, toAmino(message: DepositParams): DepositParamsAmino { const obj: any = {}; if (message.minDeposit) { obj.min_deposit = message.minDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.min_deposit = []; + obj.min_deposit = message.minDeposit; } obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; return obj; @@ -1153,14 +1199,15 @@ function createBaseVotingParams(): VotingParams { }; } export const VotingParams = { - encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.VotingParams", + encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVotingParams(); while (reader.pos < end) { @@ -1192,9 +1239,11 @@ export const VotingParams = { return message; }, fromAmino(object: VotingParamsAmino): VotingParams { - return { - votingPeriod: object?.voting_period ? Duration.fromAmino(object.voting_period) : undefined - }; + const message = createBaseVotingParams(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + return message; }, toAmino(message: VotingParams): VotingParamsAmino { const obj: any = {}; @@ -1231,7 +1280,8 @@ function createBaseTallyParams(): TallyParams { }; } export const TallyParams = { - encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.TallyParams", + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.quorum !== "") { writer.uint32(10).string(message.quorum); } @@ -1243,8 +1293,8 @@ export const TallyParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyParams(); while (reader.pos < end) { @@ -1288,17 +1338,23 @@ export const TallyParams = { return message; }, fromAmino(object: TallyParamsAmino): TallyParams { - return { - quorum: object.quorum, - threshold: object.threshold, - vetoThreshold: object.veto_threshold - }; + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = object.quorum; + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = object.veto_threshold; + } + return message; }, toAmino(message: TallyParams): TallyParamsAmino { const obj: any = {}; - obj.quorum = message.quorum; - obj.threshold = message.threshold; - obj.veto_threshold = message.vetoThreshold; + obj.quorum = message.quorum === "" ? undefined : message.quorum; + obj.threshold = message.threshold === "" ? undefined : message.threshold; + obj.veto_threshold = message.vetoThreshold === "" ? undefined : message.vetoThreshold; return obj; }, fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { diff --git a/packages/api/src/codegen/cosmos/gov/v1/query.lcd.ts b/packages/api/src/codegen/cosmos/gov/v1/query.lcd.ts index f9486709..5dafe478 100644 --- a/packages/api/src/codegen/cosmos/gov/v1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/gov/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryProposalRequest, QueryProposalResponseSDKType, QueryProposalsRequest, QueryProposalsResponseSDKType, QueryVoteRequest, QueryVoteResponseSDKType, QueryVotesRequest, QueryVotesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDepositRequest, QueryDepositResponseSDKType, QueryDepositsRequest, QueryDepositsResponseSDKType, QueryTallyResultRequest, QueryTallyResultResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/gov/v1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/gov/v1/query.rpc.Query.ts index 9e8eddd0..c4ff3fee 100644 --- a/packages/api/src/codegen/cosmos/gov/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/gov/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; /** Query defines the gRPC querier service for gov module */ @@ -37,42 +37,42 @@ export class QueryClientImpl implements Query { proposal(request: QueryProposalRequest): Promise { const data = QueryProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposal", data); - return promise.then(data => QueryProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); } proposals(request: QueryProposalsRequest): Promise { const data = QueryProposalsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposals", data); - return promise.then(data => QueryProposalsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProposalsResponse.decode(new BinaryReader(data))); } vote(request: QueryVoteRequest): Promise { const data = QueryVoteRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Vote", data); - return promise.then(data => QueryVoteResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryVoteResponse.decode(new BinaryReader(data))); } votes(request: QueryVotesRequest): Promise { const data = QueryVotesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Votes", data); - return promise.then(data => QueryVotesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryVotesResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } deposit(request: QueryDepositRequest): Promise { const data = QueryDepositRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposit", data); - return promise.then(data => QueryDepositResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDepositResponse.decode(new BinaryReader(data))); } deposits(request: QueryDepositsRequest): Promise { const data = QueryDepositsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposits", data); - return promise.then(data => QueryDepositsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDepositsResponse.decode(new BinaryReader(data))); } tallyResult(request: QueryTallyResultRequest): Promise { const data = QueryTallyResultRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "TallyResult", data); - return promise.then(data => QueryTallyResultResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/gov/v1/query.ts b/packages/api/src/codegen/cosmos/gov/v1/query.ts index 08b3e468..6cd02f09 100644 --- a/packages/api/src/codegen/cosmos/gov/v1/query.ts +++ b/packages/api/src/codegen/cosmos/gov/v1/query.ts @@ -1,11 +1,11 @@ import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON, proposalStatusToJSON } from "./gov"; import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } export interface QueryProposalRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalRequest"; @@ -14,7 +14,7 @@ export interface QueryProposalRequestProtoMsg { /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryProposalRequestAminoMsg { type: "cosmos-sdk/v1/QueryProposalRequest"; @@ -22,11 +22,11 @@ export interface QueryProposalRequestAminoMsg { } /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestSDKType { - proposal_id: Long; + proposal_id: bigint; } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponse { - proposal: Proposal; + proposal?: Proposal; } export interface QueryProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalResponse"; @@ -42,7 +42,7 @@ export interface QueryProposalResponseAminoMsg { } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponseSDKType { - proposal: ProposalSDKType; + proposal?: ProposalSDKType; } /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequest { @@ -53,7 +53,7 @@ export interface QueryProposalsRequest { /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProposalsRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalsRequest"; @@ -62,11 +62,11 @@ export interface QueryProposalsRequestProtoMsg { /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestAmino { /** proposal_status defines the status of the proposals. */ - proposal_status: ProposalStatus; + proposal_status?: ProposalStatus; /** voter defines the voter address for the proposals. */ - voter: string; + voter?: string; /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -79,7 +79,7 @@ export interface QueryProposalsRequestSDKType { proposal_status: ProposalStatus; voter: string; depositor: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryProposalsResponse is the response type for the Query/Proposals RPC @@ -88,7 +88,7 @@ export interface QueryProposalsRequestSDKType { export interface QueryProposalsResponse { proposals: Proposal[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProposalsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryProposalsResponse"; @@ -99,7 +99,7 @@ export interface QueryProposalsResponseProtoMsg { * method. */ export interface QueryProposalsResponseAmino { - proposals: ProposalAmino[]; + proposals?: ProposalAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -113,12 +113,12 @@ export interface QueryProposalsResponseAminoMsg { */ export interface QueryProposalsResponseSDKType { proposals: ProposalSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter defines the voter address for the proposals. */ voter: string; } @@ -129,9 +129,9 @@ export interface QueryVoteRequestProtoMsg { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** voter defines the voter address for the proposals. */ - voter: string; + voter?: string; } export interface QueryVoteRequestAminoMsg { type: "cosmos-sdk/v1/QueryVoteRequest"; @@ -139,13 +139,13 @@ export interface QueryVoteRequestAminoMsg { } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponse { /** vote defined the queried vote. */ - vote: Vote; + vote?: Vote; } export interface QueryVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryVoteResponse"; @@ -162,14 +162,14 @@ export interface QueryVoteResponseAminoMsg { } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseSDKType { - vote: VoteSDKType; + vote?: VoteSDKType; } /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryVotesRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryVotesRequest"; @@ -178,7 +178,7 @@ export interface QueryVotesRequestProtoMsg { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -188,15 +188,15 @@ export interface QueryVotesRequestAminoMsg { } /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { - proposal_id: Long; - pagination: PageRequestSDKType; + proposal_id: bigint; + pagination?: PageRequestSDKType; } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponse { /** votes defined the queried votes. */ votes: Vote[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryVotesResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryVotesResponse"; @@ -205,7 +205,7 @@ export interface QueryVotesResponseProtoMsg { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseAmino { /** votes defined the queried votes. */ - votes: VoteAmino[]; + votes?: VoteAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -216,7 +216,7 @@ export interface QueryVotesResponseAminoMsg { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { votes: VoteSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest { @@ -236,7 +236,7 @@ export interface QueryParamsRequestAmino { * params_type defines which parameters to query for, can be one of "voting", * "tallying" or "deposit". */ - params_type: string; + params_type?: string; } export interface QueryParamsRequestAminoMsg { type: "cosmos-sdk/v1/QueryParamsRequest"; @@ -249,11 +249,11 @@ export interface QueryParamsRequestSDKType { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** voting_params defines the parameters related to voting. */ - votingParams: VotingParams; + votingParams?: VotingParams; /** deposit_params defines the parameters related to deposit. */ - depositParams: DepositParams; + depositParams?: DepositParams; /** tally_params defines the parameters related to tally. */ - tallyParams: TallyParams; + tallyParams?: TallyParams; } export interface QueryParamsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryParamsResponse"; @@ -274,14 +274,14 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - voting_params: VotingParamsSDKType; - deposit_params: DepositParamsSDKType; - tally_params: TallyParamsSDKType; + voting_params?: VotingParamsSDKType; + deposit_params?: DepositParamsSDKType; + tally_params?: TallyParamsSDKType; } /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; } @@ -292,9 +292,9 @@ export interface QueryDepositRequestProtoMsg { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor?: string; } export interface QueryDepositRequestAminoMsg { type: "cosmos-sdk/v1/QueryDepositRequest"; @@ -302,13 +302,13 @@ export interface QueryDepositRequestAminoMsg { } /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestSDKType { - proposal_id: Long; + proposal_id: bigint; depositor: string; } /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponse { /** deposit defines the requested deposit. */ - deposit: Deposit; + deposit?: Deposit; } export interface QueryDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryDepositResponse"; @@ -325,14 +325,14 @@ export interface QueryDepositResponseAminoMsg { } /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseSDKType { - deposit: DepositSDKType; + deposit?: DepositSDKType; } /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDepositsRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryDepositsRequest"; @@ -341,7 +341,7 @@ export interface QueryDepositsRequestProtoMsg { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -351,14 +351,14 @@ export interface QueryDepositsRequestAminoMsg { } /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { - proposal_id: Long; - pagination: PageRequestSDKType; + proposal_id: bigint; + pagination?: PageRequestSDKType; } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponse { deposits: Deposit[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDepositsResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryDepositsResponse"; @@ -366,7 +366,7 @@ export interface QueryDepositsResponseProtoMsg { } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseAmino { - deposits: DepositAmino[]; + deposits?: DepositAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -377,12 +377,12 @@ export interface QueryDepositsResponseAminoMsg { /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } export interface QueryTallyResultRequestProtoMsg { typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest"; @@ -391,7 +391,7 @@ export interface QueryTallyResultRequestProtoMsg { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryTallyResultRequestAminoMsg { type: "cosmos-sdk/v1/QueryTallyResultRequest"; @@ -399,12 +399,12 @@ export interface QueryTallyResultRequestAminoMsg { } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestSDKType { - proposal_id: Long; + proposal_id: bigint; } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponse { /** tally defines the requested tally. */ - tally: TallyResult; + tally?: TallyResult; } export interface QueryTallyResultResponseProtoMsg { typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse"; @@ -421,29 +421,30 @@ export interface QueryTallyResultResponseAminoMsg { } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseSDKType { - tally: TallyResultSDKType; + tally?: TallyResultSDKType; } function createBaseQueryProposalRequest(): QueryProposalRequest { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const QueryProposalRequest = { - encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -454,27 +455,29 @@ export const QueryProposalRequest = { }, fromJSON(object: any): QueryProposalRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: QueryProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryProposalRequest { const message = createBaseQueryProposalRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { @@ -501,18 +504,19 @@ export const QueryProposalRequest = { }; function createBaseQueryProposalResponse(): QueryProposalResponse { return { - proposal: Proposal.fromPartial({}) + proposal: undefined }; } export const QueryProposalResponse = { - encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalResponse(); while (reader.pos < end) { @@ -544,9 +548,11 @@ export const QueryProposalResponse = { return message; }, fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - return { - proposal: object?.proposal ? Proposal.fromAmino(object.proposal) : undefined - }; + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; }, toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { const obj: any = {}; @@ -580,11 +586,12 @@ function createBaseQueryProposalsRequest(): QueryProposalsRequest { proposalStatus: 0, voter: "", depositor: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProposalsRequest = { - encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryProposalsRequest", + encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalStatus !== 0) { writer.uint32(8).int32(message.proposalStatus); } @@ -599,8 +606,8 @@ export const QueryProposalsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsRequest(); while (reader.pos < end) { @@ -627,7 +634,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -650,18 +657,26 @@ export const QueryProposalsRequest = { return message; }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { - return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, - voter: object.voter, - depositor: object.depositor, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsRequest(); + if (object.proposal_status !== undefined && object.proposal_status !== null) { + message.proposalStatus = object.proposal_status; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { const obj: any = {}; - obj.proposal_status = message.proposalStatus; - obj.voter = message.voter; - obj.depositor = message.depositor; + obj.proposal_status = message.proposalStatus === 0 ? undefined : message.proposalStatus; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.depositor = message.depositor === "" ? undefined : message.depositor; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -690,11 +705,12 @@ export const QueryProposalsRequest = { function createBaseQueryProposalsResponse(): QueryProposalsResponse { return { proposals: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProposalsResponse = { - encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryProposalsResponse", + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -703,8 +719,8 @@ export const QueryProposalsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsResponse(); while (reader.pos < end) { @@ -746,17 +762,19 @@ export const QueryProposalsResponse = { return message; }, fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { - return { - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { const obj: any = {}; if (message.proposals) { obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); } else { - obj.proposals = []; + obj.proposals = message.proposals; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -785,13 +803,14 @@ export const QueryProposalsResponse = { }; function createBaseQueryVoteRequest(): QueryVoteRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "" }; } export const QueryVoteRequest = { - encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.QueryVoteRequest", + encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -799,15 +818,15 @@ export const QueryVoteRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -821,32 +840,36 @@ export const QueryVoteRequest = { }, fromJSON(object: any): QueryVoteRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "" }; }, toJSON(message: QueryVoteRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); return obj; }, fromPartial(object: Partial): QueryVoteRequest { const message = createBaseQueryVoteRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; return message; }, fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter - }; + const message = createBaseQueryVoteRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; }, toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; return obj; }, fromAminoMsg(object: QueryVoteRequestAminoMsg): QueryVoteRequest { @@ -873,18 +896,19 @@ export const QueryVoteRequest = { }; function createBaseQueryVoteResponse(): QueryVoteResponse { return { - vote: Vote.fromPartial({}) + vote: undefined }; } export const QueryVoteResponse = { - encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryVoteResponse", + encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteResponse(); while (reader.pos < end) { @@ -916,9 +940,11 @@ export const QueryVoteResponse = { return message; }, fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { - return { - vote: object?.vote ? Vote.fromAmino(object.vote) : undefined - }; + const message = createBaseQueryVoteResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; }, toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { const obj: any = {}; @@ -949,13 +975,14 @@ export const QueryVoteResponse = { }; function createBaseQueryVotesRequest(): QueryVotesRequest { return { - proposalId: Long.UZERO, - pagination: PageRequest.fromPartial({}) + proposalId: BigInt(0), + pagination: undefined }; } export const QueryVotesRequest = { - encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.QueryVotesRequest", + encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -963,15 +990,15 @@ export const QueryVotesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -985,31 +1012,35 @@ export const QueryVotesRequest = { }, fromJSON(object: any): QueryVotesRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryVotesRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryVotesRequest { const message = createBaseQueryVotesRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { - return { - proposalId: Long.fromString(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1038,11 +1069,12 @@ export const QueryVotesRequest = { function createBaseQueryVotesResponse(): QueryVotesResponse { return { votes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryVotesResponse = { - encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryVotesResponse", + encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1051,8 +1083,8 @@ export const QueryVotesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesResponse(); while (reader.pos < end) { @@ -1094,17 +1126,19 @@ export const QueryVotesResponse = { return message; }, fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { - return { - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { const obj: any = {}; if (message.votes) { obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1137,14 +1171,15 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { }; } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryParamsRequest", + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.paramsType !== "") { writer.uint32(10).string(message.paramsType); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -1176,13 +1211,15 @@ export const QueryParamsRequest = { return message; }, fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - return { - paramsType: object.params_type - }; + const message = createBaseQueryParamsRequest(); + if (object.params_type !== undefined && object.params_type !== null) { + message.paramsType = object.params_type; + } + return message; }, toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; - obj.params_type = message.paramsType; + obj.params_type = message.paramsType === "" ? undefined : message.paramsType; return obj; }, fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { @@ -1209,13 +1246,14 @@ export const QueryParamsRequest = { }; function createBaseQueryParamsResponse(): QueryParamsResponse { return { - votingParams: VotingParams.fromPartial({}), - depositParams: DepositParams.fromPartial({}), - tallyParams: TallyParams.fromPartial({}) + votingParams: undefined, + depositParams: undefined, + tallyParams: undefined }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingParams !== undefined) { VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); } @@ -1227,8 +1265,8 @@ export const QueryParamsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -1272,11 +1310,17 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -1309,13 +1353,14 @@ export const QueryParamsResponse = { }; function createBaseQueryDepositRequest(): QueryDepositRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "" }; } export const QueryDepositRequest = { - encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.QueryDepositRequest", + encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -1323,15 +1368,15 @@ export const QueryDepositRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -1345,32 +1390,36 @@ export const QueryDepositRequest = { }, fromJSON(object: any): QueryDepositRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), depositor: isSet(object.depositor) ? String(object.depositor) : "" }; }, toJSON(message: QueryDepositRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); return obj; }, fromPartial(object: Partial): QueryDepositRequest { const message = createBaseQueryDepositRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.depositor = object.depositor ?? ""; return message; }, fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { - return { - proposalId: Long.fromString(object.proposal_id), - depositor: object.depositor - }; + const message = createBaseQueryDepositRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; }, toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.depositor = message.depositor; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; return obj; }, fromAminoMsg(object: QueryDepositRequestAminoMsg): QueryDepositRequest { @@ -1397,18 +1446,19 @@ export const QueryDepositRequest = { }; function createBaseQueryDepositResponse(): QueryDepositResponse { return { - deposit: Deposit.fromPartial({}) + deposit: undefined }; } export const QueryDepositResponse = { - encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryDepositResponse", + encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deposit !== undefined) { Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositResponse(); while (reader.pos < end) { @@ -1440,9 +1490,11 @@ export const QueryDepositResponse = { return message; }, fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { - return { - deposit: object?.deposit ? Deposit.fromAmino(object.deposit) : undefined - }; + const message = createBaseQueryDepositResponse(); + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; }, toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { const obj: any = {}; @@ -1473,13 +1525,14 @@ export const QueryDepositResponse = { }; function createBaseQueryDepositsRequest(): QueryDepositsRequest { return { - proposalId: Long.UZERO, - pagination: PageRequest.fromPartial({}) + proposalId: BigInt(0), + pagination: undefined }; } export const QueryDepositsRequest = { - encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.QueryDepositsRequest", + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -1487,15 +1540,15 @@ export const QueryDepositsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1509,31 +1562,35 @@ export const QueryDepositsRequest = { }, fromJSON(object: any): QueryDepositsRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryDepositsRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryDepositsRequest { const message = createBaseQueryDepositsRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { - return { - proposalId: Long.fromString(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1562,11 +1619,12 @@ export const QueryDepositsRequest = { function createBaseQueryDepositsResponse(): QueryDepositsResponse { return { deposits: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDepositsResponse = { - encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryDepositsResponse", + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1575,8 +1633,8 @@ export const QueryDepositsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsResponse(); while (reader.pos < end) { @@ -1618,17 +1676,19 @@ export const QueryDepositsResponse = { return message; }, fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { - return { - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { const obj: any = {}; if (message.deposits) { obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); } else { - obj.deposits = []; + obj.deposits = message.deposits; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1657,25 +1717,26 @@ export const QueryDepositsResponse = { }; function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const QueryTallyResultRequest = { - encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1686,27 +1747,29 @@ export const QueryTallyResultRequest = { }, fromJSON(object: any): QueryTallyResultRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: QueryTallyResultRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryTallyResultRequest { const message = createBaseQueryTallyResultRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { @@ -1733,18 +1796,19 @@ export const QueryTallyResultRequest = { }; function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { return { - tally: TallyResult.fromPartial({}) + tally: undefined }; } export const QueryTallyResultResponse = { - encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultResponse(); while (reader.pos < end) { @@ -1776,9 +1840,11 @@ export const QueryTallyResultResponse = { return message; }, fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - return { - tally: object?.tally ? TallyResult.fromAmino(object.tally) : undefined - }; + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; }, toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts index 43f13bae..2a8605ee 100644 --- a/packages/api/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgExecLegacyContent, MsgExecLegacyContentResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; /** Msg defines the gov Msg service. */ export interface Msg { @@ -30,26 +30,26 @@ export class MsgClientImpl implements Msg { submitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "SubmitProposal", data); - return promise.then(data => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); } execLegacyContent(request: MsgExecLegacyContent): Promise { const data = MsgExecLegacyContent.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "ExecLegacyContent", data); - return promise.then(data => MsgExecLegacyContentResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgExecLegacyContentResponse.decode(new BinaryReader(data))); } vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "Vote", data); - return promise.then(data => MsgVoteResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); } voteWeighted(request: MsgVoteWeighted): Promise { const data = MsgVoteWeighted.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "VoteWeighted", data); - return promise.then(data => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgVoteWeightedResponse.decode(new BinaryReader(data))); } deposit(request: MsgDeposit): Promise { const data = MsgDeposit.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "Deposit", data); - return promise.then(data => MsgDepositResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgDepositResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/gov/v1/tx.ts b/packages/api/src/codegen/cosmos/gov/v1/tx.ts index d79e90ea..f21b8d6e 100644 --- a/packages/api/src/codegen/cosmos/gov/v1/tx.ts +++ b/packages/api/src/codegen/cosmos/gov/v1/tx.ts @@ -2,8 +2,8 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, voteOptionFromJSON, voteOptionToJSON } from "./gov"; import { TextProposal, TextProposalProtoMsg, TextProposalSDKType } from "../v1beta1/gov"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. @@ -24,11 +24,11 @@ export interface MsgSubmitProposalProtoMsg { * proposal Content. */ export interface MsgSubmitProposalAmino { - messages: AnyAmino[]; - initial_deposit: CoinAmino[]; - proposer: string; + messages?: AnyAmino[]; + initial_deposit?: CoinAmino[]; + proposer?: string; /** metadata is any arbitrary metadata attached to the proposal. */ - metadata: string; + metadata?: string; } export interface MsgSubmitProposalAminoMsg { type: "cosmos-sdk/v1/MsgSubmitProposal"; @@ -46,7 +46,7 @@ export interface MsgSubmitProposalSDKType { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { - proposalId: Long; + proposalId: bigint; } export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; @@ -54,7 +54,7 @@ export interface MsgSubmitProposalResponseProtoMsg { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseAmino { - proposal_id: string; + proposal_id?: string; } export interface MsgSubmitProposalResponseAminoMsg { type: "cosmos-sdk/v1/MsgSubmitProposalResponse"; @@ -62,7 +62,7 @@ export interface MsgSubmitProposalResponseAminoMsg { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { - proposal_id: Long; + proposal_id: bigint; } /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. @@ -70,7 +70,7 @@ export interface MsgSubmitProposalResponseSDKType { */ export interface MsgExecLegacyContent { /** content is the proposal's content. */ - content: (TextProposal & Any) | undefined; + content?: (TextProposal & Any) | undefined; /** authority must be the gov module address. */ authority: string; } @@ -89,7 +89,7 @@ export interface MsgExecLegacyContentAmino { /** content is the proposal's content. */ content?: AnyAmino; /** authority must be the gov module address. */ - authority: string; + authority?: string; } export interface MsgExecLegacyContentAminoMsg { type: "cosmos-sdk/v1/MsgExecLegacyContent"; @@ -100,7 +100,7 @@ export interface MsgExecLegacyContentAminoMsg { * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentSDKType { - content: TextProposalSDKType | AnySDKType | undefined; + content?: TextProposalSDKType | AnySDKType | undefined; authority: string; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ @@ -119,7 +119,7 @@ export interface MsgExecLegacyContentResponseAminoMsg { export interface MsgExecLegacyContentResponseSDKType {} /** MsgVote defines a message to cast a vote. */ export interface MsgVote { - proposalId: Long; + proposalId: bigint; voter: string; option: VoteOption; metadata: string; @@ -131,9 +131,9 @@ export interface MsgVoteProtoMsg { /** MsgVote defines a message to cast a vote. */ export interface MsgVoteAmino { proposal_id: string; - voter: string; - option: VoteOption; - metadata: string; + voter?: string; + option?: VoteOption; + metadata?: string; } export interface MsgVoteAminoMsg { type: "cosmos-sdk/v1/MsgVote"; @@ -141,7 +141,7 @@ export interface MsgVoteAminoMsg { } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; option: VoteOption; metadata: string; @@ -162,7 +162,7 @@ export interface MsgVoteResponseAminoMsg { export interface MsgVoteResponseSDKType {} /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeighted { - proposalId: Long; + proposalId: bigint; voter: string; options: WeightedVoteOption[]; metadata: string; @@ -174,9 +174,9 @@ export interface MsgVoteWeightedProtoMsg { /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeightedAmino { proposal_id: string; - voter: string; - options: WeightedVoteOptionAmino[]; - metadata: string; + voter?: string; + options?: WeightedVoteOptionAmino[]; + metadata?: string; } export interface MsgVoteWeightedAminoMsg { type: "cosmos-sdk/v1/MsgVoteWeighted"; @@ -184,7 +184,7 @@ export interface MsgVoteWeightedAminoMsg { } /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeightedSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; options: WeightedVoteOptionSDKType[]; metadata: string; @@ -205,7 +205,7 @@ export interface MsgVoteWeightedResponseAminoMsg { export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { - proposalId: Long; + proposalId: bigint; depositor: string; amount: Coin[]; } @@ -216,8 +216,8 @@ export interface MsgDepositProtoMsg { /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositAmino { proposal_id: string; - depositor: string; - amount: CoinAmino[]; + depositor?: string; + amount?: CoinAmino[]; } export interface MsgDepositAminoMsg { type: "cosmos-sdk/v1/MsgDeposit"; @@ -225,7 +225,7 @@ export interface MsgDepositAminoMsg { } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositSDKType { - proposal_id: Long; + proposal_id: bigint; depositor: string; amount: CoinSDKType[]; } @@ -252,7 +252,8 @@ function createBaseMsgSubmitProposal(): MsgSubmitProposal { }; } export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -267,8 +268,8 @@ export const MsgSubmitProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { @@ -326,27 +327,31 @@ export const MsgSubmitProposal = { return message; }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - initialDeposit: Array.isArray(object?.initial_deposit) ? object.initial_deposit.map((e: any) => Coin.fromAmino(e)) : [], - proposer: object.proposer, - metadata: object.metadata - }; + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { const obj: any = {}; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.messages = []; + obj.messages = message.messages; } if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.initial_deposit = []; + obj.initial_deposit = message.initialDeposit; } - obj.proposer = message.proposer; - obj.metadata = message.metadata; + obj.proposer = message.proposer === "" ? undefined : message.proposer; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { @@ -373,25 +378,26 @@ export const MsgSubmitProposal = { }; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const MsgSubmitProposalResponse = { - encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -402,27 +408,29 @@ export const MsgSubmitProposalResponse = { }, fromJSON(object: any): MsgSubmitProposalResponse { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: MsgSubmitProposalResponse): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { @@ -454,7 +462,8 @@ function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { }; } export const MsgExecLegacyContent = { - encode(message: MsgExecLegacyContent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); } @@ -463,8 +472,8 @@ export const MsgExecLegacyContent = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecLegacyContent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecLegacyContent(); while (reader.pos < end) { @@ -502,15 +511,19 @@ export const MsgExecLegacyContent = { return message; }, fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { - return { - content: object?.content ? Content_FromAmino(object.content) : undefined, - authority: object.authority - }; + const message = createBaseMsgExecLegacyContent(); + if (object.content !== undefined && object.content !== null) { + message.content = Content_FromAmino(object.content); + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; }, toAmino(message: MsgExecLegacyContent): MsgExecLegacyContentAmino { const obj: any = {}; obj.content = message.content ? Content_ToAmino((message.content as Any)) : undefined; - obj.authority = message.authority; + obj.authority = message.authority === "" ? undefined : message.authority; return obj; }, fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { @@ -539,11 +552,12 @@ function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse return {}; } export const MsgExecLegacyContentResponse = { - encode(_: MsgExecLegacyContentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + encode(_: MsgExecLegacyContentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecLegacyContentResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecLegacyContentResponse(); while (reader.pos < end) { @@ -568,7 +582,8 @@ export const MsgExecLegacyContentResponse = { return message; }, fromAmino(_: MsgExecLegacyContentResponseAmino): MsgExecLegacyContentResponse { - return {}; + const message = createBaseMsgExecLegacyContentResponse(); + return message; }, toAmino(_: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAmino { const obj: any = {}; @@ -598,15 +613,16 @@ export const MsgExecLegacyContentResponse = { }; function createBaseMsgVote(): MsgVote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, metadata: "" }; } export const MsgVote = { - encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -620,15 +636,15 @@ export const MsgVote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -648,15 +664,15 @@ export const MsgVote = { }, fromJSON(object: any): MsgVote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, toJSON(message: MsgVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); message.metadata !== undefined && (obj.metadata = message.metadata); @@ -664,26 +680,34 @@ export const MsgVote = { }, fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.option = object.option ?? 0; message.metadata = object.metadata ?? ""; return message; }, fromAmino(object: MsgVoteAmino): MsgVote { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - metadata: object.metadata - }; + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgVote): MsgVoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; - obj.option = message.option; - obj.metadata = message.metadata; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { @@ -712,11 +736,12 @@ function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteResponse(); while (reader.pos < end) { @@ -741,7 +766,8 @@ export const MsgVoteResponse = { return message; }, fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - return {}; + const message = createBaseMsgVoteResponse(); + return message; }, toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { const obj: any = {}; @@ -771,15 +797,16 @@ export const MsgVoteResponse = { }; function createBaseMsgVoteWeighted(): MsgVoteWeighted { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", options: [], metadata: "" }; } export const MsgVoteWeighted = { - encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -793,15 +820,15 @@ export const MsgVoteWeighted = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeighted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -821,7 +848,7 @@ export const MsgVoteWeighted = { }, fromJSON(object: any): MsgVoteWeighted { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "" @@ -829,7 +856,7 @@ export const MsgVoteWeighted = { }, toJSON(message: MsgVoteWeighted): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toJSON(e) : undefined); @@ -841,30 +868,36 @@ export const MsgVoteWeighted = { }, fromPartial(object: Partial): MsgVoteWeighted { const message = createBaseMsgVoteWeighted(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; message.metadata = object.metadata ?? ""; return message; }, fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [], - metadata: object.metadata - }; + const message = createBaseMsgVoteWeighted(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); } else { - obj.options = []; + obj.options = message.options; } - obj.metadata = message.metadata; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { @@ -893,11 +926,12 @@ function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { return {}; } export const MsgVoteWeightedResponse = { - encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeightedResponse(); while (reader.pos < end) { @@ -922,7 +956,8 @@ export const MsgVoteWeightedResponse = { return message; }, fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - return {}; + const message = createBaseMsgVoteWeightedResponse(); + return message; }, toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { const obj: any = {}; @@ -952,14 +987,15 @@ export const MsgVoteWeightedResponse = { }; function createBaseMsgDeposit(): MsgDeposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [] }; } export const MsgDeposit = { - encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -970,15 +1006,15 @@ export const MsgDeposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -995,14 +1031,14 @@ export const MsgDeposit = { }, fromJSON(object: any): MsgDeposit { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), depositor: isSet(object.depositor) ? String(object.depositor) : "", amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: MsgDeposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); @@ -1013,26 +1049,30 @@ export const MsgDeposit = { }, fromPartial(object: Partial): MsgDeposit { const message = createBaseMsgDeposit(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.depositor = object.depositor ?? ""; message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: MsgDepositAmino): MsgDeposit { - return { - proposalId: Long.fromString(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgDeposit): MsgDepositAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.depositor = message.depositor; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.depositor = message.depositor === "" ? undefined : message.depositor; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -1062,11 +1102,12 @@ function createBaseMsgDepositResponse(): MsgDepositResponse { return {}; } export const MsgDepositResponse = { - encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDepositResponse(); while (reader.pos < end) { @@ -1091,7 +1132,8 @@ export const MsgDepositResponse = { return message; }, fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - return {}; + const message = createBaseMsgDepositResponse(); + return message; }, toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { const obj: any = {}; @@ -1119,8 +1161,8 @@ export const MsgDepositResponse = { }; } }; -export const Content_InterfaceDecoder = (input: _m0.Reader | Uint8Array): TextProposal | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): TextProposal | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.gov.v1beta1.TextProposal": @@ -1129,7 +1171,7 @@ export const Content_InterfaceDecoder = (input: _m0.Reader | Uint8Array): TextPr return data; } }; -export const Content_FromAmino = (content: AnyAmino) => { +export const Content_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/v1/TextProposal": return Any.fromPartial({ @@ -1145,7 +1187,7 @@ export const Content_ToAmino = (content: Any) => { case "/cosmos.gov.v1beta1.TextProposal": return { type: "cosmos-sdk/v1/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value)) + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/gov/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/gov/v1beta1/genesis.ts index 3dc52768..8392b130 100644 --- a/packages/api/src/codegen/cosmos/gov/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/gov/v1beta1/genesis.ts @@ -1,10 +1,10 @@ import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType } from "./gov"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ - startingProposalId: Long; + startingProposalId: bigint; /** deposits defines all the deposits present at genesis. */ deposits: Deposit[]; /** votes defines all the votes present at genesis. */ @@ -25,13 +25,13 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateAmino { /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id: string; + starting_proposal_id?: string; /** deposits defines all the deposits present at genesis. */ - deposits: DepositAmino[]; + deposits?: DepositAmino[]; /** votes defines all the votes present at genesis. */ - votes: VoteAmino[]; + votes?: VoteAmino[]; /** proposals defines all the proposals present at genesis. */ - proposals: ProposalAmino[]; + proposals?: ProposalAmino[]; /** params defines all the paramaters of related to deposit. */ deposit_params?: DepositParamsAmino; /** params defines all the paramaters of related to voting. */ @@ -45,7 +45,7 @@ export interface GenesisStateAminoMsg { } /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateSDKType { - starting_proposal_id: Long; + starting_proposal_id: bigint; deposits: DepositSDKType[]; votes: VoteSDKType[]; proposals: ProposalSDKType[]; @@ -55,7 +55,7 @@ export interface GenesisStateSDKType { } function createBaseGenesisState(): GenesisState { return { - startingProposalId: Long.UZERO, + startingProposalId: BigInt(0), deposits: [], votes: [], proposals: [], @@ -65,8 +65,9 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.startingProposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startingProposalId !== BigInt(0)) { writer.uint32(8).uint64(message.startingProposalId); } for (const v of message.deposits) { @@ -89,15 +90,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startingProposalId = (reader.uint64() as Long); + message.startingProposalId = reader.uint64(); break; case 2: message.deposits.push(Deposit.decode(reader, reader.uint32())); @@ -126,7 +127,7 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { return { - startingProposalId: isSet(object.startingProposalId) ? Long.fromValue(object.startingProposalId) : Long.UZERO, + startingProposalId: isSet(object.startingProposalId) ? BigInt(object.startingProposalId.toString()) : BigInt(0), deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], @@ -137,7 +138,7 @@ export const GenesisState = { }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.startingProposalId !== undefined && (obj.startingProposalId = (message.startingProposalId || Long.UZERO).toString()); + message.startingProposalId !== undefined && (obj.startingProposalId = (message.startingProposalId || BigInt(0)).toString()); if (message.deposits) { obj.deposits = message.deposits.map(e => e ? Deposit.toJSON(e) : undefined); } else { @@ -160,7 +161,7 @@ export const GenesisState = { }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); - message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? Long.fromValue(object.startingProposalId) : Long.UZERO; + message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? BigInt(object.startingProposalId.toString()) : BigInt(0); message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; @@ -170,33 +171,41 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - startingProposalId: Long.fromString(object.starting_proposal_id), - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseGenesisState(); + if (object.starting_proposal_id !== undefined && object.starting_proposal_id !== null) { + message.startingProposalId = BigInt(object.starting_proposal_id); + } + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.starting_proposal_id = message.startingProposalId ? message.startingProposalId.toString() : undefined; + obj.starting_proposal_id = message.startingProposalId !== BigInt(0) ? message.startingProposalId.toString() : undefined; if (message.deposits) { obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); } else { - obj.deposits = []; + obj.deposits = message.deposits; } if (message.votes) { obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } if (message.proposals) { obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); } else { - obj.proposals = []; + obj.proposals = message.proposals; } obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; diff --git a/packages/api/src/codegen/cosmos/gov/v1beta1/gov.ts b/packages/api/src/codegen/cosmos/gov/v1beta1/gov.ts index 688ff926..b5b8301e 100644 --- a/packages/api/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/packages/api/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -1,9 +1,10 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { isSet, fromJsonTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** VoteOption enumerates the valid vote options for a given governance proposal. */ export enum VoteOption { /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ @@ -157,8 +158,8 @@ export interface WeightedVoteOptionProtoMsg { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOptionAmino { - option: VoteOption; - weight: string; + option?: VoteOption; + weight?: string; } export interface WeightedVoteOptionAminoMsg { type: "cosmos-sdk/WeightedVoteOption"; @@ -178,7 +179,7 @@ export interface WeightedVoteOptionSDKType { * manually updated in case of approval. */ export interface TextProposal { - $typeUrl?: string; + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; title: string; description: string; } @@ -191,8 +192,8 @@ export interface TextProposalProtoMsg { * manually updated in case of approval. */ export interface TextProposalAmino { - title: string; - description: string; + title?: string; + description?: string; } export interface TextProposalAminoMsg { type: "cosmos-sdk/TextProposal"; @@ -203,7 +204,7 @@ export interface TextProposalAminoMsg { * manually updated in case of approval. */ export interface TextProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; title: string; description: string; } @@ -212,7 +213,7 @@ export interface TextProposalSDKType { * proposal. */ export interface Deposit { - proposalId: Long; + proposalId: bigint; depositor: string; amount: Coin[]; } @@ -225,9 +226,9 @@ export interface DepositProtoMsg { * proposal. */ export interface DepositAmino { - proposal_id: string; - depositor: string; - amount: CoinAmino[]; + proposal_id?: string; + depositor?: string; + amount?: CoinAmino[]; } export interface DepositAminoMsg { type: "cosmos-sdk/Deposit"; @@ -238,14 +239,14 @@ export interface DepositAminoMsg { * proposal. */ export interface DepositSDKType { - proposal_id: Long; + proposal_id: bigint; depositor: string; amount: CoinSDKType[]; } /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { - proposalId: Long; - content: (TextProposal & Any) | undefined; + proposalId: bigint; + content?: (TextProposal & Any) | undefined; status: ProposalStatus; /** * final_tally_result is the final tally result of the proposal. When @@ -268,20 +269,20 @@ export type ProposalEncoded = Omit & { }; /** Proposal defines the core field members of a governance proposal. */ export interface ProposalAmino { - proposal_id: string; + proposal_id?: string; content?: AnyAmino; - status: ProposalStatus; + status?: ProposalStatus; /** * final_tally_result is the final tally result of the proposal. When * querying a proposal via gRPC, this field is not populated until the * proposal's voting period has ended. */ final_tally_result?: TallyResultAmino; - submit_time?: TimestampAmino; - deposit_end_time?: TimestampAmino; - total_deposit: CoinAmino[]; - voting_start_time?: TimestampAmino; - voting_end_time?: TimestampAmino; + submit_time?: string; + deposit_end_time?: string; + total_deposit?: CoinAmino[]; + voting_start_time?: string; + voting_end_time?: string; } export interface ProposalAminoMsg { type: "cosmos-sdk/Proposal"; @@ -289,8 +290,8 @@ export interface ProposalAminoMsg { } /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { - proposal_id: Long; - content: TextProposalSDKType | AnySDKType | undefined; + proposal_id: bigint; + content?: TextProposalSDKType | AnySDKType | undefined; status: ProposalStatus; final_tally_result: TallyResultSDKType; submit_time: TimestampSDKType; @@ -312,10 +313,10 @@ export interface TallyResultProtoMsg { } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResultAmino { - yes: string; - abstain: string; - no: string; - no_with_veto: string; + yes?: string; + abstain?: string; + no?: string; + no_with_veto?: string; } export interface TallyResultAminoMsg { type: "cosmos-sdk/TallyResult"; @@ -333,7 +334,7 @@ export interface TallyResultSDKType { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface Vote { - proposalId: Long; + proposalId: bigint; voter: string; /** * Deprecated: Prefer to use `options` instead. This field is set in queries @@ -355,16 +356,16 @@ export interface VoteProtoMsg { */ export interface VoteAmino { proposal_id: string; - voter: string; + voter?: string; /** * Deprecated: Prefer to use `options` instead. This field is set in queries * if and only if `len(options) == 1` and that option has weight 1. In all * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. */ /** @deprecated */ - option: VoteOption; + option?: VoteOption; /** Since: cosmos-sdk 0.43 */ - options: WeightedVoteOptionAmino[]; + options?: WeightedVoteOptionAmino[]; } export interface VoteAminoMsg { type: "cosmos-sdk/Vote"; @@ -375,7 +376,7 @@ export interface VoteAminoMsg { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface VoteSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; /** @deprecated */ option: VoteOption; @@ -398,7 +399,7 @@ export interface DepositParamsProtoMsg { /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsAmino { /** Minimum deposit for a proposal to enter voting period. */ - min_deposit: CoinAmino[]; + min_deposit?: CoinAmino[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 * months. @@ -461,14 +462,14 @@ export interface TallyParamsAmino { * Minimum percentage of total stake needed to vote for a result to be * considered valid. */ - quorum: Uint8Array; + quorum?: string; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold: Uint8Array; + threshold?: string; /** * Minimum value of Veto votes to Total votes ratio for proposal to be * vetoed. Default value: 1/3. */ - veto_threshold: Uint8Array; + veto_threshold?: string; } export interface TallyParamsAminoMsg { type: "cosmos-sdk/TallyParams"; @@ -487,17 +488,18 @@ function createBaseWeightedVoteOption(): WeightedVoteOption { }; } export const WeightedVoteOption = { - encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption", + encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.option !== 0) { writer.uint32(8).int32(message.option); } if (message.weight !== "") { - writer.uint32(18).string(message.weight); + writer.uint32(18).string(Decimal.fromUserInput(message.weight, 18).atomics); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseWeightedVoteOption(); while (reader.pos < end) { @@ -507,7 +509,7 @@ export const WeightedVoteOption = { message.option = (reader.int32() as any); break; case 2: - message.weight = reader.string(); + message.weight = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -518,7 +520,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -535,15 +537,19 @@ export const WeightedVoteOption = { return message; }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { - return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - weight: object.weight - }; + const message = createBaseWeightedVoteOption(); + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { const obj: any = {}; - obj.option = message.option; - obj.weight = message.weight; + obj.option = message.option === 0 ? undefined : message.option; + obj.weight = message.weight === "" ? undefined : message.weight; return obj; }, fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { @@ -576,7 +582,8 @@ function createBaseTextProposal(): TextProposal { }; } export const TextProposal = { - encode(message: TextProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + encode(message: TextProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -585,8 +592,8 @@ export const TextProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TextProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TextProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTextProposal(); while (reader.pos < end) { @@ -624,15 +631,19 @@ export const TextProposal = { return message; }, fromAmino(object: TextProposalAmino): TextProposal { - return { - title: object.title, - description: object.description - }; + const message = createBaseTextProposal(); + 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: TextProposal): TextProposalAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; return obj; }, fromAminoMsg(object: TextProposalAminoMsg): TextProposal { @@ -659,14 +670,15 @@ export const TextProposal = { }; function createBaseDeposit(): Deposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [] }; } export const Deposit = { - encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.Deposit", + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -677,15 +689,15 @@ export const Deposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -702,14 +714,14 @@ export const Deposit = { }, fromJSON(object: any): Deposit { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), depositor: isSet(object.depositor) ? String(object.depositor) : "", amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: Deposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); @@ -720,26 +732,30 @@ export const Deposit = { }, fromPartial(object: Partial): Deposit { const message = createBaseDeposit(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.depositor = object.depositor ?? ""; message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: DepositAmino): Deposit { - return { - proposalId: Long.fromString(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Deposit): DepositAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.depositor = message.depositor; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -767,20 +783,21 @@ export const Deposit = { }; function createBaseProposal(): Proposal { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), content: undefined, status: 0, finalTallyResult: TallyResult.fromPartial({}), - submitTime: undefined, - depositEndTime: undefined, + submitTime: Timestamp.fromPartial({}), + depositEndTime: Timestamp.fromPartial({}), totalDeposit: [], - votingStartTime: undefined, - votingEndTime: undefined + votingStartTime: Timestamp.fromPartial({}), + votingEndTime: Timestamp.fromPartial({}) }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.content !== undefined) { @@ -809,15 +826,15 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.content = (Content_InterfaceDecoder(reader) as Any); @@ -852,9 +869,9 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? fromJsonTimestamp(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? fromJsonTimestamp(object.depositEndTime) : undefined, @@ -865,7 +882,7 @@ export const Proposal = { }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); message.finalTallyResult !== undefined && (obj.finalTallyResult = message.finalTallyResult ? TallyResult.toJSON(message.finalTallyResult) : undefined); @@ -882,7 +899,7 @@ export const Proposal = { }, fromPartial(object: Partial): Proposal { const message = createBaseProposal(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; message.status = object.status ?? 0; message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; @@ -894,30 +911,46 @@ export const Proposal = { return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - proposalId: Long.fromString(object.proposal_id), - content: object?.content ? Content_FromAmino(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, - depositEndTime: object?.deposit_end_time ? Timestamp.fromAmino(object.deposit_end_time) : undefined, - totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time ? Timestamp.fromAmino(object.voting_start_time) : undefined, - votingEndTime: object?.voting_end_time ? Timestamp.fromAmino(object.voting_end_time) : undefined - }; + const message = createBaseProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.content !== undefined && object.content !== null) { + message.content = Content_FromAmino(object.content); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = Timestamp.fromAmino(object.submit_time); + } + if (object.deposit_end_time !== undefined && object.deposit_end_time !== null) { + message.depositEndTime = Timestamp.fromAmino(object.deposit_end_time); + } + message.totalDeposit = object.total_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.voting_start_time !== undefined && object.voting_start_time !== null) { + message.votingStartTime = Timestamp.fromAmino(object.voting_start_time); + } + if (object.voting_end_time !== undefined && object.voting_end_time !== null) { + message.votingEndTime = Timestamp.fromAmino(object.voting_end_time); + } + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.content = message.content ? Content_ToAmino((message.content as Any)) : undefined; - obj.status = message.status; + obj.status = message.status === 0 ? undefined : message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(message.depositEndTime) : undefined; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.total_deposit = []; + obj.total_deposit = message.totalDeposit; } obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(message.votingStartTime) : undefined; obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(message.votingEndTime) : undefined; @@ -954,7 +987,8 @@ function createBaseTallyResult(): TallyResult { }; } export const TallyResult = { - encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.yes !== "") { writer.uint32(10).string(message.yes); } @@ -969,8 +1003,8 @@ export const TallyResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyResult(); while (reader.pos < end) { @@ -1020,19 +1054,27 @@ export const TallyResult = { return message; }, fromAmino(object: TallyResultAmino): TallyResult { - return { - yes: object.yes, - abstain: object.abstain, - no: object.no, - noWithVeto: object.no_with_veto - }; + const message = createBaseTallyResult(); + if (object.yes !== undefined && object.yes !== null) { + message.yes = object.yes; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = object.abstain; + } + if (object.no !== undefined && object.no !== null) { + message.no = object.no; + } + if (object.no_with_veto !== undefined && object.no_with_veto !== null) { + message.noWithVeto = object.no_with_veto; + } + return message; }, toAmino(message: TallyResult): TallyResultAmino { const obj: any = {}; - obj.yes = message.yes; - obj.abstain = message.abstain; - obj.no = message.no; - obj.no_with_veto = message.noWithVeto; + obj.yes = message.yes === "" ? undefined : message.yes; + obj.abstain = message.abstain === "" ? undefined : message.abstain; + obj.no = message.no === "" ? undefined : message.no; + obj.no_with_veto = message.noWithVeto === "" ? undefined : message.noWithVeto; return obj; }, fromAminoMsg(object: TallyResultAminoMsg): TallyResult { @@ -1059,15 +1101,16 @@ export const TallyResult = { }; function createBaseVote(): Vote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, options: [] }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -1081,15 +1124,15 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -1109,15 +1152,15 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [] }; }, toJSON(message: Vote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); if (message.options) { @@ -1129,29 +1172,35 @@ export const Vote = { }, fromPartial(object: Partial): Vote { const message = createBaseVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.option = object.option ?? 0; message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; return message; }, fromAmino(object: VoteAmino): Vote { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] - }; + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; - obj.option = message.option; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); } else { - obj.options = []; + obj.options = message.options; } return obj; }, @@ -1180,11 +1229,12 @@ export const Vote = { function createBaseDepositParams(): DepositParams { return { minDeposit: [], - maxDepositPeriod: undefined + maxDepositPeriod: Duration.fromPartial({}) }; } export const DepositParams = { - encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.DepositParams", + encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.minDeposit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1193,8 +1243,8 @@ export const DepositParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDepositParams(); while (reader.pos < end) { @@ -1236,17 +1286,19 @@ export const DepositParams = { return message; }, fromAmino(object: DepositParamsAmino): DepositParams { - return { - minDeposit: Array.isArray(object?.min_deposit) ? object.min_deposit.map((e: any) => Coin.fromAmino(e)) : [], - maxDepositPeriod: object?.max_deposit_period ? Duration.fromAmino(object.max_deposit_period) : undefined - }; + const message = createBaseDepositParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + return message; }, toAmino(message: DepositParams): DepositParamsAmino { const obj: any = {}; if (message.minDeposit) { obj.min_deposit = message.minDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.min_deposit = []; + obj.min_deposit = message.minDeposit; } obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; return obj; @@ -1275,18 +1327,19 @@ export const DepositParams = { }; function createBaseVotingParams(): VotingParams { return { - votingPeriod: undefined + votingPeriod: Duration.fromPartial({}) }; } export const VotingParams = { - encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.VotingParams", + encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVotingParams(); while (reader.pos < end) { @@ -1318,9 +1371,11 @@ export const VotingParams = { return message; }, fromAmino(object: VotingParamsAmino): VotingParams { - return { - votingPeriod: object?.voting_period ? Duration.fromAmino(object.voting_period) : undefined - }; + const message = createBaseVotingParams(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + return message; }, toAmino(message: VotingParams): VotingParamsAmino { const obj: any = {}; @@ -1357,7 +1412,8 @@ function createBaseTallyParams(): TallyParams { }; } export const TallyParams = { - encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.TallyParams", + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.quorum.length !== 0) { writer.uint32(10).bytes(message.quorum); } @@ -1369,8 +1425,8 @@ export const TallyParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyParams(); while (reader.pos < end) { @@ -1414,17 +1470,23 @@ export const TallyParams = { return message; }, fromAmino(object: TallyParamsAmino): TallyParams { - return { - quorum: object.quorum, - threshold: object.threshold, - vetoThreshold: object.veto_threshold - }; + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = bytesFromBase64(object.quorum); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = bytesFromBase64(object.threshold); + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = bytesFromBase64(object.veto_threshold); + } + return message; }, toAmino(message: TallyParams): TallyParamsAmino { const obj: any = {}; - obj.quorum = message.quorum; - obj.threshold = message.threshold; - obj.veto_threshold = message.vetoThreshold; + obj.quorum = message.quorum ? base64FromBytes(message.quorum) : undefined; + obj.threshold = message.threshold ? base64FromBytes(message.threshold) : undefined; + obj.veto_threshold = message.vetoThreshold ? base64FromBytes(message.vetoThreshold) : undefined; return obj; }, fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { @@ -1449,8 +1511,8 @@ export const TallyParams = { }; } }; -export const Content_InterfaceDecoder = (input: _m0.Reader | Uint8Array): TextProposal | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): TextProposal | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.gov.v1beta1.TextProposal": @@ -1459,7 +1521,7 @@ export const Content_InterfaceDecoder = (input: _m0.Reader | Uint8Array): TextPr return data; } }; -export const Content_FromAmino = (content: AnyAmino) => { +export const Content_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/TextProposal": return Any.fromPartial({ @@ -1475,7 +1537,7 @@ export const Content_ToAmino = (content: Any) => { case "/cosmos.gov.v1beta1.TextProposal": return { type: "cosmos-sdk/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value)) + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/gov/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/gov/v1beta1/query.lcd.ts index a789cf6a..eeaf06a3 100644 --- a/packages/api/src/codegen/cosmos/gov/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/gov/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryProposalRequest, QueryProposalResponseSDKType, QueryProposalsRequest, QueryProposalsResponseSDKType, QueryVoteRequest, QueryVoteResponseSDKType, QueryVotesRequest, QueryVotesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDepositRequest, QueryDepositResponseSDKType, QueryDepositsRequest, QueryDepositsResponseSDKType, QueryTallyResultRequest, QueryTallyResultResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts index 9c0507da..ead5910b 100644 --- a/packages/api/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; /** Query defines the gRPC querier service for gov module */ @@ -37,42 +37,42 @@ export class QueryClientImpl implements Query { proposal(request: QueryProposalRequest): Promise { const data = QueryProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposal", data); - return promise.then(data => QueryProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); } proposals(request: QueryProposalsRequest): Promise { const data = QueryProposalsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposals", data); - return promise.then(data => QueryProposalsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProposalsResponse.decode(new BinaryReader(data))); } vote(request: QueryVoteRequest): Promise { const data = QueryVoteRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data); - return promise.then(data => QueryVoteResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryVoteResponse.decode(new BinaryReader(data))); } votes(request: QueryVotesRequest): Promise { const data = QueryVotesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data); - return promise.then(data => QueryVotesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryVotesResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } deposit(request: QueryDepositRequest): Promise { const data = QueryDepositRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposit", data); - return promise.then(data => QueryDepositResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDepositResponse.decode(new BinaryReader(data))); } deposits(request: QueryDepositsRequest): Promise { const data = QueryDepositsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposits", data); - return promise.then(data => QueryDepositsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDepositsResponse.decode(new BinaryReader(data))); } tallyResult(request: QueryTallyResultRequest): Promise { const data = QueryTallyResultRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "TallyResult", data); - return promise.then(data => QueryTallyResultResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/gov/v1beta1/query.ts b/packages/api/src/codegen/cosmos/gov/v1beta1/query.ts index 061ef0fe..7c35fb55 100644 --- a/packages/api/src/codegen/cosmos/gov/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/gov/v1beta1/query.ts @@ -1,11 +1,11 @@ import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON, proposalStatusToJSON } from "./gov"; import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } export interface QueryProposalRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest"; @@ -14,7 +14,7 @@ export interface QueryProposalRequestProtoMsg { /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryProposalRequestAminoMsg { type: "cosmos-sdk/QueryProposalRequest"; @@ -22,7 +22,7 @@ export interface QueryProposalRequestAminoMsg { } /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestSDKType { - proposal_id: Long; + proposal_id: bigint; } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponse { @@ -53,7 +53,7 @@ export interface QueryProposalsRequest { /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProposalsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest"; @@ -62,11 +62,11 @@ export interface QueryProposalsRequestProtoMsg { /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestAmino { /** proposal_status defines the status of the proposals. */ - proposal_status: ProposalStatus; + proposal_status?: ProposalStatus; /** voter defines the voter address for the proposals. */ - voter: string; + voter?: string; /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -79,7 +79,7 @@ export interface QueryProposalsRequestSDKType { proposal_status: ProposalStatus; voter: string; depositor: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryProposalsResponse is the response type for the Query/Proposals RPC @@ -88,7 +88,7 @@ export interface QueryProposalsRequestSDKType { export interface QueryProposalsResponse { proposals: Proposal[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProposalsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse"; @@ -99,7 +99,7 @@ export interface QueryProposalsResponseProtoMsg { * method. */ export interface QueryProposalsResponseAmino { - proposals: ProposalAmino[]; + proposals?: ProposalAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -113,12 +113,12 @@ export interface QueryProposalsResponseAminoMsg { */ export interface QueryProposalsResponseSDKType { proposals: ProposalSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter defines the voter address for the proposals. */ voter: string; } @@ -129,9 +129,9 @@ export interface QueryVoteRequestProtoMsg { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** voter defines the voter address for the proposals. */ - voter: string; + voter?: string; } export interface QueryVoteRequestAminoMsg { type: "cosmos-sdk/QueryVoteRequest"; @@ -139,7 +139,7 @@ export interface QueryVoteRequestAminoMsg { } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ @@ -167,9 +167,9 @@ export interface QueryVoteResponseSDKType { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryVotesRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest"; @@ -178,7 +178,7 @@ export interface QueryVotesRequestProtoMsg { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -188,15 +188,15 @@ export interface QueryVotesRequestAminoMsg { } /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { - proposal_id: Long; - pagination: PageRequestSDKType; + proposal_id: bigint; + pagination?: PageRequestSDKType; } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponse { /** votes defined the queried votes. */ votes: Vote[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryVotesResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse"; @@ -205,7 +205,7 @@ export interface QueryVotesResponseProtoMsg { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseAmino { /** votes defined the queried votes. */ - votes: VoteAmino[]; + votes?: VoteAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -216,7 +216,7 @@ export interface QueryVotesResponseAminoMsg { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { votes: VoteSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest { @@ -236,7 +236,7 @@ export interface QueryParamsRequestAmino { * params_type defines which parameters to query for, can be one of "voting", * "tallying" or "deposit". */ - params_type: string; + params_type?: string; } export interface QueryParamsRequestAminoMsg { type: "cosmos-sdk/QueryParamsRequest"; @@ -281,7 +281,7 @@ export interface QueryParamsResponseSDKType { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; } @@ -292,9 +292,9 @@ export interface QueryDepositRequestProtoMsg { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor?: string; } export interface QueryDepositRequestAminoMsg { type: "cosmos-sdk/QueryDepositRequest"; @@ -302,7 +302,7 @@ export interface QueryDepositRequestAminoMsg { } /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestSDKType { - proposal_id: Long; + proposal_id: bigint; depositor: string; } /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ @@ -330,9 +330,9 @@ export interface QueryDepositResponseSDKType { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDepositsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest"; @@ -341,7 +341,7 @@ export interface QueryDepositsRequestProtoMsg { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -351,14 +351,14 @@ export interface QueryDepositsRequestAminoMsg { } /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { - proposal_id: Long; - pagination: PageRequestSDKType; + proposal_id: bigint; + pagination?: PageRequestSDKType; } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponse { deposits: Deposit[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDepositsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse"; @@ -366,7 +366,7 @@ export interface QueryDepositsResponseProtoMsg { } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseAmino { - deposits: DepositAmino[]; + deposits?: DepositAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -377,12 +377,12 @@ export interface QueryDepositsResponseAminoMsg { /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } export interface QueryTallyResultRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest"; @@ -391,7 +391,7 @@ export interface QueryTallyResultRequestProtoMsg { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryTallyResultRequestAminoMsg { type: "cosmos-sdk/QueryTallyResultRequest"; @@ -399,7 +399,7 @@ export interface QueryTallyResultRequestAminoMsg { } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestSDKType { - proposal_id: Long; + proposal_id: bigint; } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponse { @@ -425,25 +425,26 @@ export interface QueryTallyResultResponseSDKType { } function createBaseQueryProposalRequest(): QueryProposalRequest { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const QueryProposalRequest = { - encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -454,27 +455,29 @@ export const QueryProposalRequest = { }, fromJSON(object: any): QueryProposalRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: QueryProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryProposalRequest { const message = createBaseQueryProposalRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { @@ -505,14 +508,15 @@ function createBaseQueryProposalResponse(): QueryProposalResponse { }; } export const QueryProposalResponse = { - encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalResponse(); while (reader.pos < end) { @@ -544,9 +548,11 @@ export const QueryProposalResponse = { return message; }, fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - return { - proposal: object?.proposal ? Proposal.fromAmino(object.proposal) : undefined - }; + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; }, toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { const obj: any = {}; @@ -580,11 +586,12 @@ function createBaseQueryProposalsRequest(): QueryProposalsRequest { proposalStatus: 0, voter: "", depositor: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProposalsRequest = { - encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest", + encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalStatus !== 0) { writer.uint32(8).int32(message.proposalStatus); } @@ -599,8 +606,8 @@ export const QueryProposalsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsRequest(); while (reader.pos < end) { @@ -627,7 +634,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -650,18 +657,26 @@ export const QueryProposalsRequest = { return message; }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { - return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, - voter: object.voter, - depositor: object.depositor, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsRequest(); + if (object.proposal_status !== undefined && object.proposal_status !== null) { + message.proposalStatus = object.proposal_status; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { const obj: any = {}; - obj.proposal_status = message.proposalStatus; - obj.voter = message.voter; - obj.depositor = message.depositor; + obj.proposal_status = message.proposalStatus === 0 ? undefined : message.proposalStatus; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.depositor = message.depositor === "" ? undefined : message.depositor; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -690,11 +705,12 @@ export const QueryProposalsRequest = { function createBaseQueryProposalsResponse(): QueryProposalsResponse { return { proposals: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProposalsResponse = { - encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse", + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -703,8 +719,8 @@ export const QueryProposalsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsResponse(); while (reader.pos < end) { @@ -746,17 +762,19 @@ export const QueryProposalsResponse = { return message; }, fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { - return { - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { const obj: any = {}; if (message.proposals) { obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); } else { - obj.proposals = []; + obj.proposals = message.proposals; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -785,13 +803,14 @@ export const QueryProposalsResponse = { }; function createBaseQueryVoteRequest(): QueryVoteRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "" }; } export const QueryVoteRequest = { - encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest", + encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -799,15 +818,15 @@ export const QueryVoteRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -821,32 +840,36 @@ export const QueryVoteRequest = { }, fromJSON(object: any): QueryVoteRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "" }; }, toJSON(message: QueryVoteRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); return obj; }, fromPartial(object: Partial): QueryVoteRequest { const message = createBaseQueryVoteRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; return message; }, fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter - }; + const message = createBaseQueryVoteRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; }, toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; return obj; }, fromAminoMsg(object: QueryVoteRequestAminoMsg): QueryVoteRequest { @@ -877,14 +900,15 @@ function createBaseQueryVoteResponse(): QueryVoteResponse { }; } export const QueryVoteResponse = { - encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse", + encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteResponse(); while (reader.pos < end) { @@ -916,9 +940,11 @@ export const QueryVoteResponse = { return message; }, fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { - return { - vote: object?.vote ? Vote.fromAmino(object.vote) : undefined - }; + const message = createBaseQueryVoteResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; }, toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { const obj: any = {}; @@ -949,13 +975,14 @@ export const QueryVoteResponse = { }; function createBaseQueryVotesRequest(): QueryVotesRequest { return { - proposalId: Long.UZERO, - pagination: PageRequest.fromPartial({}) + proposalId: BigInt(0), + pagination: undefined }; } export const QueryVotesRequest = { - encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest", + encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -963,15 +990,15 @@ export const QueryVotesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -985,31 +1012,35 @@ export const QueryVotesRequest = { }, fromJSON(object: any): QueryVotesRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryVotesRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryVotesRequest { const message = createBaseQueryVotesRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { - return { - proposalId: Long.fromString(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1038,11 +1069,12 @@ export const QueryVotesRequest = { function createBaseQueryVotesResponse(): QueryVotesResponse { return { votes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryVotesResponse = { - encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse", + encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1051,8 +1083,8 @@ export const QueryVotesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesResponse(); while (reader.pos < end) { @@ -1094,17 +1126,19 @@ export const QueryVotesResponse = { return message; }, fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { - return { - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { const obj: any = {}; if (message.votes) { obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1137,14 +1171,15 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { }; } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest", + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.paramsType !== "") { writer.uint32(10).string(message.paramsType); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -1176,13 +1211,15 @@ export const QueryParamsRequest = { return message; }, fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - return { - paramsType: object.params_type - }; + const message = createBaseQueryParamsRequest(); + if (object.params_type !== undefined && object.params_type !== null) { + message.paramsType = object.params_type; + } + return message; }, toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; - obj.params_type = message.paramsType; + obj.params_type = message.paramsType === "" ? undefined : message.paramsType; return obj; }, fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { @@ -1215,7 +1252,8 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingParams !== undefined) { VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); } @@ -1227,8 +1265,8 @@ export const QueryParamsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -1272,11 +1310,17 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -1309,13 +1353,14 @@ export const QueryParamsResponse = { }; function createBaseQueryDepositRequest(): QueryDepositRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "" }; } export const QueryDepositRequest = { - encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest", + encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -1323,15 +1368,15 @@ export const QueryDepositRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -1345,32 +1390,36 @@ export const QueryDepositRequest = { }, fromJSON(object: any): QueryDepositRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), depositor: isSet(object.depositor) ? String(object.depositor) : "" }; }, toJSON(message: QueryDepositRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); return obj; }, fromPartial(object: Partial): QueryDepositRequest { const message = createBaseQueryDepositRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.depositor = object.depositor ?? ""; return message; }, fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { - return { - proposalId: Long.fromString(object.proposal_id), - depositor: object.depositor - }; + const message = createBaseQueryDepositRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; }, toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.depositor = message.depositor; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; return obj; }, fromAminoMsg(object: QueryDepositRequestAminoMsg): QueryDepositRequest { @@ -1401,14 +1450,15 @@ function createBaseQueryDepositResponse(): QueryDepositResponse { }; } export const QueryDepositResponse = { - encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse", + encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deposit !== undefined) { Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositResponse(); while (reader.pos < end) { @@ -1440,9 +1490,11 @@ export const QueryDepositResponse = { return message; }, fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { - return { - deposit: object?.deposit ? Deposit.fromAmino(object.deposit) : undefined - }; + const message = createBaseQueryDepositResponse(); + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; }, toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { const obj: any = {}; @@ -1473,13 +1525,14 @@ export const QueryDepositResponse = { }; function createBaseQueryDepositsRequest(): QueryDepositsRequest { return { - proposalId: Long.UZERO, - pagination: PageRequest.fromPartial({}) + proposalId: BigInt(0), + pagination: undefined }; } export const QueryDepositsRequest = { - encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest", + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -1487,15 +1540,15 @@ export const QueryDepositsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1509,31 +1562,35 @@ export const QueryDepositsRequest = { }, fromJSON(object: any): QueryDepositsRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryDepositsRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryDepositsRequest { const message = createBaseQueryDepositsRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { - return { - proposalId: Long.fromString(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1562,11 +1619,12 @@ export const QueryDepositsRequest = { function createBaseQueryDepositsResponse(): QueryDepositsResponse { return { deposits: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDepositsResponse = { - encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse", + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1575,8 +1633,8 @@ export const QueryDepositsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsResponse(); while (reader.pos < end) { @@ -1618,17 +1676,19 @@ export const QueryDepositsResponse = { return message; }, fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { - return { - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { const obj: any = {}; if (message.deposits) { obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); } else { - obj.deposits = []; + obj.deposits = message.deposits; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1657,25 +1717,26 @@ export const QueryDepositsResponse = { }; function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const QueryTallyResultRequest = { - encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1686,27 +1747,29 @@ export const QueryTallyResultRequest = { }, fromJSON(object: any): QueryTallyResultRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: QueryTallyResultRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryTallyResultRequest { const message = createBaseQueryTallyResultRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { @@ -1737,14 +1800,15 @@ function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { }; } export const QueryTallyResultResponse = { - encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultResponse(); while (reader.pos < end) { @@ -1776,9 +1840,11 @@ export const QueryTallyResultResponse = { return message; }, fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - return { - tally: object?.tally ? TallyResult.fromAmino(object.tally) : undefined - }; + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; }, toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts index 6600e5f9..92982883 100644 --- a/packages/api/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { @@ -28,21 +28,21 @@ export class MsgClientImpl implements Msg { submitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "SubmitProposal", data); - return promise.then(data => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); } vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data); - return promise.then(data => MsgVoteResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); } voteWeighted(request: MsgVoteWeighted): Promise { const data = MsgVoteWeighted.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "VoteWeighted", data); - return promise.then(data => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgVoteWeightedResponse.decode(new BinaryReader(data))); } deposit(request: MsgDeposit): Promise { const data = MsgDeposit.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); - return promise.then(data => MsgDepositResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgDepositResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/gov/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/gov/v1beta1/tx.ts index 97452cc9..de048345 100644 --- a/packages/api/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -1,14 +1,14 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, TextProposal, TextProposalProtoMsg, TextProposalSDKType, voteOptionFromJSON, voteOptionToJSON } from "./gov"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposal { - content: (TextProposal & Any) | undefined; + content?: (TextProposal & Any) | undefined; initialDeposit: Coin[]; proposer: string; } @@ -25,8 +25,8 @@ export type MsgSubmitProposalEncoded = Omit & { */ export interface MsgSubmitProposalAmino { content?: AnyAmino; - initial_deposit: CoinAmino[]; - proposer: string; + initial_deposit?: CoinAmino[]; + proposer?: string; } export interface MsgSubmitProposalAminoMsg { type: "cosmos-sdk/MsgSubmitProposal"; @@ -37,13 +37,13 @@ export interface MsgSubmitProposalAminoMsg { * proposal Content. */ export interface MsgSubmitProposalSDKType { - content: TextProposalSDKType | AnySDKType | undefined; + content?: TextProposalSDKType | AnySDKType | undefined; initial_deposit: CoinSDKType[]; proposer: string; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { - proposalId: Long; + proposalId: bigint; } export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse"; @@ -59,11 +59,11 @@ export interface MsgSubmitProposalResponseAminoMsg { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { - proposal_id: Long; + proposal_id: bigint; } /** MsgVote defines a message to cast a vote. */ export interface MsgVote { - proposalId: Long; + proposalId: bigint; voter: string; option: VoteOption; } @@ -73,9 +73,9 @@ export interface MsgVoteProtoMsg { } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteAmino { - proposal_id: string; - voter: string; - option: VoteOption; + proposal_id?: string; + voter?: string; + option?: VoteOption; } export interface MsgVoteAminoMsg { type: "cosmos-sdk/MsgVote"; @@ -83,7 +83,7 @@ export interface MsgVoteAminoMsg { } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; option: VoteOption; } @@ -107,7 +107,7 @@ export interface MsgVoteResponseSDKType {} * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeighted { - proposalId: Long; + proposalId: bigint; voter: string; options: WeightedVoteOption[]; } @@ -122,8 +122,8 @@ export interface MsgVoteWeightedProtoMsg { */ export interface MsgVoteWeightedAmino { proposal_id: string; - voter: string; - options: WeightedVoteOptionAmino[]; + voter?: string; + options?: WeightedVoteOptionAmino[]; } export interface MsgVoteWeightedAminoMsg { type: "cosmos-sdk/MsgVoteWeighted"; @@ -135,7 +135,7 @@ export interface MsgVoteWeightedAminoMsg { * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeightedSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; options: WeightedVoteOptionSDKType[]; } @@ -167,7 +167,7 @@ export interface MsgVoteWeightedResponseAminoMsg { export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { - proposalId: Long; + proposalId: bigint; depositor: string; amount: Coin[]; } @@ -178,8 +178,8 @@ export interface MsgDepositProtoMsg { /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositAmino { proposal_id: string; - depositor: string; - amount: CoinAmino[]; + depositor?: string; + amount?: CoinAmino[]; } export interface MsgDepositAminoMsg { type: "cosmos-sdk/MsgDeposit"; @@ -187,7 +187,7 @@ export interface MsgDepositAminoMsg { } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositSDKType { - proposal_id: Long; + proposal_id: bigint; depositor: string; amount: CoinSDKType[]; } @@ -213,7 +213,8 @@ function createBaseMsgSubmitProposal(): MsgSubmitProposal { }; } export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); } @@ -225,8 +226,8 @@ export const MsgSubmitProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { @@ -274,11 +275,15 @@ export const MsgSubmitProposal = { return message; }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - return { - content: object?.content ? Content_FromAmino(object.content) : undefined, - initialDeposit: Array.isArray(object?.initial_deposit) ? object.initial_deposit.map((e: any) => Coin.fromAmino(e)) : [], - proposer: object.proposer - }; + const message = createBaseMsgSubmitProposal(); + if (object.content !== undefined && object.content !== null) { + message.content = Content_FromAmino(object.content); + } + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { const obj: any = {}; @@ -286,9 +291,9 @@ export const MsgSubmitProposal = { if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.initial_deposit = []; + obj.initial_deposit = message.initialDeposit; } - obj.proposer = message.proposer; + obj.proposer = message.proposer === "" ? undefined : message.proposer; return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { @@ -315,25 +320,26 @@ export const MsgSubmitProposal = { }; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const MsgSubmitProposalResponse = { - encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -344,27 +350,29 @@ export const MsgSubmitProposalResponse = { }, fromJSON(object: any): MsgSubmitProposalResponse { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: MsgSubmitProposalResponse): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; return obj; }, fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { @@ -391,14 +399,15 @@ export const MsgSubmitProposalResponse = { }; function createBaseMsgVote(): MsgVote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0 }; } export const MsgVote = { - encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -409,15 +418,15 @@ export const MsgVote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -434,37 +443,43 @@ export const MsgVote = { }, fromJSON(object: any): MsgVote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toJSON(message: MsgVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); return obj; }, fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.option = object.option ?? 0; return message; }, fromAmino(object: MsgVoteAmino): MsgVote { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 - }; + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + return message; }, toAmino(message: MsgVote): MsgVoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; - obj.option = message.option; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; return obj; }, fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { @@ -493,11 +508,12 @@ function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteResponse(); while (reader.pos < end) { @@ -522,7 +538,8 @@ export const MsgVoteResponse = { return message; }, fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - return {}; + const message = createBaseMsgVoteResponse(); + return message; }, toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { const obj: any = {}; @@ -552,14 +569,15 @@ export const MsgVoteResponse = { }; function createBaseMsgVoteWeighted(): MsgVoteWeighted { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", options: [] }; } export const MsgVoteWeighted = { - encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -570,15 +588,15 @@ export const MsgVoteWeighted = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeighted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -595,14 +613,14 @@ export const MsgVoteWeighted = { }, fromJSON(object: any): MsgVoteWeighted { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [] }; }, toJSON(message: MsgVoteWeighted): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toJSON(e) : undefined); @@ -613,26 +631,30 @@ export const MsgVoteWeighted = { }, fromPartial(object: Partial): MsgVoteWeighted { const message = createBaseMsgVoteWeighted(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; return message; }, fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] - }; + const message = createBaseMsgVoteWeighted(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; }, toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); } else { - obj.options = []; + obj.options = message.options; } return obj; }, @@ -662,11 +684,12 @@ function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { return {}; } export const MsgVoteWeightedResponse = { - encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse", + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeightedResponse(); while (reader.pos < end) { @@ -691,7 +714,8 @@ export const MsgVoteWeightedResponse = { return message; }, fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - return {}; + const message = createBaseMsgVoteWeightedResponse(); + return message; }, toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { const obj: any = {}; @@ -721,14 +745,15 @@ export const MsgVoteWeightedResponse = { }; function createBaseMsgDeposit(): MsgDeposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [] }; } export const MsgDeposit = { - encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -739,15 +764,15 @@ export const MsgDeposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -764,14 +789,14 @@ export const MsgDeposit = { }, fromJSON(object: any): MsgDeposit { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), depositor: isSet(object.depositor) ? String(object.depositor) : "", amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: MsgDeposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); @@ -782,26 +807,30 @@ export const MsgDeposit = { }, fromPartial(object: Partial): MsgDeposit { const message = createBaseMsgDeposit(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.depositor = object.depositor ?? ""; message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: MsgDepositAmino): MsgDeposit { - return { - proposalId: Long.fromString(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgDeposit): MsgDepositAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.depositor = message.depositor; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.depositor = message.depositor === "" ? undefined : message.depositor; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -831,11 +860,12 @@ function createBaseMsgDepositResponse(): MsgDepositResponse { return {}; } export const MsgDepositResponse = { - encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse", + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDepositResponse(); while (reader.pos < end) { @@ -860,7 +890,8 @@ export const MsgDepositResponse = { return message; }, fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - return {}; + const message = createBaseMsgDepositResponse(); + return message; }, toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { const obj: any = {}; @@ -888,8 +919,8 @@ export const MsgDepositResponse = { }; } }; -export const Content_InterfaceDecoder = (input: _m0.Reader | Uint8Array): TextProposal | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): TextProposal | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.gov.v1beta1.TextProposal": @@ -898,7 +929,7 @@ export const Content_InterfaceDecoder = (input: _m0.Reader | Uint8Array): TextPr return data; } }; -export const Content_FromAmino = (content: AnyAmino) => { +export const Content_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/TextProposal": return Any.fromPartial({ @@ -914,7 +945,7 @@ export const Content_ToAmino = (content: Any) => { case "/cosmos.gov.v1beta1.TextProposal": return { type: "cosmos-sdk/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value)) + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/group/v1/events.ts b/packages/api/src/codegen/cosmos/group/v1/events.ts index 777784b3..6ecd3f54 100644 --- a/packages/api/src/codegen/cosmos/group/v1/events.ts +++ b/packages/api/src/codegen/cosmos/group/v1/events.ts @@ -1,10 +1,10 @@ import { ProposalExecutorResult, proposalExecutorResultFromJSON, proposalExecutorResultToJSON } from "./types"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** EventCreateGroup is an event emitted when a group is created. */ export interface EventCreateGroup { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; } export interface EventCreateGroupProtoMsg { typeUrl: "/cosmos.group.v1.EventCreateGroup"; @@ -13,7 +13,7 @@ export interface EventCreateGroupProtoMsg { /** EventCreateGroup is an event emitted when a group is created. */ export interface EventCreateGroupAmino { /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; } export interface EventCreateGroupAminoMsg { type: "cosmos-sdk/EventCreateGroup"; @@ -21,12 +21,12 @@ export interface EventCreateGroupAminoMsg { } /** EventCreateGroup is an event emitted when a group is created. */ export interface EventCreateGroupSDKType { - group_id: Long; + group_id: bigint; } /** EventUpdateGroup is an event emitted when a group is updated. */ export interface EventUpdateGroup { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; } export interface EventUpdateGroupProtoMsg { typeUrl: "/cosmos.group.v1.EventUpdateGroup"; @@ -35,7 +35,7 @@ export interface EventUpdateGroupProtoMsg { /** EventUpdateGroup is an event emitted when a group is updated. */ export interface EventUpdateGroupAmino { /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; } export interface EventUpdateGroupAminoMsg { type: "cosmos-sdk/EventUpdateGroup"; @@ -43,7 +43,7 @@ export interface EventUpdateGroupAminoMsg { } /** EventUpdateGroup is an event emitted when a group is updated. */ export interface EventUpdateGroupSDKType { - group_id: Long; + group_id: bigint; } /** EventCreateGroupPolicy is an event emitted when a group policy is created. */ export interface EventCreateGroupPolicy { @@ -57,7 +57,7 @@ export interface EventCreateGroupPolicyProtoMsg { /** EventCreateGroupPolicy is an event emitted when a group policy is created. */ export interface EventCreateGroupPolicyAmino { /** address is the account address of the group policy. */ - address: string; + address?: string; } export interface EventCreateGroupPolicyAminoMsg { type: "cosmos-sdk/EventCreateGroupPolicy"; @@ -79,7 +79,7 @@ export interface EventUpdateGroupPolicyProtoMsg { /** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ export interface EventUpdateGroupPolicyAmino { /** address is the account address of the group policy. */ - address: string; + address?: string; } export interface EventUpdateGroupPolicyAminoMsg { type: "cosmos-sdk/EventUpdateGroupPolicy"; @@ -92,7 +92,7 @@ export interface EventUpdateGroupPolicySDKType { /** EventSubmitProposal is an event emitted when a proposal is created. */ export interface EventSubmitProposal { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; } export interface EventSubmitProposalProtoMsg { typeUrl: "/cosmos.group.v1.EventSubmitProposal"; @@ -101,7 +101,7 @@ export interface EventSubmitProposalProtoMsg { /** EventSubmitProposal is an event emitted when a proposal is created. */ export interface EventSubmitProposalAmino { /** proposal_id is the unique ID of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface EventSubmitProposalAminoMsg { type: "cosmos-sdk/EventSubmitProposal"; @@ -109,12 +109,12 @@ export interface EventSubmitProposalAminoMsg { } /** EventSubmitProposal is an event emitted when a proposal is created. */ export interface EventSubmitProposalSDKType { - proposal_id: Long; + proposal_id: bigint; } /** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ export interface EventWithdrawProposal { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; } export interface EventWithdrawProposalProtoMsg { typeUrl: "/cosmos.group.v1.EventWithdrawProposal"; @@ -123,7 +123,7 @@ export interface EventWithdrawProposalProtoMsg { /** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ export interface EventWithdrawProposalAmino { /** proposal_id is the unique ID of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface EventWithdrawProposalAminoMsg { type: "cosmos-sdk/EventWithdrawProposal"; @@ -131,12 +131,12 @@ export interface EventWithdrawProposalAminoMsg { } /** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ export interface EventWithdrawProposalSDKType { - proposal_id: Long; + proposal_id: bigint; } /** EventVote is an event emitted when a voter votes on a proposal. */ export interface EventVote { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; } export interface EventVoteProtoMsg { typeUrl: "/cosmos.group.v1.EventVote"; @@ -145,7 +145,7 @@ export interface EventVoteProtoMsg { /** EventVote is an event emitted when a voter votes on a proposal. */ export interface EventVoteAmino { /** proposal_id is the unique ID of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface EventVoteAminoMsg { type: "cosmos-sdk/EventVote"; @@ -153,12 +153,12 @@ export interface EventVoteAminoMsg { } /** EventVote is an event emitted when a voter votes on a proposal. */ export interface EventVoteSDKType { - proposal_id: Long; + proposal_id: bigint; } /** EventExec is an event emitted when a proposal is executed. */ export interface EventExec { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** result is the proposal execution result. */ result: ProposalExecutorResult; /** logs contains error logs in case the execution result is FAILURE. */ @@ -171,11 +171,11 @@ export interface EventExecProtoMsg { /** EventExec is an event emitted when a proposal is executed. */ export interface EventExecAmino { /** proposal_id is the unique ID of the proposal. */ - proposal_id: string; + proposal_id?: string; /** result is the proposal execution result. */ - result: ProposalExecutorResult; + result?: ProposalExecutorResult; /** logs contains error logs in case the execution result is FAILURE. */ - logs: string; + logs?: string; } export interface EventExecAminoMsg { type: "cosmos-sdk/EventExec"; @@ -183,14 +183,14 @@ export interface EventExecAminoMsg { } /** EventExec is an event emitted when a proposal is executed. */ export interface EventExecSDKType { - proposal_id: Long; + proposal_id: bigint; result: ProposalExecutorResult; logs: string; } /** EventLeaveGroup is an event emitted when group member leaves the group. */ export interface EventLeaveGroup { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** address is the account address of the group member. */ address: string; } @@ -201,9 +201,9 @@ export interface EventLeaveGroupProtoMsg { /** EventLeaveGroup is an event emitted when group member leaves the group. */ export interface EventLeaveGroupAmino { /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; /** address is the account address of the group member. */ - address: string; + address?: string; } export interface EventLeaveGroupAminoMsg { type: "cosmos-sdk/EventLeaveGroup"; @@ -211,30 +211,31 @@ export interface EventLeaveGroupAminoMsg { } /** EventLeaveGroup is an event emitted when group member leaves the group. */ export interface EventLeaveGroupSDKType { - group_id: Long; + group_id: bigint; address: string; } function createBaseEventCreateGroup(): EventCreateGroup { return { - groupId: Long.UZERO + groupId: BigInt(0) }; } export const EventCreateGroup = { - encode(message: EventCreateGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.EventCreateGroup", + encode(message: EventCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateGroup(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -245,27 +246,29 @@ export const EventCreateGroup = { }, fromJSON(object: any): EventCreateGroup { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0) }; }, toJSON(message: EventCreateGroup): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventCreateGroup { const message = createBaseEventCreateGroup(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); return message; }, fromAmino(object: EventCreateGroupAmino): EventCreateGroup { - return { - groupId: Long.fromString(object.group_id) - }; + const message = createBaseEventCreateGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; }, toAmino(message: EventCreateGroup): EventCreateGroupAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; return obj; }, fromAminoMsg(object: EventCreateGroupAminoMsg): EventCreateGroup { @@ -292,25 +295,26 @@ export const EventCreateGroup = { }; function createBaseEventUpdateGroup(): EventUpdateGroup { return { - groupId: Long.UZERO + groupId: BigInt(0) }; } export const EventUpdateGroup = { - encode(message: EventUpdateGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.EventUpdateGroup", + encode(message: EventUpdateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateGroup(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -321,27 +325,29 @@ export const EventUpdateGroup = { }, fromJSON(object: any): EventUpdateGroup { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0) }; }, toJSON(message: EventUpdateGroup): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventUpdateGroup { const message = createBaseEventUpdateGroup(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); return message; }, fromAmino(object: EventUpdateGroupAmino): EventUpdateGroup { - return { - groupId: Long.fromString(object.group_id) - }; + const message = createBaseEventUpdateGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; }, toAmino(message: EventUpdateGroup): EventUpdateGroupAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; return obj; }, fromAminoMsg(object: EventUpdateGroupAminoMsg): EventUpdateGroup { @@ -372,14 +378,15 @@ function createBaseEventCreateGroupPolicy(): EventCreateGroupPolicy { }; } export const EventCreateGroupPolicy = { - encode(message: EventCreateGroupPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy", + encode(message: EventCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateGroupPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateGroupPolicy(); while (reader.pos < end) { @@ -411,13 +418,15 @@ export const EventCreateGroupPolicy = { return message; }, fromAmino(object: EventCreateGroupPolicyAmino): EventCreateGroupPolicy { - return { - address: object.address - }; + const message = createBaseEventCreateGroupPolicy(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: EventCreateGroupPolicy): EventCreateGroupPolicyAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: EventCreateGroupPolicyAminoMsg): EventCreateGroupPolicy { @@ -448,14 +457,15 @@ function createBaseEventUpdateGroupPolicy(): EventUpdateGroupPolicy { }; } export const EventUpdateGroupPolicy = { - encode(message: EventUpdateGroupPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy", + encode(message: EventUpdateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateGroupPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateGroupPolicy(); while (reader.pos < end) { @@ -487,13 +497,15 @@ export const EventUpdateGroupPolicy = { return message; }, fromAmino(object: EventUpdateGroupPolicyAmino): EventUpdateGroupPolicy { - return { - address: object.address - }; + const message = createBaseEventUpdateGroupPolicy(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: EventUpdateGroupPolicyAminoMsg): EventUpdateGroupPolicy { @@ -520,25 +532,26 @@ export const EventUpdateGroupPolicy = { }; function createBaseEventSubmitProposal(): EventSubmitProposal { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const EventSubmitProposal = { - encode(message: EventSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.EventSubmitProposal", + encode(message: EventSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSubmitProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -549,27 +562,29 @@ export const EventSubmitProposal = { }, fromJSON(object: any): EventSubmitProposal { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: EventSubmitProposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventSubmitProposal { const message = createBaseEventSubmitProposal(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: EventSubmitProposalAmino): EventSubmitProposal { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseEventSubmitProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: EventSubmitProposal): EventSubmitProposalAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: EventSubmitProposalAminoMsg): EventSubmitProposal { @@ -596,25 +611,26 @@ export const EventSubmitProposal = { }; function createBaseEventWithdrawProposal(): EventWithdrawProposal { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const EventWithdrawProposal = { - encode(message: EventWithdrawProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal", + encode(message: EventWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdrawProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventWithdrawProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -625,27 +641,29 @@ export const EventWithdrawProposal = { }, fromJSON(object: any): EventWithdrawProposal { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: EventWithdrawProposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventWithdrawProposal { const message = createBaseEventWithdrawProposal(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: EventWithdrawProposalAmino): EventWithdrawProposal { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseEventWithdrawProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: EventWithdrawProposal): EventWithdrawProposalAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: EventWithdrawProposalAminoMsg): EventWithdrawProposal { @@ -672,25 +690,26 @@ export const EventWithdrawProposal = { }; function createBaseEventVote(): EventVote { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const EventVote = { - encode(message: EventVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.EventVote", + encode(message: EventVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -701,27 +720,29 @@ export const EventVote = { }, fromJSON(object: any): EventVote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: EventVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventVote { const message = createBaseEventVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: EventVoteAmino): EventVote { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseEventVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: EventVote): EventVoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: EventVoteAminoMsg): EventVote { @@ -748,14 +769,15 @@ export const EventVote = { }; function createBaseEventExec(): EventExec { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), result: 0, logs: "" }; } export const EventExec = { - encode(message: EventExec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.EventExec", + encode(message: EventExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.result !== 0) { @@ -766,15 +788,15 @@ export const EventExec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventExec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventExec(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.result = (reader.int32() as any); @@ -791,37 +813,43 @@ export const EventExec = { }, fromJSON(object: any): EventExec { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1, logs: isSet(object.logs) ? String(object.logs) : "" }; }, toJSON(message: EventExec): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.result !== undefined && (obj.result = proposalExecutorResultToJSON(message.result)); message.logs !== undefined && (obj.logs = message.logs); return obj; }, fromPartial(object: Partial): EventExec { const message = createBaseEventExec(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.result = object.result ?? 0; message.logs = object.logs ?? ""; return message; }, fromAmino(object: EventExecAmino): EventExec { - return { - proposalId: Long.fromString(object.proposal_id), - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0, - logs: object.logs - }; + const message = createBaseEventExec(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + if (object.logs !== undefined && object.logs !== null) { + message.logs = object.logs; + } + return message; }, toAmino(message: EventExec): EventExecAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.result = message.result; - obj.logs = message.logs; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.result = message.result === 0 ? undefined : message.result; + obj.logs = message.logs === "" ? undefined : message.logs; return obj; }, fromAminoMsg(object: EventExecAminoMsg): EventExec { @@ -848,13 +876,14 @@ export const EventExec = { }; function createBaseEventLeaveGroup(): EventLeaveGroup { return { - groupId: Long.UZERO, + groupId: BigInt(0), address: "" }; } export const EventLeaveGroup = { - encode(message: EventLeaveGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.EventLeaveGroup", + encode(message: EventLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.address !== "") { @@ -862,15 +891,15 @@ export const EventLeaveGroup = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventLeaveGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventLeaveGroup(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 2: message.address = reader.string(); @@ -884,32 +913,36 @@ export const EventLeaveGroup = { }, fromJSON(object: any): EventLeaveGroup { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), address: isSet(object.address) ? String(object.address) : "" }; }, toJSON(message: EventLeaveGroup): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.address !== undefined && (obj.address = message.address); return obj; }, fromPartial(object: Partial): EventLeaveGroup { const message = createBaseEventLeaveGroup(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.address = object.address ?? ""; return message; }, fromAmino(object: EventLeaveGroupAmino): EventLeaveGroup { - return { - groupId: Long.fromString(object.group_id), - address: object.address - }; + const message = createBaseEventLeaveGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: EventLeaveGroup): EventLeaveGroupAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; - obj.address = message.address; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: EventLeaveGroupAminoMsg): EventLeaveGroup { diff --git a/packages/api/src/codegen/cosmos/group/v1/genesis.ts b/packages/api/src/codegen/cosmos/group/v1/genesis.ts index f044a9f7..121cf75b 100644 --- a/packages/api/src/codegen/cosmos/group/v1/genesis.ts +++ b/packages/api/src/codegen/cosmos/group/v1/genesis.ts @@ -1,13 +1,13 @@ import { GroupInfo, GroupInfoAmino, GroupInfoSDKType, GroupMember, GroupMemberAmino, GroupMemberSDKType, GroupPolicyInfo, GroupPolicyInfoAmino, GroupPolicyInfoSDKType, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType } from "./types"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** GenesisState defines the group module's genesis state. */ export interface GenesisState { /** * group_seq is the group table orm.Sequence, * it is used to get the next group ID. */ - groupSeq: Long; + groupSeq: bigint; /** groups is the list of groups info. */ groups: GroupInfo[]; /** group_members is the list of groups members. */ @@ -16,14 +16,14 @@ export interface GenesisState { * group_policy_seq is the group policy table orm.Sequence, * it is used to generate the next group policy account address. */ - groupPolicySeq: Long; + groupPolicySeq: bigint; /** group_policies is the list of group policies info. */ groupPolicies: GroupPolicyInfo[]; /** * proposal_seq is the proposal table orm.Sequence, * it is used to get the next proposal ID. */ - proposalSeq: Long; + proposalSeq: bigint; /** proposals is the list of proposals. */ proposals: Proposal[]; /** votes is the list of votes. */ @@ -39,27 +39,27 @@ export interface GenesisStateAmino { * group_seq is the group table orm.Sequence, * it is used to get the next group ID. */ - group_seq: string; + group_seq?: string; /** groups is the list of groups info. */ - groups: GroupInfoAmino[]; + groups?: GroupInfoAmino[]; /** group_members is the list of groups members. */ - group_members: GroupMemberAmino[]; + group_members?: GroupMemberAmino[]; /** * group_policy_seq is the group policy table orm.Sequence, * it is used to generate the next group policy account address. */ - group_policy_seq: string; + group_policy_seq?: string; /** group_policies is the list of group policies info. */ - group_policies: GroupPolicyInfoAmino[]; + group_policies?: GroupPolicyInfoAmino[]; /** * proposal_seq is the proposal table orm.Sequence, * it is used to get the next proposal ID. */ - proposal_seq: string; + proposal_seq?: string; /** proposals is the list of proposals. */ - proposals: ProposalAmino[]; + proposals?: ProposalAmino[]; /** votes is the list of votes. */ - votes: VoteAmino[]; + votes?: VoteAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -67,30 +67,31 @@ export interface GenesisStateAminoMsg { } /** GenesisState defines the group module's genesis state. */ export interface GenesisStateSDKType { - group_seq: Long; + group_seq: bigint; groups: GroupInfoSDKType[]; group_members: GroupMemberSDKType[]; - group_policy_seq: Long; + group_policy_seq: bigint; group_policies: GroupPolicyInfoSDKType[]; - proposal_seq: Long; + proposal_seq: bigint; proposals: ProposalSDKType[]; votes: VoteSDKType[]; } function createBaseGenesisState(): GenesisState { return { - groupSeq: Long.UZERO, + groupSeq: BigInt(0), groups: [], groupMembers: [], - groupPolicySeq: Long.UZERO, + groupPolicySeq: BigInt(0), groupPolicies: [], - proposalSeq: Long.UZERO, + proposalSeq: BigInt(0), proposals: [], votes: [] }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupSeq.isZero()) { + typeUrl: "/cosmos.group.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupSeq !== BigInt(0)) { writer.uint32(8).uint64(message.groupSeq); } for (const v of message.groups) { @@ -99,13 +100,13 @@ export const GenesisState = { for (const v of message.groupMembers) { GroupMember.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (!message.groupPolicySeq.isZero()) { + if (message.groupPolicySeq !== BigInt(0)) { writer.uint32(32).uint64(message.groupPolicySeq); } for (const v of message.groupPolicies) { GroupPolicyInfo.encode(v!, writer.uint32(42).fork()).ldelim(); } - if (!message.proposalSeq.isZero()) { + if (message.proposalSeq !== BigInt(0)) { writer.uint32(48).uint64(message.proposalSeq); } for (const v of message.proposals) { @@ -116,15 +117,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupSeq = (reader.uint64() as Long); + message.groupSeq = reader.uint64(); break; case 2: message.groups.push(GroupInfo.decode(reader, reader.uint32())); @@ -133,13 +134,13 @@ export const GenesisState = { message.groupMembers.push(GroupMember.decode(reader, reader.uint32())); break; case 4: - message.groupPolicySeq = (reader.uint64() as Long); + message.groupPolicySeq = reader.uint64(); break; case 5: message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); break; case 6: - message.proposalSeq = (reader.uint64() as Long); + message.proposalSeq = reader.uint64(); break; case 7: message.proposals.push(Proposal.decode(reader, reader.uint32())); @@ -156,19 +157,19 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { return { - groupSeq: isSet(object.groupSeq) ? Long.fromValue(object.groupSeq) : Long.UZERO, + groupSeq: isSet(object.groupSeq) ? BigInt(object.groupSeq.toString()) : BigInt(0), groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupInfo.fromJSON(e)) : [], groupMembers: Array.isArray(object?.groupMembers) ? object.groupMembers.map((e: any) => GroupMember.fromJSON(e)) : [], - groupPolicySeq: isSet(object.groupPolicySeq) ? Long.fromValue(object.groupPolicySeq) : Long.UZERO, + groupPolicySeq: isSet(object.groupPolicySeq) ? BigInt(object.groupPolicySeq.toString()) : BigInt(0), groupPolicies: Array.isArray(object?.groupPolicies) ? object.groupPolicies.map((e: any) => GroupPolicyInfo.fromJSON(e)) : [], - proposalSeq: isSet(object.proposalSeq) ? Long.fromValue(object.proposalSeq) : Long.UZERO, + proposalSeq: isSet(object.proposalSeq) ? BigInt(object.proposalSeq.toString()) : BigInt(0), proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [] }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.groupSeq !== undefined && (obj.groupSeq = (message.groupSeq || Long.UZERO).toString()); + message.groupSeq !== undefined && (obj.groupSeq = (message.groupSeq || BigInt(0)).toString()); if (message.groups) { obj.groups = message.groups.map(e => e ? GroupInfo.toJSON(e) : undefined); } else { @@ -179,13 +180,13 @@ export const GenesisState = { } else { obj.groupMembers = []; } - message.groupPolicySeq !== undefined && (obj.groupPolicySeq = (message.groupPolicySeq || Long.UZERO).toString()); + message.groupPolicySeq !== undefined && (obj.groupPolicySeq = (message.groupPolicySeq || BigInt(0)).toString()); if (message.groupPolicies) { obj.groupPolicies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toJSON(e) : undefined); } else { obj.groupPolicies = []; } - message.proposalSeq !== undefined && (obj.proposalSeq = (message.proposalSeq || Long.UZERO).toString()); + message.proposalSeq !== undefined && (obj.proposalSeq = (message.proposalSeq || BigInt(0)).toString()); if (message.proposals) { obj.proposals = message.proposals.map(e => e ? Proposal.toJSON(e) : undefined); } else { @@ -200,57 +201,63 @@ export const GenesisState = { }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); - message.groupSeq = object.groupSeq !== undefined && object.groupSeq !== null ? Long.fromValue(object.groupSeq) : Long.UZERO; + message.groupSeq = object.groupSeq !== undefined && object.groupSeq !== null ? BigInt(object.groupSeq.toString()) : BigInt(0); message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; message.groupMembers = object.groupMembers?.map(e => GroupMember.fromPartial(e)) || []; - message.groupPolicySeq = object.groupPolicySeq !== undefined && object.groupPolicySeq !== null ? Long.fromValue(object.groupPolicySeq) : Long.UZERO; + message.groupPolicySeq = object.groupPolicySeq !== undefined && object.groupPolicySeq !== null ? BigInt(object.groupPolicySeq.toString()) : BigInt(0); message.groupPolicies = object.groupPolicies?.map(e => GroupPolicyInfo.fromPartial(e)) || []; - message.proposalSeq = object.proposalSeq !== undefined && object.proposalSeq !== null ? Long.fromValue(object.proposalSeq) : Long.UZERO; + message.proposalSeq = object.proposalSeq !== undefined && object.proposalSeq !== null ? BigInt(object.proposalSeq.toString()) : BigInt(0); message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - groupSeq: Long.fromString(object.group_seq), - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupInfo.fromAmino(e)) : [], - groupMembers: Array.isArray(object?.group_members) ? object.group_members.map((e: any) => GroupMember.fromAmino(e)) : [], - groupPolicySeq: Long.fromString(object.group_policy_seq), - groupPolicies: Array.isArray(object?.group_policies) ? object.group_policies.map((e: any) => GroupPolicyInfo.fromAmino(e)) : [], - proposalSeq: Long.fromString(object.proposal_seq), - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.group_seq !== undefined && object.group_seq !== null) { + message.groupSeq = BigInt(object.group_seq); + } + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + message.groupMembers = object.group_members?.map(e => GroupMember.fromAmino(e)) || []; + if (object.group_policy_seq !== undefined && object.group_policy_seq !== null) { + message.groupPolicySeq = BigInt(object.group_policy_seq); + } + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.proposal_seq !== undefined && object.proposal_seq !== null) { + message.proposalSeq = BigInt(object.proposal_seq); + } + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.group_seq = message.groupSeq ? message.groupSeq.toString() : undefined; + obj.group_seq = message.groupSeq !== BigInt(0) ? message.groupSeq.toString() : undefined; if (message.groups) { obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); } else { - obj.groups = []; + obj.groups = message.groups; } if (message.groupMembers) { obj.group_members = message.groupMembers.map(e => e ? GroupMember.toAmino(e) : undefined); } else { - obj.group_members = []; + obj.group_members = message.groupMembers; } - obj.group_policy_seq = message.groupPolicySeq ? message.groupPolicySeq.toString() : undefined; + obj.group_policy_seq = message.groupPolicySeq !== BigInt(0) ? message.groupPolicySeq.toString() : undefined; if (message.groupPolicies) { obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); } else { - obj.group_policies = []; + obj.group_policies = message.groupPolicies; } - obj.proposal_seq = message.proposalSeq ? message.proposalSeq.toString() : undefined; + obj.proposal_seq = message.proposalSeq !== BigInt(0) ? message.proposalSeq.toString() : undefined; if (message.proposals) { obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); } else { - obj.proposals = []; + obj.proposals = message.proposals; } if (message.votes) { obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/group/v1/query.lcd.ts b/packages/api/src/codegen/cosmos/group/v1/query.lcd.ts index 469fb118..ce566ae2 100644 --- a/packages/api/src/codegen/cosmos/group/v1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/group/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryGroupInfoRequest, QueryGroupInfoResponseSDKType, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponseSDKType, QueryGroupMembersRequest, QueryGroupMembersResponseSDKType, QueryGroupsByAdminRequest, QueryGroupsByAdminResponseSDKType, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponseSDKType, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponseSDKType, QueryProposalRequest, QueryProposalResponseSDKType, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponseSDKType, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponseSDKType, QueryVotesByProposalRequest, QueryVotesByProposalResponseSDKType, QueryVotesByVoterRequest, QueryVotesByVoterResponseSDKType, QueryGroupsByMemberRequest, QueryGroupsByMemberResponseSDKType, QueryTallyResultRequest, QueryTallyResultResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/group/v1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/group/v1/query.rpc.Query.ts index 7d33e5e4..56db44e0 100644 --- a/packages/api/src/codegen/cosmos/group/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/group/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; /** Query is the cosmos.group.v1 Query service. */ @@ -58,67 +58,67 @@ export class QueryClientImpl implements Query { groupInfo(request: QueryGroupInfoRequest): Promise { const data = QueryGroupInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupInfo", data); - return promise.then(data => QueryGroupInfoResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGroupInfoResponse.decode(new BinaryReader(data))); } groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise { const data = QueryGroupPolicyInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPolicyInfo", data); - return promise.then(data => QueryGroupPolicyInfoResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGroupPolicyInfoResponse.decode(new BinaryReader(data))); } groupMembers(request: QueryGroupMembersRequest): Promise { const data = QueryGroupMembersRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupMembers", data); - return promise.then(data => QueryGroupMembersResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGroupMembersResponse.decode(new BinaryReader(data))); } groupsByAdmin(request: QueryGroupsByAdminRequest): Promise { const data = QueryGroupsByAdminRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByAdmin", data); - return promise.then(data => QueryGroupsByAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGroupsByAdminResponse.decode(new BinaryReader(data))); } groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise { const data = QueryGroupPoliciesByGroupRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByGroup", data); - return promise.then(data => QueryGroupPoliciesByGroupResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGroupPoliciesByGroupResponse.decode(new BinaryReader(data))); } groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise { const data = QueryGroupPoliciesByAdminRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByAdmin", data); - return promise.then(data => QueryGroupPoliciesByAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGroupPoliciesByAdminResponse.decode(new BinaryReader(data))); } proposal(request: QueryProposalRequest): Promise { const data = QueryProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "Proposal", data); - return promise.then(data => QueryProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); } proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise { const data = QueryProposalsByGroupPolicyRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "ProposalsByGroupPolicy", data); - return promise.then(data => QueryProposalsByGroupPolicyResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProposalsByGroupPolicyResponse.decode(new BinaryReader(data))); } voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise { const data = QueryVoteByProposalVoterRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "VoteByProposalVoter", data); - return promise.then(data => QueryVoteByProposalVoterResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryVoteByProposalVoterResponse.decode(new BinaryReader(data))); } votesByProposal(request: QueryVotesByProposalRequest): Promise { const data = QueryVotesByProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByProposal", data); - return promise.then(data => QueryVotesByProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryVotesByProposalResponse.decode(new BinaryReader(data))); } votesByVoter(request: QueryVotesByVoterRequest): Promise { const data = QueryVotesByVoterRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByVoter", data); - return promise.then(data => QueryVotesByVoterResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryVotesByVoterResponse.decode(new BinaryReader(data))); } groupsByMember(request: QueryGroupsByMemberRequest): Promise { const data = QueryGroupsByMemberRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByMember", data); - return promise.then(data => QueryGroupsByMemberResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryGroupsByMemberResponse.decode(new BinaryReader(data))); } tallyResult(request: QueryTallyResultRequest): Promise { const data = QueryTallyResultRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data); - return promise.then(data => QueryTallyResultResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/group/v1/query.ts b/packages/api/src/codegen/cosmos/group/v1/query.ts index bc8c5772..531545d9 100644 --- a/packages/api/src/codegen/cosmos/group/v1/query.ts +++ b/packages/api/src/codegen/cosmos/group/v1/query.ts @@ -1,11 +1,11 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { GroupInfo, GroupInfoAmino, GroupInfoSDKType, GroupPolicyInfo, GroupPolicyInfoAmino, GroupPolicyInfoSDKType, GroupMember, GroupMemberAmino, GroupMemberSDKType, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, TallyResult, TallyResultAmino, TallyResultSDKType } from "./types"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** QueryGroupInfoRequest is the Query/GroupInfo request type. */ export interface QueryGroupInfoRequest { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; } export interface QueryGroupInfoRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest"; @@ -14,7 +14,7 @@ export interface QueryGroupInfoRequestProtoMsg { /** QueryGroupInfoRequest is the Query/GroupInfo request type. */ export interface QueryGroupInfoRequestAmino { /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; } export interface QueryGroupInfoRequestAminoMsg { type: "cosmos-sdk/QueryGroupInfoRequest"; @@ -22,12 +22,12 @@ export interface QueryGroupInfoRequestAminoMsg { } /** QueryGroupInfoRequest is the Query/GroupInfo request type. */ export interface QueryGroupInfoRequestSDKType { - group_id: Long; + group_id: bigint; } /** QueryGroupInfoResponse is the Query/GroupInfo response type. */ export interface QueryGroupInfoResponse { /** info is the GroupInfo for the group. */ - info: GroupInfo; + info?: GroupInfo; } export interface QueryGroupInfoResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse"; @@ -44,7 +44,7 @@ export interface QueryGroupInfoResponseAminoMsg { } /** QueryGroupInfoResponse is the Query/GroupInfo response type. */ export interface QueryGroupInfoResponseSDKType { - info: GroupInfoSDKType; + info?: GroupInfoSDKType; } /** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ export interface QueryGroupPolicyInfoRequest { @@ -58,7 +58,7 @@ export interface QueryGroupPolicyInfoRequestProtoMsg { /** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ export interface QueryGroupPolicyInfoRequestAmino { /** address is the account address of the group policy. */ - address: string; + address?: string; } export interface QueryGroupPolicyInfoRequestAminoMsg { type: "cosmos-sdk/QueryGroupPolicyInfoRequest"; @@ -71,7 +71,7 @@ export interface QueryGroupPolicyInfoRequestSDKType { /** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ export interface QueryGroupPolicyInfoResponse { /** info is the GroupPolicyInfo for the group policy. */ - info: GroupPolicyInfo; + info?: GroupPolicyInfo; } export interface QueryGroupPolicyInfoResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse"; @@ -88,14 +88,14 @@ export interface QueryGroupPolicyInfoResponseAminoMsg { } /** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ export interface QueryGroupPolicyInfoResponseSDKType { - info: GroupPolicyInfoSDKType; + info?: GroupPolicyInfoSDKType; } /** QueryGroupMembersRequest is the Query/GroupMembers request type. */ export interface QueryGroupMembersRequest { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGroupMembersRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest"; @@ -104,7 +104,7 @@ export interface QueryGroupMembersRequestProtoMsg { /** QueryGroupMembersRequest is the Query/GroupMembers request type. */ export interface QueryGroupMembersRequestAmino { /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -114,15 +114,15 @@ export interface QueryGroupMembersRequestAminoMsg { } /** QueryGroupMembersRequest is the Query/GroupMembers request type. */ export interface QueryGroupMembersRequestSDKType { - group_id: Long; - pagination: PageRequestSDKType; + group_id: bigint; + pagination?: PageRequestSDKType; } /** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ export interface QueryGroupMembersResponse { /** members are the members of the group with given group_id. */ members: GroupMember[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGroupMembersResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse"; @@ -131,7 +131,7 @@ export interface QueryGroupMembersResponseProtoMsg { /** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ export interface QueryGroupMembersResponseAmino { /** members are the members of the group with given group_id. */ - members: GroupMemberAmino[]; + members?: GroupMemberAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -142,14 +142,14 @@ export interface QueryGroupMembersResponseAminoMsg { /** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ export interface QueryGroupMembersResponseSDKType { members: GroupMemberSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ export interface QueryGroupsByAdminRequest { /** admin is the account address of a group's admin. */ admin: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGroupsByAdminRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest"; @@ -158,7 +158,7 @@ export interface QueryGroupsByAdminRequestProtoMsg { /** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ export interface QueryGroupsByAdminRequestAmino { /** admin is the account address of a group's admin. */ - admin: string; + admin?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -169,14 +169,14 @@ export interface QueryGroupsByAdminRequestAminoMsg { /** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ export interface QueryGroupsByAdminRequestSDKType { admin: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ export interface QueryGroupsByAdminResponse { /** groups are the groups info with the provided admin. */ groups: GroupInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGroupsByAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse"; @@ -185,7 +185,7 @@ export interface QueryGroupsByAdminResponseProtoMsg { /** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ export interface QueryGroupsByAdminResponseAmino { /** groups are the groups info with the provided admin. */ - groups: GroupInfoAmino[]; + groups?: GroupInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -196,14 +196,14 @@ export interface QueryGroupsByAdminResponseAminoMsg { /** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ export interface QueryGroupsByAdminResponseSDKType { groups: GroupInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ export interface QueryGroupPoliciesByGroupRequest { /** group_id is the unique ID of the group policy's group. */ - groupId: Long; + groupId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGroupPoliciesByGroupRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest"; @@ -212,7 +212,7 @@ export interface QueryGroupPoliciesByGroupRequestProtoMsg { /** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ export interface QueryGroupPoliciesByGroupRequestAmino { /** group_id is the unique ID of the group policy's group. */ - group_id: string; + group_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -222,15 +222,15 @@ export interface QueryGroupPoliciesByGroupRequestAminoMsg { } /** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ export interface QueryGroupPoliciesByGroupRequestSDKType { - group_id: Long; - pagination: PageRequestSDKType; + group_id: bigint; + pagination?: PageRequestSDKType; } /** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ export interface QueryGroupPoliciesByGroupResponse { /** group_policies are the group policies info associated with the provided group. */ groupPolicies: GroupPolicyInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGroupPoliciesByGroupResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse"; @@ -239,7 +239,7 @@ export interface QueryGroupPoliciesByGroupResponseProtoMsg { /** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ export interface QueryGroupPoliciesByGroupResponseAmino { /** group_policies are the group policies info associated with the provided group. */ - group_policies: GroupPolicyInfoAmino[]; + group_policies?: GroupPolicyInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -250,14 +250,14 @@ export interface QueryGroupPoliciesByGroupResponseAminoMsg { /** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ export interface QueryGroupPoliciesByGroupResponseSDKType { group_policies: GroupPolicyInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ export interface QueryGroupPoliciesByAdminRequest { /** admin is the admin address of the group policy. */ admin: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGroupPoliciesByAdminRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest"; @@ -266,7 +266,7 @@ export interface QueryGroupPoliciesByAdminRequestProtoMsg { /** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ export interface QueryGroupPoliciesByAdminRequestAmino { /** admin is the admin address of the group policy. */ - admin: string; + admin?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -277,14 +277,14 @@ export interface QueryGroupPoliciesByAdminRequestAminoMsg { /** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ export interface QueryGroupPoliciesByAdminRequestSDKType { admin: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ export interface QueryGroupPoliciesByAdminResponse { /** group_policies are the group policies info with provided admin. */ groupPolicies: GroupPolicyInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGroupPoliciesByAdminResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse"; @@ -293,7 +293,7 @@ export interface QueryGroupPoliciesByAdminResponseProtoMsg { /** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ export interface QueryGroupPoliciesByAdminResponseAmino { /** group_policies are the group policies info with provided admin. */ - group_policies: GroupPolicyInfoAmino[]; + group_policies?: GroupPolicyInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -304,12 +304,12 @@ export interface QueryGroupPoliciesByAdminResponseAminoMsg { /** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ export interface QueryGroupPoliciesByAdminResponseSDKType { group_policies: GroupPolicyInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryProposalRequest is the Query/Proposal request type. */ export interface QueryProposalRequest { /** proposal_id is the unique ID of a proposal. */ - proposalId: Long; + proposalId: bigint; } export interface QueryProposalRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalRequest"; @@ -318,7 +318,7 @@ export interface QueryProposalRequestProtoMsg { /** QueryProposalRequest is the Query/Proposal request type. */ export interface QueryProposalRequestAmino { /** proposal_id is the unique ID of a proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryProposalRequestAminoMsg { type: "cosmos-sdk/QueryProposalRequest"; @@ -326,12 +326,12 @@ export interface QueryProposalRequestAminoMsg { } /** QueryProposalRequest is the Query/Proposal request type. */ export interface QueryProposalRequestSDKType { - proposal_id: Long; + proposal_id: bigint; } /** QueryProposalResponse is the Query/Proposal response type. */ export interface QueryProposalResponse { /** proposal is the proposal info. */ - proposal: Proposal; + proposal?: Proposal; } export interface QueryProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalResponse"; @@ -348,14 +348,14 @@ export interface QueryProposalResponseAminoMsg { } /** QueryProposalResponse is the Query/Proposal response type. */ export interface QueryProposalResponseSDKType { - proposal: ProposalSDKType; + proposal?: ProposalSDKType; } /** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ export interface QueryProposalsByGroupPolicyRequest { /** address is the account address of the group policy related to proposals. */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProposalsByGroupPolicyRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest"; @@ -364,7 +364,7 @@ export interface QueryProposalsByGroupPolicyRequestProtoMsg { /** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ export interface QueryProposalsByGroupPolicyRequestAmino { /** address is the account address of the group policy related to proposals. */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -375,14 +375,14 @@ export interface QueryProposalsByGroupPolicyRequestAminoMsg { /** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ export interface QueryProposalsByGroupPolicyRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ export interface QueryProposalsByGroupPolicyResponse { /** proposals are the proposals with given group policy. */ proposals: Proposal[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProposalsByGroupPolicyResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse"; @@ -391,7 +391,7 @@ export interface QueryProposalsByGroupPolicyResponseProtoMsg { /** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ export interface QueryProposalsByGroupPolicyResponseAmino { /** proposals are the proposals with given group policy. */ - proposals: ProposalAmino[]; + proposals?: ProposalAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -402,12 +402,12 @@ export interface QueryProposalsByGroupPolicyResponseAminoMsg { /** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ export interface QueryProposalsByGroupPolicyResponseSDKType { proposals: ProposalSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ export interface QueryVoteByProposalVoterRequest { /** proposal_id is the unique ID of a proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is a proposal voter account address. */ voter: string; } @@ -418,9 +418,9 @@ export interface QueryVoteByProposalVoterRequestProtoMsg { /** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ export interface QueryVoteByProposalVoterRequestAmino { /** proposal_id is the unique ID of a proposal. */ - proposal_id: string; + proposal_id?: string; /** voter is a proposal voter account address. */ - voter: string; + voter?: string; } export interface QueryVoteByProposalVoterRequestAminoMsg { type: "cosmos-sdk/QueryVoteByProposalVoterRequest"; @@ -428,13 +428,13 @@ export interface QueryVoteByProposalVoterRequestAminoMsg { } /** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ export interface QueryVoteByProposalVoterRequestSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; } /** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ export interface QueryVoteByProposalVoterResponse { /** vote is the vote with given proposal_id and voter. */ - vote: Vote; + vote?: Vote; } export interface QueryVoteByProposalVoterResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse"; @@ -451,14 +451,14 @@ export interface QueryVoteByProposalVoterResponseAminoMsg { } /** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ export interface QueryVoteByProposalVoterResponseSDKType { - vote: VoteSDKType; + vote?: VoteSDKType; } /** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ export interface QueryVotesByProposalRequest { /** proposal_id is the unique ID of a proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryVotesByProposalRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest"; @@ -467,7 +467,7 @@ export interface QueryVotesByProposalRequestProtoMsg { /** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ export interface QueryVotesByProposalRequestAmino { /** proposal_id is the unique ID of a proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -477,15 +477,15 @@ export interface QueryVotesByProposalRequestAminoMsg { } /** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ export interface QueryVotesByProposalRequestSDKType { - proposal_id: Long; - pagination: PageRequestSDKType; + proposal_id: bigint; + pagination?: PageRequestSDKType; } /** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ export interface QueryVotesByProposalResponse { /** votes are the list of votes for given proposal_id. */ votes: Vote[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryVotesByProposalResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse"; @@ -494,7 +494,7 @@ export interface QueryVotesByProposalResponseProtoMsg { /** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ export interface QueryVotesByProposalResponseAmino { /** votes are the list of votes for given proposal_id. */ - votes: VoteAmino[]; + votes?: VoteAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -505,14 +505,14 @@ export interface QueryVotesByProposalResponseAminoMsg { /** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ export interface QueryVotesByProposalResponseSDKType { votes: VoteSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ export interface QueryVotesByVoterRequest { /** voter is a proposal voter account address. */ voter: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryVotesByVoterRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest"; @@ -521,7 +521,7 @@ export interface QueryVotesByVoterRequestProtoMsg { /** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ export interface QueryVotesByVoterRequestAmino { /** voter is a proposal voter account address. */ - voter: string; + voter?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -532,14 +532,14 @@ export interface QueryVotesByVoterRequestAminoMsg { /** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ export interface QueryVotesByVoterRequestSDKType { voter: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ export interface QueryVotesByVoterResponse { /** votes are the list of votes by given voter. */ votes: Vote[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryVotesByVoterResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse"; @@ -548,7 +548,7 @@ export interface QueryVotesByVoterResponseProtoMsg { /** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ export interface QueryVotesByVoterResponseAmino { /** votes are the list of votes by given voter. */ - votes: VoteAmino[]; + votes?: VoteAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -559,14 +559,14 @@ export interface QueryVotesByVoterResponseAminoMsg { /** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ export interface QueryVotesByVoterResponseSDKType { votes: VoteSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ export interface QueryGroupsByMemberRequest { /** address is the group member address. */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGroupsByMemberRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest"; @@ -575,7 +575,7 @@ export interface QueryGroupsByMemberRequestProtoMsg { /** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ export interface QueryGroupsByMemberRequestAmino { /** address is the group member address. */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -586,14 +586,14 @@ export interface QueryGroupsByMemberRequestAminoMsg { /** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ export interface QueryGroupsByMemberRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ export interface QueryGroupsByMemberResponse { /** groups are the groups info with the provided group member. */ groups: GroupInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGroupsByMemberResponseProtoMsg { typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse"; @@ -602,7 +602,7 @@ export interface QueryGroupsByMemberResponseProtoMsg { /** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ export interface QueryGroupsByMemberResponseAmino { /** groups are the groups info with the provided group member. */ - groups: GroupInfoAmino[]; + groups?: GroupInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -613,12 +613,12 @@ export interface QueryGroupsByMemberResponseAminoMsg { /** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ export interface QueryGroupsByMemberResponseSDKType { groups: GroupInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryTallyResultRequest is the Query/TallyResult request type. */ export interface QueryTallyResultRequest { /** proposal_id is the unique id of a proposal. */ - proposalId: Long; + proposalId: bigint; } export interface QueryTallyResultRequestProtoMsg { typeUrl: "/cosmos.group.v1.QueryTallyResultRequest"; @@ -627,7 +627,7 @@ export interface QueryTallyResultRequestProtoMsg { /** QueryTallyResultRequest is the Query/TallyResult request type. */ export interface QueryTallyResultRequestAmino { /** proposal_id is the unique id of a proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryTallyResultRequestAminoMsg { type: "cosmos-sdk/QueryTallyResultRequest"; @@ -635,7 +635,7 @@ export interface QueryTallyResultRequestAminoMsg { } /** QueryTallyResultRequest is the Query/TallyResult request type. */ export interface QueryTallyResultRequestSDKType { - proposal_id: Long; + proposal_id: bigint; } /** QueryTallyResultResponse is the Query/TallyResult response type. */ export interface QueryTallyResultResponse { @@ -661,25 +661,26 @@ export interface QueryTallyResultResponseSDKType { } function createBaseQueryGroupInfoRequest(): QueryGroupInfoRequest { return { - groupId: Long.UZERO + groupId: BigInt(0) }; } export const QueryGroupInfoRequest = { - encode(message: QueryGroupInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest", + encode(message: QueryGroupInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -690,27 +691,29 @@ export const QueryGroupInfoRequest = { }, fromJSON(object: any): QueryGroupInfoRequest { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0) }; }, toJSON(message: QueryGroupInfoRequest): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryGroupInfoRequest { const message = createBaseQueryGroupInfoRequest(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryGroupInfoRequestAmino): QueryGroupInfoRequest { - return { - groupId: Long.fromString(object.group_id) - }; + const message = createBaseQueryGroupInfoRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; }, toAmino(message: QueryGroupInfoRequest): QueryGroupInfoRequestAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; return obj; }, fromAminoMsg(object: QueryGroupInfoRequestAminoMsg): QueryGroupInfoRequest { @@ -737,18 +740,19 @@ export const QueryGroupInfoRequest = { }; function createBaseQueryGroupInfoResponse(): QueryGroupInfoResponse { return { - info: GroupInfo.fromPartial({}) + info: undefined }; } export const QueryGroupInfoResponse = { - encode(message: QueryGroupInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse", + encode(message: QueryGroupInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.info !== undefined) { GroupInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupInfoResponse(); while (reader.pos < end) { @@ -780,9 +784,11 @@ export const QueryGroupInfoResponse = { return message; }, fromAmino(object: QueryGroupInfoResponseAmino): QueryGroupInfoResponse { - return { - info: object?.info ? GroupInfo.fromAmino(object.info) : undefined - }; + const message = createBaseQueryGroupInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = GroupInfo.fromAmino(object.info); + } + return message; }, toAmino(message: QueryGroupInfoResponse): QueryGroupInfoResponseAmino { const obj: any = {}; @@ -817,14 +823,15 @@ function createBaseQueryGroupPolicyInfoRequest(): QueryGroupPolicyInfoRequest { }; } export const QueryGroupPolicyInfoRequest = { - encode(message: QueryGroupPolicyInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest", + encode(message: QueryGroupPolicyInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPolicyInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPolicyInfoRequest(); while (reader.pos < end) { @@ -856,13 +863,15 @@ export const QueryGroupPolicyInfoRequest = { return message; }, fromAmino(object: QueryGroupPolicyInfoRequestAmino): QueryGroupPolicyInfoRequest { - return { - address: object.address - }; + const message = createBaseQueryGroupPolicyInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryGroupPolicyInfoRequest): QueryGroupPolicyInfoRequestAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: QueryGroupPolicyInfoRequestAminoMsg): QueryGroupPolicyInfoRequest { @@ -889,18 +898,19 @@ export const QueryGroupPolicyInfoRequest = { }; function createBaseQueryGroupPolicyInfoResponse(): QueryGroupPolicyInfoResponse { return { - info: GroupPolicyInfo.fromPartial({}) + info: undefined }; } export const QueryGroupPolicyInfoResponse = { - encode(message: QueryGroupPolicyInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse", + encode(message: QueryGroupPolicyInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.info !== undefined) { GroupPolicyInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPolicyInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPolicyInfoResponse(); while (reader.pos < end) { @@ -932,9 +942,11 @@ export const QueryGroupPolicyInfoResponse = { return message; }, fromAmino(object: QueryGroupPolicyInfoResponseAmino): QueryGroupPolicyInfoResponse { - return { - info: object?.info ? GroupPolicyInfo.fromAmino(object.info) : undefined - }; + const message = createBaseQueryGroupPolicyInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = GroupPolicyInfo.fromAmino(object.info); + } + return message; }, toAmino(message: QueryGroupPolicyInfoResponse): QueryGroupPolicyInfoResponseAmino { const obj: any = {}; @@ -965,13 +977,14 @@ export const QueryGroupPolicyInfoResponse = { }; function createBaseQueryGroupMembersRequest(): QueryGroupMembersRequest { return { - groupId: Long.UZERO, - pagination: PageRequest.fromPartial({}) + groupId: BigInt(0), + pagination: undefined }; } export const QueryGroupMembersRequest = { - encode(message: QueryGroupMembersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest", + encode(message: QueryGroupMembersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.pagination !== undefined) { @@ -979,15 +992,15 @@ export const QueryGroupMembersRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupMembersRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupMembersRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1001,31 +1014,35 @@ export const QueryGroupMembersRequest = { }, fromJSON(object: any): QueryGroupMembersRequest { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryGroupMembersRequest): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryGroupMembersRequest { const message = createBaseQueryGroupMembersRequest(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryGroupMembersRequestAmino): QueryGroupMembersRequest { - return { - groupId: Long.fromString(object.group_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupMembersRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupMembersRequest): QueryGroupMembersRequestAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1054,11 +1071,12 @@ export const QueryGroupMembersRequest = { function createBaseQueryGroupMembersResponse(): QueryGroupMembersResponse { return { members: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGroupMembersResponse = { - encode(message: QueryGroupMembersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse", + encode(message: QueryGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.members) { GroupMember.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1067,8 +1085,8 @@ export const QueryGroupMembersResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupMembersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupMembersResponse(); while (reader.pos < end) { @@ -1110,17 +1128,19 @@ export const QueryGroupMembersResponse = { return message; }, fromAmino(object: QueryGroupMembersResponseAmino): QueryGroupMembersResponse { - return { - members: Array.isArray(object?.members) ? object.members.map((e: any) => GroupMember.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupMembersResponse(); + message.members = object.members?.map(e => GroupMember.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupMembersResponse): QueryGroupMembersResponseAmino { const obj: any = {}; if (message.members) { obj.members = message.members.map(e => e ? GroupMember.toAmino(e) : undefined); } else { - obj.members = []; + obj.members = message.members; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1150,11 +1170,12 @@ export const QueryGroupMembersResponse = { function createBaseQueryGroupsByAdminRequest(): QueryGroupsByAdminRequest { return { admin: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGroupsByAdminRequest = { - encode(message: QueryGroupsByAdminRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest", + encode(message: QueryGroupsByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1163,8 +1184,8 @@ export const QueryGroupsByAdminRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByAdminRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByAdminRequest(); while (reader.pos < end) { @@ -1202,14 +1223,18 @@ export const QueryGroupsByAdminRequest = { return message; }, fromAmino(object: QueryGroupsByAdminRequestAmino): QueryGroupsByAdminRequest { - return { - admin: object.admin, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupsByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1238,11 +1263,12 @@ export const QueryGroupsByAdminRequest = { function createBaseQueryGroupsByAdminResponse(): QueryGroupsByAdminResponse { return { groups: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGroupsByAdminResponse = { - encode(message: QueryGroupsByAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse", + encode(message: QueryGroupsByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.groups) { GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1251,8 +1277,8 @@ export const QueryGroupsByAdminResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByAdminResponse(); while (reader.pos < end) { @@ -1294,17 +1320,19 @@ export const QueryGroupsByAdminResponse = { return message; }, fromAmino(object: QueryGroupsByAdminResponseAmino): QueryGroupsByAdminResponse { - return { - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupsByAdminResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupsByAdminResponse): QueryGroupsByAdminResponseAmino { const obj: any = {}; if (message.groups) { obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); } else { - obj.groups = []; + obj.groups = message.groups; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1333,13 +1361,14 @@ export const QueryGroupsByAdminResponse = { }; function createBaseQueryGroupPoliciesByGroupRequest(): QueryGroupPoliciesByGroupRequest { return { - groupId: Long.UZERO, - pagination: PageRequest.fromPartial({}) + groupId: BigInt(0), + pagination: undefined }; } export const QueryGroupPoliciesByGroupRequest = { - encode(message: QueryGroupPoliciesByGroupRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest", + encode(message: QueryGroupPoliciesByGroupRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.pagination !== undefined) { @@ -1347,15 +1376,15 @@ export const QueryGroupPoliciesByGroupRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByGroupRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByGroupRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1369,31 +1398,35 @@ export const QueryGroupPoliciesByGroupRequest = { }, fromJSON(object: any): QueryGroupPoliciesByGroupRequest { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryGroupPoliciesByGroupRequest): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryGroupPoliciesByGroupRequest { const message = createBaseQueryGroupPoliciesByGroupRequest(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryGroupPoliciesByGroupRequestAmino): QueryGroupPoliciesByGroupRequest { - return { - groupId: Long.fromString(object.group_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupPoliciesByGroupRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupPoliciesByGroupRequest): QueryGroupPoliciesByGroupRequestAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1422,11 +1455,12 @@ export const QueryGroupPoliciesByGroupRequest = { function createBaseQueryGroupPoliciesByGroupResponse(): QueryGroupPoliciesByGroupResponse { return { groupPolicies: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGroupPoliciesByGroupResponse = { - encode(message: QueryGroupPoliciesByGroupResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse", + encode(message: QueryGroupPoliciesByGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.groupPolicies) { GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1435,8 +1469,8 @@ export const QueryGroupPoliciesByGroupResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByGroupResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByGroupResponse(); while (reader.pos < end) { @@ -1478,17 +1512,19 @@ export const QueryGroupPoliciesByGroupResponse = { return message; }, fromAmino(object: QueryGroupPoliciesByGroupResponseAmino): QueryGroupPoliciesByGroupResponse { - return { - groupPolicies: Array.isArray(object?.group_policies) ? object.group_policies.map((e: any) => GroupPolicyInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupPoliciesByGroupResponse(); + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupPoliciesByGroupResponse): QueryGroupPoliciesByGroupResponseAmino { const obj: any = {}; if (message.groupPolicies) { obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); } else { - obj.group_policies = []; + obj.group_policies = message.groupPolicies; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1518,11 +1554,12 @@ export const QueryGroupPoliciesByGroupResponse = { function createBaseQueryGroupPoliciesByAdminRequest(): QueryGroupPoliciesByAdminRequest { return { admin: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGroupPoliciesByAdminRequest = { - encode(message: QueryGroupPoliciesByAdminRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest", + encode(message: QueryGroupPoliciesByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1531,8 +1568,8 @@ export const QueryGroupPoliciesByAdminRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByAdminRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByAdminRequest(); while (reader.pos < end) { @@ -1570,14 +1607,18 @@ export const QueryGroupPoliciesByAdminRequest = { return message; }, fromAmino(object: QueryGroupPoliciesByAdminRequestAmino): QueryGroupPoliciesByAdminRequest { - return { - admin: object.admin, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupPoliciesByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupPoliciesByAdminRequest): QueryGroupPoliciesByAdminRequestAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1606,11 +1647,12 @@ export const QueryGroupPoliciesByAdminRequest = { function createBaseQueryGroupPoliciesByAdminResponse(): QueryGroupPoliciesByAdminResponse { return { groupPolicies: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGroupPoliciesByAdminResponse = { - encode(message: QueryGroupPoliciesByAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse", + encode(message: QueryGroupPoliciesByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.groupPolicies) { GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1619,8 +1661,8 @@ export const QueryGroupPoliciesByAdminResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByAdminResponse(); while (reader.pos < end) { @@ -1662,17 +1704,19 @@ export const QueryGroupPoliciesByAdminResponse = { return message; }, fromAmino(object: QueryGroupPoliciesByAdminResponseAmino): QueryGroupPoliciesByAdminResponse { - return { - groupPolicies: Array.isArray(object?.group_policies) ? object.group_policies.map((e: any) => GroupPolicyInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupPoliciesByAdminResponse(); + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupPoliciesByAdminResponse): QueryGroupPoliciesByAdminResponseAmino { const obj: any = {}; if (message.groupPolicies) { obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); } else { - obj.group_policies = []; + obj.group_policies = message.groupPolicies; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1701,25 +1745,26 @@ export const QueryGroupPoliciesByAdminResponse = { }; function createBaseQueryProposalRequest(): QueryProposalRequest { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const QueryProposalRequest = { - encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1730,27 +1775,29 @@ export const QueryProposalRequest = { }, fromJSON(object: any): QueryProposalRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: QueryProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryProposalRequest { const message = createBaseQueryProposalRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { @@ -1777,18 +1824,19 @@ export const QueryProposalRequest = { }; function createBaseQueryProposalResponse(): QueryProposalResponse { return { - proposal: Proposal.fromPartial({}) + proposal: undefined }; } export const QueryProposalResponse = { - encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalResponse(); while (reader.pos < end) { @@ -1820,9 +1868,11 @@ export const QueryProposalResponse = { return message; }, fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - return { - proposal: object?.proposal ? Proposal.fromAmino(object.proposal) : undefined - }; + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; }, toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { const obj: any = {}; @@ -1854,11 +1904,12 @@ export const QueryProposalResponse = { function createBaseQueryProposalsByGroupPolicyRequest(): QueryProposalsByGroupPolicyRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProposalsByGroupPolicyRequest = { - encode(message: QueryProposalsByGroupPolicyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest", + encode(message: QueryProposalsByGroupPolicyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -1867,8 +1918,8 @@ export const QueryProposalsByGroupPolicyRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsByGroupPolicyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsByGroupPolicyRequest(); while (reader.pos < end) { @@ -1906,14 +1957,18 @@ export const QueryProposalsByGroupPolicyRequest = { return message; }, fromAmino(object: QueryProposalsByGroupPolicyRequestAmino): QueryProposalsByGroupPolicyRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsByGroupPolicyRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsByGroupPolicyRequest): QueryProposalsByGroupPolicyRequestAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1942,11 +1997,12 @@ export const QueryProposalsByGroupPolicyRequest = { function createBaseQueryProposalsByGroupPolicyResponse(): QueryProposalsByGroupPolicyResponse { return { proposals: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProposalsByGroupPolicyResponse = { - encode(message: QueryProposalsByGroupPolicyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse", + encode(message: QueryProposalsByGroupPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1955,8 +2011,8 @@ export const QueryProposalsByGroupPolicyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsByGroupPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsByGroupPolicyResponse(); while (reader.pos < end) { @@ -1998,17 +2054,19 @@ export const QueryProposalsByGroupPolicyResponse = { return message; }, fromAmino(object: QueryProposalsByGroupPolicyResponseAmino): QueryProposalsByGroupPolicyResponse { - return { - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsByGroupPolicyResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsByGroupPolicyResponse): QueryProposalsByGroupPolicyResponseAmino { const obj: any = {}; if (message.proposals) { obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); } else { - obj.proposals = []; + obj.proposals = message.proposals; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2037,13 +2095,14 @@ export const QueryProposalsByGroupPolicyResponse = { }; function createBaseQueryVoteByProposalVoterRequest(): QueryVoteByProposalVoterRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "" }; } export const QueryVoteByProposalVoterRequest = { - encode(message: QueryVoteByProposalVoterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest", + encode(message: QueryVoteByProposalVoterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -2051,15 +2110,15 @@ export const QueryVoteByProposalVoterRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteByProposalVoterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteByProposalVoterRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -2073,32 +2132,36 @@ export const QueryVoteByProposalVoterRequest = { }, fromJSON(object: any): QueryVoteByProposalVoterRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "" }; }, toJSON(message: QueryVoteByProposalVoterRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); return obj; }, fromPartial(object: Partial): QueryVoteByProposalVoterRequest { const message = createBaseQueryVoteByProposalVoterRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; return message; }, fromAmino(object: QueryVoteByProposalVoterRequestAmino): QueryVoteByProposalVoterRequest { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter - }; + const message = createBaseQueryVoteByProposalVoterRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; }, toAmino(message: QueryVoteByProposalVoterRequest): QueryVoteByProposalVoterRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; return obj; }, fromAminoMsg(object: QueryVoteByProposalVoterRequestAminoMsg): QueryVoteByProposalVoterRequest { @@ -2125,18 +2188,19 @@ export const QueryVoteByProposalVoterRequest = { }; function createBaseQueryVoteByProposalVoterResponse(): QueryVoteByProposalVoterResponse { return { - vote: Vote.fromPartial({}) + vote: undefined }; } export const QueryVoteByProposalVoterResponse = { - encode(message: QueryVoteByProposalVoterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse", + encode(message: QueryVoteByProposalVoterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteByProposalVoterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteByProposalVoterResponse(); while (reader.pos < end) { @@ -2168,9 +2232,11 @@ export const QueryVoteByProposalVoterResponse = { return message; }, fromAmino(object: QueryVoteByProposalVoterResponseAmino): QueryVoteByProposalVoterResponse { - return { - vote: object?.vote ? Vote.fromAmino(object.vote) : undefined - }; + const message = createBaseQueryVoteByProposalVoterResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; }, toAmino(message: QueryVoteByProposalVoterResponse): QueryVoteByProposalVoterResponseAmino { const obj: any = {}; @@ -2201,13 +2267,14 @@ export const QueryVoteByProposalVoterResponse = { }; function createBaseQueryVotesByProposalRequest(): QueryVotesByProposalRequest { return { - proposalId: Long.UZERO, - pagination: PageRequest.fromPartial({}) + proposalId: BigInt(0), + pagination: undefined }; } export const QueryVotesByProposalRequest = { - encode(message: QueryVotesByProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest", + encode(message: QueryVotesByProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -2215,15 +2282,15 @@ export const QueryVotesByProposalRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -2237,31 +2304,35 @@ export const QueryVotesByProposalRequest = { }, fromJSON(object: any): QueryVotesByProposalRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryVotesByProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): QueryVotesByProposalRequest { const message = createBaseQueryVotesByProposalRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryVotesByProposalRequestAmino): QueryVotesByProposalRequest { - return { - proposalId: Long.fromString(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesByProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesByProposalRequest): QueryVotesByProposalRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2290,11 +2361,12 @@ export const QueryVotesByProposalRequest = { function createBaseQueryVotesByProposalResponse(): QueryVotesByProposalResponse { return { votes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryVotesByProposalResponse = { - encode(message: QueryVotesByProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse", + encode(message: QueryVotesByProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2303,8 +2375,8 @@ export const QueryVotesByProposalResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByProposalResponse(); while (reader.pos < end) { @@ -2346,17 +2418,19 @@ export const QueryVotesByProposalResponse = { return message; }, fromAmino(object: QueryVotesByProposalResponseAmino): QueryVotesByProposalResponse { - return { - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesByProposalResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesByProposalResponse): QueryVotesByProposalResponseAmino { const obj: any = {}; if (message.votes) { obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2386,11 +2460,12 @@ export const QueryVotesByProposalResponse = { function createBaseQueryVotesByVoterRequest(): QueryVotesByVoterRequest { return { voter: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryVotesByVoterRequest = { - encode(message: QueryVotesByVoterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest", + encode(message: QueryVotesByVoterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.voter !== "") { writer.uint32(10).string(message.voter); } @@ -2399,8 +2474,8 @@ export const QueryVotesByVoterRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByVoterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByVoterRequest(); while (reader.pos < end) { @@ -2438,14 +2513,18 @@ export const QueryVotesByVoterRequest = { return message; }, fromAmino(object: QueryVotesByVoterRequestAmino): QueryVotesByVoterRequest { - return { - voter: object.voter, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesByVoterRequest(); + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestAmino { const obj: any = {}; - obj.voter = message.voter; + obj.voter = message.voter === "" ? undefined : message.voter; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2474,11 +2553,12 @@ export const QueryVotesByVoterRequest = { function createBaseQueryVotesByVoterResponse(): QueryVotesByVoterResponse { return { votes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryVotesByVoterResponse = { - encode(message: QueryVotesByVoterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse", + encode(message: QueryVotesByVoterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2487,8 +2567,8 @@ export const QueryVotesByVoterResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByVoterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByVoterResponse(); while (reader.pos < end) { @@ -2530,17 +2610,19 @@ export const QueryVotesByVoterResponse = { return message; }, fromAmino(object: QueryVotesByVoterResponseAmino): QueryVotesByVoterResponse { - return { - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesByVoterResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseAmino { const obj: any = {}; if (message.votes) { obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2570,11 +2652,12 @@ export const QueryVotesByVoterResponse = { function createBaseQueryGroupsByMemberRequest(): QueryGroupsByMemberRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGroupsByMemberRequest = { - encode(message: QueryGroupsByMemberRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest", + encode(message: QueryGroupsByMemberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -2583,8 +2666,8 @@ export const QueryGroupsByMemberRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByMemberRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByMemberRequest(); while (reader.pos < end) { @@ -2622,14 +2705,18 @@ export const QueryGroupsByMemberRequest = { return message; }, fromAmino(object: QueryGroupsByMemberRequestAmino): QueryGroupsByMemberRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupsByMemberRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupsByMemberRequest): QueryGroupsByMemberRequestAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2658,11 +2745,12 @@ export const QueryGroupsByMemberRequest = { function createBaseQueryGroupsByMemberResponse(): QueryGroupsByMemberResponse { return { groups: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGroupsByMemberResponse = { - encode(message: QueryGroupsByMemberResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse", + encode(message: QueryGroupsByMemberResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.groups) { GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2671,8 +2759,8 @@ export const QueryGroupsByMemberResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByMemberResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByMemberResponse(); while (reader.pos < end) { @@ -2714,17 +2802,19 @@ export const QueryGroupsByMemberResponse = { return message; }, fromAmino(object: QueryGroupsByMemberResponseAmino): QueryGroupsByMemberResponse { - return { - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGroupsByMemberResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGroupsByMemberResponse): QueryGroupsByMemberResponseAmino { const obj: any = {}; if (message.groups) { obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); } else { - obj.groups = []; + obj.groups = message.groups; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2753,25 +2843,26 @@ export const QueryGroupsByMemberResponse = { }; function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const QueryTallyResultRequest = { - encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -2782,27 +2873,29 @@ export const QueryTallyResultRequest = { }, fromJSON(object: any): QueryTallyResultRequest { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: QueryTallyResultRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryTallyResultRequest { const message = createBaseQueryTallyResultRequest(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { @@ -2833,14 +2926,15 @@ function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { }; } export const QueryTallyResultResponse = { - encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultResponse(); while (reader.pos < end) { @@ -2872,9 +2966,11 @@ export const QueryTallyResultResponse = { return message; }, fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - return { - tally: object?.tally ? TallyResult.fromAmino(object.tally) : undefined - }; + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; }, toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/group/v1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/group/v1/tx.rpc.msg.ts index 8d4e9a24..2cbd3114 100644 --- a/packages/api/src/codegen/cosmos/group/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/group/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgCreateGroup, MsgCreateGroupResponse, MsgUpdateGroupMembers, MsgUpdateGroupMembersResponse, MsgUpdateGroupAdmin, MsgUpdateGroupAdminResponse, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataResponse, MsgCreateGroupPolicy, MsgCreateGroupPolicyResponse, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicyResponse, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminResponse, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicyResponse, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataResponse, MsgSubmitProposal, MsgSubmitProposalResponse, MsgWithdrawProposal, MsgWithdrawProposalResponse, MsgVote, MsgVoteResponse, MsgExec, MsgExecResponse, MsgLeaveGroup, MsgLeaveGroupResponse } from "./tx"; /** Msg is the cosmos.group.v1 Msg service. */ export interface Msg { @@ -54,71 +54,71 @@ export class MsgClientImpl implements Msg { createGroup(request: MsgCreateGroup): Promise { const data = MsgCreateGroup.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroup", data); - return promise.then(data => MsgCreateGroupResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateGroupResponse.decode(new BinaryReader(data))); } updateGroupMembers(request: MsgUpdateGroupMembers): Promise { const data = MsgUpdateGroupMembers.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMembers", data); - return promise.then(data => MsgUpdateGroupMembersResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateGroupMembersResponse.decode(new BinaryReader(data))); } updateGroupAdmin(request: MsgUpdateGroupAdmin): Promise { const data = MsgUpdateGroupAdmin.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupAdmin", data); - return promise.then(data => MsgUpdateGroupAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateGroupAdminResponse.decode(new BinaryReader(data))); } updateGroupMetadata(request: MsgUpdateGroupMetadata): Promise { const data = MsgUpdateGroupMetadata.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMetadata", data); - return promise.then(data => MsgUpdateGroupMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateGroupMetadataResponse.decode(new BinaryReader(data))); } createGroupPolicy(request: MsgCreateGroupPolicy): Promise { const data = MsgCreateGroupPolicy.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupPolicy", data); - return promise.then(data => MsgCreateGroupPolicyResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateGroupPolicyResponse.decode(new BinaryReader(data))); } createGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise { const data = MsgCreateGroupWithPolicy.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupWithPolicy", data); - return promise.then(data => MsgCreateGroupWithPolicyResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateGroupWithPolicyResponse.decode(new BinaryReader(data))); } updateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise { const data = MsgUpdateGroupPolicyAdmin.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyAdmin", data); - return promise.then(data => MsgUpdateGroupPolicyAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateGroupPolicyAdminResponse.decode(new BinaryReader(data))); } updateGroupPolicyDecisionPolicy(request: MsgUpdateGroupPolicyDecisionPolicy): Promise { const data = MsgUpdateGroupPolicyDecisionPolicy.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyDecisionPolicy", data); - return promise.then(data => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new BinaryReader(data))); } updateGroupPolicyMetadata(request: MsgUpdateGroupPolicyMetadata): Promise { const data = MsgUpdateGroupPolicyMetadata.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyMetadata", data); - return promise.then(data => MsgUpdateGroupPolicyMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateGroupPolicyMetadataResponse.decode(new BinaryReader(data))); } submitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "SubmitProposal", data); - return promise.then(data => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); } withdrawProposal(request: MsgWithdrawProposal): Promise { const data = MsgWithdrawProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "WithdrawProposal", data); - return promise.then(data => MsgWithdrawProposalResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgWithdrawProposalResponse.decode(new BinaryReader(data))); } vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "Vote", data); - return promise.then(data => MsgVoteResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); } exec(request: MsgExec): Promise { const data = MsgExec.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "Exec", data); - return promise.then(data => MsgExecResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); } leaveGroup(request: MsgLeaveGroup): Promise { const data = MsgLeaveGroup.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "LeaveGroup", data); - return promise.then(data => MsgLeaveGroupResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgLeaveGroupResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/group/v1/tx.ts b/packages/api/src/codegen/cosmos/group/v1/tx.ts index cad6b72c..5b9235a7 100644 --- a/packages/api/src/codegen/cosmos/group/v1/tx.ts +++ b/packages/api/src/codegen/cosmos/group/v1/tx.ts @@ -1,7 +1,7 @@ import { MemberRequest, MemberRequestAmino, MemberRequestSDKType, VoteOption, ProposalExecutorResult, ThresholdDecisionPolicy, ThresholdDecisionPolicyProtoMsg, ThresholdDecisionPolicySDKType, PercentageDecisionPolicy, PercentageDecisionPolicyProtoMsg, PercentageDecisionPolicySDKType, voteOptionFromJSON, voteOptionToJSON, proposalExecutorResultFromJSON, proposalExecutorResultToJSON } from "./types"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** Exec defines modes of execution of a proposal on creation or on new vote. */ export enum Exec { /** @@ -61,11 +61,11 @@ export interface MsgCreateGroupProtoMsg { /** MsgCreateGroup is the Msg/CreateGroup request type. */ export interface MsgCreateGroupAmino { /** admin is the account address of the group admin. */ - admin: string; + admin?: string; /** members defines the group members. */ members: MemberRequestAmino[]; /** metadata is any arbitrary metadata to attached to the group. */ - metadata: string; + metadata?: string; } export interface MsgCreateGroupAminoMsg { type: "cosmos-sdk/MsgCreateGroup"; @@ -80,7 +80,7 @@ export interface MsgCreateGroupSDKType { /** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ export interface MsgCreateGroupResponse { /** group_id is the unique ID of the newly created group. */ - groupId: Long; + groupId: bigint; } export interface MsgCreateGroupResponseProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse"; @@ -89,7 +89,7 @@ export interface MsgCreateGroupResponseProtoMsg { /** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ export interface MsgCreateGroupResponseAmino { /** group_id is the unique ID of the newly created group. */ - group_id: string; + group_id?: string; } export interface MsgCreateGroupResponseAminoMsg { type: "cosmos-sdk/MsgCreateGroupResponse"; @@ -97,14 +97,14 @@ export interface MsgCreateGroupResponseAminoMsg { } /** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ export interface MsgCreateGroupResponseSDKType { - group_id: Long; + group_id: bigint; } /** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ export interface MsgUpdateGroupMembers { /** admin is the account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** * member_updates is the list of members to update, * set weight to 0 to remove a member. @@ -118,9 +118,9 @@ export interface MsgUpdateGroupMembersProtoMsg { /** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ export interface MsgUpdateGroupMembersAmino { /** admin is the account address of the group admin. */ - admin: string; + admin?: string; /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; /** * member_updates is the list of members to update, * set weight to 0 to remove a member. @@ -134,7 +134,7 @@ export interface MsgUpdateGroupMembersAminoMsg { /** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ export interface MsgUpdateGroupMembersSDKType { admin: string; - group_id: Long; + group_id: bigint; member_updates: MemberRequestSDKType[]; } /** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ @@ -156,7 +156,7 @@ export interface MsgUpdateGroupAdmin { /** admin is the current account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** new_admin is the group new admin account address. */ newAdmin: string; } @@ -167,11 +167,11 @@ export interface MsgUpdateGroupAdminProtoMsg { /** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ export interface MsgUpdateGroupAdminAmino { /** admin is the current account address of the group admin. */ - admin: string; + admin?: string; /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; /** new_admin is the group new admin account address. */ - new_admin: string; + new_admin?: string; } export interface MsgUpdateGroupAdminAminoMsg { type: "cosmos-sdk/MsgUpdateGroupAdmin"; @@ -180,7 +180,7 @@ export interface MsgUpdateGroupAdminAminoMsg { /** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ export interface MsgUpdateGroupAdminSDKType { admin: string; - group_id: Long; + group_id: bigint; new_admin: string; } /** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ @@ -202,7 +202,7 @@ export interface MsgUpdateGroupMetadata { /** admin is the account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** metadata is the updated group's metadata. */ metadata: string; } @@ -213,11 +213,11 @@ export interface MsgUpdateGroupMetadataProtoMsg { /** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ export interface MsgUpdateGroupMetadataAmino { /** admin is the account address of the group admin. */ - admin: string; + admin?: string; /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; /** metadata is the updated group's metadata. */ - metadata: string; + metadata?: string; } export interface MsgUpdateGroupMetadataAminoMsg { type: "cosmos-sdk/MsgUpdateGroupMetadata"; @@ -226,7 +226,7 @@ export interface MsgUpdateGroupMetadataAminoMsg { /** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ export interface MsgUpdateGroupMetadataSDKType { admin: string; - group_id: Long; + group_id: bigint; metadata: string; } /** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ @@ -248,11 +248,11 @@ export interface MsgCreateGroupPolicy { /** admin is the account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** metadata is any arbitrary metadata attached to the group policy. */ metadata: string; /** decision_policy specifies the group policy's decision policy. */ - decisionPolicy: (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) | undefined; + decisionPolicy?: (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) | undefined; } export interface MsgCreateGroupPolicyProtoMsg { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; @@ -264,11 +264,11 @@ export type MsgCreateGroupPolicyEncoded = Omit MemberRequest.fromAmino(e)) : [], - metadata: object.metadata - }; + const message = createBaseMsgCreateGroup(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.members = object.members?.map(e => MemberRequest.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgCreateGroup): MsgCreateGroupAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; if (message.members) { obj.members = message.members.map(e => e ? MemberRequest.toAmino(e) : undefined); } else { - obj.members = []; + obj.members = message.members; } - obj.metadata = message.metadata; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgCreateGroupAminoMsg): MsgCreateGroup { @@ -910,25 +915,26 @@ export const MsgCreateGroup = { }; function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { return { - groupId: Long.UZERO + groupId: BigInt(0) }; } export const MsgCreateGroupResponse = { - encode(message: MsgCreateGroupResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse", + encode(message: MsgCreateGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -939,27 +945,29 @@ export const MsgCreateGroupResponse = { }, fromJSON(object: any): MsgCreateGroupResponse { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0) }; }, toJSON(message: MsgCreateGroupResponse): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgCreateGroupResponse { const message = createBaseMsgCreateGroupResponse(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgCreateGroupResponseAmino): MsgCreateGroupResponse { - return { - groupId: Long.fromString(object.group_id) - }; + const message = createBaseMsgCreateGroupResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; }, toAmino(message: MsgCreateGroupResponse): MsgCreateGroupResponseAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgCreateGroupResponseAminoMsg): MsgCreateGroupResponse { @@ -987,16 +995,17 @@ export const MsgCreateGroupResponse = { function createBaseMsgUpdateGroupMembers(): MsgUpdateGroupMembers { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), memberUpdates: [] }; } export const MsgUpdateGroupMembers = { - encode(message: MsgUpdateGroupMembers, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + encode(message: MsgUpdateGroupMembers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } for (const v of message.memberUpdates) { @@ -1004,8 +1013,8 @@ export const MsgUpdateGroupMembers = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMembers { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMembers(); while (reader.pos < end) { @@ -1015,7 +1024,7 @@ export const MsgUpdateGroupMembers = { message.admin = reader.string(); break; case 2: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 3: message.memberUpdates.push(MemberRequest.decode(reader, reader.uint32())); @@ -1030,14 +1039,14 @@ export const MsgUpdateGroupMembers = { fromJSON(object: any): MsgUpdateGroupMembers { return { admin: isSet(object.admin) ? String(object.admin) : "", - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), memberUpdates: Array.isArray(object?.memberUpdates) ? object.memberUpdates.map((e: any) => MemberRequest.fromJSON(e)) : [] }; }, toJSON(message: MsgUpdateGroupMembers): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); if (message.memberUpdates) { obj.memberUpdates = message.memberUpdates.map(e => e ? MemberRequest.toJSON(e) : undefined); } else { @@ -1048,25 +1057,29 @@ export const MsgUpdateGroupMembers = { fromPartial(object: Partial): MsgUpdateGroupMembers { const message = createBaseMsgUpdateGroupMembers(); message.admin = object.admin ?? ""; - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.memberUpdates = object.memberUpdates?.map(e => MemberRequest.fromPartial(e)) || []; return message; }, fromAmino(object: MsgUpdateGroupMembersAmino): MsgUpdateGroupMembers { - return { - admin: object.admin, - groupId: Long.fromString(object.group_id), - memberUpdates: Array.isArray(object?.member_updates) ? object.member_updates.map((e: any) => MemberRequest.fromAmino(e)) : [] - }; + const message = createBaseMsgUpdateGroupMembers(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + message.memberUpdates = object.member_updates?.map(e => MemberRequest.fromAmino(e)) || []; + return message; }, toAmino(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersAmino { const obj: any = {}; - obj.admin = message.admin; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; if (message.memberUpdates) { obj.member_updates = message.memberUpdates.map(e => e ? MemberRequest.toAmino(e) : undefined); } else { - obj.member_updates = []; + obj.member_updates = message.memberUpdates; } return obj; }, @@ -1096,11 +1109,12 @@ function createBaseMsgUpdateGroupMembersResponse(): MsgUpdateGroupMembersRespons return {}; } export const MsgUpdateGroupMembersResponse = { - encode(_: MsgUpdateGroupMembersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse", + encode(_: MsgUpdateGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMembersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMembersResponse(); while (reader.pos < end) { @@ -1125,7 +1139,8 @@ export const MsgUpdateGroupMembersResponse = { return message; }, fromAmino(_: MsgUpdateGroupMembersResponseAmino): MsgUpdateGroupMembersResponse { - return {}; + const message = createBaseMsgUpdateGroupMembersResponse(); + return message; }, toAmino(_: MsgUpdateGroupMembersResponse): MsgUpdateGroupMembersResponseAmino { const obj: any = {}; @@ -1156,16 +1171,17 @@ export const MsgUpdateGroupMembersResponse = { function createBaseMsgUpdateGroupAdmin(): MsgUpdateGroupAdmin { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), newAdmin: "" }; } export const MsgUpdateGroupAdmin = { - encode(message: MsgUpdateGroupAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + encode(message: MsgUpdateGroupAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.newAdmin !== "") { @@ -1173,8 +1189,8 @@ export const MsgUpdateGroupAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupAdmin(); while (reader.pos < end) { @@ -1184,7 +1200,7 @@ export const MsgUpdateGroupAdmin = { message.admin = reader.string(); break; case 2: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 3: message.newAdmin = reader.string(); @@ -1199,36 +1215,42 @@ export const MsgUpdateGroupAdmin = { fromJSON(object: any): MsgUpdateGroupAdmin { return { admin: isSet(object.admin) ? String(object.admin) : "", - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "" }; }, toJSON(message: MsgUpdateGroupAdmin): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); return obj; }, fromPartial(object: Partial): MsgUpdateGroupAdmin { const message = createBaseMsgUpdateGroupAdmin(); message.admin = object.admin ?? ""; - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.newAdmin = object.newAdmin ?? ""; return message; }, fromAmino(object: MsgUpdateGroupAdminAmino): MsgUpdateGroupAdmin { - return { - admin: object.admin, - groupId: Long.fromString(object.group_id), - newAdmin: object.new_admin - }; + const message = createBaseMsgUpdateGroupAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; }, toAmino(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAmino { const obj: any = {}; - obj.admin = message.admin; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; - obj.new_admin = message.newAdmin; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; return obj; }, fromAminoMsg(object: MsgUpdateGroupAdminAminoMsg): MsgUpdateGroupAdmin { @@ -1257,11 +1279,12 @@ function createBaseMsgUpdateGroupAdminResponse(): MsgUpdateGroupAdminResponse { return {}; } export const MsgUpdateGroupAdminResponse = { - encode(_: MsgUpdateGroupAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse", + encode(_: MsgUpdateGroupAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupAdminResponse(); while (reader.pos < end) { @@ -1286,7 +1309,8 @@ export const MsgUpdateGroupAdminResponse = { return message; }, fromAmino(_: MsgUpdateGroupAdminResponseAmino): MsgUpdateGroupAdminResponse { - return {}; + const message = createBaseMsgUpdateGroupAdminResponse(); + return message; }, toAmino(_: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseAmino { const obj: any = {}; @@ -1317,16 +1341,17 @@ export const MsgUpdateGroupAdminResponse = { function createBaseMsgUpdateGroupMetadata(): MsgUpdateGroupMetadata { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), metadata: "" }; } export const MsgUpdateGroupMetadata = { - encode(message: MsgUpdateGroupMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + encode(message: MsgUpdateGroupMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.metadata !== "") { @@ -1334,8 +1359,8 @@ export const MsgUpdateGroupMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMetadata(); while (reader.pos < end) { @@ -1345,7 +1370,7 @@ export const MsgUpdateGroupMetadata = { message.admin = reader.string(); break; case 2: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 3: message.metadata = reader.string(); @@ -1360,36 +1385,42 @@ export const MsgUpdateGroupMetadata = { fromJSON(object: any): MsgUpdateGroupMetadata { return { admin: isSet(object.admin) ? String(object.admin) : "", - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, toJSON(message: MsgUpdateGroupMetadata): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, fromPartial(object: Partial): MsgUpdateGroupMetadata { const message = createBaseMsgUpdateGroupMetadata(); message.admin = object.admin ?? ""; - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.metadata = object.metadata ?? ""; return message; }, fromAmino(object: MsgUpdateGroupMetadataAmino): MsgUpdateGroupMetadata { - return { - admin: object.admin, - groupId: Long.fromString(object.group_id), - metadata: object.metadata - }; + const message = createBaseMsgUpdateGroupMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAmino { const obj: any = {}; - obj.admin = message.admin; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; - obj.metadata = message.metadata; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgUpdateGroupMetadataAminoMsg): MsgUpdateGroupMetadata { @@ -1418,11 +1449,12 @@ function createBaseMsgUpdateGroupMetadataResponse(): MsgUpdateGroupMetadataRespo return {}; } export const MsgUpdateGroupMetadataResponse = { - encode(_: MsgUpdateGroupMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse", + encode(_: MsgUpdateGroupMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMetadataResponse(); while (reader.pos < end) { @@ -1447,7 +1479,8 @@ export const MsgUpdateGroupMetadataResponse = { return message; }, fromAmino(_: MsgUpdateGroupMetadataResponseAmino): MsgUpdateGroupMetadataResponse { - return {}; + const message = createBaseMsgUpdateGroupMetadataResponse(); + return message; }, toAmino(_: MsgUpdateGroupMetadataResponse): MsgUpdateGroupMetadataResponseAmino { const obj: any = {}; @@ -1478,17 +1511,18 @@ export const MsgUpdateGroupMetadataResponse = { function createBaseMsgCreateGroupPolicy(): MsgCreateGroupPolicy { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), metadata: "", decisionPolicy: undefined }; } export const MsgCreateGroupPolicy = { - encode(message: MsgCreateGroupPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + encode(message: MsgCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.metadata !== "") { @@ -1499,8 +1533,8 @@ export const MsgCreateGroupPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupPolicy(); while (reader.pos < end) { @@ -1510,13 +1544,13 @@ export const MsgCreateGroupPolicy = { message.admin = reader.string(); break; case 2: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 3: message.metadata = reader.string(); break; case 4: - message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any); + message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as Any); break; default: reader.skipType(tag & 7); @@ -1528,15 +1562,15 @@ export const MsgCreateGroupPolicy = { fromJSON(object: any): MsgCreateGroupPolicy { return { admin: isSet(object.admin) ? String(object.admin) : "", - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), metadata: isSet(object.metadata) ? String(object.metadata) : "", - decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any: undefined + decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) : undefined }; }, toJSON(message: MsgCreateGroupPolicy): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.metadata !== undefined && (obj.metadata = message.metadata); message.decisionPolicy !== undefined && (obj.decisionPolicy = message.decisionPolicy ? Any.toJSON(message.decisionPolicy) : undefined); return obj; @@ -1544,24 +1578,32 @@ export const MsgCreateGroupPolicy = { fromPartial(object: Partial): MsgCreateGroupPolicy { const message = createBaseMsgCreateGroupPolicy(); message.admin = object.admin ?? ""; - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.metadata = object.metadata ?? ""; - message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any: undefined; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; return message; }, fromAmino(object: MsgCreateGroupPolicyAmino): MsgCreateGroupPolicy { - return { - admin: object.admin, - groupId: Long.fromString(object.group_id), - metadata: object.metadata, - decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any : undefined - }; + const message = createBaseMsgCreateGroupPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = DecisionPolicy_FromAmino(object.decision_policy); + } + return message; }, toAmino(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyAmino { const obj: any = {}; - obj.admin = message.admin; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; - obj.metadata = message.metadata; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; return obj; }, @@ -1593,14 +1635,15 @@ function createBaseMsgCreateGroupPolicyResponse(): MsgCreateGroupPolicyResponse }; } export const MsgCreateGroupPolicyResponse = { - encode(message: MsgCreateGroupPolicyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse", + encode(message: MsgCreateGroupPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupPolicyResponse(); while (reader.pos < end) { @@ -1632,13 +1675,15 @@ export const MsgCreateGroupPolicyResponse = { return message; }, fromAmino(object: MsgCreateGroupPolicyResponseAmino): MsgCreateGroupPolicyResponse { - return { - address: object.address - }; + const message = createBaseMsgCreateGroupPolicyResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: MsgCreateGroupPolicyResponse): MsgCreateGroupPolicyResponseAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: MsgCreateGroupPolicyResponseAminoMsg): MsgCreateGroupPolicyResponse { @@ -1671,7 +1716,8 @@ function createBaseMsgUpdateGroupPolicyAdmin(): MsgUpdateGroupPolicyAdmin { }; } export const MsgUpdateGroupPolicyAdmin = { - encode(message: MsgUpdateGroupPolicyAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + encode(message: MsgUpdateGroupPolicyAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1683,8 +1729,8 @@ export const MsgUpdateGroupPolicyAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyAdmin(); while (reader.pos < end) { @@ -1728,17 +1774,23 @@ export const MsgUpdateGroupPolicyAdmin = { return message; }, fromAmino(object: MsgUpdateGroupPolicyAdminAmino): MsgUpdateGroupPolicyAdmin { - return { - admin: object.admin, - groupPolicyAddress: object.group_policy_address, - newAdmin: object.new_admin - }; + const message = createBaseMsgUpdateGroupPolicyAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; }, toAmino(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminAmino { const obj: any = {}; - obj.admin = message.admin; - obj.group_policy_address = message.groupPolicyAddress; - obj.new_admin = message.newAdmin; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; return obj; }, fromAminoMsg(object: MsgUpdateGroupPolicyAdminAminoMsg): MsgUpdateGroupPolicyAdmin { @@ -1767,11 +1819,12 @@ function createBaseMsgUpdateGroupPolicyAdminResponse(): MsgUpdateGroupPolicyAdmi return {}; } export const MsgUpdateGroupPolicyAdminResponse = { - encode(_: MsgUpdateGroupPolicyAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", + encode(_: MsgUpdateGroupPolicyAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyAdminResponse(); while (reader.pos < end) { @@ -1796,7 +1849,8 @@ export const MsgUpdateGroupPolicyAdminResponse = { return message; }, fromAmino(_: MsgUpdateGroupPolicyAdminResponseAmino): MsgUpdateGroupPolicyAdminResponse { - return {}; + const message = createBaseMsgUpdateGroupPolicyAdminResponse(); + return message; }, toAmino(_: MsgUpdateGroupPolicyAdminResponse): MsgUpdateGroupPolicyAdminResponseAmino { const obj: any = {}; @@ -1835,7 +1889,8 @@ function createBaseMsgCreateGroupWithPolicy(): MsgCreateGroupWithPolicy { }; } export const MsgCreateGroupWithPolicy = { - encode(message: MsgCreateGroupWithPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + encode(message: MsgCreateGroupWithPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1856,8 +1911,8 @@ export const MsgCreateGroupWithPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupWithPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupWithPolicy(); while (reader.pos < end) { @@ -1879,7 +1934,7 @@ export const MsgCreateGroupWithPolicy = { message.groupPolicyAsAdmin = reader.bool(); break; case 6: - message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any); + message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as Any); break; default: reader.skipType(tag & 7); @@ -1895,7 +1950,7 @@ export const MsgCreateGroupWithPolicy = { groupMetadata: isSet(object.groupMetadata) ? String(object.groupMetadata) : "", groupPolicyMetadata: isSet(object.groupPolicyMetadata) ? String(object.groupPolicyMetadata) : "", groupPolicyAsAdmin: isSet(object.groupPolicyAsAdmin) ? Boolean(object.groupPolicyAsAdmin) : false, - decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any: undefined + decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) : undefined }; }, toJSON(message: MsgCreateGroupWithPolicy): unknown { @@ -1919,30 +1974,40 @@ export const MsgCreateGroupWithPolicy = { message.groupMetadata = object.groupMetadata ?? ""; message.groupPolicyMetadata = object.groupPolicyMetadata ?? ""; message.groupPolicyAsAdmin = object.groupPolicyAsAdmin ?? false; - message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any: undefined; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; return message; }, fromAmino(object: MsgCreateGroupWithPolicyAmino): MsgCreateGroupWithPolicy { - return { - admin: object.admin, - members: Array.isArray(object?.members) ? object.members.map((e: any) => MemberRequest.fromAmino(e)) : [], - groupMetadata: object.group_metadata, - groupPolicyMetadata: object.group_policy_metadata, - groupPolicyAsAdmin: object.group_policy_as_admin, - decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any: undefined - }; + const message = createBaseMsgCreateGroupWithPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.members = object.members?.map(e => MemberRequest.fromAmino(e)) || []; + if (object.group_metadata !== undefined && object.group_metadata !== null) { + message.groupMetadata = object.group_metadata; + } + if (object.group_policy_metadata !== undefined && object.group_policy_metadata !== null) { + message.groupPolicyMetadata = object.group_policy_metadata; + } + if (object.group_policy_as_admin !== undefined && object.group_policy_as_admin !== null) { + message.groupPolicyAsAdmin = object.group_policy_as_admin; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = DecisionPolicy_FromAmino(object.decision_policy); + } + return message; }, toAmino(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; if (message.members) { obj.members = message.members.map(e => e ? MemberRequest.toAmino(e) : undefined); } else { - obj.members = []; + obj.members = message.members; } - obj.group_metadata = message.groupMetadata; - obj.group_policy_metadata = message.groupPolicyMetadata; - obj.group_policy_as_admin = message.groupPolicyAsAdmin; + obj.group_metadata = message.groupMetadata === "" ? undefined : message.groupMetadata; + obj.group_policy_metadata = message.groupPolicyMetadata === "" ? undefined : message.groupPolicyMetadata; + obj.group_policy_as_admin = message.groupPolicyAsAdmin === false ? undefined : message.groupPolicyAsAdmin; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; return obj; }, @@ -1970,13 +2035,14 @@ export const MsgCreateGroupWithPolicy = { }; function createBaseMsgCreateGroupWithPolicyResponse(): MsgCreateGroupWithPolicyResponse { return { - groupId: Long.UZERO, + groupId: BigInt(0), groupPolicyAddress: "" }; } export const MsgCreateGroupWithPolicyResponse = { - encode(message: MsgCreateGroupWithPolicyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse", + encode(message: MsgCreateGroupWithPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.groupPolicyAddress !== "") { @@ -1984,15 +2050,15 @@ export const MsgCreateGroupWithPolicyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupWithPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupWithPolicyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 2: message.groupPolicyAddress = reader.string(); @@ -2006,32 +2072,36 @@ export const MsgCreateGroupWithPolicyResponse = { }, fromJSON(object: any): MsgCreateGroupWithPolicyResponse { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), groupPolicyAddress: isSet(object.groupPolicyAddress) ? String(object.groupPolicyAddress) : "" }; }, toJSON(message: MsgCreateGroupWithPolicyResponse): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.groupPolicyAddress !== undefined && (obj.groupPolicyAddress = message.groupPolicyAddress); return obj; }, fromPartial(object: Partial): MsgCreateGroupWithPolicyResponse { const message = createBaseMsgCreateGroupWithPolicyResponse(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.groupPolicyAddress = object.groupPolicyAddress ?? ""; return message; }, fromAmino(object: MsgCreateGroupWithPolicyResponseAmino): MsgCreateGroupWithPolicyResponse { - return { - groupId: Long.fromString(object.group_id), - groupPolicyAddress: object.group_policy_address - }; + const message = createBaseMsgCreateGroupWithPolicyResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + return message; }, toAmino(message: MsgCreateGroupWithPolicyResponse): MsgCreateGroupWithPolicyResponseAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; - obj.group_policy_address = message.groupPolicyAddress; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; return obj; }, fromAminoMsg(object: MsgCreateGroupWithPolicyResponseAminoMsg): MsgCreateGroupWithPolicyResponse { @@ -2064,7 +2134,8 @@ function createBaseMsgUpdateGroupPolicyDecisionPolicy(): MsgUpdateGroupPolicyDec }; } export const MsgUpdateGroupPolicyDecisionPolicy = { - encode(message: MsgUpdateGroupPolicyDecisionPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + encode(message: MsgUpdateGroupPolicyDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -2076,8 +2147,8 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); while (reader.pos < end) { @@ -2090,7 +2161,7 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { message.groupPolicyAddress = reader.string(); break; case 3: - message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any); + message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as Any); break; default: reader.skipType(tag & 7); @@ -2103,7 +2174,7 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { return { admin: isSet(object.admin) ? String(object.admin) : "", groupPolicyAddress: isSet(object.groupPolicyAddress) ? String(object.groupPolicyAddress) : "", - decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any : undefined + decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) : undefined }; }, toJSON(message: MsgUpdateGroupPolicyDecisionPolicy): unknown { @@ -2117,20 +2188,26 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); message.admin = object.admin ?? ""; message.groupPolicyAddress = object.groupPolicyAddress ?? ""; - message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any : undefined; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; return message; }, fromAmino(object: MsgUpdateGroupPolicyDecisionPolicyAmino): MsgUpdateGroupPolicyDecisionPolicy { - return { - admin: object.admin, - groupPolicyAddress: object.group_policy_address, - decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any : undefined - }; + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = DecisionPolicy_FromAmino(object.decision_policy); + } + return message; }, toAmino(message: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyAmino { const obj: any = {}; - obj.admin = message.admin; - obj.group_policy_address = message.groupPolicyAddress; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; return obj; }, @@ -2160,11 +2237,12 @@ function createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(): MsgUpdateGroupP return {}; } export const MsgUpdateGroupPolicyDecisionPolicyResponse = { - encode(_: MsgUpdateGroupPolicyDecisionPolicyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", + encode(_: MsgUpdateGroupPolicyDecisionPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); while (reader.pos < end) { @@ -2189,7 +2267,8 @@ export const MsgUpdateGroupPolicyDecisionPolicyResponse = { return message; }, fromAmino(_: MsgUpdateGroupPolicyDecisionPolicyResponseAmino): MsgUpdateGroupPolicyDecisionPolicyResponse { - return {}; + const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); + return message; }, toAmino(_: MsgUpdateGroupPolicyDecisionPolicyResponse): MsgUpdateGroupPolicyDecisionPolicyResponseAmino { const obj: any = {}; @@ -2225,7 +2304,8 @@ function createBaseMsgUpdateGroupPolicyMetadata(): MsgUpdateGroupPolicyMetadata }; } export const MsgUpdateGroupPolicyMetadata = { - encode(message: MsgUpdateGroupPolicyMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + encode(message: MsgUpdateGroupPolicyMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -2237,8 +2317,8 @@ export const MsgUpdateGroupPolicyMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyMetadata(); while (reader.pos < end) { @@ -2282,17 +2362,23 @@ export const MsgUpdateGroupPolicyMetadata = { return message; }, fromAmino(object: MsgUpdateGroupPolicyMetadataAmino): MsgUpdateGroupPolicyMetadata { - return { - admin: object.admin, - groupPolicyAddress: object.group_policy_address, - metadata: object.metadata - }; + const message = createBaseMsgUpdateGroupPolicyMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataAmino { const obj: any = {}; - obj.admin = message.admin; - obj.group_policy_address = message.groupPolicyAddress; - obj.metadata = message.metadata; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgUpdateGroupPolicyMetadataAminoMsg): MsgUpdateGroupPolicyMetadata { @@ -2321,11 +2407,12 @@ function createBaseMsgUpdateGroupPolicyMetadataResponse(): MsgUpdateGroupPolicyM return {}; } export const MsgUpdateGroupPolicyMetadataResponse = { - encode(_: MsgUpdateGroupPolicyMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", + encode(_: MsgUpdateGroupPolicyMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); while (reader.pos < end) { @@ -2350,7 +2437,8 @@ export const MsgUpdateGroupPolicyMetadataResponse = { return message; }, fromAmino(_: MsgUpdateGroupPolicyMetadataResponseAmino): MsgUpdateGroupPolicyMetadataResponse { - return {}; + const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); + return message; }, toAmino(_: MsgUpdateGroupPolicyMetadataResponse): MsgUpdateGroupPolicyMetadataResponseAmino { const obj: any = {}; @@ -2388,7 +2476,8 @@ function createBaseMsgSubmitProposal(): MsgSubmitProposal { }; } export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.groupPolicyAddress !== "") { writer.uint32(10).string(message.groupPolicyAddress); } @@ -2406,8 +2495,8 @@ export const MsgSubmitProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { @@ -2441,7 +2530,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "", messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgSubmitProposal): unknown { @@ -2471,29 +2560,35 @@ export const MsgSubmitProposal = { return message; }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - return { - groupPolicyAddress: object.group_policy_address, - proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - metadata: object.metadata, - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 - }; + const message = createBaseMsgSubmitProposal(); + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + message.proposers = object.proposers?.map(e => e) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.exec !== undefined && object.exec !== null) { + message.exec = object.exec; + } + return message; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { const obj: any = {}; - obj.group_policy_address = message.groupPolicyAddress; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; if (message.proposers) { obj.proposers = message.proposers.map(e => e); } else { - obj.proposers = []; + obj.proposers = message.proposers; } - obj.metadata = message.metadata; + obj.metadata = message.metadata === "" ? undefined : message.metadata; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.messages = []; + obj.messages = message.messages; } - obj.exec = message.exec; + obj.exec = message.exec === 0 ? undefined : message.exec; return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { @@ -2520,25 +2615,26 @@ export const MsgSubmitProposal = { }; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { - proposalId: Long.UZERO + proposalId: BigInt(0) }; } export const MsgSubmitProposalResponse = { - encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -2549,27 +2645,29 @@ export const MsgSubmitProposalResponse = { }, fromJSON(object: any): MsgSubmitProposalResponse { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) }; }, toJSON(message: MsgSubmitProposalResponse): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - return { - proposalId: Long.fromString(object.proposal_id) - }; + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { @@ -2596,13 +2694,14 @@ export const MsgSubmitProposalResponse = { }; function createBaseMsgWithdrawProposal(): MsgWithdrawProposal { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), address: "" }; } export const MsgWithdrawProposal = { - encode(message: MsgWithdrawProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + encode(message: MsgWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.address !== "") { @@ -2610,15 +2709,15 @@ export const MsgWithdrawProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.address = reader.string(); @@ -2632,32 +2731,36 @@ export const MsgWithdrawProposal = { }, fromJSON(object: any): MsgWithdrawProposal { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), address: isSet(object.address) ? String(object.address) : "" }; }, toJSON(message: MsgWithdrawProposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.address !== undefined && (obj.address = message.address); return obj; }, fromPartial(object: Partial): MsgWithdrawProposal { const message = createBaseMsgWithdrawProposal(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.address = object.address ?? ""; return message; }, fromAmino(object: MsgWithdrawProposalAmino): MsgWithdrawProposal { - return { - proposalId: Long.fromString(object.proposal_id), - address: object.address - }; + const message = createBaseMsgWithdrawProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: MsgWithdrawProposal): MsgWithdrawProposalAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.address = message.address; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: MsgWithdrawProposalAminoMsg): MsgWithdrawProposal { @@ -2686,11 +2789,12 @@ function createBaseMsgWithdrawProposalResponse(): MsgWithdrawProposalResponse { return {}; } export const MsgWithdrawProposalResponse = { - encode(_: MsgWithdrawProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse", + encode(_: MsgWithdrawProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawProposalResponse(); while (reader.pos < end) { @@ -2715,7 +2819,8 @@ export const MsgWithdrawProposalResponse = { return message; }, fromAmino(_: MsgWithdrawProposalResponseAmino): MsgWithdrawProposalResponse { - return {}; + const message = createBaseMsgWithdrawProposalResponse(); + return message; }, toAmino(_: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseAmino { const obj: any = {}; @@ -2745,7 +2850,7 @@ export const MsgWithdrawProposalResponse = { }; function createBaseMsgVote(): MsgVote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, metadata: "", @@ -2753,8 +2858,9 @@ function createBaseMsgVote(): MsgVote { }; } export const MsgVote = { - encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -2771,15 +2877,15 @@ export const MsgVote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -2802,16 +2908,16 @@ export const MsgVote = { }, fromJSON(object: any): MsgVote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); message.metadata !== undefined && (obj.metadata = message.metadata); @@ -2820,7 +2926,7 @@ export const MsgVote = { }, fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.option = object.option ?? 0; message.metadata = object.metadata ?? ""; @@ -2828,21 +2934,31 @@ export const MsgVote = { return message; }, fromAmino(object: MsgVoteAmino): MsgVote { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - metadata: object.metadata, - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 - }; + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.exec !== undefined && object.exec !== null) { + message.exec = object.exec; + } + return message; }, toAmino(message: MsgVote): MsgVoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; - obj.option = message.option; - obj.metadata = message.metadata; - obj.exec = message.exec; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.exec = message.exec === 0 ? undefined : message.exec; return obj; }, fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { @@ -2871,11 +2987,12 @@ function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteResponse(); while (reader.pos < end) { @@ -2900,7 +3017,8 @@ export const MsgVoteResponse = { return message; }, fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - return {}; + const message = createBaseMsgVoteResponse(); + return message; }, toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { const obj: any = {}; @@ -2930,13 +3048,14 @@ export const MsgVoteResponse = { }; function createBaseMsgExec(): MsgExec { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), executor: "" }; } export const MsgExec = { - encode(message: MsgExec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.MsgExec", + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.executor !== "") { @@ -2944,15 +3063,15 @@ export const MsgExec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExec(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.executor = reader.string(); @@ -2966,32 +3085,36 @@ export const MsgExec = { }, fromJSON(object: any): MsgExec { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), executor: isSet(object.executor) ? String(object.executor) : "" }; }, toJSON(message: MsgExec): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.executor !== undefined && (obj.executor = message.executor); return obj; }, fromPartial(object: Partial): MsgExec { const message = createBaseMsgExec(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.executor = object.executor ?? ""; return message; }, fromAmino(object: MsgExecAmino): MsgExec { - return { - proposalId: Long.fromString(object.proposal_id), - executor: object.executor - }; + const message = createBaseMsgExec(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.executor !== undefined && object.executor !== null) { + message.executor = object.executor; + } + return message; }, toAmino(message: MsgExec): MsgExecAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.executor = message.executor; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.executor = message.executor === "" ? undefined : message.executor; return obj; }, fromAminoMsg(object: MsgExecAminoMsg): MsgExec { @@ -3022,14 +3145,15 @@ function createBaseMsgExecResponse(): MsgExecResponse { }; } export const MsgExecResponse = { - encode(message: MsgExecResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgExecResponse", + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(16).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecResponse(); while (reader.pos < end) { @@ -3047,7 +3171,7 @@ export const MsgExecResponse = { }, fromJSON(object: any): MsgExecResponse { return { - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toJSON(message: MsgExecResponse): unknown { @@ -3061,13 +3185,15 @@ export const MsgExecResponse = { return message; }, fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - return { - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 - }; + const message = createBaseMsgExecResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; }, toAmino(message: MsgExecResponse): MsgExecResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = message.result === 0 ? undefined : message.result; return obj; }, fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { @@ -3095,21 +3221,22 @@ export const MsgExecResponse = { function createBaseMsgLeaveGroup(): MsgLeaveGroup { return { address: "", - groupId: Long.UZERO + groupId: BigInt(0) }; } export const MsgLeaveGroup = { - encode(message: MsgLeaveGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + encode(message: MsgLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLeaveGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLeaveGroup(); while (reader.pos < end) { @@ -3119,7 +3246,7 @@ export const MsgLeaveGroup = { message.address = reader.string(); break; case 2: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -3131,31 +3258,35 @@ export const MsgLeaveGroup = { fromJSON(object: any): MsgLeaveGroup { return { address: isSet(object.address) ? String(object.address) : "", - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0) }; }, toJSON(message: MsgLeaveGroup): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgLeaveGroup { const message = createBaseMsgLeaveGroup(); message.address = object.address ?? ""; - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgLeaveGroupAmino): MsgLeaveGroup { - return { - address: object.address, - groupId: Long.fromString(object.group_id) - }; + const message = createBaseMsgLeaveGroup(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; }, toAmino(message: MsgLeaveGroup): MsgLeaveGroupAmino { const obj: any = {}; - obj.address = message.address; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgLeaveGroupAminoMsg): MsgLeaveGroup { @@ -3184,11 +3315,12 @@ function createBaseMsgLeaveGroupResponse(): MsgLeaveGroupResponse { return {}; } export const MsgLeaveGroupResponse = { - encode(_: MsgLeaveGroupResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse", + encode(_: MsgLeaveGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLeaveGroupResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLeaveGroupResponse(); while (reader.pos < end) { @@ -3213,7 +3345,8 @@ export const MsgLeaveGroupResponse = { return message; }, fromAmino(_: MsgLeaveGroupResponseAmino): MsgLeaveGroupResponse { - return {}; + const message = createBaseMsgLeaveGroupResponse(); + return message; }, toAmino(_: MsgLeaveGroupResponse): MsgLeaveGroupResponseAmino { const obj: any = {}; @@ -3241,8 +3374,8 @@ export const MsgLeaveGroupResponse = { }; } }; -export const DecisionPolicy_InterfaceDecoder = (input: _m0.Reader | Uint8Array): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const DecisionPolicy_InterfaceDecoder = (input: BinaryReader | Uint8Array): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.group.v1.ThresholdDecisionPolicy": @@ -3253,7 +3386,7 @@ export const DecisionPolicy_InterfaceDecoder = (input: _m0.Reader | Uint8Array): return data; } }; -export const DecisionPolicy_FromAmino = (content: AnyAmino) => { +export const DecisionPolicy_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/ThresholdDecisionPolicy": return Any.fromPartial({ @@ -3274,12 +3407,12 @@ export const DecisionPolicy_ToAmino = (content: Any) => { case "/cosmos.group.v1.ThresholdDecisionPolicy": return { type: "cosmos-sdk/ThresholdDecisionPolicy", - value: ThresholdDecisionPolicy.toAmino(ThresholdDecisionPolicy.decode(content.value)) + value: ThresholdDecisionPolicy.toAmino(ThresholdDecisionPolicy.decode(content.value, undefined)) }; case "/cosmos.group.v1.PercentageDecisionPolicy": return { type: "cosmos-sdk/PercentageDecisionPolicy", - value: PercentageDecisionPolicy.toAmino(PercentageDecisionPolicy.decode(content.value)) + value: PercentageDecisionPolicy.toAmino(PercentageDecisionPolicy.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/group/v1/types.ts b/packages/api/src/codegen/cosmos/group/v1/types.ts index d0a4fa94..de0bc27c 100644 --- a/packages/api/src/codegen/cosmos/group/v1/types.ts +++ b/packages/api/src/codegen/cosmos/group/v1/types.ts @@ -1,8 +1,8 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** VoteOption enumerates the valid vote options for a given proposal. */ export enum VoteOption { /** @@ -210,13 +210,13 @@ export interface MemberProtoMsg { */ export interface MemberAmino { /** address is the member's account address. */ - address: string; + address?: string; /** weight is the member's voting weight that should be greater than 0. */ - weight: string; + weight?: string; /** metadata is any arbitrary metadata attached to the member. */ - metadata: string; + metadata?: string; /** added_at is a timestamp specifying when a member was added. */ - added_at?: TimestampAmino; + added_at?: string; } export interface MemberAminoMsg { type: "cosmos-sdk/Member"; @@ -256,11 +256,11 @@ export interface MemberRequestProtoMsg { */ export interface MemberRequestAmino { /** address is the member's account address. */ - address: string; + address?: string; /** weight is the member's voting weight that should be greater than 0. */ - weight: string; + weight?: string; /** metadata is any arbitrary metadata attached to the member. */ - metadata: string; + metadata?: string; } export interface MemberRequestAminoMsg { type: "cosmos-sdk/MemberRequest"; @@ -285,14 +285,14 @@ export interface MemberRequestSDKType { * given by `windows`. */ export interface ThresholdDecisionPolicy { - $typeUrl?: string; + $typeUrl?: "/cosmos.group.v1.ThresholdDecisionPolicy"; /** * threshold is the minimum weighted sum of `YES` votes that must be met or * exceeded for a proposal to succeed. */ threshold: string; /** windows defines the different windows for voting and execution. */ - windows: DecisionPolicyWindows; + windows?: DecisionPolicyWindows; } export interface ThresholdDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy"; @@ -311,7 +311,7 @@ export interface ThresholdDecisionPolicyAmino { * threshold is the minimum weighted sum of `YES` votes that must be met or * exceeded for a proposal to succeed. */ - threshold: string; + threshold?: string; /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindowsAmino; } @@ -328,9 +328,9 @@ export interface ThresholdDecisionPolicyAminoMsg { * given by `windows`. */ export interface ThresholdDecisionPolicySDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.group.v1.ThresholdDecisionPolicy"; threshold: string; - windows: DecisionPolicyWindowsSDKType; + windows?: DecisionPolicyWindowsSDKType; } /** * PercentageDecisionPolicy is a decision policy where a proposal passes when @@ -341,14 +341,14 @@ export interface ThresholdDecisionPolicySDKType { * given by `windows`. */ export interface PercentageDecisionPolicy { - $typeUrl?: string; + $typeUrl?: "/cosmos.group.v1.PercentageDecisionPolicy"; /** * percentage is the minimum percentage the weighted sum of `YES` votes must * meet for a proposal to succeed. */ percentage: string; /** windows defines the different windows for voting and execution. */ - windows: DecisionPolicyWindows; + windows?: DecisionPolicyWindows; } export interface PercentageDecisionPolicyProtoMsg { typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy"; @@ -367,7 +367,7 @@ export interface PercentageDecisionPolicyAmino { * percentage is the minimum percentage the weighted sum of `YES` votes must * meet for a proposal to succeed. */ - percentage: string; + percentage?: string; /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindowsAmino; } @@ -384,9 +384,9 @@ export interface PercentageDecisionPolicyAminoMsg { * given by `windows`. */ export interface PercentageDecisionPolicySDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.group.v1.PercentageDecisionPolicy"; percentage: string; - windows: DecisionPolicyWindowsSDKType; + windows?: DecisionPolicyWindowsSDKType; } /** DecisionPolicyWindows defines the different windows for voting and execution. */ export interface DecisionPolicyWindows { @@ -448,7 +448,7 @@ export interface DecisionPolicyWindowsSDKType { /** GroupInfo represents the high-level on-chain information for a group. */ export interface GroupInfo { /** id is the unique ID of the group. */ - id: Long; + id: bigint; /** admin is the account address of the group's admin. */ admin: string; /** metadata is any arbitrary metadata to attached to the group. */ @@ -459,7 +459,7 @@ export interface GroupInfo { * or any member is added or removed this version is incremented and will * cause proposals based on older versions of this group to fail */ - version: Long; + version: bigint; /** total_weight is the sum of the group members' weights. */ totalWeight: string; /** created_at is a timestamp specifying when a group was created. */ @@ -472,22 +472,22 @@ export interface GroupInfoProtoMsg { /** GroupInfo represents the high-level on-chain information for a group. */ export interface GroupInfoAmino { /** id is the unique ID of the group. */ - id: string; + id?: string; /** admin is the account address of the group's admin. */ - admin: string; + admin?: string; /** metadata is any arbitrary metadata to attached to the group. */ - metadata: string; + metadata?: string; /** * version is used to track changes to a group's membership structure that * would break existing proposals. Whenever any members weight is changed, * or any member is added or removed this version is incremented and will * cause proposals based on older versions of this group to fail */ - version: string; + version?: string; /** total_weight is the sum of the group members' weights. */ - total_weight: string; + total_weight?: string; /** created_at is a timestamp specifying when a group was created. */ - created_at?: TimestampAmino; + created_at?: string; } export interface GroupInfoAminoMsg { type: "cosmos-sdk/GroupInfo"; @@ -495,19 +495,19 @@ export interface GroupInfoAminoMsg { } /** GroupInfo represents the high-level on-chain information for a group. */ export interface GroupInfoSDKType { - id: Long; + id: bigint; admin: string; metadata: string; - version: Long; + version: bigint; total_weight: string; created_at: TimestampSDKType; } /** GroupMember represents the relationship between a group and a member. */ export interface GroupMember { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** member is the member data. */ - member: Member; + member?: Member; } export interface GroupMemberProtoMsg { typeUrl: "/cosmos.group.v1.GroupMember"; @@ -516,7 +516,7 @@ export interface GroupMemberProtoMsg { /** GroupMember represents the relationship between a group and a member. */ export interface GroupMemberAmino { /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; /** member is the member data. */ member?: MemberAmino; } @@ -526,15 +526,15 @@ export interface GroupMemberAminoMsg { } /** GroupMember represents the relationship between a group and a member. */ export interface GroupMemberSDKType { - group_id: Long; - member: MemberSDKType; + group_id: bigint; + member?: MemberSDKType; } /** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ export interface GroupPolicyInfo { /** address is the account address of group policy. */ address: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** admin is the account address of the group admin. */ admin: string; /** metadata is any arbitrary metadata to attached to the group policy. */ @@ -543,9 +543,9 @@ export interface GroupPolicyInfo { * version is used to track changes to a group's GroupPolicyInfo structure that * would create a different result on a running proposal. */ - version: Long; + version: bigint; /** decision_policy specifies the group policy's decision policy. */ - decisionPolicy: (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) | undefined; + decisionPolicy?: (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) | undefined; /** created_at is a timestamp specifying when a group policy was created. */ createdAt: Timestamp; } @@ -559,22 +559,22 @@ export type GroupPolicyInfoEncoded = Omit & { /** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ export interface GroupPolicyInfoAmino { /** address is the account address of group policy. */ - address: string; + address?: string; /** group_id is the unique ID of the group. */ - group_id: string; + group_id?: string; /** admin is the account address of the group admin. */ - admin: string; + admin?: string; /** metadata is any arbitrary metadata to attached to the group policy. */ - metadata: string; + metadata?: string; /** * version is used to track changes to a group's GroupPolicyInfo structure that * would create a different result on a running proposal. */ - version: string; + version?: string; /** decision_policy specifies the group policy's decision policy. */ decision_policy?: AnyAmino; /** created_at is a timestamp specifying when a group policy was created. */ - created_at?: TimestampAmino; + created_at?: string; } export interface GroupPolicyInfoAminoMsg { type: "cosmos-sdk/GroupPolicyInfo"; @@ -583,11 +583,11 @@ export interface GroupPolicyInfoAminoMsg { /** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ export interface GroupPolicyInfoSDKType { address: string; - group_id: Long; + group_id: bigint; admin: string; metadata: string; - version: Long; - decision_policy: ThresholdDecisionPolicySDKType | PercentageDecisionPolicySDKType | AnySDKType | undefined; + version: bigint; + decision_policy?: ThresholdDecisionPolicySDKType | PercentageDecisionPolicySDKType | AnySDKType | undefined; created_at: TimestampSDKType; } /** @@ -598,7 +598,7 @@ export interface GroupPolicyInfoSDKType { */ export interface Proposal { /** id is the unique id of the proposal. */ - id: Long; + id: bigint; /** group_policy_address is the account address of group policy. */ groupPolicyAddress: string; /** metadata is any arbitrary metadata to attached to the proposal. */ @@ -611,14 +611,14 @@ export interface Proposal { * group_version tracks the version of the group at proposal submission. * This field is here for informational purposes only. */ - groupVersion: Long; + groupVersion: bigint; /** * group_policy_version tracks the version of the group policy at proposal submission. * When a decision policy is changed, existing proposals from previous policy * versions will become invalid with the `ABORTED` status. * This field is here for informational purposes only. */ - groupPolicyVersion: Long; + groupPolicyVersion: bigint; /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ status: ProposalStatus; /** @@ -653,29 +653,29 @@ export interface ProposalProtoMsg { */ export interface ProposalAmino { /** id is the unique id of the proposal. */ - id: string; + id?: string; /** group_policy_address is the account address of group policy. */ - group_policy_address: string; + group_policy_address?: string; /** metadata is any arbitrary metadata to attached to the proposal. */ - metadata: string; + metadata?: string; /** proposers are the account addresses of the proposers. */ - proposers: string[]; + proposers?: string[]; /** submit_time is a timestamp specifying when a proposal was submitted. */ - submit_time?: TimestampAmino; + submit_time?: string; /** * group_version tracks the version of the group at proposal submission. * This field is here for informational purposes only. */ - group_version: string; + group_version?: string; /** * group_policy_version tracks the version of the group policy at proposal submission. * When a decision policy is changed, existing proposals from previous policy * versions will become invalid with the `ABORTED` status. * This field is here for informational purposes only. */ - group_policy_version: string; + group_policy_version?: string; /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ - status: ProposalStatus; + status?: ProposalStatus; /** * final_tally_result contains the sums of all weighted votes for this * proposal for each vote option. It is empty at submission, and only @@ -690,11 +690,11 @@ export interface ProposalAmino { * at this point, and the `final_tally_result`and `status` fields will be * accordingly updated. */ - voting_period_end?: TimestampAmino; + voting_period_end?: string; /** executor_result is the final result of the proposal execution. Initial value is NotRun. */ - executor_result: ProposalExecutorResult; + executor_result?: ProposalExecutorResult; /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ - messages: AnyAmino[]; + messages?: AnyAmino[]; } export interface ProposalAminoMsg { type: "cosmos-sdk/Proposal"; @@ -707,13 +707,13 @@ export interface ProposalAminoMsg { * passes as well as some optional metadata associated with the proposal. */ export interface ProposalSDKType { - id: Long; + id: bigint; group_policy_address: string; metadata: string; proposers: string[]; submit_time: TimestampSDKType; - group_version: Long; - group_policy_version: Long; + group_version: bigint; + group_policy_version: bigint; status: ProposalStatus; final_tally_result: TallyResultSDKType; voting_period_end: TimestampSDKType; @@ -738,13 +738,13 @@ export interface TallyResultProtoMsg { /** TallyResult represents the sum of weighted votes for each vote option. */ export interface TallyResultAmino { /** yes_count is the weighted sum of yes votes. */ - yes_count: string; + yes_count?: string; /** abstain_count is the weighted sum of abstainers. */ - abstain_count: string; + abstain_count?: string; /** no_count is the weighted sum of no votes. */ - no_count: string; + no_count?: string; /** no_with_veto_count is the weighted sum of veto. */ - no_with_veto_count: string; + no_with_veto_count?: string; } export interface TallyResultAminoMsg { type: "cosmos-sdk/TallyResult"; @@ -760,7 +760,7 @@ export interface TallyResultSDKType { /** Vote represents a vote for a proposal. */ export interface Vote { /** proposal is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the account address of the voter. */ voter: string; /** option is the voter's choice on the proposal. */ @@ -777,15 +777,15 @@ export interface VoteProtoMsg { /** Vote represents a vote for a proposal. */ export interface VoteAmino { /** proposal is the unique ID of the proposal. */ - proposal_id: string; + proposal_id?: string; /** voter is the account address of the voter. */ - voter: string; + voter?: string; /** option is the voter's choice on the proposal. */ - option: VoteOption; + option?: VoteOption; /** metadata is any arbitrary metadata to attached to the vote. */ - metadata: string; + metadata?: string; /** submit_time is the timestamp when the vote was submitted. */ - submit_time?: TimestampAmino; + submit_time?: string; } export interface VoteAminoMsg { type: "cosmos-sdk/Vote"; @@ -793,7 +793,7 @@ export interface VoteAminoMsg { } /** Vote represents a vote for a proposal. */ export interface VoteSDKType { - proposal_id: Long; + proposal_id: bigint; voter: string; option: VoteOption; metadata: string; @@ -804,11 +804,12 @@ function createBaseMember(): Member { address: "", weight: "", metadata: "", - addedAt: undefined + addedAt: Timestamp.fromPartial({}) }; } export const Member = { - encode(message: Member, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.Member", + encode(message: Member, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -823,8 +824,8 @@ export const Member = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Member { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Member { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMember(); while (reader.pos < end) { @@ -874,18 +875,26 @@ export const Member = { return message; }, fromAmino(object: MemberAmino): Member { - return { - address: object.address, - weight: object.weight, - metadata: object.metadata, - addedAt: object?.added_at ? Timestamp.fromAmino(object.added_at) : undefined - }; + const message = createBaseMember(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.added_at !== undefined && object.added_at !== null) { + message.addedAt = Timestamp.fromAmino(object.added_at); + } + return message; }, toAmino(message: Member): MemberAmino { const obj: any = {}; - obj.address = message.address; - obj.weight = message.weight; - obj.metadata = message.metadata; + obj.address = message.address === "" ? undefined : message.address; + obj.weight = message.weight === "" ? undefined : message.weight; + obj.metadata = message.metadata === "" ? undefined : message.metadata; obj.added_at = message.addedAt ? Timestamp.toAmino(message.addedAt) : undefined; return obj; }, @@ -919,7 +928,8 @@ function createBaseMemberRequest(): MemberRequest { }; } export const MemberRequest = { - encode(message: MemberRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.MemberRequest", + encode(message: MemberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -931,8 +941,8 @@ export const MemberRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MemberRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MemberRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMemberRequest(); while (reader.pos < end) { @@ -976,17 +986,23 @@ export const MemberRequest = { return message; }, fromAmino(object: MemberRequestAmino): MemberRequest { - return { - address: object.address, - weight: object.weight, - metadata: object.metadata - }; + const message = createBaseMemberRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MemberRequest): MemberRequestAmino { const obj: any = {}; - obj.address = message.address; - obj.weight = message.weight; - obj.metadata = message.metadata; + obj.address = message.address === "" ? undefined : message.address; + obj.weight = message.weight === "" ? undefined : message.weight; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MemberRequestAminoMsg): MemberRequest { @@ -1015,11 +1031,12 @@ function createBaseThresholdDecisionPolicy(): ThresholdDecisionPolicy { return { $typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", threshold: "", - windows: DecisionPolicyWindows.fromPartial({}) + windows: undefined }; } export const ThresholdDecisionPolicy = { - encode(message: ThresholdDecisionPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + encode(message: ThresholdDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.threshold !== "") { writer.uint32(10).string(message.threshold); } @@ -1028,8 +1045,8 @@ export const ThresholdDecisionPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ThresholdDecisionPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ThresholdDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseThresholdDecisionPolicy(); while (reader.pos < end) { @@ -1067,14 +1084,18 @@ export const ThresholdDecisionPolicy = { return message; }, fromAmino(object: ThresholdDecisionPolicyAmino): ThresholdDecisionPolicy { - return { - threshold: object.threshold, - windows: object?.windows ? DecisionPolicyWindows.fromAmino(object.windows) : undefined - }; + const message = createBaseThresholdDecisionPolicy(); + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + if (object.windows !== undefined && object.windows !== null) { + message.windows = DecisionPolicyWindows.fromAmino(object.windows); + } + return message; }, toAmino(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyAmino { const obj: any = {}; - obj.threshold = message.threshold; + obj.threshold = message.threshold === "" ? undefined : message.threshold; obj.windows = message.windows ? DecisionPolicyWindows.toAmino(message.windows) : undefined; return obj; }, @@ -1104,11 +1125,12 @@ function createBasePercentageDecisionPolicy(): PercentageDecisionPolicy { return { $typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", percentage: "", - windows: DecisionPolicyWindows.fromPartial({}) + windows: undefined }; } export const PercentageDecisionPolicy = { - encode(message: PercentageDecisionPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + encode(message: PercentageDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.percentage !== "") { writer.uint32(10).string(message.percentage); } @@ -1117,8 +1139,8 @@ export const PercentageDecisionPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PercentageDecisionPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PercentageDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePercentageDecisionPolicy(); while (reader.pos < end) { @@ -1156,14 +1178,18 @@ export const PercentageDecisionPolicy = { return message; }, fromAmino(object: PercentageDecisionPolicyAmino): PercentageDecisionPolicy { - return { - percentage: object.percentage, - windows: object?.windows ? DecisionPolicyWindows.fromAmino(object.windows) : undefined - }; + const message = createBasePercentageDecisionPolicy(); + if (object.percentage !== undefined && object.percentage !== null) { + message.percentage = object.percentage; + } + if (object.windows !== undefined && object.windows !== null) { + message.windows = DecisionPolicyWindows.fromAmino(object.windows); + } + return message; }, toAmino(message: PercentageDecisionPolicy): PercentageDecisionPolicyAmino { const obj: any = {}; - obj.percentage = message.percentage; + obj.percentage = message.percentage === "" ? undefined : message.percentage; obj.windows = message.windows ? DecisionPolicyWindows.toAmino(message.windows) : undefined; return obj; }, @@ -1191,12 +1217,13 @@ export const PercentageDecisionPolicy = { }; function createBaseDecisionPolicyWindows(): DecisionPolicyWindows { return { - votingPeriod: undefined, - minExecutionPeriod: undefined + votingPeriod: Duration.fromPartial({}), + minExecutionPeriod: Duration.fromPartial({}) }; } export const DecisionPolicyWindows = { - encode(message: DecisionPolicyWindows, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows", + encode(message: DecisionPolicyWindows, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } @@ -1205,8 +1232,8 @@ export const DecisionPolicyWindows = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DecisionPolicyWindows { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DecisionPolicyWindows { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDecisionPolicyWindows(); while (reader.pos < end) { @@ -1244,10 +1271,14 @@ export const DecisionPolicyWindows = { return message; }, fromAmino(object: DecisionPolicyWindowsAmino): DecisionPolicyWindows { - return { - votingPeriod: object?.voting_period ? Duration.fromAmino(object.voting_period) : undefined, - minExecutionPeriod: object?.min_execution_period ? Duration.fromAmino(object.min_execution_period) : undefined - }; + const message = createBaseDecisionPolicyWindows(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + if (object.min_execution_period !== undefined && object.min_execution_period !== null) { + message.minExecutionPeriod = Duration.fromAmino(object.min_execution_period); + } + return message; }, toAmino(message: DecisionPolicyWindows): DecisionPolicyWindowsAmino { const obj: any = {}; @@ -1279,17 +1310,18 @@ export const DecisionPolicyWindows = { }; function createBaseGroupInfo(): GroupInfo { return { - id: Long.UZERO, + id: BigInt(0), admin: "", metadata: "", - version: Long.UZERO, + version: BigInt(0), totalWeight: "", - createdAt: undefined + createdAt: Timestamp.fromPartial({}) }; } export const GroupInfo = { - encode(message: GroupInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/cosmos.group.v1.GroupInfo", + encode(message: GroupInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.admin !== "") { @@ -1298,7 +1330,7 @@ export const GroupInfo = { if (message.metadata !== "") { writer.uint32(26).string(message.metadata); } - if (!message.version.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(32).uint64(message.version); } if (message.totalWeight !== "") { @@ -1309,15 +1341,15 @@ export const GroupInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GroupInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GroupInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGroupInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.admin = reader.string(); @@ -1326,7 +1358,7 @@ export const GroupInfo = { message.metadata = reader.string(); break; case 4: - message.version = (reader.uint64() as Long); + message.version = reader.uint64(); break; case 5: message.totalWeight = reader.string(); @@ -1343,51 +1375,63 @@ export const GroupInfo = { }, fromJSON(object: any): GroupInfo { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), admin: isSet(object.admin) ? String(object.admin) : "", metadata: isSet(object.metadata) ? String(object.metadata) : "", - version: isSet(object.version) ? Long.fromValue(object.version) : Long.UZERO, + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0), totalWeight: isSet(object.totalWeight) ? String(object.totalWeight) : "", createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined }; }, toJSON(message: GroupInfo): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.admin !== undefined && (obj.admin = message.admin); message.metadata !== undefined && (obj.metadata = message.metadata); - message.version !== undefined && (obj.version = (message.version || Long.UZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.totalWeight !== undefined && (obj.totalWeight = message.totalWeight); message.createdAt !== undefined && (obj.createdAt = fromTimestamp(message.createdAt).toISOString()); return obj; }, fromPartial(object: Partial): GroupInfo { const message = createBaseGroupInfo(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.admin = object.admin ?? ""; message.metadata = object.metadata ?? ""; - message.version = object.version !== undefined && object.version !== null ? Long.fromValue(object.version) : Long.UZERO; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); message.totalWeight = object.totalWeight ?? ""; message.createdAt = object.createdAt !== undefined && object.createdAt !== null ? Timestamp.fromPartial(object.createdAt) : undefined; return message; }, fromAmino(object: GroupInfoAmino): GroupInfo { - return { - id: Long.fromString(object.id), - admin: object.admin, - metadata: object.metadata, - version: Long.fromString(object.version), - totalWeight: object.total_weight, - createdAt: object?.created_at ? Timestamp.fromAmino(object.created_at) : undefined - }; + const message = createBaseGroupInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = Timestamp.fromAmino(object.created_at); + } + return message; }, toAmino(message: GroupInfo): GroupInfoAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.admin = message.admin; - obj.metadata = message.metadata; - obj.version = message.version ? message.version.toString() : undefined; - obj.total_weight = message.totalWeight; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.total_weight = message.totalWeight === "" ? undefined : message.totalWeight; obj.created_at = message.createdAt ? Timestamp.toAmino(message.createdAt) : undefined; return obj; }, @@ -1415,13 +1459,14 @@ export const GroupInfo = { }; function createBaseGroupMember(): GroupMember { return { - groupId: Long.UZERO, - member: Member.fromPartial({}) + groupId: BigInt(0), + member: undefined }; } export const GroupMember = { - encode(message: GroupMember, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + typeUrl: "/cosmos.group.v1.GroupMember", + encode(message: GroupMember, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.member !== undefined) { @@ -1429,15 +1474,15 @@ export const GroupMember = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GroupMember { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GroupMember { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGroupMember(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 2: message.member = Member.decode(reader, reader.uint32()); @@ -1451,31 +1496,35 @@ export const GroupMember = { }, fromJSON(object: any): GroupMember { return { - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), member: isSet(object.member) ? Member.fromJSON(object.member) : undefined }; }, toJSON(message: GroupMember): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.member !== undefined && (obj.member = message.member ? Member.toJSON(message.member) : undefined); return obj; }, fromPartial(object: Partial): GroupMember { const message = createBaseGroupMember(); - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.member = object.member !== undefined && object.member !== null ? Member.fromPartial(object.member) : undefined; return message; }, fromAmino(object: GroupMemberAmino): GroupMember { - return { - groupId: Long.fromString(object.group_id), - member: object?.member ? Member.fromAmino(object.member) : undefined - }; + const message = createBaseGroupMember(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.member !== undefined && object.member !== null) { + message.member = Member.fromAmino(object.member); + } + return message; }, toAmino(message: GroupMember): GroupMemberAmino { const obj: any = {}; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; obj.member = message.member ? Member.toAmino(message.member) : undefined; return obj; }, @@ -1504,20 +1553,21 @@ export const GroupMember = { function createBaseGroupPolicyInfo(): GroupPolicyInfo { return { address: "", - groupId: Long.UZERO, + groupId: BigInt(0), admin: "", metadata: "", - version: Long.UZERO, + version: BigInt(0), decisionPolicy: undefined, - createdAt: undefined + createdAt: Timestamp.fromPartial({}) }; } export const GroupPolicyInfo = { - encode(message: GroupPolicyInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo", + encode(message: GroupPolicyInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.admin !== "") { @@ -1526,7 +1576,7 @@ export const GroupPolicyInfo = { if (message.metadata !== "") { writer.uint32(34).string(message.metadata); } - if (!message.version.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(40).uint64(message.version); } if (message.decisionPolicy !== undefined) { @@ -1537,8 +1587,8 @@ export const GroupPolicyInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GroupPolicyInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GroupPolicyInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGroupPolicyInfo(); while (reader.pos < end) { @@ -1548,7 +1598,7 @@ export const GroupPolicyInfo = { message.address = reader.string(); break; case 2: - message.groupId = (reader.uint64() as Long); + message.groupId = reader.uint64(); break; case 3: message.admin = reader.string(); @@ -1557,10 +1607,10 @@ export const GroupPolicyInfo = { message.metadata = reader.string(); break; case 5: - message.version = (reader.uint64() as Long); + message.version = reader.uint64(); break; case 6: - message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as ThresholdDecisionPolicy & PercentageDecisionPolicy & Any); + message.decisionPolicy = (DecisionPolicy_InterfaceDecoder(reader) as Any); break; case 7: message.createdAt = Timestamp.decode(reader, reader.uint32()); @@ -1575,23 +1625,21 @@ export const GroupPolicyInfo = { fromJSON(object: any): GroupPolicyInfo { return { address: isSet(object.address) ? String(object.address) : "", - groupId: isSet(object.groupId) ? Long.fromValue(object.groupId) : Long.UZERO, + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0), admin: isSet(object.admin) ? String(object.admin) : "", metadata: isSet(object.metadata) ? String(object.metadata) : "", - version: isSet(object.version) ? Long.fromValue(object.version) : Long.UZERO, - decisionPolicy: isSet(object.decisionPolicy) - ? Any.fromJSON(object.decisionPolicy) as (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) - : undefined, + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0), + decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) : undefined, createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined }; }, toJSON(message: GroupPolicyInfo): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.admin !== undefined && (obj.admin = message.admin); message.metadata !== undefined && (obj.metadata = message.metadata); - message.version !== undefined && (obj.version = (message.version || Long.UZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.decisionPolicy !== undefined && (obj.decisionPolicy = message.decisionPolicy ? Any.toJSON(message.decisionPolicy) : undefined); message.createdAt !== undefined && (obj.createdAt = fromTimestamp(message.createdAt).toISOString()); return obj; @@ -1599,36 +1647,46 @@ export const GroupPolicyInfo = { fromPartial(object: Partial): GroupPolicyInfo { const message = createBaseGroupPolicyInfo(); message.address = object.address ?? ""; - message.groupId = object.groupId !== undefined && object.groupId !== null ? Long.fromValue(object.groupId) : Long.UZERO; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); message.admin = object.admin ?? ""; message.metadata = object.metadata ?? ""; - message.version = object.version !== undefined && object.version !== null ? Long.fromValue(object.version) : Long.UZERO; - message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null - ? Any.fromPartial(object.decisionPolicy) as (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) - : undefined; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; message.createdAt = object.createdAt !== undefined && object.createdAt !== null ? Timestamp.fromPartial(object.createdAt) : undefined; return message; }, fromAmino(object: GroupPolicyInfoAmino): GroupPolicyInfo { - return { - address: object.address, - groupId: Long.fromString(object.group_id), - admin: object.admin, - metadata: object.metadata, - version: Long.fromString(object.version), - decisionPolicy: object?.decision_policy - ? DecisionPolicy_FromAmino(object.decision_policy) as (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) - : undefined, - createdAt: object?.created_at ? Timestamp.fromAmino(object.created_at) : undefined - }; + const message = createBaseGroupPolicyInfo(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = DecisionPolicy_FromAmino(object.decision_policy); + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = Timestamp.fromAmino(object.created_at); + } + return message; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { const obj: any = {}; - obj.address = message.address; - obj.group_id = message.groupId ? message.groupId.toString() : undefined; - obj.admin = message.admin; - obj.metadata = message.metadata; - obj.version = message.version ? message.version.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; obj.created_at = message.createdAt ? Timestamp.toAmino(message.createdAt) : undefined; return obj; @@ -1657,23 +1715,24 @@ export const GroupPolicyInfo = { }; function createBaseProposal(): Proposal { return { - id: Long.UZERO, + id: BigInt(0), groupPolicyAddress: "", metadata: "", proposers: [], - submitTime: undefined, - groupVersion: Long.UZERO, - groupPolicyVersion: Long.UZERO, + submitTime: Timestamp.fromPartial({}), + groupVersion: BigInt(0), + groupPolicyVersion: BigInt(0), status: 0, finalTallyResult: TallyResult.fromPartial({}), - votingPeriodEnd: undefined, + votingPeriodEnd: Timestamp.fromPartial({}), executorResult: 0, messages: [] }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/cosmos.group.v1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.groupPolicyAddress !== "") { @@ -1688,10 +1747,10 @@ export const Proposal = { if (message.submitTime !== undefined) { Timestamp.encode(message.submitTime, writer.uint32(42).fork()).ldelim(); } - if (!message.groupVersion.isZero()) { + if (message.groupVersion !== BigInt(0)) { writer.uint32(48).uint64(message.groupVersion); } - if (!message.groupPolicyVersion.isZero()) { + if (message.groupPolicyVersion !== BigInt(0)) { writer.uint32(56).uint64(message.groupPolicyVersion); } if (message.status !== 0) { @@ -1711,15 +1770,15 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.groupPolicyAddress = reader.string(); @@ -1734,10 +1793,10 @@ export const Proposal = { message.submitTime = Timestamp.decode(reader, reader.uint32()); break; case 6: - message.groupVersion = (reader.uint64() as Long); + message.groupVersion = reader.uint64(); break; case 7: - message.groupPolicyVersion = (reader.uint64() as Long); + message.groupPolicyVersion = reader.uint64(); break; case 8: message.status = (reader.int32() as any); @@ -1763,23 +1822,23 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), groupPolicyAddress: isSet(object.groupPolicyAddress) ? String(object.groupPolicyAddress) : "", metadata: isSet(object.metadata) ? String(object.metadata) : "", proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], submitTime: isSet(object.submitTime) ? fromJsonTimestamp(object.submitTime) : undefined, - groupVersion: isSet(object.groupVersion) ? Long.fromValue(object.groupVersion) : Long.UZERO, - groupPolicyVersion: isSet(object.groupPolicyVersion) ? Long.fromValue(object.groupPolicyVersion) : Long.UZERO, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + groupVersion: isSet(object.groupVersion) ? BigInt(object.groupVersion.toString()) : BigInt(0), + groupPolicyVersion: isSet(object.groupPolicyVersion) ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0), + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, votingPeriodEnd: isSet(object.votingPeriodEnd) ? fromJsonTimestamp(object.votingPeriodEnd) : undefined, - executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : 0, + executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [] }; }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.groupPolicyAddress !== undefined && (obj.groupPolicyAddress = message.groupPolicyAddress); message.metadata !== undefined && (obj.metadata = message.metadata); if (message.proposers) { @@ -1788,8 +1847,8 @@ export const Proposal = { obj.proposers = []; } message.submitTime !== undefined && (obj.submitTime = fromTimestamp(message.submitTime).toISOString()); - message.groupVersion !== undefined && (obj.groupVersion = (message.groupVersion || Long.UZERO).toString()); - message.groupPolicyVersion !== undefined && (obj.groupPolicyVersion = (message.groupPolicyVersion || Long.UZERO).toString()); + message.groupVersion !== undefined && (obj.groupVersion = (message.groupVersion || BigInt(0)).toString()); + message.groupPolicyVersion !== undefined && (obj.groupPolicyVersion = (message.groupPolicyVersion || BigInt(0)).toString()); message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); message.finalTallyResult !== undefined && (obj.finalTallyResult = message.finalTallyResult ? TallyResult.toJSON(message.finalTallyResult) : undefined); message.votingPeriodEnd !== undefined && (obj.votingPeriodEnd = fromTimestamp(message.votingPeriodEnd).toISOString()); @@ -1803,13 +1862,13 @@ export const Proposal = { }, fromPartial(object: Partial): Proposal { const message = createBaseProposal(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.groupPolicyAddress = object.groupPolicyAddress ?? ""; message.metadata = object.metadata ?? ""; message.proposers = object.proposers?.map(e => e) || []; message.submitTime = object.submitTime !== undefined && object.submitTime !== null ? Timestamp.fromPartial(object.submitTime) : undefined; - message.groupVersion = object.groupVersion !== undefined && object.groupVersion !== null ? Long.fromValue(object.groupVersion) : Long.UZERO; - message.groupPolicyVersion = object.groupPolicyVersion !== undefined && object.groupPolicyVersion !== null ? Long.fromValue(object.groupPolicyVersion) : Long.UZERO; + message.groupVersion = object.groupVersion !== undefined && object.groupVersion !== null ? BigInt(object.groupVersion.toString()) : BigInt(0); + message.groupPolicyVersion = object.groupPolicyVersion !== undefined && object.groupPolicyVersion !== null ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0); message.status = object.status ?? 0; message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; message.votingPeriodEnd = object.votingPeriodEnd !== undefined && object.votingPeriodEnd !== null ? Timestamp.fromPartial(object.votingPeriodEnd) : undefined; @@ -1818,42 +1877,62 @@ export const Proposal = { return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - id: Long.fromString(object.id), - groupPolicyAddress: object.group_policy_address, - metadata: object.metadata, - proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, - groupVersion: Long.fromString(object.group_version), - groupPolicyVersion: Long.fromString(object.group_policy_version), - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - votingPeriodEnd: object?.voting_period_end ? Timestamp.fromAmino(object.voting_period_end) : undefined, - executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseProposal(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + message.proposers = object.proposers?.map(e => e) || []; + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = Timestamp.fromAmino(object.submit_time); + } + if (object.group_version !== undefined && object.group_version !== null) { + message.groupVersion = BigInt(object.group_version); + } + if (object.group_policy_version !== undefined && object.group_policy_version !== null) { + message.groupPolicyVersion = BigInt(object.group_policy_version); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.voting_period_end !== undefined && object.voting_period_end !== null) { + message.votingPeriodEnd = Timestamp.fromAmino(object.voting_period_end); + } + if (object.executor_result !== undefined && object.executor_result !== null) { + message.executorResult = object.executor_result; + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.group_policy_address = message.groupPolicyAddress; - obj.metadata = message.metadata; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + obj.metadata = message.metadata === "" ? undefined : message.metadata; if (message.proposers) { obj.proposers = message.proposers.map(e => e); } else { - obj.proposers = []; + obj.proposers = message.proposers; } obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; - obj.group_version = message.groupVersion ? message.groupVersion.toString() : undefined; - obj.group_policy_version = message.groupPolicyVersion ? message.groupPolicyVersion.toString() : undefined; - obj.status = message.status; + obj.group_version = message.groupVersion !== BigInt(0) ? message.groupVersion.toString() : undefined; + obj.group_policy_version = message.groupPolicyVersion !== BigInt(0) ? message.groupPolicyVersion.toString() : undefined; + obj.status = message.status === 0 ? undefined : message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(message.votingPeriodEnd) : undefined; - obj.executor_result = message.executorResult; + obj.executor_result = message.executorResult === 0 ? undefined : message.executorResult; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.messages = []; + obj.messages = message.messages; } return obj; }, @@ -1888,7 +1967,8 @@ function createBaseTallyResult(): TallyResult { }; } export const TallyResult = { - encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.group.v1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.yesCount !== "") { writer.uint32(10).string(message.yesCount); } @@ -1903,8 +1983,8 @@ export const TallyResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyResult(); while (reader.pos < end) { @@ -1954,19 +2034,27 @@ export const TallyResult = { return message; }, fromAmino(object: TallyResultAmino): TallyResult { - return { - yesCount: object.yes_count, - abstainCount: object.abstain_count, - noCount: object.no_count, - noWithVetoCount: object.no_with_veto_count - }; + const message = createBaseTallyResult(); + if (object.yes_count !== undefined && object.yes_count !== null) { + message.yesCount = object.yes_count; + } + if (object.abstain_count !== undefined && object.abstain_count !== null) { + message.abstainCount = object.abstain_count; + } + if (object.no_count !== undefined && object.no_count !== null) { + message.noCount = object.no_count; + } + if (object.no_with_veto_count !== undefined && object.no_with_veto_count !== null) { + message.noWithVetoCount = object.no_with_veto_count; + } + return message; }, toAmino(message: TallyResult): TallyResultAmino { const obj: any = {}; - obj.yes_count = message.yesCount; - obj.abstain_count = message.abstainCount; - obj.no_count = message.noCount; - obj.no_with_veto_count = message.noWithVetoCount; + obj.yes_count = message.yesCount === "" ? undefined : message.yesCount; + obj.abstain_count = message.abstainCount === "" ? undefined : message.abstainCount; + obj.no_count = message.noCount === "" ? undefined : message.noCount; + obj.no_with_veto_count = message.noWithVetoCount === "" ? undefined : message.noWithVetoCount; return obj; }, fromAminoMsg(object: TallyResultAminoMsg): TallyResult { @@ -1993,16 +2081,17 @@ export const TallyResult = { }; function createBaseVote(): Vote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, metadata: "", - submitTime: undefined + submitTime: Timestamp.fromPartial({}) }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + typeUrl: "/cosmos.group.v1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -2019,15 +2108,15 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = (reader.uint64() as Long); + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -2050,16 +2139,16 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", submitTime: isSet(object.submitTime) ? fromJsonTimestamp(object.submitTime) : undefined }; }, toJSON(message: Vote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); message.metadata !== undefined && (obj.metadata = message.metadata); @@ -2068,7 +2157,7 @@ export const Vote = { }, fromPartial(object: Partial): Vote { const message = createBaseVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? Long.fromValue(object.proposalId) : Long.UZERO; + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.option = object.option ?? 0; message.metadata = object.metadata ?? ""; @@ -2076,20 +2165,30 @@ export const Vote = { return message; }, fromAmino(object: VoteAmino): Vote { - return { - proposalId: Long.fromString(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, - metadata: object.metadata, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined - }; + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = Timestamp.fromAmino(object.submit_time); + } + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.voter = message.voter; - obj.option = message.option; - obj.metadata = message.metadata; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; return obj; }, @@ -2115,8 +2214,8 @@ export const Vote = { }; } }; -export const DecisionPolicy_InterfaceDecoder = (input: _m0.Reader | Uint8Array): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const DecisionPolicy_InterfaceDecoder = (input: BinaryReader | Uint8Array): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { case "/cosmos.group.v1.ThresholdDecisionPolicy": @@ -2127,7 +2226,7 @@ export const DecisionPolicy_InterfaceDecoder = (input: _m0.Reader | Uint8Array): return data; } }; -export const DecisionPolicy_FromAmino = (content: AnyAmino) => { +export const DecisionPolicy_FromAmino = (content: AnyAmino): Any => { switch (content.type) { case "cosmos-sdk/ThresholdDecisionPolicy": return Any.fromPartial({ @@ -2148,12 +2247,12 @@ export const DecisionPolicy_ToAmino = (content: Any) => { case "/cosmos.group.v1.ThresholdDecisionPolicy": return { type: "cosmos-sdk/ThresholdDecisionPolicy", - value: ThresholdDecisionPolicy.toAmino(ThresholdDecisionPolicy.decode(content.value)) + value: ThresholdDecisionPolicy.toAmino(ThresholdDecisionPolicy.decode(content.value, undefined)) }; case "/cosmos.group.v1.PercentageDecisionPolicy": return { type: "cosmos-sdk/PercentageDecisionPolicy", - value: PercentageDecisionPolicy.toAmino(PercentageDecisionPolicy.decode(content.value)) + value: PercentageDecisionPolicy.toAmino(PercentageDecisionPolicy.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/api/src/codegen/cosmos/lcd.ts b/packages/api/src/codegen/cosmos/lcd.ts index 38d5a54e..a71f3e10 100644 --- a/packages/api/src/codegen/cosmos/lcd.ts +++ b/packages/api/src/codegen/cosmos/lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; export const createLCDClient = async ({ restEndpoint }: { diff --git a/packages/api/src/codegen/cosmos/mint/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/mint/v1beta1/genesis.ts index 5eb99152..f301d34e 100644 --- a/packages/api/src/codegen/cosmos/mint/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/mint/v1beta1/genesis.ts @@ -1,5 +1,5 @@ import { Minter, MinterAmino, MinterSDKType, Params, ParamsAmino, ParamsSDKType } from "./mint"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** GenesisState defines the mint module's genesis state. */ export interface GenesisState { @@ -35,7 +35,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minter !== undefined) { Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); } @@ -44,8 +45,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -83,10 +84,14 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - minter: object?.minter ? Minter.fromAmino(object.minter) : undefined, - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + if (object.minter !== undefined && object.minter !== null) { + message.minter = Minter.fromAmino(object.minter); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/mint/v1beta1/mint.ts b/packages/api/src/codegen/cosmos/mint/v1beta1/mint.ts index d16e02f3..c7cda98f 100644 --- a/packages/api/src/codegen/cosmos/mint/v1beta1/mint.ts +++ b/packages/api/src/codegen/cosmos/mint/v1beta1/mint.ts @@ -1,5 +1,6 @@ -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../helpers"; /** Minter represents the minting state. */ export interface Minter { /** current annual inflation rate */ @@ -14,9 +15,9 @@ export interface MinterProtoMsg { /** Minter represents the minting state. */ export interface MinterAmino { /** current annual inflation rate */ - inflation: string; + inflation?: string; /** current annual expected provisions */ - annual_provisions: string; + annual_provisions?: string; } export interface MinterAminoMsg { type: "cosmos-sdk/Minter"; @@ -40,7 +41,7 @@ export interface Params { /** goal of percent bonded atoms */ goalBonded: string; /** expected blocks per year */ - blocksPerYear: Long; + blocksPerYear: bigint; } export interface ParamsProtoMsg { typeUrl: "/cosmos.mint.v1beta1.Params"; @@ -49,17 +50,17 @@ export interface ParamsProtoMsg { /** Params holds parameters for the mint module. */ export interface ParamsAmino { /** type of coin to mint */ - mint_denom: string; + mint_denom?: string; /** maximum annual change in inflation rate */ - inflation_rate_change: string; + inflation_rate_change?: string; /** maximum inflation rate */ - inflation_max: string; + inflation_max?: string; /** minimum inflation rate */ - inflation_min: string; + inflation_min?: string; /** goal of percent bonded atoms */ - goal_bonded: string; + goal_bonded?: string; /** expected blocks per year */ - blocks_per_year: string; + blocks_per_year?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -72,7 +73,7 @@ export interface ParamsSDKType { inflation_max: string; inflation_min: string; goal_bonded: string; - blocks_per_year: Long; + blocks_per_year: bigint; } function createBaseMinter(): Minter { return { @@ -81,27 +82,28 @@ function createBaseMinter(): Minter { }; } export const Minter = { - encode(message: Minter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.Minter", + encode(message: Minter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.inflation !== "") { - writer.uint32(10).string(message.inflation); + writer.uint32(10).string(Decimal.fromUserInput(message.inflation, 18).atomics); } if (message.annualProvisions !== "") { - writer.uint32(18).string(message.annualProvisions); + writer.uint32(18).string(Decimal.fromUserInput(message.annualProvisions, 18).atomics); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Minter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Minter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMinter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.inflation = reader.string(); + message.inflation = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 2: - message.annualProvisions = reader.string(); + message.annualProvisions = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -129,15 +131,19 @@ export const Minter = { return message; }, fromAmino(object: MinterAmino): Minter { - return { - inflation: object.inflation, - annualProvisions: object.annual_provisions - }; + const message = createBaseMinter(); + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = object.inflation; + } + if (object.annual_provisions !== undefined && object.annual_provisions !== null) { + message.annualProvisions = object.annual_provisions; + } + return message; }, toAmino(message: Minter): MinterAmino { const obj: any = {}; - obj.inflation = message.inflation; - obj.annual_provisions = message.annualProvisions; + obj.inflation = message.inflation === "" ? undefined : message.inflation; + obj.annual_provisions = message.annualProvisions === "" ? undefined : message.annualProvisions; return obj; }, fromAminoMsg(object: MinterAminoMsg): Minter { @@ -169,33 +175,34 @@ function createBaseParams(): Params { inflationMax: "", inflationMin: "", goalBonded: "", - blocksPerYear: Long.UZERO + blocksPerYear: BigInt(0) }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mintDenom !== "") { writer.uint32(10).string(message.mintDenom); } if (message.inflationRateChange !== "") { - writer.uint32(18).string(message.inflationRateChange); + writer.uint32(18).string(Decimal.fromUserInput(message.inflationRateChange, 18).atomics); } if (message.inflationMax !== "") { - writer.uint32(26).string(message.inflationMax); + writer.uint32(26).string(Decimal.fromUserInput(message.inflationMax, 18).atomics); } if (message.inflationMin !== "") { - writer.uint32(34).string(message.inflationMin); + writer.uint32(34).string(Decimal.fromUserInput(message.inflationMin, 18).atomics); } if (message.goalBonded !== "") { - writer.uint32(42).string(message.goalBonded); + writer.uint32(42).string(Decimal.fromUserInput(message.goalBonded, 18).atomics); } - if (!message.blocksPerYear.isZero()) { + if (message.blocksPerYear !== BigInt(0)) { writer.uint32(48).uint64(message.blocksPerYear); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -205,19 +212,19 @@ export const Params = { message.mintDenom = reader.string(); break; case 2: - message.inflationRateChange = reader.string(); + message.inflationRateChange = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 3: - message.inflationMax = reader.string(); + message.inflationMax = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 4: - message.inflationMin = reader.string(); + message.inflationMin = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 5: - message.goalBonded = reader.string(); + message.goalBonded = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 6: - message.blocksPerYear = (reader.uint64() as Long); + message.blocksPerYear = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -233,7 +240,7 @@ export const Params = { inflationMax: isSet(object.inflationMax) ? String(object.inflationMax) : "", inflationMin: isSet(object.inflationMin) ? String(object.inflationMin) : "", goalBonded: isSet(object.goalBonded) ? String(object.goalBonded) : "", - blocksPerYear: isSet(object.blocksPerYear) ? Long.fromValue(object.blocksPerYear) : Long.UZERO + blocksPerYear: isSet(object.blocksPerYear) ? BigInt(object.blocksPerYear.toString()) : BigInt(0) }; }, toJSON(message: Params): unknown { @@ -243,7 +250,7 @@ export const Params = { message.inflationMax !== undefined && (obj.inflationMax = message.inflationMax); message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin); message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded); - message.blocksPerYear !== undefined && (obj.blocksPerYear = (message.blocksPerYear || Long.UZERO).toString()); + message.blocksPerYear !== undefined && (obj.blocksPerYear = (message.blocksPerYear || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Params { @@ -253,27 +260,39 @@ export const Params = { message.inflationMax = object.inflationMax ?? ""; message.inflationMin = object.inflationMin ?? ""; message.goalBonded = object.goalBonded ?? ""; - message.blocksPerYear = object.blocksPerYear !== undefined && object.blocksPerYear !== null ? Long.fromValue(object.blocksPerYear) : Long.UZERO; + message.blocksPerYear = object.blocksPerYear !== undefined && object.blocksPerYear !== null ? BigInt(object.blocksPerYear.toString()) : BigInt(0); return message; }, fromAmino(object: ParamsAmino): Params { - return { - mintDenom: object.mint_denom, - inflationRateChange: object.inflation_rate_change, - inflationMax: object.inflation_max, - inflationMin: object.inflation_min, - goalBonded: object.goal_bonded, - blocksPerYear: Long.fromString(object.blocks_per_year) - }; + const message = createBaseParams(); + if (object.mint_denom !== undefined && object.mint_denom !== null) { + message.mintDenom = object.mint_denom; + } + if (object.inflation_rate_change !== undefined && object.inflation_rate_change !== null) { + message.inflationRateChange = object.inflation_rate_change; + } + if (object.inflation_max !== undefined && object.inflation_max !== null) { + message.inflationMax = object.inflation_max; + } + if (object.inflation_min !== undefined && object.inflation_min !== null) { + message.inflationMin = object.inflation_min; + } + if (object.goal_bonded !== undefined && object.goal_bonded !== null) { + message.goalBonded = object.goal_bonded; + } + if (object.blocks_per_year !== undefined && object.blocks_per_year !== null) { + message.blocksPerYear = BigInt(object.blocks_per_year); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.mint_denom = message.mintDenom; - obj.inflation_rate_change = message.inflationRateChange; - obj.inflation_max = message.inflationMax; - obj.inflation_min = message.inflationMin; - obj.goal_bonded = message.goalBonded; - obj.blocks_per_year = message.blocksPerYear ? message.blocksPerYear.toString() : undefined; + obj.mint_denom = message.mintDenom === "" ? undefined : message.mintDenom; + obj.inflation_rate_change = message.inflationRateChange === "" ? undefined : message.inflationRateChange; + obj.inflation_max = message.inflationMax === "" ? undefined : message.inflationMax; + obj.inflation_min = message.inflationMin === "" ? undefined : message.inflationMin; + obj.goal_bonded = message.goalBonded === "" ? undefined : message.goalBonded; + obj.blocks_per_year = message.blocksPerYear !== BigInt(0) ? message.blocksPerYear.toString() : undefined; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/api/src/codegen/cosmos/mint/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/mint/v1beta1/query.lcd.ts index 887e5df2..ad985b04 100644 --- a/packages/api/src/codegen/cosmos/mint/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/mint/v1beta1/query.lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryParamsRequest, QueryParamsResponseSDKType, QueryInflationRequest, QueryInflationResponseSDKType, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts index bbeea2d3..71e91773 100644 --- a/packages/api/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryParamsRequest, QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./query"; /** Query provides defines the gRPC querier service. */ @@ -22,17 +22,17 @@ export class QueryClientImpl implements Query { params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } inflation(request: QueryInflationRequest = {}): Promise { const data = QueryInflationRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Inflation", data); - return promise.then(data => QueryInflationResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryInflationResponse.decode(new BinaryReader(data))); } annualProvisions(request: QueryAnnualProvisionsRequest = {}): Promise { const data = QueryAnnualProvisionsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "AnnualProvisions", data); - return promise.then(data => QueryAnnualProvisionsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAnnualProvisionsResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/mint/v1beta1/query.ts b/packages/api/src/codegen/cosmos/mint/v1beta1/query.ts index 51f384b6..add8d580 100644 --- a/packages/api/src/codegen/cosmos/mint/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/mint/v1beta1/query.ts @@ -1,5 +1,5 @@ import { Params, ParamsAmino, ParamsSDKType } from "./mint"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -69,7 +69,7 @@ export interface QueryInflationResponseProtoMsg { */ export interface QueryInflationResponseAmino { /** inflation is the current minting inflation value. */ - inflation: Uint8Array; + inflation?: string; } export interface QueryInflationResponseAminoMsg { type: "cosmos-sdk/QueryInflationResponse"; @@ -123,7 +123,7 @@ export interface QueryAnnualProvisionsResponseProtoMsg { */ export interface QueryAnnualProvisionsResponseAmino { /** annual_provisions is the current minting annual provisions value. */ - annual_provisions: Uint8Array; + annual_provisions?: string; } export interface QueryAnnualProvisionsResponseAminoMsg { type: "cosmos-sdk/QueryAnnualProvisionsResponse"; @@ -140,11 +140,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -169,7 +170,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -203,14 +205,15 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -242,9 +245,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -277,11 +282,12 @@ function createBaseQueryInflationRequest(): QueryInflationRequest { return {}; } export const QueryInflationRequest = { - encode(_: QueryInflationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationRequest", + encode(_: QueryInflationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInflationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInflationRequest(); while (reader.pos < end) { @@ -306,7 +312,8 @@ export const QueryInflationRequest = { return message; }, fromAmino(_: QueryInflationRequestAmino): QueryInflationRequest { - return {}; + const message = createBaseQueryInflationRequest(); + return message; }, toAmino(_: QueryInflationRequest): QueryInflationRequestAmino { const obj: any = {}; @@ -340,14 +347,15 @@ function createBaseQueryInflationResponse(): QueryInflationResponse { }; } export const QueryInflationResponse = { - encode(message: QueryInflationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.QueryInflationResponse", + encode(message: QueryInflationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.inflation.length !== 0) { writer.uint32(10).bytes(message.inflation); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInflationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInflationResponse(); while (reader.pos < end) { @@ -379,13 +387,15 @@ export const QueryInflationResponse = { return message; }, fromAmino(object: QueryInflationResponseAmino): QueryInflationResponse { - return { - inflation: object.inflation - }; + const message = createBaseQueryInflationResponse(); + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = bytesFromBase64(object.inflation); + } + return message; }, toAmino(message: QueryInflationResponse): QueryInflationResponseAmino { const obj: any = {}; - obj.inflation = message.inflation; + obj.inflation = message.inflation ? base64FromBytes(message.inflation) : undefined; return obj; }, fromAminoMsg(object: QueryInflationResponseAminoMsg): QueryInflationResponse { @@ -414,11 +424,12 @@ function createBaseQueryAnnualProvisionsRequest(): QueryAnnualProvisionsRequest return {}; } export const QueryAnnualProvisionsRequest = { - encode(_: QueryAnnualProvisionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest", + encode(_: QueryAnnualProvisionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnnualProvisionsRequest(); while (reader.pos < end) { @@ -443,7 +454,8 @@ export const QueryAnnualProvisionsRequest = { return message; }, fromAmino(_: QueryAnnualProvisionsRequestAmino): QueryAnnualProvisionsRequest { - return {}; + const message = createBaseQueryAnnualProvisionsRequest(); + return message; }, toAmino(_: QueryAnnualProvisionsRequest): QueryAnnualProvisionsRequestAmino { const obj: any = {}; @@ -477,14 +489,15 @@ function createBaseQueryAnnualProvisionsResponse(): QueryAnnualProvisionsRespons }; } export const QueryAnnualProvisionsResponse = { - encode(message: QueryAnnualProvisionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse", + encode(message: QueryAnnualProvisionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.annualProvisions.length !== 0) { writer.uint32(10).bytes(message.annualProvisions); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnnualProvisionsResponse(); while (reader.pos < end) { @@ -516,13 +529,15 @@ export const QueryAnnualProvisionsResponse = { return message; }, fromAmino(object: QueryAnnualProvisionsResponseAmino): QueryAnnualProvisionsResponse { - return { - annualProvisions: object.annual_provisions - }; + const message = createBaseQueryAnnualProvisionsResponse(); + if (object.annual_provisions !== undefined && object.annual_provisions !== null) { + message.annualProvisions = bytesFromBase64(object.annual_provisions); + } + return message; }, toAmino(message: QueryAnnualProvisionsResponse): QueryAnnualProvisionsResponseAmino { const obj: any = {}; - obj.annual_provisions = message.annualProvisions; + obj.annual_provisions = message.annualProvisions ? base64FromBytes(message.annualProvisions) : undefined; return obj; }, fromAminoMsg(object: QueryAnnualProvisionsResponseAminoMsg): QueryAnnualProvisionsResponse { diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/event.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/event.ts index cfa63f5a..e5b10f54 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/event.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/event.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** EventSend is emitted on Msg/Send */ export interface EventSend { @@ -13,10 +13,10 @@ export interface EventSendProtoMsg { } /** EventSend is emitted on Msg/Send */ export interface EventSendAmino { - class_id: string; - id: string; - sender: string; - receiver: string; + class_id?: string; + id?: string; + sender?: string; + receiver?: string; } export interface EventSendAminoMsg { type: "cosmos-sdk/EventSend"; @@ -41,9 +41,9 @@ export interface EventMintProtoMsg { } /** EventMint is emitted on Mint */ export interface EventMintAmino { - class_id: string; - id: string; - owner: string; + class_id?: string; + id?: string; + owner?: string; } export interface EventMintAminoMsg { type: "cosmos-sdk/EventMint"; @@ -67,9 +67,9 @@ export interface EventBurnProtoMsg { } /** EventBurn is emitted on Burn */ export interface EventBurnAmino { - class_id: string; - id: string; - owner: string; + class_id?: string; + id?: string; + owner?: string; } export interface EventBurnAminoMsg { type: "cosmos-sdk/EventBurn"; @@ -90,7 +90,8 @@ function createBaseEventSend(): EventSend { }; } export const EventSend = { - encode(message: EventSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.EventSend", + encode(message: EventSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -105,8 +106,8 @@ export const EventSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSend(); while (reader.pos < end) { @@ -156,19 +157,27 @@ export const EventSend = { return message; }, fromAmino(object: EventSendAmino): EventSend { - return { - classId: object.class_id, - id: object.id, - sender: object.sender, - receiver: object.receiver - }; + const message = createBaseEventSend(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + return message; }, toAmino(message: EventSend): EventSendAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.id = message.id; - obj.sender = message.sender; - obj.receiver = message.receiver; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; return obj; }, fromAminoMsg(object: EventSendAminoMsg): EventSend { @@ -201,7 +210,8 @@ function createBaseEventMint(): EventMint { }; } export const EventMint = { - encode(message: EventMint, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.EventMint", + encode(message: EventMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -213,8 +223,8 @@ export const EventMint = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventMint { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventMint(); while (reader.pos < end) { @@ -258,17 +268,23 @@ export const EventMint = { return message; }, fromAmino(object: EventMintAmino): EventMint { - return { - classId: object.class_id, - id: object.id, - owner: object.owner - }; + const message = createBaseEventMint(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: EventMint): EventMintAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.id = message.id; - obj.owner = message.owner; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.owner = message.owner === "" ? undefined : message.owner; return obj; }, fromAminoMsg(object: EventMintAminoMsg): EventMint { @@ -301,7 +317,8 @@ function createBaseEventBurn(): EventBurn { }; } export const EventBurn = { - encode(message: EventBurn, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.EventBurn", + encode(message: EventBurn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -313,8 +330,8 @@ export const EventBurn = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventBurn { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventBurn { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventBurn(); while (reader.pos < end) { @@ -358,17 +375,23 @@ export const EventBurn = { return message; }, fromAmino(object: EventBurnAmino): EventBurn { - return { - classId: object.class_id, - id: object.id, - owner: object.owner - }; + const message = createBaseEventBurn(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: EventBurn): EventBurnAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.id = message.id; - obj.owner = message.owner; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.owner = message.owner === "" ? undefined : message.owner; return obj; }, fromAminoMsg(object: EventBurnAminoMsg): EventBurn { diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/genesis.ts index 6aeb573d..215bb932 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/genesis.ts @@ -1,5 +1,5 @@ import { Class, ClassAmino, ClassSDKType, NFT, NFTAmino, NFTSDKType } from "./nft"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** GenesisState defines the nft module's genesis state. */ export interface GenesisState { @@ -14,8 +14,8 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the nft module's genesis state. */ export interface GenesisStateAmino { /** class defines the class of the nft type. */ - classes: ClassAmino[]; - entries: EntryAmino[]; + classes?: ClassAmino[]; + entries?: EntryAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -40,9 +40,9 @@ export interface EntryProtoMsg { /** Entry Defines all nft owned by a person */ export interface EntryAmino { /** owner is the owner address of the following nft */ - owner: string; + owner?: string; /** nfts is a group of nfts of the same owner */ - nfts: NFTAmino[]; + nfts?: NFTAmino[]; } export interface EntryAminoMsg { type: "cosmos-sdk/Entry"; @@ -60,7 +60,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classes) { Class.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -69,8 +70,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -116,22 +117,22 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => Class.fromAmino(e)) : [], - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => Entry.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.classes = object.classes?.map(e => Class.fromAmino(e)) || []; + message.entries = object.entries?.map(e => Entry.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; if (message.classes) { obj.classes = message.classes.map(e => e ? Class.toAmino(e) : undefined); } else { - obj.classes = []; + obj.classes = message.classes; } if (message.entries) { obj.entries = message.entries.map(e => e ? Entry.toAmino(e) : undefined); } else { - obj.entries = []; + obj.entries = message.entries; } return obj; }, @@ -164,7 +165,8 @@ function createBaseEntry(): Entry { }; } export const Entry = { - encode(message: Entry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.Entry", + encode(message: Entry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -173,8 +175,8 @@ export const Entry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Entry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Entry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEntry(); while (reader.pos < end) { @@ -216,18 +218,20 @@ export const Entry = { return message; }, fromAmino(object: EntryAmino): Entry { - return { - owner: object.owner, - nfts: Array.isArray(object?.nfts) ? object.nfts.map((e: any) => NFT.fromAmino(e)) : [] - }; + const message = createBaseEntry(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.nfts = object.nfts?.map(e => NFT.fromAmino(e)) || []; + return message; }, toAmino(message: Entry): EntryAmino { const obj: any = {}; - obj.owner = message.owner; + obj.owner = message.owner === "" ? undefined : message.owner; if (message.nfts) { obj.nfts = message.nfts.map(e => e ? NFT.toAmino(e) : undefined); } else { - obj.nfts = []; + obj.nfts = message.nfts; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/nft.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/nft.ts index a30544d9..3d392b92 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/nft.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/nft.ts @@ -1,5 +1,5 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** Class defines the class of the nft type. */ export interface Class { @@ -16,7 +16,7 @@ export interface Class { /** uri_hash is a hash of the document pointed by uri. Optional */ uriHash: string; /** data is the app specific metadata of the NFT class. Optional */ - data: Any; + data?: Any; } export interface ClassProtoMsg { typeUrl: "/cosmos.nft.v1beta1.Class"; @@ -25,17 +25,17 @@ export interface ClassProtoMsg { /** Class defines the class of the nft type. */ export interface ClassAmino { /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ - id: string; + id?: string; /** name defines the human-readable name of the NFT classification. Optional */ - name: string; + name?: string; /** symbol is an abbreviated name for nft classification. Optional */ - symbol: string; + symbol?: string; /** description is a brief description of nft classification. Optional */ - description: string; + description?: string; /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ - uri: string; + uri?: string; /** uri_hash is a hash of the document pointed by uri. Optional */ - uri_hash: string; + uri_hash?: string; /** data is the app specific metadata of the NFT class. Optional */ data?: AnyAmino; } @@ -51,7 +51,7 @@ export interface ClassSDKType { description: string; uri: string; uri_hash: string; - data: AnySDKType; + data?: AnySDKType; } /** NFT defines the NFT. */ export interface NFT { @@ -64,7 +64,7 @@ export interface NFT { /** uri_hash is a hash of the document pointed by uri */ uriHash: string; /** data is an app specific data of the NFT. Optional */ - data: Any; + data?: Any; } export interface NFTProtoMsg { typeUrl: "/cosmos.nft.v1beta1.NFT"; @@ -73,13 +73,13 @@ export interface NFTProtoMsg { /** NFT defines the NFT. */ export interface NFTAmino { /** class_id associated with the NFT, similar to the contract address of ERC721 */ - class_id: string; + class_id?: string; /** id is a unique identifier of the NFT */ - id: string; + id?: string; /** uri for the NFT metadata stored off chain */ - uri: string; + uri?: string; /** uri_hash is a hash of the document pointed by uri */ - uri_hash: string; + uri_hash?: string; /** data is an app specific data of the NFT. Optional */ data?: AnyAmino; } @@ -93,7 +93,7 @@ export interface NFTSDKType { id: string; uri: string; uri_hash: string; - data: AnySDKType; + data?: AnySDKType; } function createBaseClass(): Class { return { @@ -107,7 +107,8 @@ function createBaseClass(): Class { }; } export const Class = { - encode(message: Class, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.Class", + encode(message: Class, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -131,8 +132,8 @@ export const Class = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Class { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Class { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClass(); while (reader.pos < end) { @@ -200,24 +201,38 @@ export const Class = { return message; }, fromAmino(object: ClassAmino): Class { - return { - id: object.id, - name: object.name, - symbol: object.symbol, - description: object.description, - uri: object.uri, - uriHash: object.uri_hash, - data: object?.data ? Any.fromAmino(object.data) : undefined - }; + const message = createBaseClass(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + if (object.data !== undefined && object.data !== null) { + message.data = Any.fromAmino(object.data); + } + return message; }, toAmino(message: Class): ClassAmino { const obj: any = {}; - obj.id = message.id; - obj.name = message.name; - obj.symbol = message.symbol; - obj.description = message.description; - obj.uri = message.uri; - obj.uri_hash = message.uriHash; + obj.id = message.id === "" ? undefined : message.id; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.description = message.description === "" ? undefined : message.description; + obj.uri = message.uri === "" ? undefined : message.uri; + obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash; obj.data = message.data ? Any.toAmino(message.data) : undefined; return obj; }, @@ -253,7 +268,8 @@ function createBaseNFT(): NFT { }; } export const NFT = { - encode(message: NFT, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.NFT", + encode(message: NFT, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -271,8 +287,8 @@ export const NFT = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): NFT { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): NFT { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseNFT(); while (reader.pos < end) { @@ -328,20 +344,30 @@ export const NFT = { return message; }, fromAmino(object: NFTAmino): NFT { - return { - classId: object.class_id, - id: object.id, - uri: object.uri, - uriHash: object.uri_hash, - data: object?.data ? Any.fromAmino(object.data) : undefined - }; + const message = createBaseNFT(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + if (object.data !== undefined && object.data !== null) { + message.data = Any.fromAmino(object.data); + } + return message; }, toAmino(message: NFT): NFTAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.id = message.id; - obj.uri = message.uri; - obj.uri_hash = message.uriHash; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.uri = message.uri === "" ? undefined : message.uri; + obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash; obj.data = message.data ? Any.toAmino(message.data) : undefined; return obj; }, diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/query.lcd.ts index c1042772..a8dec9fc 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryOwnerRequest, QueryOwnerResponseSDKType, QuerySupplyRequest, QuerySupplyResponseSDKType, QueryNFTsRequest, QueryNFTsResponseSDKType, QueryNFTRequest, QueryNFTResponseSDKType, QueryClassRequest, QueryClassResponseSDKType, QueryClassesRequest, QueryClassesResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts index b8be5de6..4b96e9e9 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -37,39 +37,39 @@ export class QueryClientImpl implements Query { balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Balance", data); - return promise.then(data => QueryBalanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBalanceResponse.decode(new BinaryReader(data))); } owner(request: QueryOwnerRequest): Promise { const data = QueryOwnerRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Owner", data); - return promise.then(data => QueryOwnerResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryOwnerResponse.decode(new BinaryReader(data))); } supply(request: QuerySupplyRequest): Promise { const data = QuerySupplyRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Supply", data); - return promise.then(data => QuerySupplyResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySupplyResponse.decode(new BinaryReader(data))); } nFTs(request: QueryNFTsRequest): Promise { const data = QueryNFTsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFTs", data); - return promise.then(data => QueryNFTsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryNFTsResponse.decode(new BinaryReader(data))); } nFT(request: QueryNFTRequest): Promise { const data = QueryNFTRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFT", data); - return promise.then(data => QueryNFTResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryNFTResponse.decode(new BinaryReader(data))); } class(request: QueryClassRequest): Promise { const data = QueryClassRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Class", data); - return promise.then(data => QueryClassResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassResponse.decode(new BinaryReader(data))); } classes(request: QueryClassesRequest = { pagination: undefined }): Promise { const data = QueryClassesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Classes", data); - return promise.then(data => QueryClassesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassesResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/query.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/query.ts index 69255fea..aaefa5c5 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/query.ts @@ -1,7 +1,7 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { NFT, NFTAmino, NFTSDKType, Class, ClassAmino, ClassSDKType } from "./nft"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method */ export interface QueryBalanceRequest { classId: string; @@ -13,8 +13,8 @@ export interface QueryBalanceRequestProtoMsg { } /** QueryBalanceRequest is the request type for the Query/Balance RPC method */ export interface QueryBalanceRequestAmino { - class_id: string; - owner: string; + class_id?: string; + owner?: string; } export interface QueryBalanceRequestAminoMsg { type: "cosmos-sdk/QueryBalanceRequest"; @@ -27,7 +27,7 @@ export interface QueryBalanceRequestSDKType { } /** QueryBalanceResponse is the response type for the Query/Balance RPC method */ export interface QueryBalanceResponse { - amount: Long; + amount: bigint; } export interface QueryBalanceResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryBalanceResponse"; @@ -35,7 +35,7 @@ export interface QueryBalanceResponseProtoMsg { } /** QueryBalanceResponse is the response type for the Query/Balance RPC method */ export interface QueryBalanceResponseAmino { - amount: string; + amount?: string; } export interface QueryBalanceResponseAminoMsg { type: "cosmos-sdk/QueryBalanceResponse"; @@ -43,7 +43,7 @@ export interface QueryBalanceResponseAminoMsg { } /** QueryBalanceResponse is the response type for the Query/Balance RPC method */ export interface QueryBalanceResponseSDKType { - amount: Long; + amount: bigint; } /** QueryOwnerRequest is the request type for the Query/Owner RPC method */ export interface QueryOwnerRequest { @@ -56,8 +56,8 @@ export interface QueryOwnerRequestProtoMsg { } /** QueryOwnerRequest is the request type for the Query/Owner RPC method */ export interface QueryOwnerRequestAmino { - class_id: string; - id: string; + class_id?: string; + id?: string; } export interface QueryOwnerRequestAminoMsg { type: "cosmos-sdk/QueryOwnerRequest"; @@ -78,7 +78,7 @@ export interface QueryOwnerResponseProtoMsg { } /** QueryOwnerResponse is the response type for the Query/Owner RPC method */ export interface QueryOwnerResponseAmino { - owner: string; + owner?: string; } export interface QueryOwnerResponseAminoMsg { type: "cosmos-sdk/QueryOwnerResponse"; @@ -98,7 +98,7 @@ export interface QuerySupplyRequestProtoMsg { } /** QuerySupplyRequest is the request type for the Query/Supply RPC method */ export interface QuerySupplyRequestAmino { - class_id: string; + class_id?: string; } export interface QuerySupplyRequestAminoMsg { type: "cosmos-sdk/QuerySupplyRequest"; @@ -110,7 +110,7 @@ export interface QuerySupplyRequestSDKType { } /** QuerySupplyResponse is the response type for the Query/Supply RPC method */ export interface QuerySupplyResponse { - amount: Long; + amount: bigint; } export interface QuerySupplyResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QuerySupplyResponse"; @@ -118,7 +118,7 @@ export interface QuerySupplyResponseProtoMsg { } /** QuerySupplyResponse is the response type for the Query/Supply RPC method */ export interface QuerySupplyResponseAmino { - amount: string; + amount?: string; } export interface QuerySupplyResponseAminoMsg { type: "cosmos-sdk/QuerySupplyResponse"; @@ -126,13 +126,13 @@ export interface QuerySupplyResponseAminoMsg { } /** QuerySupplyResponse is the response type for the Query/Supply RPC method */ export interface QuerySupplyResponseSDKType { - amount: Long; + amount: bigint; } /** QueryNFTstRequest is the request type for the Query/NFTs RPC method */ export interface QueryNFTsRequest { classId: string; owner: string; - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryNFTsRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryNFTsRequest"; @@ -140,8 +140,8 @@ export interface QueryNFTsRequestProtoMsg { } /** QueryNFTstRequest is the request type for the Query/NFTs RPC method */ export interface QueryNFTsRequestAmino { - class_id: string; - owner: string; + class_id?: string; + owner?: string; pagination?: PageRequestAmino; } export interface QueryNFTsRequestAminoMsg { @@ -152,12 +152,12 @@ export interface QueryNFTsRequestAminoMsg { export interface QueryNFTsRequestSDKType { class_id: string; owner: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryNFTsResponse is the response type for the Query/NFTs RPC methods */ export interface QueryNFTsResponse { nfts: NFT[]; - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryNFTsResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryNFTsResponse"; @@ -165,7 +165,7 @@ export interface QueryNFTsResponseProtoMsg { } /** QueryNFTsResponse is the response type for the Query/NFTs RPC methods */ export interface QueryNFTsResponseAmino { - nfts: NFTAmino[]; + nfts?: NFTAmino[]; pagination?: PageResponseAmino; } export interface QueryNFTsResponseAminoMsg { @@ -175,7 +175,7 @@ export interface QueryNFTsResponseAminoMsg { /** QueryNFTsResponse is the response type for the Query/NFTs RPC methods */ export interface QueryNFTsResponseSDKType { nfts: NFTSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryNFTRequest is the request type for the Query/NFT RPC method */ export interface QueryNFTRequest { @@ -188,8 +188,8 @@ export interface QueryNFTRequestProtoMsg { } /** QueryNFTRequest is the request type for the Query/NFT RPC method */ export interface QueryNFTRequestAmino { - class_id: string; - id: string; + class_id?: string; + id?: string; } export interface QueryNFTRequestAminoMsg { type: "cosmos-sdk/QueryNFTRequest"; @@ -202,7 +202,7 @@ export interface QueryNFTRequestSDKType { } /** QueryNFTResponse is the response type for the Query/NFT RPC method */ export interface QueryNFTResponse { - nft: NFT; + nft?: NFT; } export interface QueryNFTResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryNFTResponse"; @@ -218,7 +218,7 @@ export interface QueryNFTResponseAminoMsg { } /** QueryNFTResponse is the response type for the Query/NFT RPC method */ export interface QueryNFTResponseSDKType { - nft: NFTSDKType; + nft?: NFTSDKType; } /** QueryClassRequest is the request type for the Query/Class RPC method */ export interface QueryClassRequest { @@ -230,7 +230,7 @@ export interface QueryClassRequestProtoMsg { } /** QueryClassRequest is the request type for the Query/Class RPC method */ export interface QueryClassRequestAmino { - class_id: string; + class_id?: string; } export interface QueryClassRequestAminoMsg { type: "cosmos-sdk/QueryClassRequest"; @@ -242,7 +242,7 @@ export interface QueryClassRequestSDKType { } /** QueryClassResponse is the response type for the Query/Class RPC method */ export interface QueryClassResponse { - class: Class; + class?: Class; } export interface QueryClassResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryClassResponse"; @@ -258,12 +258,12 @@ export interface QueryClassResponseAminoMsg { } /** QueryClassResponse is the response type for the Query/Class RPC method */ export interface QueryClassResponseSDKType { - class: ClassSDKType; + class?: ClassSDKType; } /** QueryClassesRequest is the request type for the Query/Classes RPC method */ export interface QueryClassesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClassesRequestProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryClassesRequest"; @@ -280,12 +280,12 @@ export interface QueryClassesRequestAminoMsg { } /** QueryClassesRequest is the request type for the Query/Classes RPC method */ export interface QueryClassesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryClassesResponse is the response type for the Query/Classes RPC method */ export interface QueryClassesResponse { classes: Class[]; - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClassesResponseProtoMsg { typeUrl: "/cosmos.nft.v1beta1.QueryClassesResponse"; @@ -293,7 +293,7 @@ export interface QueryClassesResponseProtoMsg { } /** QueryClassesResponse is the response type for the Query/Classes RPC method */ export interface QueryClassesResponseAmino { - classes: ClassAmino[]; + classes?: ClassAmino[]; pagination?: PageResponseAmino; } export interface QueryClassesResponseAminoMsg { @@ -303,7 +303,7 @@ export interface QueryClassesResponseAminoMsg { /** QueryClassesResponse is the response type for the Query/Classes RPC method */ export interface QueryClassesResponseSDKType { classes: ClassSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryBalanceRequest(): QueryBalanceRequest { return { @@ -312,7 +312,8 @@ function createBaseQueryBalanceRequest(): QueryBalanceRequest { }; } export const QueryBalanceRequest = { - encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceRequest", + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -321,8 +322,8 @@ export const QueryBalanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceRequest(); while (reader.pos < end) { @@ -360,15 +361,19 @@ export const QueryBalanceRequest = { return message; }, fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { - return { - classId: object.class_id, - owner: object.owner - }; + const message = createBaseQueryBalanceRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.owner = message.owner; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.owner = message.owner === "" ? undefined : message.owner; return obj; }, fromAminoMsg(object: QueryBalanceRequestAminoMsg): QueryBalanceRequest { @@ -395,25 +400,26 @@ export const QueryBalanceRequest = { }; function createBaseQueryBalanceResponse(): QueryBalanceResponse { return { - amount: Long.UZERO + amount: BigInt(0) }; } export const QueryBalanceResponse = { - encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.amount.isZero()) { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceResponse", + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== BigInt(0)) { writer.uint32(8).uint64(message.amount); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.amount = (reader.uint64() as Long); + message.amount = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -424,27 +430,29 @@ export const QueryBalanceResponse = { }, fromJSON(object: any): QueryBalanceResponse { return { - amount: isSet(object.amount) ? Long.fromValue(object.amount) : Long.UZERO + amount: isSet(object.amount) ? BigInt(object.amount.toString()) : BigInt(0) }; }, toJSON(message: QueryBalanceResponse): unknown { const obj: any = {}; - message.amount !== undefined && (obj.amount = (message.amount || Long.UZERO).toString()); + message.amount !== undefined && (obj.amount = (message.amount || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryBalanceResponse { const message = createBaseQueryBalanceResponse(); - message.amount = object.amount !== undefined && object.amount !== null ? Long.fromValue(object.amount) : Long.UZERO; + message.amount = object.amount !== undefined && object.amount !== null ? BigInt(object.amount.toString()) : BigInt(0); return message; }, fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { - return { - amount: Long.fromString(object.amount) - }; + const message = createBaseQueryBalanceResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = BigInt(object.amount); + } + return message; }, toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { const obj: any = {}; - obj.amount = message.amount ? message.amount.toString() : undefined; + obj.amount = message.amount !== BigInt(0) ? message.amount.toString() : undefined; return obj; }, fromAminoMsg(object: QueryBalanceResponseAminoMsg): QueryBalanceResponse { @@ -476,7 +484,8 @@ function createBaseQueryOwnerRequest(): QueryOwnerRequest { }; } export const QueryOwnerRequest = { - encode(message: QueryOwnerRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerRequest", + encode(message: QueryOwnerRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -485,8 +494,8 @@ export const QueryOwnerRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryOwnerRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwnerRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryOwnerRequest(); while (reader.pos < end) { @@ -524,15 +533,19 @@ export const QueryOwnerRequest = { return message; }, fromAmino(object: QueryOwnerRequestAmino): QueryOwnerRequest { - return { - classId: object.class_id, - id: object.id - }; + const message = createBaseQueryOwnerRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; }, toAmino(message: QueryOwnerRequest): QueryOwnerRequestAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.id = message.id; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; return obj; }, fromAminoMsg(object: QueryOwnerRequestAminoMsg): QueryOwnerRequest { @@ -563,14 +576,15 @@ function createBaseQueryOwnerResponse(): QueryOwnerResponse { }; } export const QueryOwnerResponse = { - encode(message: QueryOwnerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerResponse", + encode(message: QueryOwnerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryOwnerResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwnerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryOwnerResponse(); while (reader.pos < end) { @@ -602,13 +616,15 @@ export const QueryOwnerResponse = { return message; }, fromAmino(object: QueryOwnerResponseAmino): QueryOwnerResponse { - return { - owner: object.owner - }; + const message = createBaseQueryOwnerResponse(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: QueryOwnerResponse): QueryOwnerResponseAmino { const obj: any = {}; - obj.owner = message.owner; + obj.owner = message.owner === "" ? undefined : message.owner; return obj; }, fromAminoMsg(object: QueryOwnerResponseAminoMsg): QueryOwnerResponse { @@ -639,14 +655,15 @@ function createBaseQuerySupplyRequest(): QuerySupplyRequest { }; } export const QuerySupplyRequest = { - encode(message: QuerySupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyRequest", + encode(message: QuerySupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyRequest(); while (reader.pos < end) { @@ -678,13 +695,15 @@ export const QuerySupplyRequest = { return message; }, fromAmino(object: QuerySupplyRequestAmino): QuerySupplyRequest { - return { - classId: object.class_id - }; + const message = createBaseQuerySupplyRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: QuerySupplyRequest): QuerySupplyRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: QuerySupplyRequestAminoMsg): QuerySupplyRequest { @@ -711,25 +730,26 @@ export const QuerySupplyRequest = { }; function createBaseQuerySupplyResponse(): QuerySupplyResponse { return { - amount: Long.UZERO + amount: BigInt(0) }; } export const QuerySupplyResponse = { - encode(message: QuerySupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.amount.isZero()) { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyResponse", + encode(message: QuerySupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== BigInt(0)) { writer.uint32(8).uint64(message.amount); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.amount = (reader.uint64() as Long); + message.amount = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -740,27 +760,29 @@ export const QuerySupplyResponse = { }, fromJSON(object: any): QuerySupplyResponse { return { - amount: isSet(object.amount) ? Long.fromValue(object.amount) : Long.UZERO + amount: isSet(object.amount) ? BigInt(object.amount.toString()) : BigInt(0) }; }, toJSON(message: QuerySupplyResponse): unknown { const obj: any = {}; - message.amount !== undefined && (obj.amount = (message.amount || Long.UZERO).toString()); + message.amount !== undefined && (obj.amount = (message.amount || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QuerySupplyResponse { const message = createBaseQuerySupplyResponse(); - message.amount = object.amount !== undefined && object.amount !== null ? Long.fromValue(object.amount) : Long.UZERO; + message.amount = object.amount !== undefined && object.amount !== null ? BigInt(object.amount.toString()) : BigInt(0); return message; }, fromAmino(object: QuerySupplyResponseAmino): QuerySupplyResponse { - return { - amount: Long.fromString(object.amount) - }; + const message = createBaseQuerySupplyResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = BigInt(object.amount); + } + return message; }, toAmino(message: QuerySupplyResponse): QuerySupplyResponseAmino { const obj: any = {}; - obj.amount = message.amount ? message.amount.toString() : undefined; + obj.amount = message.amount !== BigInt(0) ? message.amount.toString() : undefined; return obj; }, fromAminoMsg(object: QuerySupplyResponseAminoMsg): QuerySupplyResponse { @@ -789,11 +811,12 @@ function createBaseQueryNFTsRequest(): QueryNFTsRequest { return { classId: "", owner: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryNFTsRequest = { - encode(message: QueryNFTsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsRequest", + encode(message: QueryNFTsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -805,8 +828,8 @@ export const QueryNFTsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTsRequest(); while (reader.pos < end) { @@ -850,16 +873,22 @@ export const QueryNFTsRequest = { return message; }, fromAmino(object: QueryNFTsRequestAmino): QueryNFTsRequest { - return { - classId: object.class_id, - owner: object.owner, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryNFTsRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryNFTsRequest): QueryNFTsRequestAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.owner = message.owner; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.owner = message.owner === "" ? undefined : message.owner; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -888,11 +917,12 @@ export const QueryNFTsRequest = { function createBaseQueryNFTsResponse(): QueryNFTsResponse { return { nfts: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryNFTsResponse = { - encode(message: QueryNFTsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsResponse", + encode(message: QueryNFTsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.nfts) { NFT.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -901,8 +931,8 @@ export const QueryNFTsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTsResponse(); while (reader.pos < end) { @@ -944,17 +974,19 @@ export const QueryNFTsResponse = { return message; }, fromAmino(object: QueryNFTsResponseAmino): QueryNFTsResponse { - return { - nfts: Array.isArray(object?.nfts) ? object.nfts.map((e: any) => NFT.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryNFTsResponse(); + message.nfts = object.nfts?.map(e => NFT.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryNFTsResponse): QueryNFTsResponseAmino { const obj: any = {}; if (message.nfts) { obj.nfts = message.nfts.map(e => e ? NFT.toAmino(e) : undefined); } else { - obj.nfts = []; + obj.nfts = message.nfts; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -988,7 +1020,8 @@ function createBaseQueryNFTRequest(): QueryNFTRequest { }; } export const QueryNFTRequest = { - encode(message: QueryNFTRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTRequest", + encode(message: QueryNFTRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -997,8 +1030,8 @@ export const QueryNFTRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTRequest(); while (reader.pos < end) { @@ -1036,15 +1069,19 @@ export const QueryNFTRequest = { return message; }, fromAmino(object: QueryNFTRequestAmino): QueryNFTRequest { - return { - classId: object.class_id, - id: object.id - }; + const message = createBaseQueryNFTRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; }, toAmino(message: QueryNFTRequest): QueryNFTRequestAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.id = message.id; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; return obj; }, fromAminoMsg(object: QueryNFTRequestAminoMsg): QueryNFTRequest { @@ -1071,18 +1108,19 @@ export const QueryNFTRequest = { }; function createBaseQueryNFTResponse(): QueryNFTResponse { return { - nft: NFT.fromPartial({}) + nft: undefined }; } export const QueryNFTResponse = { - encode(message: QueryNFTResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTResponse", + encode(message: QueryNFTResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.nft !== undefined) { NFT.encode(message.nft, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTResponse(); while (reader.pos < end) { @@ -1114,9 +1152,11 @@ export const QueryNFTResponse = { return message; }, fromAmino(object: QueryNFTResponseAmino): QueryNFTResponse { - return { - nft: object?.nft ? NFT.fromAmino(object.nft) : undefined - }; + const message = createBaseQueryNFTResponse(); + if (object.nft !== undefined && object.nft !== null) { + message.nft = NFT.fromAmino(object.nft); + } + return message; }, toAmino(message: QueryNFTResponse): QueryNFTResponseAmino { const obj: any = {}; @@ -1151,14 +1191,15 @@ function createBaseQueryClassRequest(): QueryClassRequest { }; } export const QueryClassRequest = { - encode(message: QueryClassRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryClassRequest", + encode(message: QueryClassRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassRequest(); while (reader.pos < end) { @@ -1190,13 +1231,15 @@ export const QueryClassRequest = { return message; }, fromAmino(object: QueryClassRequestAmino): QueryClassRequest { - return { - classId: object.class_id - }; + const message = createBaseQueryClassRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: QueryClassRequest): QueryClassRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: QueryClassRequestAminoMsg): QueryClassRequest { @@ -1223,18 +1266,19 @@ export const QueryClassRequest = { }; function createBaseQueryClassResponse(): QueryClassResponse { return { - class: Class.fromPartial({}) + class: undefined }; } export const QueryClassResponse = { - encode(message: QueryClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryClassResponse", + encode(message: QueryClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.class !== undefined) { Class.encode(message.class, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassResponse(); while (reader.pos < end) { @@ -1266,9 +1310,11 @@ export const QueryClassResponse = { return message; }, fromAmino(object: QueryClassResponseAmino): QueryClassResponse { - return { - class: object?.class ? Class.fromAmino(object.class) : undefined - }; + const message = createBaseQueryClassResponse(); + if (object.class !== undefined && object.class !== null) { + message.class = Class.fromAmino(object.class); + } + return message; }, toAmino(message: QueryClassResponse): QueryClassResponseAmino { const obj: any = {}; @@ -1299,18 +1345,19 @@ export const QueryClassResponse = { }; function createBaseQueryClassesRequest(): QueryClassesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClassesRequest = { - encode(message: QueryClassesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesRequest", + encode(message: QueryClassesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesRequest(); while (reader.pos < end) { @@ -1342,9 +1389,11 @@ export const QueryClassesRequest = { return message; }, fromAmino(object: QueryClassesRequestAmino): QueryClassesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesRequest): QueryClassesRequestAmino { const obj: any = {}; @@ -1376,11 +1425,12 @@ export const QueryClassesRequest = { function createBaseQueryClassesResponse(): QueryClassesResponse { return { classes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClassesResponse = { - encode(message: QueryClassesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesResponse", + encode(message: QueryClassesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classes) { Class.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1389,8 +1439,8 @@ export const QueryClassesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesResponse(); while (reader.pos < end) { @@ -1432,17 +1482,19 @@ export const QueryClassesResponse = { return message; }, fromAmino(object: QueryClassesResponseAmino): QueryClassesResponse { - return { - classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => Class.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesResponse(); + message.classes = object.classes?.map(e => Class.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesResponse): QueryClassesResponseAmino { const obj: any = {}; if (message.classes) { obj.classes = message.classes.map(e => e ? Class.toAmino(e) : undefined); } else { - obj.classes = []; + obj.classes = message.classes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts index a2d3111b..54618192 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgSend, MsgSendResponse } from "./tx"; /** Msg defines the nft Msg service. */ export interface Msg { @@ -15,6 +15,6 @@ export class MsgClientImpl implements Msg { send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Msg", "Send", data); - return promise.then(data => MsgSendResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSendResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/nft/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/nft/v1beta1/tx.ts index 7caf4d14..a83163c4 100644 --- a/packages/api/src/codegen/cosmos/nft/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/nft/v1beta1/tx.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** MsgSend represents a message to send a nft from one account to another account. */ export interface MsgSend { @@ -18,13 +18,13 @@ export interface MsgSendProtoMsg { /** MsgSend represents a message to send a nft from one account to another account. */ export interface MsgSendAmino { /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ - class_id: string; + class_id?: string; /** id defines the unique identification of nft */ - id: string; + id?: string; /** sender is the address of the owner of nft */ - sender: string; + sender?: string; /** receiver is the receiver address of nft */ - receiver: string; + receiver?: string; } export interface MsgSendAminoMsg { type: "cosmos-sdk/MsgNFTSend"; @@ -60,7 +60,8 @@ function createBaseMsgSend(): MsgSend { }; } export const MsgSend = { - encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -75,8 +76,8 @@ export const MsgSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend(); while (reader.pos < end) { @@ -126,19 +127,27 @@ export const MsgSend = { return message; }, fromAmino(object: MsgSendAmino): MsgSend { - return { - classId: object.class_id, - id: object.id, - sender: object.sender, - receiver: object.receiver - }; + const message = createBaseMsgSend(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + return message; }, toAmino(message: MsgSend): MsgSendAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.id = message.id; - obj.sender = message.sender; - obj.receiver = message.receiver; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; return obj; }, fromAminoMsg(object: MsgSendAminoMsg): MsgSend { @@ -167,11 +176,12 @@ function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse", + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendResponse(); while (reader.pos < end) { @@ -196,7 +206,8 @@ export const MsgSendResponse = { return message; }, fromAmino(_: MsgSendResponseAmino): MsgSendResponse { - return {}; + const message = createBaseMsgSendResponse(); + return message; }, toAmino(_: MsgSendResponse): MsgSendResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/orm/module/v1alpha1/module.ts b/packages/api/src/codegen/cosmos/orm/module/v1alpha1/module.ts index 3af8ae30..e9185adc 100644 --- a/packages/api/src/codegen/cosmos/orm/module/v1alpha1/module.ts +++ b/packages/api/src/codegen/cosmos/orm/module/v1alpha1/module.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; /** * Module defines the ORM module which adds providers to the app container for * module-scoped DB's. In the future it may provide gRPC services for interacting @@ -29,11 +29,12 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.orm.module.v1alpha1.Module", + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -58,7 +59,8 @@ export const Module = { return message; }, fromAmino(_: ModuleAmino): Module { - return {}; + const message = createBaseModule(); + return message; }, toAmino(_: Module): ModuleAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/orm/v1/orm.ts b/packages/api/src/codegen/cosmos/orm/v1/orm.ts index c9a0b20a..7e420cb7 100644 --- a/packages/api/src/codegen/cosmos/orm/v1/orm.ts +++ b/packages/api/src/codegen/cosmos/orm/v1/orm.ts @@ -1,9 +1,9 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** TableDescriptor describes an ORM table. */ export interface TableDescriptor { /** primary_key defines the primary key for the table. */ - primaryKey: PrimaryKeyDescriptor; + primaryKey?: PrimaryKeyDescriptor; /** index defines one or more secondary indexes. */ index: SecondaryIndexDescriptor[]; /** @@ -22,13 +22,13 @@ export interface TableDescriptorAmino { /** primary_key defines the primary key for the table. */ primary_key?: PrimaryKeyDescriptorAmino; /** index defines one or more secondary indexes. */ - index: SecondaryIndexDescriptorAmino[]; + index?: SecondaryIndexDescriptorAmino[]; /** * id is a non-zero integer ID that must be unique within the * tables and singletons in this file. It may be deprecated in the future when this * can be auto-generated. */ - id: number; + id?: number; } export interface TableDescriptorAminoMsg { type: "cosmos-sdk/TableDescriptor"; @@ -36,7 +36,7 @@ export interface TableDescriptorAminoMsg { } /** TableDescriptor describes an ORM table. */ export interface TableDescriptorSDKType { - primary_key: PrimaryKeyDescriptorSDKType; + primary_key?: PrimaryKeyDescriptorSDKType; index: SecondaryIndexDescriptorSDKType[]; id: number; } @@ -120,13 +120,13 @@ export interface PrimaryKeyDescriptorAmino { * Primary keys are prefixed by the varint encoded table id and the byte 0x0 * plus any additional prefix specified by the schema. */ - fields: string; + fields?: string; /** * auto_increment specifies that the primary key is generated by an * auto-incrementing integer. If this is set to true fields must only * contain one field of that is of type uint64. */ - auto_increment: boolean; + auto_increment?: boolean; } export interface PrimaryKeyDescriptorAminoMsg { type: "cosmos-sdk/PrimaryKeyDescriptor"; @@ -177,15 +177,15 @@ export interface SecondaryIndexDescriptorAmino { * primary key can be reconstructed. Unique indexes instead of being suffixed * store the remaining primary key fields in the value.. */ - fields: string; + fields?: string; /** * id is a non-zero integer ID that must be unique within the indexes for this * table and less than 32768. It may be deprecated in the future when this can * be auto-generated. */ - id: number; + id?: number; /** unique specifies that this an unique index. */ - unique: boolean; + unique?: boolean; } export interface SecondaryIndexDescriptorAminoMsg { type: "cosmos-sdk/SecondaryIndexDescriptor"; @@ -217,7 +217,7 @@ export interface SingletonDescriptorAmino { * tables and singletons in this file. It may be deprecated in the future when this * can be auto-generated. */ - id: number; + id?: number; } export interface SingletonDescriptorAminoMsg { type: "cosmos-sdk/SingletonDescriptor"; @@ -229,13 +229,14 @@ export interface SingletonDescriptorSDKType { } function createBaseTableDescriptor(): TableDescriptor { return { - primaryKey: PrimaryKeyDescriptor.fromPartial({}), + primaryKey: undefined, index: [], id: 0 }; } export const TableDescriptor = { - encode(message: TableDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.orm.v1.TableDescriptor", + encode(message: TableDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.primaryKey !== undefined) { PrimaryKeyDescriptor.encode(message.primaryKey, writer.uint32(10).fork()).ldelim(); } @@ -247,8 +248,8 @@ export const TableDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TableDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TableDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTableDescriptor(); while (reader.pos < end) { @@ -296,11 +297,15 @@ export const TableDescriptor = { return message; }, fromAmino(object: TableDescriptorAmino): TableDescriptor { - return { - primaryKey: object?.primary_key ? PrimaryKeyDescriptor.fromAmino(object.primary_key) : undefined, - index: Array.isArray(object?.index) ? object.index.map((e: any) => SecondaryIndexDescriptor.fromAmino(e)) : [], - id: object.id - }; + const message = createBaseTableDescriptor(); + if (object.primary_key !== undefined && object.primary_key !== null) { + message.primaryKey = PrimaryKeyDescriptor.fromAmino(object.primary_key); + } + message.index = object.index?.map(e => SecondaryIndexDescriptor.fromAmino(e)) || []; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; }, toAmino(message: TableDescriptor): TableDescriptorAmino { const obj: any = {}; @@ -308,9 +313,9 @@ export const TableDescriptor = { if (message.index) { obj.index = message.index.map(e => e ? SecondaryIndexDescriptor.toAmino(e) : undefined); } else { - obj.index = []; + obj.index = message.index; } - obj.id = message.id; + obj.id = message.id === 0 ? undefined : message.id; return obj; }, fromAminoMsg(object: TableDescriptorAminoMsg): TableDescriptor { @@ -342,7 +347,8 @@ function createBasePrimaryKeyDescriptor(): PrimaryKeyDescriptor { }; } export const PrimaryKeyDescriptor = { - encode(message: PrimaryKeyDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.orm.v1.PrimaryKeyDescriptor", + encode(message: PrimaryKeyDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fields !== "") { writer.uint32(10).string(message.fields); } @@ -351,8 +357,8 @@ export const PrimaryKeyDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PrimaryKeyDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PrimaryKeyDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePrimaryKeyDescriptor(); while (reader.pos < end) { @@ -390,15 +396,19 @@ export const PrimaryKeyDescriptor = { return message; }, fromAmino(object: PrimaryKeyDescriptorAmino): PrimaryKeyDescriptor { - return { - fields: object.fields, - autoIncrement: object.auto_increment - }; + const message = createBasePrimaryKeyDescriptor(); + if (object.fields !== undefined && object.fields !== null) { + message.fields = object.fields; + } + if (object.auto_increment !== undefined && object.auto_increment !== null) { + message.autoIncrement = object.auto_increment; + } + return message; }, toAmino(message: PrimaryKeyDescriptor): PrimaryKeyDescriptorAmino { const obj: any = {}; - obj.fields = message.fields; - obj.auto_increment = message.autoIncrement; + obj.fields = message.fields === "" ? undefined : message.fields; + obj.auto_increment = message.autoIncrement === false ? undefined : message.autoIncrement; return obj; }, fromAminoMsg(object: PrimaryKeyDescriptorAminoMsg): PrimaryKeyDescriptor { @@ -431,7 +441,8 @@ function createBaseSecondaryIndexDescriptor(): SecondaryIndexDescriptor { }; } export const SecondaryIndexDescriptor = { - encode(message: SecondaryIndexDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.orm.v1.SecondaryIndexDescriptor", + encode(message: SecondaryIndexDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fields !== "") { writer.uint32(10).string(message.fields); } @@ -443,8 +454,8 @@ export const SecondaryIndexDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SecondaryIndexDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SecondaryIndexDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSecondaryIndexDescriptor(); while (reader.pos < end) { @@ -488,17 +499,23 @@ export const SecondaryIndexDescriptor = { return message; }, fromAmino(object: SecondaryIndexDescriptorAmino): SecondaryIndexDescriptor { - return { - fields: object.fields, - id: object.id, - unique: object.unique - }; + const message = createBaseSecondaryIndexDescriptor(); + if (object.fields !== undefined && object.fields !== null) { + message.fields = object.fields; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.unique !== undefined && object.unique !== null) { + message.unique = object.unique; + } + return message; }, toAmino(message: SecondaryIndexDescriptor): SecondaryIndexDescriptorAmino { const obj: any = {}; - obj.fields = message.fields; - obj.id = message.id; - obj.unique = message.unique; + obj.fields = message.fields === "" ? undefined : message.fields; + obj.id = message.id === 0 ? undefined : message.id; + obj.unique = message.unique === false ? undefined : message.unique; return obj; }, fromAminoMsg(object: SecondaryIndexDescriptorAminoMsg): SecondaryIndexDescriptor { @@ -529,14 +546,15 @@ function createBaseSingletonDescriptor(): SingletonDescriptor { }; } export const SingletonDescriptor = { - encode(message: SingletonDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.orm.v1.SingletonDescriptor", + encode(message: SingletonDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SingletonDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SingletonDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSingletonDescriptor(); while (reader.pos < end) { @@ -568,13 +586,15 @@ export const SingletonDescriptor = { return message; }, fromAmino(object: SingletonDescriptorAmino): SingletonDescriptor { - return { - id: object.id - }; + const message = createBaseSingletonDescriptor(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; }, toAmino(message: SingletonDescriptor): SingletonDescriptorAmino { const obj: any = {}; - obj.id = message.id; + obj.id = message.id === 0 ? undefined : message.id; return obj; }, fromAminoMsg(object: SingletonDescriptorAminoMsg): SingletonDescriptor { diff --git a/packages/api/src/codegen/cosmos/orm/v1alpha1/schema.ts b/packages/api/src/codegen/cosmos/orm/v1alpha1/schema.ts index a05083b9..70e7de91 100644 --- a/packages/api/src/codegen/cosmos/orm/v1alpha1/schema.ts +++ b/packages/api/src/codegen/cosmos/orm/v1alpha1/schema.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** StorageType */ export enum StorageType { @@ -100,12 +100,12 @@ export interface ModuleSchemaDescriptorProtoMsg { } /** ModuleSchemaDescriptor describe's a module's ORM schema. */ export interface ModuleSchemaDescriptorAmino { - schema_file: ModuleSchemaDescriptor_FileEntryAmino[]; + schema_file?: ModuleSchemaDescriptor_FileEntryAmino[]; /** * prefix is an optional prefix that precedes all keys in this module's * store. */ - prefix: Uint8Array; + prefix?: string; } export interface ModuleSchemaDescriptorAminoMsg { type: "cosmos-sdk/ModuleSchemaDescriptor"; @@ -146,19 +146,19 @@ export interface ModuleSchemaDescriptor_FileEntryAmino { * id is a prefix that will be varint encoded and prepended to all the * table keys specified in the file's tables. */ - id: number; + id?: number; /** * proto_file_name is the name of a file .proto in that contains * table definitions. The .proto file must be in a package that the * module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. */ - proto_file_name: string; + proto_file_name?: string; /** * storage_type optionally indicates the type of storage this file's * tables should used. If it is left unspecified, the default KV-storage * of the app will be used. */ - storage_type: StorageType; + storage_type?: StorageType; } export interface ModuleSchemaDescriptor_FileEntryAminoMsg { type: "cosmos-sdk/FileEntry"; @@ -177,7 +177,8 @@ function createBaseModuleSchemaDescriptor(): ModuleSchemaDescriptor { }; } export const ModuleSchemaDescriptor = { - encode(message: ModuleSchemaDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.orm.v1alpha1.ModuleSchemaDescriptor", + encode(message: ModuleSchemaDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.schemaFile) { ModuleSchemaDescriptor_FileEntry.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -186,8 +187,8 @@ export const ModuleSchemaDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleSchemaDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleSchemaDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleSchemaDescriptor(); while (reader.pos < end) { @@ -229,19 +230,21 @@ export const ModuleSchemaDescriptor = { return message; }, fromAmino(object: ModuleSchemaDescriptorAmino): ModuleSchemaDescriptor { - return { - schemaFile: Array.isArray(object?.schema_file) ? object.schema_file.map((e: any) => ModuleSchemaDescriptor_FileEntry.fromAmino(e)) : [], - prefix: object.prefix - }; + const message = createBaseModuleSchemaDescriptor(); + message.schemaFile = object.schema_file?.map(e => ModuleSchemaDescriptor_FileEntry.fromAmino(e)) || []; + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; }, toAmino(message: ModuleSchemaDescriptor): ModuleSchemaDescriptorAmino { const obj: any = {}; if (message.schemaFile) { obj.schema_file = message.schemaFile.map(e => e ? ModuleSchemaDescriptor_FileEntry.toAmino(e) : undefined); } else { - obj.schema_file = []; + obj.schema_file = message.schemaFile; } - obj.prefix = message.prefix; + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; return obj; }, fromAminoMsg(object: ModuleSchemaDescriptorAminoMsg): ModuleSchemaDescriptor { @@ -274,7 +277,8 @@ function createBaseModuleSchemaDescriptor_FileEntry(): ModuleSchemaDescriptor_Fi }; } export const ModuleSchemaDescriptor_FileEntry = { - encode(message: ModuleSchemaDescriptor_FileEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.orm.v1alpha1.FileEntry", + encode(message: ModuleSchemaDescriptor_FileEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); } @@ -286,8 +290,8 @@ export const ModuleSchemaDescriptor_FileEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleSchemaDescriptor_FileEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleSchemaDescriptor_FileEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleSchemaDescriptor_FileEntry(); while (reader.pos < end) { @@ -313,7 +317,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: isSet(object.id) ? Number(object.id) : 0, protoFileName: isSet(object.protoFileName) ? String(object.protoFileName) : "", - storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : 0 + storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : -1 }; }, toJSON(message: ModuleSchemaDescriptor_FileEntry): unknown { @@ -331,17 +335,23 @@ export const ModuleSchemaDescriptor_FileEntry = { return message; }, fromAmino(object: ModuleSchemaDescriptor_FileEntryAmino): ModuleSchemaDescriptor_FileEntry { - return { - id: object.id, - protoFileName: object.proto_file_name, - storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 - }; + const message = createBaseModuleSchemaDescriptor_FileEntry(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.proto_file_name !== undefined && object.proto_file_name !== null) { + message.protoFileName = object.proto_file_name; + } + if (object.storage_type !== undefined && object.storage_type !== null) { + message.storageType = object.storage_type; + } + return message; }, toAmino(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntryAmino { const obj: any = {}; - obj.id = message.id; - obj.proto_file_name = message.protoFileName; - obj.storage_type = message.storageType; + obj.id = message.id === 0 ? undefined : message.id; + obj.proto_file_name = message.protoFileName === "" ? undefined : message.protoFileName; + obj.storage_type = message.storageType === 0 ? undefined : message.storageType; return obj; }, fromAminoMsg(object: ModuleSchemaDescriptor_FileEntryAminoMsg): ModuleSchemaDescriptor_FileEntry { diff --git a/packages/api/src/codegen/cosmos/params/v1beta1/params.ts b/packages/api/src/codegen/cosmos/params/v1beta1/params.ts index 84059be1..90793ec3 100644 --- a/packages/api/src/codegen/cosmos/params/v1beta1/params.ts +++ b/packages/api/src/codegen/cosmos/params/v1beta1/params.ts @@ -1,8 +1,8 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** ParameterChangeProposal defines a proposal to change one or more parameters. */ export interface ParameterChangeProposal { - $typeUrl?: string; + $typeUrl?: "/cosmos.params.v1beta1.ParameterChangeProposal"; title: string; description: string; changes: ParamChange[]; @@ -13,9 +13,9 @@ export interface ParameterChangeProposalProtoMsg { } /** ParameterChangeProposal defines a proposal to change one or more parameters. */ export interface ParameterChangeProposalAmino { - title: string; - description: string; - changes: ParamChangeAmino[]; + title?: string; + description?: string; + changes?: ParamChangeAmino[]; } export interface ParameterChangeProposalAminoMsg { type: "cosmos-sdk/ParameterChangeProposal"; @@ -23,7 +23,7 @@ export interface ParameterChangeProposalAminoMsg { } /** ParameterChangeProposal defines a proposal to change one or more parameters. */ export interface ParameterChangeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.params.v1beta1.ParameterChangeProposal"; title: string; description: string; changes: ParamChangeSDKType[]; @@ -46,9 +46,9 @@ export interface ParamChangeProtoMsg { * ParameterChangeProposal. */ export interface ParamChangeAmino { - subspace: string; - key: string; - value: string; + subspace?: string; + key?: string; + value?: string; } export interface ParamChangeAminoMsg { type: "cosmos-sdk/ParamChange"; @@ -72,7 +72,8 @@ function createBaseParameterChangeProposal(): ParameterChangeProposal { }; } export const ParameterChangeProposal = { - encode(message: ParameterChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + encode(message: ParameterChangeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -84,8 +85,8 @@ export const ParameterChangeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ParameterChangeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ParameterChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParameterChangeProposal(); while (reader.pos < end) { @@ -133,20 +134,24 @@ export const ParameterChangeProposal = { return message; }, fromAmino(object: ParameterChangeProposalAmino): ParameterChangeProposal { - return { - title: object.title, - description: object.description, - changes: Array.isArray(object?.changes) ? object.changes.map((e: any) => ParamChange.fromAmino(e)) : [] - }; + const message = createBaseParameterChangeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.changes = object.changes?.map(e => ParamChange.fromAmino(e)) || []; + return message; }, toAmino(message: ParameterChangeProposal): ParameterChangeProposalAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; if (message.changes) { obj.changes = message.changes.map(e => e ? ParamChange.toAmino(e) : undefined); } else { - obj.changes = []; + obj.changes = message.changes; } return obj; }, @@ -180,7 +185,8 @@ function createBaseParamChange(): ParamChange { }; } export const ParamChange = { - encode(message: ParamChange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.params.v1beta1.ParamChange", + encode(message: ParamChange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -192,8 +198,8 @@ export const ParamChange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ParamChange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ParamChange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParamChange(); while (reader.pos < end) { @@ -237,17 +243,23 @@ export const ParamChange = { return message; }, fromAmino(object: ParamChangeAmino): ParamChange { - return { - subspace: object.subspace, - key: object.key, - value: object.value - }; + const message = createBaseParamChange(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; }, toAmino(message: ParamChange): ParamChangeAmino { const obj: any = {}; - obj.subspace = message.subspace; - obj.key = message.key; - obj.value = message.value; + obj.subspace = message.subspace === "" ? undefined : message.subspace; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; return obj; }, fromAminoMsg(object: ParamChangeAminoMsg): ParamChange { diff --git a/packages/api/src/codegen/cosmos/params/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/params/v1beta1/query.lcd.ts index d42f9639..30dd12e3 100644 --- a/packages/api/src/codegen/cosmos/params/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/params/v1beta1/query.lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryParamsRequest, QueryParamsResponseSDKType, QuerySubspacesRequest, QuerySubspacesResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts index 77352b11..a432f94d 100644 --- a/packages/api/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -26,12 +26,12 @@ export class QueryClientImpl implements Query { params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } subspaces(request: QuerySubspacesRequest = {}): Promise { const data = QuerySubspacesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Subspaces", data); - return promise.then(data => QuerySubspacesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySubspacesResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/params/v1beta1/query.ts b/packages/api/src/codegen/cosmos/params/v1beta1/query.ts index 9da15b0f..761b2725 100644 --- a/packages/api/src/codegen/cosmos/params/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/params/v1beta1/query.ts @@ -1,5 +1,5 @@ import { ParamChange, ParamChangeAmino, ParamChangeSDKType } from "./params"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest { @@ -15,9 +15,9 @@ export interface QueryParamsRequestProtoMsg { /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequestAmino { /** subspace defines the module to query the parameter for. */ - subspace: string; + subspace?: string; /** key defines the key of the parameter in the subspace. */ - key: string; + key?: string; } export interface QueryParamsRequestAminoMsg { type: "cosmos-sdk/QueryParamsRequest"; @@ -99,7 +99,7 @@ export interface QuerySubspacesResponseProtoMsg { * Since: cosmos-sdk 0.46 */ export interface QuerySubspacesResponseAmino { - subspaces: SubspaceAmino[]; + subspaces?: SubspaceAmino[]; } export interface QuerySubspacesResponseAminoMsg { type: "cosmos-sdk/QuerySubspacesResponse"; @@ -135,8 +135,8 @@ export interface SubspaceProtoMsg { * Since: cosmos-sdk 0.46 */ export interface SubspaceAmino { - subspace: string; - keys: string[]; + subspace?: string; + keys?: string[]; } export interface SubspaceAminoMsg { type: "cosmos-sdk/Subspace"; @@ -159,7 +159,8 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { }; } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest", + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -168,8 +169,8 @@ export const QueryParamsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -207,15 +208,19 @@ export const QueryParamsRequest = { return message; }, fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - return { - subspace: object.subspace, - key: object.key - }; + const message = createBaseQueryParamsRequest(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + return message; }, toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; - obj.subspace = message.subspace; - obj.key = message.key; + obj.subspace = message.subspace === "" ? undefined : message.subspace; + obj.key = message.key === "" ? undefined : message.key; return obj; }, fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { @@ -246,14 +251,15 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.param !== undefined) { ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -285,9 +291,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - param: object?.param ? ParamChange.fromAmino(object.param) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.param !== undefined && object.param !== null) { + message.param = ParamChange.fromAmino(object.param); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -320,11 +328,12 @@ function createBaseQuerySubspacesRequest(): QuerySubspacesRequest { return {}; } export const QuerySubspacesRequest = { - encode(_: QuerySubspacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest", + encode(_: QuerySubspacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySubspacesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySubspacesRequest(); while (reader.pos < end) { @@ -349,7 +358,8 @@ export const QuerySubspacesRequest = { return message; }, fromAmino(_: QuerySubspacesRequestAmino): QuerySubspacesRequest { - return {}; + const message = createBaseQuerySubspacesRequest(); + return message; }, toAmino(_: QuerySubspacesRequest): QuerySubspacesRequestAmino { const obj: any = {}; @@ -383,14 +393,15 @@ function createBaseQuerySubspacesResponse(): QuerySubspacesResponse { }; } export const QuerySubspacesResponse = { - encode(message: QuerySubspacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse", + encode(message: QuerySubspacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.subspaces) { Subspace.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySubspacesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySubspacesResponse(); while (reader.pos < end) { @@ -426,16 +437,16 @@ export const QuerySubspacesResponse = { return message; }, fromAmino(object: QuerySubspacesResponseAmino): QuerySubspacesResponse { - return { - subspaces: Array.isArray(object?.subspaces) ? object.subspaces.map((e: any) => Subspace.fromAmino(e)) : [] - }; + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map(e => Subspace.fromAmino(e)) || []; + return message; }, toAmino(message: QuerySubspacesResponse): QuerySubspacesResponseAmino { const obj: any = {}; if (message.subspaces) { obj.subspaces = message.subspaces.map(e => e ? Subspace.toAmino(e) : undefined); } else { - obj.subspaces = []; + obj.subspaces = message.subspaces; } return obj; }, @@ -468,7 +479,8 @@ function createBaseSubspace(): Subspace { }; } export const Subspace = { - encode(message: Subspace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.params.v1beta1.Subspace", + encode(message: Subspace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -477,8 +489,8 @@ export const Subspace = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Subspace { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Subspace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubspace(); while (reader.pos < end) { @@ -520,18 +532,20 @@ export const Subspace = { return message; }, fromAmino(object: SubspaceAmino): Subspace { - return { - subspace: object.subspace, - keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => e) : [] - }; + const message = createBaseSubspace(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + message.keys = object.keys?.map(e => e) || []; + return message; }, toAmino(message: Subspace): SubspaceAmino { const obj: any = {}; - obj.subspace = message.subspace; + obj.subspace = message.subspace === "" ? undefined : message.subspace; if (message.keys) { obj.keys = message.keys.map(e => e); } else { - obj.keys = []; + obj.keys = message.keys; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/slashing/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/slashing/v1beta1/genesis.ts index 6b7a9421..c8ccef29 100644 --- a/packages/api/src/codegen/cosmos/slashing/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/slashing/v1beta1/genesis.ts @@ -1,6 +1,6 @@ import { Params, ParamsAmino, ParamsSDKType, ValidatorSigningInfo, ValidatorSigningInfoAmino, ValidatorSigningInfoSDKType } from "./slashing"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** GenesisState defines the slashing module's genesis state. */ export interface GenesisState { /** params defines all the paramaters of related to deposit. */ @@ -28,12 +28,12 @@ export interface GenesisStateAmino { * signing_infos represents a map between validator addresses and their * signing infos. */ - signing_infos: SigningInfoAmino[]; + signing_infos?: SigningInfoAmino[]; /** * missed_blocks represents a map between validator addresses and their * missed blocks. */ - missed_blocks: ValidatorMissedBlocksAmino[]; + missed_blocks?: ValidatorMissedBlocksAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -59,7 +59,7 @@ export interface SigningInfoProtoMsg { /** SigningInfo stores validator signing info of corresponding address. */ export interface SigningInfoAmino { /** address is the validator address. */ - address: string; + address?: string; /** validator_signing_info represents the signing info of this validator. */ validator_signing_info?: ValidatorSigningInfoAmino; } @@ -92,9 +92,9 @@ export interface ValidatorMissedBlocksProtoMsg { */ export interface ValidatorMissedBlocksAmino { /** address is the validator address. */ - address: string; + address?: string; /** missed_blocks is an array of missed blocks by the validator. */ - missed_blocks: MissedBlockAmino[]; + missed_blocks?: MissedBlockAmino[]; } export interface ValidatorMissedBlocksAminoMsg { type: "cosmos-sdk/ValidatorMissedBlocks"; @@ -111,7 +111,7 @@ export interface ValidatorMissedBlocksSDKType { /** MissedBlock contains height and missed status as boolean. */ export interface MissedBlock { /** index is the height at which the block was missed. */ - index: Long; + index: bigint; /** missed is the missed status. */ missed: boolean; } @@ -122,9 +122,9 @@ export interface MissedBlockProtoMsg { /** MissedBlock contains height and missed status as boolean. */ export interface MissedBlockAmino { /** index is the height at which the block was missed. */ - index: string; + index?: string; /** missed is the missed status. */ - missed: boolean; + missed?: boolean; } export interface MissedBlockAminoMsg { type: "cosmos-sdk/MissedBlock"; @@ -132,7 +132,7 @@ export interface MissedBlockAminoMsg { } /** MissedBlock contains height and missed status as boolean. */ export interface MissedBlockSDKType { - index: Long; + index: bigint; missed: boolean; } function createBaseGenesisState(): GenesisState { @@ -143,7 +143,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -155,8 +156,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -208,11 +209,13 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - signingInfos: Array.isArray(object?.signing_infos) ? object.signing_infos.map((e: any) => SigningInfo.fromAmino(e)) : [], - missedBlocks: Array.isArray(object?.missed_blocks) ? object.missed_blocks.map((e: any) => ValidatorMissedBlocks.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.signingInfos = object.signing_infos?.map(e => SigningInfo.fromAmino(e)) || []; + message.missedBlocks = object.missed_blocks?.map(e => ValidatorMissedBlocks.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -220,12 +223,12 @@ export const GenesisState = { if (message.signingInfos) { obj.signing_infos = message.signingInfos.map(e => e ? SigningInfo.toAmino(e) : undefined); } else { - obj.signing_infos = []; + obj.signing_infos = message.signingInfos; } if (message.missedBlocks) { obj.missed_blocks = message.missedBlocks.map(e => e ? ValidatorMissedBlocks.toAmino(e) : undefined); } else { - obj.missed_blocks = []; + obj.missed_blocks = message.missedBlocks; } return obj; }, @@ -258,7 +261,8 @@ function createBaseSigningInfo(): SigningInfo { }; } export const SigningInfo = { - encode(message: SigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.SigningInfo", + encode(message: SigningInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -267,8 +271,8 @@ export const SigningInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SigningInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SigningInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSigningInfo(); while (reader.pos < end) { @@ -306,14 +310,18 @@ export const SigningInfo = { return message; }, fromAmino(object: SigningInfoAmino): SigningInfo { - return { - address: object.address, - validatorSigningInfo: object?.validator_signing_info ? ValidatorSigningInfo.fromAmino(object.validator_signing_info) : undefined - }; + const message = createBaseSigningInfo(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.validator_signing_info !== undefined && object.validator_signing_info !== null) { + message.validatorSigningInfo = ValidatorSigningInfo.fromAmino(object.validator_signing_info); + } + return message; }, toAmino(message: SigningInfo): SigningInfoAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.validator_signing_info = message.validatorSigningInfo ? ValidatorSigningInfo.toAmino(message.validatorSigningInfo) : undefined; return obj; }, @@ -346,7 +354,8 @@ function createBaseValidatorMissedBlocks(): ValidatorMissedBlocks { }; } export const ValidatorMissedBlocks = { - encode(message: ValidatorMissedBlocks, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.ValidatorMissedBlocks", + encode(message: ValidatorMissedBlocks, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -355,8 +364,8 @@ export const ValidatorMissedBlocks = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorMissedBlocks { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorMissedBlocks { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorMissedBlocks(); while (reader.pos < end) { @@ -398,18 +407,20 @@ export const ValidatorMissedBlocks = { return message; }, fromAmino(object: ValidatorMissedBlocksAmino): ValidatorMissedBlocks { - return { - address: object.address, - missedBlocks: Array.isArray(object?.missed_blocks) ? object.missed_blocks.map((e: any) => MissedBlock.fromAmino(e)) : [] - }; + const message = createBaseValidatorMissedBlocks(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.missedBlocks = object.missed_blocks?.map(e => MissedBlock.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorMissedBlocks): ValidatorMissedBlocksAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; if (message.missedBlocks) { obj.missed_blocks = message.missedBlocks.map(e => e ? MissedBlock.toAmino(e) : undefined); } else { - obj.missed_blocks = []; + obj.missed_blocks = message.missedBlocks; } return obj; }, @@ -437,13 +448,14 @@ export const ValidatorMissedBlocks = { }; function createBaseMissedBlock(): MissedBlock { return { - index: Long.ZERO, + index: BigInt(0), missed: false }; } export const MissedBlock = { - encode(message: MissedBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + typeUrl: "/cosmos.slashing.v1beta1.MissedBlock", + encode(message: MissedBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).int64(message.index); } if (message.missed === true) { @@ -451,15 +463,15 @@ export const MissedBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MissedBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MissedBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMissedBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = (reader.int64() as Long); + message.index = reader.int64(); break; case 2: message.missed = reader.bool(); @@ -473,32 +485,36 @@ export const MissedBlock = { }, fromJSON(object: any): MissedBlock { return { - index: isSet(object.index) ? Long.fromValue(object.index) : Long.ZERO, + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), missed: isSet(object.missed) ? Boolean(object.missed) : false }; }, toJSON(message: MissedBlock): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.missed !== undefined && (obj.missed = message.missed); return obj; }, fromPartial(object: Partial): MissedBlock { const message = createBaseMissedBlock(); - message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.ZERO; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); message.missed = object.missed ?? false; return message; }, fromAmino(object: MissedBlockAmino): MissedBlock { - return { - index: Long.fromString(object.index), - missed: object.missed - }; + const message = createBaseMissedBlock(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.missed !== undefined && object.missed !== null) { + message.missed = object.missed; + } + return message; }, toAmino(message: MissedBlock): MissedBlockAmino { const obj: any = {}; - obj.index = message.index ? message.index.toString() : undefined; - obj.missed = message.missed; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.missed = message.missed === false ? undefined : message.missed; return obj; }, fromAminoMsg(object: MissedBlockAminoMsg): MissedBlock { diff --git a/packages/api/src/codegen/cosmos/slashing/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/slashing/v1beta1/query.lcd.ts index 644d8669..dbce4023 100644 --- a/packages/api/src/codegen/cosmos/slashing/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/slashing/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryParamsRequest, QueryParamsResponseSDKType, QuerySigningInfoRequest, QuerySigningInfoResponseSDKType, QuerySigningInfosRequest, QuerySigningInfosResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts index b73c00d7..83586b56 100644 --- a/packages/api/src/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryParamsRequest, QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./query"; /** Query provides defines the gRPC querier service */ @@ -22,19 +22,19 @@ export class QueryClientImpl implements Query { params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } signingInfo(request: QuerySigningInfoRequest): Promise { const data = QuerySigningInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfo", data); - return promise.then(data => QuerySigningInfoResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySigningInfoResponse.decode(new BinaryReader(data))); } signingInfos(request: QuerySigningInfosRequest = { pagination: undefined }): Promise { const data = QuerySigningInfosRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfos", data); - return promise.then(data => QuerySigningInfosResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySigningInfosResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/slashing/v1beta1/query.ts b/packages/api/src/codegen/cosmos/slashing/v1beta1/query.ts index b3b58327..788d726d 100644 --- a/packages/api/src/codegen/cosmos/slashing/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/slashing/v1beta1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType, ValidatorSigningInfo, ValidatorSigningInfoAmino, ValidatorSigningInfoSDKType } from "./slashing"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method */ export interface QueryParamsRequest {} @@ -54,7 +54,7 @@ export interface QuerySigningInfoRequestProtoMsg { */ export interface QuerySigningInfoRequestAmino { /** cons_address is the address to query signing info of */ - cons_address: string; + cons_address?: string; } export interface QuerySigningInfoRequestAminoMsg { type: "cosmos-sdk/QuerySigningInfoRequest"; @@ -103,7 +103,7 @@ export interface QuerySigningInfoResponseSDKType { * method */ export interface QuerySigningInfosRequest { - pagination: PageRequest; + pagination?: PageRequest; } export interface QuerySigningInfosRequestProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfosRequest"; @@ -125,7 +125,7 @@ export interface QuerySigningInfosRequestAminoMsg { * method */ export interface QuerySigningInfosRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC @@ -134,7 +134,7 @@ export interface QuerySigningInfosRequestSDKType { export interface QuerySigningInfosResponse { /** info is the signing info of all validators */ info: ValidatorSigningInfo[]; - pagination: PageResponse; + pagination?: PageResponse; } export interface QuerySigningInfosResponseProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfosResponse"; @@ -146,7 +146,7 @@ export interface QuerySigningInfosResponseProtoMsg { */ export interface QuerySigningInfosResponseAmino { /** info is the signing info of all validators */ - info: ValidatorSigningInfoAmino[]; + info?: ValidatorSigningInfoAmino[]; pagination?: PageResponseAmino; } export interface QuerySigningInfosResponseAminoMsg { @@ -159,17 +159,18 @@ export interface QuerySigningInfosResponseAminoMsg { */ export interface QuerySigningInfosResponseSDKType { info: ValidatorSigningInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -194,7 +195,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -228,14 +230,15 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -267,9 +270,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -304,14 +309,15 @@ function createBaseQuerySigningInfoRequest(): QuerySigningInfoRequest { }; } export const QuerySigningInfoRequest = { - encode(message: QuerySigningInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfoRequest", + encode(message: QuerySigningInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consAddress !== "") { writer.uint32(10).string(message.consAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfoRequest(); while (reader.pos < end) { @@ -343,13 +349,15 @@ export const QuerySigningInfoRequest = { return message; }, fromAmino(object: QuerySigningInfoRequestAmino): QuerySigningInfoRequest { - return { - consAddress: object.cons_address - }; + const message = createBaseQuerySigningInfoRequest(); + if (object.cons_address !== undefined && object.cons_address !== null) { + message.consAddress = object.cons_address; + } + return message; }, toAmino(message: QuerySigningInfoRequest): QuerySigningInfoRequestAmino { const obj: any = {}; - obj.cons_address = message.consAddress; + obj.cons_address = message.consAddress === "" ? undefined : message.consAddress; return obj; }, fromAminoMsg(object: QuerySigningInfoRequestAminoMsg): QuerySigningInfoRequest { @@ -380,14 +388,15 @@ function createBaseQuerySigningInfoResponse(): QuerySigningInfoResponse { }; } export const QuerySigningInfoResponse = { - encode(message: QuerySigningInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfoResponse", + encode(message: QuerySigningInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.valSigningInfo !== undefined) { ValidatorSigningInfo.encode(message.valSigningInfo, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfoResponse(); while (reader.pos < end) { @@ -419,9 +428,11 @@ export const QuerySigningInfoResponse = { return message; }, fromAmino(object: QuerySigningInfoResponseAmino): QuerySigningInfoResponse { - return { - valSigningInfo: object?.val_signing_info ? ValidatorSigningInfo.fromAmino(object.val_signing_info) : undefined - }; + const message = createBaseQuerySigningInfoResponse(); + if (object.val_signing_info !== undefined && object.val_signing_info !== null) { + message.valSigningInfo = ValidatorSigningInfo.fromAmino(object.val_signing_info); + } + return message; }, toAmino(message: QuerySigningInfoResponse): QuerySigningInfoResponseAmino { const obj: any = {}; @@ -452,18 +463,19 @@ export const QuerySigningInfoResponse = { }; function createBaseQuerySigningInfosRequest(): QuerySigningInfosRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QuerySigningInfosRequest = { - encode(message: QuerySigningInfosRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfosRequest", + encode(message: QuerySigningInfosRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfosRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfosRequest(); while (reader.pos < end) { @@ -495,9 +507,11 @@ export const QuerySigningInfosRequest = { return message; }, fromAmino(object: QuerySigningInfosRequestAmino): QuerySigningInfosRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySigningInfosRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySigningInfosRequest): QuerySigningInfosRequestAmino { const obj: any = {}; @@ -529,11 +543,12 @@ export const QuerySigningInfosRequest = { function createBaseQuerySigningInfosResponse(): QuerySigningInfosResponse { return { info: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QuerySigningInfosResponse = { - encode(message: QuerySigningInfosResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.QuerySigningInfosResponse", + encode(message: QuerySigningInfosResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.info) { ValidatorSigningInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -542,8 +557,8 @@ export const QuerySigningInfosResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfosResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfosResponse(); while (reader.pos < end) { @@ -585,17 +600,19 @@ export const QuerySigningInfosResponse = { return message; }, fromAmino(object: QuerySigningInfosResponseAmino): QuerySigningInfosResponse { - return { - info: Array.isArray(object?.info) ? object.info.map((e: any) => ValidatorSigningInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySigningInfosResponse(); + message.info = object.info?.map(e => ValidatorSigningInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySigningInfosResponse): QuerySigningInfosResponseAmino { const obj: any = {}; if (message.info) { obj.info = message.info.map(e => e ? ValidatorSigningInfo.toAmino(e) : undefined); } else { - obj.info = []; + obj.info = message.info; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; diff --git a/packages/api/src/codegen/cosmos/slashing/v1beta1/slashing.ts b/packages/api/src/codegen/cosmos/slashing/v1beta1/slashing.ts index 8d7d5845..2caeb9d7 100644 --- a/packages/api/src/codegen/cosmos/slashing/v1beta1/slashing.ts +++ b/packages/api/src/codegen/cosmos/slashing/v1beta1/slashing.ts @@ -1,7 +1,7 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * ValidatorSigningInfo defines a validator's signing info for monitoring their * liveness activity. @@ -9,13 +9,13 @@ import * as _m0 from "protobufjs/minimal"; export interface ValidatorSigningInfo { address: string; /** Height at which validator was first a candidate OR was unjailed */ - startHeight: Long; + startHeight: bigint; /** * Index which is incremented each time the validator was a bonded * in a block and may have signed a precommit or not. This in conjunction with the * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. */ - indexOffset: Long; + indexOffset: bigint; /** Timestamp until which the validator is jailed due to liveness downtime. */ jailedUntil: Timestamp; /** @@ -27,7 +27,7 @@ export interface ValidatorSigningInfo { * A counter kept to avoid unnecessary array reads. * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. */ - missedBlocksCounter: Long; + missedBlocksCounter: bigint; } export interface ValidatorSigningInfoProtoMsg { typeUrl: "/cosmos.slashing.v1beta1.ValidatorSigningInfo"; @@ -38,27 +38,27 @@ export interface ValidatorSigningInfoProtoMsg { * liveness activity. */ export interface ValidatorSigningInfoAmino { - address: string; + address?: string; /** Height at which validator was first a candidate OR was unjailed */ - start_height: string; + start_height?: string; /** * Index which is incremented each time the validator was a bonded * in a block and may have signed a precommit or not. This in conjunction with the * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. */ - index_offset: string; + index_offset?: string; /** Timestamp until which the validator is jailed due to liveness downtime. */ - jailed_until?: TimestampAmino; + jailed_until?: string; /** * Whether or not a validator has been tombstoned (killed out of validator set). It is set * once the validator commits an equivocation or for any other configured misbehiavor. */ - tombstoned: boolean; + tombstoned?: boolean; /** * A counter kept to avoid unnecessary array reads. * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. */ - missed_blocks_counter: string; + missed_blocks_counter?: string; } export interface ValidatorSigningInfoAminoMsg { type: "cosmos-sdk/ValidatorSigningInfo"; @@ -70,15 +70,15 @@ export interface ValidatorSigningInfoAminoMsg { */ export interface ValidatorSigningInfoSDKType { address: string; - start_height: Long; - index_offset: Long; + start_height: bigint; + index_offset: bigint; jailed_until: TimestampSDKType; tombstoned: boolean; - missed_blocks_counter: Long; + missed_blocks_counter: bigint; } /** Params represents the parameters used for by the slashing module. */ export interface Params { - signedBlocksWindow: Long; + signedBlocksWindow: bigint; minSignedPerWindow: Uint8Array; downtimeJailDuration: Duration; slashFractionDoubleSign: Uint8Array; @@ -90,11 +90,11 @@ export interface ParamsProtoMsg { } /** Params represents the parameters used for by the slashing module. */ export interface ParamsAmino { - signed_blocks_window: string; - min_signed_per_window: Uint8Array; + signed_blocks_window?: string; + min_signed_per_window?: string; downtime_jail_duration?: DurationAmino; - slash_fraction_double_sign: Uint8Array; - slash_fraction_downtime: Uint8Array; + slash_fraction_double_sign?: string; + slash_fraction_downtime?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -102,7 +102,7 @@ export interface ParamsAminoMsg { } /** Params represents the parameters used for by the slashing module. */ export interface ParamsSDKType { - signed_blocks_window: Long; + signed_blocks_window: bigint; min_signed_per_window: Uint8Array; downtime_jail_duration: DurationSDKType; slash_fraction_double_sign: Uint8Array; @@ -111,22 +111,23 @@ export interface ParamsSDKType { function createBaseValidatorSigningInfo(): ValidatorSigningInfo { return { address: "", - startHeight: Long.ZERO, - indexOffset: Long.ZERO, - jailedUntil: undefined, + startHeight: BigInt(0), + indexOffset: BigInt(0), + jailedUntil: Timestamp.fromPartial({}), tombstoned: false, - missedBlocksCounter: Long.ZERO + missedBlocksCounter: BigInt(0) }; } export const ValidatorSigningInfo = { - encode(message: ValidatorSigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.ValidatorSigningInfo", + encode(message: ValidatorSigningInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.startHeight.isZero()) { + if (message.startHeight !== BigInt(0)) { writer.uint32(16).int64(message.startHeight); } - if (!message.indexOffset.isZero()) { + if (message.indexOffset !== BigInt(0)) { writer.uint32(24).int64(message.indexOffset); } if (message.jailedUntil !== undefined) { @@ -135,13 +136,13 @@ export const ValidatorSigningInfo = { if (message.tombstoned === true) { writer.uint32(40).bool(message.tombstoned); } - if (!message.missedBlocksCounter.isZero()) { + if (message.missedBlocksCounter !== BigInt(0)) { writer.uint32(48).int64(message.missedBlocksCounter); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSigningInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSigningInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSigningInfo(); while (reader.pos < end) { @@ -151,10 +152,10 @@ export const ValidatorSigningInfo = { message.address = reader.string(); break; case 2: - message.startHeight = (reader.int64() as Long); + message.startHeight = reader.int64(); break; case 3: - message.indexOffset = (reader.int64() as Long); + message.indexOffset = reader.int64(); break; case 4: message.jailedUntil = Timestamp.decode(reader, reader.uint32()); @@ -163,7 +164,7 @@ export const ValidatorSigningInfo = { message.tombstoned = reader.bool(); break; case 6: - message.missedBlocksCounter = (reader.int64() as Long); + message.missedBlocksCounter = reader.int64(); break; default: reader.skipType(tag & 7); @@ -175,51 +176,63 @@ export const ValidatorSigningInfo = { fromJSON(object: any): ValidatorSigningInfo { return { address: isSet(object.address) ? String(object.address) : "", - startHeight: isSet(object.startHeight) ? Long.fromValue(object.startHeight) : Long.ZERO, - indexOffset: isSet(object.indexOffset) ? Long.fromValue(object.indexOffset) : Long.ZERO, + startHeight: isSet(object.startHeight) ? BigInt(object.startHeight.toString()) : BigInt(0), + indexOffset: isSet(object.indexOffset) ? BigInt(object.indexOffset.toString()) : BigInt(0), jailedUntil: isSet(object.jailedUntil) ? fromJsonTimestamp(object.jailedUntil) : undefined, tombstoned: isSet(object.tombstoned) ? Boolean(object.tombstoned) : false, - missedBlocksCounter: isSet(object.missedBlocksCounter) ? Long.fromValue(object.missedBlocksCounter) : Long.ZERO + missedBlocksCounter: isSet(object.missedBlocksCounter) ? BigInt(object.missedBlocksCounter.toString()) : BigInt(0) }; }, toJSON(message: ValidatorSigningInfo): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.startHeight !== undefined && (obj.startHeight = (message.startHeight || Long.ZERO).toString()); - message.indexOffset !== undefined && (obj.indexOffset = (message.indexOffset || Long.ZERO).toString()); + message.startHeight !== undefined && (obj.startHeight = (message.startHeight || BigInt(0)).toString()); + message.indexOffset !== undefined && (obj.indexOffset = (message.indexOffset || BigInt(0)).toString()); message.jailedUntil !== undefined && (obj.jailedUntil = fromTimestamp(message.jailedUntil).toISOString()); message.tombstoned !== undefined && (obj.tombstoned = message.tombstoned); - message.missedBlocksCounter !== undefined && (obj.missedBlocksCounter = (message.missedBlocksCounter || Long.ZERO).toString()); + message.missedBlocksCounter !== undefined && (obj.missedBlocksCounter = (message.missedBlocksCounter || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ValidatorSigningInfo { const message = createBaseValidatorSigningInfo(); message.address = object.address ?? ""; - message.startHeight = object.startHeight !== undefined && object.startHeight !== null ? Long.fromValue(object.startHeight) : Long.ZERO; - message.indexOffset = object.indexOffset !== undefined && object.indexOffset !== null ? Long.fromValue(object.indexOffset) : Long.ZERO; + message.startHeight = object.startHeight !== undefined && object.startHeight !== null ? BigInt(object.startHeight.toString()) : BigInt(0); + message.indexOffset = object.indexOffset !== undefined && object.indexOffset !== null ? BigInt(object.indexOffset.toString()) : BigInt(0); message.jailedUntil = object.jailedUntil !== undefined && object.jailedUntil !== null ? Timestamp.fromPartial(object.jailedUntil) : undefined; message.tombstoned = object.tombstoned ?? false; - message.missedBlocksCounter = object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null ? Long.fromValue(object.missedBlocksCounter) : Long.ZERO; + message.missedBlocksCounter = object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null ? BigInt(object.missedBlocksCounter.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorSigningInfoAmino): ValidatorSigningInfo { - return { - address: object.address, - startHeight: Long.fromString(object.start_height), - indexOffset: Long.fromString(object.index_offset), - jailedUntil: object?.jailed_until ? Timestamp.fromAmino(object.jailed_until) : undefined, - tombstoned: object.tombstoned, - missedBlocksCounter: Long.fromString(object.missed_blocks_counter) - }; + const message = createBaseValidatorSigningInfo(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.start_height !== undefined && object.start_height !== null) { + message.startHeight = BigInt(object.start_height); + } + if (object.index_offset !== undefined && object.index_offset !== null) { + message.indexOffset = BigInt(object.index_offset); + } + if (object.jailed_until !== undefined && object.jailed_until !== null) { + message.jailedUntil = Timestamp.fromAmino(object.jailed_until); + } + if (object.tombstoned !== undefined && object.tombstoned !== null) { + message.tombstoned = object.tombstoned; + } + if (object.missed_blocks_counter !== undefined && object.missed_blocks_counter !== null) { + message.missedBlocksCounter = BigInt(object.missed_blocks_counter); + } + return message; }, toAmino(message: ValidatorSigningInfo): ValidatorSigningInfoAmino { const obj: any = {}; - obj.address = message.address; - obj.start_height = message.startHeight ? message.startHeight.toString() : undefined; - obj.index_offset = message.indexOffset ? message.indexOffset.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + obj.start_height = message.startHeight !== BigInt(0) ? message.startHeight.toString() : undefined; + obj.index_offset = message.indexOffset !== BigInt(0) ? message.indexOffset.toString() : undefined; obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(message.jailedUntil) : undefined; - obj.tombstoned = message.tombstoned; - obj.missed_blocks_counter = message.missedBlocksCounter ? message.missedBlocksCounter.toString() : undefined; + obj.tombstoned = message.tombstoned === false ? undefined : message.tombstoned; + obj.missed_blocks_counter = message.missedBlocksCounter !== BigInt(0) ? message.missedBlocksCounter.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorSigningInfoAminoMsg): ValidatorSigningInfo { @@ -246,16 +259,17 @@ export const ValidatorSigningInfo = { }; function createBaseParams(): Params { return { - signedBlocksWindow: Long.ZERO, + signedBlocksWindow: BigInt(0), minSignedPerWindow: new Uint8Array(), - downtimeJailDuration: undefined, + downtimeJailDuration: Duration.fromPartial({}), slashFractionDoubleSign: new Uint8Array(), slashFractionDowntime: new Uint8Array() }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.signedBlocksWindow.isZero()) { + typeUrl: "/cosmos.slashing.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signedBlocksWindow !== BigInt(0)) { writer.uint32(8).int64(message.signedBlocksWindow); } if (message.minSignedPerWindow.length !== 0) { @@ -272,15 +286,15 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signedBlocksWindow = (reader.int64() as Long); + message.signedBlocksWindow = reader.int64(); break; case 2: message.minSignedPerWindow = reader.bytes(); @@ -303,7 +317,7 @@ export const Params = { }, fromJSON(object: any): Params { return { - signedBlocksWindow: isSet(object.signedBlocksWindow) ? Long.fromValue(object.signedBlocksWindow) : Long.ZERO, + signedBlocksWindow: isSet(object.signedBlocksWindow) ? BigInt(object.signedBlocksWindow.toString()) : BigInt(0), minSignedPerWindow: isSet(object.minSignedPerWindow) ? bytesFromBase64(object.minSignedPerWindow) : new Uint8Array(), downtimeJailDuration: isSet(object.downtimeJailDuration) ? Duration.fromJSON(object.downtimeJailDuration) : undefined, slashFractionDoubleSign: isSet(object.slashFractionDoubleSign) ? bytesFromBase64(object.slashFractionDoubleSign) : new Uint8Array(), @@ -312,7 +326,7 @@ export const Params = { }, toJSON(message: Params): unknown { const obj: any = {}; - message.signedBlocksWindow !== undefined && (obj.signedBlocksWindow = (message.signedBlocksWindow || Long.ZERO).toString()); + message.signedBlocksWindow !== undefined && (obj.signedBlocksWindow = (message.signedBlocksWindow || BigInt(0)).toString()); message.minSignedPerWindow !== undefined && (obj.minSignedPerWindow = base64FromBytes(message.minSignedPerWindow !== undefined ? message.minSignedPerWindow : new Uint8Array())); message.downtimeJailDuration !== undefined && (obj.downtimeJailDuration = message.downtimeJailDuration ? Duration.toJSON(message.downtimeJailDuration) : undefined); message.slashFractionDoubleSign !== undefined && (obj.slashFractionDoubleSign = base64FromBytes(message.slashFractionDoubleSign !== undefined ? message.slashFractionDoubleSign : new Uint8Array())); @@ -321,7 +335,7 @@ export const Params = { }, fromPartial(object: Partial): Params { const message = createBaseParams(); - message.signedBlocksWindow = object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null ? Long.fromValue(object.signedBlocksWindow) : Long.ZERO; + message.signedBlocksWindow = object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null ? BigInt(object.signedBlocksWindow.toString()) : BigInt(0); message.minSignedPerWindow = object.minSignedPerWindow ?? new Uint8Array(); message.downtimeJailDuration = object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null ? Duration.fromPartial(object.downtimeJailDuration) : undefined; message.slashFractionDoubleSign = object.slashFractionDoubleSign ?? new Uint8Array(); @@ -329,21 +343,31 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - signedBlocksWindow: Long.fromString(object.signed_blocks_window), - minSignedPerWindow: object.min_signed_per_window, - downtimeJailDuration: object?.downtime_jail_duration ? Duration.fromAmino(object.downtime_jail_duration) : undefined, - slashFractionDoubleSign: object.slash_fraction_double_sign, - slashFractionDowntime: object.slash_fraction_downtime - }; + const message = createBaseParams(); + if (object.signed_blocks_window !== undefined && object.signed_blocks_window !== null) { + message.signedBlocksWindow = BigInt(object.signed_blocks_window); + } + if (object.min_signed_per_window !== undefined && object.min_signed_per_window !== null) { + message.minSignedPerWindow = bytesFromBase64(object.min_signed_per_window); + } + if (object.downtime_jail_duration !== undefined && object.downtime_jail_duration !== null) { + message.downtimeJailDuration = Duration.fromAmino(object.downtime_jail_duration); + } + if (object.slash_fraction_double_sign !== undefined && object.slash_fraction_double_sign !== null) { + message.slashFractionDoubleSign = bytesFromBase64(object.slash_fraction_double_sign); + } + if (object.slash_fraction_downtime !== undefined && object.slash_fraction_downtime !== null) { + message.slashFractionDowntime = bytesFromBase64(object.slash_fraction_downtime); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.signed_blocks_window = message.signedBlocksWindow ? message.signedBlocksWindow.toString() : undefined; - obj.min_signed_per_window = message.minSignedPerWindow; + obj.signed_blocks_window = message.signedBlocksWindow !== BigInt(0) ? message.signedBlocksWindow.toString() : undefined; + obj.min_signed_per_window = message.minSignedPerWindow ? base64FromBytes(message.minSignedPerWindow) : undefined; obj.downtime_jail_duration = message.downtimeJailDuration ? Duration.toAmino(message.downtimeJailDuration) : undefined; - obj.slash_fraction_double_sign = message.slashFractionDoubleSign; - obj.slash_fraction_downtime = message.slashFractionDowntime; + obj.slash_fraction_double_sign = message.slashFractionDoubleSign ? base64FromBytes(message.slashFractionDoubleSign) : undefined; + obj.slash_fraction_downtime = message.slashFractionDowntime ? base64FromBytes(message.slashFractionDowntime) : undefined; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts index 2bb83a99..5a4b327d 100644 --- a/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgUnjail, MsgUnjailResponse } from "./tx"; /** Msg defines the slashing Msg service. */ export interface Msg { @@ -19,6 +19,6 @@ export class MsgClientImpl implements Msg { unjail(request: MsgUnjail): Promise { const data = MsgUnjail.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data); - return promise.then(data => MsgUnjailResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUnjailResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.ts index f1b90149..ec88a21f 100644 --- a/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/slashing/v1beta1/tx.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** MsgUnjail defines the Msg/Unjail request type */ export interface MsgUnjail { @@ -40,14 +40,15 @@ function createBaseMsgUnjail(): MsgUnjail { }; } export const MsgUnjail = { - encode(message: MsgUnjail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", + encode(message: MsgUnjail, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjail { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnjail { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnjail(); while (reader.pos < end) { @@ -79,13 +80,15 @@ export const MsgUnjail = { return message; }, fromAmino(object: MsgUnjailAmino): MsgUnjail { - return { - validatorAddr: object.validator_addr - }; + const message = createBaseMsgUnjail(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: MsgUnjail): MsgUnjailAmino { const obj: any = {}; - obj.validator_addr = message.validatorAddr; + obj.validator_addr = message.validatorAddr ?? ""; return obj; }, fromAminoMsg(object: MsgUnjailAminoMsg): MsgUnjail { @@ -114,11 +117,12 @@ function createBaseMsgUnjailResponse(): MsgUnjailResponse { return {}; } export const MsgUnjailResponse = { - encode(_: MsgUnjailResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjailResponse", + encode(_: MsgUnjailResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjailResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnjailResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnjailResponse(); while (reader.pos < end) { @@ -143,7 +147,8 @@ export const MsgUnjailResponse = { return message; }, fromAmino(_: MsgUnjailResponseAmino): MsgUnjailResponse { - return {}; + const message = createBaseMsgUnjailResponse(); + return message; }, toAmino(_: MsgUnjailResponse): MsgUnjailResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/authz.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/authz.ts index 74fa83d0..558d0df5 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/authz.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/authz.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * AuthorizationType defines the type of staking module authorization type @@ -60,12 +60,12 @@ export function authorizationTypeToJSON(object: AuthorizationType): string { * Since: cosmos-sdk 0.43 */ export interface StakeAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.staking.v1beta1.StakeAuthorization"; /** * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is * empty, there is no spend limit and any amount of coins can be delegated. */ - maxTokens: Coin; + maxTokens?: Coin; /** * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's * account. @@ -99,7 +99,7 @@ export interface StakeAuthorizationAmino { /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ deny_list?: StakeAuthorization_ValidatorsAmino; /** authorization_type defines one of AuthorizationType. */ - authorization_type: AuthorizationType; + authorization_type?: AuthorizationType; } export interface StakeAuthorizationAminoMsg { type: "cosmos-sdk/StakeAuthorization"; @@ -111,8 +111,8 @@ export interface StakeAuthorizationAminoMsg { * Since: cosmos-sdk 0.43 */ export interface StakeAuthorizationSDKType { - $typeUrl?: string; - max_tokens: CoinSDKType; + $typeUrl?: "/cosmos.staking.v1beta1.StakeAuthorization"; + max_tokens?: CoinSDKType; allow_list?: StakeAuthorization_ValidatorsSDKType; deny_list?: StakeAuthorization_ValidatorsSDKType; authorization_type: AuthorizationType; @@ -127,7 +127,7 @@ export interface StakeAuthorization_ValidatorsProtoMsg { } /** Validators defines list of validator addresses. */ export interface StakeAuthorization_ValidatorsAmino { - address: string[]; + address?: string[]; } export interface StakeAuthorization_ValidatorsAminoMsg { type: "cosmos-sdk/Validators"; @@ -147,7 +147,8 @@ function createBaseStakeAuthorization(): StakeAuthorization { }; } export const StakeAuthorization = { - encode(message: StakeAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", + encode(message: StakeAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxTokens !== undefined) { Coin.encode(message.maxTokens, writer.uint32(10).fork()).ldelim(); } @@ -162,8 +163,8 @@ export const StakeAuthorization = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StakeAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStakeAuthorization(); while (reader.pos < end) { @@ -193,7 +194,7 @@ export const StakeAuthorization = { maxTokens: isSet(object.maxTokens) ? Coin.fromJSON(object.maxTokens) : undefined, allowList: isSet(object.allowList) ? StakeAuthorization_Validators.fromJSON(object.allowList) : undefined, denyList: isSet(object.denyList) ? StakeAuthorization_Validators.fromJSON(object.denyList) : undefined, - authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : 0 + authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : -1 }; }, toJSON(message: StakeAuthorization): unknown { @@ -213,19 +214,27 @@ export const StakeAuthorization = { return message; }, fromAmino(object: StakeAuthorizationAmino): StakeAuthorization { - return { - maxTokens: object?.max_tokens ? Coin.fromAmino(object.max_tokens) : undefined, - allowList: object?.allow_list ? StakeAuthorization_Validators.fromAmino(object.allow_list) : undefined, - denyList: object?.deny_list ? StakeAuthorization_Validators.fromAmino(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 - }; + const message = createBaseStakeAuthorization(); + if (object.max_tokens !== undefined && object.max_tokens !== null) { + message.maxTokens = Coin.fromAmino(object.max_tokens); + } + if (object.allow_list !== undefined && object.allow_list !== null) { + message.allowList = StakeAuthorization_Validators.fromAmino(object.allow_list); + } + if (object.deny_list !== undefined && object.deny_list !== null) { + message.denyList = StakeAuthorization_Validators.fromAmino(object.deny_list); + } + if (object.authorization_type !== undefined && object.authorization_type !== null) { + message.authorizationType = object.authorization_type; + } + return message; }, toAmino(message: StakeAuthorization): StakeAuthorizationAmino { const obj: any = {}; obj.max_tokens = message.maxTokens ? Coin.toAmino(message.maxTokens) : undefined; obj.allow_list = message.allowList ? StakeAuthorization_Validators.toAmino(message.allowList) : undefined; obj.deny_list = message.denyList ? StakeAuthorization_Validators.toAmino(message.denyList) : undefined; - obj.authorization_type = message.authorizationType; + obj.authorization_type = message.authorizationType === 0 ? undefined : message.authorizationType; return obj; }, fromAminoMsg(object: StakeAuthorizationAminoMsg): StakeAuthorization { @@ -256,14 +265,15 @@ function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validator }; } export const StakeAuthorization_Validators = { - encode(message: StakeAuthorization_Validators, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Validators", + encode(message: StakeAuthorization_Validators, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.address) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization_Validators { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StakeAuthorization_Validators { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStakeAuthorization_Validators(); while (reader.pos < end) { @@ -299,16 +309,16 @@ export const StakeAuthorization_Validators = { return message; }, fromAmino(object: StakeAuthorization_ValidatorsAmino): StakeAuthorization_Validators { - return { - address: Array.isArray(object?.address) ? object.address.map((e: any) => e) : [] - }; + const message = createBaseStakeAuthorization_Validators(); + message.address = object.address?.map(e => e) || []; + return message; }, toAmino(message: StakeAuthorization_Validators): StakeAuthorization_ValidatorsAmino { const obj: any = {}; if (message.address) { obj.address = message.address.map(e => e); } else { - obj.address = []; + obj.address = message.address; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/genesis.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/genesis.ts index 504c4eef..6f70bb3f 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/genesis.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/genesis.ts @@ -1,6 +1,6 @@ import { Params, ParamsAmino, ParamsSDKType, Validator, ValidatorAmino, ValidatorSDKType, Delegation, DelegationAmino, DelegationSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, Redelegation, RedelegationAmino, RedelegationSDKType } from "./staking"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { /** params defines all the paramaters of related to deposit. */ @@ -37,21 +37,21 @@ export interface GenesisStateAmino { * last_total_power tracks the total amounts of bonded tokens recorded during * the previous end block. */ - last_total_power: Uint8Array; + last_total_power?: string; /** * last_validator_powers is a special index that provides a historical list * of the last-block's bonded validators. */ - last_validator_powers: LastValidatorPowerAmino[]; + last_validator_powers?: LastValidatorPowerAmino[]; /** delegations defines the validator set at genesis. */ - validators: ValidatorAmino[]; + validators?: ValidatorAmino[]; /** delegations defines the delegations active at genesis. */ - delegations: DelegationAmino[]; + delegations?: DelegationAmino[]; /** unbonding_delegations defines the unbonding delegations active at genesis. */ - unbonding_delegations: UnbondingDelegationAmino[]; + unbonding_delegations?: UnbondingDelegationAmino[]; /** redelegations defines the redelegations active at genesis. */ - redelegations: RedelegationAmino[]; - exported: boolean; + redelegations?: RedelegationAmino[]; + exported?: boolean; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -73,7 +73,7 @@ export interface LastValidatorPower { /** address is the address of the validator. */ address: string; /** power defines the power of the validator. */ - power: Long; + power: bigint; } export interface LastValidatorPowerProtoMsg { typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower"; @@ -82,9 +82,9 @@ export interface LastValidatorPowerProtoMsg { /** LastValidatorPower required for validator set update logic. */ export interface LastValidatorPowerAmino { /** address is the address of the validator. */ - address: string; + address?: string; /** power defines the power of the validator. */ - power: string; + power?: string; } export interface LastValidatorPowerAminoMsg { type: "cosmos-sdk/LastValidatorPower"; @@ -93,7 +93,7 @@ export interface LastValidatorPowerAminoMsg { /** LastValidatorPower required for validator set update logic. */ export interface LastValidatorPowerSDKType { address: string; - power: Long; + power: bigint; } function createBaseGenesisState(): GenesisState { return { @@ -108,7 +108,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -135,8 +136,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -230,47 +231,53 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - lastTotalPower: object.last_total_power, - lastValidatorPowers: Array.isArray(object?.last_validator_powers) ? object.last_validator_powers.map((e: any) => LastValidatorPower.fromAmino(e)) : [], - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - delegations: Array.isArray(object?.delegations) ? object.delegations.map((e: any) => Delegation.fromAmino(e)) : [], - unbondingDelegations: Array.isArray(object?.unbonding_delegations) ? object.unbonding_delegations.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - redelegations: Array.isArray(object?.redelegations) ? object.redelegations.map((e: any) => Redelegation.fromAmino(e)) : [], - exported: object.exported - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.last_total_power !== undefined && object.last_total_power !== null) { + message.lastTotalPower = bytesFromBase64(object.last_total_power); + } + message.lastValidatorPowers = object.last_validator_powers?.map(e => LastValidatorPower.fromAmino(e)) || []; + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + message.delegations = object.delegations?.map(e => Delegation.fromAmino(e)) || []; + message.unbondingDelegations = object.unbonding_delegations?.map(e => UnbondingDelegation.fromAmino(e)) || []; + message.redelegations = object.redelegations?.map(e => Redelegation.fromAmino(e)) || []; + if (object.exported !== undefined && object.exported !== null) { + message.exported = object.exported; + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.last_total_power = message.lastTotalPower; + obj.last_total_power = message.lastTotalPower ? base64FromBytes(message.lastTotalPower) : undefined; if (message.lastValidatorPowers) { obj.last_validator_powers = message.lastValidatorPowers.map(e => e ? LastValidatorPower.toAmino(e) : undefined); } else { - obj.last_validator_powers = []; + obj.last_validator_powers = message.lastValidatorPowers; } if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } if (message.delegations) { obj.delegations = message.delegations.map(e => e ? Delegation.toAmino(e) : undefined); } else { - obj.delegations = []; + obj.delegations = message.delegations; } if (message.unbondingDelegations) { obj.unbonding_delegations = message.unbondingDelegations.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); } else { - obj.unbonding_delegations = []; + obj.unbonding_delegations = message.unbondingDelegations; } if (message.redelegations) { obj.redelegations = message.redelegations.map(e => e ? Redelegation.toAmino(e) : undefined); } else { - obj.redelegations = []; + obj.redelegations = message.redelegations; } - obj.exported = message.exported; + obj.exported = message.exported === false ? undefined : message.exported; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -298,21 +305,22 @@ export const GenesisState = { function createBaseLastValidatorPower(): LastValidatorPower { return { address: "", - power: Long.ZERO + power: BigInt(0) }; } export const LastValidatorPower = { - encode(message: LastValidatorPower, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower", + encode(message: LastValidatorPower, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(16).int64(message.power); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LastValidatorPower { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LastValidatorPower { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLastValidatorPower(); while (reader.pos < end) { @@ -322,7 +330,7 @@ export const LastValidatorPower = { message.address = reader.string(); break; case 2: - message.power = (reader.int64() as Long); + message.power = reader.int64(); break; default: reader.skipType(tag & 7); @@ -334,31 +342,35 @@ export const LastValidatorPower = { fromJSON(object: any): LastValidatorPower { return { address: isSet(object.address) ? String(object.address) : "", - power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO + power: isSet(object.power) ? BigInt(object.power.toString()) : BigInt(0) }; }, toJSON(message: LastValidatorPower): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): LastValidatorPower { const message = createBaseLastValidatorPower(); message.address = object.address ?? ""; - message.power = object.power !== undefined && object.power !== null ? Long.fromValue(object.power) : Long.ZERO; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); return message; }, fromAmino(object: LastValidatorPowerAmino): LastValidatorPower { - return { - address: object.address, - power: Long.fromString(object.power) - }; + const message = createBaseLastValidatorPower(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: LastValidatorPower): LastValidatorPowerAmino { const obj: any = {}; - obj.address = message.address; - obj.power = message.power ? message.power.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; return obj; }, fromAminoMsg(object: LastValidatorPowerAminoMsg): LastValidatorPower { diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/query.lcd.ts index 8d97edff..4ba0b022 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryValidatorsRequest, QueryValidatorsResponseSDKType, QueryValidatorRequest, QueryValidatorResponseSDKType, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponseSDKType, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponseSDKType, QueryDelegationRequest, QueryDelegationResponseSDKType, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponseSDKType, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponseSDKType, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponseSDKType, QueryRedelegationsRequest, QueryRedelegationsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponseSDKType, QueryHistoricalInfoRequest, QueryHistoricalInfoResponseSDKType, QueryPoolRequest, QueryPoolResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts index 40cb0390..1a204ce8 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -67,72 +67,72 @@ export class QueryClientImpl implements Query { validators(request: QueryValidatorsRequest): Promise { const data = QueryValidatorsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validators", data); - return promise.then(data => QueryValidatorsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryValidatorsResponse.decode(new BinaryReader(data))); } validator(request: QueryValidatorRequest): Promise { const data = QueryValidatorRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validator", data); - return promise.then(data => QueryValidatorResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryValidatorResponse.decode(new BinaryReader(data))); } validatorDelegations(request: QueryValidatorDelegationsRequest): Promise { const data = QueryValidatorDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorDelegations", data); - return promise.then(data => QueryValidatorDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryValidatorDelegationsResponse.decode(new BinaryReader(data))); } validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise { const data = QueryValidatorUnbondingDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorUnbondingDelegations", data); - return promise.then(data => QueryValidatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryValidatorUnbondingDelegationsResponse.decode(new BinaryReader(data))); } delegation(request: QueryDelegationRequest): Promise { const data = QueryDelegationRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Delegation", data); - return promise.then(data => QueryDelegationResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegationResponse.decode(new BinaryReader(data))); } unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { const data = QueryUnbondingDelegationRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "UnbondingDelegation", data); - return promise.then(data => QueryUnbondingDelegationResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryUnbondingDelegationResponse.decode(new BinaryReader(data))); } delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise { const data = QueryDelegatorDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorDelegations", data); - return promise.then(data => QueryDelegatorDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegatorDelegationsResponse.decode(new BinaryReader(data))); } delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise { const data = QueryDelegatorUnbondingDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorUnbondingDelegations", data); - return promise.then(data => QueryDelegatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegatorUnbondingDelegationsResponse.decode(new BinaryReader(data))); } redelegations(request: QueryRedelegationsRequest): Promise { const data = QueryRedelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Redelegations", data); - return promise.then(data => QueryRedelegationsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryRedelegationsResponse.decode(new BinaryReader(data))); } delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { const data = QueryDelegatorValidatorsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidators", data); - return promise.then(data => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegatorValidatorsResponse.decode(new BinaryReader(data))); } delegatorValidator(request: QueryDelegatorValidatorRequest): Promise { const data = QueryDelegatorValidatorRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidator", data); - return promise.then(data => QueryDelegatorValidatorResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDelegatorValidatorResponse.decode(new BinaryReader(data))); } historicalInfo(request: QueryHistoricalInfoRequest): Promise { const data = QueryHistoricalInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "HistoricalInfo", data); - return promise.then(data => QueryHistoricalInfoResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryHistoricalInfoResponse.decode(new BinaryReader(data))); } pool(request: QueryPoolRequest = {}): Promise { const data = QueryPoolRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Pool", data); - return promise.then(data => QueryPoolResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryPoolResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/query.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/query.ts index d2c9156e..e8bc5cde 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/query.ts @@ -1,13 +1,13 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Validator, ValidatorAmino, ValidatorSDKType, DelegationResponse, DelegationResponseAmino, DelegationResponseSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, RedelegationResponse, RedelegationResponseAmino, RedelegationResponseSDKType, HistoricalInfo, HistoricalInfoAmino, HistoricalInfoSDKType, Pool, PoolAmino, PoolSDKType, Params, ParamsAmino, ParamsSDKType } from "./staking"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequest { /** status enables to query for validators matching a given status. */ status: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; @@ -16,7 +16,7 @@ export interface QueryValidatorsRequestProtoMsg { /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestAmino { /** status enables to query for validators matching a given status. */ - status: string; + status?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -27,14 +27,14 @@ export interface QueryValidatorsRequestAminoMsg { /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestSDKType { status: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponse { /** validators contains all the queried validators. */ validators: Validator[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; @@ -43,7 +43,7 @@ export interface QueryValidatorsResponseProtoMsg { /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponseAmino { /** validators contains all the queried validators. */ - validators: ValidatorAmino[]; + validators?: ValidatorAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -54,7 +54,7 @@ export interface QueryValidatorsResponseAminoMsg { /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponseSDKType { validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequest { @@ -68,7 +68,7 @@ export interface QueryValidatorRequestProtoMsg { /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryValidatorRequestAminoMsg { type: "cosmos-sdk/QueryValidatorRequest"; @@ -108,7 +108,7 @@ export interface QueryValidatorDelegationsRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; @@ -120,7 +120,7 @@ export interface QueryValidatorDelegationsRequestProtoMsg { */ export interface QueryValidatorDelegationsRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -134,7 +134,7 @@ export interface QueryValidatorDelegationsRequestAminoMsg { */ export interface QueryValidatorDelegationsRequestSDKType { validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorDelegationsResponse is response type for the @@ -143,7 +143,7 @@ export interface QueryValidatorDelegationsRequestSDKType { export interface QueryValidatorDelegationsResponse { delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; @@ -154,7 +154,7 @@ export interface QueryValidatorDelegationsResponseProtoMsg { * Query/ValidatorDelegations RPC method */ export interface QueryValidatorDelegationsResponseAmino { - delegation_responses: DelegationResponseAmino[]; + delegation_responses?: DelegationResponseAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -168,7 +168,7 @@ export interface QueryValidatorDelegationsResponseAminoMsg { */ export interface QueryValidatorDelegationsResponseSDKType { delegation_responses: DelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryValidatorUnbondingDelegationsRequest is required type for the @@ -178,7 +178,7 @@ export interface QueryValidatorUnbondingDelegationsRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; @@ -190,7 +190,7 @@ export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { */ export interface QueryValidatorUnbondingDelegationsRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -204,7 +204,7 @@ export interface QueryValidatorUnbondingDelegationsRequestAminoMsg { */ export interface QueryValidatorUnbondingDelegationsRequestSDKType { validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorUnbondingDelegationsResponse is response type for the @@ -213,7 +213,7 @@ export interface QueryValidatorUnbondingDelegationsRequestSDKType { export interface QueryValidatorUnbondingDelegationsResponse { unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; @@ -224,7 +224,7 @@ export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { * Query/ValidatorUnbondingDelegations RPC method. */ export interface QueryValidatorUnbondingDelegationsResponseAmino { - unbonding_responses: UnbondingDelegationAmino[]; + unbonding_responses?: UnbondingDelegationAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -238,7 +238,7 @@ export interface QueryValidatorUnbondingDelegationsResponseAminoMsg { */ export interface QueryValidatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequest { @@ -254,9 +254,9 @@ export interface QueryDelegationRequestProtoMsg { /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryDelegationRequestAminoMsg { type: "cosmos-sdk/QueryDelegationRequest"; @@ -270,7 +270,7 @@ export interface QueryDelegationRequestSDKType { /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponse { /** delegation_responses defines the delegation info of a delegation. */ - delegationResponse: DelegationResponse; + delegationResponse?: DelegationResponse; } export interface QueryDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; @@ -287,7 +287,7 @@ export interface QueryDelegationResponseAminoMsg { } /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponseSDKType { - delegation_response: DelegationResponseSDKType; + delegation_response?: DelegationResponseSDKType; } /** * QueryUnbondingDelegationRequest is request type for the @@ -309,9 +309,9 @@ export interface QueryUnbondingDelegationRequestProtoMsg { */ export interface QueryUnbondingDelegationRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryUnbondingDelegationRequestAminoMsg { type: "cosmos-sdk/QueryUnbondingDelegationRequest"; @@ -364,7 +364,7 @@ export interface QueryDelegatorDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; @@ -376,7 +376,7 @@ export interface QueryDelegatorDelegationsRequestProtoMsg { */ export interface QueryDelegatorDelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -390,7 +390,7 @@ export interface QueryDelegatorDelegationsRequestAminoMsg { */ export interface QueryDelegatorDelegationsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDelegatorDelegationsResponse is response type for the @@ -400,7 +400,7 @@ export interface QueryDelegatorDelegationsResponse { /** delegation_responses defines all the delegations' info of a delegator. */ delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; @@ -412,7 +412,7 @@ export interface QueryDelegatorDelegationsResponseProtoMsg { */ export interface QueryDelegatorDelegationsResponseAmino { /** delegation_responses defines all the delegations' info of a delegator. */ - delegation_responses: DelegationResponseAmino[]; + delegation_responses?: DelegationResponseAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -426,7 +426,7 @@ export interface QueryDelegatorDelegationsResponseAminoMsg { */ export interface QueryDelegatorDelegationsResponseSDKType { delegation_responses: DelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorUnbondingDelegationsRequest is request type for the @@ -436,7 +436,7 @@ export interface QueryDelegatorUnbondingDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; @@ -448,7 +448,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { */ export interface QueryDelegatorUnbondingDelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -462,7 +462,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestAminoMsg { */ export interface QueryDelegatorUnbondingDelegationsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryUnbondingDelegatorDelegationsResponse is response type for the @@ -471,7 +471,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestSDKType { export interface QueryDelegatorUnbondingDelegationsResponse { unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; @@ -482,7 +482,7 @@ export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { * Query/UnbondingDelegatorDelegations RPC method. */ export interface QueryDelegatorUnbondingDelegationsResponseAmino { - unbonding_responses: UnbondingDelegationAmino[]; + unbonding_responses?: UnbondingDelegationAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -496,7 +496,7 @@ export interface QueryDelegatorUnbondingDelegationsResponseAminoMsg { */ export interface QueryDelegatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryRedelegationsRequest is request type for the Query/Redelegations RPC @@ -510,7 +510,7 @@ export interface QueryRedelegationsRequest { /** dst_validator_addr defines the validator address to redelegate to. */ dstValidatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryRedelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; @@ -522,11 +522,11 @@ export interface QueryRedelegationsRequestProtoMsg { */ export interface QueryRedelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** src_validator_addr defines the validator address to redelegate from. */ - src_validator_addr: string; + src_validator_addr?: string; /** dst_validator_addr defines the validator address to redelegate to. */ - dst_validator_addr: string; + dst_validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -542,7 +542,7 @@ export interface QueryRedelegationsRequestSDKType { delegator_addr: string; src_validator_addr: string; dst_validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryRedelegationsResponse is response type for the Query/Redelegations RPC @@ -551,7 +551,7 @@ export interface QueryRedelegationsRequestSDKType { export interface QueryRedelegationsResponse { redelegationResponses: RedelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryRedelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; @@ -562,7 +562,7 @@ export interface QueryRedelegationsResponseProtoMsg { * method. */ export interface QueryRedelegationsResponseAmino { - redelegation_responses: RedelegationResponseAmino[]; + redelegation_responses?: RedelegationResponseAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -576,7 +576,7 @@ export interface QueryRedelegationsResponseAminoMsg { */ export interface QueryRedelegationsResponseSDKType { redelegation_responses: RedelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorValidatorsRequest is request type for the @@ -586,7 +586,7 @@ export interface QueryDelegatorValidatorsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; @@ -598,7 +598,7 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { */ export interface QueryDelegatorValidatorsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -612,7 +612,7 @@ export interface QueryDelegatorValidatorsRequestAminoMsg { */ export interface QueryDelegatorValidatorsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDelegatorValidatorsResponse is response type for the @@ -622,7 +622,7 @@ export interface QueryDelegatorValidatorsResponse { /** validators defines the validators' info of a delegator. */ validators: Validator[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; @@ -634,7 +634,7 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { */ export interface QueryDelegatorValidatorsResponseAmino { /** validators defines the validators' info of a delegator. */ - validators: ValidatorAmino[]; + validators?: ValidatorAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -648,7 +648,7 @@ export interface QueryDelegatorValidatorsResponseAminoMsg { */ export interface QueryDelegatorValidatorsResponseSDKType { validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorValidatorRequest is request type for the @@ -670,9 +670,9 @@ export interface QueryDelegatorValidatorRequestProtoMsg { */ export interface QueryDelegatorValidatorRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryDelegatorValidatorRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorRequest"; @@ -723,7 +723,7 @@ export interface QueryDelegatorValidatorResponseSDKType { */ export interface QueryHistoricalInfoRequest { /** height defines at which height to query the historical info. */ - height: Long; + height: bigint; } export interface QueryHistoricalInfoRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest"; @@ -735,7 +735,7 @@ export interface QueryHistoricalInfoRequestProtoMsg { */ export interface QueryHistoricalInfoRequestAmino { /** height defines at which height to query the historical info. */ - height: string; + height?: string; } export interface QueryHistoricalInfoRequestAminoMsg { type: "cosmos-sdk/QueryHistoricalInfoRequest"; @@ -746,7 +746,7 @@ export interface QueryHistoricalInfoRequestAminoMsg { * method. */ export interface QueryHistoricalInfoRequestSDKType { - height: Long; + height: bigint; } /** * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC @@ -754,7 +754,7 @@ export interface QueryHistoricalInfoRequestSDKType { */ export interface QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ - hist: HistoricalInfo; + hist?: HistoricalInfo; } export interface QueryHistoricalInfoResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; @@ -777,7 +777,7 @@ export interface QueryHistoricalInfoResponseAminoMsg { * method. */ export interface QueryHistoricalInfoResponseSDKType { - hist: HistoricalInfoSDKType; + hist?: HistoricalInfoSDKType; } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ export interface QueryPoolRequest {} @@ -854,11 +854,12 @@ export interface QueryParamsResponseSDKType { function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { return { status: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorsRequest = { - encode(message: QueryValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + encode(message: QueryValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== "") { writer.uint32(10).string(message.status); } @@ -867,8 +868,8 @@ export const QueryValidatorsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorsRequest(); while (reader.pos < end) { @@ -906,14 +907,18 @@ export const QueryValidatorsRequest = { return message; }, fromAmino(object: QueryValidatorsRequestAmino): QueryValidatorsRequest { - return { - status: object.status, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorsRequest): QueryValidatorsRequestAmino { const obj: any = {}; - obj.status = message.status; + obj.status = message.status === "" ? undefined : message.status; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -942,11 +947,12 @@ export const QueryValidatorsRequest = { function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { return { validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorsResponse = { - encode(message: QueryValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + encode(message: QueryValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -955,8 +961,8 @@ export const QueryValidatorsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorsResponse(); while (reader.pos < end) { @@ -998,17 +1004,19 @@ export const QueryValidatorsResponse = { return message; }, fromAmino(object: QueryValidatorsResponseAmino): QueryValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorsResponse): QueryValidatorsResponseAmino { const obj: any = {}; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1041,14 +1049,15 @@ function createBaseQueryValidatorRequest(): QueryValidatorRequest { }; } export const QueryValidatorRequest = { - encode(message: QueryValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + encode(message: QueryValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorRequest(); while (reader.pos < end) { @@ -1080,13 +1089,15 @@ export const QueryValidatorRequest = { return message; }, fromAmino(object: QueryValidatorRequestAmino): QueryValidatorRequest { - return { - validatorAddr: object.validator_addr - }; + const message = createBaseQueryValidatorRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryValidatorRequest): QueryValidatorRequestAmino { const obj: any = {}; - obj.validator_addr = message.validatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; return obj; }, fromAminoMsg(object: QueryValidatorRequestAminoMsg): QueryValidatorRequest { @@ -1117,14 +1128,15 @@ function createBaseQueryValidatorResponse(): QueryValidatorResponse { }; } export const QueryValidatorResponse = { - encode(message: QueryValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + encode(message: QueryValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorResponse(); while (reader.pos < end) { @@ -1156,9 +1168,11 @@ export const QueryValidatorResponse = { return message; }, fromAmino(object: QueryValidatorResponseAmino): QueryValidatorResponse { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined - }; + const message = createBaseQueryValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; }, toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { const obj: any = {}; @@ -1190,11 +1204,12 @@ export const QueryValidatorResponse = { function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { return { validatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorDelegationsRequest = { - encode(message: QueryValidatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + encode(message: QueryValidatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } @@ -1203,8 +1218,8 @@ export const QueryValidatorDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorDelegationsRequest(); while (reader.pos < end) { @@ -1242,14 +1257,18 @@ export const QueryValidatorDelegationsRequest = { return message; }, fromAmino(object: QueryValidatorDelegationsRequestAmino): QueryValidatorDelegationsRequest { - return { - validatorAddr: object.validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAmino { const obj: any = {}; - obj.validator_addr = message.validatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1278,11 +1297,12 @@ export const QueryValidatorDelegationsRequest = { function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { return { delegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorDelegationsResponse = { - encode(message: QueryValidatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + encode(message: QueryValidatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1291,8 +1311,8 @@ export const QueryValidatorDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorDelegationsResponse(); while (reader.pos < end) { @@ -1334,17 +1354,19 @@ export const QueryValidatorDelegationsResponse = { return message; }, fromAmino(object: QueryValidatorDelegationsResponseAmino): QueryValidatorDelegationsResponse { - return { - delegationResponses: Array.isArray(object?.delegation_responses) ? object.delegation_responses.map((e: any) => DelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAmino { const obj: any = {}; if (message.delegationResponses) { obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); } else { - obj.delegation_responses = []; + obj.delegation_responses = message.delegationResponses; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1374,11 +1396,12 @@ export const QueryValidatorDelegationsResponse = { function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { return { validatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorUnbondingDelegationsRequest = { - encode(message: QueryValidatorUnbondingDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + encode(message: QueryValidatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } @@ -1387,8 +1410,8 @@ export const QueryValidatorUnbondingDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorUnbondingDelegationsRequest(); while (reader.pos < end) { @@ -1426,14 +1449,18 @@ export const QueryValidatorUnbondingDelegationsRequest = { return message; }, fromAmino(object: QueryValidatorUnbondingDelegationsRequestAmino): QueryValidatorUnbondingDelegationsRequest { - return { - validatorAddr: object.validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAmino { const obj: any = {}; - obj.validator_addr = message.validatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1462,11 +1489,12 @@ export const QueryValidatorUnbondingDelegationsRequest = { function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { return { unbondingResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorUnbondingDelegationsResponse = { - encode(message: QueryValidatorUnbondingDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + encode(message: QueryValidatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1475,8 +1503,8 @@ export const QueryValidatorUnbondingDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorUnbondingDelegationsResponse(); while (reader.pos < end) { @@ -1518,17 +1546,19 @@ export const QueryValidatorUnbondingDelegationsResponse = { return message; }, fromAmino(object: QueryValidatorUnbondingDelegationsResponseAmino): QueryValidatorUnbondingDelegationsResponse { - return { - unbondingResponses: Array.isArray(object?.unbonding_responses) ? object.unbonding_responses.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAmino { const obj: any = {}; if (message.unbondingResponses) { obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); } else { - obj.unbonding_responses = []; + obj.unbonding_responses = message.unbondingResponses; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1562,7 +1592,8 @@ function createBaseQueryDelegationRequest(): QueryDelegationRequest { }; } export const QueryDelegationRequest = { - encode(message: QueryDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + encode(message: QueryDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1571,8 +1602,8 @@ export const QueryDelegationRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationRequest(); while (reader.pos < end) { @@ -1610,15 +1641,19 @@ export const QueryDelegationRequest = { return message; }, fromAmino(object: QueryDelegationRequestAmino): QueryDelegationRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryDelegationRequest): QueryDelegationRequestAmino { const obj: any = {}; - obj.delegator_addr = message.delegatorAddr; - obj.validator_addr = message.validatorAddr; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; return obj; }, fromAminoMsg(object: QueryDelegationRequestAminoMsg): QueryDelegationRequest { @@ -1645,18 +1680,19 @@ export const QueryDelegationRequest = { }; function createBaseQueryDelegationResponse(): QueryDelegationResponse { return { - delegationResponse: DelegationResponse.fromPartial({}) + delegationResponse: undefined }; } export const QueryDelegationResponse = { - encode(message: QueryDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + encode(message: QueryDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegationResponse !== undefined) { DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationResponse(); while (reader.pos < end) { @@ -1688,9 +1724,11 @@ export const QueryDelegationResponse = { return message; }, fromAmino(object: QueryDelegationResponseAmino): QueryDelegationResponse { - return { - delegationResponse: object?.delegation_response ? DelegationResponse.fromAmino(object.delegation_response) : undefined - }; + const message = createBaseQueryDelegationResponse(); + if (object.delegation_response !== undefined && object.delegation_response !== null) { + message.delegationResponse = DelegationResponse.fromAmino(object.delegation_response); + } + return message; }, toAmino(message: QueryDelegationResponse): QueryDelegationResponseAmino { const obj: any = {}; @@ -1726,7 +1764,8 @@ function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRe }; } export const QueryUnbondingDelegationRequest = { - encode(message: QueryUnbondingDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + encode(message: QueryUnbondingDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1735,8 +1774,8 @@ export const QueryUnbondingDelegationRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingDelegationRequest(); while (reader.pos < end) { @@ -1774,15 +1813,19 @@ export const QueryUnbondingDelegationRequest = { return message; }, fromAmino(object: QueryUnbondingDelegationRequestAmino): QueryUnbondingDelegationRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryUnbondingDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAmino { const obj: any = {}; - obj.delegator_addr = message.delegatorAddr; - obj.validator_addr = message.validatorAddr; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; return obj; }, fromAminoMsg(object: QueryUnbondingDelegationRequestAminoMsg): QueryUnbondingDelegationRequest { @@ -1813,14 +1856,15 @@ function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationR }; } export const QueryUnbondingDelegationResponse = { - encode(message: QueryUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + encode(message: QueryUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.unbond !== undefined) { UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingDelegationResponse(); while (reader.pos < end) { @@ -1852,9 +1896,11 @@ export const QueryUnbondingDelegationResponse = { return message; }, fromAmino(object: QueryUnbondingDelegationResponseAmino): QueryUnbondingDelegationResponse { - return { - unbond: object?.unbond ? UnbondingDelegation.fromAmino(object.unbond) : undefined - }; + const message = createBaseQueryUnbondingDelegationResponse(); + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromAmino(object.unbond); + } + return message; }, toAmino(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAmino { const obj: any = {}; @@ -1886,11 +1932,12 @@ export const QueryUnbondingDelegationResponse = { function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorDelegationsRequest = { - encode(message: QueryDelegatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + encode(message: QueryDelegatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1899,8 +1946,8 @@ export const QueryDelegatorDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorDelegationsRequest(); while (reader.pos < end) { @@ -1938,14 +1985,18 @@ export const QueryDelegatorDelegationsRequest = { return message; }, fromAmino(object: QueryDelegatorDelegationsRequestAmino): QueryDelegatorDelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAmino { const obj: any = {}; - obj.delegator_addr = message.delegatorAddr; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1974,11 +2025,12 @@ export const QueryDelegatorDelegationsRequest = { function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { return { delegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorDelegationsResponse = { - encode(message: QueryDelegatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + encode(message: QueryDelegatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1987,8 +2039,8 @@ export const QueryDelegatorDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorDelegationsResponse(); while (reader.pos < end) { @@ -2030,17 +2082,19 @@ export const QueryDelegatorDelegationsResponse = { return message; }, fromAmino(object: QueryDelegatorDelegationsResponseAmino): QueryDelegatorDelegationsResponse { - return { - delegationResponses: Array.isArray(object?.delegation_responses) ? object.delegation_responses.map((e: any) => DelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAmino { const obj: any = {}; if (message.delegationResponses) { obj.delegation_responses = message.delegationResponses.map(e => e ? DelegationResponse.toAmino(e) : undefined); } else { - obj.delegation_responses = []; + obj.delegation_responses = message.delegationResponses; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2070,11 +2124,12 @@ export const QueryDelegatorDelegationsResponse = { function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorUnbondingDelegationsRequest = { - encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -2083,8 +2138,8 @@ export const QueryDelegatorUnbondingDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); while (reader.pos < end) { @@ -2122,14 +2177,18 @@ export const QueryDelegatorUnbondingDelegationsRequest = { return message; }, fromAmino(object: QueryDelegatorUnbondingDelegationsRequestAmino): QueryDelegatorUnbondingDelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAmino { const obj: any = {}; - obj.delegator_addr = message.delegatorAddr; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2158,11 +2217,12 @@ export const QueryDelegatorUnbondingDelegationsRequest = { function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { return { unbondingResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorUnbondingDelegationsResponse = { - encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2171,8 +2231,8 @@ export const QueryDelegatorUnbondingDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); while (reader.pos < end) { @@ -2214,17 +2274,19 @@ export const QueryDelegatorUnbondingDelegationsResponse = { return message; }, fromAmino(object: QueryDelegatorUnbondingDelegationsResponseAmino): QueryDelegatorUnbondingDelegationsResponse { - return { - unbondingResponses: Array.isArray(object?.unbonding_responses) ? object.unbonding_responses.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAmino { const obj: any = {}; if (message.unbondingResponses) { obj.unbonding_responses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toAmino(e) : undefined); } else { - obj.unbonding_responses = []; + obj.unbonding_responses = message.unbondingResponses; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2256,11 +2318,12 @@ function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { delegatorAddr: "", srcValidatorAddr: "", dstValidatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryRedelegationsRequest = { - encode(message: QueryRedelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + encode(message: QueryRedelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -2275,8 +2338,8 @@ export const QueryRedelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryRedelegationsRequest(); while (reader.pos < end) { @@ -2326,18 +2389,26 @@ export const QueryRedelegationsRequest = { return message; }, fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - srcValidatorAddr: object.src_validator_addr, - dstValidatorAddr: object.dst_validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryRedelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.src_validator_addr !== undefined && object.src_validator_addr !== null) { + message.srcValidatorAddr = object.src_validator_addr; + } + if (object.dst_validator_addr !== undefined && object.dst_validator_addr !== null) { + message.dstValidatorAddr = object.dst_validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryRedelegationsRequest): QueryRedelegationsRequestAmino { const obj: any = {}; - obj.delegator_addr = message.delegatorAddr; - obj.src_validator_addr = message.srcValidatorAddr; - obj.dst_validator_addr = message.dstValidatorAddr; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.src_validator_addr = message.srcValidatorAddr === "" ? undefined : message.srcValidatorAddr; + obj.dst_validator_addr = message.dstValidatorAddr === "" ? undefined : message.dstValidatorAddr; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2366,11 +2437,12 @@ export const QueryRedelegationsRequest = { function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { return { redelegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryRedelegationsResponse = { - encode(message: QueryRedelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + encode(message: QueryRedelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.redelegationResponses) { RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2379,8 +2451,8 @@ export const QueryRedelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryRedelegationsResponse(); while (reader.pos < end) { @@ -2422,17 +2494,19 @@ export const QueryRedelegationsResponse = { return message; }, fromAmino(object: QueryRedelegationsResponseAmino): QueryRedelegationsResponse { - return { - redelegationResponses: Array.isArray(object?.redelegation_responses) ? object.redelegation_responses.map((e: any) => RedelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegation_responses?.map(e => RedelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryRedelegationsResponse): QueryRedelegationsResponseAmino { const obj: any = {}; if (message.redelegationResponses) { obj.redelegation_responses = message.redelegationResponses.map(e => e ? RedelegationResponse.toAmino(e) : undefined); } else { - obj.redelegation_responses = []; + obj.redelegation_responses = message.redelegationResponses; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2462,11 +2536,12 @@ export const QueryRedelegationsResponse = { function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorValidatorsRequest = { - encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -2475,8 +2550,8 @@ export const QueryDelegatorValidatorsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsRequest(); while (reader.pos < end) { @@ -2514,14 +2589,18 @@ export const QueryDelegatorValidatorsRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { const obj: any = {}; - obj.delegator_addr = message.delegatorAddr; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2550,11 +2629,12 @@ export const QueryDelegatorValidatorsRequest = { function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { return { validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorValidatorsResponse = { - encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2563,8 +2643,8 @@ export const QueryDelegatorValidatorsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsResponse(); while (reader.pos < end) { @@ -2606,17 +2686,19 @@ export const QueryDelegatorValidatorsResponse = { return message; }, fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { const obj: any = {}; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2650,7 +2732,8 @@ function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequ }; } export const QueryDelegatorValidatorRequest = { - encode(message: QueryDelegatorValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + encode(message: QueryDelegatorValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -2659,8 +2742,8 @@ export const QueryDelegatorValidatorRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorRequest(); while (reader.pos < end) { @@ -2698,15 +2781,19 @@ export const QueryDelegatorValidatorRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorRequestAmino): QueryDelegatorValidatorRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryDelegatorValidatorRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAmino { const obj: any = {}; - obj.delegator_addr = message.delegatorAddr; - obj.validator_addr = message.validatorAddr; + obj.delegator_addr = message.delegatorAddr === "" ? undefined : message.delegatorAddr; + obj.validator_addr = message.validatorAddr === "" ? undefined : message.validatorAddr; return obj; }, fromAminoMsg(object: QueryDelegatorValidatorRequestAminoMsg): QueryDelegatorValidatorRequest { @@ -2737,14 +2824,15 @@ function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorRes }; } export const QueryDelegatorValidatorResponse = { - encode(message: QueryDelegatorValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + encode(message: QueryDelegatorValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorResponse(); while (reader.pos < end) { @@ -2776,9 +2864,11 @@ export const QueryDelegatorValidatorResponse = { return message; }, fromAmino(object: QueryDelegatorValidatorResponseAmino): QueryDelegatorValidatorResponse { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined - }; + const message = createBaseQueryDelegatorValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; }, toAmino(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAmino { const obj: any = {}; @@ -2809,25 +2899,26 @@ export const QueryDelegatorValidatorResponse = { }; function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { return { - height: Long.ZERO + height: BigInt(0) }; } export const QueryHistoricalInfoRequest = { - encode(message: QueryHistoricalInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + encode(message: QueryHistoricalInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHistoricalInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -2838,27 +2929,29 @@ export const QueryHistoricalInfoRequest = { }, fromJSON(object: any): QueryHistoricalInfoRequest { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) }; }, toJSON(message: QueryHistoricalInfoRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryHistoricalInfoRequest { const message = createBaseQueryHistoricalInfoRequest(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: QueryHistoricalInfoRequestAmino): QueryHistoricalInfoRequest { - return { - height: Long.fromString(object.height) - }; + const message = createBaseQueryHistoricalInfoRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; return obj; }, fromAminoMsg(object: QueryHistoricalInfoRequestAminoMsg): QueryHistoricalInfoRequest { @@ -2885,18 +2978,19 @@ export const QueryHistoricalInfoRequest = { }; function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { return { - hist: HistoricalInfo.fromPartial({}) + hist: undefined }; } export const QueryHistoricalInfoResponse = { - encode(message: QueryHistoricalInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + encode(message: QueryHistoricalInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hist !== undefined) { HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHistoricalInfoResponse(); while (reader.pos < end) { @@ -2928,9 +3022,11 @@ export const QueryHistoricalInfoResponse = { return message; }, fromAmino(object: QueryHistoricalInfoResponseAmino): QueryHistoricalInfoResponse { - return { - hist: object?.hist ? HistoricalInfo.fromAmino(object.hist) : undefined - }; + const message = createBaseQueryHistoricalInfoResponse(); + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromAmino(object.hist); + } + return message; }, toAmino(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAmino { const obj: any = {}; @@ -2963,11 +3059,12 @@ function createBaseQueryPoolRequest(): QueryPoolRequest { return {}; } export const QueryPoolRequest = { - encode(_: QueryPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + encode(_: QueryPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPoolRequest(); while (reader.pos < end) { @@ -2992,7 +3089,8 @@ export const QueryPoolRequest = { return message; }, fromAmino(_: QueryPoolRequestAmino): QueryPoolRequest { - return {}; + const message = createBaseQueryPoolRequest(); + return message; }, toAmino(_: QueryPoolRequest): QueryPoolRequestAmino { const obj: any = {}; @@ -3026,14 +3124,15 @@ function createBaseQueryPoolResponse(): QueryPoolResponse { }; } export const QueryPoolResponse = { - encode(message: QueryPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + encode(message: QueryPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pool !== undefined) { Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPoolResponse(); while (reader.pos < end) { @@ -3065,9 +3164,11 @@ export const QueryPoolResponse = { return message; }, fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { - return { - pool: object?.pool ? Pool.fromAmino(object.pool) : undefined - }; + const message = createBaseQueryPoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromAmino(object.pool); + } + return message; }, toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { const obj: any = {}; @@ -3100,11 +3201,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -3129,7 +3231,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -3163,14 +3266,15 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -3202,9 +3306,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/staking.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/staking.ts index 893f4bd0..28c33660 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -1,12 +1,13 @@ import { Header, HeaderAmino, HeaderSDKType } from "../../../tendermint/types/types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -import { toBase64, fromBase64 } from "@cosmjs/encoding"; -import { encodeBech32Pubkey, decodeBech32Pubkey } from "@cosmjs/amino"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; +import { Decimal } from "@cosmjs/math"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { Pubkey } from "@cosmjs/amino"; /** BondStatus is the status of a validator. */ export enum BondStatus { /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ @@ -78,7 +79,7 @@ export interface HistoricalInfoProtoMsg { */ export interface HistoricalInfoAmino { header?: HeaderAmino; - valset: ValidatorAmino[]; + valset?: ValidatorAmino[]; } export interface HistoricalInfoAminoMsg { type: "cosmos-sdk/HistoricalInfo"; @@ -116,11 +117,11 @@ export interface CommissionRatesProtoMsg { */ export interface CommissionRatesAmino { /** rate is the commission rate charged to delegators, as a fraction. */ - rate: string; + rate?: string; /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ - max_rate: string; + max_rate?: string; /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate: string; + max_change_rate?: string; } export interface CommissionRatesAminoMsg { type: "cosmos-sdk/CommissionRates"; @@ -151,7 +152,7 @@ export interface CommissionAmino { /** commission_rates defines the initial commission rates to be used for creating a validator. */ commission_rates?: CommissionRatesAmino; /** update_time is the last time the commission rate was changed. */ - update_time?: TimestampAmino; + update_time?: string; } export interface CommissionAminoMsg { type: "cosmos-sdk/Commission"; @@ -182,15 +183,15 @@ export interface DescriptionProtoMsg { /** Description defines a validator description. */ export interface DescriptionAmino { /** moniker defines a human-readable name for the validator. */ - moniker: string; + moniker?: string; /** identity defines an optional identity signature (ex. UPort or Keybase). */ - identity: string; + identity?: string; /** website defines an optional website link. */ - website: string; + website?: string; /** security_contact defines an optional email for security contact. */ - security_contact: string; + security_contact?: string; /** details define other optional details. */ - details: string; + details?: string; } export interface DescriptionAminoMsg { type: "cosmos-sdk/Description"; @@ -218,7 +219,7 @@ export interface Validator { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ operatorAddress: string; /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensusPubkey: (Any) | undefined; + consensusPubkey?: (Any) | undefined; /** jailed defined whether the validator has been jailed from bonded status or not. */ jailed: boolean; /** status is the validator status (bonded/unbonding/unbonded). */ @@ -230,7 +231,7 @@ export interface Validator { /** description defines the description terms for the validator. */ description: Description; /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbondingHeight: Long; + unbondingHeight: bigint; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ unbondingTime: Timestamp; /** commission defines the commission parameters. */ @@ -261,23 +262,23 @@ export type ValidatorEncoded = Omit & { */ export interface ValidatorAmino { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operator_address: string; + operator_address?: string; /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ consensus_pubkey?: AnyAmino; /** jailed defined whether the validator has been jailed from bonded status or not. */ - jailed: boolean; + jailed?: boolean; /** status is the validator status (bonded/unbonding/unbonded). */ - status: BondStatus; + status?: BondStatus; /** tokens define the delegated tokens (incl. self-delegation). */ - tokens: string; + tokens?: string; /** delegator_shares defines total shares issued to a validator's delegators. */ - delegator_shares: string; + delegator_shares?: string; /** description defines the description terms for the validator. */ description?: DescriptionAmino; /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbonding_height: string; + unbonding_height?: string; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time?: TimestampAmino; + unbonding_time?: string; /** commission defines the commission parameters. */ commission?: CommissionAmino; /** @@ -285,7 +286,7 @@ export interface ValidatorAmino { * * Since: cosmos-sdk 0.46 */ - min_self_delegation: string; + min_self_delegation?: string; } export interface ValidatorAminoMsg { type: "cosmos-sdk/Validator"; @@ -303,13 +304,13 @@ export interface ValidatorAminoMsg { */ export interface ValidatorSDKType { operator_address: string; - consensus_pubkey: AnySDKType | undefined; + consensus_pubkey?: AnySDKType | undefined; jailed: boolean; status: BondStatus; tokens: string; delegator_shares: string; description: DescriptionSDKType; - unbonding_height: Long; + unbonding_height: bigint; unbonding_time: TimestampSDKType; commission: CommissionSDKType; min_self_delegation: string; @@ -324,7 +325,7 @@ export interface ValAddressesProtoMsg { } /** ValAddresses defines a repeated set of validator addresses. */ export interface ValAddressesAmino { - addresses: string[]; + addresses?: string[]; } export interface ValAddressesAminoMsg { type: "cosmos-sdk/ValAddresses"; @@ -353,8 +354,8 @@ export interface DVPairProtoMsg { * be used to construct the key to getting an UnbondingDelegation from state. */ export interface DVPairAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; } export interface DVPairAminoMsg { type: "cosmos-sdk/DVPair"; @@ -379,7 +380,7 @@ export interface DVPairsProtoMsg { } /** DVPairs defines an array of DVPair objects. */ export interface DVPairsAmino { - pairs: DVPairAmino[]; + pairs?: DVPairAmino[]; } export interface DVPairsAminoMsg { type: "cosmos-sdk/DVPairs"; @@ -411,9 +412,9 @@ export interface DVVTripletProtoMsg { * Redelegation from state. */ export interface DVVTripletAmino { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; } export interface DVVTripletAminoMsg { type: "cosmos-sdk/DVVTriplet"; @@ -440,7 +441,7 @@ export interface DVVTripletsProtoMsg { } /** DVVTriplets defines an array of DVVTriplet objects. */ export interface DVVTripletsAmino { - triplets: DVVTripletAmino[]; + triplets?: DVVTripletAmino[]; } export interface DVVTripletsAminoMsg { type: "cosmos-sdk/DVVTriplets"; @@ -474,11 +475,11 @@ export interface DelegationProtoMsg { */ export interface DelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validator_address?: string; /** shares define the delegation shares received. */ - shares: string; + shares?: string; } export interface DelegationAminoMsg { type: "cosmos-sdk/Delegation"; @@ -516,11 +517,11 @@ export interface UnbondingDelegationProtoMsg { */ export interface UnbondingDelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validator_address?: string; /** entries are the unbonding delegation entries. */ - entries: UnbondingDelegationEntryAmino[]; + entries?: UnbondingDelegationEntryAmino[]; } export interface UnbondingDelegationAminoMsg { type: "cosmos-sdk/UnbondingDelegation"; @@ -538,7 +539,7 @@ export interface UnbondingDelegationSDKType { /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntry { /** creation_height is the height which the unbonding took place. */ - creationHeight: Long; + creationHeight: bigint; /** completion_time is the unix time for unbonding completion. */ completionTime: Timestamp; /** initial_balance defines the tokens initially scheduled to receive at completion. */ @@ -553,13 +554,13 @@ export interface UnbondingDelegationEntryProtoMsg { /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntryAmino { /** creation_height is the height which the unbonding took place. */ - creation_height: string; + creation_height?: string; /** completion_time is the unix time for unbonding completion. */ - completion_time?: TimestampAmino; + completion_time?: string; /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initial_balance: string; + initial_balance?: string; /** balance defines the tokens to receive at completion. */ - balance: string; + balance?: string; } export interface UnbondingDelegationEntryAminoMsg { type: "cosmos-sdk/UnbondingDelegationEntry"; @@ -567,7 +568,7 @@ export interface UnbondingDelegationEntryAminoMsg { } /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntrySDKType { - creation_height: Long; + creation_height: bigint; completion_time: TimestampSDKType; initial_balance: string; balance: string; @@ -575,7 +576,7 @@ export interface UnbondingDelegationEntrySDKType { /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntry { /** creation_height defines the height which the redelegation took place. */ - creationHeight: Long; + creationHeight: bigint; /** completion_time defines the unix time for redelegation completion. */ completionTime: Timestamp; /** initial_balance defines the initial balance when redelegation started. */ @@ -590,13 +591,13 @@ export interface RedelegationEntryProtoMsg { /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntryAmino { /** creation_height defines the height which the redelegation took place. */ - creation_height: string; + creation_height?: string; /** completion_time defines the unix time for redelegation completion. */ - completion_time?: TimestampAmino; + completion_time?: string; /** initial_balance defines the initial balance when redelegation started. */ - initial_balance: string; + initial_balance?: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ - shares_dst: string; + shares_dst?: string; } export interface RedelegationEntryAminoMsg { type: "cosmos-sdk/RedelegationEntry"; @@ -604,7 +605,7 @@ export interface RedelegationEntryAminoMsg { } /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntrySDKType { - creation_height: Long; + creation_height: bigint; completion_time: TimestampSDKType; initial_balance: string; shares_dst: string; @@ -633,13 +634,13 @@ export interface RedelegationProtoMsg { */ export interface RedelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_src_address is the validator redelegation source operator address. */ - validator_src_address: string; + validator_src_address?: string; /** validator_dst_address is the validator redelegation destination operator address. */ - validator_dst_address: string; + validator_dst_address?: string; /** entries are the redelegation entries. */ - entries: RedelegationEntryAmino[]; + entries?: RedelegationEntryAmino[]; } export interface RedelegationAminoMsg { type: "cosmos-sdk/Redelegation"; @@ -679,15 +680,15 @@ export interface ParamsAmino { /** unbonding_time is the time duration of unbonding. */ unbonding_time?: DurationAmino; /** max_validators is the maximum number of validators. */ - max_validators: number; + max_validators?: number; /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ - max_entries: number; + max_entries?: number; /** historical_entries is the number of historical entries to persist. */ - historical_entries: number; + historical_entries?: number; /** bond_denom defines the bondable coin denomination. */ - bond_denom: string; + bond_denom?: string; /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ - min_commission_rate: string; + min_commission_rate?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -754,7 +755,7 @@ export interface RedelegationEntryResponseProtoMsg { */ export interface RedelegationEntryResponseAmino { redelegation_entry?: RedelegationEntryAmino; - balance: string; + balance?: string; } export interface RedelegationEntryResponseAminoMsg { type: "cosmos-sdk/RedelegationEntryResponse"; @@ -789,7 +790,7 @@ export interface RedelegationResponseProtoMsg { */ export interface RedelegationResponseAmino { redelegation?: RedelegationAmino; - entries: RedelegationEntryResponseAmino[]; + entries?: RedelegationEntryResponseAmino[]; } export interface RedelegationResponseAminoMsg { type: "cosmos-sdk/RedelegationResponse"; @@ -843,7 +844,8 @@ function createBaseHistoricalInfo(): HistoricalInfo { }; } export const HistoricalInfo = { - encode(message: HistoricalInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + encode(message: HistoricalInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -852,8 +854,8 @@ export const HistoricalInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HistoricalInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHistoricalInfo(); while (reader.pos < end) { @@ -895,10 +897,12 @@ export const HistoricalInfo = { return message; }, fromAmino(object: HistoricalInfoAmino): HistoricalInfo { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - valset: Array.isArray(object?.valset) ? object.valset.map((e: any) => Validator.fromAmino(e)) : [] - }; + const message = createBaseHistoricalInfo(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + message.valset = object.valset?.map(e => Validator.fromAmino(e)) || []; + return message; }, toAmino(message: HistoricalInfo): HistoricalInfoAmino { const obj: any = {}; @@ -906,7 +910,7 @@ export const HistoricalInfo = { if (message.valset) { obj.valset = message.valset.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.valset = []; + obj.valset = message.valset; } return obj; }, @@ -940,33 +944,34 @@ function createBaseCommissionRates(): CommissionRates { }; } export const CommissionRates = { - encode(message: CommissionRates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rate !== "") { - writer.uint32(10).string(message.rate); + writer.uint32(10).string(Decimal.fromUserInput(message.rate, 18).atomics); } if (message.maxRate !== "") { - writer.uint32(18).string(message.maxRate); + writer.uint32(18).string(Decimal.fromUserInput(message.maxRate, 18).atomics); } if (message.maxChangeRate !== "") { - writer.uint32(26).string(message.maxChangeRate); + writer.uint32(26).string(Decimal.fromUserInput(message.maxChangeRate, 18).atomics); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommissionRates { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommissionRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommissionRates(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rate = reader.string(); + message.rate = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 2: - message.maxRate = reader.string(); + message.maxRate = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 3: - message.maxChangeRate = reader.string(); + message.maxChangeRate = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -997,17 +1002,23 @@ export const CommissionRates = { return message; }, fromAmino(object: CommissionRatesAmino): CommissionRates { - return { - rate: object.rate, - maxRate: object.max_rate, - maxChangeRate: object.max_change_rate - }; + const message = createBaseCommissionRates(); + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.max_rate !== undefined && object.max_rate !== null) { + message.maxRate = object.max_rate; + } + if (object.max_change_rate !== undefined && object.max_change_rate !== null) { + message.maxChangeRate = object.max_change_rate; + } + return message; }, toAmino(message: CommissionRates): CommissionRatesAmino { const obj: any = {}; - obj.rate = message.rate; - obj.max_rate = message.maxRate; - obj.max_change_rate = message.maxChangeRate; + obj.rate = message.rate === "" ? undefined : message.rate; + obj.max_rate = message.maxRate === "" ? undefined : message.maxRate; + obj.max_change_rate = message.maxChangeRate === "" ? undefined : message.maxChangeRate; return obj; }, fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates { @@ -1035,11 +1046,12 @@ export const CommissionRates = { function createBaseCommission(): Commission { return { commissionRates: CommissionRates.fromPartial({}), - updateTime: undefined + updateTime: Timestamp.fromPartial({}) }; } export const Commission = { - encode(message: Commission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Commission", + encode(message: Commission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.commissionRates !== undefined) { CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); } @@ -1048,8 +1060,8 @@ export const Commission = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Commission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Commission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommission(); while (reader.pos < end) { @@ -1087,10 +1099,14 @@ export const Commission = { return message; }, fromAmino(object: CommissionAmino): Commission { - return { - commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined - }; + const message = createBaseCommission(); + if (object.commission_rates !== undefined && object.commission_rates !== null) { + message.commissionRates = CommissionRates.fromAmino(object.commission_rates); + } + if (object.update_time !== undefined && object.update_time !== null) { + message.updateTime = Timestamp.fromAmino(object.update_time); + } + return message; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; @@ -1130,7 +1146,8 @@ function createBaseDescription(): Description { }; } export const Description = { - encode(message: Description, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Description", + encode(message: Description, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moniker !== "") { writer.uint32(10).string(message.moniker); } @@ -1148,8 +1165,8 @@ export const Description = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Description { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Description { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescription(); while (reader.pos < end) { @@ -1205,21 +1222,31 @@ export const Description = { return message; }, fromAmino(object: DescriptionAmino): Description { - return { - moniker: object.moniker, - identity: object.identity, - website: object.website, - securityContact: object.security_contact, - details: object.details - }; + const message = createBaseDescription(); + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } + if (object.security_contact !== undefined && object.security_contact !== null) { + message.securityContact = object.security_contact; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } + return message; }, toAmino(message: Description): DescriptionAmino { const obj: any = {}; - obj.moniker = message.moniker; - obj.identity = message.identity; - obj.website = message.website; - obj.security_contact = message.securityContact; - obj.details = message.details; + obj.moniker = message.moniker === "" ? undefined : message.moniker; + obj.identity = message.identity === "" ? undefined : message.identity; + obj.website = message.website === "" ? undefined : message.website; + obj.security_contact = message.securityContact === "" ? undefined : message.securityContact; + obj.details = message.details === "" ? undefined : message.details; return obj; }, fromAminoMsg(object: DescriptionAminoMsg): Description { @@ -1253,14 +1280,15 @@ function createBaseValidator(): Validator { tokens: "", delegatorShares: "", description: Description.fromPartial({}), - unbondingHeight: Long.ZERO, - unbondingTime: undefined, + unbondingHeight: BigInt(0), + unbondingTime: Timestamp.fromPartial({}), commission: Commission.fromPartial({}), minSelfDelegation: "" }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.operatorAddress !== "") { writer.uint32(10).string(message.operatorAddress); } @@ -1277,12 +1305,12 @@ export const Validator = { writer.uint32(42).string(message.tokens); } if (message.delegatorShares !== "") { - writer.uint32(50).string(message.delegatorShares); + writer.uint32(50).string(Decimal.fromUserInput(message.delegatorShares, 18).atomics); } if (message.description !== undefined) { Description.encode(message.description, writer.uint32(58).fork()).ldelim(); } - if (!message.unbondingHeight.isZero()) { + if (message.unbondingHeight !== BigInt(0)) { writer.uint32(64).int64(message.unbondingHeight); } if (message.unbondingTime !== undefined) { @@ -1296,8 +1324,8 @@ export const Validator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -1319,13 +1347,13 @@ export const Validator = { message.tokens = reader.string(); break; case 6: - message.delegatorShares = reader.string(); + message.delegatorShares = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 7: message.description = Description.decode(reader, reader.uint32()); break; case 8: - message.unbondingHeight = (reader.int64() as Long); + message.unbondingHeight = reader.int64(); break; case 9: message.unbondingTime = Timestamp.decode(reader, reader.uint32()); @@ -1348,11 +1376,11 @@ export const Validator = { operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: isSet(object.tokens) ? String(object.tokens) : "", delegatorShares: isSet(object.delegatorShares) ? String(object.delegatorShares) : "", description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, - unbondingHeight: isSet(object.unbondingHeight) ? Long.fromValue(object.unbondingHeight) : Long.ZERO, + unbondingHeight: isSet(object.unbondingHeight) ? BigInt(object.unbondingHeight.toString()) : BigInt(0), unbondingTime: isSet(object.unbondingTime) ? fromJsonTimestamp(object.unbondingTime) : undefined, commission: isSet(object.commission) ? Commission.fromJSON(object.commission) : undefined, minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "" @@ -1367,7 +1395,7 @@ export const Validator = { message.tokens !== undefined && (obj.tokens = message.tokens); message.delegatorShares !== undefined && (obj.delegatorShares = message.delegatorShares); message.description !== undefined && (obj.description = message.description ? Description.toJSON(message.description) : undefined); - message.unbondingHeight !== undefined && (obj.unbondingHeight = (message.unbondingHeight || Long.ZERO).toString()); + message.unbondingHeight !== undefined && (obj.unbondingHeight = (message.unbondingHeight || BigInt(0)).toString()); message.unbondingTime !== undefined && (obj.unbondingTime = fromTimestamp(message.unbondingTime).toISOString()); message.commission !== undefined && (obj.commission = message.commission ? Commission.toJSON(message.commission) : undefined); message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); @@ -1382,46 +1410,62 @@ export const Validator = { message.tokens = object.tokens ?? ""; message.delegatorShares = object.delegatorShares ?? ""; message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; - message.unbondingHeight = object.unbondingHeight !== undefined && object.unbondingHeight !== null ? Long.fromValue(object.unbondingHeight) : Long.ZERO; + message.unbondingHeight = object.unbondingHeight !== undefined && object.unbondingHeight !== null ? BigInt(object.unbondingHeight.toString()) : BigInt(0); message.unbondingTime = object.unbondingTime !== undefined && object.unbondingTime !== null ? Timestamp.fromPartial(object.unbondingTime) : undefined; message.commission = object.commission !== undefined && object.commission !== null ? Commission.fromPartial(object.commission) : undefined; message.minSelfDelegation = object.minSelfDelegation ?? ""; return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - operatorAddress: object.operator_address, - consensusPubkey: { - typeUrl: "tendermint/PubKeySecp256k1", - value: object.consensus_pubkey?.value - }, - jailed: object.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, - tokens: object.tokens, - delegatorShares: object.delegator_shares, - description: object?.description ? Description.fromAmino(object.description) : undefined, - unbondingHeight: Long.fromString(object.unbonding_height), - unbondingTime: object?.unbonding_time ? Timestamp.fromAmino(object.unbonding_time) : undefined, - commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.consensus_pubkey !== undefined && object.consensus_pubkey !== null) { + message.consensusPubkey = encodePubkey(object.consensus_pubkey); + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } + if (object.delegator_shares !== undefined && object.delegator_shares !== null) { + message.delegatorShares = object.delegator_shares; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.unbonding_height !== undefined && object.unbonding_height !== null) { + message.unbondingHeight = BigInt(object.unbonding_height); + } + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = Timestamp.fromAmino(object.unbonding_time); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.operator_address = message.operatorAddress; - obj.consensus_pubkey = message.consensusPubkey ? { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: message.consensusPubkey.value - } : undefined; - obj.jailed = message.jailed; - obj.status = message.status; - obj.tokens = message.tokens; - obj.delegator_shares = message.delegatorShares; + obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress; + obj.consensus_pubkey = message.consensusPubkey ? decodePubkey(message.consensusPubkey) : undefined; + obj.jailed = message.jailed === false ? undefined : message.jailed; + obj.status = message.status === 0 ? undefined : message.status; + obj.tokens = message.tokens === "" ? undefined : message.tokens; + obj.delegator_shares = message.delegatorShares === "" ? undefined : message.delegatorShares; obj.description = message.description ? Description.toAmino(message.description) : undefined; - obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; + obj.unbonding_height = message.unbondingHeight !== BigInt(0) ? message.unbondingHeight.toString() : undefined; obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(message.unbondingTime) : undefined; obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; - obj.min_self_delegation = message.minSelfDelegation; + obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { @@ -1452,14 +1496,15 @@ function createBaseValAddresses(): ValAddresses { }; } export const ValAddresses = { - encode(message: ValAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + encode(message: ValAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.addresses) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValAddresses { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValAddresses(); while (reader.pos < end) { @@ -1495,16 +1540,16 @@ export const ValAddresses = { return message; }, fromAmino(object: ValAddressesAmino): ValAddresses { - return { - addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => e) : [] - }; + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; }, toAmino(message: ValAddresses): ValAddressesAmino { const obj: any = {}; if (message.addresses) { obj.addresses = message.addresses.map(e => e); } else { - obj.addresses = []; + obj.addresses = message.addresses; } return obj; }, @@ -1537,7 +1582,8 @@ function createBaseDVPair(): DVPair { }; } export const DVPair = { - encode(message: DVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.DVPair", + encode(message: DVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1546,8 +1592,8 @@ export const DVPair = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVPair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVPair(); while (reader.pos < end) { @@ -1585,15 +1631,19 @@ export const DVPair = { return message; }, fromAmino(object: DVPairAmino): DVPair { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseDVPair(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: DVPair): DVPairAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; return obj; }, fromAminoMsg(object: DVPairAminoMsg): DVPair { @@ -1624,14 +1674,15 @@ function createBaseDVPairs(): DVPairs { }; } export const DVPairs = { - encode(message: DVPairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.DVPairs", + encode(message: DVPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pairs) { DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVPairs { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVPairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVPairs(); while (reader.pos < end) { @@ -1667,16 +1718,16 @@ export const DVPairs = { return message; }, fromAmino(object: DVPairsAmino): DVPairs { - return { - pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => DVPair.fromAmino(e)) : [] - }; + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || []; + return message; }, toAmino(message: DVPairs): DVPairsAmino { const obj: any = {}; if (message.pairs) { obj.pairs = message.pairs.map(e => e ? DVPair.toAmino(e) : undefined); } else { - obj.pairs = []; + obj.pairs = message.pairs; } return obj; }, @@ -1710,7 +1761,8 @@ function createBaseDVVTriplet(): DVVTriplet { }; } export const DVVTriplet = { - encode(message: DVVTriplet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + encode(message: DVVTriplet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1722,8 +1774,8 @@ export const DVVTriplet = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVVTriplet(); while (reader.pos < end) { @@ -1767,17 +1819,23 @@ export const DVVTriplet = { return message; }, fromAmino(object: DVVTripletAmino): DVVTriplet { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address - }; + const message = createBaseDVVTriplet(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + return message; }, toAmino(message: DVVTriplet): DVVTripletAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_src_address = message.validatorSrcAddress; - obj.validator_dst_address = message.validatorDstAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress; + obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress; return obj; }, fromAminoMsg(object: DVVTripletAminoMsg): DVVTriplet { @@ -1808,14 +1866,15 @@ function createBaseDVVTriplets(): DVVTriplets { }; } export const DVVTriplets = { - encode(message: DVVTriplets, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + encode(message: DVVTriplets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.triplets) { DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplets { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVVTriplets(); while (reader.pos < end) { @@ -1851,16 +1910,16 @@ export const DVVTriplets = { return message; }, fromAmino(object: DVVTripletsAmino): DVVTriplets { - return { - triplets: Array.isArray(object?.triplets) ? object.triplets.map((e: any) => DVVTriplet.fromAmino(e)) : [] - }; + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || []; + return message; }, toAmino(message: DVVTriplets): DVVTripletsAmino { const obj: any = {}; if (message.triplets) { obj.triplets = message.triplets.map(e => e ? DVVTriplet.toAmino(e) : undefined); } else { - obj.triplets = []; + obj.triplets = message.triplets; } return obj; }, @@ -1894,7 +1953,8 @@ function createBaseDelegation(): Delegation { }; } export const Delegation = { - encode(message: Delegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Delegation", + encode(message: Delegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1902,12 +1962,12 @@ export const Delegation = { writer.uint32(18).string(message.validatorAddress); } if (message.shares !== "") { - writer.uint32(26).string(message.shares); + writer.uint32(26).string(Decimal.fromUserInput(message.shares, 18).atomics); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Delegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Delegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegation(); while (reader.pos < end) { @@ -1920,7 +1980,7 @@ export const Delegation = { message.validatorAddress = reader.string(); break; case 3: - message.shares = reader.string(); + message.shares = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -1951,17 +2011,23 @@ export const Delegation = { return message; }, fromAmino(object: DelegationAmino): Delegation { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - shares: object.shares - }; + const message = createBaseDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } + return message; }, toAmino(message: Delegation): DelegationAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; - obj.shares = message.shares; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.shares = message.shares === "" ? undefined : message.shares; return obj; }, fromAminoMsg(object: DelegationAminoMsg): Delegation { @@ -1994,7 +2060,8 @@ function createBaseUnbondingDelegation(): UnbondingDelegation { }; } export const UnbondingDelegation = { - encode(message: UnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + encode(message: UnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -2006,8 +2073,8 @@ export const UnbondingDelegation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnbondingDelegation(); while (reader.pos < end) { @@ -2055,20 +2122,24 @@ export const UnbondingDelegation = { return message; }, fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => UnbondingDelegationEntry.fromAmino(e)) : [] - }; + const message = createBaseUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || []; + return message; }, toAmino(message: UnbondingDelegation): UnbondingDelegationAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; if (message.entries) { obj.entries = message.entries.map(e => e ? UnbondingDelegationEntry.toAmino(e) : undefined); } else { - obj.entries = []; + obj.entries = message.entries; } return obj; }, @@ -2096,15 +2167,16 @@ export const UnbondingDelegation = { }; function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { return { - creationHeight: Long.ZERO, - completionTime: undefined, + creationHeight: BigInt(0), + completionTime: Timestamp.fromPartial({}), initialBalance: "", balance: "" }; } export const UnbondingDelegationEntry = { - encode(message: UnbondingDelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.creationHeight.isZero()) { + typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + encode(message: UnbondingDelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { writer.uint32(8).int64(message.creationHeight); } if (message.completionTime !== undefined) { @@ -2118,15 +2190,15 @@ export const UnbondingDelegationEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegationEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnbondingDelegationEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creationHeight = (reader.int64() as Long); + message.creationHeight = reader.int64(); break; case 2: message.completionTime = Timestamp.decode(reader, reader.uint32()); @@ -2146,7 +2218,7 @@ export const UnbondingDelegationEntry = { }, fromJSON(object: any): UnbondingDelegationEntry { return { - creationHeight: isSet(object.creationHeight) ? Long.fromValue(object.creationHeight) : Long.ZERO, + creationHeight: isSet(object.creationHeight) ? BigInt(object.creationHeight.toString()) : BigInt(0), completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined, initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", balance: isSet(object.balance) ? String(object.balance) : "" @@ -2154,7 +2226,7 @@ export const UnbondingDelegationEntry = { }, toJSON(message: UnbondingDelegationEntry): unknown { const obj: any = {}; - message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); message.completionTime !== undefined && (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); message.balance !== undefined && (obj.balance = message.balance); @@ -2162,26 +2234,34 @@ export const UnbondingDelegationEntry = { }, fromPartial(object: Partial): UnbondingDelegationEntry { const message = createBaseUnbondingDelegationEntry(); - message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? Long.fromValue(object.creationHeight) : Long.ZERO; + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); message.completionTime = object.completionTime !== undefined && object.completionTime !== null ? Timestamp.fromPartial(object.completionTime) : undefined; message.initialBalance = object.initialBalance ?? ""; message.balance = object.balance ?? ""; return message; }, fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { - return { - creationHeight: Long.fromString(object.creation_height), - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined, - initialBalance: object.initial_balance, - balance: object.balance - }; + const message = createBaseUnbondingDelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = Timestamp.fromAmino(object.completion_time); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; }, toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; - obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; + obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; - obj.initial_balance = message.initialBalance; - obj.balance = message.balance; + obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance; + obj.balance = message.balance === "" ? undefined : message.balance; return obj; }, fromAminoMsg(object: UnbondingDelegationEntryAminoMsg): UnbondingDelegationEntry { @@ -2208,15 +2288,16 @@ export const UnbondingDelegationEntry = { }; function createBaseRedelegationEntry(): RedelegationEntry { return { - creationHeight: Long.ZERO, - completionTime: undefined, + creationHeight: BigInt(0), + completionTime: Timestamp.fromPartial({}), initialBalance: "", sharesDst: "" }; } export const RedelegationEntry = { - encode(message: RedelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.creationHeight.isZero()) { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + encode(message: RedelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { writer.uint32(8).int64(message.creationHeight); } if (message.completionTime !== undefined) { @@ -2226,19 +2307,19 @@ export const RedelegationEntry = { writer.uint32(26).string(message.initialBalance); } if (message.sharesDst !== "") { - writer.uint32(34).string(message.sharesDst); + writer.uint32(34).string(Decimal.fromUserInput(message.sharesDst, 18).atomics); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegationEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creationHeight = (reader.int64() as Long); + message.creationHeight = reader.int64(); break; case 2: message.completionTime = Timestamp.decode(reader, reader.uint32()); @@ -2247,7 +2328,7 @@ export const RedelegationEntry = { message.initialBalance = reader.string(); break; case 4: - message.sharesDst = reader.string(); + message.sharesDst = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -2258,7 +2339,7 @@ export const RedelegationEntry = { }, fromJSON(object: any): RedelegationEntry { return { - creationHeight: isSet(object.creationHeight) ? Long.fromValue(object.creationHeight) : Long.ZERO, + creationHeight: isSet(object.creationHeight) ? BigInt(object.creationHeight.toString()) : BigInt(0), completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined, initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", sharesDst: isSet(object.sharesDst) ? String(object.sharesDst) : "" @@ -2266,7 +2347,7 @@ export const RedelegationEntry = { }, toJSON(message: RedelegationEntry): unknown { const obj: any = {}; - message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); message.completionTime !== undefined && (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst); @@ -2274,26 +2355,34 @@ export const RedelegationEntry = { }, fromPartial(object: Partial): RedelegationEntry { const message = createBaseRedelegationEntry(); - message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? Long.fromValue(object.creationHeight) : Long.ZERO; + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); message.completionTime = object.completionTime !== undefined && object.completionTime !== null ? Timestamp.fromPartial(object.completionTime) : undefined; message.initialBalance = object.initialBalance ?? ""; message.sharesDst = object.sharesDst ?? ""; return message; }, fromAmino(object: RedelegationEntryAmino): RedelegationEntry { - return { - creationHeight: Long.fromString(object.creation_height), - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined, - initialBalance: object.initial_balance, - sharesDst: object.shares_dst - }; + const message = createBaseRedelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = Timestamp.fromAmino(object.completion_time); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.shares_dst !== undefined && object.shares_dst !== null) { + message.sharesDst = object.shares_dst; + } + return message; }, toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; - obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; + obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; - obj.initial_balance = message.initialBalance; - obj.shares_dst = message.sharesDst; + obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance; + obj.shares_dst = message.sharesDst === "" ? undefined : message.sharesDst; return obj; }, fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { @@ -2327,7 +2416,8 @@ function createBaseRedelegation(): Redelegation { }; } export const Redelegation = { - encode(message: Redelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Redelegation", + encode(message: Redelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -2342,8 +2432,8 @@ export const Redelegation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Redelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Redelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegation(); while (reader.pos < end) { @@ -2397,22 +2487,28 @@ export const Redelegation = { return message; }, fromAmino(object: RedelegationAmino): Redelegation { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntry.fromAmino(e)) : [] - }; + const message = createBaseRedelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + message.entries = object.entries?.map(e => RedelegationEntry.fromAmino(e)) || []; + return message; }, toAmino(message: Redelegation): RedelegationAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_src_address = message.validatorSrcAddress; - obj.validator_dst_address = message.validatorDstAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress; + obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress; if (message.entries) { obj.entries = message.entries.map(e => e ? RedelegationEntry.toAmino(e) : undefined); } else { - obj.entries = []; + obj.entries = message.entries; } return obj; }, @@ -2440,7 +2536,7 @@ export const Redelegation = { }; function createBaseParams(): Params { return { - unbondingTime: undefined, + unbondingTime: Duration.fromPartial({}), maxValidators: 0, maxEntries: 0, historicalEntries: 0, @@ -2449,7 +2545,8 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.unbondingTime !== undefined) { Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); } @@ -2466,12 +2563,12 @@ export const Params = { writer.uint32(42).string(message.bondDenom); } if (message.minCommissionRate !== "") { - writer.uint32(50).string(message.minCommissionRate); + writer.uint32(50).string(Decimal.fromUserInput(message.minCommissionRate, 18).atomics); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -2493,7 +2590,7 @@ export const Params = { message.bondDenom = reader.string(); break; case 6: - message.minCommissionRate = reader.string(); + message.minCommissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -2533,23 +2630,35 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - unbondingTime: object?.unbonding_time ? Duration.fromAmino(object.unbonding_time) : undefined, - maxValidators: object.max_validators, - maxEntries: object.max_entries, - historicalEntries: object.historical_entries, - bondDenom: object.bond_denom, - minCommissionRate: object.min_commission_rate - }; + const message = createBaseParams(); + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = Duration.fromAmino(object.unbonding_time); + } + if (object.max_validators !== undefined && object.max_validators !== null) { + message.maxValidators = object.max_validators; + } + if (object.max_entries !== undefined && object.max_entries !== null) { + message.maxEntries = object.max_entries; + } + if (object.historical_entries !== undefined && object.historical_entries !== null) { + message.historicalEntries = object.historical_entries; + } + if (object.bond_denom !== undefined && object.bond_denom !== null) { + message.bondDenom = object.bond_denom; + } + if (object.min_commission_rate !== undefined && object.min_commission_rate !== null) { + message.minCommissionRate = object.min_commission_rate; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : undefined; - obj.max_validators = message.maxValidators; - obj.max_entries = message.maxEntries; - obj.historical_entries = message.historicalEntries; - obj.bond_denom = message.bondDenom; - obj.min_commission_rate = message.minCommissionRate; + obj.max_validators = message.maxValidators === 0 ? undefined : message.maxValidators; + obj.max_entries = message.maxEntries === 0 ? undefined : message.maxEntries; + obj.historical_entries = message.historicalEntries === 0 ? undefined : message.historicalEntries; + obj.bond_denom = message.bondDenom === "" ? undefined : message.bondDenom; + obj.min_commission_rate = message.minCommissionRate === "" ? undefined : message.minCommissionRate; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -2577,11 +2686,12 @@ export const Params = { function createBaseDelegationResponse(): DelegationResponse { return { delegation: Delegation.fromPartial({}), - balance: undefined + balance: Coin.fromPartial({}) }; } export const DelegationResponse = { - encode(message: DelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + encode(message: DelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegation !== undefined) { Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); } @@ -2590,8 +2700,8 @@ export const DelegationResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegationResponse(); while (reader.pos < end) { @@ -2629,10 +2739,14 @@ export const DelegationResponse = { return message; }, fromAmino(object: DelegationResponseAmino): DelegationResponse { - return { - delegation: object?.delegation ? Delegation.fromAmino(object.delegation) : undefined, - balance: object?.balance ? Coin.fromAmino(object.balance) : undefined - }; + const message = createBaseDelegationResponse(); + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromAmino(object.delegation); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; }, toAmino(message: DelegationResponse): DelegationResponseAmino { const obj: any = {}; @@ -2669,7 +2783,8 @@ function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { }; } export const RedelegationEntryResponse = { - encode(message: RedelegationEntryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + encode(message: RedelegationEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.redelegationEntry !== undefined) { RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); } @@ -2678,8 +2793,8 @@ export const RedelegationEntryResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegationEntryResponse(); while (reader.pos < end) { @@ -2717,15 +2832,19 @@ export const RedelegationEntryResponse = { return message; }, fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { - return { - redelegationEntry: object?.redelegation_entry ? RedelegationEntry.fromAmino(object.redelegation_entry) : undefined, - balance: object.balance - }; + const message = createBaseRedelegationEntryResponse(); + if (object.redelegation_entry !== undefined && object.redelegation_entry !== null) { + message.redelegationEntry = RedelegationEntry.fromAmino(object.redelegation_entry); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; }, toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { const obj: any = {}; obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : undefined; - obj.balance = message.balance; + obj.balance = message.balance === "" ? undefined : message.balance; return obj; }, fromAminoMsg(object: RedelegationEntryResponseAminoMsg): RedelegationEntryResponse { @@ -2757,7 +2876,8 @@ function createBaseRedelegationResponse(): RedelegationResponse { }; } export const RedelegationResponse = { - encode(message: RedelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + encode(message: RedelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.redelegation !== undefined) { Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); } @@ -2766,8 +2886,8 @@ export const RedelegationResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegationResponse(); while (reader.pos < end) { @@ -2809,10 +2929,12 @@ export const RedelegationResponse = { return message; }, fromAmino(object: RedelegationResponseAmino): RedelegationResponse { - return { - redelegation: object?.redelegation ? Redelegation.fromAmino(object.redelegation) : undefined, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntryResponse.fromAmino(e)) : [] - }; + const message = createBaseRedelegationResponse(); + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromAmino(object.redelegation); + } + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || []; + return message; }, toAmino(message: RedelegationResponse): RedelegationResponseAmino { const obj: any = {}; @@ -2820,7 +2942,7 @@ export const RedelegationResponse = { if (message.entries) { obj.entries = message.entries.map(e => e ? RedelegationEntryResponse.toAmino(e) : undefined); } else { - obj.entries = []; + obj.entries = message.entries; } return obj; }, @@ -2853,7 +2975,8 @@ function createBasePool(): Pool { }; } export const Pool = { - encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.Pool", + encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.notBondedTokens !== "") { writer.uint32(10).string(message.notBondedTokens); } @@ -2862,8 +2985,8 @@ export const Pool = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Pool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePool(); while (reader.pos < end) { @@ -2901,15 +3024,19 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - notBondedTokens: object.not_bonded_tokens, - bondedTokens: object.bonded_tokens - }; + const message = createBasePool(); + if (object.not_bonded_tokens !== undefined && object.not_bonded_tokens !== null) { + message.notBondedTokens = object.not_bonded_tokens; + } + if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { + message.bondedTokens = object.bonded_tokens; + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; - obj.not_bonded_tokens = message.notBondedTokens; - obj.bonded_tokens = message.bondedTokens; + obj.not_bonded_tokens = message.notBondedTokens ?? ""; + obj.bonded_tokens = message.bondedTokens ?? ""; return obj; }, fromAminoMsg(object: PoolAminoMsg): Pool { @@ -2934,23 +3061,17 @@ export const Pool = { }; } }; -export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: _m0.Reader | Uint8Array): Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { default: return data; } }; -export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => { - return encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(content.value) - }, "cosmos"); +export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino): Any => { + return encodePubkey(content); }; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => { - return { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: content.value - }; +export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { + return decodePubkey(content); }; \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts index 58d37da1..2325cd2c 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse } from "./tx"; /** Msg defines the staking Msg service. */ export interface Msg { @@ -44,31 +44,31 @@ export class MsgClientImpl implements Msg { createValidator(request: MsgCreateValidator): Promise { const data = MsgCreateValidator.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data); - return promise.then(data => MsgCreateValidatorResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateValidatorResponse.decode(new BinaryReader(data))); } editValidator(request: MsgEditValidator): Promise { const data = MsgEditValidator.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data); - return promise.then(data => MsgEditValidatorResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgEditValidatorResponse.decode(new BinaryReader(data))); } delegate(request: MsgDelegate): Promise { const data = MsgDelegate.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data); - return promise.then(data => MsgDelegateResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgDelegateResponse.decode(new BinaryReader(data))); } beginRedelegate(request: MsgBeginRedelegate): Promise { const data = MsgBeginRedelegate.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data); - return promise.then(data => MsgBeginRedelegateResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgBeginRedelegateResponse.decode(new BinaryReader(data))); } undelegate(request: MsgUndelegate): Promise { const data = MsgUndelegate.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); - return promise.then(data => MsgUndelegateResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUndelegateResponse.decode(new BinaryReader(data))); } cancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise { const data = MsgCancelUnbondingDelegation.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CancelUnbondingDelegation", data); - return promise.then(data => MsgCancelUnbondingDelegationResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCancelUnbondingDelegationResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/staking/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/staking/v1beta1/tx.ts index 18aeb804..a6064a44 100644 --- a/packages/api/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -1,11 +1,12 @@ import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType } from "./staking"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -import { toBase64, fromBase64 } from "@cosmjs/encoding"; -import { encodeBech32Pubkey, decodeBech32Pubkey } from "@cosmjs/amino"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { Decimal } from "@cosmjs/math"; +import { Pubkey } from "@cosmjs/amino"; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { description: Description; @@ -13,7 +14,7 @@ export interface MsgCreateValidator { minSelfDelegation: string; delegatorAddress: string; validatorAddress: string; - pubkey: (Any) | undefined; + pubkey?: (Any) | undefined; value: Coin; } export interface MsgCreateValidatorProtoMsg { @@ -27,9 +28,9 @@ export type MsgCreateValidatorEncoded = Omit & { export interface MsgCreateValidatorAmino { description?: DescriptionAmino; commission?: CommissionRatesAmino; - min_self_delegation: string; - delegator_address: string; - validator_address: string; + min_self_delegation?: string; + delegator_address?: string; + validator_address?: string; pubkey?: AnyAmino; value?: CoinAmino; } @@ -44,7 +45,7 @@ export interface MsgCreateValidatorSDKType { min_self_delegation: string; delegator_address: string; validator_address: string; - pubkey: AnySDKType | undefined; + pubkey?: AnySDKType | undefined; value: CoinSDKType; } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ @@ -81,15 +82,15 @@ export interface MsgEditValidatorProtoMsg { /** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidatorAmino { description?: DescriptionAmino; - validator_address: string; + validator_address?: string; /** * We pass a reference to the new commission rate and min self delegation as * it's not mandatory to update. If not updated, the deserialized rate will be * zero with no way to distinguish if an update was intended. * REF: #2373 */ - commission_rate: string; - min_self_delegation: string; + commission_rate?: string; + min_self_delegation?: string; } export interface MsgEditValidatorAminoMsg { type: "cosmos-sdk/MsgEditValidator"; @@ -134,8 +135,8 @@ export interface MsgDelegateProtoMsg { * from a delegator to a validator. */ export interface MsgDelegateAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; amount?: CoinAmino; } export interface MsgDelegateAminoMsg { @@ -184,9 +185,9 @@ export interface MsgBeginRedelegateProtoMsg { * of coins from a delegator and source validator to a destination validator. */ export interface MsgBeginRedelegateAmino { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; amount?: CoinAmino; } export interface MsgBeginRedelegateAminoMsg { @@ -213,7 +214,7 @@ export interface MsgBeginRedelegateResponseProtoMsg { } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseAmino { - completion_time?: TimestampAmino; + completion_time?: string; } export interface MsgBeginRedelegateResponseAminoMsg { type: "cosmos-sdk/MsgBeginRedelegateResponse"; @@ -241,8 +242,8 @@ export interface MsgUndelegateProtoMsg { * delegate and a validator. */ export interface MsgUndelegateAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; amount?: CoinAmino; } export interface MsgUndelegateAminoMsg { @@ -268,7 +269,7 @@ export interface MsgUndelegateResponseProtoMsg { } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseAmino { - completion_time?: TimestampAmino; + completion_time?: string; } export interface MsgUndelegateResponseAminoMsg { type: "cosmos-sdk/MsgUndelegateResponse"; @@ -289,7 +290,7 @@ export interface MsgCancelUnbondingDelegation { /** amount is always less than or equal to unbonding delegation entry balance */ amount: Coin; /** creation_height is the height which the unbonding took place. */ - creationHeight: Long; + creationHeight: bigint; } export interface MsgCancelUnbondingDelegationProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"; @@ -301,12 +302,12 @@ export interface MsgCancelUnbondingDelegationProtoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCancelUnbondingDelegationAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; /** amount is always less than or equal to unbonding delegation entry balance */ amount?: CoinAmino; /** creation_height is the height which the unbonding took place. */ - creation_height: string; + creation_height?: string; } export interface MsgCancelUnbondingDelegationAminoMsg { type: "cosmos-sdk/MsgCancelUnbondingDelegation"; @@ -321,7 +322,7 @@ export interface MsgCancelUnbondingDelegationSDKType { delegator_address: string; validator_address: string; amount: CoinSDKType; - creation_height: Long; + creation_height: bigint; } /** * MsgCancelUnbondingDelegationResponse @@ -357,11 +358,12 @@ function createBaseMsgCreateValidator(): MsgCreateValidator { delegatorAddress: "", validatorAddress: "", pubkey: undefined, - value: undefined + value: Coin.fromPartial({}) }; } export const MsgCreateValidator = { - encode(message: MsgCreateValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + encode(message: MsgCreateValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== undefined) { Description.encode(message.description, writer.uint32(10).fork()).ldelim(); } @@ -385,8 +387,8 @@ export const MsgCreateValidator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateValidator(); while (reader.pos < end) { @@ -454,30 +456,38 @@ export const MsgCreateValidator = { return message; }, fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { - return { - description: object?.description ? Description.fromAmino(object.description) : undefined, - commission: object?.commission ? CommissionRates.fromAmino(object.commission) : undefined, - minSelfDelegation: object.min_self_delegation, - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - pubkey: { - typeUrl: "tendermint/PubKeySecp256k1", - value: object.pubkey?.value, - }, - value: object?.value ? Coin.fromAmino(object.value) : undefined - }; + const message = createBaseMsgCreateValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = encodePubkey(object.pubkey); + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromAmino(object.value); + } + return message; }, toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { const obj: any = {}; obj.description = message.description ? Description.toAmino(message.description) : undefined; obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : undefined; - obj.min_self_delegation = message.minSelfDelegation; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; - obj.pubkey = message.pubkey ? { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: message.pubkey.value - } : undefined; + obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined; obj.value = message.value ? Coin.toAmino(message.value) : undefined; return obj; }, @@ -507,11 +517,12 @@ function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { return {}; } export const MsgCreateValidatorResponse = { - encode(_: MsgCreateValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + encode(_: MsgCreateValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateValidatorResponse(); while (reader.pos < end) { @@ -536,7 +547,8 @@ export const MsgCreateValidatorResponse = { return message; }, fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { - return {}; + const message = createBaseMsgCreateValidatorResponse(); + return message; }, toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { const obj: any = {}; @@ -573,7 +585,8 @@ function createBaseMsgEditValidator(): MsgEditValidator { }; } export const MsgEditValidator = { - encode(message: MsgEditValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + encode(message: MsgEditValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== undefined) { Description.encode(message.description, writer.uint32(10).fork()).ldelim(); } @@ -581,15 +594,15 @@ export const MsgEditValidator = { writer.uint32(18).string(message.validatorAddress); } if (message.commissionRate !== "") { - writer.uint32(26).string(message.commissionRate); + writer.uint32(26).string(Decimal.fromUserInput(message.commissionRate, 18).atomics); } if (message.minSelfDelegation !== "") { writer.uint32(34).string(message.minSelfDelegation); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgEditValidator(); while (reader.pos < end) { @@ -602,7 +615,7 @@ export const MsgEditValidator = { message.validatorAddress = reader.string(); break; case 3: - message.commissionRate = reader.string(); + message.commissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 4: message.minSelfDelegation = reader.string(); @@ -639,19 +652,27 @@ export const MsgEditValidator = { return message; }, fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { - return { - description: object?.description ? Description.fromAmino(object.description) : undefined, - validatorAddress: object.validator_address, - commissionRate: object.commission_rate, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseMsgEditValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.commission_rate !== undefined && object.commission_rate !== null) { + message.commissionRate = object.commission_rate; + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; }, toAmino(message: MsgEditValidator): MsgEditValidatorAmino { const obj: any = {}; obj.description = message.description ? Description.toAmino(message.description) : undefined; - obj.validator_address = message.validatorAddress; - obj.commission_rate = message.commissionRate; - obj.min_self_delegation = message.minSelfDelegation; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.commission_rate = message.commissionRate === "" ? undefined : message.commissionRate; + obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; return obj; }, fromAminoMsg(object: MsgEditValidatorAminoMsg): MsgEditValidator { @@ -680,11 +701,12 @@ function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { return {}; } export const MsgEditValidatorResponse = { - encode(_: MsgEditValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + encode(_: MsgEditValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgEditValidatorResponse(); while (reader.pos < end) { @@ -709,7 +731,8 @@ export const MsgEditValidatorResponse = { return message; }, fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { - return {}; + const message = createBaseMsgEditValidatorResponse(); + return message; }, toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { const obj: any = {}; @@ -741,11 +764,12 @@ function createBaseMsgDelegate(): MsgDelegate { return { delegatorAddress: "", validatorAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgDelegate = { - encode(message: MsgDelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + encode(message: MsgDelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -757,8 +781,8 @@ export const MsgDelegate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDelegate(); while (reader.pos < end) { @@ -802,16 +826,22 @@ export const MsgDelegate = { return message; }, fromAmino(object: MsgDelegateAmino): MsgDelegate { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgDelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgDelegate): MsgDelegateAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; return obj; }, @@ -841,11 +871,12 @@ function createBaseMsgDelegateResponse(): MsgDelegateResponse { return {}; } export const MsgDelegateResponse = { - encode(_: MsgDelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + encode(_: MsgDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDelegateResponse(); while (reader.pos < end) { @@ -870,7 +901,8 @@ export const MsgDelegateResponse = { return message; }, fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { - return {}; + const message = createBaseMsgDelegateResponse(); + return message; }, toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { const obj: any = {}; @@ -903,11 +935,12 @@ function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgBeginRedelegate = { - encode(message: MsgBeginRedelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + encode(message: MsgBeginRedelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -922,8 +955,8 @@ export const MsgBeginRedelegate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBeginRedelegate(); while (reader.pos < end) { @@ -973,18 +1006,26 @@ export const MsgBeginRedelegate = { return message; }, fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgBeginRedelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgBeginRedelegate): MsgBeginRedelegateAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_src_address = message.validatorSrcAddress; - obj.validator_dst_address = message.validatorDstAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress; + obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; return obj; }, @@ -1012,18 +1053,19 @@ export const MsgBeginRedelegate = { }; function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { return { - completionTime: undefined + completionTime: Timestamp.fromPartial({}) }; } export const MsgBeginRedelegateResponse = { - encode(message: MsgBeginRedelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + encode(message: MsgBeginRedelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.completionTime !== undefined) { Timestamp.encode(message.completionTime, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBeginRedelegateResponse(); while (reader.pos < end) { @@ -1055,9 +1097,11 @@ export const MsgBeginRedelegateResponse = { return message; }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { - return { - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined - }; + const message = createBaseMsgBeginRedelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = Timestamp.fromAmino(object.completion_time); + } + return message; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; @@ -1090,11 +1134,12 @@ function createBaseMsgUndelegate(): MsgUndelegate { return { delegatorAddress: "", validatorAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgUndelegate = { - encode(message: MsgUndelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + encode(message: MsgUndelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1106,8 +1151,8 @@ export const MsgUndelegate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUndelegate(); while (reader.pos < end) { @@ -1151,16 +1196,22 @@ export const MsgUndelegate = { return message; }, fromAmino(object: MsgUndelegateAmino): MsgUndelegate { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgUndelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgUndelegate): MsgUndelegateAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; return obj; }, @@ -1188,18 +1239,19 @@ export const MsgUndelegate = { }; function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { return { - completionTime: undefined + completionTime: Timestamp.fromPartial({}) }; } export const MsgUndelegateResponse = { - encode(message: MsgUndelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + encode(message: MsgUndelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.completionTime !== undefined) { Timestamp.encode(message.completionTime, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUndelegateResponse(); while (reader.pos < end) { @@ -1231,9 +1283,11 @@ export const MsgUndelegateResponse = { return message; }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { - return { - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined - }; + const message = createBaseMsgUndelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = Timestamp.fromAmino(object.completion_time); + } + return message; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; @@ -1266,12 +1320,13 @@ function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation return { delegatorAddress: "", validatorAddress: "", - amount: undefined, - creationHeight: Long.ZERO + amount: Coin.fromPartial({}), + creationHeight: BigInt(0) }; } export const MsgCancelUnbondingDelegation = { - encode(message: MsgCancelUnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + encode(message: MsgCancelUnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1281,13 +1336,13 @@ export const MsgCancelUnbondingDelegation = { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); } - if (!message.creationHeight.isZero()) { + if (message.creationHeight !== BigInt(0)) { writer.uint32(32).int64(message.creationHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUnbondingDelegation(); while (reader.pos < end) { @@ -1303,7 +1358,7 @@ export const MsgCancelUnbondingDelegation = { message.amount = Coin.decode(reader, reader.uint32()); break; case 4: - message.creationHeight = (reader.int64() as Long); + message.creationHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1317,7 +1372,7 @@ export const MsgCancelUnbondingDelegation = { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, - creationHeight: isSet(object.creationHeight) ? Long.fromValue(object.creationHeight) : Long.ZERO + creationHeight: isSet(object.creationHeight) ? BigInt(object.creationHeight.toString()) : BigInt(0) }; }, toJSON(message: MsgCancelUnbondingDelegation): unknown { @@ -1325,7 +1380,7 @@ export const MsgCancelUnbondingDelegation = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgCancelUnbondingDelegation { @@ -1333,23 +1388,31 @@ export const MsgCancelUnbondingDelegation = { message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; - message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? Long.fromValue(object.creationHeight) : Long.ZERO; + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); return message; }, fromAmino(object: MsgCancelUnbondingDelegationAmino): MsgCancelUnbondingDelegation { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined, - creationHeight: Long.fromString(object.creation_height) - }; + const message = createBaseMsgCancelUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + return message; }, toAmino(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAmino { const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - obj.validator_address = message.validatorAddress; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; + obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; return obj; }, fromAminoMsg(object: MsgCancelUnbondingDelegationAminoMsg): MsgCancelUnbondingDelegation { @@ -1378,11 +1441,12 @@ function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDel return {}; } export const MsgCancelUnbondingDelegationResponse = { - encode(_: MsgCancelUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + encode(_: MsgCancelUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUnbondingDelegationResponse(); while (reader.pos < end) { @@ -1407,7 +1471,8 @@ export const MsgCancelUnbondingDelegationResponse = { return message; }, fromAmino(_: MsgCancelUnbondingDelegationResponseAmino): MsgCancelUnbondingDelegationResponse { - return {}; + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; }, toAmino(_: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseAmino { const obj: any = {}; @@ -1435,23 +1500,17 @@ export const MsgCancelUnbondingDelegationResponse = { }; } }; -export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: _m0.Reader | Uint8Array): Any => { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); +export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { default: return data; } }; -export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => { - return encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(content.value) - }, "cosmos"); +export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino): Any => { + return encodePubkey(content); }; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => { - return { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: content.value - }; +export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { + return decodePubkey(content); }; \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/packages/api/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index 084df192..fc4dc926 100644 --- a/packages/api/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/api/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -1,7 +1,7 @@ import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../../crypto/multisig/v1beta1/multisig"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * SignMode represents a signing mode with its own security guarantees. * @@ -117,7 +117,7 @@ export interface SignatureDescriptorsProtoMsg { /** SignatureDescriptors wraps multiple SignatureDescriptor's. */ export interface SignatureDescriptorsAmino { /** signatures are the signature descriptors */ - signatures: SignatureDescriptorAmino[]; + signatures?: SignatureDescriptorAmino[]; } export interface SignatureDescriptorsAminoMsg { type: "cosmos-sdk/SignatureDescriptors"; @@ -135,14 +135,14 @@ export interface SignatureDescriptorsSDKType { */ export interface SignatureDescriptor { /** public_key is the public key of the signer */ - publicKey: Any; - data: SignatureDescriptor_Data; + publicKey?: Any; + data?: SignatureDescriptor_Data; /** * sequence is the sequence of the account, which describes the * number of committed transactions signed by a given address. It is used to prevent * replay attacks. */ - sequence: Long; + sequence: bigint; } export interface SignatureDescriptorProtoMsg { typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor"; @@ -163,7 +163,7 @@ export interface SignatureDescriptorAmino { * number of committed transactions signed by a given address. It is used to prevent * replay attacks. */ - sequence: string; + sequence?: string; } export interface SignatureDescriptorAminoMsg { type: "cosmos-sdk/SignatureDescriptor"; @@ -176,9 +176,9 @@ export interface SignatureDescriptorAminoMsg { * clients. */ export interface SignatureDescriptorSDKType { - public_key: AnySDKType; - data: SignatureDescriptor_DataSDKType; - sequence: Long; + public_key?: AnySDKType; + data?: SignatureDescriptor_DataSDKType; + sequence: bigint; } /** Data represents signature data */ export interface SignatureDescriptor_Data { @@ -221,9 +221,9 @@ export interface SignatureDescriptor_Data_SingleProtoMsg { /** Single is the signature data for a single signer */ export interface SignatureDescriptor_Data_SingleAmino { /** mode is the signing mode of the single signer */ - mode: SignMode; + mode?: SignMode; /** signature is the raw signature bytes */ - signature: Uint8Array; + signature?: string; } export interface SignatureDescriptor_Data_SingleAminoMsg { type: "cosmos-sdk/Single"; @@ -237,7 +237,7 @@ export interface SignatureDescriptor_Data_SingleSDKType { /** Multi is the signature data for a multisig public key */ export interface SignatureDescriptor_Data_Multi { /** bitarray specifies which keys within the multisig are signing */ - bitarray: CompactBitArray; + bitarray?: CompactBitArray; /** signatures is the signatures of the multi-signature */ signatures: SignatureDescriptor_Data[]; } @@ -250,7 +250,7 @@ export interface SignatureDescriptor_Data_MultiAmino { /** bitarray specifies which keys within the multisig are signing */ bitarray?: CompactBitArrayAmino; /** signatures is the signatures of the multi-signature */ - signatures: SignatureDescriptor_DataAmino[]; + signatures?: SignatureDescriptor_DataAmino[]; } export interface SignatureDescriptor_Data_MultiAminoMsg { type: "cosmos-sdk/Multi"; @@ -258,7 +258,7 @@ export interface SignatureDescriptor_Data_MultiAminoMsg { } /** Multi is the signature data for a multisig public key */ export interface SignatureDescriptor_Data_MultiSDKType { - bitarray: CompactBitArraySDKType; + bitarray?: CompactBitArraySDKType; signatures: SignatureDescriptor_DataSDKType[]; } function createBaseSignatureDescriptors(): SignatureDescriptors { @@ -267,14 +267,15 @@ function createBaseSignatureDescriptors(): SignatureDescriptors { }; } export const SignatureDescriptors = { - encode(message: SignatureDescriptors, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + encode(message: SignatureDescriptors, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signatures) { SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptors { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptors(); while (reader.pos < end) { @@ -310,16 +311,16 @@ export const SignatureDescriptors = { return message; }, fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { - return { - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor.fromAmino(e)) : [] - }; + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { const obj: any = {}; if (message.signatures) { obj.signatures = message.signatures.map(e => e ? SignatureDescriptor.toAmino(e) : undefined); } else { - obj.signatures = []; + obj.signatures = message.signatures; } return obj; }, @@ -348,25 +349,26 @@ export const SignatureDescriptors = { function createBaseSignatureDescriptor(): SignatureDescriptor { return { publicKey: undefined, - data: Data.fromPartial({}), - sequence: Long.UZERO + data: undefined, + sequence: BigInt(0) }; } export const SignatureDescriptor = { - encode(message: SignatureDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + encode(message: SignatureDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); } if (message.data !== undefined) { SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor(); while (reader.pos < end) { @@ -379,7 +381,7 @@ export const SignatureDescriptor = { message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); break; case 3: - message.sequence = (reader.uint64() as Long); + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -392,35 +394,41 @@ export const SignatureDescriptor = { return { publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, data: isSet(object.data) ? SignatureDescriptor_Data.fromJSON(object.data) : undefined, - sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) }; }, toJSON(message: SignatureDescriptor): unknown { const obj: any = {}; message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); message.data !== undefined && (obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): SignatureDescriptor { const message = createBaseSignatureDescriptor(); message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; message.data = object.data !== undefined && object.data !== null ? SignatureDescriptor_Data.fromPartial(object.data) : undefined; - message.sequence = object.sequence !== undefined && object.sequence !== null ? Long.fromValue(object.sequence) : Long.UZERO; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); return message; }, fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - data: object?.data ? SignatureDescriptor_Data.fromAmino(object.data) : undefined, - sequence: Long.fromString(object.sequence) - }; + const message = createBaseSignatureDescriptor(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromAmino(object.data); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: SignatureDescriptor): SignatureDescriptorAmino { const obj: any = {}; obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; obj.data = message.data ? SignatureDescriptor_Data.toAmino(message.data) : undefined; - obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; return obj; }, fromAminoMsg(object: SignatureDescriptorAminoMsg): SignatureDescriptor { @@ -452,7 +460,8 @@ function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { }; } export const SignatureDescriptor_Data = { - encode(message: SignatureDescriptor_Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.signing.v1beta1.Data", + encode(message: SignatureDescriptor_Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.single !== undefined) { SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); } @@ -461,8 +470,8 @@ export const SignatureDescriptor_Data = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor_Data(); while (reader.pos < end) { @@ -500,10 +509,14 @@ export const SignatureDescriptor_Data = { return message; }, fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { - return { - single: object?.single ? SignatureDescriptor_Data_Single.fromAmino(object.single) : undefined, - multi: object?.multi ? SignatureDescriptor_Data_Multi.fromAmino(object.multi) : undefined - }; + const message = createBaseSignatureDescriptor_Data(); + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromAmino(object.multi); + } + return message; }, toAmino(message: SignatureDescriptor_Data): SignatureDescriptor_DataAmino { const obj: any = {}; @@ -540,7 +553,8 @@ function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_S }; } export const SignatureDescriptor_Data_Single = { - encode(message: SignatureDescriptor_Data_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.signing.v1beta1.Single", + encode(message: SignatureDescriptor_Data_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); } @@ -549,8 +563,8 @@ export const SignatureDescriptor_Data_Single = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor_Data_Single(); while (reader.pos < end) { @@ -571,7 +585,7 @@ export const SignatureDescriptor_Data_Single = { }, fromJSON(object: any): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() }; }, @@ -588,15 +602,19 @@ export const SignatureDescriptor_Data_Single = { return message; }, fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { - return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, - signature: object.signature - }; + const message = createBaseSignatureDescriptor_Data_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAmino { const obj: any = {}; - obj.mode = message.mode; - obj.signature = message.signature; + obj.mode = message.mode === 0 ? undefined : message.mode; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: SignatureDescriptor_Data_SingleAminoMsg): SignatureDescriptor_Data_Single { @@ -623,12 +641,13 @@ export const SignatureDescriptor_Data_Single = { }; function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { return { - bitarray: CompactBitArray.fromPartial({}), + bitarray: undefined, signatures: [] }; } export const SignatureDescriptor_Data_Multi = { - encode(message: SignatureDescriptor_Data_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + encode(message: SignatureDescriptor_Data_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bitarray !== undefined) { CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); } @@ -637,8 +656,8 @@ export const SignatureDescriptor_Data_Multi = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor_Data_Multi(); while (reader.pos < end) { @@ -680,10 +699,12 @@ export const SignatureDescriptor_Data_Multi = { return message; }, fromAmino(object: SignatureDescriptor_Data_MultiAmino): SignatureDescriptor_Data_Multi { - return { - bitarray: object?.bitarray ? CompactBitArray.fromAmino(object.bitarray) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor_Data.fromAmino(e)) : [] - }; + const message = createBaseSignatureDescriptor_Data_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromAmino(e)) || []; + return message; }, toAmino(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAmino { const obj: any = {}; @@ -691,7 +712,7 @@ export const SignatureDescriptor_Data_Multi = { if (message.signatures) { obj.signatures = message.signatures.map(e => e ? SignatureDescriptor_Data.toAmino(e) : undefined); } else { - obj.signatures = []; + obj.signatures = message.signatures; } return obj; }, diff --git a/packages/api/src/codegen/cosmos/tx/v1beta1/service.lcd.ts b/packages/api/src/codegen/cosmos/tx/v1beta1/service.lcd.ts index 2460e581..18594347 100644 --- a/packages/api/src/codegen/cosmos/tx/v1beta1/service.lcd.ts +++ b/packages/api/src/codegen/cosmos/tx/v1beta1/service.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { GetTxRequest, GetTxResponseSDKType, GetTxsEventRequest, GetTxsEventResponseSDKType, GetBlockWithTxsRequest, GetBlockWithTxsResponseSDKType } from "./service"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts b/packages/api/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts index 215c9d4d..5a963175 100644 --- a/packages/api/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts +++ b/packages/api/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse } from "./service"; /** Service defines a gRPC service for interacting with transactions. */ @@ -32,27 +32,27 @@ export class ServiceClientImpl implements Service { simulate(request: SimulateRequest): Promise { const data = SimulateRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "Simulate", data); - return promise.then(data => SimulateResponse.decode(new _m0.Reader(data))); + return promise.then(data => SimulateResponse.decode(new BinaryReader(data))); } getTx(request: GetTxRequest): Promise { const data = GetTxRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTx", data); - return promise.then(data => GetTxResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetTxResponse.decode(new BinaryReader(data))); } broadcastTx(request: BroadcastTxRequest): Promise { const data = BroadcastTxRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "BroadcastTx", data); - return promise.then(data => BroadcastTxResponse.decode(new _m0.Reader(data))); + return promise.then(data => BroadcastTxResponse.decode(new BinaryReader(data))); } getTxsEvent(request: GetTxsEventRequest): Promise { const data = GetTxsEventRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); - return promise.then(data => GetTxsEventResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetTxsEventResponse.decode(new BinaryReader(data))); } getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { const data = GetBlockWithTxsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetBlockWithTxs", data); - return promise.then(data => GetBlockWithTxsResponse.decode(new _m0.Reader(data))); + return promise.then(data => GetBlockWithTxsResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/tx/v1beta1/service.ts b/packages/api/src/codegen/cosmos/tx/v1beta1/service.ts index e89001af..81775aa1 100644 --- a/packages/api/src/codegen/cosmos/tx/v1beta1/service.ts +++ b/packages/api/src/codegen/cosmos/tx/v1beta1/service.ts @@ -3,8 +3,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { TxResponse, TxResponseAmino, TxResponseSDKType, GasInfo, GasInfoAmino, GasInfoSDKType, Result, ResultAmino, ResultSDKType } from "../../base/abci/v1beta1/abci"; import { BlockID, BlockIDAmino, BlockIDSDKType } from "../../../tendermint/types/types"; import { Block, BlockAmino, BlockSDKType } from "../../../tendermint/types/block"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** OrderBy defines the sorting order */ export enum OrderBy { /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ @@ -117,15 +117,15 @@ export interface GetTxsEventRequest { * Deprecated post v0.46.x: use page and limit instead. */ /** @deprecated */ - pagination: PageRequest; + pagination?: PageRequest; orderBy: OrderBy; /** page is the page number to query, starts at 1. If not provided, will default to first page. */ - page: Long; + page: bigint; /** * limit is the total number of results to be returned in the result page. * If left empty it will default to a value to be set by each app. */ - limit: Long; + limit: bigint; } export interface GetTxsEventRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest"; @@ -137,21 +137,21 @@ export interface GetTxsEventRequestProtoMsg { */ export interface GetTxsEventRequestAmino { /** events is the list of transaction event type. */ - events: string[]; + events?: string[]; /** * pagination defines a pagination for the request. * Deprecated post v0.46.x: use page and limit instead. */ /** @deprecated */ pagination?: PageRequestAmino; - order_by: OrderBy; + order_by?: OrderBy; /** page is the page number to query, starts at 1. If not provided, will default to first page. */ - page: string; + page?: string; /** * limit is the total number of results to be returned in the result page. * If left empty it will default to a value to be set by each app. */ - limit: string; + limit?: string; } export interface GetTxsEventRequestAminoMsg { type: "cosmos-sdk/GetTxsEventRequest"; @@ -164,10 +164,10 @@ export interface GetTxsEventRequestAminoMsg { export interface GetTxsEventRequestSDKType { events: string[]; /** @deprecated */ - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; order_by: OrderBy; - page: Long; - limit: Long; + page: bigint; + limit: bigint; } /** * GetTxsEventResponse is the response type for the Service.TxsByEvents @@ -183,9 +183,9 @@ export interface GetTxsEventResponse { * Deprecated post v0.46.x: use total instead. */ /** @deprecated */ - pagination: PageResponse; + pagination?: PageResponse; /** total is total number of results available */ - total: Long; + total: bigint; } export interface GetTxsEventResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse"; @@ -197,9 +197,9 @@ export interface GetTxsEventResponseProtoMsg { */ export interface GetTxsEventResponseAmino { /** txs is the list of queried transactions. */ - txs: TxAmino[]; + txs?: TxAmino[]; /** tx_responses is the list of queried TxResponses. */ - tx_responses: TxResponseAmino[]; + tx_responses?: TxResponseAmino[]; /** * pagination defines a pagination for the response. * Deprecated post v0.46.x: use total instead. @@ -207,7 +207,7 @@ export interface GetTxsEventResponseAmino { /** @deprecated */ pagination?: PageResponseAmino; /** total is total number of results available */ - total: string; + total?: string; } export interface GetTxsEventResponseAminoMsg { type: "cosmos-sdk/GetTxsEventResponse"; @@ -221,8 +221,8 @@ export interface GetTxsEventResponseSDKType { txs: TxSDKType[]; tx_responses: TxResponseSDKType[]; /** @deprecated */ - pagination: PageResponseSDKType; - total: Long; + pagination?: PageResponseSDKType; + total: bigint; } /** * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -243,8 +243,8 @@ export interface BroadcastTxRequestProtoMsg { */ export interface BroadcastTxRequestAmino { /** tx_bytes is the raw transaction. */ - tx_bytes: Uint8Array; - mode: BroadcastMode; + tx_bytes?: string; + mode?: BroadcastMode; } export interface BroadcastTxRequestAminoMsg { type: "cosmos-sdk/BroadcastTxRequest"; @@ -264,7 +264,7 @@ export interface BroadcastTxRequestSDKType { */ export interface BroadcastTxResponse { /** tx_response is the queried TxResponses. */ - txResponse: TxResponse; + txResponse?: TxResponse; } export interface BroadcastTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; @@ -287,7 +287,7 @@ export interface BroadcastTxResponseAminoMsg { * Service.BroadcastTx method. */ export interface BroadcastTxResponseSDKType { - tx_response: TxResponseSDKType; + tx_response?: TxResponseSDKType; } /** * SimulateRequest is the request type for the Service.Simulate @@ -299,7 +299,7 @@ export interface SimulateRequest { * Deprecated. Send raw tx bytes instead. */ /** @deprecated */ - tx: Tx; + tx?: Tx; /** * tx_bytes is the raw transaction. * @@ -327,7 +327,7 @@ export interface SimulateRequestAmino { * * Since: cosmos-sdk 0.43 */ - tx_bytes: Uint8Array; + tx_bytes?: string; } export interface SimulateRequestAminoMsg { type: "cosmos-sdk/SimulateRequest"; @@ -339,7 +339,7 @@ export interface SimulateRequestAminoMsg { */ export interface SimulateRequestSDKType { /** @deprecated */ - tx: TxSDKType; + tx?: TxSDKType; tx_bytes: Uint8Array; } /** @@ -348,9 +348,9 @@ export interface SimulateRequestSDKType { */ export interface SimulateResponse { /** gas_info is the information about gas used in the simulation. */ - gasInfo: GasInfo; + gasInfo?: GasInfo; /** result is the result of the simulation. */ - result: Result; + result?: Result; } export interface SimulateResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; @@ -375,8 +375,8 @@ export interface SimulateResponseAminoMsg { * Service.SimulateRPC method. */ export interface SimulateResponseSDKType { - gas_info: GasInfoSDKType; - result: ResultSDKType; + gas_info?: GasInfoSDKType; + result?: ResultSDKType; } /** * GetTxRequest is the request type for the Service.GetTx @@ -396,7 +396,7 @@ export interface GetTxRequestProtoMsg { */ export interface GetTxRequestAmino { /** hash is the tx hash to query, encoded as a hex string. */ - hash: string; + hash?: string; } export interface GetTxRequestAminoMsg { type: "cosmos-sdk/GetTxRequest"; @@ -412,9 +412,9 @@ export interface GetTxRequestSDKType { /** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponse { /** tx is the queried transaction. */ - tx: Tx; + tx?: Tx; /** tx_response is the queried TxResponses. */ - txResponse: TxResponse; + txResponse?: TxResponse; } export interface GetTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; @@ -433,8 +433,8 @@ export interface GetTxResponseAminoMsg { } /** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponseSDKType { - tx: TxSDKType; - tx_response: TxResponseSDKType; + tx?: TxSDKType; + tx_response?: TxResponseSDKType; } /** * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs @@ -444,9 +444,9 @@ export interface GetTxResponseSDKType { */ export interface GetBlockWithTxsRequest { /** height is the height of the block to query. */ - height: Long; + height: bigint; /** pagination defines a pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface GetBlockWithTxsRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; @@ -460,7 +460,7 @@ export interface GetBlockWithTxsRequestProtoMsg { */ export interface GetBlockWithTxsRequestAmino { /** height is the height of the block to query. */ - height: string; + height?: string; /** pagination defines a pagination for the request. */ pagination?: PageRequestAmino; } @@ -475,8 +475,8 @@ export interface GetBlockWithTxsRequestAminoMsg { * Since: cosmos-sdk 0.45.2 */ export interface GetBlockWithTxsRequestSDKType { - height: Long; - pagination: PageRequestSDKType; + height: bigint; + pagination?: PageRequestSDKType; } /** * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. @@ -486,10 +486,10 @@ export interface GetBlockWithTxsRequestSDKType { export interface GetBlockWithTxsResponse { /** txs are the transactions in the block. */ txs: Tx[]; - blockId: BlockID; - block: Block; + blockId?: BlockID; + block?: Block; /** pagination defines a pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface GetBlockWithTxsResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; @@ -502,7 +502,7 @@ export interface GetBlockWithTxsResponseProtoMsg { */ export interface GetBlockWithTxsResponseAmino { /** txs are the transactions in the block. */ - txs: TxAmino[]; + txs?: TxAmino[]; block_id?: BlockIDAmino; block?: BlockAmino; /** pagination defines a pagination for the response. */ @@ -519,21 +519,22 @@ export interface GetBlockWithTxsResponseAminoMsg { */ export interface GetBlockWithTxsResponseSDKType { txs: TxSDKType[]; - block_id: BlockIDSDKType; - block: BlockSDKType; - pagination: PageResponseSDKType; + block_id?: BlockIDSDKType; + block?: BlockSDKType; + pagination?: PageResponseSDKType; } function createBaseGetTxsEventRequest(): GetTxsEventRequest { return { events: [], - pagination: PageRequest.fromPartial({}), + pagination: undefined, orderBy: 0, - page: Long.UZERO, - limit: Long.UZERO + page: BigInt(0), + limit: BigInt(0) }; } export const GetTxsEventRequest = { - encode(message: GetTxsEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + encode(message: GetTxsEventRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.events) { writer.uint32(10).string(v!); } @@ -543,16 +544,16 @@ export const GetTxsEventRequest = { if (message.orderBy !== 0) { writer.uint32(24).int32(message.orderBy); } - if (!message.page.isZero()) { + if (message.page !== BigInt(0)) { writer.uint32(32).uint64(message.page); } - if (!message.limit.isZero()) { + if (message.limit !== BigInt(0)) { writer.uint32(40).uint64(message.limit); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxsEventRequest(); while (reader.pos < end) { @@ -568,10 +569,10 @@ export const GetTxsEventRequest = { message.orderBy = (reader.int32() as any); break; case 4: - message.page = (reader.uint64() as Long); + message.page = reader.uint64(); break; case 5: - message.limit = (reader.uint64() as Long); + message.limit = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -584,9 +585,9 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : 0, - page: isSet(object.page) ? Long.fromValue(object.page) : Long.UZERO, - limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO + orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : -1, + page: isSet(object.page) ? BigInt(object.page.toString()) : BigInt(0), + limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0) }; }, toJSON(message: GetTxsEventRequest): unknown { @@ -598,8 +599,8 @@ export const GetTxsEventRequest = { } message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)); - message.page !== undefined && (obj.page = (message.page || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.page !== undefined && (obj.page = (message.page || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): GetTxsEventRequest { @@ -607,30 +608,38 @@ export const GetTxsEventRequest = { message.events = object.events?.map(e => e) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; message.orderBy = object.orderBy ?? 0; - message.page = object.page !== undefined && object.page !== null ? Long.fromValue(object.page) : Long.UZERO; - message.limit = object.limit !== undefined && object.limit !== null ? Long.fromValue(object.limit) : Long.UZERO; + message.page = object.page !== undefined && object.page !== null ? BigInt(object.page.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); return message; }, fromAmino(object: GetTxsEventRequestAmino): GetTxsEventRequest { - return { - events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0, - page: Long.fromString(object.page), - limit: Long.fromString(object.limit) - }; + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.order_by !== undefined && object.order_by !== null) { + message.orderBy = object.order_by; + } + if (object.page !== undefined && object.page !== null) { + message.page = BigInt(object.page); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + return message; }, toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { const obj: any = {}; if (message.events) { obj.events = message.events.map(e => e); } else { - obj.events = []; + obj.events = message.events; } obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; - obj.order_by = message.orderBy; - obj.page = message.page ? message.page.toString() : undefined; - obj.limit = message.limit ? message.limit.toString() : undefined; + obj.order_by = message.orderBy === 0 ? undefined : message.orderBy; + obj.page = message.page !== BigInt(0) ? message.page.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; return obj; }, fromAminoMsg(object: GetTxsEventRequestAminoMsg): GetTxsEventRequest { @@ -659,12 +668,13 @@ function createBaseGetTxsEventResponse(): GetTxsEventResponse { return { txs: [], txResponses: [], - pagination: PageResponse.fromPartial({}), - total: Long.UZERO + pagination: undefined, + total: BigInt(0) }; } export const GetTxsEventResponse = { - encode(message: GetTxsEventResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + encode(message: GetTxsEventResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { Tx.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -674,13 +684,13 @@ export const GetTxsEventResponse = { if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } - if (!message.total.isZero()) { + if (message.total !== BigInt(0)) { writer.uint32(32).uint64(message.total); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxsEventResponse(); while (reader.pos < end) { @@ -696,7 +706,7 @@ export const GetTxsEventResponse = { message.pagination = PageResponse.decode(reader, reader.uint32()); break; case 4: - message.total = (reader.uint64() as Long); + message.total = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -710,7 +720,7 @@ export const GetTxsEventResponse = { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromJSON(e)) : [], txResponses: Array.isArray(object?.txResponses) ? object.txResponses.map((e: any) => TxResponse.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO + total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0) }; }, toJSON(message: GetTxsEventResponse): unknown { @@ -726,7 +736,7 @@ export const GetTxsEventResponse = { obj.txResponses = []; } message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): GetTxsEventResponse { @@ -734,31 +744,35 @@ export const GetTxsEventResponse = { message.txs = object.txs?.map(e => Tx.fromPartial(e)) || []; message.txResponses = object.txResponses?.map(e => TxResponse.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - message.total = object.total !== undefined && object.total !== null ? Long.fromValue(object.total) : Long.UZERO; + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); return message; }, fromAmino(object: GetTxsEventResponseAmino): GetTxsEventResponse { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromAmino(e)) : [], - txResponses: Array.isArray(object?.tx_responses) ? object.tx_responses.map((e: any) => TxResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - total: Long.fromString(object.total) - }; + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + message.txResponses = object.tx_responses?.map(e => TxResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; }, toAmino(message: GetTxsEventResponse): GetTxsEventResponseAmino { const obj: any = {}; if (message.txs) { obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); } else { - obj.txs = []; + obj.txs = message.txs; } if (message.txResponses) { obj.tx_responses = message.txResponses.map(e => e ? TxResponse.toAmino(e) : undefined); } else { - obj.tx_responses = []; + obj.tx_responses = message.txResponses; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; - obj.total = message.total ? message.total.toString() : undefined; + obj.total = message.total !== BigInt(0) ? message.total.toString() : undefined; return obj; }, fromAminoMsg(object: GetTxsEventResponseAminoMsg): GetTxsEventResponse { @@ -790,7 +804,8 @@ function createBaseBroadcastTxRequest(): BroadcastTxRequest { }; } export const BroadcastTxRequest = { - encode(message: BroadcastTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + encode(message: BroadcastTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txBytes.length !== 0) { writer.uint32(10).bytes(message.txBytes); } @@ -799,8 +814,8 @@ export const BroadcastTxRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBroadcastTxRequest(); while (reader.pos < end) { @@ -822,7 +837,7 @@ export const BroadcastTxRequest = { fromJSON(object: any): BroadcastTxRequest { return { txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toJSON(message: BroadcastTxRequest): unknown { @@ -838,15 +853,19 @@ export const BroadcastTxRequest = { return message; }, fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { - return { - txBytes: object.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 - }; + const message = createBaseBroadcastTxRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; }, toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { const obj: any = {}; - obj.tx_bytes = message.txBytes; - obj.mode = message.mode; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + obj.mode = message.mode === 0 ? undefined : message.mode; return obj; }, fromAminoMsg(object: BroadcastTxRequestAminoMsg): BroadcastTxRequest { @@ -873,18 +892,19 @@ export const BroadcastTxRequest = { }; function createBaseBroadcastTxResponse(): BroadcastTxResponse { return { - txResponse: TxResponse.fromPartial({}) + txResponse: undefined }; } export const BroadcastTxResponse = { - encode(message: BroadcastTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + encode(message: BroadcastTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txResponse !== undefined) { TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBroadcastTxResponse(); while (reader.pos < end) { @@ -916,9 +936,11 @@ export const BroadcastTxResponse = { return message; }, fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { - return { - txResponse: object?.tx_response ? TxResponse.fromAmino(object.tx_response) : undefined - }; + const message = createBaseBroadcastTxResponse(); + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; }, toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { const obj: any = {}; @@ -949,12 +971,13 @@ export const BroadcastTxResponse = { }; function createBaseSimulateRequest(): SimulateRequest { return { - tx: Tx.fromPartial({}), + tx: undefined, txBytes: new Uint8Array() }; } export const SimulateRequest = { - encode(message: SimulateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + encode(message: SimulateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } @@ -963,8 +986,8 @@ export const SimulateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimulateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimulateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimulateRequest(); while (reader.pos < end) { @@ -1002,15 +1025,19 @@ export const SimulateRequest = { return message; }, fromAmino(object: SimulateRequestAmino): SimulateRequest { - return { - tx: object?.tx ? Tx.fromAmino(object.tx) : undefined, - txBytes: object.tx_bytes - }; + const message = createBaseSimulateRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; }, toAmino(message: SimulateRequest): SimulateRequestAmino { const obj: any = {}; obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; - obj.tx_bytes = message.txBytes; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; return obj; }, fromAminoMsg(object: SimulateRequestAminoMsg): SimulateRequest { @@ -1037,12 +1064,13 @@ export const SimulateRequest = { }; function createBaseSimulateResponse(): SimulateResponse { return { - gasInfo: GasInfo.fromPartial({}), - result: Result.fromPartial({}) + gasInfo: undefined, + result: undefined }; } export const SimulateResponse = { - encode(message: SimulateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + encode(message: SimulateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gasInfo !== undefined) { GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); } @@ -1051,8 +1079,8 @@ export const SimulateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimulateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimulateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimulateResponse(); while (reader.pos < end) { @@ -1090,10 +1118,14 @@ export const SimulateResponse = { return message; }, fromAmino(object: SimulateResponseAmino): SimulateResponse { - return { - gasInfo: object?.gas_info ? GasInfo.fromAmino(object.gas_info) : undefined, - result: object?.result ? Result.fromAmino(object.result) : undefined - }; + const message = createBaseSimulateResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; }, toAmino(message: SimulateResponse): SimulateResponseAmino { const obj: any = {}; @@ -1129,14 +1161,15 @@ function createBaseGetTxRequest(): GetTxRequest { }; } export const GetTxRequest = { - encode(message: GetTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + encode(message: GetTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxRequest(); while (reader.pos < end) { @@ -1168,13 +1201,15 @@ export const GetTxRequest = { return message; }, fromAmino(object: GetTxRequestAmino): GetTxRequest { - return { - hash: object.hash - }; + const message = createBaseGetTxRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: GetTxRequest): GetTxRequestAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash === "" ? undefined : message.hash; return obj; }, fromAminoMsg(object: GetTxRequestAminoMsg): GetTxRequest { @@ -1201,12 +1236,13 @@ export const GetTxRequest = { }; function createBaseGetTxResponse(): GetTxResponse { return { - tx: Tx.fromPartial({}), - txResponse: TxResponse.fromPartial({}) + tx: undefined, + txResponse: undefined }; } export const GetTxResponse = { - encode(message: GetTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + encode(message: GetTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } @@ -1215,8 +1251,8 @@ export const GetTxResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxResponse(); while (reader.pos < end) { @@ -1254,10 +1290,14 @@ export const GetTxResponse = { return message; }, fromAmino(object: GetTxResponseAmino): GetTxResponse { - return { - tx: object?.tx ? Tx.fromAmino(object.tx) : undefined, - txResponse: object?.tx_response ? TxResponse.fromAmino(object.tx_response) : undefined - }; + const message = createBaseGetTxResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; }, toAmino(message: GetTxResponse): GetTxResponseAmino { const obj: any = {}; @@ -1289,13 +1329,14 @@ export const GetTxResponse = { }; function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { return { - height: Long.ZERO, - pagination: PageRequest.fromPartial({}) + height: BigInt(0), + pagination: undefined }; } export const GetBlockWithTxsRequest = { - encode(message: GetBlockWithTxsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + encode(message: GetBlockWithTxsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.pagination !== undefined) { @@ -1303,15 +1344,15 @@ export const GetBlockWithTxsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockWithTxsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1325,31 +1366,35 @@ export const GetBlockWithTxsRequest = { }, fromJSON(object: any): GetBlockWithTxsRequest { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetBlockWithTxsRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, fromPartial(object: Partial): GetBlockWithTxsRequest { const message = createBaseGetBlockWithTxsRequest(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GetBlockWithTxsRequestAmino): GetBlockWithTxsRequest { - return { - height: Long.fromString(object.height), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetBlockWithTxsRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1378,13 +1423,14 @@ export const GetBlockWithTxsRequest = { function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { return { txs: [], - blockId: BlockID.fromPartial({}), - block: Block.fromPartial({}), - pagination: PageResponse.fromPartial({}) + blockId: undefined, + block: undefined, + pagination: undefined }; } export const GetBlockWithTxsResponse = { - encode(message: GetBlockWithTxsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + encode(message: GetBlockWithTxsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { Tx.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1399,8 +1445,8 @@ export const GetBlockWithTxsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockWithTxsResponse(); while (reader.pos < end) { @@ -1454,19 +1500,25 @@ export const GetBlockWithTxsResponse = { return message; }, fromAmino(object: GetBlockWithTxsResponseAmino): GetBlockWithTxsResponse { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromAmino(e)) : [], - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - block: object?.block ? Block.fromAmino(object.block) : undefined, - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromAmino(object.block); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAmino { const obj: any = {}; if (message.txs) { obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); } else { - obj.txs = []; + obj.txs = message.txs; } obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; obj.block = message.block ? Block.toAmino(message.block) : undefined; diff --git a/packages/api/src/codegen/cosmos/tx/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/tx/v1beta1/tx.ts index 434df9a8..5775a835 100644 --- a/packages/api/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -2,17 +2,17 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing"; import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../crypto/multisig/v1beta1/multisig"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** Tx is the standard type used for broadcasting transactions. */ export interface Tx { /** body is the processable content of the transaction */ - body: TxBody; + body?: TxBody; /** * auth_info is the authorization related content of the transaction, * specifically signers, signer modes and fee */ - authInfo: AuthInfo; + authInfo?: AuthInfo; /** * signatures is a list of signatures that matches the length and order of * AuthInfo's signer_infos to allow connecting signature meta information like @@ -38,7 +38,7 @@ export interface TxAmino { * AuthInfo's signer_infos to allow connecting signature meta information like * public key and signing mode by position. */ - signatures: Uint8Array[]; + signatures?: string[]; } export interface TxAminoMsg { type: "cosmos-sdk/Tx"; @@ -46,8 +46,8 @@ export interface TxAminoMsg { } /** Tx is the standard type used for broadcasting transactions. */ export interface TxSDKType { - body: TxBodySDKType; - auth_info: AuthInfoSDKType; + body?: TxBodySDKType; + auth_info?: AuthInfoSDKType; signatures: Uint8Array[]; } /** @@ -91,18 +91,18 @@ export interface TxRawAmino { * body_bytes is a protobuf serialization of a TxBody that matches the * representation in SignDoc. */ - body_bytes: Uint8Array; + body_bytes?: string; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in SignDoc. */ - auth_info_bytes: Uint8Array; + auth_info_bytes?: string; /** * signatures is a list of signatures that matches the length and order of * AuthInfo's signer_infos to allow connecting signature meta information like * public key and signing mode by position. */ - signatures: Uint8Array[]; + signatures?: string[]; } export interface TxRawAminoMsg { type: "cosmos-sdk/TxRaw"; @@ -139,7 +139,7 @@ export interface SignDoc { */ chainId: string; /** account_number is the account number of the account in state */ - accountNumber: Long; + accountNumber: bigint; } export interface SignDocProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignDoc"; @@ -151,20 +151,20 @@ export interface SignDocAmino { * body_bytes is protobuf serialization of a TxBody that matches the * representation in TxRaw. */ - body_bytes: Uint8Array; + body_bytes?: string; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in TxRaw. */ - auth_info_bytes: Uint8Array; + auth_info_bytes?: string; /** * chain_id is the unique identifier of the chain this transaction targets. * It prevents signed transactions from being used on another chain by an * attacker */ - chain_id: string; + chain_id?: string; /** account_number is the account number of the account in state */ - account_number: string; + account_number?: string; } export interface SignDocAminoMsg { type: "cosmos-sdk/SignDoc"; @@ -175,7 +175,7 @@ export interface SignDocSDKType { body_bytes: Uint8Array; auth_info_bytes: Uint8Array; chain_id: string; - account_number: Long; + account_number: bigint; } /** * SignDocDirectAux is the type used for generating sign bytes for @@ -190,7 +190,7 @@ export interface SignDocDirectAux { */ bodyBytes: Uint8Array; /** public_key is the public key of the signing account. */ - publicKey: Any; + publicKey?: Any; /** * chain_id is the identifier of the chain this transaction targets. * It prevents signed transactions from being used on another chain by an @@ -198,9 +198,9 @@ export interface SignDocDirectAux { */ chainId: string; /** account_number is the account number of the account in state. */ - accountNumber: Long; + accountNumber: bigint; /** sequence is the sequence number of the signing account. */ - sequence: Long; + sequence: bigint; /** * Tip is the optional tip used for transactions fees paid in another denom. * It should be left empty if the signer is not the tipper for this @@ -209,7 +209,7 @@ export interface SignDocDirectAux { * This field is ignored if the chain didn't enable tips, i.e. didn't add the * `TipDecorator` in its posthandler. */ - tip: Tip; + tip?: Tip; } export interface SignDocDirectAuxProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux"; @@ -226,7 +226,7 @@ export interface SignDocDirectAuxAmino { * body_bytes is protobuf serialization of a TxBody that matches the * representation in TxRaw. */ - body_bytes: Uint8Array; + body_bytes?: string; /** public_key is the public key of the signing account. */ public_key?: AnyAmino; /** @@ -234,11 +234,11 @@ export interface SignDocDirectAuxAmino { * It prevents signed transactions from being used on another chain by an * attacker. */ - chain_id: string; + chain_id?: string; /** account_number is the account number of the account in state. */ - account_number: string; + account_number?: string; /** sequence is the sequence number of the signing account. */ - sequence: string; + sequence?: string; /** * Tip is the optional tip used for transactions fees paid in another denom. * It should be left empty if the signer is not the tipper for this @@ -261,11 +261,11 @@ export interface SignDocDirectAuxAminoMsg { */ export interface SignDocDirectAuxSDKType { body_bytes: Uint8Array; - public_key: AnySDKType; + public_key?: AnySDKType; chain_id: string; - account_number: Long; - sequence: Long; - tip: TipSDKType; + account_number: bigint; + sequence: bigint; + tip?: TipSDKType; } /** TxBody is the body of a transaction that all signers sign over. */ export interface TxBody { @@ -289,7 +289,7 @@ export interface TxBody { * timeout is the block height after which this transaction will not * be processed by the chain */ - timeoutHeight: Long; + timeoutHeight: bigint; /** * extension_options are arbitrary options that can be added by chains * when the default options are not sufficient. If any of these are present @@ -318,30 +318,30 @@ export interface TxBodyAmino { * is referred to as the primary signer and pays the fee for the whole * transaction. */ - messages: AnyAmino[]; + messages?: AnyAmino[]; /** * memo is any arbitrary note/comment to be added to the transaction. * WARNING: in clients, any publicly exposed text should not be called memo, * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). */ - memo: string; + memo?: string; /** * timeout is the block height after which this transaction will not * be processed by the chain */ - timeout_height: string; + timeout_height?: string; /** * extension_options are arbitrary options that can be added by chains * when the default options are not sufficient. If any of these are present * and can't be handled, the transaction will be rejected */ - extension_options: AnyAmino[]; + extension_options?: AnyAmino[]; /** * extension_options are arbitrary options that can be added by chains * when the default options are not sufficient. If any of these are present * and can't be handled, they will be ignored */ - non_critical_extension_options: AnyAmino[]; + non_critical_extension_options?: AnyAmino[]; } export interface TxBodyAminoMsg { type: "cosmos-sdk/TxBody"; @@ -351,7 +351,7 @@ export interface TxBodyAminoMsg { export interface TxBodySDKType { messages: AnySDKType[]; memo: string; - timeout_height: Long; + timeout_height: bigint; extension_options: AnySDKType[]; non_critical_extension_options: AnySDKType[]; } @@ -373,7 +373,7 @@ export interface AuthInfo { * based on the cost of evaluating the body and doing signature verification * of the signers. This can be estimated via simulation. */ - fee: Fee; + fee?: Fee; /** * Tip is the optional tip used for transactions fees paid in another denom. * @@ -382,7 +382,7 @@ export interface AuthInfo { * * Since: cosmos-sdk 0.46 */ - tip: Tip; + tip?: Tip; } export interface AuthInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuthInfo"; @@ -399,7 +399,7 @@ export interface AuthInfoAmino { * messages. The first element is the primary signer and the one which pays * the fee. */ - signer_infos: SignerInfoAmino[]; + signer_infos?: SignerInfoAmino[]; /** * Fee is the fee and gas limit for the transaction. The first signer is the * primary signer and the one which pays the fee. The fee can be calculated @@ -427,8 +427,8 @@ export interface AuthInfoAminoMsg { */ export interface AuthInfoSDKType { signer_infos: SignerInfoSDKType[]; - fee: FeeSDKType; - tip: TipSDKType; + fee?: FeeSDKType; + tip?: TipSDKType; } /** * SignerInfo describes the public key and signing mode of a single top-level @@ -440,18 +440,18 @@ export interface SignerInfo { * that already exist in state. If unset, the verifier can use the required \ * signer address for this position and lookup the public key. */ - publicKey: Any; + publicKey?: Any; /** * mode_info describes the signing mode of the signer and is a nested * structure to support nested multisig pubkey's */ - modeInfo: ModeInfo; + modeInfo?: ModeInfo; /** * sequence is the sequence of the account, which describes the * number of committed transactions signed by a given address. It is used to * prevent replay attacks. */ - sequence: Long; + sequence: bigint; } export interface SignerInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SignerInfo"; @@ -478,7 +478,7 @@ export interface SignerInfoAmino { * number of committed transactions signed by a given address. It is used to * prevent replay attacks. */ - sequence: string; + sequence?: string; } export interface SignerInfoAminoMsg { type: "cosmos-sdk/SignerInfo"; @@ -489,9 +489,9 @@ export interface SignerInfoAminoMsg { * signer. */ export interface SignerInfoSDKType { - public_key: AnySDKType; - mode_info: ModeInfoSDKType; - sequence: Long; + public_key?: AnySDKType; + mode_info?: ModeInfoSDKType; + sequence: bigint; } /** ModeInfo describes the signing mode of a single or nested multisig signer. */ export interface ModeInfo { @@ -540,7 +540,7 @@ export interface ModeInfo_SingleProtoMsg { */ export interface ModeInfo_SingleAmino { /** mode is the signing mode of the single signer */ - mode: SignMode; + mode?: SignMode; } export interface ModeInfo_SingleAminoMsg { type: "cosmos-sdk/Single"; @@ -557,7 +557,7 @@ export interface ModeInfo_SingleSDKType { /** Multi is the mode info for a multisig public key */ export interface ModeInfo_Multi { /** bitarray specifies which keys within the multisig are signing */ - bitarray: CompactBitArray; + bitarray?: CompactBitArray; /** * mode_infos is the corresponding modes of the signers of the multisig * which could include nested multisig public keys @@ -576,7 +576,7 @@ export interface ModeInfo_MultiAmino { * mode_infos is the corresponding modes of the signers of the multisig * which could include nested multisig public keys */ - mode_infos: ModeInfoAmino[]; + mode_infos?: ModeInfoAmino[]; } export interface ModeInfo_MultiAminoMsg { type: "cosmos-sdk/Multi"; @@ -584,7 +584,7 @@ export interface ModeInfo_MultiAminoMsg { } /** Multi is the mode info for a multisig public key */ export interface ModeInfo_MultiSDKType { - bitarray: CompactBitArraySDKType; + bitarray?: CompactBitArraySDKType; mode_infos: ModeInfoSDKType[]; } /** @@ -599,7 +599,7 @@ export interface Fee { * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs */ - gasLimit: Long; + gasLimit: bigint; /** * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. * the payer must be a tx signer (and thus have signed this field in AuthInfo). @@ -624,24 +624,24 @@ export interface FeeProtoMsg { */ export interface FeeAmino { /** amount is the amount of coins to be paid as a fee */ - amount: CoinAmino[]; + amount?: CoinAmino[]; /** * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs */ - gas_limit: string; + gas_limit?: string; /** * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. * the payer must be a tx signer (and thus have signed this field in AuthInfo). * setting this field does *not* change the ordering of required signers for the transaction. */ - payer: string; + payer?: string; /** * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does * not support fee grants, this will fail */ - granter: string; + granter?: string; } export interface FeeAminoMsg { type: "cosmos-sdk/Fee"; @@ -654,7 +654,7 @@ export interface FeeAminoMsg { */ export interface FeeSDKType { amount: CoinSDKType[]; - gas_limit: Long; + gas_limit: bigint; payer: string; granter: string; } @@ -680,9 +680,9 @@ export interface TipProtoMsg { */ export interface TipAmino { /** amount is the amount of the tip */ - amount: CoinAmino[]; + amount?: CoinAmino[]; /** tipper is the address of the account paying for the tip */ - tipper: string; + tipper?: string; } export interface TipAminoMsg { type: "cosmos-sdk/Tip"; @@ -717,7 +717,7 @@ export interface AuxSignerData { * signs. Note: we use the same sign doc even if we're signing with * LEGACY_AMINO_JSON. */ - signDoc: SignDocDirectAux; + signDoc?: SignDocDirectAux; /** mode is the signing mode of the single signer. */ mode: SignMode; /** sig is the signature of the sign doc. */ @@ -741,7 +741,7 @@ export interface AuxSignerDataAmino { * AuxSignerData across different chains, the bech32 prefix of the target * chain (where the final transaction is broadcasted) should be used. */ - address: string; + address?: string; /** * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer * signs. Note: we use the same sign doc even if we're signing with @@ -749,9 +749,9 @@ export interface AuxSignerDataAmino { */ sign_doc?: SignDocDirectAuxAmino; /** mode is the signing mode of the single signer. */ - mode: SignMode; + mode?: SignMode; /** sig is the signature of the sign doc. */ - sig: Uint8Array; + sig?: string; } export interface AuxSignerDataAminoMsg { type: "cosmos-sdk/AuxSignerData"; @@ -767,19 +767,20 @@ export interface AuxSignerDataAminoMsg { */ export interface AuxSignerDataSDKType { address: string; - sign_doc: SignDocDirectAuxSDKType; + sign_doc?: SignDocDirectAuxSDKType; mode: SignMode; sig: Uint8Array; } function createBaseTx(): Tx { return { - body: TxBody.fromPartial({}), - authInfo: AuthInfo.fromPartial({}), + body: undefined, + authInfo: undefined, signatures: [] }; } export const Tx = { - encode(message: Tx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.Tx", + encode(message: Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.body !== undefined) { TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); } @@ -791,8 +792,8 @@ export const Tx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Tx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Tx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTx(); while (reader.pos < end) { @@ -840,20 +841,24 @@ export const Tx = { return message; }, fromAmino(object: TxAmino): Tx { - return { - body: object?.body ? TxBody.fromAmino(object.body) : undefined, - authInfo: object?.auth_info ? AuthInfo.fromAmino(object.auth_info) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseTx(); + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromAmino(object.body); + } + if (object.auth_info !== undefined && object.auth_info !== null) { + message.authInfo = AuthInfo.fromAmino(object.auth_info); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Tx): TxAmino { const obj: any = {}; obj.body = message.body ? TxBody.toAmino(message.body) : undefined; obj.auth_info = message.authInfo ? AuthInfo.toAmino(message.authInfo) : undefined; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { - obj.signatures = []; + obj.signatures = message.signatures; } return obj; }, @@ -887,7 +892,8 @@ function createBaseTxRaw(): TxRaw { }; } export const TxRaw = { - encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.TxRaw", + encode(message: TxRaw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); } @@ -899,8 +905,8 @@ export const TxRaw = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxRaw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxRaw(); while (reader.pos < end) { @@ -948,20 +954,24 @@ export const TxRaw = { return message; }, fromAmino(object: TxRawAmino): TxRaw { - return { - bodyBytes: object.body_bytes, - authInfoBytes: object.auth_info_bytes, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseTxRaw(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: TxRaw): TxRawAmino { const obj: any = {}; - obj.body_bytes = message.bodyBytes; - obj.auth_info_bytes = message.authInfoBytes; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { - obj.signatures = []; + obj.signatures = message.signatures; } return obj; }, @@ -992,11 +1002,12 @@ function createBaseSignDoc(): SignDoc { bodyBytes: new Uint8Array(), authInfoBytes: new Uint8Array(), chainId: "", - accountNumber: Long.UZERO + accountNumber: BigInt(0) }; } export const SignDoc = { - encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.SignDoc", + encode(message: SignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); } @@ -1006,13 +1017,13 @@ export const SignDoc = { if (message.chainId !== "") { writer.uint32(26).string(message.chainId); } - if (!message.accountNumber.isZero()) { + if (message.accountNumber !== BigInt(0)) { writer.uint32(32).uint64(message.accountNumber); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignDoc { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignDoc(); while (reader.pos < end) { @@ -1028,7 +1039,7 @@ export const SignDoc = { message.chainId = reader.string(); break; case 4: - message.accountNumber = (reader.uint64() as Long); + message.accountNumber = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1042,7 +1053,7 @@ export const SignDoc = { bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), authInfoBytes: isSet(object.authInfoBytes) ? bytesFromBase64(object.authInfoBytes) : new Uint8Array(), chainId: isSet(object.chainId) ? String(object.chainId) : "", - accountNumber: isSet(object.accountNumber) ? Long.fromValue(object.accountNumber) : Long.UZERO + accountNumber: isSet(object.accountNumber) ? BigInt(object.accountNumber.toString()) : BigInt(0) }; }, toJSON(message: SignDoc): unknown { @@ -1050,7 +1061,7 @@ export const SignDoc = { message.bodyBytes !== undefined && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); message.authInfoBytes !== undefined && (obj.authInfoBytes = base64FromBytes(message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array())); message.chainId !== undefined && (obj.chainId = message.chainId); - message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); + message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): SignDoc { @@ -1058,23 +1069,31 @@ export const SignDoc = { message.bodyBytes = object.bodyBytes ?? new Uint8Array(); message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); message.chainId = object.chainId ?? ""; - message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? Long.fromValue(object.accountNumber) : Long.UZERO; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); return message; }, fromAmino(object: SignDocAmino): SignDoc { - return { - bodyBytes: object.body_bytes, - authInfoBytes: object.auth_info_bytes, - chainId: object.chain_id, - accountNumber: Long.fromString(object.account_number) - }; + const message = createBaseSignDoc(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + return message; }, toAmino(message: SignDoc): SignDocAmino { const obj: any = {}; - obj.body_bytes = message.bodyBytes; - obj.auth_info_bytes = message.authInfoBytes; - obj.chain_id = message.chainId; - obj.account_number = message.accountNumber ? message.accountNumber.toString() : undefined; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber.toString() : undefined; return obj; }, fromAminoMsg(object: SignDocAminoMsg): SignDoc { @@ -1104,13 +1123,14 @@ function createBaseSignDocDirectAux(): SignDocDirectAux { bodyBytes: new Uint8Array(), publicKey: undefined, chainId: "", - accountNumber: Long.UZERO, - sequence: Long.UZERO, - tip: Tip.fromPartial({}) + accountNumber: BigInt(0), + sequence: BigInt(0), + tip: undefined }; } export const SignDocDirectAux = { - encode(message: SignDocDirectAux, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + encode(message: SignDocDirectAux, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); } @@ -1120,10 +1140,10 @@ export const SignDocDirectAux = { if (message.chainId !== "") { writer.uint32(26).string(message.chainId); } - if (!message.accountNumber.isZero()) { + if (message.accountNumber !== BigInt(0)) { writer.uint32(32).uint64(message.accountNumber); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(40).uint64(message.sequence); } if (message.tip !== undefined) { @@ -1131,8 +1151,8 @@ export const SignDocDirectAux = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignDocDirectAux { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignDocDirectAux { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignDocDirectAux(); while (reader.pos < end) { @@ -1148,10 +1168,10 @@ export const SignDocDirectAux = { message.chainId = reader.string(); break; case 4: - message.accountNumber = (reader.uint64() as Long); + message.accountNumber = reader.uint64(); break; case 5: - message.sequence = (reader.uint64() as Long); + message.sequence = reader.uint64(); break; case 6: message.tip = Tip.decode(reader, reader.uint32()); @@ -1168,8 +1188,8 @@ export const SignDocDirectAux = { bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, chainId: isSet(object.chainId) ? String(object.chainId) : "", - accountNumber: isSet(object.accountNumber) ? Long.fromValue(object.accountNumber) : Long.UZERO, - sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, + accountNumber: isSet(object.accountNumber) ? BigInt(object.accountNumber.toString()) : BigInt(0), + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : undefined }; }, @@ -1178,8 +1198,8 @@ export const SignDocDirectAux = { message.bodyBytes !== undefined && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); message.chainId !== undefined && (obj.chainId = message.chainId); - message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); message.tip !== undefined && (obj.tip = message.tip ? Tip.toJSON(message.tip) : undefined); return obj; }, @@ -1188,28 +1208,40 @@ export const SignDocDirectAux = { message.bodyBytes = object.bodyBytes ?? new Uint8Array(); message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; message.chainId = object.chainId ?? ""; - message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? Long.fromValue(object.accountNumber) : Long.UZERO; - message.sequence = object.sequence !== undefined && object.sequence !== null ? Long.fromValue(object.sequence) : Long.UZERO; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; return message; }, fromAmino(object: SignDocDirectAuxAmino): SignDocDirectAux { - return { - bodyBytes: object.body_bytes, - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - chainId: object.chain_id, - accountNumber: Long.fromString(object.account_number), - sequence: Long.fromString(object.sequence), - tip: object?.tip ? Tip.fromAmino(object.tip) : undefined - }; + const message = createBaseSignDocDirectAux(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; }, toAmino(message: SignDocDirectAux): SignDocDirectAuxAmino { const obj: any = {}; - obj.body_bytes = message.bodyBytes; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; - obj.chain_id = message.chainId; - obj.account_number = message.accountNumber ? message.accountNumber.toString() : undefined; - obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; return obj; }, @@ -1239,20 +1271,21 @@ function createBaseTxBody(): TxBody { return { messages: [], memo: "", - timeoutHeight: Long.UZERO, + timeoutHeight: BigInt(0), extensionOptions: [], nonCriticalExtensionOptions: [] }; } export const TxBody = { - encode(message: TxBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.TxBody", + encode(message: TxBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.memo !== "") { writer.uint32(18).string(message.memo); } - if (!message.timeoutHeight.isZero()) { + if (message.timeoutHeight !== BigInt(0)) { writer.uint32(24).uint64(message.timeoutHeight); } for (const v of message.extensionOptions) { @@ -1263,8 +1296,8 @@ export const TxBody = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxBody { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxBody { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxBody(); while (reader.pos < end) { @@ -1277,7 +1310,7 @@ export const TxBody = { message.memo = reader.string(); break; case 3: - message.timeoutHeight = (reader.uint64() as Long); + message.timeoutHeight = reader.uint64(); break; case 1023: message.extensionOptions.push(Any.decode(reader, reader.uint32())); @@ -1296,7 +1329,7 @@ export const TxBody = { return { messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], memo: isSet(object.memo) ? String(object.memo) : "", - timeoutHeight: isSet(object.timeoutHeight) ? Long.fromValue(object.timeoutHeight) : Long.UZERO, + timeoutHeight: isSet(object.timeoutHeight) ? BigInt(object.timeoutHeight.toString()) : BigInt(0), extensionOptions: Array.isArray(object?.extensionOptions) ? object.extensionOptions.map((e: any) => Any.fromJSON(e)) : [], nonCriticalExtensionOptions: Array.isArray(object?.nonCriticalExtensionOptions) ? object.nonCriticalExtensionOptions.map((e: any) => Any.fromJSON(e)) : [] }; @@ -1309,7 +1342,7 @@ export const TxBody = { obj.messages = []; } message.memo !== undefined && (obj.memo = message.memo); - message.timeoutHeight !== undefined && (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + message.timeoutHeight !== undefined && (obj.timeoutHeight = (message.timeoutHeight || BigInt(0)).toString()); if (message.extensionOptions) { obj.extensionOptions = message.extensionOptions.map(e => e ? Any.toJSON(e) : undefined); } else { @@ -1326,38 +1359,42 @@ export const TxBody = { const message = createBaseTxBody(); message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; message.memo = object.memo ?? ""; - message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Long.fromValue(object.timeoutHeight) : Long.UZERO; + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? BigInt(object.timeoutHeight.toString()) : BigInt(0); message.extensionOptions = object.extensionOptions?.map(e => Any.fromPartial(e)) || []; message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: TxBodyAmino): TxBody { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - memo: object.memo, - timeoutHeight: Long.fromString(object.timeout_height), - extensionOptions: Array.isArray(object?.extension_options) ? object.extension_options.map((e: any) => Any.fromAmino(e)) : [], - nonCriticalExtensionOptions: Array.isArray(object?.non_critical_extension_options) ? object.non_critical_extension_options.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + message.extensionOptions = object.extension_options?.map(e => Any.fromAmino(e)) || []; + message.nonCriticalExtensionOptions = object.non_critical_extension_options?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: TxBody): TxBodyAmino { const obj: any = {}; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.messages = []; + obj.messages = message.messages; } - obj.memo = message.memo; - obj.timeout_height = message.timeoutHeight ? message.timeoutHeight.toString() : undefined; + obj.memo = message.memo === "" ? undefined : message.memo; + obj.timeout_height = message.timeoutHeight !== BigInt(0) ? message.timeoutHeight.toString() : undefined; if (message.extensionOptions) { obj.extension_options = message.extensionOptions.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.extension_options = []; + obj.extension_options = message.extensionOptions; } if (message.nonCriticalExtensionOptions) { obj.non_critical_extension_options = message.nonCriticalExtensionOptions.map(e => e ? Any.toAmino(e) : undefined); } else { - obj.non_critical_extension_options = []; + obj.non_critical_extension_options = message.nonCriticalExtensionOptions; } return obj; }, @@ -1386,12 +1423,13 @@ export const TxBody = { function createBaseAuthInfo(): AuthInfo { return { signerInfos: [], - fee: Fee.fromPartial({}), - tip: Tip.fromPartial({}) + fee: undefined, + tip: undefined }; } export const AuthInfo = { - encode(message: AuthInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + encode(message: AuthInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signerInfos) { SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1403,8 +1441,8 @@ export const AuthInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AuthInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAuthInfo(); while (reader.pos < end) { @@ -1452,18 +1490,22 @@ export const AuthInfo = { return message; }, fromAmino(object: AuthInfoAmino): AuthInfo { - return { - signerInfos: Array.isArray(object?.signer_infos) ? object.signer_infos.map((e: any) => SignerInfo.fromAmino(e)) : [], - fee: object?.fee ? Fee.fromAmino(object.fee) : undefined, - tip: object?.tip ? Tip.fromAmino(object.tip) : undefined - }; + const message = createBaseAuthInfo(); + message.signerInfos = object.signer_infos?.map(e => SignerInfo.fromAmino(e)) || []; + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; }, toAmino(message: AuthInfo): AuthInfoAmino { const obj: any = {}; if (message.signerInfos) { obj.signer_infos = message.signerInfos.map(e => e ? SignerInfo.toAmino(e) : undefined); } else { - obj.signer_infos = []; + obj.signer_infos = message.signerInfos; } obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; @@ -1494,25 +1536,26 @@ export const AuthInfo = { function createBaseSignerInfo(): SignerInfo { return { publicKey: undefined, - modeInfo: ModeInfo.fromPartial({}), - sequence: Long.UZERO + modeInfo: undefined, + sequence: BigInt(0) }; } export const SignerInfo = { - encode(message: SignerInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + encode(message: SignerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); } if (message.modeInfo !== undefined) { ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignerInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignerInfo(); while (reader.pos < end) { @@ -1525,7 +1568,7 @@ export const SignerInfo = { message.modeInfo = ModeInfo.decode(reader, reader.uint32()); break; case 3: - message.sequence = (reader.uint64() as Long); + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1538,35 +1581,41 @@ export const SignerInfo = { return { publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, modeInfo: isSet(object.modeInfo) ? ModeInfo.fromJSON(object.modeInfo) : undefined, - sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) }; }, toJSON(message: SignerInfo): unknown { const obj: any = {}; message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); message.modeInfo !== undefined && (obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): SignerInfo { const message = createBaseSignerInfo(); message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; message.modeInfo = object.modeInfo !== undefined && object.modeInfo !== null ? ModeInfo.fromPartial(object.modeInfo) : undefined; - message.sequence = object.sequence !== undefined && object.sequence !== null ? Long.fromValue(object.sequence) : Long.UZERO; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); return message; }, fromAmino(object: SignerInfoAmino): SignerInfo { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - modeInfo: object?.mode_info ? ModeInfo.fromAmino(object.mode_info) : undefined, - sequence: Long.fromString(object.sequence) - }; + const message = createBaseSignerInfo(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.mode_info !== undefined && object.mode_info !== null) { + message.modeInfo = ModeInfo.fromAmino(object.mode_info); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: SignerInfo): SignerInfoAmino { const obj: any = {}; obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; obj.mode_info = message.modeInfo ? ModeInfo.toAmino(message.modeInfo) : undefined; - obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; return obj; }, fromAminoMsg(object: SignerInfoAminoMsg): SignerInfo { @@ -1598,7 +1647,8 @@ function createBaseModeInfo(): ModeInfo { }; } export const ModeInfo = { - encode(message: ModeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + encode(message: ModeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.single !== undefined) { ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); } @@ -1607,8 +1657,8 @@ export const ModeInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModeInfo(); while (reader.pos < end) { @@ -1646,10 +1696,14 @@ export const ModeInfo = { return message; }, fromAmino(object: ModeInfoAmino): ModeInfo { - return { - single: object?.single ? ModeInfo_Single.fromAmino(object.single) : undefined, - multi: object?.multi ? ModeInfo_Multi.fromAmino(object.multi) : undefined - }; + const message = createBaseModeInfo(); + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromAmino(object.multi); + } + return message; }, toAmino(message: ModeInfo): ModeInfoAmino { const obj: any = {}; @@ -1685,14 +1739,15 @@ function createBaseModeInfo_Single(): ModeInfo_Single { }; } export const ModeInfo_Single = { - encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.Single", + encode(message: ModeInfo_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModeInfo_Single(); while (reader.pos < end) { @@ -1710,7 +1765,7 @@ export const ModeInfo_Single = { }, fromJSON(object: any): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toJSON(message: ModeInfo_Single): unknown { @@ -1724,13 +1779,15 @@ export const ModeInfo_Single = { return message; }, fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { - return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 - }; + const message = createBaseModeInfo_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + return message; }, toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { const obj: any = {}; - obj.mode = message.mode; + obj.mode = message.mode === 0 ? undefined : message.mode; return obj; }, fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { @@ -1757,12 +1814,13 @@ export const ModeInfo_Single = { }; function createBaseModeInfo_Multi(): ModeInfo_Multi { return { - bitarray: CompactBitArray.fromPartial({}), + bitarray: undefined, modeInfos: [] }; } export const ModeInfo_Multi = { - encode(message: ModeInfo_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.Multi", + encode(message: ModeInfo_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bitarray !== undefined) { CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); } @@ -1771,8 +1829,8 @@ export const ModeInfo_Multi = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModeInfo_Multi(); while (reader.pos < end) { @@ -1814,10 +1872,12 @@ export const ModeInfo_Multi = { return message; }, fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { - return { - bitarray: object?.bitarray ? CompactBitArray.fromAmino(object.bitarray) : undefined, - modeInfos: Array.isArray(object?.mode_infos) ? object.mode_infos.map((e: any) => ModeInfo.fromAmino(e)) : [] - }; + const message = createBaseModeInfo_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.modeInfos = object.mode_infos?.map(e => ModeInfo.fromAmino(e)) || []; + return message; }, toAmino(message: ModeInfo_Multi): ModeInfo_MultiAmino { const obj: any = {}; @@ -1825,7 +1885,7 @@ export const ModeInfo_Multi = { if (message.modeInfos) { obj.mode_infos = message.modeInfos.map(e => e ? ModeInfo.toAmino(e) : undefined); } else { - obj.mode_infos = []; + obj.mode_infos = message.modeInfos; } return obj; }, @@ -1854,17 +1914,18 @@ export const ModeInfo_Multi = { function createBaseFee(): Fee { return { amount: [], - gasLimit: Long.UZERO, + gasLimit: BigInt(0), payer: "", granter: "" }; } export const Fee = { - encode(message: Fee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.Fee", + encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (!message.gasLimit.isZero()) { + if (message.gasLimit !== BigInt(0)) { writer.uint32(16).uint64(message.gasLimit); } if (message.payer !== "") { @@ -1875,8 +1936,8 @@ export const Fee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Fee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFee(); while (reader.pos < end) { @@ -1886,7 +1947,7 @@ export const Fee = { message.amount.push(Coin.decode(reader, reader.uint32())); break; case 2: - message.gasLimit = (reader.uint64() as Long); + message.gasLimit = reader.uint64(); break; case 3: message.payer = reader.string(); @@ -1904,7 +1965,7 @@ export const Fee = { fromJSON(object: any): Fee { return { amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], - gasLimit: isSet(object.gasLimit) ? Long.fromValue(object.gasLimit) : Long.UZERO, + gasLimit: isSet(object.gasLimit) ? BigInt(object.gasLimit.toString()) : BigInt(0), payer: isSet(object.payer) ? String(object.payer) : "", granter: isSet(object.granter) ? String(object.granter) : "" }; @@ -1916,7 +1977,7 @@ export const Fee = { } else { obj.amount = []; } - message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString()); + message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || BigInt(0)).toString()); message.payer !== undefined && (obj.payer = message.payer); message.granter !== undefined && (obj.granter = message.granter); return obj; @@ -1924,29 +1985,35 @@ export const Fee = { fromPartial(object: Partial): Fee { const message = createBaseFee(); message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; - message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? Long.fromValue(object.gasLimit) : Long.UZERO; + message.gasLimit = object.gasLimit !== undefined && object.gasLimit !== null ? BigInt(object.gasLimit.toString()) : BigInt(0); message.payer = object.payer ?? ""; message.granter = object.granter ?? ""; return message; }, fromAmino(object: FeeAmino): Fee { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - gasLimit: Long.fromString(object.gas_limit), - payer: object.payer, - granter: object.granter - }; + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; }, toAmino(message: Fee): FeeAmino { const obj: any = {}; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } - obj.gas_limit = message.gasLimit ? message.gasLimit.toString() : undefined; - obj.payer = message.payer; - obj.granter = message.granter; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit.toString() : undefined; + obj.payer = message.payer === "" ? undefined : message.payer; + obj.granter = message.granter === "" ? undefined : message.granter; return obj; }, fromAminoMsg(object: FeeAminoMsg): Fee { @@ -1978,7 +2045,8 @@ function createBaseTip(): Tip { }; } export const Tip = { - encode(message: Tip, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.Tip", + encode(message: Tip, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1987,8 +2055,8 @@ export const Tip = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Tip { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Tip { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTip(); while (reader.pos < end) { @@ -2030,19 +2098,21 @@ export const Tip = { return message; }, fromAmino(object: TipAmino): Tip { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - tipper: object.tipper - }; + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.tipper !== undefined && object.tipper !== null) { + message.tipper = object.tipper; + } + return message; }, toAmino(message: Tip): TipAmino { const obj: any = {}; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } - obj.tipper = message.tipper; + obj.tipper = message.tipper === "" ? undefined : message.tipper; return obj; }, fromAminoMsg(object: TipAminoMsg): Tip { @@ -2070,13 +2140,14 @@ export const Tip = { function createBaseAuxSignerData(): AuxSignerData { return { address: "", - signDoc: SignDocDirectAux.fromPartial({}), + signDoc: undefined, mode: 0, sig: new Uint8Array() }; } export const AuxSignerData = { - encode(message: AuxSignerData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + encode(message: AuxSignerData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -2091,8 +2162,8 @@ export const AuxSignerData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AuxSignerData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AuxSignerData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAuxSignerData(); while (reader.pos < end) { @@ -2121,7 +2192,7 @@ export const AuxSignerData = { return { address: isSet(object.address) ? String(object.address) : "", signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, @@ -2142,19 +2213,27 @@ export const AuxSignerData = { return message; }, fromAmino(object: AuxSignerDataAmino): AuxSignerData { - return { - address: object.address, - signDoc: object?.sign_doc ? SignDocDirectAux.fromAmino(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, - sig: object.sig - }; + const message = createBaseAuxSignerData(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.sign_doc !== undefined && object.sign_doc !== null) { + message.signDoc = SignDocDirectAux.fromAmino(object.sign_doc); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + if (object.sig !== undefined && object.sig !== null) { + message.sig = bytesFromBase64(object.sig); + } + return message; }, toAmino(message: AuxSignerData): AuxSignerDataAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.sign_doc = message.signDoc ? SignDocDirectAux.toAmino(message.signDoc) : undefined; - obj.mode = message.mode; - obj.sig = message.sig; + obj.mode = message.mode === 0 ? undefined : message.mode; + obj.sig = message.sig ? base64FromBytes(message.sig) : undefined; return obj; }, fromAminoMsg(object: AuxSignerDataAminoMsg): AuxSignerData { diff --git a/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts b/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts index a57b5ac5..40543d68 100644 --- a/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts +++ b/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryCurrentPlanRequest, QueryCurrentPlanResponseSDKType, QueryAppliedPlanRequest, QueryAppliedPlanResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType, QueryModuleVersionsRequest, QueryModuleVersionsResponseSDKType, QueryAuthorityRequest, QueryAuthorityResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts index 3fd0abd7..042c6fde 100644 --- a/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts +++ b/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; /** Query defines the gRPC upgrade querier service. */ @@ -43,27 +43,27 @@ export class QueryClientImpl implements Query { currentPlan(request: QueryCurrentPlanRequest = {}): Promise { const data = QueryCurrentPlanRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "CurrentPlan", data); - return promise.then(data => QueryCurrentPlanResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryCurrentPlanResponse.decode(new BinaryReader(data))); } appliedPlan(request: QueryAppliedPlanRequest): Promise { const data = QueryAppliedPlanRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "AppliedPlan", data); - return promise.then(data => QueryAppliedPlanResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAppliedPlanResponse.decode(new BinaryReader(data))); } upgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise { const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "UpgradedConsensusState", data); - return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data))); } moduleVersions(request: QueryModuleVersionsRequest): Promise { const data = QueryModuleVersionsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); - return promise.then(data => QueryModuleVersionsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryModuleVersionsResponse.decode(new BinaryReader(data))); } authority(request: QueryAuthorityRequest = {}): Promise { const data = QueryAuthorityRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "Authority", data); - return promise.then(data => QueryAuthorityResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAuthorityResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.ts b/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.ts index 730ac545..1dc03091 100644 --- a/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.ts +++ b/packages/api/src/codegen/cosmos/upgrade/v1beta1/query.ts @@ -1,6 +1,6 @@ import { Plan, PlanAmino, PlanSDKType, ModuleVersion, ModuleVersionAmino, ModuleVersionSDKType } from "./upgrade"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC * method. @@ -30,7 +30,7 @@ export interface QueryCurrentPlanRequestSDKType {} */ export interface QueryCurrentPlanResponse { /** plan is the current upgrade plan. */ - plan: Plan; + plan?: Plan; } export interface QueryCurrentPlanResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse"; @@ -53,7 +53,7 @@ export interface QueryCurrentPlanResponseAminoMsg { * method. */ export interface QueryCurrentPlanResponseSDKType { - plan: PlanSDKType; + plan?: PlanSDKType; } /** * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC @@ -73,7 +73,7 @@ export interface QueryAppliedPlanRequestProtoMsg { */ export interface QueryAppliedPlanRequestAmino { /** name is the name of the applied plan to query for. */ - name: string; + name?: string; } export interface QueryAppliedPlanRequestAminoMsg { type: "cosmos-sdk/QueryAppliedPlanRequest"; @@ -92,7 +92,7 @@ export interface QueryAppliedPlanRequestSDKType { */ export interface QueryAppliedPlanResponse { /** height is the block height at which the plan was applied. */ - height: Long; + height: bigint; } export interface QueryAppliedPlanResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse"; @@ -104,7 +104,7 @@ export interface QueryAppliedPlanResponseProtoMsg { */ export interface QueryAppliedPlanResponseAmino { /** height is the block height at which the plan was applied. */ - height: string; + height?: string; } export interface QueryAppliedPlanResponseAminoMsg { type: "cosmos-sdk/QueryAppliedPlanResponse"; @@ -115,7 +115,7 @@ export interface QueryAppliedPlanResponseAminoMsg { * method. */ export interface QueryAppliedPlanResponseSDKType { - height: Long; + height: bigint; } /** * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState @@ -127,7 +127,7 @@ export interface QueryUpgradedConsensusStateRequest { * last height of the current chain must be sent in request * as this is the height under which next consensus state is stored */ - lastHeight: Long; + lastHeight: bigint; } export interface QueryUpgradedConsensusStateRequestProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest"; @@ -143,7 +143,7 @@ export interface QueryUpgradedConsensusStateRequestAmino { * last height of the current chain must be sent in request * as this is the height under which next consensus state is stored */ - last_height: string; + last_height?: string; } export interface QueryUpgradedConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryUpgradedConsensusStateRequest"; @@ -155,7 +155,7 @@ export interface QueryUpgradedConsensusStateRequestAminoMsg { */ /** @deprecated */ export interface QueryUpgradedConsensusStateRequestSDKType { - last_height: Long; + last_height: bigint; } /** * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState @@ -177,7 +177,7 @@ export interface QueryUpgradedConsensusStateResponseProtoMsg { /** @deprecated */ export interface QueryUpgradedConsensusStateResponseAmino { /** Since: cosmos-sdk 0.43 */ - upgraded_consensus_state: Uint8Array; + upgraded_consensus_state?: string; } export interface QueryUpgradedConsensusStateResponseAminoMsg { type: "cosmos-sdk/QueryUpgradedConsensusStateResponse"; @@ -221,7 +221,7 @@ export interface QueryModuleVersionsRequestAmino { * consensus version from state. Leaving this empty will * fetch the full list of module versions from state */ - module_name: string; + module_name?: string; } export interface QueryModuleVersionsRequestAminoMsg { type: "cosmos-sdk/QueryModuleVersionsRequest"; @@ -258,7 +258,7 @@ export interface QueryModuleVersionsResponseProtoMsg { */ export interface QueryModuleVersionsResponseAmino { /** module_versions is a list of module names with their consensus versions. */ - module_versions: ModuleVersionAmino[]; + module_versions?: ModuleVersionAmino[]; } export interface QueryModuleVersionsResponseAminoMsg { type: "cosmos-sdk/QueryModuleVersionsResponse"; @@ -317,7 +317,7 @@ export interface QueryAuthorityResponseProtoMsg { * Since: cosmos-sdk 0.46 */ export interface QueryAuthorityResponseAmino { - address: string; + address?: string; } export interface QueryAuthorityResponseAminoMsg { type: "cosmos-sdk/QueryAuthorityResponse"; @@ -335,11 +335,12 @@ function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { return {}; } export const QueryCurrentPlanRequest = { - encode(_: QueryCurrentPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", + encode(_: QueryCurrentPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentPlanRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCurrentPlanRequest(); while (reader.pos < end) { @@ -364,7 +365,8 @@ export const QueryCurrentPlanRequest = { return message; }, fromAmino(_: QueryCurrentPlanRequestAmino): QueryCurrentPlanRequest { - return {}; + const message = createBaseQueryCurrentPlanRequest(); + return message; }, toAmino(_: QueryCurrentPlanRequest): QueryCurrentPlanRequestAmino { const obj: any = {}; @@ -394,18 +396,19 @@ export const QueryCurrentPlanRequest = { }; function createBaseQueryCurrentPlanResponse(): QueryCurrentPlanResponse { return { - plan: Plan.fromPartial({}) + plan: undefined }; } export const QueryCurrentPlanResponse = { - encode(message: QueryCurrentPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", + encode(message: QueryCurrentPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.plan !== undefined) { Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentPlanResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCurrentPlanResponse(); while (reader.pos < end) { @@ -437,9 +440,11 @@ export const QueryCurrentPlanResponse = { return message; }, fromAmino(object: QueryCurrentPlanResponseAmino): QueryCurrentPlanResponse { - return { - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined - }; + const message = createBaseQueryCurrentPlanResponse(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; }, toAmino(message: QueryCurrentPlanResponse): QueryCurrentPlanResponseAmino { const obj: any = {}; @@ -474,14 +479,15 @@ function createBaseQueryAppliedPlanRequest(): QueryAppliedPlanRequest { }; } export const QueryAppliedPlanRequest = { - encode(message: QueryAppliedPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", + encode(message: QueryAppliedPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAppliedPlanRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAppliedPlanRequest(); while (reader.pos < end) { @@ -513,13 +519,15 @@ export const QueryAppliedPlanRequest = { return message; }, fromAmino(object: QueryAppliedPlanRequestAmino): QueryAppliedPlanRequest { - return { - name: object.name - }; + const message = createBaseQueryAppliedPlanRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: QueryAppliedPlanRequest): QueryAppliedPlanRequestAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; return obj; }, fromAminoMsg(object: QueryAppliedPlanRequestAminoMsg): QueryAppliedPlanRequest { @@ -546,25 +554,26 @@ export const QueryAppliedPlanRequest = { }; function createBaseQueryAppliedPlanResponse(): QueryAppliedPlanResponse { return { - height: Long.ZERO + height: BigInt(0) }; } export const QueryAppliedPlanResponse = { - encode(message: QueryAppliedPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", + encode(message: QueryAppliedPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAppliedPlanResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAppliedPlanResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -575,27 +584,29 @@ export const QueryAppliedPlanResponse = { }, fromJSON(object: any): QueryAppliedPlanResponse { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) }; }, toJSON(message: QueryAppliedPlanResponse): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryAppliedPlanResponse { const message = createBaseQueryAppliedPlanResponse(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: QueryAppliedPlanResponseAmino): QueryAppliedPlanResponse { - return { - height: Long.fromString(object.height) - }; + const message = createBaseQueryAppliedPlanResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: QueryAppliedPlanResponse): QueryAppliedPlanResponseAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; return obj; }, fromAminoMsg(object: QueryAppliedPlanResponseAminoMsg): QueryAppliedPlanResponse { @@ -622,25 +633,26 @@ export const QueryAppliedPlanResponse = { }; function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { return { - lastHeight: Long.ZERO + lastHeight: BigInt(0) }; } export const QueryUpgradedConsensusStateRequest = { - encode(message: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.lastHeight.isZero()) { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", + encode(message: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastHeight !== BigInt(0)) { writer.uint32(8).int64(message.lastHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.lastHeight = (reader.int64() as Long); + message.lastHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -651,27 +663,29 @@ export const QueryUpgradedConsensusStateRequest = { }, fromJSON(object: any): QueryUpgradedConsensusStateRequest { return { - lastHeight: isSet(object.lastHeight) ? Long.fromValue(object.lastHeight) : Long.ZERO + lastHeight: isSet(object.lastHeight) ? BigInt(object.lastHeight.toString()) : BigInt(0) }; }, toJSON(message: QueryUpgradedConsensusStateRequest): unknown { const obj: any = {}; - message.lastHeight !== undefined && (obj.lastHeight = (message.lastHeight || Long.ZERO).toString()); + message.lastHeight !== undefined && (obj.lastHeight = (message.lastHeight || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryUpgradedConsensusStateRequest { const message = createBaseQueryUpgradedConsensusStateRequest(); - message.lastHeight = object.lastHeight !== undefined && object.lastHeight !== null ? Long.fromValue(object.lastHeight) : Long.ZERO; + message.lastHeight = object.lastHeight !== undefined && object.lastHeight !== null ? BigInt(object.lastHeight.toString()) : BigInt(0); return message; }, fromAmino(object: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { - return { - lastHeight: Long.fromString(object.last_height) - }; + const message = createBaseQueryUpgradedConsensusStateRequest(); + if (object.last_height !== undefined && object.last_height !== null) { + message.lastHeight = BigInt(object.last_height); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { const obj: any = {}; - obj.last_height = message.lastHeight ? message.lastHeight.toString() : undefined; + obj.last_height = message.lastHeight !== BigInt(0) ? message.lastHeight.toString() : undefined; return obj; }, fromAminoMsg(object: QueryUpgradedConsensusStateRequestAminoMsg): QueryUpgradedConsensusStateRequest { @@ -702,14 +716,15 @@ function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensus }; } export const QueryUpgradedConsensusStateResponse = { - encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", + encode(message: QueryUpgradedConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.upgradedConsensusState.length !== 0) { writer.uint32(18).bytes(message.upgradedConsensusState); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateResponse(); while (reader.pos < end) { @@ -741,13 +756,15 @@ export const QueryUpgradedConsensusStateResponse = { return message; }, fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { - return { - upgradedConsensusState: object.upgraded_consensus_state - }; + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = bytesFromBase64(object.upgraded_consensus_state); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { const obj: any = {}; - obj.upgraded_consensus_state = message.upgradedConsensusState; + obj.upgraded_consensus_state = message.upgradedConsensusState ? base64FromBytes(message.upgradedConsensusState) : undefined; return obj; }, fromAminoMsg(object: QueryUpgradedConsensusStateResponseAminoMsg): QueryUpgradedConsensusStateResponse { @@ -778,14 +795,15 @@ function createBaseQueryModuleVersionsRequest(): QueryModuleVersionsRequest { }; } export const QueryModuleVersionsRequest = { - encode(message: QueryModuleVersionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", + encode(message: QueryModuleVersionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moduleName !== "") { writer.uint32(10).string(message.moduleName); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleVersionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleVersionsRequest(); while (reader.pos < end) { @@ -817,13 +835,15 @@ export const QueryModuleVersionsRequest = { return message; }, fromAmino(object: QueryModuleVersionsRequestAmino): QueryModuleVersionsRequest { - return { - moduleName: object.module_name - }; + const message = createBaseQueryModuleVersionsRequest(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + return message; }, toAmino(message: QueryModuleVersionsRequest): QueryModuleVersionsRequestAmino { const obj: any = {}; - obj.module_name = message.moduleName; + obj.module_name = message.moduleName === "" ? undefined : message.moduleName; return obj; }, fromAminoMsg(object: QueryModuleVersionsRequestAminoMsg): QueryModuleVersionsRequest { @@ -854,14 +874,15 @@ function createBaseQueryModuleVersionsResponse(): QueryModuleVersionsResponse { }; } export const QueryModuleVersionsResponse = { - encode(message: QueryModuleVersionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", + encode(message: QueryModuleVersionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.moduleVersions) { ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleVersionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleVersionsResponse(); while (reader.pos < end) { @@ -897,16 +918,16 @@ export const QueryModuleVersionsResponse = { return message; }, fromAmino(object: QueryModuleVersionsResponseAmino): QueryModuleVersionsResponse { - return { - moduleVersions: Array.isArray(object?.module_versions) ? object.module_versions.map((e: any) => ModuleVersion.fromAmino(e)) : [] - }; + const message = createBaseQueryModuleVersionsResponse(); + message.moduleVersions = object.module_versions?.map(e => ModuleVersion.fromAmino(e)) || []; + return message; }, toAmino(message: QueryModuleVersionsResponse): QueryModuleVersionsResponseAmino { const obj: any = {}; if (message.moduleVersions) { obj.module_versions = message.moduleVersions.map(e => e ? ModuleVersion.toAmino(e) : undefined); } else { - obj.module_versions = []; + obj.module_versions = message.moduleVersions; } return obj; }, @@ -936,11 +957,12 @@ function createBaseQueryAuthorityRequest(): QueryAuthorityRequest { return {}; } export const QueryAuthorityRequest = { - encode(_: QueryAuthorityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + encode(_: QueryAuthorityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAuthorityRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAuthorityRequest(); while (reader.pos < end) { @@ -965,7 +987,8 @@ export const QueryAuthorityRequest = { return message; }, fromAmino(_: QueryAuthorityRequestAmino): QueryAuthorityRequest { - return {}; + const message = createBaseQueryAuthorityRequest(); + return message; }, toAmino(_: QueryAuthorityRequest): QueryAuthorityRequestAmino { const obj: any = {}; @@ -999,14 +1022,15 @@ function createBaseQueryAuthorityResponse(): QueryAuthorityResponse { }; } export const QueryAuthorityResponse = { - encode(message: QueryAuthorityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + encode(message: QueryAuthorityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAuthorityResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAuthorityResponse(); while (reader.pos < end) { @@ -1038,13 +1062,15 @@ export const QueryAuthorityResponse = { return message; }, fromAmino(object: QueryAuthorityResponseAmino): QueryAuthorityResponse { - return { - address: object.address - }; + const message = createBaseQueryAuthorityResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryAuthorityResponse): QueryAuthorityResponseAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; return obj; }, fromAminoMsg(object: QueryAuthorityResponseAminoMsg): QueryAuthorityResponse { diff --git a/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts index d55eb7c7..cbef95a8 100644 --- a/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgSoftwareUpgrade, MsgSoftwareUpgradeResponse, MsgCancelUpgrade, MsgCancelUpgradeResponse } from "./tx"; /** Msg defines the upgrade Msg service. */ export interface Msg { @@ -27,11 +27,11 @@ export class MsgClientImpl implements Msg { softwareUpgrade(request: MsgSoftwareUpgrade): Promise { const data = MsgSoftwareUpgrade.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); - return promise.then(data => MsgSoftwareUpgradeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSoftwareUpgradeResponse.decode(new BinaryReader(data))); } cancelUpgrade(request: MsgCancelUpgrade): Promise { const data = MsgCancelUpgrade.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); - return promise.then(data => MsgCancelUpgradeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCancelUpgradeResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.ts index aee8f18d..53b7baec 100644 --- a/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/upgrade/v1beta1/tx.ts @@ -1,5 +1,5 @@ import { Plan, PlanAmino, PlanSDKType } from "./upgrade"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. @@ -23,7 +23,7 @@ export interface MsgSoftwareUpgradeProtoMsg { */ export interface MsgSoftwareUpgradeAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** plan is the upgrade plan. */ plan?: PlanAmino; } @@ -86,7 +86,7 @@ export interface MsgCancelUpgradeProtoMsg { */ export interface MsgCancelUpgradeAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; } export interface MsgCancelUpgradeAminoMsg { type: "cosmos-sdk/MsgCancelUpgrade"; @@ -133,7 +133,8 @@ function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { }; } export const MsgSoftwareUpgrade = { - encode(message: MsgSoftwareUpgrade, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + encode(message: MsgSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -142,8 +143,8 @@ export const MsgSoftwareUpgrade = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSoftwareUpgrade { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSoftwareUpgrade(); while (reader.pos < end) { @@ -181,14 +182,18 @@ export const MsgSoftwareUpgrade = { return message; }, fromAmino(object: MsgSoftwareUpgradeAmino): MsgSoftwareUpgrade { - return { - authority: object.authority, - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined - }; + const message = createBaseMsgSoftwareUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; }, toAmino(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAmino { const obj: any = {}; - obj.authority = message.authority; + obj.authority = message.authority === "" ? undefined : message.authority; obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; return obj; }, @@ -218,11 +223,12 @@ function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { return {}; } export const MsgSoftwareUpgradeResponse = { - encode(_: MsgSoftwareUpgradeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + encode(_: MsgSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSoftwareUpgradeResponse(); while (reader.pos < end) { @@ -247,7 +253,8 @@ export const MsgSoftwareUpgradeResponse = { return message; }, fromAmino(_: MsgSoftwareUpgradeResponseAmino): MsgSoftwareUpgradeResponse { - return {}; + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; }, toAmino(_: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAmino { const obj: any = {}; @@ -281,14 +288,15 @@ function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { }; } export const MsgCancelUpgrade = { - encode(message: MsgCancelUpgrade, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + encode(message: MsgCancelUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUpgrade { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUpgrade(); while (reader.pos < end) { @@ -320,13 +328,15 @@ export const MsgCancelUpgrade = { return message; }, fromAmino(object: MsgCancelUpgradeAmino): MsgCancelUpgrade { - return { - authority: object.authority - }; + const message = createBaseMsgCancelUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; }, toAmino(message: MsgCancelUpgrade): MsgCancelUpgradeAmino { const obj: any = {}; - obj.authority = message.authority; + obj.authority = message.authority === "" ? undefined : message.authority; return obj; }, fromAminoMsg(object: MsgCancelUpgradeAminoMsg): MsgCancelUpgrade { @@ -355,11 +365,12 @@ function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { return {}; } export const MsgCancelUpgradeResponse = { - encode(_: MsgCancelUpgradeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + encode(_: MsgCancelUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUpgradeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUpgradeResponse(); while (reader.pos < end) { @@ -384,7 +395,8 @@ export const MsgCancelUpgradeResponse = { return message; }, fromAmino(_: MsgCancelUpgradeResponseAmino): MsgCancelUpgradeResponse { - return {}; + const message = createBaseMsgCancelUpgradeResponse(); + return message; }, toAmino(_: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/packages/api/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts index 9f76a588..3910122a 100644 --- a/packages/api/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts +++ b/packages/api/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts @@ -1,7 +1,7 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** Plan specifies information about a planned upgrade and when it should occur. */ export interface Plan { /** @@ -25,7 +25,7 @@ export interface Plan { * The height at which the upgrade must be performed. * Only used if Time is not set. */ - height: Long; + height: bigint; /** * Any application specific upgrade info to be included on-chain * such as a git commit that validators could automatically upgrade to @@ -37,7 +37,7 @@ export interface Plan { * If this field is not empty, an error will be thrown. */ /** @deprecated */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface PlanProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.Plan"; @@ -54,24 +54,24 @@ export interface PlanAmino { * assumed that the software is out-of-date when the upgrade Time or Height is * reached and the software will exit. */ - name: string; + 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?: TimestampAmino; + time?: string; /** * The height at which the upgrade must be performed. * Only used if Time is not set. */ - height: string; + 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; + info?: string; /** * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been * moved to the IBC module in the sub module 02-client. @@ -89,10 +89,10 @@ export interface PlanSDKType { name: string; /** @deprecated */ time: TimestampSDKType; - height: Long; + height: bigint; info: string; /** @deprecated */ - upgraded_client_state: AnySDKType; + upgraded_client_state?: AnySDKType; } /** * SoftwareUpgradeProposal is a gov Content type for initiating a software @@ -102,7 +102,7 @@ export interface PlanSDKType { */ /** @deprecated */ export interface SoftwareUpgradeProposal { - $typeUrl?: string; + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; title: string; description: string; plan: Plan; @@ -119,8 +119,8 @@ export interface SoftwareUpgradeProposalProtoMsg { */ /** @deprecated */ export interface SoftwareUpgradeProposalAmino { - title: string; - description: string; + title?: string; + description?: string; plan?: PlanAmino; } export interface SoftwareUpgradeProposalAminoMsg { @@ -135,7 +135,7 @@ export interface SoftwareUpgradeProposalAminoMsg { */ /** @deprecated */ export interface SoftwareUpgradeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; title: string; description: string; plan: PlanSDKType; @@ -148,7 +148,7 @@ export interface SoftwareUpgradeProposalSDKType { */ /** @deprecated */ export interface CancelSoftwareUpgradeProposal { - $typeUrl?: string; + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; title: string; description: string; } @@ -164,8 +164,8 @@ export interface CancelSoftwareUpgradeProposalProtoMsg { */ /** @deprecated */ export interface CancelSoftwareUpgradeProposalAmino { - title: string; - description: string; + title?: string; + description?: string; } export interface CancelSoftwareUpgradeProposalAminoMsg { type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; @@ -179,7 +179,7 @@ export interface CancelSoftwareUpgradeProposalAminoMsg { */ /** @deprecated */ export interface CancelSoftwareUpgradeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; title: string; description: string; } @@ -192,7 +192,7 @@ export interface ModuleVersion { /** name of the app module */ name: string; /** consensus version of the app module */ - version: Long; + version: bigint; } export interface ModuleVersionProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion"; @@ -205,9 +205,9 @@ export interface ModuleVersionProtoMsg { */ export interface ModuleVersionAmino { /** name of the app module */ - name: string; + name?: string; /** consensus version of the app module */ - version: string; + version?: string; } export interface ModuleVersionAminoMsg { type: "cosmos-sdk/ModuleVersion"; @@ -220,26 +220,27 @@ export interface ModuleVersionAminoMsg { */ export interface ModuleVersionSDKType { name: string; - version: Long; + version: bigint; } function createBasePlan(): Plan { return { name: "", - time: undefined, - height: Long.ZERO, + time: Timestamp.fromPartial({}), + height: BigInt(0), info: "", upgradedClientState: undefined }; } export const Plan = { - encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + 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.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.info !== "") { @@ -250,8 +251,8 @@ export const Plan = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePlan(); while (reader.pos < end) { @@ -264,7 +265,7 @@ export const Plan = { message.time = Timestamp.decode(reader, reader.uint32()); break; case 3: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 4: message.info = reader.string(); @@ -283,7 +284,7 @@ export const Plan = { return { name: isSet(object.name) ? String(object.name) : "", time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + 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 }; @@ -292,7 +293,7 @@ export const Plan = { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.info !== undefined && (obj.info = message.info); message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); return obj; @@ -301,26 +302,36 @@ export const 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 ? Long.fromValue(object.height) : Long.ZERO; + 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 { - return { - name: object.name, - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - height: Long.fromString(object.height), - info: object.info, - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + 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; + obj.name = message.name === "" ? undefined : message.name; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; - obj.height = message.height ? message.height.toString() : undefined; - obj.info = message.info; + 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; }, @@ -355,7 +366,8 @@ function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { }; } export const SoftwareUpgradeProposal = { - encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + encode(message: SoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -367,8 +379,8 @@ export const SoftwareUpgradeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSoftwareUpgradeProposal(); while (reader.pos < end) { @@ -412,16 +424,22 @@ export const SoftwareUpgradeProposal = { return message; }, fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { - return { - title: object.title, - description: object.description, - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined - }; + 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; - obj.description = message.description; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; return obj; }, @@ -455,7 +473,8 @@ function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposa }; } export const CancelSoftwareUpgradeProposal = { - encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + encode(message: CancelSoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -464,8 +483,8 @@ export const CancelSoftwareUpgradeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCancelSoftwareUpgradeProposal(); while (reader.pos < end) { @@ -503,15 +522,19 @@ export const CancelSoftwareUpgradeProposal = { return message; }, fromAmino(object: CancelSoftwareUpgradeProposalAmino): CancelSoftwareUpgradeProposal { - return { - title: object.title, - description: object.description - }; + 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; - obj.description = message.description; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; return obj; }, fromAminoMsg(object: CancelSoftwareUpgradeProposalAminoMsg): CancelSoftwareUpgradeProposal { @@ -539,21 +562,22 @@ export const CancelSoftwareUpgradeProposal = { function createBaseModuleVersion(): ModuleVersion { return { name: "", - version: Long.UZERO + version: BigInt(0) }; } export const ModuleVersion = { - encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + 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.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(16).uint64(message.version); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleVersion(); while (reader.pos < end) { @@ -563,7 +587,7 @@ export const ModuleVersion = { message.name = reader.string(); break; case 2: - message.version = (reader.uint64() as Long); + message.version = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -575,31 +599,35 @@ export const ModuleVersion = { fromJSON(object: any): ModuleVersion { return { name: isSet(object.name) ? String(object.name) : "", - version: isSet(object.version) ? Long.fromValue(object.version) : Long.UZERO + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0) }; }, toJSON(message: ModuleVersion): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.version !== undefined && (obj.version = (message.version || Long.UZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ModuleVersion { const message = createBaseModuleVersion(); message.name = object.name ?? ""; - message.version = object.version !== undefined && object.version !== null ? Long.fromValue(object.version) : Long.UZERO; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); return message; }, fromAmino(object: ModuleVersionAmino): ModuleVersion { - return { - name: object.name, - version: Long.fromString(object.version) - }; + 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; - obj.version = message.version ? message.version.toString() : undefined; + obj.name = message.name === "" ? undefined : message.name; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; return obj; }, fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { diff --git a/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts b/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts index 05817c47..e588f16d 100644 --- a/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgCreateVestingAccount, MsgCreateVestingAccountResponse, MsgCreatePermanentLockedAccount, MsgCreatePermanentLockedAccountResponse, MsgCreatePeriodicVestingAccount, MsgCreatePeriodicVestingAccountResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { @@ -34,16 +34,16 @@ export class MsgClientImpl implements Msg { createVestingAccount(request: MsgCreateVestingAccount): Promise { const data = MsgCreateVestingAccount.encode(request).finish(); const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); - return promise.then(data => MsgCreateVestingAccountResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateVestingAccountResponse.decode(new BinaryReader(data))); } createPermanentLockedAccount(request: MsgCreatePermanentLockedAccount): Promise { const data = MsgCreatePermanentLockedAccount.encode(request).finish(); const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePermanentLockedAccount", data); - return promise.then(data => MsgCreatePermanentLockedAccountResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreatePermanentLockedAccountResponse.decode(new BinaryReader(data))); } createPeriodicVestingAccount(request: MsgCreatePeriodicVestingAccount): Promise { const data = MsgCreatePeriodicVestingAccount.encode(request).finish(); const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePeriodicVestingAccount", data); - return promise.then(data => MsgCreatePeriodicVestingAccountResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreatePeriodicVestingAccountResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.ts b/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.ts index d0976b93..d7acb006 100644 --- a/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.ts +++ b/packages/api/src/codegen/cosmos/vesting/v1beta1/tx.ts @@ -1,7 +1,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Period, PeriodAmino, PeriodSDKType } from "./vesting"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. @@ -10,7 +10,7 @@ export interface MsgCreateVestingAccount { fromAddress: string; toAddress: string; amount: Coin[]; - endTime: Long; + endTime: bigint; delayed: boolean; } export interface MsgCreateVestingAccountProtoMsg { @@ -22,11 +22,11 @@ export interface MsgCreateVestingAccountProtoMsg { * account. */ export interface MsgCreateVestingAccountAmino { - from_address: string; - to_address: string; - amount: CoinAmino[]; - end_time: string; - delayed: boolean; + from_address?: string; + to_address?: string; + amount?: CoinAmino[]; + end_time?: string; + delayed?: boolean; } export interface MsgCreateVestingAccountAminoMsg { type: "cosmos-sdk/MsgCreateVestingAccount"; @@ -40,7 +40,7 @@ export interface MsgCreateVestingAccountSDKType { from_address: string; to_address: string; amount: CoinSDKType[]; - end_time: Long; + end_time: bigint; delayed: boolean; } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ @@ -79,9 +79,9 @@ export interface MsgCreatePermanentLockedAccountProtoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCreatePermanentLockedAccountAmino { - from_address: string; - to_address: string; - amount: CoinAmino[]; + from_address?: string; + to_address?: string; + amount?: CoinAmino[]; } export interface MsgCreatePermanentLockedAccountAminoMsg { type: "cosmos-sdk/MsgCreatePermanentLockedAccount"; @@ -133,7 +133,7 @@ export interface MsgCreatePermanentLockedAccountResponseSDKType {} export interface MsgCreatePeriodicVestingAccount { fromAddress: string; toAddress: string; - startTime: Long; + startTime: bigint; vestingPeriods: Period[]; } export interface MsgCreatePeriodicVestingAccountProtoMsg { @@ -147,10 +147,10 @@ export interface MsgCreatePeriodicVestingAccountProtoMsg { * Since: cosmos-sdk 0.46 */ export interface MsgCreatePeriodicVestingAccountAmino { - from_address: string; - to_address: string; - start_time: string; - vesting_periods: PeriodAmino[]; + from_address?: string; + to_address?: string; + start_time?: string; + vesting_periods?: PeriodAmino[]; } export interface MsgCreatePeriodicVestingAccountAminoMsg { type: "cosmos-sdk/MsgCreatePeriodicVestingAccount"; @@ -165,7 +165,7 @@ export interface MsgCreatePeriodicVestingAccountAminoMsg { export interface MsgCreatePeriodicVestingAccountSDKType { from_address: string; to_address: string; - start_time: Long; + start_time: bigint; vesting_periods: PeriodSDKType[]; } /** @@ -202,12 +202,13 @@ function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { fromAddress: "", toAddress: "", amount: [], - endTime: Long.ZERO, + endTime: BigInt(0), delayed: false }; } export const MsgCreateVestingAccount = { - encode(message: MsgCreateVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + encode(message: MsgCreateVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } @@ -217,7 +218,7 @@ export const MsgCreateVestingAccount = { for (const v of message.amount) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (!message.endTime.isZero()) { + if (message.endTime !== BigInt(0)) { writer.uint32(32).int64(message.endTime); } if (message.delayed === true) { @@ -225,8 +226,8 @@ export const MsgCreateVestingAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateVestingAccount(); while (reader.pos < end) { @@ -242,7 +243,7 @@ export const MsgCreateVestingAccount = { message.amount.push(Coin.decode(reader, reader.uint32())); break; case 4: - message.endTime = (reader.int64() as Long); + message.endTime = reader.int64(); break; case 5: message.delayed = reader.bool(); @@ -259,7 +260,7 @@ export const MsgCreateVestingAccount = { fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], - endTime: isSet(object.endTime) ? Long.fromValue(object.endTime) : Long.ZERO, + endTime: isSet(object.endTime) ? BigInt(object.endTime.toString()) : BigInt(0), delayed: isSet(object.delayed) ? Boolean(object.delayed) : false }; }, @@ -272,7 +273,7 @@ export const MsgCreateVestingAccount = { } else { obj.amount = []; } - message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); + message.endTime !== undefined && (obj.endTime = (message.endTime || BigInt(0)).toString()); message.delayed !== undefined && (obj.delayed = message.delayed); return obj; }, @@ -281,30 +282,38 @@ export const MsgCreateVestingAccount = { message.fromAddress = object.fromAddress ?? ""; message.toAddress = object.toAddress ?? ""; message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; - message.endTime = object.endTime !== undefined && object.endTime !== null ? Long.fromValue(object.endTime) : Long.ZERO; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); message.delayed = object.delayed ?? false; return message; }, fromAmino(object: MsgCreateVestingAccountAmino): MsgCreateVestingAccount { - return { - fromAddress: object.from_address, - toAddress: object.to_address, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - endTime: Long.fromString(object.end_time), - delayed: object.delayed - }; + const message = createBaseMsgCreateVestingAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + if (object.delayed !== undefined && object.delayed !== null) { + message.delayed = object.delayed; + } + return message; }, toAmino(message: MsgCreateVestingAccount): MsgCreateVestingAccountAmino { const obj: any = {}; - obj.from_address = message.fromAddress; - obj.to_address = message.toAddress; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } - obj.end_time = message.endTime ? message.endTime.toString() : undefined; - obj.delayed = message.delayed; + obj.end_time = message.endTime !== BigInt(0) ? message.endTime.toString() : undefined; + obj.delayed = message.delayed === false ? undefined : message.delayed; return obj; }, fromAminoMsg(object: MsgCreateVestingAccountAminoMsg): MsgCreateVestingAccount { @@ -333,11 +342,12 @@ function createBaseMsgCreateVestingAccountResponse(): MsgCreateVestingAccountRes return {}; } export const MsgCreateVestingAccountResponse = { - encode(_: MsgCreateVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", + encode(_: MsgCreateVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateVestingAccountResponse(); while (reader.pos < end) { @@ -362,7 +372,8 @@ export const MsgCreateVestingAccountResponse = { return message; }, fromAmino(_: MsgCreateVestingAccountResponseAmino): MsgCreateVestingAccountResponse { - return {}; + const message = createBaseMsgCreateVestingAccountResponse(); + return message; }, toAmino(_: MsgCreateVestingAccountResponse): MsgCreateVestingAccountResponseAmino { const obj: any = {}; @@ -398,7 +409,8 @@ function createBaseMsgCreatePermanentLockedAccount(): MsgCreatePermanentLockedAc }; } export const MsgCreatePermanentLockedAccount = { - encode(message: MsgCreatePermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + encode(message: MsgCreatePermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } @@ -410,8 +422,8 @@ export const MsgCreatePermanentLockedAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePermanentLockedAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePermanentLockedAccount(); while (reader.pos < end) { @@ -459,20 +471,24 @@ export const MsgCreatePermanentLockedAccount = { return message; }, fromAmino(object: MsgCreatePermanentLockedAccountAmino): MsgCreatePermanentLockedAccount { - return { - fromAddress: object.from_address, - toAddress: object.to_address, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgCreatePermanentLockedAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountAmino { const obj: any = {}; - obj.from_address = message.fromAddress; - obj.to_address = message.toAddress; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -502,11 +518,12 @@ function createBaseMsgCreatePermanentLockedAccountResponse(): MsgCreatePermanent return {}; } export const MsgCreatePermanentLockedAccountResponse = { - encode(_: MsgCreatePermanentLockedAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + encode(_: MsgCreatePermanentLockedAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePermanentLockedAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePermanentLockedAccountResponse(); while (reader.pos < end) { @@ -531,7 +548,8 @@ export const MsgCreatePermanentLockedAccountResponse = { return message; }, fromAmino(_: MsgCreatePermanentLockedAccountResponseAmino): MsgCreatePermanentLockedAccountResponse { - return {}; + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + return message; }, toAmino(_: MsgCreatePermanentLockedAccountResponse): MsgCreatePermanentLockedAccountResponseAmino { const obj: any = {}; @@ -563,19 +581,20 @@ function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAc return { fromAddress: "", toAddress: "", - startTime: Long.ZERO, + startTime: BigInt(0), vestingPeriods: [] }; } export const MsgCreatePeriodicVestingAccount = { - encode(message: MsgCreatePeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + encode(message: MsgCreatePeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } if (message.toAddress !== "") { writer.uint32(18).string(message.toAddress); } - if (!message.startTime.isZero()) { + if (message.startTime !== BigInt(0)) { writer.uint32(24).int64(message.startTime); } for (const v of message.vestingPeriods) { @@ -583,8 +602,8 @@ export const MsgCreatePeriodicVestingAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePeriodicVestingAccount(); while (reader.pos < end) { @@ -597,7 +616,7 @@ export const MsgCreatePeriodicVestingAccount = { message.toAddress = reader.string(); break; case 3: - message.startTime = (reader.int64() as Long); + message.startTime = reader.int64(); break; case 4: message.vestingPeriods.push(Period.decode(reader, reader.uint32())); @@ -613,7 +632,7 @@ export const MsgCreatePeriodicVestingAccount = { return { fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", - startTime: isSet(object.startTime) ? Long.fromValue(object.startTime) : Long.ZERO, + startTime: isSet(object.startTime) ? BigInt(object.startTime.toString()) : BigInt(0), vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) : [] }; }, @@ -621,7 +640,7 @@ export const MsgCreatePeriodicVestingAccount = { const obj: any = {}; message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); message.toAddress !== undefined && (obj.toAddress = message.toAddress); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + message.startTime !== undefined && (obj.startTime = (message.startTime || BigInt(0)).toString()); if (message.vestingPeriods) { obj.vestingPeriods = message.vestingPeriods.map(e => e ? Period.toJSON(e) : undefined); } else { @@ -633,27 +652,33 @@ export const MsgCreatePeriodicVestingAccount = { const message = createBaseMsgCreatePeriodicVestingAccount(); message.fromAddress = object.fromAddress ?? ""; message.toAddress = object.toAddress ?? ""; - message.startTime = object.startTime !== undefined && object.startTime !== null ? Long.fromValue(object.startTime) : Long.ZERO; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); message.vestingPeriods = object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; return message; }, fromAmino(object: MsgCreatePeriodicVestingAccountAmino): MsgCreatePeriodicVestingAccount { - return { - fromAddress: object.from_address, - toAddress: object.to_address, - startTime: Long.fromString(object.start_time), - vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] - }; + const message = createBaseMsgCreatePeriodicVestingAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + message.vestingPeriods = object.vesting_periods?.map(e => Period.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountAmino { const obj: any = {}; - obj.from_address = message.fromAddress; - obj.to_address = message.toAddress; - obj.start_time = message.startTime ? message.startTime.toString() : undefined; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime.toString() : undefined; if (message.vestingPeriods) { obj.vesting_periods = message.vestingPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { - obj.vesting_periods = []; + obj.vesting_periods = message.vestingPeriods; } return obj; }, @@ -683,11 +708,12 @@ function createBaseMsgCreatePeriodicVestingAccountResponse(): MsgCreatePeriodicV return {}; } export const MsgCreatePeriodicVestingAccountResponse = { - encode(_: MsgCreatePeriodicVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + encode(_: MsgCreatePeriodicVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePeriodicVestingAccountResponse(); while (reader.pos < end) { @@ -712,7 +738,8 @@ export const MsgCreatePeriodicVestingAccountResponse = { return message; }, fromAmino(_: MsgCreatePeriodicVestingAccountResponseAmino): MsgCreatePeriodicVestingAccountResponse { - return {}; + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); + return message; }, toAmino(_: MsgCreatePeriodicVestingAccountResponse): MsgCreatePeriodicVestingAccountResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos/vesting/v1beta1/vesting.ts b/packages/api/src/codegen/cosmos/vesting/v1beta1/vesting.ts index a079ef82..f70704d3 100644 --- a/packages/api/src/codegen/cosmos/vesting/v1beta1/vesting.ts +++ b/packages/api/src/codegen/cosmos/vesting/v1beta1/vesting.ts @@ -1,17 +1,17 @@ import { BaseAccount, BaseAccountAmino, BaseAccountSDKType } from "../../auth/v1beta1/auth"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** * BaseVestingAccount implements the VestingAccount interface. It contains all * the necessary fields needed for any vesting account implementation. */ export interface BaseVestingAccount { - baseAccount: BaseAccount; + baseAccount?: BaseAccount; originalVesting: Coin[]; delegatedFree: Coin[]; delegatedVesting: Coin[]; - endTime: Long; + endTime: bigint; } export interface BaseVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount"; @@ -23,10 +23,10 @@ export interface BaseVestingAccountProtoMsg { */ export interface BaseVestingAccountAmino { base_account?: BaseAccountAmino; - original_vesting: CoinAmino[]; - delegated_free: CoinAmino[]; - delegated_vesting: CoinAmino[]; - end_time: string; + original_vesting?: CoinAmino[]; + delegated_free?: CoinAmino[]; + delegated_vesting?: CoinAmino[]; + end_time?: string; } export interface BaseVestingAccountAminoMsg { type: "cosmos-sdk/BaseVestingAccount"; @@ -37,19 +37,19 @@ export interface BaseVestingAccountAminoMsg { * the necessary fields needed for any vesting account implementation. */ export interface BaseVestingAccountSDKType { - base_account: BaseAccountSDKType; + base_account?: BaseAccountSDKType; original_vesting: CoinSDKType[]; delegated_free: CoinSDKType[]; delegated_vesting: CoinSDKType[]; - end_time: Long; + end_time: bigint; } /** * ContinuousVestingAccount implements the VestingAccount interface. It * continuously vests by unlocking coins linearly with respect to time. */ export interface ContinuousVestingAccount { - baseVestingAccount: BaseVestingAccount; - startTime: Long; + baseVestingAccount?: BaseVestingAccount; + startTime: bigint; } export interface ContinuousVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount"; @@ -61,7 +61,7 @@ export interface ContinuousVestingAccountProtoMsg { */ export interface ContinuousVestingAccountAmino { base_vesting_account?: BaseVestingAccountAmino; - start_time: string; + start_time?: string; } export interface ContinuousVestingAccountAminoMsg { type: "cosmos-sdk/ContinuousVestingAccount"; @@ -72,8 +72,8 @@ export interface ContinuousVestingAccountAminoMsg { * continuously vests by unlocking coins linearly with respect to time. */ export interface ContinuousVestingAccountSDKType { - base_vesting_account: BaseVestingAccountSDKType; - start_time: Long; + base_vesting_account?: BaseVestingAccountSDKType; + start_time: bigint; } /** * DelayedVestingAccount implements the VestingAccount interface. It vests all @@ -81,7 +81,7 @@ export interface ContinuousVestingAccountSDKType { * locked until a specified time. */ export interface DelayedVestingAccount { - baseVestingAccount: BaseVestingAccount; + baseVestingAccount?: BaseVestingAccount; } export interface DelayedVestingAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount"; @@ -105,11 +105,11 @@ export interface DelayedVestingAccountAminoMsg { * locked until a specified time. */ export interface DelayedVestingAccountSDKType { - base_vesting_account: BaseVestingAccountSDKType; + base_vesting_account?: BaseVestingAccountSDKType; } /** Period defines a length of time and amount of coins that will vest. */ export interface Period { - length: Long; + length: bigint; amount: Coin[]; } export interface PeriodProtoMsg { @@ -118,8 +118,8 @@ export interface PeriodProtoMsg { } /** Period defines a length of time and amount of coins that will vest. */ export interface PeriodAmino { - length: string; - amount: CoinAmino[]; + length?: string; + amount?: CoinAmino[]; } export interface PeriodAminoMsg { type: "cosmos-sdk/Period"; @@ -127,7 +127,7 @@ export interface PeriodAminoMsg { } /** Period defines a length of time and amount of coins that will vest. */ export interface PeriodSDKType { - length: Long; + length: bigint; amount: CoinSDKType[]; } /** @@ -135,8 +135,8 @@ export interface PeriodSDKType { * periodically vests by unlocking coins during each specified period. */ export interface PeriodicVestingAccount { - baseVestingAccount: BaseVestingAccount; - startTime: Long; + baseVestingAccount?: BaseVestingAccount; + startTime: bigint; vestingPeriods: Period[]; } export interface PeriodicVestingAccountProtoMsg { @@ -149,8 +149,8 @@ export interface PeriodicVestingAccountProtoMsg { */ export interface PeriodicVestingAccountAmino { base_vesting_account?: BaseVestingAccountAmino; - start_time: string; - vesting_periods: PeriodAmino[]; + start_time?: string; + vesting_periods?: PeriodAmino[]; } export interface PeriodicVestingAccountAminoMsg { type: "cosmos-sdk/PeriodicVestingAccount"; @@ -161,8 +161,8 @@ export interface PeriodicVestingAccountAminoMsg { * periodically vests by unlocking coins during each specified period. */ export interface PeriodicVestingAccountSDKType { - base_vesting_account: BaseVestingAccountSDKType; - start_time: Long; + base_vesting_account?: BaseVestingAccountSDKType; + start_time: bigint; vesting_periods: PeriodSDKType[]; } /** @@ -173,7 +173,7 @@ export interface PeriodicVestingAccountSDKType { * Since: cosmos-sdk 0.43 */ export interface PermanentLockedAccount { - baseVestingAccount: BaseVestingAccount; + baseVestingAccount?: BaseVestingAccount; } export interface PermanentLockedAccountProtoMsg { typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount"; @@ -201,19 +201,20 @@ export interface PermanentLockedAccountAminoMsg { * Since: cosmos-sdk 0.43 */ export interface PermanentLockedAccountSDKType { - base_vesting_account: BaseVestingAccountSDKType; + base_vesting_account?: BaseVestingAccountSDKType; } function createBaseBaseVestingAccount(): BaseVestingAccount { return { - baseAccount: BaseAccount.fromPartial({}), + baseAccount: undefined, originalVesting: [], delegatedFree: [], delegatedVesting: [], - endTime: Long.ZERO + endTime: BigInt(0) }; } export const BaseVestingAccount = { - encode(message: BaseVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.BaseVestingAccount", + encode(message: BaseVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } @@ -226,13 +227,13 @@ export const BaseVestingAccount = { for (const v of message.delegatedVesting) { Coin.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (!message.endTime.isZero()) { + if (message.endTime !== BigInt(0)) { writer.uint32(40).int64(message.endTime); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BaseVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BaseVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBaseVestingAccount(); while (reader.pos < end) { @@ -251,7 +252,7 @@ export const BaseVestingAccount = { message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); break; case 5: - message.endTime = (reader.int64() as Long); + message.endTime = reader.int64(); break; default: reader.skipType(tag & 7); @@ -266,7 +267,7 @@ export const BaseVestingAccount = { originalVesting: Array.isArray(object?.originalVesting) ? object.originalVesting.map((e: any) => Coin.fromJSON(e)) : [], delegatedFree: Array.isArray(object?.delegatedFree) ? object.delegatedFree.map((e: any) => Coin.fromJSON(e)) : [], delegatedVesting: Array.isArray(object?.delegatedVesting) ? object.delegatedVesting.map((e: any) => Coin.fromJSON(e)) : [], - endTime: isSet(object.endTime) ? Long.fromValue(object.endTime) : Long.ZERO + endTime: isSet(object.endTime) ? BigInt(object.endTime.toString()) : BigInt(0) }; }, toJSON(message: BaseVestingAccount): unknown { @@ -287,7 +288,7 @@ export const BaseVestingAccount = { } else { obj.delegatedVesting = []; } - message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); + message.endTime !== undefined && (obj.endTime = (message.endTime || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): BaseVestingAccount { @@ -296,17 +297,21 @@ export const BaseVestingAccount = { message.originalVesting = object.originalVesting?.map(e => Coin.fromPartial(e)) || []; message.delegatedFree = object.delegatedFree?.map(e => Coin.fromPartial(e)) || []; message.delegatedVesting = object.delegatedVesting?.map(e => Coin.fromPartial(e)) || []; - message.endTime = object.endTime !== undefined && object.endTime !== null ? Long.fromValue(object.endTime) : Long.ZERO; + message.endTime = object.endTime !== undefined && object.endTime !== null ? BigInt(object.endTime.toString()) : BigInt(0); return message; }, fromAmino(object: BaseVestingAccountAmino): BaseVestingAccount { - return { - baseAccount: object?.base_account ? BaseAccount.fromAmino(object.base_account) : undefined, - originalVesting: Array.isArray(object?.original_vesting) ? object.original_vesting.map((e: any) => Coin.fromAmino(e)) : [], - delegatedFree: Array.isArray(object?.delegated_free) ? object.delegated_free.map((e: any) => Coin.fromAmino(e)) : [], - delegatedVesting: Array.isArray(object?.delegated_vesting) ? object.delegated_vesting.map((e: any) => Coin.fromAmino(e)) : [], - endTime: Long.fromString(object.end_time) - }; + const message = createBaseBaseVestingAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + message.originalVesting = object.original_vesting?.map(e => Coin.fromAmino(e)) || []; + message.delegatedFree = object.delegated_free?.map(e => Coin.fromAmino(e)) || []; + message.delegatedVesting = object.delegated_vesting?.map(e => Coin.fromAmino(e)) || []; + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = BigInt(object.end_time); + } + return message; }, toAmino(message: BaseVestingAccount): BaseVestingAccountAmino { const obj: any = {}; @@ -314,19 +319,19 @@ export const BaseVestingAccount = { if (message.originalVesting) { obj.original_vesting = message.originalVesting.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.original_vesting = []; + obj.original_vesting = message.originalVesting; } if (message.delegatedFree) { obj.delegated_free = message.delegatedFree.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.delegated_free = []; + obj.delegated_free = message.delegatedFree; } if (message.delegatedVesting) { obj.delegated_vesting = message.delegatedVesting.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.delegated_vesting = []; + obj.delegated_vesting = message.delegatedVesting; } - obj.end_time = message.endTime ? message.endTime.toString() : undefined; + obj.end_time = message.endTime !== BigInt(0) ? message.endTime.toString() : undefined; return obj; }, fromAminoMsg(object: BaseVestingAccountAminoMsg): BaseVestingAccount { @@ -353,22 +358,23 @@ export const BaseVestingAccount = { }; function createBaseContinuousVestingAccount(): ContinuousVestingAccount { return { - baseVestingAccount: BaseVestingAccount.fromPartial({}), - startTime: Long.ZERO + baseVestingAccount: undefined, + startTime: BigInt(0) }; } export const ContinuousVestingAccount = { - encode(message: ContinuousVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.ContinuousVestingAccount", + encode(message: ContinuousVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } - if (!message.startTime.isZero()) { + if (message.startTime !== BigInt(0)) { writer.uint32(16).int64(message.startTime); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContinuousVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContinuousVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContinuousVestingAccount(); while (reader.pos < end) { @@ -378,7 +384,7 @@ export const ContinuousVestingAccount = { message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; case 2: - message.startTime = (reader.int64() as Long); + message.startTime = reader.int64(); break; default: reader.skipType(tag & 7); @@ -390,31 +396,35 @@ export const ContinuousVestingAccount = { fromJSON(object: any): ContinuousVestingAccount { return { baseVestingAccount: isSet(object.baseVestingAccount) ? BaseVestingAccount.fromJSON(object.baseVestingAccount) : undefined, - startTime: isSet(object.startTime) ? Long.fromValue(object.startTime) : Long.ZERO + startTime: isSet(object.startTime) ? BigInt(object.startTime.toString()) : BigInt(0) }; }, toJSON(message: ContinuousVestingAccount): unknown { const obj: any = {}; message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount ? BaseVestingAccount.toJSON(message.baseVestingAccount) : undefined); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + message.startTime !== undefined && (obj.startTime = (message.startTime || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ContinuousVestingAccount { const message = createBaseContinuousVestingAccount(); message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; - message.startTime = object.startTime !== undefined && object.startTime !== null ? Long.fromValue(object.startTime) : Long.ZERO; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); return message; }, fromAmino(object: ContinuousVestingAccountAmino): ContinuousVestingAccount { - return { - baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, - startTime: Long.fromString(object.start_time) - }; + const message = createBaseContinuousVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + return message; }, toAmino(message: ContinuousVestingAccount): ContinuousVestingAccountAmino { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; - obj.start_time = message.startTime ? message.startTime.toString() : undefined; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime.toString() : undefined; return obj; }, fromAminoMsg(object: ContinuousVestingAccountAminoMsg): ContinuousVestingAccount { @@ -441,18 +451,19 @@ export const ContinuousVestingAccount = { }; function createBaseDelayedVestingAccount(): DelayedVestingAccount { return { - baseVestingAccount: BaseVestingAccount.fromPartial({}) + baseVestingAccount: undefined }; } export const DelayedVestingAccount = { - encode(message: DelayedVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.DelayedVestingAccount", + encode(message: DelayedVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelayedVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelayedVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelayedVestingAccount(); while (reader.pos < end) { @@ -484,9 +495,11 @@ export const DelayedVestingAccount = { return message; }, fromAmino(object: DelayedVestingAccountAmino): DelayedVestingAccount { - return { - baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined - }; + const message = createBaseDelayedVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; }, toAmino(message: DelayedVestingAccount): DelayedVestingAccountAmino { const obj: any = {}; @@ -517,13 +530,14 @@ export const DelayedVestingAccount = { }; function createBasePeriod(): Period { return { - length: Long.ZERO, + length: BigInt(0), amount: [] }; } export const Period = { - encode(message: Period, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.length.isZero()) { + typeUrl: "/cosmos.vesting.v1beta1.Period", + encode(message: Period, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.length !== BigInt(0)) { writer.uint32(8).int64(message.length); } for (const v of message.amount) { @@ -531,15 +545,15 @@ export const Period = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Period { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Period { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePeriod(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.length = (reader.int64() as Long); + message.length = reader.int64(); break; case 2: message.amount.push(Coin.decode(reader, reader.uint32())); @@ -553,13 +567,13 @@ export const Period = { }, fromJSON(object: any): Period { return { - length: isSet(object.length) ? Long.fromValue(object.length) : Long.ZERO, + length: isSet(object.length) ? BigInt(object.length.toString()) : BigInt(0), amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: Period): unknown { const obj: any = {}; - message.length !== undefined && (obj.length = (message.length || Long.ZERO).toString()); + message.length !== undefined && (obj.length = (message.length || BigInt(0)).toString()); if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); } else { @@ -569,23 +583,25 @@ export const Period = { }, fromPartial(object: Partial): Period { const message = createBasePeriod(); - message.length = object.length !== undefined && object.length !== null ? Long.fromValue(object.length) : Long.ZERO; + message.length = object.length !== undefined && object.length !== null ? BigInt(object.length.toString()) : BigInt(0); message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: PeriodAmino): Period { - return { - length: Long.fromString(object.length), - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBasePeriod(); + if (object.length !== undefined && object.length !== null) { + message.length = BigInt(object.length); + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Period): PeriodAmino { const obj: any = {}; - obj.length = message.length ? message.length.toString() : undefined; + obj.length = message.length !== BigInt(0) ? message.length.toString() : undefined; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.amount = []; + obj.amount = message.amount; } return obj; }, @@ -613,17 +629,18 @@ export const Period = { }; function createBasePeriodicVestingAccount(): PeriodicVestingAccount { return { - baseVestingAccount: BaseVestingAccount.fromPartial({}), - startTime: Long.ZERO, + baseVestingAccount: undefined, + startTime: BigInt(0), vestingPeriods: [] }; } export const PeriodicVestingAccount = { - encode(message: PeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.PeriodicVestingAccount", + encode(message: PeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } - if (!message.startTime.isZero()) { + if (message.startTime !== BigInt(0)) { writer.uint32(16).int64(message.startTime); } for (const v of message.vestingPeriods) { @@ -631,8 +648,8 @@ export const PeriodicVestingAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePeriodicVestingAccount(); while (reader.pos < end) { @@ -642,7 +659,7 @@ export const PeriodicVestingAccount = { message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; case 2: - message.startTime = (reader.int64() as Long); + message.startTime = reader.int64(); break; case 3: message.vestingPeriods.push(Period.decode(reader, reader.uint32())); @@ -657,14 +674,14 @@ export const PeriodicVestingAccount = { fromJSON(object: any): PeriodicVestingAccount { return { baseVestingAccount: isSet(object.baseVestingAccount) ? BaseVestingAccount.fromJSON(object.baseVestingAccount) : undefined, - startTime: isSet(object.startTime) ? Long.fromValue(object.startTime) : Long.ZERO, + startTime: isSet(object.startTime) ? BigInt(object.startTime.toString()) : BigInt(0), vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) : [] }; }, toJSON(message: PeriodicVestingAccount): unknown { const obj: any = {}; message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount ? BaseVestingAccount.toJSON(message.baseVestingAccount) : undefined); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + message.startTime !== undefined && (obj.startTime = (message.startTime || BigInt(0)).toString()); if (message.vestingPeriods) { obj.vestingPeriods = message.vestingPeriods.map(e => e ? Period.toJSON(e) : undefined); } else { @@ -675,25 +692,29 @@ export const PeriodicVestingAccount = { fromPartial(object: Partial): PeriodicVestingAccount { const message = createBasePeriodicVestingAccount(); message.baseVestingAccount = object.baseVestingAccount !== undefined && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : undefined; - message.startTime = object.startTime !== undefined && object.startTime !== null ? Long.fromValue(object.startTime) : Long.ZERO; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); message.vestingPeriods = object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; return message; }, fromAmino(object: PeriodicVestingAccountAmino): PeriodicVestingAccount { - return { - baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, - startTime: Long.fromString(object.start_time), - vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [] - }; + const message = createBasePeriodicVestingAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + message.vestingPeriods = object.vesting_periods?.map(e => Period.fromAmino(e)) || []; + return message; }, toAmino(message: PeriodicVestingAccount): PeriodicVestingAccountAmino { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; - obj.start_time = message.startTime ? message.startTime.toString() : undefined; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime.toString() : undefined; if (message.vestingPeriods) { obj.vesting_periods = message.vestingPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { - obj.vesting_periods = []; + obj.vesting_periods = message.vestingPeriods; } return obj; }, @@ -721,18 +742,19 @@ export const PeriodicVestingAccount = { }; function createBasePermanentLockedAccount(): PermanentLockedAccount { return { - baseVestingAccount: BaseVestingAccount.fromPartial({}) + baseVestingAccount: undefined }; } export const PermanentLockedAccount = { - encode(message: PermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos.vesting.v1beta1.PermanentLockedAccount", + encode(message: PermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PermanentLockedAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePermanentLockedAccount(); while (reader.pos < end) { @@ -764,9 +786,11 @@ export const PermanentLockedAccount = { return message; }, fromAmino(object: PermanentLockedAccountAmino): PermanentLockedAccount { - return { - baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined - }; + const message = createBasePermanentLockedAccount(); + if (object.base_vesting_account !== undefined && object.base_vesting_account !== null) { + message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account); + } + return message; }, toAmino(message: PermanentLockedAccount): PermanentLockedAccountAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/cosmos_proto/cosmos.ts b/packages/api/src/codegen/cosmos_proto/cosmos.ts index 96c85851..2dcf956b 100644 --- a/packages/api/src/codegen/cosmos_proto/cosmos.ts +++ b/packages/api/src/codegen/cosmos_proto/cosmos.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../binary"; import { isSet } from "../helpers"; export enum ScalarType { SCALAR_TYPE_UNSPECIFIED = 0, @@ -71,12 +71,12 @@ export interface InterfaceDescriptorAmino { * package.name, ex. for the package a.b and interface named C, the * fully-qualified name will be a.b.C. */ - name: string; + name?: string; /** * description is a human-readable description of the interface and its * purpose. */ - description: string; + description?: string; } export interface InterfaceDescriptorAminoMsg { type: "/cosmos_proto.InterfaceDescriptor"; @@ -141,20 +141,20 @@ export interface ScalarDescriptorAmino { * package.name, ex. for the package a.b and scalar named C, the * fully-qualified name will be a.b.C. */ - name: string; + name?: string; /** * description is a human-readable description of the scalar and its * encoding format. For instance a big integer or decimal scalar should * specify precisely the expected encoding format. */ - description: string; + description?: string; /** * field_type is the type of field with which this scalar can be used. * Scalars can be used with one and only one type of field so that * encoding standards and simple and clear. Currently only string and * bytes fields are supported for scalars. */ - field_type: ScalarType[]; + field_type?: ScalarType[]; } export interface ScalarDescriptorAminoMsg { type: "/cosmos_proto.ScalarDescriptor"; @@ -181,7 +181,8 @@ function createBaseInterfaceDescriptor(): InterfaceDescriptor { }; } export const InterfaceDescriptor = { - encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos_proto.InterfaceDescriptor", + encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -190,8 +191,8 @@ export const InterfaceDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInterfaceDescriptor(); while (reader.pos < end) { @@ -229,15 +230,19 @@ export const InterfaceDescriptor = { return message; }, fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - return { - name: object.name, - description: object.description - }; + const message = createBaseInterfaceDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; }, toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { const obj: any = {}; - obj.name = message.name; - obj.description = message.description; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; return obj; }, fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { @@ -264,7 +269,8 @@ function createBaseScalarDescriptor(): ScalarDescriptor { }; } export const ScalarDescriptor = { - encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/cosmos_proto.ScalarDescriptor", + encode(message: ScalarDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -278,8 +284,8 @@ export const ScalarDescriptor = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseScalarDescriptor(); while (reader.pos < end) { @@ -334,20 +340,24 @@ export const ScalarDescriptor = { return message; }, fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { - return { - name: object.name, - description: object.description, - fieldType: Array.isArray(object?.field_type) ? object.field_type.map((e: any) => scalarTypeFromJSON(e)) : [] - }; + const message = createBaseScalarDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.fieldType = object.field_type?.map(e => e) || []; + return message; }, toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { const obj: any = {}; - obj.name = message.name; - obj.description = message.description; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; if (message.fieldType) { - obj.field_type = message.fieldType.map(e => scalarTypeToJSON(e)); + obj.field_type = message.fieldType.map(e => e); } else { - obj.field_type = []; + obj.field_type = message.fieldType; } return obj; }, diff --git a/packages/api/src/codegen/google/api/http.ts b/packages/api/src/codegen/google/api/http.ts new file mode 100644 index 00000000..bde50615 --- /dev/null +++ b/packages/api/src/codegen/google/api/http.ts @@ -0,0 +1,1423 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} +export interface HttpProtoMsg { + typeUrl: "/google.api.Http"; + value: Uint8Array; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpAmino { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules?: HttpRuleAmino[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion?: boolean; +} +export interface HttpAminoMsg { + type: "/google.api.Http"; + value: HttpAmino; +} +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface HttpSDKType { + rules: HttpRuleSDKType[]; + fully_decode_reserved_expansion: boolean; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPattern; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} +export interface HttpRuleProtoMsg { + typeUrl: "/google.api.HttpRule"; + value: Uint8Array; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleAmino { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector?: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: string; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: string; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: string; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: string; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPatternAmino; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body?: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + response_body?: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings?: HttpRuleAmino[]; +} +export interface HttpRuleAminoMsg { + type: "/google.api.HttpRule"; + value: HttpRuleAmino; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRuleSDKType { + selector: string; + get?: string; + put?: string; + post?: string; + delete?: string; + patch?: string; + custom?: CustomHttpPatternSDKType; + body: string; + response_body: string; + additional_bindings: HttpRuleSDKType[]; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} +export interface CustomHttpPatternProtoMsg { + typeUrl: "/google.api.CustomHttpPattern"; + value: Uint8Array; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternAmino { + /** The name of this custom HTTP verb. */ + kind?: string; + /** The path matched by this custom verb. */ + path?: string; +} +export interface CustomHttpPatternAminoMsg { + type: "/google.api.CustomHttpPattern"; + value: CustomHttpPatternAmino; +} +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPatternSDKType { + kind: string; + path: string; +} +function createBaseHttp(): Http { + return { + rules: [], + fullyDecodeReservedExpansion: false + }; +} +export const Http = { + typeUrl: "/google.api.Http", + encode(message: Http, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Http { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Http { + return { + rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromJSON(e)) : [], + fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion) ? Boolean(object.fullyDecodeReservedExpansion) : false + }; + }, + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map(e => e ? HttpRule.toJSON(e) : undefined); + } else { + obj.rules = []; + } + message.fullyDecodeReservedExpansion !== undefined && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); + return obj; + }, + fromPartial(object: Partial): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; + return message; + }, + fromAmino(object: HttpAmino): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromAmino(e)) || []; + if (object.fully_decode_reserved_expansion !== undefined && object.fully_decode_reserved_expansion !== null) { + message.fullyDecodeReservedExpansion = object.fully_decode_reserved_expansion; + } + return message; + }, + toAmino(message: Http): HttpAmino { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map(e => e ? HttpRule.toAmino(e) : undefined); + } else { + obj.rules = message.rules; + } + obj.fully_decode_reserved_expansion = message.fullyDecodeReservedExpansion === false ? undefined : message.fullyDecodeReservedExpansion; + return obj; + }, + fromAminoMsg(object: HttpAminoMsg): Http { + return Http.fromAmino(object.value); + }, + fromProtoMsg(message: HttpProtoMsg): Http { + return Http.decode(message.value); + }, + toProto(message: Http): Uint8Array { + return Http.encode(message).finish(); + }, + toProtoMsg(message: Http): HttpProtoMsg { + return { + typeUrl: "/google.api.Http", + value: Http.encode(message).finish() + }; + } +}; +function createBaseHttpRule(): HttpRule { + return { + selector: "", + get: undefined, + put: undefined, + post: undefined, + delete: undefined, + patch: undefined, + custom: undefined, + body: "", + responseBody: "", + additionalBindings: [] + }; +} +export const HttpRule = { + typeUrl: "/google.api.HttpRule", + encode(message: HttpRule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): HttpRule { + return { + selector: isSet(object.selector) ? String(object.selector) : "", + get: isSet(object.get) ? String(object.get) : undefined, + put: isSet(object.put) ? String(object.put) : undefined, + post: isSet(object.post) ? String(object.post) : undefined, + delete: isSet(object.delete) ? String(object.delete) : undefined, + patch: isSet(object.patch) ? String(object.patch) : undefined, + custom: isSet(object.custom) ? CustomHttpPattern.fromJSON(object.custom) : undefined, + body: isSet(object.body) ? String(object.body) : "", + responseBody: isSet(object.responseBody) ? String(object.responseBody) : "", + additionalBindings: Array.isArray(object?.additionalBindings) ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e)) : [] + }; + }, + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); + message.body !== undefined && (obj.body = message.body); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map(e => e ? HttpRule.toJSON(e) : undefined); + } else { + obj.additionalBindings = []; + } + return obj; + }, + fromPartial(object: Partial): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ""; + message.get = object.get ?? undefined; + message.put = object.put ?? undefined; + message.post = object.post ?? undefined; + message.delete = object.delete ?? undefined; + message.patch = object.patch ?? undefined; + message.custom = object.custom !== undefined && object.custom !== null ? CustomHttpPattern.fromPartial(object.custom) : undefined; + message.body = object.body ?? ""; + message.responseBody = object.responseBody ?? ""; + message.additionalBindings = object.additionalBindings?.map(e => HttpRule.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HttpRuleAmino): HttpRule { + const message = createBaseHttpRule(); + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromAmino(object.custom); + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.responseBody = object.response_body; + } + message.additionalBindings = object.additional_bindings?.map(e => HttpRule.fromAmino(e)) || []; + return message; + }, + toAmino(message: HttpRule): HttpRuleAmino { + const obj: any = {}; + 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 === "" ? 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 = message.additionalBindings; + } + return obj; + }, + fromAminoMsg(object: HttpRuleAminoMsg): HttpRule { + return HttpRule.fromAmino(object.value); + }, + fromProtoMsg(message: HttpRuleProtoMsg): HttpRule { + return HttpRule.decode(message.value); + }, + toProto(message: HttpRule): Uint8Array { + return HttpRule.encode(message).finish(); + }, + toProtoMsg(message: HttpRule): HttpRuleProtoMsg { + return { + typeUrl: "/google.api.HttpRule", + value: HttpRule.encode(message).finish() + }; + } +}; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { + kind: "", + path: "" + }; +} +export const CustomHttpPattern = { + typeUrl: "/google.api.CustomHttpPattern", + encode(message: CustomHttpPattern, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CustomHttpPattern { + return { + kind: isSet(object.kind) ? String(object.kind) : "", + path: isSet(object.path) ? String(object.path) : "" + }; + }, + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, + fromPartial(object: Partial): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ""; + message.path = object.path ?? ""; + return message; + }, + fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + return message; + }, + toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { + const obj: any = {}; + obj.kind = message.kind === "" ? undefined : message.kind; + obj.path = message.path === "" ? undefined : message.path; + return obj; + }, + fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern { + return CustomHttpPattern.fromAmino(object.value); + }, + fromProtoMsg(message: CustomHttpPatternProtoMsg): CustomHttpPattern { + return CustomHttpPattern.decode(message.value); + }, + toProto(message: CustomHttpPattern): Uint8Array { + return CustomHttpPattern.encode(message).finish(); + }, + toProtoMsg(message: CustomHttpPattern): CustomHttpPatternProtoMsg { + return { + typeUrl: "/google.api.CustomHttpPattern", + value: CustomHttpPattern.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/api/src/codegen/google/bundle.ts b/packages/api/src/codegen/google/bundle.ts index 4c140722..c9d1e72f 100644 --- a/packages/api/src/codegen/google/bundle.ts +++ b/packages/api/src/codegen/google/bundle.ts @@ -1,16 +1,18 @@ import * as _99 from "./api/annotations"; -import * as _100 from "./protobuf/descriptor"; -import * as _101 from "./protobuf/any"; -import * as _102 from "./protobuf/timestamp"; -import * as _103 from "./protobuf/duration"; +import * as _100 from "./api/http"; +import * as _101 from "./protobuf/descriptor"; +import * as _102 from "./protobuf/any"; +import * as _103 from "./protobuf/timestamp"; +import * as _104 from "./protobuf/duration"; export namespace google { export const api = { - ..._99 + ..._99, + ..._100 }; export const protobuf = { - ..._100, ..._101, ..._102, - ..._103 + ..._103, + ..._104 }; } \ No newline at end of file diff --git a/packages/api/src/codegen/google/protobuf/any.ts b/packages/api/src/codegen/google/protobuf/any.ts index da1bf3c5..cd43a3e7 100644 --- a/packages/api/src/codegen/google/protobuf/any.ts +++ b/packages/api/src/codegen/google/protobuf/any.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; /** * `Any` contains an arbitrary serialized protocol buffer message along with a @@ -82,7 +82,7 @@ import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; * } */ export interface Any { - $typeUrl?: string; + $typeUrl?: "/google.protobuf.Any" | string; /** * A URL/resource name that uniquely identifies the type of the serialized * protocol buffer message. This string must contain at least @@ -321,7 +321,7 @@ export interface AnyAminoMsg { * } */ export interface AnySDKType { - $typeUrl?: string; + $typeUrl?: "/google.protobuf.Any" | string; type_url: string; value: Uint8Array; } @@ -333,7 +333,8 @@ function createBaseAny(): Any { }; } export const Any = { - encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.Any", + encode(message: Any, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.typeUrl !== "") { writer.uint32(10).string(message.typeUrl); } @@ -342,8 +343,8 @@ export const Any = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Any { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAny(); while (reader.pos < end) { @@ -388,7 +389,7 @@ export const Any = { }, toAmino(message: Any): AnyAmino { const obj: any = {}; - obj.type_url = message.typeUrl; + obj.type = message.typeUrl; obj.value = message.value; return obj; }, diff --git a/packages/api/src/codegen/google/protobuf/descriptor.ts b/packages/api/src/codegen/google/protobuf/descriptor.ts index d1990cd3..febc7b37 100644 --- a/packages/api/src/codegen/google/protobuf/descriptor.ts +++ b/packages/api/src/codegen/google/protobuf/descriptor.ts @@ -1,5 +1,5 @@ -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export enum FieldDescriptorProto_Type { /** * TYPE_DOUBLE - 0 is reserved for errors. @@ -374,7 +374,7 @@ export interface FileDescriptorSetProtoMsg { * files it parses. */ export interface FileDescriptorSetAmino { - file: FileDescriptorProtoAmino[]; + file?: FileDescriptorProtoAmino[]; } export interface FileDescriptorSetAminoMsg { type: "/google.protobuf.FileDescriptorSet"; @@ -406,14 +406,14 @@ export interface FileDescriptorProto { enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions; + options?: FileOptions; /** * This field contains optional information about the original source code. * You may safely remove this entire field without harming runtime * functionality of the descriptors -- the information is needed only by * development tools. */ - sourceCodeInfo: SourceCodeInfo; + sourceCodeInfo?: SourceCodeInfo; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -427,22 +427,22 @@ export interface FileDescriptorProtoProtoMsg { /** Describes a complete .proto file. */ export interface FileDescriptorProtoAmino { /** file name, relative to root of source tree */ - name: string; - package: string; + name?: string; + package?: string; /** Names of files imported by this file. */ - dependency: string[]; + dependency?: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + public_dependency?: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weak_dependency?: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProtoAmino[]; - enum_type: EnumDescriptorProtoAmino[]; - service: ServiceDescriptorProtoAmino[]; - extension: FieldDescriptorProtoAmino[]; + message_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + service?: ServiceDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; options?: FileOptionsAmino; /** * This field contains optional information about the original source code. @@ -455,7 +455,7 @@ export interface FileDescriptorProtoAmino { * The syntax of the proto file. * The supported values are "proto2" and "proto3". */ - syntax: string; + syntax?: string; } export interface FileDescriptorProtoAminoMsg { type: "/google.protobuf.FileDescriptorProto"; @@ -472,8 +472,8 @@ export interface FileDescriptorProtoSDKType { enum_type: EnumDescriptorProtoSDKType[]; service: ServiceDescriptorProtoSDKType[]; extension: FieldDescriptorProtoSDKType[]; - options: FileOptionsSDKType; - source_code_info: SourceCodeInfoSDKType; + options?: FileOptionsSDKType; + source_code_info?: SourceCodeInfoSDKType; syntax: string; } /** Describes a message type. */ @@ -485,7 +485,7 @@ export interface DescriptorProto { enumType: EnumDescriptorProto[]; extensionRange: DescriptorProto_ExtensionRange[]; oneofDecl: OneofDescriptorProto[]; - options: MessageOptions; + options?: MessageOptions; reservedRange: DescriptorProto_ReservedRange[]; /** * Reserved field names, which may not be used by fields in the same message. @@ -499,20 +499,20 @@ export interface DescriptorProtoProtoMsg { } /** Describes a message type. */ export interface DescriptorProtoAmino { - name: string; - field: FieldDescriptorProtoAmino[]; - extension: FieldDescriptorProtoAmino[]; - nested_type: DescriptorProtoAmino[]; - enum_type: EnumDescriptorProtoAmino[]; - extension_range: DescriptorProto_ExtensionRangeAmino[]; - oneof_decl: OneofDescriptorProtoAmino[]; + name?: string; + field?: FieldDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; + nested_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + extension_range?: DescriptorProto_ExtensionRangeAmino[]; + oneof_decl?: OneofDescriptorProtoAmino[]; options?: MessageOptionsAmino; - reserved_range: DescriptorProto_ReservedRangeAmino[]; + reserved_range?: DescriptorProto_ReservedRangeAmino[]; /** * Reserved field names, which may not be used by fields in the same message. * A given name may only be reserved once. */ - reserved_name: string[]; + reserved_name?: string[]; } export interface DescriptorProtoAminoMsg { type: "/google.protobuf.DescriptorProto"; @@ -527,7 +527,7 @@ export interface DescriptorProtoSDKType { enum_type: EnumDescriptorProtoSDKType[]; extension_range: DescriptorProto_ExtensionRangeSDKType[]; oneof_decl: OneofDescriptorProtoSDKType[]; - options: MessageOptionsSDKType; + options?: MessageOptionsSDKType; reserved_range: DescriptorProto_ReservedRangeSDKType[]; reserved_name: string[]; } @@ -536,7 +536,7 @@ export interface DescriptorProto_ExtensionRange { start: number; /** Exclusive. */ end: number; - options: ExtensionRangeOptions; + options?: ExtensionRangeOptions; } export interface DescriptorProto_ExtensionRangeProtoMsg { typeUrl: "/google.protobuf.ExtensionRange"; @@ -544,9 +544,9 @@ export interface DescriptorProto_ExtensionRangeProtoMsg { } export interface DescriptorProto_ExtensionRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Exclusive. */ - end: number; + end?: number; options?: ExtensionRangeOptionsAmino; } export interface DescriptorProto_ExtensionRangeAminoMsg { @@ -556,7 +556,7 @@ export interface DescriptorProto_ExtensionRangeAminoMsg { export interface DescriptorProto_ExtensionRangeSDKType { start: number; end: number; - options: ExtensionRangeOptionsSDKType; + options?: ExtensionRangeOptionsSDKType; } /** * Range of reserved tag numbers. Reserved tag numbers may not be used by @@ -580,9 +580,9 @@ export interface DescriptorProto_ReservedRangeProtoMsg { */ export interface DescriptorProto_ReservedRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Exclusive. */ - end: number; + end?: number; } export interface DescriptorProto_ReservedRangeAminoMsg { type: "/google.protobuf.ReservedRange"; @@ -607,7 +607,7 @@ export interface ExtensionRangeOptionsProtoMsg { } export interface ExtensionRangeOptionsAmino { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface ExtensionRangeOptionsAminoMsg { type: "/google.protobuf.ExtensionRangeOptions"; @@ -659,7 +659,7 @@ export interface FieldDescriptorProto { * it to camelCase. */ jsonName: string; - options: FieldOptions; + options?: FieldOptions; } export interface FieldDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.FieldDescriptorProto"; @@ -667,14 +667,14 @@ export interface FieldDescriptorProtoProtoMsg { } /** Describes a field within a message. */ export interface FieldDescriptorProtoAmino { - name: string; - number: number; - label: FieldDescriptorProto_Label; + name?: string; + number?: number; + label?: FieldDescriptorProto_Label; /** * If type_name is set, this need not be set. If both this and type_name * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. */ - type: FieldDescriptorProto_Type; + type?: FieldDescriptorProto_Type; /** * For message and enum types, this is the name of the type. If the name * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping @@ -682,12 +682,12 @@ export interface FieldDescriptorProtoAmino { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + type_name?: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. */ - extendee: string; + extendee?: string; /** * For numeric types, contains the original text representation of the value. * For booleans, "true" or "false". @@ -695,19 +695,19 @@ export interface FieldDescriptorProtoAmino { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + default_value?: string; /** * If set, gives the index of a oneof in the containing type's oneof_decl * list. This field is a member of that oneof. */ - oneof_index: number; + oneof_index?: number; /** * JSON name of this field. The value is set by protocol compiler. If the * user has set a "json_name" option on this field, that option's value * will be used. Otherwise, it's deduced from the field's name by converting * it to camelCase. */ - json_name: string; + json_name?: string; options?: FieldOptionsAmino; } export interface FieldDescriptorProtoAminoMsg { @@ -725,12 +725,12 @@ export interface FieldDescriptorProtoSDKType { default_value: string; oneof_index: number; json_name: string; - options: FieldOptionsSDKType; + options?: FieldOptionsSDKType; } /** Describes a oneof. */ export interface OneofDescriptorProto { name: string; - options: OneofOptions; + options?: OneofOptions; } export interface OneofDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.OneofDescriptorProto"; @@ -738,7 +738,7 @@ export interface OneofDescriptorProtoProtoMsg { } /** Describes a oneof. */ export interface OneofDescriptorProtoAmino { - name: string; + name?: string; options?: OneofOptionsAmino; } export interface OneofDescriptorProtoAminoMsg { @@ -748,13 +748,13 @@ export interface OneofDescriptorProtoAminoMsg { /** Describes a oneof. */ export interface OneofDescriptorProtoSDKType { name: string; - options: OneofOptionsSDKType; + options?: OneofOptionsSDKType; } /** Describes an enum type. */ export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions; + options?: EnumOptions; /** * Range of reserved numeric values. Reserved numeric values may not be used * by enum values in the same enum declaration. Reserved ranges may not @@ -773,20 +773,20 @@ export interface EnumDescriptorProtoProtoMsg { } /** Describes an enum type. */ export interface EnumDescriptorProtoAmino { - name: string; - value: EnumValueDescriptorProtoAmino[]; + name?: string; + value?: EnumValueDescriptorProtoAmino[]; options?: EnumOptionsAmino; /** * Range of reserved numeric values. Reserved numeric values may not be used * by enum values in the same enum declaration. Reserved ranges may not * overlap. */ - reserved_range: EnumDescriptorProto_EnumReservedRangeAmino[]; + reserved_range?: EnumDescriptorProto_EnumReservedRangeAmino[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reserved_name?: string[]; } export interface EnumDescriptorProtoAminoMsg { type: "/google.protobuf.EnumDescriptorProto"; @@ -796,7 +796,7 @@ export interface EnumDescriptorProtoAminoMsg { export interface EnumDescriptorProtoSDKType { name: string; value: EnumValueDescriptorProtoSDKType[]; - options: EnumOptionsSDKType; + options?: EnumOptionsSDKType; reserved_range: EnumDescriptorProto_EnumReservedRangeSDKType[]; reserved_name: string[]; } @@ -828,9 +828,9 @@ export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { */ export interface EnumDescriptorProto_EnumReservedRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Inclusive. */ - end: number; + end?: number; } export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { type: "/google.protobuf.EnumReservedRange"; @@ -852,7 +852,7 @@ export interface EnumDescriptorProto_EnumReservedRangeSDKType { export interface EnumValueDescriptorProto { name: string; number: number; - options: EnumValueOptions; + options?: EnumValueOptions; } export interface EnumValueDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.EnumValueDescriptorProto"; @@ -860,8 +860,8 @@ export interface EnumValueDescriptorProtoProtoMsg { } /** Describes a value within an enum. */ export interface EnumValueDescriptorProtoAmino { - name: string; - number: number; + name?: string; + number?: number; options?: EnumValueOptionsAmino; } export interface EnumValueDescriptorProtoAminoMsg { @@ -872,13 +872,13 @@ export interface EnumValueDescriptorProtoAminoMsg { export interface EnumValueDescriptorProtoSDKType { name: string; number: number; - options: EnumValueOptionsSDKType; + options?: EnumValueOptionsSDKType; } /** Describes a service. */ export interface ServiceDescriptorProto { name: string; method: MethodDescriptorProto[]; - options: ServiceOptions; + options?: ServiceOptions; } export interface ServiceDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.ServiceDescriptorProto"; @@ -886,8 +886,8 @@ export interface ServiceDescriptorProtoProtoMsg { } /** Describes a service. */ export interface ServiceDescriptorProtoAmino { - name: string; - method: MethodDescriptorProtoAmino[]; + name?: string; + method?: MethodDescriptorProtoAmino[]; options?: ServiceOptionsAmino; } export interface ServiceDescriptorProtoAminoMsg { @@ -898,7 +898,7 @@ export interface ServiceDescriptorProtoAminoMsg { export interface ServiceDescriptorProtoSDKType { name: string; method: MethodDescriptorProtoSDKType[]; - options: ServiceOptionsSDKType; + options?: ServiceOptionsSDKType; } /** Describes a method of a service. */ export interface MethodDescriptorProto { @@ -909,7 +909,7 @@ export interface MethodDescriptorProto { */ inputType: string; outputType: string; - options: MethodOptions; + options?: MethodOptions; /** Identifies if client streams multiple client messages */ clientStreaming: boolean; /** Identifies if server streams multiple server messages */ @@ -921,18 +921,18 @@ export interface MethodDescriptorProtoProtoMsg { } /** Describes a method of a service. */ export interface MethodDescriptorProtoAmino { - name: string; + name?: string; /** * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; + input_type?: string; + output_type?: string; options?: MethodOptionsAmino; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + client_streaming?: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + server_streaming?: boolean; } export interface MethodDescriptorProtoAminoMsg { type: "/google.protobuf.MethodDescriptorProto"; @@ -943,7 +943,7 @@ export interface MethodDescriptorProtoSDKType { name: string; input_type: string; output_type: string; - options: MethodOptionsSDKType; + options?: MethodOptionsSDKType; client_streaming: boolean; server_streaming: boolean; } @@ -1075,7 +1075,7 @@ export interface FileOptionsAmino { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + java_package?: string; /** * If set, all the classes from the .proto file are wrapped in a single * outer class with the given name. This applies to both Proto1 @@ -1083,7 +1083,7 @@ export interface FileOptionsAmino { * a .proto always translates to a single class, but you may want to * explicitly choose the class name). */ - java_outer_classname: string; + java_outer_classname?: string; /** * If set true, then the Java code generator will generate a separate .java * file for each top-level message, enum, and service defined in the .proto @@ -1092,10 +1092,10 @@ export interface FileOptionsAmino { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + java_multiple_files?: boolean; /** This option does nothing. */ /** @deprecated */ - java_generate_equals_and_hash: boolean; + java_generate_equals_and_hash?: boolean; /** * If set true, then the Java2 code generator will generate code that * throws an exception whenever an attempt is made to assign a non-UTF-8 @@ -1104,8 +1104,8 @@ export interface FileOptionsAmino { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + java_string_check_utf8?: boolean; + optimize_for?: FileOptions_OptimizeMode; /** * Sets the Go package where structs generated from this .proto will be * placed. If omitted, the Go package will be derived from the following: @@ -1113,7 +1113,7 @@ export interface FileOptionsAmino { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + go_package?: string; /** * Should generic services be generated in each language? "Generic" services * are not specific to any particular RPC system. They are generated by the @@ -1126,64 +1126,64 @@ export interface FileOptionsAmino { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations * for everything in the file, or it will be completely ignored; in the very * least, this is a formalization for deprecating files. */ - deprecated: boolean; + deprecated?: boolean; /** * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + cc_enable_arenas?: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objc_class_prefix?: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + csharp_namespace?: string; /** * By default Swift generators will take the proto package and CamelCase it * replacing '.' with underscore and use that to prefix the types/symbols * defined. When this options is provided, they will use this value instead * to prefix the types/symbols defined. */ - swift_prefix: string; + swift_prefix?: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + php_class_prefix?: string; /** * Use this option to change the namespace of php generated classes. Default * is empty. When this option is empty, the package name will be used for * determining the namespace. */ - php_namespace: string; + php_namespace?: string; /** * Use this option to change the namespace of php generated metadata classes. * Default is empty. When this option is empty, the proto file name will be * used for determining the namespace. */ - php_metadata_namespace: string; + php_metadata_namespace?: string; /** * Use this option to change the package of ruby generated classes. Default * is empty. When this option is not set, the package name will be used for * determining the ruby package. */ - ruby_package: string; + ruby_package?: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface FileOptionsAminoMsg { type: "/google.protobuf.FileOptions"; @@ -1300,20 +1300,20 @@ export interface MessageOptionsAmino { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + message_set_wire_format?: boolean; /** * Disables the generation of the standard "descriptor()" accessor, which can * conflict with a field of the same name. This is meant to make migration * from proto1 easier; new code should avoid fields named "descriptor". */ - no_standard_descriptor_accessor: boolean; + no_standard_descriptor_accessor?: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the message, or it will be completely ignored; in the very least, * this is a formalization for deprecating messages. */ - deprecated: boolean; + deprecated?: boolean; /** * Whether the message is an automatically generated map entry type for the * maps field. @@ -1337,9 +1337,9 @@ export interface MessageOptionsAmino { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + map_entry?: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface MessageOptionsAminoMsg { type: "/google.protobuf.MessageOptions"; @@ -1436,7 +1436,7 @@ export interface FieldOptionsAmino { * options below. This option is not yet implemented in the open source * release -- sorry, we'll try to include it in a future version! */ - ctype: FieldOptions_CType; + ctype?: FieldOptions_CType; /** * The packed option can be enabled for repeated primitive fields to enable * a more efficient representation on the wire. Rather than repeatedly @@ -1444,7 +1444,7 @@ export interface FieldOptionsAmino { * a single length-delimited blob. In proto3, only explicit setting it to * false will avoid using packed encoding. */ - packed: boolean; + packed?: boolean; /** * The jstype option determines the JavaScript type used for values of the * field. The option is permitted only for 64 bit integral and fixed types @@ -1458,7 +1458,7 @@ export interface FieldOptionsAmino { * This option is an enum to permit additional types to be added, e.g. * goog.math.Integer. */ - jstype: FieldOptions_JSType; + jstype?: FieldOptions_JSType; /** * Should this field be parsed lazily? Lazy applies only to message-type * fields. It means that when the outer message is initially parsed, the @@ -1489,18 +1489,18 @@ export interface FieldOptionsAmino { * check its required fields, regardless of whether or not the message has * been parsed. */ - lazy: boolean; + lazy?: boolean; /** * Is this field deprecated? * Depending on the target platform, this can emit Deprecated annotations * for accessors, or it will be completely ignored; in the very least, this * is a formalization for deprecating fields. */ - deprecated: boolean; + deprecated?: boolean; /** For Google-internal migration only. Do not use. */ - weak: boolean; + weak?: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface FieldOptionsAminoMsg { type: "/google.protobuf.FieldOptions"; @@ -1525,7 +1525,7 @@ export interface OneofOptionsProtoMsg { } export interface OneofOptionsAmino { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface OneofOptionsAminoMsg { type: "/google.protobuf.OneofOptions"; @@ -1559,16 +1559,16 @@ export interface EnumOptionsAmino { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allow_alias?: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the enum, or it will be completely ignored; in the very least, this * is a formalization for deprecating enums. */ - deprecated: boolean; + deprecated?: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface EnumOptionsAminoMsg { type: "/google.protobuf.EnumOptions"; @@ -1601,9 +1601,9 @@ export interface EnumValueOptionsAmino { * for the enum value, or it will be completely ignored; in the very least, * this is a formalization for deprecating enum values. */ - deprecated: boolean; + deprecated?: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface EnumValueOptionsAminoMsg { type: "/google.protobuf.EnumValueOptions"; @@ -1635,9 +1635,9 @@ export interface ServiceOptionsAmino { * for the service, or it will be completely ignored; in the very least, * this is a formalization for deprecating services. */ - deprecated: boolean; + deprecated?: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface ServiceOptionsAminoMsg { type: "/google.protobuf.ServiceOptions"; @@ -1670,10 +1670,10 @@ export interface MethodOptionsAmino { * for the method, or it will be completely ignored; in the very least, * this is a formalization for deprecating methods. */ - deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + deprecated?: boolean; + idempotency_level?: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface MethodOptionsAminoMsg { type: "/google.protobuf.MethodOptions"; @@ -1699,8 +1699,8 @@ export interface UninterpretedOption { * identified it as during parsing. Exactly one of these should be set. */ identifierValue: string; - positiveIntValue: Long; - negativeIntValue: Long; + positiveIntValue: bigint; + negativeIntValue: bigint; doubleValue: number; stringValue: Uint8Array; aggregateValue: string; @@ -1718,17 +1718,17 @@ export interface UninterpretedOptionProtoMsg { * in them. */ export interface UninterpretedOptionAmino { - name: UninterpretedOption_NamePartAmino[]; + name?: UninterpretedOption_NamePartAmino[]; /** * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: string; - negative_int_value: string; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifier_value?: string; + positive_int_value?: string; + negative_int_value?: string; + double_value?: number; + string_value?: string; + aggregate_value?: string; } export interface UninterpretedOptionAminoMsg { type: "/google.protobuf.UninterpretedOption"; @@ -1745,8 +1745,8 @@ export interface UninterpretedOptionAminoMsg { export interface UninterpretedOptionSDKType { name: UninterpretedOption_NamePartSDKType[]; identifier_value: string; - positive_int_value: Long; - negative_int_value: Long; + positive_int_value: bigint; + negative_int_value: bigint; double_value: number; string_value: Uint8Array; aggregate_value: string; @@ -1774,8 +1774,8 @@ export interface UninterpretedOption_NamePartProtoMsg { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePartAmino { - name_part: string; - is_extension: boolean; + name_part?: string; + is_extension?: boolean; } export interface UninterpretedOption_NamePartAminoMsg { type: "/google.protobuf.NamePart"; @@ -1898,7 +1898,7 @@ export interface SourceCodeInfoAmino { * ignore those that it doesn't understand, as more types of locations could * be recorded in the future. */ - location: SourceCodeInfo_LocationAmino[]; + location?: SourceCodeInfo_LocationAmino[]; } export interface SourceCodeInfoAminoMsg { type: "/google.protobuf.SourceCodeInfo"; @@ -2029,7 +2029,7 @@ export interface SourceCodeInfo_LocationAmino { * this path refers to the whole field declaration (from the beginning * of the label to the terminating semicolon). */ - path: number[]; + path?: number[]; /** * Always has exactly three or four elements: start line, start column, * end line (optional, otherwise assumed same as start line), end column. @@ -2037,7 +2037,7 @@ export interface SourceCodeInfo_LocationAmino { * and column numbers are zero-based -- typically you will want to add * 1 to each before displaying to a user. */ - span: number[]; + span?: number[]; /** * If this SourceCodeInfo represents a complete declaration, these are any * comments appearing before and after the declaration which appear to be @@ -2087,9 +2087,9 @@ export interface SourceCodeInfo_LocationAmino { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments?: string[]; } export interface SourceCodeInfo_LocationAminoMsg { type: "/google.protobuf.Location"; @@ -2128,7 +2128,7 @@ export interface GeneratedCodeInfoAmino { * An Annotation connects some span of text in generated code to an element * of its generating .proto file. */ - annotation: GeneratedCodeInfo_AnnotationAmino[]; + annotation?: GeneratedCodeInfo_AnnotationAmino[]; } export interface GeneratedCodeInfoAminoMsg { type: "/google.protobuf.GeneratedCodeInfo"; @@ -2171,20 +2171,20 @@ export interface GeneratedCodeInfo_AnnotationAmino { * Identifies the element in the original source .proto file. This field * is formatted the same as SourceCodeInfo.Location.path. */ - path: number[]; + path?: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + source_file?: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. */ - begin: number; + begin?: number; /** * Identifies the ending offset in bytes in the generated code that * relates to the identified offset. The end offset should be one past * the last relevant byte (so the length of the text = end - begin). */ - end: number; + end?: number; } export interface GeneratedCodeInfo_AnnotationAminoMsg { type: "/google.protobuf.Annotation"; @@ -2202,14 +2202,15 @@ function createBaseFileDescriptorSet(): FileDescriptorSet { }; } export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.FileDescriptorSet", + encode(message: FileDescriptorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.file) { FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileDescriptorSet(); while (reader.pos < end) { @@ -2245,16 +2246,16 @@ export const FileDescriptorSet = { return message; }, fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { - return { - file: Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromAmino(e)) : [] - }; + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; }, toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { const obj: any = {}; if (message.file) { obj.file = message.file.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); } else { - obj.file = []; + obj.file = message.file; } return obj; }, @@ -2285,13 +2286,14 @@ function createBaseFileDescriptorProto(): FileDescriptorProto { enumType: [], service: [], extension: [], - options: FileOptions.fromPartial({}), - sourceCodeInfo: SourceCodeInfo.fromPartial({}), + options: undefined, + sourceCodeInfo: undefined, syntax: "" }; } export const FileDescriptorProto = { - encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.FileDescriptorProto", + encode(message: FileDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2334,8 +2336,8 @@ export const FileDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileDescriptorProto(); while (reader.pos < end) { @@ -2475,63 +2477,73 @@ export const FileDescriptorProto = { return message; }, fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { - return { - name: object.name, - package: object.package, - dependency: Array.isArray(object?.dependency) ? object.dependency.map((e: any) => e) : [], - publicDependency: Array.isArray(object?.public_dependency) ? object.public_dependency.map((e: any) => e) : [], - weakDependency: Array.isArray(object?.weak_dependency) ? object.weak_dependency.map((e: any) => e) : [], - messageType: Array.isArray(object?.message_type) ? object.message_type.map((e: any) => DescriptorProto.fromAmino(e)) : [], - enumType: Array.isArray(object?.enum_type) ? object.enum_type.map((e: any) => EnumDescriptorProto.fromAmino(e)) : [], - service: Array.isArray(object?.service) ? object.service.map((e: any) => ServiceDescriptorProto.fromAmino(e)) : [], - extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - options: object?.options ? FileOptions.fromAmino(object.options) : undefined, - sourceCodeInfo: object?.source_code_info ? SourceCodeInfo.fromAmino(object.source_code_info) : undefined, - syntax: object.syntax - }; + const message = createBaseFileDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.public_dependency?.map(e => e) || []; + message.weakDependency = object.weak_dependency?.map(e => e) || []; + message.messageType = object.message_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromAmino(object.options); + } + if (object.source_code_info !== undefined && object.source_code_info !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromAmino(object.source_code_info); + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } + return message; }, 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 { @@ -2559,13 +2571,14 @@ function createBaseDescriptorProto(): DescriptorProto { enumType: [], extensionRange: [], oneofDecl: [], - options: MessageOptions.fromPartial({}), + options: undefined, reservedRange: [], reservedName: [] }; } export const DescriptorProto = { - encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.DescriptorProto", + encode(message: DescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2598,8 +2611,8 @@ export const DescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescriptorProto(); while (reader.pos < end) { @@ -2717,62 +2730,66 @@ export const DescriptorProto = { return message; }, fromAmino(object: DescriptorProtoAmino): DescriptorProto { - return { - name: object.name, - field: Array.isArray(object?.field) ? object.field.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - nestedType: Array.isArray(object?.nested_type) ? object.nested_type.map((e: any) => DescriptorProto.fromAmino(e)) : [], - enumType: Array.isArray(object?.enum_type) ? object.enum_type.map((e: any) => EnumDescriptorProto.fromAmino(e)) : [], - extensionRange: Array.isArray(object?.extension_range) ? object.extension_range.map((e: any) => DescriptorProto_ExtensionRange.fromAmino(e)) : [], - oneofDecl: Array.isArray(object?.oneof_decl) ? object.oneof_decl.map((e: any) => OneofDescriptorProto.fromAmino(e)) : [], - options: object?.options ? MessageOptions.fromAmino(object.options) : undefined, - reservedRange: Array.isArray(object?.reserved_range) ? object.reserved_range.map((e: any) => DescriptorProto_ReservedRange.fromAmino(e)) : [], - reservedName: Array.isArray(object?.reserved_name) ? object.reserved_name.map((e: any) => e) : [] - }; + const message = createBaseDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.field = object.field?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.nestedType = object.nested_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.extensionRange = object.extension_range?.map(e => DescriptorProto_ExtensionRange.fromAmino(e)) || []; + message.oneofDecl = object.oneof_decl?.map(e => OneofDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => DescriptorProto_ReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; }, 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; }, @@ -2796,11 +2813,12 @@ function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRa return { start: 0, end: 0, - options: ExtensionRangeOptions.fromPartial({}) + options: undefined }; } export const DescriptorProto_ExtensionRange = { - encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.ExtensionRange", + encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2812,8 +2830,8 @@ export const DescriptorProto_ExtensionRange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { @@ -2857,16 +2875,22 @@ export const DescriptorProto_ExtensionRange = { return message; }, fromAmino(object: DescriptorProto_ExtensionRangeAmino): DescriptorProto_ExtensionRange { - return { - start: object.start, - end: object.end, - options: object?.options ? ExtensionRangeOptions.fromAmino(object.options) : undefined - }; + const message = createBaseDescriptorProto_ExtensionRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromAmino(object.options); + } + return message; }, 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; }, @@ -2893,7 +2917,8 @@ function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRang }; } export const DescriptorProto_ReservedRange = { - encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.ReservedRange", + encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2902,8 +2927,8 @@ export const DescriptorProto_ReservedRange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { @@ -2941,15 +2966,19 @@ export const DescriptorProto_ReservedRange = { return message; }, fromAmino(object: DescriptorProto_ReservedRangeAmino): DescriptorProto_ReservedRange { - return { - start: object.start, - end: object.end - }; + const message = createBaseDescriptorProto_ReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, 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 { @@ -2974,14 +3003,15 @@ function createBaseExtensionRangeOptions(): ExtensionRangeOptions { }; } export const ExtensionRangeOptions = { - encode(message: ExtensionRangeOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.ExtensionRangeOptions", + encode(message: ExtensionRangeOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { @@ -3017,16 +3047,16 @@ export const ExtensionRangeOptions = { return message; }, fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { const obj: any = {}; 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; }, @@ -3057,11 +3087,12 @@ function createBaseFieldDescriptorProto(): FieldDescriptorProto { defaultValue: "", oneofIndex: 0, jsonName: "", - options: FieldOptions.fromPartial({}) + options: undefined }; } export const FieldDescriptorProto = { - encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.FieldDescriptorProto", + encode(message: FieldDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -3094,8 +3125,8 @@ export const FieldDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { @@ -3142,8 +3173,8 @@ export const FieldDescriptorProto = { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: isSet(object.typeName) ? String(object.typeName) : "", extendee: isSet(object.extendee) ? String(object.extendee) : "", defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", @@ -3181,30 +3212,50 @@ export const FieldDescriptorProto = { return message; }, fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { - return { - name: object.name, - number: object.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, - typeName: object.type_name, - extendee: object.extendee, - defaultValue: object.default_value, - oneofIndex: object.oneof_index, - jsonName: object.json_name, - options: object?.options ? FieldOptions.fromAmino(object.options) : undefined - }; + const message = createBaseFieldDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.typeName = object.type_name; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneofIndex = object.oneof_index; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.jsonName = object.json_name; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromAmino(object.options); + } + return message; }, 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; }, @@ -3227,11 +3278,12 @@ export const FieldDescriptorProto = { function createBaseOneofDescriptorProto(): OneofDescriptorProto { return { name: "", - options: OneofOptions.fromPartial({}) + options: undefined }; } export const OneofDescriptorProto = { - encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.OneofDescriptorProto", + encode(message: OneofDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -3240,8 +3292,8 @@ export const OneofDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { @@ -3279,14 +3331,18 @@ export const OneofDescriptorProto = { return message; }, fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { - return { - name: object.name, - options: object?.options ? OneofOptions.fromAmino(object.options) : undefined - }; + const message = createBaseOneofDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromAmino(object.options); + } + return message; }, 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; }, @@ -3310,13 +3366,14 @@ function createBaseEnumDescriptorProto(): EnumDescriptorProto { return { name: "", value: [], - options: EnumOptions.fromPartial({}), + options: undefined, reservedRange: [], reservedName: [] }; } export const EnumDescriptorProto = { - encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.EnumDescriptorProto", + encode(message: EnumDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -3334,8 +3391,8 @@ export const EnumDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { @@ -3403,32 +3460,36 @@ export const EnumDescriptorProto = { return message; }, fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { - return { - name: object.name, - value: Array.isArray(object?.value) ? object.value.map((e: any) => EnumValueDescriptorProto.fromAmino(e)) : [], - options: object?.options ? EnumOptions.fromAmino(object.options) : undefined, - reservedRange: Array.isArray(object?.reserved_range) ? object.reserved_range.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) : [], - reservedName: Array.isArray(object?.reserved_name) ? object.reserved_name.map((e: any) => e) : [] - }; + const message = createBaseEnumDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.value = object.value?.map(e => EnumValueDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; }, 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; }, @@ -3455,7 +3516,8 @@ function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_ }; } export const EnumDescriptorProto_EnumReservedRange = { - encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.EnumReservedRange", + encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -3464,8 +3526,8 @@ export const EnumDescriptorProto_EnumReservedRange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { @@ -3503,15 +3565,19 @@ export const EnumDescriptorProto_EnumReservedRange = { return message; }, fromAmino(object: EnumDescriptorProto_EnumReservedRangeAmino): EnumDescriptorProto_EnumReservedRange { - return { - start: object.start, - end: object.end - }; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, 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 { @@ -3534,11 +3600,12 @@ function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { return { name: "", number: 0, - options: EnumValueOptions.fromPartial({}) + options: undefined }; } export const EnumValueDescriptorProto = { - encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.EnumValueDescriptorProto", + encode(message: EnumValueDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -3550,8 +3617,8 @@ export const EnumValueDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { @@ -3595,16 +3662,22 @@ export const EnumValueDescriptorProto = { return message; }, fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { - return { - name: object.name, - number: object.number, - options: object?.options ? EnumValueOptions.fromAmino(object.options) : undefined - }; + const message = createBaseEnumValueDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromAmino(object.options); + } + return message; }, 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; }, @@ -3628,11 +3701,12 @@ function createBaseServiceDescriptorProto(): ServiceDescriptorProto { return { name: "", method: [], - options: ServiceOptions.fromPartial({}) + options: undefined }; } export const ServiceDescriptorProto = { - encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.ServiceDescriptorProto", + encode(message: ServiceDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -3644,8 +3718,8 @@ export const ServiceDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { @@ -3693,19 +3767,23 @@ export const ServiceDescriptorProto = { return message; }, fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { - return { - name: object.name, - method: Array.isArray(object?.method) ? object.method.map((e: any) => MethodDescriptorProto.fromAmino(e)) : [], - options: object?.options ? ServiceOptions.fromAmino(object.options) : undefined - }; + const message = createBaseServiceDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.method = object.method?.map(e => MethodDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromAmino(object.options); + } + return message; }, 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; @@ -3731,13 +3809,14 @@ function createBaseMethodDescriptorProto(): MethodDescriptorProto { name: "", inputType: "", outputType: "", - options: MethodOptions.fromPartial({}), + options: undefined, clientStreaming: false, serverStreaming: false }; } export const MethodDescriptorProto = { - encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.MethodDescriptorProto", + encode(message: MethodDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -3758,8 +3837,8 @@ export const MethodDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { @@ -3821,23 +3900,35 @@ export const MethodDescriptorProto = { return message; }, fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { - return { - name: object.name, - inputType: object.input_type, - outputType: object.output_type, - options: object?.options ? MethodOptions.fromAmino(object.options) : undefined, - clientStreaming: object.client_streaming, - serverStreaming: object.server_streaming - }; + const message = createBaseMethodDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.inputType = object.input_type; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.outputType = object.output_type; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromAmino(object.options); + } + if (object.client_streaming !== undefined && object.client_streaming !== null) { + message.clientStreaming = object.client_streaming; + } + if (object.server_streaming !== undefined && object.server_streaming !== null) { + message.serverStreaming = object.server_streaming; + } + return message; }, 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 { @@ -3882,7 +3973,8 @@ function createBaseFileOptions(): FileOptions { }; } export const FileOptions = { - encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.FileOptions", + encode(message: FileOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.javaPackage !== "") { writer.uint32(10).string(message.javaPackage); } @@ -3948,8 +4040,8 @@ export const FileOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileOptions(); while (reader.pos < end) { @@ -4032,7 +4124,7 @@ export const FileOptions = { javaMultipleFiles: isSet(object.javaMultipleFiles) ? Boolean(object.javaMultipleFiles) : false, javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? Boolean(object.javaGenerateEqualsAndHash) : false, javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 0, + optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : -1, goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", ccGenericServices: isSet(object.ccGenericServices) ? Boolean(object.ccGenericServices) : false, javaGenericServices: isSet(object.javaGenericServices) ? Boolean(object.javaGenericServices) : false, @@ -4105,56 +4197,96 @@ export const FileOptions = { return message; }, fromAmino(object: FileOptionsAmino): FileOptions { - return { - javaPackage: object.java_package, - javaOuterClassname: object.java_outer_classname, - javaMultipleFiles: object.java_multiple_files, - javaGenerateEqualsAndHash: object.java_generate_equals_and_hash, - javaStringCheckUtf8: object.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, - goPackage: object.go_package, - ccGenericServices: object.cc_generic_services, - javaGenericServices: object.java_generic_services, - pyGenericServices: object.py_generic_services, - phpGenericServices: object.php_generic_services, - deprecated: object.deprecated, - ccEnableArenas: object.cc_enable_arenas, - objcClassPrefix: object.objc_class_prefix, - csharpNamespace: object.csharp_namespace, - swiftPrefix: object.swift_prefix, - phpClassPrefix: object.php_class_prefix, - phpNamespace: object.php_namespace, - phpMetadataNamespace: object.php_metadata_namespace, - rubyPackage: object.ruby_package, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseFileOptions(); + if (object.java_package !== undefined && object.java_package !== null) { + message.javaPackage = object.java_package; + } + if (object.java_outer_classname !== undefined && object.java_outer_classname !== null) { + message.javaOuterClassname = object.java_outer_classname; + } + if (object.java_multiple_files !== undefined && object.java_multiple_files !== null) { + message.javaMultipleFiles = object.java_multiple_files; + } + if (object.java_generate_equals_and_hash !== undefined && object.java_generate_equals_and_hash !== null) { + message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; + } + if (object.java_string_check_utf8 !== undefined && object.java_string_check_utf8 !== null) { + message.javaStringCheckUtf8 = object.java_string_check_utf8; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimizeFor = object.optimize_for; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.goPackage = object.go_package; + } + if (object.cc_generic_services !== undefined && object.cc_generic_services !== null) { + message.ccGenericServices = object.cc_generic_services; + } + if (object.java_generic_services !== undefined && object.java_generic_services !== null) { + message.javaGenericServices = object.java_generic_services; + } + if (object.py_generic_services !== undefined && object.py_generic_services !== null) { + message.pyGenericServices = object.py_generic_services; + } + if (object.php_generic_services !== undefined && object.php_generic_services !== null) { + message.phpGenericServices = object.php_generic_services; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.cc_enable_arenas !== undefined && object.cc_enable_arenas !== null) { + message.ccEnableArenas = object.cc_enable_arenas; + } + if (object.objc_class_prefix !== undefined && object.objc_class_prefix !== null) { + message.objcClassPrefix = object.objc_class_prefix; + } + if (object.csharp_namespace !== undefined && object.csharp_namespace !== null) { + message.csharpNamespace = object.csharp_namespace; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swiftPrefix = object.swift_prefix; + } + if (object.php_class_prefix !== undefined && object.php_class_prefix !== null) { + message.phpClassPrefix = object.php_class_prefix; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.phpNamespace = object.php_namespace; + } + if (object.php_metadata_namespace !== undefined && object.php_metadata_namespace !== null) { + message.phpMetadataNamespace = object.php_metadata_namespace; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.rubyPackage = object.ruby_package; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, 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; }, @@ -4184,7 +4316,8 @@ function createBaseMessageOptions(): MessageOptions { }; } export const MessageOptions = { - encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.MessageOptions", + encode(message: MessageOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.messageSetWireFormat === true) { writer.uint32(8).bool(message.messageSetWireFormat); } @@ -4202,8 +4335,8 @@ export const MessageOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMessageOptions(); while (reader.pos < end) { @@ -4263,24 +4396,32 @@ export const MessageOptions = { return message; }, fromAmino(object: MessageOptionsAmino): MessageOptions { - return { - messageSetWireFormat: object.message_set_wire_format, - noStandardDescriptorAccessor: object.no_standard_descriptor_accessor, - deprecated: object.deprecated, - mapEntry: object.map_entry, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseMessageOptions(); + if (object.message_set_wire_format !== undefined && object.message_set_wire_format !== null) { + message.messageSetWireFormat = object.message_set_wire_format; + } + if (object.no_standard_descriptor_accessor !== undefined && object.no_standard_descriptor_accessor !== null) { + message.noStandardDescriptorAccessor = object.no_standard_descriptor_accessor; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.mapEntry = object.map_entry; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, 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; }, @@ -4312,7 +4453,8 @@ function createBaseFieldOptions(): FieldOptions { }; } export const FieldOptions = { - encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.FieldOptions", + encode(message: FieldOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ctype !== 1) { writer.uint32(8).int32(message.ctype); } @@ -4336,8 +4478,8 @@ export const FieldOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFieldOptions(); while (reader.pos < end) { @@ -4373,9 +4515,9 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, @@ -4409,28 +4551,40 @@ export const FieldOptions = { return message; }, fromAmino(object: FieldOptionsAmino): FieldOptions { - return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, - packed: object.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, - lazy: object.lazy, - deprecated: object.deprecated, - weak: object.weak, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseFieldOptions(); + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, 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; }, @@ -4456,14 +4610,15 @@ function createBaseOneofOptions(): OneofOptions { }; } export const OneofOptions = { - encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.OneofOptions", + encode(message: OneofOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOneofOptions(); while (reader.pos < end) { @@ -4499,16 +4654,16 @@ export const OneofOptions = { return message; }, fromAmino(object: OneofOptionsAmino): OneofOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: OneofOptions): OneofOptionsAmino { const obj: any = {}; 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; }, @@ -4536,7 +4691,8 @@ function createBaseEnumOptions(): EnumOptions { }; } export const EnumOptions = { - encode(message: EnumOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.EnumOptions", + encode(message: EnumOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowAlias === true) { writer.uint32(16).bool(message.allowAlias); } @@ -4548,8 +4704,8 @@ export const EnumOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumOptions(); while (reader.pos < end) { @@ -4597,20 +4753,24 @@ export const EnumOptions = { return message; }, fromAmino(object: EnumOptionsAmino): EnumOptions { - return { - allowAlias: object.allow_alias, - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseEnumOptions(); + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allowAlias = object.allow_alias; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, 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; }, @@ -4637,7 +4797,8 @@ function createBaseEnumValueOptions(): EnumValueOptions { }; } export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.EnumValueOptions", + encode(message: EnumValueOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(8).bool(message.deprecated); } @@ -4646,8 +4807,8 @@ export const EnumValueOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumValueOptions(); while (reader.pos < end) { @@ -4689,18 +4850,20 @@ export const EnumValueOptions = { return message; }, fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { - return { - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseEnumValueOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, 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; }, @@ -4727,7 +4890,8 @@ function createBaseServiceOptions(): ServiceOptions { }; } export const ServiceOptions = { - encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.ServiceOptions", + encode(message: ServiceOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } @@ -4736,8 +4900,8 @@ export const ServiceOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseServiceOptions(); while (reader.pos < end) { @@ -4779,18 +4943,20 @@ export const ServiceOptions = { return message; }, fromAmino(object: ServiceOptionsAmino): ServiceOptions { - return { - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseServiceOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, 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; }, @@ -4818,7 +4984,8 @@ function createBaseMethodOptions(): MethodOptions { }; } export const MethodOptions = { - encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.MethodOptions", + encode(message: MethodOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } @@ -4830,8 +4997,8 @@ export const MethodOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMethodOptions(); while (reader.pos < end) { @@ -4856,7 +5023,7 @@ export const MethodOptions = { fromJSON(object: any): MethodOptions { return { deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : 0, + idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : -1, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, @@ -4879,20 +5046,24 @@ export const MethodOptions = { return message; }, fromAmino(object: MethodOptionsAmino): MethodOptions { - return { - deprecated: object.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseMethodOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.idempotency_level !== undefined && object.idempotency_level !== null) { + 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; }, @@ -4916,25 +5087,26 @@ function createBaseUninterpretedOption(): UninterpretedOption { return { name: [], identifierValue: "", - positiveIntValue: Long.UZERO, - negativeIntValue: Long.ZERO, + positiveIntValue: BigInt(0), + negativeIntValue: BigInt(0), doubleValue: 0, stringValue: new Uint8Array(), aggregateValue: "" }; } export const UninterpretedOption = { - encode(message: UninterpretedOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.UninterpretedOption", + encode(message: UninterpretedOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.name) { UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.identifierValue !== "") { writer.uint32(26).string(message.identifierValue); } - if (!message.positiveIntValue.isZero()) { + if (message.positiveIntValue !== BigInt(0)) { writer.uint32(32).uint64(message.positiveIntValue); } - if (!message.negativeIntValue.isZero()) { + if (message.negativeIntValue !== BigInt(0)) { writer.uint32(40).int64(message.negativeIntValue); } if (message.doubleValue !== 0) { @@ -4948,8 +5120,8 @@ export const UninterpretedOption = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUninterpretedOption(); while (reader.pos < end) { @@ -4962,10 +5134,10 @@ export const UninterpretedOption = { message.identifierValue = reader.string(); break; case 4: - message.positiveIntValue = (reader.uint64() as Long); + message.positiveIntValue = reader.uint64(); break; case 5: - message.negativeIntValue = (reader.int64() as Long); + message.negativeIntValue = reader.int64(); break; case 6: message.doubleValue = reader.double(); @@ -4987,8 +5159,8 @@ export const UninterpretedOption = { return { name: Array.isArray(object?.name) ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) : [], identifierValue: isSet(object.identifierValue) ? String(object.identifierValue) : "", - positiveIntValue: isSet(object.positiveIntValue) ? Long.fromValue(object.positiveIntValue) : Long.UZERO, - negativeIntValue: isSet(object.negativeIntValue) ? Long.fromValue(object.negativeIntValue) : Long.ZERO, + positiveIntValue: isSet(object.positiveIntValue) ? BigInt(object.positiveIntValue.toString()) : BigInt(0), + negativeIntValue: isSet(object.negativeIntValue) ? BigInt(object.negativeIntValue.toString()) : BigInt(0), doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0, stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(), aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "" @@ -5002,8 +5174,8 @@ export const UninterpretedOption = { obj.name = []; } message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); - message.positiveIntValue !== undefined && (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()); - message.negativeIntValue !== undefined && (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString()); + message.positiveIntValue !== undefined && (obj.positiveIntValue = (message.positiveIntValue || BigInt(0)).toString()); + message.negativeIntValue !== undefined && (obj.negativeIntValue = (message.negativeIntValue || BigInt(0)).toString()); message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); message.stringValue !== undefined && (obj.stringValue = base64FromBytes(message.stringValue !== undefined ? message.stringValue : new Uint8Array())); message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); @@ -5013,37 +5185,49 @@ export const UninterpretedOption = { const message = createBaseUninterpretedOption(); message.name = object.name?.map(e => UninterpretedOption_NamePart.fromPartial(e)) || []; message.identifierValue = object.identifierValue ?? ""; - message.positiveIntValue = object.positiveIntValue !== undefined && object.positiveIntValue !== null ? Long.fromValue(object.positiveIntValue) : Long.UZERO; - message.negativeIntValue = object.negativeIntValue !== undefined && object.negativeIntValue !== null ? Long.fromValue(object.negativeIntValue) : Long.ZERO; + message.positiveIntValue = object.positiveIntValue !== undefined && object.positiveIntValue !== null ? BigInt(object.positiveIntValue.toString()) : BigInt(0); + message.negativeIntValue = object.negativeIntValue !== undefined && object.negativeIntValue !== null ? BigInt(object.negativeIntValue.toString()) : BigInt(0); message.doubleValue = object.doubleValue ?? 0; message.stringValue = object.stringValue ?? new Uint8Array(); message.aggregateValue = object.aggregateValue ?? ""; return message; }, fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { - return { - name: Array.isArray(object?.name) ? object.name.map((e: any) => UninterpretedOption_NamePart.fromAmino(e)) : [], - identifierValue: object.identifier_value, - positiveIntValue: Long.fromString(object.positive_int_value), - negativeIntValue: Long.fromString(object.negative_int_value), - doubleValue: object.double_value, - stringValue: object.string_value, - aggregateValue: object.aggregate_value - }; + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromAmino(e)) || []; + if (object.identifier_value !== undefined && object.identifier_value !== null) { + message.identifierValue = object.identifier_value; + } + if (object.positive_int_value !== undefined && object.positive_int_value !== null) { + message.positiveIntValue = BigInt(object.positive_int_value); + } + if (object.negative_int_value !== undefined && object.negative_int_value !== null) { + message.negativeIntValue = BigInt(object.negative_int_value); + } + if (object.double_value !== undefined && object.double_value !== null) { + message.doubleValue = object.double_value; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.stringValue = bytesFromBase64(object.string_value); + } + if (object.aggregate_value !== undefined && object.aggregate_value !== null) { + message.aggregateValue = object.aggregate_value; + } + return message; }, toAmino(message: UninterpretedOption): UninterpretedOptionAmino { const obj: any = {}; if (message.name) { obj.name = message.name.map(e => e ? UninterpretedOption_NamePart.toAmino(e) : undefined); } else { - obj.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.string_value = message.stringValue; - obj.aggregate_value = message.aggregateValue; + obj.name = message.name; + } + 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 === "" ? undefined : message.aggregateValue; return obj; }, fromAminoMsg(object: UninterpretedOptionAminoMsg): UninterpretedOption { @@ -5069,7 +5253,8 @@ function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart }; } export const UninterpretedOption_NamePart = { - encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.NamePart", + encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.namePart !== "") { writer.uint32(10).string(message.namePart); } @@ -5078,8 +5263,8 @@ export const UninterpretedOption_NamePart = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { @@ -5117,15 +5302,19 @@ export const UninterpretedOption_NamePart = { return message; }, fromAmino(object: UninterpretedOption_NamePartAmino): UninterpretedOption_NamePart { - return { - namePart: object.name_part, - isExtension: object.is_extension - }; + const message = createBaseUninterpretedOption_NamePart(); + if (object.name_part !== undefined && object.name_part !== null) { + message.namePart = object.name_part; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.isExtension = object.is_extension; + } + return message; }, 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 { @@ -5150,14 +5339,15 @@ function createBaseSourceCodeInfo(): SourceCodeInfo { }; } export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.SourceCodeInfo", + encode(message: SourceCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.location) { SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSourceCodeInfo(); while (reader.pos < end) { @@ -5193,16 +5383,16 @@ export const SourceCodeInfo = { return message; }, fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { - return { - location: Array.isArray(object?.location) ? object.location.map((e: any) => SourceCodeInfo_Location.fromAmino(e)) : [] - }; + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromAmino(e)) || []; + return message; }, toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { const obj: any = {}; if (message.location) { obj.location = message.location.map(e => e ? SourceCodeInfo_Location.toAmino(e) : undefined); } else { - obj.location = []; + obj.location = message.location; } return obj; }, @@ -5232,7 +5422,8 @@ function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { }; } export const SourceCodeInfo_Location = { - encode(message: SourceCodeInfo_Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.Location", + encode(message: SourceCodeInfo_Location, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.path) { writer.int32(v); @@ -5254,8 +5445,8 @@ export const SourceCodeInfo_Location = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { @@ -5337,32 +5528,36 @@ export const SourceCodeInfo_Location = { return message; }, fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [], - span: Array.isArray(object?.span) ? object.span.map((e: any) => e) : [], - leadingComments: object.leading_comments, - trailingComments: object.trailing_comments, - leadingDetachedComments: Array.isArray(object?.leading_detached_comments) ? object.leading_detached_comments.map((e: any) => e) : [] - }; + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + if (object.leading_comments !== undefined && object.leading_comments !== null) { + message.leadingComments = object.leading_comments; + } + if (object.trailing_comments !== undefined && object.trailing_comments !== null) { + message.trailingComments = object.trailing_comments; + } + message.leadingDetachedComments = object.leading_detached_comments?.map(e => e) || []; + return message; }, toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { const obj: any = {}; 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; }, @@ -5388,14 +5583,15 @@ function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { }; } export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.GeneratedCodeInfo", + encode(message: GeneratedCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.annotation) { GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGeneratedCodeInfo(); while (reader.pos < end) { @@ -5431,16 +5627,16 @@ export const GeneratedCodeInfo = { return message; }, fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { - return { - annotation: Array.isArray(object?.annotation) ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromAmino(e)) : [] - }; + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromAmino(e)) || []; + return message; }, toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { const obj: any = {}; if (message.annotation) { obj.annotation = message.annotation.map(e => e ? GeneratedCodeInfo_Annotation.toAmino(e) : undefined); } else { - obj.annotation = []; + obj.annotation = message.annotation; } return obj; }, @@ -5469,7 +5665,8 @@ function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation }; } export const GeneratedCodeInfo_Annotation = { - encode(message: GeneratedCodeInfo_Annotation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/google.protobuf.Annotation", + encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.path) { writer.int32(v); @@ -5486,8 +5683,8 @@ export const GeneratedCodeInfo_Annotation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { @@ -5548,23 +5745,29 @@ export const GeneratedCodeInfo_Annotation = { return message; }, fromAmino(object: GeneratedCodeInfo_AnnotationAmino): GeneratedCodeInfo_Annotation { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [], - sourceFile: object.source_file, - begin: object.begin, - end: object.end - }; + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + if (object.source_file !== undefined && object.source_file !== null) { + message.sourceFile = object.source_file; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, toAmino(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationAmino { const obj: any = {}; 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/api/src/codegen/google/protobuf/duration.ts b/packages/api/src/codegen/google/protobuf/duration.ts index 64e1acaf..3a2aff40 100644 --- a/packages/api/src/codegen/google/protobuf/duration.ts +++ b/packages/api/src/codegen/google/protobuf/duration.ts @@ -1,5 +1,5 @@ -import { Long, isSet } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; /** * A Duration represents a signed, fixed-length span of time represented * as a count of seconds and fractions of seconds at nanosecond @@ -66,7 +66,7 @@ export interface Duration { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds: Long; + seconds: bigint; /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 @@ -207,18 +207,19 @@ export interface DurationAminoMsg { * microsecond should be expressed in JSON format as "3.000001s". */ export interface DurationSDKType { - seconds: Long; + seconds: bigint; nanos: number; } function createBaseDuration(): Duration { return { - seconds: Long.ZERO, + seconds: BigInt(0), nanos: 0 }; } export const Duration = { - encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.seconds.isZero()) { + typeUrl: "/google.protobuf.Duration", + encode(message: Duration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { writer.uint32(8).int64(message.seconds); } if (message.nanos !== 0) { @@ -226,15 +227,15 @@ export const Duration = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.seconds = (reader.int64() as Long); + message.seconds = reader.int64(); break; case 2: message.nanos = reader.int32(); @@ -248,31 +249,31 @@ export const Duration = { }, fromJSON(object: any): Duration { return { - seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, + seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0), nanos: isSet(object.nanos) ? Number(object.nanos) : 0 }; }, toJSON(message: Duration): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.seconds !== undefined && (obj.seconds = (message.seconds || BigInt(0)).toString()); message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, fromPartial(object: Partial): Duration { const message = createBaseDuration(); - message.seconds = object.seconds !== undefined && object.seconds !== null ? Long.fromValue(object.seconds) : Long.ZERO; + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); message.nanos = object.nanos ?? 0; return message; }, fromAmino(object: DurationAmino): Duration { - const value = parseInt(object); + const value = BigInt(object); return { - seconds: Long.fromNumber(Math.floor(value / 1_000_000_000)), - nanos: value % 1_000_000_000 + seconds: value / BigInt("1000000000"), + nanos: Number(value % BigInt("1000000000")) }; }, toAmino(message: Duration): DurationAmino { - return (message.seconds.toInt() * 1_000_000_000 + message.nanos).toString(); + return (message.seconds * BigInt("1000000000") + BigInt(message.nanos)).toString(); }, fromAminoMsg(object: DurationAminoMsg): Duration { return Duration.fromAmino(object.value); diff --git a/packages/api/src/codegen/google/protobuf/timestamp.ts b/packages/api/src/codegen/google/protobuf/timestamp.ts index fd454b9e..95533b11 100644 --- a/packages/api/src/codegen/google/protobuf/timestamp.ts +++ b/packages/api/src/codegen/google/protobuf/timestamp.ts @@ -1,5 +1,5 @@ -import { Long, isSet } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../helpers"; /** * 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 @@ -90,7 +90,7 @@ export interface Timestamp { * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to * 9999-12-31T23:59:59Z inclusive. */ - seconds: Long; + seconds: bigint; /** * Non-negative fractions of a second at nanosecond resolution. Negative * second values with fractions must still have non-negative nanos values @@ -277,18 +277,19 @@ export interface TimestampAminoMsg { * ) to obtain a formatter capable of generating timestamps in this format. */ export interface TimestampSDKType { - seconds: Long; + seconds: bigint; nanos: number; } function createBaseTimestamp(): Timestamp { return { - seconds: Long.ZERO, + seconds: BigInt(0), nanos: 0 }; } export const Timestamp = { - encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.seconds.isZero()) { + typeUrl: "/google.protobuf.Timestamp", + encode(message: Timestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { writer.uint32(8).int64(message.seconds); } if (message.nanos !== 0) { @@ -296,15 +297,15 @@ export const Timestamp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.seconds = (reader.int64() as Long); + message.seconds = reader.int64(); break; case 2: message.nanos = reader.int32(); @@ -318,33 +319,27 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { return { - seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, + seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0), nanos: isSet(object.nanos) ? Number(object.nanos) : 0 }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.seconds !== undefined && (obj.seconds = (message.seconds || BigInt(0)).toString()); message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, fromPartial(object: Partial): Timestamp { const message = createBaseTimestamp(); - message.seconds = object.seconds !== undefined && object.seconds !== null ? Long.fromValue(object.seconds) : Long.ZERO; + message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); message.nanos = object.nanos ?? 0; return message; }, fromAmino(object: TimestampAmino): Timestamp { - return { - seconds: Long.fromNumber(new Date(object).getSeconds()), - nanos: 0 - }; + return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - const obj: any = {}; - obj.seconds = message.seconds ? message.seconds.toString() : undefined; - obj.nanos = message.nanos; - return obj; + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/packages/api/src/codegen/helpers.ts b/packages/api/src/codegen/helpers.ts index 99c75645..8fb6b0ed 100644 --- a/packages/api/src/codegen/helpers.ts +++ b/packages/api/src/codegen/helpers.ts @@ -1,242 +1,255 @@ /** -* This file and any referenced files were automatically generated by @osmonauts/telescope@0.99.0 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.5.2 * 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. */ -import * as _m0 from "protobufjs/minimal"; -import Long from 'long'; - -// @ts-ignore -if (_m0.util.Long !== Long) { - _m0.util.Long = (Long as any); - - _m0.configure(); -} - -export { Long }; declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; var globalThis: any = (() => { - if (typeof globalThis !== 'undefined') return globalThis; - if (typeof self !== 'undefined') return self; - if (typeof window !== 'undefined') return window; - if (typeof global !== 'undefined') return global; - throw 'Unable to locate global object'; + if (typeof globalThis !== 'undefined') return globalThis; + if (typeof self !== 'undefined') return self; + if (typeof window !== 'undefined') return window; + if (typeof global !== 'undefined') return global; + throw 'Unable to locate global object'; })(); const atob: (b64: string) => string = - globalThis.atob || ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')); + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')); export function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; } const btoa: (bin: string) => string = - globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')); + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')); export function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return btoa(bin.join('')); + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return btoa(bin.join('')); } export interface AminoHeight { - readonly revision_number?: string; - readonly revision_height?: string; -}; + readonly revision_number?: string; + readonly revision_height?: string; +} -export function omitDefault(input: T): T | undefined { - if (typeof input === "string") { - return input === "" ? undefined : input; - } +export function omitDefault( + input: T +): T | undefined { + if (typeof input === 'string') { + return input === '' ? undefined : input; + } - if (typeof input === "number") { - return input === 0 ? undefined : input; - } + if (typeof input === 'number') { + return input === 0 ? undefined : input; + } - if (Long.isLong(input)) { - return input.isZero() ? undefined : input; - } + if (typeof input === "boolean"){ + return input === false ? undefined : input; + } - throw new Error(`Got unsupported type ${typeof input}`); -}; + if (typeof input === 'bigint') { + return input === BigInt(0) ? undefined : input; + } + + throw new Error(`Got unsupported type ${typeof input}`); +} interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: Long; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - - nanos: number; + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + + nanos: number; } export function toDuration(duration: string): Duration { - return { - seconds: Long.fromNumber(Math.floor(parseInt(duration) / 1000000000)), - nanos: parseInt(duration) % 1000000000 - }; -}; + return { + seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)), + nanos: parseInt(duration) % 1000000000 + }; +} export function fromDuration(duration: Duration): string { - return (parseInt(duration.seconds.toString()) * 1000000000 + duration.nanos).toString(); -}; + return ( + parseInt(duration.seconds.toString()) * 1000000000 + + duration.nanos + ).toString(); +} export function isSet(value: any): boolean { - return value !== null && value !== undefined; -}; + return value !== null && value !== undefined; +} export function isObject(value: any): boolean { - return typeof value === 'object' && value !== null; -}; + return typeof value === 'object' && value !== null; +} export interface PageRequest { - key: Uint8Array; - offset: Long; - limit: Long; - countTotal: boolean; - reverse: boolean; -}; + key: Uint8Array; + offset: bigint; + limit: bigint; + countTotal: boolean; + reverse: boolean; +} export interface PageRequestParams { - "pagination.key"?: string; - "pagination.offset"?: string; - "pagination.limit"?: string; - "pagination.count_total"?: boolean; - "pagination.reverse"?: boolean; -}; + 'pagination.key'?: string; + 'pagination.offset'?: string; + 'pagination.limit'?: string; + 'pagination.count_total'?: boolean; + 'pagination.reverse'?: boolean; +} export interface Params { - params: PageRequestParams; -}; - -export const setPaginationParams = (options: Params, pagination?: PageRequest) => { - - if (!pagination) { - return options; - } - - if (typeof pagination?.countTotal !== "undefined") { - options.params['pagination.count_total'] = pagination.countTotal; - } - if (typeof pagination?.key !== "undefined") { - // String to Uint8Array - // let uint8arr = new Uint8Array(Buffer.from(data,'base64')); - - // Uint8Array to String - options.params['pagination.key'] = Buffer.from(pagination.key).toString('base64'); - } - if (typeof pagination?.limit !== "undefined") { - options.params["pagination.limit"] = pagination.limit.toString() - } - if (typeof pagination?.offset !== "undefined") { - options.params["pagination.offset"] = pagination.offset.toString() - } - if (typeof pagination?.reverse !== "undefined") { - options.params['pagination.reverse'] = pagination.reverse; - } + params: PageRequestParams; +} +export const setPaginationParams = ( + options: Params, + pagination?: PageRequest +) => { + if (!pagination) { return options; + } + + if (typeof pagination?.countTotal !== 'undefined') { + options.params['pagination.count_total'] = pagination.countTotal; + } + if (typeof pagination?.key !== 'undefined') { + // String to Uint8Array + // let uint8arr = new Uint8Array(Buffer.from(data,'base64')); + + // Uint8Array to String + options.params['pagination.key'] = Buffer.from(pagination.key).toString( + 'base64' + ); + } + if (typeof pagination?.limit !== 'undefined') { + options.params['pagination.limit'] = pagination.limit.toString(); + } + if (typeof pagination?.offset !== 'undefined') { + options.params['pagination.offset'] = pagination.offset.toString(); + } + if (typeof pagination?.reverse !== 'undefined') { + options.params['pagination.reverse'] = pagination.reverse; + } + + return options; }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | bigint + | boolean + | undefined; export type DeepPartial = T extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record>, never>; + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + >; export interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; -}; + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: Long; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - - nanos: number; + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + + nanos: number; } export function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = date.getTime() % 1000 * 1000000; - return { - seconds, - nanos - }; -}; + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1000) * 1000000; + return { + seconds, + nanos + }; +} export function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1000; - millis += t.nanos / 1000000; - return new Date(millis); -}; - -const fromJSON = (object: any): Timestamp => { - return { - seconds: isSet(object.seconds) ? Long.fromString(object.seconds) : Long.ZERO, - nanos: isSet(object.nanos) ? Number(object.nanos) : 0 - }; -}; + let millis = Number(t.seconds) * 1000; + millis += t.nanos / 1000000; + return new Date(millis); +} const timestampFromJSON = (object: any): Timestamp => { return { - seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, - nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + seconds: isSet(object.seconds) + ? BigInt(object.seconds.toString()) + : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 }; -} - +}; + export function fromJsonTimestamp(o: any): Timestamp { if (o instanceof Date) { return toTimestamp(o); - } else if (typeof o === "string") { + } else if (typeof o === 'string') { return toTimestamp(new Date(o)); } else { return timestampFromJSON(o); } } - + function numberToLong(number: number) { - return Long.fromNumber(number); + return BigInt(Math.trunc(number)); } + diff --git a/packages/api/src/codegen/ibc/applications/transfer/v1/genesis.ts b/packages/api/src/codegen/ibc/applications/transfer/v1/genesis.ts index fae07901..b1170c5f 100644 --- a/packages/api/src/codegen/ibc/applications/transfer/v1/genesis.ts +++ b/packages/api/src/codegen/ibc/applications/transfer/v1/genesis.ts @@ -1,5 +1,5 @@ import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisState { @@ -13,8 +13,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisStateAmino { - port_id: string; - denom_traces: DenomTraceAmino[]; + port_id?: string; + denom_traces?: DenomTraceAmino[]; params?: ParamsAmino; } export interface GenesisStateAminoMsg { @@ -35,7 +35,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -47,8 +48,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -96,19 +97,23 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - portId: object.port_id, - denomTraces: Array.isArray(object?.denom_traces) ? object.denom_traces.map((e: any) => DenomTrace.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.port_id = message.portId; + obj.port_id = message.portId === "" ? undefined : message.portId; if (message.denomTraces) { obj.denom_traces = message.denomTraces.map(e => e ? DenomTrace.toAmino(e) : undefined); } else { - obj.denom_traces = []; + obj.denom_traces = message.denomTraces; } obj.params = message.params ? Params.toAmino(message.params) : undefined; return obj; diff --git a/packages/api/src/codegen/ibc/applications/transfer/v1/query.lcd.ts b/packages/api/src/codegen/ibc/applications/transfer/v1/query.lcd.ts index 23116a0c..ea4047e7 100644 --- a/packages/api/src/codegen/ibc/applications/transfer/v1/query.lcd.ts +++ b/packages/api/src/codegen/ibc/applications/transfer/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryDenomTraceRequest, QueryDenomTraceResponseSDKType, QueryDenomTracesRequest, QueryDenomTracesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomHashRequest, QueryDenomHashResponseSDKType, QueryEscrowAddressRequest, QueryEscrowAddressResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts b/packages/api/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts index a78c6d2c..d05b79df 100644 --- a/packages/api/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryDenomTraceRequest, QueryDenomTraceResponse, QueryDenomTracesRequest, QueryDenomTracesResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomHashRequest, QueryDenomHashResponse, QueryEscrowAddressRequest, QueryEscrowAddressResponse } from "./query"; /** Query provides defines the gRPC querier service. */ @@ -28,29 +28,29 @@ export class QueryClientImpl implements Query { denomTrace(request: QueryDenomTraceRequest): Promise { const data = QueryDenomTraceRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); - return promise.then(data => QueryDenomTraceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDenomTraceResponse.decode(new BinaryReader(data))); } denomTraces(request: QueryDenomTracesRequest = { pagination: undefined }): Promise { const data = QueryDenomTracesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTraces", data); - return promise.then(data => QueryDenomTracesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDenomTracesResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } denomHash(request: QueryDenomHashRequest): Promise { const data = QueryDenomHashRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomHash", data); - return promise.then(data => QueryDenomHashResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryDenomHashResponse.decode(new BinaryReader(data))); } escrowAddress(request: QueryEscrowAddressRequest): Promise { const data = QueryEscrowAddressRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "EscrowAddress", data); - return promise.then(data => QueryEscrowAddressResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryEscrowAddressResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/ibc/applications/transfer/v1/query.ts b/packages/api/src/codegen/ibc/applications/transfer/v1/query.ts index b0b75018..0d8c1dd3 100644 --- a/packages/api/src/codegen/ibc/applications/transfer/v1/query.ts +++ b/packages/api/src/codegen/ibc/applications/transfer/v1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC @@ -20,7 +20,7 @@ export interface QueryDenomTraceRequestProtoMsg { */ export interface QueryDenomTraceRequestAmino { /** hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. */ - hash: string; + hash?: string; } export interface QueryDenomTraceRequestAminoMsg { type: "cosmos-sdk/QueryDenomTraceRequest"; @@ -39,7 +39,7 @@ export interface QueryDenomTraceRequestSDKType { */ export interface QueryDenomTraceResponse { /** denom_trace returns the requested denomination trace information. */ - denomTrace: DenomTrace; + denomTrace?: DenomTrace; } export interface QueryDenomTraceResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse"; @@ -62,7 +62,7 @@ export interface QueryDenomTraceResponseAminoMsg { * method. */ export interface QueryDenomTraceResponseSDKType { - denom_trace: DenomTraceSDKType; + denom_trace?: DenomTraceSDKType; } /** * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC @@ -70,7 +70,7 @@ export interface QueryDenomTraceResponseSDKType { */ export interface QueryDenomTracesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDenomTracesRequestProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest"; @@ -93,7 +93,7 @@ export interface QueryDenomTracesRequestAminoMsg { * method */ export interface QueryDenomTracesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC @@ -103,7 +103,7 @@ export interface QueryDenomTracesResponse { /** denom_traces returns all denominations trace information. */ denomTraces: DenomTrace[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDenomTracesResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse"; @@ -115,7 +115,7 @@ export interface QueryDenomTracesResponseProtoMsg { */ export interface QueryDenomTracesResponseAmino { /** denom_traces returns all denominations trace information. */ - denom_traces: DenomTraceAmino[]; + denom_traces?: DenomTraceAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -129,7 +129,7 @@ export interface QueryDenomTracesResponseAminoMsg { */ export interface QueryDenomTracesResponseSDKType { denom_traces: DenomTraceSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -148,7 +148,7 @@ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** params defines the parameters of the module. */ - params: Params; + params?: Params; } export interface QueryParamsResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse"; @@ -165,7 +165,7 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** * QueryDenomHashRequest is the request type for the Query/DenomHash RPC @@ -185,7 +185,7 @@ export interface QueryDenomHashRequestProtoMsg { */ export interface QueryDenomHashRequestAmino { /** The denomination trace ([port_id]/[channel_id])+/[denom] */ - trace: string; + trace?: string; } export interface QueryDenomHashRequestAminoMsg { type: "cosmos-sdk/QueryDenomHashRequest"; @@ -216,7 +216,7 @@ export interface QueryDenomHashResponseProtoMsg { */ export interface QueryDenomHashResponseAmino { /** hash (in hex format) of the denomination trace information. */ - hash: string; + hash?: string; } export interface QueryDenomHashResponseAminoMsg { type: "cosmos-sdk/QueryDenomHashResponse"; @@ -243,9 +243,9 @@ export interface QueryEscrowAddressRequestProtoMsg { /** QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. */ export interface QueryEscrowAddressRequestAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; } export interface QueryEscrowAddressRequestAminoMsg { type: "cosmos-sdk/QueryEscrowAddressRequest"; @@ -268,7 +268,7 @@ export interface QueryEscrowAddressResponseProtoMsg { /** QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. */ export interface QueryEscrowAddressResponseAmino { /** the escrow account address */ - escrow_address: string; + escrow_address?: string; } export interface QueryEscrowAddressResponseAminoMsg { type: "cosmos-sdk/QueryEscrowAddressResponse"; @@ -284,14 +284,15 @@ function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { }; } export const QueryDenomTraceRequest = { - encode(message: QueryDenomTraceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceRequest", + encode(message: QueryDenomTraceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTraceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTraceRequest(); while (reader.pos < end) { @@ -323,13 +324,15 @@ export const QueryDenomTraceRequest = { return message; }, fromAmino(object: QueryDenomTraceRequestAmino): QueryDenomTraceRequest { - return { - hash: object.hash - }; + const message = createBaseQueryDenomTraceRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: QueryDenomTraceRequest): QueryDenomTraceRequestAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash === "" ? undefined : message.hash; return obj; }, fromAminoMsg(object: QueryDenomTraceRequestAminoMsg): QueryDenomTraceRequest { @@ -356,18 +359,19 @@ export const QueryDenomTraceRequest = { }; function createBaseQueryDenomTraceResponse(): QueryDenomTraceResponse { return { - denomTrace: DenomTrace.fromPartial({}) + denomTrace: undefined }; } export const QueryDenomTraceResponse = { - encode(message: QueryDenomTraceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse", + encode(message: QueryDenomTraceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denomTrace !== undefined) { DenomTrace.encode(message.denomTrace, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTraceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTraceResponse(); while (reader.pos < end) { @@ -399,9 +403,11 @@ export const QueryDenomTraceResponse = { return message; }, fromAmino(object: QueryDenomTraceResponseAmino): QueryDenomTraceResponse { - return { - denomTrace: object?.denom_trace ? DenomTrace.fromAmino(object.denom_trace) : undefined - }; + const message = createBaseQueryDenomTraceResponse(); + if (object.denom_trace !== undefined && object.denom_trace !== null) { + message.denomTrace = DenomTrace.fromAmino(object.denom_trace); + } + return message; }, toAmino(message: QueryDenomTraceResponse): QueryDenomTraceResponseAmino { const obj: any = {}; @@ -432,18 +438,19 @@ export const QueryDenomTraceResponse = { }; function createBaseQueryDenomTracesRequest(): QueryDenomTracesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDenomTracesRequest = { - encode(message: QueryDenomTracesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest", + encode(message: QueryDenomTracesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTracesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTracesRequest(); while (reader.pos < end) { @@ -475,9 +482,11 @@ export const QueryDenomTracesRequest = { return message; }, fromAmino(object: QueryDenomTracesRequestAmino): QueryDenomTracesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomTracesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomTracesRequest): QueryDenomTracesRequestAmino { const obj: any = {}; @@ -509,11 +518,12 @@ export const QueryDenomTracesRequest = { function createBaseQueryDenomTracesResponse(): QueryDenomTracesResponse { return { denomTraces: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDenomTracesResponse = { - encode(message: QueryDenomTracesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse", + encode(message: QueryDenomTracesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denomTraces) { DenomTrace.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -522,8 +532,8 @@ export const QueryDenomTracesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTracesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTracesResponse(); while (reader.pos < end) { @@ -565,17 +575,19 @@ export const QueryDenomTracesResponse = { return message; }, fromAmino(object: QueryDenomTracesResponseAmino): QueryDenomTracesResponse { - return { - denomTraces: Array.isArray(object?.denom_traces) ? object.denom_traces.map((e: any) => DenomTrace.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomTracesResponse(); + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomTracesResponse): QueryDenomTracesResponseAmino { const obj: any = {}; if (message.denomTraces) { obj.denom_traces = message.denomTraces.map(e => e ? DenomTrace.toAmino(e) : undefined); } else { - obj.denom_traces = []; + obj.denom_traces = message.denomTraces; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -606,11 +618,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -635,7 +648,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -665,18 +679,19 @@ export const QueryParamsRequest = { }; function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -708,9 +723,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -745,14 +762,15 @@ function createBaseQueryDenomHashRequest(): QueryDenomHashRequest { }; } export const QueryDenomHashRequest = { - encode(message: QueryDenomHashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashRequest", + encode(message: QueryDenomHashRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.trace !== "") { writer.uint32(10).string(message.trace); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomHashRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomHashRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomHashRequest(); while (reader.pos < end) { @@ -784,13 +802,15 @@ export const QueryDenomHashRequest = { return message; }, fromAmino(object: QueryDenomHashRequestAmino): QueryDenomHashRequest { - return { - trace: object.trace - }; + const message = createBaseQueryDenomHashRequest(); + if (object.trace !== undefined && object.trace !== null) { + message.trace = object.trace; + } + return message; }, toAmino(message: QueryDenomHashRequest): QueryDenomHashRequestAmino { const obj: any = {}; - obj.trace = message.trace; + obj.trace = message.trace === "" ? undefined : message.trace; return obj; }, fromAminoMsg(object: QueryDenomHashRequestAminoMsg): QueryDenomHashRequest { @@ -821,14 +841,15 @@ function createBaseQueryDenomHashResponse(): QueryDenomHashResponse { }; } export const QueryDenomHashResponse = { - encode(message: QueryDenomHashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashResponse", + encode(message: QueryDenomHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomHashResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomHashResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomHashResponse(); while (reader.pos < end) { @@ -860,13 +881,15 @@ export const QueryDenomHashResponse = { return message; }, fromAmino(object: QueryDenomHashResponseAmino): QueryDenomHashResponse { - return { - hash: object.hash - }; + const message = createBaseQueryDenomHashResponse(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: QueryDenomHashResponse): QueryDenomHashResponseAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash === "" ? undefined : message.hash; return obj; }, fromAminoMsg(object: QueryDenomHashResponseAminoMsg): QueryDenomHashResponse { @@ -898,7 +921,8 @@ function createBaseQueryEscrowAddressRequest(): QueryEscrowAddressRequest { }; } export const QueryEscrowAddressRequest = { - encode(message: QueryEscrowAddressRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressRequest", + encode(message: QueryEscrowAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -907,8 +931,8 @@ export const QueryEscrowAddressRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEscrowAddressRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEscrowAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEscrowAddressRequest(); while (reader.pos < end) { @@ -946,15 +970,19 @@ export const QueryEscrowAddressRequest = { return message; }, fromAmino(object: QueryEscrowAddressRequestAmino): QueryEscrowAddressRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryEscrowAddressRequest(); + 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: QueryEscrowAddressRequest): QueryEscrowAddressRequestAmino { const obj: any = {}; - obj.port_id = message.portId; - obj.channel_id = message.channelId; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; return obj; }, fromAminoMsg(object: QueryEscrowAddressRequestAminoMsg): QueryEscrowAddressRequest { @@ -985,14 +1013,15 @@ function createBaseQueryEscrowAddressResponse(): QueryEscrowAddressResponse { }; } export const QueryEscrowAddressResponse = { - encode(message: QueryEscrowAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressResponse", + encode(message: QueryEscrowAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.escrowAddress !== "") { writer.uint32(10).string(message.escrowAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEscrowAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEscrowAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEscrowAddressResponse(); while (reader.pos < end) { @@ -1024,13 +1053,15 @@ export const QueryEscrowAddressResponse = { return message; }, fromAmino(object: QueryEscrowAddressResponseAmino): QueryEscrowAddressResponse { - return { - escrowAddress: object.escrow_address - }; + const message = createBaseQueryEscrowAddressResponse(); + if (object.escrow_address !== undefined && object.escrow_address !== null) { + message.escrowAddress = object.escrow_address; + } + return message; }, toAmino(message: QueryEscrowAddressResponse): QueryEscrowAddressResponseAmino { const obj: any = {}; - obj.escrow_address = message.escrowAddress; + obj.escrow_address = message.escrowAddress === "" ? undefined : message.escrowAddress; return obj; }, fromAminoMsg(object: QueryEscrowAddressResponseAminoMsg): QueryEscrowAddressResponse { diff --git a/packages/api/src/codegen/ibc/applications/transfer/v1/transfer.ts b/packages/api/src/codegen/ibc/applications/transfer/v1/transfer.ts index 7a370e2e..3e7a452c 100644 --- a/packages/api/src/codegen/ibc/applications/transfer/v1/transfer.ts +++ b/packages/api/src/codegen/ibc/applications/transfer/v1/transfer.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** * DenomTrace contains the base denomination for ICS20 fungible tokens and the @@ -26,9 +26,9 @@ export interface DenomTraceAmino { * path defines the chain of port/channel identifiers used for tracing the * source of the fungible token. */ - path: string; + path?: string; /** base denomination of the relayed fungible token. */ - base_denom: string; + base_denom?: string; } export interface DenomTraceAminoMsg { type: "cosmos-sdk/DenomTrace"; @@ -75,12 +75,12 @@ export interface ParamsAmino { * send_enabled enables or disables all cross-chain token transfers from this * chain. */ - send_enabled: boolean; + send_enabled?: boolean; /** * receive_enabled enables or disables all cross-chain token transfers to this * chain. */ - receive_enabled: boolean; + receive_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -103,7 +103,8 @@ function createBaseDenomTrace(): DenomTrace { }; } export const DenomTrace = { - encode(message: DenomTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.DenomTrace", + encode(message: DenomTrace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path !== "") { writer.uint32(10).string(message.path); } @@ -112,8 +113,8 @@ export const DenomTrace = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DenomTrace { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DenomTrace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDenomTrace(); while (reader.pos < end) { @@ -151,15 +152,19 @@ export const DenomTrace = { return message; }, fromAmino(object: DenomTraceAmino): DenomTrace { - return { - path: object.path, - baseDenom: object.base_denom - }; + const message = createBaseDenomTrace(); + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; }, toAmino(message: DenomTrace): DenomTraceAmino { const obj: any = {}; - obj.path = message.path; - obj.base_denom = message.baseDenom; + obj.path = message.path === "" ? undefined : message.path; + obj.base_denom = message.baseDenom === "" ? undefined : message.baseDenom; return obj; }, fromAminoMsg(object: DenomTraceAminoMsg): DenomTrace { @@ -191,7 +196,8 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sendEnabled === true) { writer.uint32(8).bool(message.sendEnabled); } @@ -200,8 +206,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -239,15 +245,19 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - sendEnabled: object.send_enabled, - receiveEnabled: object.receive_enabled - }; + const message = createBaseParams(); + if (object.send_enabled !== undefined && object.send_enabled !== null) { + message.sendEnabled = object.send_enabled; + } + if (object.receive_enabled !== undefined && object.receive_enabled !== null) { + message.receiveEnabled = object.receive_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.send_enabled = message.sendEnabled; - obj.receive_enabled = message.receiveEnabled; + obj.send_enabled = message.sendEnabled === false ? undefined : message.sendEnabled; + obj.receive_enabled = message.receiveEnabled === false ? undefined : message.receiveEnabled; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/api/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts b/packages/api/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts index 4a3f7c4c..c4f28579 100644 --- a/packages/api/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { MsgTransfer, MsgTransferResponse } from "./tx"; /** Msg defines the ibc/transfer Msg service. */ export interface Msg { @@ -15,6 +15,6 @@ export class MsgClientImpl implements Msg { transfer(request: MsgTransfer): Promise { const data = MsgTransfer.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); - return promise.then(data => MsgTransferResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgTransferResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/ibc/applications/transfer/v1/tx.ts b/packages/api/src/codegen/ibc/applications/transfer/v1/tx.ts index fe718873..915c5f9f 100644 --- a/packages/api/src/codegen/ibc/applications/transfer/v1/tx.ts +++ b/packages/api/src/codegen/ibc/applications/transfer/v1/tx.ts @@ -1,7 +1,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; -import { Long, isSet } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between * ICS20 enabled chains. See ICS Spec here: @@ -27,7 +27,7 @@ export interface MsgTransfer { * Timeout timestamp in absolute nanoseconds since unix epoch. * The timeout is disabled when set to 0. */ - timeoutTimestamp: Long; + timeoutTimestamp: bigint; } export interface MsgTransferProtoMsg { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer"; @@ -40,15 +40,15 @@ export interface MsgTransferProtoMsg { */ export interface MsgTransferAmino { /** the port on which the packet will be sent */ - source_port: string; + source_port?: string; /** the channel by which the packet will be sent */ - source_channel: string; + source_channel?: string; /** the tokens to be transferred */ token?: CoinAmino; /** the sender address */ - sender: string; + sender?: string; /** the recipient address on the destination chain */ - receiver: string; + receiver?: string; /** * Timeout height relative to the current block height. * The timeout is disabled when set to 0. @@ -58,7 +58,7 @@ export interface MsgTransferAmino { * Timeout timestamp in absolute nanoseconds since unix epoch. * The timeout is disabled when set to 0. */ - timeout_timestamp: string; + timeout_timestamp?: string; } export interface MsgTransferAminoMsg { type: "cosmos-sdk/MsgTransfer"; @@ -76,7 +76,7 @@ export interface MsgTransferSDKType { sender: string; receiver: string; timeout_height: HeightSDKType; - timeout_timestamp: Long; + timeout_timestamp: bigint; } /** MsgTransferResponse defines the Msg/Transfer response type. */ export interface MsgTransferResponse {} @@ -96,15 +96,16 @@ function createBaseMsgTransfer(): MsgTransfer { return { sourcePort: "", sourceChannel: "", - token: undefined, + token: Coin.fromPartial({}), sender: "", receiver: "", timeoutHeight: Height.fromPartial({}), - timeoutTimestamp: Long.UZERO + timeoutTimestamp: BigInt(0) }; } export const MsgTransfer = { - encode(message: MsgTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + encode(message: MsgTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sourcePort !== "") { writer.uint32(10).string(message.sourcePort); } @@ -123,13 +124,13 @@ export const MsgTransfer = { if (message.timeoutHeight !== undefined) { Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); } - if (!message.timeoutTimestamp.isZero()) { + if (message.timeoutTimestamp !== BigInt(0)) { writer.uint32(56).uint64(message.timeoutTimestamp); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransfer { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTransfer(); while (reader.pos < end) { @@ -154,7 +155,7 @@ export const MsgTransfer = { message.timeoutHeight = Height.decode(reader, reader.uint32()); break; case 7: - message.timeoutTimestamp = (reader.uint64() as Long); + message.timeoutTimestamp = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -171,7 +172,7 @@ export const MsgTransfer = { sender: isSet(object.sender) ? String(object.sender) : "", receiver: isSet(object.receiver) ? String(object.receiver) : "", timeoutHeight: isSet(object.timeoutHeight) ? Height.fromJSON(object.timeoutHeight) : undefined, - timeoutTimestamp: isSet(object.timeoutTimestamp) ? Long.fromValue(object.timeoutTimestamp) : Long.UZERO + timeoutTimestamp: isSet(object.timeoutTimestamp) ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0) }; }, toJSON(message: MsgTransfer): unknown { @@ -182,7 +183,7 @@ export const MsgTransfer = { message.sender !== undefined && (obj.sender = message.sender); message.receiver !== undefined && (obj.receiver = message.receiver); message.timeoutHeight !== undefined && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); - message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgTransfer { @@ -193,29 +194,43 @@ export const MsgTransfer = { message.sender = object.sender ?? ""; message.receiver = object.receiver ?? ""; message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; - message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? Long.fromValue(object.timeoutTimestamp) : Long.UZERO; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); return message; }, fromAmino(object: MsgTransferAmino): MsgTransfer { - return { - sourcePort: object.source_port, - sourceChannel: object.source_channel, - token: object?.token ? Coin.fromAmino(object.token) : undefined, - sender: object.sender, - receiver: object.receiver, - timeoutHeight: object?.timeout_height ? Height.fromAmino(object.timeout_height) : undefined, - timeoutTimestamp: Long.fromString(object.timeout_timestamp) - }; + const message = createBaseMsgTransfer(); + 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.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + 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: MsgTransfer): MsgTransferAmino { const obj: any = {}; - obj.source_port = message.sourcePort; - obj.source_channel = message.sourceChannel; + obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; + obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; obj.token = message.token ? Coin.toAmino(message.token) : undefined; - obj.sender = message.sender; - obj.receiver = message.receiver; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; - obj.timeout_timestamp = message.timeoutTimestamp ? message.timeoutTimestamp.toString() : undefined; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp.toString() : undefined; return obj; }, fromAminoMsg(object: MsgTransferAminoMsg): MsgTransfer { @@ -244,11 +259,12 @@ function createBaseMsgTransferResponse(): MsgTransferResponse { return {}; } export const MsgTransferResponse = { - encode(_: MsgTransferResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + encode(_: MsgTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTransferResponse(); while (reader.pos < end) { @@ -273,7 +289,8 @@ export const MsgTransferResponse = { return message; }, fromAmino(_: MsgTransferResponseAmino): MsgTransferResponse { - return {}; + const message = createBaseMsgTransferResponse(); + return message; }, toAmino(_: MsgTransferResponse): MsgTransferResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/ibc/bundle.ts b/packages/api/src/codegen/ibc/bundle.ts index bfbcf111..94f124a6 100644 --- a/packages/api/src/codegen/ibc/bundle.ts +++ b/packages/api/src/codegen/ibc/bundle.ts @@ -1,58 +1,58 @@ -import * as _104 from "./applications/transfer/v1/genesis"; -import * as _105 from "./applications/transfer/v1/query"; -import * as _106 from "./applications/transfer/v1/transfer"; -import * as _107 from "./applications/transfer/v1/tx"; -import * as _108 from "./core/client/v1/client"; -import * as _109 from "./core/client/v1/genesis"; -import * as _110 from "./core/client/v1/query"; -import * as _111 from "./core/client/v1/tx"; -import * as _230 from "./applications/transfer/v1/tx.amino"; -import * as _231 from "./core/client/v1/tx.amino"; -import * as _232 from "./applications/transfer/v1/tx.registry"; -import * as _233 from "./core/client/v1/tx.registry"; -import * as _234 from "./applications/transfer/v1/query.lcd"; -import * as _235 from "./core/client/v1/query.lcd"; -import * as _236 from "./applications/transfer/v1/query.rpc.Query"; -import * as _237 from "./core/client/v1/query.rpc.Query"; -import * as _238 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _239 from "./core/client/v1/tx.rpc.msg"; -import * as _273 from "./lcd"; -import * as _274 from "./rpc.query"; -import * as _275 from "./rpc.tx"; +import * as _105 from "./applications/transfer/v1/genesis"; +import * as _106 from "./applications/transfer/v1/query"; +import * as _107 from "./applications/transfer/v1/transfer"; +import * as _108 from "./applications/transfer/v1/tx"; +import * as _109 from "./core/client/v1/client"; +import * as _110 from "./core/client/v1/genesis"; +import * as _111 from "./core/client/v1/query"; +import * as _112 from "./core/client/v1/tx"; +import * as _231 from "./applications/transfer/v1/tx.amino"; +import * as _232 from "./core/client/v1/tx.amino"; +import * as _233 from "./applications/transfer/v1/tx.registry"; +import * as _234 from "./core/client/v1/tx.registry"; +import * as _235 from "./applications/transfer/v1/query.lcd"; +import * as _236 from "./core/client/v1/query.lcd"; +import * as _237 from "./applications/transfer/v1/query.rpc.Query"; +import * as _238 from "./core/client/v1/query.rpc.Query"; +import * as _239 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _240 from "./core/client/v1/tx.rpc.msg"; +import * as _274 from "./lcd"; +import * as _275 from "./rpc.query"; +import * as _276 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace transfer { export const v1 = { - ..._104, ..._105, ..._106, ..._107, - ..._230, - ..._232, - ..._234, - ..._236, - ..._238 + ..._108, + ..._231, + ..._233, + ..._235, + ..._237, + ..._239 }; } } export namespace core { export namespace client { export const v1 = { - ..._108, ..._109, ..._110, ..._111, - ..._231, - ..._233, - ..._235, - ..._237, - ..._239 + ..._112, + ..._232, + ..._234, + ..._236, + ..._238, + ..._240 }; } } export const ClientFactory = { - ..._273, ..._274, - ..._275 + ..._275, + ..._276 }; } \ No newline at end of file diff --git a/packages/api/src/codegen/ibc/client.ts b/packages/api/src/codegen/ibc/client.ts index 6ab62a89..7f972f22 100644 --- a/packages/api/src/codegen/ibc/client.ts +++ b/packages/api/src/codegen/ibc/client.ts @@ -43,7 +43,7 @@ export const getSigningIbcClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/packages/api/src/codegen/ibc/core/client/v1/client.ts b/packages/api/src/codegen/ibc/core/client/v1/client.ts index 16bede21..8137f85d 100644 --- a/packages/api/src/codegen/ibc/core/client/v1/client.ts +++ b/packages/api/src/codegen/ibc/core/client/v1/client.ts @@ -1,7 +1,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Plan, PlanAmino, PlanSDKType } from "../../../../cosmos/upgrade/v1beta1/upgrade"; -import { Long, isSet } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; /** * IdentifiedClientState defines a client state with an additional client * identifier field. @@ -10,7 +10,7 @@ export interface IdentifiedClientState { /** client identifier */ clientId: string; /** client state */ - clientState: Any; + clientState?: Any; } export interface IdentifiedClientStateProtoMsg { typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; @@ -22,7 +22,7 @@ export interface IdentifiedClientStateProtoMsg { */ export interface IdentifiedClientStateAmino { /** client identifier */ - client_id: string; + client_id?: string; /** client state */ client_state?: AnyAmino; } @@ -36,7 +36,7 @@ export interface IdentifiedClientStateAminoMsg { */ export interface IdentifiedClientStateSDKType { client_id: string; - client_state: AnySDKType; + client_state?: AnySDKType; } /** * ConsensusStateWithHeight defines a consensus state with an additional height @@ -46,7 +46,7 @@ export interface ConsensusStateWithHeight { /** consensus state height */ height: Height; /** consensus state */ - consensusState: Any; + consensusState?: Any; } export interface ConsensusStateWithHeightProtoMsg { typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; @@ -72,7 +72,7 @@ export interface ConsensusStateWithHeightAminoMsg { */ export interface ConsensusStateWithHeightSDKType { height: HeightSDKType; - consensus_state: AnySDKType; + consensus_state?: AnySDKType; } /** * ClientConsensusStates defines all the stored consensus states for a given @@ -94,9 +94,9 @@ export interface ClientConsensusStatesProtoMsg { */ export interface ClientConsensusStatesAmino { /** client identifier */ - client_id: string; + client_id?: string; /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeightAmino[]; + consensus_states?: ConsensusStateWithHeightAmino[]; } export interface ClientConsensusStatesAminoMsg { type: "cosmos-sdk/ClientConsensusStates"; @@ -117,7 +117,7 @@ export interface ClientConsensusStatesSDKType { * chain parameters (with exception to latest height, frozen height, and chain-id). */ export interface ClientUpdateProposal { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; /** the title of the update proposal */ title: string; /** the description of the proposal */ @@ -142,16 +142,16 @@ export interface ClientUpdateProposalProtoMsg { */ export interface ClientUpdateProposalAmino { /** the title of the update proposal */ - title: string; + title?: string; /** the description of the proposal */ - description: string; + description?: string; /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; + subject_client_id?: string; /** * the substitute client identifier for the client standing in for the subject * client */ - substitute_client_id: string; + substitute_client_id?: string; } export interface ClientUpdateProposalAminoMsg { type: "cosmos-sdk/ClientUpdateProposal"; @@ -164,7 +164,7 @@ export interface ClientUpdateProposalAminoMsg { * chain parameters (with exception to latest height, frozen height, and chain-id). */ export interface ClientUpdateProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; title: string; description: string; subject_client_id: string; @@ -175,7 +175,7 @@ export interface ClientUpdateProposalSDKType { * upgrade. */ export interface UpgradeProposal { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; description: string; plan: Plan; @@ -187,7 +187,7 @@ export interface UpgradeProposal { * of the chain. This will allow IBC connections to persist smoothly across * planned chain upgrades */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface UpgradeProposalProtoMsg { typeUrl: "/ibc.core.client.v1.UpgradeProposal"; @@ -198,8 +198,8 @@ export interface UpgradeProposalProtoMsg { * upgrade. */ export interface UpgradeProposalAmino { - title: string; - description: string; + title?: string; + description?: string; plan?: PlanAmino; /** * An UpgradedClientState must be provided to perform an IBC breaking upgrade. @@ -220,11 +220,11 @@ export interface UpgradeProposalAminoMsg { * upgrade. */ export interface UpgradeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; description: string; plan: PlanSDKType; - upgraded_client_state: AnySDKType; + upgraded_client_state?: AnySDKType; } /** * Height is a monotonically increasing data type @@ -240,9 +240,9 @@ export interface UpgradeProposalSDKType { */ export interface Height { /** the revision that the client is currently on */ - revisionNumber: Long; + revisionNumber: bigint; /** the height within the given revision */ - revisionHeight: Long; + revisionHeight: bigint; } export interface HeightProtoMsg { typeUrl: "/ibc.core.client.v1.Height"; @@ -262,9 +262,9 @@ export interface HeightProtoMsg { */ export interface HeightAmino { /** the revision that the client is currently on */ - revision_number: string; + revision_number?: string; /** the height within the given revision */ - revision_height: string; + revision_height?: string; } export interface HeightAminoMsg { type: "cosmos-sdk/Height"; @@ -283,8 +283,8 @@ export interface HeightAminoMsg { * gets reset */ export interface HeightSDKType { - revision_number: Long; - revision_height: Long; + revision_number: bigint; + revision_height: bigint; } /** Params defines the set of IBC light client parameters. */ export interface Params { @@ -298,7 +298,7 @@ export interface ParamsProtoMsg { /** Params defines the set of IBC light client parameters. */ export interface ParamsAmino { /** allowed_clients defines the list of allowed client state types. */ - allowed_clients: string[]; + allowed_clients?: string[]; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -315,7 +315,8 @@ function createBaseIdentifiedClientState(): IdentifiedClientState { }; } export const IdentifiedClientState = { - encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + encode(message: IdentifiedClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -324,8 +325,8 @@ export const IdentifiedClientState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentifiedClientState(); while (reader.pos < end) { @@ -363,14 +364,18 @@ export const IdentifiedClientState = { return message; }, fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { - return { - clientId: object.client_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined - }; + 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; + obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; return obj; }, @@ -403,7 +408,8 @@ function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { }; } export const ConsensusStateWithHeight = { - encode(message: ConsensusStateWithHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + 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(); } @@ -412,8 +418,8 @@ export const ConsensusStateWithHeight = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensusStateWithHeight(); while (reader.pos < end) { @@ -451,10 +457,14 @@ export const ConsensusStateWithHeight = { return message; }, fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { - return { - height: object?.height ? Height.fromAmino(object.height) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined - }; + 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 = {}; @@ -491,7 +501,8 @@ function createBaseClientConsensusStates(): ClientConsensusStates { }; } export const ClientConsensusStates = { - encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + encode(message: ClientConsensusStates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -500,8 +511,8 @@ export const ClientConsensusStates = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientConsensusStates(); while (reader.pos < end) { @@ -543,18 +554,20 @@ export const ClientConsensusStates = { return message; }, fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { - return { - clientId: object.client_id, - consensusStates: Array.isArray(object?.consensus_states) ? object.consensus_states.map((e: any) => ConsensusStateWithHeight.fromAmino(e)) : [] - }; + 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; + 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 = []; + obj.consensus_states = message.consensusStates; } return obj; }, @@ -590,7 +603,8 @@ function createBaseClientUpdateProposal(): ClientUpdateProposal { }; } export const ClientUpdateProposal = { - encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -605,8 +619,8 @@ export const ClientUpdateProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientUpdateProposal(); while (reader.pos < end) { @@ -656,19 +670,27 @@ export const ClientUpdateProposal = { return message; }, fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { - return { - title: object.title, - description: object.description, - subjectClientId: object.subject_client_id, - substituteClientId: object.substitute_client_id - }; + 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; - obj.description = message.description; - obj.subject_client_id = message.subjectClientId; - obj.substitute_client_id = message.substituteClientId; + 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 { @@ -703,7 +725,8 @@ function createBaseUpgradeProposal(): UpgradeProposal { }; } export const UpgradeProposal = { - encode(message: UpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + encode(message: UpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -718,8 +741,8 @@ export const UpgradeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUpgradeProposal(); while (reader.pos < end) { @@ -769,17 +792,25 @@ export const UpgradeProposal = { return message; }, fromAmino(object: UpgradeProposalAmino): UpgradeProposal { - return { - title: object.title, - description: object.description, - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined, - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + 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; - obj.description = message.description; + 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; @@ -808,32 +839,33 @@ export const UpgradeProposal = { }; function createBaseHeight(): Height { return { - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) }; } export const Height = { - encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.revisionNumber.isZero()) { + 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.isZero()) { + if (message.revisionHeight !== BigInt(0)) { writer.uint32(16).uint64(message.revisionHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Height { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Height { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeight(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revisionNumber = (reader.uint64() as Long); + message.revisionNumber = reader.uint64(); break; case 2: - message.revisionHeight = (reader.uint64() as Long); + message.revisionHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -844,32 +876,32 @@ export const Height = { }, fromJSON(object: any): Height { return { - revisionNumber: isSet(object.revisionNumber) ? Long.fromValue(object.revisionNumber) : Long.UZERO, - revisionHeight: isSet(object.revisionHeight) ? Long.fromValue(object.revisionHeight) : Long.UZERO + revisionNumber: isSet(object.revisionNumber) ? BigInt(object.revisionNumber.toString()) : BigInt(0), + revisionHeight: isSet(object.revisionHeight) ? BigInt(object.revisionHeight.toString()) : BigInt(0) }; }, toJSON(message: Height): unknown { const obj: any = {}; - message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); - message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + 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 ? Long.fromValue(object.revisionNumber) : Long.UZERO; - message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? Long.fromValue(object.revisionHeight) : Long.UZERO; + 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: Long.fromString(object.revision_number || "0", true), - revisionHeight: Long.fromString(object.revision_height || "0", true) + revisionNumber: BigInt(object.revision_number || "0"), + revisionHeight: BigInt(object.revision_height || "0") }; }, toAmino(message: Height): HeightAmino { const obj: any = {}; - obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; - obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; + 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 { @@ -900,14 +932,15 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + 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: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -943,16 +976,16 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - allowedClients: Array.isArray(object?.allowed_clients) ? object.allowed_clients.map((e: any) => e) : [] - }; + 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 = []; + obj.allowed_clients = message.allowedClients; } return obj; }, diff --git a/packages/api/src/codegen/ibc/core/client/v1/genesis.ts b/packages/api/src/codegen/ibc/core/client/v1/genesis.ts index 28564f8a..2367e918 100644 --- a/packages/api/src/codegen/ibc/core/client/v1/genesis.ts +++ b/packages/api/src/codegen/ibc/core/client/v1/genesis.ts @@ -1,6 +1,6 @@ import { IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ClientConsensusStates, ClientConsensusStatesAmino, ClientConsensusStatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisState { /** client states with their corresponding identifiers */ @@ -13,7 +13,7 @@ export interface GenesisState { /** create localhost on initialization */ createLocalhost: boolean; /** the sequence for the next generated client identifier */ - nextClientSequence: Long; + nextClientSequence: bigint; } export interface GenesisStateProtoMsg { typeUrl: "/ibc.core.client.v1.GenesisState"; @@ -22,16 +22,16 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisStateAmino { /** client states with their corresponding identifiers */ - clients: IdentifiedClientStateAmino[]; + clients?: IdentifiedClientStateAmino[]; /** consensus states from each client */ - clients_consensus: ClientConsensusStatesAmino[]; + clients_consensus?: ClientConsensusStatesAmino[]; /** metadata from each client */ - clients_metadata: IdentifiedGenesisMetadataAmino[]; + clients_metadata?: IdentifiedGenesisMetadataAmino[]; params?: ParamsAmino; /** create localhost on initialization */ - create_localhost: boolean; + create_localhost?: boolean; /** the sequence for the next generated client identifier */ - next_client_sequence: string; + next_client_sequence?: string; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -44,7 +44,7 @@ export interface GenesisStateSDKType { clients_metadata: IdentifiedGenesisMetadataSDKType[]; params: ParamsSDKType; create_localhost: boolean; - next_client_sequence: Long; + next_client_sequence: bigint; } /** * GenesisMetadata defines the genesis type for metadata that clients may return @@ -66,9 +66,9 @@ export interface GenesisMetadataProtoMsg { */ export interface GenesisMetadataAmino { /** store key of metadata without clientID-prefix */ - key: Uint8Array; + key?: string; /** metadata value */ - value: Uint8Array; + value?: string; } export interface GenesisMetadataAminoMsg { type: "cosmos-sdk/GenesisMetadata"; @@ -99,8 +99,8 @@ export interface IdentifiedGenesisMetadataProtoMsg { * client id. */ export interface IdentifiedGenesisMetadataAmino { - client_id: string; - client_metadata: GenesisMetadataAmino[]; + client_id?: string; + client_metadata?: GenesisMetadataAmino[]; } export interface IdentifiedGenesisMetadataAminoMsg { type: "cosmos-sdk/IdentifiedGenesisMetadata"; @@ -121,11 +121,12 @@ function createBaseGenesisState(): GenesisState { clientsMetadata: [], params: Params.fromPartial({}), createLocalhost: false, - nextClientSequence: Long.UZERO + nextClientSequence: BigInt(0) }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clients) { IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -141,13 +142,13 @@ export const GenesisState = { if (message.createLocalhost === true) { writer.uint32(40).bool(message.createLocalhost); } - if (!message.nextClientSequence.isZero()) { + if (message.nextClientSequence !== BigInt(0)) { writer.uint32(48).uint64(message.nextClientSequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -169,7 +170,7 @@ export const GenesisState = { message.createLocalhost = reader.bool(); break; case 6: - message.nextClientSequence = (reader.uint64() as Long); + message.nextClientSequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -185,7 +186,7 @@ export const GenesisState = { clientsMetadata: Array.isArray(object?.clientsMetadata) ? object.clientsMetadata.map((e: any) => IdentifiedGenesisMetadata.fromJSON(e)) : [], params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, createLocalhost: isSet(object.createLocalhost) ? Boolean(object.createLocalhost) : false, - nextClientSequence: isSet(object.nextClientSequence) ? Long.fromValue(object.nextClientSequence) : Long.UZERO + nextClientSequence: isSet(object.nextClientSequence) ? BigInt(object.nextClientSequence.toString()) : BigInt(0) }; }, toJSON(message: GenesisState): unknown { @@ -207,7 +208,7 @@ export const GenesisState = { } message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); message.createLocalhost !== undefined && (obj.createLocalhost = message.createLocalhost); - message.nextClientSequence !== undefined && (obj.nextClientSequence = (message.nextClientSequence || Long.UZERO).toString()); + message.nextClientSequence !== undefined && (obj.nextClientSequence = (message.nextClientSequence || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): GenesisState { @@ -217,39 +218,45 @@ export const GenesisState = { message.clientsMetadata = object.clientsMetadata?.map(e => IdentifiedGenesisMetadata.fromPartial(e)) || []; message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.createLocalhost = object.createLocalhost ?? false; - message.nextClientSequence = object.nextClientSequence !== undefined && object.nextClientSequence !== null ? Long.fromValue(object.nextClientSequence) : Long.UZERO; + message.nextClientSequence = object.nextClientSequence !== undefined && object.nextClientSequence !== null ? BigInt(object.nextClientSequence.toString()) : BigInt(0); return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - clients: Array.isArray(object?.clients) ? object.clients.map((e: any) => IdentifiedClientState.fromAmino(e)) : [], - clientsConsensus: Array.isArray(object?.clients_consensus) ? object.clients_consensus.map((e: any) => ClientConsensusStates.fromAmino(e)) : [], - clientsMetadata: Array.isArray(object?.clients_metadata) ? object.clients_metadata.map((e: any) => IdentifiedGenesisMetadata.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined, - createLocalhost: object.create_localhost, - nextClientSequence: Long.fromString(object.next_client_sequence) - }; + const message = createBaseGenesisState(); + message.clients = object.clients?.map(e => IdentifiedClientState.fromAmino(e)) || []; + message.clientsConsensus = object.clients_consensus?.map(e => ClientConsensusStates.fromAmino(e)) || []; + message.clientsMetadata = object.clients_metadata?.map(e => IdentifiedGenesisMetadata.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.create_localhost !== undefined && object.create_localhost !== null) { + message.createLocalhost = object.create_localhost; + } + if (object.next_client_sequence !== undefined && object.next_client_sequence !== null) { + message.nextClientSequence = BigInt(object.next_client_sequence); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; if (message.clients) { obj.clients = message.clients.map(e => e ? IdentifiedClientState.toAmino(e) : undefined); } else { - obj.clients = []; + obj.clients = message.clients; } if (message.clientsConsensus) { obj.clients_consensus = message.clientsConsensus.map(e => e ? ClientConsensusStates.toAmino(e) : undefined); } else { - obj.clients_consensus = []; + obj.clients_consensus = message.clientsConsensus; } if (message.clientsMetadata) { obj.clients_metadata = message.clientsMetadata.map(e => e ? IdentifiedGenesisMetadata.toAmino(e) : undefined); } else { - obj.clients_metadata = []; + obj.clients_metadata = message.clientsMetadata; } obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.create_localhost = message.createLocalhost; - obj.next_client_sequence = message.nextClientSequence ? message.nextClientSequence.toString() : undefined; + obj.create_localhost = message.createLocalhost === false ? undefined : message.createLocalhost; + obj.next_client_sequence = message.nextClientSequence !== BigInt(0) ? message.nextClientSequence.toString() : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -281,7 +288,8 @@ function createBaseGenesisMetadata(): GenesisMetadata { }; } export const GenesisMetadata = { - encode(message: GenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.GenesisMetadata", + encode(message: GenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -290,8 +298,8 @@ export const GenesisMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisMetadata(); while (reader.pos < end) { @@ -329,15 +337,19 @@ export const GenesisMetadata = { return message; }, fromAmino(object: GenesisMetadataAmino): GenesisMetadata { - return { - key: object.key, - value: object.value - }; + const message = createBaseGenesisMetadata(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: GenesisMetadata): GenesisMetadataAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: GenesisMetadataAminoMsg): GenesisMetadata { @@ -369,7 +381,8 @@ function createBaseIdentifiedGenesisMetadata(): IdentifiedGenesisMetadata { }; } export const IdentifiedGenesisMetadata = { - encode(message: IdentifiedGenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata", + encode(message: IdentifiedGenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -378,8 +391,8 @@ export const IdentifiedGenesisMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedGenesisMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedGenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentifiedGenesisMetadata(); while (reader.pos < end) { @@ -421,18 +434,20 @@ export const IdentifiedGenesisMetadata = { return message; }, fromAmino(object: IdentifiedGenesisMetadataAmino): IdentifiedGenesisMetadata { - return { - clientId: object.client_id, - clientMetadata: Array.isArray(object?.client_metadata) ? object.client_metadata.map((e: any) => GenesisMetadata.fromAmino(e)) : [] - }; + const message = createBaseIdentifiedGenesisMetadata(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.clientMetadata = object.client_metadata?.map(e => GenesisMetadata.fromAmino(e)) || []; + return message; }, toAmino(message: IdentifiedGenesisMetadata): IdentifiedGenesisMetadataAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; if (message.clientMetadata) { obj.client_metadata = message.clientMetadata.map(e => e ? GenesisMetadata.toAmino(e) : undefined); } else { - obj.client_metadata = []; + obj.client_metadata = message.clientMetadata; } return obj; }, diff --git a/packages/api/src/codegen/ibc/core/client/v1/query.lcd.ts b/packages/api/src/codegen/ibc/core/client/v1/query.lcd.ts index fc8f034e..bdd5fd85 100644 --- a/packages/api/src/codegen/ibc/core/client/v1/query.lcd.ts +++ b/packages/api/src/codegen/ibc/core/client/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryClientStateRequest, QueryClientStateResponseSDKType, QueryClientStatesRequest, QueryClientStatesResponseSDKType, QueryConsensusStateRequest, QueryConsensusStateResponseSDKType, QueryConsensusStatesRequest, QueryConsensusStatesResponseSDKType, QueryConsensusStateHeightsRequest, QueryConsensusStateHeightsResponseSDKType, QueryClientStatusRequest, QueryClientStatusResponseSDKType, QueryClientParamsRequest, QueryClientParamsResponseSDKType, QueryUpgradedClientStateRequest, QueryUpgradedClientStateResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/ibc/core/client/v1/query.rpc.Query.ts b/packages/api/src/codegen/ibc/core/client/v1/query.rpc.Query.ts index 474b6184..b859352b 100644 --- a/packages/api/src/codegen/ibc/core/client/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/ibc/core/client/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryClientStateRequest, QueryClientStateResponse, QueryClientStatesRequest, QueryClientStatesResponse, QueryConsensusStateRequest, QueryConsensusStateResponse, QueryConsensusStatesRequest, QueryConsensusStatesResponse, QueryConsensusStateHeightsRequest, QueryConsensusStateHeightsResponse, QueryClientStatusRequest, QueryClientStatusResponse, QueryClientParamsRequest, QueryClientParamsResponse, QueryUpgradedClientStateRequest, QueryUpgradedClientStateResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse } from "./query"; /** Query provides defines the gRPC querier service */ @@ -46,49 +46,49 @@ export class QueryClientImpl implements Query { clientState(request: QueryClientStateRequest): Promise { const data = QueryClientStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientState", data); - return promise.then(data => QueryClientStateResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClientStateResponse.decode(new BinaryReader(data))); } clientStates(request: QueryClientStatesRequest = { pagination: undefined }): Promise { const data = QueryClientStatesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStates", data); - return promise.then(data => QueryClientStatesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClientStatesResponse.decode(new BinaryReader(data))); } consensusState(request: QueryConsensusStateRequest): Promise { const data = QueryConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusState", data); - return promise.then(data => QueryConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryConsensusStateResponse.decode(new BinaryReader(data))); } consensusStates(request: QueryConsensusStatesRequest): Promise { const data = QueryConsensusStatesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStates", data); - return promise.then(data => QueryConsensusStatesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryConsensusStatesResponse.decode(new BinaryReader(data))); } consensusStateHeights(request: QueryConsensusStateHeightsRequest): Promise { const data = QueryConsensusStateHeightsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStateHeights", data); - return promise.then(data => QueryConsensusStateHeightsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryConsensusStateHeightsResponse.decode(new BinaryReader(data))); } clientStatus(request: QueryClientStatusRequest): Promise { const data = QueryClientStatusRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStatus", data); - return promise.then(data => QueryClientStatusResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClientStatusResponse.decode(new BinaryReader(data))); } clientParams(request: QueryClientParamsRequest = {}): Promise { const data = QueryClientParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientParams", data); - return promise.then(data => QueryClientParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClientParamsResponse.decode(new BinaryReader(data))); } upgradedClientState(request: QueryUpgradedClientStateRequest = {}): Promise { const data = QueryUpgradedClientStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedClientState", data); - return promise.then(data => QueryUpgradedClientStateResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryUpgradedClientStateResponse.decode(new BinaryReader(data))); } upgradedConsensusState(request: QueryUpgradedConsensusStateRequest = {}): Promise { const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedConsensusState", data); - return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/ibc/core/client/v1/query.ts b/packages/api/src/codegen/ibc/core/client/v1/query.ts index c06e8594..ae857498 100644 --- a/packages/api/src/codegen/ibc/core/client/v1/query.ts +++ b/packages/api/src/codegen/ibc/core/client/v1/query.ts @@ -1,8 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ConsensusStateWithHeight, ConsensusStateWithHeightAmino, ConsensusStateWithHeightSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * QueryClientStateRequest is the request type for the Query/ClientState RPC * method @@ -21,7 +21,7 @@ export interface QueryClientStateRequestProtoMsg { */ export interface QueryClientStateRequestAmino { /** client state unique identifier */ - client_id: string; + client_id?: string; } export interface QueryClientStateRequestAminoMsg { type: "cosmos-sdk/QueryClientStateRequest"; @@ -41,7 +41,7 @@ export interface QueryClientStateRequestSDKType { */ export interface QueryClientStateResponse { /** client state associated with the request identifier */ - clientState: Any; + clientState?: Any; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -60,7 +60,7 @@ export interface QueryClientStateResponseAmino { /** client state associated with the request identifier */ client_state?: AnyAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -74,7 +74,7 @@ export interface QueryClientStateResponseAminoMsg { * which the proof was retrieved. */ export interface QueryClientStateResponseSDKType { - client_state: AnySDKType; + client_state?: AnySDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -84,7 +84,7 @@ export interface QueryClientStateResponseSDKType { */ export interface QueryClientStatesRequest { /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClientStatesRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest"; @@ -107,7 +107,7 @@ export interface QueryClientStatesRequestAminoMsg { * method */ export interface QueryClientStatesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryClientStatesResponse is the response type for the Query/ClientStates RPC @@ -117,7 +117,7 @@ export interface QueryClientStatesResponse { /** list of stored ClientStates of the chain. */ clientStates: IdentifiedClientState[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClientStatesResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse"; @@ -129,7 +129,7 @@ export interface QueryClientStatesResponseProtoMsg { */ export interface QueryClientStatesResponseAmino { /** list of stored ClientStates of the chain. */ - client_states: IdentifiedClientStateAmino[]; + client_states?: IdentifiedClientStateAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -143,7 +143,7 @@ export interface QueryClientStatesResponseAminoMsg { */ export interface QueryClientStatesResponseSDKType { client_states: IdentifiedClientStateSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryConsensusStateRequest is the request type for the Query/ConsensusState @@ -154,9 +154,9 @@ export interface QueryConsensusStateRequest { /** client identifier */ clientId: string; /** consensus state revision number */ - revisionNumber: Long; + revisionNumber: bigint; /** consensus state revision height */ - revisionHeight: Long; + revisionHeight: bigint; /** * latest_height overrrides the height field and queries the latest stored * ConsensusState @@ -174,16 +174,16 @@ export interface QueryConsensusStateRequestProtoMsg { */ export interface QueryConsensusStateRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** consensus state revision number */ - revision_number: string; + revision_number?: string; /** consensus state revision height */ - revision_height: string; + revision_height?: string; /** * latest_height overrrides the height field and queries the latest stored * ConsensusState */ - latest_height: boolean; + latest_height?: boolean; } export interface QueryConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryConsensusStateRequest"; @@ -196,8 +196,8 @@ export interface QueryConsensusStateRequestAminoMsg { */ export interface QueryConsensusStateRequestSDKType { client_id: string; - revision_number: Long; - revision_height: Long; + revision_number: bigint; + revision_height: bigint; latest_height: boolean; } /** @@ -206,7 +206,7 @@ export interface QueryConsensusStateRequestSDKType { */ export interface QueryConsensusStateResponse { /** consensus state associated with the client identifier at the given height */ - consensusState: Any; + consensusState?: Any; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -224,7 +224,7 @@ export interface QueryConsensusStateResponseAmino { /** consensus state associated with the client identifier at the given height */ consensus_state?: AnyAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -237,7 +237,7 @@ export interface QueryConsensusStateResponseAminoMsg { * RPC method */ export interface QueryConsensusStateResponseSDKType { - consensus_state: AnySDKType; + consensus_state?: AnySDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -249,7 +249,7 @@ export interface QueryConsensusStatesRequest { /** client identifier */ clientId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConsensusStatesRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest"; @@ -261,7 +261,7 @@ export interface QueryConsensusStatesRequestProtoMsg { */ export interface QueryConsensusStatesRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -275,7 +275,7 @@ export interface QueryConsensusStatesRequestAminoMsg { */ export interface QueryConsensusStatesRequestSDKType { client_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConsensusStatesResponse is the response type for the @@ -285,7 +285,7 @@ export interface QueryConsensusStatesResponse { /** consensus states associated with the identifier */ consensusStates: ConsensusStateWithHeight[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryConsensusStatesResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse"; @@ -297,7 +297,7 @@ export interface QueryConsensusStatesResponseProtoMsg { */ export interface QueryConsensusStatesResponseAmino { /** consensus states associated with the identifier */ - consensus_states: ConsensusStateWithHeightAmino[]; + consensus_states?: ConsensusStateWithHeightAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -311,7 +311,7 @@ export interface QueryConsensusStatesResponseAminoMsg { */ export interface QueryConsensusStatesResponseSDKType { consensus_states: ConsensusStateWithHeightSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights @@ -321,7 +321,7 @@ export interface QueryConsensusStateHeightsRequest { /** client identifier */ clientId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConsensusStateHeightsRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest"; @@ -333,7 +333,7 @@ export interface QueryConsensusStateHeightsRequestProtoMsg { */ export interface QueryConsensusStateHeightsRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -347,7 +347,7 @@ export interface QueryConsensusStateHeightsRequestAminoMsg { */ export interface QueryConsensusStateHeightsRequestSDKType { client_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConsensusStateHeightsResponse is the response type for the @@ -357,7 +357,7 @@ export interface QueryConsensusStateHeightsResponse { /** consensus state heights */ consensusStateHeights: Height[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryConsensusStateHeightsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse"; @@ -369,7 +369,7 @@ export interface QueryConsensusStateHeightsResponseProtoMsg { */ export interface QueryConsensusStateHeightsResponseAmino { /** consensus state heights */ - consensus_state_heights: HeightAmino[]; + consensus_state_heights?: HeightAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -383,7 +383,7 @@ export interface QueryConsensusStateHeightsResponseAminoMsg { */ export interface QueryConsensusStateHeightsResponseSDKType { consensus_state_heights: HeightSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC @@ -403,7 +403,7 @@ export interface QueryClientStatusRequestProtoMsg { */ export interface QueryClientStatusRequestAmino { /** client unique identifier */ - client_id: string; + client_id?: string; } export interface QueryClientStatusRequestAminoMsg { type: "cosmos-sdk/QueryClientStatusRequest"; @@ -432,7 +432,7 @@ export interface QueryClientStatusResponseProtoMsg { * method. It returns the current status of the IBC client. */ export interface QueryClientStatusResponseAmino { - status: string; + status?: string; } export interface QueryClientStatusResponseAminoMsg { type: "cosmos-sdk/QueryClientStatusResponse"; @@ -474,7 +474,7 @@ export interface QueryClientParamsRequestSDKType {} */ export interface QueryClientParamsResponse { /** params defines the parameters of the module. */ - params: Params; + params?: Params; } export interface QueryClientParamsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse"; @@ -497,7 +497,7 @@ export interface QueryClientParamsResponseAminoMsg { * method. */ export interface QueryClientParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** * QueryUpgradedClientStateRequest is the request type for the @@ -528,7 +528,7 @@ export interface QueryUpgradedClientStateRequestSDKType {} */ export interface QueryUpgradedClientStateResponse { /** client state associated with the request identifier */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface QueryUpgradedClientStateResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse"; @@ -551,7 +551,7 @@ export interface QueryUpgradedClientStateResponseAminoMsg { * Query/UpgradedClientState RPC method. */ export interface QueryUpgradedClientStateResponseSDKType { - upgraded_client_state: AnySDKType; + upgraded_client_state?: AnySDKType; } /** * QueryUpgradedConsensusStateRequest is the request type for the @@ -582,7 +582,7 @@ export interface QueryUpgradedConsensusStateRequestSDKType {} */ export interface QueryUpgradedConsensusStateResponse { /** Consensus state associated with the request identifier */ - upgradedConsensusState: Any; + upgradedConsensusState?: Any; } export interface QueryUpgradedConsensusStateResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse"; @@ -605,7 +605,7 @@ export interface QueryUpgradedConsensusStateResponseAminoMsg { * Query/UpgradedConsensusState RPC method. */ export interface QueryUpgradedConsensusStateResponseSDKType { - upgraded_consensus_state: AnySDKType; + upgraded_consensus_state?: AnySDKType; } function createBaseQueryClientStateRequest(): QueryClientStateRequest { return { @@ -613,14 +613,15 @@ function createBaseQueryClientStateRequest(): QueryClientStateRequest { }; } export const QueryClientStateRequest = { - encode(message: QueryClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientStateRequest", + encode(message: QueryClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStateRequest(); while (reader.pos < end) { @@ -652,13 +653,15 @@ export const QueryClientStateRequest = { return message; }, fromAmino(object: QueryClientStateRequestAmino): QueryClientStateRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientStateRequest): QueryClientStateRequestAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; return obj; }, fromAminoMsg(object: QueryClientStateRequestAminoMsg): QueryClientStateRequest { @@ -691,7 +694,8 @@ function createBaseQueryClientStateResponse(): QueryClientStateResponse { }; } export const QueryClientStateResponse = { - encode(message: QueryClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientStateResponse", + encode(message: QueryClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientState !== undefined) { Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); } @@ -703,8 +707,8 @@ export const QueryClientStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStateResponse(); while (reader.pos < end) { @@ -748,16 +752,22 @@ export const QueryClientStateResponse = { return message; }, fromAmino(object: QueryClientStateResponseAmino): QueryClientStateResponse { - return { - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryClientStateResponse(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryClientStateResponse): QueryClientStateResponseAmino { const obj: any = {}; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -785,18 +795,19 @@ export const QueryClientStateResponse = { }; function createBaseQueryClientStatesRequest(): QueryClientStatesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClientStatesRequest = { - encode(message: QueryClientStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest", + encode(message: QueryClientStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatesRequest(); while (reader.pos < end) { @@ -828,9 +839,11 @@ export const QueryClientStatesRequest = { return message; }, fromAmino(object: QueryClientStatesRequestAmino): QueryClientStatesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClientStatesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClientStatesRequest): QueryClientStatesRequestAmino { const obj: any = {}; @@ -862,11 +875,12 @@ export const QueryClientStatesRequest = { function createBaseQueryClientStatesResponse(): QueryClientStatesResponse { return { clientStates: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClientStatesResponse = { - encode(message: QueryClientStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse", + encode(message: QueryClientStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clientStates) { IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -875,8 +889,8 @@ export const QueryClientStatesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatesResponse(); while (reader.pos < end) { @@ -918,17 +932,19 @@ export const QueryClientStatesResponse = { return message; }, fromAmino(object: QueryClientStatesResponseAmino): QueryClientStatesResponse { - return { - clientStates: Array.isArray(object?.client_states) ? object.client_states.map((e: any) => IdentifiedClientState.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.client_states?.map(e => IdentifiedClientState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClientStatesResponse): QueryClientStatesResponseAmino { const obj: any = {}; if (message.clientStates) { obj.client_states = message.clientStates.map(e => e ? IdentifiedClientState.toAmino(e) : undefined); } else { - obj.client_states = []; + obj.client_states = message.clientStates; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -958,20 +974,21 @@ export const QueryClientStatesResponse = { function createBaseQueryConsensusStateRequest(): QueryConsensusStateRequest { return { clientId: "", - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), latestHeight: false }; } export const QueryConsensusStateRequest = { - encode(message: QueryConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest", + encode(message: QueryConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } - if (!message.revisionNumber.isZero()) { + if (message.revisionNumber !== BigInt(0)) { writer.uint32(16).uint64(message.revisionNumber); } - if (!message.revisionHeight.isZero()) { + if (message.revisionHeight !== BigInt(0)) { writer.uint32(24).uint64(message.revisionHeight); } if (message.latestHeight === true) { @@ -979,8 +996,8 @@ export const QueryConsensusStateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateRequest(); while (reader.pos < end) { @@ -990,10 +1007,10 @@ export const QueryConsensusStateRequest = { message.clientId = reader.string(); break; case 2: - message.revisionNumber = (reader.uint64() as Long); + message.revisionNumber = reader.uint64(); break; case 3: - message.revisionHeight = (reader.uint64() as Long); + message.revisionHeight = reader.uint64(); break; case 4: message.latestHeight = reader.bool(); @@ -1008,41 +1025,49 @@ export const QueryConsensusStateRequest = { fromJSON(object: any): QueryConsensusStateRequest { return { clientId: isSet(object.clientId) ? String(object.clientId) : "", - revisionNumber: isSet(object.revisionNumber) ? Long.fromValue(object.revisionNumber) : Long.UZERO, - revisionHeight: isSet(object.revisionHeight) ? Long.fromValue(object.revisionHeight) : Long.UZERO, + revisionNumber: isSet(object.revisionNumber) ? BigInt(object.revisionNumber.toString()) : BigInt(0), + revisionHeight: isSet(object.revisionHeight) ? BigInt(object.revisionHeight.toString()) : BigInt(0), latestHeight: isSet(object.latestHeight) ? Boolean(object.latestHeight) : false }; }, toJSON(message: QueryConsensusStateRequest): unknown { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); - message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); - message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); + message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight); return obj; }, fromPartial(object: Partial): QueryConsensusStateRequest { const message = createBaseQueryConsensusStateRequest(); message.clientId = object.clientId ?? ""; - message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? Long.fromValue(object.revisionNumber) : Long.UZERO; - message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? Long.fromValue(object.revisionHeight) : Long.UZERO; + 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); message.latestHeight = object.latestHeight ?? false; return message; }, fromAmino(object: QueryConsensusStateRequestAmino): QueryConsensusStateRequest { - return { - clientId: object.client_id, - revisionNumber: Long.fromString(object.revision_number), - revisionHeight: Long.fromString(object.revision_height), - latestHeight: object.latest_height - }; + const message = createBaseQueryConsensusStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = object.latest_height; + } + return message; }, toAmino(message: QueryConsensusStateRequest): QueryConsensusStateRequestAmino { const obj: any = {}; - obj.client_id = message.clientId; - obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; - obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; - obj.latest_height = message.latestHeight; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; + obj.latest_height = message.latestHeight === false ? undefined : message.latestHeight; return obj; }, fromAminoMsg(object: QueryConsensusStateRequestAminoMsg): QueryConsensusStateRequest { @@ -1075,7 +1100,8 @@ function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { }; } export const QueryConsensusStateResponse = { - encode(message: QueryConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse", + encode(message: QueryConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); } @@ -1087,8 +1113,8 @@ export const QueryConsensusStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateResponse(); while (reader.pos < end) { @@ -1132,16 +1158,22 @@ export const QueryConsensusStateResponse = { return message; }, fromAmino(object: QueryConsensusStateResponseAmino): QueryConsensusStateResponse { - return { - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConsensusStateResponse): QueryConsensusStateResponseAmino { const obj: any = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1170,11 +1202,12 @@ export const QueryConsensusStateResponse = { function createBaseQueryConsensusStatesRequest(): QueryConsensusStatesRequest { return { clientId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStatesRequest = { - encode(message: QueryConsensusStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest", + encode(message: QueryConsensusStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -1183,8 +1216,8 @@ export const QueryConsensusStatesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStatesRequest(); while (reader.pos < end) { @@ -1222,14 +1255,18 @@ export const QueryConsensusStatesRequest = { return message; }, fromAmino(object: QueryConsensusStatesRequestAmino): QueryConsensusStatesRequest { - return { - clientId: object.client_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStatesRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStatesRequest): QueryConsensusStatesRequestAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1258,11 +1295,12 @@ export const QueryConsensusStatesRequest = { function createBaseQueryConsensusStatesResponse(): QueryConsensusStatesResponse { return { consensusStates: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStatesResponse = { - encode(message: QueryConsensusStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse", + encode(message: QueryConsensusStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.consensusStates) { ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1271,8 +1309,8 @@ export const QueryConsensusStatesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStatesResponse(); while (reader.pos < end) { @@ -1314,17 +1352,19 @@ export const QueryConsensusStatesResponse = { return message; }, fromAmino(object: QueryConsensusStatesResponseAmino): QueryConsensusStatesResponse { - return { - consensusStates: Array.isArray(object?.consensus_states) ? object.consensus_states.map((e: any) => ConsensusStateWithHeight.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStatesResponse): QueryConsensusStatesResponseAmino { const obj: any = {}; if (message.consensusStates) { obj.consensus_states = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toAmino(e) : undefined); } else { - obj.consensus_states = []; + obj.consensus_states = message.consensusStates; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1354,11 +1394,12 @@ export const QueryConsensusStatesResponse = { function createBaseQueryConsensusStateHeightsRequest(): QueryConsensusStateHeightsRequest { return { clientId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStateHeightsRequest = { - encode(message: QueryConsensusStateHeightsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest", + encode(message: QueryConsensusStateHeightsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -1367,8 +1408,8 @@ export const QueryConsensusStateHeightsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateHeightsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateHeightsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateHeightsRequest(); while (reader.pos < end) { @@ -1406,14 +1447,18 @@ export const QueryConsensusStateHeightsRequest = { return message; }, fromAmino(object: QueryConsensusStateHeightsRequestAmino): QueryConsensusStateHeightsRequest { - return { - clientId: object.client_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStateHeightsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStateHeightsRequest): QueryConsensusStateHeightsRequestAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1442,11 +1487,12 @@ export const QueryConsensusStateHeightsRequest = { function createBaseQueryConsensusStateHeightsResponse(): QueryConsensusStateHeightsResponse { return { consensusStateHeights: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStateHeightsResponse = { - encode(message: QueryConsensusStateHeightsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse", + encode(message: QueryConsensusStateHeightsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.consensusStateHeights) { Height.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1455,8 +1501,8 @@ export const QueryConsensusStateHeightsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateHeightsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateHeightsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateHeightsResponse(); while (reader.pos < end) { @@ -1498,17 +1544,19 @@ export const QueryConsensusStateHeightsResponse = { return message; }, fromAmino(object: QueryConsensusStateHeightsResponseAmino): QueryConsensusStateHeightsResponse { - return { - consensusStateHeights: Array.isArray(object?.consensus_state_heights) ? object.consensus_state_heights.map((e: any) => Height.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStateHeightsResponse(); + message.consensusStateHeights = object.consensus_state_heights?.map(e => Height.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStateHeightsResponse): QueryConsensusStateHeightsResponseAmino { const obj: any = {}; if (message.consensusStateHeights) { obj.consensus_state_heights = message.consensusStateHeights.map(e => e ? Height.toAmino(e) : undefined); } else { - obj.consensus_state_heights = []; + obj.consensus_state_heights = message.consensusStateHeights; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1541,14 +1589,15 @@ function createBaseQueryClientStatusRequest(): QueryClientStatusRequest { }; } export const QueryClientStatusRequest = { - encode(message: QueryClientStatusRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest", + encode(message: QueryClientStatusRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatusRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatusRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatusRequest(); while (reader.pos < end) { @@ -1580,13 +1629,15 @@ export const QueryClientStatusRequest = { return message; }, fromAmino(object: QueryClientStatusRequestAmino): QueryClientStatusRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientStatusRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientStatusRequest): QueryClientStatusRequestAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; return obj; }, fromAminoMsg(object: QueryClientStatusRequestAminoMsg): QueryClientStatusRequest { @@ -1617,14 +1668,15 @@ function createBaseQueryClientStatusResponse(): QueryClientStatusResponse { }; } export const QueryClientStatusResponse = { - encode(message: QueryClientStatusResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse", + encode(message: QueryClientStatusResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== "") { writer.uint32(10).string(message.status); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatusResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatusResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatusResponse(); while (reader.pos < end) { @@ -1656,13 +1708,15 @@ export const QueryClientStatusResponse = { return message; }, fromAmino(object: QueryClientStatusResponseAmino): QueryClientStatusResponse { - return { - status: object.status - }; + const message = createBaseQueryClientStatusResponse(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; }, toAmino(message: QueryClientStatusResponse): QueryClientStatusResponseAmino { const obj: any = {}; - obj.status = message.status; + obj.status = message.status === "" ? undefined : message.status; return obj; }, fromAminoMsg(object: QueryClientStatusResponseAminoMsg): QueryClientStatusResponse { @@ -1691,11 +1745,12 @@ function createBaseQueryClientParamsRequest(): QueryClientParamsRequest { return {}; } export const QueryClientParamsRequest = { - encode(_: QueryClientParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest", + encode(_: QueryClientParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientParamsRequest(); while (reader.pos < end) { @@ -1720,7 +1775,8 @@ export const QueryClientParamsRequest = { return message; }, fromAmino(_: QueryClientParamsRequestAmino): QueryClientParamsRequest { - return {}; + const message = createBaseQueryClientParamsRequest(); + return message; }, toAmino(_: QueryClientParamsRequest): QueryClientParamsRequestAmino { const obj: any = {}; @@ -1750,18 +1806,19 @@ export const QueryClientParamsRequest = { }; function createBaseQueryClientParamsResponse(): QueryClientParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryClientParamsResponse = { - encode(message: QueryClientParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse", + encode(message: QueryClientParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientParamsResponse(); while (reader.pos < end) { @@ -1793,9 +1850,11 @@ export const QueryClientParamsResponse = { return message; }, fromAmino(object: QueryClientParamsResponseAmino): QueryClientParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryClientParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryClientParamsResponse): QueryClientParamsResponseAmino { const obj: any = {}; @@ -1828,11 +1887,12 @@ function createBaseQueryUpgradedClientStateRequest(): QueryUpgradedClientStateRe return {}; } export const QueryUpgradedClientStateRequest = { - encode(_: QueryUpgradedClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest", + encode(_: QueryUpgradedClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedClientStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedClientStateRequest(); while (reader.pos < end) { @@ -1857,7 +1917,8 @@ export const QueryUpgradedClientStateRequest = { return message; }, fromAmino(_: QueryUpgradedClientStateRequestAmino): QueryUpgradedClientStateRequest { - return {}; + const message = createBaseQueryUpgradedClientStateRequest(); + return message; }, toAmino(_: QueryUpgradedClientStateRequest): QueryUpgradedClientStateRequestAmino { const obj: any = {}; @@ -1891,14 +1952,15 @@ function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateR }; } export const QueryUpgradedClientStateResponse = { - encode(message: QueryUpgradedClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse", + encode(message: QueryUpgradedClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.upgradedClientState !== undefined) { Any.encode(message.upgradedClientState, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedClientStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedClientStateResponse(); while (reader.pos < end) { @@ -1930,9 +1992,11 @@ export const QueryUpgradedClientStateResponse = { return message; }, fromAmino(object: QueryUpgradedClientStateResponseAmino): QueryUpgradedClientStateResponse { - return { - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + const message = createBaseQueryUpgradedClientStateResponse(); + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; }, toAmino(message: QueryUpgradedClientStateResponse): QueryUpgradedClientStateResponseAmino { const obj: any = {}; @@ -1965,11 +2029,12 @@ function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusS return {}; } export const QueryUpgradedConsensusStateRequest = { - encode(_: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest", + encode(_: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateRequest(); while (reader.pos < end) { @@ -1994,7 +2059,8 @@ export const QueryUpgradedConsensusStateRequest = { return message; }, fromAmino(_: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { - return {}; + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; }, toAmino(_: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { const obj: any = {}; @@ -2028,14 +2094,15 @@ function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensus }; } export const QueryUpgradedConsensusStateResponse = { - encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + encode(message: QueryUpgradedConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.upgradedConsensusState !== undefined) { Any.encode(message.upgradedConsensusState, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateResponse(); while (reader.pos < end) { @@ -2067,9 +2134,11 @@ export const QueryUpgradedConsensusStateResponse = { return message; }, fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { - return { - upgradedConsensusState: object?.upgraded_consensus_state ? Any.fromAmino(object.upgraded_consensus_state) : undefined - }; + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = Any.fromAmino(object.upgraded_consensus_state); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts b/packages/api/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts index 26c3f912..29890ac8 100644 --- a/packages/api/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse } from "./tx"; /** Msg defines the ibc/client Msg service. */ export interface Msg { @@ -24,21 +24,21 @@ export class MsgClientImpl implements Msg { createClient(request: MsgCreateClient): Promise { const data = MsgCreateClient.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "CreateClient", data); - return promise.then(data => MsgCreateClientResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateClientResponse.decode(new BinaryReader(data))); } updateClient(request: MsgUpdateClient): Promise { const data = MsgUpdateClient.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClient", data); - return promise.then(data => MsgUpdateClientResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClientResponse.decode(new BinaryReader(data))); } upgradeClient(request: MsgUpgradeClient): Promise { const data = MsgUpgradeClient.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpgradeClient", data); - return promise.then(data => MsgUpgradeClientResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpgradeClientResponse.decode(new BinaryReader(data))); } submitMisbehaviour(request: MsgSubmitMisbehaviour): Promise { const data = MsgSubmitMisbehaviour.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); - return promise.then(data => MsgSubmitMisbehaviourResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSubmitMisbehaviourResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/ibc/core/client/v1/tx.ts b/packages/api/src/codegen/ibc/core/client/v1/tx.ts index e8856325..f2f3b326 100644 --- a/packages/api/src/codegen/ibc/core/client/v1/tx.ts +++ b/packages/api/src/codegen/ibc/core/client/v1/tx.ts @@ -1,15 +1,15 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClient { /** light client state */ - clientState: Any; + clientState?: Any; /** * consensus state associated with the client that corresponds to a given * height. */ - consensusState: Any; + consensusState?: Any; /** signer address */ signer: string; } @@ -27,7 +27,7 @@ export interface MsgCreateClientAmino { */ consensus_state?: AnyAmino; /** signer address */ - signer: string; + signer?: string; } export interface MsgCreateClientAminoMsg { type: "cosmos-sdk/MsgCreateClient"; @@ -35,8 +35,8 @@ export interface MsgCreateClientAminoMsg { } /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClientSDKType { - client_state: AnySDKType; - consensus_state: AnySDKType; + client_state?: AnySDKType; + consensus_state?: AnySDKType; signer: string; } /** MsgCreateClientResponse defines the Msg/CreateClient response type. */ @@ -61,7 +61,7 @@ export interface MsgUpdateClient { /** client unique identifier */ clientId: string; /** client message to update the light client */ - clientMessage: Any; + clientMessage?: Any; /** signer address */ signer: string; } @@ -75,11 +75,11 @@ export interface MsgUpdateClientProtoMsg { */ export interface MsgUpdateClientAmino { /** client unique identifier */ - client_id: string; + client_id?: string; /** client message to update the light client */ client_message?: AnyAmino; /** signer address */ - signer: string; + signer?: string; } export interface MsgUpdateClientAminoMsg { type: "cosmos-sdk/MsgUpdateClient"; @@ -91,7 +91,7 @@ export interface MsgUpdateClientAminoMsg { */ export interface MsgUpdateClientSDKType { client_id: string; - client_message: AnySDKType; + client_message?: AnySDKType; signer: string; } /** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ @@ -116,12 +116,12 @@ export interface MsgUpgradeClient { /** client unique identifier */ clientId: string; /** upgraded client state */ - clientState: Any; + clientState?: Any; /** * upgraded consensus state, only contains enough information to serve as a * basis of trust in update logic */ - consensusState: Any; + consensusState?: Any; /** proof that old chain committed to new client */ proofUpgradeClient: Uint8Array; /** proof that old chain committed to new consensus state */ @@ -139,7 +139,7 @@ export interface MsgUpgradeClientProtoMsg { */ export interface MsgUpgradeClientAmino { /** client unique identifier */ - client_id: string; + client_id?: string; /** upgraded client state */ client_state?: AnyAmino; /** @@ -148,11 +148,11 @@ export interface MsgUpgradeClientAmino { */ consensus_state?: AnyAmino; /** proof that old chain committed to new client */ - proof_upgrade_client: Uint8Array; + proof_upgrade_client?: string; /** proof that old chain committed to new consensus state */ - proof_upgrade_consensus_state: Uint8Array; + proof_upgrade_consensus_state?: string; /** signer address */ - signer: string; + signer?: string; } export interface MsgUpgradeClientAminoMsg { type: "cosmos-sdk/MsgUpgradeClient"; @@ -164,8 +164,8 @@ export interface MsgUpgradeClientAminoMsg { */ export interface MsgUpgradeClientSDKType { client_id: string; - client_state: AnySDKType; - consensus_state: AnySDKType; + client_state?: AnySDKType; + consensus_state?: AnySDKType; proof_upgrade_client: Uint8Array; proof_upgrade_consensus_state: Uint8Array; signer: string; @@ -195,7 +195,7 @@ export interface MsgSubmitMisbehaviour { clientId: string; /** misbehaviour used for freezing the light client */ /** @deprecated */ - misbehaviour: Any; + misbehaviour?: Any; /** signer address */ /** @deprecated */ signer: string; @@ -212,13 +212,13 @@ export interface MsgSubmitMisbehaviourProtoMsg { export interface MsgSubmitMisbehaviourAmino { /** client unique identifier */ /** @deprecated */ - client_id: string; + client_id?: string; /** misbehaviour used for freezing the light client */ /** @deprecated */ misbehaviour?: AnyAmino; /** signer address */ /** @deprecated */ - signer: string; + signer?: string; } export interface MsgSubmitMisbehaviourAminoMsg { type: "cosmos-sdk/MsgSubmitMisbehaviour"; @@ -233,7 +233,7 @@ export interface MsgSubmitMisbehaviourSDKType { /** @deprecated */ client_id: string; /** @deprecated */ - misbehaviour: AnySDKType; + misbehaviour?: AnySDKType; /** @deprecated */ signer: string; } @@ -268,7 +268,8 @@ function createBaseMsgCreateClient(): MsgCreateClient { }; } export const MsgCreateClient = { - encode(message: MsgCreateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + encode(message: MsgCreateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientState !== undefined) { Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); } @@ -280,8 +281,8 @@ export const MsgCreateClient = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClient { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClient(); while (reader.pos < end) { @@ -325,17 +326,23 @@ export const MsgCreateClient = { return message; }, fromAmino(object: MsgCreateClientAmino): MsgCreateClient { - return { - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - signer: object.signer - }; + const message = createBaseMsgCreateClient(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgCreateClient): MsgCreateClientAmino { const obj: any = {}; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; - obj.signer = message.signer; + obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object: MsgCreateClientAminoMsg): MsgCreateClient { @@ -364,11 +371,12 @@ function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { return {}; } export const MsgCreateClientResponse = { - encode(_: MsgCreateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + encode(_: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClientResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClientResponse(); while (reader.pos < end) { @@ -393,7 +401,8 @@ export const MsgCreateClientResponse = { return message; }, fromAmino(_: MsgCreateClientResponseAmino): MsgCreateClientResponse { - return {}; + const message = createBaseMsgCreateClientResponse(); + return message; }, toAmino(_: MsgCreateClientResponse): MsgCreateClientResponseAmino { const obj: any = {}; @@ -429,7 +438,8 @@ function createBaseMsgUpdateClient(): MsgUpdateClient { }; } export const MsgUpdateClient = { - encode(message: MsgUpdateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + encode(message: MsgUpdateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -441,8 +451,8 @@ export const MsgUpdateClient = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClient { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClient(); while (reader.pos < end) { @@ -486,17 +496,23 @@ export const MsgUpdateClient = { return message; }, fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { - return { - clientId: object.client_id, - clientMessage: object?.client_message ? Any.fromAmino(object.client_message) : undefined, - signer: object.signer - }; + const message = createBaseMsgUpdateClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_message !== undefined && object.client_message !== null) { + message.clientMessage = Any.fromAmino(object.client_message); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgUpdateClient): MsgUpdateClientAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.client_message = message.clientMessage ? Any.toAmino(message.clientMessage) : undefined; - obj.signer = message.signer; + obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object: MsgUpdateClientAminoMsg): MsgUpdateClient { @@ -525,11 +541,12 @@ function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { return {}; } export const MsgUpdateClientResponse = { - encode(_: MsgUpdateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + encode(_: MsgUpdateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClientResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClientResponse(); while (reader.pos < end) { @@ -554,7 +571,8 @@ export const MsgUpdateClientResponse = { return message; }, fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { - return {}; + const message = createBaseMsgUpdateClientResponse(); + return message; }, toAmino(_: MsgUpdateClientResponse): MsgUpdateClientResponseAmino { const obj: any = {}; @@ -593,7 +611,8 @@ function createBaseMsgUpgradeClient(): MsgUpgradeClient { }; } export const MsgUpgradeClient = { - encode(message: MsgUpgradeClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + encode(message: MsgUpgradeClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -614,8 +633,8 @@ export const MsgUpgradeClient = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClient { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpgradeClient(); while (reader.pos < end) { @@ -677,23 +696,35 @@ export const MsgUpgradeClient = { return message; }, fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { - return { - clientId: object.client_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - proofUpgradeClient: object.proof_upgrade_client, - proofUpgradeConsensusState: object.proof_upgrade_consensus_state, - signer: object.signer - }; + const message = createBaseMsgUpgradeClient(); + 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); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof_upgrade_client !== undefined && object.proof_upgrade_client !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proof_upgrade_client); + } + if (object.proof_upgrade_consensus_state !== undefined && object.proof_upgrade_consensus_state !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proof_upgrade_consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgUpgradeClient): MsgUpgradeClientAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; - obj.proof_upgrade_client = message.proofUpgradeClient; - obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState; - obj.signer = message.signer; + obj.proof_upgrade_client = message.proofUpgradeClient ? base64FromBytes(message.proofUpgradeClient) : undefined; + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState ? base64FromBytes(message.proofUpgradeConsensusState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object: MsgUpgradeClientAminoMsg): MsgUpgradeClient { @@ -722,11 +753,12 @@ function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { return {}; } export const MsgUpgradeClientResponse = { - encode(_: MsgUpgradeClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + encode(_: MsgUpgradeClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClientResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpgradeClientResponse(); while (reader.pos < end) { @@ -751,7 +783,8 @@ export const MsgUpgradeClientResponse = { return message; }, fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { - return {}; + const message = createBaseMsgUpgradeClientResponse(); + return message; }, toAmino(_: MsgUpgradeClientResponse): MsgUpgradeClientResponseAmino { const obj: any = {}; @@ -787,7 +820,8 @@ function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { }; } export const MsgSubmitMisbehaviour = { - encode(message: MsgSubmitMisbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + encode(message: MsgSubmitMisbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -799,8 +833,8 @@ export const MsgSubmitMisbehaviour = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviour { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitMisbehaviour(); while (reader.pos < end) { @@ -844,17 +878,23 @@ export const MsgSubmitMisbehaviour = { return message; }, fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { - return { - clientId: object.client_id, - misbehaviour: object?.misbehaviour ? Any.fromAmino(object.misbehaviour) : undefined, - signer: object.signer - }; + const message = createBaseMsgSubmitMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromAmino(object.misbehaviour); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAmino { const obj: any = {}; - obj.client_id = message.clientId; + obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.misbehaviour = message.misbehaviour ? Any.toAmino(message.misbehaviour) : undefined; - obj.signer = message.signer; + obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object: MsgSubmitMisbehaviourAminoMsg): MsgSubmitMisbehaviour { @@ -883,11 +923,12 @@ function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourRespons return {}; } export const MsgSubmitMisbehaviourResponse = { - encode(_: MsgSubmitMisbehaviourResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + encode(_: MsgSubmitMisbehaviourResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitMisbehaviourResponse(); while (reader.pos < end) { @@ -912,7 +953,8 @@ export const MsgSubmitMisbehaviourResponse = { return message; }, fromAmino(_: MsgSubmitMisbehaviourResponseAmino): MsgSubmitMisbehaviourResponse { - return {}; + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; }, toAmino(_: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/ibc/lcd.ts b/packages/api/src/codegen/ibc/lcd.ts index 139b0edb..3afd3f59 100644 --- a/packages/api/src/codegen/ibc/lcd.ts +++ b/packages/api/src/codegen/ibc/lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; export const createLCDClient = async ({ restEndpoint }: { diff --git a/packages/api/src/codegen/index.ts b/packages/api/src/codegen/index.ts index eeda298e..9c1ad26a 100644 --- a/packages/api/src/codegen/index.ts +++ b/packages/api/src/codegen/index.ts @@ -1,5 +1,5 @@ /** - * This file and any referenced files were automatically generated by @osmonauts/telescope@0.99.0 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.2 * 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. */ @@ -14,4 +14,7 @@ export * from "./ibc/bundle"; export * from "./ibc/client"; export * from "./regen/bundle"; export * from "./regen/client"; -export * from "./tendermint/bundle"; \ No newline at end of file +export * from "./tendermint/bundle"; +export * from "./varint"; +export * from "./utf8"; +export * from "./binary"; \ No newline at end of file diff --git a/packages/api/src/codegen/regen/bundle.ts b/packages/api/src/codegen/regen/bundle.ts index 34d68a04..8c36ebb4 100644 --- a/packages/api/src/codegen/regen/bundle.ts +++ b/packages/api/src/codegen/regen/bundle.ts @@ -1,142 +1,131 @@ -import * as _112 from "./data/v1/events"; -import * as _113 from "./data/v1/query"; -import * as _114 from "./data/v1/state"; -import * as _115 from "./data/v1/tx"; -import * as _116 from "./data/v1/types"; -import * as _117 from "./ecocredit/basket/v1/events"; -import * as _118 from "./ecocredit/basket/v1/query"; -import * as _119 from "./ecocredit/basket/v1/state"; -import * as _120 from "./ecocredit/basket/v1/tx"; -import * as _121 from "./ecocredit/basket/v1/types"; -import * as _122 from "./ecocredit/marketplace/v1/events"; -import * as _123 from "./ecocredit/marketplace/v1/query"; -import * as _124 from "./ecocredit/marketplace/v1/state"; -import * as _125 from "./ecocredit/marketplace/v1/tx"; -import * as _126 from "./ecocredit/marketplace/v1/types"; -import * as _127 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _128 from "./ecocredit/v1/events"; -import * as _129 from "./ecocredit/v1/query"; -import * as _130 from "./ecocredit/v1/state"; -import * as _131 from "./ecocredit/v1/tx"; -import * as _132 from "./ecocredit/v1/types"; -import * as _133 from "./ecocredit/v1alpha1/events"; -import * as _134 from "./ecocredit/v1alpha1/genesis"; -import * as _135 from "./ecocredit/v1alpha1/query"; -import * as _136 from "./ecocredit/v1alpha1/tx"; -import * as _137 from "./ecocredit/v1alpha1/types"; -import * as _138 from "./intertx/v1/query"; -import * as _139 from "./intertx/v1/tx"; -import * as _240 from "./data/v1/tx.amino"; -import * as _241 from "./ecocredit/basket/v1/tx.amino"; -import * as _242 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _243 from "./ecocredit/v1/tx.amino"; -import * as _244 from "./ecocredit/v1alpha1/tx.amino"; -import * as _245 from "./intertx/v1/tx.amino"; -import * as _246 from "./data/v1/tx.registry"; -import * as _247 from "./ecocredit/basket/v1/tx.registry"; -import * as _248 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _249 from "./ecocredit/v1/tx.registry"; -import * as _250 from "./ecocredit/v1alpha1/tx.registry"; -import * as _251 from "./intertx/v1/tx.registry"; -import * as _252 from "./data/v1/query.lcd"; -import * as _253 from "./ecocredit/basket/v1/query.lcd"; -import * as _254 from "./ecocredit/marketplace/v1/query.lcd"; -import * as _255 from "./ecocredit/v1/query.lcd"; -import * as _256 from "./ecocredit/v1alpha1/query.lcd"; -import * as _257 from "./intertx/v1/query.lcd"; -import * as _258 from "./data/v1/query.rpc.Query"; -import * as _259 from "./ecocredit/basket/v1/query.rpc.Query"; -import * as _260 from "./ecocredit/marketplace/v1/query.rpc.Query"; -import * as _261 from "./ecocredit/v1/query.rpc.Query"; -import * as _262 from "./ecocredit/v1alpha1/query.rpc.Query"; -import * as _263 from "./intertx/v1/query.rpc.Query"; -import * as _264 from "./data/v1/tx.rpc.msg"; -import * as _265 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _266 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _267 from "./ecocredit/v1/tx.rpc.msg"; -import * as _268 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _269 from "./intertx/v1/tx.rpc.msg"; -import * as _276 from "./lcd"; -import * as _277 from "./rpc.query"; -import * as _278 from "./rpc.tx"; +import * as _113 from "./data/v1/events"; +import * as _114 from "./data/v1/query"; +import * as _115 from "./data/v1/state"; +import * as _116 from "./data/v1/tx"; +import * as _117 from "./data/v1/types"; +import * as _118 from "./ecocredit/basket/v1/events"; +import * as _119 from "./ecocredit/basket/v1/query"; +import * as _120 from "./ecocredit/basket/v1/state"; +import * as _121 from "./ecocredit/basket/v1/tx"; +import * as _122 from "./ecocredit/basket/v1/types"; +import * as _123 from "./ecocredit/marketplace/v1/events"; +import * as _124 from "./ecocredit/marketplace/v1/query"; +import * as _125 from "./ecocredit/marketplace/v1/state"; +import * as _126 from "./ecocredit/marketplace/v1/tx"; +import * as _127 from "./ecocredit/marketplace/v1/types"; +import * as _128 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _129 from "./ecocredit/v1/events"; +import * as _130 from "./ecocredit/v1/query"; +import * as _131 from "./ecocredit/v1/state"; +import * as _132 from "./ecocredit/v1/tx"; +import * as _133 from "./ecocredit/v1/types"; +import * as _134 from "./ecocredit/v1alpha1/events"; +import * as _135 from "./ecocredit/v1alpha1/genesis"; +import * as _136 from "./ecocredit/v1alpha1/query"; +import * as _137 from "./ecocredit/v1alpha1/tx"; +import * as _138 from "./ecocredit/v1alpha1/types"; +import * as _139 from "./intertx/v1/query"; +import * as _140 from "./intertx/v1/tx"; +import * as _241 from "./data/v1/tx.amino"; +import * as _242 from "./ecocredit/basket/v1/tx.amino"; +import * as _243 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _244 from "./ecocredit/v1/tx.amino"; +import * as _245 from "./ecocredit/v1alpha1/tx.amino"; +import * as _246 from "./intertx/v1/tx.amino"; +import * as _247 from "./data/v1/tx.registry"; +import * as _248 from "./ecocredit/basket/v1/tx.registry"; +import * as _249 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _250 from "./ecocredit/v1/tx.registry"; +import * as _251 from "./ecocredit/v1alpha1/tx.registry"; +import * as _252 from "./intertx/v1/tx.registry"; +import * as _253 from "./data/v1/query.lcd"; +import * as _254 from "./ecocredit/basket/v1/query.lcd"; +import * as _255 from "./ecocredit/marketplace/v1/query.lcd"; +import * as _256 from "./ecocredit/v1/query.lcd"; +import * as _257 from "./ecocredit/v1alpha1/query.lcd"; +import * as _258 from "./intertx/v1/query.lcd"; +import * as _259 from "./data/v1/query.rpc.Query"; +import * as _260 from "./ecocredit/basket/v1/query.rpc.Query"; +import * as _261 from "./ecocredit/marketplace/v1/query.rpc.Query"; +import * as _262 from "./ecocredit/v1/query.rpc.Query"; +import * as _263 from "./ecocredit/v1alpha1/query.rpc.Query"; +import * as _264 from "./intertx/v1/query.rpc.Query"; +import * as _265 from "./data/v1/tx.rpc.msg"; +import * as _266 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _267 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _268 from "./ecocredit/v1/tx.rpc.msg"; +import * as _269 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _270 from "./intertx/v1/tx.rpc.msg"; +import * as _277 from "./lcd"; +import * as _278 from "./rpc.query"; +import * as _279 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._112, ..._113, ..._114, ..._115, ..._116, - ..._240, - ..._246, - ..._252, - ..._258, - ..._264 + ..._117, + ..._241, + ..._247, + ..._253, + ..._259, + ..._265 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._117, ..._118, ..._119, ..._120, ..._121, - ..._241, - ..._247, - ..._253, - ..._259, - ..._265 + ..._122, + ..._242, + ..._248, + ..._254, + ..._260, + ..._266 }; } export namespace marketplace { export const v1 = { - ..._122, ..._123, ..._124, ..._125, ..._126, - ..._242, - ..._248, - ..._254, - ..._260, - ..._266 + ..._127, + ..._243, + ..._249, + ..._255, + ..._261, + ..._267 }; } export namespace orderbook { export const v1alpha1 = { - ..._127 + ..._128 }; } export const v1 = { - ..._128, ..._129, ..._130, ..._131, ..._132, - ..._243, - ..._249, - ..._255, - ..._261, - ..._267 - }; - export const v1alpha1 = { ..._133, - ..._134, - ..._135, - ..._136, - ..._137, ..._244, ..._250, ..._256, ..._262, ..._268 }; - } - export namespace intertx { - export const v1 = { + export const v1alpha1 = { + ..._134, + ..._135, + ..._136, + ..._137, ..._138, - ..._139, ..._245, ..._251, ..._257, @@ -144,9 +133,20 @@ export namespace regen { ..._269 }; } + export namespace intertx { + export const v1 = { + ..._139, + ..._140, + ..._246, + ..._252, + ..._258, + ..._264, + ..._270 + }; + } export const ClientFactory = { - ..._276, ..._277, - ..._278 + ..._278, + ..._279 }; } \ No newline at end of file diff --git a/packages/api/src/codegen/regen/client.ts b/packages/api/src/codegen/regen/client.ts index 06f9b169..d5b188ac 100644 --- a/packages/api/src/codegen/regen/client.ts +++ b/packages/api/src/codegen/regen/client.ts @@ -55,7 +55,7 @@ export const getSigningRegenClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/packages/api/src/codegen/regen/data/v1/events.ts b/packages/api/src/codegen/regen/data/v1/events.ts index 511791c9..a3c5969d 100644 --- a/packages/api/src/codegen/regen/data/v1/events.ts +++ b/packages/api/src/codegen/regen/data/v1/events.ts @@ -1,5 +1,5 @@ -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; /** EventAnchor is an event emitted when data is anchored on chain. */ export interface EventAnchor { /** iri is the IRI of the data anchored on chain. */ @@ -12,7 +12,7 @@ export interface EventAnchorProtoMsg { /** EventAnchor is an event emitted when data is anchored on chain. */ export interface EventAnchorAmino { /** iri is the IRI of the data anchored on chain. */ - iri: string; + iri?: string; } export interface EventAnchorAminoMsg { type: "/regen.data.v1.EventAnchor"; @@ -39,12 +39,12 @@ export interface EventAttestProtoMsg { /** EventAttest is an event emitted when data is attested to on chain. */ export interface EventAttestAmino { /** iri is the IRI of the data attested to. */ - iri: string; + iri?: string; /** * attestor is the address of the account that has attested to the veracity of * the data. */ - attestor: string; + attestor?: string; } export interface EventAttestAminoMsg { type: "/regen.data.v1.EventAttest"; @@ -58,7 +58,7 @@ export interface EventAttestSDKType { /** EventDefineResolver is an event emitted when a resolved is defined on chain. */ export interface EventDefineResolver { /** id is the ID of the defined resolver. */ - id: Long; + id: bigint; } export interface EventDefineResolverProtoMsg { typeUrl: "/regen.data.v1.EventDefineResolver"; @@ -67,7 +67,7 @@ export interface EventDefineResolverProtoMsg { /** EventDefineResolver is an event emitted when a resolved is defined on chain. */ export interface EventDefineResolverAmino { /** id is the ID of the defined resolver. */ - id: string; + id?: string; } export interface EventDefineResolverAminoMsg { type: "/regen.data.v1.EventDefineResolver"; @@ -75,7 +75,7 @@ export interface EventDefineResolverAminoMsg { } /** EventDefineResolver is an event emitted when a resolved is defined on chain. */ export interface EventDefineResolverSDKType { - id: Long; + id: bigint; } /** * EventRegisterResolver is an event emitted when data is registered to a @@ -83,7 +83,7 @@ export interface EventDefineResolverSDKType { */ export interface EventRegisterResolver { /** id is the ID of the resolver that the data was registered to. */ - id: Long; + id: bigint; /** iri is the IRI of the data that was registered. */ iri: string; } @@ -97,9 +97,9 @@ export interface EventRegisterResolverProtoMsg { */ export interface EventRegisterResolverAmino { /** id is the ID of the resolver that the data was registered to. */ - id: string; + id?: string; /** iri is the IRI of the data that was registered. */ - iri: string; + iri?: string; } export interface EventRegisterResolverAminoMsg { type: "/regen.data.v1.EventRegisterResolver"; @@ -110,7 +110,7 @@ export interface EventRegisterResolverAminoMsg { * resolver on chain. */ export interface EventRegisterResolverSDKType { - id: Long; + id: bigint; iri: string; } function createBaseEventAnchor(): EventAnchor { @@ -119,14 +119,15 @@ function createBaseEventAnchor(): EventAnchor { }; } export const EventAnchor = { - encode(message: EventAnchor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.EventAnchor", + encode(message: EventAnchor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventAnchor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventAnchor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventAnchor(); while (reader.pos < end) { @@ -158,13 +159,15 @@ export const EventAnchor = { return message; }, fromAmino(object: EventAnchorAmino): EventAnchor { - return { - iri: object.iri - }; + const message = createBaseEventAnchor(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + return message; }, toAmino(message: EventAnchor): EventAnchorAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; return obj; }, fromAminoMsg(object: EventAnchorAminoMsg): EventAnchor { @@ -190,7 +193,8 @@ function createBaseEventAttest(): EventAttest { }; } export const EventAttest = { - encode(message: EventAttest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.EventAttest", + encode(message: EventAttest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } @@ -199,8 +203,8 @@ export const EventAttest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventAttest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventAttest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventAttest(); while (reader.pos < end) { @@ -238,15 +242,19 @@ export const EventAttest = { return message; }, fromAmino(object: EventAttestAmino): EventAttest { - return { - iri: object.iri, - attestor: object.attestor - }; + const message = createBaseEventAttest(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + if (object.attestor !== undefined && object.attestor !== null) { + message.attestor = object.attestor; + } + return message; }, toAmino(message: EventAttest): EventAttestAmino { const obj: any = {}; - obj.iri = message.iri; - obj.attestor = message.attestor; + obj.iri = message.iri === "" ? undefined : message.iri; + obj.attestor = message.attestor === "" ? undefined : message.attestor; return obj; }, fromAminoMsg(object: EventAttestAminoMsg): EventAttest { @@ -267,25 +275,26 @@ export const EventAttest = { }; function createBaseEventDefineResolver(): EventDefineResolver { return { - id: Long.UZERO + id: BigInt(0) }; } export const EventDefineResolver = { - encode(message: EventDefineResolver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.data.v1.EventDefineResolver", + encode(message: EventDefineResolver, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventDefineResolver { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventDefineResolver { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventDefineResolver(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -296,27 +305,29 @@ export const EventDefineResolver = { }, fromJSON(object: any): EventDefineResolver { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) }; }, toJSON(message: EventDefineResolver): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventDefineResolver { const message = createBaseEventDefineResolver(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); return message; }, fromAmino(object: EventDefineResolverAmino): EventDefineResolver { - return { - id: Long.fromString(object.id) - }; + const message = createBaseEventDefineResolver(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; }, toAmino(message: EventDefineResolver): EventDefineResolverAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; return obj; }, fromAminoMsg(object: EventDefineResolverAminoMsg): EventDefineResolver { @@ -337,13 +348,14 @@ export const EventDefineResolver = { }; function createBaseEventRegisterResolver(): EventRegisterResolver { return { - id: Long.UZERO, + id: BigInt(0), iri: "" }; } export const EventRegisterResolver = { - encode(message: EventRegisterResolver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.data.v1.EventRegisterResolver", + encode(message: EventRegisterResolver, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.iri !== "") { @@ -351,15 +363,15 @@ export const EventRegisterResolver = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventRegisterResolver { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventRegisterResolver { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventRegisterResolver(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.iri = reader.string(); @@ -373,32 +385,36 @@ export const EventRegisterResolver = { }, fromJSON(object: any): EventRegisterResolver { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), iri: isSet(object.iri) ? String(object.iri) : "" }; }, toJSON(message: EventRegisterResolver): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.iri !== undefined && (obj.iri = message.iri); return obj; }, fromPartial(object: Partial): EventRegisterResolver { const message = createBaseEventRegisterResolver(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.iri = object.iri ?? ""; return message; }, fromAmino(object: EventRegisterResolverAmino): EventRegisterResolver { - return { - id: Long.fromString(object.id), - iri: object.iri - }; + const message = createBaseEventRegisterResolver(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + return message; }, toAmino(message: EventRegisterResolver): EventRegisterResolverAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.iri = message.iri; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.iri = message.iri === "" ? undefined : message.iri; return obj; }, fromAminoMsg(object: EventRegisterResolverAminoMsg): EventRegisterResolver { diff --git a/packages/api/src/codegen/regen/data/v1/query.lcd.ts b/packages/api/src/codegen/regen/data/v1/query.lcd.ts index 5934a0e5..598d82ec 100644 --- a/packages/api/src/codegen/regen/data/v1/query.lcd.ts +++ b/packages/api/src/codegen/regen/data/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryAnchorByIRIRequest, QueryAnchorByIRIResponseSDKType, QueryAttestationsByAttestorRequest, QueryAttestationsByAttestorResponseSDKType, QueryAttestationsByIRIRequest, QueryAttestationsByIRIResponseSDKType, QueryResolverRequest, QueryResolverResponseSDKType, QueryResolversByIRIRequest, QueryResolversByIRIResponseSDKType, ConvertIRIToHashRequest, ConvertIRIToHashResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/regen/data/v1/query.rpc.Query.ts b/packages/api/src/codegen/regen/data/v1/query.rpc.Query.ts index f471b703..6df7b048 100644 --- a/packages/api/src/codegen/regen/data/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/regen/data/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryAnchorByIRIRequest, QueryAnchorByIRIResponse, QueryAnchorByHashRequest, QueryAnchorByHashResponse, QueryAttestationsByAttestorRequest, QueryAttestationsByAttestorResponse, QueryAttestationsByIRIRequest, QueryAttestationsByIRIResponse, QueryAttestationsByHashRequest, QueryAttestationsByHashResponse, QueryResolverRequest, QueryResolverResponse, QueryResolversByIRIRequest, QueryResolversByIRIResponse, QueryResolversByHashRequest, QueryResolversByHashResponse, QueryResolversByURLRequest, QueryResolversByURLResponse, ConvertIRIToHashRequest, ConvertIRIToHashResponse, ConvertHashToIRIRequest, ConvertHashToIRIResponse } from "./query"; /** Query is the regen.data.v1 Query service */ @@ -55,57 +55,57 @@ export class QueryClientImpl implements Query { anchorByIRI(request: QueryAnchorByIRIRequest): Promise { const data = QueryAnchorByIRIRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "AnchorByIRI", data); - return promise.then(data => QueryAnchorByIRIResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAnchorByIRIResponse.decode(new BinaryReader(data))); } anchorByHash(request: QueryAnchorByHashRequest): Promise { const data = QueryAnchorByHashRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "AnchorByHash", data); - return promise.then(data => QueryAnchorByHashResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAnchorByHashResponse.decode(new BinaryReader(data))); } attestationsByAttestor(request: QueryAttestationsByAttestorRequest): Promise { const data = QueryAttestationsByAttestorRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "AttestationsByAttestor", data); - return promise.then(data => QueryAttestationsByAttestorResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAttestationsByAttestorResponse.decode(new BinaryReader(data))); } attestationsByIRI(request: QueryAttestationsByIRIRequest): Promise { const data = QueryAttestationsByIRIRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "AttestationsByIRI", data); - return promise.then(data => QueryAttestationsByIRIResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAttestationsByIRIResponse.decode(new BinaryReader(data))); } attestationsByHash(request: QueryAttestationsByHashRequest): Promise { const data = QueryAttestationsByHashRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "AttestationsByHash", data); - return promise.then(data => QueryAttestationsByHashResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAttestationsByHashResponse.decode(new BinaryReader(data))); } resolver(request: QueryResolverRequest): Promise { const data = QueryResolverRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "Resolver", data); - return promise.then(data => QueryResolverResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryResolverResponse.decode(new BinaryReader(data))); } resolversByIRI(request: QueryResolversByIRIRequest): Promise { const data = QueryResolversByIRIRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "ResolversByIRI", data); - return promise.then(data => QueryResolversByIRIResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryResolversByIRIResponse.decode(new BinaryReader(data))); } resolversByHash(request: QueryResolversByHashRequest): Promise { const data = QueryResolversByHashRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "ResolversByHash", data); - return promise.then(data => QueryResolversByHashResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryResolversByHashResponse.decode(new BinaryReader(data))); } resolversByURL(request: QueryResolversByURLRequest): Promise { const data = QueryResolversByURLRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "ResolversByURL", data); - return promise.then(data => QueryResolversByURLResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryResolversByURLResponse.decode(new BinaryReader(data))); } convertIRIToHash(request: ConvertIRIToHashRequest): Promise { const data = ConvertIRIToHashRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "ConvertIRIToHash", data); - return promise.then(data => ConvertIRIToHashResponse.decode(new _m0.Reader(data))); + return promise.then(data => ConvertIRIToHashResponse.decode(new BinaryReader(data))); } convertHashToIRI(request: ConvertHashToIRIRequest): Promise { const data = ConvertHashToIRIRequest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Query", "ConvertHashToIRI", data); - return promise.then(data => ConvertHashToIRIResponse.decode(new _m0.Reader(data))); + return promise.then(data => ConvertHashToIRIResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/regen/data/v1/query.ts b/packages/api/src/codegen/regen/data/v1/query.ts index c38194f5..3b57e7b6 100644 --- a/packages/api/src/codegen/regen/data/v1/query.ts +++ b/packages/api/src/codegen/regen/data/v1/query.ts @@ -1,8 +1,8 @@ import { ContentHash, ContentHashAmino, ContentHashSDKType } from "./types"; import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** QueryAnchorByIRIRequest is the Query/AnchorByIRI request type. */ export interface QueryAnchorByIRIRequest { /** iri is the IRI of the anchored data. */ @@ -15,7 +15,7 @@ export interface QueryAnchorByIRIRequestProtoMsg { /** QueryAnchorByIRIRequest is the Query/AnchorByIRI request type. */ export interface QueryAnchorByIRIRequestAmino { /** iri is the IRI of the anchored data. */ - iri: string; + iri?: string; } export interface QueryAnchorByIRIRequestAminoMsg { type: "/regen.data.v1.QueryAnchorByIRIRequest"; @@ -28,7 +28,7 @@ export interface QueryAnchorByIRIRequestSDKType { /** QueryAnchorByIRIResponse is the Query/AnchorByIRI response type. */ export interface QueryAnchorByIRIResponse { /** anchor is information about the data anchor. */ - anchor: AnchorInfo; + anchor?: AnchorInfo; } export interface QueryAnchorByIRIResponseProtoMsg { typeUrl: "/regen.data.v1.QueryAnchorByIRIResponse"; @@ -45,12 +45,12 @@ export interface QueryAnchorByIRIResponseAminoMsg { } /** QueryAnchorByIRIResponse is the Query/AnchorByIRI response type. */ export interface QueryAnchorByIRIResponseSDKType { - anchor: AnchorInfoSDKType; + anchor?: AnchorInfoSDKType; } /** QueryAnchorByHashRequest is the Query/AnchorByHash request type. */ export interface QueryAnchorByHashRequest { /** content_hash is the ContentHash of the anchored data. */ - contentHash: ContentHash; + contentHash?: ContentHash; } export interface QueryAnchorByHashRequestProtoMsg { typeUrl: "/regen.data.v1.QueryAnchorByHashRequest"; @@ -67,12 +67,12 @@ export interface QueryAnchorByHashRequestAminoMsg { } /** QueryAnchorByHashRequest is the Query/AnchorByHash request type. */ export interface QueryAnchorByHashRequestSDKType { - content_hash: ContentHashSDKType; + content_hash?: ContentHashSDKType; } /** QueryAnchorByHashResponse is the Query/AnchorByHash response type. */ export interface QueryAnchorByHashResponse { /** anchor is information about the data anchor. */ - anchor: AnchorInfo; + anchor?: AnchorInfo; } export interface QueryAnchorByHashResponseProtoMsg { typeUrl: "/regen.data.v1.QueryAnchorByHashResponse"; @@ -89,7 +89,7 @@ export interface QueryAnchorByHashResponseAminoMsg { } /** QueryAnchorByHashResponse is the Query/AnchorByHash response type. */ export interface QueryAnchorByHashResponseSDKType { - anchor: AnchorInfoSDKType; + anchor?: AnchorInfoSDKType; } /** * QueryAttestationsByAttestorRequest is the Query/AttestationsByAttestor @@ -99,7 +99,7 @@ export interface QueryAttestationsByAttestorRequest { /** attestor is the address of the attestor. */ attestor: string; /** pagination is the PageRequest to use for pagination. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAttestationsByAttestorRequestProtoMsg { typeUrl: "/regen.data.v1.QueryAttestationsByAttestorRequest"; @@ -111,7 +111,7 @@ export interface QueryAttestationsByAttestorRequestProtoMsg { */ export interface QueryAttestationsByAttestorRequestAmino { /** attestor is the address of the attestor. */ - attestor: string; + attestor?: string; /** pagination is the PageRequest to use for pagination. */ pagination?: PageRequestAmino; } @@ -125,7 +125,7 @@ export interface QueryAttestationsByAttestorRequestAminoMsg { */ export interface QueryAttestationsByAttestorRequestSDKType { attestor: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAttestationsByAttestorResponse is the Query/AttestationsByAttestor @@ -135,7 +135,7 @@ export interface QueryAttestationsByAttestorResponse { /** attestations are the attestations by the attestor. */ attestations: AttestationInfo[]; /** pagination is the pagination PageResponse. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAttestationsByAttestorResponseProtoMsg { typeUrl: "/regen.data.v1.QueryAttestationsByAttestorResponse"; @@ -147,7 +147,7 @@ export interface QueryAttestationsByAttestorResponseProtoMsg { */ export interface QueryAttestationsByAttestorResponseAmino { /** attestations are the attestations by the attestor. */ - attestations: AttestationInfoAmino[]; + attestations?: AttestationInfoAmino[]; /** pagination is the pagination PageResponse. */ pagination?: PageResponseAmino; } @@ -161,14 +161,14 @@ export interface QueryAttestationsByAttestorResponseAminoMsg { */ export interface QueryAttestationsByAttestorResponseSDKType { attestations: AttestationInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryAttestationsByIRIRequest is the Query/AttestationsByIRI request type. */ export interface QueryAttestationsByIRIRequest { /** iri is the IRI of the anchored data. */ iri: string; /** pagination is the PageRequest to use for pagination. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAttestationsByIRIRequestProtoMsg { typeUrl: "/regen.data.v1.QueryAttestationsByIRIRequest"; @@ -177,7 +177,7 @@ export interface QueryAttestationsByIRIRequestProtoMsg { /** QueryAttestationsByIRIRequest is the Query/AttestationsByIRI request type. */ export interface QueryAttestationsByIRIRequestAmino { /** iri is the IRI of the anchored data. */ - iri: string; + iri?: string; /** pagination is the PageRequest to use for pagination. */ pagination?: PageRequestAmino; } @@ -188,14 +188,14 @@ export interface QueryAttestationsByIRIRequestAminoMsg { /** QueryAttestationsByIRIRequest is the Query/AttestationsByIRI request type. */ export interface QueryAttestationsByIRIRequestSDKType { iri: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryAttestationsByIRIResponse is the Query/AttestationsByIRI response type. */ export interface QueryAttestationsByIRIResponse { /** attestations are the attestations that have been made to the anchored data. */ attestations: AttestationInfo[]; /** pagination is the pagination PageResponse. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAttestationsByIRIResponseProtoMsg { typeUrl: "/regen.data.v1.QueryAttestationsByIRIResponse"; @@ -204,7 +204,7 @@ export interface QueryAttestationsByIRIResponseProtoMsg { /** QueryAttestationsByIRIResponse is the Query/AttestationsByIRI response type. */ export interface QueryAttestationsByIRIResponseAmino { /** attestations are the attestations that have been made to the anchored data. */ - attestations: AttestationInfoAmino[]; + attestations?: AttestationInfoAmino[]; /** pagination is the pagination PageResponse. */ pagination?: PageResponseAmino; } @@ -215,14 +215,14 @@ export interface QueryAttestationsByIRIResponseAminoMsg { /** QueryAttestationsByIRIResponse is the Query/AttestationsByIRI response type. */ export interface QueryAttestationsByIRIResponseSDKType { attestations: AttestationInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryAttestationsByHashRequest is the Query/AttestationsByHash request type. */ export interface QueryAttestationsByHashRequest { /** content_hash is the ContentHash of the anchored data. */ - contentHash: ContentHash; + contentHash?: ContentHash; /** pagination is the PageRequest to use for pagination. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAttestationsByHashRequestProtoMsg { typeUrl: "/regen.data.v1.QueryAttestationsByHashRequest"; @@ -241,8 +241,8 @@ export interface QueryAttestationsByHashRequestAminoMsg { } /** QueryAttestationsByHashRequest is the Query/AttestationsByHash request type. */ export interface QueryAttestationsByHashRequestSDKType { - content_hash: ContentHashSDKType; - pagination: PageRequestSDKType; + content_hash?: ContentHashSDKType; + pagination?: PageRequestSDKType; } /** * QueryAttestationsByHashResponse is the Query/AttestationsByHash response @@ -252,7 +252,7 @@ export interface QueryAttestationsByHashResponse { /** attestations are the attestations that have been made to the anchored data. */ attestations: AttestationInfo[]; /** pagination is the pagination PageResponse. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAttestationsByHashResponseProtoMsg { typeUrl: "/regen.data.v1.QueryAttestationsByHashResponse"; @@ -264,7 +264,7 @@ export interface QueryAttestationsByHashResponseProtoMsg { */ export interface QueryAttestationsByHashResponseAmino { /** attestations are the attestations that have been made to the anchored data. */ - attestations: AttestationInfoAmino[]; + attestations?: AttestationInfoAmino[]; /** pagination is the pagination PageResponse. */ pagination?: PageResponseAmino; } @@ -278,12 +278,12 @@ export interface QueryAttestationsByHashResponseAminoMsg { */ export interface QueryAttestationsByHashResponseSDKType { attestations: AttestationInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryResolverRequest is the Query/Resolver request type. */ export interface QueryResolverRequest { /** id is the ID of the resolver. */ - id: Long; + id: bigint; } export interface QueryResolverRequestProtoMsg { typeUrl: "/regen.data.v1.QueryResolverRequest"; @@ -292,7 +292,7 @@ export interface QueryResolverRequestProtoMsg { /** QueryResolverRequest is the Query/Resolver request type. */ export interface QueryResolverRequestAmino { /** id is the ID of the resolver. */ - id: string; + id?: string; } export interface QueryResolverRequestAminoMsg { type: "/regen.data.v1.QueryResolverRequest"; @@ -300,12 +300,12 @@ export interface QueryResolverRequestAminoMsg { } /** QueryResolverRequest is the Query/Resolver request type. */ export interface QueryResolverRequestSDKType { - id: Long; + id: bigint; } /** QueryResolverResponse is the Query/Resolver response type. */ export interface QueryResolverResponse { /** resolver is information about the resolver. */ - resolver: ResolverInfo; + resolver?: ResolverInfo; } export interface QueryResolverResponseProtoMsg { typeUrl: "/regen.data.v1.QueryResolverResponse"; @@ -322,14 +322,14 @@ export interface QueryResolverResponseAminoMsg { } /** QueryResolverResponse is the Query/Resolver response type. */ export interface QueryResolverResponseSDKType { - resolver: ResolverInfoSDKType; + resolver?: ResolverInfoSDKType; } /** QueryResolversByIRIRequest is the Query/ResolversByIRI request type. */ export interface QueryResolversByIRIRequest { /** iri is the IRI of the anchored data. */ iri: string; /** pagination is the PageRequest to use for pagination. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryResolversByIRIRequestProtoMsg { typeUrl: "/regen.data.v1.QueryResolversByIRIRequest"; @@ -338,7 +338,7 @@ export interface QueryResolversByIRIRequestProtoMsg { /** QueryResolversByIRIRequest is the Query/ResolversByIRI request type. */ export interface QueryResolversByIRIRequestAmino { /** iri is the IRI of the anchored data. */ - iri: string; + iri?: string; /** pagination is the PageRequest to use for pagination. */ pagination?: PageRequestAmino; } @@ -349,14 +349,14 @@ export interface QueryResolversByIRIRequestAminoMsg { /** QueryResolversByIRIRequest is the Query/ResolversByIRI request type. */ export interface QueryResolversByIRIRequestSDKType { iri: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryResolversByIRIResponse is the Query/ResolversByIRI response type. */ export interface QueryResolversByIRIResponse { /** resolvers are the resolvers that have registered the anchored data. */ resolvers: ResolverInfo[]; /** pagination is the PageResponse to use for pagination. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryResolversByIRIResponseProtoMsg { typeUrl: "/regen.data.v1.QueryResolversByIRIResponse"; @@ -365,7 +365,7 @@ export interface QueryResolversByIRIResponseProtoMsg { /** QueryResolversByIRIResponse is the Query/ResolversByIRI response type. */ export interface QueryResolversByIRIResponseAmino { /** resolvers are the resolvers that have registered the anchored data. */ - resolvers: ResolverInfoAmino[]; + resolvers?: ResolverInfoAmino[]; /** pagination is the PageResponse to use for pagination. */ pagination?: PageResponseAmino; } @@ -376,14 +376,14 @@ export interface QueryResolversByIRIResponseAminoMsg { /** QueryResolversByIRIResponse is the Query/ResolversByIRI response type. */ export interface QueryResolversByIRIResponseSDKType { resolvers: ResolverInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryResolversByHashRequest is the Query/ResolversByHash request type. */ export interface QueryResolversByHashRequest { /** content_hash is the ContentHash of the anchored data. */ - contentHash: ContentHash; + contentHash?: ContentHash; /** pagination is the PageRequest to use for pagination. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryResolversByHashRequestProtoMsg { typeUrl: "/regen.data.v1.QueryResolversByHashRequest"; @@ -402,15 +402,15 @@ export interface QueryResolversByHashRequestAminoMsg { } /** QueryResolversByHashRequest is the Query/ResolversByHash request type. */ export interface QueryResolversByHashRequestSDKType { - content_hash: ContentHashSDKType; - pagination: PageRequestSDKType; + content_hash?: ContentHashSDKType; + pagination?: PageRequestSDKType; } /** QueryResolversByHashResponse is the Query/ResolversByHash response type. */ export interface QueryResolversByHashResponse { /** resolvers are the resolvers that have registered the data. */ resolvers: ResolverInfo[]; /** pagination is the PageResponse to use for pagination. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryResolversByHashResponseProtoMsg { typeUrl: "/regen.data.v1.QueryResolversByHashResponse"; @@ -419,7 +419,7 @@ export interface QueryResolversByHashResponseProtoMsg { /** QueryResolversByHashResponse is the Query/ResolversByHash response type. */ export interface QueryResolversByHashResponseAmino { /** resolvers are the resolvers that have registered the data. */ - resolvers: ResolverInfoAmino[]; + resolvers?: ResolverInfoAmino[]; /** pagination is the PageResponse to use for pagination. */ pagination?: PageResponseAmino; } @@ -430,14 +430,14 @@ export interface QueryResolversByHashResponseAminoMsg { /** QueryResolversByHashResponse is the Query/ResolversByHash response type. */ export interface QueryResolversByHashResponseSDKType { resolvers: ResolverInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryResolversByURLRequest is the Query/ResolversByURL request type. */ export interface QueryResolversByURLRequest { /** url is the URL of the resolver. */ url: string; /** pagination is the PageRequest to use for pagination. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryResolversByURLRequestProtoMsg { typeUrl: "/regen.data.v1.QueryResolversByURLRequest"; @@ -446,7 +446,7 @@ export interface QueryResolversByURLRequestProtoMsg { /** QueryResolversByURLRequest is the Query/ResolversByURL request type. */ export interface QueryResolversByURLRequestAmino { /** url is the URL of the resolver. */ - url: string; + url?: string; /** pagination is the PageRequest to use for pagination. */ pagination?: PageRequestAmino; } @@ -457,14 +457,14 @@ export interface QueryResolversByURLRequestAminoMsg { /** QueryResolversByURLRequest is the Query/ResolversByURL request type. */ export interface QueryResolversByURLRequestSDKType { url: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryResolversByURLResponse is the Query/ResolversByURL response type. */ export interface QueryResolversByURLResponse { /** resolvers are the resolvers that have a matching URL. */ resolvers: ResolverInfo[]; /** pagination is the PageResponse to use for pagination. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryResolversByURLResponseProtoMsg { typeUrl: "/regen.data.v1.QueryResolversByURLResponse"; @@ -473,7 +473,7 @@ export interface QueryResolversByURLResponseProtoMsg { /** QueryResolversByURLResponse is the Query/ResolversByURL response type. */ export interface QueryResolversByURLResponseAmino { /** resolvers are the resolvers that have a matching URL. */ - resolvers: ResolverInfoAmino[]; + resolvers?: ResolverInfoAmino[]; /** pagination is the PageResponse to use for pagination. */ pagination?: PageResponseAmino; } @@ -484,7 +484,7 @@ export interface QueryResolversByURLResponseAminoMsg { /** QueryResolversByURLResponse is the Query/ResolversByURL response type. */ export interface QueryResolversByURLResponseSDKType { resolvers: ResolverInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** ConvertIRIToHashRequest is the Query/ConvertIRIToHash request type. */ export interface ConvertIRIToHashRequest { @@ -498,7 +498,7 @@ export interface ConvertIRIToHashRequestProtoMsg { /** ConvertIRIToHashRequest is the Query/ConvertIRIToHash request type. */ export interface ConvertIRIToHashRequestAmino { /** iri is the IRI to convert to a ContentHash. */ - iri: string; + iri?: string; } export interface ConvertIRIToHashRequestAminoMsg { type: "/regen.data.v1.ConvertIRIToHashRequest"; @@ -511,7 +511,7 @@ export interface ConvertIRIToHashRequestSDKType { /** ConvertIRIToHashResponse is the Query/ConvertIRIToHash response type. */ export interface ConvertIRIToHashResponse { /** content_hash is the ContentHash converted from the IRI. */ - contentHash: ContentHash; + contentHash?: ContentHash; } export interface ConvertIRIToHashResponseProtoMsg { typeUrl: "/regen.data.v1.ConvertIRIToHashResponse"; @@ -528,12 +528,12 @@ export interface ConvertIRIToHashResponseAminoMsg { } /** ConvertIRIToHashResponse is the Query/ConvertIRIToHash response type. */ export interface ConvertIRIToHashResponseSDKType { - content_hash: ContentHashSDKType; + content_hash?: ContentHashSDKType; } /** ConvertHashToIRIRequest is the Query/ConvertHashToIRI request type. */ export interface ConvertHashToIRIRequest { /** content_hash is the ContentHash to convert to an IRI. */ - contentHash: ContentHash; + contentHash?: ContentHash; } export interface ConvertHashToIRIRequestProtoMsg { typeUrl: "/regen.data.v1.ConvertHashToIRIRequest"; @@ -550,7 +550,7 @@ export interface ConvertHashToIRIRequestAminoMsg { } /** ConvertHashToIRIRequest is the Query/ConvertHashToIRI request type. */ export interface ConvertHashToIRIRequestSDKType { - content_hash: ContentHashSDKType; + content_hash?: ContentHashSDKType; } /** ConvertHashToIRIResponse is the Query/ConvertHashToIRI response type. */ export interface ConvertHashToIRIResponse { @@ -564,7 +564,7 @@ export interface ConvertHashToIRIResponseProtoMsg { /** ConvertHashToIRIResponse is the Query/ConvertHashToIRI response type. */ export interface ConvertHashToIRIResponseAmino { /** iri is the IRI converted from the ContentHash. */ - iri: string; + iri?: string; } export interface ConvertHashToIRIResponseAminoMsg { type: "/regen.data.v1.ConvertHashToIRIResponse"; @@ -579,9 +579,9 @@ export interface AnchorInfo { /** iri is the IRI of the anchored data. */ iri: string; /** content_hash is the ContentHash of the anchored data. */ - contentHash: ContentHash; + contentHash?: ContentHash; /** timestamp is the time at which the data was anchored. */ - timestamp: Timestamp; + timestamp?: Timestamp; } export interface AnchorInfoProtoMsg { typeUrl: "/regen.data.v1.AnchorInfo"; @@ -590,11 +590,11 @@ export interface AnchorInfoProtoMsg { /** AnchorInfo is the information for a data anchor. */ export interface AnchorInfoAmino { /** iri is the IRI of the anchored data. */ - iri: string; + iri?: string; /** content_hash is the ContentHash of the anchored data. */ content_hash?: ContentHashAmino; /** timestamp is the time at which the data was anchored. */ - timestamp?: TimestampAmino; + timestamp?: string; } export interface AnchorInfoAminoMsg { type: "/regen.data.v1.AnchorInfo"; @@ -603,8 +603,8 @@ export interface AnchorInfoAminoMsg { /** AnchorInfo is the information for a data anchor. */ export interface AnchorInfoSDKType { iri: string; - content_hash: ContentHashSDKType; - timestamp: TimestampSDKType; + content_hash?: ContentHashSDKType; + timestamp?: TimestampSDKType; } /** AttestationInfo is the information for an attestation. */ export interface AttestationInfo { @@ -613,7 +613,7 @@ export interface AttestationInfo { /** attestor is the address of the account that attested to the anchored data. */ attestor: string; /** timestamp is the time at which the data was attested to. */ - timestamp: Timestamp; + timestamp?: Timestamp; } export interface AttestationInfoProtoMsg { typeUrl: "/regen.data.v1.AttestationInfo"; @@ -622,11 +622,11 @@ export interface AttestationInfoProtoMsg { /** AttestationInfo is the information for an attestation. */ export interface AttestationInfoAmino { /** iri is the IRI of the anchored data. */ - iri: string; + iri?: string; /** attestor is the address of the account that attested to the anchored data. */ - attestor: string; + attestor?: string; /** timestamp is the time at which the data was attested to. */ - timestamp?: TimestampAmino; + timestamp?: string; } export interface AttestationInfoAminoMsg { type: "/regen.data.v1.AttestationInfo"; @@ -636,12 +636,12 @@ export interface AttestationInfoAminoMsg { export interface AttestationInfoSDKType { iri: string; attestor: string; - timestamp: TimestampSDKType; + timestamp?: TimestampSDKType; } /** ResolverInfo is the information for a resolver. */ export interface ResolverInfo { /** id is the ID of the resolver. */ - id: Long; + id: bigint; /** url is the URL of the resolver. */ url: string; /** manager is the address of the account that manages the resolver. */ @@ -654,11 +654,11 @@ export interface ResolverInfoProtoMsg { /** ResolverInfo is the information for a resolver. */ export interface ResolverInfoAmino { /** id is the ID of the resolver. */ - id: string; + id?: string; /** url is the URL of the resolver. */ - url: string; + url?: string; /** manager is the address of the account that manages the resolver. */ - manager: string; + manager?: string; } export interface ResolverInfoAminoMsg { type: "/regen.data.v1.ResolverInfo"; @@ -666,7 +666,7 @@ export interface ResolverInfoAminoMsg { } /** ResolverInfo is the information for a resolver. */ export interface ResolverInfoSDKType { - id: Long; + id: bigint; url: string; manager: string; } @@ -676,14 +676,15 @@ function createBaseQueryAnchorByIRIRequest(): QueryAnchorByIRIRequest { }; } export const QueryAnchorByIRIRequest = { - encode(message: QueryAnchorByIRIRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAnchorByIRIRequest", + encode(message: QueryAnchorByIRIRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnchorByIRIRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnchorByIRIRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnchorByIRIRequest(); while (reader.pos < end) { @@ -715,13 +716,15 @@ export const QueryAnchorByIRIRequest = { return message; }, fromAmino(object: QueryAnchorByIRIRequestAmino): QueryAnchorByIRIRequest { - return { - iri: object.iri - }; + const message = createBaseQueryAnchorByIRIRequest(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + return message; }, toAmino(message: QueryAnchorByIRIRequest): QueryAnchorByIRIRequestAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; return obj; }, fromAminoMsg(object: QueryAnchorByIRIRequestAminoMsg): QueryAnchorByIRIRequest { @@ -742,18 +745,19 @@ export const QueryAnchorByIRIRequest = { }; function createBaseQueryAnchorByIRIResponse(): QueryAnchorByIRIResponse { return { - anchor: AnchorInfo.fromPartial({}) + anchor: undefined }; } export const QueryAnchorByIRIResponse = { - encode(message: QueryAnchorByIRIResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAnchorByIRIResponse", + encode(message: QueryAnchorByIRIResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.anchor !== undefined) { AnchorInfo.encode(message.anchor, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnchorByIRIResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnchorByIRIResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnchorByIRIResponse(); while (reader.pos < end) { @@ -785,9 +789,11 @@ export const QueryAnchorByIRIResponse = { return message; }, fromAmino(object: QueryAnchorByIRIResponseAmino): QueryAnchorByIRIResponse { - return { - anchor: object?.anchor ? AnchorInfo.fromAmino(object.anchor) : undefined - }; + const message = createBaseQueryAnchorByIRIResponse(); + if (object.anchor !== undefined && object.anchor !== null) { + message.anchor = AnchorInfo.fromAmino(object.anchor); + } + return message; }, toAmino(message: QueryAnchorByIRIResponse): QueryAnchorByIRIResponseAmino { const obj: any = {}; @@ -812,18 +818,19 @@ export const QueryAnchorByIRIResponse = { }; function createBaseQueryAnchorByHashRequest(): QueryAnchorByHashRequest { return { - contentHash: ContentHash.fromPartial({}) + contentHash: undefined }; } export const QueryAnchorByHashRequest = { - encode(message: QueryAnchorByHashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAnchorByHashRequest", + encode(message: QueryAnchorByHashRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contentHash !== undefined) { ContentHash.encode(message.contentHash, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnchorByHashRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnchorByHashRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnchorByHashRequest(); while (reader.pos < end) { @@ -855,9 +862,11 @@ export const QueryAnchorByHashRequest = { return message; }, fromAmino(object: QueryAnchorByHashRequestAmino): QueryAnchorByHashRequest { - return { - contentHash: object?.content_hash ? ContentHash.fromAmino(object.content_hash) : undefined - }; + const message = createBaseQueryAnchorByHashRequest(); + if (object.content_hash !== undefined && object.content_hash !== null) { + message.contentHash = ContentHash.fromAmino(object.content_hash); + } + return message; }, toAmino(message: QueryAnchorByHashRequest): QueryAnchorByHashRequestAmino { const obj: any = {}; @@ -882,18 +891,19 @@ export const QueryAnchorByHashRequest = { }; function createBaseQueryAnchorByHashResponse(): QueryAnchorByHashResponse { return { - anchor: AnchorInfo.fromPartial({}) + anchor: undefined }; } export const QueryAnchorByHashResponse = { - encode(message: QueryAnchorByHashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAnchorByHashResponse", + encode(message: QueryAnchorByHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.anchor !== undefined) { AnchorInfo.encode(message.anchor, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnchorByHashResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnchorByHashResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnchorByHashResponse(); while (reader.pos < end) { @@ -925,9 +935,11 @@ export const QueryAnchorByHashResponse = { return message; }, fromAmino(object: QueryAnchorByHashResponseAmino): QueryAnchorByHashResponse { - return { - anchor: object?.anchor ? AnchorInfo.fromAmino(object.anchor) : undefined - }; + const message = createBaseQueryAnchorByHashResponse(); + if (object.anchor !== undefined && object.anchor !== null) { + message.anchor = AnchorInfo.fromAmino(object.anchor); + } + return message; }, toAmino(message: QueryAnchorByHashResponse): QueryAnchorByHashResponseAmino { const obj: any = {}; @@ -953,11 +965,12 @@ export const QueryAnchorByHashResponse = { function createBaseQueryAttestationsByAttestorRequest(): QueryAttestationsByAttestorRequest { return { attestor: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAttestationsByAttestorRequest = { - encode(message: QueryAttestationsByAttestorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAttestationsByAttestorRequest", + encode(message: QueryAttestationsByAttestorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.attestor !== "") { writer.uint32(10).string(message.attestor); } @@ -966,8 +979,8 @@ export const QueryAttestationsByAttestorRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAttestationsByAttestorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAttestationsByAttestorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAttestationsByAttestorRequest(); while (reader.pos < end) { @@ -1005,14 +1018,18 @@ export const QueryAttestationsByAttestorRequest = { return message; }, fromAmino(object: QueryAttestationsByAttestorRequestAmino): QueryAttestationsByAttestorRequest { - return { - attestor: object.attestor, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAttestationsByAttestorRequest(); + if (object.attestor !== undefined && object.attestor !== null) { + message.attestor = object.attestor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAttestationsByAttestorRequest): QueryAttestationsByAttestorRequestAmino { const obj: any = {}; - obj.attestor = message.attestor; + obj.attestor = message.attestor === "" ? undefined : message.attestor; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1035,11 +1052,12 @@ export const QueryAttestationsByAttestorRequest = { function createBaseQueryAttestationsByAttestorResponse(): QueryAttestationsByAttestorResponse { return { attestations: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAttestationsByAttestorResponse = { - encode(message: QueryAttestationsByAttestorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAttestationsByAttestorResponse", + encode(message: QueryAttestationsByAttestorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.attestations) { AttestationInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1048,8 +1066,8 @@ export const QueryAttestationsByAttestorResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAttestationsByAttestorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAttestationsByAttestorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAttestationsByAttestorResponse(); while (reader.pos < end) { @@ -1091,17 +1109,19 @@ export const QueryAttestationsByAttestorResponse = { return message; }, fromAmino(object: QueryAttestationsByAttestorResponseAmino): QueryAttestationsByAttestorResponse { - return { - attestations: Array.isArray(object?.attestations) ? object.attestations.map((e: any) => AttestationInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAttestationsByAttestorResponse(); + message.attestations = object.attestations?.map(e => AttestationInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAttestationsByAttestorResponse): QueryAttestationsByAttestorResponseAmino { const obj: any = {}; if (message.attestations) { obj.attestations = message.attestations.map(e => e ? AttestationInfo.toAmino(e) : undefined); } else { - obj.attestations = []; + obj.attestations = message.attestations; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1125,11 +1145,12 @@ export const QueryAttestationsByAttestorResponse = { function createBaseQueryAttestationsByIRIRequest(): QueryAttestationsByIRIRequest { return { iri: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAttestationsByIRIRequest = { - encode(message: QueryAttestationsByIRIRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAttestationsByIRIRequest", + encode(message: QueryAttestationsByIRIRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } @@ -1138,8 +1159,8 @@ export const QueryAttestationsByIRIRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAttestationsByIRIRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAttestationsByIRIRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAttestationsByIRIRequest(); while (reader.pos < end) { @@ -1177,14 +1198,18 @@ export const QueryAttestationsByIRIRequest = { return message; }, fromAmino(object: QueryAttestationsByIRIRequestAmino): QueryAttestationsByIRIRequest { - return { - iri: object.iri, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAttestationsByIRIRequest(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAttestationsByIRIRequest): QueryAttestationsByIRIRequestAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1207,11 +1232,12 @@ export const QueryAttestationsByIRIRequest = { function createBaseQueryAttestationsByIRIResponse(): QueryAttestationsByIRIResponse { return { attestations: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAttestationsByIRIResponse = { - encode(message: QueryAttestationsByIRIResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAttestationsByIRIResponse", + encode(message: QueryAttestationsByIRIResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.attestations) { AttestationInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1220,8 +1246,8 @@ export const QueryAttestationsByIRIResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAttestationsByIRIResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAttestationsByIRIResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAttestationsByIRIResponse(); while (reader.pos < end) { @@ -1263,17 +1289,19 @@ export const QueryAttestationsByIRIResponse = { return message; }, fromAmino(object: QueryAttestationsByIRIResponseAmino): QueryAttestationsByIRIResponse { - return { - attestations: Array.isArray(object?.attestations) ? object.attestations.map((e: any) => AttestationInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAttestationsByIRIResponse(); + message.attestations = object.attestations?.map(e => AttestationInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAttestationsByIRIResponse): QueryAttestationsByIRIResponseAmino { const obj: any = {}; if (message.attestations) { obj.attestations = message.attestations.map(e => e ? AttestationInfo.toAmino(e) : undefined); } else { - obj.attestations = []; + obj.attestations = message.attestations; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1296,12 +1324,13 @@ export const QueryAttestationsByIRIResponse = { }; function createBaseQueryAttestationsByHashRequest(): QueryAttestationsByHashRequest { return { - contentHash: ContentHash.fromPartial({}), - pagination: PageRequest.fromPartial({}) + contentHash: undefined, + pagination: undefined }; } export const QueryAttestationsByHashRequest = { - encode(message: QueryAttestationsByHashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAttestationsByHashRequest", + encode(message: QueryAttestationsByHashRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contentHash !== undefined) { ContentHash.encode(message.contentHash, writer.uint32(10).fork()).ldelim(); } @@ -1310,8 +1339,8 @@ export const QueryAttestationsByHashRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAttestationsByHashRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAttestationsByHashRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAttestationsByHashRequest(); while (reader.pos < end) { @@ -1349,10 +1378,14 @@ export const QueryAttestationsByHashRequest = { return message; }, fromAmino(object: QueryAttestationsByHashRequestAmino): QueryAttestationsByHashRequest { - return { - contentHash: object?.content_hash ? ContentHash.fromAmino(object.content_hash) : undefined, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAttestationsByHashRequest(); + if (object.content_hash !== undefined && object.content_hash !== null) { + message.contentHash = ContentHash.fromAmino(object.content_hash); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAttestationsByHashRequest): QueryAttestationsByHashRequestAmino { const obj: any = {}; @@ -1379,11 +1412,12 @@ export const QueryAttestationsByHashRequest = { function createBaseQueryAttestationsByHashResponse(): QueryAttestationsByHashResponse { return { attestations: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAttestationsByHashResponse = { - encode(message: QueryAttestationsByHashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryAttestationsByHashResponse", + encode(message: QueryAttestationsByHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.attestations) { AttestationInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1392,8 +1426,8 @@ export const QueryAttestationsByHashResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAttestationsByHashResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAttestationsByHashResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAttestationsByHashResponse(); while (reader.pos < end) { @@ -1435,17 +1469,19 @@ export const QueryAttestationsByHashResponse = { return message; }, fromAmino(object: QueryAttestationsByHashResponseAmino): QueryAttestationsByHashResponse { - return { - attestations: Array.isArray(object?.attestations) ? object.attestations.map((e: any) => AttestationInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAttestationsByHashResponse(); + message.attestations = object.attestations?.map(e => AttestationInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAttestationsByHashResponse): QueryAttestationsByHashResponseAmino { const obj: any = {}; if (message.attestations) { obj.attestations = message.attestations.map(e => e ? AttestationInfo.toAmino(e) : undefined); } else { - obj.attestations = []; + obj.attestations = message.attestations; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1468,25 +1504,26 @@ export const QueryAttestationsByHashResponse = { }; function createBaseQueryResolverRequest(): QueryResolverRequest { return { - id: Long.UZERO + id: BigInt(0) }; } export const QueryResolverRequest = { - encode(message: QueryResolverRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.data.v1.QueryResolverRequest", + encode(message: QueryResolverRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolverRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolverRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolverRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1497,27 +1534,29 @@ export const QueryResolverRequest = { }, fromJSON(object: any): QueryResolverRequest { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) }; }, toJSON(message: QueryResolverRequest): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QueryResolverRequest { const message = createBaseQueryResolverRequest(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); return message; }, fromAmino(object: QueryResolverRequestAmino): QueryResolverRequest { - return { - id: Long.fromString(object.id) - }; + const message = createBaseQueryResolverRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; }, toAmino(message: QueryResolverRequest): QueryResolverRequestAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; return obj; }, fromAminoMsg(object: QueryResolverRequestAminoMsg): QueryResolverRequest { @@ -1538,18 +1577,19 @@ export const QueryResolverRequest = { }; function createBaseQueryResolverResponse(): QueryResolverResponse { return { - resolver: ResolverInfo.fromPartial({}) + resolver: undefined }; } export const QueryResolverResponse = { - encode(message: QueryResolverResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryResolverResponse", + encode(message: QueryResolverResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.resolver !== undefined) { ResolverInfo.encode(message.resolver, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolverResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolverResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolverResponse(); while (reader.pos < end) { @@ -1581,9 +1621,11 @@ export const QueryResolverResponse = { return message; }, fromAmino(object: QueryResolverResponseAmino): QueryResolverResponse { - return { - resolver: object?.resolver ? ResolverInfo.fromAmino(object.resolver) : undefined - }; + const message = createBaseQueryResolverResponse(); + if (object.resolver !== undefined && object.resolver !== null) { + message.resolver = ResolverInfo.fromAmino(object.resolver); + } + return message; }, toAmino(message: QueryResolverResponse): QueryResolverResponseAmino { const obj: any = {}; @@ -1609,11 +1651,12 @@ export const QueryResolverResponse = { function createBaseQueryResolversByIRIRequest(): QueryResolversByIRIRequest { return { iri: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryResolversByIRIRequest = { - encode(message: QueryResolversByIRIRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryResolversByIRIRequest", + encode(message: QueryResolversByIRIRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } @@ -1622,8 +1665,8 @@ export const QueryResolversByIRIRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolversByIRIRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolversByIRIRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolversByIRIRequest(); while (reader.pos < end) { @@ -1661,14 +1704,18 @@ export const QueryResolversByIRIRequest = { return message; }, fromAmino(object: QueryResolversByIRIRequestAmino): QueryResolversByIRIRequest { - return { - iri: object.iri, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryResolversByIRIRequest(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryResolversByIRIRequest): QueryResolversByIRIRequestAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1691,11 +1738,12 @@ export const QueryResolversByIRIRequest = { function createBaseQueryResolversByIRIResponse(): QueryResolversByIRIResponse { return { resolvers: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryResolversByIRIResponse = { - encode(message: QueryResolversByIRIResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryResolversByIRIResponse", + encode(message: QueryResolversByIRIResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.resolvers) { ResolverInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1704,8 +1752,8 @@ export const QueryResolversByIRIResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolversByIRIResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolversByIRIResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolversByIRIResponse(); while (reader.pos < end) { @@ -1747,17 +1795,19 @@ export const QueryResolversByIRIResponse = { return message; }, fromAmino(object: QueryResolversByIRIResponseAmino): QueryResolversByIRIResponse { - return { - resolvers: Array.isArray(object?.resolvers) ? object.resolvers.map((e: any) => ResolverInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryResolversByIRIResponse(); + message.resolvers = object.resolvers?.map(e => ResolverInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryResolversByIRIResponse): QueryResolversByIRIResponseAmino { const obj: any = {}; if (message.resolvers) { obj.resolvers = message.resolvers.map(e => e ? ResolverInfo.toAmino(e) : undefined); } else { - obj.resolvers = []; + obj.resolvers = message.resolvers; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1780,12 +1830,13 @@ export const QueryResolversByIRIResponse = { }; function createBaseQueryResolversByHashRequest(): QueryResolversByHashRequest { return { - contentHash: ContentHash.fromPartial({}), - pagination: PageRequest.fromPartial({}) + contentHash: undefined, + pagination: undefined }; } export const QueryResolversByHashRequest = { - encode(message: QueryResolversByHashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryResolversByHashRequest", + encode(message: QueryResolversByHashRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contentHash !== undefined) { ContentHash.encode(message.contentHash, writer.uint32(10).fork()).ldelim(); } @@ -1794,8 +1845,8 @@ export const QueryResolversByHashRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolversByHashRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolversByHashRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolversByHashRequest(); while (reader.pos < end) { @@ -1833,10 +1884,14 @@ export const QueryResolversByHashRequest = { return message; }, fromAmino(object: QueryResolversByHashRequestAmino): QueryResolversByHashRequest { - return { - contentHash: object?.content_hash ? ContentHash.fromAmino(object.content_hash) : undefined, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryResolversByHashRequest(); + if (object.content_hash !== undefined && object.content_hash !== null) { + message.contentHash = ContentHash.fromAmino(object.content_hash); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryResolversByHashRequest): QueryResolversByHashRequestAmino { const obj: any = {}; @@ -1863,11 +1918,12 @@ export const QueryResolversByHashRequest = { function createBaseQueryResolversByHashResponse(): QueryResolversByHashResponse { return { resolvers: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryResolversByHashResponse = { - encode(message: QueryResolversByHashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryResolversByHashResponse", + encode(message: QueryResolversByHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.resolvers) { ResolverInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1876,8 +1932,8 @@ export const QueryResolversByHashResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolversByHashResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolversByHashResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolversByHashResponse(); while (reader.pos < end) { @@ -1919,17 +1975,19 @@ export const QueryResolversByHashResponse = { return message; }, fromAmino(object: QueryResolversByHashResponseAmino): QueryResolversByHashResponse { - return { - resolvers: Array.isArray(object?.resolvers) ? object.resolvers.map((e: any) => ResolverInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryResolversByHashResponse(); + message.resolvers = object.resolvers?.map(e => ResolverInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryResolversByHashResponse): QueryResolversByHashResponseAmino { const obj: any = {}; if (message.resolvers) { obj.resolvers = message.resolvers.map(e => e ? ResolverInfo.toAmino(e) : undefined); } else { - obj.resolvers = []; + obj.resolvers = message.resolvers; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1953,11 +2011,12 @@ export const QueryResolversByHashResponse = { function createBaseQueryResolversByURLRequest(): QueryResolversByURLRequest { return { url: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryResolversByURLRequest = { - encode(message: QueryResolversByURLRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryResolversByURLRequest", + encode(message: QueryResolversByURLRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.url !== "") { writer.uint32(10).string(message.url); } @@ -1966,8 +2025,8 @@ export const QueryResolversByURLRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolversByURLRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolversByURLRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolversByURLRequest(); while (reader.pos < end) { @@ -2005,14 +2064,18 @@ export const QueryResolversByURLRequest = { return message; }, fromAmino(object: QueryResolversByURLRequestAmino): QueryResolversByURLRequest { - return { - url: object.url, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryResolversByURLRequest(); + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryResolversByURLRequest): QueryResolversByURLRequestAmino { const obj: any = {}; - obj.url = message.url; + obj.url = message.url === "" ? undefined : message.url; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2035,11 +2098,12 @@ export const QueryResolversByURLRequest = { function createBaseQueryResolversByURLResponse(): QueryResolversByURLResponse { return { resolvers: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryResolversByURLResponse = { - encode(message: QueryResolversByURLResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.QueryResolversByURLResponse", + encode(message: QueryResolversByURLResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.resolvers) { ResolverInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2048,8 +2112,8 @@ export const QueryResolversByURLResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryResolversByURLResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryResolversByURLResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResolversByURLResponse(); while (reader.pos < end) { @@ -2091,17 +2155,19 @@ export const QueryResolversByURLResponse = { return message; }, fromAmino(object: QueryResolversByURLResponseAmino): QueryResolversByURLResponse { - return { - resolvers: Array.isArray(object?.resolvers) ? object.resolvers.map((e: any) => ResolverInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryResolversByURLResponse(); + message.resolvers = object.resolvers?.map(e => ResolverInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryResolversByURLResponse): QueryResolversByURLResponseAmino { const obj: any = {}; if (message.resolvers) { obj.resolvers = message.resolvers.map(e => e ? ResolverInfo.toAmino(e) : undefined); } else { - obj.resolvers = []; + obj.resolvers = message.resolvers; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2128,14 +2194,15 @@ function createBaseConvertIRIToHashRequest(): ConvertIRIToHashRequest { }; } export const ConvertIRIToHashRequest = { - encode(message: ConvertIRIToHashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.ConvertIRIToHashRequest", + encode(message: ConvertIRIToHashRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConvertIRIToHashRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConvertIRIToHashRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConvertIRIToHashRequest(); while (reader.pos < end) { @@ -2167,13 +2234,15 @@ export const ConvertIRIToHashRequest = { return message; }, fromAmino(object: ConvertIRIToHashRequestAmino): ConvertIRIToHashRequest { - return { - iri: object.iri - }; + const message = createBaseConvertIRIToHashRequest(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + return message; }, toAmino(message: ConvertIRIToHashRequest): ConvertIRIToHashRequestAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; return obj; }, fromAminoMsg(object: ConvertIRIToHashRequestAminoMsg): ConvertIRIToHashRequest { @@ -2194,18 +2263,19 @@ export const ConvertIRIToHashRequest = { }; function createBaseConvertIRIToHashResponse(): ConvertIRIToHashResponse { return { - contentHash: ContentHash.fromPartial({}) + contentHash: undefined }; } export const ConvertIRIToHashResponse = { - encode(message: ConvertIRIToHashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.ConvertIRIToHashResponse", + encode(message: ConvertIRIToHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contentHash !== undefined) { ContentHash.encode(message.contentHash, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConvertIRIToHashResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConvertIRIToHashResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConvertIRIToHashResponse(); while (reader.pos < end) { @@ -2237,9 +2307,11 @@ export const ConvertIRIToHashResponse = { return message; }, fromAmino(object: ConvertIRIToHashResponseAmino): ConvertIRIToHashResponse { - return { - contentHash: object?.content_hash ? ContentHash.fromAmino(object.content_hash) : undefined - }; + const message = createBaseConvertIRIToHashResponse(); + if (object.content_hash !== undefined && object.content_hash !== null) { + message.contentHash = ContentHash.fromAmino(object.content_hash); + } + return message; }, toAmino(message: ConvertIRIToHashResponse): ConvertIRIToHashResponseAmino { const obj: any = {}; @@ -2264,18 +2336,19 @@ export const ConvertIRIToHashResponse = { }; function createBaseConvertHashToIRIRequest(): ConvertHashToIRIRequest { return { - contentHash: ContentHash.fromPartial({}) + contentHash: undefined }; } export const ConvertHashToIRIRequest = { - encode(message: ConvertHashToIRIRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.ConvertHashToIRIRequest", + encode(message: ConvertHashToIRIRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contentHash !== undefined) { ContentHash.encode(message.contentHash, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConvertHashToIRIRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConvertHashToIRIRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConvertHashToIRIRequest(); while (reader.pos < end) { @@ -2307,9 +2380,11 @@ export const ConvertHashToIRIRequest = { return message; }, fromAmino(object: ConvertHashToIRIRequestAmino): ConvertHashToIRIRequest { - return { - contentHash: object?.content_hash ? ContentHash.fromAmino(object.content_hash) : undefined - }; + const message = createBaseConvertHashToIRIRequest(); + if (object.content_hash !== undefined && object.content_hash !== null) { + message.contentHash = ContentHash.fromAmino(object.content_hash); + } + return message; }, toAmino(message: ConvertHashToIRIRequest): ConvertHashToIRIRequestAmino { const obj: any = {}; @@ -2338,14 +2413,15 @@ function createBaseConvertHashToIRIResponse(): ConvertHashToIRIResponse { }; } export const ConvertHashToIRIResponse = { - encode(message: ConvertHashToIRIResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.ConvertHashToIRIResponse", + encode(message: ConvertHashToIRIResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConvertHashToIRIResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConvertHashToIRIResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConvertHashToIRIResponse(); while (reader.pos < end) { @@ -2377,13 +2453,15 @@ export const ConvertHashToIRIResponse = { return message; }, fromAmino(object: ConvertHashToIRIResponseAmino): ConvertHashToIRIResponse { - return { - iri: object.iri - }; + const message = createBaseConvertHashToIRIResponse(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + return message; }, toAmino(message: ConvertHashToIRIResponse): ConvertHashToIRIResponseAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; return obj; }, fromAminoMsg(object: ConvertHashToIRIResponseAminoMsg): ConvertHashToIRIResponse { @@ -2405,12 +2483,13 @@ export const ConvertHashToIRIResponse = { function createBaseAnchorInfo(): AnchorInfo { return { iri: "", - contentHash: ContentHash.fromPartial({}), + contentHash: undefined, timestamp: undefined }; } export const AnchorInfo = { - encode(message: AnchorInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.AnchorInfo", + encode(message: AnchorInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } @@ -2422,8 +2501,8 @@ export const AnchorInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AnchorInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AnchorInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAnchorInfo(); while (reader.pos < end) { @@ -2467,15 +2546,21 @@ export const AnchorInfo = { return message; }, fromAmino(object: AnchorInfoAmino): AnchorInfo { - return { - iri: object.iri, - contentHash: object?.content_hash ? ContentHash.fromAmino(object.content_hash) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseAnchorInfo(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + if (object.content_hash !== undefined && object.content_hash !== null) { + message.contentHash = ContentHash.fromAmino(object.content_hash); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: AnchorInfo): AnchorInfoAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; obj.content_hash = message.contentHash ? ContentHash.toAmino(message.contentHash) : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; @@ -2504,7 +2589,8 @@ function createBaseAttestationInfo(): AttestationInfo { }; } export const AttestationInfo = { - encode(message: AttestationInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.AttestationInfo", + encode(message: AttestationInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } @@ -2516,8 +2602,8 @@ export const AttestationInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AttestationInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AttestationInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAttestationInfo(); while (reader.pos < end) { @@ -2561,16 +2647,22 @@ export const AttestationInfo = { return message; }, fromAmino(object: AttestationInfoAmino): AttestationInfo { - return { - iri: object.iri, - attestor: object.attestor, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseAttestationInfo(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + if (object.attestor !== undefined && object.attestor !== null) { + message.attestor = object.attestor; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: AttestationInfo): AttestationInfoAmino { const obj: any = {}; - obj.iri = message.iri; - obj.attestor = message.attestor; + obj.iri = message.iri === "" ? undefined : message.iri; + obj.attestor = message.attestor === "" ? undefined : message.attestor; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; }, @@ -2592,14 +2684,15 @@ export const AttestationInfo = { }; function createBaseResolverInfo(): ResolverInfo { return { - id: Long.UZERO, + id: BigInt(0), url: "", manager: "" }; } export const ResolverInfo = { - encode(message: ResolverInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.data.v1.ResolverInfo", + encode(message: ResolverInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.url !== "") { @@ -2610,15 +2703,15 @@ export const ResolverInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResolverInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResolverInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResolverInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.url = reader.string(); @@ -2635,37 +2728,43 @@ export const ResolverInfo = { }, fromJSON(object: any): ResolverInfo { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), url: isSet(object.url) ? String(object.url) : "", manager: isSet(object.manager) ? String(object.manager) : "" }; }, toJSON(message: ResolverInfo): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.url !== undefined && (obj.url = message.url); message.manager !== undefined && (obj.manager = message.manager); return obj; }, fromPartial(object: Partial): ResolverInfo { const message = createBaseResolverInfo(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.url = object.url ?? ""; message.manager = object.manager ?? ""; return message; }, fromAmino(object: ResolverInfoAmino): ResolverInfo { - return { - id: Long.fromString(object.id), - url: object.url, - manager: object.manager - }; + const message = createBaseResolverInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } + if (object.manager !== undefined && object.manager !== null) { + message.manager = object.manager; + } + return message; }, toAmino(message: ResolverInfo): ResolverInfoAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.url = message.url; - obj.manager = message.manager; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.url = message.url === "" ? undefined : message.url; + obj.manager = message.manager === "" ? undefined : message.manager; return obj; }, fromAminoMsg(object: ResolverInfoAminoMsg): ResolverInfo { diff --git a/packages/api/src/codegen/regen/data/v1/state.ts b/packages/api/src/codegen/regen/data/v1/state.ts index 4c998340..c044e0d7 100644 --- a/packages/api/src/codegen/regen/data/v1/state.ts +++ b/packages/api/src/codegen/regen/data/v1/state.ts @@ -1,6 +1,6 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Long, isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** DataID stores a compact data ID and its full IRI. */ export interface DataID { /** id is the compact automatically-generated data ID. */ @@ -15,9 +15,9 @@ export interface DataIDProtoMsg { /** DataID stores a compact data ID and its full IRI. */ export interface DataIDAmino { /** id is the compact automatically-generated data ID. */ - id: Uint8Array; + id?: string; /** iri is the IRI of the data which contains its full ContentHash. */ - iri: string; + iri?: string; } export interface DataIDAminoMsg { type: "/regen.data.v1.DataID"; @@ -36,7 +36,7 @@ export interface DataAnchor { * timestamp is the anchor timestamp for this object - the time at which * it was first known to the blockchain. */ - timestamp: Timestamp; + timestamp?: Timestamp; } export interface DataAnchorProtoMsg { typeUrl: "/regen.data.v1.DataAnchor"; @@ -45,12 +45,12 @@ export interface DataAnchorProtoMsg { /** DataAnchor stores the anchor timestamp for a data object. */ export interface DataAnchorAmino { /** id is the compact data ID. */ - id: Uint8Array; + id?: string; /** * timestamp is the anchor timestamp for this object - the time at which * it was first known to the blockchain. */ - timestamp?: TimestampAmino; + timestamp?: string; } export interface DataAnchorAminoMsg { type: "/regen.data.v1.DataAnchor"; @@ -59,7 +59,7 @@ export interface DataAnchorAminoMsg { /** DataAnchor stores the anchor timestamp for a data object. */ export interface DataAnchorSDKType { id: Uint8Array; - timestamp: TimestampSDKType; + timestamp?: TimestampSDKType; } /** DataAttestor is a join table for associating data IDs and attestors. */ export interface DataAttestor { @@ -68,7 +68,7 @@ export interface DataAttestor { /** attestor is the account address of the attestor. */ attestor: Uint8Array; /** timestamp is the time at which the attestor signed this data object. */ - timestamp: Timestamp; + timestamp?: Timestamp; } export interface DataAttestorProtoMsg { typeUrl: "/regen.data.v1.DataAttestor"; @@ -77,11 +77,11 @@ export interface DataAttestorProtoMsg { /** DataAttestor is a join table for associating data IDs and attestors. */ export interface DataAttestorAmino { /** id is the compact data ID. */ - id: Uint8Array; + id?: string; /** attestor is the account address of the attestor. */ - attestor: Uint8Array; + attestor?: string; /** timestamp is the time at which the attestor signed this data object. */ - timestamp?: TimestampAmino; + timestamp?: string; } export interface DataAttestorAminoMsg { type: "/regen.data.v1.DataAttestor"; @@ -91,12 +91,12 @@ export interface DataAttestorAminoMsg { export interface DataAttestorSDKType { id: Uint8Array; attestor: Uint8Array; - timestamp: TimestampSDKType; + timestamp?: TimestampSDKType; } /** Resolver describes a data resolver. */ export interface Resolver { /** id is the ID of the resolver. */ - id: Long; + id: bigint; /** url is the URL of the resolver. */ url: string; /** @@ -112,14 +112,14 @@ export interface ResolverProtoMsg { /** Resolver describes a data resolver. */ export interface ResolverAmino { /** id is the ID of the resolver. */ - id: string; + id?: string; /** url is the URL of the resolver. */ - url: string; + url?: string; /** * manager is the bytes address of the resolver manager who is allowed * to make calls to Msg/RegisterResolver for this resolver. */ - manager: Uint8Array; + manager?: string; } export interface ResolverAminoMsg { type: "/regen.data.v1.Resolver"; @@ -127,7 +127,7 @@ export interface ResolverAminoMsg { } /** Resolver describes a data resolver. */ export interface ResolverSDKType { - id: Long; + id: bigint; url: string; manager: Uint8Array; } @@ -139,7 +139,7 @@ export interface DataResolver { /** id is the compact data ID. */ id: Uint8Array; /** resolver_id is the ID of the resolver. */ - resolverId: Long; + resolverId: bigint; } export interface DataResolverProtoMsg { typeUrl: "/regen.data.v1.DataResolver"; @@ -151,9 +151,9 @@ export interface DataResolverProtoMsg { */ export interface DataResolverAmino { /** id is the compact data ID. */ - id: Uint8Array; + id?: string; /** resolver_id is the ID of the resolver. */ - resolver_id: string; + resolver_id?: string; } export interface DataResolverAminoMsg { type: "/regen.data.v1.DataResolver"; @@ -165,7 +165,7 @@ export interface DataResolverAminoMsg { */ export interface DataResolverSDKType { id: Uint8Array; - resolver_id: Long; + resolver_id: bigint; } function createBaseDataID(): DataID { return { @@ -174,7 +174,8 @@ function createBaseDataID(): DataID { }; } export const DataID = { - encode(message: DataID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.DataID", + encode(message: DataID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id.length !== 0) { writer.uint32(10).bytes(message.id); } @@ -183,8 +184,8 @@ export const DataID = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DataID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DataID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDataID(); while (reader.pos < end) { @@ -222,15 +223,19 @@ export const DataID = { return message; }, fromAmino(object: DataIDAmino): DataID { - return { - id: object.id, - iri: object.iri - }; + const message = createBaseDataID(); + if (object.id !== undefined && object.id !== null) { + message.id = bytesFromBase64(object.id); + } + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + return message; }, toAmino(message: DataID): DataIDAmino { const obj: any = {}; - obj.id = message.id; - obj.iri = message.iri; + obj.id = message.id ? base64FromBytes(message.id) : undefined; + obj.iri = message.iri === "" ? undefined : message.iri; return obj; }, fromAminoMsg(object: DataIDAminoMsg): DataID { @@ -256,7 +261,8 @@ function createBaseDataAnchor(): DataAnchor { }; } export const DataAnchor = { - encode(message: DataAnchor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.DataAnchor", + encode(message: DataAnchor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id.length !== 0) { writer.uint32(10).bytes(message.id); } @@ -265,8 +271,8 @@ export const DataAnchor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DataAnchor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DataAnchor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDataAnchor(); while (reader.pos < end) { @@ -304,14 +310,18 @@ export const DataAnchor = { return message; }, fromAmino(object: DataAnchorAmino): DataAnchor { - return { - id: object.id, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseDataAnchor(); + if (object.id !== undefined && object.id !== null) { + message.id = bytesFromBase64(object.id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: DataAnchor): DataAnchorAmino { const obj: any = {}; - obj.id = message.id; + obj.id = message.id ? base64FromBytes(message.id) : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; }, @@ -339,7 +349,8 @@ function createBaseDataAttestor(): DataAttestor { }; } export const DataAttestor = { - encode(message: DataAttestor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.DataAttestor", + encode(message: DataAttestor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id.length !== 0) { writer.uint32(10).bytes(message.id); } @@ -351,8 +362,8 @@ export const DataAttestor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DataAttestor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DataAttestor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDataAttestor(); while (reader.pos < end) { @@ -396,16 +407,22 @@ export const DataAttestor = { return message; }, fromAmino(object: DataAttestorAmino): DataAttestor { - return { - id: object.id, - attestor: object.attestor, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseDataAttestor(); + if (object.id !== undefined && object.id !== null) { + message.id = bytesFromBase64(object.id); + } + if (object.attestor !== undefined && object.attestor !== null) { + message.attestor = bytesFromBase64(object.attestor); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: DataAttestor): DataAttestorAmino { const obj: any = {}; - obj.id = message.id; - obj.attestor = message.attestor; + obj.id = message.id ? base64FromBytes(message.id) : undefined; + obj.attestor = message.attestor ? base64FromBytes(message.attestor) : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; }, @@ -427,14 +444,15 @@ export const DataAttestor = { }; function createBaseResolver(): Resolver { return { - id: Long.UZERO, + id: BigInt(0), url: "", manager: new Uint8Array() }; } export const Resolver = { - encode(message: Resolver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.data.v1.Resolver", + encode(message: Resolver, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.url !== "") { @@ -445,15 +463,15 @@ export const Resolver = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Resolver { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Resolver { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResolver(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.url = reader.string(); @@ -470,37 +488,43 @@ export const Resolver = { }, fromJSON(object: any): Resolver { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), url: isSet(object.url) ? String(object.url) : "", manager: isSet(object.manager) ? bytesFromBase64(object.manager) : new Uint8Array() }; }, toJSON(message: Resolver): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.url !== undefined && (obj.url = message.url); message.manager !== undefined && (obj.manager = base64FromBytes(message.manager !== undefined ? message.manager : new Uint8Array())); return obj; }, fromPartial(object: Partial): Resolver { const message = createBaseResolver(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.url = object.url ?? ""; message.manager = object.manager ?? new Uint8Array(); return message; }, fromAmino(object: ResolverAmino): Resolver { - return { - id: Long.fromString(object.id), - url: object.url, - manager: object.manager - }; + const message = createBaseResolver(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } + if (object.manager !== undefined && object.manager !== null) { + message.manager = bytesFromBase64(object.manager); + } + return message; }, toAmino(message: Resolver): ResolverAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.url = message.url; - obj.manager = message.manager; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.url = message.url === "" ? undefined : message.url; + obj.manager = message.manager ? base64FromBytes(message.manager) : undefined; return obj; }, fromAminoMsg(object: ResolverAminoMsg): Resolver { @@ -522,21 +546,22 @@ export const Resolver = { function createBaseDataResolver(): DataResolver { return { id: new Uint8Array(), - resolverId: Long.UZERO + resolverId: BigInt(0) }; } export const DataResolver = { - encode(message: DataResolver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.DataResolver", + encode(message: DataResolver, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id.length !== 0) { writer.uint32(10).bytes(message.id); } - if (!message.resolverId.isZero()) { + if (message.resolverId !== BigInt(0)) { writer.uint32(16).uint64(message.resolverId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DataResolver { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DataResolver { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDataResolver(); while (reader.pos < end) { @@ -546,7 +571,7 @@ export const DataResolver = { message.id = reader.bytes(); break; case 2: - message.resolverId = (reader.uint64() as Long); + message.resolverId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -558,31 +583,35 @@ export const DataResolver = { fromJSON(object: any): DataResolver { return { id: isSet(object.id) ? bytesFromBase64(object.id) : new Uint8Array(), - resolverId: isSet(object.resolverId) ? Long.fromValue(object.resolverId) : Long.UZERO + resolverId: isSet(object.resolverId) ? BigInt(object.resolverId.toString()) : BigInt(0) }; }, toJSON(message: DataResolver): unknown { const obj: any = {}; message.id !== undefined && (obj.id = base64FromBytes(message.id !== undefined ? message.id : new Uint8Array())); - message.resolverId !== undefined && (obj.resolverId = (message.resolverId || Long.UZERO).toString()); + message.resolverId !== undefined && (obj.resolverId = (message.resolverId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): DataResolver { const message = createBaseDataResolver(); message.id = object.id ?? new Uint8Array(); - message.resolverId = object.resolverId !== undefined && object.resolverId !== null ? Long.fromValue(object.resolverId) : Long.UZERO; + message.resolverId = object.resolverId !== undefined && object.resolverId !== null ? BigInt(object.resolverId.toString()) : BigInt(0); return message; }, fromAmino(object: DataResolverAmino): DataResolver { - return { - id: object.id, - resolverId: Long.fromString(object.resolver_id) - }; + const message = createBaseDataResolver(); + if (object.id !== undefined && object.id !== null) { + message.id = bytesFromBase64(object.id); + } + if (object.resolver_id !== undefined && object.resolver_id !== null) { + message.resolverId = BigInt(object.resolver_id); + } + return message; }, toAmino(message: DataResolver): DataResolverAmino { const obj: any = {}; - obj.id = message.id; - obj.resolver_id = message.resolverId ? message.resolverId.toString() : undefined; + obj.id = message.id ? base64FromBytes(message.id) : undefined; + obj.resolver_id = message.resolverId !== BigInt(0) ? message.resolverId.toString() : undefined; return obj; }, fromAminoMsg(object: DataResolverAminoMsg): DataResolver { diff --git a/packages/api/src/codegen/regen/data/v1/tx.rpc.msg.ts b/packages/api/src/codegen/regen/data/v1/tx.rpc.msg.ts index 89b424bc..9aa16713 100644 --- a/packages/api/src/codegen/regen/data/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/regen/data/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgAnchor, MsgAnchorResponse, MsgAttest, MsgAttestResponse, MsgDefineResolver, MsgDefineResolverResponse, MsgRegisterResolver, MsgRegisterResolverResponse } from "./tx"; /** Msg is the regen.data.v1 Msg service */ export interface Msg { @@ -58,21 +58,21 @@ export class MsgClientImpl implements Msg { anchor(request: MsgAnchor): Promise { const data = MsgAnchor.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Msg", "Anchor", data); - return promise.then(data => MsgAnchorResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgAnchorResponse.decode(new BinaryReader(data))); } attest(request: MsgAttest): Promise { const data = MsgAttest.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Msg", "Attest", data); - return promise.then(data => MsgAttestResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgAttestResponse.decode(new BinaryReader(data))); } defineResolver(request: MsgDefineResolver): Promise { const data = MsgDefineResolver.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Msg", "DefineResolver", data); - return promise.then(data => MsgDefineResolverResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgDefineResolverResponse.decode(new BinaryReader(data))); } registerResolver(request: MsgRegisterResolver): Promise { const data = MsgRegisterResolver.encode(request).finish(); const promise = this.rpc.request("regen.data.v1.Msg", "RegisterResolver", data); - return promise.then(data => MsgRegisterResolverResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRegisterResolverResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/regen/data/v1/tx.ts b/packages/api/src/codegen/regen/data/v1/tx.ts index 6a489f18..7c89be14 100644 --- a/packages/api/src/codegen/regen/data/v1/tx.ts +++ b/packages/api/src/codegen/regen/data/v1/tx.ts @@ -1,7 +1,7 @@ import { ContentHash, ContentHashAmino, ContentHashSDKType, ContentHash_Graph } from "./types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** MsgAnchor is the Msg/Anchor request type. */ export interface MsgAnchor { /** @@ -11,7 +11,7 @@ export interface MsgAnchor { */ sender: string; /** content_hash is the content hash for the data to anchor. */ - contentHash: ContentHash; + contentHash?: ContentHash; } export interface MsgAnchorProtoMsg { typeUrl: "/regen.data.v1.MsgAnchor"; @@ -24,7 +24,7 @@ export interface MsgAnchorAmino { * Anchor is not attesting to the veracity of the underlying data. They * can simply be an intermediary providing services. */ - sender: string; + sender?: string; /** content_hash is the content hash for the data to anchor. */ content_hash?: ContentHashAmino; } @@ -35,14 +35,14 @@ export interface MsgAnchorAminoMsg { /** MsgAnchor is the Msg/Anchor request type. */ export interface MsgAnchorSDKType { sender: string; - content_hash: ContentHashSDKType; + content_hash?: ContentHashSDKType; } /** MsgAnchor is the Msg/Anchor response type. */ export interface MsgAnchorResponse { /** iri is the IRI of the data that was anchored. */ iri: string; /** timestamp is the time at which the data was anchored. */ - timestamp: Timestamp; + timestamp?: Timestamp; } export interface MsgAnchorResponseProtoMsg { typeUrl: "/regen.data.v1.MsgAnchorResponse"; @@ -51,9 +51,9 @@ export interface MsgAnchorResponseProtoMsg { /** MsgAnchor is the Msg/Anchor response type. */ export interface MsgAnchorResponseAmino { /** iri is the IRI of the data that was anchored. */ - iri: string; + iri?: string; /** timestamp is the time at which the data was anchored. */ - timestamp?: TimestampAmino; + timestamp?: string; } export interface MsgAnchorResponseAminoMsg { type: "/regen.data.v1.MsgAnchorResponse"; @@ -62,7 +62,7 @@ export interface MsgAnchorResponseAminoMsg { /** MsgAnchor is the Msg/Anchor response type. */ export interface MsgAnchorResponseSDKType { iri: string; - timestamp: TimestampSDKType; + timestamp?: TimestampSDKType; } /** MsgAttest is the Msg/Attest request type. */ export interface MsgAttest { @@ -92,13 +92,13 @@ export interface MsgAttestAmino { * veracity of the data referenced by the IRI. The precise meaning of this may * vary depending on the underlying data. */ - attestor: string; + attestor?: string; /** * content_hashes are the content hashes for anchored data. Only RDF graph * data can be signed as its data model is intended to specifically convey * semantic meaning. */ - content_hashes: ContentHash_GraphAmino[]; + content_hashes?: ContentHash_GraphAmino[]; } export interface MsgAttestAminoMsg { type: "regen-ledger/MsgAttest"; @@ -118,7 +118,7 @@ export interface MsgAttestResponse { */ iris: string[]; /** timestamp is the time at which any new attestations were made. */ - timestamp: Timestamp; + timestamp?: Timestamp; } export interface MsgAttestResponseProtoMsg { typeUrl: "/regen.data.v1.MsgAttestResponse"; @@ -131,9 +131,9 @@ export interface MsgAttestResponseAmino { * to the same piece of data, the previous attestation will not be updated and * the IRI will not be included in this list. */ - iris: string[]; + iris?: string[]; /** timestamp is the time at which any new attestations were made. */ - timestamp?: TimestampAmino; + timestamp?: string; } export interface MsgAttestResponseAminoMsg { type: "/regen.data.v1.MsgAttestResponse"; @@ -142,7 +142,7 @@ export interface MsgAttestResponseAminoMsg { /** MsgAttestResponse is the Msg/Attest response type. */ export interface MsgAttestResponseSDKType { iris: string[]; - timestamp: TimestampSDKType; + timestamp?: TimestampSDKType; } /** MsgDefineResolver is the Msg/DefineResolver request type. */ export interface MsgDefineResolver { @@ -174,7 +174,7 @@ export interface MsgDefineResolverAmino { * Msg/RegisterResolver. To authorize other accounts to register resolvers, * the manager should make use of cosmos.authz. */ - manager: string; + manager?: string; /** * resolver_url is a resolver URL which should refer to an HTTP service * which will respond to a GET request with the IRI of a ContentHash @@ -182,7 +182,7 @@ export interface MsgDefineResolverAmino { * should use the HTTP Accept header to negotiate the RDF serialization * format. */ - resolver_url: string; + resolver_url?: string; } export interface MsgDefineResolverAminoMsg { type: "regen-ledger/MsgDefineResolver"; @@ -199,7 +199,7 @@ export interface MsgDefineResolverResponse { * resolver_id is the integer ID of the resolver to be used in * MsgRegisterResolver. */ - resolverId: Long; + resolverId: bigint; } export interface MsgDefineResolverResponseProtoMsg { typeUrl: "/regen.data.v1.MsgDefineResolverResponse"; @@ -211,7 +211,7 @@ export interface MsgDefineResolverResponseAmino { * resolver_id is the integer ID of the resolver to be used in * MsgRegisterResolver. */ - resolver_id: string; + resolver_id?: string; } export interface MsgDefineResolverResponseAminoMsg { type: "/regen.data.v1.MsgDefineResolverResponse"; @@ -219,7 +219,7 @@ export interface MsgDefineResolverResponseAminoMsg { } /** MsgDefineResolverResponse is the Msg/DefineResolver response type. */ export interface MsgDefineResolverResponseSDKType { - resolver_id: Long; + resolver_id: bigint; } /** MsgRegisterResolver is the Msg/RegisterResolver request type. */ export interface MsgRegisterResolver { @@ -229,7 +229,7 @@ export interface MsgRegisterResolver { */ manager: string; /** resolver_id is the ID of a resolver defined with Msg/DefineResolver. */ - resolverId: Long; + resolverId: bigint; /** * content_hashes is a list of content hashes which the resolver claims to * serve. @@ -246,14 +246,14 @@ export interface MsgRegisterResolverAmino { * manager is the address of the resolver manager who registered this * resolver with Msg/DefinedResolver. */ - manager: string; + manager?: string; /** resolver_id is the ID of a resolver defined with Msg/DefineResolver. */ - resolver_id: string; + resolver_id?: string; /** * content_hashes is a list of content hashes which the resolver claims to * serve. */ - content_hashes: ContentHashAmino[]; + content_hashes?: ContentHashAmino[]; } export interface MsgRegisterResolverAminoMsg { type: "regen-ledger/MsgRegisterResolver"; @@ -262,7 +262,7 @@ export interface MsgRegisterResolverAminoMsg { /** MsgRegisterResolver is the Msg/RegisterResolver request type. */ export interface MsgRegisterResolverSDKType { manager: string; - resolver_id: Long; + resolver_id: bigint; content_hashes: ContentHashSDKType[]; } /** MsgRegisterResolverResponse is the Msg/RegisterResolver response type. */ @@ -282,11 +282,12 @@ export interface MsgRegisterResolverResponseSDKType {} function createBaseMsgAnchor(): MsgAnchor { return { sender: "", - contentHash: ContentHash.fromPartial({}) + contentHash: undefined }; } export const MsgAnchor = { - encode(message: MsgAnchor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.MsgAnchor", + encode(message: MsgAnchor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -295,8 +296,8 @@ export const MsgAnchor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAnchor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAnchor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAnchor(); while (reader.pos < end) { @@ -334,14 +335,18 @@ export const MsgAnchor = { return message; }, fromAmino(object: MsgAnchorAmino): MsgAnchor { - return { - sender: object.sender, - contentHash: object?.content_hash ? ContentHash.fromAmino(object.content_hash) : undefined - }; + const message = createBaseMsgAnchor(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.content_hash !== undefined && object.content_hash !== null) { + message.contentHash = ContentHash.fromAmino(object.content_hash); + } + return message; }, toAmino(message: MsgAnchor): MsgAnchorAmino { const obj: any = {}; - obj.sender = message.sender; + obj.sender = message.sender === "" ? undefined : message.sender; obj.content_hash = message.contentHash ? ContentHash.toAmino(message.contentHash) : undefined; return obj; }, @@ -374,7 +379,8 @@ function createBaseMsgAnchorResponse(): MsgAnchorResponse { }; } export const MsgAnchorResponse = { - encode(message: MsgAnchorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.MsgAnchorResponse", + encode(message: MsgAnchorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.iri !== "") { writer.uint32(10).string(message.iri); } @@ -383,8 +389,8 @@ export const MsgAnchorResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAnchorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAnchorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAnchorResponse(); while (reader.pos < end) { @@ -422,14 +428,18 @@ export const MsgAnchorResponse = { return message; }, fromAmino(object: MsgAnchorResponseAmino): MsgAnchorResponse { - return { - iri: object.iri, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseMsgAnchorResponse(); + if (object.iri !== undefined && object.iri !== null) { + message.iri = object.iri; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: MsgAnchorResponse): MsgAnchorResponseAmino { const obj: any = {}; - obj.iri = message.iri; + obj.iri = message.iri === "" ? undefined : message.iri; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; }, @@ -456,7 +466,8 @@ function createBaseMsgAttest(): MsgAttest { }; } export const MsgAttest = { - encode(message: MsgAttest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.MsgAttest", + encode(message: MsgAttest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.attestor !== "") { writer.uint32(10).string(message.attestor); } @@ -465,8 +476,8 @@ export const MsgAttest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAttest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAttest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAttest(); while (reader.pos < end) { @@ -508,18 +519,20 @@ export const MsgAttest = { return message; }, fromAmino(object: MsgAttestAmino): MsgAttest { - return { - attestor: object.attestor, - contentHashes: Array.isArray(object?.content_hashes) ? object.content_hashes.map((e: any) => ContentHash_Graph.fromAmino(e)) : [] - }; + const message = createBaseMsgAttest(); + if (object.attestor !== undefined && object.attestor !== null) { + message.attestor = object.attestor; + } + message.contentHashes = object.content_hashes?.map(e => ContentHash_Graph.fromAmino(e)) || []; + return message; }, toAmino(message: MsgAttest): MsgAttestAmino { const obj: any = {}; - obj.attestor = message.attestor; + obj.attestor = message.attestor === "" ? undefined : message.attestor; if (message.contentHashes) { obj.content_hashes = message.contentHashes.map(e => e ? ContentHash_Graph.toAmino(e) : undefined); } else { - obj.content_hashes = []; + obj.content_hashes = message.contentHashes; } return obj; }, @@ -552,7 +565,8 @@ function createBaseMsgAttestResponse(): MsgAttestResponse { }; } export const MsgAttestResponse = { - encode(message: MsgAttestResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.MsgAttestResponse", + encode(message: MsgAttestResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.iris) { writer.uint32(10).string(v!); } @@ -561,8 +575,8 @@ export const MsgAttestResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAttestResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAttestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAttestResponse(); while (reader.pos < end) { @@ -604,17 +618,19 @@ export const MsgAttestResponse = { return message; }, fromAmino(object: MsgAttestResponseAmino): MsgAttestResponse { - return { - iris: Array.isArray(object?.iris) ? object.iris.map((e: any) => e) : [], - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseMsgAttestResponse(); + message.iris = object.iris?.map(e => e) || []; + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: MsgAttestResponse): MsgAttestResponseAmino { const obj: any = {}; if (message.iris) { obj.iris = message.iris.map(e => e); } else { - obj.iris = []; + obj.iris = message.iris; } obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; @@ -642,7 +658,8 @@ function createBaseMsgDefineResolver(): MsgDefineResolver { }; } export const MsgDefineResolver = { - encode(message: MsgDefineResolver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.MsgDefineResolver", + encode(message: MsgDefineResolver, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.manager !== "") { writer.uint32(10).string(message.manager); } @@ -651,8 +668,8 @@ export const MsgDefineResolver = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDefineResolver { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDefineResolver { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDefineResolver(); while (reader.pos < end) { @@ -690,15 +707,19 @@ export const MsgDefineResolver = { return message; }, fromAmino(object: MsgDefineResolverAmino): MsgDefineResolver { - return { - manager: object.manager, - resolverUrl: object.resolver_url - }; + const message = createBaseMsgDefineResolver(); + if (object.manager !== undefined && object.manager !== null) { + message.manager = object.manager; + } + if (object.resolver_url !== undefined && object.resolver_url !== null) { + message.resolverUrl = object.resolver_url; + } + return message; }, toAmino(message: MsgDefineResolver): MsgDefineResolverAmino { const obj: any = {}; - obj.manager = message.manager; - obj.resolver_url = message.resolverUrl; + obj.manager = message.manager === "" ? undefined : message.manager; + obj.resolver_url = message.resolverUrl === "" ? undefined : message.resolverUrl; return obj; }, fromAminoMsg(object: MsgDefineResolverAminoMsg): MsgDefineResolver { @@ -725,25 +746,26 @@ export const MsgDefineResolver = { }; function createBaseMsgDefineResolverResponse(): MsgDefineResolverResponse { return { - resolverId: Long.UZERO + resolverId: BigInt(0) }; } export const MsgDefineResolverResponse = { - encode(message: MsgDefineResolverResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.resolverId.isZero()) { + typeUrl: "/regen.data.v1.MsgDefineResolverResponse", + encode(message: MsgDefineResolverResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.resolverId !== BigInt(0)) { writer.uint32(8).uint64(message.resolverId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDefineResolverResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDefineResolverResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDefineResolverResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resolverId = (reader.uint64() as Long); + message.resolverId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -754,27 +776,29 @@ export const MsgDefineResolverResponse = { }, fromJSON(object: any): MsgDefineResolverResponse { return { - resolverId: isSet(object.resolverId) ? Long.fromValue(object.resolverId) : Long.UZERO + resolverId: isSet(object.resolverId) ? BigInt(object.resolverId.toString()) : BigInt(0) }; }, toJSON(message: MsgDefineResolverResponse): unknown { const obj: any = {}; - message.resolverId !== undefined && (obj.resolverId = (message.resolverId || Long.UZERO).toString()); + message.resolverId !== undefined && (obj.resolverId = (message.resolverId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgDefineResolverResponse { const message = createBaseMsgDefineResolverResponse(); - message.resolverId = object.resolverId !== undefined && object.resolverId !== null ? Long.fromValue(object.resolverId) : Long.UZERO; + message.resolverId = object.resolverId !== undefined && object.resolverId !== null ? BigInt(object.resolverId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgDefineResolverResponseAmino): MsgDefineResolverResponse { - return { - resolverId: Long.fromString(object.resolver_id) - }; + const message = createBaseMsgDefineResolverResponse(); + if (object.resolver_id !== undefined && object.resolver_id !== null) { + message.resolverId = BigInt(object.resolver_id); + } + return message; }, toAmino(message: MsgDefineResolverResponse): MsgDefineResolverResponseAmino { const obj: any = {}; - obj.resolver_id = message.resolverId ? message.resolverId.toString() : undefined; + obj.resolver_id = message.resolverId !== BigInt(0) ? message.resolverId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgDefineResolverResponseAminoMsg): MsgDefineResolverResponse { @@ -796,16 +820,17 @@ export const MsgDefineResolverResponse = { function createBaseMsgRegisterResolver(): MsgRegisterResolver { return { manager: "", - resolverId: Long.UZERO, + resolverId: BigInt(0), contentHashes: [] }; } export const MsgRegisterResolver = { - encode(message: MsgRegisterResolver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.MsgRegisterResolver", + encode(message: MsgRegisterResolver, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.manager !== "") { writer.uint32(10).string(message.manager); } - if (!message.resolverId.isZero()) { + if (message.resolverId !== BigInt(0)) { writer.uint32(16).uint64(message.resolverId); } for (const v of message.contentHashes) { @@ -813,8 +838,8 @@ export const MsgRegisterResolver = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterResolver { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterResolver { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterResolver(); while (reader.pos < end) { @@ -824,7 +849,7 @@ export const MsgRegisterResolver = { message.manager = reader.string(); break; case 2: - message.resolverId = (reader.uint64() as Long); + message.resolverId = reader.uint64(); break; case 3: message.contentHashes.push(ContentHash.decode(reader, reader.uint32())); @@ -839,14 +864,14 @@ export const MsgRegisterResolver = { fromJSON(object: any): MsgRegisterResolver { return { manager: isSet(object.manager) ? String(object.manager) : "", - resolverId: isSet(object.resolverId) ? Long.fromValue(object.resolverId) : Long.UZERO, + resolverId: isSet(object.resolverId) ? BigInt(object.resolverId.toString()) : BigInt(0), contentHashes: Array.isArray(object?.contentHashes) ? object.contentHashes.map((e: any) => ContentHash.fromJSON(e)) : [] }; }, toJSON(message: MsgRegisterResolver): unknown { const obj: any = {}; message.manager !== undefined && (obj.manager = message.manager); - message.resolverId !== undefined && (obj.resolverId = (message.resolverId || Long.UZERO).toString()); + message.resolverId !== undefined && (obj.resolverId = (message.resolverId || BigInt(0)).toString()); if (message.contentHashes) { obj.contentHashes = message.contentHashes.map(e => e ? ContentHash.toJSON(e) : undefined); } else { @@ -857,25 +882,29 @@ export const MsgRegisterResolver = { fromPartial(object: Partial): MsgRegisterResolver { const message = createBaseMsgRegisterResolver(); message.manager = object.manager ?? ""; - message.resolverId = object.resolverId !== undefined && object.resolverId !== null ? Long.fromValue(object.resolverId) : Long.UZERO; + message.resolverId = object.resolverId !== undefined && object.resolverId !== null ? BigInt(object.resolverId.toString()) : BigInt(0); message.contentHashes = object.contentHashes?.map(e => ContentHash.fromPartial(e)) || []; return message; }, fromAmino(object: MsgRegisterResolverAmino): MsgRegisterResolver { - return { - manager: object.manager, - resolverId: Long.fromString(object.resolver_id), - contentHashes: Array.isArray(object?.content_hashes) ? object.content_hashes.map((e: any) => ContentHash.fromAmino(e)) : [] - }; + const message = createBaseMsgRegisterResolver(); + if (object.manager !== undefined && object.manager !== null) { + message.manager = object.manager; + } + if (object.resolver_id !== undefined && object.resolver_id !== null) { + message.resolverId = BigInt(object.resolver_id); + } + message.contentHashes = object.content_hashes?.map(e => ContentHash.fromAmino(e)) || []; + return message; }, toAmino(message: MsgRegisterResolver): MsgRegisterResolverAmino { const obj: any = {}; - obj.manager = message.manager; - obj.resolver_id = message.resolverId ? message.resolverId.toString() : undefined; + obj.manager = message.manager === "" ? undefined : message.manager; + obj.resolver_id = message.resolverId !== BigInt(0) ? message.resolverId.toString() : undefined; if (message.contentHashes) { obj.content_hashes = message.contentHashes.map(e => e ? ContentHash.toAmino(e) : undefined); } else { - obj.content_hashes = []; + obj.content_hashes = message.contentHashes; } return obj; }, @@ -905,11 +934,12 @@ function createBaseMsgRegisterResolverResponse(): MsgRegisterResolverResponse { return {}; } export const MsgRegisterResolverResponse = { - encode(_: MsgRegisterResolverResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.MsgRegisterResolverResponse", + encode(_: MsgRegisterResolverResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterResolverResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterResolverResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterResolverResponse(); while (reader.pos < end) { @@ -934,7 +964,8 @@ export const MsgRegisterResolverResponse = { return message; }, fromAmino(_: MsgRegisterResolverResponseAmino): MsgRegisterResolverResponse { - return {}; + const message = createBaseMsgRegisterResolverResponse(); + return message; }, toAmino(_: MsgRegisterResolverResponse): MsgRegisterResolverResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/data/v1/types.ts b/packages/api/src/codegen/regen/data/v1/types.ts index 29ee6e3a..eb9a6c28 100644 --- a/packages/api/src/codegen/regen/data/v1/types.ts +++ b/packages/api/src/codegen/regen/data/v1/types.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** DigestAlgorithm is the hash digest algorithm */ export enum DigestAlgorithm { @@ -256,13 +256,13 @@ export interface ContentHash { * the guarantee that the canonical hash will not change. The media type for * "raw" data is defined by the MediaType enum. */ - raw: ContentHash_Raw; + raw?: ContentHash_Raw; /** * Graph specifies graph data that conforms to the RDF data model. * The canonicalization algorithm used for an RDF graph is specified by * GraphCanonicalizationAlgorithm. */ - graph: ContentHash_Graph; + graph?: ContentHash_Graph; } export interface ContentHashProtoMsg { typeUrl: "/regen.data.v1.ContentHash"; @@ -293,8 +293,8 @@ export interface ContentHashAminoMsg { } /** ContentHash specifies a hash-based content identifier for a piece of data. */ export interface ContentHashSDKType { - raw: ContentHash_RawSDKType; - graph: ContentHash_GraphSDKType; + raw?: ContentHash_RawSDKType; + graph?: ContentHash_GraphSDKType; } /** Raw is the content hash type used for raw data. */ export interface ContentHash_Raw { @@ -318,11 +318,11 @@ export interface ContentHash_RawAmino { * hash represents the hash of the data based on the specified * digest_algorithm. */ - hash: Uint8Array; + hash?: string; /** digest_algorithm represents the hash digest algorithm. */ - digest_algorithm: DigestAlgorithm; + digest_algorithm?: DigestAlgorithm; /** media_type represents the media type for raw data. */ - media_type: RawMediaType; + media_type?: RawMediaType; } export interface ContentHash_RawAminoMsg { type: "/regen.data.v1.Raw"; @@ -361,16 +361,16 @@ export interface ContentHash_GraphAmino { * hash represents the hash of the data based on the specified * digest_algorithm. */ - hash: Uint8Array; + hash?: string; /** digest_algorithm represents the hash digest algorithm. */ - digest_algorithm: DigestAlgorithm; + digest_algorithm?: DigestAlgorithm; /** * graph_canonicalization_algorithm represents the RDF graph * canonicalization algorithm. */ - canonicalization_algorithm: GraphCanonicalizationAlgorithm; + canonicalization_algorithm?: GraphCanonicalizationAlgorithm; /** merkle_tree is the merkle tree type used for the graph hash, if any. */ - merkle_tree: GraphMerkleTree; + merkle_tree?: GraphMerkleTree; } export interface ContentHash_GraphAminoMsg { type: "/regen.data.v1.Graph"; @@ -395,7 +395,7 @@ export interface ContentHashesProtoMsg { /** ContentHashes contains list of content ContentHash. */ export interface ContentHashesAmino { /** data is a list of content hashes which the resolver claims to serve. */ - content_hashes: ContentHashAmino[]; + content_hashes?: ContentHashAmino[]; } export interface ContentHashesAminoMsg { type: "/regen.data.v1.ContentHashes"; @@ -407,12 +407,13 @@ export interface ContentHashesSDKType { } function createBaseContentHash(): ContentHash { return { - raw: Raw.fromPartial({}), - graph: Graph.fromPartial({}) + raw: undefined, + graph: undefined }; } export const ContentHash = { - encode(message: ContentHash, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.ContentHash", + encode(message: ContentHash, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.raw !== undefined) { ContentHash_Raw.encode(message.raw, writer.uint32(10).fork()).ldelim(); } @@ -421,8 +422,8 @@ export const ContentHash = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContentHash { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContentHash { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContentHash(); while (reader.pos < end) { @@ -460,10 +461,14 @@ export const ContentHash = { return message; }, fromAmino(object: ContentHashAmino): ContentHash { - return { - raw: object?.raw ? ContentHash_Raw.fromAmino(object.raw) : undefined, - graph: object?.graph ? ContentHash_Graph.fromAmino(object.graph) : undefined - }; + const message = createBaseContentHash(); + if (object.raw !== undefined && object.raw !== null) { + message.raw = ContentHash_Raw.fromAmino(object.raw); + } + if (object.graph !== undefined && object.graph !== null) { + message.graph = ContentHash_Graph.fromAmino(object.graph); + } + return message; }, toAmino(message: ContentHash): ContentHashAmino { const obj: any = {}; @@ -495,7 +500,8 @@ function createBaseContentHash_Raw(): ContentHash_Raw { }; } export const ContentHash_Raw = { - encode(message: ContentHash_Raw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.Raw", + encode(message: ContentHash_Raw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } @@ -507,8 +513,8 @@ export const ContentHash_Raw = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContentHash_Raw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContentHash_Raw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContentHash_Raw(); while (reader.pos < end) { @@ -533,8 +539,8 @@ export const ContentHash_Raw = { fromJSON(object: any): ContentHash_Raw { return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), - digestAlgorithm: isSet(object.digestAlgorithm) ? digestAlgorithmFromJSON(object.digestAlgorithm) : 0, - mediaType: isSet(object.mediaType) ? rawMediaTypeFromJSON(object.mediaType) : 0 + digestAlgorithm: isSet(object.digestAlgorithm) ? digestAlgorithmFromJSON(object.digestAlgorithm) : -1, + mediaType: isSet(object.mediaType) ? rawMediaTypeFromJSON(object.mediaType) : -1 }; }, toJSON(message: ContentHash_Raw): unknown { @@ -552,17 +558,23 @@ export const ContentHash_Raw = { return message; }, fromAmino(object: ContentHash_RawAmino): ContentHash_Raw { - return { - hash: object.hash, - digestAlgorithm: isSet(object.digest_algorithm) ? digestAlgorithmFromJSON(object.digest_algorithm) : 0, - mediaType: isSet(object.media_type) ? rawMediaTypeFromJSON(object.media_type) : 0 - }; + const message = createBaseContentHash_Raw(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.digest_algorithm !== undefined && object.digest_algorithm !== null) { + message.digestAlgorithm = object.digest_algorithm; + } + if (object.media_type !== undefined && object.media_type !== null) { + message.mediaType = object.media_type; + } + return message; }, toAmino(message: ContentHash_Raw): ContentHash_RawAmino { const obj: any = {}; - obj.hash = message.hash; - obj.digest_algorithm = message.digestAlgorithm; - obj.media_type = message.mediaType; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.digest_algorithm = message.digestAlgorithm === 0 ? undefined : message.digestAlgorithm; + obj.media_type = message.mediaType === 0 ? undefined : message.mediaType; return obj; }, fromAminoMsg(object: ContentHash_RawAminoMsg): ContentHash_Raw { @@ -590,7 +602,8 @@ function createBaseContentHash_Graph(): ContentHash_Graph { }; } export const ContentHash_Graph = { - encode(message: ContentHash_Graph, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.Graph", + encode(message: ContentHash_Graph, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } @@ -605,8 +618,8 @@ export const ContentHash_Graph = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContentHash_Graph { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContentHash_Graph { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContentHash_Graph(); while (reader.pos < end) { @@ -634,9 +647,9 @@ export const ContentHash_Graph = { fromJSON(object: any): ContentHash_Graph { return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), - digestAlgorithm: isSet(object.digestAlgorithm) ? digestAlgorithmFromJSON(object.digestAlgorithm) : 0, - canonicalizationAlgorithm: isSet(object.canonicalizationAlgorithm) ? graphCanonicalizationAlgorithmFromJSON(object.canonicalizationAlgorithm) : 0, - merkleTree: isSet(object.merkleTree) ? graphMerkleTreeFromJSON(object.merkleTree) : 0 + digestAlgorithm: isSet(object.digestAlgorithm) ? digestAlgorithmFromJSON(object.digestAlgorithm) : -1, + canonicalizationAlgorithm: isSet(object.canonicalizationAlgorithm) ? graphCanonicalizationAlgorithmFromJSON(object.canonicalizationAlgorithm) : -1, + merkleTree: isSet(object.merkleTree) ? graphMerkleTreeFromJSON(object.merkleTree) : -1 }; }, toJSON(message: ContentHash_Graph): unknown { @@ -656,19 +669,27 @@ export const ContentHash_Graph = { return message; }, fromAmino(object: ContentHash_GraphAmino): ContentHash_Graph { - return { - hash: object.hash, - digestAlgorithm: isSet(object.digest_algorithm) ? digestAlgorithmFromJSON(object.digest_algorithm) : 0, - canonicalizationAlgorithm: isSet(object.canonicalization_algorithm) ? graphCanonicalizationAlgorithmFromJSON(object.canonicalization_algorithm) : 0, - merkleTree: isSet(object.merkle_tree) ? graphMerkleTreeFromJSON(object.merkle_tree) : 0 - }; + const message = createBaseContentHash_Graph(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.digest_algorithm !== undefined && object.digest_algorithm !== null) { + message.digestAlgorithm = object.digest_algorithm; + } + if (object.canonicalization_algorithm !== undefined && object.canonicalization_algorithm !== null) { + message.canonicalizationAlgorithm = object.canonicalization_algorithm; + } + if (object.merkle_tree !== undefined && object.merkle_tree !== null) { + message.merkleTree = object.merkle_tree; + } + return message; }, toAmino(message: ContentHash_Graph): ContentHash_GraphAmino { const obj: any = {}; - obj.hash = message.hash; - obj.digest_algorithm = message.digestAlgorithm; - obj.canonicalization_algorithm = message.canonicalizationAlgorithm; - obj.merkle_tree = message.merkleTree; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.digest_algorithm = message.digestAlgorithm === 0 ? undefined : message.digestAlgorithm; + obj.canonicalization_algorithm = message.canonicalizationAlgorithm === 0 ? undefined : message.canonicalizationAlgorithm; + obj.merkle_tree = message.merkleTree === 0 ? undefined : message.merkleTree; return obj; }, fromAminoMsg(object: ContentHash_GraphAminoMsg): ContentHash_Graph { @@ -693,14 +714,15 @@ function createBaseContentHashes(): ContentHashes { }; } export const ContentHashes = { - encode(message: ContentHashes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.data.v1.ContentHashes", + encode(message: ContentHashes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.contentHashes) { ContentHash.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContentHashes { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContentHashes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContentHashes(); while (reader.pos < end) { @@ -736,16 +758,16 @@ export const ContentHashes = { return message; }, fromAmino(object: ContentHashesAmino): ContentHashes { - return { - contentHashes: Array.isArray(object?.content_hashes) ? object.content_hashes.map((e: any) => ContentHash.fromAmino(e)) : [] - }; + const message = createBaseContentHashes(); + message.contentHashes = object.content_hashes?.map(e => ContentHash.fromAmino(e)) || []; + return message; }, toAmino(message: ContentHashes): ContentHashesAmino { const obj: any = {}; if (message.contentHashes) { obj.content_hashes = message.contentHashes.map(e => e ? ContentHash.toAmino(e) : undefined); } else { - obj.content_hashes = []; + obj.content_hashes = message.contentHashes; } return obj; }, diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/events.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/events.ts index a6245264..763931fe 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/events.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/events.ts @@ -1,5 +1,5 @@ import { BasketCredit, BasketCreditAmino, BasketCreditSDKType } from "./types"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** EventCreate is an event emitted when a basket is created. */ export interface EventCreate { @@ -22,7 +22,7 @@ export interface EventCreateProtoMsg { /** EventCreate is an event emitted when a basket is created. */ export interface EventCreateAmino { /** basket_denom is the basket bank denom. */ - basket_denom: string; + basket_denom?: string; /** * curator is the address of the basket curator who is able to change certain * basket settings. @@ -31,7 +31,7 @@ export interface EventCreateAmino { * removed in the next version. */ /** @deprecated */ - curator: string; + curator?: string; } export interface EventCreateAminoMsg { type: "/regen.ecocredit.basket.v1.EventCreate"; @@ -79,9 +79,9 @@ export interface EventPutProtoMsg { */ export interface EventPutAmino { /** owner is the owner of the credits put into the basket. */ - owner: string; + owner?: string; /** basket_denom is the basket bank denom that the credits were added to. */ - basket_denom: string; + basket_denom?: string; /** * credits are the credits that were added to the basket. * @@ -89,7 +89,7 @@ export interface EventPutAmino { * removed in the next version. */ /** @deprecated */ - credits: BasketCreditAmino[]; + credits?: BasketCreditAmino[]; /** * amount is the integer number of basket tokens converted from credits. * @@ -97,7 +97,7 @@ export interface EventPutAmino { * removed in the next version. */ /** @deprecated */ - amount: string; + amount?: string; } export interface EventPutAminoMsg { type: "/regen.ecocredit.basket.v1.EventPut"; @@ -151,9 +151,9 @@ export interface EventTakeProtoMsg { */ export interface EventTakeAmino { /** owner is the owner of the credits taken from the basket. */ - owner: string; + owner?: string; /** basket_denom is the basket bank denom that credits were taken from. */ - basket_denom: string; + basket_denom?: string; /** * credits are the credits that were taken from the basket. * @@ -161,7 +161,7 @@ export interface EventTakeAmino { * removed in the next version. */ /** @deprecated */ - credits: BasketCreditAmino[]; + credits?: BasketCreditAmino[]; /** * amount is the integer number of basket tokens converted to credits. * @@ -169,7 +169,7 @@ export interface EventTakeAmino { * removed in the next version. */ /** @deprecated */ - amount: string; + amount?: string; } export interface EventTakeAminoMsg { type: "/regen.ecocredit.basket.v1.EventTake"; @@ -207,7 +207,7 @@ export interface EventUpdateCuratorProtoMsg { */ export interface EventUpdateCuratorAmino { /** denom is the basket denom. */ - denom: string; + denom?: string; } export interface EventUpdateCuratorAminoMsg { type: "/regen.ecocredit.basket.v1.EventUpdateCurator"; @@ -243,7 +243,7 @@ export interface EventUpdateDateCriteriaProtoMsg { */ export interface EventUpdateDateCriteriaAmino { /** denom is the basket denom. */ - denom: string; + denom?: string; } export interface EventUpdateDateCriteriaAminoMsg { type: "/regen.ecocredit.basket.v1.EventUpdateDateCriteria"; @@ -265,7 +265,8 @@ function createBaseEventCreate(): EventCreate { }; } export const EventCreate = { - encode(message: EventCreate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.EventCreate", + encode(message: EventCreate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basketDenom !== "") { writer.uint32(10).string(message.basketDenom); } @@ -274,8 +275,8 @@ export const EventCreate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreate(); while (reader.pos < end) { @@ -313,15 +314,19 @@ export const EventCreate = { return message; }, fromAmino(object: EventCreateAmino): EventCreate { - return { - basketDenom: object.basket_denom, - curator: object.curator - }; + const message = createBaseEventCreate(); + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + if (object.curator !== undefined && object.curator !== null) { + message.curator = object.curator; + } + return message; }, toAmino(message: EventCreate): EventCreateAmino { const obj: any = {}; - obj.basket_denom = message.basketDenom; - obj.curator = message.curator; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; + obj.curator = message.curator === "" ? undefined : message.curator; return obj; }, fromAminoMsg(object: EventCreateAminoMsg): EventCreate { @@ -349,7 +354,8 @@ function createBaseEventPut(): EventPut { }; } export const EventPut = { - encode(message: EventPut, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.EventPut", + encode(message: EventPut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -364,8 +370,8 @@ export const EventPut = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventPut { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventPut { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventPut(); while (reader.pos < end) { @@ -419,23 +425,29 @@ export const EventPut = { return message; }, fromAmino(object: EventPutAmino): EventPut { - return { - owner: object.owner, - basketDenom: object.basket_denom, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => BasketCredit.fromAmino(e)) : [], - amount: object.amount - }; + const message = createBaseEventPut(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + message.credits = object.credits?.map(e => BasketCredit.fromAmino(e)) || []; + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: EventPut): EventPutAmino { const obj: any = {}; - obj.owner = message.owner; - obj.basket_denom = message.basketDenom; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; if (message.credits) { obj.credits = message.credits.map(e => e ? BasketCredit.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } - obj.amount = message.amount; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: EventPutAminoMsg): EventPut { @@ -463,7 +475,8 @@ function createBaseEventTake(): EventTake { }; } export const EventTake = { - encode(message: EventTake, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.EventTake", + encode(message: EventTake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -478,8 +491,8 @@ export const EventTake = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventTake { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventTake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventTake(); while (reader.pos < end) { @@ -533,23 +546,29 @@ export const EventTake = { return message; }, fromAmino(object: EventTakeAmino): EventTake { - return { - owner: object.owner, - basketDenom: object.basket_denom, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => BasketCredit.fromAmino(e)) : [], - amount: object.amount - }; + const message = createBaseEventTake(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + message.credits = object.credits?.map(e => BasketCredit.fromAmino(e)) || []; + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: EventTake): EventTakeAmino { const obj: any = {}; - obj.owner = message.owner; - obj.basket_denom = message.basketDenom; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; if (message.credits) { obj.credits = message.credits.map(e => e ? BasketCredit.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } - obj.amount = message.amount; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: EventTakeAminoMsg): EventTake { @@ -574,14 +593,15 @@ function createBaseEventUpdateCurator(): EventUpdateCurator { }; } export const EventUpdateCurator = { - encode(message: EventUpdateCurator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.EventUpdateCurator", + encode(message: EventUpdateCurator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateCurator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateCurator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateCurator(); while (reader.pos < end) { @@ -613,13 +633,15 @@ export const EventUpdateCurator = { return message; }, fromAmino(object: EventUpdateCuratorAmino): EventUpdateCurator { - return { - denom: object.denom - }; + const message = createBaseEventUpdateCurator(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: EventUpdateCurator): EventUpdateCuratorAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: EventUpdateCuratorAminoMsg): EventUpdateCurator { @@ -644,14 +666,15 @@ function createBaseEventUpdateDateCriteria(): EventUpdateDateCriteria { }; } export const EventUpdateDateCriteria = { - encode(message: EventUpdateDateCriteria, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.EventUpdateDateCriteria", + encode(message: EventUpdateDateCriteria, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateDateCriteria { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateDateCriteria { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateDateCriteria(); while (reader.pos < end) { @@ -683,13 +706,15 @@ export const EventUpdateDateCriteria = { return message; }, fromAmino(object: EventUpdateDateCriteriaAmino): EventUpdateDateCriteria { - return { - denom: object.denom - }; + const message = createBaseEventUpdateDateCriteria(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: EventUpdateDateCriteria): EventUpdateDateCriteriaAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: EventUpdateDateCriteriaAminoMsg): EventUpdateDateCriteria { diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/query.lcd.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/query.lcd.ts index 79c245a7..52d98baa 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/query.lcd.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryBasketRequest, QueryBasketResponseSDKType, QueryBasketsRequest, QueryBasketsResponseSDKType, QueryBasketBalancesRequest, QueryBasketBalancesResponseSDKType, QueryBasketBalanceRequest, QueryBasketBalanceResponseSDKType, QueryBasketFeeRequest, QueryBasketFeeResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/query.rpc.Query.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/query.rpc.Query.ts index f10bef60..31cd7e3a 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryBasketRequest, QueryBasketResponse, QueryBasketsRequest, QueryBasketsResponse, QueryBasketBalancesRequest, QueryBasketBalancesResponse, QueryBasketBalanceRequest, QueryBasketBalanceResponse, QueryBasketFeeRequest, QueryBasketFeeResponse } from "./query"; /** Msg is the regen.ecocredit.basket.v1 Query service. */ @@ -33,29 +33,29 @@ export class QueryClientImpl implements Query { basket(request: QueryBasketRequest): Promise { const data = QueryBasketRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Query", "Basket", data); - return promise.then(data => QueryBasketResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBasketResponse.decode(new BinaryReader(data))); } baskets(request: QueryBasketsRequest = { pagination: undefined }): Promise { const data = QueryBasketsRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Query", "Baskets", data); - return promise.then(data => QueryBasketsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBasketsResponse.decode(new BinaryReader(data))); } basketBalances(request: QueryBasketBalancesRequest): Promise { const data = QueryBasketBalancesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Query", "BasketBalances", data); - return promise.then(data => QueryBasketBalancesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBasketBalancesResponse.decode(new BinaryReader(data))); } basketBalance(request: QueryBasketBalanceRequest): Promise { const data = QueryBasketBalanceRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Query", "BasketBalance", data); - return promise.then(data => QueryBasketBalanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBasketBalanceResponse.decode(new BinaryReader(data))); } basketFee(request: QueryBasketFeeRequest = {}): Promise { const data = QueryBasketFeeRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Query", "BasketFee", data); - return promise.then(data => QueryBasketFeeResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBasketFeeResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/query.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/query.ts index 5cc76a81..a8f2b9ee 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/query.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/query.ts @@ -2,7 +2,7 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Basket, BasketAmino, BasketSDKType, BasketBalance, BasketBalanceAmino, BasketBalanceSDKType } from "./state"; import { DateCriteria, DateCriteriaAmino, DateCriteriaSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** QueryBasketRequest is the Query/Basket request type. */ export interface QueryBasketRequest { @@ -16,7 +16,7 @@ export interface QueryBasketRequestProtoMsg { /** QueryBasketRequest is the Query/Basket request type. */ export interface QueryBasketRequestAmino { /** basket_denom represents the denom of the basket to query. */ - basket_denom: string; + basket_denom?: string; } export interface QueryBasketRequestAminoMsg { type: "/regen.ecocredit.basket.v1.QueryBasketRequest"; @@ -36,7 +36,7 @@ export interface QueryBasketResponse { * basket_info is available using BasketInfo. */ /** @deprecated */ - basket: Basket; + basket?: Basket; /** classes are the credit classes that can be deposited in the basket. */ classes: string[]; /** @@ -44,7 +44,7 @@ export interface QueryBasketResponse { * * Since Revision 1 */ - basketInfo: BasketInfo; + basketInfo?: BasketInfo; } export interface QueryBasketResponseProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.QueryBasketResponse"; @@ -62,7 +62,7 @@ export interface QueryBasketResponseAmino { /** @deprecated */ basket?: BasketAmino; /** classes are the credit classes that can be deposited in the basket. */ - classes: string[]; + classes?: string[]; /** * basket_info is the queried basket. * @@ -77,14 +77,14 @@ export interface QueryBasketResponseAminoMsg { /** QueryBasketResponse is the Query/Basket response type. */ export interface QueryBasketResponseSDKType { /** @deprecated */ - basket: BasketSDKType; + basket?: BasketSDKType; classes: string[]; - basket_info: BasketInfoSDKType; + basket_info?: BasketInfoSDKType; } /** QueryBasketsRequest is the Query/Baskets request type. */ export interface QueryBasketsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBasketsRequestProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.QueryBasketsRequest"; @@ -101,7 +101,7 @@ export interface QueryBasketsRequestAminoMsg { } /** QueryBasketsRequest is the Query/Baskets request type. */ export interface QueryBasketsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBasketsResponse is the Query/Baskets response type. */ export interface QueryBasketsResponse { @@ -115,7 +115,7 @@ export interface QueryBasketsResponse { /** @deprecated */ baskets: Basket[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; /** * baskets_info are the fetched baskets. * @@ -137,7 +137,7 @@ export interface QueryBasketsResponseAmino { * baskets_info is available using BasketInfo. */ /** @deprecated */ - baskets: BasketAmino[]; + baskets?: BasketAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; /** @@ -145,7 +145,7 @@ export interface QueryBasketsResponseAmino { * * Since Revision 1 */ - baskets_info: BasketInfoAmino[]; + baskets_info?: BasketInfoAmino[]; } export interface QueryBasketsResponseAminoMsg { type: "/regen.ecocredit.basket.v1.QueryBasketsResponse"; @@ -155,7 +155,7 @@ export interface QueryBasketsResponseAminoMsg { export interface QueryBasketsResponseSDKType { /** @deprecated */ baskets: BasketSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; baskets_info: BasketInfoSDKType[]; } /** QueryBasketBalancesRequest is the Query/BasketBalances request type. */ @@ -163,7 +163,7 @@ export interface QueryBasketBalancesRequest { /** basket_denom is the denom of the basket. */ basketDenom: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBasketBalancesRequestProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.QueryBasketBalancesRequest"; @@ -172,7 +172,7 @@ export interface QueryBasketBalancesRequestProtoMsg { /** QueryBasketBalancesRequest is the Query/BasketBalances request type. */ export interface QueryBasketBalancesRequestAmino { /** basket_denom is the denom of the basket. */ - basket_denom: string; + basket_denom?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -183,7 +183,7 @@ export interface QueryBasketBalancesRequestAminoMsg { /** QueryBasketBalancesRequest is the Query/BasketBalances request type. */ export interface QueryBasketBalancesRequestSDKType { basket_denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBasketBalancesResponse is the Query/BasketBalances response type. */ export interface QueryBasketBalancesResponse { @@ -197,7 +197,7 @@ export interface QueryBasketBalancesResponse { /** @deprecated */ balances: BasketBalance[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; /** * balances_info is a list of credit balances in the basket. * @@ -219,7 +219,7 @@ export interface QueryBasketBalancesResponseAmino { * version. In the meantime baskets_info is available using BasketBalanceInfo. */ /** @deprecated */ - balances: BasketBalanceAmino[]; + balances?: BasketBalanceAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; /** @@ -227,7 +227,7 @@ export interface QueryBasketBalancesResponseAmino { * * Since Revision 1 */ - balances_info: BasketBalanceInfoAmino[]; + balances_info?: BasketBalanceInfoAmino[]; } export interface QueryBasketBalancesResponseAminoMsg { type: "/regen.ecocredit.basket.v1.QueryBasketBalancesResponse"; @@ -237,7 +237,7 @@ export interface QueryBasketBalancesResponseAminoMsg { export interface QueryBasketBalancesResponseSDKType { /** @deprecated */ balances: BasketBalanceSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; balances_info: BasketBalanceInfoSDKType[]; } /** QueryBasketBalanceRequest is the Query/BasketBalance request type. */ @@ -254,9 +254,9 @@ export interface QueryBasketBalanceRequestProtoMsg { /** QueryBasketBalanceRequest is the Query/BasketBalance request type. */ export interface QueryBasketBalanceRequestAmino { /** basket_denom is the denom of the basket. */ - basket_denom: string; + basket_denom?: string; /** batch_denom is the denom of the credit batch. */ - batch_denom: string; + batch_denom?: string; } export interface QueryBasketBalanceRequestAminoMsg { type: "/regen.ecocredit.basket.v1.QueryBasketBalanceRequest"; @@ -279,7 +279,7 @@ export interface QueryBasketBalanceResponseProtoMsg { /** QueryBasketBalanceResponse is the Query/BasketBalance response type. */ export interface QueryBasketBalanceResponseAmino { /** balance is the amount of the queried credit batch in the basket. */ - balance: string; + balance?: string; } export interface QueryBasketBalanceResponseAminoMsg { type: "/regen.ecocredit.basket.v1.QueryBasketBalanceResponse"; @@ -310,7 +310,7 @@ export interface BasketInfo { */ creditTypeAbbrev: string; /** date_criteria is the date criteria for batches admitted to the basket. */ - dateCriteria: DateCriteria; + dateCriteria?: DateCriteria; /** exponent is the exponent for converting credits to/from basket tokens. */ exponent: number; /** @@ -326,32 +326,32 @@ export interface BasketInfoProtoMsg { /** BasketInfo is the human-readable basket information. */ export interface BasketInfoAmino { /** basket_denom is the basket bank denom. */ - basket_denom: string; + basket_denom?: string; /** * name is the unique name of the basket specified in MsgCreate. Basket * names must be unique across all credit types and choices of exponent * above and beyond the uniqueness constraint on basket_denom. */ - name: string; + name?: string; /** * disable_auto_retire indicates whether or not the credits will be retired * upon withdraw from the basket. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * credit_type_abbrev is the abbreviation of the credit type this basket is * able to hold. */ - credit_type_abbrev: string; + credit_type_abbrev?: string; /** date_criteria is the date criteria for batches admitted to the basket. */ date_criteria?: DateCriteriaAmino; /** exponent is the exponent for converting credits to/from basket tokens. */ - exponent: number; + exponent?: number; /** * curator is the address of the basket curator who is able to change certain * basket settings. */ - curator: string; + curator?: string; } export interface BasketInfoAminoMsg { type: "/regen.ecocredit.basket.v1.BasketInfo"; @@ -363,7 +363,7 @@ export interface BasketInfoSDKType { name: string; disable_auto_retire: boolean; credit_type_abbrev: string; - date_criteria: DateCriteriaSDKType; + date_criteria?: DateCriteriaSDKType; exponent: number; curator: string; } @@ -381,9 +381,9 @@ export interface BasketBalanceInfoProtoMsg { /** BasketBalanceInfo is the human-readable basket balance information. */ export interface BasketBalanceInfoAmino { /** batch_denom is the denom of the credit batch */ - batch_denom: string; + batch_denom?: string; /** balance is the amount of ecocredits held in the basket */ - balance: string; + balance?: string; } export interface BasketBalanceInfoAminoMsg { type: "/regen.ecocredit.basket.v1.BasketBalanceInfo"; @@ -430,7 +430,7 @@ export interface QueryBasketFeeResponse { * fee is the basket creation fee. If not set, a basket creation fee is not * required. */ - fee: Coin; + fee?: Coin; } export interface QueryBasketFeeResponseProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.QueryBasketFeeResponse"; @@ -458,7 +458,7 @@ export interface QueryBasketFeeResponseAminoMsg { * Since Revision 2 */ export interface QueryBasketFeeResponseSDKType { - fee: CoinSDKType; + fee?: CoinSDKType; } function createBaseQueryBasketRequest(): QueryBasketRequest { return { @@ -466,14 +466,15 @@ function createBaseQueryBasketRequest(): QueryBasketRequest { }; } export const QueryBasketRequest = { - encode(message: QueryBasketRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketRequest", + encode(message: QueryBasketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basketDenom !== "") { writer.uint32(10).string(message.basketDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketRequest(); while (reader.pos < end) { @@ -505,13 +506,15 @@ export const QueryBasketRequest = { return message; }, fromAmino(object: QueryBasketRequestAmino): QueryBasketRequest { - return { - basketDenom: object.basket_denom - }; + const message = createBaseQueryBasketRequest(); + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + return message; }, toAmino(message: QueryBasketRequest): QueryBasketRequestAmino { const obj: any = {}; - obj.basket_denom = message.basketDenom; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; return obj; }, fromAminoMsg(object: QueryBasketRequestAminoMsg): QueryBasketRequest { @@ -532,13 +535,14 @@ export const QueryBasketRequest = { }; function createBaseQueryBasketResponse(): QueryBasketResponse { return { - basket: Basket.fromPartial({}), + basket: undefined, classes: [], - basketInfo: BasketInfo.fromPartial({}) + basketInfo: undefined }; } export const QueryBasketResponse = { - encode(message: QueryBasketResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketResponse", + encode(message: QueryBasketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basket !== undefined) { Basket.encode(message.basket, writer.uint32(10).fork()).ldelim(); } @@ -550,8 +554,8 @@ export const QueryBasketResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketResponse(); while (reader.pos < end) { @@ -599,11 +603,15 @@ export const QueryBasketResponse = { return message; }, fromAmino(object: QueryBasketResponseAmino): QueryBasketResponse { - return { - basket: object?.basket ? Basket.fromAmino(object.basket) : undefined, - classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => e) : [], - basketInfo: object?.basket_info ? BasketInfo.fromAmino(object.basket_info) : undefined - }; + const message = createBaseQueryBasketResponse(); + if (object.basket !== undefined && object.basket !== null) { + message.basket = Basket.fromAmino(object.basket); + } + message.classes = object.classes?.map(e => e) || []; + if (object.basket_info !== undefined && object.basket_info !== null) { + message.basketInfo = BasketInfo.fromAmino(object.basket_info); + } + return message; }, toAmino(message: QueryBasketResponse): QueryBasketResponseAmino { const obj: any = {}; @@ -611,7 +619,7 @@ export const QueryBasketResponse = { if (message.classes) { obj.classes = message.classes.map(e => e); } else { - obj.classes = []; + obj.classes = message.classes; } obj.basket_info = message.basketInfo ? BasketInfo.toAmino(message.basketInfo) : undefined; return obj; @@ -634,18 +642,19 @@ export const QueryBasketResponse = { }; function createBaseQueryBasketsRequest(): QueryBasketsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBasketsRequest = { - encode(message: QueryBasketsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketsRequest", + encode(message: QueryBasketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketsRequest(); while (reader.pos < end) { @@ -677,9 +686,11 @@ export const QueryBasketsRequest = { return message; }, fromAmino(object: QueryBasketsRequestAmino): QueryBasketsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBasketsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBasketsRequest): QueryBasketsRequestAmino { const obj: any = {}; @@ -705,12 +716,13 @@ export const QueryBasketsRequest = { function createBaseQueryBasketsResponse(): QueryBasketsResponse { return { baskets: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, basketsInfo: [] }; } export const QueryBasketsResponse = { - encode(message: QueryBasketsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketsResponse", + encode(message: QueryBasketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.baskets) { Basket.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -722,8 +734,8 @@ export const QueryBasketsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketsResponse(); while (reader.pos < end) { @@ -775,24 +787,26 @@ export const QueryBasketsResponse = { return message; }, fromAmino(object: QueryBasketsResponseAmino): QueryBasketsResponse { - return { - baskets: Array.isArray(object?.baskets) ? object.baskets.map((e: any) => Basket.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - basketsInfo: Array.isArray(object?.baskets_info) ? object.baskets_info.map((e: any) => BasketInfo.fromAmino(e)) : [] - }; + const message = createBaseQueryBasketsResponse(); + message.baskets = object.baskets?.map(e => Basket.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + message.basketsInfo = object.baskets_info?.map(e => BasketInfo.fromAmino(e)) || []; + return message; }, toAmino(message: QueryBasketsResponse): QueryBasketsResponseAmino { const obj: any = {}; if (message.baskets) { obj.baskets = message.baskets.map(e => e ? Basket.toAmino(e) : undefined); } else { - obj.baskets = []; + obj.baskets = message.baskets; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; if (message.basketsInfo) { obj.baskets_info = message.basketsInfo.map(e => e ? BasketInfo.toAmino(e) : undefined); } else { - obj.baskets_info = []; + obj.baskets_info = message.basketsInfo; } return obj; }, @@ -815,11 +829,12 @@ export const QueryBasketsResponse = { function createBaseQueryBasketBalancesRequest(): QueryBasketBalancesRequest { return { basketDenom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBasketBalancesRequest = { - encode(message: QueryBasketBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketBalancesRequest", + encode(message: QueryBasketBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basketDenom !== "") { writer.uint32(10).string(message.basketDenom); } @@ -828,8 +843,8 @@ export const QueryBasketBalancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketBalancesRequest(); while (reader.pos < end) { @@ -867,14 +882,18 @@ export const QueryBasketBalancesRequest = { return message; }, fromAmino(object: QueryBasketBalancesRequestAmino): QueryBasketBalancesRequest { - return { - basketDenom: object.basket_denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBasketBalancesRequest(); + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBasketBalancesRequest): QueryBasketBalancesRequestAmino { const obj: any = {}; - obj.basket_denom = message.basketDenom; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -897,12 +916,13 @@ export const QueryBasketBalancesRequest = { function createBaseQueryBasketBalancesResponse(): QueryBasketBalancesResponse { return { balances: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, balancesInfo: [] }; } export const QueryBasketBalancesResponse = { - encode(message: QueryBasketBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketBalancesResponse", + encode(message: QueryBasketBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { BasketBalance.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -914,8 +934,8 @@ export const QueryBasketBalancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketBalancesResponse(); while (reader.pos < end) { @@ -967,24 +987,26 @@ export const QueryBasketBalancesResponse = { return message; }, fromAmino(object: QueryBasketBalancesResponseAmino): QueryBasketBalancesResponse { - return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => BasketBalance.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - balancesInfo: Array.isArray(object?.balances_info) ? object.balances_info.map((e: any) => BasketBalanceInfo.fromAmino(e)) : [] - }; + const message = createBaseQueryBasketBalancesResponse(); + message.balances = object.balances?.map(e => BasketBalance.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + message.balancesInfo = object.balances_info?.map(e => BasketBalanceInfo.fromAmino(e)) || []; + return message; }, toAmino(message: QueryBasketBalancesResponse): QueryBasketBalancesResponseAmino { const obj: any = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? BasketBalance.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; if (message.balancesInfo) { obj.balances_info = message.balancesInfo.map(e => e ? BasketBalanceInfo.toAmino(e) : undefined); } else { - obj.balances_info = []; + obj.balances_info = message.balancesInfo; } return obj; }, @@ -1011,7 +1033,8 @@ function createBaseQueryBasketBalanceRequest(): QueryBasketBalanceRequest { }; } export const QueryBasketBalanceRequest = { - encode(message: QueryBasketBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketBalanceRequest", + encode(message: QueryBasketBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basketDenom !== "") { writer.uint32(10).string(message.basketDenom); } @@ -1020,8 +1043,8 @@ export const QueryBasketBalanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketBalanceRequest(); while (reader.pos < end) { @@ -1059,15 +1082,19 @@ export const QueryBasketBalanceRequest = { return message; }, fromAmino(object: QueryBasketBalanceRequestAmino): QueryBasketBalanceRequest { - return { - basketDenom: object.basket_denom, - batchDenom: object.batch_denom - }; + const message = createBaseQueryBasketBalanceRequest(); + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: QueryBasketBalanceRequest): QueryBasketBalanceRequestAmino { const obj: any = {}; - obj.basket_denom = message.basketDenom; - obj.batch_denom = message.batchDenom; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: QueryBasketBalanceRequestAminoMsg): QueryBasketBalanceRequest { @@ -1092,14 +1119,15 @@ function createBaseQueryBasketBalanceResponse(): QueryBasketBalanceResponse { }; } export const QueryBasketBalanceResponse = { - encode(message: QueryBasketBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketBalanceResponse", + encode(message: QueryBasketBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.balance !== "") { writer.uint32(10).string(message.balance); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketBalanceResponse(); while (reader.pos < end) { @@ -1131,13 +1159,15 @@ export const QueryBasketBalanceResponse = { return message; }, fromAmino(object: QueryBasketBalanceResponseAmino): QueryBasketBalanceResponse { - return { - balance: object.balance - }; + const message = createBaseQueryBasketBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; }, toAmino(message: QueryBasketBalanceResponse): QueryBasketBalanceResponseAmino { const obj: any = {}; - obj.balance = message.balance; + obj.balance = message.balance === "" ? undefined : message.balance; return obj; }, fromAminoMsg(object: QueryBasketBalanceResponseAminoMsg): QueryBasketBalanceResponse { @@ -1162,13 +1192,14 @@ function createBaseBasketInfo(): BasketInfo { name: "", disableAutoRetire: false, creditTypeAbbrev: "", - dateCriteria: DateCriteria.fromPartial({}), + dateCriteria: undefined, exponent: 0, curator: "" }; } export const BasketInfo = { - encode(message: BasketInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.BasketInfo", + encode(message: BasketInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basketDenom !== "") { writer.uint32(10).string(message.basketDenom); } @@ -1192,8 +1223,8 @@ export const BasketInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasketInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasketInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasketInfo(); while (reader.pos < end) { @@ -1261,25 +1292,39 @@ export const BasketInfo = { return message; }, fromAmino(object: BasketInfoAmino): BasketInfo { - return { - basketDenom: object.basket_denom, - name: object.name, - disableAutoRetire: object.disable_auto_retire, - creditTypeAbbrev: object.credit_type_abbrev, - dateCriteria: object?.date_criteria ? DateCriteria.fromAmino(object.date_criteria) : undefined, - exponent: object.exponent, - curator: object.curator - }; + const message = createBaseBasketInfo(); + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + if (object.date_criteria !== undefined && object.date_criteria !== null) { + message.dateCriteria = DateCriteria.fromAmino(object.date_criteria); + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + if (object.curator !== undefined && object.curator !== null) { + message.curator = object.curator; + } + return message; }, toAmino(message: BasketInfo): BasketInfoAmino { const obj: any = {}; - obj.basket_denom = message.basketDenom; - obj.name = message.name; - obj.disable_auto_retire = message.disableAutoRetire; - obj.credit_type_abbrev = message.creditTypeAbbrev; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; + obj.name = message.name === "" ? undefined : message.name; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; obj.date_criteria = message.dateCriteria ? DateCriteria.toAmino(message.dateCriteria) : undefined; - obj.exponent = message.exponent; - obj.curator = message.curator; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + obj.curator = message.curator === "" ? undefined : message.curator; return obj; }, fromAminoMsg(object: BasketInfoAminoMsg): BasketInfo { @@ -1305,7 +1350,8 @@ function createBaseBasketBalanceInfo(): BasketBalanceInfo { }; } export const BasketBalanceInfo = { - encode(message: BasketBalanceInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.BasketBalanceInfo", + encode(message: BasketBalanceInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -1314,8 +1360,8 @@ export const BasketBalanceInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasketBalanceInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasketBalanceInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasketBalanceInfo(); while (reader.pos < end) { @@ -1353,15 +1399,19 @@ export const BasketBalanceInfo = { return message; }, fromAmino(object: BasketBalanceInfoAmino): BasketBalanceInfo { - return { - batchDenom: object.batch_denom, - balance: object.balance - }; + const message = createBaseBasketBalanceInfo(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; }, toAmino(message: BasketBalanceInfo): BasketBalanceInfoAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.balance = message.balance; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.balance = message.balance === "" ? undefined : message.balance; return obj; }, fromAminoMsg(object: BasketBalanceInfoAminoMsg): BasketBalanceInfo { @@ -1384,11 +1434,12 @@ function createBaseQueryBasketFeeRequest(): QueryBasketFeeRequest { return {}; } export const QueryBasketFeeRequest = { - encode(_: QueryBasketFeeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketFeeRequest", + encode(_: QueryBasketFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketFeeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketFeeRequest(); while (reader.pos < end) { @@ -1413,7 +1464,8 @@ export const QueryBasketFeeRequest = { return message; }, fromAmino(_: QueryBasketFeeRequestAmino): QueryBasketFeeRequest { - return {}; + const message = createBaseQueryBasketFeeRequest(); + return message; }, toAmino(_: QueryBasketFeeRequest): QueryBasketFeeRequestAmino { const obj: any = {}; @@ -1441,14 +1493,15 @@ function createBaseQueryBasketFeeResponse(): QueryBasketFeeResponse { }; } export const QueryBasketFeeResponse = { - encode(message: QueryBasketFeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.QueryBasketFeeResponse", + encode(message: QueryBasketFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Coin.encode(message.fee, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBasketFeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBasketFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBasketFeeResponse(); while (reader.pos < end) { @@ -1480,9 +1533,11 @@ export const QueryBasketFeeResponse = { return message; }, fromAmino(object: QueryBasketFeeResponseAmino): QueryBasketFeeResponse { - return { - fee: object?.fee ? Coin.fromAmino(object.fee) : undefined - }; + const message = createBaseQueryBasketFeeResponse(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; }, toAmino(message: QueryBasketFeeResponse): QueryBasketFeeResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/state.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/state.ts index 7493afc7..26c396e8 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/state.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/state.ts @@ -1,15 +1,15 @@ import { DateCriteria, DateCriteriaAmino, DateCriteriaSDKType } from "./types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../../google/protobuf/timestamp"; import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { Long, isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; /** Basket represents a basket in state. */ export interface Basket { /** * id is the uint64 ID of the basket. It is used internally for reducing * storage space. */ - id: Long; + id: bigint; /** * basket_denom is the basket bank denom formed from name and credit type with * the format `eco..` where prefix is the @@ -45,7 +45,7 @@ export interface Basket { */ creditTypeAbbrev: string; /** date_criteria is the date criteria for batches admitted to the basket. */ - dateCriteria: DateCriteria; + dateCriteria?: DateCriteria; /** * Deprecated (Since Revision 1): This field is no longer used and will be * removed in the next version. The value of credit type precision is always @@ -72,7 +72,7 @@ export interface BasketAmino { * id is the uint64 ID of the basket. It is used internally for reducing * storage space. */ - id: string; + id?: string; /** * basket_denom is the basket bank denom formed from name and credit type with * the format `eco..` where prefix is the @@ -90,23 +90,23 @@ export interface BasketAmino { * 21 - z (zepto) * 24 - y (yocto) */ - basket_denom: string; + basket_denom?: string; /** * name is the unique name of the basket specified in MsgCreate. Basket * names must be unique across all credit types and choices of exponent * above and beyond the uniqueness constraint on basket_denom. */ - name: string; + name?: string; /** * disable_auto_retire indicates whether or not the credits will be retired * upon withdraw from the basket. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * credit_type_abbrev is the abbreviation of the credit type this basket is * able to hold. */ - credit_type_abbrev: string; + credit_type_abbrev?: string; /** date_criteria is the date criteria for batches admitted to the basket. */ date_criteria?: DateCriteriaAmino; /** @@ -116,14 +116,14 @@ export interface BasketAmino { * field will be set to the value of credit type precision until removed. */ /** @deprecated */ - exponent: number; + exponent?: number; /** * curator is the address of the basket curator who is able to change certain * basket settings. * * Since Revision 1 */ - curator: Uint8Array; + curator?: string; } export interface BasketAminoMsg { type: "/regen.ecocredit.basket.v1.Basket"; @@ -131,12 +131,12 @@ export interface BasketAminoMsg { } /** Basket represents a basket in state. */ export interface BasketSDKType { - id: Long; + id: bigint; basket_denom: string; name: string; disable_auto_retire: boolean; credit_type_abbrev: string; - date_criteria: DateCriteriaSDKType; + date_criteria?: DateCriteriaSDKType; /** @deprecated */ exponent: number; curator: Uint8Array; @@ -144,7 +144,7 @@ export interface BasketSDKType { /** BasketClass describes a credit class that can be deposited in a basket. */ export interface BasketClass { /** basket_id is the ID of the basket */ - basketId: Long; + basketId: bigint; /** * class_id is the id of the credit class that is allowed to be deposited in * the basket @@ -158,12 +158,12 @@ export interface BasketClassProtoMsg { /** BasketClass describes a credit class that can be deposited in a basket. */ export interface BasketClassAmino { /** basket_id is the ID of the basket */ - basket_id: string; + basket_id?: string; /** * class_id is the id of the credit class that is allowed to be deposited in * the basket */ - class_id: string; + class_id?: string; } export interface BasketClassAminoMsg { type: "/regen.ecocredit.basket.v1.BasketClass"; @@ -171,13 +171,13 @@ export interface BasketClassAminoMsg { } /** BasketClass describes a credit class that can be deposited in a basket. */ export interface BasketClassSDKType { - basket_id: Long; + basket_id: bigint; class_id: string; } /** BasketBalance stores the amount of credits from a batch in a basket */ export interface BasketBalance { /** basket_id is the ID of the basket */ - basketId: Long; + basketId: bigint; /** batch_denom is the denom of the credit batch */ batchDenom: string; /** balance is the amount of ecocredits held in the basket */ @@ -186,7 +186,7 @@ export interface BasketBalance { * batch_start_date is the start date of the batch. This field is used * to create an index which is used to remove the oldest credits first. */ - batchStartDate: Timestamp; + batchStartDate?: Timestamp; } export interface BasketBalanceProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.BasketBalance"; @@ -195,16 +195,16 @@ export interface BasketBalanceProtoMsg { /** BasketBalance stores the amount of credits from a batch in a basket */ export interface BasketBalanceAmino { /** basket_id is the ID of the basket */ - basket_id: string; + basket_id?: string; /** batch_denom is the denom of the credit batch */ - batch_denom: string; + batch_denom?: string; /** balance is the amount of ecocredits held in the basket */ - balance: string; + balance?: string; /** * batch_start_date is the start date of the batch. This field is used * to create an index which is used to remove the oldest credits first. */ - batch_start_date?: TimestampAmino; + batch_start_date?: string; } export interface BasketBalanceAminoMsg { type: "/regen.ecocredit.basket.v1.BasketBalance"; @@ -212,10 +212,10 @@ export interface BasketBalanceAminoMsg { } /** BasketBalance stores the amount of credits from a batch in a basket */ export interface BasketBalanceSDKType { - basket_id: Long; + basket_id: bigint; batch_denom: string; balance: string; - batch_start_date: TimestampSDKType; + batch_start_date?: TimestampSDKType; } /** * BasketFee is the basket creation fee. If not set, a basket creation fee is @@ -228,7 +228,7 @@ export interface BasketFee { * fee is the basket creation fee. If not set, a basket creation fee is not * required. */ - fee: Coin; + fee?: Coin; } export interface BasketFeeProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.BasketFee"; @@ -258,23 +258,24 @@ export interface BasketFeeAminoMsg { * Since Revision 2 */ export interface BasketFeeSDKType { - fee: CoinSDKType; + fee?: CoinSDKType; } function createBaseBasket(): Basket { return { - id: Long.UZERO, + id: BigInt(0), basketDenom: "", name: "", disableAutoRetire: false, creditTypeAbbrev: "", - dateCriteria: DateCriteria.fromPartial({}), + dateCriteria: undefined, exponent: 0, curator: new Uint8Array() }; } export const Basket = { - encode(message: Basket, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.ecocredit.basket.v1.Basket", + encode(message: Basket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.basketDenom !== "") { @@ -300,15 +301,15 @@ export const Basket = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Basket { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Basket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasket(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.basketDenom = reader.string(); @@ -340,7 +341,7 @@ export const Basket = { }, fromJSON(object: any): Basket { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), basketDenom: isSet(object.basketDenom) ? String(object.basketDenom) : "", name: isSet(object.name) ? String(object.name) : "", disableAutoRetire: isSet(object.disableAutoRetire) ? Boolean(object.disableAutoRetire) : false, @@ -352,7 +353,7 @@ export const Basket = { }, toJSON(message: Basket): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.basketDenom !== undefined && (obj.basketDenom = message.basketDenom); message.name !== undefined && (obj.name = message.name); message.disableAutoRetire !== undefined && (obj.disableAutoRetire = message.disableAutoRetire); @@ -364,7 +365,7 @@ export const Basket = { }, fromPartial(object: Partial): Basket { const message = createBaseBasket(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.basketDenom = object.basketDenom ?? ""; message.name = object.name ?? ""; message.disableAutoRetire = object.disableAutoRetire ?? false; @@ -375,27 +376,43 @@ export const Basket = { return message; }, fromAmino(object: BasketAmino): Basket { - return { - id: Long.fromString(object.id), - basketDenom: object.basket_denom, - name: object.name, - disableAutoRetire: object.disable_auto_retire, - creditTypeAbbrev: object.credit_type_abbrev, - dateCriteria: object?.date_criteria ? DateCriteria.fromAmino(object.date_criteria) : undefined, - exponent: object.exponent, - curator: object.curator - }; + const message = createBaseBasket(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + if (object.date_criteria !== undefined && object.date_criteria !== null) { + message.dateCriteria = DateCriteria.fromAmino(object.date_criteria); + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + if (object.curator !== undefined && object.curator !== null) { + message.curator = bytesFromBase64(object.curator); + } + return message; }, toAmino(message: Basket): BasketAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.basket_denom = message.basketDenom; - obj.name = message.name; - obj.disable_auto_retire = message.disableAutoRetire; - obj.credit_type_abbrev = message.creditTypeAbbrev; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; + obj.name = message.name === "" ? undefined : message.name; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; obj.date_criteria = message.dateCriteria ? DateCriteria.toAmino(message.dateCriteria) : undefined; - obj.exponent = message.exponent; - obj.curator = message.curator; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + obj.curator = message.curator ? base64FromBytes(message.curator) : undefined; return obj; }, fromAminoMsg(object: BasketAminoMsg): Basket { @@ -416,13 +433,14 @@ export const Basket = { }; function createBaseBasketClass(): BasketClass { return { - basketId: Long.UZERO, + basketId: BigInt(0), classId: "" }; } export const BasketClass = { - encode(message: BasketClass, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.basketId.isZero()) { + typeUrl: "/regen.ecocredit.basket.v1.BasketClass", + encode(message: BasketClass, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.basketId !== BigInt(0)) { writer.uint32(8).uint64(message.basketId); } if (message.classId !== "") { @@ -430,15 +448,15 @@ export const BasketClass = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasketClass { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasketClass { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasketClass(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.basketId = (reader.uint64() as Long); + message.basketId = reader.uint64(); break; case 2: message.classId = reader.string(); @@ -452,32 +470,36 @@ export const BasketClass = { }, fromJSON(object: any): BasketClass { return { - basketId: isSet(object.basketId) ? Long.fromValue(object.basketId) : Long.UZERO, + basketId: isSet(object.basketId) ? BigInt(object.basketId.toString()) : BigInt(0), classId: isSet(object.classId) ? String(object.classId) : "" }; }, toJSON(message: BasketClass): unknown { const obj: any = {}; - message.basketId !== undefined && (obj.basketId = (message.basketId || Long.UZERO).toString()); + message.basketId !== undefined && (obj.basketId = (message.basketId || BigInt(0)).toString()); message.classId !== undefined && (obj.classId = message.classId); return obj; }, fromPartial(object: Partial): BasketClass { const message = createBaseBasketClass(); - message.basketId = object.basketId !== undefined && object.basketId !== null ? Long.fromValue(object.basketId) : Long.UZERO; + message.basketId = object.basketId !== undefined && object.basketId !== null ? BigInt(object.basketId.toString()) : BigInt(0); message.classId = object.classId ?? ""; return message; }, fromAmino(object: BasketClassAmino): BasketClass { - return { - basketId: Long.fromString(object.basket_id), - classId: object.class_id - }; + const message = createBaseBasketClass(); + if (object.basket_id !== undefined && object.basket_id !== null) { + message.basketId = BigInt(object.basket_id); + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: BasketClass): BasketClassAmino { const obj: any = {}; - obj.basket_id = message.basketId ? message.basketId.toString() : undefined; - obj.class_id = message.classId; + obj.basket_id = message.basketId !== BigInt(0) ? message.basketId.toString() : undefined; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: BasketClassAminoMsg): BasketClass { @@ -498,15 +520,16 @@ export const BasketClass = { }; function createBaseBasketBalance(): BasketBalance { return { - basketId: Long.UZERO, + basketId: BigInt(0), batchDenom: "", balance: "", batchStartDate: undefined }; } export const BasketBalance = { - encode(message: BasketBalance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.basketId.isZero()) { + typeUrl: "/regen.ecocredit.basket.v1.BasketBalance", + encode(message: BasketBalance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.basketId !== BigInt(0)) { writer.uint32(8).uint64(message.basketId); } if (message.batchDenom !== "") { @@ -520,15 +543,15 @@ export const BasketBalance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasketBalance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasketBalance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasketBalance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.basketId = (reader.uint64() as Long); + message.basketId = reader.uint64(); break; case 2: message.batchDenom = reader.string(); @@ -548,7 +571,7 @@ export const BasketBalance = { }, fromJSON(object: any): BasketBalance { return { - basketId: isSet(object.basketId) ? Long.fromValue(object.basketId) : Long.UZERO, + basketId: isSet(object.basketId) ? BigInt(object.basketId.toString()) : BigInt(0), batchDenom: isSet(object.batchDenom) ? String(object.batchDenom) : "", balance: isSet(object.balance) ? String(object.balance) : "", batchStartDate: isSet(object.batchStartDate) ? fromJsonTimestamp(object.batchStartDate) : undefined @@ -556,7 +579,7 @@ export const BasketBalance = { }, toJSON(message: BasketBalance): unknown { const obj: any = {}; - message.basketId !== undefined && (obj.basketId = (message.basketId || Long.UZERO).toString()); + message.basketId !== undefined && (obj.basketId = (message.basketId || BigInt(0)).toString()); message.batchDenom !== undefined && (obj.batchDenom = message.batchDenom); message.balance !== undefined && (obj.balance = message.balance); message.batchStartDate !== undefined && (obj.batchStartDate = fromTimestamp(message.batchStartDate).toISOString()); @@ -564,25 +587,33 @@ export const BasketBalance = { }, fromPartial(object: Partial): BasketBalance { const message = createBaseBasketBalance(); - message.basketId = object.basketId !== undefined && object.basketId !== null ? Long.fromValue(object.basketId) : Long.UZERO; + message.basketId = object.basketId !== undefined && object.basketId !== null ? BigInt(object.basketId.toString()) : BigInt(0); message.batchDenom = object.batchDenom ?? ""; message.balance = object.balance ?? ""; message.batchStartDate = object.batchStartDate !== undefined && object.batchStartDate !== null ? Timestamp.fromPartial(object.batchStartDate) : undefined; return message; }, fromAmino(object: BasketBalanceAmino): BasketBalance { - return { - basketId: Long.fromString(object.basket_id), - batchDenom: object.batch_denom, - balance: object.balance, - batchStartDate: object?.batch_start_date ? Timestamp.fromAmino(object.batch_start_date) : undefined - }; + const message = createBaseBasketBalance(); + if (object.basket_id !== undefined && object.basket_id !== null) { + message.basketId = BigInt(object.basket_id); + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + if (object.batch_start_date !== undefined && object.batch_start_date !== null) { + message.batchStartDate = Timestamp.fromAmino(object.batch_start_date); + } + return message; }, toAmino(message: BasketBalance): BasketBalanceAmino { const obj: any = {}; - obj.basket_id = message.basketId ? message.basketId.toString() : undefined; - obj.batch_denom = message.batchDenom; - obj.balance = message.balance; + obj.basket_id = message.basketId !== BigInt(0) ? message.basketId.toString() : undefined; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.balance = message.balance === "" ? undefined : message.balance; obj.batch_start_date = message.batchStartDate ? Timestamp.toAmino(message.batchStartDate) : undefined; return obj; }, @@ -608,14 +639,15 @@ function createBaseBasketFee(): BasketFee { }; } export const BasketFee = { - encode(message: BasketFee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.BasketFee", + encode(message: BasketFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Coin.encode(message.fee, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasketFee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasketFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasketFee(); while (reader.pos < end) { @@ -647,9 +679,11 @@ export const BasketFee = { return message; }, fromAmino(object: BasketFeeAmino): BasketFee { - return { - fee: object?.fee ? Coin.fromAmino(object.fee) : undefined - }; + const message = createBaseBasketFee(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; }, toAmino(message: BasketFee): BasketFeeAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts index 0780cb76..01d553ea 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { MsgCreate, MsgCreateResponse, MsgPut, MsgPutResponse, MsgTake, MsgTakeResponse, MsgUpdateBasketFee, MsgUpdateBasketFeeResponse, MsgUpdateCurator, MsgUpdateCuratorResponse, MsgUpdateDateCriteria, MsgUpdateDateCriteriaResponse } from "./tx"; /** Msg is the regen.ecocredit.basket.v1 Msg service. */ export interface Msg { @@ -77,31 +77,31 @@ export class MsgClientImpl implements Msg { create(request: MsgCreate): Promise { const data = MsgCreate.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Msg", "Create", data); - return promise.then(data => MsgCreateResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateResponse.decode(new BinaryReader(data))); } put(request: MsgPut): Promise { const data = MsgPut.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Msg", "Put", data); - return promise.then(data => MsgPutResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgPutResponse.decode(new BinaryReader(data))); } take(request: MsgTake): Promise { const data = MsgTake.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Msg", "Take", data); - return promise.then(data => MsgTakeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgTakeResponse.decode(new BinaryReader(data))); } updateBasketFee(request: MsgUpdateBasketFee): Promise { const data = MsgUpdateBasketFee.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Msg", "UpdateBasketFee", data); - return promise.then(data => MsgUpdateBasketFeeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateBasketFeeResponse.decode(new BinaryReader(data))); } updateCurator(request: MsgUpdateCurator): Promise { const data = MsgUpdateCurator.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Msg", "UpdateCurator", data); - return promise.then(data => MsgUpdateCuratorResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateCuratorResponse.decode(new BinaryReader(data))); } updateDateCriteria(request: MsgUpdateDateCriteria): Promise { const data = MsgUpdateDateCriteria.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.basket.v1.Msg", "UpdateDateCriteria", data); - return promise.then(data => MsgUpdateDateCriteriaResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateDateCriteriaResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.ts index f35e9b29..ffa3017e 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/tx.ts @@ -1,6 +1,6 @@ import { DateCriteria, DateCriteriaAmino, DateCriteriaSDKType, BasketCredit, BasketCreditAmino, BasketCreditSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** MsgCreateBasket is the Msg/CreateBasket request type. */ export interface MsgCreate { @@ -51,7 +51,7 @@ export interface MsgCreate { * date_criteria is the date criteria for batches admitted to the basket. * At most, only one of the date criteria fields can be set. */ - dateCriteria: DateCriteria; + dateCriteria?: DateCriteria; /** * fee is the basket creation fee. A fee is not required if no fee exists * in the basket fee parameter. The fee must be greater than or equal to the @@ -76,7 +76,7 @@ export interface MsgCreateAmino { * curator is the address of the basket curator who is able to change certain * basket settings. */ - curator: string; + curator?: string; /** * name will be used to together with prefix to create a bank denom for this * basket token. It can be between 3-8 alphanumeric characters, with the @@ -86,12 +86,12 @@ export interface MsgCreateAmino { * `eco..` where prefix is the prefix of * a standard SI unit derived from credit type precision. */ - name: string; + name?: string; /** * description is a human-readable description of the basket denom that should * be at most 256 characters. */ - description: string; + description?: string; /** * Deprecated (Since Revision 1): This field is no longer used and will be * removed in the next version. The value of credit type precision is always @@ -99,7 +99,7 @@ export interface MsgCreateAmino { * bank denom metadata, and converting credits to/from basket tokens. */ /** @deprecated */ - exponent: number; + exponent?: number; /** * disable_auto_retire allows auto-retirement to be disabled. * The credits will be auto-retired if disable_auto_retire is @@ -107,14 +107,14 @@ export interface MsgCreateAmino { * address picking them from the basket, in which case they will remain * tradable. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * credit_type_abbrev is the abbreviation of the credit type this basket is * able to hold. */ - credit_type_abbrev: string; + credit_type_abbrev?: string; /** allowed_classes are the credit classes allowed to be put in the basket */ - allowed_classes: string[]; + allowed_classes?: string[]; /** * date_criteria is the date criteria for batches admitted to the basket. * At most, only one of the date criteria fields can be set. @@ -132,7 +132,7 @@ export interface MsgCreateAmino { * This field will be updated to a single fee rather than a list of fees in * the next version to reflect these requirements. */ - fee: CoinAmino[]; + fee?: CoinAmino[]; } export interface MsgCreateAminoMsg { type: "regen.basket/MsgCreate"; @@ -148,7 +148,7 @@ export interface MsgCreateSDKType { disable_auto_retire: boolean; credit_type_abbrev: string; allowed_classes: string[]; - date_criteria: DateCriteriaSDKType; + date_criteria?: DateCriteriaSDKType; fee: CoinSDKType[]; } /** MsgCreateBasketResponse is the Msg/CreateBasket response type. */ @@ -163,7 +163,7 @@ export interface MsgCreateResponseProtoMsg { /** MsgCreateBasketResponse is the Msg/CreateBasket response type. */ export interface MsgCreateResponseAmino { /** basket_denom is the unique denomination ID of the newly created basket. */ - basket_denom: string; + basket_denom?: string; } export interface MsgCreateResponseAminoMsg { type: "/regen.ecocredit.basket.v1.MsgCreateResponse"; @@ -192,14 +192,14 @@ export interface MsgPutProtoMsg { /** MsgAddToBasket is the Msg/AddToBasket request type. */ export interface MsgPutAmino { /** owner is the owner of credits being put into the basket. */ - owner: string; + owner?: string; /** basket_denom is the basket denom to add credits to. */ - basket_denom: string; + basket_denom?: string; /** * credits are credits to add to the basket. If they do not match the basket's * admission criteria, the operation will fail. */ - credits: BasketCreditAmino[]; + credits?: BasketCreditAmino[]; } export interface MsgPutAminoMsg { type: "regen.basket/MsgPut"; @@ -223,7 +223,7 @@ export interface MsgPutResponseProtoMsg { /** MsgAddToBasketResponse is the Msg/AddToBasket response type. */ export interface MsgPutResponseAmino { /** amount_received is the integer amount of basket tokens received. */ - amount_received: string; + amount_received?: string; } export interface MsgPutResponseAminoMsg { type: "/regen.ecocredit.basket.v1.MsgPutResponse"; @@ -282,11 +282,11 @@ export interface MsgTakeProtoMsg { /** MsgTakeFromBasket is the Msg/TakeFromBasket request type. */ export interface MsgTakeAmino { /** owner is the owner of the basket tokens. */ - owner: string; + owner?: string; /** basket_denom is the basket bank denom to take credits from. */ - basket_denom: string; + basket_denom?: string; /** amount is the integer number of basket tokens to convert into credits. */ - amount: string; + amount?: string; /** * retirement_location is the optional retirement jurisdiction for the * credits which will be used only if retire_on_take is true. @@ -296,7 +296,7 @@ export interface MsgTakeAmino { * set and retirement_jurisdiction will be used if both are set. */ /** @deprecated */ - retirement_location: string; + retirement_location?: string; /** * retire_on_take is a boolean that dictates whether the ecocredits * received in exchange for the basket tokens will be received as @@ -304,14 +304,14 @@ export interface MsgTakeAmino { * false, retire_on_take MUST be set to true, and a retirement jurisdiction * must be provided. */ - retire_on_take: boolean; + retire_on_take?: boolean; /** * retirement_jurisdiction is the optional retirement jurisdiction for the * credits which will be used only if retire_on_take is true. * * Since Revision 1 */ - retirement_jurisdiction: string; + retirement_jurisdiction?: string; /** * retirement_reason is any arbitrary string that specifies the reason for * retiring credits. The reason will be included in EventRetire and is not @@ -319,7 +319,7 @@ export interface MsgTakeAmino { * * Since Revision 2 */ - retirement_reason: string; + retirement_reason?: string; } export interface MsgTakeAminoMsg { type: "regen.basket/MsgTake"; @@ -348,7 +348,7 @@ export interface MsgTakeResponseProtoMsg { /** MsgTakeFromBasketResponse is the Msg/TakeFromBasket response type. */ export interface MsgTakeResponseAmino { /** credits are the credits taken out of the basket. */ - credits: BasketCreditAmino[]; + credits?: BasketCreditAmino[]; } export interface MsgTakeResponseAminoMsg { type: "/regen.ecocredit.basket.v1.MsgTakeResponse"; @@ -370,7 +370,7 @@ export interface MsgUpdateBasketFee { * fee is the basket creation fee. If not set, the basket creation fee will be * removed and no fee will be required to create a basket. */ - fee: Coin; + fee?: Coin; } export interface MsgUpdateBasketFeeProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateBasketFee"; @@ -383,7 +383,7 @@ export interface MsgUpdateBasketFeeProtoMsg { */ export interface MsgUpdateBasketFeeAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** * fee is the basket creation fee. If not set, the basket creation fee will be * removed and no fee will be required to create a basket. @@ -401,7 +401,7 @@ export interface MsgUpdateBasketFeeAminoMsg { */ export interface MsgUpdateBasketFeeSDKType { authority: string; - fee: CoinSDKType; + fee?: CoinSDKType; } /** * MsgUpdateBasketFeeResponse is the Msg/UpdateBasketFee response type. @@ -456,14 +456,14 @@ export interface MsgUpdateCuratorProtoMsg { */ export interface MsgUpdateCuratorAmino { /** curator is the address of the basket curator. */ - curator: string; + curator?: string; /** denom is the unique identifier of the basket. */ - denom: string; + denom?: string; /** * new_curator is the address of the account that will become the * new curator of the basket. */ - new_curator: string; + new_curator?: string; } export interface MsgUpdateCuratorAminoMsg { type: "regen.basket/MsgUpdateCurator"; @@ -519,7 +519,7 @@ export interface MsgUpdateDateCriteria { * new_date_criteria is the new date criteria for batches admitted to the * basket. At most, only one of the date criteria fields can be set. */ - newDateCriteria: DateCriteria; + newDateCriteria?: DateCriteria; } export interface MsgUpdateDateCriteriaProtoMsg { typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateDateCriteria"; @@ -532,9 +532,9 @@ export interface MsgUpdateDateCriteriaProtoMsg { */ export interface MsgUpdateDateCriteriaAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** denom is the unique identifier of the basket. */ - denom: string; + denom?: string; /** * new_date_criteria is the new date criteria for batches admitted to the * basket. At most, only one of the date criteria fields can be set. @@ -553,7 +553,7 @@ export interface MsgUpdateDateCriteriaAminoMsg { export interface MsgUpdateDateCriteriaSDKType { authority: string; denom: string; - new_date_criteria: DateCriteriaSDKType; + new_date_criteria?: DateCriteriaSDKType; } /** * MsgUpdateDateCriteriaResponse is the Msg/UpdateDateCriteria response type. @@ -590,12 +590,13 @@ function createBaseMsgCreate(): MsgCreate { disableAutoRetire: false, creditTypeAbbrev: "", allowedClasses: [], - dateCriteria: DateCriteria.fromPartial({}), + dateCriteria: undefined, fee: [] }; } export const MsgCreate = { - encode(message: MsgCreate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgCreate", + encode(message: MsgCreate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.curator !== "") { writer.uint32(10).string(message.curator); } @@ -625,8 +626,8 @@ export const MsgCreate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreate(); while (reader.pos < end) { @@ -714,36 +715,50 @@ export const MsgCreate = { return message; }, fromAmino(object: MsgCreateAmino): MsgCreate { - return { - curator: object.curator, - name: object.name, - description: object.description, - exponent: object.exponent, - disableAutoRetire: object.disable_auto_retire, - creditTypeAbbrev: object.credit_type_abbrev, - allowedClasses: Array.isArray(object?.allowed_classes) ? object.allowed_classes.map((e: any) => e) : [], - dateCriteria: object?.date_criteria ? DateCriteria.fromAmino(object.date_criteria) : undefined, - fee: Array.isArray(object?.fee) ? object.fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgCreate(); + if (object.curator !== undefined && object.curator !== null) { + message.curator = object.curator; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + message.allowedClasses = object.allowed_classes?.map(e => e) || []; + if (object.date_criteria !== undefined && object.date_criteria !== null) { + message.dateCriteria = DateCriteria.fromAmino(object.date_criteria); + } + message.fee = object.fee?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCreate): MsgCreateAmino { const obj: any = {}; - obj.curator = message.curator; - obj.name = message.name; - obj.description = message.description; - obj.exponent = message.exponent; - obj.disable_auto_retire = message.disableAutoRetire; - obj.credit_type_abbrev = message.creditTypeAbbrev; + obj.curator = message.curator === "" ? undefined : message.curator; + obj.name = message.name === "" ? undefined : message.name; + obj.description = message.description === "" ? undefined : message.description; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; if (message.allowedClasses) { obj.allowed_classes = message.allowedClasses.map(e => e); } else { - obj.allowed_classes = []; + obj.allowed_classes = message.allowedClasses; } obj.date_criteria = message.dateCriteria ? DateCriteria.toAmino(message.dateCriteria) : undefined; if (message.fee) { obj.fee = message.fee.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.fee = []; + obj.fee = message.fee; } return obj; }, @@ -775,14 +790,15 @@ function createBaseMsgCreateResponse(): MsgCreateResponse { }; } export const MsgCreateResponse = { - encode(message: MsgCreateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgCreateResponse", + encode(message: MsgCreateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basketDenom !== "") { writer.uint32(10).string(message.basketDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateResponse(); while (reader.pos < end) { @@ -814,13 +830,15 @@ export const MsgCreateResponse = { return message; }, fromAmino(object: MsgCreateResponseAmino): MsgCreateResponse { - return { - basketDenom: object.basket_denom - }; + const message = createBaseMsgCreateResponse(); + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + return message; }, toAmino(message: MsgCreateResponse): MsgCreateResponseAmino { const obj: any = {}; - obj.basket_denom = message.basketDenom; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; return obj; }, fromAminoMsg(object: MsgCreateResponseAminoMsg): MsgCreateResponse { @@ -847,7 +865,8 @@ function createBaseMsgPut(): MsgPut { }; } export const MsgPut = { - encode(message: MsgPut, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgPut", + encode(message: MsgPut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -859,8 +878,8 @@ export const MsgPut = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPut { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPut { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPut(); while (reader.pos < end) { @@ -908,20 +927,24 @@ export const MsgPut = { return message; }, fromAmino(object: MsgPutAmino): MsgPut { - return { - owner: object.owner, - basketDenom: object.basket_denom, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => BasketCredit.fromAmino(e)) : [] - }; + const message = createBaseMsgPut(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + message.credits = object.credits?.map(e => BasketCredit.fromAmino(e)) || []; + return message; }, toAmino(message: MsgPut): MsgPutAmino { const obj: any = {}; - obj.owner = message.owner; - obj.basket_denom = message.basketDenom; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; if (message.credits) { obj.credits = message.credits.map(e => e ? BasketCredit.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } return obj; }, @@ -953,14 +976,15 @@ function createBaseMsgPutResponse(): MsgPutResponse { }; } export const MsgPutResponse = { - encode(message: MsgPutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgPutResponse", + encode(message: MsgPutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amountReceived !== "") { writer.uint32(10).string(message.amountReceived); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPutResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPutResponse(); while (reader.pos < end) { @@ -992,13 +1016,15 @@ export const MsgPutResponse = { return message; }, fromAmino(object: MsgPutResponseAmino): MsgPutResponse { - return { - amountReceived: object.amount_received - }; + const message = createBaseMsgPutResponse(); + if (object.amount_received !== undefined && object.amount_received !== null) { + message.amountReceived = object.amount_received; + } + return message; }, toAmino(message: MsgPutResponse): MsgPutResponseAmino { const obj: any = {}; - obj.amount_received = message.amountReceived; + obj.amount_received = message.amountReceived === "" ? undefined : message.amountReceived; return obj; }, fromAminoMsg(object: MsgPutResponseAminoMsg): MsgPutResponse { @@ -1029,7 +1055,8 @@ function createBaseMsgTake(): MsgTake { }; } export const MsgTake = { - encode(message: MsgTake, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgTake", + encode(message: MsgTake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -1053,8 +1080,8 @@ export const MsgTake = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTake { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTake(); while (reader.pos < end) { @@ -1122,25 +1149,39 @@ export const MsgTake = { return message; }, fromAmino(object: MsgTakeAmino): MsgTake { - return { - owner: object.owner, - basketDenom: object.basket_denom, - amount: object.amount, - retirementLocation: object.retirement_location, - retireOnTake: object.retire_on_take, - retirementJurisdiction: object.retirement_jurisdiction, - retirementReason: object.retirement_reason - }; + const message = createBaseMsgTake(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.retirement_location !== undefined && object.retirement_location !== null) { + message.retirementLocation = object.retirement_location; + } + if (object.retire_on_take !== undefined && object.retire_on_take !== null) { + message.retireOnTake = object.retire_on_take; + } + if (object.retirement_jurisdiction !== undefined && object.retirement_jurisdiction !== null) { + message.retirementJurisdiction = object.retirement_jurisdiction; + } + if (object.retirement_reason !== undefined && object.retirement_reason !== null) { + message.retirementReason = object.retirement_reason; + } + return message; }, toAmino(message: MsgTake): MsgTakeAmino { const obj: any = {}; - obj.owner = message.owner; - obj.basket_denom = message.basketDenom; - obj.amount = message.amount; - obj.retirement_location = message.retirementLocation; - obj.retire_on_take = message.retireOnTake; - obj.retirement_jurisdiction = message.retirementJurisdiction; - obj.retirement_reason = message.retirementReason; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.retirement_location = message.retirementLocation === "" ? undefined : message.retirementLocation; + obj.retire_on_take = message.retireOnTake === false ? undefined : message.retireOnTake; + obj.retirement_jurisdiction = message.retirementJurisdiction === "" ? undefined : message.retirementJurisdiction; + obj.retirement_reason = message.retirementReason === "" ? undefined : message.retirementReason; return obj; }, fromAminoMsg(object: MsgTakeAminoMsg): MsgTake { @@ -1171,14 +1212,15 @@ function createBaseMsgTakeResponse(): MsgTakeResponse { }; } export const MsgTakeResponse = { - encode(message: MsgTakeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgTakeResponse", + encode(message: MsgTakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.credits) { BasketCredit.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTakeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTakeResponse(); while (reader.pos < end) { @@ -1214,16 +1256,16 @@ export const MsgTakeResponse = { return message; }, fromAmino(object: MsgTakeResponseAmino): MsgTakeResponse { - return { - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => BasketCredit.fromAmino(e)) : [] - }; + const message = createBaseMsgTakeResponse(); + message.credits = object.credits?.map(e => BasketCredit.fromAmino(e)) || []; + return message; }, toAmino(message: MsgTakeResponse): MsgTakeResponseAmino { const obj: any = {}; if (message.credits) { obj.credits = message.credits.map(e => e ? BasketCredit.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } return obj; }, @@ -1250,7 +1292,8 @@ function createBaseMsgUpdateBasketFee(): MsgUpdateBasketFee { }; } export const MsgUpdateBasketFee = { - encode(message: MsgUpdateBasketFee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateBasketFee", + encode(message: MsgUpdateBasketFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1259,8 +1302,8 @@ export const MsgUpdateBasketFee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateBasketFee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateBasketFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateBasketFee(); while (reader.pos < end) { @@ -1298,14 +1341,18 @@ export const MsgUpdateBasketFee = { return message; }, fromAmino(object: MsgUpdateBasketFeeAmino): MsgUpdateBasketFee { - return { - authority: object.authority, - fee: object?.fee ? Coin.fromAmino(object.fee) : undefined - }; + const message = createBaseMsgUpdateBasketFee(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; }, toAmino(message: MsgUpdateBasketFee): MsgUpdateBasketFeeAmino { const obj: any = {}; - obj.authority = message.authority; + obj.authority = message.authority === "" ? undefined : message.authority; obj.fee = message.fee ? Coin.toAmino(message.fee) : undefined; return obj; }, @@ -1335,11 +1382,12 @@ function createBaseMsgUpdateBasketFeeResponse(): MsgUpdateBasketFeeResponse { return {}; } export const MsgUpdateBasketFeeResponse = { - encode(_: MsgUpdateBasketFeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateBasketFeeResponse", + encode(_: MsgUpdateBasketFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateBasketFeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateBasketFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateBasketFeeResponse(); while (reader.pos < end) { @@ -1364,7 +1412,8 @@ export const MsgUpdateBasketFeeResponse = { return message; }, fromAmino(_: MsgUpdateBasketFeeResponseAmino): MsgUpdateBasketFeeResponse { - return {}; + const message = createBaseMsgUpdateBasketFeeResponse(); + return message; }, toAmino(_: MsgUpdateBasketFeeResponse): MsgUpdateBasketFeeResponseAmino { const obj: any = {}; @@ -1394,7 +1443,8 @@ function createBaseMsgUpdateCurator(): MsgUpdateCurator { }; } export const MsgUpdateCurator = { - encode(message: MsgUpdateCurator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateCurator", + encode(message: MsgUpdateCurator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.curator !== "") { writer.uint32(10).string(message.curator); } @@ -1406,8 +1456,8 @@ export const MsgUpdateCurator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateCurator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateCurator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateCurator(); while (reader.pos < end) { @@ -1451,17 +1501,23 @@ export const MsgUpdateCurator = { return message; }, fromAmino(object: MsgUpdateCuratorAmino): MsgUpdateCurator { - return { - curator: object.curator, - denom: object.denom, - newCurator: object.new_curator - }; + const message = createBaseMsgUpdateCurator(); + if (object.curator !== undefined && object.curator !== null) { + message.curator = object.curator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_curator !== undefined && object.new_curator !== null) { + message.newCurator = object.new_curator; + } + return message; }, toAmino(message: MsgUpdateCurator): MsgUpdateCuratorAmino { const obj: any = {}; - obj.curator = message.curator; - obj.denom = message.denom; - obj.new_curator = message.newCurator; + obj.curator = message.curator === "" ? undefined : message.curator; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.new_curator = message.newCurator === "" ? undefined : message.newCurator; return obj; }, fromAminoMsg(object: MsgUpdateCuratorAminoMsg): MsgUpdateCurator { @@ -1490,11 +1546,12 @@ function createBaseMsgUpdateCuratorResponse(): MsgUpdateCuratorResponse { return {}; } export const MsgUpdateCuratorResponse = { - encode(_: MsgUpdateCuratorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateCuratorResponse", + encode(_: MsgUpdateCuratorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateCuratorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateCuratorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateCuratorResponse(); while (reader.pos < end) { @@ -1519,7 +1576,8 @@ export const MsgUpdateCuratorResponse = { return message; }, fromAmino(_: MsgUpdateCuratorResponseAmino): MsgUpdateCuratorResponse { - return {}; + const message = createBaseMsgUpdateCuratorResponse(); + return message; }, toAmino(_: MsgUpdateCuratorResponse): MsgUpdateCuratorResponseAmino { const obj: any = {}; @@ -1545,11 +1603,12 @@ function createBaseMsgUpdateDateCriteria(): MsgUpdateDateCriteria { return { authority: "", denom: "", - newDateCriteria: DateCriteria.fromPartial({}) + newDateCriteria: undefined }; } export const MsgUpdateDateCriteria = { - encode(message: MsgUpdateDateCriteria, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateDateCriteria", + encode(message: MsgUpdateDateCriteria, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1561,8 +1620,8 @@ export const MsgUpdateDateCriteria = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateDateCriteria { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDateCriteria { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateDateCriteria(); while (reader.pos < end) { @@ -1606,16 +1665,22 @@ export const MsgUpdateDateCriteria = { return message; }, fromAmino(object: MsgUpdateDateCriteriaAmino): MsgUpdateDateCriteria { - return { - authority: object.authority, - denom: object.denom, - newDateCriteria: object?.new_date_criteria ? DateCriteria.fromAmino(object.new_date_criteria) : undefined - }; + const message = createBaseMsgUpdateDateCriteria(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_date_criteria !== undefined && object.new_date_criteria !== null) { + message.newDateCriteria = DateCriteria.fromAmino(object.new_date_criteria); + } + return message; }, toAmino(message: MsgUpdateDateCriteria): MsgUpdateDateCriteriaAmino { const obj: any = {}; - obj.authority = message.authority; - obj.denom = message.denom; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.denom = message.denom === "" ? undefined : message.denom; obj.new_date_criteria = message.newDateCriteria ? DateCriteria.toAmino(message.newDateCriteria) : undefined; return obj; }, @@ -1645,11 +1710,12 @@ function createBaseMsgUpdateDateCriteriaResponse(): MsgUpdateDateCriteriaRespons return {}; } export const MsgUpdateDateCriteriaResponse = { - encode(_: MsgUpdateDateCriteriaResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.MsgUpdateDateCriteriaResponse", + encode(_: MsgUpdateDateCriteriaResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateDateCriteriaResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateDateCriteriaResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateDateCriteriaResponse(); while (reader.pos < end) { @@ -1674,7 +1740,8 @@ export const MsgUpdateDateCriteriaResponse = { return message; }, fromAmino(_: MsgUpdateDateCriteriaResponseAmino): MsgUpdateDateCriteriaResponse { - return {}; + const message = createBaseMsgUpdateDateCriteriaResponse(); + return message; }, toAmino(_: MsgUpdateDateCriteriaResponse): MsgUpdateDateCriteriaResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/ecocredit/basket/v1/types.ts b/packages/api/src/codegen/regen/ecocredit/basket/v1/types.ts index f1a8a1a9..6a825326 100644 --- a/packages/api/src/codegen/regen/ecocredit/basket/v1/types.ts +++ b/packages/api/src/codegen/regen/ecocredit/basket/v1/types.ts @@ -1,6 +1,6 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; /** BasketCredit represents the information for a credit batch inside a basket. */ export interface BasketCredit { @@ -20,13 +20,13 @@ export interface BasketCreditProtoMsg { /** BasketCredit represents the information for a credit batch inside a basket. */ export interface BasketCreditAmino { /** batch_denom is the unique ID of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** * amount is the number of credits being put into or taken out of the basket. * Decimal values are acceptable within the precision of the corresponding * credit type for this batch. */ - amount: string; + amount?: string; } export interface BasketCreditAminoMsg { type: "/regen.ecocredit.basket.v1.BasketCredit"; @@ -47,7 +47,7 @@ export interface DateCriteria { * allowed into the basket. At most only one of `start_date_window`, * `min_start_date`, and `years_in_the_past` can be set for a basket. */ - minStartDate: Timestamp; + minStartDate?: Timestamp; /** * start_date_window (optional) is a duration of time measured into the past * which sets a cutoff for batch start dates when adding new credits to the @@ -56,7 +56,7 @@ export interface DateCriteria { * basket. At most only one of `start_date_window`, `min_start_date`, and * `years_in_the_past` can be set for a basket. */ - startDateWindow: Duration; + startDateWindow?: Duration; /** * years_in_the_past (optional) is the number of years into the past which * sets a cutoff for the batch start dates when adding new credits to the @@ -83,7 +83,7 @@ export interface DateCriteriaAmino { * allowed into the basket. At most only one of `start_date_window`, * `min_start_date`, and `years_in_the_past` can be set for a basket. */ - min_start_date?: TimestampAmino; + min_start_date?: string; /** * start_date_window (optional) is a duration of time measured into the past * which sets a cutoff for batch start dates when adding new credits to the @@ -103,7 +103,7 @@ export interface DateCriteriaAmino { * * Since Revision 1 */ - years_in_the_past: number; + years_in_the_past?: number; } export interface DateCriteriaAminoMsg { type: "/regen.ecocredit.basket.v1.DateCriteria"; @@ -114,8 +114,8 @@ export interface DateCriteriaAminoMsg { * At most, only one of the values should be set. */ export interface DateCriteriaSDKType { - min_start_date: TimestampSDKType; - start_date_window: DurationSDKType; + min_start_date?: TimestampSDKType; + start_date_window?: DurationSDKType; years_in_the_past: number; } function createBaseBasketCredit(): BasketCredit { @@ -125,7 +125,8 @@ function createBaseBasketCredit(): BasketCredit { }; } export const BasketCredit = { - encode(message: BasketCredit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.BasketCredit", + encode(message: BasketCredit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -134,8 +135,8 @@ export const BasketCredit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasketCredit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasketCredit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasketCredit(); while (reader.pos < end) { @@ -173,15 +174,19 @@ export const BasketCredit = { return message; }, fromAmino(object: BasketCreditAmino): BasketCredit { - return { - batchDenom: object.batch_denom, - amount: object.amount - }; + const message = createBaseBasketCredit(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: BasketCredit): BasketCreditAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: BasketCreditAminoMsg): BasketCredit { @@ -208,7 +213,8 @@ function createBaseDateCriteria(): DateCriteria { }; } export const DateCriteria = { - encode(message: DateCriteria, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.basket.v1.DateCriteria", + encode(message: DateCriteria, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minStartDate !== undefined) { Timestamp.encode(message.minStartDate, writer.uint32(10).fork()).ldelim(); } @@ -220,8 +226,8 @@ export const DateCriteria = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DateCriteria { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DateCriteria { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDateCriteria(); while (reader.pos < end) { @@ -265,17 +271,23 @@ export const DateCriteria = { return message; }, fromAmino(object: DateCriteriaAmino): DateCriteria { - return { - minStartDate: object?.min_start_date ? Timestamp.fromAmino(object.min_start_date) : undefined, - startDateWindow: object?.start_date_window ? Duration.fromAmino(object.start_date_window) : undefined, - yearsInThePast: object.years_in_the_past - }; + const message = createBaseDateCriteria(); + if (object.min_start_date !== undefined && object.min_start_date !== null) { + message.minStartDate = Timestamp.fromAmino(object.min_start_date); + } + if (object.start_date_window !== undefined && object.start_date_window !== null) { + message.startDateWindow = Duration.fromAmino(object.start_date_window); + } + if (object.years_in_the_past !== undefined && object.years_in_the_past !== null) { + message.yearsInThePast = object.years_in_the_past; + } + return message; }, toAmino(message: DateCriteria): DateCriteriaAmino { const obj: any = {}; obj.min_start_date = message.minStartDate ? Timestamp.toAmino(message.minStartDate) : undefined; obj.start_date_window = message.startDateWindow ? Duration.toAmino(message.startDateWindow) : undefined; - obj.years_in_the_past = message.yearsInThePast; + obj.years_in_the_past = message.yearsInThePast === 0 ? undefined : message.yearsInThePast; return obj; }, fromAminoMsg(object: DateCriteriaAminoMsg): DateCriteria { diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/events.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/events.ts index f2e8be6b..6e423b15 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/events.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/events.ts @@ -1,9 +1,9 @@ -import { Long, isSet } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; /** EventSell is an event emitted when a sell order is created. */ export interface EventSell { /** sell_order_id is the unique identifier of the sell order that was created. */ - sellOrderId: Long; + sellOrderId: bigint; } export interface EventSellProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.EventSell"; @@ -12,7 +12,7 @@ export interface EventSellProtoMsg { /** EventSell is an event emitted when a sell order is created. */ export interface EventSellAmino { /** sell_order_id is the unique identifier of the sell order that was created. */ - sell_order_id: string; + sell_order_id?: string; } export interface EventSellAminoMsg { type: "/regen.ecocredit.marketplace.v1.EventSell"; @@ -20,7 +20,7 @@ export interface EventSellAminoMsg { } /** EventSell is an event emitted when a sell order is created. */ export interface EventSellSDKType { - sell_order_id: Long; + sell_order_id: bigint; } /** EventBuyDirect is an event emitted when a direct buy order is processed. */ export interface EventBuyDirect { @@ -28,7 +28,7 @@ export interface EventBuyDirect { * sell_order_id is the unique identifier of the sell order that credits were * purchased from. */ - sellOrderId: Long; + sellOrderId: bigint; } export interface EventBuyDirectProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.EventBuyDirect"; @@ -40,7 +40,7 @@ export interface EventBuyDirectAmino { * sell_order_id is the unique identifier of the sell order that credits were * purchased from. */ - sell_order_id: string; + sell_order_id?: string; } export interface EventBuyDirectAminoMsg { type: "/regen.ecocredit.marketplace.v1.EventBuyDirect"; @@ -48,12 +48,12 @@ export interface EventBuyDirectAminoMsg { } /** EventBuyDirect is an event emitted when a direct buy order is processed. */ export interface EventBuyDirectSDKType { - sell_order_id: Long; + sell_order_id: bigint; } /** EventUpdateSellOrder is an event emitted when a sell order is updated. */ export interface EventUpdateSellOrder { /** sell_order_id is the unique identifier of the sell order that was updated. */ - sellOrderId: Long; + sellOrderId: bigint; } export interface EventUpdateSellOrderProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.EventUpdateSellOrder"; @@ -62,7 +62,7 @@ export interface EventUpdateSellOrderProtoMsg { /** EventUpdateSellOrder is an event emitted when a sell order is updated. */ export interface EventUpdateSellOrderAmino { /** sell_order_id is the unique identifier of the sell order that was updated. */ - sell_order_id: string; + sell_order_id?: string; } export interface EventUpdateSellOrderAminoMsg { type: "/regen.ecocredit.marketplace.v1.EventUpdateSellOrder"; @@ -70,7 +70,7 @@ export interface EventUpdateSellOrderAminoMsg { } /** EventUpdateSellOrder is an event emitted when a sell order is updated. */ export interface EventUpdateSellOrderSDKType { - sell_order_id: Long; + sell_order_id: bigint; } /** EventCancelSellOrder is an event emitted when a sell order is cancelled. */ export interface EventCancelSellOrder { @@ -78,7 +78,7 @@ export interface EventCancelSellOrder { * sell_order_id is the unique identifier of the sell order that was * cancelled. */ - sellOrderId: Long; + sellOrderId: bigint; } export interface EventCancelSellOrderProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.EventCancelSellOrder"; @@ -90,7 +90,7 @@ export interface EventCancelSellOrderAmino { * sell_order_id is the unique identifier of the sell order that was * cancelled. */ - sell_order_id: string; + sell_order_id?: string; } export interface EventCancelSellOrderAminoMsg { type: "/regen.ecocredit.marketplace.v1.EventCancelSellOrder"; @@ -98,7 +98,7 @@ export interface EventCancelSellOrderAminoMsg { } /** EventCancelSellOrder is an event emitted when a sell order is cancelled. */ export interface EventCancelSellOrderSDKType { - sell_order_id: Long; + sell_order_id: bigint; } /** * EventAllowDenom is an event emitted when a new denom is added for use in the @@ -124,7 +124,7 @@ export interface EventAllowDenomAmino { * denom is the bank denom (e.g. ibc/GLKHDSG423SGS) added to the list of * allowed denoms for use in the marketplace. */ - denom: string; + denom?: string; } export interface EventAllowDenomAminoMsg { type: "/regen.ecocredit.marketplace.v1.EventAllowDenom"; @@ -165,7 +165,7 @@ export interface EventRemoveAllowedDenomAmino { * denom is the bank denom (e.g. ibc/GLKHDSG423SGS) removed from the list of * allowed denoms for use in the marketplace. */ - denom: string; + denom?: string; } export interface EventRemoveAllowedDenomAminoMsg { type: "/regen.ecocredit.marketplace.v1.EventRemoveAllowedDenom"; @@ -182,25 +182,26 @@ export interface EventRemoveAllowedDenomSDKType { } function createBaseEventSell(): EventSell { return { - sellOrderId: Long.UZERO + sellOrderId: BigInt(0) }; } export const EventSell = { - encode(message: EventSell, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sellOrderId.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.EventSell", + encode(message: EventSell, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.sellOrderId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventSell { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventSell { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSell(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -211,27 +212,29 @@ export const EventSell = { }, fromJSON(object: any): EventSell { return { - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0) }; }, toJSON(message: EventSell): unknown { const obj: any = {}; - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventSell { const message = createBaseEventSell(); - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); return message; }, fromAmino(object: EventSellAmino): EventSell { - return { - sellOrderId: Long.fromString(object.sell_order_id) - }; + const message = createBaseEventSell(); + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + return message; }, toAmino(message: EventSell): EventSellAmino { const obj: any = {}; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; return obj; }, fromAminoMsg(object: EventSellAminoMsg): EventSell { @@ -252,25 +255,26 @@ export const EventSell = { }; function createBaseEventBuyDirect(): EventBuyDirect { return { - sellOrderId: Long.UZERO + sellOrderId: BigInt(0) }; } export const EventBuyDirect = { - encode(message: EventBuyDirect, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sellOrderId.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.EventBuyDirect", + encode(message: EventBuyDirect, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.sellOrderId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventBuyDirect { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventBuyDirect { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventBuyDirect(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -281,27 +285,29 @@ export const EventBuyDirect = { }, fromJSON(object: any): EventBuyDirect { return { - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0) }; }, toJSON(message: EventBuyDirect): unknown { const obj: any = {}; - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventBuyDirect { const message = createBaseEventBuyDirect(); - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); return message; }, fromAmino(object: EventBuyDirectAmino): EventBuyDirect { - return { - sellOrderId: Long.fromString(object.sell_order_id) - }; + const message = createBaseEventBuyDirect(); + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + return message; }, toAmino(message: EventBuyDirect): EventBuyDirectAmino { const obj: any = {}; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; return obj; }, fromAminoMsg(object: EventBuyDirectAminoMsg): EventBuyDirect { @@ -322,25 +328,26 @@ export const EventBuyDirect = { }; function createBaseEventUpdateSellOrder(): EventUpdateSellOrder { return { - sellOrderId: Long.UZERO + sellOrderId: BigInt(0) }; } export const EventUpdateSellOrder = { - encode(message: EventUpdateSellOrder, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sellOrderId.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.EventUpdateSellOrder", + encode(message: EventUpdateSellOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.sellOrderId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateSellOrder { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateSellOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateSellOrder(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -351,27 +358,29 @@ export const EventUpdateSellOrder = { }, fromJSON(object: any): EventUpdateSellOrder { return { - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0) }; }, toJSON(message: EventUpdateSellOrder): unknown { const obj: any = {}; - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventUpdateSellOrder { const message = createBaseEventUpdateSellOrder(); - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); return message; }, fromAmino(object: EventUpdateSellOrderAmino): EventUpdateSellOrder { - return { - sellOrderId: Long.fromString(object.sell_order_id) - }; + const message = createBaseEventUpdateSellOrder(); + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + return message; }, toAmino(message: EventUpdateSellOrder): EventUpdateSellOrderAmino { const obj: any = {}; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; return obj; }, fromAminoMsg(object: EventUpdateSellOrderAminoMsg): EventUpdateSellOrder { @@ -392,25 +401,26 @@ export const EventUpdateSellOrder = { }; function createBaseEventCancelSellOrder(): EventCancelSellOrder { return { - sellOrderId: Long.UZERO + sellOrderId: BigInt(0) }; } export const EventCancelSellOrder = { - encode(message: EventCancelSellOrder, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sellOrderId.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.EventCancelSellOrder", + encode(message: EventCancelSellOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.sellOrderId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCancelSellOrder { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCancelSellOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCancelSellOrder(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -421,27 +431,29 @@ export const EventCancelSellOrder = { }, fromJSON(object: any): EventCancelSellOrder { return { - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0) }; }, toJSON(message: EventCancelSellOrder): unknown { const obj: any = {}; - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EventCancelSellOrder { const message = createBaseEventCancelSellOrder(); - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); return message; }, fromAmino(object: EventCancelSellOrderAmino): EventCancelSellOrder { - return { - sellOrderId: Long.fromString(object.sell_order_id) - }; + const message = createBaseEventCancelSellOrder(); + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + return message; }, toAmino(message: EventCancelSellOrder): EventCancelSellOrderAmino { const obj: any = {}; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; return obj; }, fromAminoMsg(object: EventCancelSellOrderAminoMsg): EventCancelSellOrder { @@ -466,14 +478,15 @@ function createBaseEventAllowDenom(): EventAllowDenom { }; } export const EventAllowDenom = { - encode(message: EventAllowDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.EventAllowDenom", + encode(message: EventAllowDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventAllowDenom { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventAllowDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventAllowDenom(); while (reader.pos < end) { @@ -505,13 +518,15 @@ export const EventAllowDenom = { return message; }, fromAmino(object: EventAllowDenomAmino): EventAllowDenom { - return { - denom: object.denom - }; + const message = createBaseEventAllowDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: EventAllowDenom): EventAllowDenomAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: EventAllowDenomAminoMsg): EventAllowDenom { @@ -536,14 +551,15 @@ function createBaseEventRemoveAllowedDenom(): EventRemoveAllowedDenom { }; } export const EventRemoveAllowedDenom = { - encode(message: EventRemoveAllowedDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.EventRemoveAllowedDenom", + encode(message: EventRemoveAllowedDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventRemoveAllowedDenom { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventRemoveAllowedDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventRemoveAllowedDenom(); while (reader.pos < end) { @@ -575,13 +591,15 @@ export const EventRemoveAllowedDenom = { return message; }, fromAmino(object: EventRemoveAllowedDenomAmino): EventRemoveAllowedDenom { - return { - denom: object.denom - }; + const message = createBaseEventRemoveAllowedDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: EventRemoveAllowedDenom): EventRemoveAllowedDenomAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: EventRemoveAllowedDenomAminoMsg): EventRemoveAllowedDenom { diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.lcd.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.lcd.ts index 7ec2d999..2eb26fe6 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.lcd.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QuerySellOrderRequest, QuerySellOrderResponseSDKType, QuerySellOrdersRequest, QuerySellOrdersResponseSDKType, QuerySellOrdersByBatchRequest, QuerySellOrdersByBatchResponseSDKType, QuerySellOrdersBySellerRequest, QuerySellOrdersBySellerResponseSDKType, QueryAllowedDenomsRequest, QueryAllowedDenomsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.rpc.Query.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.rpc.Query.ts index 6fcd5ab1..7e029969 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QuerySellOrderRequest, QuerySellOrderResponse, QuerySellOrdersRequest, QuerySellOrdersResponse, QuerySellOrdersByBatchRequest, QuerySellOrdersByBatchResponse, QuerySellOrdersBySellerRequest, QuerySellOrdersBySellerResponse, QueryAllowedDenomsRequest, QueryAllowedDenomsResponse } from "./query"; /** Msg is the regen.ecocredit.marketplace.v1 Query service. */ @@ -37,31 +37,31 @@ export class QueryClientImpl implements Query { sellOrder(request: QuerySellOrderRequest): Promise { const data = QuerySellOrderRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Query", "SellOrder", data); - return promise.then(data => QuerySellOrderResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySellOrderResponse.decode(new BinaryReader(data))); } sellOrders(request: QuerySellOrdersRequest = { pagination: undefined }): Promise { const data = QuerySellOrdersRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Query", "SellOrders", data); - return promise.then(data => QuerySellOrdersResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySellOrdersResponse.decode(new BinaryReader(data))); } sellOrdersByBatch(request: QuerySellOrdersByBatchRequest): Promise { const data = QuerySellOrdersByBatchRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Query", "SellOrdersByBatch", data); - return promise.then(data => QuerySellOrdersByBatchResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySellOrdersByBatchResponse.decode(new BinaryReader(data))); } sellOrdersBySeller(request: QuerySellOrdersBySellerRequest): Promise { const data = QuerySellOrdersBySellerRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Query", "SellOrdersBySeller", data); - return promise.then(data => QuerySellOrdersBySellerResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySellOrdersBySellerResponse.decode(new BinaryReader(data))); } allowedDenoms(request: QueryAllowedDenomsRequest = { pagination: undefined }): Promise { const data = QueryAllowedDenomsRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Query", "AllowedDenoms", data); - return promise.then(data => QueryAllowedDenomsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllowedDenomsResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.ts index 579bf361..4b90f451 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/query.ts @@ -1,12 +1,12 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { AllowedDenom, AllowedDenomAmino, AllowedDenomSDKType } from "./state"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; /** QuerySellOrderRequest is the Query/SellOrder request type. */ export interface QuerySellOrderRequest { /** sell_order_id is the id of the requested sell order. */ - sellOrderId: Long; + sellOrderId: bigint; } export interface QuerySellOrderRequestProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrderRequest"; @@ -15,7 +15,7 @@ export interface QuerySellOrderRequestProtoMsg { /** QuerySellOrderRequest is the Query/SellOrder request type. */ export interface QuerySellOrderRequestAmino { /** sell_order_id is the id of the requested sell order. */ - sell_order_id: string; + sell_order_id?: string; } export interface QuerySellOrderRequestAminoMsg { type: "/regen.ecocredit.marketplace.v1.QuerySellOrderRequest"; @@ -23,12 +23,12 @@ export interface QuerySellOrderRequestAminoMsg { } /** QuerySellOrderRequest is the Query/SellOrder request type. */ export interface QuerySellOrderRequestSDKType { - sell_order_id: Long; + sell_order_id: bigint; } /** QuerySellOrderResponse is the Query/SellOrder response type. */ export interface QuerySellOrderResponse { /** sell_order contains all information related to a sell order. */ - sellOrder: SellOrderInfo; + sellOrder?: SellOrderInfo; } export interface QuerySellOrderResponseProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrderResponse"; @@ -45,12 +45,12 @@ export interface QuerySellOrderResponseAminoMsg { } /** QuerySellOrderResponse is the Query/SellOrder response type. */ export interface QuerySellOrderResponseSDKType { - sell_order: SellOrderInfoSDKType; + sell_order?: SellOrderInfoSDKType; } /** QuerySellOrdersRequest is the Query/SellOrders request type. */ export interface QuerySellOrdersRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QuerySellOrdersRequestProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersRequest"; @@ -67,14 +67,14 @@ export interface QuerySellOrdersRequestAminoMsg { } /** QuerySellOrdersRequest is the Query/SellOrders request type. */ export interface QuerySellOrdersRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QuerySellOrdersResponse is the Query/SellOrders response type. */ export interface QuerySellOrdersResponse { /** sell_orders is a list of sell orders. */ sellOrders: SellOrderInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QuerySellOrdersResponseProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersResponse"; @@ -83,7 +83,7 @@ export interface QuerySellOrdersResponseProtoMsg { /** QuerySellOrdersResponse is the Query/SellOrders response type. */ export interface QuerySellOrdersResponseAmino { /** sell_orders is a list of sell orders. */ - sell_orders: SellOrderInfoAmino[]; + sell_orders?: SellOrderInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -94,7 +94,7 @@ export interface QuerySellOrdersResponseAminoMsg { /** QuerySellOrdersResponse is the Query/SellOrders response type. */ export interface QuerySellOrdersResponseSDKType { sell_orders: SellOrderInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QuerySellOrdersByBatchRequest is the Query/SellOrdersByBatch @@ -104,7 +104,7 @@ export interface QuerySellOrdersByBatchRequest { /** batch_denom is an ecocredit denom */ batchDenom: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QuerySellOrdersByBatchRequestProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersByBatchRequest"; @@ -116,7 +116,7 @@ export interface QuerySellOrdersByBatchRequestProtoMsg { */ export interface QuerySellOrdersByBatchRequestAmino { /** batch_denom is an ecocredit denom */ - batch_denom: string; + batch_denom?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -130,7 +130,7 @@ export interface QuerySellOrdersByBatchRequestAminoMsg { */ export interface QuerySellOrdersByBatchRequestSDKType { batch_denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QuerySellOrdersByBatchResponse is the Query/SellOrdersByBatch @@ -140,7 +140,7 @@ export interface QuerySellOrdersByBatchResponse { /** sell_orders is a list of sell orders. */ sellOrders: SellOrderInfo[]; /** pagination defines an optional pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QuerySellOrdersByBatchResponseProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersByBatchResponse"; @@ -152,7 +152,7 @@ export interface QuerySellOrdersByBatchResponseProtoMsg { */ export interface QuerySellOrdersByBatchResponseAmino { /** sell_orders is a list of sell orders. */ - sell_orders: SellOrderInfoAmino[]; + sell_orders?: SellOrderInfoAmino[]; /** pagination defines an optional pagination for the response. */ pagination?: PageResponseAmino; } @@ -166,7 +166,7 @@ export interface QuerySellOrdersByBatchResponseAminoMsg { */ export interface QuerySellOrdersByBatchResponseSDKType { sell_orders: SellOrderInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QuerySellOrdersBySellerRequest is the Query/SellOrdersBySeller request @@ -176,7 +176,7 @@ export interface QuerySellOrdersBySellerRequest { /** seller is the address of the account that is selling credits. */ seller: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QuerySellOrdersBySellerRequestProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersBySellerRequest"; @@ -188,7 +188,7 @@ export interface QuerySellOrdersBySellerRequestProtoMsg { */ export interface QuerySellOrdersBySellerRequestAmino { /** seller is the address of the account that is selling credits. */ - seller: string; + seller?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -202,7 +202,7 @@ export interface QuerySellOrdersBySellerRequestAminoMsg { */ export interface QuerySellOrdersBySellerRequestSDKType { seller: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QuerySellOrdersBySellerResponse is the Query/SellOrdersBySellerResponse @@ -212,7 +212,7 @@ export interface QuerySellOrdersBySellerResponse { /** sell_orders is a list of sell orders. */ sellOrders: SellOrderInfo[]; /** pagination defines an optional pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QuerySellOrdersBySellerResponseProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersBySellerResponse"; @@ -224,7 +224,7 @@ export interface QuerySellOrdersBySellerResponseProtoMsg { */ export interface QuerySellOrdersBySellerResponseAmino { /** sell_orders is a list of sell orders. */ - sell_orders: SellOrderInfoAmino[]; + sell_orders?: SellOrderInfoAmino[]; /** pagination defines an optional pagination for the response. */ pagination?: PageResponseAmino; } @@ -238,12 +238,12 @@ export interface QuerySellOrdersBySellerResponseAminoMsg { */ export interface QuerySellOrdersBySellerResponseSDKType { sell_orders: SellOrderInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryAllowedDenomsRequest is the Query/AllowedDenoms request type. */ export interface QueryAllowedDenomsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllowedDenomsRequestProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QueryAllowedDenomsRequest"; @@ -260,7 +260,7 @@ export interface QueryAllowedDenomsRequestAminoMsg { } /** QueryAllowedDenomsRequest is the Query/AllowedDenoms request type. */ export interface QueryAllowedDenomsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryAllowedDenomsResponse is the Query/AllowedDenoms response type. */ export interface QueryAllowedDenomsResponse { @@ -270,7 +270,7 @@ export interface QueryAllowedDenomsResponse { */ allowedDenoms: AllowedDenom[]; /** pagination defines an optional pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllowedDenomsResponseProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.QueryAllowedDenomsResponse"; @@ -282,7 +282,7 @@ export interface QueryAllowedDenomsResponseAmino { * allowed_denoms is a list of coin denoms allowed to use in the ask price of * sell orders. */ - allowed_denoms: AllowedDenomAmino[]; + allowed_denoms?: AllowedDenomAmino[]; /** pagination defines an optional pagination for the response. */ pagination?: PageResponseAmino; } @@ -293,12 +293,12 @@ export interface QueryAllowedDenomsResponseAminoMsg { /** QueryAllowedDenomsResponse is the Query/AllowedDenoms response type. */ export interface QueryAllowedDenomsResponseSDKType { allowed_denoms: AllowedDenomSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** SellOrderInfo is the human-readable sell order information. */ export interface SellOrderInfo { /** id is the unique ID of sell order. */ - id: Long; + id: bigint; /** seller is the address of the account that is selling credits. */ seller: string; /** batch_denom is denom of the credit batch being sold. */ @@ -323,7 +323,7 @@ export interface SellOrderInfo { * expiration is an optional timestamp when the sell order expires. When the * expiration time is reached, the sell order is removed from state. */ - expiration: Timestamp; + expiration?: Timestamp; } export interface SellOrderInfoProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.SellOrderInfo"; @@ -332,32 +332,32 @@ export interface SellOrderInfoProtoMsg { /** SellOrderInfo is the human-readable sell order information. */ export interface SellOrderInfoAmino { /** id is the unique ID of sell order. */ - id: string; + id?: string; /** seller is the address of the account that is selling credits. */ - seller: string; + seller?: string; /** batch_denom is denom of the credit batch being sold. */ - batch_denom: string; + batch_denom?: string; /** quantity is the decimal quantity of credits being sold. */ - quantity: string; + quantity?: string; /** ask_denom is the denom used in the ask price of the sell order. */ - ask_denom: string; + ask_denom?: string; /** * ask_amount is the amount that the seller is asking for each credit unit of * the batch. Each credit unit of the batch will be sold for at least the * ask_amount. */ - ask_amount: string; + ask_amount?: string; /** * disable_auto_retire disables auto-retirement of credits which allows a * buyer to disable auto-retirement in their buy order enabling them to * resell the credits to another buyer. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * expiration is an optional timestamp when the sell order expires. When the * expiration time is reached, the sell order is removed from state. */ - expiration?: TimestampAmino; + expiration?: string; } export interface SellOrderInfoAminoMsg { type: "/regen.ecocredit.marketplace.v1.SellOrderInfo"; @@ -365,36 +365,37 @@ export interface SellOrderInfoAminoMsg { } /** SellOrderInfo is the human-readable sell order information. */ export interface SellOrderInfoSDKType { - id: Long; + id: bigint; seller: string; batch_denom: string; quantity: string; ask_denom: string; ask_amount: string; disable_auto_retire: boolean; - expiration: TimestampSDKType; + expiration?: TimestampSDKType; } function createBaseQuerySellOrderRequest(): QuerySellOrderRequest { return { - sellOrderId: Long.UZERO + sellOrderId: BigInt(0) }; } export const QuerySellOrderRequest = { - encode(message: QuerySellOrderRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sellOrderId.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrderRequest", + encode(message: QuerySellOrderRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.sellOrderId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrderRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrderRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrderRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -405,27 +406,29 @@ export const QuerySellOrderRequest = { }, fromJSON(object: any): QuerySellOrderRequest { return { - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0) }; }, toJSON(message: QuerySellOrderRequest): unknown { const obj: any = {}; - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): QuerySellOrderRequest { const message = createBaseQuerySellOrderRequest(); - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); return message; }, fromAmino(object: QuerySellOrderRequestAmino): QuerySellOrderRequest { - return { - sellOrderId: Long.fromString(object.sell_order_id) - }; + const message = createBaseQuerySellOrderRequest(); + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + return message; }, toAmino(message: QuerySellOrderRequest): QuerySellOrderRequestAmino { const obj: any = {}; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; return obj; }, fromAminoMsg(object: QuerySellOrderRequestAminoMsg): QuerySellOrderRequest { @@ -446,18 +449,19 @@ export const QuerySellOrderRequest = { }; function createBaseQuerySellOrderResponse(): QuerySellOrderResponse { return { - sellOrder: SellOrderInfo.fromPartial({}) + sellOrder: undefined }; } export const QuerySellOrderResponse = { - encode(message: QuerySellOrderResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrderResponse", + encode(message: QuerySellOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sellOrder !== undefined) { SellOrderInfo.encode(message.sellOrder, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrderResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrderResponse(); while (reader.pos < end) { @@ -489,9 +493,11 @@ export const QuerySellOrderResponse = { return message; }, fromAmino(object: QuerySellOrderResponseAmino): QuerySellOrderResponse { - return { - sellOrder: object?.sell_order ? SellOrderInfo.fromAmino(object.sell_order) : undefined - }; + const message = createBaseQuerySellOrderResponse(); + if (object.sell_order !== undefined && object.sell_order !== null) { + message.sellOrder = SellOrderInfo.fromAmino(object.sell_order); + } + return message; }, toAmino(message: QuerySellOrderResponse): QuerySellOrderResponseAmino { const obj: any = {}; @@ -516,18 +522,19 @@ export const QuerySellOrderResponse = { }; function createBaseQuerySellOrdersRequest(): QuerySellOrdersRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QuerySellOrdersRequest = { - encode(message: QuerySellOrdersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersRequest", + encode(message: QuerySellOrdersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrdersRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrdersRequest(); while (reader.pos < end) { @@ -559,9 +566,11 @@ export const QuerySellOrdersRequest = { return message; }, fromAmino(object: QuerySellOrdersRequestAmino): QuerySellOrdersRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySellOrdersRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySellOrdersRequest): QuerySellOrdersRequestAmino { const obj: any = {}; @@ -587,11 +596,12 @@ export const QuerySellOrdersRequest = { function createBaseQuerySellOrdersResponse(): QuerySellOrdersResponse { return { sellOrders: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QuerySellOrdersResponse = { - encode(message: QuerySellOrdersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersResponse", + encode(message: QuerySellOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.sellOrders) { SellOrderInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -600,8 +610,8 @@ export const QuerySellOrdersResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrdersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrdersResponse(); while (reader.pos < end) { @@ -643,17 +653,19 @@ export const QuerySellOrdersResponse = { return message; }, fromAmino(object: QuerySellOrdersResponseAmino): QuerySellOrdersResponse { - return { - sellOrders: Array.isArray(object?.sell_orders) ? object.sell_orders.map((e: any) => SellOrderInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySellOrdersResponse(); + message.sellOrders = object.sell_orders?.map(e => SellOrderInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySellOrdersResponse): QuerySellOrdersResponseAmino { const obj: any = {}; if (message.sellOrders) { obj.sell_orders = message.sellOrders.map(e => e ? SellOrderInfo.toAmino(e) : undefined); } else { - obj.sell_orders = []; + obj.sell_orders = message.sellOrders; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -677,11 +689,12 @@ export const QuerySellOrdersResponse = { function createBaseQuerySellOrdersByBatchRequest(): QuerySellOrdersByBatchRequest { return { batchDenom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QuerySellOrdersByBatchRequest = { - encode(message: QuerySellOrdersByBatchRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersByBatchRequest", + encode(message: QuerySellOrdersByBatchRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -690,8 +703,8 @@ export const QuerySellOrdersByBatchRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrdersByBatchRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrdersByBatchRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrdersByBatchRequest(); while (reader.pos < end) { @@ -729,14 +742,18 @@ export const QuerySellOrdersByBatchRequest = { return message; }, fromAmino(object: QuerySellOrdersByBatchRequestAmino): QuerySellOrdersByBatchRequest { - return { - batchDenom: object.batch_denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySellOrdersByBatchRequest(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySellOrdersByBatchRequest): QuerySellOrdersByBatchRequestAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -759,11 +776,12 @@ export const QuerySellOrdersByBatchRequest = { function createBaseQuerySellOrdersByBatchResponse(): QuerySellOrdersByBatchResponse { return { sellOrders: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QuerySellOrdersByBatchResponse = { - encode(message: QuerySellOrdersByBatchResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersByBatchResponse", + encode(message: QuerySellOrdersByBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.sellOrders) { SellOrderInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -772,8 +790,8 @@ export const QuerySellOrdersByBatchResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrdersByBatchResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrdersByBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrdersByBatchResponse(); while (reader.pos < end) { @@ -815,17 +833,19 @@ export const QuerySellOrdersByBatchResponse = { return message; }, fromAmino(object: QuerySellOrdersByBatchResponseAmino): QuerySellOrdersByBatchResponse { - return { - sellOrders: Array.isArray(object?.sell_orders) ? object.sell_orders.map((e: any) => SellOrderInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySellOrdersByBatchResponse(); + message.sellOrders = object.sell_orders?.map(e => SellOrderInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySellOrdersByBatchResponse): QuerySellOrdersByBatchResponseAmino { const obj: any = {}; if (message.sellOrders) { obj.sell_orders = message.sellOrders.map(e => e ? SellOrderInfo.toAmino(e) : undefined); } else { - obj.sell_orders = []; + obj.sell_orders = message.sellOrders; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -849,11 +869,12 @@ export const QuerySellOrdersByBatchResponse = { function createBaseQuerySellOrdersBySellerRequest(): QuerySellOrdersBySellerRequest { return { seller: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QuerySellOrdersBySellerRequest = { - encode(message: QuerySellOrdersBySellerRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersBySellerRequest", + encode(message: QuerySellOrdersBySellerRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.seller !== "") { writer.uint32(10).string(message.seller); } @@ -862,8 +883,8 @@ export const QuerySellOrdersBySellerRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrdersBySellerRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrdersBySellerRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrdersBySellerRequest(); while (reader.pos < end) { @@ -901,14 +922,18 @@ export const QuerySellOrdersBySellerRequest = { return message; }, fromAmino(object: QuerySellOrdersBySellerRequestAmino): QuerySellOrdersBySellerRequest { - return { - seller: object.seller, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySellOrdersBySellerRequest(); + if (object.seller !== undefined && object.seller !== null) { + message.seller = object.seller; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySellOrdersBySellerRequest): QuerySellOrdersBySellerRequestAmino { const obj: any = {}; - obj.seller = message.seller; + obj.seller = message.seller === "" ? undefined : message.seller; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -931,11 +956,12 @@ export const QuerySellOrdersBySellerRequest = { function createBaseQuerySellOrdersBySellerResponse(): QuerySellOrdersBySellerResponse { return { sellOrders: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QuerySellOrdersBySellerResponse = { - encode(message: QuerySellOrdersBySellerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QuerySellOrdersBySellerResponse", + encode(message: QuerySellOrdersBySellerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.sellOrders) { SellOrderInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -944,8 +970,8 @@ export const QuerySellOrdersBySellerResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySellOrdersBySellerResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySellOrdersBySellerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySellOrdersBySellerResponse(); while (reader.pos < end) { @@ -987,17 +1013,19 @@ export const QuerySellOrdersBySellerResponse = { return message; }, fromAmino(object: QuerySellOrdersBySellerResponseAmino): QuerySellOrdersBySellerResponse { - return { - sellOrders: Array.isArray(object?.sell_orders) ? object.sell_orders.map((e: any) => SellOrderInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQuerySellOrdersBySellerResponse(); + message.sellOrders = object.sell_orders?.map(e => SellOrderInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QuerySellOrdersBySellerResponse): QuerySellOrdersBySellerResponseAmino { const obj: any = {}; if (message.sellOrders) { obj.sell_orders = message.sellOrders.map(e => e ? SellOrderInfo.toAmino(e) : undefined); } else { - obj.sell_orders = []; + obj.sell_orders = message.sellOrders; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1020,18 +1048,19 @@ export const QuerySellOrdersBySellerResponse = { }; function createBaseQueryAllowedDenomsRequest(): QueryAllowedDenomsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllowedDenomsRequest = { - encode(message: QueryAllowedDenomsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QueryAllowedDenomsRequest", + encode(message: QueryAllowedDenomsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowedDenomsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowedDenomsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowedDenomsRequest(); while (reader.pos < end) { @@ -1063,9 +1092,11 @@ export const QueryAllowedDenomsRequest = { return message; }, fromAmino(object: QueryAllowedDenomsRequestAmino): QueryAllowedDenomsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowedDenomsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowedDenomsRequest): QueryAllowedDenomsRequestAmino { const obj: any = {}; @@ -1091,11 +1122,12 @@ export const QueryAllowedDenomsRequest = { function createBaseQueryAllowedDenomsResponse(): QueryAllowedDenomsResponse { return { allowedDenoms: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllowedDenomsResponse = { - encode(message: QueryAllowedDenomsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.QueryAllowedDenomsResponse", + encode(message: QueryAllowedDenomsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowedDenoms) { AllowedDenom.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1104,8 +1136,8 @@ export const QueryAllowedDenomsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowedDenomsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowedDenomsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowedDenomsResponse(); while (reader.pos < end) { @@ -1147,17 +1179,19 @@ export const QueryAllowedDenomsResponse = { return message; }, fromAmino(object: QueryAllowedDenomsResponseAmino): QueryAllowedDenomsResponse { - return { - allowedDenoms: Array.isArray(object?.allowed_denoms) ? object.allowed_denoms.map((e: any) => AllowedDenom.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowedDenomsResponse(); + message.allowedDenoms = object.allowed_denoms?.map(e => AllowedDenom.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowedDenomsResponse): QueryAllowedDenomsResponseAmino { const obj: any = {}; if (message.allowedDenoms) { obj.allowed_denoms = message.allowedDenoms.map(e => e ? AllowedDenom.toAmino(e) : undefined); } else { - obj.allowed_denoms = []; + obj.allowed_denoms = message.allowedDenoms; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1180,7 +1214,7 @@ export const QueryAllowedDenomsResponse = { }; function createBaseSellOrderInfo(): SellOrderInfo { return { - id: Long.UZERO, + id: BigInt(0), seller: "", batchDenom: "", quantity: "", @@ -1191,8 +1225,9 @@ function createBaseSellOrderInfo(): SellOrderInfo { }; } export const SellOrderInfo = { - encode(message: SellOrderInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.SellOrderInfo", + encode(message: SellOrderInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.seller !== "") { @@ -1218,15 +1253,15 @@ export const SellOrderInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SellOrderInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SellOrderInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSellOrderInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.seller = reader.string(); @@ -1258,7 +1293,7 @@ export const SellOrderInfo = { }, fromJSON(object: any): SellOrderInfo { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), seller: isSet(object.seller) ? String(object.seller) : "", batchDenom: isSet(object.batchDenom) ? String(object.batchDenom) : "", quantity: isSet(object.quantity) ? String(object.quantity) : "", @@ -1270,7 +1305,7 @@ export const SellOrderInfo = { }, toJSON(message: SellOrderInfo): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.seller !== undefined && (obj.seller = message.seller); message.batchDenom !== undefined && (obj.batchDenom = message.batchDenom); message.quantity !== undefined && (obj.quantity = message.quantity); @@ -1282,7 +1317,7 @@ export const SellOrderInfo = { }, fromPartial(object: Partial): SellOrderInfo { const message = createBaseSellOrderInfo(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.seller = object.seller ?? ""; message.batchDenom = object.batchDenom ?? ""; message.quantity = object.quantity ?? ""; @@ -1293,26 +1328,42 @@ export const SellOrderInfo = { return message; }, fromAmino(object: SellOrderInfoAmino): SellOrderInfo { - return { - id: Long.fromString(object.id), - seller: object.seller, - batchDenom: object.batch_denom, - quantity: object.quantity, - askDenom: object.ask_denom, - askAmount: object.ask_amount, - disableAutoRetire: object.disable_auto_retire, - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined - }; + const message = createBaseSellOrderInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.seller !== undefined && object.seller !== null) { + message.seller = object.seller; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.ask_denom !== undefined && object.ask_denom !== null) { + message.askDenom = object.ask_denom; + } + if (object.ask_amount !== undefined && object.ask_amount !== null) { + message.askAmount = object.ask_amount; + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = Timestamp.fromAmino(object.expiration); + } + return message; }, toAmino(message: SellOrderInfo): SellOrderInfoAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.seller = message.seller; - obj.batch_denom = message.batchDenom; - obj.quantity = message.quantity; - obj.ask_denom = message.askDenom; - obj.ask_amount = message.askAmount; - obj.disable_auto_retire = message.disableAutoRetire; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.seller = message.seller === "" ? undefined : message.seller; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.ask_denom = message.askDenom === "" ? undefined : message.askDenom; + obj.ask_amount = message.askAmount === "" ? undefined : message.askAmount; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; return obj; }, diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/state.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/state.ts index 38e5ea26..fec20740 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/state.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/state.ts @@ -1,24 +1,24 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../../google/protobuf/timestamp"; -import { Long, isSet, bytesFromBase64, fromJsonTimestamp, base64FromBytes, fromTimestamp } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, fromJsonTimestamp, base64FromBytes, fromTimestamp } from "../../../../helpers"; /** SellOrder represents the information for a sell order. */ export interface SellOrder { /** id is the unique ID of sell order. */ - id: Long; + id: bigint; /** seller is the address of the account that is selling credits. */ seller: Uint8Array; /** * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links a sell order to a credit batch. */ - batchKey: Long; + batchKey: bigint; /** quantity is the decimal quantity of credits being sold. */ quantity: string; /** * market_id is the market in which this sell order exists and specifies * the bank_denom that ask_amount corresponds to forming the ask_price. */ - marketId: Long; + marketId: bigint; /** * ask_amount is the integer amount (encoded as a string) that the seller is * asking for each credit unit of the batch. Each credit unit of the batch @@ -36,7 +36,7 @@ export interface SellOrder { * expiration is an optional timestamp when the sell order expires. When the * expiration time is reached, the sell order is removed from state. */ - expiration: Timestamp; + expiration?: Timestamp; /** * maker indicates that this is a maker order, meaning that when it hit * the order book, there were no matching buy orders. @@ -50,44 +50,44 @@ export interface SellOrderProtoMsg { /** SellOrder represents the information for a sell order. */ export interface SellOrderAmino { /** id is the unique ID of sell order. */ - id: string; + id?: string; /** seller is the address of the account that is selling credits. */ - seller: Uint8Array; + seller?: string; /** * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links a sell order to a credit batch. */ - batch_key: string; + batch_key?: string; /** quantity is the decimal quantity of credits being sold. */ - quantity: string; + quantity?: string; /** * market_id is the market in which this sell order exists and specifies * the bank_denom that ask_amount corresponds to forming the ask_price. */ - market_id: string; + market_id?: string; /** * ask_amount is the integer amount (encoded as a string) that the seller is * asking for each credit unit of the batch. Each credit unit of the batch * will be sold for at least the ask_amount. The ask_amount corresponds to the * Market.denom to form the ask price. */ - ask_amount: string; + ask_amount?: string; /** * disable_auto_retire disables auto-retirement of credits which allows a * buyer to disable auto-retirement in their buy order enabling them to * resell the credits to another buyer. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * expiration is an optional timestamp when the sell order expires. When the * expiration time is reached, the sell order is removed from state. */ - expiration?: TimestampAmino; + expiration?: string; /** * maker indicates that this is a maker order, meaning that when it hit * the order book, there were no matching buy orders. */ - maker: boolean; + maker?: boolean; } export interface SellOrderAminoMsg { type: "/regen.ecocredit.marketplace.v1.SellOrder"; @@ -95,14 +95,14 @@ export interface SellOrderAminoMsg { } /** SellOrder represents the information for a sell order. */ export interface SellOrderSDKType { - id: Long; + id: bigint; seller: Uint8Array; - batch_key: Long; + batch_key: bigint; quantity: string; - market_id: Long; + market_id: bigint; ask_amount: string; disable_auto_retire: boolean; - expiration: TimestampSDKType; + expiration?: TimestampSDKType; maker: boolean; } /** AllowedDenom represents the information for an allowed ask/bid denom. */ @@ -128,18 +128,18 @@ export interface AllowedDenomProtoMsg { /** AllowedDenom represents the information for an allowed ask/bid denom. */ export interface AllowedDenomAmino { /** denom is the bank denom to allow (ex. ibc/GLKHDSG423SGS) */ - bank_denom: string; + bank_denom?: string; /** * display_denom is the denom to display to the user and is informational. * Because the denom is likely an IBC denom, this should be chosen by * governance to represent the consensus trusted name of the denom. */ - display_denom: string; + display_denom?: string; /** * exponent is the exponent that relates the denom to the display_denom and is * informational */ - exponent: number; + exponent?: number; } export interface AllowedDenomAminoMsg { type: "/regen.ecocredit.marketplace.v1.AllowedDenom"; @@ -164,7 +164,7 @@ export interface AllowedDenomSDKType { */ export interface Market { /** id is the unique ID of the market. */ - id: Long; + id: bigint; /** credit_type_abbrev is the abbreviation of the credit type. */ creditTypeAbbrev: string; /** bank_denom is an allowed bank denom. */ @@ -215,11 +215,11 @@ export interface MarketProtoMsg { */ export interface MarketAmino { /** id is the unique ID of the market. */ - id: string; + id?: string; /** credit_type_abbrev is the abbreviation of the credit type. */ - credit_type_abbrev: string; + credit_type_abbrev?: string; /** bank_denom is an allowed bank denom. */ - bank_denom: string; + bank_denom?: string; /** * precision_modifier is an optional modifier used to convert arbitrary * precision integer bank amounts to uint32 values used for sorting in the @@ -247,7 +247,7 @@ export interface MarketAmino { * will need to adjust precision_modifier to allow for higher prices in * exchange for less precision at the lower end. */ - precision_modifier: number; + precision_modifier?: number; } export interface MarketAminoMsg { type: "/regen.ecocredit.marketplace.v1.Market"; @@ -265,18 +265,18 @@ export interface MarketAminoMsg { * with care. */ export interface MarketSDKType { - id: Long; + id: bigint; credit_type_abbrev: string; bank_denom: string; precision_modifier: number; } function createBaseSellOrder(): SellOrder { return { - id: Long.UZERO, + id: BigInt(0), seller: new Uint8Array(), - batchKey: Long.UZERO, + batchKey: BigInt(0), quantity: "", - marketId: Long.UZERO, + marketId: BigInt(0), askAmount: "", disableAutoRetire: false, expiration: undefined, @@ -284,20 +284,21 @@ function createBaseSellOrder(): SellOrder { }; } export const SellOrder = { - encode(message: SellOrder, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.SellOrder", + encode(message: SellOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.seller.length !== 0) { writer.uint32(18).bytes(message.seller); } - if (!message.batchKey.isZero()) { + if (message.batchKey !== BigInt(0)) { writer.uint32(24).uint64(message.batchKey); } if (message.quantity !== "") { writer.uint32(34).string(message.quantity); } - if (!message.marketId.isZero()) { + if (message.marketId !== BigInt(0)) { writer.uint32(40).uint64(message.marketId); } if (message.askAmount !== "") { @@ -314,27 +315,27 @@ export const SellOrder = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SellOrder { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SellOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSellOrder(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.seller = reader.bytes(); break; case 3: - message.batchKey = (reader.uint64() as Long); + message.batchKey = reader.uint64(); break; case 4: message.quantity = reader.string(); break; case 5: - message.marketId = (reader.uint64() as Long); + message.marketId = reader.uint64(); break; case 6: message.askAmount = reader.string(); @@ -357,11 +358,11 @@ export const SellOrder = { }, fromJSON(object: any): SellOrder { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), seller: isSet(object.seller) ? bytesFromBase64(object.seller) : new Uint8Array(), - batchKey: isSet(object.batchKey) ? Long.fromValue(object.batchKey) : Long.UZERO, + batchKey: isSet(object.batchKey) ? BigInt(object.batchKey.toString()) : BigInt(0), quantity: isSet(object.quantity) ? String(object.quantity) : "", - marketId: isSet(object.marketId) ? Long.fromValue(object.marketId) : Long.UZERO, + marketId: isSet(object.marketId) ? BigInt(object.marketId.toString()) : BigInt(0), askAmount: isSet(object.askAmount) ? String(object.askAmount) : "", disableAutoRetire: isSet(object.disableAutoRetire) ? Boolean(object.disableAutoRetire) : false, expiration: isSet(object.expiration) ? fromJsonTimestamp(object.expiration) : undefined, @@ -370,11 +371,11 @@ export const SellOrder = { }, toJSON(message: SellOrder): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.seller !== undefined && (obj.seller = base64FromBytes(message.seller !== undefined ? message.seller : new Uint8Array())); - message.batchKey !== undefined && (obj.batchKey = (message.batchKey || Long.UZERO).toString()); + message.batchKey !== undefined && (obj.batchKey = (message.batchKey || BigInt(0)).toString()); message.quantity !== undefined && (obj.quantity = message.quantity); - message.marketId !== undefined && (obj.marketId = (message.marketId || Long.UZERO).toString()); + message.marketId !== undefined && (obj.marketId = (message.marketId || BigInt(0)).toString()); message.askAmount !== undefined && (obj.askAmount = message.askAmount); message.disableAutoRetire !== undefined && (obj.disableAutoRetire = message.disableAutoRetire); message.expiration !== undefined && (obj.expiration = fromTimestamp(message.expiration).toISOString()); @@ -383,11 +384,11 @@ export const SellOrder = { }, fromPartial(object: Partial): SellOrder { const message = createBaseSellOrder(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.seller = object.seller ?? new Uint8Array(); - message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? Long.fromValue(object.batchKey) : Long.UZERO; + message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? BigInt(object.batchKey.toString()) : BigInt(0); message.quantity = object.quantity ?? ""; - message.marketId = object.marketId !== undefined && object.marketId !== null ? Long.fromValue(object.marketId) : Long.UZERO; + message.marketId = object.marketId !== undefined && object.marketId !== null ? BigInt(object.marketId.toString()) : BigInt(0); message.askAmount = object.askAmount ?? ""; message.disableAutoRetire = object.disableAutoRetire ?? false; message.expiration = object.expiration !== undefined && object.expiration !== null ? Timestamp.fromPartial(object.expiration) : undefined; @@ -395,29 +396,47 @@ export const SellOrder = { return message; }, fromAmino(object: SellOrderAmino): SellOrder { - return { - id: Long.fromString(object.id), - seller: object.seller, - batchKey: Long.fromString(object.batch_key), - quantity: object.quantity, - marketId: Long.fromString(object.market_id), - askAmount: object.ask_amount, - disableAutoRetire: object.disable_auto_retire, - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined, - maker: object.maker - }; + const message = createBaseSellOrder(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.seller !== undefined && object.seller !== null) { + message.seller = bytesFromBase64(object.seller); + } + if (object.batch_key !== undefined && object.batch_key !== null) { + message.batchKey = BigInt(object.batch_key); + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = BigInt(object.market_id); + } + if (object.ask_amount !== undefined && object.ask_amount !== null) { + message.askAmount = object.ask_amount; + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = Timestamp.fromAmino(object.expiration); + } + if (object.maker !== undefined && object.maker !== null) { + message.maker = object.maker; + } + return message; }, toAmino(message: SellOrder): SellOrderAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.seller = message.seller; - obj.batch_key = message.batchKey ? message.batchKey.toString() : undefined; - obj.quantity = message.quantity; - obj.market_id = message.marketId ? message.marketId.toString() : undefined; - obj.ask_amount = message.askAmount; - obj.disable_auto_retire = message.disableAutoRetire; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.seller = message.seller ? base64FromBytes(message.seller) : undefined; + obj.batch_key = message.batchKey !== BigInt(0) ? message.batchKey.toString() : undefined; + obj.quantity = message.quantity === "" ? undefined : message.quantity; + obj.market_id = message.marketId !== BigInt(0) ? message.marketId.toString() : undefined; + obj.ask_amount = message.askAmount === "" ? undefined : message.askAmount; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; - obj.maker = message.maker; + obj.maker = message.maker === false ? undefined : message.maker; return obj; }, fromAminoMsg(object: SellOrderAminoMsg): SellOrder { @@ -444,7 +463,8 @@ function createBaseAllowedDenom(): AllowedDenom { }; } export const AllowedDenom = { - encode(message: AllowedDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.AllowedDenom", + encode(message: AllowedDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bankDenom !== "") { writer.uint32(10).string(message.bankDenom); } @@ -456,8 +476,8 @@ export const AllowedDenom = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowedDenom { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowedDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowedDenom(); while (reader.pos < end) { @@ -501,17 +521,23 @@ export const AllowedDenom = { return message; }, fromAmino(object: AllowedDenomAmino): AllowedDenom { - return { - bankDenom: object.bank_denom, - displayDenom: object.display_denom, - exponent: object.exponent - }; + const message = createBaseAllowedDenom(); + if (object.bank_denom !== undefined && object.bank_denom !== null) { + message.bankDenom = object.bank_denom; + } + if (object.display_denom !== undefined && object.display_denom !== null) { + message.displayDenom = object.display_denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + return message; }, toAmino(message: AllowedDenom): AllowedDenomAmino { const obj: any = {}; - obj.bank_denom = message.bankDenom; - obj.display_denom = message.displayDenom; - obj.exponent = message.exponent; + obj.bank_denom = message.bankDenom === "" ? undefined : message.bankDenom; + obj.display_denom = message.displayDenom === "" ? undefined : message.displayDenom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; return obj; }, fromAminoMsg(object: AllowedDenomAminoMsg): AllowedDenom { @@ -532,15 +558,16 @@ export const AllowedDenom = { }; function createBaseMarket(): Market { return { - id: Long.UZERO, + id: BigInt(0), creditTypeAbbrev: "", bankDenom: "", precisionModifier: 0 }; } export const Market = { - encode(message: Market, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.Market", + encode(message: Market, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.creditTypeAbbrev !== "") { @@ -554,15 +581,15 @@ export const Market = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Market { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Market { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMarket(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = (reader.uint64() as Long); + message.id = reader.uint64(); break; case 2: message.creditTypeAbbrev = reader.string(); @@ -582,7 +609,7 @@ export const Market = { }, fromJSON(object: any): Market { return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), creditTypeAbbrev: isSet(object.creditTypeAbbrev) ? String(object.creditTypeAbbrev) : "", bankDenom: isSet(object.bankDenom) ? String(object.bankDenom) : "", precisionModifier: isSet(object.precisionModifier) ? Number(object.precisionModifier) : 0 @@ -590,7 +617,7 @@ export const Market = { }, toJSON(message: Market): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.creditTypeAbbrev !== undefined && (obj.creditTypeAbbrev = message.creditTypeAbbrev); message.bankDenom !== undefined && (obj.bankDenom = message.bankDenom); message.precisionModifier !== undefined && (obj.precisionModifier = Math.round(message.precisionModifier)); @@ -598,26 +625,34 @@ export const Market = { }, fromPartial(object: Partial): Market { const message = createBaseMarket(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.creditTypeAbbrev = object.creditTypeAbbrev ?? ""; message.bankDenom = object.bankDenom ?? ""; message.precisionModifier = object.precisionModifier ?? 0; return message; }, fromAmino(object: MarketAmino): Market { - return { - id: Long.fromString(object.id), - creditTypeAbbrev: object.credit_type_abbrev, - bankDenom: object.bank_denom, - precisionModifier: object.precision_modifier - }; + const message = createBaseMarket(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + if (object.bank_denom !== undefined && object.bank_denom !== null) { + message.bankDenom = object.bank_denom; + } + if (object.precision_modifier !== undefined && object.precision_modifier !== null) { + message.precisionModifier = object.precision_modifier; + } + return message; }, toAmino(message: Market): MarketAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.credit_type_abbrev = message.creditTypeAbbrev; - obj.bank_denom = message.bankDenom; - obj.precision_modifier = message.precisionModifier; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; + obj.bank_denom = message.bankDenom === "" ? undefined : message.bankDenom; + obj.precision_modifier = message.precisionModifier === 0 ? undefined : message.precisionModifier; return obj; }, fromAminoMsg(object: MarketAminoMsg): Market { diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts index f0b2dbd4..a85d5b81 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../../binary"; import { MsgSell, MsgSellResponse, MsgUpdateSellOrders, MsgUpdateSellOrdersResponse, MsgCancelSellOrder, MsgCancelSellOrderResponse, MsgBuyDirect, MsgBuyDirectResponse, MsgAddAllowedDenom, MsgAddAllowedDenomResponse, MsgRemoveAllowedDenom, MsgRemoveAllowedDenomResponse } from "./tx"; /** Msg is the regen.ecocredit.marketplace.v1 Msg service. */ export interface Msg { @@ -39,31 +39,31 @@ export class MsgClientImpl implements Msg { sell(request: MsgSell): Promise { const data = MsgSell.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Msg", "Sell", data); - return promise.then(data => MsgSellResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSellResponse.decode(new BinaryReader(data))); } updateSellOrders(request: MsgUpdateSellOrders): Promise { const data = MsgUpdateSellOrders.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Msg", "UpdateSellOrders", data); - return promise.then(data => MsgUpdateSellOrdersResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateSellOrdersResponse.decode(new BinaryReader(data))); } cancelSellOrder(request: MsgCancelSellOrder): Promise { const data = MsgCancelSellOrder.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Msg", "CancelSellOrder", data); - return promise.then(data => MsgCancelSellOrderResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCancelSellOrderResponse.decode(new BinaryReader(data))); } buyDirect(request: MsgBuyDirect): Promise { const data = MsgBuyDirect.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Msg", "BuyDirect", data); - return promise.then(data => MsgBuyDirectResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgBuyDirectResponse.decode(new BinaryReader(data))); } addAllowedDenom(request: MsgAddAllowedDenom): Promise { const data = MsgAddAllowedDenom.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Msg", "AddAllowedDenom", data); - return promise.then(data => MsgAddAllowedDenomResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgAddAllowedDenomResponse.decode(new BinaryReader(data))); } removeAllowedDenom(request: MsgRemoveAllowedDenom): Promise { const data = MsgRemoveAllowedDenom.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.marketplace.v1.Msg", "RemoveAllowedDenom", data); - return promise.then(data => MsgRemoveAllowedDenomResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRemoveAllowedDenomResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.ts index 330480ed..f38b6e25 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/tx.ts @@ -1,7 +1,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; /** MsgSell is the Msg/Sell request type. */ export interface MsgSell { /** seller is the address of the account that is selling credits. */ @@ -16,9 +16,9 @@ export interface MsgSellProtoMsg { /** MsgSell is the Msg/Sell request type. */ export interface MsgSellAmino { /** seller is the address of the account that is selling credits. */ - seller: string; + seller?: string; /** orders are the sell orders being created. */ - orders: MsgSell_OrderAmino[]; + orders?: MsgSell_OrderAmino[]; } export interface MsgSellAminoMsg { type: "regen.marketplace/MsgSell"; @@ -46,7 +46,7 @@ export interface MsgSell_Order { * batch_denom. Each credit unit of the batch will be sold for at least the * ask_price or more. */ - askPrice: Coin; + askPrice?: Coin; /** * disable_auto_retire disables auto-retirement of credits which allows a * buyer to disable auto-retirement in their buy order enabling them to @@ -57,7 +57,7 @@ export interface MsgSell_Order { * expiration is an optional timestamp when the sell order expires. When the * expiration time is reached, the sell order is removed from state. */ - expiration: Timestamp; + expiration?: Timestamp; } export interface MsgSell_OrderProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.Order"; @@ -66,7 +66,7 @@ export interface MsgSell_OrderProtoMsg { /** Order is the content of a new sell order. */ export interface MsgSell_OrderAmino { /** batch_denom is the credit batch being sold. */ - batch_denom: string; + batch_denom?: string; /** * quantity is the quantity of credits being sold from this batch. If it is * less then the balance of credits the owner has available at the time this @@ -74,7 +74,7 @@ export interface MsgSell_OrderAmino { * owner's balance. However, if the balance of credits is less than this * quantity at the time the sell order is created, the operation will fail. */ - quantity: string; + quantity?: string; /** * ask_price is the price the seller is asking for each unit of the * batch_denom. Each credit unit of the batch will be sold for at least the @@ -86,12 +86,12 @@ export interface MsgSell_OrderAmino { * buyer to disable auto-retirement in their buy order enabling them to * resell the credits to another buyer. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * expiration is an optional timestamp when the sell order expires. When the * expiration time is reached, the sell order is removed from state. */ - expiration?: TimestampAmino; + expiration?: string; } export interface MsgSell_OrderAminoMsg { type: "/regen.ecocredit.marketplace.v1.Order"; @@ -101,14 +101,14 @@ export interface MsgSell_OrderAminoMsg { export interface MsgSell_OrderSDKType { batch_denom: string; quantity: string; - ask_price: CoinSDKType; + ask_price?: CoinSDKType; disable_auto_retire: boolean; - expiration: TimestampSDKType; + expiration?: TimestampSDKType; } /** MsgSellResponse is the Msg/Sell response type. */ export interface MsgSellResponse { /** sell_order_ids are the sell order IDs of the newly created sell orders. */ - sellOrderIds: Long[]; + sellOrderIds: bigint[]; } export interface MsgSellResponseProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.MsgSellResponse"; @@ -117,7 +117,7 @@ export interface MsgSellResponseProtoMsg { /** MsgSellResponse is the Msg/Sell response type. */ export interface MsgSellResponseAmino { /** sell_order_ids are the sell order IDs of the newly created sell orders. */ - sell_order_ids: string[]; + sell_order_ids?: string[]; } export interface MsgSellResponseAminoMsg { type: "/regen.ecocredit.marketplace.v1.MsgSellResponse"; @@ -125,7 +125,7 @@ export interface MsgSellResponseAminoMsg { } /** MsgSellResponse is the Msg/Sell response type. */ export interface MsgSellResponseSDKType { - sell_order_ids: Long[]; + sell_order_ids: bigint[]; } /** MsgUpdateSellOrders is the Msg/UpdateSellOrders request type. */ export interface MsgUpdateSellOrders { @@ -141,9 +141,9 @@ export interface MsgUpdateSellOrdersProtoMsg { /** MsgUpdateSellOrders is the Msg/UpdateSellOrders request type. */ export interface MsgUpdateSellOrdersAmino { /** seller is the address of the account that is selling credits. */ - seller: string; + seller?: string; /** updates are updates to existing sell orders. */ - updates: MsgUpdateSellOrders_UpdateAmino[]; + updates?: MsgUpdateSellOrders_UpdateAmino[]; } export interface MsgUpdateSellOrdersAminoMsg { type: "regen.marketplace/MsgUpdateSellOrders"; @@ -157,11 +157,11 @@ export interface MsgUpdateSellOrdersSDKType { /** Update is an update to an existing sell order. */ export interface MsgUpdateSellOrders_Update { /** sell_order_id is the ID of an existing sell order. */ - sellOrderId: Long; + sellOrderId: bigint; /** new_quantity is the updated quantity of credits available to sell. */ newQuantity: string; /** new_ask_price is the new ask price for this sell order */ - newAskPrice: Coin; + newAskPrice?: Coin; /** * disable_auto_retire updates the disable_auto_retire field in the sell * order. @@ -171,7 +171,7 @@ export interface MsgUpdateSellOrders_Update { * new_expiration is an optional timestamp when the sell order expires. When * the expiration time is reached, the sell order is removed from state. */ - newExpiration: Timestamp; + newExpiration?: Timestamp; } export interface MsgUpdateSellOrders_UpdateProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.Update"; @@ -180,21 +180,21 @@ export interface MsgUpdateSellOrders_UpdateProtoMsg { /** Update is an update to an existing sell order. */ export interface MsgUpdateSellOrders_UpdateAmino { /** sell_order_id is the ID of an existing sell order. */ - sell_order_id: string; + sell_order_id?: string; /** new_quantity is the updated quantity of credits available to sell. */ - new_quantity: string; + new_quantity?: string; /** new_ask_price is the new ask price for this sell order */ new_ask_price?: CoinAmino; /** * disable_auto_retire updates the disable_auto_retire field in the sell * order. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * new_expiration is an optional timestamp when the sell order expires. When * the expiration time is reached, the sell order is removed from state. */ - new_expiration?: TimestampAmino; + new_expiration?: string; } export interface MsgUpdateSellOrders_UpdateAminoMsg { type: "/regen.ecocredit.marketplace.v1.Update"; @@ -202,11 +202,11 @@ export interface MsgUpdateSellOrders_UpdateAminoMsg { } /** Update is an update to an existing sell order. */ export interface MsgUpdateSellOrders_UpdateSDKType { - sell_order_id: Long; + sell_order_id: bigint; new_quantity: string; - new_ask_price: CoinSDKType; + new_ask_price?: CoinSDKType; disable_auto_retire: boolean; - new_expiration: TimestampSDKType; + new_expiration?: TimestampSDKType; } /** MsgUpdateSellOrdersResponse is the Msg/UpdateSellOrders response type. */ export interface MsgUpdateSellOrdersResponse {} @@ -230,7 +230,7 @@ export interface MsgCancelSellOrder { */ seller: string; /** sell_order_id is the id of the seller order to cancel. */ - sellOrderId: Long; + sellOrderId: bigint; } export interface MsgCancelSellOrderProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.MsgCancelSellOrder"; @@ -242,9 +242,9 @@ export interface MsgCancelSellOrderAmino { * seller is the address of the account that created the sell order and is * therefore authorized to cancel the sell order. */ - seller: string; + seller?: string; /** sell_order_id is the id of the seller order to cancel. */ - sell_order_id: string; + sell_order_id?: string; } export interface MsgCancelSellOrderAminoMsg { type: "regen.marketplace/MsgCancelSellOrder"; @@ -253,7 +253,7 @@ export interface MsgCancelSellOrderAminoMsg { /** MsgCancelSellOrder is the Msg/CancelSellOrder request type. */ export interface MsgCancelSellOrderSDKType { seller: string; - sell_order_id: Long; + sell_order_id: bigint; } /** MsgCancelSellOrder is the Msg/CancelSellOrder response type. */ export interface MsgCancelSellOrderResponse {} @@ -283,9 +283,9 @@ export interface MsgBuyDirectProtoMsg { /** MsgBuyDirect is the Msg/BuyDirect request type. */ export interface MsgBuyDirectAmino { /** buyer is the address of the account that is buying credits. */ - buyer: string; + buyer?: string; /** orders is a list of orders for ecocredits. */ - orders: MsgBuyDirect_OrderAmino[]; + orders?: MsgBuyDirect_OrderAmino[]; } export interface MsgBuyDirectAminoMsg { type: "regen.marketplace/MsgBuyDirect"; @@ -302,11 +302,11 @@ export interface MsgBuyDirect_Order { * sell_order_id is the sell order ID against which the buyer is trying * to buy. */ - sellOrderId: Long; + sellOrderId: bigint; /** quantity is the quantity of credits to buy. */ quantity: string; /** bid_price is the price the buyer is willing to pay per credit. */ - bidPrice: Coin; + bidPrice?: Coin; /** * disable_auto_retire allows auto-retirement to be disabled. If it is set * to true the credits will not auto-retire and can be resold assuming that @@ -339,9 +339,9 @@ export interface MsgBuyDirect_OrderAmino { * sell_order_id is the sell order ID against which the buyer is trying * to buy. */ - sell_order_id: string; + sell_order_id?: string; /** quantity is the quantity of credits to buy. */ - quantity: string; + quantity?: string; /** bid_price is the price the buyer is willing to pay per credit. */ bid_price?: CoinAmino; /** @@ -351,12 +351,12 @@ export interface MsgBuyDirect_OrderAmino { * order hasn't disabled auto-retirement and the buy order tries to disable * it, that buy order will fail. */ - disable_auto_retire: boolean; + disable_auto_retire?: boolean; /** * retirement_jurisdiction is the optional retirement jurisdiction for the * credits which will be used only if disable_auto_retire is false. */ - retirement_jurisdiction: string; + retirement_jurisdiction?: string; /** * retirement_reason is any arbitrary string that specifies the reason for * retiring credits. The reason will be included in EventRetire and is not @@ -364,7 +364,7 @@ export interface MsgBuyDirect_OrderAmino { * * Since Revision 1 */ - retirement_reason: string; + retirement_reason?: string; } export interface MsgBuyDirect_OrderAminoMsg { type: "/regen.ecocredit.marketplace.v1.Order"; @@ -372,9 +372,9 @@ export interface MsgBuyDirect_OrderAminoMsg { } /** Order contains the information needed to purchase an ecocredit. */ export interface MsgBuyDirect_OrderSDKType { - sell_order_id: Long; + sell_order_id: bigint; quantity: string; - bid_price: CoinSDKType; + bid_price?: CoinSDKType; disable_auto_retire: boolean; retirement_jurisdiction: string; retirement_reason: string; @@ -426,20 +426,20 @@ export interface MsgAddAllowedDenomProtoMsg { */ export interface MsgAddAllowedDenomAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** denom is the bank denom to allow (ex. ibc/GLKHDSG423SGS) */ - bank_denom: string; + bank_denom?: string; /** * display_denom is the denom to display to the user and is informational. * Because the denom is likely an IBC denom, this should be chosen by * governance to represent the consensus trusted name of the denom. */ - display_denom: string; + display_denom?: string; /** * exponent is the exponent that relates the denom to the display_denom and is * informational */ - exponent: number; + exponent?: number; } export interface MsgAddAllowedDenomAminoMsg { type: "regen.marketplace/MsgAddAllowedDenom"; @@ -504,9 +504,9 @@ export interface MsgRemoveAllowedDenomProtoMsg { */ export interface MsgRemoveAllowedDenomAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** denom is the denom to remove (ex. ibc/GLKHDSG423SGS) */ - denom: string; + denom?: string; } export interface MsgRemoveAllowedDenomAminoMsg { type: "regen.marketplace/MsgRemoveAllowedDenom"; @@ -554,7 +554,8 @@ function createBaseMsgSell(): MsgSell { }; } export const MsgSell = { - encode(message: MsgSell, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgSell", + encode(message: MsgSell, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.seller !== "") { writer.uint32(10).string(message.seller); } @@ -563,8 +564,8 @@ export const MsgSell = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSell { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSell { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSell(); while (reader.pos < end) { @@ -606,18 +607,20 @@ export const MsgSell = { return message; }, fromAmino(object: MsgSellAmino): MsgSell { - return { - seller: object.seller, - orders: Array.isArray(object?.orders) ? object.orders.map((e: any) => MsgSell_Order.fromAmino(e)) : [] - }; + const message = createBaseMsgSell(); + if (object.seller !== undefined && object.seller !== null) { + message.seller = object.seller; + } + message.orders = object.orders?.map(e => MsgSell_Order.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSell): MsgSellAmino { const obj: any = {}; - obj.seller = message.seller; + obj.seller = message.seller === "" ? undefined : message.seller; if (message.orders) { obj.orders = message.orders.map(e => e ? MsgSell_Order.toAmino(e) : undefined); } else { - obj.orders = []; + obj.orders = message.orders; } return obj; }, @@ -653,7 +656,8 @@ function createBaseMsgSell_Order(): MsgSell_Order { }; } export const MsgSell_Order = { - encode(message: MsgSell_Order, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.Order", + encode(message: MsgSell_Order, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -671,8 +675,8 @@ export const MsgSell_Order = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSell_Order { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSell_Order { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSell_Order(); while (reader.pos < end) { @@ -728,20 +732,30 @@ export const MsgSell_Order = { return message; }, fromAmino(object: MsgSell_OrderAmino): MsgSell_Order { - return { - batchDenom: object.batch_denom, - quantity: object.quantity, - askPrice: object?.ask_price ? Coin.fromAmino(object.ask_price) : undefined, - disableAutoRetire: object.disable_auto_retire, - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined - }; + const message = createBaseMsgSell_Order(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.ask_price !== undefined && object.ask_price !== null) { + message.askPrice = Coin.fromAmino(object.ask_price); + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = Timestamp.fromAmino(object.expiration); + } + return message; }, toAmino(message: MsgSell_Order): MsgSell_OrderAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.quantity = message.quantity; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.quantity = message.quantity === "" ? undefined : message.quantity; obj.ask_price = message.askPrice ? Coin.toAmino(message.askPrice) : undefined; - obj.disable_auto_retire = message.disableAutoRetire; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; return obj; }, @@ -767,7 +781,8 @@ function createBaseMsgSellResponse(): MsgSellResponse { }; } export const MsgSellResponse = { - encode(message: MsgSellResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgSellResponse", + encode(message: MsgSellResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.sellOrderIds) { writer.uint64(v); @@ -775,8 +790,8 @@ export const MsgSellResponse = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSellResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSellResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSellResponse(); while (reader.pos < end) { @@ -786,10 +801,10 @@ export const MsgSellResponse = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.sellOrderIds.push((reader.uint64() as Long)); + message.sellOrderIds.push(reader.uint64()); } } else { - message.sellOrderIds.push((reader.uint64() as Long)); + message.sellOrderIds.push(reader.uint64()); } break; default: @@ -801,13 +816,13 @@ export const MsgSellResponse = { }, fromJSON(object: any): MsgSellResponse { return { - sellOrderIds: Array.isArray(object?.sellOrderIds) ? object.sellOrderIds.map((e: any) => Long.fromValue(e)) : [] + sellOrderIds: Array.isArray(object?.sellOrderIds) ? object.sellOrderIds.map((e: any) => BigInt(e.toString())) : [] }; }, toJSON(message: MsgSellResponse): unknown { const obj: any = {}; if (message.sellOrderIds) { - obj.sellOrderIds = message.sellOrderIds.map(e => (e || Long.UZERO).toString()); + obj.sellOrderIds = message.sellOrderIds.map(e => (e || BigInt(0)).toString()); } else { obj.sellOrderIds = []; } @@ -815,20 +830,20 @@ export const MsgSellResponse = { }, fromPartial(object: Partial): MsgSellResponse { const message = createBaseMsgSellResponse(); - message.sellOrderIds = object.sellOrderIds?.map(e => Long.fromValue(e)) || []; + message.sellOrderIds = object.sellOrderIds?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: MsgSellResponseAmino): MsgSellResponse { - return { - sellOrderIds: Array.isArray(object?.sell_order_ids) ? object.sell_order_ids.map((e: any) => e) : [] - }; + const message = createBaseMsgSellResponse(); + message.sellOrderIds = object.sell_order_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: MsgSellResponse): MsgSellResponseAmino { const obj: any = {}; if (message.sellOrderIds) { - obj.sell_order_ids = message.sellOrderIds.map(e => e); + obj.sell_order_ids = message.sellOrderIds.map(e => e.toString()); } else { - obj.sell_order_ids = []; + obj.sell_order_ids = message.sellOrderIds; } return obj; }, @@ -855,7 +870,8 @@ function createBaseMsgUpdateSellOrders(): MsgUpdateSellOrders { }; } export const MsgUpdateSellOrders = { - encode(message: MsgUpdateSellOrders, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgUpdateSellOrders", + encode(message: MsgUpdateSellOrders, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.seller !== "") { writer.uint32(10).string(message.seller); } @@ -864,8 +880,8 @@ export const MsgUpdateSellOrders = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSellOrders { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSellOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateSellOrders(); while (reader.pos < end) { @@ -907,18 +923,20 @@ export const MsgUpdateSellOrders = { return message; }, fromAmino(object: MsgUpdateSellOrdersAmino): MsgUpdateSellOrders { - return { - seller: object.seller, - updates: Array.isArray(object?.updates) ? object.updates.map((e: any) => MsgUpdateSellOrders_Update.fromAmino(e)) : [] - }; + const message = createBaseMsgUpdateSellOrders(); + if (object.seller !== undefined && object.seller !== null) { + message.seller = object.seller; + } + message.updates = object.updates?.map(e => MsgUpdateSellOrders_Update.fromAmino(e)) || []; + return message; }, toAmino(message: MsgUpdateSellOrders): MsgUpdateSellOrdersAmino { const obj: any = {}; - obj.seller = message.seller; + obj.seller = message.seller === "" ? undefined : message.seller; if (message.updates) { obj.updates = message.updates.map(e => e ? MsgUpdateSellOrders_Update.toAmino(e) : undefined); } else { - obj.updates = []; + obj.updates = message.updates; } return obj; }, @@ -946,7 +964,7 @@ export const MsgUpdateSellOrders = { }; function createBaseMsgUpdateSellOrders_Update(): MsgUpdateSellOrders_Update { return { - sellOrderId: Long.UZERO, + sellOrderId: BigInt(0), newQuantity: "", newAskPrice: undefined, disableAutoRetire: false, @@ -954,8 +972,9 @@ function createBaseMsgUpdateSellOrders_Update(): MsgUpdateSellOrders_Update { }; } export const MsgUpdateSellOrders_Update = { - encode(message: MsgUpdateSellOrders_Update, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sellOrderId.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.Update", + encode(message: MsgUpdateSellOrders_Update, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.sellOrderId); } if (message.newQuantity !== "") { @@ -972,15 +991,15 @@ export const MsgUpdateSellOrders_Update = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSellOrders_Update { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSellOrders_Update { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateSellOrders_Update(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; case 2: message.newQuantity = reader.string(); @@ -1003,7 +1022,7 @@ export const MsgUpdateSellOrders_Update = { }, fromJSON(object: any): MsgUpdateSellOrders_Update { return { - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO, + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0), newQuantity: isSet(object.newQuantity) ? String(object.newQuantity) : "", newAskPrice: isSet(object.newAskPrice) ? Coin.fromJSON(object.newAskPrice) : undefined, disableAutoRetire: isSet(object.disableAutoRetire) ? Boolean(object.disableAutoRetire) : false, @@ -1012,7 +1031,7 @@ export const MsgUpdateSellOrders_Update = { }, toJSON(message: MsgUpdateSellOrders_Update): unknown { const obj: any = {}; - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); message.newQuantity !== undefined && (obj.newQuantity = message.newQuantity); message.newAskPrice !== undefined && (obj.newAskPrice = message.newAskPrice ? Coin.toJSON(message.newAskPrice) : undefined); message.disableAutoRetire !== undefined && (obj.disableAutoRetire = message.disableAutoRetire); @@ -1021,7 +1040,7 @@ export const MsgUpdateSellOrders_Update = { }, fromPartial(object: Partial): MsgUpdateSellOrders_Update { const message = createBaseMsgUpdateSellOrders_Update(); - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); message.newQuantity = object.newQuantity ?? ""; message.newAskPrice = object.newAskPrice !== undefined && object.newAskPrice !== null ? Coin.fromPartial(object.newAskPrice) : undefined; message.disableAutoRetire = object.disableAutoRetire ?? false; @@ -1029,20 +1048,30 @@ export const MsgUpdateSellOrders_Update = { return message; }, fromAmino(object: MsgUpdateSellOrders_UpdateAmino): MsgUpdateSellOrders_Update { - return { - sellOrderId: Long.fromString(object.sell_order_id), - newQuantity: object.new_quantity, - newAskPrice: object?.new_ask_price ? Coin.fromAmino(object.new_ask_price) : undefined, - disableAutoRetire: object.disable_auto_retire, - newExpiration: object?.new_expiration ? Timestamp.fromAmino(object.new_expiration) : undefined - }; + const message = createBaseMsgUpdateSellOrders_Update(); + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + if (object.new_quantity !== undefined && object.new_quantity !== null) { + message.newQuantity = object.new_quantity; + } + if (object.new_ask_price !== undefined && object.new_ask_price !== null) { + message.newAskPrice = Coin.fromAmino(object.new_ask_price); + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.new_expiration !== undefined && object.new_expiration !== null) { + message.newExpiration = Timestamp.fromAmino(object.new_expiration); + } + return message; }, toAmino(message: MsgUpdateSellOrders_Update): MsgUpdateSellOrders_UpdateAmino { const obj: any = {}; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; - obj.new_quantity = message.newQuantity; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; + obj.new_quantity = message.newQuantity === "" ? undefined : message.newQuantity; obj.new_ask_price = message.newAskPrice ? Coin.toAmino(message.newAskPrice) : undefined; - obj.disable_auto_retire = message.disableAutoRetire; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; obj.new_expiration = message.newExpiration ? Timestamp.toAmino(message.newExpiration) : undefined; return obj; }, @@ -1066,11 +1095,12 @@ function createBaseMsgUpdateSellOrdersResponse(): MsgUpdateSellOrdersResponse { return {}; } export const MsgUpdateSellOrdersResponse = { - encode(_: MsgUpdateSellOrdersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgUpdateSellOrdersResponse", + encode(_: MsgUpdateSellOrdersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSellOrdersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSellOrdersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateSellOrdersResponse(); while (reader.pos < end) { @@ -1095,7 +1125,8 @@ export const MsgUpdateSellOrdersResponse = { return message; }, fromAmino(_: MsgUpdateSellOrdersResponseAmino): MsgUpdateSellOrdersResponse { - return {}; + const message = createBaseMsgUpdateSellOrdersResponse(); + return message; }, toAmino(_: MsgUpdateSellOrdersResponse): MsgUpdateSellOrdersResponseAmino { const obj: any = {}; @@ -1120,21 +1151,22 @@ export const MsgUpdateSellOrdersResponse = { function createBaseMsgCancelSellOrder(): MsgCancelSellOrder { return { seller: "", - sellOrderId: Long.UZERO + sellOrderId: BigInt(0) }; } export const MsgCancelSellOrder = { - encode(message: MsgCancelSellOrder, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgCancelSellOrder", + encode(message: MsgCancelSellOrder, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.seller !== "") { writer.uint32(10).string(message.seller); } - if (!message.sellOrderId.isZero()) { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(16).uint64(message.sellOrderId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelSellOrder { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSellOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelSellOrder(); while (reader.pos < end) { @@ -1144,7 +1176,7 @@ export const MsgCancelSellOrder = { message.seller = reader.string(); break; case 2: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1156,31 +1188,35 @@ export const MsgCancelSellOrder = { fromJSON(object: any): MsgCancelSellOrder { return { seller: isSet(object.seller) ? String(object.seller) : "", - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0) }; }, toJSON(message: MsgCancelSellOrder): unknown { const obj: any = {}; message.seller !== undefined && (obj.seller = message.seller); - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): MsgCancelSellOrder { const message = createBaseMsgCancelSellOrder(); message.seller = object.seller ?? ""; - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgCancelSellOrderAmino): MsgCancelSellOrder { - return { - seller: object.seller, - sellOrderId: Long.fromString(object.sell_order_id) - }; + const message = createBaseMsgCancelSellOrder(); + if (object.seller !== undefined && object.seller !== null) { + message.seller = object.seller; + } + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + return message; }, toAmino(message: MsgCancelSellOrder): MsgCancelSellOrderAmino { const obj: any = {}; - obj.seller = message.seller; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; + obj.seller = message.seller === "" ? undefined : message.seller; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgCancelSellOrderAminoMsg): MsgCancelSellOrder { @@ -1209,11 +1245,12 @@ function createBaseMsgCancelSellOrderResponse(): MsgCancelSellOrderResponse { return {}; } export const MsgCancelSellOrderResponse = { - encode(_: MsgCancelSellOrderResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgCancelSellOrderResponse", + encode(_: MsgCancelSellOrderResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelSellOrderResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSellOrderResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelSellOrderResponse(); while (reader.pos < end) { @@ -1238,7 +1275,8 @@ export const MsgCancelSellOrderResponse = { return message; }, fromAmino(_: MsgCancelSellOrderResponseAmino): MsgCancelSellOrderResponse { - return {}; + const message = createBaseMsgCancelSellOrderResponse(); + return message; }, toAmino(_: MsgCancelSellOrderResponse): MsgCancelSellOrderResponseAmino { const obj: any = {}; @@ -1267,7 +1305,8 @@ function createBaseMsgBuyDirect(): MsgBuyDirect { }; } export const MsgBuyDirect = { - encode(message: MsgBuyDirect, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgBuyDirect", + encode(message: MsgBuyDirect, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.buyer !== "") { writer.uint32(10).string(message.buyer); } @@ -1276,8 +1315,8 @@ export const MsgBuyDirect = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBuyDirect { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBuyDirect { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBuyDirect(); while (reader.pos < end) { @@ -1319,18 +1358,20 @@ export const MsgBuyDirect = { return message; }, fromAmino(object: MsgBuyDirectAmino): MsgBuyDirect { - return { - buyer: object.buyer, - orders: Array.isArray(object?.orders) ? object.orders.map((e: any) => MsgBuyDirect_Order.fromAmino(e)) : [] - }; + const message = createBaseMsgBuyDirect(); + if (object.buyer !== undefined && object.buyer !== null) { + message.buyer = object.buyer; + } + message.orders = object.orders?.map(e => MsgBuyDirect_Order.fromAmino(e)) || []; + return message; }, toAmino(message: MsgBuyDirect): MsgBuyDirectAmino { const obj: any = {}; - obj.buyer = message.buyer; + obj.buyer = message.buyer === "" ? undefined : message.buyer; if (message.orders) { obj.orders = message.orders.map(e => e ? MsgBuyDirect_Order.toAmino(e) : undefined); } else { - obj.orders = []; + obj.orders = message.orders; } return obj; }, @@ -1358,7 +1399,7 @@ export const MsgBuyDirect = { }; function createBaseMsgBuyDirect_Order(): MsgBuyDirect_Order { return { - sellOrderId: Long.UZERO, + sellOrderId: BigInt(0), quantity: "", bidPrice: undefined, disableAutoRetire: false, @@ -1367,8 +1408,9 @@ function createBaseMsgBuyDirect_Order(): MsgBuyDirect_Order { }; } export const MsgBuyDirect_Order = { - encode(message: MsgBuyDirect_Order, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sellOrderId.isZero()) { + typeUrl: "/regen.ecocredit.marketplace.v1.Order", + encode(message: MsgBuyDirect_Order, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(16).uint64(message.sellOrderId); } if (message.quantity !== "") { @@ -1388,15 +1430,15 @@ export const MsgBuyDirect_Order = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBuyDirect_Order { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBuyDirect_Order { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBuyDirect_Order(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; case 3: message.quantity = reader.string(); @@ -1422,7 +1464,7 @@ export const MsgBuyDirect_Order = { }, fromJSON(object: any): MsgBuyDirect_Order { return { - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO, + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0), quantity: isSet(object.quantity) ? String(object.quantity) : "", bidPrice: isSet(object.bidPrice) ? Coin.fromJSON(object.bidPrice) : undefined, disableAutoRetire: isSet(object.disableAutoRetire) ? Boolean(object.disableAutoRetire) : false, @@ -1432,7 +1474,7 @@ export const MsgBuyDirect_Order = { }, toJSON(message: MsgBuyDirect_Order): unknown { const obj: any = {}; - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); message.quantity !== undefined && (obj.quantity = message.quantity); message.bidPrice !== undefined && (obj.bidPrice = message.bidPrice ? Coin.toJSON(message.bidPrice) : undefined); message.disableAutoRetire !== undefined && (obj.disableAutoRetire = message.disableAutoRetire); @@ -1442,7 +1484,7 @@ export const MsgBuyDirect_Order = { }, fromPartial(object: Partial): MsgBuyDirect_Order { const message = createBaseMsgBuyDirect_Order(); - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); message.quantity = object.quantity ?? ""; message.bidPrice = object.bidPrice !== undefined && object.bidPrice !== null ? Coin.fromPartial(object.bidPrice) : undefined; message.disableAutoRetire = object.disableAutoRetire ?? false; @@ -1451,23 +1493,35 @@ export const MsgBuyDirect_Order = { return message; }, fromAmino(object: MsgBuyDirect_OrderAmino): MsgBuyDirect_Order { - return { - sellOrderId: Long.fromString(object.sell_order_id), - quantity: object.quantity, - bidPrice: object?.bid_price ? Coin.fromAmino(object.bid_price) : undefined, - disableAutoRetire: object.disable_auto_retire, - retirementJurisdiction: object.retirement_jurisdiction, - retirementReason: object.retirement_reason - }; + const message = createBaseMsgBuyDirect_Order(); + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + if (object.quantity !== undefined && object.quantity !== null) { + message.quantity = object.quantity; + } + if (object.bid_price !== undefined && object.bid_price !== null) { + message.bidPrice = Coin.fromAmino(object.bid_price); + } + if (object.disable_auto_retire !== undefined && object.disable_auto_retire !== null) { + message.disableAutoRetire = object.disable_auto_retire; + } + if (object.retirement_jurisdiction !== undefined && object.retirement_jurisdiction !== null) { + message.retirementJurisdiction = object.retirement_jurisdiction; + } + if (object.retirement_reason !== undefined && object.retirement_reason !== null) { + message.retirementReason = object.retirement_reason; + } + return message; }, toAmino(message: MsgBuyDirect_Order): MsgBuyDirect_OrderAmino { const obj: any = {}; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; - obj.quantity = message.quantity; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; + obj.quantity = message.quantity === "" ? undefined : message.quantity; obj.bid_price = message.bidPrice ? Coin.toAmino(message.bidPrice) : undefined; - obj.disable_auto_retire = message.disableAutoRetire; - obj.retirement_jurisdiction = message.retirementJurisdiction; - obj.retirement_reason = message.retirementReason; + obj.disable_auto_retire = message.disableAutoRetire === false ? undefined : message.disableAutoRetire; + obj.retirement_jurisdiction = message.retirementJurisdiction === "" ? undefined : message.retirementJurisdiction; + obj.retirement_reason = message.retirementReason === "" ? undefined : message.retirementReason; return obj; }, fromAminoMsg(object: MsgBuyDirect_OrderAminoMsg): MsgBuyDirect_Order { @@ -1490,11 +1544,12 @@ function createBaseMsgBuyDirectResponse(): MsgBuyDirectResponse { return {}; } export const MsgBuyDirectResponse = { - encode(_: MsgBuyDirectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgBuyDirectResponse", + encode(_: MsgBuyDirectResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBuyDirectResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBuyDirectResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBuyDirectResponse(); while (reader.pos < end) { @@ -1519,7 +1574,8 @@ export const MsgBuyDirectResponse = { return message; }, fromAmino(_: MsgBuyDirectResponseAmino): MsgBuyDirectResponse { - return {}; + const message = createBaseMsgBuyDirectResponse(); + return message; }, toAmino(_: MsgBuyDirectResponse): MsgBuyDirectResponseAmino { const obj: any = {}; @@ -1550,7 +1606,8 @@ function createBaseMsgAddAllowedDenom(): MsgAddAllowedDenom { }; } export const MsgAddAllowedDenom = { - encode(message: MsgAddAllowedDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgAddAllowedDenom", + encode(message: MsgAddAllowedDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1565,8 +1622,8 @@ export const MsgAddAllowedDenom = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddAllowedDenom { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddAllowedDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddAllowedDenom(); while (reader.pos < end) { @@ -1616,19 +1673,27 @@ export const MsgAddAllowedDenom = { return message; }, fromAmino(object: MsgAddAllowedDenomAmino): MsgAddAllowedDenom { - return { - authority: object.authority, - bankDenom: object.bank_denom, - displayDenom: object.display_denom, - exponent: object.exponent - }; + const message = createBaseMsgAddAllowedDenom(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.bank_denom !== undefined && object.bank_denom !== null) { + message.bankDenom = object.bank_denom; + } + if (object.display_denom !== undefined && object.display_denom !== null) { + message.displayDenom = object.display_denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + return message; }, toAmino(message: MsgAddAllowedDenom): MsgAddAllowedDenomAmino { const obj: any = {}; - obj.authority = message.authority; - obj.bank_denom = message.bankDenom; - obj.display_denom = message.displayDenom; - obj.exponent = message.exponent; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.bank_denom = message.bankDenom === "" ? undefined : message.bankDenom; + obj.display_denom = message.displayDenom === "" ? undefined : message.displayDenom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; return obj; }, fromAminoMsg(object: MsgAddAllowedDenomAminoMsg): MsgAddAllowedDenom { @@ -1657,11 +1722,12 @@ function createBaseMsgAddAllowedDenomResponse(): MsgAddAllowedDenomResponse { return {}; } export const MsgAddAllowedDenomResponse = { - encode(_: MsgAddAllowedDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgAddAllowedDenomResponse", + encode(_: MsgAddAllowedDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddAllowedDenomResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddAllowedDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddAllowedDenomResponse(); while (reader.pos < end) { @@ -1686,7 +1752,8 @@ export const MsgAddAllowedDenomResponse = { return message; }, fromAmino(_: MsgAddAllowedDenomResponseAmino): MsgAddAllowedDenomResponse { - return {}; + const message = createBaseMsgAddAllowedDenomResponse(); + return message; }, toAmino(_: MsgAddAllowedDenomResponse): MsgAddAllowedDenomResponseAmino { const obj: any = {}; @@ -1715,7 +1782,8 @@ function createBaseMsgRemoveAllowedDenom(): MsgRemoveAllowedDenom { }; } export const MsgRemoveAllowedDenom = { - encode(message: MsgRemoveAllowedDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenom", + encode(message: MsgRemoveAllowedDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1724,8 +1792,8 @@ export const MsgRemoveAllowedDenom = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveAllowedDenom { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveAllowedDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRemoveAllowedDenom(); while (reader.pos < end) { @@ -1763,15 +1831,19 @@ export const MsgRemoveAllowedDenom = { return message; }, fromAmino(object: MsgRemoveAllowedDenomAmino): MsgRemoveAllowedDenom { - return { - authority: object.authority, - denom: object.denom - }; + const message = createBaseMsgRemoveAllowedDenom(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: MsgRemoveAllowedDenom): MsgRemoveAllowedDenomAmino { const obj: any = {}; - obj.authority = message.authority; - obj.denom = message.denom; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object: MsgRemoveAllowedDenomAminoMsg): MsgRemoveAllowedDenom { @@ -1800,11 +1872,12 @@ function createBaseMsgRemoveAllowedDenomResponse(): MsgRemoveAllowedDenomRespons return {}; } export const MsgRemoveAllowedDenomResponse = { - encode(_: MsgRemoveAllowedDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.MsgRemoveAllowedDenomResponse", + encode(_: MsgRemoveAllowedDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveAllowedDenomResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveAllowedDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRemoveAllowedDenomResponse(); while (reader.pos < end) { @@ -1829,7 +1902,8 @@ export const MsgRemoveAllowedDenomResponse = { return message; }, fromAmino(_: MsgRemoveAllowedDenomResponseAmino): MsgRemoveAllowedDenomResponse { - return {}; + const message = createBaseMsgRemoveAllowedDenomResponse(); + return message; }, toAmino(_: MsgRemoveAllowedDenomResponse): MsgRemoveAllowedDenomResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/types.ts b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/types.ts index 6994c94e..75ecde5e 100644 --- a/packages/api/src/codegen/regen/ecocredit/marketplace/v1/types.ts +++ b/packages/api/src/codegen/regen/ecocredit/marketplace/v1/types.ts @@ -1,5 +1,5 @@ import { AllowedDenom, AllowedDenomAmino, AllowedDenomSDKType } from "./state"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; /** * AllowDenomProposal is a gov Content type for approving a denom for use in the @@ -17,7 +17,7 @@ export interface AllowDenomProposal { * denom contains coin denom information that will be added to the * list of allowed denoms for use in the marketplace. */ - denom: AllowedDenom; + denom?: AllowedDenom; } export interface AllowDenomProposalProtoMsg { typeUrl: "/regen.ecocredit.marketplace.v1.AllowDenomProposal"; @@ -32,9 +32,9 @@ export interface AllowDenomProposalProtoMsg { */ export interface AllowDenomProposalAmino { /** title is the title of the proposal. */ - title: string; + title?: string; /** description is the description of the proposal. */ - description: string; + description?: string; /** * denom contains coin denom information that will be added to the * list of allowed denoms for use in the marketplace. @@ -55,17 +55,18 @@ export interface AllowDenomProposalAminoMsg { export interface AllowDenomProposalSDKType { title: string; description: string; - denom: AllowedDenomSDKType; + denom?: AllowedDenomSDKType; } function createBaseAllowDenomProposal(): AllowDenomProposal { return { title: "", description: "", - denom: AllowedDenom.fromPartial({}) + denom: undefined }; } export const AllowDenomProposal = { - encode(message: AllowDenomProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.marketplace.v1.AllowDenomProposal", + encode(message: AllowDenomProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -77,8 +78,8 @@ export const AllowDenomProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowDenomProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowDenomProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowDenomProposal(); while (reader.pos < end) { @@ -122,16 +123,22 @@ export const AllowDenomProposal = { return message; }, fromAmino(object: AllowDenomProposalAmino): AllowDenomProposal { - return { - title: object.title, - description: object.description, - denom: object?.denom ? AllowedDenom.fromAmino(object.denom) : undefined - }; + const message = createBaseAllowDenomProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = AllowedDenom.fromAmino(object.denom); + } + return message; }, toAmino(message: AllowDenomProposal): AllowDenomProposalAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; obj.denom = message.denom ? AllowedDenom.toAmino(message.denom) : undefined; return obj; }, diff --git a/packages/api/src/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts b/packages/api/src/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts index b9d745e5..207e4810 100644 --- a/packages/api/src/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts +++ b/packages/api/src/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts @@ -1,17 +1,17 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../../helpers"; /** * BuyOrderSellOrderMatch defines the data the FIFO/price-time-priority matching * algorithm used to actually match buy and sell orders. */ export interface BuyOrderSellOrderMatch { /** market_id defines the market within which this match exists. */ - marketId: Long; + marketId: bigint; /** buy_order_id is the buy order ID. */ - buyOrderId: Long; + buyOrderId: bigint; /** sell_order_id is the sell order ID. */ - sellOrderId: Long; + sellOrderId: bigint; /** * bid_price_complement is the the complement (^ operator) of the bid price * encoded as a uint32 (which should have sufficient precision) - effectively @@ -35,23 +35,23 @@ export interface BuyOrderSellOrderMatchProtoMsg { */ export interface BuyOrderSellOrderMatchAmino { /** market_id defines the market within which this match exists. */ - market_id: string; + market_id?: string; /** buy_order_id is the buy order ID. */ - buy_order_id: string; + buy_order_id?: string; /** sell_order_id is the sell order ID. */ - sell_order_id: string; + sell_order_id?: string; /** * bid_price_complement is the the complement (^ operator) of the bid price * encoded as a uint32 (which should have sufficient precision) - effectively * ~price * 10^exponent (usually 10^6). The complement is used so that bids * can be sorted high to low. */ - bid_price_complement: number; + bid_price_complement?: number; /** * ask_price is the ask price encoded to a uint32. Ask prices are sorted low * to high. */ - ask_price: number; + ask_price?: number; } export interface BuyOrderSellOrderMatchAminoMsg { type: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderSellOrderMatch"; @@ -62,24 +62,24 @@ export interface BuyOrderSellOrderMatchAminoMsg { * algorithm used to actually match buy and sell orders. */ export interface BuyOrderSellOrderMatchSDKType { - market_id: Long; - buy_order_id: Long; - sell_order_id: Long; + market_id: bigint; + buy_order_id: bigint; + sell_order_id: bigint; bid_price_complement: number; ask_price: number; } /** BuyOrderClassSelector indexes a buy order with class selector. */ export interface BuyOrderClassSelector { /** buy_order_id is the buy order ID. */ - buyOrderId: Long; + buyOrderId: bigint; /** class_id is the class ID. */ - classId: Long; + classId: bigint; /** project_location is the project location in the selector's criteria. */ projectLocation: string; /** min_start_date is the minimum start date in the selector's criteria. */ - minStartDate: Timestamp; + minStartDate?: Timestamp; /** max_end_date is the maximum end date in the selector's criteria. */ - maxEndDate: Timestamp; + maxEndDate?: Timestamp; } export interface BuyOrderClassSelectorProtoMsg { typeUrl: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderClassSelector"; @@ -88,15 +88,15 @@ export interface BuyOrderClassSelectorProtoMsg { /** BuyOrderClassSelector indexes a buy order with class selector. */ export interface BuyOrderClassSelectorAmino { /** buy_order_id is the buy order ID. */ - buy_order_id: string; + buy_order_id?: string; /** class_id is the class ID. */ - class_id: string; + class_id?: string; /** project_location is the project location in the selector's criteria. */ - project_location: string; + project_location?: string; /** min_start_date is the minimum start date in the selector's criteria. */ - min_start_date?: TimestampAmino; + min_start_date?: string; /** max_end_date is the maximum end date in the selector's criteria. */ - max_end_date?: TimestampAmino; + max_end_date?: string; } export interface BuyOrderClassSelectorAminoMsg { type: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderClassSelector"; @@ -104,22 +104,22 @@ export interface BuyOrderClassSelectorAminoMsg { } /** BuyOrderClassSelector indexes a buy order with class selector. */ export interface BuyOrderClassSelectorSDKType { - buy_order_id: Long; - class_id: Long; + buy_order_id: bigint; + class_id: bigint; project_location: string; - min_start_date: TimestampSDKType; - max_end_date: TimestampSDKType; + min_start_date?: TimestampSDKType; + max_end_date?: TimestampSDKType; } /** BuyOrderProjectSelector indexes a buy order with project selector. */ export interface BuyOrderProjectSelector { /** buy_order_id is the buy order ID. */ - buyOrderId: Long; + buyOrderId: bigint; /** project_id is the project ID. */ - projectId: Long; + projectId: bigint; /** min_start_date is the minimum start date in the selector's criteria. */ - minStartDate: Timestamp; + minStartDate?: Timestamp; /** max_end_date is the maximum end date in the selector's criteria. */ - maxEndDate: Timestamp; + maxEndDate?: Timestamp; } export interface BuyOrderProjectSelectorProtoMsg { typeUrl: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderProjectSelector"; @@ -128,13 +128,13 @@ export interface BuyOrderProjectSelectorProtoMsg { /** BuyOrderProjectSelector indexes a buy order with project selector. */ export interface BuyOrderProjectSelectorAmino { /** buy_order_id is the buy order ID. */ - buy_order_id: string; + buy_order_id?: string; /** project_id is the project ID. */ - project_id: string; + project_id?: string; /** min_start_date is the minimum start date in the selector's criteria. */ - min_start_date?: TimestampAmino; + min_start_date?: string; /** max_end_date is the maximum end date in the selector's criteria. */ - max_end_date?: TimestampAmino; + max_end_date?: string; } export interface BuyOrderProjectSelectorAminoMsg { type: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderProjectSelector"; @@ -142,17 +142,17 @@ export interface BuyOrderProjectSelectorAminoMsg { } /** BuyOrderProjectSelector indexes a buy order with project selector. */ export interface BuyOrderProjectSelectorSDKType { - buy_order_id: Long; - project_id: Long; - min_start_date: TimestampSDKType; - max_end_date: TimestampSDKType; + buy_order_id: bigint; + project_id: bigint; + min_start_date?: TimestampSDKType; + max_end_date?: TimestampSDKType; } /** BuyOrderBatchSelector indexes a buy order with batch selector. */ export interface BuyOrderBatchSelector { /** buy_order_id is the buy order ID. */ - buyOrderId: Long; + buyOrderId: bigint; /** batch_id is the batch ID. */ - batchId: Long; + batchId: bigint; } export interface BuyOrderBatchSelectorProtoMsg { typeUrl: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderBatchSelector"; @@ -161,9 +161,9 @@ export interface BuyOrderBatchSelectorProtoMsg { /** BuyOrderBatchSelector indexes a buy order with batch selector. */ export interface BuyOrderBatchSelectorAmino { /** buy_order_id is the buy order ID. */ - buy_order_id: string; + buy_order_id?: string; /** batch_id is the batch ID. */ - batch_id: string; + batch_id?: string; } export interface BuyOrderBatchSelectorAminoMsg { type: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderBatchSelector"; @@ -171,27 +171,28 @@ export interface BuyOrderBatchSelectorAminoMsg { } /** BuyOrderBatchSelector indexes a buy order with batch selector. */ export interface BuyOrderBatchSelectorSDKType { - buy_order_id: Long; - batch_id: Long; + buy_order_id: bigint; + batch_id: bigint; } function createBaseBuyOrderSellOrderMatch(): BuyOrderSellOrderMatch { return { - marketId: Long.UZERO, - buyOrderId: Long.UZERO, - sellOrderId: Long.UZERO, + marketId: BigInt(0), + buyOrderId: BigInt(0), + sellOrderId: BigInt(0), bidPriceComplement: 0, askPrice: 0 }; } export const BuyOrderSellOrderMatch = { - encode(message: BuyOrderSellOrderMatch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.marketId.isZero()) { + typeUrl: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderSellOrderMatch", + encode(message: BuyOrderSellOrderMatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.marketId !== BigInt(0)) { writer.uint32(8).uint64(message.marketId); } - if (!message.buyOrderId.isZero()) { + if (message.buyOrderId !== BigInt(0)) { writer.uint32(16).uint64(message.buyOrderId); } - if (!message.sellOrderId.isZero()) { + if (message.sellOrderId !== BigInt(0)) { writer.uint32(24).uint64(message.sellOrderId); } if (message.bidPriceComplement !== 0) { @@ -202,21 +203,21 @@ export const BuyOrderSellOrderMatch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BuyOrderSellOrderMatch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BuyOrderSellOrderMatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBuyOrderSellOrderMatch(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.marketId = (reader.uint64() as Long); + message.marketId = reader.uint64(); break; case 2: - message.buyOrderId = (reader.uint64() as Long); + message.buyOrderId = reader.uint64(); break; case 3: - message.sellOrderId = (reader.uint64() as Long); + message.sellOrderId = reader.uint64(); break; case 4: message.bidPriceComplement = reader.fixed32(); @@ -233,47 +234,57 @@ export const BuyOrderSellOrderMatch = { }, fromJSON(object: any): BuyOrderSellOrderMatch { return { - marketId: isSet(object.marketId) ? Long.fromValue(object.marketId) : Long.UZERO, - buyOrderId: isSet(object.buyOrderId) ? Long.fromValue(object.buyOrderId) : Long.UZERO, - sellOrderId: isSet(object.sellOrderId) ? Long.fromValue(object.sellOrderId) : Long.UZERO, + marketId: isSet(object.marketId) ? BigInt(object.marketId.toString()) : BigInt(0), + buyOrderId: isSet(object.buyOrderId) ? BigInt(object.buyOrderId.toString()) : BigInt(0), + sellOrderId: isSet(object.sellOrderId) ? BigInt(object.sellOrderId.toString()) : BigInt(0), bidPriceComplement: isSet(object.bidPriceComplement) ? Number(object.bidPriceComplement) : 0, askPrice: isSet(object.askPrice) ? Number(object.askPrice) : 0 }; }, toJSON(message: BuyOrderSellOrderMatch): unknown { const obj: any = {}; - message.marketId !== undefined && (obj.marketId = (message.marketId || Long.UZERO).toString()); - message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || Long.UZERO).toString()); - message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || Long.UZERO).toString()); + message.marketId !== undefined && (obj.marketId = (message.marketId || BigInt(0)).toString()); + message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || BigInt(0)).toString()); + message.sellOrderId !== undefined && (obj.sellOrderId = (message.sellOrderId || BigInt(0)).toString()); message.bidPriceComplement !== undefined && (obj.bidPriceComplement = Math.round(message.bidPriceComplement)); message.askPrice !== undefined && (obj.askPrice = Math.round(message.askPrice)); return obj; }, fromPartial(object: Partial): BuyOrderSellOrderMatch { const message = createBaseBuyOrderSellOrderMatch(); - message.marketId = object.marketId !== undefined && object.marketId !== null ? Long.fromValue(object.marketId) : Long.UZERO; - message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? Long.fromValue(object.buyOrderId) : Long.UZERO; - message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? Long.fromValue(object.sellOrderId) : Long.UZERO; + message.marketId = object.marketId !== undefined && object.marketId !== null ? BigInt(object.marketId.toString()) : BigInt(0); + message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? BigInt(object.buyOrderId.toString()) : BigInt(0); + message.sellOrderId = object.sellOrderId !== undefined && object.sellOrderId !== null ? BigInt(object.sellOrderId.toString()) : BigInt(0); message.bidPriceComplement = object.bidPriceComplement ?? 0; message.askPrice = object.askPrice ?? 0; return message; }, fromAmino(object: BuyOrderSellOrderMatchAmino): BuyOrderSellOrderMatch { - return { - marketId: Long.fromString(object.market_id), - buyOrderId: Long.fromString(object.buy_order_id), - sellOrderId: Long.fromString(object.sell_order_id), - bidPriceComplement: object.bid_price_complement, - askPrice: object.ask_price - }; + const message = createBaseBuyOrderSellOrderMatch(); + if (object.market_id !== undefined && object.market_id !== null) { + message.marketId = BigInt(object.market_id); + } + if (object.buy_order_id !== undefined && object.buy_order_id !== null) { + message.buyOrderId = BigInt(object.buy_order_id); + } + if (object.sell_order_id !== undefined && object.sell_order_id !== null) { + message.sellOrderId = BigInt(object.sell_order_id); + } + if (object.bid_price_complement !== undefined && object.bid_price_complement !== null) { + message.bidPriceComplement = object.bid_price_complement; + } + if (object.ask_price !== undefined && object.ask_price !== null) { + message.askPrice = object.ask_price; + } + return message; }, toAmino(message: BuyOrderSellOrderMatch): BuyOrderSellOrderMatchAmino { const obj: any = {}; - obj.market_id = message.marketId ? message.marketId.toString() : undefined; - obj.buy_order_id = message.buyOrderId ? message.buyOrderId.toString() : undefined; - obj.sell_order_id = message.sellOrderId ? message.sellOrderId.toString() : undefined; - obj.bid_price_complement = message.bidPriceComplement; - obj.ask_price = message.askPrice; + obj.market_id = message.marketId !== BigInt(0) ? message.marketId.toString() : undefined; + obj.buy_order_id = message.buyOrderId !== BigInt(0) ? message.buyOrderId.toString() : undefined; + obj.sell_order_id = message.sellOrderId !== BigInt(0) ? message.sellOrderId.toString() : undefined; + obj.bid_price_complement = message.bidPriceComplement === 0 ? undefined : message.bidPriceComplement; + obj.ask_price = message.askPrice === 0 ? undefined : message.askPrice; return obj; }, fromAminoMsg(object: BuyOrderSellOrderMatchAminoMsg): BuyOrderSellOrderMatch { @@ -294,19 +305,20 @@ export const BuyOrderSellOrderMatch = { }; function createBaseBuyOrderClassSelector(): BuyOrderClassSelector { return { - buyOrderId: Long.UZERO, - classId: Long.UZERO, + buyOrderId: BigInt(0), + classId: BigInt(0), projectLocation: "", minStartDate: undefined, maxEndDate: undefined }; } export const BuyOrderClassSelector = { - encode(message: BuyOrderClassSelector, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.buyOrderId.isZero()) { + typeUrl: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderClassSelector", + encode(message: BuyOrderClassSelector, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.buyOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.buyOrderId); } - if (!message.classId.isZero()) { + if (message.classId !== BigInt(0)) { writer.uint32(16).uint64(message.classId); } if (message.projectLocation !== "") { @@ -320,18 +332,18 @@ export const BuyOrderClassSelector = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BuyOrderClassSelector { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BuyOrderClassSelector { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBuyOrderClassSelector(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.buyOrderId = (reader.uint64() as Long); + message.buyOrderId = reader.uint64(); break; case 2: - message.classId = (reader.uint64() as Long); + message.classId = reader.uint64(); break; case 3: message.projectLocation = reader.string(); @@ -351,8 +363,8 @@ export const BuyOrderClassSelector = { }, fromJSON(object: any): BuyOrderClassSelector { return { - buyOrderId: isSet(object.buyOrderId) ? Long.fromValue(object.buyOrderId) : Long.UZERO, - classId: isSet(object.classId) ? Long.fromValue(object.classId) : Long.UZERO, + buyOrderId: isSet(object.buyOrderId) ? BigInt(object.buyOrderId.toString()) : BigInt(0), + classId: isSet(object.classId) ? BigInt(object.classId.toString()) : BigInt(0), projectLocation: isSet(object.projectLocation) ? String(object.projectLocation) : "", minStartDate: isSet(object.minStartDate) ? fromJsonTimestamp(object.minStartDate) : undefined, maxEndDate: isSet(object.maxEndDate) ? fromJsonTimestamp(object.maxEndDate) : undefined @@ -360,8 +372,8 @@ export const BuyOrderClassSelector = { }, toJSON(message: BuyOrderClassSelector): unknown { const obj: any = {}; - message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || Long.UZERO).toString()); - message.classId !== undefined && (obj.classId = (message.classId || Long.UZERO).toString()); + message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || BigInt(0)).toString()); + message.classId !== undefined && (obj.classId = (message.classId || BigInt(0)).toString()); message.projectLocation !== undefined && (obj.projectLocation = message.projectLocation); message.minStartDate !== undefined && (obj.minStartDate = fromTimestamp(message.minStartDate).toISOString()); message.maxEndDate !== undefined && (obj.maxEndDate = fromTimestamp(message.maxEndDate).toISOString()); @@ -369,27 +381,37 @@ export const BuyOrderClassSelector = { }, fromPartial(object: Partial): BuyOrderClassSelector { const message = createBaseBuyOrderClassSelector(); - message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? Long.fromValue(object.buyOrderId) : Long.UZERO; - message.classId = object.classId !== undefined && object.classId !== null ? Long.fromValue(object.classId) : Long.UZERO; + message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? BigInt(object.buyOrderId.toString()) : BigInt(0); + message.classId = object.classId !== undefined && object.classId !== null ? BigInt(object.classId.toString()) : BigInt(0); message.projectLocation = object.projectLocation ?? ""; message.minStartDate = object.minStartDate !== undefined && object.minStartDate !== null ? Timestamp.fromPartial(object.minStartDate) : undefined; message.maxEndDate = object.maxEndDate !== undefined && object.maxEndDate !== null ? Timestamp.fromPartial(object.maxEndDate) : undefined; return message; }, fromAmino(object: BuyOrderClassSelectorAmino): BuyOrderClassSelector { - return { - buyOrderId: Long.fromString(object.buy_order_id), - classId: Long.fromString(object.class_id), - projectLocation: object.project_location, - minStartDate: object?.min_start_date ? Timestamp.fromAmino(object.min_start_date) : undefined, - maxEndDate: object?.max_end_date ? Timestamp.fromAmino(object.max_end_date) : undefined - }; + const message = createBaseBuyOrderClassSelector(); + if (object.buy_order_id !== undefined && object.buy_order_id !== null) { + message.buyOrderId = BigInt(object.buy_order_id); + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = BigInt(object.class_id); + } + if (object.project_location !== undefined && object.project_location !== null) { + message.projectLocation = object.project_location; + } + if (object.min_start_date !== undefined && object.min_start_date !== null) { + message.minStartDate = Timestamp.fromAmino(object.min_start_date); + } + if (object.max_end_date !== undefined && object.max_end_date !== null) { + message.maxEndDate = Timestamp.fromAmino(object.max_end_date); + } + return message; }, toAmino(message: BuyOrderClassSelector): BuyOrderClassSelectorAmino { const obj: any = {}; - obj.buy_order_id = message.buyOrderId ? message.buyOrderId.toString() : undefined; - obj.class_id = message.classId ? message.classId.toString() : undefined; - obj.project_location = message.projectLocation; + obj.buy_order_id = message.buyOrderId !== BigInt(0) ? message.buyOrderId.toString() : undefined; + obj.class_id = message.classId !== BigInt(0) ? message.classId.toString() : undefined; + obj.project_location = message.projectLocation === "" ? undefined : message.projectLocation; obj.min_start_date = message.minStartDate ? Timestamp.toAmino(message.minStartDate) : undefined; obj.max_end_date = message.maxEndDate ? Timestamp.toAmino(message.maxEndDate) : undefined; return obj; @@ -412,18 +434,19 @@ export const BuyOrderClassSelector = { }; function createBaseBuyOrderProjectSelector(): BuyOrderProjectSelector { return { - buyOrderId: Long.UZERO, - projectId: Long.UZERO, + buyOrderId: BigInt(0), + projectId: BigInt(0), minStartDate: undefined, maxEndDate: undefined }; } export const BuyOrderProjectSelector = { - encode(message: BuyOrderProjectSelector, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.buyOrderId.isZero()) { + typeUrl: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderProjectSelector", + encode(message: BuyOrderProjectSelector, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.buyOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.buyOrderId); } - if (!message.projectId.isZero()) { + if (message.projectId !== BigInt(0)) { writer.uint32(16).uint64(message.projectId); } if (message.minStartDate !== undefined) { @@ -434,18 +457,18 @@ export const BuyOrderProjectSelector = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BuyOrderProjectSelector { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BuyOrderProjectSelector { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBuyOrderProjectSelector(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.buyOrderId = (reader.uint64() as Long); + message.buyOrderId = reader.uint64(); break; case 2: - message.projectId = (reader.uint64() as Long); + message.projectId = reader.uint64(); break; case 3: message.minStartDate = Timestamp.decode(reader, reader.uint32()); @@ -462,40 +485,48 @@ export const BuyOrderProjectSelector = { }, fromJSON(object: any): BuyOrderProjectSelector { return { - buyOrderId: isSet(object.buyOrderId) ? Long.fromValue(object.buyOrderId) : Long.UZERO, - projectId: isSet(object.projectId) ? Long.fromValue(object.projectId) : Long.UZERO, + buyOrderId: isSet(object.buyOrderId) ? BigInt(object.buyOrderId.toString()) : BigInt(0), + projectId: isSet(object.projectId) ? BigInt(object.projectId.toString()) : BigInt(0), minStartDate: isSet(object.minStartDate) ? fromJsonTimestamp(object.minStartDate) : undefined, maxEndDate: isSet(object.maxEndDate) ? fromJsonTimestamp(object.maxEndDate) : undefined }; }, toJSON(message: BuyOrderProjectSelector): unknown { const obj: any = {}; - message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || Long.UZERO).toString()); - message.projectId !== undefined && (obj.projectId = (message.projectId || Long.UZERO).toString()); + message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || BigInt(0)).toString()); + message.projectId !== undefined && (obj.projectId = (message.projectId || BigInt(0)).toString()); message.minStartDate !== undefined && (obj.minStartDate = fromTimestamp(message.minStartDate).toISOString()); message.maxEndDate !== undefined && (obj.maxEndDate = fromTimestamp(message.maxEndDate).toISOString()); return obj; }, fromPartial(object: Partial): BuyOrderProjectSelector { const message = createBaseBuyOrderProjectSelector(); - message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? Long.fromValue(object.buyOrderId) : Long.UZERO; - message.projectId = object.projectId !== undefined && object.projectId !== null ? Long.fromValue(object.projectId) : Long.UZERO; + message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? BigInt(object.buyOrderId.toString()) : BigInt(0); + message.projectId = object.projectId !== undefined && object.projectId !== null ? BigInt(object.projectId.toString()) : BigInt(0); message.minStartDate = object.minStartDate !== undefined && object.minStartDate !== null ? Timestamp.fromPartial(object.minStartDate) : undefined; message.maxEndDate = object.maxEndDate !== undefined && object.maxEndDate !== null ? Timestamp.fromPartial(object.maxEndDate) : undefined; return message; }, fromAmino(object: BuyOrderProjectSelectorAmino): BuyOrderProjectSelector { - return { - buyOrderId: Long.fromString(object.buy_order_id), - projectId: Long.fromString(object.project_id), - minStartDate: object?.min_start_date ? Timestamp.fromAmino(object.min_start_date) : undefined, - maxEndDate: object?.max_end_date ? Timestamp.fromAmino(object.max_end_date) : undefined - }; + const message = createBaseBuyOrderProjectSelector(); + if (object.buy_order_id !== undefined && object.buy_order_id !== null) { + message.buyOrderId = BigInt(object.buy_order_id); + } + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = BigInt(object.project_id); + } + if (object.min_start_date !== undefined && object.min_start_date !== null) { + message.minStartDate = Timestamp.fromAmino(object.min_start_date); + } + if (object.max_end_date !== undefined && object.max_end_date !== null) { + message.maxEndDate = Timestamp.fromAmino(object.max_end_date); + } + return message; }, toAmino(message: BuyOrderProjectSelector): BuyOrderProjectSelectorAmino { const obj: any = {}; - obj.buy_order_id = message.buyOrderId ? message.buyOrderId.toString() : undefined; - obj.project_id = message.projectId ? message.projectId.toString() : undefined; + obj.buy_order_id = message.buyOrderId !== BigInt(0) ? message.buyOrderId.toString() : undefined; + obj.project_id = message.projectId !== BigInt(0) ? message.projectId.toString() : undefined; obj.min_start_date = message.minStartDate ? Timestamp.toAmino(message.minStartDate) : undefined; obj.max_end_date = message.maxEndDate ? Timestamp.toAmino(message.maxEndDate) : undefined; return obj; @@ -518,32 +549,33 @@ export const BuyOrderProjectSelector = { }; function createBaseBuyOrderBatchSelector(): BuyOrderBatchSelector { return { - buyOrderId: Long.UZERO, - batchId: Long.UZERO + buyOrderId: BigInt(0), + batchId: BigInt(0) }; } export const BuyOrderBatchSelector = { - encode(message: BuyOrderBatchSelector, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.buyOrderId.isZero()) { + typeUrl: "/regen.ecocredit.orderbook.v1alpha1.BuyOrderBatchSelector", + encode(message: BuyOrderBatchSelector, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.buyOrderId !== BigInt(0)) { writer.uint32(8).uint64(message.buyOrderId); } - if (!message.batchId.isZero()) { + if (message.batchId !== BigInt(0)) { writer.uint32(16).uint64(message.batchId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BuyOrderBatchSelector { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BuyOrderBatchSelector { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBuyOrderBatchSelector(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.buyOrderId = (reader.uint64() as Long); + message.buyOrderId = reader.uint64(); break; case 2: - message.batchId = (reader.uint64() as Long); + message.batchId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -554,32 +586,36 @@ export const BuyOrderBatchSelector = { }, fromJSON(object: any): BuyOrderBatchSelector { return { - buyOrderId: isSet(object.buyOrderId) ? Long.fromValue(object.buyOrderId) : Long.UZERO, - batchId: isSet(object.batchId) ? Long.fromValue(object.batchId) : Long.UZERO + buyOrderId: isSet(object.buyOrderId) ? BigInt(object.buyOrderId.toString()) : BigInt(0), + batchId: isSet(object.batchId) ? BigInt(object.batchId.toString()) : BigInt(0) }; }, toJSON(message: BuyOrderBatchSelector): unknown { const obj: any = {}; - message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || Long.UZERO).toString()); - message.batchId !== undefined && (obj.batchId = (message.batchId || Long.UZERO).toString()); + message.buyOrderId !== undefined && (obj.buyOrderId = (message.buyOrderId || BigInt(0)).toString()); + message.batchId !== undefined && (obj.batchId = (message.batchId || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): BuyOrderBatchSelector { const message = createBaseBuyOrderBatchSelector(); - message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? Long.fromValue(object.buyOrderId) : Long.UZERO; - message.batchId = object.batchId !== undefined && object.batchId !== null ? Long.fromValue(object.batchId) : Long.UZERO; + message.buyOrderId = object.buyOrderId !== undefined && object.buyOrderId !== null ? BigInt(object.buyOrderId.toString()) : BigInt(0); + message.batchId = object.batchId !== undefined && object.batchId !== null ? BigInt(object.batchId.toString()) : BigInt(0); return message; }, fromAmino(object: BuyOrderBatchSelectorAmino): BuyOrderBatchSelector { - return { - buyOrderId: Long.fromString(object.buy_order_id), - batchId: Long.fromString(object.batch_id) - }; + const message = createBaseBuyOrderBatchSelector(); + if (object.buy_order_id !== undefined && object.buy_order_id !== null) { + message.buyOrderId = BigInt(object.buy_order_id); + } + if (object.batch_id !== undefined && object.batch_id !== null) { + message.batchId = BigInt(object.batch_id); + } + return message; }, toAmino(message: BuyOrderBatchSelector): BuyOrderBatchSelectorAmino { const obj: any = {}; - obj.buy_order_id = message.buyOrderId ? message.buyOrderId.toString() : undefined; - obj.batch_id = message.batchId ? message.batchId.toString() : undefined; + obj.buy_order_id = message.buyOrderId !== BigInt(0) ? message.buyOrderId.toString() : undefined; + obj.batch_id = message.batchId !== BigInt(0) ? message.batchId.toString() : undefined; return obj; }, fromAminoMsg(object: BuyOrderBatchSelectorAminoMsg): BuyOrderBatchSelector { diff --git a/packages/api/src/codegen/regen/ecocredit/v1/events.ts b/packages/api/src/codegen/regen/ecocredit/v1/events.ts index 747df79b..9e874abe 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/events.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/events.ts @@ -1,5 +1,5 @@ import { OriginTx, OriginTxAmino, OriginTxSDKType } from "./types"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** EventCreateClass is an event emitted when a credit class is created. */ export interface EventCreateClass { @@ -13,7 +13,7 @@ export interface EventCreateClassProtoMsg { /** EventCreateClass is an event emitted when a credit class is created. */ export interface EventCreateClassAmino { /** class_id is the unique identifier of the credit class. */ - class_id: string; + class_id?: string; } export interface EventCreateClassAminoMsg { type: "/regen.ecocredit.v1.EventCreateClass"; @@ -35,7 +35,7 @@ export interface EventCreateProjectProtoMsg { /** EventCreateProject is an event emitted when a project is created. */ export interface EventCreateProjectAmino { /** project_id is the unique identifier of the project. */ - project_id: string; + project_id?: string; } export interface EventCreateProjectAminoMsg { type: "/regen.ecocredit.v1.EventCreateProject"; @@ -53,7 +53,7 @@ export interface EventCreateBatch { * origin_tx is the transaction from another chain or registry that triggered * the creation of the credit batch. */ - originTx: OriginTx; + originTx?: OriginTx; } export interface EventCreateBatchProtoMsg { typeUrl: "/regen.ecocredit.v1.EventCreateBatch"; @@ -62,7 +62,7 @@ export interface EventCreateBatchProtoMsg { /** EventCreateBatch is an event emitted when a credit batch is created. */ export interface EventCreateBatchAmino { /** batch_denom is the unique identifier of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** * origin_tx is the transaction from another chain or registry that triggered * the creation of the credit batch. @@ -76,7 +76,7 @@ export interface EventCreateBatchAminoMsg { /** EventCreateBatch is an event emitted when a credit batch is created. */ export interface EventCreateBatchSDKType { batch_denom: string; - origin_tx: OriginTxSDKType; + origin_tx?: OriginTxSDKType; } /** * EventMint is an event emitted when credits are minted either when creating a @@ -106,11 +106,11 @@ export interface EventMintAmino { * batch_denom is the unique identifier of the credit batch within which the * credits were minted. */ - batch_denom: string; + batch_denom?: string; /** tradable_amount is the amount of tradable credits minted. */ - tradable_amount: string; + tradable_amount?: string; /** retired_amount is the amount of retired credits minted. */ - retired_amount: string; + retired_amount?: string; } export interface EventMintAminoMsg { type: "/regen.ecocredit.v1.EventMint"; @@ -139,7 +139,7 @@ export interface EventMintBatchCredits { * origin_tx is the transaction from another chain or registry that triggered * the minting of credits within the credit batch. */ - originTx: OriginTx; + originTx?: OriginTx; } export interface EventMintBatchCreditsProtoMsg { typeUrl: "/regen.ecocredit.v1.EventMintBatchCredits"; @@ -154,7 +154,7 @@ export interface EventMintBatchCreditsAmino { * batch_denom is the unique identifier of the credit batch within which the * credits were minted. */ - batch_denom: string; + batch_denom?: string; /** * origin_tx is the transaction from another chain or registry that triggered * the minting of credits within the credit batch. @@ -171,7 +171,7 @@ export interface EventMintBatchCreditsAminoMsg { */ export interface EventMintBatchCreditsSDKType { batch_denom: string; - origin_tx: OriginTxSDKType; + origin_tx?: OriginTxSDKType; } /** * EventTransfer is an event emitted when credits are transferred from one @@ -214,20 +214,20 @@ export interface EventTransferAmino { * case that the credits were transferred from a module, this will be the * module address (i.e. either the ecocredit module or basket submodule). */ - sender: string; + sender?: string; /** * recipient is the recipient of the credits. In the case that the credits * were transferred to a base account, this will be the account address. In * the case that the credits were transferred to a module, this will be the * module address (i.e. either the ecocredit module or basket submodule). */ - recipient: string; + recipient?: string; /** batch_denom is the unique identifier of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** tradable_amount is the decimal number of tradable credits received. */ - tradable_amount: string; + tradable_amount?: string; /** retired_amount is the decimal number of retired credits received. */ - retired_amount: string; + retired_amount?: string; } export interface EventTransferAminoMsg { type: "/regen.ecocredit.v1.EventTransfer"; @@ -298,14 +298,14 @@ export interface EventRetireAmino { * retired upon taking from a basket using basket.Msg/Take, or retired upon * purchase using marketplace.Msg/BuyDirect. */ - owner: string; + owner?: string; /** * batch_denom is the unique identifier of the credit batch within which the * credits were retired. */ - batch_denom: string; + batch_denom?: string; /** amount is the decimal number of credits that have been retired. */ - amount: string; + amount?: string; /** * jurisdiction is the jurisdiction of the beneficiary or buyer of the retired * credits. It is a string of the form @@ -313,14 +313,14 @@ export interface EventRetireAmino { * fields conforming to ISO 3166-2, and postal-code being up to 64 * alphanumeric characters. */ - jurisdiction: string; + jurisdiction?: string; /** * reason is any arbitrary string that specifies the reason for retiring * credits. * * Since Revision 2 */ - reason: string; + reason?: string; } export interface EventRetireAminoMsg { type: "/regen.ecocredit.v1.EventRetire"; @@ -367,16 +367,16 @@ export interface EventCancelProtoMsg { */ export interface EventCancelAmino { /** owner is the address of the account that cancelled the credits. */ - owner: string; + owner?: string; /** * batch_denom is the unique identifier of the credit batch within which the * credits were cancelled. */ - batch_denom: string; + batch_denom?: string; /** amount is the decimal number of credits that have been cancelled. */ - amount: string; + amount?: string; /** reason is the reason the credits were cancelled. */ - reason: string; + reason?: string; } export interface EventCancelAminoMsg { type: "/regen.ecocredit.v1.EventCancel"; @@ -411,7 +411,7 @@ export interface EventUpdateClassAdminProtoMsg { */ export interface EventUpdateClassAdminAmino { /** class_id is the unique identifier of the class that was updated. */ - class_id: string; + class_id?: string; } export interface EventUpdateClassAdminAminoMsg { type: "/regen.ecocredit.v1.EventUpdateClassAdmin"; @@ -442,7 +442,7 @@ export interface EventUpdateClassIssuersProtoMsg { */ export interface EventUpdateClassIssuersAmino { /** class_id is the unique identifier of the class that was updated. */ - class_id: string; + class_id?: string; } export interface EventUpdateClassIssuersAminoMsg { type: "/regen.ecocredit.v1.EventUpdateClassIssuers"; @@ -473,7 +473,7 @@ export interface EventUpdateClassMetadataProtoMsg { */ export interface EventUpdateClassMetadataAmino { /** class_id is the unique identifier of the class that was updated. */ - class_id: string; + class_id?: string; } export interface EventUpdateClassMetadataAminoMsg { type: "/regen.ecocredit.v1.EventUpdateClassMetadata"; @@ -498,7 +498,7 @@ export interface EventUpdateProjectAdminProtoMsg { /** EventUpdateProjectAdmin is emitted when the project admin is changed. */ export interface EventUpdateProjectAdminAmino { /** project_id is the unique identifier of the project that was updated. */ - project_id: string; + project_id?: string; } export interface EventUpdateProjectAdminAminoMsg { type: "/regen.ecocredit.v1.EventUpdateProjectAdmin"; @@ -520,7 +520,7 @@ export interface EventUpdateProjectMetadataProtoMsg { /** EventUpdateProjectMetadata is emitted when the project metadata is changed. */ export interface EventUpdateProjectMetadataAmino { /** project_id is the unique identifier of the project that was updated. */ - project_id: string; + project_id?: string; } export interface EventUpdateProjectMetadataAminoMsg { type: "/regen.ecocredit.v1.EventUpdateProjectMetadata"; @@ -552,7 +552,7 @@ export interface EventUpdateBatchMetadataProtoMsg { */ export interface EventUpdateBatchMetadataAmino { /** batch_denom is the unique identifier of the batch that was updated. */ - batch_denom: string; + batch_denom?: string; } export interface EventUpdateBatchMetadataAminoMsg { type: "/regen.ecocredit.v1.EventUpdateBatchMetadata"; @@ -579,7 +579,7 @@ export interface EventSealBatchProtoMsg { /** EventSealBatch is emitted when a batch is sealed. */ export interface EventSealBatchAmino { /** batch_denom is the denom of the batch that was sealed. */ - batch_denom: string; + batch_denom?: string; } export interface EventSealBatchAminoMsg { type: "/regen.ecocredit.v1.EventSealBatch"; @@ -601,7 +601,7 @@ export interface EventAddCreditTypeProtoMsg { /** EventAddCreditType is emitted when governance approves a new credit type. */ export interface EventAddCreditTypeAmino { /** abbreviation is the abbreviation of the credit type. */ - abbreviation: string; + abbreviation?: string; } export interface EventAddCreditTypeAminoMsg { type: "/regen.ecocredit.v1.EventAddCreditType"; @@ -641,25 +641,25 @@ export interface EventBridgeProtoMsg { /** EventBridge is emitted when credits are bridged to another chain. */ export interface EventBridgeAmino { /** target is the target chain. */ - target: string; + target?: string; /** recipient is the recipient address. */ - recipient: string; + recipient?: string; /** contract is the contract address. */ - contract: string; + contract?: string; /** amount is the amount of credits. */ - amount: string; + amount?: string; /** * owner is the owner address. * * Since Revision 1 */ - owner: string; + owner?: string; /** * batch_denom is the credit batch denom. * * Since Revision 3 */ - batch_denom: string; + batch_denom?: string; } export interface EventBridgeAminoMsg { type: "/regen.ecocredit.v1.EventBridge"; @@ -698,7 +698,7 @@ export interface EventBridgeReceive { * * Since Revision 3 */ - originTx: OriginTx; + originTx?: OriginTx; } export interface EventBridgeReceiveProtoMsg { typeUrl: "/regen.ecocredit.v1.EventBridgeReceive"; @@ -710,18 +710,18 @@ export interface EventBridgeReceiveAmino { * project_id is the unique identifier of the project that was either created * or the existing project within which the credit batch exists. */ - project_id: string; + project_id?: string; /** * batch_denom is the unique identifier of the credit batch either created * or within which the credits were dynamically minted. */ - batch_denom: string; + batch_denom?: string; /** * amount is the amount of credits. * * Since Revision 3 */ - amount: string; + amount?: string; /** * origin_tx is the transaction from another chain or registry that triggered * the minting of credits within the credit batch. @@ -739,7 +739,7 @@ export interface EventBridgeReceiveSDKType { project_id: string; batch_denom: string; amount: string; - origin_tx: OriginTxSDKType; + origin_tx?: OriginTxSDKType; } function createBaseEventCreateClass(): EventCreateClass { return { @@ -747,14 +747,15 @@ function createBaseEventCreateClass(): EventCreateClass { }; } export const EventCreateClass = { - encode(message: EventCreateClass, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventCreateClass", + encode(message: EventCreateClass, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateClass { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateClass { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateClass(); while (reader.pos < end) { @@ -786,13 +787,15 @@ export const EventCreateClass = { return message; }, fromAmino(object: EventCreateClassAmino): EventCreateClass { - return { - classId: object.class_id - }; + const message = createBaseEventCreateClass(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: EventCreateClass): EventCreateClassAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: EventCreateClassAminoMsg): EventCreateClass { @@ -817,14 +820,15 @@ function createBaseEventCreateProject(): EventCreateProject { }; } export const EventCreateProject = { - encode(message: EventCreateProject, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventCreateProject", + encode(message: EventCreateProject, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.projectId !== "") { writer.uint32(10).string(message.projectId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateProject { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateProject { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateProject(); while (reader.pos < end) { @@ -856,13 +860,15 @@ export const EventCreateProject = { return message; }, fromAmino(object: EventCreateProjectAmino): EventCreateProject { - return { - projectId: object.project_id - }; + const message = createBaseEventCreateProject(); + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + return message; }, toAmino(message: EventCreateProject): EventCreateProjectAmino { const obj: any = {}; - obj.project_id = message.projectId; + obj.project_id = message.projectId === "" ? undefined : message.projectId; return obj; }, fromAminoMsg(object: EventCreateProjectAminoMsg): EventCreateProject { @@ -884,11 +890,12 @@ export const EventCreateProject = { function createBaseEventCreateBatch(): EventCreateBatch { return { batchDenom: "", - originTx: OriginTx.fromPartial({}) + originTx: undefined }; } export const EventCreateBatch = { - encode(message: EventCreateBatch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventCreateBatch", + encode(message: EventCreateBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -897,8 +904,8 @@ export const EventCreateBatch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateBatch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateBatch(); while (reader.pos < end) { @@ -936,14 +943,18 @@ export const EventCreateBatch = { return message; }, fromAmino(object: EventCreateBatchAmino): EventCreateBatch { - return { - batchDenom: object.batch_denom, - originTx: object?.origin_tx ? OriginTx.fromAmino(object.origin_tx) : undefined - }; + const message = createBaseEventCreateBatch(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.origin_tx !== undefined && object.origin_tx !== null) { + message.originTx = OriginTx.fromAmino(object.origin_tx); + } + return message; }, toAmino(message: EventCreateBatch): EventCreateBatchAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; obj.origin_tx = message.originTx ? OriginTx.toAmino(message.originTx) : undefined; return obj; }, @@ -971,7 +982,8 @@ function createBaseEventMint(): EventMint { }; } export const EventMint = { - encode(message: EventMint, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventMint", + encode(message: EventMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -983,8 +995,8 @@ export const EventMint = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventMint { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventMint(); while (reader.pos < end) { @@ -1028,17 +1040,23 @@ export const EventMint = { return message; }, fromAmino(object: EventMintAmino): EventMint { - return { - batchDenom: object.batch_denom, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount - }; + const message = createBaseEventMint(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + return message; }, toAmino(message: EventMint): EventMintAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; return obj; }, fromAminoMsg(object: EventMintAminoMsg): EventMint { @@ -1060,11 +1078,12 @@ export const EventMint = { function createBaseEventMintBatchCredits(): EventMintBatchCredits { return { batchDenom: "", - originTx: OriginTx.fromPartial({}) + originTx: undefined }; } export const EventMintBatchCredits = { - encode(message: EventMintBatchCredits, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventMintBatchCredits", + encode(message: EventMintBatchCredits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -1073,8 +1092,8 @@ export const EventMintBatchCredits = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventMintBatchCredits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventMintBatchCredits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventMintBatchCredits(); while (reader.pos < end) { @@ -1112,14 +1131,18 @@ export const EventMintBatchCredits = { return message; }, fromAmino(object: EventMintBatchCreditsAmino): EventMintBatchCredits { - return { - batchDenom: object.batch_denom, - originTx: object?.origin_tx ? OriginTx.fromAmino(object.origin_tx) : undefined - }; + const message = createBaseEventMintBatchCredits(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.origin_tx !== undefined && object.origin_tx !== null) { + message.originTx = OriginTx.fromAmino(object.origin_tx); + } + return message; }, toAmino(message: EventMintBatchCredits): EventMintBatchCreditsAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; obj.origin_tx = message.originTx ? OriginTx.toAmino(message.originTx) : undefined; return obj; }, @@ -1149,7 +1172,8 @@ function createBaseEventTransfer(): EventTransfer { }; } export const EventTransfer = { - encode(message: EventTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventTransfer", + encode(message: EventTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -1167,8 +1191,8 @@ export const EventTransfer = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventTransfer { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventTransfer(); while (reader.pos < end) { @@ -1224,21 +1248,31 @@ export const EventTransfer = { return message; }, fromAmino(object: EventTransferAmino): EventTransfer { - return { - sender: object.sender, - recipient: object.recipient, - batchDenom: object.batch_denom, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount - }; + const message = createBaseEventTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + return message; }, toAmino(message: EventTransfer): EventTransferAmino { const obj: any = {}; - obj.sender = message.sender; - obj.recipient = message.recipient; - obj.batch_denom = message.batchDenom; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; return obj; }, fromAminoMsg(object: EventTransferAminoMsg): EventTransfer { @@ -1267,7 +1301,8 @@ function createBaseEventRetire(): EventRetire { }; } export const EventRetire = { - encode(message: EventRetire, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventRetire", + encode(message: EventRetire, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -1285,8 +1320,8 @@ export const EventRetire = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventRetire { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventRetire { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventRetire(); while (reader.pos < end) { @@ -1342,21 +1377,31 @@ export const EventRetire = { return message; }, fromAmino(object: EventRetireAmino): EventRetire { - return { - owner: object.owner, - batchDenom: object.batch_denom, - amount: object.amount, - jurisdiction: object.jurisdiction, - reason: object.reason - }; + const message = createBaseEventRetire(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.jurisdiction !== undefined && object.jurisdiction !== null) { + message.jurisdiction = object.jurisdiction; + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + return message; }, toAmino(message: EventRetire): EventRetireAmino { const obj: any = {}; - obj.owner = message.owner; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; - obj.jurisdiction = message.jurisdiction; - obj.reason = message.reason; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.jurisdiction = message.jurisdiction === "" ? undefined : message.jurisdiction; + obj.reason = message.reason === "" ? undefined : message.reason; return obj; }, fromAminoMsg(object: EventRetireAminoMsg): EventRetire { @@ -1384,7 +1429,8 @@ function createBaseEventCancel(): EventCancel { }; } export const EventCancel = { - encode(message: EventCancel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventCancel", + encode(message: EventCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -1399,8 +1445,8 @@ export const EventCancel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCancel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCancel(); while (reader.pos < end) { @@ -1450,19 +1496,27 @@ export const EventCancel = { return message; }, fromAmino(object: EventCancelAmino): EventCancel { - return { - owner: object.owner, - batchDenom: object.batch_denom, - amount: object.amount, - reason: object.reason - }; + const message = createBaseEventCancel(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + return message; }, toAmino(message: EventCancel): EventCancelAmino { const obj: any = {}; - obj.owner = message.owner; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; - obj.reason = message.reason; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.reason = message.reason === "" ? undefined : message.reason; return obj; }, fromAminoMsg(object: EventCancelAminoMsg): EventCancel { @@ -1487,14 +1541,15 @@ function createBaseEventUpdateClassAdmin(): EventUpdateClassAdmin { }; } export const EventUpdateClassAdmin = { - encode(message: EventUpdateClassAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventUpdateClassAdmin", + encode(message: EventUpdateClassAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateClassAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateClassAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateClassAdmin(); while (reader.pos < end) { @@ -1526,13 +1581,15 @@ export const EventUpdateClassAdmin = { return message; }, fromAmino(object: EventUpdateClassAdminAmino): EventUpdateClassAdmin { - return { - classId: object.class_id - }; + const message = createBaseEventUpdateClassAdmin(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: EventUpdateClassAdmin): EventUpdateClassAdminAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: EventUpdateClassAdminAminoMsg): EventUpdateClassAdmin { @@ -1557,14 +1614,15 @@ function createBaseEventUpdateClassIssuers(): EventUpdateClassIssuers { }; } export const EventUpdateClassIssuers = { - encode(message: EventUpdateClassIssuers, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventUpdateClassIssuers", + encode(message: EventUpdateClassIssuers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateClassIssuers { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateClassIssuers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateClassIssuers(); while (reader.pos < end) { @@ -1596,13 +1654,15 @@ export const EventUpdateClassIssuers = { return message; }, fromAmino(object: EventUpdateClassIssuersAmino): EventUpdateClassIssuers { - return { - classId: object.class_id - }; + const message = createBaseEventUpdateClassIssuers(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: EventUpdateClassIssuers): EventUpdateClassIssuersAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: EventUpdateClassIssuersAminoMsg): EventUpdateClassIssuers { @@ -1627,14 +1687,15 @@ function createBaseEventUpdateClassMetadata(): EventUpdateClassMetadata { }; } export const EventUpdateClassMetadata = { - encode(message: EventUpdateClassMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventUpdateClassMetadata", + encode(message: EventUpdateClassMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateClassMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateClassMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateClassMetadata(); while (reader.pos < end) { @@ -1666,13 +1727,15 @@ export const EventUpdateClassMetadata = { return message; }, fromAmino(object: EventUpdateClassMetadataAmino): EventUpdateClassMetadata { - return { - classId: object.class_id - }; + const message = createBaseEventUpdateClassMetadata(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: EventUpdateClassMetadata): EventUpdateClassMetadataAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: EventUpdateClassMetadataAminoMsg): EventUpdateClassMetadata { @@ -1697,14 +1760,15 @@ function createBaseEventUpdateProjectAdmin(): EventUpdateProjectAdmin { }; } export const EventUpdateProjectAdmin = { - encode(message: EventUpdateProjectAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventUpdateProjectAdmin", + encode(message: EventUpdateProjectAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.projectId !== "") { writer.uint32(10).string(message.projectId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateProjectAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateProjectAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateProjectAdmin(); while (reader.pos < end) { @@ -1736,13 +1800,15 @@ export const EventUpdateProjectAdmin = { return message; }, fromAmino(object: EventUpdateProjectAdminAmino): EventUpdateProjectAdmin { - return { - projectId: object.project_id - }; + const message = createBaseEventUpdateProjectAdmin(); + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + return message; }, toAmino(message: EventUpdateProjectAdmin): EventUpdateProjectAdminAmino { const obj: any = {}; - obj.project_id = message.projectId; + obj.project_id = message.projectId === "" ? undefined : message.projectId; return obj; }, fromAminoMsg(object: EventUpdateProjectAdminAminoMsg): EventUpdateProjectAdmin { @@ -1767,14 +1833,15 @@ function createBaseEventUpdateProjectMetadata(): EventUpdateProjectMetadata { }; } export const EventUpdateProjectMetadata = { - encode(message: EventUpdateProjectMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventUpdateProjectMetadata", + encode(message: EventUpdateProjectMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.projectId !== "") { writer.uint32(10).string(message.projectId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateProjectMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateProjectMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateProjectMetadata(); while (reader.pos < end) { @@ -1806,13 +1873,15 @@ export const EventUpdateProjectMetadata = { return message; }, fromAmino(object: EventUpdateProjectMetadataAmino): EventUpdateProjectMetadata { - return { - projectId: object.project_id - }; + const message = createBaseEventUpdateProjectMetadata(); + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + return message; }, toAmino(message: EventUpdateProjectMetadata): EventUpdateProjectMetadataAmino { const obj: any = {}; - obj.project_id = message.projectId; + obj.project_id = message.projectId === "" ? undefined : message.projectId; return obj; }, fromAminoMsg(object: EventUpdateProjectMetadataAminoMsg): EventUpdateProjectMetadata { @@ -1837,14 +1906,15 @@ function createBaseEventUpdateBatchMetadata(): EventUpdateBatchMetadata { }; } export const EventUpdateBatchMetadata = { - encode(message: EventUpdateBatchMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventUpdateBatchMetadata", + encode(message: EventUpdateBatchMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateBatchMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateBatchMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateBatchMetadata(); while (reader.pos < end) { @@ -1876,13 +1946,15 @@ export const EventUpdateBatchMetadata = { return message; }, fromAmino(object: EventUpdateBatchMetadataAmino): EventUpdateBatchMetadata { - return { - batchDenom: object.batch_denom - }; + const message = createBaseEventUpdateBatchMetadata(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: EventUpdateBatchMetadata): EventUpdateBatchMetadataAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: EventUpdateBatchMetadataAminoMsg): EventUpdateBatchMetadata { @@ -1907,14 +1979,15 @@ function createBaseEventSealBatch(): EventSealBatch { }; } export const EventSealBatch = { - encode(message: EventSealBatch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventSealBatch", + encode(message: EventSealBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventSealBatch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventSealBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSealBatch(); while (reader.pos < end) { @@ -1946,13 +2019,15 @@ export const EventSealBatch = { return message; }, fromAmino(object: EventSealBatchAmino): EventSealBatch { - return { - batchDenom: object.batch_denom - }; + const message = createBaseEventSealBatch(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: EventSealBatch): EventSealBatchAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: EventSealBatchAminoMsg): EventSealBatch { @@ -1977,14 +2052,15 @@ function createBaseEventAddCreditType(): EventAddCreditType { }; } export const EventAddCreditType = { - encode(message: EventAddCreditType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventAddCreditType", + encode(message: EventAddCreditType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.abbreviation !== "") { writer.uint32(10).string(message.abbreviation); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventAddCreditType { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventAddCreditType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventAddCreditType(); while (reader.pos < end) { @@ -2016,13 +2092,15 @@ export const EventAddCreditType = { return message; }, fromAmino(object: EventAddCreditTypeAmino): EventAddCreditType { - return { - abbreviation: object.abbreviation - }; + const message = createBaseEventAddCreditType(); + if (object.abbreviation !== undefined && object.abbreviation !== null) { + message.abbreviation = object.abbreviation; + } + return message; }, toAmino(message: EventAddCreditType): EventAddCreditTypeAmino { const obj: any = {}; - obj.abbreviation = message.abbreviation; + obj.abbreviation = message.abbreviation === "" ? undefined : message.abbreviation; return obj; }, fromAminoMsg(object: EventAddCreditTypeAminoMsg): EventAddCreditType { @@ -2052,7 +2130,8 @@ function createBaseEventBridge(): EventBridge { }; } export const EventBridge = { - encode(message: EventBridge, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventBridge", + encode(message: EventBridge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.target !== "") { writer.uint32(10).string(message.target); } @@ -2073,8 +2152,8 @@ export const EventBridge = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventBridge { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventBridge { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventBridge(); while (reader.pos < end) { @@ -2136,23 +2215,35 @@ export const EventBridge = { return message; }, fromAmino(object: EventBridgeAmino): EventBridge { - return { - target: object.target, - recipient: object.recipient, - contract: object.contract, - amount: object.amount, - owner: object.owner, - batchDenom: object.batch_denom - }; + const message = createBaseEventBridge(); + if (object.target !== undefined && object.target !== null) { + message.target = object.target; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: EventBridge): EventBridgeAmino { const obj: any = {}; - obj.target = message.target; - obj.recipient = message.recipient; - obj.contract = message.contract; - obj.amount = message.amount; - obj.owner = message.owner; - obj.batch_denom = message.batchDenom; + obj.target = message.target === "" ? undefined : message.target; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: EventBridgeAminoMsg): EventBridge { @@ -2176,11 +2267,12 @@ function createBaseEventBridgeReceive(): EventBridgeReceive { projectId: "", batchDenom: "", amount: "", - originTx: OriginTx.fromPartial({}) + originTx: undefined }; } export const EventBridgeReceive = { - encode(message: EventBridgeReceive, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.EventBridgeReceive", + encode(message: EventBridgeReceive, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.projectId !== "") { writer.uint32(10).string(message.projectId); } @@ -2195,8 +2287,8 @@ export const EventBridgeReceive = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventBridgeReceive { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventBridgeReceive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventBridgeReceive(); while (reader.pos < end) { @@ -2246,18 +2338,26 @@ export const EventBridgeReceive = { return message; }, fromAmino(object: EventBridgeReceiveAmino): EventBridgeReceive { - return { - projectId: object.project_id, - batchDenom: object.batch_denom, - amount: object.amount, - originTx: object?.origin_tx ? OriginTx.fromAmino(object.origin_tx) : undefined - }; + const message = createBaseEventBridgeReceive(); + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.origin_tx !== undefined && object.origin_tx !== null) { + message.originTx = OriginTx.fromAmino(object.origin_tx); + } + return message; }, toAmino(message: EventBridgeReceive): EventBridgeReceiveAmino { const obj: any = {}; - obj.project_id = message.projectId; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; + obj.project_id = message.projectId === "" ? undefined : message.projectId; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; obj.origin_tx = message.originTx ? OriginTx.toAmino(message.originTx) : undefined; return obj; }, diff --git a/packages/api/src/codegen/regen/ecocredit/v1/query.lcd.ts b/packages/api/src/codegen/regen/ecocredit/v1/query.lcd.ts index c73bb7b9..64fa9b0d 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/query.lcd.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryClassesRequest, QueryClassesResponseSDKType, QueryClassesByAdminRequest, QueryClassesByAdminResponseSDKType, QueryClassRequest, QueryClassResponseSDKType, QueryClassIssuersRequest, QueryClassIssuersResponseSDKType, QueryProjectsRequest, QueryProjectsResponseSDKType, QueryProjectsByClassRequest, QueryProjectsByClassResponseSDKType, QueryProjectsByReferenceIdRequest, QueryProjectsByReferenceIdResponseSDKType, QueryProjectsByAdminRequest, QueryProjectsByAdminResponseSDKType, QueryProjectRequest, QueryProjectResponseSDKType, QueryBatchesRequest, QueryBatchesResponseSDKType, QueryBatchesByIssuerRequest, QueryBatchesByIssuerResponseSDKType, QueryBatchesByClassRequest, QueryBatchesByClassResponseSDKType, QueryBatchesByProjectRequest, QueryBatchesByProjectResponseSDKType, QueryBatchRequest, QueryBatchResponseSDKType, QueryBalanceRequest, QueryBalanceResponseSDKType, QueryBalancesRequest, QueryBalancesResponseSDKType, QueryBalancesByBatchRequest, QueryBalancesByBatchResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QuerySupplyRequest, QuerySupplyResponseSDKType, QueryCreditTypesRequest, QueryCreditTypesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryCreditTypeRequest, QueryCreditTypeResponseSDKType, QueryClassCreatorAllowlistRequest, QueryClassCreatorAllowlistResponseSDKType, QueryAllowedClassCreatorsRequest, QueryAllowedClassCreatorsResponseSDKType, QueryClassFeeRequest, QueryClassFeeResponseSDKType, QueryAllowedBridgeChainsRequest, QueryAllowedBridgeChainsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/regen/ecocredit/v1/query.rpc.Query.ts b/packages/api/src/codegen/regen/ecocredit/v1/query.rpc.Query.ts index 734e96ba..366c0cc7 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryClassesRequest, QueryClassesResponse, QueryClassesByAdminRequest, QueryClassesByAdminResponse, QueryClassRequest, QueryClassResponse, QueryClassIssuersRequest, QueryClassIssuersResponse, QueryProjectsRequest, QueryProjectsResponse, QueryProjectsByClassRequest, QueryProjectsByClassResponse, QueryProjectsByReferenceIdRequest, QueryProjectsByReferenceIdResponse, QueryProjectsByAdminRequest, QueryProjectsByAdminResponse, QueryProjectRequest, QueryProjectResponse, QueryBatchesRequest, QueryBatchesResponse, QueryBatchesByIssuerRequest, QueryBatchesByIssuerResponse, QueryBatchesByClassRequest, QueryBatchesByClassResponse, QueryBatchesByProjectRequest, QueryBatchesByProjectResponse, QueryBatchRequest, QueryBatchResponse, QueryBalanceRequest, QueryBalanceResponse, QueryBalancesRequest, QueryBalancesResponse, QueryBalancesByBatchRequest, QueryBalancesByBatchResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySupplyRequest, QuerySupplyResponse, QueryCreditTypesRequest, QueryCreditTypesResponse, QueryParamsRequest, QueryParamsResponse, QueryCreditTypeRequest, QueryCreditTypeResponse, QueryClassCreatorAllowlistRequest, QueryClassCreatorAllowlistResponse, QueryAllowedClassCreatorsRequest, QueryAllowedClassCreatorsResponse, QueryClassFeeRequest, QueryClassFeeResponse, QueryAllowedBridgeChainsRequest, QueryAllowedBridgeChainsResponse } from "./query"; /** Msg is the regen.ecocredit.v1 Query service. */ @@ -143,140 +143,140 @@ export class QueryClientImpl implements Query { }): Promise { const data = QueryClassesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Classes", data); - return promise.then(data => QueryClassesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassesResponse.decode(new BinaryReader(data))); } classesByAdmin(request: QueryClassesByAdminRequest): Promise { const data = QueryClassesByAdminRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "ClassesByAdmin", data); - return promise.then(data => QueryClassesByAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassesByAdminResponse.decode(new BinaryReader(data))); } class(request: QueryClassRequest): Promise { const data = QueryClassRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Class", data); - return promise.then(data => QueryClassResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassResponse.decode(new BinaryReader(data))); } classIssuers(request: QueryClassIssuersRequest): Promise { const data = QueryClassIssuersRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "ClassIssuers", data); - return promise.then(data => QueryClassIssuersResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassIssuersResponse.decode(new BinaryReader(data))); } projects(request: QueryProjectsRequest = { pagination: undefined }): Promise { const data = QueryProjectsRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Projects", data); - return promise.then(data => QueryProjectsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProjectsResponse.decode(new BinaryReader(data))); } projectsByClass(request: QueryProjectsByClassRequest): Promise { const data = QueryProjectsByClassRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "ProjectsByClass", data); - return promise.then(data => QueryProjectsByClassResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProjectsByClassResponse.decode(new BinaryReader(data))); } projectsByReferenceId(request: QueryProjectsByReferenceIdRequest): Promise { const data = QueryProjectsByReferenceIdRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "ProjectsByReferenceId", data); - return promise.then(data => QueryProjectsByReferenceIdResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProjectsByReferenceIdResponse.decode(new BinaryReader(data))); } projectsByAdmin(request: QueryProjectsByAdminRequest): Promise { const data = QueryProjectsByAdminRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "ProjectsByAdmin", data); - return promise.then(data => QueryProjectsByAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProjectsByAdminResponse.decode(new BinaryReader(data))); } project(request: QueryProjectRequest): Promise { const data = QueryProjectRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Project", data); - return promise.then(data => QueryProjectResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryProjectResponse.decode(new BinaryReader(data))); } batches(request: QueryBatchesRequest = { pagination: undefined }): Promise { const data = QueryBatchesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Batches", data); - return promise.then(data => QueryBatchesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBatchesResponse.decode(new BinaryReader(data))); } batchesByIssuer(request: QueryBatchesByIssuerRequest): Promise { const data = QueryBatchesByIssuerRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "BatchesByIssuer", data); - return promise.then(data => QueryBatchesByIssuerResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBatchesByIssuerResponse.decode(new BinaryReader(data))); } batchesByClass(request: QueryBatchesByClassRequest): Promise { const data = QueryBatchesByClassRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "BatchesByClass", data); - return promise.then(data => QueryBatchesByClassResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBatchesByClassResponse.decode(new BinaryReader(data))); } batchesByProject(request: QueryBatchesByProjectRequest): Promise { const data = QueryBatchesByProjectRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "BatchesByProject", data); - return promise.then(data => QueryBatchesByProjectResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBatchesByProjectResponse.decode(new BinaryReader(data))); } batch(request: QueryBatchRequest): Promise { const data = QueryBatchRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Batch", data); - return promise.then(data => QueryBatchResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBatchResponse.decode(new BinaryReader(data))); } balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Balance", data); - return promise.then(data => QueryBalanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBalanceResponse.decode(new BinaryReader(data))); } balances(request: QueryBalancesRequest): Promise { const data = QueryBalancesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Balances", data); - return promise.then(data => QueryBalancesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBalancesResponse.decode(new BinaryReader(data))); } balancesByBatch(request: QueryBalancesByBatchRequest): Promise { const data = QueryBalancesByBatchRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "BalancesByBatch", data); - return promise.then(data => QueryBalancesByBatchResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBalancesByBatchResponse.decode(new BinaryReader(data))); } allBalances(request: QueryAllBalancesRequest = { pagination: undefined }): Promise { const data = QueryAllBalancesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "AllBalances", data); - return promise.then(data => QueryAllBalancesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllBalancesResponse.decode(new BinaryReader(data))); } supply(request: QuerySupplyRequest): Promise { const data = QuerySupplyRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Supply", data); - return promise.then(data => QuerySupplyResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySupplyResponse.decode(new BinaryReader(data))); } creditTypes(request: QueryCreditTypesRequest = {}): Promise { const data = QueryCreditTypesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "CreditTypes", data); - return promise.then(data => QueryCreditTypesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryCreditTypesResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } creditType(request: QueryCreditTypeRequest): Promise { const data = QueryCreditTypeRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "CreditType", data); - return promise.then(data => QueryCreditTypeResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryCreditTypeResponse.decode(new BinaryReader(data))); } classCreatorAllowlist(request: QueryClassCreatorAllowlistRequest = {}): Promise { const data = QueryClassCreatorAllowlistRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "ClassCreatorAllowlist", data); - return promise.then(data => QueryClassCreatorAllowlistResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassCreatorAllowlistResponse.decode(new BinaryReader(data))); } allowedClassCreators(request: QueryAllowedClassCreatorsRequest = { pagination: undefined }): Promise { const data = QueryAllowedClassCreatorsRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "AllowedClassCreators", data); - return promise.then(data => QueryAllowedClassCreatorsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllowedClassCreatorsResponse.decode(new BinaryReader(data))); } classFee(request: QueryClassFeeRequest = {}): Promise { const data = QueryClassFeeRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "ClassFee", data); - return promise.then(data => QueryClassFeeResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassFeeResponse.decode(new BinaryReader(data))); } allowedBridgeChains(request: QueryAllowedBridgeChainsRequest = {}): Promise { const data = QueryAllowedBridgeChainsRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Query", "AllowedBridgeChains", data); - return promise.then(data => QueryAllowedBridgeChainsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryAllowedBridgeChainsResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/regen/ecocredit/v1/query.ts b/packages/api/src/codegen/regen/ecocredit/v1/query.ts index 92c1a212..e99c5058 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/query.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/query.ts @@ -1,14 +1,14 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { CreditType, CreditTypeAmino, CreditTypeSDKType } from "./state"; import { Params, ParamsAmino, ParamsSDKType } from "./types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** QueryClassesRequest is the Query/Classes request type. */ export interface QueryClassesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClassesRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassesRequest"; @@ -25,14 +25,14 @@ export interface QueryClassesRequestAminoMsg { } /** QueryClassesRequest is the Query/Classes request type. */ export interface QueryClassesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryClassesResponse is the Query/Classes response type. */ export interface QueryClassesResponse { /** classes are the fetched credit classes. */ classes: ClassInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClassesResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassesResponse"; @@ -41,7 +41,7 @@ export interface QueryClassesResponseProtoMsg { /** QueryClassesResponse is the Query/Classes response type. */ export interface QueryClassesResponseAmino { /** classes are the fetched credit classes. */ - classes: ClassInfoAmino[]; + classes?: ClassInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -52,14 +52,14 @@ export interface QueryClassesResponseAminoMsg { /** QueryClassesResponse is the Query/Classes response type. */ export interface QueryClassesResponseSDKType { classes: ClassInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryClassesByAdminRequest is the Query/ClassesByAdmin request type. */ export interface QueryClassesByAdminRequest { /** admin is the address of the admin of the class. */ admin: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClassesByAdminRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassesByAdminRequest"; @@ -68,7 +68,7 @@ export interface QueryClassesByAdminRequestProtoMsg { /** QueryClassesByAdminRequest is the Query/ClassesByAdmin request type. */ export interface QueryClassesByAdminRequestAmino { /** admin is the address of the admin of the class. */ - admin: string; + admin?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -79,14 +79,14 @@ export interface QueryClassesByAdminRequestAminoMsg { /** QueryClassesByAdminRequest is the Query/ClassesByAdmin request type. */ export interface QueryClassesByAdminRequestSDKType { admin: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryClassesByAdminResponse is the Query/ClassesByAdmin response type. */ export interface QueryClassesByAdminResponse { /** classes are the fetched credit classes. */ classes: ClassInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClassesByAdminResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassesByAdminResponse"; @@ -95,7 +95,7 @@ export interface QueryClassesByAdminResponseProtoMsg { /** QueryClassesByAdminResponse is the Query/ClassesByAdmin response type. */ export interface QueryClassesByAdminResponseAmino { /** classes are the fetched credit classes. */ - classes: ClassInfoAmino[]; + classes?: ClassInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -106,7 +106,7 @@ export interface QueryClassesByAdminResponseAminoMsg { /** QueryClassesByAdminResponse is the Query/ClassesByAdmin response type. */ export interface QueryClassesByAdminResponseSDKType { classes: ClassInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryClassRequest is the Query/Class request type. */ export interface QueryClassRequest { @@ -120,7 +120,7 @@ export interface QueryClassRequestProtoMsg { /** QueryClassRequest is the Query/Class request type. */ export interface QueryClassRequestAmino { /** class_id is the unique identifier of the credit class to query. */ - class_id: string; + class_id?: string; } export interface QueryClassRequestAminoMsg { type: "/regen.ecocredit.v1.QueryClassRequest"; @@ -133,7 +133,7 @@ export interface QueryClassRequestSDKType { /** QueryClassResponse is the Query/Class request type. */ export interface QueryClassResponse { /** class is the fetched credit class. */ - class: ClassInfo; + class?: ClassInfo; } export interface QueryClassResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassResponse"; @@ -150,14 +150,14 @@ export interface QueryClassResponseAminoMsg { } /** QueryClassResponse is the Query/Class request type. */ export interface QueryClassResponseSDKType { - class: ClassInfoSDKType; + class?: ClassInfoSDKType; } /** QueryClassIssuersRequest is the Query/ClassIssuers request type. */ export interface QueryClassIssuersRequest { /** class_id is the unique identifier of the credit class to query. */ classId: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClassIssuersRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassIssuersRequest"; @@ -166,7 +166,7 @@ export interface QueryClassIssuersRequestProtoMsg { /** QueryClassIssuersRequest is the Query/ClassIssuers request type. */ export interface QueryClassIssuersRequestAmino { /** class_id is the unique identifier of the credit class to query. */ - class_id: string; + class_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -177,14 +177,14 @@ export interface QueryClassIssuersRequestAminoMsg { /** QueryClassIssuersRequest is the Query/ClassIssuers request type. */ export interface QueryClassIssuersRequestSDKType { class_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryClassIssuersRequest is the Query/ClassIssuers response type. */ export interface QueryClassIssuersResponse { /** issuers is a list of issuers for the credit class */ issuers: string[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClassIssuersResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassIssuersResponse"; @@ -193,7 +193,7 @@ export interface QueryClassIssuersResponseProtoMsg { /** QueryClassIssuersRequest is the Query/ClassIssuers response type. */ export interface QueryClassIssuersResponseAmino { /** issuers is a list of issuers for the credit class */ - issuers: string[]; + issuers?: string[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -204,12 +204,12 @@ export interface QueryClassIssuersResponseAminoMsg { /** QueryClassIssuersRequest is the Query/ClassIssuers response type. */ export interface QueryClassIssuersResponseSDKType { issuers: string[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryProjectsRequest is the Query/Projects request type. */ export interface QueryProjectsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProjectsRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsRequest"; @@ -226,14 +226,14 @@ export interface QueryProjectsRequestAminoMsg { } /** QueryProjectsRequest is the Query/Projects request type. */ export interface QueryProjectsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryProjectsResponse is the Query/Projects response type. */ export interface QueryProjectsResponse { /** projects are the fetched projects. */ projects: ProjectInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProjectsResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsResponse"; @@ -242,7 +242,7 @@ export interface QueryProjectsResponseProtoMsg { /** QueryProjectsResponse is the Query/Projects response type. */ export interface QueryProjectsResponseAmino { /** projects are the fetched projects. */ - projects: ProjectInfoAmino[]; + projects?: ProjectInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -253,14 +253,14 @@ export interface QueryProjectsResponseAminoMsg { /** QueryProjectsResponse is the Query/Projects response type. */ export interface QueryProjectsResponseSDKType { projects: ProjectInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryProjectsByClassRequest is the Query/ProjectsByClass request type. */ export interface QueryProjectsByClassRequest { /** class_id is the unique identifier of the credit class to query. */ classId: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProjectsByClassRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsByClassRequest"; @@ -269,7 +269,7 @@ export interface QueryProjectsByClassRequestProtoMsg { /** QueryProjectsByClassRequest is the Query/ProjectsByClass request type. */ export interface QueryProjectsByClassRequestAmino { /** class_id is the unique identifier of the credit class to query. */ - class_id: string; + class_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -280,14 +280,14 @@ export interface QueryProjectsByClassRequestAminoMsg { /** QueryProjectsByClassRequest is the Query/ProjectsByClass request type. */ export interface QueryProjectsByClassRequestSDKType { class_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryProjectsByClassResponse is the Query/ProjectsByClass response type. */ export interface QueryProjectsByClassResponse { /** projects are the fetched projects. */ projects: ProjectInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProjectsByClassResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsByClassResponse"; @@ -296,7 +296,7 @@ export interface QueryProjectsByClassResponseProtoMsg { /** QueryProjectsByClassResponse is the Query/ProjectsByClass response type. */ export interface QueryProjectsByClassResponseAmino { /** projects are the fetched projects. */ - projects: ProjectInfoAmino[]; + projects?: ProjectInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -307,7 +307,7 @@ export interface QueryProjectsByClassResponseAminoMsg { /** QueryProjectsByClassResponse is the Query/ProjectsByClass response type. */ export interface QueryProjectsByClassResponseSDKType { projects: ProjectInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryProjectsByReferenceIdRequest is the Query/ProjectsByReferenceId request @@ -317,7 +317,7 @@ export interface QueryProjectsByReferenceIdRequest { /** reference_id is the project reference id. */ referenceId: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProjectsByReferenceIdRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsByReferenceIdRequest"; @@ -329,7 +329,7 @@ export interface QueryProjectsByReferenceIdRequestProtoMsg { */ export interface QueryProjectsByReferenceIdRequestAmino { /** reference_id is the project reference id. */ - reference_id: string; + reference_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -343,7 +343,7 @@ export interface QueryProjectsByReferenceIdRequestAminoMsg { */ export interface QueryProjectsByReferenceIdRequestSDKType { reference_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryProjectsByReferenceIdResponse is the Query/ProjectsByReferenceId @@ -353,7 +353,7 @@ export interface QueryProjectsByReferenceIdResponse { /** projects are the fetched projects. */ projects: ProjectInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProjectsByReferenceIdResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsByReferenceIdResponse"; @@ -365,7 +365,7 @@ export interface QueryProjectsByReferenceIdResponseProtoMsg { */ export interface QueryProjectsByReferenceIdResponseAmino { /** projects are the fetched projects. */ - projects: ProjectInfoAmino[]; + projects?: ProjectInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -379,14 +379,14 @@ export interface QueryProjectsByReferenceIdResponseAminoMsg { */ export interface QueryProjectsByReferenceIdResponseSDKType { projects: ProjectInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryProjectsByAdminRequest is the Query/ProjectByAdmin request type. */ export interface QueryProjectsByAdminRequest { /** admin is the account address of project admin. */ admin: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProjectsByAdminRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsByAdminRequest"; @@ -395,7 +395,7 @@ export interface QueryProjectsByAdminRequestProtoMsg { /** QueryProjectsByAdminRequest is the Query/ProjectByAdmin request type. */ export interface QueryProjectsByAdminRequestAmino { /** admin is the account address of project admin. */ - admin: string; + admin?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -406,14 +406,14 @@ export interface QueryProjectsByAdminRequestAminoMsg { /** QueryProjectsByAdminRequest is the Query/ProjectByAdmin request type. */ export interface QueryProjectsByAdminRequestSDKType { admin: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryProjectsByAdminResponse is the Query/ProjectByAdmin response type. */ export interface QueryProjectsByAdminResponse { /** projects are the fetched projects. */ projects: ProjectInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProjectsByAdminResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectsByAdminResponse"; @@ -422,7 +422,7 @@ export interface QueryProjectsByAdminResponseProtoMsg { /** QueryProjectsByAdminResponse is the Query/ProjectByAdmin response type. */ export interface QueryProjectsByAdminResponseAmino { /** projects are the fetched projects. */ - projects: ProjectInfoAmino[]; + projects?: ProjectInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -433,7 +433,7 @@ export interface QueryProjectsByAdminResponseAminoMsg { /** QueryProjectsByAdminResponse is the Query/ProjectByAdmin response type. */ export interface QueryProjectsByAdminResponseSDKType { projects: ProjectInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryProjectRequest is the Query/Project request type. */ export interface QueryProjectRequest { @@ -447,7 +447,7 @@ export interface QueryProjectRequestProtoMsg { /** QueryProjectRequest is the Query/Project request type. */ export interface QueryProjectRequestAmino { /** project_id is the unique identifier of the project to query. */ - project_id: string; + project_id?: string; } export interface QueryProjectRequestAminoMsg { type: "/regen.ecocredit.v1.QueryProjectRequest"; @@ -460,7 +460,7 @@ export interface QueryProjectRequestSDKType { /** QueryProjectResponse is the Query/Project response type. */ export interface QueryProjectResponse { /** project is the fetched project. */ - project: ProjectInfo; + project?: ProjectInfo; } export interface QueryProjectResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryProjectResponse"; @@ -477,12 +477,12 @@ export interface QueryProjectResponseAminoMsg { } /** QueryProjectResponse is the Query/Project response type. */ export interface QueryProjectResponseSDKType { - project: ProjectInfoSDKType; + project?: ProjectInfoSDKType; } /** QueryBatchesRequest is the Query/Batches request type. */ export interface QueryBatchesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBatchesRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesRequest"; @@ -499,14 +499,14 @@ export interface QueryBatchesRequestAminoMsg { } /** QueryBatchesRequest is the Query/Batches request type. */ export interface QueryBatchesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBatchesResponse is the Query/Batches response type. */ export interface QueryBatchesResponse { /** batches are the fetched credit batches. */ batches: BatchInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryBatchesResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesResponse"; @@ -515,7 +515,7 @@ export interface QueryBatchesResponseProtoMsg { /** QueryBatchesResponse is the Query/Batches response type. */ export interface QueryBatchesResponseAmino { /** batches are the fetched credit batches. */ - batches: BatchInfoAmino[]; + batches?: BatchInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -526,14 +526,14 @@ export interface QueryBatchesResponseAminoMsg { /** QueryBatchesResponse is the Query/Batches response type. */ export interface QueryBatchesResponseSDKType { batches: BatchInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryBatchesByIssuerRequest is the Query/BatchesByIssuer request type. */ export interface QueryBatchesByIssuerRequest { /** issuer is the address that issued the batch */ issuer: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBatchesByIssuerRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesByIssuerRequest"; @@ -542,7 +542,7 @@ export interface QueryBatchesByIssuerRequestProtoMsg { /** QueryBatchesByIssuerRequest is the Query/BatchesByIssuer request type. */ export interface QueryBatchesByIssuerRequestAmino { /** issuer is the address that issued the batch */ - issuer: string; + issuer?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -553,14 +553,14 @@ export interface QueryBatchesByIssuerRequestAminoMsg { /** QueryBatchesByIssuerRequest is the Query/BatchesByIssuer request type. */ export interface QueryBatchesByIssuerRequestSDKType { issuer: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBatchesByIssuerResponse is the Query/BatchesByIssuer response type. */ export interface QueryBatchesByIssuerResponse { /** batches are the fetched credit batches. */ batches: BatchInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryBatchesByIssuerResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesByIssuerResponse"; @@ -569,7 +569,7 @@ export interface QueryBatchesByIssuerResponseProtoMsg { /** QueryBatchesByIssuerResponse is the Query/BatchesByIssuer response type. */ export interface QueryBatchesByIssuerResponseAmino { /** batches are the fetched credit batches. */ - batches: BatchInfoAmino[]; + batches?: BatchInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -580,14 +580,14 @@ export interface QueryBatchesByIssuerResponseAminoMsg { /** QueryBatchesByIssuerResponse is the Query/BatchesByIssuer response type. */ export interface QueryBatchesByIssuerResponseSDKType { batches: BatchInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryBatchesByClassRequest is the Query/BatchesByClass request type. */ export interface QueryBatchesByClassRequest { /** class_id is the unique identifier of the credit class to query. */ classId: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBatchesByClassRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesByClassRequest"; @@ -596,7 +596,7 @@ export interface QueryBatchesByClassRequestProtoMsg { /** QueryBatchesByClassRequest is the Query/BatchesByClass request type. */ export interface QueryBatchesByClassRequestAmino { /** class_id is the unique identifier of the credit class to query. */ - class_id: string; + class_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -607,14 +607,14 @@ export interface QueryBatchesByClassRequestAminoMsg { /** QueryBatchesByClassRequest is the Query/BatchesByClass request type. */ export interface QueryBatchesByClassRequestSDKType { class_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBatchesByProjectRequest is the Query/BatchesByProject request type. */ export interface QueryBatchesByProjectRequest { /** project_id is the unique identifier of the project to query. */ projectId: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBatchesByProjectRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesByProjectRequest"; @@ -623,7 +623,7 @@ export interface QueryBatchesByProjectRequestProtoMsg { /** QueryBatchesByProjectRequest is the Query/BatchesByProject request type. */ export interface QueryBatchesByProjectRequestAmino { /** project_id is the unique identifier of the project to query. */ - project_id: string; + project_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -634,14 +634,14 @@ export interface QueryBatchesByProjectRequestAminoMsg { /** QueryBatchesByProjectRequest is the Query/BatchesByProject request type. */ export interface QueryBatchesByProjectRequestSDKType { project_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBatchesByProjectResponse is the Query/BatchesByProject response type. */ export interface QueryBatchesByProjectResponse { /** batches are the fetched credit batches. */ batches: BatchInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryBatchesByProjectResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesByProjectResponse"; @@ -650,7 +650,7 @@ export interface QueryBatchesByProjectResponseProtoMsg { /** QueryBatchesByProjectResponse is the Query/BatchesByProject response type. */ export interface QueryBatchesByProjectResponseAmino { /** batches are the fetched credit batches. */ - batches: BatchInfoAmino[]; + batches?: BatchInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -661,14 +661,14 @@ export interface QueryBatchesByProjectResponseAminoMsg { /** QueryBatchesByProjectResponse is the Query/BatchesByProject response type. */ export interface QueryBatchesByProjectResponseSDKType { batches: BatchInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryBatchesByClassResponse is the Query/BatchesByClass response type. */ export interface QueryBatchesByClassResponse { /** batches are the fetched credit batches. */ batches: BatchInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryBatchesByClassResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchesByClassResponse"; @@ -677,7 +677,7 @@ export interface QueryBatchesByClassResponseProtoMsg { /** QueryBatchesByClassResponse is the Query/BatchesByClass response type. */ export interface QueryBatchesByClassResponseAmino { /** batches are the fetched credit batches. */ - batches: BatchInfoAmino[]; + batches?: BatchInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -688,7 +688,7 @@ export interface QueryBatchesByClassResponseAminoMsg { /** QueryBatchesByClassResponse is the Query/BatchesByClass response type. */ export interface QueryBatchesByClassResponseSDKType { batches: BatchInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryBatchRequest is the Query/Batch request type. */ export interface QueryBatchRequest { @@ -702,7 +702,7 @@ export interface QueryBatchRequestProtoMsg { /** QueryBatchRequest is the Query/Batch request type. */ export interface QueryBatchRequestAmino { /** batch_denom is the unique identifier of the credit batch to query. */ - batch_denom: string; + batch_denom?: string; } export interface QueryBatchRequestAminoMsg { type: "/regen.ecocredit.v1.QueryBatchRequest"; @@ -715,7 +715,7 @@ export interface QueryBatchRequestSDKType { /** QueryBatchResponse is the Query/Batch response type. */ export interface QueryBatchResponse { /** batch is the fetched credit batch. */ - batch: BatchInfo; + batch?: BatchInfo; } export interface QueryBatchResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBatchResponse"; @@ -732,7 +732,7 @@ export interface QueryBatchResponseAminoMsg { } /** QueryBatchResponse is the Query/Batch response type. */ export interface QueryBatchResponseSDKType { - batch: BatchInfoSDKType; + batch?: BatchInfoSDKType; } /** QueryBalanceRequest is the Query/Balance request type. */ export interface QueryBalanceRequest { @@ -748,9 +748,9 @@ export interface QueryBalanceRequestProtoMsg { /** QueryBalanceRequest is the Query/Balance request type. */ export interface QueryBalanceRequestAmino { /** address is the address of the account whose balance is being queried. */ - address: string; + address?: string; /** batch_denom is the unique identifier of the credit batch to query. */ - batch_denom: string; + batch_denom?: string; } export interface QueryBalanceRequestAminoMsg { type: "/regen.ecocredit.v1.QueryBalanceRequest"; @@ -764,7 +764,7 @@ export interface QueryBalanceRequestSDKType { /** QueryBalanceResponse is the Query/Balance response type. */ export interface QueryBalanceResponse { /** balance is the balance of the given account. */ - balance: BatchBalanceInfo; + balance?: BatchBalanceInfo; } export interface QueryBalanceResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBalanceResponse"; @@ -781,14 +781,14 @@ export interface QueryBalanceResponseAminoMsg { } /** QueryBalanceResponse is the Query/Balance response type. */ export interface QueryBalanceResponseSDKType { - balance: BatchBalanceInfoSDKType; + balance?: BatchBalanceInfoSDKType; } /** QueryBalancesRequest is the Query/Balances request type. */ export interface QueryBalancesRequest { /** address is the address of the account whose balance is being queried. */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBalancesRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBalancesRequest"; @@ -797,7 +797,7 @@ export interface QueryBalancesRequestProtoMsg { /** QueryBalancesRequest is the Query/Balances request type. */ export interface QueryBalancesRequestAmino { /** address is the address of the account whose balance is being queried. */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -808,7 +808,7 @@ export interface QueryBalancesRequestAminoMsg { /** QueryBalancesRequest is the Query/Balances request type. */ export interface QueryBalancesRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBalancesResponse is the Query/Balances response type. */ export interface QueryBalancesResponse { @@ -818,7 +818,7 @@ export interface QueryBalancesResponse { */ balances: BatchBalanceInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryBalancesResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBalancesResponse"; @@ -830,7 +830,7 @@ export interface QueryBalancesResponseAmino { * balances are a list of balances from different credit batches that the * account holds. */ - balances: BatchBalanceInfoAmino[]; + balances?: BatchBalanceInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -841,7 +841,7 @@ export interface QueryBalancesResponseAminoMsg { /** QueryBalancesResponse is the Query/Balances response type. */ export interface QueryBalancesResponseSDKType { balances: BatchBalanceInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryBalancesByBatchRequest is the Query/BalancesByBatch request type. @@ -852,7 +852,7 @@ export interface QueryBalancesByBatchRequest { /** batch_denom is the denom of the batch to query by. */ batchDenom: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBalancesByBatchRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBalancesByBatchRequest"; @@ -865,7 +865,7 @@ export interface QueryBalancesByBatchRequestProtoMsg { */ export interface QueryBalancesByBatchRequestAmino { /** batch_denom is the denom of the batch to query by. */ - batch_denom: string; + batch_denom?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -880,7 +880,7 @@ export interface QueryBalancesByBatchRequestAminoMsg { */ export interface QueryBalancesByBatchRequestSDKType { batch_denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryBalancesByBatchResponse is the Query/BalancesByBatch response type. @@ -894,7 +894,7 @@ export interface QueryBalancesByBatchResponse { */ balances: BatchBalanceInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryBalancesByBatchResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryBalancesByBatchResponse"; @@ -910,7 +910,7 @@ export interface QueryBalancesByBatchResponseAmino { * balances are a list of balances from different credit batches that the * account holds. */ - balances: BatchBalanceInfoAmino[]; + balances?: BatchBalanceInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -925,7 +925,7 @@ export interface QueryBalancesByBatchResponseAminoMsg { */ export interface QueryBalancesByBatchResponseSDKType { balances: BatchBalanceInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryAllBalancesRequest is the Query/AllBalances request type. @@ -934,7 +934,7 @@ export interface QueryBalancesByBatchResponseSDKType { */ export interface QueryAllBalancesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllBalancesRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryAllBalancesRequest"; @@ -959,7 +959,7 @@ export interface QueryAllBalancesRequestAminoMsg { * Since Revision 2 */ export interface QueryAllBalancesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllBalancesResponse is the Query/AllBalances response type. @@ -973,7 +973,7 @@ export interface QueryAllBalancesResponse { */ balances: BatchBalanceInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllBalancesResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryAllBalancesResponse"; @@ -989,7 +989,7 @@ export interface QueryAllBalancesResponseAmino { * balances are a list of balances from different credit batches that the * account holds. */ - balances: BatchBalanceInfoAmino[]; + balances?: BatchBalanceInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -1004,7 +1004,7 @@ export interface QueryAllBalancesResponseAminoMsg { */ export interface QueryAllBalancesResponseSDKType { balances: BatchBalanceInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QuerySupplyRequest is the Query/Supply request type. */ export interface QuerySupplyRequest { @@ -1018,7 +1018,7 @@ export interface QuerySupplyRequestProtoMsg { /** QuerySupplyRequest is the Query/Supply request type. */ export interface QuerySupplyRequestAmino { /** batch_denom is the unique identifier of the credit batch to query. */ - batch_denom: string; + batch_denom?: string; } export interface QuerySupplyRequestAminoMsg { type: "/regen.ecocredit.v1.QuerySupplyRequest"; @@ -1056,17 +1056,17 @@ export interface QuerySupplyResponseAmino { * tradable_amount is the decimal number of tradable credits in the batch * supply. */ - tradable_amount: string; + tradable_amount?: string; /** * retired_amount is the decimal number of retired credits in the batch * supply. */ - retired_amount: string; + retired_amount?: string; /** * cancelled_amount is the decimal number of cancelled credits in the batch * supply. */ - cancelled_amount: string; + cancelled_amount?: string; } export interface QuerySupplyResponseAminoMsg { type: "/regen.ecocredit.v1.QuerySupplyResponse"; @@ -1104,7 +1104,7 @@ export interface QueryCreditTypesResponseProtoMsg { /** QueryCreditTypesRequest is the Query/Credit_Types response type */ export interface QueryCreditTypesResponseAmino { /** credit_types are the fetched credit types. */ - credit_types: CreditTypeAmino[]; + credit_types?: CreditTypeAmino[]; } export interface QueryCreditTypesResponseAminoMsg { type: "/regen.ecocredit.v1.QueryCreditTypesResponse"; @@ -1131,7 +1131,7 @@ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is the Query/Params response type. */ export interface QueryParamsResponse { /** params defines the parameters of the ecocredit module. */ - params: Params; + params?: Params; } export interface QueryParamsResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryParamsResponse"; @@ -1148,7 +1148,7 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the Query/Params response type. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** QueryCreditTypeRequest is the Query/CreditType request type */ export interface QueryCreditTypeRequest { @@ -1162,7 +1162,7 @@ export interface QueryCreditTypeRequestProtoMsg { /** QueryCreditTypeRequest is the Query/CreditType request type */ export interface QueryCreditTypeRequestAmino { /** abbreviation is the abbreviation of the credit type. */ - abbreviation: string; + abbreviation?: string; } export interface QueryCreditTypeRequestAminoMsg { type: "/regen.ecocredit.v1.QueryCreditTypeRequest"; @@ -1175,7 +1175,7 @@ export interface QueryCreditTypeRequestSDKType { /** QueryCreditTypeResponse is the Query/CreditType response type */ export interface QueryCreditTypeResponse { /** credit_type is the fetched credit type. */ - creditType: CreditType; + creditType?: CreditType; } export interface QueryCreditTypeResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryCreditTypeResponse"; @@ -1192,7 +1192,7 @@ export interface QueryCreditTypeResponseAminoMsg { } /** QueryCreditTypeResponse is the Query/CreditType response type */ export interface QueryCreditTypeResponseSDKType { - credit_type: CreditTypeSDKType; + credit_type?: CreditTypeSDKType; } /** ClassInfo is the human-readable credit class information. */ export interface ClassInfo { @@ -1215,16 +1215,16 @@ export interface ClassInfoProtoMsg { /** ClassInfo is the human-readable credit class information. */ export interface ClassInfoAmino { /** id is the unique identifier of the credit class. */ - id: string; + id?: string; /** admin is the admin of the credit class. */ - admin: string; + admin?: string; /** metadata is the arbitrary metadata attached to the credit class. */ - metadata: string; + metadata?: string; /** * credit_type_abbrev is the abbreviation of the credit type within which this * credit class was created. */ - credit_type_abbrev: string; + credit_type_abbrev?: string; } export interface ClassInfoAminoMsg { type: "/regen.ecocredit.v1.ClassInfo"; @@ -1265,23 +1265,23 @@ export interface ProjectInfoProtoMsg { /** ProjectInfo is the human-readable project information. */ export interface ProjectInfoAmino { /** id is the unique identifier of the project. */ - id: string; + id?: string; /** admin is the admin of the project. */ - admin: string; + admin?: string; /** * class_id is the unique identifier of the credit class within which the * project was created. */ - class_id: string; + class_id?: string; /** * jurisdiction is the jurisdiction of the project. Full documentation can be * found in MsgCreateProject.jurisdiction. */ - jurisdiction: string; + jurisdiction?: string; /** metadata is the arbitrary metadata attached to the project. */ - metadata: string; + metadata?: string; /** reference_id is any arbitrary string that can be use to reference project. */ - reference_id: string; + reference_id?: string; } export interface ProjectInfoAminoMsg { type: "/regen.ecocredit.v1.ProjectInfo"; @@ -1319,14 +1319,14 @@ export interface BatchInfo { * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - startDate: Timestamp; + startDate?: Timestamp; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - endDate: Timestamp; + endDate?: Timestamp; /** issuance_date is the timestamp when the credit batch was issued. */ - issuanceDate: Timestamp; + issuanceDate?: Timestamp; /** * open determines whether or not the credit batch is open, i.e. whether or * not new credits can be minted to the credit batch. @@ -1343,36 +1343,36 @@ export interface BatchInfoAmino { * issuer is the address that created the batch and the address authorized to * mint new credits to the credit batch if the credit batch is open. */ - issuer: string; + issuer?: string; /** * project_id is the unique identifier of the project within which this credit * batch was created. */ - project_id: string; + project_id?: string; /** * denom is the unique identifier of the credit batch formed from the project * name, batch sequence number and dates. */ - denom: string; + denom?: string; /** metadata is any arbitrary metadata attached to the credit batch. */ - metadata: string; + metadata?: string; /** * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - start_date?: TimestampAmino; + start_date?: string; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - end_date?: TimestampAmino; + end_date?: string; /** issuance_date is the timestamp when the credit batch was issued. */ - issuance_date?: TimestampAmino; + issuance_date?: string; /** * open determines whether or not the credit batch is open, i.e. whether or * not new credits can be minted to the credit batch. */ - open: boolean; + open?: boolean; } export interface BatchInfoAminoMsg { type: "/regen.ecocredit.v1.BatchInfo"; @@ -1384,9 +1384,9 @@ export interface BatchInfoSDKType { project_id: string; denom: string; metadata: string; - start_date: TimestampSDKType; - end_date: TimestampSDKType; - issuance_date: TimestampSDKType; + start_date?: TimestampSDKType; + end_date?: TimestampSDKType; + issuance_date?: TimestampSDKType; open: boolean; } /** BatchBalanceInfo is the human-readable batch balance information. */ @@ -1414,20 +1414,20 @@ export interface BatchBalanceInfoProtoMsg { /** BatchBalanceInfo is the human-readable batch balance information. */ export interface BatchBalanceInfoAmino { /** address is the address of the account that owns the credits. */ - address: string; + address?: string; /** batch_denom is the unique identifier of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** tradable_amount is the total number of tradable credits owned by address. */ - tradable_amount: string; + tradable_amount?: string; /** retired_amount is the total number of retired credits owned by address. */ - retired_amount: string; + retired_amount?: string; /** * escrowed_amount is the total number of escrowed credits owned by address * and held in escrow by the marketplace. Credits are held in escrow when a * sell order is created and taken out of escrow when the sell order is either * cancelled, updated with a reduced quantity, or processed. */ - escrowed_amount: string; + escrowed_amount?: string; } export interface BatchBalanceInfoAminoMsg { type: "/regen.ecocredit.v1.BatchBalanceInfo"; @@ -1498,7 +1498,7 @@ export interface QueryClassCreatorAllowlistResponseAmino { * enabled determines whether or not the allowlist for creating credit classes * is enabled. */ - enabled: boolean; + enabled?: boolean; } export interface QueryClassCreatorAllowlistResponseAminoMsg { type: "/regen.ecocredit.v1.QueryClassCreatorAllowlistResponse"; @@ -1521,7 +1521,7 @@ export interface QueryClassCreatorAllowlistResponseSDKType { */ export interface QueryAllowedClassCreatorsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllowedClassCreatorsRequestProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryAllowedClassCreatorsRequest"; @@ -1548,7 +1548,7 @@ export interface QueryAllowedClassCreatorsRequestAminoMsg { * Since Revision 2 */ export interface QueryAllowedClassCreatorsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllowedClassCreatorsResponse is the Query/AllowedClassCreators response @@ -1560,7 +1560,7 @@ export interface QueryAllowedClassCreatorsResponse { /** class_creators is the list of allowed credit class creators. */ classCreators: string[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllowedClassCreatorsResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryAllowedClassCreatorsResponse"; @@ -1574,7 +1574,7 @@ export interface QueryAllowedClassCreatorsResponseProtoMsg { */ export interface QueryAllowedClassCreatorsResponseAmino { /** class_creators is the list of allowed credit class creators. */ - class_creators: string[]; + class_creators?: string[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -1590,7 +1590,7 @@ export interface QueryAllowedClassCreatorsResponseAminoMsg { */ export interface QueryAllowedClassCreatorsResponseSDKType { class_creators: string[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryClassFeeRequest is the Query/ClassFee request type. @@ -1628,7 +1628,7 @@ export interface QueryClassFeeResponse { * fee is the credit class creation fee. If not set, a credit class creation * fee is not required. */ - fee: Coin; + fee?: Coin; } export interface QueryClassFeeResponseProtoMsg { typeUrl: "/regen.ecocredit.v1.QueryClassFeeResponse"; @@ -1656,7 +1656,7 @@ export interface QueryClassFeeResponseAminoMsg { * Since Revision 2 */ export interface QueryClassFeeResponseSDKType { - fee: CoinSDKType; + fee?: CoinSDKType; } /** * QueryAllowedBridgeChainsRequest is the Query/AllowedBridgeChains request @@ -1715,7 +1715,7 @@ export interface QueryAllowedBridgeChainsResponseAmino { * allowed_bridge_chains is a list of chains that are allowed to be used in * bridge operations. */ - allowed_bridge_chains: string[]; + allowed_bridge_chains?: string[]; } export interface QueryAllowedBridgeChainsResponseAminoMsg { type: "/regen.ecocredit.v1.QueryAllowedBridgeChainsResponse"; @@ -1732,18 +1732,19 @@ export interface QueryAllowedBridgeChainsResponseSDKType { } function createBaseQueryClassesRequest(): QueryClassesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClassesRequest = { - encode(message: QueryClassesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassesRequest", + encode(message: QueryClassesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesRequest(); while (reader.pos < end) { @@ -1775,9 +1776,11 @@ export const QueryClassesRequest = { return message; }, fromAmino(object: QueryClassesRequestAmino): QueryClassesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesRequest): QueryClassesRequestAmino { const obj: any = {}; @@ -1803,11 +1806,12 @@ export const QueryClassesRequest = { function createBaseQueryClassesResponse(): QueryClassesResponse { return { classes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClassesResponse = { - encode(message: QueryClassesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassesResponse", + encode(message: QueryClassesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classes) { ClassInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1816,8 +1820,8 @@ export const QueryClassesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesResponse(); while (reader.pos < end) { @@ -1859,17 +1863,19 @@ export const QueryClassesResponse = { return message; }, fromAmino(object: QueryClassesResponseAmino): QueryClassesResponse { - return { - classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => ClassInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesResponse(); + message.classes = object.classes?.map(e => ClassInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesResponse): QueryClassesResponseAmino { const obj: any = {}; if (message.classes) { obj.classes = message.classes.map(e => e ? ClassInfo.toAmino(e) : undefined); } else { - obj.classes = []; + obj.classes = message.classes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1893,11 +1899,12 @@ export const QueryClassesResponse = { function createBaseQueryClassesByAdminRequest(): QueryClassesByAdminRequest { return { admin: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClassesByAdminRequest = { - encode(message: QueryClassesByAdminRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassesByAdminRequest", + encode(message: QueryClassesByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1906,8 +1913,8 @@ export const QueryClassesByAdminRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesByAdminRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesByAdminRequest(); while (reader.pos < end) { @@ -1945,14 +1952,18 @@ export const QueryClassesByAdminRequest = { return message; }, fromAmino(object: QueryClassesByAdminRequestAmino): QueryClassesByAdminRequest { - return { - admin: object.admin, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesByAdminRequest): QueryClassesByAdminRequestAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1975,11 +1986,12 @@ export const QueryClassesByAdminRequest = { function createBaseQueryClassesByAdminResponse(): QueryClassesByAdminResponse { return { classes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClassesByAdminResponse = { - encode(message: QueryClassesByAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassesByAdminResponse", + encode(message: QueryClassesByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classes) { ClassInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1988,8 +2000,8 @@ export const QueryClassesByAdminResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesByAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesByAdminResponse(); while (reader.pos < end) { @@ -2031,17 +2043,19 @@ export const QueryClassesByAdminResponse = { return message; }, fromAmino(object: QueryClassesByAdminResponseAmino): QueryClassesByAdminResponse { - return { - classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => ClassInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesByAdminResponse(); + message.classes = object.classes?.map(e => ClassInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesByAdminResponse): QueryClassesByAdminResponseAmino { const obj: any = {}; if (message.classes) { obj.classes = message.classes.map(e => e ? ClassInfo.toAmino(e) : undefined); } else { - obj.classes = []; + obj.classes = message.classes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2068,14 +2082,15 @@ function createBaseQueryClassRequest(): QueryClassRequest { }; } export const QueryClassRequest = { - encode(message: QueryClassRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassRequest", + encode(message: QueryClassRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassRequest(); while (reader.pos < end) { @@ -2107,13 +2122,15 @@ export const QueryClassRequest = { return message; }, fromAmino(object: QueryClassRequestAmino): QueryClassRequest { - return { - classId: object.class_id - }; + const message = createBaseQueryClassRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: QueryClassRequest): QueryClassRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: QueryClassRequestAminoMsg): QueryClassRequest { @@ -2134,18 +2151,19 @@ export const QueryClassRequest = { }; function createBaseQueryClassResponse(): QueryClassResponse { return { - class: ClassInfo.fromPartial({}) + class: undefined }; } export const QueryClassResponse = { - encode(message: QueryClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassResponse", + encode(message: QueryClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.class !== undefined) { ClassInfo.encode(message.class, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassResponse(); while (reader.pos < end) { @@ -2177,9 +2195,11 @@ export const QueryClassResponse = { return message; }, fromAmino(object: QueryClassResponseAmino): QueryClassResponse { - return { - class: object?.class ? ClassInfo.fromAmino(object.class) : undefined - }; + const message = createBaseQueryClassResponse(); + if (object.class !== undefined && object.class !== null) { + message.class = ClassInfo.fromAmino(object.class); + } + return message; }, toAmino(message: QueryClassResponse): QueryClassResponseAmino { const obj: any = {}; @@ -2205,11 +2225,12 @@ export const QueryClassResponse = { function createBaseQueryClassIssuersRequest(): QueryClassIssuersRequest { return { classId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClassIssuersRequest = { - encode(message: QueryClassIssuersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassIssuersRequest", + encode(message: QueryClassIssuersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -2218,8 +2239,8 @@ export const QueryClassIssuersRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassIssuersRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassIssuersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassIssuersRequest(); while (reader.pos < end) { @@ -2257,14 +2278,18 @@ export const QueryClassIssuersRequest = { return message; }, fromAmino(object: QueryClassIssuersRequestAmino): QueryClassIssuersRequest { - return { - classId: object.class_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassIssuersRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassIssuersRequest): QueryClassIssuersRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2287,11 +2312,12 @@ export const QueryClassIssuersRequest = { function createBaseQueryClassIssuersResponse(): QueryClassIssuersResponse { return { issuers: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClassIssuersResponse = { - encode(message: QueryClassIssuersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassIssuersResponse", + encode(message: QueryClassIssuersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.issuers) { writer.uint32(10).string(v!); } @@ -2300,8 +2326,8 @@ export const QueryClassIssuersResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassIssuersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassIssuersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassIssuersResponse(); while (reader.pos < end) { @@ -2343,17 +2369,19 @@ export const QueryClassIssuersResponse = { return message; }, fromAmino(object: QueryClassIssuersResponseAmino): QueryClassIssuersResponse { - return { - issuers: Array.isArray(object?.issuers) ? object.issuers.map((e: any) => e) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassIssuersResponse(); + message.issuers = object.issuers?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassIssuersResponse): QueryClassIssuersResponseAmino { const obj: any = {}; if (message.issuers) { obj.issuers = message.issuers.map(e => e); } else { - obj.issuers = []; + obj.issuers = message.issuers; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2376,18 +2404,19 @@ export const QueryClassIssuersResponse = { }; function createBaseQueryProjectsRequest(): QueryProjectsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProjectsRequest = { - encode(message: QueryProjectsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsRequest", + encode(message: QueryProjectsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsRequest(); while (reader.pos < end) { @@ -2419,9 +2448,11 @@ export const QueryProjectsRequest = { return message; }, fromAmino(object: QueryProjectsRequestAmino): QueryProjectsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsRequest): QueryProjectsRequestAmino { const obj: any = {}; @@ -2447,11 +2478,12 @@ export const QueryProjectsRequest = { function createBaseQueryProjectsResponse(): QueryProjectsResponse { return { projects: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProjectsResponse = { - encode(message: QueryProjectsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsResponse", + encode(message: QueryProjectsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.projects) { ProjectInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2460,8 +2492,8 @@ export const QueryProjectsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsResponse(); while (reader.pos < end) { @@ -2503,17 +2535,19 @@ export const QueryProjectsResponse = { return message; }, fromAmino(object: QueryProjectsResponseAmino): QueryProjectsResponse { - return { - projects: Array.isArray(object?.projects) ? object.projects.map((e: any) => ProjectInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsResponse(); + message.projects = object.projects?.map(e => ProjectInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsResponse): QueryProjectsResponseAmino { const obj: any = {}; if (message.projects) { obj.projects = message.projects.map(e => e ? ProjectInfo.toAmino(e) : undefined); } else { - obj.projects = []; + obj.projects = message.projects; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2537,11 +2571,12 @@ export const QueryProjectsResponse = { function createBaseQueryProjectsByClassRequest(): QueryProjectsByClassRequest { return { classId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProjectsByClassRequest = { - encode(message: QueryProjectsByClassRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsByClassRequest", + encode(message: QueryProjectsByClassRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -2550,8 +2585,8 @@ export const QueryProjectsByClassRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsByClassRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsByClassRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsByClassRequest(); while (reader.pos < end) { @@ -2589,14 +2624,18 @@ export const QueryProjectsByClassRequest = { return message; }, fromAmino(object: QueryProjectsByClassRequestAmino): QueryProjectsByClassRequest { - return { - classId: object.class_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsByClassRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsByClassRequest): QueryProjectsByClassRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2619,11 +2658,12 @@ export const QueryProjectsByClassRequest = { function createBaseQueryProjectsByClassResponse(): QueryProjectsByClassResponse { return { projects: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProjectsByClassResponse = { - encode(message: QueryProjectsByClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsByClassResponse", + encode(message: QueryProjectsByClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.projects) { ProjectInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2632,8 +2672,8 @@ export const QueryProjectsByClassResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsByClassResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsByClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsByClassResponse(); while (reader.pos < end) { @@ -2675,17 +2715,19 @@ export const QueryProjectsByClassResponse = { return message; }, fromAmino(object: QueryProjectsByClassResponseAmino): QueryProjectsByClassResponse { - return { - projects: Array.isArray(object?.projects) ? object.projects.map((e: any) => ProjectInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsByClassResponse(); + message.projects = object.projects?.map(e => ProjectInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsByClassResponse): QueryProjectsByClassResponseAmino { const obj: any = {}; if (message.projects) { obj.projects = message.projects.map(e => e ? ProjectInfo.toAmino(e) : undefined); } else { - obj.projects = []; + obj.projects = message.projects; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2709,11 +2751,12 @@ export const QueryProjectsByClassResponse = { function createBaseQueryProjectsByReferenceIdRequest(): QueryProjectsByReferenceIdRequest { return { referenceId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProjectsByReferenceIdRequest = { - encode(message: QueryProjectsByReferenceIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsByReferenceIdRequest", + encode(message: QueryProjectsByReferenceIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.referenceId !== "") { writer.uint32(10).string(message.referenceId); } @@ -2722,8 +2765,8 @@ export const QueryProjectsByReferenceIdRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsByReferenceIdRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsByReferenceIdRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsByReferenceIdRequest(); while (reader.pos < end) { @@ -2761,14 +2804,18 @@ export const QueryProjectsByReferenceIdRequest = { return message; }, fromAmino(object: QueryProjectsByReferenceIdRequestAmino): QueryProjectsByReferenceIdRequest { - return { - referenceId: object.reference_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsByReferenceIdRequest(); + if (object.reference_id !== undefined && object.reference_id !== null) { + message.referenceId = object.reference_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsByReferenceIdRequest): QueryProjectsByReferenceIdRequestAmino { const obj: any = {}; - obj.reference_id = message.referenceId; + obj.reference_id = message.referenceId === "" ? undefined : message.referenceId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2791,11 +2838,12 @@ export const QueryProjectsByReferenceIdRequest = { function createBaseQueryProjectsByReferenceIdResponse(): QueryProjectsByReferenceIdResponse { return { projects: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProjectsByReferenceIdResponse = { - encode(message: QueryProjectsByReferenceIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsByReferenceIdResponse", + encode(message: QueryProjectsByReferenceIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.projects) { ProjectInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2804,8 +2852,8 @@ export const QueryProjectsByReferenceIdResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsByReferenceIdResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsByReferenceIdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsByReferenceIdResponse(); while (reader.pos < end) { @@ -2847,17 +2895,19 @@ export const QueryProjectsByReferenceIdResponse = { return message; }, fromAmino(object: QueryProjectsByReferenceIdResponseAmino): QueryProjectsByReferenceIdResponse { - return { - projects: Array.isArray(object?.projects) ? object.projects.map((e: any) => ProjectInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsByReferenceIdResponse(); + message.projects = object.projects?.map(e => ProjectInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsByReferenceIdResponse): QueryProjectsByReferenceIdResponseAmino { const obj: any = {}; if (message.projects) { obj.projects = message.projects.map(e => e ? ProjectInfo.toAmino(e) : undefined); } else { - obj.projects = []; + obj.projects = message.projects; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -2881,11 +2931,12 @@ export const QueryProjectsByReferenceIdResponse = { function createBaseQueryProjectsByAdminRequest(): QueryProjectsByAdminRequest { return { admin: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProjectsByAdminRequest = { - encode(message: QueryProjectsByAdminRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsByAdminRequest", + encode(message: QueryProjectsByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -2894,8 +2945,8 @@ export const QueryProjectsByAdminRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsByAdminRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsByAdminRequest(); while (reader.pos < end) { @@ -2933,14 +2984,18 @@ export const QueryProjectsByAdminRequest = { return message; }, fromAmino(object: QueryProjectsByAdminRequestAmino): QueryProjectsByAdminRequest { - return { - admin: object.admin, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsByAdminRequest): QueryProjectsByAdminRequestAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -2963,11 +3018,12 @@ export const QueryProjectsByAdminRequest = { function createBaseQueryProjectsByAdminResponse(): QueryProjectsByAdminResponse { return { projects: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProjectsByAdminResponse = { - encode(message: QueryProjectsByAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectsByAdminResponse", + encode(message: QueryProjectsByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.projects) { ProjectInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2976,8 +3032,8 @@ export const QueryProjectsByAdminResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectsByAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectsByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectsByAdminResponse(); while (reader.pos < end) { @@ -3019,17 +3075,19 @@ export const QueryProjectsByAdminResponse = { return message; }, fromAmino(object: QueryProjectsByAdminResponseAmino): QueryProjectsByAdminResponse { - return { - projects: Array.isArray(object?.projects) ? object.projects.map((e: any) => ProjectInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProjectsByAdminResponse(); + message.projects = object.projects?.map(e => ProjectInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProjectsByAdminResponse): QueryProjectsByAdminResponseAmino { const obj: any = {}; if (message.projects) { obj.projects = message.projects.map(e => e ? ProjectInfo.toAmino(e) : undefined); } else { - obj.projects = []; + obj.projects = message.projects; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -3056,14 +3114,15 @@ function createBaseQueryProjectRequest(): QueryProjectRequest { }; } export const QueryProjectRequest = { - encode(message: QueryProjectRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectRequest", + encode(message: QueryProjectRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.projectId !== "") { writer.uint32(10).string(message.projectId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectRequest(); while (reader.pos < end) { @@ -3095,13 +3154,15 @@ export const QueryProjectRequest = { return message; }, fromAmino(object: QueryProjectRequestAmino): QueryProjectRequest { - return { - projectId: object.project_id - }; + const message = createBaseQueryProjectRequest(); + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + return message; }, toAmino(message: QueryProjectRequest): QueryProjectRequestAmino { const obj: any = {}; - obj.project_id = message.projectId; + obj.project_id = message.projectId === "" ? undefined : message.projectId; return obj; }, fromAminoMsg(object: QueryProjectRequestAminoMsg): QueryProjectRequest { @@ -3122,18 +3183,19 @@ export const QueryProjectRequest = { }; function createBaseQueryProjectResponse(): QueryProjectResponse { return { - project: ProjectInfo.fromPartial({}) + project: undefined }; } export const QueryProjectResponse = { - encode(message: QueryProjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryProjectResponse", + encode(message: QueryProjectResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.project !== undefined) { ProjectInfo.encode(message.project, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProjectResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProjectResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProjectResponse(); while (reader.pos < end) { @@ -3165,9 +3227,11 @@ export const QueryProjectResponse = { return message; }, fromAmino(object: QueryProjectResponseAmino): QueryProjectResponse { - return { - project: object?.project ? ProjectInfo.fromAmino(object.project) : undefined - }; + const message = createBaseQueryProjectResponse(); + if (object.project !== undefined && object.project !== null) { + message.project = ProjectInfo.fromAmino(object.project); + } + return message; }, toAmino(message: QueryProjectResponse): QueryProjectResponseAmino { const obj: any = {}; @@ -3192,18 +3256,19 @@ export const QueryProjectResponse = { }; function createBaseQueryBatchesRequest(): QueryBatchesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBatchesRequest = { - encode(message: QueryBatchesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesRequest", + encode(message: QueryBatchesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesRequest(); while (reader.pos < end) { @@ -3235,9 +3300,11 @@ export const QueryBatchesRequest = { return message; }, fromAmino(object: QueryBatchesRequestAmino): QueryBatchesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesRequest): QueryBatchesRequestAmino { const obj: any = {}; @@ -3263,11 +3330,12 @@ export const QueryBatchesRequest = { function createBaseQueryBatchesResponse(): QueryBatchesResponse { return { batches: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryBatchesResponse = { - encode(message: QueryBatchesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesResponse", + encode(message: QueryBatchesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.batches) { BatchInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -3276,8 +3344,8 @@ export const QueryBatchesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesResponse(); while (reader.pos < end) { @@ -3319,17 +3387,19 @@ export const QueryBatchesResponse = { return message; }, fromAmino(object: QueryBatchesResponseAmino): QueryBatchesResponse { - return { - batches: Array.isArray(object?.batches) ? object.batches.map((e: any) => BatchInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesResponse(); + message.batches = object.batches?.map(e => BatchInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesResponse): QueryBatchesResponseAmino { const obj: any = {}; if (message.batches) { obj.batches = message.batches.map(e => e ? BatchInfo.toAmino(e) : undefined); } else { - obj.batches = []; + obj.batches = message.batches; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -3353,11 +3423,12 @@ export const QueryBatchesResponse = { function createBaseQueryBatchesByIssuerRequest(): QueryBatchesByIssuerRequest { return { issuer: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBatchesByIssuerRequest = { - encode(message: QueryBatchesByIssuerRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesByIssuerRequest", + encode(message: QueryBatchesByIssuerRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -3366,8 +3437,8 @@ export const QueryBatchesByIssuerRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesByIssuerRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesByIssuerRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesByIssuerRequest(); while (reader.pos < end) { @@ -3405,14 +3476,18 @@ export const QueryBatchesByIssuerRequest = { return message; }, fromAmino(object: QueryBatchesByIssuerRequestAmino): QueryBatchesByIssuerRequest { - return { - issuer: object.issuer, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesByIssuerRequest(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesByIssuerRequest): QueryBatchesByIssuerRequestAmino { const obj: any = {}; - obj.issuer = message.issuer; + obj.issuer = message.issuer === "" ? undefined : message.issuer; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -3435,11 +3510,12 @@ export const QueryBatchesByIssuerRequest = { function createBaseQueryBatchesByIssuerResponse(): QueryBatchesByIssuerResponse { return { batches: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryBatchesByIssuerResponse = { - encode(message: QueryBatchesByIssuerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesByIssuerResponse", + encode(message: QueryBatchesByIssuerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.batches) { BatchInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -3448,8 +3524,8 @@ export const QueryBatchesByIssuerResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesByIssuerResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesByIssuerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesByIssuerResponse(); while (reader.pos < end) { @@ -3491,17 +3567,19 @@ export const QueryBatchesByIssuerResponse = { return message; }, fromAmino(object: QueryBatchesByIssuerResponseAmino): QueryBatchesByIssuerResponse { - return { - batches: Array.isArray(object?.batches) ? object.batches.map((e: any) => BatchInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesByIssuerResponse(); + message.batches = object.batches?.map(e => BatchInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesByIssuerResponse): QueryBatchesByIssuerResponseAmino { const obj: any = {}; if (message.batches) { obj.batches = message.batches.map(e => e ? BatchInfo.toAmino(e) : undefined); } else { - obj.batches = []; + obj.batches = message.batches; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -3525,11 +3603,12 @@ export const QueryBatchesByIssuerResponse = { function createBaseQueryBatchesByClassRequest(): QueryBatchesByClassRequest { return { classId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBatchesByClassRequest = { - encode(message: QueryBatchesByClassRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesByClassRequest", + encode(message: QueryBatchesByClassRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -3538,8 +3617,8 @@ export const QueryBatchesByClassRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesByClassRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesByClassRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesByClassRequest(); while (reader.pos < end) { @@ -3577,14 +3656,18 @@ export const QueryBatchesByClassRequest = { return message; }, fromAmino(object: QueryBatchesByClassRequestAmino): QueryBatchesByClassRequest { - return { - classId: object.class_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesByClassRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesByClassRequest): QueryBatchesByClassRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -3607,11 +3690,12 @@ export const QueryBatchesByClassRequest = { function createBaseQueryBatchesByProjectRequest(): QueryBatchesByProjectRequest { return { projectId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBatchesByProjectRequest = { - encode(message: QueryBatchesByProjectRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesByProjectRequest", + encode(message: QueryBatchesByProjectRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.projectId !== "") { writer.uint32(10).string(message.projectId); } @@ -3620,8 +3704,8 @@ export const QueryBatchesByProjectRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesByProjectRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesByProjectRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesByProjectRequest(); while (reader.pos < end) { @@ -3659,14 +3743,18 @@ export const QueryBatchesByProjectRequest = { return message; }, fromAmino(object: QueryBatchesByProjectRequestAmino): QueryBatchesByProjectRequest { - return { - projectId: object.project_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesByProjectRequest(); + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesByProjectRequest): QueryBatchesByProjectRequestAmino { const obj: any = {}; - obj.project_id = message.projectId; + obj.project_id = message.projectId === "" ? undefined : message.projectId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -3689,11 +3777,12 @@ export const QueryBatchesByProjectRequest = { function createBaseQueryBatchesByProjectResponse(): QueryBatchesByProjectResponse { return { batches: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryBatchesByProjectResponse = { - encode(message: QueryBatchesByProjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesByProjectResponse", + encode(message: QueryBatchesByProjectResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.batches) { BatchInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -3702,8 +3791,8 @@ export const QueryBatchesByProjectResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesByProjectResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesByProjectResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesByProjectResponse(); while (reader.pos < end) { @@ -3745,17 +3834,19 @@ export const QueryBatchesByProjectResponse = { return message; }, fromAmino(object: QueryBatchesByProjectResponseAmino): QueryBatchesByProjectResponse { - return { - batches: Array.isArray(object?.batches) ? object.batches.map((e: any) => BatchInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesByProjectResponse(); + message.batches = object.batches?.map(e => BatchInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesByProjectResponse): QueryBatchesByProjectResponseAmino { const obj: any = {}; if (message.batches) { obj.batches = message.batches.map(e => e ? BatchInfo.toAmino(e) : undefined); } else { - obj.batches = []; + obj.batches = message.batches; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -3779,11 +3870,12 @@ export const QueryBatchesByProjectResponse = { function createBaseQueryBatchesByClassResponse(): QueryBatchesByClassResponse { return { batches: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryBatchesByClassResponse = { - encode(message: QueryBatchesByClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchesByClassResponse", + encode(message: QueryBatchesByClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.batches) { BatchInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -3792,8 +3884,8 @@ export const QueryBatchesByClassResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesByClassResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesByClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesByClassResponse(); while (reader.pos < end) { @@ -3835,17 +3927,19 @@ export const QueryBatchesByClassResponse = { return message; }, fromAmino(object: QueryBatchesByClassResponseAmino): QueryBatchesByClassResponse { - return { - batches: Array.isArray(object?.batches) ? object.batches.map((e: any) => BatchInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesByClassResponse(); + message.batches = object.batches?.map(e => BatchInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesByClassResponse): QueryBatchesByClassResponseAmino { const obj: any = {}; if (message.batches) { obj.batches = message.batches.map(e => e ? BatchInfo.toAmino(e) : undefined); } else { - obj.batches = []; + obj.batches = message.batches; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -3872,14 +3966,15 @@ function createBaseQueryBatchRequest(): QueryBatchRequest { }; } export const QueryBatchRequest = { - encode(message: QueryBatchRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchRequest", + encode(message: QueryBatchRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchRequest(); while (reader.pos < end) { @@ -3911,13 +4006,15 @@ export const QueryBatchRequest = { return message; }, fromAmino(object: QueryBatchRequestAmino): QueryBatchRequest { - return { - batchDenom: object.batch_denom - }; + const message = createBaseQueryBatchRequest(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: QueryBatchRequest): QueryBatchRequestAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: QueryBatchRequestAminoMsg): QueryBatchRequest { @@ -3938,18 +4035,19 @@ export const QueryBatchRequest = { }; function createBaseQueryBatchResponse(): QueryBatchResponse { return { - batch: BatchInfo.fromPartial({}) + batch: undefined }; } export const QueryBatchResponse = { - encode(message: QueryBatchResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBatchResponse", + encode(message: QueryBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batch !== undefined) { BatchInfo.encode(message.batch, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchResponse(); while (reader.pos < end) { @@ -3981,9 +4079,11 @@ export const QueryBatchResponse = { return message; }, fromAmino(object: QueryBatchResponseAmino): QueryBatchResponse { - return { - batch: object?.batch ? BatchInfo.fromAmino(object.batch) : undefined - }; + const message = createBaseQueryBatchResponse(); + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchInfo.fromAmino(object.batch); + } + return message; }, toAmino(message: QueryBatchResponse): QueryBatchResponseAmino { const obj: any = {}; @@ -4013,7 +4113,8 @@ function createBaseQueryBalanceRequest(): QueryBalanceRequest { }; } export const QueryBalanceRequest = { - encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBalanceRequest", + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -4022,8 +4123,8 @@ export const QueryBalanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceRequest(); while (reader.pos < end) { @@ -4061,15 +4162,19 @@ export const QueryBalanceRequest = { return message; }, fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { - return { - address: object.address, - batchDenom: object.batch_denom - }; + const message = createBaseQueryBalanceRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { const obj: any = {}; - obj.address = message.address; - obj.batch_denom = message.batchDenom; + obj.address = message.address === "" ? undefined : message.address; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: QueryBalanceRequestAminoMsg): QueryBalanceRequest { @@ -4090,18 +4195,19 @@ export const QueryBalanceRequest = { }; function createBaseQueryBalanceResponse(): QueryBalanceResponse { return { - balance: BatchBalanceInfo.fromPartial({}) + balance: undefined }; } export const QueryBalanceResponse = { - encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBalanceResponse", + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.balance !== undefined) { BatchBalanceInfo.encode(message.balance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceResponse(); while (reader.pos < end) { @@ -4133,9 +4239,11 @@ export const QueryBalanceResponse = { return message; }, fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { - return { - balance: object?.balance ? BatchBalanceInfo.fromAmino(object.balance) : undefined - }; + const message = createBaseQueryBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = BatchBalanceInfo.fromAmino(object.balance); + } + return message; }, toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { const obj: any = {}; @@ -4161,11 +4269,12 @@ export const QueryBalanceResponse = { function createBaseQueryBalancesRequest(): QueryBalancesRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBalancesRequest = { - encode(message: QueryBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBalancesRequest", + encode(message: QueryBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -4174,8 +4283,8 @@ export const QueryBalancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalancesRequest(); while (reader.pos < end) { @@ -4213,14 +4322,18 @@ export const QueryBalancesRequest = { return message; }, fromAmino(object: QueryBalancesRequestAmino): QueryBalancesRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBalancesRequest): QueryBalancesRequestAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -4243,11 +4356,12 @@ export const QueryBalancesRequest = { function createBaseQueryBalancesResponse(): QueryBalancesResponse { return { balances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryBalancesResponse = { - encode(message: QueryBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBalancesResponse", + encode(message: QueryBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { BatchBalanceInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -4256,8 +4370,8 @@ export const QueryBalancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalancesResponse(); while (reader.pos < end) { @@ -4299,17 +4413,19 @@ export const QueryBalancesResponse = { return message; }, fromAmino(object: QueryBalancesResponseAmino): QueryBalancesResponse { - return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => BatchBalanceInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBalancesResponse(); + message.balances = object.balances?.map(e => BatchBalanceInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBalancesResponse): QueryBalancesResponseAmino { const obj: any = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? BatchBalanceInfo.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -4333,11 +4449,12 @@ export const QueryBalancesResponse = { function createBaseQueryBalancesByBatchRequest(): QueryBalancesByBatchRequest { return { batchDenom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBalancesByBatchRequest = { - encode(message: QueryBalancesByBatchRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBalancesByBatchRequest", + encode(message: QueryBalancesByBatchRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -4346,8 +4463,8 @@ export const QueryBalancesByBatchRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalancesByBatchRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalancesByBatchRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalancesByBatchRequest(); while (reader.pos < end) { @@ -4385,14 +4502,18 @@ export const QueryBalancesByBatchRequest = { return message; }, fromAmino(object: QueryBalancesByBatchRequestAmino): QueryBalancesByBatchRequest { - return { - batchDenom: object.batch_denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBalancesByBatchRequest(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBalancesByBatchRequest): QueryBalancesByBatchRequestAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -4415,11 +4536,12 @@ export const QueryBalancesByBatchRequest = { function createBaseQueryBalancesByBatchResponse(): QueryBalancesByBatchResponse { return { balances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryBalancesByBatchResponse = { - encode(message: QueryBalancesByBatchResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryBalancesByBatchResponse", + encode(message: QueryBalancesByBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { BatchBalanceInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -4428,8 +4550,8 @@ export const QueryBalancesByBatchResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalancesByBatchResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalancesByBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalancesByBatchResponse(); while (reader.pos < end) { @@ -4471,17 +4593,19 @@ export const QueryBalancesByBatchResponse = { return message; }, fromAmino(object: QueryBalancesByBatchResponseAmino): QueryBalancesByBatchResponse { - return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => BatchBalanceInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBalancesByBatchResponse(); + message.balances = object.balances?.map(e => BatchBalanceInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBalancesByBatchResponse): QueryBalancesByBatchResponseAmino { const obj: any = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? BatchBalanceInfo.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -4504,18 +4628,19 @@ export const QueryBalancesByBatchResponse = { }; function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesRequest = { - encode(message: QueryAllBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryAllBalancesRequest", + encode(message: QueryAllBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllBalancesRequest(); while (reader.pos < end) { @@ -4547,9 +4672,11 @@ export const QueryAllBalancesRequest = { return message; }, fromAmino(object: QueryAllBalancesRequestAmino): QueryAllBalancesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllBalancesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllBalancesRequest): QueryAllBalancesRequestAmino { const obj: any = {}; @@ -4575,11 +4702,12 @@ export const QueryAllBalancesRequest = { function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { return { balances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesResponse = { - encode(message: QueryAllBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryAllBalancesResponse", + encode(message: QueryAllBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { BatchBalanceInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -4588,8 +4716,8 @@ export const QueryAllBalancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllBalancesResponse(); while (reader.pos < end) { @@ -4631,17 +4759,19 @@ export const QueryAllBalancesResponse = { return message; }, fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { - return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => BatchBalanceInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => BatchBalanceInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { const obj: any = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? BatchBalanceInfo.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -4668,14 +4798,15 @@ function createBaseQuerySupplyRequest(): QuerySupplyRequest { }; } export const QuerySupplyRequest = { - encode(message: QuerySupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QuerySupplyRequest", + encode(message: QuerySupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyRequest(); while (reader.pos < end) { @@ -4707,13 +4838,15 @@ export const QuerySupplyRequest = { return message; }, fromAmino(object: QuerySupplyRequestAmino): QuerySupplyRequest { - return { - batchDenom: object.batch_denom - }; + const message = createBaseQuerySupplyRequest(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: QuerySupplyRequest): QuerySupplyRequestAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: QuerySupplyRequestAminoMsg): QuerySupplyRequest { @@ -4740,7 +4873,8 @@ function createBaseQuerySupplyResponse(): QuerySupplyResponse { }; } export const QuerySupplyResponse = { - encode(message: QuerySupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QuerySupplyResponse", + encode(message: QuerySupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tradableAmount !== "") { writer.uint32(10).string(message.tradableAmount); } @@ -4752,8 +4886,8 @@ export const QuerySupplyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyResponse(); while (reader.pos < end) { @@ -4797,17 +4931,23 @@ export const QuerySupplyResponse = { return message; }, fromAmino(object: QuerySupplyResponseAmino): QuerySupplyResponse { - return { - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - cancelledAmount: object.cancelled_amount - }; + const message = createBaseQuerySupplyResponse(); + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.cancelled_amount !== undefined && object.cancelled_amount !== null) { + message.cancelledAmount = object.cancelled_amount; + } + return message; }, toAmino(message: QuerySupplyResponse): QuerySupplyResponseAmino { const obj: any = {}; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.cancelled_amount = message.cancelledAmount; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.cancelled_amount = message.cancelledAmount === "" ? undefined : message.cancelledAmount; return obj; }, fromAminoMsg(object: QuerySupplyResponseAminoMsg): QuerySupplyResponse { @@ -4830,11 +4970,12 @@ function createBaseQueryCreditTypesRequest(): QueryCreditTypesRequest { return {}; } export const QueryCreditTypesRequest = { - encode(_: QueryCreditTypesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryCreditTypesRequest", + encode(_: QueryCreditTypesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCreditTypesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCreditTypesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCreditTypesRequest(); while (reader.pos < end) { @@ -4859,7 +5000,8 @@ export const QueryCreditTypesRequest = { return message; }, fromAmino(_: QueryCreditTypesRequestAmino): QueryCreditTypesRequest { - return {}; + const message = createBaseQueryCreditTypesRequest(); + return message; }, toAmino(_: QueryCreditTypesRequest): QueryCreditTypesRequestAmino { const obj: any = {}; @@ -4887,14 +5029,15 @@ function createBaseQueryCreditTypesResponse(): QueryCreditTypesResponse { }; } export const QueryCreditTypesResponse = { - encode(message: QueryCreditTypesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryCreditTypesResponse", + encode(message: QueryCreditTypesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.creditTypes) { CreditType.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCreditTypesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCreditTypesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCreditTypesResponse(); while (reader.pos < end) { @@ -4930,16 +5073,16 @@ export const QueryCreditTypesResponse = { return message; }, fromAmino(object: QueryCreditTypesResponseAmino): QueryCreditTypesResponse { - return { - creditTypes: Array.isArray(object?.credit_types) ? object.credit_types.map((e: any) => CreditType.fromAmino(e)) : [] - }; + const message = createBaseQueryCreditTypesResponse(); + message.creditTypes = object.credit_types?.map(e => CreditType.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCreditTypesResponse): QueryCreditTypesResponseAmino { const obj: any = {}; if (message.creditTypes) { obj.credit_types = message.creditTypes.map(e => e ? CreditType.toAmino(e) : undefined); } else { - obj.credit_types = []; + obj.credit_types = message.creditTypes; } return obj; }, @@ -4963,11 +5106,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -4992,7 +5136,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -5016,18 +5161,19 @@ export const QueryParamsRequest = { }; function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -5059,9 +5205,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -5090,14 +5238,15 @@ function createBaseQueryCreditTypeRequest(): QueryCreditTypeRequest { }; } export const QueryCreditTypeRequest = { - encode(message: QueryCreditTypeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryCreditTypeRequest", + encode(message: QueryCreditTypeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.abbreviation !== "") { writer.uint32(10).string(message.abbreviation); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCreditTypeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCreditTypeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCreditTypeRequest(); while (reader.pos < end) { @@ -5129,13 +5278,15 @@ export const QueryCreditTypeRequest = { return message; }, fromAmino(object: QueryCreditTypeRequestAmino): QueryCreditTypeRequest { - return { - abbreviation: object.abbreviation - }; + const message = createBaseQueryCreditTypeRequest(); + if (object.abbreviation !== undefined && object.abbreviation !== null) { + message.abbreviation = object.abbreviation; + } + return message; }, toAmino(message: QueryCreditTypeRequest): QueryCreditTypeRequestAmino { const obj: any = {}; - obj.abbreviation = message.abbreviation; + obj.abbreviation = message.abbreviation === "" ? undefined : message.abbreviation; return obj; }, fromAminoMsg(object: QueryCreditTypeRequestAminoMsg): QueryCreditTypeRequest { @@ -5156,18 +5307,19 @@ export const QueryCreditTypeRequest = { }; function createBaseQueryCreditTypeResponse(): QueryCreditTypeResponse { return { - creditType: CreditType.fromPartial({}) + creditType: undefined }; } export const QueryCreditTypeResponse = { - encode(message: QueryCreditTypeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryCreditTypeResponse", + encode(message: QueryCreditTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.creditType !== undefined) { CreditType.encode(message.creditType, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCreditTypeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCreditTypeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCreditTypeResponse(); while (reader.pos < end) { @@ -5199,9 +5351,11 @@ export const QueryCreditTypeResponse = { return message; }, fromAmino(object: QueryCreditTypeResponseAmino): QueryCreditTypeResponse { - return { - creditType: object?.credit_type ? CreditType.fromAmino(object.credit_type) : undefined - }; + const message = createBaseQueryCreditTypeResponse(); + if (object.credit_type !== undefined && object.credit_type !== null) { + message.creditType = CreditType.fromAmino(object.credit_type); + } + return message; }, toAmino(message: QueryCreditTypeResponse): QueryCreditTypeResponseAmino { const obj: any = {}; @@ -5233,7 +5387,8 @@ function createBaseClassInfo(): ClassInfo { }; } export const ClassInfo = { - encode(message: ClassInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.ClassInfo", + encode(message: ClassInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -5248,8 +5403,8 @@ export const ClassInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClassInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClassInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClassInfo(); while (reader.pos < end) { @@ -5299,19 +5454,27 @@ export const ClassInfo = { return message; }, fromAmino(object: ClassInfoAmino): ClassInfo { - return { - id: object.id, - admin: object.admin, - metadata: object.metadata, - creditTypeAbbrev: object.credit_type_abbrev - }; + const message = createBaseClassInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + return message; }, toAmino(message: ClassInfo): ClassInfoAmino { const obj: any = {}; - obj.id = message.id; - obj.admin = message.admin; - obj.metadata = message.metadata; - obj.credit_type_abbrev = message.creditTypeAbbrev; + obj.id = message.id === "" ? undefined : message.id; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; return obj; }, fromAminoMsg(object: ClassInfoAminoMsg): ClassInfo { @@ -5341,7 +5504,8 @@ function createBaseProjectInfo(): ProjectInfo { }; } export const ProjectInfo = { - encode(message: ProjectInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.ProjectInfo", + encode(message: ProjectInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -5362,8 +5526,8 @@ export const ProjectInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProjectInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProjectInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProjectInfo(); while (reader.pos < end) { @@ -5425,23 +5589,35 @@ export const ProjectInfo = { return message; }, fromAmino(object: ProjectInfoAmino): ProjectInfo { - return { - id: object.id, - admin: object.admin, - classId: object.class_id, - jurisdiction: object.jurisdiction, - metadata: object.metadata, - referenceId: object.reference_id - }; + const message = createBaseProjectInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.jurisdiction !== undefined && object.jurisdiction !== null) { + message.jurisdiction = object.jurisdiction; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.reference_id !== undefined && object.reference_id !== null) { + message.referenceId = object.reference_id; + } + return message; }, toAmino(message: ProjectInfo): ProjectInfoAmino { const obj: any = {}; - obj.id = message.id; - obj.admin = message.admin; - obj.class_id = message.classId; - obj.jurisdiction = message.jurisdiction; - obj.metadata = message.metadata; - obj.reference_id = message.referenceId; + obj.id = message.id === "" ? undefined : message.id; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.jurisdiction = message.jurisdiction === "" ? undefined : message.jurisdiction; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.reference_id = message.referenceId === "" ? undefined : message.referenceId; return obj; }, fromAminoMsg(object: ProjectInfoAminoMsg): ProjectInfo { @@ -5473,7 +5649,8 @@ function createBaseBatchInfo(): BatchInfo { }; } export const BatchInfo = { - encode(message: BatchInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.BatchInfo", + encode(message: BatchInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -5500,8 +5677,8 @@ export const BatchInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchInfo(); while (reader.pos < end) { @@ -5575,27 +5752,43 @@ export const BatchInfo = { return message; }, fromAmino(object: BatchInfoAmino): BatchInfo { - return { - issuer: object.issuer, - projectId: object.project_id, - denom: object.denom, - metadata: object.metadata, - startDate: object?.start_date ? Timestamp.fromAmino(object.start_date) : undefined, - endDate: object?.end_date ? Timestamp.fromAmino(object.end_date) : undefined, - issuanceDate: object?.issuance_date ? Timestamp.fromAmino(object.issuance_date) : undefined, - open: object.open - }; + const message = createBaseBatchInfo(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.start_date !== undefined && object.start_date !== null) { + message.startDate = Timestamp.fromAmino(object.start_date); + } + if (object.end_date !== undefined && object.end_date !== null) { + message.endDate = Timestamp.fromAmino(object.end_date); + } + if (object.issuance_date !== undefined && object.issuance_date !== null) { + message.issuanceDate = Timestamp.fromAmino(object.issuance_date); + } + if (object.open !== undefined && object.open !== null) { + message.open = object.open; + } + return message; }, toAmino(message: BatchInfo): BatchInfoAmino { const obj: any = {}; - obj.issuer = message.issuer; - obj.project_id = message.projectId; - obj.denom = message.denom; - obj.metadata = message.metadata; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.project_id = message.projectId === "" ? undefined : message.projectId; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.metadata = message.metadata === "" ? undefined : message.metadata; obj.start_date = message.startDate ? Timestamp.toAmino(message.startDate) : undefined; obj.end_date = message.endDate ? Timestamp.toAmino(message.endDate) : undefined; obj.issuance_date = message.issuanceDate ? Timestamp.toAmino(message.issuanceDate) : undefined; - obj.open = message.open; + obj.open = message.open === false ? undefined : message.open; return obj; }, fromAminoMsg(object: BatchInfoAminoMsg): BatchInfo { @@ -5624,7 +5817,8 @@ function createBaseBatchBalanceInfo(): BatchBalanceInfo { }; } export const BatchBalanceInfo = { - encode(message: BatchBalanceInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.BatchBalanceInfo", + encode(message: BatchBalanceInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -5642,8 +5836,8 @@ export const BatchBalanceInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchBalanceInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchBalanceInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchBalanceInfo(); while (reader.pos < end) { @@ -5699,21 +5893,31 @@ export const BatchBalanceInfo = { return message; }, fromAmino(object: BatchBalanceInfoAmino): BatchBalanceInfo { - return { - address: object.address, - batchDenom: object.batch_denom, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - escrowedAmount: object.escrowed_amount - }; + const message = createBaseBatchBalanceInfo(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.escrowed_amount !== undefined && object.escrowed_amount !== null) { + message.escrowedAmount = object.escrowed_amount; + } + return message; }, toAmino(message: BatchBalanceInfo): BatchBalanceInfoAmino { const obj: any = {}; - obj.address = message.address; - obj.batch_denom = message.batchDenom; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.escrowed_amount = message.escrowedAmount; + obj.address = message.address === "" ? undefined : message.address; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.escrowed_amount = message.escrowedAmount === "" ? undefined : message.escrowedAmount; return obj; }, fromAminoMsg(object: BatchBalanceInfoAminoMsg): BatchBalanceInfo { @@ -5736,11 +5940,12 @@ function createBaseQueryClassCreatorAllowlistRequest(): QueryClassCreatorAllowli return {}; } export const QueryClassCreatorAllowlistRequest = { - encode(_: QueryClassCreatorAllowlistRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassCreatorAllowlistRequest", + encode(_: QueryClassCreatorAllowlistRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassCreatorAllowlistRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassCreatorAllowlistRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassCreatorAllowlistRequest(); while (reader.pos < end) { @@ -5765,7 +5970,8 @@ export const QueryClassCreatorAllowlistRequest = { return message; }, fromAmino(_: QueryClassCreatorAllowlistRequestAmino): QueryClassCreatorAllowlistRequest { - return {}; + const message = createBaseQueryClassCreatorAllowlistRequest(); + return message; }, toAmino(_: QueryClassCreatorAllowlistRequest): QueryClassCreatorAllowlistRequestAmino { const obj: any = {}; @@ -5793,14 +5999,15 @@ function createBaseQueryClassCreatorAllowlistResponse(): QueryClassCreatorAllowl }; } export const QueryClassCreatorAllowlistResponse = { - encode(message: QueryClassCreatorAllowlistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassCreatorAllowlistResponse", + encode(message: QueryClassCreatorAllowlistResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.enabled === true) { writer.uint32(8).bool(message.enabled); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassCreatorAllowlistResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassCreatorAllowlistResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassCreatorAllowlistResponse(); while (reader.pos < end) { @@ -5832,13 +6039,15 @@ export const QueryClassCreatorAllowlistResponse = { return message; }, fromAmino(object: QueryClassCreatorAllowlistResponseAmino): QueryClassCreatorAllowlistResponse { - return { - enabled: object.enabled - }; + const message = createBaseQueryClassCreatorAllowlistResponse(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: QueryClassCreatorAllowlistResponse): QueryClassCreatorAllowlistResponseAmino { const obj: any = {}; - obj.enabled = message.enabled; + obj.enabled = message.enabled === false ? undefined : message.enabled; return obj; }, fromAminoMsg(object: QueryClassCreatorAllowlistResponseAminoMsg): QueryClassCreatorAllowlistResponse { @@ -5859,18 +6068,19 @@ export const QueryClassCreatorAllowlistResponse = { }; function createBaseQueryAllowedClassCreatorsRequest(): QueryAllowedClassCreatorsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllowedClassCreatorsRequest = { - encode(message: QueryAllowedClassCreatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryAllowedClassCreatorsRequest", + encode(message: QueryAllowedClassCreatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowedClassCreatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowedClassCreatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowedClassCreatorsRequest(); while (reader.pos < end) { @@ -5902,9 +6112,11 @@ export const QueryAllowedClassCreatorsRequest = { return message; }, fromAmino(object: QueryAllowedClassCreatorsRequestAmino): QueryAllowedClassCreatorsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowedClassCreatorsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowedClassCreatorsRequest): QueryAllowedClassCreatorsRequestAmino { const obj: any = {}; @@ -5930,11 +6142,12 @@ export const QueryAllowedClassCreatorsRequest = { function createBaseQueryAllowedClassCreatorsResponse(): QueryAllowedClassCreatorsResponse { return { classCreators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllowedClassCreatorsResponse = { - encode(message: QueryAllowedClassCreatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryAllowedClassCreatorsResponse", + encode(message: QueryAllowedClassCreatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classCreators) { writer.uint32(10).string(v!); } @@ -5943,8 +6156,8 @@ export const QueryAllowedClassCreatorsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowedClassCreatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowedClassCreatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowedClassCreatorsResponse(); while (reader.pos < end) { @@ -5986,17 +6199,19 @@ export const QueryAllowedClassCreatorsResponse = { return message; }, fromAmino(object: QueryAllowedClassCreatorsResponseAmino): QueryAllowedClassCreatorsResponse { - return { - classCreators: Array.isArray(object?.class_creators) ? object.class_creators.map((e: any) => e) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllowedClassCreatorsResponse(); + message.classCreators = object.class_creators?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllowedClassCreatorsResponse): QueryAllowedClassCreatorsResponseAmino { const obj: any = {}; if (message.classCreators) { obj.class_creators = message.classCreators.map(e => e); } else { - obj.class_creators = []; + obj.class_creators = message.classCreators; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -6021,11 +6236,12 @@ function createBaseQueryClassFeeRequest(): QueryClassFeeRequest { return {}; } export const QueryClassFeeRequest = { - encode(_: QueryClassFeeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassFeeRequest", + encode(_: QueryClassFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassFeeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassFeeRequest(); while (reader.pos < end) { @@ -6050,7 +6266,8 @@ export const QueryClassFeeRequest = { return message; }, fromAmino(_: QueryClassFeeRequestAmino): QueryClassFeeRequest { - return {}; + const message = createBaseQueryClassFeeRequest(); + return message; }, toAmino(_: QueryClassFeeRequest): QueryClassFeeRequestAmino { const obj: any = {}; @@ -6078,14 +6295,15 @@ function createBaseQueryClassFeeResponse(): QueryClassFeeResponse { }; } export const QueryClassFeeResponse = { - encode(message: QueryClassFeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryClassFeeResponse", + encode(message: QueryClassFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Coin.encode(message.fee, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassFeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassFeeResponse(); while (reader.pos < end) { @@ -6117,9 +6335,11 @@ export const QueryClassFeeResponse = { return message; }, fromAmino(object: QueryClassFeeResponseAmino): QueryClassFeeResponse { - return { - fee: object?.fee ? Coin.fromAmino(object.fee) : undefined - }; + const message = createBaseQueryClassFeeResponse(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; }, toAmino(message: QueryClassFeeResponse): QueryClassFeeResponseAmino { const obj: any = {}; @@ -6146,11 +6366,12 @@ function createBaseQueryAllowedBridgeChainsRequest(): QueryAllowedBridgeChainsRe return {}; } export const QueryAllowedBridgeChainsRequest = { - encode(_: QueryAllowedBridgeChainsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryAllowedBridgeChainsRequest", + encode(_: QueryAllowedBridgeChainsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowedBridgeChainsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowedBridgeChainsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowedBridgeChainsRequest(); while (reader.pos < end) { @@ -6175,7 +6396,8 @@ export const QueryAllowedBridgeChainsRequest = { return message; }, fromAmino(_: QueryAllowedBridgeChainsRequestAmino): QueryAllowedBridgeChainsRequest { - return {}; + const message = createBaseQueryAllowedBridgeChainsRequest(); + return message; }, toAmino(_: QueryAllowedBridgeChainsRequest): QueryAllowedBridgeChainsRequestAmino { const obj: any = {}; @@ -6203,14 +6425,15 @@ function createBaseQueryAllowedBridgeChainsResponse(): QueryAllowedBridgeChainsR }; } export const QueryAllowedBridgeChainsResponse = { - encode(message: QueryAllowedBridgeChainsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.QueryAllowedBridgeChainsResponse", + encode(message: QueryAllowedBridgeChainsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowedBridgeChains) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowedBridgeChainsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowedBridgeChainsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowedBridgeChainsResponse(); while (reader.pos < end) { @@ -6246,16 +6469,16 @@ export const QueryAllowedBridgeChainsResponse = { return message; }, fromAmino(object: QueryAllowedBridgeChainsResponseAmino): QueryAllowedBridgeChainsResponse { - return { - allowedBridgeChains: Array.isArray(object?.allowed_bridge_chains) ? object.allowed_bridge_chains.map((e: any) => e) : [] - }; + const message = createBaseQueryAllowedBridgeChainsResponse(); + message.allowedBridgeChains = object.allowed_bridge_chains?.map(e => e) || []; + return message; }, toAmino(message: QueryAllowedBridgeChainsResponse): QueryAllowedBridgeChainsResponseAmino { const obj: any = {}; if (message.allowedBridgeChains) { obj.allowed_bridge_chains = message.allowedBridgeChains.map(e => e); } else { - obj.allowed_bridge_chains = []; + obj.allowed_bridge_chains = message.allowedBridgeChains; } return obj; }, diff --git a/packages/api/src/codegen/regen/ecocredit/v1/state.ts b/packages/api/src/codegen/regen/ecocredit/v1/state.ts index 3d1d8048..3a76113f 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/state.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/state.ts @@ -1,7 +1,7 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Long, isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** * CreditType defines the measurement unit/precision of a certain credit type * (e.g. carbon, biodiversity...) @@ -32,13 +32,13 @@ export interface CreditTypeAmino { * abbreviation is a 1-3 character uppercase abbreviation of the CreditType * name, used in batch denominations within the CreditType. It must be unique. */ - abbreviation: string; + abbreviation?: string; /** name is the name of the credit type (e.g. carbon, biodiversity). */ - name: string; + name?: string; /** unit is the measurement unit of the credit type (e.g. kg, ton). */ - unit: string; + unit?: string; /** precision is the decimal precision of the credit type. */ - precision: number; + precision?: number; } export interface CreditTypeAminoMsg { type: "/regen.ecocredit.v1.CreditType"; @@ -60,7 +60,7 @@ export interface Class { * key is the table row identifier of the credit class used internally for * efficient lookups. This identifier is auto-incrementing. */ - key: Long; + key: bigint; /** * id is the unique identifier of the credit class auto-generated from the * credit type abbreviation and the credit class sequence number. @@ -83,18 +83,18 @@ export interface ClassAmino { * key is the table row identifier of the credit class used internally for * efficient lookups. This identifier is auto-incrementing. */ - key: string; + key?: string; /** * id is the unique identifier of the credit class auto-generated from the * credit type abbreviation and the credit class sequence number. */ - id: string; + id?: string; /** admin is the admin of the credit class. */ - admin: Uint8Array; + admin?: string; /** metadata is any arbitrary metadata to attached to the credit class. */ - metadata: string; + metadata?: string; /** credit_type_abbrev is the abbreviation of the credit type. */ - credit_type_abbrev: string; + credit_type_abbrev?: string; } export interface ClassAminoMsg { type: "/regen.ecocredit.v1.Class"; @@ -102,7 +102,7 @@ export interface ClassAminoMsg { } /** Class represents the high-level on-chain information for a credit class. */ export interface ClassSDKType { - key: Long; + key: bigint; id: string; admin: Uint8Array; metadata: string; @@ -117,7 +117,7 @@ export interface ClassIssuer { * class_key is the table row identifier of the credit class used internally * for efficient lookups. This links a class issuer to a credit class. */ - classKey: Long; + classKey: bigint; /** issuer is the approved issuer of the credit class. */ issuer: Uint8Array; } @@ -134,9 +134,9 @@ export interface ClassIssuerAmino { * class_key is the table row identifier of the credit class used internally * for efficient lookups. This links a class issuer to a credit class. */ - class_key: string; + class_key?: string; /** issuer is the approved issuer of the credit class. */ - issuer: Uint8Array; + issuer?: string; } export interface ClassIssuerAminoMsg { type: "/regen.ecocredit.v1.ClassIssuer"; @@ -147,7 +147,7 @@ export interface ClassIssuerAminoMsg { * issuers */ export interface ClassIssuerSDKType { - class_key: Long; + class_key: bigint; issuer: Uint8Array; } /** Project represents the high-level on-chain information for a project. */ @@ -156,7 +156,7 @@ export interface Project { * key is the table row identifier of the project used internally for * efficient lookups. This identifier is auto-incrementing. */ - key: Long; + key: bigint; /** * id is the unique identifier of the project either auto-generated from the * credit class id and project sequence number or provided upon creation. @@ -168,7 +168,7 @@ export interface Project { * class_key is the table row identifier of the credit class used internally * for efficient lookups. This links a project to a credit class. */ - classKey: Long; + classKey: bigint; /** * jurisdiction is the jurisdiction of the project. * Full documentation can be found in MsgCreateProject.jurisdiction. @@ -189,28 +189,28 @@ export interface ProjectAmino { * key is the table row identifier of the project used internally for * efficient lookups. This identifier is auto-incrementing. */ - key: string; + key?: string; /** * id is the unique identifier of the project either auto-generated from the * credit class id and project sequence number or provided upon creation. */ - id: string; + id?: string; /** admin is the admin of the project. */ - admin: Uint8Array; + admin?: string; /** * class_key is the table row identifier of the credit class used internally * for efficient lookups. This links a project to a credit class. */ - class_key: string; + class_key?: string; /** * jurisdiction is the jurisdiction of the project. * Full documentation can be found in MsgCreateProject.jurisdiction. */ - jurisdiction: string; + jurisdiction?: string; /** metadata is any arbitrary metadata attached to the project. */ - metadata: string; + metadata?: string; /** reference_id is any arbitrary string used to reference the project. */ - reference_id: string; + reference_id?: string; } export interface ProjectAminoMsg { type: "/regen.ecocredit.v1.Project"; @@ -218,10 +218,10 @@ export interface ProjectAminoMsg { } /** Project represents the high-level on-chain information for a project. */ export interface ProjectSDKType { - key: Long; + key: bigint; id: string; admin: Uint8Array; - class_key: Long; + class_key: bigint; jurisdiction: string; metadata: string; reference_id: string; @@ -232,7 +232,7 @@ export interface Batch { * key is the table row identifier of the credit batch used internally for * efficient lookups. This identifier is auto-incrementing. */ - key: Long; + key: bigint; /** * issuer is the address that created the batch and which is * authorized to mint more credits if open=true. @@ -242,7 +242,7 @@ export interface Batch { * project_key is the table row identifier of the credit class used internally * for efficient lookups. This links a credit batch to a project. */ - projectKey: Long; + projectKey: bigint; /** * denom is the unique identifier of the credit batch formed from the * project id, the batch sequence number, and the start and end date of the @@ -255,14 +255,14 @@ export interface Batch { * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - startDate: Timestamp; + startDate?: Timestamp; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - endDate: Timestamp; + endDate?: Timestamp; /** issuance_date is the timestamp when the credit batch was issued. */ - issuanceDate: Timestamp; + issuanceDate?: Timestamp; /** * open tells if it's possible to mint new credits in the future. * Once `open` is set to false, it can't be toggled any more. @@ -279,42 +279,42 @@ export interface BatchAmino { * key is the table row identifier of the credit batch used internally for * efficient lookups. This identifier is auto-incrementing. */ - key: string; + key?: string; /** * issuer is the address that created the batch and which is * authorized to mint more credits if open=true. */ - issuer: Uint8Array; + issuer?: string; /** * project_key is the table row identifier of the credit class used internally * for efficient lookups. This links a credit batch to a project. */ - project_key: string; + project_key?: string; /** * denom is the unique identifier of the credit batch formed from the * project id, the batch sequence number, and the start and end date of the * credit batch. */ - denom: string; + denom?: string; /** metadata is any arbitrary metadata attached to the credit batch. */ - metadata: string; + metadata?: string; /** * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - start_date?: TimestampAmino; + start_date?: string; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - end_date?: TimestampAmino; + end_date?: string; /** issuance_date is the timestamp when the credit batch was issued. */ - issuance_date?: TimestampAmino; + issuance_date?: string; /** * open tells if it's possible to mint new credits in the future. * Once `open` is set to false, it can't be toggled any more. */ - open: boolean; + open?: boolean; } export interface BatchAminoMsg { type: "/regen.ecocredit.v1.Batch"; @@ -322,14 +322,14 @@ export interface BatchAminoMsg { } /** Batch represents the high-level on-chain information for a credit batch. */ export interface BatchSDKType { - key: Long; + key: bigint; issuer: Uint8Array; - project_key: Long; + project_key: bigint; denom: string; metadata: string; - start_date: TimestampSDKType; - end_date: TimestampSDKType; - issuance_date: TimestampSDKType; + start_date?: TimestampSDKType; + end_date?: TimestampSDKType; + issuance_date?: TimestampSDKType; open: boolean; } /** @@ -346,7 +346,7 @@ export interface ClassSequence { * next_sequence is the next sequence number for a credit class within the * credit type. The sequence number is used to generate a class id. */ - nextSequence: Long; + nextSequence: bigint; } export interface ClassSequenceProtoMsg { typeUrl: "/regen.ecocredit.v1.ClassSequence"; @@ -361,12 +361,12 @@ export interface ClassSequenceAmino { * credit_type_abbrev is the credit type abbreviation. This links a class * sequence to a credit type. */ - credit_type_abbrev: string; + credit_type_abbrev?: string; /** * next_sequence is the next sequence number for a credit class within the * credit type. The sequence number is used to generate a class id. */ - next_sequence: string; + next_sequence?: string; } export interface ClassSequenceAminoMsg { type: "/regen.ecocredit.v1.ClassSequence"; @@ -378,7 +378,7 @@ export interface ClassSequenceAminoMsg { */ export interface ClassSequenceSDKType { credit_type_abbrev: string; - next_sequence: Long; + next_sequence: bigint; } /** * ProjectSequence stores and increments the sequence number for projects within @@ -389,12 +389,12 @@ export interface ProjectSequence { * class_key is the table row identifier of the credit class used internally * for efficient lookups. This links a project sequence to a credit class. */ - classKey: Long; + classKey: bigint; /** * next_sequence is the next sequence number for a project within the credit * class. The sequence number is used to generate a project id. */ - nextSequence: Long; + nextSequence: bigint; } export interface ProjectSequenceProtoMsg { typeUrl: "/regen.ecocredit.v1.ProjectSequence"; @@ -409,12 +409,12 @@ export interface ProjectSequenceAmino { * class_key is the table row identifier of the credit class used internally * for efficient lookups. This links a project sequence to a credit class. */ - class_key: string; + class_key?: string; /** * next_sequence is the next sequence number for a project within the credit * class. The sequence number is used to generate a project id. */ - next_sequence: string; + next_sequence?: string; } export interface ProjectSequenceAminoMsg { type: "/regen.ecocredit.v1.ProjectSequence"; @@ -425,8 +425,8 @@ export interface ProjectSequenceAminoMsg { * a credit class. */ export interface ProjectSequenceSDKType { - class_key: Long; - next_sequence: Long; + class_key: bigint; + next_sequence: bigint; } /** * BatchSequence stores and increments the sequence number for credit batches @@ -437,12 +437,12 @@ export interface BatchSequence { * project_key is the table row identifier of the project used internally for * efficient lookups. This links a batch sequence to a project. */ - projectKey: Long; + projectKey: bigint; /** * next_sequence is the next sequence number for a credit batch within the * project. The sequence number is used to generate a batch denom. */ - nextSequence: Long; + nextSequence: bigint; } export interface BatchSequenceProtoMsg { typeUrl: "/regen.ecocredit.v1.BatchSequence"; @@ -457,12 +457,12 @@ export interface BatchSequenceAmino { * project_key is the table row identifier of the project used internally for * efficient lookups. This links a batch sequence to a project. */ - project_key: string; + project_key?: string; /** * next_sequence is the next sequence number for a credit batch within the * project. The sequence number is used to generate a batch denom. */ - next_sequence: string; + next_sequence?: string; } export interface BatchSequenceAminoMsg { type: "/regen.ecocredit.v1.BatchSequence"; @@ -473,8 +473,8 @@ export interface BatchSequenceAminoMsg { * within a project. */ export interface BatchSequenceSDKType { - project_key: Long; - next_sequence: Long; + project_key: bigint; + next_sequence: bigint; } /** BatchBalance stores each accounts credit balance. */ export interface BatchBalance { @@ -482,7 +482,7 @@ export interface BatchBalance { * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links a batch balance to a credit batch. */ - batchKey: Long; + batchKey: bigint; /** address is the address of the account that owns the credits. */ address: Uint8Array; /** tradable_amount is the total number of tradable credits owned by address. */ @@ -507,20 +507,20 @@ export interface BatchBalanceAmino { * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links a batch balance to a credit batch. */ - batch_key: string; + batch_key?: string; /** address is the address of the account that owns the credits. */ - address: Uint8Array; + address?: string; /** tradable_amount is the total number of tradable credits owned by address. */ - tradable_amount: string; + tradable_amount?: string; /** retired_amount is the total number of retired credits owned by address. */ - retired_amount: string; + retired_amount?: string; /** * escrowed_amount is the total number of escrowed credits owned by address * and held in escrow by the marketplace. Credits are held in escrow when a * sell order is created and taken out of escrow when the sell order is either * cancelled, updated with a reduced quantity, or processed. */ - escrowed_amount: string; + escrowed_amount?: string; } export interface BatchBalanceAminoMsg { type: "/regen.ecocredit.v1.BatchBalance"; @@ -528,7 +528,7 @@ export interface BatchBalanceAminoMsg { } /** BatchBalance stores each accounts credit balance. */ export interface BatchBalanceSDKType { - batch_key: Long; + batch_key: bigint; address: Uint8Array; tradable_amount: string; retired_amount: string; @@ -540,7 +540,7 @@ export interface BatchSupply { * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links a batch supply to a credit batch. */ - batchKey: Long; + batchKey: bigint; /** * tradable_amount is the total number of tradable credits in the credit * batch. Tradable credits may be retired in which case they will be removed @@ -574,7 +574,7 @@ export interface BatchSupplyAmino { * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links a batch supply to a credit batch. */ - batch_key: string; + batch_key?: string; /** * tradable_amount is the total number of tradable credits in the credit * batch. Tradable credits may be retired in which case they will be removed @@ -583,20 +583,20 @@ export interface BatchSupplyAmino { * and tracked in cancelled_amount. The sum of the tradable, retired, and * cancelled amounts will always equal the original credit issuance amount. */ - tradable_amount: string; + tradable_amount?: string; /** * retired_amount is the total amount of credits that have been retired in the * credit batch. The sum of the tradable, retired, and cancelled amounts will * always equal the original credit issuance amount. */ - retired_amount: string; + retired_amount?: string; /** * cancelled_amount is the number of credits in the batch that have been * cancelled, effectively undoing the issuance. The sum of the tradable, * retired, and cancelled amounts will always equal the original credit * issuance amount. */ - cancelled_amount: string; + cancelled_amount?: string; } export interface BatchSupplyAminoMsg { type: "/regen.ecocredit.v1.BatchSupply"; @@ -604,7 +604,7 @@ export interface BatchSupplyAminoMsg { } /** BatchSupply stores the supply of credits for a credit batch. */ export interface BatchSupplySDKType { - batch_key: Long; + batch_key: bigint; tradable_amount: string; retired_amount: string; cancelled_amount: string; @@ -623,7 +623,7 @@ export interface OriginTxIndex { * to prevent malicious credit class issuers from blocking bridge operations * taking place within another credit class. */ - classKey: Long; + classKey: bigint; /** * id is the transaction ID of an originating transaction or operation * based on a type (i.e. transaction ID, serial number). @@ -653,17 +653,17 @@ export interface OriginTxIndexAmino { * to prevent malicious credit class issuers from blocking bridge operations * taking place within another credit class. */ - class_key: string; + class_key?: string; /** * id is the transaction ID of an originating transaction or operation * based on a type (i.e. transaction ID, serial number). */ - id: string; + id?: string; /** * source is the source chain or registry of the transaction originating * the mint process (e.g. polygon, ethereum, verra). */ - source: string; + source?: string; } export interface OriginTxIndexAminoMsg { type: "/regen.ecocredit.v1.OriginTxIndex"; @@ -677,7 +677,7 @@ export interface OriginTxIndexAminoMsg { * bridge operations taking place within another credit class. */ export interface OriginTxIndexSDKType { - class_key: Long; + class_key: bigint; id: string; source: string; } @@ -692,14 +692,14 @@ export interface BatchContract { * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links an external contract to a credit batch. */ - batchKey: Long; + batchKey: bigint; /** * class_key is the table row identifier of the credit class within which the * credit batch exists. A contract is unique within the scope of a credit * class to prevent malicious credit class issuers from blocking bridge * operations taking place within another credit class. */ - classKey: Long; + classKey: bigint; /** * contract is the address of the contract on the source chain that was * executed when creating the transaction. This address will be used when @@ -722,20 +722,20 @@ export interface BatchContractAmino { * batch_key is the table row identifier of the credit batch used internally * for efficient lookups. This links an external contract to a credit batch. */ - batch_key: string; + batch_key?: string; /** * class_key is the table row identifier of the credit class within which the * credit batch exists. A contract is unique within the scope of a credit * class to prevent malicious credit class issuers from blocking bridge * operations taking place within another credit class. */ - class_key: string; + class_key?: string; /** * contract is the address of the contract on the source chain that was * executed when creating the transaction. This address will be used when * sending credits back to the source chain. */ - contract: string; + contract?: string; } export interface BatchContractAminoMsg { type: "/regen.ecocredit.v1.BatchContract"; @@ -748,8 +748,8 @@ export interface BatchContractAminoMsg { * have been bridged will always be bridged back to the original contract. */ export interface BatchContractSDKType { - batch_key: Long; - class_key: Long; + batch_key: bigint; + class_key: bigint; contract: string; } /** @@ -778,7 +778,7 @@ export interface ClassCreatorAllowlistProtoMsg { */ export interface ClassCreatorAllowlistAmino { /** enabled is whether or not the allow list is enabled. */ - enabled: boolean; + enabled?: boolean; } export interface ClassCreatorAllowlistAminoMsg { type: "/regen.ecocredit.v1.ClassCreatorAllowlist"; @@ -817,7 +817,7 @@ export interface AllowedClassCreatorProtoMsg { */ export interface AllowedClassCreatorAmino { /** address is the address that is allowed to create credit classes */ - address: Uint8Array; + address?: string; } export interface AllowedClassCreatorAminoMsg { type: "/regen.ecocredit.v1.AllowedClassCreator"; @@ -843,7 +843,7 @@ export interface ClassFee { * fee is the credit class creation fee. If not set, a credit class creation * fee is not required. */ - fee: Coin; + fee?: Coin; } export interface ClassFeeProtoMsg { typeUrl: "/regen.ecocredit.v1.ClassFee"; @@ -873,7 +873,7 @@ export interface ClassFeeAminoMsg { * Since Revision 2 */ export interface ClassFeeSDKType { - fee: CoinSDKType; + fee?: CoinSDKType; } /** * AllowedBridgeChain is a list of chains that are allowed to be used in @@ -901,7 +901,7 @@ export interface AllowedBridgeChainProtoMsg { */ export interface AllowedBridgeChainAmino { /** chain_name is the name of the chain allowed to bridge ecocredits to. */ - chain_name: string; + chain_name?: string; } export interface AllowedBridgeChainAminoMsg { type: "/regen.ecocredit.v1.AllowedBridgeChain"; @@ -927,7 +927,8 @@ function createBaseCreditType(): CreditType { }; } export const CreditType = { - encode(message: CreditType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.CreditType", + encode(message: CreditType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.abbreviation !== "") { writer.uint32(10).string(message.abbreviation); } @@ -942,8 +943,8 @@ export const CreditType = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CreditType { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CreditType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCreditType(); while (reader.pos < end) { @@ -993,19 +994,27 @@ export const CreditType = { return message; }, fromAmino(object: CreditTypeAmino): CreditType { - return { - abbreviation: object.abbreviation, - name: object.name, - unit: object.unit, - precision: object.precision - }; + const message = createBaseCreditType(); + if (object.abbreviation !== undefined && object.abbreviation !== null) { + message.abbreviation = object.abbreviation; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.unit !== undefined && object.unit !== null) { + message.unit = object.unit; + } + if (object.precision !== undefined && object.precision !== null) { + message.precision = object.precision; + } + return message; }, toAmino(message: CreditType): CreditTypeAmino { const obj: any = {}; - obj.abbreviation = message.abbreviation; - obj.name = message.name; - obj.unit = message.unit; - obj.precision = message.precision; + obj.abbreviation = message.abbreviation === "" ? undefined : message.abbreviation; + obj.name = message.name === "" ? undefined : message.name; + obj.unit = message.unit === "" ? undefined : message.unit; + obj.precision = message.precision === 0 ? undefined : message.precision; return obj; }, fromAminoMsg(object: CreditTypeAminoMsg): CreditType { @@ -1026,7 +1035,7 @@ export const CreditType = { }; function createBaseClass(): Class { return { - key: Long.UZERO, + key: BigInt(0), id: "", admin: new Uint8Array(), metadata: "", @@ -1034,8 +1043,9 @@ function createBaseClass(): Class { }; } export const Class = { - encode(message: Class, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.key.isZero()) { + typeUrl: "/regen.ecocredit.v1.Class", + encode(message: Class, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== BigInt(0)) { writer.uint32(8).uint64(message.key); } if (message.id !== "") { @@ -1052,15 +1062,15 @@ export const Class = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Class { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Class { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClass(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = (reader.uint64() as Long); + message.key = reader.uint64(); break; case 2: message.id = reader.string(); @@ -1083,7 +1093,7 @@ export const Class = { }, fromJSON(object: any): Class { return { - key: isSet(object.key) ? Long.fromValue(object.key) : Long.UZERO, + key: isSet(object.key) ? BigInt(object.key.toString()) : BigInt(0), id: isSet(object.id) ? String(object.id) : "", admin: isSet(object.admin) ? bytesFromBase64(object.admin) : new Uint8Array(), metadata: isSet(object.metadata) ? String(object.metadata) : "", @@ -1092,7 +1102,7 @@ export const Class = { }, toJSON(message: Class): unknown { const obj: any = {}; - message.key !== undefined && (obj.key = (message.key || Long.UZERO).toString()); + message.key !== undefined && (obj.key = (message.key || BigInt(0)).toString()); message.id !== undefined && (obj.id = message.id); message.admin !== undefined && (obj.admin = base64FromBytes(message.admin !== undefined ? message.admin : new Uint8Array())); message.metadata !== undefined && (obj.metadata = message.metadata); @@ -1101,7 +1111,7 @@ export const Class = { }, fromPartial(object: Partial): Class { const message = createBaseClass(); - message.key = object.key !== undefined && object.key !== null ? Long.fromValue(object.key) : Long.UZERO; + message.key = object.key !== undefined && object.key !== null ? BigInt(object.key.toString()) : BigInt(0); message.id = object.id ?? ""; message.admin = object.admin ?? new Uint8Array(); message.metadata = object.metadata ?? ""; @@ -1109,21 +1119,31 @@ export const Class = { return message; }, fromAmino(object: ClassAmino): Class { - return { - key: Long.fromString(object.key), - id: object.id, - admin: object.admin, - metadata: object.metadata, - creditTypeAbbrev: object.credit_type_abbrev - }; + const message = createBaseClass(); + if (object.key !== undefined && object.key !== null) { + message.key = BigInt(object.key); + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = bytesFromBase64(object.admin); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + return message; }, toAmino(message: Class): ClassAmino { const obj: any = {}; - obj.key = message.key ? message.key.toString() : undefined; - obj.id = message.id; - obj.admin = message.admin; - obj.metadata = message.metadata; - obj.credit_type_abbrev = message.creditTypeAbbrev; + obj.key = message.key !== BigInt(0) ? message.key.toString() : undefined; + obj.id = message.id === "" ? undefined : message.id; + obj.admin = message.admin ? base64FromBytes(message.admin) : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; return obj; }, fromAminoMsg(object: ClassAminoMsg): Class { @@ -1144,13 +1164,14 @@ export const Class = { }; function createBaseClassIssuer(): ClassIssuer { return { - classKey: Long.UZERO, + classKey: BigInt(0), issuer: new Uint8Array() }; } export const ClassIssuer = { - encode(message: ClassIssuer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.classKey.isZero()) { + typeUrl: "/regen.ecocredit.v1.ClassIssuer", + encode(message: ClassIssuer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classKey !== BigInt(0)) { writer.uint32(8).uint64(message.classKey); } if (message.issuer.length !== 0) { @@ -1158,15 +1179,15 @@ export const ClassIssuer = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClassIssuer { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClassIssuer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClassIssuer(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.classKey = (reader.uint64() as Long); + message.classKey = reader.uint64(); break; case 2: message.issuer = reader.bytes(); @@ -1180,32 +1201,36 @@ export const ClassIssuer = { }, fromJSON(object: any): ClassIssuer { return { - classKey: isSet(object.classKey) ? Long.fromValue(object.classKey) : Long.UZERO, + classKey: isSet(object.classKey) ? BigInt(object.classKey.toString()) : BigInt(0), issuer: isSet(object.issuer) ? bytesFromBase64(object.issuer) : new Uint8Array() }; }, toJSON(message: ClassIssuer): unknown { const obj: any = {}; - message.classKey !== undefined && (obj.classKey = (message.classKey || Long.UZERO).toString()); + message.classKey !== undefined && (obj.classKey = (message.classKey || BigInt(0)).toString()); message.issuer !== undefined && (obj.issuer = base64FromBytes(message.issuer !== undefined ? message.issuer : new Uint8Array())); return obj; }, fromPartial(object: Partial): ClassIssuer { const message = createBaseClassIssuer(); - message.classKey = object.classKey !== undefined && object.classKey !== null ? Long.fromValue(object.classKey) : Long.UZERO; + message.classKey = object.classKey !== undefined && object.classKey !== null ? BigInt(object.classKey.toString()) : BigInt(0); message.issuer = object.issuer ?? new Uint8Array(); return message; }, fromAmino(object: ClassIssuerAmino): ClassIssuer { - return { - classKey: Long.fromString(object.class_key), - issuer: object.issuer - }; + const message = createBaseClassIssuer(); + if (object.class_key !== undefined && object.class_key !== null) { + message.classKey = BigInt(object.class_key); + } + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = bytesFromBase64(object.issuer); + } + return message; }, toAmino(message: ClassIssuer): ClassIssuerAmino { const obj: any = {}; - obj.class_key = message.classKey ? message.classKey.toString() : undefined; - obj.issuer = message.issuer; + obj.class_key = message.classKey !== BigInt(0) ? message.classKey.toString() : undefined; + obj.issuer = message.issuer ? base64FromBytes(message.issuer) : undefined; return obj; }, fromAminoMsg(object: ClassIssuerAminoMsg): ClassIssuer { @@ -1226,18 +1251,19 @@ export const ClassIssuer = { }; function createBaseProject(): Project { return { - key: Long.UZERO, + key: BigInt(0), id: "", admin: new Uint8Array(), - classKey: Long.UZERO, + classKey: BigInt(0), jurisdiction: "", metadata: "", referenceId: "" }; } export const Project = { - encode(message: Project, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.key.isZero()) { + typeUrl: "/regen.ecocredit.v1.Project", + encode(message: Project, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== BigInt(0)) { writer.uint32(8).uint64(message.key); } if (message.id !== "") { @@ -1246,7 +1272,7 @@ export const Project = { if (message.admin.length !== 0) { writer.uint32(26).bytes(message.admin); } - if (!message.classKey.isZero()) { + if (message.classKey !== BigInt(0)) { writer.uint32(32).uint64(message.classKey); } if (message.jurisdiction !== "") { @@ -1260,15 +1286,15 @@ export const Project = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Project { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Project { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProject(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = (reader.uint64() as Long); + message.key = reader.uint64(); break; case 2: message.id = reader.string(); @@ -1277,7 +1303,7 @@ export const Project = { message.admin = reader.bytes(); break; case 4: - message.classKey = (reader.uint64() as Long); + message.classKey = reader.uint64(); break; case 5: message.jurisdiction = reader.string(); @@ -1297,10 +1323,10 @@ export const Project = { }, fromJSON(object: any): Project { return { - key: isSet(object.key) ? Long.fromValue(object.key) : Long.UZERO, + key: isSet(object.key) ? BigInt(object.key.toString()) : BigInt(0), id: isSet(object.id) ? String(object.id) : "", admin: isSet(object.admin) ? bytesFromBase64(object.admin) : new Uint8Array(), - classKey: isSet(object.classKey) ? Long.fromValue(object.classKey) : Long.UZERO, + classKey: isSet(object.classKey) ? BigInt(object.classKey.toString()) : BigInt(0), jurisdiction: isSet(object.jurisdiction) ? String(object.jurisdiction) : "", metadata: isSet(object.metadata) ? String(object.metadata) : "", referenceId: isSet(object.referenceId) ? String(object.referenceId) : "" @@ -1308,10 +1334,10 @@ export const Project = { }, toJSON(message: Project): unknown { const obj: any = {}; - message.key !== undefined && (obj.key = (message.key || Long.UZERO).toString()); + message.key !== undefined && (obj.key = (message.key || BigInt(0)).toString()); message.id !== undefined && (obj.id = message.id); message.admin !== undefined && (obj.admin = base64FromBytes(message.admin !== undefined ? message.admin : new Uint8Array())); - message.classKey !== undefined && (obj.classKey = (message.classKey || Long.UZERO).toString()); + message.classKey !== undefined && (obj.classKey = (message.classKey || BigInt(0)).toString()); message.jurisdiction !== undefined && (obj.jurisdiction = message.jurisdiction); message.metadata !== undefined && (obj.metadata = message.metadata); message.referenceId !== undefined && (obj.referenceId = message.referenceId); @@ -1319,35 +1345,49 @@ export const Project = { }, fromPartial(object: Partial): Project { const message = createBaseProject(); - message.key = object.key !== undefined && object.key !== null ? Long.fromValue(object.key) : Long.UZERO; + message.key = object.key !== undefined && object.key !== null ? BigInt(object.key.toString()) : BigInt(0); message.id = object.id ?? ""; message.admin = object.admin ?? new Uint8Array(); - message.classKey = object.classKey !== undefined && object.classKey !== null ? Long.fromValue(object.classKey) : Long.UZERO; + message.classKey = object.classKey !== undefined && object.classKey !== null ? BigInt(object.classKey.toString()) : BigInt(0); message.jurisdiction = object.jurisdiction ?? ""; message.metadata = object.metadata ?? ""; message.referenceId = object.referenceId ?? ""; return message; }, fromAmino(object: ProjectAmino): Project { - return { - key: Long.fromString(object.key), - id: object.id, - admin: object.admin, - classKey: Long.fromString(object.class_key), - jurisdiction: object.jurisdiction, - metadata: object.metadata, - referenceId: object.reference_id - }; + const message = createBaseProject(); + if (object.key !== undefined && object.key !== null) { + message.key = BigInt(object.key); + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = bytesFromBase64(object.admin); + } + if (object.class_key !== undefined && object.class_key !== null) { + message.classKey = BigInt(object.class_key); + } + if (object.jurisdiction !== undefined && object.jurisdiction !== null) { + message.jurisdiction = object.jurisdiction; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.reference_id !== undefined && object.reference_id !== null) { + message.referenceId = object.reference_id; + } + return message; }, toAmino(message: Project): ProjectAmino { const obj: any = {}; - obj.key = message.key ? message.key.toString() : undefined; - obj.id = message.id; - obj.admin = message.admin; - obj.class_key = message.classKey ? message.classKey.toString() : undefined; - obj.jurisdiction = message.jurisdiction; - obj.metadata = message.metadata; - obj.reference_id = message.referenceId; + obj.key = message.key !== BigInt(0) ? message.key.toString() : undefined; + obj.id = message.id === "" ? undefined : message.id; + obj.admin = message.admin ? base64FromBytes(message.admin) : undefined; + obj.class_key = message.classKey !== BigInt(0) ? message.classKey.toString() : undefined; + obj.jurisdiction = message.jurisdiction === "" ? undefined : message.jurisdiction; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.reference_id = message.referenceId === "" ? undefined : message.referenceId; return obj; }, fromAminoMsg(object: ProjectAminoMsg): Project { @@ -1368,9 +1408,9 @@ export const Project = { }; function createBaseBatch(): Batch { return { - key: Long.UZERO, + key: BigInt(0), issuer: new Uint8Array(), - projectKey: Long.UZERO, + projectKey: BigInt(0), denom: "", metadata: "", startDate: undefined, @@ -1380,14 +1420,15 @@ function createBaseBatch(): Batch { }; } export const Batch = { - encode(message: Batch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.key.isZero()) { + typeUrl: "/regen.ecocredit.v1.Batch", + encode(message: Batch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== BigInt(0)) { writer.uint32(8).uint64(message.key); } if (message.issuer.length !== 0) { writer.uint32(18).bytes(message.issuer); } - if (!message.projectKey.isZero()) { + if (message.projectKey !== BigInt(0)) { writer.uint32(24).uint64(message.projectKey); } if (message.denom !== "") { @@ -1410,21 +1451,21 @@ export const Batch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Batch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Batch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatch(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = (reader.uint64() as Long); + message.key = reader.uint64(); break; case 2: message.issuer = reader.bytes(); break; case 3: - message.projectKey = (reader.uint64() as Long); + message.projectKey = reader.uint64(); break; case 4: message.denom = reader.string(); @@ -1453,9 +1494,9 @@ export const Batch = { }, fromJSON(object: any): Batch { return { - key: isSet(object.key) ? Long.fromValue(object.key) : Long.UZERO, + key: isSet(object.key) ? BigInt(object.key.toString()) : BigInt(0), issuer: isSet(object.issuer) ? bytesFromBase64(object.issuer) : new Uint8Array(), - projectKey: isSet(object.projectKey) ? Long.fromValue(object.projectKey) : Long.UZERO, + projectKey: isSet(object.projectKey) ? BigInt(object.projectKey.toString()) : BigInt(0), denom: isSet(object.denom) ? String(object.denom) : "", metadata: isSet(object.metadata) ? String(object.metadata) : "", startDate: isSet(object.startDate) ? fromJsonTimestamp(object.startDate) : undefined, @@ -1466,9 +1507,9 @@ export const Batch = { }, toJSON(message: Batch): unknown { const obj: any = {}; - message.key !== undefined && (obj.key = (message.key || Long.UZERO).toString()); + message.key !== undefined && (obj.key = (message.key || BigInt(0)).toString()); message.issuer !== undefined && (obj.issuer = base64FromBytes(message.issuer !== undefined ? message.issuer : new Uint8Array())); - message.projectKey !== undefined && (obj.projectKey = (message.projectKey || Long.UZERO).toString()); + message.projectKey !== undefined && (obj.projectKey = (message.projectKey || BigInt(0)).toString()); message.denom !== undefined && (obj.denom = message.denom); message.metadata !== undefined && (obj.metadata = message.metadata); message.startDate !== undefined && (obj.startDate = fromTimestamp(message.startDate).toISOString()); @@ -1479,9 +1520,9 @@ export const Batch = { }, fromPartial(object: Partial): Batch { const message = createBaseBatch(); - message.key = object.key !== undefined && object.key !== null ? Long.fromValue(object.key) : Long.UZERO; + message.key = object.key !== undefined && object.key !== null ? BigInt(object.key.toString()) : BigInt(0); message.issuer = object.issuer ?? new Uint8Array(); - message.projectKey = object.projectKey !== undefined && object.projectKey !== null ? Long.fromValue(object.projectKey) : Long.UZERO; + message.projectKey = object.projectKey !== undefined && object.projectKey !== null ? BigInt(object.projectKey.toString()) : BigInt(0); message.denom = object.denom ?? ""; message.metadata = object.metadata ?? ""; message.startDate = object.startDate !== undefined && object.startDate !== null ? Timestamp.fromPartial(object.startDate) : undefined; @@ -1491,29 +1532,47 @@ export const Batch = { return message; }, fromAmino(object: BatchAmino): Batch { - return { - key: Long.fromString(object.key), - issuer: object.issuer, - projectKey: Long.fromString(object.project_key), - denom: object.denom, - metadata: object.metadata, - startDate: object?.start_date ? Timestamp.fromAmino(object.start_date) : undefined, - endDate: object?.end_date ? Timestamp.fromAmino(object.end_date) : undefined, - issuanceDate: object?.issuance_date ? Timestamp.fromAmino(object.issuance_date) : undefined, - open: object.open - }; + const message = createBaseBatch(); + if (object.key !== undefined && object.key !== null) { + message.key = BigInt(object.key); + } + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = bytesFromBase64(object.issuer); + } + if (object.project_key !== undefined && object.project_key !== null) { + message.projectKey = BigInt(object.project_key); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.start_date !== undefined && object.start_date !== null) { + message.startDate = Timestamp.fromAmino(object.start_date); + } + if (object.end_date !== undefined && object.end_date !== null) { + message.endDate = Timestamp.fromAmino(object.end_date); + } + if (object.issuance_date !== undefined && object.issuance_date !== null) { + message.issuanceDate = Timestamp.fromAmino(object.issuance_date); + } + if (object.open !== undefined && object.open !== null) { + message.open = object.open; + } + return message; }, toAmino(message: Batch): BatchAmino { const obj: any = {}; - obj.key = message.key ? message.key.toString() : undefined; - obj.issuer = message.issuer; - obj.project_key = message.projectKey ? message.projectKey.toString() : undefined; - obj.denom = message.denom; - obj.metadata = message.metadata; + obj.key = message.key !== BigInt(0) ? message.key.toString() : undefined; + obj.issuer = message.issuer ? base64FromBytes(message.issuer) : undefined; + obj.project_key = message.projectKey !== BigInt(0) ? message.projectKey.toString() : undefined; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.metadata = message.metadata === "" ? undefined : message.metadata; obj.start_date = message.startDate ? Timestamp.toAmino(message.startDate) : undefined; obj.end_date = message.endDate ? Timestamp.toAmino(message.endDate) : undefined; obj.issuance_date = message.issuanceDate ? Timestamp.toAmino(message.issuanceDate) : undefined; - obj.open = message.open; + obj.open = message.open === false ? undefined : message.open; return obj; }, fromAminoMsg(object: BatchAminoMsg): Batch { @@ -1535,21 +1594,22 @@ export const Batch = { function createBaseClassSequence(): ClassSequence { return { creditTypeAbbrev: "", - nextSequence: Long.UZERO + nextSequence: BigInt(0) }; } export const ClassSequence = { - encode(message: ClassSequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.ClassSequence", + encode(message: ClassSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.creditTypeAbbrev !== "") { writer.uint32(10).string(message.creditTypeAbbrev); } - if (!message.nextSequence.isZero()) { + if (message.nextSequence !== BigInt(0)) { writer.uint32(16).uint64(message.nextSequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClassSequence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClassSequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClassSequence(); while (reader.pos < end) { @@ -1559,7 +1619,7 @@ export const ClassSequence = { message.creditTypeAbbrev = reader.string(); break; case 2: - message.nextSequence = (reader.uint64() as Long); + message.nextSequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1571,31 +1631,35 @@ export const ClassSequence = { fromJSON(object: any): ClassSequence { return { creditTypeAbbrev: isSet(object.creditTypeAbbrev) ? String(object.creditTypeAbbrev) : "", - nextSequence: isSet(object.nextSequence) ? Long.fromValue(object.nextSequence) : Long.UZERO + nextSequence: isSet(object.nextSequence) ? BigInt(object.nextSequence.toString()) : BigInt(0) }; }, toJSON(message: ClassSequence): unknown { const obj: any = {}; message.creditTypeAbbrev !== undefined && (obj.creditTypeAbbrev = message.creditTypeAbbrev); - message.nextSequence !== undefined && (obj.nextSequence = (message.nextSequence || Long.UZERO).toString()); + message.nextSequence !== undefined && (obj.nextSequence = (message.nextSequence || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ClassSequence { const message = createBaseClassSequence(); message.creditTypeAbbrev = object.creditTypeAbbrev ?? ""; - message.nextSequence = object.nextSequence !== undefined && object.nextSequence !== null ? Long.fromValue(object.nextSequence) : Long.UZERO; + message.nextSequence = object.nextSequence !== undefined && object.nextSequence !== null ? BigInt(object.nextSequence.toString()) : BigInt(0); return message; }, fromAmino(object: ClassSequenceAmino): ClassSequence { - return { - creditTypeAbbrev: object.credit_type_abbrev, - nextSequence: Long.fromString(object.next_sequence) - }; + const message = createBaseClassSequence(); + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + if (object.next_sequence !== undefined && object.next_sequence !== null) { + message.nextSequence = BigInt(object.next_sequence); + } + return message; }, toAmino(message: ClassSequence): ClassSequenceAmino { const obj: any = {}; - obj.credit_type_abbrev = message.creditTypeAbbrev; - obj.next_sequence = message.nextSequence ? message.nextSequence.toString() : undefined; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; + obj.next_sequence = message.nextSequence !== BigInt(0) ? message.nextSequence.toString() : undefined; return obj; }, fromAminoMsg(object: ClassSequenceAminoMsg): ClassSequence { @@ -1616,32 +1680,33 @@ export const ClassSequence = { }; function createBaseProjectSequence(): ProjectSequence { return { - classKey: Long.UZERO, - nextSequence: Long.UZERO + classKey: BigInt(0), + nextSequence: BigInt(0) }; } export const ProjectSequence = { - encode(message: ProjectSequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.classKey.isZero()) { + typeUrl: "/regen.ecocredit.v1.ProjectSequence", + encode(message: ProjectSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classKey !== BigInt(0)) { writer.uint32(8).uint64(message.classKey); } - if (!message.nextSequence.isZero()) { + if (message.nextSequence !== BigInt(0)) { writer.uint32(16).uint64(message.nextSequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProjectSequence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProjectSequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProjectSequence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.classKey = (reader.uint64() as Long); + message.classKey = reader.uint64(); break; case 2: - message.nextSequence = (reader.uint64() as Long); + message.nextSequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1652,32 +1717,36 @@ export const ProjectSequence = { }, fromJSON(object: any): ProjectSequence { return { - classKey: isSet(object.classKey) ? Long.fromValue(object.classKey) : Long.UZERO, - nextSequence: isSet(object.nextSequence) ? Long.fromValue(object.nextSequence) : Long.UZERO + classKey: isSet(object.classKey) ? BigInt(object.classKey.toString()) : BigInt(0), + nextSequence: isSet(object.nextSequence) ? BigInt(object.nextSequence.toString()) : BigInt(0) }; }, toJSON(message: ProjectSequence): unknown { const obj: any = {}; - message.classKey !== undefined && (obj.classKey = (message.classKey || Long.UZERO).toString()); - message.nextSequence !== undefined && (obj.nextSequence = (message.nextSequence || Long.UZERO).toString()); + message.classKey !== undefined && (obj.classKey = (message.classKey || BigInt(0)).toString()); + message.nextSequence !== undefined && (obj.nextSequence = (message.nextSequence || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ProjectSequence { const message = createBaseProjectSequence(); - message.classKey = object.classKey !== undefined && object.classKey !== null ? Long.fromValue(object.classKey) : Long.UZERO; - message.nextSequence = object.nextSequence !== undefined && object.nextSequence !== null ? Long.fromValue(object.nextSequence) : Long.UZERO; + message.classKey = object.classKey !== undefined && object.classKey !== null ? BigInt(object.classKey.toString()) : BigInt(0); + message.nextSequence = object.nextSequence !== undefined && object.nextSequence !== null ? BigInt(object.nextSequence.toString()) : BigInt(0); return message; }, fromAmino(object: ProjectSequenceAmino): ProjectSequence { - return { - classKey: Long.fromString(object.class_key), - nextSequence: Long.fromString(object.next_sequence) - }; + const message = createBaseProjectSequence(); + if (object.class_key !== undefined && object.class_key !== null) { + message.classKey = BigInt(object.class_key); + } + if (object.next_sequence !== undefined && object.next_sequence !== null) { + message.nextSequence = BigInt(object.next_sequence); + } + return message; }, toAmino(message: ProjectSequence): ProjectSequenceAmino { const obj: any = {}; - obj.class_key = message.classKey ? message.classKey.toString() : undefined; - obj.next_sequence = message.nextSequence ? message.nextSequence.toString() : undefined; + obj.class_key = message.classKey !== BigInt(0) ? message.classKey.toString() : undefined; + obj.next_sequence = message.nextSequence !== BigInt(0) ? message.nextSequence.toString() : undefined; return obj; }, fromAminoMsg(object: ProjectSequenceAminoMsg): ProjectSequence { @@ -1698,32 +1767,33 @@ export const ProjectSequence = { }; function createBaseBatchSequence(): BatchSequence { return { - projectKey: Long.UZERO, - nextSequence: Long.UZERO + projectKey: BigInt(0), + nextSequence: BigInt(0) }; } export const BatchSequence = { - encode(message: BatchSequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.projectKey.isZero()) { + typeUrl: "/regen.ecocredit.v1.BatchSequence", + encode(message: BatchSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.projectKey !== BigInt(0)) { writer.uint32(8).uint64(message.projectKey); } - if (!message.nextSequence.isZero()) { + if (message.nextSequence !== BigInt(0)) { writer.uint32(16).uint64(message.nextSequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchSequence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchSequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchSequence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.projectKey = (reader.uint64() as Long); + message.projectKey = reader.uint64(); break; case 2: - message.nextSequence = (reader.uint64() as Long); + message.nextSequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1734,32 +1804,36 @@ export const BatchSequence = { }, fromJSON(object: any): BatchSequence { return { - projectKey: isSet(object.projectKey) ? Long.fromValue(object.projectKey) : Long.UZERO, - nextSequence: isSet(object.nextSequence) ? Long.fromValue(object.nextSequence) : Long.UZERO + projectKey: isSet(object.projectKey) ? BigInt(object.projectKey.toString()) : BigInt(0), + nextSequence: isSet(object.nextSequence) ? BigInt(object.nextSequence.toString()) : BigInt(0) }; }, toJSON(message: BatchSequence): unknown { const obj: any = {}; - message.projectKey !== undefined && (obj.projectKey = (message.projectKey || Long.UZERO).toString()); - message.nextSequence !== undefined && (obj.nextSequence = (message.nextSequence || Long.UZERO).toString()); + message.projectKey !== undefined && (obj.projectKey = (message.projectKey || BigInt(0)).toString()); + message.nextSequence !== undefined && (obj.nextSequence = (message.nextSequence || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): BatchSequence { const message = createBaseBatchSequence(); - message.projectKey = object.projectKey !== undefined && object.projectKey !== null ? Long.fromValue(object.projectKey) : Long.UZERO; - message.nextSequence = object.nextSequence !== undefined && object.nextSequence !== null ? Long.fromValue(object.nextSequence) : Long.UZERO; + message.projectKey = object.projectKey !== undefined && object.projectKey !== null ? BigInt(object.projectKey.toString()) : BigInt(0); + message.nextSequence = object.nextSequence !== undefined && object.nextSequence !== null ? BigInt(object.nextSequence.toString()) : BigInt(0); return message; }, fromAmino(object: BatchSequenceAmino): BatchSequence { - return { - projectKey: Long.fromString(object.project_key), - nextSequence: Long.fromString(object.next_sequence) - }; + const message = createBaseBatchSequence(); + if (object.project_key !== undefined && object.project_key !== null) { + message.projectKey = BigInt(object.project_key); + } + if (object.next_sequence !== undefined && object.next_sequence !== null) { + message.nextSequence = BigInt(object.next_sequence); + } + return message; }, toAmino(message: BatchSequence): BatchSequenceAmino { const obj: any = {}; - obj.project_key = message.projectKey ? message.projectKey.toString() : undefined; - obj.next_sequence = message.nextSequence ? message.nextSequence.toString() : undefined; + obj.project_key = message.projectKey !== BigInt(0) ? message.projectKey.toString() : undefined; + obj.next_sequence = message.nextSequence !== BigInt(0) ? message.nextSequence.toString() : undefined; return obj; }, fromAminoMsg(object: BatchSequenceAminoMsg): BatchSequence { @@ -1780,7 +1854,7 @@ export const BatchSequence = { }; function createBaseBatchBalance(): BatchBalance { return { - batchKey: Long.UZERO, + batchKey: BigInt(0), address: new Uint8Array(), tradableAmount: "", retiredAmount: "", @@ -1788,8 +1862,9 @@ function createBaseBatchBalance(): BatchBalance { }; } export const BatchBalance = { - encode(message: BatchBalance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.batchKey.isZero()) { + typeUrl: "/regen.ecocredit.v1.BatchBalance", + encode(message: BatchBalance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batchKey !== BigInt(0)) { writer.uint32(8).uint64(message.batchKey); } if (message.address.length !== 0) { @@ -1806,15 +1881,15 @@ export const BatchBalance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchBalance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchBalance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchBalance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.batchKey = (reader.uint64() as Long); + message.batchKey = reader.uint64(); break; case 2: message.address = reader.bytes(); @@ -1837,7 +1912,7 @@ export const BatchBalance = { }, fromJSON(object: any): BatchBalance { return { - batchKey: isSet(object.batchKey) ? Long.fromValue(object.batchKey) : Long.UZERO, + batchKey: isSet(object.batchKey) ? BigInt(object.batchKey.toString()) : BigInt(0), address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), tradableAmount: isSet(object.tradableAmount) ? String(object.tradableAmount) : "", retiredAmount: isSet(object.retiredAmount) ? String(object.retiredAmount) : "", @@ -1846,7 +1921,7 @@ export const BatchBalance = { }, toJSON(message: BatchBalance): unknown { const obj: any = {}; - message.batchKey !== undefined && (obj.batchKey = (message.batchKey || Long.UZERO).toString()); + message.batchKey !== undefined && (obj.batchKey = (message.batchKey || BigInt(0)).toString()); message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); message.tradableAmount !== undefined && (obj.tradableAmount = message.tradableAmount); message.retiredAmount !== undefined && (obj.retiredAmount = message.retiredAmount); @@ -1855,7 +1930,7 @@ export const BatchBalance = { }, fromPartial(object: Partial): BatchBalance { const message = createBaseBatchBalance(); - message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? Long.fromValue(object.batchKey) : Long.UZERO; + message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? BigInt(object.batchKey.toString()) : BigInt(0); message.address = object.address ?? new Uint8Array(); message.tradableAmount = object.tradableAmount ?? ""; message.retiredAmount = object.retiredAmount ?? ""; @@ -1863,21 +1938,31 @@ export const BatchBalance = { return message; }, fromAmino(object: BatchBalanceAmino): BatchBalance { - return { - batchKey: Long.fromString(object.batch_key), - address: object.address, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - escrowedAmount: object.escrowed_amount - }; + const message = createBaseBatchBalance(); + if (object.batch_key !== undefined && object.batch_key !== null) { + message.batchKey = BigInt(object.batch_key); + } + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.escrowed_amount !== undefined && object.escrowed_amount !== null) { + message.escrowedAmount = object.escrowed_amount; + } + return message; }, toAmino(message: BatchBalance): BatchBalanceAmino { const obj: any = {}; - obj.batch_key = message.batchKey ? message.batchKey.toString() : undefined; - obj.address = message.address; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.escrowed_amount = message.escrowedAmount; + obj.batch_key = message.batchKey !== BigInt(0) ? message.batchKey.toString() : undefined; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.escrowed_amount = message.escrowedAmount === "" ? undefined : message.escrowedAmount; return obj; }, fromAminoMsg(object: BatchBalanceAminoMsg): BatchBalance { @@ -1898,15 +1983,16 @@ export const BatchBalance = { }; function createBaseBatchSupply(): BatchSupply { return { - batchKey: Long.UZERO, + batchKey: BigInt(0), tradableAmount: "", retiredAmount: "", cancelledAmount: "" }; } export const BatchSupply = { - encode(message: BatchSupply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.batchKey.isZero()) { + typeUrl: "/regen.ecocredit.v1.BatchSupply", + encode(message: BatchSupply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batchKey !== BigInt(0)) { writer.uint32(8).uint64(message.batchKey); } if (message.tradableAmount !== "") { @@ -1920,15 +2006,15 @@ export const BatchSupply = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchSupply { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchSupply { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchSupply(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.batchKey = (reader.uint64() as Long); + message.batchKey = reader.uint64(); break; case 2: message.tradableAmount = reader.string(); @@ -1948,7 +2034,7 @@ export const BatchSupply = { }, fromJSON(object: any): BatchSupply { return { - batchKey: isSet(object.batchKey) ? Long.fromValue(object.batchKey) : Long.UZERO, + batchKey: isSet(object.batchKey) ? BigInt(object.batchKey.toString()) : BigInt(0), tradableAmount: isSet(object.tradableAmount) ? String(object.tradableAmount) : "", retiredAmount: isSet(object.retiredAmount) ? String(object.retiredAmount) : "", cancelledAmount: isSet(object.cancelledAmount) ? String(object.cancelledAmount) : "" @@ -1956,7 +2042,7 @@ export const BatchSupply = { }, toJSON(message: BatchSupply): unknown { const obj: any = {}; - message.batchKey !== undefined && (obj.batchKey = (message.batchKey || Long.UZERO).toString()); + message.batchKey !== undefined && (obj.batchKey = (message.batchKey || BigInt(0)).toString()); message.tradableAmount !== undefined && (obj.tradableAmount = message.tradableAmount); message.retiredAmount !== undefined && (obj.retiredAmount = message.retiredAmount); message.cancelledAmount !== undefined && (obj.cancelledAmount = message.cancelledAmount); @@ -1964,26 +2050,34 @@ export const BatchSupply = { }, fromPartial(object: Partial): BatchSupply { const message = createBaseBatchSupply(); - message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? Long.fromValue(object.batchKey) : Long.UZERO; + message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? BigInt(object.batchKey.toString()) : BigInt(0); message.tradableAmount = object.tradableAmount ?? ""; message.retiredAmount = object.retiredAmount ?? ""; message.cancelledAmount = object.cancelledAmount ?? ""; return message; }, fromAmino(object: BatchSupplyAmino): BatchSupply { - return { - batchKey: Long.fromString(object.batch_key), - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - cancelledAmount: object.cancelled_amount - }; + const message = createBaseBatchSupply(); + if (object.batch_key !== undefined && object.batch_key !== null) { + message.batchKey = BigInt(object.batch_key); + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.cancelled_amount !== undefined && object.cancelled_amount !== null) { + message.cancelledAmount = object.cancelled_amount; + } + return message; }, toAmino(message: BatchSupply): BatchSupplyAmino { const obj: any = {}; - obj.batch_key = message.batchKey ? message.batchKey.toString() : undefined; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.cancelled_amount = message.cancelledAmount; + obj.batch_key = message.batchKey !== BigInt(0) ? message.batchKey.toString() : undefined; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.cancelled_amount = message.cancelledAmount === "" ? undefined : message.cancelledAmount; return obj; }, fromAminoMsg(object: BatchSupplyAminoMsg): BatchSupply { @@ -2004,14 +2098,15 @@ export const BatchSupply = { }; function createBaseOriginTxIndex(): OriginTxIndex { return { - classKey: Long.UZERO, + classKey: BigInt(0), id: "", source: "" }; } export const OriginTxIndex = { - encode(message: OriginTxIndex, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.classKey.isZero()) { + typeUrl: "/regen.ecocredit.v1.OriginTxIndex", + encode(message: OriginTxIndex, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classKey !== BigInt(0)) { writer.uint32(8).uint64(message.classKey); } if (message.id !== "") { @@ -2022,15 +2117,15 @@ export const OriginTxIndex = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OriginTxIndex { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): OriginTxIndex { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOriginTxIndex(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.classKey = (reader.uint64() as Long); + message.classKey = reader.uint64(); break; case 2: message.id = reader.string(); @@ -2047,37 +2142,43 @@ export const OriginTxIndex = { }, fromJSON(object: any): OriginTxIndex { return { - classKey: isSet(object.classKey) ? Long.fromValue(object.classKey) : Long.UZERO, + classKey: isSet(object.classKey) ? BigInt(object.classKey.toString()) : BigInt(0), id: isSet(object.id) ? String(object.id) : "", source: isSet(object.source) ? String(object.source) : "" }; }, toJSON(message: OriginTxIndex): unknown { const obj: any = {}; - message.classKey !== undefined && (obj.classKey = (message.classKey || Long.UZERO).toString()); + message.classKey !== undefined && (obj.classKey = (message.classKey || BigInt(0)).toString()); message.id !== undefined && (obj.id = message.id); message.source !== undefined && (obj.source = message.source); return obj; }, fromPartial(object: Partial): OriginTxIndex { const message = createBaseOriginTxIndex(); - message.classKey = object.classKey !== undefined && object.classKey !== null ? Long.fromValue(object.classKey) : Long.UZERO; + message.classKey = object.classKey !== undefined && object.classKey !== null ? BigInt(object.classKey.toString()) : BigInt(0); message.id = object.id ?? ""; message.source = object.source ?? ""; return message; }, fromAmino(object: OriginTxIndexAmino): OriginTxIndex { - return { - classKey: Long.fromString(object.class_key), - id: object.id, - source: object.source - }; + const message = createBaseOriginTxIndex(); + if (object.class_key !== undefined && object.class_key !== null) { + message.classKey = BigInt(object.class_key); + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + return message; }, toAmino(message: OriginTxIndex): OriginTxIndexAmino { const obj: any = {}; - obj.class_key = message.classKey ? message.classKey.toString() : undefined; - obj.id = message.id; - obj.source = message.source; + obj.class_key = message.classKey !== BigInt(0) ? message.classKey.toString() : undefined; + obj.id = message.id === "" ? undefined : message.id; + obj.source = message.source === "" ? undefined : message.source; return obj; }, fromAminoMsg(object: OriginTxIndexAminoMsg): OriginTxIndex { @@ -2098,17 +2199,18 @@ export const OriginTxIndex = { }; function createBaseBatchContract(): BatchContract { return { - batchKey: Long.UZERO, - classKey: Long.UZERO, + batchKey: BigInt(0), + classKey: BigInt(0), contract: "" }; } export const BatchContract = { - encode(message: BatchContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.batchKey.isZero()) { + typeUrl: "/regen.ecocredit.v1.BatchContract", + encode(message: BatchContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.batchKey !== BigInt(0)) { writer.uint32(8).uint64(message.batchKey); } - if (!message.classKey.isZero()) { + if (message.classKey !== BigInt(0)) { writer.uint32(16).uint64(message.classKey); } if (message.contract !== "") { @@ -2116,18 +2218,18 @@ export const BatchContract = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchContract { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.batchKey = (reader.uint64() as Long); + message.batchKey = reader.uint64(); break; case 2: - message.classKey = (reader.uint64() as Long); + message.classKey = reader.uint64(); break; case 3: message.contract = reader.string(); @@ -2141,37 +2243,43 @@ export const BatchContract = { }, fromJSON(object: any): BatchContract { return { - batchKey: isSet(object.batchKey) ? Long.fromValue(object.batchKey) : Long.UZERO, - classKey: isSet(object.classKey) ? Long.fromValue(object.classKey) : Long.UZERO, + batchKey: isSet(object.batchKey) ? BigInt(object.batchKey.toString()) : BigInt(0), + classKey: isSet(object.classKey) ? BigInt(object.classKey.toString()) : BigInt(0), contract: isSet(object.contract) ? String(object.contract) : "" }; }, toJSON(message: BatchContract): unknown { const obj: any = {}; - message.batchKey !== undefined && (obj.batchKey = (message.batchKey || Long.UZERO).toString()); - message.classKey !== undefined && (obj.classKey = (message.classKey || Long.UZERO).toString()); + message.batchKey !== undefined && (obj.batchKey = (message.batchKey || BigInt(0)).toString()); + message.classKey !== undefined && (obj.classKey = (message.classKey || BigInt(0)).toString()); message.contract !== undefined && (obj.contract = message.contract); return obj; }, fromPartial(object: Partial): BatchContract { const message = createBaseBatchContract(); - message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? Long.fromValue(object.batchKey) : Long.UZERO; - message.classKey = object.classKey !== undefined && object.classKey !== null ? Long.fromValue(object.classKey) : Long.UZERO; + message.batchKey = object.batchKey !== undefined && object.batchKey !== null ? BigInt(object.batchKey.toString()) : BigInt(0); + message.classKey = object.classKey !== undefined && object.classKey !== null ? BigInt(object.classKey.toString()) : BigInt(0); message.contract = object.contract ?? ""; return message; }, fromAmino(object: BatchContractAmino): BatchContract { - return { - batchKey: Long.fromString(object.batch_key), - classKey: Long.fromString(object.class_key), - contract: object.contract - }; + const message = createBaseBatchContract(); + if (object.batch_key !== undefined && object.batch_key !== null) { + message.batchKey = BigInt(object.batch_key); + } + if (object.class_key !== undefined && object.class_key !== null) { + message.classKey = BigInt(object.class_key); + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; }, toAmino(message: BatchContract): BatchContractAmino { const obj: any = {}; - obj.batch_key = message.batchKey ? message.batchKey.toString() : undefined; - obj.class_key = message.classKey ? message.classKey.toString() : undefined; - obj.contract = message.contract; + obj.batch_key = message.batchKey !== BigInt(0) ? message.batchKey.toString() : undefined; + obj.class_key = message.classKey !== BigInt(0) ? message.classKey.toString() : undefined; + obj.contract = message.contract === "" ? undefined : message.contract; return obj; }, fromAminoMsg(object: BatchContractAminoMsg): BatchContract { @@ -2196,14 +2304,15 @@ function createBaseClassCreatorAllowlist(): ClassCreatorAllowlist { }; } export const ClassCreatorAllowlist = { - encode(message: ClassCreatorAllowlist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.ClassCreatorAllowlist", + encode(message: ClassCreatorAllowlist, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.enabled === true) { writer.uint32(8).bool(message.enabled); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClassCreatorAllowlist { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClassCreatorAllowlist { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClassCreatorAllowlist(); while (reader.pos < end) { @@ -2235,13 +2344,15 @@ export const ClassCreatorAllowlist = { return message; }, fromAmino(object: ClassCreatorAllowlistAmino): ClassCreatorAllowlist { - return { - enabled: object.enabled - }; + const message = createBaseClassCreatorAllowlist(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: ClassCreatorAllowlist): ClassCreatorAllowlistAmino { const obj: any = {}; - obj.enabled = message.enabled; + obj.enabled = message.enabled === false ? undefined : message.enabled; return obj; }, fromAminoMsg(object: ClassCreatorAllowlistAminoMsg): ClassCreatorAllowlist { @@ -2266,14 +2377,15 @@ function createBaseAllowedClassCreator(): AllowedClassCreator { }; } export const AllowedClassCreator = { - encode(message: AllowedClassCreator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.AllowedClassCreator", + encode(message: AllowedClassCreator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowedClassCreator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowedClassCreator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowedClassCreator(); while (reader.pos < end) { @@ -2305,13 +2417,15 @@ export const AllowedClassCreator = { return message; }, fromAmino(object: AllowedClassCreatorAmino): AllowedClassCreator { - return { - address: object.address - }; + const message = createBaseAllowedClassCreator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + return message; }, toAmino(message: AllowedClassCreator): AllowedClassCreatorAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address ? base64FromBytes(message.address) : undefined; return obj; }, fromAminoMsg(object: AllowedClassCreatorAminoMsg): AllowedClassCreator { @@ -2336,14 +2450,15 @@ function createBaseClassFee(): ClassFee { }; } export const ClassFee = { - encode(message: ClassFee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.ClassFee", + encode(message: ClassFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Coin.encode(message.fee, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClassFee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClassFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClassFee(); while (reader.pos < end) { @@ -2375,9 +2490,11 @@ export const ClassFee = { return message; }, fromAmino(object: ClassFeeAmino): ClassFee { - return { - fee: object?.fee ? Coin.fromAmino(object.fee) : undefined - }; + const message = createBaseClassFee(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; }, toAmino(message: ClassFee): ClassFeeAmino { const obj: any = {}; @@ -2406,14 +2523,15 @@ function createBaseAllowedBridgeChain(): AllowedBridgeChain { }; } export const AllowedBridgeChain = { - encode(message: AllowedBridgeChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.AllowedBridgeChain", + encode(message: AllowedBridgeChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainName !== "") { writer.uint32(10).string(message.chainName); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowedBridgeChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowedBridgeChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowedBridgeChain(); while (reader.pos < end) { @@ -2445,13 +2563,15 @@ export const AllowedBridgeChain = { return message; }, fromAmino(object: AllowedBridgeChainAmino): AllowedBridgeChain { - return { - chainName: object.chain_name - }; + const message = createBaseAllowedBridgeChain(); + if (object.chain_name !== undefined && object.chain_name !== null) { + message.chainName = object.chain_name; + } + return message; }, toAmino(message: AllowedBridgeChain): AllowedBridgeChainAmino { const obj: any = {}; - obj.chain_name = message.chainName; + obj.chain_name = message.chainName === "" ? undefined : message.chainName; return obj; }, fromAminoMsg(object: AllowedBridgeChainAminoMsg): AllowedBridgeChain { diff --git a/packages/api/src/codegen/regen/ecocredit/v1/tx.rpc.msg.ts b/packages/api/src/codegen/regen/ecocredit/v1/tx.rpc.msg.ts index 6b93b421..e97311dd 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgCreateClass, MsgCreateClassResponse, MsgCreateProject, MsgCreateProjectResponse, MsgCreateBatch, MsgCreateBatchResponse, MsgMintBatchCredits, MsgMintBatchCreditsResponse, MsgSealBatch, MsgSealBatchResponse, MsgSend, MsgSendResponse, MsgRetire, MsgRetireResponse, MsgCancel, MsgCancelResponse, MsgUpdateClassAdmin, MsgUpdateClassAdminResponse, MsgUpdateClassIssuers, MsgUpdateClassIssuersResponse, MsgUpdateClassMetadata, MsgUpdateClassMetadataResponse, MsgUpdateProjectAdmin, MsgUpdateProjectAdminResponse, MsgUpdateProjectMetadata, MsgUpdateProjectMetadataResponse, MsgUpdateBatchMetadata, MsgUpdateBatchMetadataResponse, MsgBridge, MsgBridgeResponse, MsgBridgeReceive, MsgBridgeReceiveResponse, MsgAddCreditType, MsgAddCreditTypeResponse, MsgSetClassCreatorAllowlist, MsgSetClassCreatorAllowlistResponse, MsgAddClassCreator, MsgAddClassCreatorResponse, MsgRemoveClassCreator, MsgRemoveClassCreatorResponse, MsgUpdateClassFee, MsgUpdateClassFeeResponse, MsgAddAllowedBridgeChain, MsgAddAllowedBridgeChainResponse, MsgRemoveAllowedBridgeChain, MsgRemoveAllowedBridgeChainResponse } from "./tx"; /** Msg is the regen.ecocredit.v1 Msg service. */ export interface Msg { @@ -205,116 +205,116 @@ export class MsgClientImpl implements Msg { createClass(request: MsgCreateClass): Promise { const data = MsgCreateClass.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "CreateClass", data); - return promise.then(data => MsgCreateClassResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateClassResponse.decode(new BinaryReader(data))); } createProject(request: MsgCreateProject): Promise { const data = MsgCreateProject.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "CreateProject", data); - return promise.then(data => MsgCreateProjectResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateProjectResponse.decode(new BinaryReader(data))); } createBatch(request: MsgCreateBatch): Promise { const data = MsgCreateBatch.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "CreateBatch", data); - return promise.then(data => MsgCreateBatchResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateBatchResponse.decode(new BinaryReader(data))); } mintBatchCredits(request: MsgMintBatchCredits): Promise { const data = MsgMintBatchCredits.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "MintBatchCredits", data); - return promise.then(data => MsgMintBatchCreditsResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgMintBatchCreditsResponse.decode(new BinaryReader(data))); } sealBatch(request: MsgSealBatch): Promise { const data = MsgSealBatch.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "SealBatch", data); - return promise.then(data => MsgSealBatchResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSealBatchResponse.decode(new BinaryReader(data))); } send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "Send", data); - return promise.then(data => MsgSendResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSendResponse.decode(new BinaryReader(data))); } retire(request: MsgRetire): Promise { const data = MsgRetire.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "Retire", data); - return promise.then(data => MsgRetireResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRetireResponse.decode(new BinaryReader(data))); } cancel(request: MsgCancel): Promise { const data = MsgCancel.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "Cancel", data); - return promise.then(data => MsgCancelResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCancelResponse.decode(new BinaryReader(data))); } updateClassAdmin(request: MsgUpdateClassAdmin): Promise { const data = MsgUpdateClassAdmin.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "UpdateClassAdmin", data); - return promise.then(data => MsgUpdateClassAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClassAdminResponse.decode(new BinaryReader(data))); } updateClassIssuers(request: MsgUpdateClassIssuers): Promise { const data = MsgUpdateClassIssuers.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "UpdateClassIssuers", data); - return promise.then(data => MsgUpdateClassIssuersResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClassIssuersResponse.decode(new BinaryReader(data))); } updateClassMetadata(request: MsgUpdateClassMetadata): Promise { const data = MsgUpdateClassMetadata.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "UpdateClassMetadata", data); - return promise.then(data => MsgUpdateClassMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClassMetadataResponse.decode(new BinaryReader(data))); } updateProjectAdmin(request: MsgUpdateProjectAdmin): Promise { const data = MsgUpdateProjectAdmin.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "UpdateProjectAdmin", data); - return promise.then(data => MsgUpdateProjectAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateProjectAdminResponse.decode(new BinaryReader(data))); } updateProjectMetadata(request: MsgUpdateProjectMetadata): Promise { const data = MsgUpdateProjectMetadata.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "UpdateProjectMetadata", data); - return promise.then(data => MsgUpdateProjectMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateProjectMetadataResponse.decode(new BinaryReader(data))); } updateBatchMetadata(request: MsgUpdateBatchMetadata): Promise { const data = MsgUpdateBatchMetadata.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "UpdateBatchMetadata", data); - return promise.then(data => MsgUpdateBatchMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateBatchMetadataResponse.decode(new BinaryReader(data))); } bridge(request: MsgBridge): Promise { const data = MsgBridge.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "Bridge", data); - return promise.then(data => MsgBridgeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgBridgeResponse.decode(new BinaryReader(data))); } bridgeReceive(request: MsgBridgeReceive): Promise { const data = MsgBridgeReceive.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "BridgeReceive", data); - return promise.then(data => MsgBridgeReceiveResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgBridgeReceiveResponse.decode(new BinaryReader(data))); } addCreditType(request: MsgAddCreditType): Promise { const data = MsgAddCreditType.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "AddCreditType", data); - return promise.then(data => MsgAddCreditTypeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgAddCreditTypeResponse.decode(new BinaryReader(data))); } setClassCreatorAllowlist(request: MsgSetClassCreatorAllowlist): Promise { const data = MsgSetClassCreatorAllowlist.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "SetClassCreatorAllowlist", data); - return promise.then(data => MsgSetClassCreatorAllowlistResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSetClassCreatorAllowlistResponse.decode(new BinaryReader(data))); } addClassCreator(request: MsgAddClassCreator): Promise { const data = MsgAddClassCreator.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "AddClassCreator", data); - return promise.then(data => MsgAddClassCreatorResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgAddClassCreatorResponse.decode(new BinaryReader(data))); } removeClassCreator(request: MsgRemoveClassCreator): Promise { const data = MsgRemoveClassCreator.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "RemoveClassCreator", data); - return promise.then(data => MsgRemoveClassCreatorResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRemoveClassCreatorResponse.decode(new BinaryReader(data))); } updateClassFee(request: MsgUpdateClassFee): Promise { const data = MsgUpdateClassFee.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "UpdateClassFee", data); - return promise.then(data => MsgUpdateClassFeeResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClassFeeResponse.decode(new BinaryReader(data))); } addAllowedBridgeChain(request: MsgAddAllowedBridgeChain): Promise { const data = MsgAddAllowedBridgeChain.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "AddAllowedBridgeChain", data); - return promise.then(data => MsgAddAllowedBridgeChainResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgAddAllowedBridgeChainResponse.decode(new BinaryReader(data))); } removeAllowedBridgeChain(request: MsgRemoveAllowedBridgeChain): Promise { const data = MsgRemoveAllowedBridgeChain.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1.Msg", "RemoveAllowedBridgeChain", data); - return promise.then(data => MsgRemoveAllowedBridgeChainResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRemoveAllowedBridgeChainResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/regen/ecocredit/v1/tx.ts b/packages/api/src/codegen/regen/ecocredit/v1/tx.ts index 88d1e15b..5721b2bc 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/tx.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/tx.ts @@ -1,8 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BatchIssuance, BatchIssuanceAmino, BatchIssuanceSDKType, OriginTx, OriginTxAmino, OriginTxSDKType, Credits, CreditsAmino, CreditsSDKType } from "./types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { CreditType, CreditTypeAmino, CreditTypeSDKType } from "./state"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** * MsgAddCreditType is the Msg/AddCreditType request type. @@ -13,7 +13,7 @@ export interface MsgAddCreditType { /** authority is the address of the governance account. */ authority: string; /** credit_type defines a credit type to add to the credit types parameter. */ - creditType: CreditType; + creditType?: CreditType; } export interface MsgAddCreditTypeProtoMsg { typeUrl: "/regen.ecocredit.v1.MsgAddCreditType"; @@ -26,7 +26,7 @@ export interface MsgAddCreditTypeProtoMsg { */ export interface MsgAddCreditTypeAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** credit_type defines a credit type to add to the credit types parameter. */ credit_type?: CreditTypeAmino; } @@ -41,7 +41,7 @@ export interface MsgAddCreditTypeAminoMsg { */ export interface MsgAddCreditTypeSDKType { authority: string; - credit_type: CreditTypeSDKType; + credit_type?: CreditTypeSDKType; } /** * MsgAddCreditTypeResponse is the Msg/AddCreditType response type. @@ -99,7 +99,7 @@ export interface MsgCreateClass { * creation fee parameter is set. The provided fee can be greater than the * parameter, but only the amount in the parameter will be charged. */ - fee: Coin; + fee?: Coin; } export interface MsgCreateClassProtoMsg { typeUrl: "/regen.ecocredit.v1.MsgCreateClass"; @@ -114,22 +114,22 @@ export interface MsgCreateClassAmino { * the list of approved issuers. If Params.allowlist_enabled is set to true, * this address must be included in Params.allowed_class_creators. */ - admin: string; + admin?: string; /** * issuers are the addresses of the accounts that will have permissions within * the credit class to create projects and issue credits. */ - issuers: string[]; + issuers?: string[]; /** * metadata is any arbitrary string with a maximum length of 256 characters * that includes or references metadata to attach to the credit class. */ - metadata: string; + metadata?: string; /** * credit_type_abbrev is the abbreviation of the credit type under which the * credit class will be created (e.g. "C", "BIO"). */ - credit_type_abbrev: string; + credit_type_abbrev?: string; /** * fee is the credit class creation fee. An equal fee is required if the class * creation fee parameter is set. The provided fee can be greater than the @@ -147,7 +147,7 @@ export interface MsgCreateClassSDKType { issuers: string[]; metadata: string; credit_type_abbrev: string; - fee: CoinSDKType; + fee?: CoinSDKType; } /** MsgCreateClassResponse is the Msg/CreateClass response type. */ export interface MsgCreateClassResponse { @@ -161,7 +161,7 @@ export interface MsgCreateClassResponseProtoMsg { /** MsgCreateClassResponse is the Msg/CreateClass response type. */ export interface MsgCreateClassResponseAmino { /** class_id is the unique identifier of the credit class. */ - class_id: string; + class_id?: string; } export interface MsgCreateClassResponseAminoMsg { type: "/regen.ecocredit.v1.MsgCreateClassResponse"; @@ -220,17 +220,17 @@ export interface MsgCreateProjectAmino { * created. The admin will have permissions to update the project including * the ability to reassign the admin role to another account. */ - admin: string; + admin?: string; /** * class_id is the unique identifier of the credit class under which the * project will be created. */ - class_id: string; + class_id?: string; /** * metadata is any arbitrary string with a maximum length of 256 characters * that includes or references metadata to attach to the project. */ - metadata: string; + metadata?: string; /** * jurisdiction is the jurisdiction of the project. A jurisdiction has with * the format: [-[ ]] @@ -240,12 +240,12 @@ export interface MsgCreateProjectAmino { * sub-national-code and postal-code are optional and can be added for * increased precision. */ - jurisdiction: string; + jurisdiction?: string; /** * reference_id is any arbitrary string used to reference the project with a * maximum length of 32 characters. */ - reference_id: string; + reference_id?: string; } export interface MsgCreateProjectAminoMsg { type: "regen/MsgCreateProject"; @@ -271,7 +271,7 @@ export interface MsgCreateProjectResponseProtoMsg { /** MsgCreateProjectResponse is the Msg/CreateProject response type. */ export interface MsgCreateProjectResponseAmino { /** project_id is the unique identifier of the project. */ - project_id: string; + project_id?: string; } export interface MsgCreateProjectResponseAminoMsg { type: "/regen.ecocredit.v1.MsgCreateProjectResponse"; @@ -308,12 +308,12 @@ export interface MsgCreateBatch { * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - startDate: Timestamp; + startDate?: Timestamp; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - endDate: Timestamp; + endDate?: Timestamp; /** * open determines whether or not the credits can be dynamically minted to the * credit batch following the creation of the credit batch. This field should @@ -327,7 +327,7 @@ export interface MsgCreateBatch { * issuing credits and should only be set when bridging assets from another * chain or registry as a result of a bridge operation. */ - originTx: OriginTx; + originTx?: OriginTx; } export interface MsgCreateBatchProtoMsg { typeUrl: "/regen.ecocredit.v1.MsgCreateBatch"; @@ -339,40 +339,40 @@ export interface MsgCreateBatchAmino { * issuer is the address of the account issuing the credits and must be an * approved issuer within the credit class of the project. */ - issuer: string; + issuer?: string; /** * project_id is the unique identifier of the project under which the credit * batch will be created. */ - project_id: string; + project_id?: string; /** * issuance specifies the amount of tradable and retired credits that will be * issued to each recipient and the jurisdiction in which the credits will be * retired if credits are to be retired upon receipt. */ - issuance: BatchIssuanceAmino[]; + issuance?: BatchIssuanceAmino[]; /** * metadata is any arbitrary string with a maximum length of 256 characters * that includes or references metadata to attach to the credit batch. */ - metadata: string; + metadata?: string; /** * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - start_date?: TimestampAmino; + start_date?: string; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - end_date?: TimestampAmino; + end_date?: string; /** * open determines whether or not the credits can be dynamically minted to the * credit batch following the creation of the credit batch. This field should * only be set to true when bridging credits from another chain or registry as * a result of a bridge operation and is not intended for native issuance. */ - open: boolean; + open?: boolean; /** * origin_tx is the transaction from another chain or registry that triggered * the creation of the credit batch. This field can be ignored when natively @@ -391,10 +391,10 @@ export interface MsgCreateBatchSDKType { project_id: string; issuance: BatchIssuanceSDKType[]; metadata: string; - start_date: TimestampSDKType; - end_date: TimestampSDKType; + start_date?: TimestampSDKType; + end_date?: TimestampSDKType; open: boolean; - origin_tx: OriginTxSDKType; + origin_tx?: OriginTxSDKType; } /** MsgCreateBatchResponse is the Msg/CreateBatch response type. */ export interface MsgCreateBatchResponse { @@ -408,7 +408,7 @@ export interface MsgCreateBatchResponseProtoMsg { /** MsgCreateBatchResponse is the Msg/CreateBatch response type. */ export interface MsgCreateBatchResponseAmino { /** batch_denom is the unique identifier of the credit batch. */ - batch_denom: string; + batch_denom?: string; } export interface MsgCreateBatchResponseAminoMsg { type: "/regen.ecocredit.v1.MsgCreateBatchResponse"; @@ -437,7 +437,7 @@ export interface MsgMintBatchCredits { * origin_tx is the transaction from another chain or registry that triggered * the minting of credits. */ - originTx: OriginTx; + originTx?: OriginTx; } export interface MsgMintBatchCreditsProtoMsg { typeUrl: "/regen.ecocredit.v1.MsgMintBatchCredits"; @@ -449,15 +449,15 @@ export interface MsgMintBatchCreditsAmino { * issuer is the address of the account minting the credits and must be the * same issuer who created the credit batch. */ - issuer: string; + issuer?: string; /** batch_denom is the unique identifier of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** * issuance specifies the amount of tradable and retired credits that will be * issued to each recipient and the jurisdiction in which the credits will be * retired if credits are to be retired upon receipt. */ - issuance: BatchIssuanceAmino[]; + issuance?: BatchIssuanceAmino[]; /** * origin_tx is the transaction from another chain or registry that triggered * the minting of credits. @@ -473,7 +473,7 @@ export interface MsgMintBatchCreditsSDKType { issuer: string; batch_denom: string; issuance: BatchIssuanceSDKType[]; - origin_tx: OriginTxSDKType; + origin_tx?: OriginTxSDKType; } /** MsgMintBatchCreditsResponse is the Msg/MintBatchCredits response type. */ export interface MsgMintBatchCreditsResponse {} @@ -509,9 +509,9 @@ export interface MsgSealBatchAmino { * issuer is the address of the account that created the credit batch and the * only account with permissions to seal the credit batch. */ - issuer: string; + issuer?: string; /** batch_denom is the unique identifier of the credit batch. */ - batch_denom: string; + batch_denom?: string; } export interface MsgSealBatchAminoMsg { type: "regen/MsgSealBatch"; @@ -552,11 +552,11 @@ export interface MsgSendProtoMsg { /** MsgSend is the Msg/Send request type. */ export interface MsgSendAmino { /** sender is the address of the account sending credits. */ - sender: string; + sender?: string; /** recipient is the address of the account receiving credits. */ - recipient: string; + recipient?: string; /** credits are the credits being sent to the recipient. */ - credits: MsgSend_SendCreditsAmino[]; + credits?: MsgSend_SendCreditsAmino[]; } export interface MsgSendAminoMsg { type: "regen/MsgSend"; @@ -618,19 +618,19 @@ export interface MsgSend_SendCreditsProtoMsg { */ export interface MsgSend_SendCreditsAmino { /** batch_denom is the unique identifier of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** * tradable_amount is the amount of credits in this transfer that can be * traded by the recipient. The number of decimal places must be less than * or equal to the credit type precision. */ - tradable_amount: string; + tradable_amount?: string; /** * retired_amount is the amount of credits in this transfer that are retired * upon receipt. The number of decimal places must be less than or equal to * the credit type precision. */ - retired_amount: string; + retired_amount?: string; /** * retirement_jurisdiction is the jurisdiction of the recipient and is only * required if retired_amount is positive. A jurisdiction has the format: @@ -640,7 +640,7 @@ export interface MsgSend_SendCreditsAmino { * country-code is required, while the sub-national-code and postal-code are * optional and can be added for increased precision. */ - retirement_jurisdiction: string; + retirement_jurisdiction?: string; /** * retirement_reason is any arbitrary string that specifies the reason for * retiring credits. This field is only required if retired_amount is @@ -648,7 +648,7 @@ export interface MsgSend_SendCreditsAmino { * * Since Revision 2 */ - retirement_reason: string; + retirement_reason?: string; } export interface MsgSend_SendCreditsAminoMsg { type: "/regen.ecocredit.v1.SendCredits"; @@ -711,9 +711,9 @@ export interface MsgRetireProtoMsg { /** MsgRetire is the Msg/Retire request type. */ export interface MsgRetireAmino { /** owner is the address of the account that owns the credits being retired. */ - owner: string; + owner?: string; /** credits specifies a credit batch and the number of credits being retired. */ - credits: CreditsAmino[]; + credits?: CreditsAmino[]; /** * jurisdiction is the jurisdiction of the credit owner. A jurisdiction has * the format: [-[ ]] @@ -723,14 +723,14 @@ export interface MsgRetireAmino { * sub-national-code and postal-code are optional and can be added for * increased precision. */ - jurisdiction: string; + jurisdiction?: string; /** * reason is any arbitrary string that specifies the reason for retiring * credits. * * Since Revision 2 */ - reason: string; + reason?: string; } export interface MsgRetireAminoMsg { type: "regen/MsgRetire"; @@ -776,14 +776,14 @@ export interface MsgCancelProtoMsg { /** MsgCancel is the Msg/Cancel request type. */ export interface MsgCancelAmino { /** owner is the address of the account that owns the credits being cancelled. */ - owner: string; + owner?: string; /** credits specifies a credit batch and the number of credits being cancelled. */ - credits: CreditsAmino[]; + credits?: CreditsAmino[]; /** * reason is any arbitrary string that specifies the reason for cancelling * credits. */ - reason: string; + reason?: string; } export interface MsgCancelAminoMsg { type: "regen/MsgCancel"; @@ -834,14 +834,14 @@ export interface MsgUpdateClassAdminAmino { * admin is the address of the account that is currently the admin of the * credit class. */ - admin: string; + admin?: string; /** class_id is the unique identifier of the credit class. */ - class_id: string; + class_id?: string; /** * new_admin is the address of the account that will become the new admin of * the credit class. */ - new_admin: string; + new_admin?: string; } export interface MsgUpdateClassAdminAminoMsg { type: "regen/MsgUpdateClassAdmin"; @@ -891,19 +891,19 @@ export interface MsgUpdateClassIssuersProtoMsg { /** MsgUpdateClassIssuers is the Msg/UpdateClassIssuers request type. */ export interface MsgUpdateClassIssuersAmino { /** admin is the address of the account that is the admin of the credit class. */ - admin: string; + admin?: string; /** class_id is the unique identifier of the credit class. */ - class_id: string; + class_id?: string; /** * add_issuers are the addresses of the accounts that will be added to the * list of approved credit class issuers. */ - add_issuers: string[]; + add_issuers?: string[]; /** * remove_issuers are the addresses of the accounts that will be removed from * the list of approved credit class issuers. */ - remove_issuers: string[]; + remove_issuers?: string[]; } export interface MsgUpdateClassIssuersAminoMsg { type: "regen/MsgUpdateClassIssuers"; @@ -950,15 +950,15 @@ export interface MsgUpdateClassMetadataProtoMsg { /** MsgUpdateClassMetadata is the Msg/UpdateClassMetadata request type. */ export interface MsgUpdateClassMetadataAmino { /** admin is the address of the account that is the admin of the credit class. */ - admin: string; + admin?: string; /** class_id is the unique identifier of the credit class. */ - class_id: string; + class_id?: string; /** * new_metadata is new metadata that will replace the existing metadata. It * can be any arbitrary string with a maximum length of 256 characters that * includes or references the metadata to attach to the credit class. */ - new_metadata: string; + new_metadata?: string; } export interface MsgUpdateClassMetadataAminoMsg { type: "regen/MsgUpdateClassMetadata"; @@ -1009,14 +1009,14 @@ export interface MsgUpdateProjectAdminAmino { * admin is the address of the account that is the currently the admin of the * project. */ - admin: string; + admin?: string; /** project_id is the unique identifier of the project. */ - project_id: string; + project_id?: string; /** * new_admin is the address of the account that will become the new admin of * the project. */ - new_admin: string; + new_admin?: string; } export interface MsgUpdateProjectAdminAminoMsg { type: "regen/MsgUpdateProjectAdmin"; @@ -1062,15 +1062,15 @@ export interface MsgUpdateProjectMetadataProtoMsg { /** MsgUpdateProjectMetadata is the Msg/UpdateProjectMetadata request type. */ export interface MsgUpdateProjectMetadataAmino { /** admin is the address of the account that is the admin of the project. */ - admin: string; + admin?: string; /** project_id is the unique identifier of the project. */ - project_id: string; + project_id?: string; /** * new_metadata is new metadata that will replace the existing metadata. It * can be any arbitrary string with a maximum length of 256 characters that * includes or references the metadata to attach to the project. */ - new_metadata: string; + new_metadata?: string; } export interface MsgUpdateProjectMetadataAminoMsg { type: "regen/MsgUpdateProjectMetadata"; @@ -1123,13 +1123,13 @@ export interface MsgBridgeProtoMsg { /** MsgBridge is the Msg/Bridge request type. */ export interface MsgBridgeAmino { /** owner is the address of the account that owns the credits being bridged. */ - owner: string; + owner?: string; /** target is the name of the target chain or registry. */ - target: string; + target?: string; /** recipient is the address of the account receiving the bridged credits. */ - recipient: string; + recipient?: string; /** credits specifies a credit batch and the number of credits being bridged. */ - credits: CreditsAmino[]; + credits?: CreditsAmino[]; } export interface MsgBridgeAminoMsg { type: "regen/MsgBridge"; @@ -1170,15 +1170,15 @@ export interface MsgUpdateBatchMetadataProtoMsg { */ export interface MsgUpdateBatchMetadataAmino { /** issuer is the address of the account that is the issuer of the batch. */ - issuer: string; + issuer?: string; /** batch_denom is the unique identifier of the batch. */ - batch_denom: string; + batch_denom?: string; /** * new_metadata is new metadata that will replace the existing metadata. It * can be any arbitrary string with a maximum length of 256 characters that * includes or references the metadata to attach to the batch. */ - new_metadata: string; + new_metadata?: string; } export interface MsgUpdateBatchMetadataAminoMsg { type: "regen/MsgUpdateBatchMetadata"; @@ -1247,14 +1247,14 @@ export interface MsgBridgeReceive { */ classId: string; /** project defines the project information for the bridged credits. */ - project: MsgBridgeReceive_Project; + project?: MsgBridgeReceive_Project; /** batch defines the credit batch information for the bridged credits. */ - batch: MsgBridgeReceive_Batch; + batch?: MsgBridgeReceive_Batch; /** * origin_tx is a reference to a transaction which caused the transfer from * another chain or registry. */ - originTx: OriginTx; + originTx?: OriginTx; } export interface MsgBridgeReceiveProtoMsg { typeUrl: "/regen.ecocredit.v1.MsgBridgeReceive"; @@ -1263,12 +1263,12 @@ export interface MsgBridgeReceiveProtoMsg { /** MsgBridgeReceive is the Msg/BridgeReceive request type. */ export interface MsgBridgeReceiveAmino { /** issuer is the account address of the service bridging the credits. */ - issuer: string; + issuer?: string; /** * class_id is the unique identifier of the credit class within which the * project and credit batch already exist or will be created. */ - class_id: string; + class_id?: string; /** project defines the project information for the bridged credits. */ project?: MsgBridgeReceive_ProjectAmino; /** batch defines the credit batch information for the bridged credits. */ @@ -1287,9 +1287,9 @@ export interface MsgBridgeReceiveAminoMsg { export interface MsgBridgeReceiveSDKType { issuer: string; class_id: string; - project: MsgBridgeReceive_ProjectSDKType; - batch: MsgBridgeReceive_BatchSDKType; - origin_tx: OriginTxSDKType; + project?: MsgBridgeReceive_ProjectSDKType; + batch?: MsgBridgeReceive_BatchSDKType; + origin_tx?: OriginTxSDKType; } /** * Batch defines the credit batch information for the bridged credits. This @@ -1305,12 +1305,12 @@ export interface MsgBridgeReceive_Batch { * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - startDate: Timestamp; + startDate?: Timestamp; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - endDate: Timestamp; + endDate?: Timestamp; /** metadata is the metadata for the credit batch. */ metadata: string; } @@ -1325,21 +1325,21 @@ export interface MsgBridgeReceive_BatchProtoMsg { */ export interface MsgBridgeReceive_BatchAmino { /** recipient is the recipient of the bridged credits. */ - recipient: string; + recipient?: string; /** amount is the amount of credits being bridged. */ - amount: string; + amount?: string; /** * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - start_date?: TimestampAmino; + start_date?: string; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - end_date?: TimestampAmino; + end_date?: string; /** metadata is the metadata for the credit batch. */ - metadata: string; + metadata?: string; } export interface MsgBridgeReceive_BatchAminoMsg { type: "/regen.ecocredit.v1.Batch"; @@ -1353,8 +1353,8 @@ export interface MsgBridgeReceive_BatchAminoMsg { export interface MsgBridgeReceive_BatchSDKType { recipient: string; amount: string; - start_date: TimestampSDKType; - end_date: TimestampSDKType; + start_date?: TimestampSDKType; + end_date?: TimestampSDKType; metadata: string; } /** @@ -1381,11 +1381,11 @@ export interface MsgBridgeReceive_ProjectProtoMsg { */ export interface MsgBridgeReceive_ProjectAmino { /** reference_id is the reference id of the project. */ - reference_id: string; + reference_id?: string; /** jurisdiction is the project jurisdiction. */ - jurisdiction: string; + jurisdiction?: string; /** metadata is the metadata for the project. */ - metadata: string; + metadata?: string; } export interface MsgBridgeReceive_ProjectAminoMsg { type: "/regen.ecocredit.v1.Project"; @@ -1424,12 +1424,12 @@ export interface MsgBridgeReceiveResponseAmino { * batch_denom is the unique identifier of the credit batch either created * or within which the credits were dynamically minted. */ - batch_denom: string; + batch_denom?: string; /** * project_id is the unique identifier of the project that was either created * or the existing project within which the credit batch exists. */ - project_id: string; + project_id?: string; } export interface MsgBridgeReceiveResponseAminoMsg { type: "/regen.ecocredit.v1.MsgBridgeReceiveResponse"; @@ -1462,9 +1462,9 @@ export interface MsgAddClassCreatorProtoMsg { */ export interface MsgAddClassCreatorAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** creator is the address to add to the class creator list. */ - creator: string; + creator?: string; } export interface MsgAddClassCreatorAminoMsg { type: "regen/MsgAddClassCreator"; @@ -1529,9 +1529,9 @@ export interface MsgSetClassCreatorAllowlistProtoMsg { */ export interface MsgSetClassCreatorAllowlistAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** enabled defines the boolean value to set the allowlist on or off. */ - enabled: boolean; + enabled?: boolean; } export interface MsgSetClassCreatorAllowlistAminoMsg { type: "regen/MsgSetClassCreatorAllowlist"; @@ -1598,9 +1598,9 @@ export interface MsgRemoveClassCreatorProtoMsg { */ export interface MsgRemoveClassCreatorAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** creator is the address to remove from the class creator list. */ - creator: string; + creator?: string; } export interface MsgRemoveClassCreatorAminoMsg { type: "regen/MsgRemoveClassCreator"; @@ -1653,7 +1653,7 @@ export interface MsgUpdateClassFee { * fee is the credit class creation fee. If not set, the credit class creation * fee will be removed and no fee will be required to create a credit class. */ - fee: Coin; + fee?: Coin; } export interface MsgUpdateClassFeeProtoMsg { typeUrl: "/regen.ecocredit.v1.MsgUpdateClassFee"; @@ -1666,7 +1666,7 @@ export interface MsgUpdateClassFeeProtoMsg { */ export interface MsgUpdateClassFeeAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** * fee is the credit class creation fee. If not set, the credit class creation * fee will be removed and no fee will be required to create a credit class. @@ -1684,7 +1684,7 @@ export interface MsgUpdateClassFeeAminoMsg { */ export interface MsgUpdateClassFeeSDKType { authority: string; - fee: CoinSDKType; + fee?: CoinSDKType; } /** * MsgUpdateClassFeeResponse is the Msg/UpdateClassFee response type. @@ -1737,12 +1737,12 @@ export interface MsgAddAllowedBridgeChainProtoMsg { */ export interface MsgAddAllowedBridgeChainAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** * chain_name is the name of the chain to allow bridging of ecocredits to * (i.e. polygon, ethereum, celo). */ - chain_name: string; + chain_name?: string; } export interface MsgAddAllowedBridgeChainAminoMsg { type: "regen/MsgAddAllowedBridgeChain"; @@ -1811,12 +1811,12 @@ export interface MsgRemoveAllowedBridgeChainProtoMsg { */ export interface MsgRemoveAllowedBridgeChainAmino { /** authority is the address of the governance account. */ - authority: string; + authority?: string; /** * chain_name is the name of the chain to remove from the list of allowed * chains to bridge ecocredits to (i.e. polygon, ethereum, celo). */ - chain_name: string; + chain_name?: string; } export interface MsgRemoveAllowedBridgeChainAminoMsg { type: "regen/MsgRemoveAllowedBridgeChain"; @@ -1863,11 +1863,12 @@ export interface MsgRemoveAllowedBridgeChainResponseSDKType {} function createBaseMsgAddCreditType(): MsgAddCreditType { return { authority: "", - creditType: CreditType.fromPartial({}) + creditType: undefined }; } export const MsgAddCreditType = { - encode(message: MsgAddCreditType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgAddCreditType", + encode(message: MsgAddCreditType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1876,8 +1877,8 @@ export const MsgAddCreditType = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddCreditType { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCreditType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddCreditType(); while (reader.pos < end) { @@ -1915,14 +1916,18 @@ export const MsgAddCreditType = { return message; }, fromAmino(object: MsgAddCreditTypeAmino): MsgAddCreditType { - return { - authority: object.authority, - creditType: object?.credit_type ? CreditType.fromAmino(object.credit_type) : undefined - }; + const message = createBaseMsgAddCreditType(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.credit_type !== undefined && object.credit_type !== null) { + message.creditType = CreditType.fromAmino(object.credit_type); + } + return message; }, toAmino(message: MsgAddCreditType): MsgAddCreditTypeAmino { const obj: any = {}; - obj.authority = message.authority; + obj.authority = message.authority === "" ? undefined : message.authority; obj.credit_type = message.creditType ? CreditType.toAmino(message.creditType) : undefined; return obj; }, @@ -1952,11 +1957,12 @@ function createBaseMsgAddCreditTypeResponse(): MsgAddCreditTypeResponse { return {}; } export const MsgAddCreditTypeResponse = { - encode(_: MsgAddCreditTypeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgAddCreditTypeResponse", + encode(_: MsgAddCreditTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddCreditTypeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCreditTypeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddCreditTypeResponse(); while (reader.pos < end) { @@ -1981,7 +1987,8 @@ export const MsgAddCreditTypeResponse = { return message; }, fromAmino(_: MsgAddCreditTypeResponseAmino): MsgAddCreditTypeResponse { - return {}; + const message = createBaseMsgAddCreditTypeResponse(); + return message; }, toAmino(_: MsgAddCreditTypeResponse): MsgAddCreditTypeResponseAmino { const obj: any = {}; @@ -2013,7 +2020,8 @@ function createBaseMsgCreateClass(): MsgCreateClass { }; } export const MsgCreateClass = { - encode(message: MsgCreateClass, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCreateClass", + encode(message: MsgCreateClass, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -2031,8 +2039,8 @@ export const MsgCreateClass = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClass { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClass { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClass(); while (reader.pos < end) { @@ -2092,24 +2100,32 @@ export const MsgCreateClass = { return message; }, fromAmino(object: MsgCreateClassAmino): MsgCreateClass { - return { - admin: object.admin, - issuers: Array.isArray(object?.issuers) ? object.issuers.map((e: any) => e) : [], - metadata: object.metadata, - creditTypeAbbrev: object.credit_type_abbrev, - fee: object?.fee ? Coin.fromAmino(object.fee) : undefined - }; + const message = createBaseMsgCreateClass(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.issuers = object.issuers?.map(e => e) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.credit_type_abbrev !== undefined && object.credit_type_abbrev !== null) { + message.creditTypeAbbrev = object.credit_type_abbrev; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; }, toAmino(message: MsgCreateClass): MsgCreateClassAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; if (message.issuers) { obj.issuers = message.issuers.map(e => e); } else { - obj.issuers = []; + obj.issuers = message.issuers; } - obj.metadata = message.metadata; - obj.credit_type_abbrev = message.creditTypeAbbrev; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.credit_type_abbrev = message.creditTypeAbbrev === "" ? undefined : message.creditTypeAbbrev; obj.fee = message.fee ? Coin.toAmino(message.fee) : undefined; return obj; }, @@ -2141,14 +2157,15 @@ function createBaseMsgCreateClassResponse(): MsgCreateClassResponse { }; } export const MsgCreateClassResponse = { - encode(message: MsgCreateClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCreateClassResponse", + encode(message: MsgCreateClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClassResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClassResponse(); while (reader.pos < end) { @@ -2180,13 +2197,15 @@ export const MsgCreateClassResponse = { return message; }, fromAmino(object: MsgCreateClassResponseAmino): MsgCreateClassResponse { - return { - classId: object.class_id - }; + const message = createBaseMsgCreateClassResponse(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: MsgCreateClassResponse): MsgCreateClassResponseAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: MsgCreateClassResponseAminoMsg): MsgCreateClassResponse { @@ -2215,7 +2234,8 @@ function createBaseMsgCreateProject(): MsgCreateProject { }; } export const MsgCreateProject = { - encode(message: MsgCreateProject, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCreateProject", + encode(message: MsgCreateProject, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -2233,8 +2253,8 @@ export const MsgCreateProject = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateProject { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateProject { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateProject(); while (reader.pos < end) { @@ -2290,21 +2310,31 @@ export const MsgCreateProject = { return message; }, fromAmino(object: MsgCreateProjectAmino): MsgCreateProject { - return { - admin: object.admin, - classId: object.class_id, - metadata: object.metadata, - jurisdiction: object.jurisdiction, - referenceId: object.reference_id - }; + const message = createBaseMsgCreateProject(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.jurisdiction !== undefined && object.jurisdiction !== null) { + message.jurisdiction = object.jurisdiction; + } + if (object.reference_id !== undefined && object.reference_id !== null) { + message.referenceId = object.reference_id; + } + return message; }, toAmino(message: MsgCreateProject): MsgCreateProjectAmino { const obj: any = {}; - obj.admin = message.admin; - obj.class_id = message.classId; - obj.metadata = message.metadata; - obj.jurisdiction = message.jurisdiction; - obj.reference_id = message.referenceId; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.jurisdiction = message.jurisdiction === "" ? undefined : message.jurisdiction; + obj.reference_id = message.referenceId === "" ? undefined : message.referenceId; return obj; }, fromAminoMsg(object: MsgCreateProjectAminoMsg): MsgCreateProject { @@ -2335,14 +2365,15 @@ function createBaseMsgCreateProjectResponse(): MsgCreateProjectResponse { }; } export const MsgCreateProjectResponse = { - encode(message: MsgCreateProjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCreateProjectResponse", + encode(message: MsgCreateProjectResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.projectId !== "") { writer.uint32(10).string(message.projectId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateProjectResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateProjectResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateProjectResponse(); while (reader.pos < end) { @@ -2374,13 +2405,15 @@ export const MsgCreateProjectResponse = { return message; }, fromAmino(object: MsgCreateProjectResponseAmino): MsgCreateProjectResponse { - return { - projectId: object.project_id - }; + const message = createBaseMsgCreateProjectResponse(); + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + return message; }, toAmino(message: MsgCreateProjectResponse): MsgCreateProjectResponseAmino { const obj: any = {}; - obj.project_id = message.projectId; + obj.project_id = message.projectId === "" ? undefined : message.projectId; return obj; }, fromAminoMsg(object: MsgCreateProjectResponseAminoMsg): MsgCreateProjectResponse { @@ -2408,11 +2441,12 @@ function createBaseMsgCreateBatch(): MsgCreateBatch { startDate: undefined, endDate: undefined, open: false, - originTx: OriginTx.fromPartial({}) + originTx: undefined }; } export const MsgCreateBatch = { - encode(message: MsgCreateBatch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCreateBatch", + encode(message: MsgCreateBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -2439,8 +2473,8 @@ export const MsgCreateBatch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBatch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateBatch(); while (reader.pos < end) { @@ -2518,30 +2552,44 @@ export const MsgCreateBatch = { return message; }, fromAmino(object: MsgCreateBatchAmino): MsgCreateBatch { - return { - issuer: object.issuer, - projectId: object.project_id, - issuance: Array.isArray(object?.issuance) ? object.issuance.map((e: any) => BatchIssuance.fromAmino(e)) : [], - metadata: object.metadata, - startDate: object?.start_date ? Timestamp.fromAmino(object.start_date) : undefined, - endDate: object?.end_date ? Timestamp.fromAmino(object.end_date) : undefined, - open: object.open, - originTx: object?.origin_tx ? OriginTx.fromAmino(object.origin_tx) : undefined - }; + const message = createBaseMsgCreateBatch(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + message.issuance = object.issuance?.map(e => BatchIssuance.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.start_date !== undefined && object.start_date !== null) { + message.startDate = Timestamp.fromAmino(object.start_date); + } + if (object.end_date !== undefined && object.end_date !== null) { + message.endDate = Timestamp.fromAmino(object.end_date); + } + if (object.open !== undefined && object.open !== null) { + message.open = object.open; + } + if (object.origin_tx !== undefined && object.origin_tx !== null) { + message.originTx = OriginTx.fromAmino(object.origin_tx); + } + return message; }, toAmino(message: MsgCreateBatch): MsgCreateBatchAmino { const obj: any = {}; - obj.issuer = message.issuer; - obj.project_id = message.projectId; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.project_id = message.projectId === "" ? undefined : message.projectId; if (message.issuance) { obj.issuance = message.issuance.map(e => e ? BatchIssuance.toAmino(e) : undefined); } else { - obj.issuance = []; + obj.issuance = message.issuance; } - obj.metadata = message.metadata; + obj.metadata = message.metadata === "" ? undefined : message.metadata; obj.start_date = message.startDate ? Timestamp.toAmino(message.startDate) : undefined; obj.end_date = message.endDate ? Timestamp.toAmino(message.endDate) : undefined; - obj.open = message.open; + obj.open = message.open === false ? undefined : message.open; obj.origin_tx = message.originTx ? OriginTx.toAmino(message.originTx) : undefined; return obj; }, @@ -2573,14 +2621,15 @@ function createBaseMsgCreateBatchResponse(): MsgCreateBatchResponse { }; } export const MsgCreateBatchResponse = { - encode(message: MsgCreateBatchResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCreateBatchResponse", + encode(message: MsgCreateBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBatchResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateBatchResponse(); while (reader.pos < end) { @@ -2612,13 +2661,15 @@ export const MsgCreateBatchResponse = { return message; }, fromAmino(object: MsgCreateBatchResponseAmino): MsgCreateBatchResponse { - return { - batchDenom: object.batch_denom - }; + const message = createBaseMsgCreateBatchResponse(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: MsgCreateBatchResponse): MsgCreateBatchResponseAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: MsgCreateBatchResponseAminoMsg): MsgCreateBatchResponse { @@ -2642,11 +2693,12 @@ function createBaseMsgMintBatchCredits(): MsgMintBatchCredits { issuer: "", batchDenom: "", issuance: [], - originTx: OriginTx.fromPartial({}) + originTx: undefined }; } export const MsgMintBatchCredits = { - encode(message: MsgMintBatchCredits, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgMintBatchCredits", + encode(message: MsgMintBatchCredits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -2661,8 +2713,8 @@ export const MsgMintBatchCredits = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMintBatchCredits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMintBatchCredits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMintBatchCredits(); while (reader.pos < end) { @@ -2716,21 +2768,27 @@ export const MsgMintBatchCredits = { return message; }, fromAmino(object: MsgMintBatchCreditsAmino): MsgMintBatchCredits { - return { - issuer: object.issuer, - batchDenom: object.batch_denom, - issuance: Array.isArray(object?.issuance) ? object.issuance.map((e: any) => BatchIssuance.fromAmino(e)) : [], - originTx: object?.origin_tx ? OriginTx.fromAmino(object.origin_tx) : undefined - }; + const message = createBaseMsgMintBatchCredits(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + message.issuance = object.issuance?.map(e => BatchIssuance.fromAmino(e)) || []; + if (object.origin_tx !== undefined && object.origin_tx !== null) { + message.originTx = OriginTx.fromAmino(object.origin_tx); + } + return message; }, toAmino(message: MsgMintBatchCredits): MsgMintBatchCreditsAmino { const obj: any = {}; - obj.issuer = message.issuer; - obj.batch_denom = message.batchDenom; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; if (message.issuance) { obj.issuance = message.issuance.map(e => e ? BatchIssuance.toAmino(e) : undefined); } else { - obj.issuance = []; + obj.issuance = message.issuance; } obj.origin_tx = message.originTx ? OriginTx.toAmino(message.originTx) : undefined; return obj; @@ -2761,11 +2819,12 @@ function createBaseMsgMintBatchCreditsResponse(): MsgMintBatchCreditsResponse { return {}; } export const MsgMintBatchCreditsResponse = { - encode(_: MsgMintBatchCreditsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgMintBatchCreditsResponse", + encode(_: MsgMintBatchCreditsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMintBatchCreditsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMintBatchCreditsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMintBatchCreditsResponse(); while (reader.pos < end) { @@ -2790,7 +2849,8 @@ export const MsgMintBatchCreditsResponse = { return message; }, fromAmino(_: MsgMintBatchCreditsResponseAmino): MsgMintBatchCreditsResponse { - return {}; + const message = createBaseMsgMintBatchCreditsResponse(); + return message; }, toAmino(_: MsgMintBatchCreditsResponse): MsgMintBatchCreditsResponseAmino { const obj: any = {}; @@ -2819,7 +2879,8 @@ function createBaseMsgSealBatch(): MsgSealBatch { }; } export const MsgSealBatch = { - encode(message: MsgSealBatch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgSealBatch", + encode(message: MsgSealBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -2828,8 +2889,8 @@ export const MsgSealBatch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSealBatch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSealBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSealBatch(); while (reader.pos < end) { @@ -2867,15 +2928,19 @@ export const MsgSealBatch = { return message; }, fromAmino(object: MsgSealBatchAmino): MsgSealBatch { - return { - issuer: object.issuer, - batchDenom: object.batch_denom - }; + const message = createBaseMsgSealBatch(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: MsgSealBatch): MsgSealBatchAmino { const obj: any = {}; - obj.issuer = message.issuer; - obj.batch_denom = message.batchDenom; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: MsgSealBatchAminoMsg): MsgSealBatch { @@ -2904,11 +2969,12 @@ function createBaseMsgSealBatchResponse(): MsgSealBatchResponse { return {}; } export const MsgSealBatchResponse = { - encode(_: MsgSealBatchResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgSealBatchResponse", + encode(_: MsgSealBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSealBatchResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSealBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSealBatchResponse(); while (reader.pos < end) { @@ -2933,7 +2999,8 @@ export const MsgSealBatchResponse = { return message; }, fromAmino(_: MsgSealBatchResponseAmino): MsgSealBatchResponse { - return {}; + const message = createBaseMsgSealBatchResponse(); + return message; }, toAmino(_: MsgSealBatchResponse): MsgSealBatchResponseAmino { const obj: any = {}; @@ -2963,7 +3030,8 @@ function createBaseMsgSend(): MsgSend { }; } export const MsgSend = { - encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgSend", + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -2975,8 +3043,8 @@ export const MsgSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend(); while (reader.pos < end) { @@ -3024,20 +3092,24 @@ export const MsgSend = { return message; }, fromAmino(object: MsgSendAmino): MsgSend { - return { - sender: object.sender, - recipient: object.recipient, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => MsgSend_SendCredits.fromAmino(e)) : [] - }; + const message = createBaseMsgSend(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.credits = object.credits?.map(e => MsgSend_SendCredits.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSend): MsgSendAmino { const obj: any = {}; - obj.sender = message.sender; - obj.recipient = message.recipient; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.recipient = message.recipient === "" ? undefined : message.recipient; if (message.credits) { obj.credits = message.credits.map(e => e ? MsgSend_SendCredits.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } return obj; }, @@ -3073,7 +3145,8 @@ function createBaseMsgSend_SendCredits(): MsgSend_SendCredits { }; } export const MsgSend_SendCredits = { - encode(message: MsgSend_SendCredits, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.SendCredits", + encode(message: MsgSend_SendCredits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -3091,8 +3164,8 @@ export const MsgSend_SendCredits = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend_SendCredits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend_SendCredits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend_SendCredits(); while (reader.pos < end) { @@ -3148,21 +3221,31 @@ export const MsgSend_SendCredits = { return message; }, fromAmino(object: MsgSend_SendCreditsAmino): MsgSend_SendCredits { - return { - batchDenom: object.batch_denom, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - retirementJurisdiction: object.retirement_jurisdiction, - retirementReason: object.retirement_reason - }; + const message = createBaseMsgSend_SendCredits(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.retirement_jurisdiction !== undefined && object.retirement_jurisdiction !== null) { + message.retirementJurisdiction = object.retirement_jurisdiction; + } + if (object.retirement_reason !== undefined && object.retirement_reason !== null) { + message.retirementReason = object.retirement_reason; + } + return message; }, toAmino(message: MsgSend_SendCredits): MsgSend_SendCreditsAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.retirement_jurisdiction = message.retirementJurisdiction; - obj.retirement_reason = message.retirementReason; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.retirement_jurisdiction = message.retirementJurisdiction === "" ? undefined : message.retirementJurisdiction; + obj.retirement_reason = message.retirementReason === "" ? undefined : message.retirementReason; return obj; }, fromAminoMsg(object: MsgSend_SendCreditsAminoMsg): MsgSend_SendCredits { @@ -3185,11 +3268,12 @@ function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgSendResponse", + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendResponse(); while (reader.pos < end) { @@ -3214,7 +3298,8 @@ export const MsgSendResponse = { return message; }, fromAmino(_: MsgSendResponseAmino): MsgSendResponse { - return {}; + const message = createBaseMsgSendResponse(); + return message; }, toAmino(_: MsgSendResponse): MsgSendResponseAmino { const obj: any = {}; @@ -3245,7 +3330,8 @@ function createBaseMsgRetire(): MsgRetire { }; } export const MsgRetire = { - encode(message: MsgRetire, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgRetire", + encode(message: MsgRetire, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -3260,8 +3346,8 @@ export const MsgRetire = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRetire { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRetire { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRetire(); while (reader.pos < end) { @@ -3315,23 +3401,29 @@ export const MsgRetire = { return message; }, fromAmino(object: MsgRetireAmino): MsgRetire { - return { - owner: object.owner, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => Credits.fromAmino(e)) : [], - jurisdiction: object.jurisdiction, - reason: object.reason - }; + const message = createBaseMsgRetire(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.credits = object.credits?.map(e => Credits.fromAmino(e)) || []; + if (object.jurisdiction !== undefined && object.jurisdiction !== null) { + message.jurisdiction = object.jurisdiction; + } + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + return message; }, toAmino(message: MsgRetire): MsgRetireAmino { const obj: any = {}; - obj.owner = message.owner; + obj.owner = message.owner === "" ? undefined : message.owner; if (message.credits) { obj.credits = message.credits.map(e => e ? Credits.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } - obj.jurisdiction = message.jurisdiction; - obj.reason = message.reason; + obj.jurisdiction = message.jurisdiction === "" ? undefined : message.jurisdiction; + obj.reason = message.reason === "" ? undefined : message.reason; return obj; }, fromAminoMsg(object: MsgRetireAminoMsg): MsgRetire { @@ -3360,11 +3452,12 @@ function createBaseMsgRetireResponse(): MsgRetireResponse { return {}; } export const MsgRetireResponse = { - encode(_: MsgRetireResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgRetireResponse", + encode(_: MsgRetireResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRetireResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRetireResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRetireResponse(); while (reader.pos < end) { @@ -3389,7 +3482,8 @@ export const MsgRetireResponse = { return message; }, fromAmino(_: MsgRetireResponseAmino): MsgRetireResponse { - return {}; + const message = createBaseMsgRetireResponse(); + return message; }, toAmino(_: MsgRetireResponse): MsgRetireResponseAmino { const obj: any = {}; @@ -3419,7 +3513,8 @@ function createBaseMsgCancel(): MsgCancel { }; } export const MsgCancel = { - encode(message: MsgCancel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCancel", + encode(message: MsgCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -3431,8 +3526,8 @@ export const MsgCancel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancel(); while (reader.pos < end) { @@ -3480,21 +3575,25 @@ export const MsgCancel = { return message; }, fromAmino(object: MsgCancelAmino): MsgCancel { - return { - owner: object.owner, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => Credits.fromAmino(e)) : [], - reason: object.reason - }; + const message = createBaseMsgCancel(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.credits = object.credits?.map(e => Credits.fromAmino(e)) || []; + if (object.reason !== undefined && object.reason !== null) { + message.reason = object.reason; + } + return message; }, toAmino(message: MsgCancel): MsgCancelAmino { const obj: any = {}; - obj.owner = message.owner; + obj.owner = message.owner === "" ? undefined : message.owner; if (message.credits) { obj.credits = message.credits.map(e => e ? Credits.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } - obj.reason = message.reason; + obj.reason = message.reason === "" ? undefined : message.reason; return obj; }, fromAminoMsg(object: MsgCancelAminoMsg): MsgCancel { @@ -3523,11 +3622,12 @@ function createBaseMsgCancelResponse(): MsgCancelResponse { return {}; } export const MsgCancelResponse = { - encode(_: MsgCancelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgCancelResponse", + encode(_: MsgCancelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelResponse(); while (reader.pos < end) { @@ -3552,7 +3652,8 @@ export const MsgCancelResponse = { return message; }, fromAmino(_: MsgCancelResponseAmino): MsgCancelResponse { - return {}; + const message = createBaseMsgCancelResponse(); + return message; }, toAmino(_: MsgCancelResponse): MsgCancelResponseAmino { const obj: any = {}; @@ -3582,7 +3683,8 @@ function createBaseMsgUpdateClassAdmin(): MsgUpdateClassAdmin { }; } export const MsgUpdateClassAdmin = { - encode(message: MsgUpdateClassAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassAdmin", + encode(message: MsgUpdateClassAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -3594,8 +3696,8 @@ export const MsgUpdateClassAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassAdmin(); while (reader.pos < end) { @@ -3639,17 +3741,23 @@ export const MsgUpdateClassAdmin = { return message; }, fromAmino(object: MsgUpdateClassAdminAmino): MsgUpdateClassAdmin { - return { - admin: object.admin, - classId: object.class_id, - newAdmin: object.new_admin - }; + const message = createBaseMsgUpdateClassAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; }, toAmino(message: MsgUpdateClassAdmin): MsgUpdateClassAdminAmino { const obj: any = {}; - obj.admin = message.admin; - obj.class_id = message.classId; - obj.new_admin = message.newAdmin; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; return obj; }, fromAminoMsg(object: MsgUpdateClassAdminAminoMsg): MsgUpdateClassAdmin { @@ -3678,11 +3786,12 @@ function createBaseMsgUpdateClassAdminResponse(): MsgUpdateClassAdminResponse { return {}; } export const MsgUpdateClassAdminResponse = { - encode(_: MsgUpdateClassAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassAdminResponse", + encode(_: MsgUpdateClassAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassAdminResponse(); while (reader.pos < end) { @@ -3707,7 +3816,8 @@ export const MsgUpdateClassAdminResponse = { return message; }, fromAmino(_: MsgUpdateClassAdminResponseAmino): MsgUpdateClassAdminResponse { - return {}; + const message = createBaseMsgUpdateClassAdminResponse(); + return message; }, toAmino(_: MsgUpdateClassAdminResponse): MsgUpdateClassAdminResponseAmino { const obj: any = {}; @@ -3738,7 +3848,8 @@ function createBaseMsgUpdateClassIssuers(): MsgUpdateClassIssuers { }; } export const MsgUpdateClassIssuers = { - encode(message: MsgUpdateClassIssuers, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassIssuers", + encode(message: MsgUpdateClassIssuers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -3753,8 +3864,8 @@ export const MsgUpdateClassIssuers = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassIssuers { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassIssuers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassIssuers(); while (reader.pos < end) { @@ -3812,26 +3923,30 @@ export const MsgUpdateClassIssuers = { return message; }, fromAmino(object: MsgUpdateClassIssuersAmino): MsgUpdateClassIssuers { - return { - admin: object.admin, - classId: object.class_id, - addIssuers: Array.isArray(object?.add_issuers) ? object.add_issuers.map((e: any) => e) : [], - removeIssuers: Array.isArray(object?.remove_issuers) ? object.remove_issuers.map((e: any) => e) : [] - }; + const message = createBaseMsgUpdateClassIssuers(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + message.addIssuers = object.add_issuers?.map(e => e) || []; + message.removeIssuers = object.remove_issuers?.map(e => e) || []; + return message; }, toAmino(message: MsgUpdateClassIssuers): MsgUpdateClassIssuersAmino { const obj: any = {}; - obj.admin = message.admin; - obj.class_id = message.classId; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; if (message.addIssuers) { obj.add_issuers = message.addIssuers.map(e => e); } else { - obj.add_issuers = []; + obj.add_issuers = message.addIssuers; } if (message.removeIssuers) { obj.remove_issuers = message.removeIssuers.map(e => e); } else { - obj.remove_issuers = []; + obj.remove_issuers = message.removeIssuers; } return obj; }, @@ -3861,11 +3976,12 @@ function createBaseMsgUpdateClassIssuersResponse(): MsgUpdateClassIssuersRespons return {}; } export const MsgUpdateClassIssuersResponse = { - encode(_: MsgUpdateClassIssuersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassIssuersResponse", + encode(_: MsgUpdateClassIssuersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassIssuersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassIssuersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassIssuersResponse(); while (reader.pos < end) { @@ -3890,7 +4006,8 @@ export const MsgUpdateClassIssuersResponse = { return message; }, fromAmino(_: MsgUpdateClassIssuersResponseAmino): MsgUpdateClassIssuersResponse { - return {}; + const message = createBaseMsgUpdateClassIssuersResponse(); + return message; }, toAmino(_: MsgUpdateClassIssuersResponse): MsgUpdateClassIssuersResponseAmino { const obj: any = {}; @@ -3920,7 +4037,8 @@ function createBaseMsgUpdateClassMetadata(): MsgUpdateClassMetadata { }; } export const MsgUpdateClassMetadata = { - encode(message: MsgUpdateClassMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassMetadata", + encode(message: MsgUpdateClassMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -3932,8 +4050,8 @@ export const MsgUpdateClassMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassMetadata(); while (reader.pos < end) { @@ -3977,17 +4095,23 @@ export const MsgUpdateClassMetadata = { return message; }, fromAmino(object: MsgUpdateClassMetadataAmino): MsgUpdateClassMetadata { - return { - admin: object.admin, - classId: object.class_id, - newMetadata: object.new_metadata - }; + const message = createBaseMsgUpdateClassMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.new_metadata !== undefined && object.new_metadata !== null) { + message.newMetadata = object.new_metadata; + } + return message; }, toAmino(message: MsgUpdateClassMetadata): MsgUpdateClassMetadataAmino { const obj: any = {}; - obj.admin = message.admin; - obj.class_id = message.classId; - obj.new_metadata = message.newMetadata; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.new_metadata = message.newMetadata === "" ? undefined : message.newMetadata; return obj; }, fromAminoMsg(object: MsgUpdateClassMetadataAminoMsg): MsgUpdateClassMetadata { @@ -4016,11 +4140,12 @@ function createBaseMsgUpdateClassMetadataResponse(): MsgUpdateClassMetadataRespo return {}; } export const MsgUpdateClassMetadataResponse = { - encode(_: MsgUpdateClassMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassMetadataResponse", + encode(_: MsgUpdateClassMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassMetadataResponse(); while (reader.pos < end) { @@ -4045,7 +4170,8 @@ export const MsgUpdateClassMetadataResponse = { return message; }, fromAmino(_: MsgUpdateClassMetadataResponseAmino): MsgUpdateClassMetadataResponse { - return {}; + const message = createBaseMsgUpdateClassMetadataResponse(); + return message; }, toAmino(_: MsgUpdateClassMetadataResponse): MsgUpdateClassMetadataResponseAmino { const obj: any = {}; @@ -4075,7 +4201,8 @@ function createBaseMsgUpdateProjectAdmin(): MsgUpdateProjectAdmin { }; } export const MsgUpdateProjectAdmin = { - encode(message: MsgUpdateProjectAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateProjectAdmin", + encode(message: MsgUpdateProjectAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -4087,8 +4214,8 @@ export const MsgUpdateProjectAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateProjectAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateProjectAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateProjectAdmin(); while (reader.pos < end) { @@ -4132,17 +4259,23 @@ export const MsgUpdateProjectAdmin = { return message; }, fromAmino(object: MsgUpdateProjectAdminAmino): MsgUpdateProjectAdmin { - return { - admin: object.admin, - projectId: object.project_id, - newAdmin: object.new_admin - }; + const message = createBaseMsgUpdateProjectAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; }, toAmino(message: MsgUpdateProjectAdmin): MsgUpdateProjectAdminAmino { const obj: any = {}; - obj.admin = message.admin; - obj.project_id = message.projectId; - obj.new_admin = message.newAdmin; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.project_id = message.projectId === "" ? undefined : message.projectId; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; return obj; }, fromAminoMsg(object: MsgUpdateProjectAdminAminoMsg): MsgUpdateProjectAdmin { @@ -4171,11 +4304,12 @@ function createBaseMsgUpdateProjectAdminResponse(): MsgUpdateProjectAdminRespons return {}; } export const MsgUpdateProjectAdminResponse = { - encode(_: MsgUpdateProjectAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateProjectAdminResponse", + encode(_: MsgUpdateProjectAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateProjectAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateProjectAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateProjectAdminResponse(); while (reader.pos < end) { @@ -4200,7 +4334,8 @@ export const MsgUpdateProjectAdminResponse = { return message; }, fromAmino(_: MsgUpdateProjectAdminResponseAmino): MsgUpdateProjectAdminResponse { - return {}; + const message = createBaseMsgUpdateProjectAdminResponse(); + return message; }, toAmino(_: MsgUpdateProjectAdminResponse): MsgUpdateProjectAdminResponseAmino { const obj: any = {}; @@ -4230,7 +4365,8 @@ function createBaseMsgUpdateProjectMetadata(): MsgUpdateProjectMetadata { }; } export const MsgUpdateProjectMetadata = { - encode(message: MsgUpdateProjectMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateProjectMetadata", + encode(message: MsgUpdateProjectMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -4242,8 +4378,8 @@ export const MsgUpdateProjectMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateProjectMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateProjectMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateProjectMetadata(); while (reader.pos < end) { @@ -4287,17 +4423,23 @@ export const MsgUpdateProjectMetadata = { return message; }, fromAmino(object: MsgUpdateProjectMetadataAmino): MsgUpdateProjectMetadata { - return { - admin: object.admin, - projectId: object.project_id, - newMetadata: object.new_metadata - }; + const message = createBaseMsgUpdateProjectMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + if (object.new_metadata !== undefined && object.new_metadata !== null) { + message.newMetadata = object.new_metadata; + } + return message; }, toAmino(message: MsgUpdateProjectMetadata): MsgUpdateProjectMetadataAmino { const obj: any = {}; - obj.admin = message.admin; - obj.project_id = message.projectId; - obj.new_metadata = message.newMetadata; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.project_id = message.projectId === "" ? undefined : message.projectId; + obj.new_metadata = message.newMetadata === "" ? undefined : message.newMetadata; return obj; }, fromAminoMsg(object: MsgUpdateProjectMetadataAminoMsg): MsgUpdateProjectMetadata { @@ -4326,11 +4468,12 @@ function createBaseMsgUpdateProjectMetadataResponse(): MsgUpdateProjectMetadataR return {}; } export const MsgUpdateProjectMetadataResponse = { - encode(_: MsgUpdateProjectMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateProjectMetadataResponse", + encode(_: MsgUpdateProjectMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateProjectMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateProjectMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateProjectMetadataResponse(); while (reader.pos < end) { @@ -4355,7 +4498,8 @@ export const MsgUpdateProjectMetadataResponse = { return message; }, fromAmino(_: MsgUpdateProjectMetadataResponseAmino): MsgUpdateProjectMetadataResponse { - return {}; + const message = createBaseMsgUpdateProjectMetadataResponse(); + return message; }, toAmino(_: MsgUpdateProjectMetadataResponse): MsgUpdateProjectMetadataResponseAmino { const obj: any = {}; @@ -4386,7 +4530,8 @@ function createBaseMsgBridge(): MsgBridge { }; } export const MsgBridge = { - encode(message: MsgBridge, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgBridge", + encode(message: MsgBridge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -4401,8 +4546,8 @@ export const MsgBridge = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBridge { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBridge { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBridge(); while (reader.pos < end) { @@ -4456,22 +4601,28 @@ export const MsgBridge = { return message; }, fromAmino(object: MsgBridgeAmino): MsgBridge { - return { - owner: object.owner, - target: object.target, - recipient: object.recipient, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => Credits.fromAmino(e)) : [] - }; + const message = createBaseMsgBridge(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.target !== undefined && object.target !== null) { + message.target = object.target; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.credits = object.credits?.map(e => Credits.fromAmino(e)) || []; + return message; }, toAmino(message: MsgBridge): MsgBridgeAmino { const obj: any = {}; - obj.owner = message.owner; - obj.target = message.target; - obj.recipient = message.recipient; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.target = message.target === "" ? undefined : message.target; + obj.recipient = message.recipient === "" ? undefined : message.recipient; if (message.credits) { obj.credits = message.credits.map(e => e ? Credits.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } return obj; }, @@ -4505,7 +4656,8 @@ function createBaseMsgUpdateBatchMetadata(): MsgUpdateBatchMetadata { }; } export const MsgUpdateBatchMetadata = { - encode(message: MsgUpdateBatchMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateBatchMetadata", + encode(message: MsgUpdateBatchMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -4517,8 +4669,8 @@ export const MsgUpdateBatchMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateBatchMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateBatchMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateBatchMetadata(); while (reader.pos < end) { @@ -4562,17 +4714,23 @@ export const MsgUpdateBatchMetadata = { return message; }, fromAmino(object: MsgUpdateBatchMetadataAmino): MsgUpdateBatchMetadata { - return { - issuer: object.issuer, - batchDenom: object.batch_denom, - newMetadata: object.new_metadata - }; + const message = createBaseMsgUpdateBatchMetadata(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.new_metadata !== undefined && object.new_metadata !== null) { + message.newMetadata = object.new_metadata; + } + return message; }, toAmino(message: MsgUpdateBatchMetadata): MsgUpdateBatchMetadataAmino { const obj: any = {}; - obj.issuer = message.issuer; - obj.batch_denom = message.batchDenom; - obj.new_metadata = message.newMetadata; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.new_metadata = message.newMetadata === "" ? undefined : message.newMetadata; return obj; }, fromAminoMsg(object: MsgUpdateBatchMetadataAminoMsg): MsgUpdateBatchMetadata { @@ -4601,11 +4759,12 @@ function createBaseMsgUpdateBatchMetadataResponse(): MsgUpdateBatchMetadataRespo return {}; } export const MsgUpdateBatchMetadataResponse = { - encode(_: MsgUpdateBatchMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateBatchMetadataResponse", + encode(_: MsgUpdateBatchMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateBatchMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateBatchMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateBatchMetadataResponse(); while (reader.pos < end) { @@ -4630,7 +4789,8 @@ export const MsgUpdateBatchMetadataResponse = { return message; }, fromAmino(_: MsgUpdateBatchMetadataResponseAmino): MsgUpdateBatchMetadataResponse { - return {}; + const message = createBaseMsgUpdateBatchMetadataResponse(); + return message; }, toAmino(_: MsgUpdateBatchMetadataResponse): MsgUpdateBatchMetadataResponseAmino { const obj: any = {}; @@ -4656,11 +4816,12 @@ function createBaseMsgBridgeResponse(): MsgBridgeResponse { return {}; } export const MsgBridgeResponse = { - encode(_: MsgBridgeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgBridgeResponse", + encode(_: MsgBridgeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBridgeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBridgeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBridgeResponse(); while (reader.pos < end) { @@ -4685,7 +4846,8 @@ export const MsgBridgeResponse = { return message; }, fromAmino(_: MsgBridgeResponseAmino): MsgBridgeResponse { - return {}; + const message = createBaseMsgBridgeResponse(); + return message; }, toAmino(_: MsgBridgeResponse): MsgBridgeResponseAmino { const obj: any = {}; @@ -4711,13 +4873,14 @@ function createBaseMsgBridgeReceive(): MsgBridgeReceive { return { issuer: "", classId: "", - project: Project.fromPartial({}), - batch: Batch.fromPartial({}), - originTx: OriginTx.fromPartial({}) + project: undefined, + batch: undefined, + originTx: undefined }; } export const MsgBridgeReceive = { - encode(message: MsgBridgeReceive, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgBridgeReceive", + encode(message: MsgBridgeReceive, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -4735,8 +4898,8 @@ export const MsgBridgeReceive = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBridgeReceive { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBridgeReceive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBridgeReceive(); while (reader.pos < end) { @@ -4792,18 +4955,28 @@ export const MsgBridgeReceive = { return message; }, fromAmino(object: MsgBridgeReceiveAmino): MsgBridgeReceive { - return { - issuer: object.issuer, - classId: object.class_id, - project: object?.project ? MsgBridgeReceive_Project.fromAmino(object.project) : undefined, - batch: object?.batch ? MsgBridgeReceive_Batch.fromAmino(object.batch) : undefined, - originTx: object?.origin_tx ? OriginTx.fromAmino(object.origin_tx) : undefined - }; + const message = createBaseMsgBridgeReceive(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.project !== undefined && object.project !== null) { + message.project = MsgBridgeReceive_Project.fromAmino(object.project); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = MsgBridgeReceive_Batch.fromAmino(object.batch); + } + if (object.origin_tx !== undefined && object.origin_tx !== null) { + message.originTx = OriginTx.fromAmino(object.origin_tx); + } + return message; }, toAmino(message: MsgBridgeReceive): MsgBridgeReceiveAmino { const obj: any = {}; - obj.issuer = message.issuer; - obj.class_id = message.classId; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.class_id = message.classId === "" ? undefined : message.classId; obj.project = message.project ? MsgBridgeReceive_Project.toAmino(message.project) : undefined; obj.batch = message.batch ? MsgBridgeReceive_Batch.toAmino(message.batch) : undefined; obj.origin_tx = message.originTx ? OriginTx.toAmino(message.originTx) : undefined; @@ -4841,7 +5014,8 @@ function createBaseMsgBridgeReceive_Batch(): MsgBridgeReceive_Batch { }; } export const MsgBridgeReceive_Batch = { - encode(message: MsgBridgeReceive_Batch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.Batch", + encode(message: MsgBridgeReceive_Batch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.recipient !== "") { writer.uint32(10).string(message.recipient); } @@ -4859,8 +5033,8 @@ export const MsgBridgeReceive_Batch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBridgeReceive_Batch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBridgeReceive_Batch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBridgeReceive_Batch(); while (reader.pos < end) { @@ -4916,21 +5090,31 @@ export const MsgBridgeReceive_Batch = { return message; }, fromAmino(object: MsgBridgeReceive_BatchAmino): MsgBridgeReceive_Batch { - return { - recipient: object.recipient, - amount: object.amount, - startDate: object?.start_date ? Timestamp.fromAmino(object.start_date) : undefined, - endDate: object?.end_date ? Timestamp.fromAmino(object.end_date) : undefined, - metadata: object.metadata - }; + const message = createBaseMsgBridgeReceive_Batch(); + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.start_date !== undefined && object.start_date !== null) { + message.startDate = Timestamp.fromAmino(object.start_date); + } + if (object.end_date !== undefined && object.end_date !== null) { + message.endDate = Timestamp.fromAmino(object.end_date); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgBridgeReceive_Batch): MsgBridgeReceive_BatchAmino { const obj: any = {}; - obj.recipient = message.recipient; - obj.amount = message.amount; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.amount = message.amount === "" ? undefined : message.amount; obj.start_date = message.startDate ? Timestamp.toAmino(message.startDate) : undefined; obj.end_date = message.endDate ? Timestamp.toAmino(message.endDate) : undefined; - obj.metadata = message.metadata; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgBridgeReceive_BatchAminoMsg): MsgBridgeReceive_Batch { @@ -4957,7 +5141,8 @@ function createBaseMsgBridgeReceive_Project(): MsgBridgeReceive_Project { }; } export const MsgBridgeReceive_Project = { - encode(message: MsgBridgeReceive_Project, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.Project", + encode(message: MsgBridgeReceive_Project, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.referenceId !== "") { writer.uint32(10).string(message.referenceId); } @@ -4969,8 +5154,8 @@ export const MsgBridgeReceive_Project = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBridgeReceive_Project { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBridgeReceive_Project { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBridgeReceive_Project(); while (reader.pos < end) { @@ -5014,17 +5199,23 @@ export const MsgBridgeReceive_Project = { return message; }, fromAmino(object: MsgBridgeReceive_ProjectAmino): MsgBridgeReceive_Project { - return { - referenceId: object.reference_id, - jurisdiction: object.jurisdiction, - metadata: object.metadata - }; + const message = createBaseMsgBridgeReceive_Project(); + if (object.reference_id !== undefined && object.reference_id !== null) { + message.referenceId = object.reference_id; + } + if (object.jurisdiction !== undefined && object.jurisdiction !== null) { + message.jurisdiction = object.jurisdiction; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; }, toAmino(message: MsgBridgeReceive_Project): MsgBridgeReceive_ProjectAmino { const obj: any = {}; - obj.reference_id = message.referenceId; - obj.jurisdiction = message.jurisdiction; - obj.metadata = message.metadata; + obj.reference_id = message.referenceId === "" ? undefined : message.referenceId; + obj.jurisdiction = message.jurisdiction === "" ? undefined : message.jurisdiction; + obj.metadata = message.metadata === "" ? undefined : message.metadata; return obj; }, fromAminoMsg(object: MsgBridgeReceive_ProjectAminoMsg): MsgBridgeReceive_Project { @@ -5050,7 +5241,8 @@ function createBaseMsgBridgeReceiveResponse(): MsgBridgeReceiveResponse { }; } export const MsgBridgeReceiveResponse = { - encode(message: MsgBridgeReceiveResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgBridgeReceiveResponse", + encode(message: MsgBridgeReceiveResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -5059,8 +5251,8 @@ export const MsgBridgeReceiveResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBridgeReceiveResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBridgeReceiveResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBridgeReceiveResponse(); while (reader.pos < end) { @@ -5098,15 +5290,19 @@ export const MsgBridgeReceiveResponse = { return message; }, fromAmino(object: MsgBridgeReceiveResponseAmino): MsgBridgeReceiveResponse { - return { - batchDenom: object.batch_denom, - projectId: object.project_id - }; + const message = createBaseMsgBridgeReceiveResponse(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.project_id !== undefined && object.project_id !== null) { + message.projectId = object.project_id; + } + return message; }, toAmino(message: MsgBridgeReceiveResponse): MsgBridgeReceiveResponseAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.project_id = message.projectId; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.project_id = message.projectId === "" ? undefined : message.projectId; return obj; }, fromAminoMsg(object: MsgBridgeReceiveResponseAminoMsg): MsgBridgeReceiveResponse { @@ -5132,7 +5328,8 @@ function createBaseMsgAddClassCreator(): MsgAddClassCreator { }; } export const MsgAddClassCreator = { - encode(message: MsgAddClassCreator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgAddClassCreator", + encode(message: MsgAddClassCreator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -5141,8 +5338,8 @@ export const MsgAddClassCreator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddClassCreator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddClassCreator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddClassCreator(); while (reader.pos < end) { @@ -5180,15 +5377,19 @@ export const MsgAddClassCreator = { return message; }, fromAmino(object: MsgAddClassCreatorAmino): MsgAddClassCreator { - return { - authority: object.authority, - creator: object.creator - }; + const message = createBaseMsgAddClassCreator(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; }, toAmino(message: MsgAddClassCreator): MsgAddClassCreatorAmino { const obj: any = {}; - obj.authority = message.authority; - obj.creator = message.creator; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.creator = message.creator === "" ? undefined : message.creator; return obj; }, fromAminoMsg(object: MsgAddClassCreatorAminoMsg): MsgAddClassCreator { @@ -5217,11 +5418,12 @@ function createBaseMsgAddClassCreatorResponse(): MsgAddClassCreatorResponse { return {}; } export const MsgAddClassCreatorResponse = { - encode(_: MsgAddClassCreatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgAddClassCreatorResponse", + encode(_: MsgAddClassCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddClassCreatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddClassCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddClassCreatorResponse(); while (reader.pos < end) { @@ -5246,7 +5448,8 @@ export const MsgAddClassCreatorResponse = { return message; }, fromAmino(_: MsgAddClassCreatorResponseAmino): MsgAddClassCreatorResponse { - return {}; + const message = createBaseMsgAddClassCreatorResponse(); + return message; }, toAmino(_: MsgAddClassCreatorResponse): MsgAddClassCreatorResponseAmino { const obj: any = {}; @@ -5275,7 +5478,8 @@ function createBaseMsgSetClassCreatorAllowlist(): MsgSetClassCreatorAllowlist { }; } export const MsgSetClassCreatorAllowlist = { - encode(message: MsgSetClassCreatorAllowlist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgSetClassCreatorAllowlist", + encode(message: MsgSetClassCreatorAllowlist, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -5284,8 +5488,8 @@ export const MsgSetClassCreatorAllowlist = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetClassCreatorAllowlist { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetClassCreatorAllowlist { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetClassCreatorAllowlist(); while (reader.pos < end) { @@ -5323,15 +5527,19 @@ export const MsgSetClassCreatorAllowlist = { return message; }, fromAmino(object: MsgSetClassCreatorAllowlistAmino): MsgSetClassCreatorAllowlist { - return { - authority: object.authority, - enabled: object.enabled - }; + const message = createBaseMsgSetClassCreatorAllowlist(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: MsgSetClassCreatorAllowlist): MsgSetClassCreatorAllowlistAmino { const obj: any = {}; - obj.authority = message.authority; - obj.enabled = message.enabled; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.enabled = message.enabled === false ? undefined : message.enabled; return obj; }, fromAminoMsg(object: MsgSetClassCreatorAllowlistAminoMsg): MsgSetClassCreatorAllowlist { @@ -5360,11 +5568,12 @@ function createBaseMsgSetClassCreatorAllowlistResponse(): MsgSetClassCreatorAllo return {}; } export const MsgSetClassCreatorAllowlistResponse = { - encode(_: MsgSetClassCreatorAllowlistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgSetClassCreatorAllowlistResponse", + encode(_: MsgSetClassCreatorAllowlistResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetClassCreatorAllowlistResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetClassCreatorAllowlistResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetClassCreatorAllowlistResponse(); while (reader.pos < end) { @@ -5389,7 +5598,8 @@ export const MsgSetClassCreatorAllowlistResponse = { return message; }, fromAmino(_: MsgSetClassCreatorAllowlistResponseAmino): MsgSetClassCreatorAllowlistResponse { - return {}; + const message = createBaseMsgSetClassCreatorAllowlistResponse(); + return message; }, toAmino(_: MsgSetClassCreatorAllowlistResponse): MsgSetClassCreatorAllowlistResponseAmino { const obj: any = {}; @@ -5418,7 +5628,8 @@ function createBaseMsgRemoveClassCreator(): MsgRemoveClassCreator { }; } export const MsgRemoveClassCreator = { - encode(message: MsgRemoveClassCreator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgRemoveClassCreator", + encode(message: MsgRemoveClassCreator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -5427,8 +5638,8 @@ export const MsgRemoveClassCreator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveClassCreator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveClassCreator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRemoveClassCreator(); while (reader.pos < end) { @@ -5466,15 +5677,19 @@ export const MsgRemoveClassCreator = { return message; }, fromAmino(object: MsgRemoveClassCreatorAmino): MsgRemoveClassCreator { - return { - authority: object.authority, - creator: object.creator - }; + const message = createBaseMsgRemoveClassCreator(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; }, toAmino(message: MsgRemoveClassCreator): MsgRemoveClassCreatorAmino { const obj: any = {}; - obj.authority = message.authority; - obj.creator = message.creator; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.creator = message.creator === "" ? undefined : message.creator; return obj; }, fromAminoMsg(object: MsgRemoveClassCreatorAminoMsg): MsgRemoveClassCreator { @@ -5503,11 +5718,12 @@ function createBaseMsgRemoveClassCreatorResponse(): MsgRemoveClassCreatorRespons return {}; } export const MsgRemoveClassCreatorResponse = { - encode(_: MsgRemoveClassCreatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgRemoveClassCreatorResponse", + encode(_: MsgRemoveClassCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveClassCreatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveClassCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRemoveClassCreatorResponse(); while (reader.pos < end) { @@ -5532,7 +5748,8 @@ export const MsgRemoveClassCreatorResponse = { return message; }, fromAmino(_: MsgRemoveClassCreatorResponseAmino): MsgRemoveClassCreatorResponse { - return {}; + const message = createBaseMsgRemoveClassCreatorResponse(); + return message; }, toAmino(_: MsgRemoveClassCreatorResponse): MsgRemoveClassCreatorResponseAmino { const obj: any = {}; @@ -5561,7 +5778,8 @@ function createBaseMsgUpdateClassFee(): MsgUpdateClassFee { }; } export const MsgUpdateClassFee = { - encode(message: MsgUpdateClassFee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassFee", + encode(message: MsgUpdateClassFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -5570,8 +5788,8 @@ export const MsgUpdateClassFee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassFee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassFee(); while (reader.pos < end) { @@ -5609,14 +5827,18 @@ export const MsgUpdateClassFee = { return message; }, fromAmino(object: MsgUpdateClassFeeAmino): MsgUpdateClassFee { - return { - authority: object.authority, - fee: object?.fee ? Coin.fromAmino(object.fee) : undefined - }; + const message = createBaseMsgUpdateClassFee(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; }, toAmino(message: MsgUpdateClassFee): MsgUpdateClassFeeAmino { const obj: any = {}; - obj.authority = message.authority; + obj.authority = message.authority === "" ? undefined : message.authority; obj.fee = message.fee ? Coin.toAmino(message.fee) : undefined; return obj; }, @@ -5646,11 +5868,12 @@ function createBaseMsgUpdateClassFeeResponse(): MsgUpdateClassFeeResponse { return {}; } export const MsgUpdateClassFeeResponse = { - encode(_: MsgUpdateClassFeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgUpdateClassFeeResponse", + encode(_: MsgUpdateClassFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassFeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassFeeResponse(); while (reader.pos < end) { @@ -5675,7 +5898,8 @@ export const MsgUpdateClassFeeResponse = { return message; }, fromAmino(_: MsgUpdateClassFeeResponseAmino): MsgUpdateClassFeeResponse { - return {}; + const message = createBaseMsgUpdateClassFeeResponse(); + return message; }, toAmino(_: MsgUpdateClassFeeResponse): MsgUpdateClassFeeResponseAmino { const obj: any = {}; @@ -5704,7 +5928,8 @@ function createBaseMsgAddAllowedBridgeChain(): MsgAddAllowedBridgeChain { }; } export const MsgAddAllowedBridgeChain = { - encode(message: MsgAddAllowedBridgeChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgAddAllowedBridgeChain", + encode(message: MsgAddAllowedBridgeChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -5713,8 +5938,8 @@ export const MsgAddAllowedBridgeChain = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddAllowedBridgeChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddAllowedBridgeChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddAllowedBridgeChain(); while (reader.pos < end) { @@ -5752,15 +5977,19 @@ export const MsgAddAllowedBridgeChain = { return message; }, fromAmino(object: MsgAddAllowedBridgeChainAmino): MsgAddAllowedBridgeChain { - return { - authority: object.authority, - chainName: object.chain_name - }; + const message = createBaseMsgAddAllowedBridgeChain(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.chain_name !== undefined && object.chain_name !== null) { + message.chainName = object.chain_name; + } + return message; }, toAmino(message: MsgAddAllowedBridgeChain): MsgAddAllowedBridgeChainAmino { const obj: any = {}; - obj.authority = message.authority; - obj.chain_name = message.chainName; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.chain_name = message.chainName === "" ? undefined : message.chainName; return obj; }, fromAminoMsg(object: MsgAddAllowedBridgeChainAminoMsg): MsgAddAllowedBridgeChain { @@ -5789,11 +6018,12 @@ function createBaseMsgAddAllowedBridgeChainResponse(): MsgAddAllowedBridgeChainR return {}; } export const MsgAddAllowedBridgeChainResponse = { - encode(_: MsgAddAllowedBridgeChainResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgAddAllowedBridgeChainResponse", + encode(_: MsgAddAllowedBridgeChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddAllowedBridgeChainResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddAllowedBridgeChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAddAllowedBridgeChainResponse(); while (reader.pos < end) { @@ -5818,7 +6048,8 @@ export const MsgAddAllowedBridgeChainResponse = { return message; }, fromAmino(_: MsgAddAllowedBridgeChainResponseAmino): MsgAddAllowedBridgeChainResponse { - return {}; + const message = createBaseMsgAddAllowedBridgeChainResponse(); + return message; }, toAmino(_: MsgAddAllowedBridgeChainResponse): MsgAddAllowedBridgeChainResponseAmino { const obj: any = {}; @@ -5847,7 +6078,8 @@ function createBaseMsgRemoveAllowedBridgeChain(): MsgRemoveAllowedBridgeChain { }; } export const MsgRemoveAllowedBridgeChain = { - encode(message: MsgRemoveAllowedBridgeChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgRemoveAllowedBridgeChain", + encode(message: MsgRemoveAllowedBridgeChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -5856,8 +6088,8 @@ export const MsgRemoveAllowedBridgeChain = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveAllowedBridgeChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveAllowedBridgeChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRemoveAllowedBridgeChain(); while (reader.pos < end) { @@ -5895,15 +6127,19 @@ export const MsgRemoveAllowedBridgeChain = { return message; }, fromAmino(object: MsgRemoveAllowedBridgeChainAmino): MsgRemoveAllowedBridgeChain { - return { - authority: object.authority, - chainName: object.chain_name - }; + const message = createBaseMsgRemoveAllowedBridgeChain(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.chain_name !== undefined && object.chain_name !== null) { + message.chainName = object.chain_name; + } + return message; }, toAmino(message: MsgRemoveAllowedBridgeChain): MsgRemoveAllowedBridgeChainAmino { const obj: any = {}; - obj.authority = message.authority; - obj.chain_name = message.chainName; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.chain_name = message.chainName === "" ? undefined : message.chainName; return obj; }, fromAminoMsg(object: MsgRemoveAllowedBridgeChainAminoMsg): MsgRemoveAllowedBridgeChain { @@ -5932,11 +6168,12 @@ function createBaseMsgRemoveAllowedBridgeChainResponse(): MsgRemoveAllowedBridge return {}; } export const MsgRemoveAllowedBridgeChainResponse = { - encode(_: MsgRemoveAllowedBridgeChainResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.MsgRemoveAllowedBridgeChainResponse", + encode(_: MsgRemoveAllowedBridgeChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveAllowedBridgeChainResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveAllowedBridgeChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRemoveAllowedBridgeChainResponse(); while (reader.pos < end) { @@ -5961,7 +6198,8 @@ export const MsgRemoveAllowedBridgeChainResponse = { return message; }, fromAmino(_: MsgRemoveAllowedBridgeChainResponseAmino): MsgRemoveAllowedBridgeChainResponse { - return {}; + const message = createBaseMsgRemoveAllowedBridgeChainResponse(); + return message; }, toAmino(_: MsgRemoveAllowedBridgeChainResponse): MsgRemoveAllowedBridgeChainResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/ecocredit/v1/types.ts b/packages/api/src/codegen/regen/ecocredit/v1/types.ts index b8d706aa..ce793d09 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1/types.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1/types.ts @@ -1,6 +1,6 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { CreditType, CreditTypeAmino, CreditTypeSDKType } from "./state"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * Params defines the updatable global parameters of the ecocredit module for @@ -61,40 +61,40 @@ export interface ParamsAmino { * creating a credit class. Any fee listed is accepted and charged to the * credit class creator when creating a credit class. */ - credit_class_fee: CoinAmino[]; + credit_class_fee?: CoinAmino[]; /** * basket_fee is a list of basket creation fees accepted when creating a * basket. Any fee listed is accepted and charged to the basket creator when * creating a basket. */ - basket_fee: CoinAmino[]; + basket_fee?: CoinAmino[]; /** * allowed_class_creators is an allowlist defining the addresses with the * required permissions to create credit classes when allowlist_enabled is set * to true. If allowlist_enabled is set to false, this list has no effect. */ - allowed_class_creators: string[]; + allowed_class_creators?: string[]; /** * allowlist_enabled determines whether or not the allowlist for creating * credit classes is enabled. When set to true, only the addresses listed in * allowed_class_creators can create credit classes. When set to false, any * address can create credit classes. */ - allowlist_enabled: boolean; + allowlist_enabled?: boolean; /** * allowed_denoms is a list of bank denoms allowed to be used in the ask price * of sell orders. * * Since Revision 2 */ - allowed_denoms: AllowedDenomAmino[]; + allowed_denoms?: AllowedDenomAmino[]; /** * AllowedBridgeChains is a list of chain names that are allowed to be used in * bridge operations. * * Since Revision 2 */ - allowed_bridge_chains: string[]; + allowed_bridge_chains?: string[]; } export interface ParamsAminoMsg { type: "/regen.ecocredit.v1.Params"; @@ -126,9 +126,9 @@ export interface CreditsProtoMsg { /** Credits represents a simple structure for credits. */ export interface CreditsAmino { /** batch_denom is the denom of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** amount is the amount of credits. */ - amount: string; + amount?: string; } export interface CreditsAminoMsg { type: "/regen.ecocredit.v1.Credits"; @@ -182,19 +182,19 @@ export interface BatchIssuanceProtoMsg { /** BatchIssuance represents a simple structure for a credit batch issuance. */ export interface BatchIssuanceAmino { /** recipient is the address of the account receiving the issued credits. */ - recipient: string; + recipient?: string; /** * tradable_amount is the amount of credits that the recipient will receive in * a tradable state. The number of decimal places must be less than or equal * to the credit type precision. */ - tradable_amount: string; + tradable_amount?: string; /** * retired_amount is the amount of credits that the recipient will receive in * a retired state. The number of decimal places must be less than or equal to * the credit type precision. */ - retired_amount: string; + retired_amount?: string; /** * retirement_jurisdiction is the jurisdiction of the recipient and is only * required if retired_amount is positive. A jurisdiction has the following @@ -205,7 +205,7 @@ export interface BatchIssuanceAmino { * sub-national-code and postal-code are optional and can be added for * increased precision. */ - retirement_jurisdiction: string; + retirement_jurisdiction?: string; /** * retirement_reason is any arbitrary string that specifies the reason for * retiring credits. The reason will be included in EventRetire and is not @@ -213,7 +213,7 @@ export interface BatchIssuanceAmino { * * Since Revision 2 */ - retirement_reason: string; + retirement_reason?: string; } export interface BatchIssuanceAminoMsg { type: "/regen.ecocredit.v1.BatchIssuance"; @@ -269,12 +269,12 @@ export interface OriginTxAmino { * id is the transaction ID of an originating transaction or operation based * on a type (i.e. transaction ID, serial number). */ - id: string; + id?: string; /** * source is the source chain or registry of the transaction originating the * mint process (e.g. polygon, ethereum, verra). */ - source: string; + source?: string; /** * contract is the address of the contract on the source chain that was * executed when creating the transaction. This address will be stored in @@ -282,12 +282,12 @@ export interface OriginTxAmino { * used when sending credits back to the source chain. This field can be left * blank if credits are bridged from a non-contract-based source. */ - contract: string; + contract?: string; /** * note is a reference note for accounting that will be included in an event * emitted from either Msg/CreateBatch or Msg/MintBatchCredits. */ - note: string; + note?: string; } export interface OriginTxAminoMsg { type: "/regen.ecocredit.v1.OriginTx"; @@ -317,7 +317,7 @@ export interface CreditTypeProposal { * credit_type is the credit type to be added to the network if the proposal * passes. */ - creditType: CreditType; + creditType?: CreditType; } export interface CreditTypeProposalProtoMsg { typeUrl: "/regen.ecocredit.v1.CreditTypeProposal"; @@ -330,9 +330,9 @@ export interface CreditTypeProposalProtoMsg { */ export interface CreditTypeProposalAmino { /** title is the title of the proposal. */ - title: string; + title?: string; /** description is the description of the proposal. */ - description: string; + description?: string; /** * credit_type is the credit type to be added to the network if the proposal * passes. @@ -351,7 +351,7 @@ export interface CreditTypeProposalAminoMsg { export interface CreditTypeProposalSDKType { title: string; description: string; - credit_type: CreditTypeSDKType; + credit_type?: CreditTypeSDKType; } /** * AllowedDenom represents the information for an allowed ask denom. @@ -390,18 +390,18 @@ export interface AllowedDenomProtoMsg { */ export interface AllowedDenomAmino { /** denom is the bank denom to allow (ex. ibc/GLKHDSG423SGS) */ - bank_denom: string; + bank_denom?: string; /** * display_denom is the denom to display to the user and is informational. * Because the denom is likely an IBC denom, this should be chosen by * governance to represent the consensus trusted name of the denom. */ - display_denom: string; + display_denom?: string; /** * exponent is the exponent that relates the denom to the display_denom and is * informational */ - exponent: number; + exponent?: number; } export interface AllowedDenomAminoMsg { type: "/regen.ecocredit.v1.AllowedDenom"; @@ -431,7 +431,8 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.creditClassFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -452,8 +453,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -535,42 +536,44 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - creditClassFee: Array.isArray(object?.credit_class_fee) ? object.credit_class_fee.map((e: any) => Coin.fromAmino(e)) : [], - basketFee: Array.isArray(object?.basket_fee) ? object.basket_fee.map((e: any) => Coin.fromAmino(e)) : [], - allowedClassCreators: Array.isArray(object?.allowed_class_creators) ? object.allowed_class_creators.map((e: any) => e) : [], - allowlistEnabled: object.allowlist_enabled, - allowedDenoms: Array.isArray(object?.allowed_denoms) ? object.allowed_denoms.map((e: any) => AllowedDenom.fromAmino(e)) : [], - allowedBridgeChains: Array.isArray(object?.allowed_bridge_chains) ? object.allowed_bridge_chains.map((e: any) => e) : [] - }; + const message = createBaseParams(); + message.creditClassFee = object.credit_class_fee?.map(e => Coin.fromAmino(e)) || []; + message.basketFee = object.basket_fee?.map(e => Coin.fromAmino(e)) || []; + message.allowedClassCreators = object.allowed_class_creators?.map(e => e) || []; + if (object.allowlist_enabled !== undefined && object.allowlist_enabled !== null) { + message.allowlistEnabled = object.allowlist_enabled; + } + message.allowedDenoms = object.allowed_denoms?.map(e => AllowedDenom.fromAmino(e)) || []; + message.allowedBridgeChains = object.allowed_bridge_chains?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; if (message.creditClassFee) { obj.credit_class_fee = message.creditClassFee.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.credit_class_fee = []; + obj.credit_class_fee = message.creditClassFee; } if (message.basketFee) { obj.basket_fee = message.basketFee.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.basket_fee = []; + obj.basket_fee = message.basketFee; } if (message.allowedClassCreators) { obj.allowed_class_creators = message.allowedClassCreators.map(e => e); } else { - obj.allowed_class_creators = []; + obj.allowed_class_creators = message.allowedClassCreators; } - obj.allowlist_enabled = message.allowlistEnabled; + obj.allowlist_enabled = message.allowlistEnabled === false ? undefined : message.allowlistEnabled; if (message.allowedDenoms) { obj.allowed_denoms = message.allowedDenoms.map(e => e ? AllowedDenom.toAmino(e) : undefined); } else { - obj.allowed_denoms = []; + obj.allowed_denoms = message.allowedDenoms; } if (message.allowedBridgeChains) { obj.allowed_bridge_chains = message.allowedBridgeChains.map(e => e); } else { - obj.allowed_bridge_chains = []; + obj.allowed_bridge_chains = message.allowedBridgeChains; } return obj; }, @@ -597,7 +600,8 @@ function createBaseCredits(): Credits { }; } export const Credits = { - encode(message: Credits, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.Credits", + encode(message: Credits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -606,8 +610,8 @@ export const Credits = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Credits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Credits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCredits(); while (reader.pos < end) { @@ -645,15 +649,19 @@ export const Credits = { return message; }, fromAmino(object: CreditsAmino): Credits { - return { - batchDenom: object.batch_denom, - amount: object.amount - }; + const message = createBaseCredits(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: Credits): CreditsAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: CreditsAminoMsg): Credits { @@ -682,7 +690,8 @@ function createBaseBatchIssuance(): BatchIssuance { }; } export const BatchIssuance = { - encode(message: BatchIssuance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.BatchIssuance", + encode(message: BatchIssuance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.recipient !== "") { writer.uint32(10).string(message.recipient); } @@ -700,8 +709,8 @@ export const BatchIssuance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchIssuance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchIssuance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchIssuance(); while (reader.pos < end) { @@ -757,21 +766,31 @@ export const BatchIssuance = { return message; }, fromAmino(object: BatchIssuanceAmino): BatchIssuance { - return { - recipient: object.recipient, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - retirementJurisdiction: object.retirement_jurisdiction, - retirementReason: object.retirement_reason - }; + const message = createBaseBatchIssuance(); + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.retirement_jurisdiction !== undefined && object.retirement_jurisdiction !== null) { + message.retirementJurisdiction = object.retirement_jurisdiction; + } + if (object.retirement_reason !== undefined && object.retirement_reason !== null) { + message.retirementReason = object.retirement_reason; + } + return message; }, toAmino(message: BatchIssuance): BatchIssuanceAmino { const obj: any = {}; - obj.recipient = message.recipient; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.retirement_jurisdiction = message.retirementJurisdiction; - obj.retirement_reason = message.retirementReason; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.retirement_jurisdiction = message.retirementJurisdiction === "" ? undefined : message.retirementJurisdiction; + obj.retirement_reason = message.retirementReason === "" ? undefined : message.retirementReason; return obj; }, fromAminoMsg(object: BatchIssuanceAminoMsg): BatchIssuance { @@ -799,7 +818,8 @@ function createBaseOriginTx(): OriginTx { }; } export const OriginTx = { - encode(message: OriginTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.OriginTx", + encode(message: OriginTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -814,8 +834,8 @@ export const OriginTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OriginTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): OriginTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOriginTx(); while (reader.pos < end) { @@ -865,19 +885,27 @@ export const OriginTx = { return message; }, fromAmino(object: OriginTxAmino): OriginTx { - return { - id: object.id, - source: object.source, - contract: object.contract, - note: object.note - }; + const message = createBaseOriginTx(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.note !== undefined && object.note !== null) { + message.note = object.note; + } + return message; }, toAmino(message: OriginTx): OriginTxAmino { const obj: any = {}; - obj.id = message.id; - obj.source = message.source; - obj.contract = message.contract; - obj.note = message.note; + obj.id = message.id === "" ? undefined : message.id; + obj.source = message.source === "" ? undefined : message.source; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.note = message.note === "" ? undefined : message.note; return obj; }, fromAminoMsg(object: OriginTxAminoMsg): OriginTx { @@ -900,11 +928,12 @@ function createBaseCreditTypeProposal(): CreditTypeProposal { return { title: "", description: "", - creditType: CreditType.fromPartial({}) + creditType: undefined }; } export const CreditTypeProposal = { - encode(message: CreditTypeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.CreditTypeProposal", + encode(message: CreditTypeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -916,8 +945,8 @@ export const CreditTypeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CreditTypeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CreditTypeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCreditTypeProposal(); while (reader.pos < end) { @@ -961,16 +990,22 @@ export const CreditTypeProposal = { return message; }, fromAmino(object: CreditTypeProposalAmino): CreditTypeProposal { - return { - title: object.title, - description: object.description, - creditType: object?.credit_type ? CreditType.fromAmino(object.credit_type) : undefined - }; + const message = createBaseCreditTypeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.credit_type !== undefined && object.credit_type !== null) { + message.creditType = CreditType.fromAmino(object.credit_type); + } + return message; }, toAmino(message: CreditTypeProposal): CreditTypeProposalAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; obj.credit_type = message.creditType ? CreditType.toAmino(message.creditType) : undefined; return obj; }, @@ -998,7 +1033,8 @@ function createBaseAllowedDenom(): AllowedDenom { }; } export const AllowedDenom = { - encode(message: AllowedDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1.AllowedDenom", + encode(message: AllowedDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bankDenom !== "") { writer.uint32(10).string(message.bankDenom); } @@ -1010,8 +1046,8 @@ export const AllowedDenom = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowedDenom { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowedDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowedDenom(); while (reader.pos < end) { @@ -1055,17 +1091,23 @@ export const AllowedDenom = { return message; }, fromAmino(object: AllowedDenomAmino): AllowedDenom { - return { - bankDenom: object.bank_denom, - displayDenom: object.display_denom, - exponent: object.exponent - }; + const message = createBaseAllowedDenom(); + if (object.bank_denom !== undefined && object.bank_denom !== null) { + message.bankDenom = object.bank_denom; + } + if (object.display_denom !== undefined && object.display_denom !== null) { + message.displayDenom = object.display_denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + return message; }, toAmino(message: AllowedDenom): AllowedDenomAmino { const obj: any = {}; - obj.bank_denom = message.bankDenom; - obj.display_denom = message.displayDenom; - obj.exponent = message.exponent; + obj.bank_denom = message.bankDenom === "" ? undefined : message.bankDenom; + obj.display_denom = message.displayDenom === "" ? undefined : message.displayDenom; + obj.exponent = message.exponent === 0 ? undefined : message.exponent; return obj; }, fromAminoMsg(object: AllowedDenomAminoMsg): AllowedDenom { diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/events.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/events.ts index 9d9f1a2b..8b3be7ca 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/events.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/events.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** EventCreateClass is an event emitted when a credit class is created. */ export interface EventCreateClass { @@ -14,9 +14,9 @@ export interface EventCreateClassProtoMsg { /** EventCreateClass is an event emitted when a credit class is created. */ export interface EventCreateClassAmino { /** class_id is the unique ID of credit class. */ - class_id: string; + class_id?: string; /** admin is the admin of the credit class. */ - admin: string; + admin?: string; } export interface EventCreateClassAminoMsg { type: "/regen.ecocredit.v1alpha1.EventCreateClass"; @@ -60,28 +60,28 @@ export interface EventCreateBatchProtoMsg { /** EventCreateBatch is an event emitted when a credit batch is created. */ export interface EventCreateBatchAmino { /** class_id is the unique ID of credit class. */ - class_id: string; + class_id?: string; /** batch_denom is the unique ID of credit batch. */ - batch_denom: string; + batch_denom?: string; /** issuer is the account address of the issuer of the credit batch. */ - issuer: string; + issuer?: string; /** total_amount is the total number of credits in the credit batch. */ - total_amount: string; + total_amount?: string; /** * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - start_date: string; + start_date?: string; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - end_date: string; + end_date?: string; /** * project_location is the location of the project backing the credits in this * batch. Full documentation can be found in MsgCreateBatch.project_location. */ - project_location: string; + project_location?: string; } export interface EventCreateBatchAminoMsg { type: "/regen.ecocredit.v1alpha1.EventCreateBatch"; @@ -142,22 +142,22 @@ export interface EventReceiveAmino { * result of a transfer. It will not be set when credits are received at * initial issuance or taken from a basket. */ - sender: string; + sender?: string; /** recipient is the recipient of the credits. */ - recipient: string; + recipient?: string; /** batch_denom is the unique ID of credit batch. */ - batch_denom: string; + batch_denom?: string; /** tradable_amount is the decimal number of tradable credits received. */ - tradable_amount: string; + tradable_amount?: string; /** retired_amount is the decimal number of retired credits received. */ - retired_amount: string; + retired_amount?: string; /** * basket_denom is the denom of the basket. when the basket_denom field is * set, it indicates that this event was triggered by the transfer of credits * from a basket. It will not be set if the credits were sent by a user, or by * initial issuance. */ - basket_denom: string; + basket_denom?: string; } export interface EventReceiveAminoMsg { type: "/regen.ecocredit.v1alpha1.EventReceive"; @@ -217,11 +217,11 @@ export interface EventRetireAmino { * account receiving credits in the case that credits were retired upon * issuance using Msg/CreateBatch or retired upon transfer using Msg/Send. */ - retirer: string; + retirer?: string; /** batch_denom is the unique ID of credit batch. */ - batch_denom: string; + batch_denom?: string; /** amount is the decimal number of credits that have been retired. */ - amount: string; + amount?: string; /** * location is the location of the beneficiary or buyer of the retired * credits. It is a string of the form @@ -229,7 +229,7 @@ export interface EventRetireAmino { * fields conforming to ISO 3166-2, and postal-code being up to 64 * alphanumeric characters. */ - location: string; + location?: string; } export interface EventRetireAminoMsg { type: "/regen.ecocredit.v1alpha1.EventRetire"; @@ -276,11 +276,11 @@ export interface EventCancelAmino { * canceller is the account which has cancelled the credits, which should be * the holder of the credits. */ - canceller: string; + canceller?: string; /** batch_denom is the unique ID of credit batch. */ - batch_denom: string; + batch_denom?: string; /** amount is the decimal number of credits that have been cancelled. */ - amount: string; + amount?: string; } export interface EventCancelAminoMsg { type: "/regen.ecocredit.v1alpha1.EventCancel"; @@ -303,7 +303,8 @@ function createBaseEventCreateClass(): EventCreateClass { }; } export const EventCreateClass = { - encode(message: EventCreateClass, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.EventCreateClass", + encode(message: EventCreateClass, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -312,8 +313,8 @@ export const EventCreateClass = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateClass { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateClass { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateClass(); while (reader.pos < end) { @@ -351,15 +352,19 @@ export const EventCreateClass = { return message; }, fromAmino(object: EventCreateClassAmino): EventCreateClass { - return { - classId: object.class_id, - admin: object.admin - }; + const message = createBaseEventCreateClass(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; }, toAmino(message: EventCreateClass): EventCreateClassAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.admin = message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.admin = message.admin === "" ? undefined : message.admin; return obj; }, fromAminoMsg(object: EventCreateClassAminoMsg): EventCreateClass { @@ -390,7 +395,8 @@ function createBaseEventCreateBatch(): EventCreateBatch { }; } export const EventCreateBatch = { - encode(message: EventCreateBatch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.EventCreateBatch", + encode(message: EventCreateBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -414,8 +420,8 @@ export const EventCreateBatch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateBatch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateBatch(); while (reader.pos < end) { @@ -483,25 +489,39 @@ export const EventCreateBatch = { return message; }, fromAmino(object: EventCreateBatchAmino): EventCreateBatch { - return { - classId: object.class_id, - batchDenom: object.batch_denom, - issuer: object.issuer, - totalAmount: object.total_amount, - startDate: object.start_date, - endDate: object.end_date, - projectLocation: object.project_location - }; + const message = createBaseEventCreateBatch(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.total_amount !== undefined && object.total_amount !== null) { + message.totalAmount = object.total_amount; + } + if (object.start_date !== undefined && object.start_date !== null) { + message.startDate = object.start_date; + } + if (object.end_date !== undefined && object.end_date !== null) { + message.endDate = object.end_date; + } + if (object.project_location !== undefined && object.project_location !== null) { + message.projectLocation = object.project_location; + } + return message; }, toAmino(message: EventCreateBatch): EventCreateBatchAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.batch_denom = message.batchDenom; - obj.issuer = message.issuer; - obj.total_amount = message.totalAmount; - obj.start_date = message.startDate; - obj.end_date = message.endDate; - obj.project_location = message.projectLocation; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.total_amount = message.totalAmount === "" ? undefined : message.totalAmount; + obj.start_date = message.startDate === "" ? undefined : message.startDate; + obj.end_date = message.endDate === "" ? undefined : message.endDate; + obj.project_location = message.projectLocation === "" ? undefined : message.projectLocation; return obj; }, fromAminoMsg(object: EventCreateBatchAminoMsg): EventCreateBatch { @@ -531,7 +551,8 @@ function createBaseEventReceive(): EventReceive { }; } export const EventReceive = { - encode(message: EventReceive, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.EventReceive", + encode(message: EventReceive, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -552,8 +573,8 @@ export const EventReceive = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventReceive { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventReceive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventReceive(); while (reader.pos < end) { @@ -615,23 +636,35 @@ export const EventReceive = { return message; }, fromAmino(object: EventReceiveAmino): EventReceive { - return { - sender: object.sender, - recipient: object.recipient, - batchDenom: object.batch_denom, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - basketDenom: object.basket_denom - }; + const message = createBaseEventReceive(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.basket_denom !== undefined && object.basket_denom !== null) { + message.basketDenom = object.basket_denom; + } + return message; }, toAmino(message: EventReceive): EventReceiveAmino { const obj: any = {}; - obj.sender = message.sender; - obj.recipient = message.recipient; - obj.batch_denom = message.batchDenom; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.basket_denom = message.basketDenom; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.basket_denom = message.basketDenom === "" ? undefined : message.basketDenom; return obj; }, fromAminoMsg(object: EventReceiveAminoMsg): EventReceive { @@ -659,7 +692,8 @@ function createBaseEventRetire(): EventRetire { }; } export const EventRetire = { - encode(message: EventRetire, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.EventRetire", + encode(message: EventRetire, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.retirer !== "") { writer.uint32(10).string(message.retirer); } @@ -674,8 +708,8 @@ export const EventRetire = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventRetire { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventRetire { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventRetire(); while (reader.pos < end) { @@ -725,19 +759,27 @@ export const EventRetire = { return message; }, fromAmino(object: EventRetireAmino): EventRetire { - return { - retirer: object.retirer, - batchDenom: object.batch_denom, - amount: object.amount, - location: object.location - }; + const message = createBaseEventRetire(); + if (object.retirer !== undefined && object.retirer !== null) { + message.retirer = object.retirer; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.location !== undefined && object.location !== null) { + message.location = object.location; + } + return message; }, toAmino(message: EventRetire): EventRetireAmino { const obj: any = {}; - obj.retirer = message.retirer; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; - obj.location = message.location; + obj.retirer = message.retirer === "" ? undefined : message.retirer; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.location = message.location === "" ? undefined : message.location; return obj; }, fromAminoMsg(object: EventRetireAminoMsg): EventRetire { @@ -764,7 +806,8 @@ function createBaseEventCancel(): EventCancel { }; } export const EventCancel = { - encode(message: EventCancel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.EventCancel", + encode(message: EventCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.canceller !== "") { writer.uint32(10).string(message.canceller); } @@ -776,8 +819,8 @@ export const EventCancel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCancel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCancel(); while (reader.pos < end) { @@ -821,17 +864,23 @@ export const EventCancel = { return message; }, fromAmino(object: EventCancelAmino): EventCancel { - return { - canceller: object.canceller, - batchDenom: object.batch_denom, - amount: object.amount - }; + const message = createBaseEventCancel(); + if (object.canceller !== undefined && object.canceller !== null) { + message.canceller = object.canceller; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: EventCancel): EventCancelAmino { const obj: any = {}; - obj.canceller = message.canceller; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; + obj.canceller = message.canceller === "" ? undefined : message.canceller; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: EventCancelAminoMsg): EventCancel { diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/genesis.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/genesis.ts index 65c0e623..e971f0be 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/genesis.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/genesis.ts @@ -1,5 +1,5 @@ import { Params, ParamsAmino, ParamsSDKType, ClassInfo, ClassInfoAmino, ClassInfoSDKType, BatchInfo, BatchInfoAmino, BatchInfoSDKType, CreditTypeSeq, CreditTypeSeqAmino, CreditTypeSeqSDKType } from "./types"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** GenesisState defines ecocredit module's genesis state. */ export interface GenesisState { @@ -31,15 +31,15 @@ export interface GenesisStateAmino { */ params?: ParamsAmino; /** class_info is the list of credit class info. */ - class_info: ClassInfoAmino[]; + class_info?: ClassInfoAmino[]; /** batch_info is the list of credit batch info. */ - batch_info: BatchInfoAmino[]; + batch_info?: BatchInfoAmino[]; /** sequences is the list of credit type sequence. */ - sequences: CreditTypeSeqAmino[]; + sequences?: CreditTypeSeqAmino[]; /** balances is the list of credit batch tradable/retired units. */ - balances: BalanceAmino[]; + balances?: BalanceAmino[]; /** supplies is the list of credit batch tradable/retired supply. */ - supplies: SupplyAmino[]; + supplies?: SupplyAmino[]; } export interface GenesisStateAminoMsg { type: "/regen.ecocredit.v1alpha1.GenesisState"; @@ -78,13 +78,13 @@ export interface BalanceProtoMsg { */ export interface BalanceAmino { /** address is the account address of the account holding credits. */ - address: string; + address?: string; /** batch_denom is the unique ID of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** tradable_balance is the tradable balance of the credit batch. */ - tradable_balance: string; + tradable_balance?: string; /** retired_balance is the retired balance of the credit batch. */ - retired_balance: string; + retired_balance?: string; } export interface BalanceAminoMsg { type: "/regen.ecocredit.v1alpha1.Balance"; @@ -116,11 +116,11 @@ export interface SupplyProtoMsg { /** Supply represents a tradable or retired supply of a credit batch. */ export interface SupplyAmino { /** batch_denom is the unique ID of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** tradable_supply is the tradable supply of the credit batch. */ - tradable_supply: string; + tradable_supply?: string; /** retired_supply is the retired supply of the credit batch. */ - retired_supply: string; + retired_supply?: string; } export interface SupplyAminoMsg { type: "/regen.ecocredit.v1alpha1.Supply"; @@ -143,7 +143,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -164,8 +165,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -247,14 +248,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - classInfo: Array.isArray(object?.class_info) ? object.class_info.map((e: any) => ClassInfo.fromAmino(e)) : [], - batchInfo: Array.isArray(object?.batch_info) ? object.batch_info.map((e: any) => BatchInfo.fromAmino(e)) : [], - sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => CreditTypeSeq.fromAmino(e)) : [], - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Balance.fromAmino(e)) : [], - supplies: Array.isArray(object?.supplies) ? object.supplies.map((e: any) => Supply.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.classInfo = object.class_info?.map(e => ClassInfo.fromAmino(e)) || []; + message.batchInfo = object.batch_info?.map(e => BatchInfo.fromAmino(e)) || []; + message.sequences = object.sequences?.map(e => CreditTypeSeq.fromAmino(e)) || []; + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + message.supplies = object.supplies?.map(e => Supply.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -262,27 +265,27 @@ export const GenesisState = { if (message.classInfo) { obj.class_info = message.classInfo.map(e => e ? ClassInfo.toAmino(e) : undefined); } else { - obj.class_info = []; + obj.class_info = message.classInfo; } if (message.batchInfo) { obj.batch_info = message.batchInfo.map(e => e ? BatchInfo.toAmino(e) : undefined); } else { - obj.batch_info = []; + obj.batch_info = message.batchInfo; } if (message.sequences) { obj.sequences = message.sequences.map(e => e ? CreditTypeSeq.toAmino(e) : undefined); } else { - obj.sequences = []; + obj.sequences = message.sequences; } if (message.balances) { obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); } else { - obj.balances = []; + obj.balances = message.balances; } if (message.supplies) { obj.supplies = message.supplies.map(e => e ? Supply.toAmino(e) : undefined); } else { - obj.supplies = []; + obj.supplies = message.supplies; } return obj; }, @@ -311,7 +314,8 @@ function createBaseBalance(): Balance { }; } export const Balance = { - encode(message: Balance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.Balance", + encode(message: Balance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -326,8 +330,8 @@ export const Balance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Balance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Balance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBalance(); while (reader.pos < end) { @@ -377,19 +381,27 @@ export const Balance = { return message; }, fromAmino(object: BalanceAmino): Balance { - return { - address: object.address, - batchDenom: object.batch_denom, - tradableBalance: object.tradable_balance, - retiredBalance: object.retired_balance - }; + const message = createBaseBalance(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_balance !== undefined && object.tradable_balance !== null) { + message.tradableBalance = object.tradable_balance; + } + if (object.retired_balance !== undefined && object.retired_balance !== null) { + message.retiredBalance = object.retired_balance; + } + return message; }, toAmino(message: Balance): BalanceAmino { const obj: any = {}; - obj.address = message.address; - obj.batch_denom = message.batchDenom; - obj.tradable_balance = message.tradableBalance; - obj.retired_balance = message.retiredBalance; + obj.address = message.address === "" ? undefined : message.address; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_balance = message.tradableBalance === "" ? undefined : message.tradableBalance; + obj.retired_balance = message.retiredBalance === "" ? undefined : message.retiredBalance; return obj; }, fromAminoMsg(object: BalanceAminoMsg): Balance { @@ -416,7 +428,8 @@ function createBaseSupply(): Supply { }; } export const Supply = { - encode(message: Supply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.Supply", + encode(message: Supply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -428,8 +441,8 @@ export const Supply = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Supply { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSupply(); while (reader.pos < end) { @@ -473,17 +486,23 @@ export const Supply = { return message; }, fromAmino(object: SupplyAmino): Supply { - return { - batchDenom: object.batch_denom, - tradableSupply: object.tradable_supply, - retiredSupply: object.retired_supply - }; + const message = createBaseSupply(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_supply !== undefined && object.tradable_supply !== null) { + message.tradableSupply = object.tradable_supply; + } + if (object.retired_supply !== undefined && object.retired_supply !== null) { + message.retiredSupply = object.retired_supply; + } + return message; }, toAmino(message: Supply): SupplyAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.tradable_supply = message.tradableSupply; - obj.retired_supply = message.retiredSupply; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_supply = message.tradableSupply === "" ? undefined : message.tradableSupply; + obj.retired_supply = message.retiredSupply === "" ? undefined : message.retiredSupply; return obj; }, fromAminoMsg(object: SupplyAminoMsg): Supply { diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.lcd.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.lcd.ts index 3653b6cb..bd0cec64 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.lcd.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.lcd.ts @@ -1,5 +1,5 @@ import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryClassesRequest, QueryClassesResponseSDKType, QueryClassInfoRequest, QueryClassInfoResponseSDKType, QueryBatchesRequest, QueryBatchesResponseSDKType, QueryBatchInfoRequest, QueryBatchInfoResponseSDKType, QueryBalanceRequest, QueryBalanceResponseSDKType, QuerySupplyRequest, QuerySupplyResponseSDKType, QueryCreditTypesRequest, QueryCreditTypesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.rpc.Query.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.rpc.Query.ts index 6c1102af..242518c5 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.rpc.Query.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryClassesRequest, QueryClassesResponse, QueryClassInfoRequest, QueryClassInfoResponse, QueryBatchesRequest, QueryBatchesResponse, QueryBatchInfoRequest, QueryBatchInfoResponse, QueryBalanceRequest, QueryBalanceResponse, QuerySupplyRequest, QuerySupplyResponse, QueryCreditTypesRequest, QueryCreditTypesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; /** Msg is the regen.ecocredit.v1alpha1 Query service. */ @@ -45,42 +45,42 @@ export class QueryClientImpl implements Query { }): Promise { const data = QueryClassesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "Classes", data); - return promise.then(data => QueryClassesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassesResponse.decode(new BinaryReader(data))); } classInfo(request: QueryClassInfoRequest): Promise { const data = QueryClassInfoRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "ClassInfo", data); - return promise.then(data => QueryClassInfoResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryClassInfoResponse.decode(new BinaryReader(data))); } batches(request: QueryBatchesRequest): Promise { const data = QueryBatchesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "Batches", data); - return promise.then(data => QueryBatchesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBatchesResponse.decode(new BinaryReader(data))); } batchInfo(request: QueryBatchInfoRequest): Promise { const data = QueryBatchInfoRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "BatchInfo", data); - return promise.then(data => QueryBatchInfoResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBatchInfoResponse.decode(new BinaryReader(data))); } balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "Balance", data); - return promise.then(data => QueryBalanceResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryBalanceResponse.decode(new BinaryReader(data))); } supply(request: QuerySupplyRequest): Promise { const data = QuerySupplyRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "Supply", data); - return promise.then(data => QuerySupplyResponse.decode(new _m0.Reader(data))); + return promise.then(data => QuerySupplyResponse.decode(new BinaryReader(data))); } creditTypes(request: QueryCreditTypesRequest = {}): Promise { const data = QueryCreditTypesRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "CreditTypes", data); - return promise.then(data => QueryCreditTypesResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryCreditTypesResponse.decode(new BinaryReader(data))); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.ts index eb183675..10aaa4bf 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType, ClassInfo, ClassInfoAmino, ClassInfoSDKType, BatchInfo, BatchInfoAmino, BatchInfoSDKType, CreditType, CreditTypeAmino, CreditTypeSDKType } from "./types"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** QueryParamsRequest is the Query/Params request type. */ export interface QueryParamsRequest {} @@ -19,7 +19,7 @@ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is the Query/Params response type. */ export interface QueryParamsResponse { /** params defines the parameters of the ecocredit module. */ - params: Params; + params?: Params; } export interface QueryParamsResponseProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.QueryParamsResponse"; @@ -36,12 +36,12 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the Query/Params response type. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** QueryClassesRequest is the Query/Classes request type. */ export interface QueryClassesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClassesRequestProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.QueryClassesRequest"; @@ -58,14 +58,14 @@ export interface QueryClassesRequestAminoMsg { } /** QueryClassesRequest is the Query/Classes request type. */ export interface QueryClassesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryClassesResponse is the Query/Classes response type. */ export interface QueryClassesResponse { /** classes are the fetched credit classes. */ classes: ClassInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClassesResponseProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.QueryClassesResponse"; @@ -74,7 +74,7 @@ export interface QueryClassesResponseProtoMsg { /** QueryClassesResponse is the Query/Classes response type. */ export interface QueryClassesResponseAmino { /** classes are the fetched credit classes. */ - classes: ClassInfoAmino[]; + classes?: ClassInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -85,7 +85,7 @@ export interface QueryClassesResponseAminoMsg { /** QueryClassesResponse is the Query/Classes response type. */ export interface QueryClassesResponseSDKType { classes: ClassInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryClassInfoRequest is the Query/ClassInfo request type. */ export interface QueryClassInfoRequest { @@ -99,7 +99,7 @@ export interface QueryClassInfoRequestProtoMsg { /** QueryClassInfoRequest is the Query/ClassInfo request type. */ export interface QueryClassInfoRequestAmino { /** class_id is the unique ID of credit class to query. */ - class_id: string; + class_id?: string; } export interface QueryClassInfoRequestAminoMsg { type: "/regen.ecocredit.v1alpha1.QueryClassInfoRequest"; @@ -112,7 +112,7 @@ export interface QueryClassInfoRequestSDKType { /** QueryClassInfoResponse is the Query/ClassInfo request type. */ export interface QueryClassInfoResponse { /** info is the ClassInfo for the credit class. */ - info: ClassInfo; + info?: ClassInfo; } export interface QueryClassInfoResponseProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.QueryClassInfoResponse"; @@ -129,14 +129,14 @@ export interface QueryClassInfoResponseAminoMsg { } /** QueryClassInfoResponse is the Query/ClassInfo request type. */ export interface QueryClassInfoResponseSDKType { - info: ClassInfoSDKType; + info?: ClassInfoSDKType; } /** QueryBatchesRequest is the Query/Batches request type. */ export interface QueryBatchesRequest { /** class_id is the unique ID of the credit class to query. */ classId: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryBatchesRequestProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.QueryBatchesRequest"; @@ -145,7 +145,7 @@ export interface QueryBatchesRequestProtoMsg { /** QueryBatchesRequest is the Query/Batches request type. */ export interface QueryBatchesRequestAmino { /** class_id is the unique ID of the credit class to query. */ - class_id: string; + class_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -156,14 +156,14 @@ export interface QueryBatchesRequestAminoMsg { /** QueryBatchesRequest is the Query/Batches request type. */ export interface QueryBatchesRequestSDKType { class_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryBatchesResponse is the Query/Batches response type. */ export interface QueryBatchesResponse { /** batches are the fetched credit batches within the class. */ batches: BatchInfo[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryBatchesResponseProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.QueryBatchesResponse"; @@ -172,7 +172,7 @@ export interface QueryBatchesResponseProtoMsg { /** QueryBatchesResponse is the Query/Batches response type. */ export interface QueryBatchesResponseAmino { /** batches are the fetched credit batches within the class. */ - batches: BatchInfoAmino[]; + batches?: BatchInfoAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -183,7 +183,7 @@ export interface QueryBatchesResponseAminoMsg { /** QueryBatchesResponse is the Query/Batches response type. */ export interface QueryBatchesResponseSDKType { batches: BatchInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryBatchInfoRequest is the Query/BatchInfo request type. */ export interface QueryBatchInfoRequest { @@ -197,7 +197,7 @@ export interface QueryBatchInfoRequestProtoMsg { /** QueryBatchInfoRequest is the Query/BatchInfo request type. */ export interface QueryBatchInfoRequestAmino { /** batch_denom is the unique ID of credit batch to query. */ - batch_denom: string; + batch_denom?: string; } export interface QueryBatchInfoRequestAminoMsg { type: "/regen.ecocredit.v1alpha1.QueryBatchInfoRequest"; @@ -210,7 +210,7 @@ export interface QueryBatchInfoRequestSDKType { /** QueryBatchInfoResponse is the Query/BatchInfo response type. */ export interface QueryBatchInfoResponse { /** info is the BatchInfo for the credit batch. */ - info: BatchInfo; + info?: BatchInfo; } export interface QueryBatchInfoResponseProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.QueryBatchInfoResponse"; @@ -227,7 +227,7 @@ export interface QueryBatchInfoResponseAminoMsg { } /** QueryBatchInfoResponse is the Query/BatchInfo response type. */ export interface QueryBatchInfoResponseSDKType { - info: BatchInfoSDKType; + info?: BatchInfoSDKType; } /** QueryBalanceRequest is the Query/Balance request type. */ export interface QueryBalanceRequest { @@ -243,9 +243,9 @@ export interface QueryBalanceRequestProtoMsg { /** QueryBalanceRequest is the Query/Balance request type. */ export interface QueryBalanceRequestAmino { /** account is the address of the account whose balance is being queried. */ - account: string; + account?: string; /** batch_denom is the unique ID of credit batch balance to query. */ - batch_denom: string; + batch_denom?: string; } export interface QueryBalanceRequestAminoMsg { type: "/regen.ecocredit.v1alpha1.QueryBalanceRequest"; @@ -270,9 +270,9 @@ export interface QueryBalanceResponseProtoMsg { /** QueryBalanceResponse is the Query/Balance response type. */ export interface QueryBalanceResponseAmino { /** tradable_amount is the decimal number of tradable credits. */ - tradable_amount: string; + tradable_amount?: string; /** retired_amount is the decimal number of retired credits. */ - retired_amount: string; + retired_amount?: string; } export interface QueryBalanceResponseAminoMsg { type: "/regen.ecocredit.v1alpha1.QueryBalanceResponse"; @@ -295,7 +295,7 @@ export interface QuerySupplyRequestProtoMsg { /** QuerySupplyRequest is the Query/Supply request type. */ export interface QuerySupplyRequestAmino { /** batch_denom is the unique ID of credit batch to query. */ - batch_denom: string; + batch_denom?: string; } export interface QuerySupplyRequestAminoMsg { type: "/regen.ecocredit.v1alpha1.QuerySupplyRequest"; @@ -328,12 +328,12 @@ export interface QuerySupplyResponseAmino { * tradable_supply is the decimal number of tradable credits in the batch * supply. */ - tradable_supply: string; + tradable_supply?: string; /** * retired_supply is the decimal number of retired credits in the batch * supply. */ - retired_supply: string; + retired_supply?: string; } export interface QuerySupplyResponseAminoMsg { type: "/regen.ecocredit.v1alpha1.QuerySupplyResponse"; @@ -370,7 +370,7 @@ export interface QueryCreditTypesResponseProtoMsg { /** QueryCreditTypesRequest is the Query/Credit_Types response type */ export interface QueryCreditTypesResponseAmino { /** list of credit types */ - credit_types: CreditTypeAmino[]; + credit_types?: CreditTypeAmino[]; } export interface QueryCreditTypesResponseAminoMsg { type: "/regen.ecocredit.v1alpha1.QueryCreditTypesResponse"; @@ -384,11 +384,12 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -413,7 +414,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -437,18 +439,19 @@ export const QueryParamsRequest = { }; function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.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: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -480,9 +483,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + 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 = {}; @@ -507,18 +512,19 @@ export const QueryParamsResponse = { }; function createBaseQueryClassesRequest(): QueryClassesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClassesRequest = { - encode(message: QueryClassesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryClassesRequest", + encode(message: QueryClassesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesRequest(); while (reader.pos < end) { @@ -550,9 +556,11 @@ export const QueryClassesRequest = { return message; }, fromAmino(object: QueryClassesRequestAmino): QueryClassesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesRequest): QueryClassesRequestAmino { const obj: any = {}; @@ -578,11 +586,12 @@ export const QueryClassesRequest = { function createBaseQueryClassesResponse(): QueryClassesResponse { return { classes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClassesResponse = { - encode(message: QueryClassesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryClassesResponse", + encode(message: QueryClassesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classes) { ClassInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -591,8 +600,8 @@ export const QueryClassesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesResponse(); while (reader.pos < end) { @@ -634,17 +643,19 @@ export const QueryClassesResponse = { return message; }, fromAmino(object: QueryClassesResponseAmino): QueryClassesResponse { - return { - classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => ClassInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClassesResponse(); + message.classes = object.classes?.map(e => ClassInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClassesResponse): QueryClassesResponseAmino { const obj: any = {}; if (message.classes) { obj.classes = message.classes.map(e => e ? ClassInfo.toAmino(e) : undefined); } else { - obj.classes = []; + obj.classes = message.classes; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -671,14 +682,15 @@ function createBaseQueryClassInfoRequest(): QueryClassInfoRequest { }; } export const QueryClassInfoRequest = { - encode(message: QueryClassInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryClassInfoRequest", + encode(message: QueryClassInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassInfoRequest(); while (reader.pos < end) { @@ -710,13 +722,15 @@ export const QueryClassInfoRequest = { return message; }, fromAmino(object: QueryClassInfoRequestAmino): QueryClassInfoRequest { - return { - classId: object.class_id - }; + const message = createBaseQueryClassInfoRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: QueryClassInfoRequest): QueryClassInfoRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: QueryClassInfoRequestAminoMsg): QueryClassInfoRequest { @@ -737,18 +751,19 @@ export const QueryClassInfoRequest = { }; function createBaseQueryClassInfoResponse(): QueryClassInfoResponse { return { - info: ClassInfo.fromPartial({}) + info: undefined }; } export const QueryClassInfoResponse = { - encode(message: QueryClassInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryClassInfoResponse", + encode(message: QueryClassInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.info !== undefined) { ClassInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassInfoResponse(); while (reader.pos < end) { @@ -780,9 +795,11 @@ export const QueryClassInfoResponse = { return message; }, fromAmino(object: QueryClassInfoResponseAmino): QueryClassInfoResponse { - return { - info: object?.info ? ClassInfo.fromAmino(object.info) : undefined - }; + const message = createBaseQueryClassInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = ClassInfo.fromAmino(object.info); + } + return message; }, toAmino(message: QueryClassInfoResponse): QueryClassInfoResponseAmino { const obj: any = {}; @@ -808,11 +825,12 @@ export const QueryClassInfoResponse = { function createBaseQueryBatchesRequest(): QueryBatchesRequest { return { classId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryBatchesRequest = { - encode(message: QueryBatchesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryBatchesRequest", + encode(message: QueryBatchesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -821,8 +839,8 @@ export const QueryBatchesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesRequest(); while (reader.pos < end) { @@ -860,14 +878,18 @@ export const QueryBatchesRequest = { return message; }, fromAmino(object: QueryBatchesRequestAmino): QueryBatchesRequest { - return { - classId: object.class_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesRequest): QueryBatchesRequestAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -890,11 +912,12 @@ export const QueryBatchesRequest = { function createBaseQueryBatchesResponse(): QueryBatchesResponse { return { batches: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryBatchesResponse = { - encode(message: QueryBatchesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryBatchesResponse", + encode(message: QueryBatchesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.batches) { BatchInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -903,8 +926,8 @@ export const QueryBatchesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchesResponse(); while (reader.pos < end) { @@ -946,17 +969,19 @@ export const QueryBatchesResponse = { return message; }, fromAmino(object: QueryBatchesResponseAmino): QueryBatchesResponse { - return { - batches: Array.isArray(object?.batches) ? object.batches.map((e: any) => BatchInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryBatchesResponse(); + message.batches = object.batches?.map(e => BatchInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryBatchesResponse): QueryBatchesResponseAmino { const obj: any = {}; if (message.batches) { obj.batches = message.batches.map(e => e ? BatchInfo.toAmino(e) : undefined); } else { - obj.batches = []; + obj.batches = message.batches; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -983,14 +1008,15 @@ function createBaseQueryBatchInfoRequest(): QueryBatchInfoRequest { }; } export const QueryBatchInfoRequest = { - encode(message: QueryBatchInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryBatchInfoRequest", + encode(message: QueryBatchInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchInfoRequest(); while (reader.pos < end) { @@ -1022,13 +1048,15 @@ export const QueryBatchInfoRequest = { return message; }, fromAmino(object: QueryBatchInfoRequestAmino): QueryBatchInfoRequest { - return { - batchDenom: object.batch_denom - }; + const message = createBaseQueryBatchInfoRequest(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: QueryBatchInfoRequest): QueryBatchInfoRequestAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: QueryBatchInfoRequestAminoMsg): QueryBatchInfoRequest { @@ -1049,18 +1077,19 @@ export const QueryBatchInfoRequest = { }; function createBaseQueryBatchInfoResponse(): QueryBatchInfoResponse { return { - info: BatchInfo.fromPartial({}) + info: undefined }; } export const QueryBatchInfoResponse = { - encode(message: QueryBatchInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryBatchInfoResponse", + encode(message: QueryBatchInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.info !== undefined) { BatchInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBatchInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBatchInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBatchInfoResponse(); while (reader.pos < end) { @@ -1092,9 +1121,11 @@ export const QueryBatchInfoResponse = { return message; }, fromAmino(object: QueryBatchInfoResponseAmino): QueryBatchInfoResponse { - return { - info: object?.info ? BatchInfo.fromAmino(object.info) : undefined - }; + const message = createBaseQueryBatchInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = BatchInfo.fromAmino(object.info); + } + return message; }, toAmino(message: QueryBatchInfoResponse): QueryBatchInfoResponseAmino { const obj: any = {}; @@ -1124,7 +1155,8 @@ function createBaseQueryBalanceRequest(): QueryBalanceRequest { }; } export const QueryBalanceRequest = { - encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryBalanceRequest", + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== "") { writer.uint32(10).string(message.account); } @@ -1133,8 +1165,8 @@ export const QueryBalanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceRequest(); while (reader.pos < end) { @@ -1172,15 +1204,19 @@ export const QueryBalanceRequest = { return message; }, fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { - return { - account: object.account, - batchDenom: object.batch_denom - }; + const message = createBaseQueryBalanceRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { const obj: any = {}; - obj.account = message.account; - obj.batch_denom = message.batchDenom; + obj.account = message.account === "" ? undefined : message.account; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: QueryBalanceRequestAminoMsg): QueryBalanceRequest { @@ -1206,7 +1242,8 @@ function createBaseQueryBalanceResponse(): QueryBalanceResponse { }; } export const QueryBalanceResponse = { - encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryBalanceResponse", + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tradableAmount !== "") { writer.uint32(10).string(message.tradableAmount); } @@ -1215,8 +1252,8 @@ export const QueryBalanceResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceResponse(); while (reader.pos < end) { @@ -1254,15 +1291,19 @@ export const QueryBalanceResponse = { return message; }, fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { - return { - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount - }; + const message = createBaseQueryBalanceResponse(); + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + return message; }, toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { const obj: any = {}; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; return obj; }, fromAminoMsg(object: QueryBalanceResponseAminoMsg): QueryBalanceResponse { @@ -1287,14 +1328,15 @@ function createBaseQuerySupplyRequest(): QuerySupplyRequest { }; } export const QuerySupplyRequest = { - encode(message: QuerySupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QuerySupplyRequest", + encode(message: QuerySupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyRequest(); while (reader.pos < end) { @@ -1326,13 +1368,15 @@ export const QuerySupplyRequest = { return message; }, fromAmino(object: QuerySupplyRequestAmino): QuerySupplyRequest { - return { - batchDenom: object.batch_denom - }; + const message = createBaseQuerySupplyRequest(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: QuerySupplyRequest): QuerySupplyRequestAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: QuerySupplyRequestAminoMsg): QuerySupplyRequest { @@ -1358,7 +1402,8 @@ function createBaseQuerySupplyResponse(): QuerySupplyResponse { }; } export const QuerySupplyResponse = { - encode(message: QuerySupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QuerySupplyResponse", + encode(message: QuerySupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tradableSupply !== "") { writer.uint32(10).string(message.tradableSupply); } @@ -1367,8 +1412,8 @@ export const QuerySupplyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyResponse(); while (reader.pos < end) { @@ -1406,15 +1451,19 @@ export const QuerySupplyResponse = { return message; }, fromAmino(object: QuerySupplyResponseAmino): QuerySupplyResponse { - return { - tradableSupply: object.tradable_supply, - retiredSupply: object.retired_supply - }; + const message = createBaseQuerySupplyResponse(); + if (object.tradable_supply !== undefined && object.tradable_supply !== null) { + message.tradableSupply = object.tradable_supply; + } + if (object.retired_supply !== undefined && object.retired_supply !== null) { + message.retiredSupply = object.retired_supply; + } + return message; }, toAmino(message: QuerySupplyResponse): QuerySupplyResponseAmino { const obj: any = {}; - obj.tradable_supply = message.tradableSupply; - obj.retired_supply = message.retiredSupply; + obj.tradable_supply = message.tradableSupply === "" ? undefined : message.tradableSupply; + obj.retired_supply = message.retiredSupply === "" ? undefined : message.retiredSupply; return obj; }, fromAminoMsg(object: QuerySupplyResponseAminoMsg): QuerySupplyResponse { @@ -1437,11 +1486,12 @@ function createBaseQueryCreditTypesRequest(): QueryCreditTypesRequest { return {}; } export const QueryCreditTypesRequest = { - encode(_: QueryCreditTypesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryCreditTypesRequest", + encode(_: QueryCreditTypesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCreditTypesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCreditTypesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCreditTypesRequest(); while (reader.pos < end) { @@ -1466,7 +1516,8 @@ export const QueryCreditTypesRequest = { return message; }, fromAmino(_: QueryCreditTypesRequestAmino): QueryCreditTypesRequest { - return {}; + const message = createBaseQueryCreditTypesRequest(); + return message; }, toAmino(_: QueryCreditTypesRequest): QueryCreditTypesRequestAmino { const obj: any = {}; @@ -1494,14 +1545,15 @@ function createBaseQueryCreditTypesResponse(): QueryCreditTypesResponse { }; } export const QueryCreditTypesResponse = { - encode(message: QueryCreditTypesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.QueryCreditTypesResponse", + encode(message: QueryCreditTypesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.creditTypes) { CreditType.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCreditTypesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCreditTypesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCreditTypesResponse(); while (reader.pos < end) { @@ -1537,16 +1589,16 @@ export const QueryCreditTypesResponse = { return message; }, fromAmino(object: QueryCreditTypesResponseAmino): QueryCreditTypesResponse { - return { - creditTypes: Array.isArray(object?.credit_types) ? object.credit_types.map((e: any) => CreditType.fromAmino(e)) : [] - }; + const message = createBaseQueryCreditTypesResponse(); + message.creditTypes = object.credit_types?.map(e => CreditType.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCreditTypesResponse): QueryCreditTypesResponseAmino { const obj: any = {}; if (message.creditTypes) { obj.credit_types = message.creditTypes.map(e => e ? CreditType.toAmino(e) : undefined); } else { - obj.credit_types = []; + obj.credit_types = message.creditTypes; } return obj; }, diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts index f748bf71..a92a34bb 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgCreateClass, MsgCreateClassResponse, MsgCreateBatch, MsgCreateBatchResponse, MsgSend, MsgSendResponse, MsgRetire, MsgRetireResponse, MsgCancel, MsgCancelResponse, MsgUpdateClassAdmin, MsgUpdateClassAdminResponse, MsgUpdateClassIssuers, MsgUpdateClassIssuersResponse, MsgUpdateClassMetadata, MsgUpdateClassMetadataResponse } from "./tx"; /** Msg is the regen.ecocredit.v1alpha1 Msg service. */ export interface Msg { @@ -50,41 +50,41 @@ export class MsgClientImpl implements Msg { createClass(request: MsgCreateClass): Promise { const data = MsgCreateClass.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "CreateClass", data); - return promise.then(data => MsgCreateClassResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateClassResponse.decode(new BinaryReader(data))); } createBatch(request: MsgCreateBatch): Promise { const data = MsgCreateBatch.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "CreateBatch", data); - return promise.then(data => MsgCreateBatchResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCreateBatchResponse.decode(new BinaryReader(data))); } send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "Send", data); - return promise.then(data => MsgSendResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSendResponse.decode(new BinaryReader(data))); } retire(request: MsgRetire): Promise { const data = MsgRetire.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "Retire", data); - return promise.then(data => MsgRetireResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRetireResponse.decode(new BinaryReader(data))); } cancel(request: MsgCancel): Promise { const data = MsgCancel.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "Cancel", data); - return promise.then(data => MsgCancelResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgCancelResponse.decode(new BinaryReader(data))); } updateClassAdmin(request: MsgUpdateClassAdmin): Promise { const data = MsgUpdateClassAdmin.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "UpdateClassAdmin", data); - return promise.then(data => MsgUpdateClassAdminResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClassAdminResponse.decode(new BinaryReader(data))); } updateClassIssuers(request: MsgUpdateClassIssuers): Promise { const data = MsgUpdateClassIssuers.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "UpdateClassIssuers", data); - return promise.then(data => MsgUpdateClassIssuersResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClassIssuersResponse.decode(new BinaryReader(data))); } updateClassMetadata(request: MsgUpdateClassMetadata): Promise { const data = MsgUpdateClassMetadata.encode(request).finish(); const promise = this.rpc.request("regen.ecocredit.v1alpha1.Msg", "UpdateClassMetadata", data); - return promise.then(data => MsgUpdateClassMetadataResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgUpdateClassMetadataResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.ts index 5babb252..61db3a7a 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/tx.ts @@ -1,5 +1,5 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import * as _m0 from "protobufjs/minimal"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** MsgCreateClass is the Msg/CreateClass request type. */ export interface MsgCreateClass { @@ -22,16 +22,16 @@ export interface MsgCreateClassProtoMsg { /** MsgCreateClass is the Msg/CreateClass request type. */ export interface MsgCreateClassAmino { /** admin is the address of the account that created the credit class. */ - admin: string; + admin?: string; /** issuers are the account addresses of the approved issuers. */ - issuers: string[]; + issuers?: string[]; /** metadata is any arbitrary metadata to attached to the credit class. */ - metadata: Uint8Array; + metadata?: string; /** * credit_type_name describes the type of credit (e.g. "carbon", * "biodiversity"). */ - credit_type_name: string; + credit_type_name?: string; } export interface MsgCreateClassAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgCreateClass"; @@ -56,7 +56,7 @@ export interface MsgCreateClassResponseProtoMsg { /** MsgCreateClassResponse is the Msg/CreateClass response type. */ export interface MsgCreateClassResponseAmino { /** class_id is the unique ID of the newly created credit class. */ - class_id: string; + class_id?: string; } export interface MsgCreateClassResponseAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgCreateClassResponse"; @@ -80,12 +80,12 @@ export interface MsgCreateBatch { * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - startDate: Timestamp; + startDate?: Timestamp; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - endDate: Timestamp; + endDate?: Timestamp; /** * project_location is the location of the project backing the credits in this * batch. It is a string of the form @@ -103,23 +103,23 @@ export interface MsgCreateBatchProtoMsg { /** MsgCreateBatch is the Msg/CreateBatch request type. */ export interface MsgCreateBatchAmino { /** issuer is the address of the batch issuer. */ - issuer: string; + issuer?: string; /** class_id is the unique ID of the class. */ - class_id: string; + class_id?: string; /** issuance are the credits issued in the batch. */ - issuance: MsgCreateBatch_BatchIssuanceAmino[]; + issuance?: MsgCreateBatch_BatchIssuanceAmino[]; /** metadata is any arbitrary metadata attached to the credit batch. */ - metadata: Uint8Array; + metadata?: string; /** * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - start_date?: TimestampAmino; + start_date?: string; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - end_date?: TimestampAmino; + end_date?: string; /** * project_location is the location of the project backing the credits in this * batch. It is a string of the form @@ -128,7 +128,7 @@ export interface MsgCreateBatchAmino { * alphanumeric characters. country-code is required, while sub-national-code * and postal-code can be added for increasing precision. */ - project_location: string; + project_location?: string; } export interface MsgCreateBatchAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgCreateBatch"; @@ -140,8 +140,8 @@ export interface MsgCreateBatchSDKType { class_id: string; issuance: MsgCreateBatch_BatchIssuanceSDKType[]; metadata: Uint8Array; - start_date: TimestampSDKType; - end_date: TimestampSDKType; + start_date?: TimestampSDKType; + end_date?: TimestampSDKType; project_location: string; } /** @@ -182,18 +182,18 @@ export interface MsgCreateBatch_BatchIssuanceProtoMsg { */ export interface MsgCreateBatch_BatchIssuanceAmino { /** recipient is the account of the recipient. */ - recipient: string; + recipient?: string; /** * tradable_amount is the number of credits in this issuance that can be * traded by this recipient. Decimal values are acceptable. */ - tradable_amount: string; + tradable_amount?: string; /** * retired_amount is the number of credits in this issuance that are * effectively retired by the issuer on receipt. Decimal values are * acceptable. */ - retired_amount: string; + retired_amount?: string; /** * retirement_location is the location of the beneficiary or buyer of the * retired credits. This must be provided if retired_amount is positive. It @@ -202,7 +202,7 @@ export interface MsgCreateBatch_BatchIssuanceAmino { * fields conforming to ISO 3166-2, and postal-code being up to 64 * alphanumeric characters. */ - retirement_location: string; + retirement_location?: string; } export interface MsgCreateBatch_BatchIssuanceAminoMsg { type: "/regen.ecocredit.v1alpha1.BatchIssuance"; @@ -230,7 +230,7 @@ export interface MsgCreateBatchResponseProtoMsg { /** MsgCreateBatchResponse is the Msg/CreateBatch response type. */ export interface MsgCreateBatchResponseAmino { /** batch_denom is the unique denomination ID of the newly created batch. */ - batch_denom: string; + batch_denom?: string; } export interface MsgCreateBatchResponseAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgCreateBatchResponse"; @@ -256,11 +256,11 @@ export interface MsgSendProtoMsg { /** MsgSend is the Msg/Send request type. */ export interface MsgSendAmino { /** sender is the address of the account sending credits. */ - sender: string; + sender?: string; /** sender is the address of the account receiving credits. */ - recipient: string; + recipient?: string; /** credits are the credits being sent. */ - credits: MsgSend_SendCreditsAmino[]; + credits?: MsgSend_SendCreditsAmino[]; } export interface MsgSendAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgSend"; @@ -313,19 +313,19 @@ export interface MsgSend_SendCreditsProtoMsg { */ export interface MsgSend_SendCreditsAmino { /** batch_denom is the unique ID of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** * tradable_amount is the number of credits in this transfer that can be * traded by the recipient. Decimal values are acceptable within the * precision returned by Query/Precision. */ - tradable_amount: string; + tradable_amount?: string; /** * retired_amount is the number of credits in this transfer that are * effectively retired by the issuer on receipt. Decimal values are * acceptable within the precision returned by Query/Precision. */ - retired_amount: string; + retired_amount?: string; /** * retirement_location is the location of the beneficiary or buyer of the * retired credits. This must be provided if retired_amount is positive. It @@ -334,7 +334,7 @@ export interface MsgSend_SendCreditsAmino { * fields conforming to ISO 3166-2, and postal-code being up to 64 * alphanumeric characters. */ - retirement_location: string; + retirement_location?: string; } export interface MsgSend_SendCreditsAminoMsg { type: "/regen.ecocredit.v1alpha1.SendCredits"; @@ -387,9 +387,9 @@ export interface MsgRetireProtoMsg { /** MsgRetire is the Msg/Retire request type. */ export interface MsgRetireAmino { /** holder is the credit holder address. */ - holder: string; + holder?: string; /** credits are the credits being retired. */ - credits: MsgRetire_RetireCreditsAmino[]; + credits?: MsgRetire_RetireCreditsAmino[]; /** * location is the location of the beneficiary or buyer of the retired * credits. It is a string of the form @@ -397,7 +397,7 @@ export interface MsgRetireAmino { * fields conforming to ISO 3166-2, and postal-code being up to 64 * alphanumeric characters. */ - location: string; + location?: string; } export interface MsgRetireAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgRetire"; @@ -427,13 +427,13 @@ export interface MsgRetire_RetireCreditsProtoMsg { /** RetireCredits specifies a batch and the number of credits being retired. */ export interface MsgRetire_RetireCreditsAmino { /** batch_denom is the unique ID of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** * amount is the number of credits being retired. * Decimal values are acceptable within the precision returned by * Query/Precision. */ - amount: string; + amount?: string; } export interface MsgRetire_RetireCreditsAminoMsg { type: "/regen.ecocredit.v1alpha1.RetireCredits"; @@ -472,9 +472,9 @@ export interface MsgCancelProtoMsg { /** MsgCancel is the Msg/Cancel request type. */ export interface MsgCancelAmino { /** holder is the credit holder address. */ - holder: string; + holder?: string; /** credits are the credits being cancelled. */ - credits: MsgCancel_CancelCreditsAmino[]; + credits?: MsgCancel_CancelCreditsAmino[]; } export interface MsgCancelAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgCancel"; @@ -503,13 +503,13 @@ export interface MsgCancel_CancelCreditsProtoMsg { /** CancelCredits specifies a batch and the number of credits being cancelled. */ export interface MsgCancel_CancelCreditsAmino { /** batch_denom is the unique ID of the credit batch. */ - batch_denom: string; + batch_denom?: string; /** * amount is the number of credits being cancelled. * Decimal values are acceptable within the precision returned by * Query/Precision. */ - amount: string; + amount?: string; } export interface MsgCancel_CancelCreditsAminoMsg { type: "/regen.ecocredit.v1alpha1.CancelCredits"; @@ -550,11 +550,11 @@ export interface MsgUpdateClassAdminProtoMsg { /** MsgUpdateClassAdmin is the Msg/UpdateClassAdmin request type. */ export interface MsgUpdateClassAdminAmino { /** admin is the address of the account that is the admin of the credit class. */ - admin: string; + admin?: string; /** class_id is the unique ID of the credit class. */ - class_id: string; + class_id?: string; /** new_admin is the address of the new admin of the credit class. */ - new_admin: string; + new_admin?: string; } export interface MsgUpdateClassAdminAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgUpdateClassAdmin"; @@ -596,11 +596,11 @@ export interface MsgUpdateClassIssuersProtoMsg { /** MsgUpdateClassIssuers is the Msg/UpdateClassIssuers request type. */ export interface MsgUpdateClassIssuersAmino { /** admin is the address of the account that is the admin of the credit class. */ - admin: string; + admin?: string; /** class_id is the unique ID of the credit class. */ - class_id: string; + class_id?: string; /** issuers are the updated account addresses of the approved issuers. */ - issuers: string[]; + issuers?: string[]; } export interface MsgUpdateClassIssuersAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgUpdateClassIssuers"; @@ -645,14 +645,14 @@ export interface MsgUpdateClassMetadataProtoMsg { /** MsgUpdateClassMetadata is the Msg/UpdateClassMetadata request type. */ export interface MsgUpdateClassMetadataAmino { /** admin is the address of the account that is the admin of the credit class. */ - admin: string; + admin?: string; /** class_id is the unique ID of the credit class. */ - class_id: string; + class_id?: string; /** * metadata is the updated arbitrary metadata to be attached to the credit * class. */ - metadata: Uint8Array; + metadata?: string; } export interface MsgUpdateClassMetadataAminoMsg { type: "/regen.ecocredit.v1alpha1.MsgUpdateClassMetadata"; @@ -687,7 +687,8 @@ function createBaseMsgCreateClass(): MsgCreateClass { }; } export const MsgCreateClass = { - encode(message: MsgCreateClass, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgCreateClass", + encode(message: MsgCreateClass, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -702,8 +703,8 @@ export const MsgCreateClass = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClass { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClass { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClass(); while (reader.pos < end) { @@ -757,23 +758,29 @@ export const MsgCreateClass = { return message; }, fromAmino(object: MsgCreateClassAmino): MsgCreateClass { - return { - admin: object.admin, - issuers: Array.isArray(object?.issuers) ? object.issuers.map((e: any) => e) : [], - metadata: object.metadata, - creditTypeName: object.credit_type_name - }; + const message = createBaseMsgCreateClass(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.issuers = object.issuers?.map(e => e) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + if (object.credit_type_name !== undefined && object.credit_type_name !== null) { + message.creditTypeName = object.credit_type_name; + } + return message; }, toAmino(message: MsgCreateClass): MsgCreateClassAmino { const obj: any = {}; - obj.admin = message.admin; + obj.admin = message.admin === "" ? undefined : message.admin; if (message.issuers) { obj.issuers = message.issuers.map(e => e); } else { - obj.issuers = []; + obj.issuers = message.issuers; } - obj.metadata = message.metadata; - obj.credit_type_name = message.creditTypeName; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; + obj.credit_type_name = message.creditTypeName === "" ? undefined : message.creditTypeName; return obj; }, fromAminoMsg(object: MsgCreateClassAminoMsg): MsgCreateClass { @@ -798,14 +805,15 @@ function createBaseMsgCreateClassResponse(): MsgCreateClassResponse { }; } export const MsgCreateClassResponse = { - encode(message: MsgCreateClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgCreateClassResponse", + encode(message: MsgCreateClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClassResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClassResponse(); while (reader.pos < end) { @@ -837,13 +845,15 @@ export const MsgCreateClassResponse = { return message; }, fromAmino(object: MsgCreateClassResponseAmino): MsgCreateClassResponse { - return { - classId: object.class_id - }; + const message = createBaseMsgCreateClassResponse(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; }, toAmino(message: MsgCreateClassResponse): MsgCreateClassResponseAmino { const obj: any = {}; - obj.class_id = message.classId; + obj.class_id = message.classId === "" ? undefined : message.classId; return obj; }, fromAminoMsg(object: MsgCreateClassResponseAminoMsg): MsgCreateClassResponse { @@ -874,7 +884,8 @@ function createBaseMsgCreateBatch(): MsgCreateBatch { }; } export const MsgCreateBatch = { - encode(message: MsgCreateBatch, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgCreateBatch", + encode(message: MsgCreateBatch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.issuer !== "") { writer.uint32(10).string(message.issuer); } @@ -898,8 +909,8 @@ export const MsgCreateBatch = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBatch { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBatch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateBatch(); while (reader.pos < end) { @@ -971,29 +982,41 @@ export const MsgCreateBatch = { return message; }, fromAmino(object: MsgCreateBatchAmino): MsgCreateBatch { - return { - issuer: object.issuer, - classId: object.class_id, - issuance: Array.isArray(object?.issuance) ? object.issuance.map((e: any) => MsgCreateBatch_BatchIssuance.fromAmino(e)) : [], - metadata: object.metadata, - startDate: object?.start_date ? Timestamp.fromAmino(object.start_date) : undefined, - endDate: object?.end_date ? Timestamp.fromAmino(object.end_date) : undefined, - projectLocation: object.project_location - }; + const message = createBaseMsgCreateBatch(); + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + message.issuance = object.issuance?.map(e => MsgCreateBatch_BatchIssuance.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + if (object.start_date !== undefined && object.start_date !== null) { + message.startDate = Timestamp.fromAmino(object.start_date); + } + if (object.end_date !== undefined && object.end_date !== null) { + message.endDate = Timestamp.fromAmino(object.end_date); + } + if (object.project_location !== undefined && object.project_location !== null) { + message.projectLocation = object.project_location; + } + return message; }, toAmino(message: MsgCreateBatch): MsgCreateBatchAmino { const obj: any = {}; - obj.issuer = message.issuer; - obj.class_id = message.classId; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.class_id = message.classId === "" ? undefined : message.classId; if (message.issuance) { obj.issuance = message.issuance.map(e => e ? MsgCreateBatch_BatchIssuance.toAmino(e) : undefined); } else { - obj.issuance = []; + obj.issuance = message.issuance; } - obj.metadata = message.metadata; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; obj.start_date = message.startDate ? Timestamp.toAmino(message.startDate) : undefined; obj.end_date = message.endDate ? Timestamp.toAmino(message.endDate) : undefined; - obj.project_location = message.projectLocation; + obj.project_location = message.projectLocation === "" ? undefined : message.projectLocation; return obj; }, fromAminoMsg(object: MsgCreateBatchAminoMsg): MsgCreateBatch { @@ -1021,7 +1044,8 @@ function createBaseMsgCreateBatch_BatchIssuance(): MsgCreateBatch_BatchIssuance }; } export const MsgCreateBatch_BatchIssuance = { - encode(message: MsgCreateBatch_BatchIssuance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.BatchIssuance", + encode(message: MsgCreateBatch_BatchIssuance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.recipient !== "") { writer.uint32(10).string(message.recipient); } @@ -1036,8 +1060,8 @@ export const MsgCreateBatch_BatchIssuance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBatch_BatchIssuance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBatch_BatchIssuance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateBatch_BatchIssuance(); while (reader.pos < end) { @@ -1087,19 +1111,27 @@ export const MsgCreateBatch_BatchIssuance = { return message; }, fromAmino(object: MsgCreateBatch_BatchIssuanceAmino): MsgCreateBatch_BatchIssuance { - return { - recipient: object.recipient, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - retirementLocation: object.retirement_location - }; + const message = createBaseMsgCreateBatch_BatchIssuance(); + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.retirement_location !== undefined && object.retirement_location !== null) { + message.retirementLocation = object.retirement_location; + } + return message; }, toAmino(message: MsgCreateBatch_BatchIssuance): MsgCreateBatch_BatchIssuanceAmino { const obj: any = {}; - obj.recipient = message.recipient; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.retirement_location = message.retirementLocation; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.retirement_location = message.retirementLocation === "" ? undefined : message.retirementLocation; return obj; }, fromAminoMsg(object: MsgCreateBatch_BatchIssuanceAminoMsg): MsgCreateBatch_BatchIssuance { @@ -1124,14 +1156,15 @@ function createBaseMsgCreateBatchResponse(): MsgCreateBatchResponse { }; } export const MsgCreateBatchResponse = { - encode(message: MsgCreateBatchResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgCreateBatchResponse", + encode(message: MsgCreateBatchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBatchResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateBatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateBatchResponse(); while (reader.pos < end) { @@ -1163,13 +1196,15 @@ export const MsgCreateBatchResponse = { return message; }, fromAmino(object: MsgCreateBatchResponseAmino): MsgCreateBatchResponse { - return { - batchDenom: object.batch_denom - }; + const message = createBaseMsgCreateBatchResponse(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + return message; }, toAmino(message: MsgCreateBatchResponse): MsgCreateBatchResponseAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; return obj; }, fromAminoMsg(object: MsgCreateBatchResponseAminoMsg): MsgCreateBatchResponse { @@ -1196,7 +1231,8 @@ function createBaseMsgSend(): MsgSend { }; } export const MsgSend = { - encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgSend", + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -1208,8 +1244,8 @@ export const MsgSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend(); while (reader.pos < end) { @@ -1257,20 +1293,24 @@ export const MsgSend = { return message; }, fromAmino(object: MsgSendAmino): MsgSend { - return { - sender: object.sender, - recipient: object.recipient, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => MsgSend_SendCredits.fromAmino(e)) : [] - }; + const message = createBaseMsgSend(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.credits = object.credits?.map(e => MsgSend_SendCredits.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSend): MsgSendAmino { const obj: any = {}; - obj.sender = message.sender; - obj.recipient = message.recipient; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.recipient = message.recipient === "" ? undefined : message.recipient; if (message.credits) { obj.credits = message.credits.map(e => e ? MsgSend_SendCredits.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } return obj; }, @@ -1299,7 +1339,8 @@ function createBaseMsgSend_SendCredits(): MsgSend_SendCredits { }; } export const MsgSend_SendCredits = { - encode(message: MsgSend_SendCredits, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.SendCredits", + encode(message: MsgSend_SendCredits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -1314,8 +1355,8 @@ export const MsgSend_SendCredits = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend_SendCredits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend_SendCredits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend_SendCredits(); while (reader.pos < end) { @@ -1365,19 +1406,27 @@ export const MsgSend_SendCredits = { return message; }, fromAmino(object: MsgSend_SendCreditsAmino): MsgSend_SendCredits { - return { - batchDenom: object.batch_denom, - tradableAmount: object.tradable_amount, - retiredAmount: object.retired_amount, - retirementLocation: object.retirement_location - }; + const message = createBaseMsgSend_SendCredits(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.tradable_amount !== undefined && object.tradable_amount !== null) { + message.tradableAmount = object.tradable_amount; + } + if (object.retired_amount !== undefined && object.retired_amount !== null) { + message.retiredAmount = object.retired_amount; + } + if (object.retirement_location !== undefined && object.retirement_location !== null) { + message.retirementLocation = object.retirement_location; + } + return message; }, toAmino(message: MsgSend_SendCredits): MsgSend_SendCreditsAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.tradable_amount = message.tradableAmount; - obj.retired_amount = message.retiredAmount; - obj.retirement_location = message.retirementLocation; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.tradable_amount = message.tradableAmount === "" ? undefined : message.tradableAmount; + obj.retired_amount = message.retiredAmount === "" ? undefined : message.retiredAmount; + obj.retirement_location = message.retirementLocation === "" ? undefined : message.retirementLocation; return obj; }, fromAminoMsg(object: MsgSend_SendCreditsAminoMsg): MsgSend_SendCredits { @@ -1400,11 +1449,12 @@ function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgSendResponse", + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendResponse(); while (reader.pos < end) { @@ -1429,7 +1479,8 @@ export const MsgSendResponse = { return message; }, fromAmino(_: MsgSendResponseAmino): MsgSendResponse { - return {}; + const message = createBaseMsgSendResponse(); + return message; }, toAmino(_: MsgSendResponse): MsgSendResponseAmino { const obj: any = {}; @@ -1459,7 +1510,8 @@ function createBaseMsgRetire(): MsgRetire { }; } export const MsgRetire = { - encode(message: MsgRetire, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgRetire", + encode(message: MsgRetire, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.holder !== "") { writer.uint32(10).string(message.holder); } @@ -1471,8 +1523,8 @@ export const MsgRetire = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRetire { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRetire { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRetire(); while (reader.pos < end) { @@ -1520,21 +1572,25 @@ export const MsgRetire = { return message; }, fromAmino(object: MsgRetireAmino): MsgRetire { - return { - holder: object.holder, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => MsgRetire_RetireCredits.fromAmino(e)) : [], - location: object.location - }; + const message = createBaseMsgRetire(); + if (object.holder !== undefined && object.holder !== null) { + message.holder = object.holder; + } + message.credits = object.credits?.map(e => MsgRetire_RetireCredits.fromAmino(e)) || []; + if (object.location !== undefined && object.location !== null) { + message.location = object.location; + } + return message; }, toAmino(message: MsgRetire): MsgRetireAmino { const obj: any = {}; - obj.holder = message.holder; + obj.holder = message.holder === "" ? undefined : message.holder; if (message.credits) { obj.credits = message.credits.map(e => e ? MsgRetire_RetireCredits.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } - obj.location = message.location; + obj.location = message.location === "" ? undefined : message.location; return obj; }, fromAminoMsg(object: MsgRetireAminoMsg): MsgRetire { @@ -1560,7 +1616,8 @@ function createBaseMsgRetire_RetireCredits(): MsgRetire_RetireCredits { }; } export const MsgRetire_RetireCredits = { - encode(message: MsgRetire_RetireCredits, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.RetireCredits", + encode(message: MsgRetire_RetireCredits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -1569,8 +1626,8 @@ export const MsgRetire_RetireCredits = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRetire_RetireCredits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRetire_RetireCredits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRetire_RetireCredits(); while (reader.pos < end) { @@ -1608,15 +1665,19 @@ export const MsgRetire_RetireCredits = { return message; }, fromAmino(object: MsgRetire_RetireCreditsAmino): MsgRetire_RetireCredits { - return { - batchDenom: object.batch_denom, - amount: object.amount - }; + const message = createBaseMsgRetire_RetireCredits(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: MsgRetire_RetireCredits): MsgRetire_RetireCreditsAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: MsgRetire_RetireCreditsAminoMsg): MsgRetire_RetireCredits { @@ -1639,11 +1700,12 @@ function createBaseMsgRetireResponse(): MsgRetireResponse { return {}; } export const MsgRetireResponse = { - encode(_: MsgRetireResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgRetireResponse", + encode(_: MsgRetireResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRetireResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRetireResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRetireResponse(); while (reader.pos < end) { @@ -1668,7 +1730,8 @@ export const MsgRetireResponse = { return message; }, fromAmino(_: MsgRetireResponseAmino): MsgRetireResponse { - return {}; + const message = createBaseMsgRetireResponse(); + return message; }, toAmino(_: MsgRetireResponse): MsgRetireResponseAmino { const obj: any = {}; @@ -1697,7 +1760,8 @@ function createBaseMsgCancel(): MsgCancel { }; } export const MsgCancel = { - encode(message: MsgCancel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgCancel", + encode(message: MsgCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.holder !== "") { writer.uint32(10).string(message.holder); } @@ -1706,8 +1770,8 @@ export const MsgCancel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancel(); while (reader.pos < end) { @@ -1749,18 +1813,20 @@ export const MsgCancel = { return message; }, fromAmino(object: MsgCancelAmino): MsgCancel { - return { - holder: object.holder, - credits: Array.isArray(object?.credits) ? object.credits.map((e: any) => MsgCancel_CancelCredits.fromAmino(e)) : [] - }; + const message = createBaseMsgCancel(); + if (object.holder !== undefined && object.holder !== null) { + message.holder = object.holder; + } + message.credits = object.credits?.map(e => MsgCancel_CancelCredits.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCancel): MsgCancelAmino { const obj: any = {}; - obj.holder = message.holder; + obj.holder = message.holder === "" ? undefined : message.holder; if (message.credits) { obj.credits = message.credits.map(e => e ? MsgCancel_CancelCredits.toAmino(e) : undefined); } else { - obj.credits = []; + obj.credits = message.credits; } return obj; }, @@ -1787,7 +1853,8 @@ function createBaseMsgCancel_CancelCredits(): MsgCancel_CancelCredits { }; } export const MsgCancel_CancelCredits = { - encode(message: MsgCancel_CancelCredits, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.CancelCredits", + encode(message: MsgCancel_CancelCredits, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.batchDenom !== "") { writer.uint32(10).string(message.batchDenom); } @@ -1796,8 +1863,8 @@ export const MsgCancel_CancelCredits = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancel_CancelCredits { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancel_CancelCredits { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancel_CancelCredits(); while (reader.pos < end) { @@ -1835,15 +1902,19 @@ export const MsgCancel_CancelCredits = { return message; }, fromAmino(object: MsgCancel_CancelCreditsAmino): MsgCancel_CancelCredits { - return { - batchDenom: object.batch_denom, - amount: object.amount - }; + const message = createBaseMsgCancel_CancelCredits(); + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: MsgCancel_CancelCredits): MsgCancel_CancelCreditsAmino { const obj: any = {}; - obj.batch_denom = message.batchDenom; - obj.amount = message.amount; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: MsgCancel_CancelCreditsAminoMsg): MsgCancel_CancelCredits { @@ -1866,11 +1937,12 @@ function createBaseMsgCancelResponse(): MsgCancelResponse { return {}; } export const MsgCancelResponse = { - encode(_: MsgCancelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgCancelResponse", + encode(_: MsgCancelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelResponse(); while (reader.pos < end) { @@ -1895,7 +1967,8 @@ export const MsgCancelResponse = { return message; }, fromAmino(_: MsgCancelResponseAmino): MsgCancelResponse { - return {}; + const message = createBaseMsgCancelResponse(); + return message; }, toAmino(_: MsgCancelResponse): MsgCancelResponseAmino { const obj: any = {}; @@ -1925,7 +1998,8 @@ function createBaseMsgUpdateClassAdmin(): MsgUpdateClassAdmin { }; } export const MsgUpdateClassAdmin = { - encode(message: MsgUpdateClassAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgUpdateClassAdmin", + encode(message: MsgUpdateClassAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1937,8 +2011,8 @@ export const MsgUpdateClassAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassAdmin(); while (reader.pos < end) { @@ -1982,17 +2056,23 @@ export const MsgUpdateClassAdmin = { return message; }, fromAmino(object: MsgUpdateClassAdminAmino): MsgUpdateClassAdmin { - return { - admin: object.admin, - classId: object.class_id, - newAdmin: object.new_admin - }; + const message = createBaseMsgUpdateClassAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; }, toAmino(message: MsgUpdateClassAdmin): MsgUpdateClassAdminAmino { const obj: any = {}; - obj.admin = message.admin; - obj.class_id = message.classId; - obj.new_admin = message.newAdmin; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; return obj; }, fromAminoMsg(object: MsgUpdateClassAdminAminoMsg): MsgUpdateClassAdmin { @@ -2015,11 +2095,12 @@ function createBaseMsgUpdateClassAdminResponse(): MsgUpdateClassAdminResponse { return {}; } export const MsgUpdateClassAdminResponse = { - encode(_: MsgUpdateClassAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgUpdateClassAdminResponse", + encode(_: MsgUpdateClassAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassAdminResponse(); while (reader.pos < end) { @@ -2044,7 +2125,8 @@ export const MsgUpdateClassAdminResponse = { return message; }, fromAmino(_: MsgUpdateClassAdminResponseAmino): MsgUpdateClassAdminResponse { - return {}; + const message = createBaseMsgUpdateClassAdminResponse(); + return message; }, toAmino(_: MsgUpdateClassAdminResponse): MsgUpdateClassAdminResponseAmino { const obj: any = {}; @@ -2074,7 +2156,8 @@ function createBaseMsgUpdateClassIssuers(): MsgUpdateClassIssuers { }; } export const MsgUpdateClassIssuers = { - encode(message: MsgUpdateClassIssuers, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgUpdateClassIssuers", + encode(message: MsgUpdateClassIssuers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -2086,8 +2169,8 @@ export const MsgUpdateClassIssuers = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassIssuers { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassIssuers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassIssuers(); while (reader.pos < end) { @@ -2135,20 +2218,24 @@ export const MsgUpdateClassIssuers = { return message; }, fromAmino(object: MsgUpdateClassIssuersAmino): MsgUpdateClassIssuers { - return { - admin: object.admin, - classId: object.class_id, - issuers: Array.isArray(object?.issuers) ? object.issuers.map((e: any) => e) : [] - }; + const message = createBaseMsgUpdateClassIssuers(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + message.issuers = object.issuers?.map(e => e) || []; + return message; }, toAmino(message: MsgUpdateClassIssuers): MsgUpdateClassIssuersAmino { const obj: any = {}; - obj.admin = message.admin; - obj.class_id = message.classId; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; if (message.issuers) { obj.issuers = message.issuers.map(e => e); } else { - obj.issuers = []; + obj.issuers = message.issuers; } return obj; }, @@ -2172,11 +2259,12 @@ function createBaseMsgUpdateClassIssuersResponse(): MsgUpdateClassIssuersRespons return {}; } export const MsgUpdateClassIssuersResponse = { - encode(_: MsgUpdateClassIssuersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgUpdateClassIssuersResponse", + encode(_: MsgUpdateClassIssuersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassIssuersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassIssuersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassIssuersResponse(); while (reader.pos < end) { @@ -2201,7 +2289,8 @@ export const MsgUpdateClassIssuersResponse = { return message; }, fromAmino(_: MsgUpdateClassIssuersResponseAmino): MsgUpdateClassIssuersResponse { - return {}; + const message = createBaseMsgUpdateClassIssuersResponse(); + return message; }, toAmino(_: MsgUpdateClassIssuersResponse): MsgUpdateClassIssuersResponseAmino { const obj: any = {}; @@ -2231,7 +2320,8 @@ function createBaseMsgUpdateClassMetadata(): MsgUpdateClassMetadata { }; } export const MsgUpdateClassMetadata = { - encode(message: MsgUpdateClassMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgUpdateClassMetadata", + encode(message: MsgUpdateClassMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -2243,8 +2333,8 @@ export const MsgUpdateClassMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassMetadata(); while (reader.pos < end) { @@ -2288,17 +2378,23 @@ export const MsgUpdateClassMetadata = { return message; }, fromAmino(object: MsgUpdateClassMetadataAmino): MsgUpdateClassMetadata { - return { - admin: object.admin, - classId: object.class_id, - metadata: object.metadata - }; + const message = createBaseMsgUpdateClassMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + return message; }, toAmino(message: MsgUpdateClassMetadata): MsgUpdateClassMetadataAmino { const obj: any = {}; - obj.admin = message.admin; - obj.class_id = message.classId; - obj.metadata = message.metadata; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; return obj; }, fromAminoMsg(object: MsgUpdateClassMetadataAminoMsg): MsgUpdateClassMetadata { @@ -2321,11 +2417,12 @@ function createBaseMsgUpdateClassMetadataResponse(): MsgUpdateClassMetadataRespo return {}; } export const MsgUpdateClassMetadataResponse = { - encode(_: MsgUpdateClassMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.MsgUpdateClassMetadataResponse", + encode(_: MsgUpdateClassMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClassMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClassMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClassMetadataResponse(); while (reader.pos < end) { @@ -2350,7 +2447,8 @@ export const MsgUpdateClassMetadataResponse = { return message; }, fromAmino(_: MsgUpdateClassMetadataResponseAmino): MsgUpdateClassMetadataResponse { - return {}; + const message = createBaseMsgUpdateClassMetadataResponse(); + return message; }, toAmino(_: MsgUpdateClassMetadataResponse): MsgUpdateClassMetadataResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/ecocredit/v1alpha1/types.ts b/packages/api/src/codegen/regen/ecocredit/v1alpha1/types.ts index 7444f598..18c761e5 100644 --- a/packages/api/src/codegen/regen/ecocredit/v1alpha1/types.ts +++ b/packages/api/src/codegen/regen/ecocredit/v1alpha1/types.ts @@ -1,7 +1,7 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Long, isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; /** ClassInfo represents the high-level on-chain information for a credit class. */ export interface ClassInfo { /** class_id is the unique ID of credit class. */ @@ -16,9 +16,9 @@ export interface ClassInfo { * credit_type describes the type of credit (e.g. carbon, biodiversity), as * well as unit and precision. */ - creditType: CreditType; + creditType?: CreditType; /** The number of batches issued in this credit class. */ - numBatches: Long; + numBatches: bigint; } export interface ClassInfoProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.ClassInfo"; @@ -27,20 +27,20 @@ export interface ClassInfoProtoMsg { /** ClassInfo represents the high-level on-chain information for a credit class. */ export interface ClassInfoAmino { /** class_id is the unique ID of credit class. */ - class_id: string; + class_id?: string; /** admin is the admin of the credit class. */ - admin: string; + admin?: string; /** issuers are the approved issuers of the credit class. */ - issuers: string[]; + issuers?: string[]; /** metadata is any arbitrary metadata to attached to the credit class. */ - metadata: Uint8Array; + metadata?: string; /** * credit_type describes the type of credit (e.g. carbon, biodiversity), as * well as unit and precision. */ credit_type?: CreditTypeAmino; /** The number of batches issued in this credit class. */ - num_batches: string; + num_batches?: string; } export interface ClassInfoAminoMsg { type: "/regen.ecocredit.v1alpha1.ClassInfo"; @@ -52,8 +52,8 @@ export interface ClassInfoSDKType { admin: string; issuers: string[]; metadata: Uint8Array; - credit_type: CreditTypeSDKType; - num_batches: Long; + credit_type?: CreditTypeSDKType; + num_batches: bigint; } /** BatchInfo represents the high-level on-chain information for a credit batch. */ export interface BatchInfo { @@ -84,12 +84,12 @@ export interface BatchInfo { * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - startDate: Timestamp; + startDate?: Timestamp; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - endDate: Timestamp; + endDate?: Timestamp; /** * project_location is the location of the project backing the credits in this * batch. Full documentation can be found in MsgCreateBatch.project_location. @@ -103,11 +103,11 @@ export interface BatchInfoProtoMsg { /** BatchInfo represents the high-level on-chain information for a credit batch. */ export interface BatchInfoAmino { /** class_id is the unique ID of credit class. */ - class_id: string; + class_id?: string; /** batch_denom is the unique ID of credit batch. */ - batch_denom: string; + batch_denom?: string; /** issuer is the issuer of the credit batch. */ - issuer: string; + issuer?: string; /** * total_amount is the total number of active credits in the credit batch. * Some of the issued credits may be cancelled and will be removed from @@ -115,31 +115,31 @@ export interface BatchInfoAmino { * amount_cancelled will always sum to the original amount of credits that * were issued. */ - total_amount: string; + total_amount?: string; /** metadata is any arbitrary metadata attached to the credit batch. */ - metadata: Uint8Array; + metadata?: string; /** * amount_cancelled is the number of credits in the batch that have been * cancelled, effectively undoing there issuance. The sum of total_amount and * amount_cancelled will always sum to the original amount of credits that * were issued. */ - amount_cancelled: string; + amount_cancelled?: string; /** * start_date is the beginning of the period during which this credit batch * was quantified and verified. */ - start_date?: TimestampAmino; + start_date?: string; /** * end_date is the end of the period during which this credit batch was * quantified and verified. */ - end_date?: TimestampAmino; + end_date?: string; /** * project_location is the location of the project backing the credits in this * batch. Full documentation can be found in MsgCreateBatch.project_location. */ - project_location: string; + project_location?: string; } export interface BatchInfoAminoMsg { type: "/regen.ecocredit.v1alpha1.BatchInfo"; @@ -153,8 +153,8 @@ export interface BatchInfoSDKType { total_amount: string; metadata: Uint8Array; amount_cancelled: string; - start_date: TimestampSDKType; - end_date: TimestampSDKType; + start_date?: TimestampSDKType; + end_date?: TimestampSDKType; project_location: string; } /** @@ -189,21 +189,21 @@ export interface ParamsProtoMsg { */ export interface ParamsAmino { /** credit_class_fee is the fixed fee charged on creation of a new credit class */ - credit_class_fee: CoinAmino[]; + credit_class_fee?: CoinAmino[]; /** * allowed_class_creators is an allowlist defining the addresses with * the required permissions to create credit classes */ - allowed_class_creators: string[]; + allowed_class_creators?: string[]; /** * allowlist_enabled is a param that enables/disables the allowlist for credit * creation */ - allowlist_enabled: boolean; + allowlist_enabled?: boolean; /** credit_types is a list of definitions for credit types */ - credit_types: CreditTypeAmino[]; + credit_types?: CreditTypeAmino[]; /** basket_creation_fee is the fee to create a new basket denom. */ - basket_creation_fee: CoinAmino[]; + basket_creation_fee?: CoinAmino[]; } export interface ParamsAminoMsg { type: "/regen.ecocredit.v1alpha1.Params"; @@ -247,16 +247,16 @@ export interface CreditTypeProtoMsg { */ export interface CreditTypeAmino { /** the type of credit (e.g. carbon, biodiversity, etc) */ - name: string; + name?: string; /** * abbreviation is a 1-3 character uppercase abbreviation of the CreditType * name, used in batch denominations within the CreditType. It must be unique. */ - abbreviation: string; + abbreviation?: string; /** the measurement unit (e.g. kg, ton, etc) */ - unit: string; + unit?: string; /** the decimal precision */ - precision: number; + precision?: number; } export interface CreditTypeAminoMsg { type: "/regen.ecocredit.v1alpha1.CreditType"; @@ -280,7 +280,7 @@ export interface CreditTypeSeq { /** The credit type abbreviation */ abbreviation: string; /** The sequence number of classes of the credit type */ - seqNumber: Long; + seqNumber: bigint; } export interface CreditTypeSeqProtoMsg { typeUrl: "/regen.ecocredit.v1alpha1.CreditTypeSeq"; @@ -292,9 +292,9 @@ export interface CreditTypeSeqProtoMsg { */ export interface CreditTypeSeqAmino { /** The credit type abbreviation */ - abbreviation: string; + abbreviation?: string; /** The sequence number of classes of the credit type */ - seq_number: string; + seq_number?: string; } export interface CreditTypeSeqAminoMsg { type: "/regen.ecocredit.v1alpha1.CreditTypeSeq"; @@ -306,7 +306,7 @@ export interface CreditTypeSeqAminoMsg { */ export interface CreditTypeSeqSDKType { abbreviation: string; - seq_number: Long; + seq_number: bigint; } function createBaseClassInfo(): ClassInfo { return { @@ -314,12 +314,13 @@ function createBaseClassInfo(): ClassInfo { admin: "", issuers: [], metadata: new Uint8Array(), - creditType: CreditType.fromPartial({}), - numBatches: Long.UZERO + creditType: undefined, + numBatches: BigInt(0) }; } export const ClassInfo = { - encode(message: ClassInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.ClassInfo", + encode(message: ClassInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -335,13 +336,13 @@ export const ClassInfo = { if (message.creditType !== undefined) { CreditType.encode(message.creditType, writer.uint32(42).fork()).ldelim(); } - if (!message.numBatches.isZero()) { + if (message.numBatches !== BigInt(0)) { writer.uint32(48).uint64(message.numBatches); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClassInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClassInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClassInfo(); while (reader.pos < end) { @@ -363,7 +364,7 @@ export const ClassInfo = { message.creditType = CreditType.decode(reader, reader.uint32()); break; case 6: - message.numBatches = (reader.uint64() as Long); + message.numBatches = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -379,7 +380,7 @@ export const ClassInfo = { issuers: Array.isArray(object?.issuers) ? object.issuers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? bytesFromBase64(object.metadata) : new Uint8Array(), creditType: isSet(object.creditType) ? CreditType.fromJSON(object.creditType) : undefined, - numBatches: isSet(object.numBatches) ? Long.fromValue(object.numBatches) : Long.UZERO + numBatches: isSet(object.numBatches) ? BigInt(object.numBatches.toString()) : BigInt(0) }; }, toJSON(message: ClassInfo): unknown { @@ -393,7 +394,7 @@ export const ClassInfo = { } message.metadata !== undefined && (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); message.creditType !== undefined && (obj.creditType = message.creditType ? CreditType.toJSON(message.creditType) : undefined); - message.numBatches !== undefined && (obj.numBatches = (message.numBatches || Long.UZERO).toString()); + message.numBatches !== undefined && (obj.numBatches = (message.numBatches || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ClassInfo { @@ -403,31 +404,41 @@ export const ClassInfo = { message.issuers = object.issuers?.map(e => e) || []; message.metadata = object.metadata ?? new Uint8Array(); message.creditType = object.creditType !== undefined && object.creditType !== null ? CreditType.fromPartial(object.creditType) : undefined; - message.numBatches = object.numBatches !== undefined && object.numBatches !== null ? Long.fromValue(object.numBatches) : Long.UZERO; + message.numBatches = object.numBatches !== undefined && object.numBatches !== null ? BigInt(object.numBatches.toString()) : BigInt(0); return message; }, fromAmino(object: ClassInfoAmino): ClassInfo { - return { - classId: object.class_id, - admin: object.admin, - issuers: Array.isArray(object?.issuers) ? object.issuers.map((e: any) => e) : [], - metadata: object.metadata, - creditType: object?.credit_type ? CreditType.fromAmino(object.credit_type) : undefined, - numBatches: Long.fromString(object.num_batches) - }; + const message = createBaseClassInfo(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.issuers = object.issuers?.map(e => e) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + if (object.credit_type !== undefined && object.credit_type !== null) { + message.creditType = CreditType.fromAmino(object.credit_type); + } + if (object.num_batches !== undefined && object.num_batches !== null) { + message.numBatches = BigInt(object.num_batches); + } + return message; }, toAmino(message: ClassInfo): ClassInfoAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.admin = message.admin; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.admin = message.admin === "" ? undefined : message.admin; if (message.issuers) { obj.issuers = message.issuers.map(e => e); } else { - obj.issuers = []; + obj.issuers = message.issuers; } - obj.metadata = message.metadata; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; obj.credit_type = message.creditType ? CreditType.toAmino(message.creditType) : undefined; - obj.num_batches = message.numBatches ? message.numBatches.toString() : undefined; + obj.num_batches = message.numBatches !== BigInt(0) ? message.numBatches.toString() : undefined; return obj; }, fromAminoMsg(object: ClassInfoAminoMsg): ClassInfo { @@ -460,7 +471,8 @@ function createBaseBatchInfo(): BatchInfo { }; } export const BatchInfo = { - encode(message: BatchInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.BatchInfo", + encode(message: BatchInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -490,8 +502,8 @@ export const BatchInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchInfo(); while (reader.pos < end) { @@ -571,29 +583,47 @@ export const BatchInfo = { return message; }, fromAmino(object: BatchInfoAmino): BatchInfo { - return { - classId: object.class_id, - batchDenom: object.batch_denom, - issuer: object.issuer, - totalAmount: object.total_amount, - metadata: object.metadata, - amountCancelled: object.amount_cancelled, - startDate: object?.start_date ? Timestamp.fromAmino(object.start_date) : undefined, - endDate: object?.end_date ? Timestamp.fromAmino(object.end_date) : undefined, - projectLocation: object.project_location - }; + const message = createBaseBatchInfo(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.batch_denom !== undefined && object.batch_denom !== null) { + message.batchDenom = object.batch_denom; + } + if (object.issuer !== undefined && object.issuer !== null) { + message.issuer = object.issuer; + } + if (object.total_amount !== undefined && object.total_amount !== null) { + message.totalAmount = object.total_amount; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + if (object.amount_cancelled !== undefined && object.amount_cancelled !== null) { + message.amountCancelled = object.amount_cancelled; + } + if (object.start_date !== undefined && object.start_date !== null) { + message.startDate = Timestamp.fromAmino(object.start_date); + } + if (object.end_date !== undefined && object.end_date !== null) { + message.endDate = Timestamp.fromAmino(object.end_date); + } + if (object.project_location !== undefined && object.project_location !== null) { + message.projectLocation = object.project_location; + } + return message; }, toAmino(message: BatchInfo): BatchInfoAmino { const obj: any = {}; - obj.class_id = message.classId; - obj.batch_denom = message.batchDenom; - obj.issuer = message.issuer; - obj.total_amount = message.totalAmount; - obj.metadata = message.metadata; - obj.amount_cancelled = message.amountCancelled; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.batch_denom = message.batchDenom === "" ? undefined : message.batchDenom; + obj.issuer = message.issuer === "" ? undefined : message.issuer; + obj.total_amount = message.totalAmount === "" ? undefined : message.totalAmount; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; + obj.amount_cancelled = message.amountCancelled === "" ? undefined : message.amountCancelled; obj.start_date = message.startDate ? Timestamp.toAmino(message.startDate) : undefined; obj.end_date = message.endDate ? Timestamp.toAmino(message.endDate) : undefined; - obj.project_location = message.projectLocation; + obj.project_location = message.projectLocation === "" ? undefined : message.projectLocation; return obj; }, fromAminoMsg(object: BatchInfoAminoMsg): BatchInfo { @@ -622,7 +652,8 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.creditClassFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -640,8 +671,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -713,36 +744,38 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - creditClassFee: Array.isArray(object?.credit_class_fee) ? object.credit_class_fee.map((e: any) => Coin.fromAmino(e)) : [], - allowedClassCreators: Array.isArray(object?.allowed_class_creators) ? object.allowed_class_creators.map((e: any) => e) : [], - allowlistEnabled: object.allowlist_enabled, - creditTypes: Array.isArray(object?.credit_types) ? object.credit_types.map((e: any) => CreditType.fromAmino(e)) : [], - basketCreationFee: Array.isArray(object?.basket_creation_fee) ? object.basket_creation_fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseParams(); + message.creditClassFee = object.credit_class_fee?.map(e => Coin.fromAmino(e)) || []; + message.allowedClassCreators = object.allowed_class_creators?.map(e => e) || []; + if (object.allowlist_enabled !== undefined && object.allowlist_enabled !== null) { + message.allowlistEnabled = object.allowlist_enabled; + } + message.creditTypes = object.credit_types?.map(e => CreditType.fromAmino(e)) || []; + message.basketCreationFee = object.basket_creation_fee?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; if (message.creditClassFee) { obj.credit_class_fee = message.creditClassFee.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.credit_class_fee = []; + obj.credit_class_fee = message.creditClassFee; } if (message.allowedClassCreators) { obj.allowed_class_creators = message.allowedClassCreators.map(e => e); } else { - obj.allowed_class_creators = []; + obj.allowed_class_creators = message.allowedClassCreators; } - obj.allowlist_enabled = message.allowlistEnabled; + obj.allowlist_enabled = message.allowlistEnabled === false ? undefined : message.allowlistEnabled; if (message.creditTypes) { obj.credit_types = message.creditTypes.map(e => e ? CreditType.toAmino(e) : undefined); } else { - obj.credit_types = []; + obj.credit_types = message.creditTypes; } if (message.basketCreationFee) { obj.basket_creation_fee = message.basketCreationFee.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.basket_creation_fee = []; + obj.basket_creation_fee = message.basketCreationFee; } return obj; }, @@ -771,7 +804,8 @@ function createBaseCreditType(): CreditType { }; } export const CreditType = { - encode(message: CreditType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.CreditType", + encode(message: CreditType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -786,8 +820,8 @@ export const CreditType = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CreditType { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CreditType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCreditType(); while (reader.pos < end) { @@ -837,19 +871,27 @@ export const CreditType = { return message; }, fromAmino(object: CreditTypeAmino): CreditType { - return { - name: object.name, - abbreviation: object.abbreviation, - unit: object.unit, - precision: object.precision - }; + const message = createBaseCreditType(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.abbreviation !== undefined && object.abbreviation !== null) { + message.abbreviation = object.abbreviation; + } + if (object.unit !== undefined && object.unit !== null) { + message.unit = object.unit; + } + if (object.precision !== undefined && object.precision !== null) { + message.precision = object.precision; + } + return message; }, toAmino(message: CreditType): CreditTypeAmino { const obj: any = {}; - obj.name = message.name; - obj.abbreviation = message.abbreviation; - obj.unit = message.unit; - obj.precision = message.precision; + obj.name = message.name === "" ? undefined : message.name; + obj.abbreviation = message.abbreviation === "" ? undefined : message.abbreviation; + obj.unit = message.unit === "" ? undefined : message.unit; + obj.precision = message.precision === 0 ? undefined : message.precision; return obj; }, fromAminoMsg(object: CreditTypeAminoMsg): CreditType { @@ -871,21 +913,22 @@ export const CreditType = { function createBaseCreditTypeSeq(): CreditTypeSeq { return { abbreviation: "", - seqNumber: Long.UZERO + seqNumber: BigInt(0) }; } export const CreditTypeSeq = { - encode(message: CreditTypeSeq, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.ecocredit.v1alpha1.CreditTypeSeq", + encode(message: CreditTypeSeq, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.abbreviation !== "") { writer.uint32(10).string(message.abbreviation); } - if (!message.seqNumber.isZero()) { + if (message.seqNumber !== BigInt(0)) { writer.uint32(16).uint64(message.seqNumber); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CreditTypeSeq { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CreditTypeSeq { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCreditTypeSeq(); while (reader.pos < end) { @@ -895,7 +938,7 @@ export const CreditTypeSeq = { message.abbreviation = reader.string(); break; case 2: - message.seqNumber = (reader.uint64() as Long); + message.seqNumber = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -907,31 +950,35 @@ export const CreditTypeSeq = { fromJSON(object: any): CreditTypeSeq { return { abbreviation: isSet(object.abbreviation) ? String(object.abbreviation) : "", - seqNumber: isSet(object.seqNumber) ? Long.fromValue(object.seqNumber) : Long.UZERO + seqNumber: isSet(object.seqNumber) ? BigInt(object.seqNumber.toString()) : BigInt(0) }; }, toJSON(message: CreditTypeSeq): unknown { const obj: any = {}; message.abbreviation !== undefined && (obj.abbreviation = message.abbreviation); - message.seqNumber !== undefined && (obj.seqNumber = (message.seqNumber || Long.UZERO).toString()); + message.seqNumber !== undefined && (obj.seqNumber = (message.seqNumber || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): CreditTypeSeq { const message = createBaseCreditTypeSeq(); message.abbreviation = object.abbreviation ?? ""; - message.seqNumber = object.seqNumber !== undefined && object.seqNumber !== null ? Long.fromValue(object.seqNumber) : Long.UZERO; + message.seqNumber = object.seqNumber !== undefined && object.seqNumber !== null ? BigInt(object.seqNumber.toString()) : BigInt(0); return message; }, fromAmino(object: CreditTypeSeqAmino): CreditTypeSeq { - return { - abbreviation: object.abbreviation, - seqNumber: Long.fromString(object.seq_number) - }; + const message = createBaseCreditTypeSeq(); + if (object.abbreviation !== undefined && object.abbreviation !== null) { + message.abbreviation = object.abbreviation; + } + if (object.seq_number !== undefined && object.seq_number !== null) { + message.seqNumber = BigInt(object.seq_number); + } + return message; }, toAmino(message: CreditTypeSeq): CreditTypeSeqAmino { const obj: any = {}; - obj.abbreviation = message.abbreviation; - obj.seq_number = message.seqNumber ? message.seqNumber.toString() : undefined; + obj.abbreviation = message.abbreviation === "" ? undefined : message.abbreviation; + obj.seq_number = message.seqNumber !== BigInt(0) ? message.seqNumber.toString() : undefined; return obj; }, fromAminoMsg(object: CreditTypeSeqAminoMsg): CreditTypeSeq { diff --git a/packages/api/src/codegen/regen/intertx/v1/query.lcd.ts b/packages/api/src/codegen/regen/intertx/v1/query.lcd.ts index a02284d9..069ad52d 100644 --- a/packages/api/src/codegen/regen/intertx/v1/query.lcd.ts +++ b/packages/api/src/codegen/regen/intertx/v1/query.lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; import { QueryInterchainAccountRequest, QueryInterchainAccountResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; diff --git a/packages/api/src/codegen/regen/intertx/v1/query.rpc.Query.ts b/packages/api/src/codegen/regen/intertx/v1/query.rpc.Query.ts index 6d46a75b..d0b2289b 100644 --- a/packages/api/src/codegen/regen/intertx/v1/query.rpc.Query.ts +++ b/packages/api/src/codegen/regen/intertx/v1/query.rpc.Query.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryInterchainAccountRequest, QueryInterchainAccountResponse } from "./query"; /** Query defines the gRPC querier service. */ @@ -19,7 +19,7 @@ export class QueryClientImpl implements Query { interchainAccount(request: QueryInterchainAccountRequest): Promise { const data = QueryInterchainAccountRequest.encode(request).finish(); const promise = this.rpc.request("regen.intertx.v1.Query", "InterchainAccount", data); - return promise.then(data => QueryInterchainAccountResponse.decode(new _m0.Reader(data))); + return promise.then(data => QueryInterchainAccountResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { diff --git a/packages/api/src/codegen/regen/intertx/v1/query.ts b/packages/api/src/codegen/regen/intertx/v1/query.ts index 5ee84c3c..659416ef 100644 --- a/packages/api/src/codegen/regen/intertx/v1/query.ts +++ b/packages/api/src/codegen/regen/intertx/v1/query.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** * QueryInterchainAccountRequest is the request type for the @@ -20,9 +20,9 @@ export interface QueryInterchainAccountRequestProtoMsg { */ export interface QueryInterchainAccountRequestAmino { /** owner is the address of the account that owns the ICA. */ - owner: string; + owner?: string; /** connection_id is the connection the ICA claimed. */ - connection_id: string; + connection_id?: string; } export interface QueryInterchainAccountRequestAminoMsg { type: "/regen.intertx.v1.QueryInterchainAccountRequest"; @@ -54,7 +54,7 @@ export interface QueryInterchainAccountResponseProtoMsg { */ export interface QueryInterchainAccountResponseAmino { /** interchain_account_address is the address of the ICA. */ - interchain_account_address: string; + interchain_account_address?: string; } export interface QueryInterchainAccountResponseAminoMsg { type: "/regen.intertx.v1.QueryInterchainAccountResponse"; @@ -74,7 +74,8 @@ function createBaseQueryInterchainAccountRequest(): QueryInterchainAccountReques }; } export const QueryInterchainAccountRequest = { - encode(message: QueryInterchainAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.intertx.v1.QueryInterchainAccountRequest", + encode(message: QueryInterchainAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -83,8 +84,8 @@ export const QueryInterchainAccountRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInterchainAccountRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInterchainAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInterchainAccountRequest(); while (reader.pos < end) { @@ -122,15 +123,19 @@ export const QueryInterchainAccountRequest = { return message; }, fromAmino(object: QueryInterchainAccountRequestAmino): QueryInterchainAccountRequest { - return { - owner: object.owner, - connectionId: object.connection_id - }; + const message = createBaseQueryInterchainAccountRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; }, toAmino(message: QueryInterchainAccountRequest): QueryInterchainAccountRequestAmino { const obj: any = {}; - obj.owner = message.owner; - obj.connection_id = message.connectionId; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; return obj; }, fromAminoMsg(object: QueryInterchainAccountRequestAminoMsg): QueryInterchainAccountRequest { @@ -155,14 +160,15 @@ function createBaseQueryInterchainAccountResponse(): QueryInterchainAccountRespo }; } export const QueryInterchainAccountResponse = { - encode(message: QueryInterchainAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.intertx.v1.QueryInterchainAccountResponse", + encode(message: QueryInterchainAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.interchainAccountAddress !== "") { writer.uint32(10).string(message.interchainAccountAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInterchainAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInterchainAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInterchainAccountResponse(); while (reader.pos < end) { @@ -194,13 +200,15 @@ export const QueryInterchainAccountResponse = { return message; }, fromAmino(object: QueryInterchainAccountResponseAmino): QueryInterchainAccountResponse { - return { - interchainAccountAddress: object.interchain_account_address - }; + const message = createBaseQueryInterchainAccountResponse(); + if (object.interchain_account_address !== undefined && object.interchain_account_address !== null) { + message.interchainAccountAddress = object.interchain_account_address; + } + return message; }, toAmino(message: QueryInterchainAccountResponse): QueryInterchainAccountResponseAmino { const obj: any = {}; - obj.interchain_account_address = message.interchainAccountAddress; + obj.interchain_account_address = message.interchainAccountAddress === "" ? undefined : message.interchainAccountAddress; return obj; }, fromAminoMsg(object: QueryInterchainAccountResponseAminoMsg): QueryInterchainAccountResponse { diff --git a/packages/api/src/codegen/regen/intertx/v1/tx.rpc.msg.ts b/packages/api/src/codegen/regen/intertx/v1/tx.rpc.msg.ts index 3f67e211..23e7216c 100644 --- a/packages/api/src/codegen/regen/intertx/v1/tx.rpc.msg.ts +++ b/packages/api/src/codegen/regen/intertx/v1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader } from "../../../binary"; import { MsgRegisterAccount, MsgRegisterAccountResponse, MsgSubmitTx, MsgSubmitTxResponse } from "./tx"; /** Msg defines the intertx Msg service. */ export interface Msg { @@ -18,11 +18,11 @@ export class MsgClientImpl implements Msg { registerAccount(request: MsgRegisterAccount): Promise { const data = MsgRegisterAccount.encode(request).finish(); const promise = this.rpc.request("regen.intertx.v1.Msg", "RegisterAccount", data); - return promise.then(data => MsgRegisterAccountResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgRegisterAccountResponse.decode(new BinaryReader(data))); } submitTx(request: MsgSubmitTx): Promise { const data = MsgSubmitTx.encode(request).finish(); const promise = this.rpc.request("regen.intertx.v1.Msg", "SubmitTx", data); - return promise.then(data => MsgSubmitTxResponse.decode(new _m0.Reader(data))); + return promise.then(data => MsgSubmitTxResponse.decode(new BinaryReader(data))); } } \ No newline at end of file diff --git a/packages/api/src/codegen/regen/intertx/v1/tx.ts b/packages/api/src/codegen/regen/intertx/v1/tx.ts index 3c90b2f8..ecf73724 100644 --- a/packages/api/src/codegen/regen/intertx/v1/tx.ts +++ b/packages/api/src/codegen/regen/intertx/v1/tx.ts @@ -1,5 +1,5 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** MsgRegisterAccount defines the payload for Msg/RegisterAccount */ export interface MsgRegisterAccount { @@ -21,15 +21,15 @@ export interface MsgRegisterAccountProtoMsg { /** MsgRegisterAccount defines the payload for Msg/RegisterAccount */ export interface MsgRegisterAccountAmino { /** owner is the address of the interchain account owner. */ - owner: string; + owner?: string; /** connection_id is the connection id string (i.e. channel-5). */ - connection_id: string; + connection_id?: string; /** * version is the application version string. For example, this could be an * ICS27 encoded metadata type or an ICS29 encoded metadata type with a nested * application version. */ - version: string; + version?: string; } export interface MsgRegisterAccountAminoMsg { type: "/regen.intertx.v1.MsgRegisterAccount"; @@ -62,7 +62,7 @@ export interface MsgSubmitTx { /** connection_id is the id of the connection. */ connectionId: string; /** msg is the bytes of the transaction msg to send. */ - msg: Any; + msg?: Any; } export interface MsgSubmitTxProtoMsg { typeUrl: "/regen.intertx.v1.MsgSubmitTx"; @@ -71,9 +71,9 @@ export interface MsgSubmitTxProtoMsg { /** MsgSubmitTx defines the payload for Msg/SubmitTx */ export interface MsgSubmitTxAmino { /** owner is the owner address of the interchain account. */ - owner: string; + owner?: string; /** connection_id is the id of the connection. */ - connection_id: string; + connection_id?: string; /** msg is the bytes of the transaction msg to send. */ msg?: AnyAmino; } @@ -85,7 +85,7 @@ export interface MsgSubmitTxAminoMsg { export interface MsgSubmitTxSDKType { owner: string; connection_id: string; - msg: AnySDKType; + msg?: AnySDKType; } /** MsgSubmitTxResponse defines the response for Msg/SubmitTx */ export interface MsgSubmitTxResponse {} @@ -109,7 +109,8 @@ function createBaseMsgRegisterAccount(): MsgRegisterAccount { }; } export const MsgRegisterAccount = { - encode(message: MsgRegisterAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.intertx.v1.MsgRegisterAccount", + encode(message: MsgRegisterAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -121,8 +122,8 @@ export const MsgRegisterAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterAccount(); while (reader.pos < end) { @@ -166,17 +167,23 @@ export const MsgRegisterAccount = { return message; }, fromAmino(object: MsgRegisterAccountAmino): MsgRegisterAccount { - return { - owner: object.owner, - connectionId: object.connection_id, - version: object.version - }; + const message = createBaseMsgRegisterAccount(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; }, toAmino(message: MsgRegisterAccount): MsgRegisterAccountAmino { const obj: any = {}; - obj.owner = message.owner; - obj.connection_id = message.connectionId; - obj.version = message.version; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.version = message.version === "" ? undefined : message.version; return obj; }, fromAminoMsg(object: MsgRegisterAccountAminoMsg): MsgRegisterAccount { @@ -199,11 +206,12 @@ function createBaseMsgRegisterAccountResponse(): MsgRegisterAccountResponse { return {}; } export const MsgRegisterAccountResponse = { - encode(_: MsgRegisterAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.intertx.v1.MsgRegisterAccountResponse", + encode(_: MsgRegisterAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterAccountResponse(); while (reader.pos < end) { @@ -228,7 +236,8 @@ export const MsgRegisterAccountResponse = { return message; }, fromAmino(_: MsgRegisterAccountResponseAmino): MsgRegisterAccountResponse { - return {}; + const message = createBaseMsgRegisterAccountResponse(); + return message; }, toAmino(_: MsgRegisterAccountResponse): MsgRegisterAccountResponseAmino { const obj: any = {}; @@ -258,7 +267,8 @@ function createBaseMsgSubmitTx(): MsgSubmitTx { }; } export const MsgSubmitTx = { - encode(message: MsgSubmitTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.intertx.v1.MsgSubmitTx", + encode(message: MsgSubmitTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -270,8 +280,8 @@ export const MsgSubmitTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitTx(); while (reader.pos < end) { @@ -315,16 +325,22 @@ export const MsgSubmitTx = { return message; }, fromAmino(object: MsgSubmitTxAmino): MsgSubmitTx { - return { - owner: object.owner, - connectionId: object.connection_id, - msg: object?.msg ? Any.fromAmino(object.msg) : undefined - }; + const message = createBaseMsgSubmitTx(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = Any.fromAmino(object.msg); + } + return message; }, toAmino(message: MsgSubmitTx): MsgSubmitTxAmino { const obj: any = {}; - obj.owner = message.owner; - obj.connection_id = message.connectionId; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; obj.msg = message.msg ? Any.toAmino(message.msg) : undefined; return obj; }, @@ -348,11 +364,12 @@ function createBaseMsgSubmitTxResponse(): MsgSubmitTxResponse { return {}; } export const MsgSubmitTxResponse = { - encode(_: MsgSubmitTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/regen.intertx.v1.MsgSubmitTxResponse", + encode(_: MsgSubmitTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitTxResponse(); while (reader.pos < end) { @@ -377,7 +394,8 @@ export const MsgSubmitTxResponse = { return message; }, fromAmino(_: MsgSubmitTxResponseAmino): MsgSubmitTxResponse { - return {}; + const message = createBaseMsgSubmitTxResponse(); + return message; }, toAmino(_: MsgSubmitTxResponse): MsgSubmitTxResponseAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/regen/lcd.ts b/packages/api/src/codegen/regen/lcd.ts index 9dfbf533..006d3f41 100644 --- a/packages/api/src/codegen/regen/lcd.ts +++ b/packages/api/src/codegen/regen/lcd.ts @@ -1,4 +1,4 @@ -import { LCDClient } from "@osmonauts/lcd"; +import { LCDClient } from "@cosmology/lcd"; export const createLCDClient = async ({ restEndpoint }: { diff --git a/packages/api/src/codegen/tendermint/abci/types.ts b/packages/api/src/codegen/tendermint/abci/types.ts index eb107cdb..8a083802 100644 --- a/packages/api/src/codegen/tendermint/abci/types.ts +++ b/packages/api/src/codegen/tendermint/abci/types.ts @@ -1,10 +1,10 @@ -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../google/protobuf/timestamp"; import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../types/params"; import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; -import { Long, isSet, fromJsonTimestamp, bytesFromBase64, fromTimestamp, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, fromJsonTimestamp, bytesFromBase64, fromTimestamp, base64FromBytes } from "../../helpers"; export enum CheckTxType { NEW = 0, RECHECK = 1, @@ -307,7 +307,7 @@ export interface RequestEchoProtoMsg { value: Uint8Array; } export interface RequestEchoAmino { - message: string; + message?: string; } export interface RequestEchoAminoMsg { type: "/tendermint.abci.RequestEcho"; @@ -329,8 +329,8 @@ export interface RequestFlushAminoMsg { export interface RequestFlushSDKType {} export interface RequestInfo { version: string; - blockVersion: Long; - p2pVersion: Long; + blockVersion: bigint; + p2pVersion: bigint; abciVersion: string; } export interface RequestInfoProtoMsg { @@ -338,10 +338,10 @@ export interface RequestInfoProtoMsg { value: Uint8Array; } export interface RequestInfoAmino { - version: string; - block_version: string; - p2p_version: string; - abci_version: string; + version?: string; + block_version?: string; + p2p_version?: string; + abci_version?: string; } export interface RequestInfoAminoMsg { type: "/tendermint.abci.RequestInfo"; @@ -349,29 +349,29 @@ export interface RequestInfoAminoMsg { } export interface RequestInfoSDKType { version: string; - block_version: Long; - p2p_version: Long; + block_version: bigint; + p2p_version: bigint; abci_version: string; } export interface RequestInitChain { time: Timestamp; chainId: string; - consensusParams: ConsensusParams; + consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appStateBytes: Uint8Array; - initialHeight: Long; + initialHeight: bigint; } export interface RequestInitChainProtoMsg { typeUrl: "/tendermint.abci.RequestInitChain"; value: Uint8Array; } export interface RequestInitChainAmino { - time?: TimestampAmino; - chain_id: string; + time?: string; + chain_id?: string; consensus_params?: ConsensusParamsAmino; - validators: ValidatorUpdateAmino[]; - app_state_bytes: Uint8Array; - initial_height: string; + validators?: ValidatorUpdateAmino[]; + app_state_bytes?: string; + initial_height?: string; } export interface RequestInitChainAminoMsg { type: "/tendermint.abci.RequestInitChain"; @@ -380,15 +380,15 @@ export interface RequestInitChainAminoMsg { export interface RequestInitChainSDKType { time: TimestampSDKType; chain_id: string; - consensus_params: ConsensusParamsSDKType; + consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_state_bytes: Uint8Array; - initial_height: Long; + initial_height: bigint; } export interface RequestQuery { data: Uint8Array; path: string; - height: Long; + height: bigint; prove: boolean; } export interface RequestQueryProtoMsg { @@ -396,10 +396,10 @@ export interface RequestQueryProtoMsg { value: Uint8Array; } export interface RequestQueryAmino { - data: Uint8Array; - path: string; - height: string; - prove: boolean; + data?: string; + path?: string; + height?: string; + prove?: boolean; } export interface RequestQueryAminoMsg { type: "/tendermint.abci.RequestQuery"; @@ -408,7 +408,7 @@ export interface RequestQueryAminoMsg { export interface RequestQuerySDKType { data: Uint8Array; path: string; - height: Long; + height: bigint; prove: boolean; } export interface RequestBeginBlock { @@ -422,10 +422,10 @@ export interface RequestBeginBlockProtoMsg { value: Uint8Array; } export interface RequestBeginBlockAmino { - hash: Uint8Array; + hash?: string; header?: HeaderAmino; last_commit_info?: CommitInfoAmino; - byzantine_validators: MisbehaviorAmino[]; + byzantine_validators?: MisbehaviorAmino[]; } export interface RequestBeginBlockAminoMsg { type: "/tendermint.abci.RequestBeginBlock"; @@ -446,8 +446,8 @@ export interface RequestCheckTxProtoMsg { value: Uint8Array; } export interface RequestCheckTxAmino { - tx: Uint8Array; - type: CheckTxType; + tx?: string; + type?: CheckTxType; } export interface RequestCheckTxAminoMsg { type: "/tendermint.abci.RequestCheckTx"; @@ -465,7 +465,7 @@ export interface RequestDeliverTxProtoMsg { value: Uint8Array; } export interface RequestDeliverTxAmino { - tx: Uint8Array; + tx?: string; } export interface RequestDeliverTxAminoMsg { type: "/tendermint.abci.RequestDeliverTx"; @@ -475,21 +475,21 @@ export interface RequestDeliverTxSDKType { tx: Uint8Array; } export interface RequestEndBlock { - height: Long; + height: bigint; } export interface RequestEndBlockProtoMsg { typeUrl: "/tendermint.abci.RequestEndBlock"; value: Uint8Array; } export interface RequestEndBlockAmino { - height: string; + height?: string; } export interface RequestEndBlockAminoMsg { type: "/tendermint.abci.RequestEndBlock"; value: RequestEndBlockAmino; } export interface RequestEndBlockSDKType { - height: Long; + height: bigint; } export interface RequestCommit {} export interface RequestCommitProtoMsg { @@ -519,7 +519,7 @@ export interface RequestListSnapshotsSDKType {} /** offers a snapshot to the application */ export interface RequestOfferSnapshot { /** snapshot offered by peers */ - snapshot: Snapshot; + snapshot?: Snapshot; /** light client-verified app hash for snapshot height */ appHash: Uint8Array; } @@ -532,7 +532,7 @@ export interface RequestOfferSnapshotAmino { /** snapshot offered by peers */ snapshot?: SnapshotAmino; /** light client-verified app hash for snapshot height */ - app_hash: Uint8Array; + app_hash?: string; } export interface RequestOfferSnapshotAminoMsg { type: "/tendermint.abci.RequestOfferSnapshot"; @@ -540,12 +540,12 @@ export interface RequestOfferSnapshotAminoMsg { } /** offers a snapshot to the application */ export interface RequestOfferSnapshotSDKType { - snapshot: SnapshotSDKType; + snapshot?: SnapshotSDKType; app_hash: Uint8Array; } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunk { - height: Long; + height: bigint; format: number; chunk: number; } @@ -555,9 +555,9 @@ export interface RequestLoadSnapshotChunkProtoMsg { } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkAmino { - height: string; - format: number; - chunk: number; + height?: string; + format?: number; + chunk?: number; } export interface RequestLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.RequestLoadSnapshotChunk"; @@ -565,7 +565,7 @@ export interface RequestLoadSnapshotChunkAminoMsg { } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkSDKType { - height: Long; + height: bigint; format: number; chunk: number; } @@ -581,9 +581,9 @@ export interface RequestApplySnapshotChunkProtoMsg { } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunkAmino { - index: number; - chunk: Uint8Array; - sender: string; + index?: number; + chunk?: string; + sender?: string; } export interface RequestApplySnapshotChunkAminoMsg { type: "/tendermint.abci.RequestApplySnapshotChunk"; @@ -597,7 +597,7 @@ export interface RequestApplySnapshotChunkSDKType { } export interface RequestPrepareProposal { /** the modified transactions cannot exceed this size. */ - maxTxBytes: Long; + maxTxBytes: bigint; /** * txs is an array of transactions that will be included in a block, * sent to the app for possible modifications. @@ -605,7 +605,7 @@ export interface RequestPrepareProposal { txs: Uint8Array[]; localLastCommit: ExtendedCommitInfo; misbehavior: Misbehavior[]; - height: Long; + height: bigint; time: Timestamp; nextValidatorsHash: Uint8Array; /** address of the public key of the validator proposing the block. */ @@ -617,30 +617,30 @@ export interface RequestPrepareProposalProtoMsg { } export interface RequestPrepareProposalAmino { /** the modified transactions cannot exceed this size. */ - max_tx_bytes: string; + max_tx_bytes?: string; /** * txs is an array of transactions that will be included in a block, * sent to the app for possible modifications. */ - txs: Uint8Array[]; + txs?: string[]; local_last_commit?: ExtendedCommitInfoAmino; - misbehavior: MisbehaviorAmino[]; - height: string; - time?: TimestampAmino; - next_validators_hash: Uint8Array; + misbehavior?: MisbehaviorAmino[]; + height?: string; + time?: string; + next_validators_hash?: string; /** address of the public key of the validator proposing the block. */ - proposer_address: Uint8Array; + proposer_address?: string; } export interface RequestPrepareProposalAminoMsg { type: "/tendermint.abci.RequestPrepareProposal"; value: RequestPrepareProposalAmino; } export interface RequestPrepareProposalSDKType { - max_tx_bytes: Long; + max_tx_bytes: bigint; txs: Uint8Array[]; local_last_commit: ExtendedCommitInfoSDKType; misbehavior: MisbehaviorSDKType[]; - height: Long; + height: bigint; time: TimestampSDKType; next_validators_hash: Uint8Array; proposer_address: Uint8Array; @@ -651,7 +651,7 @@ export interface RequestProcessProposal { misbehavior: Misbehavior[]; /** hash is the merkle root hash of the fields of the proposed block. */ hash: Uint8Array; - height: Long; + height: bigint; time: Timestamp; nextValidatorsHash: Uint8Array; /** address of the public key of the original proposer of the block. */ @@ -662,16 +662,16 @@ export interface RequestProcessProposalProtoMsg { value: Uint8Array; } export interface RequestProcessProposalAmino { - txs: Uint8Array[]; + txs?: string[]; proposed_last_commit?: CommitInfoAmino; - misbehavior: MisbehaviorAmino[]; + misbehavior?: MisbehaviorAmino[]; /** hash is the merkle root hash of the fields of the proposed block. */ - hash: Uint8Array; - height: string; - time?: TimestampAmino; - next_validators_hash: Uint8Array; + hash?: string; + height?: string; + time?: string; + next_validators_hash?: string; /** address of the public key of the original proposer of the block. */ - proposer_address: Uint8Array; + proposer_address?: string; } export interface RequestProcessProposalAminoMsg { type: "/tendermint.abci.RequestProcessProposal"; @@ -682,7 +682,7 @@ export interface RequestProcessProposalSDKType { proposed_last_commit: CommitInfoSDKType; misbehavior: MisbehaviorSDKType[]; hash: Uint8Array; - height: Long; + height: bigint; time: TimestampSDKType; next_validators_hash: Uint8Array; proposer_address: Uint8Array; @@ -762,7 +762,7 @@ export interface ResponseExceptionProtoMsg { } /** nondeterministic */ export interface ResponseExceptionAmino { - error: string; + error?: string; } export interface ResponseExceptionAminoMsg { type: "/tendermint.abci.ResponseException"; @@ -780,7 +780,7 @@ export interface ResponseEchoProtoMsg { value: Uint8Array; } export interface ResponseEchoAmino { - message: string; + message?: string; } export interface ResponseEchoAminoMsg { type: "/tendermint.abci.ResponseEcho"; @@ -803,8 +803,8 @@ export interface ResponseFlushSDKType {} export interface ResponseInfo { data: string; version: string; - appVersion: Long; - lastBlockHeight: Long; + appVersion: bigint; + lastBlockHeight: bigint; lastBlockAppHash: Uint8Array; } export interface ResponseInfoProtoMsg { @@ -812,11 +812,11 @@ export interface ResponseInfoProtoMsg { value: Uint8Array; } export interface ResponseInfoAmino { - data: string; - version: string; - app_version: string; - last_block_height: string; - last_block_app_hash: Uint8Array; + data?: string; + version?: string; + app_version?: string; + last_block_height?: string; + last_block_app_hash?: string; } export interface ResponseInfoAminoMsg { type: "/tendermint.abci.ResponseInfo"; @@ -825,12 +825,12 @@ export interface ResponseInfoAminoMsg { export interface ResponseInfoSDKType { data: string; version: string; - app_version: Long; - last_block_height: Long; + app_version: bigint; + last_block_height: bigint; last_block_app_hash: Uint8Array; } export interface ResponseInitChain { - consensusParams: ConsensusParams; + consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appHash: Uint8Array; } @@ -840,15 +840,15 @@ export interface ResponseInitChainProtoMsg { } export interface ResponseInitChainAmino { consensus_params?: ConsensusParamsAmino; - validators: ValidatorUpdateAmino[]; - app_hash: Uint8Array; + validators?: ValidatorUpdateAmino[]; + app_hash?: string; } export interface ResponseInitChainAminoMsg { type: "/tendermint.abci.ResponseInitChain"; value: ResponseInitChainAmino; } export interface ResponseInitChainSDKType { - consensus_params: ConsensusParamsSDKType; + consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_hash: Uint8Array; } @@ -858,11 +858,11 @@ export interface ResponseQuery { log: string; /** nondeterministic */ info: string; - index: Long; + index: bigint; key: Uint8Array; value: Uint8Array; - proofOps: ProofOps; - height: Long; + proofOps?: ProofOps; + height: bigint; codespace: string; } export interface ResponseQueryProtoMsg { @@ -870,17 +870,17 @@ export interface ResponseQueryProtoMsg { value: Uint8Array; } export interface ResponseQueryAmino { - code: number; + code?: number; /** bytes data = 2; // use "value" instead. */ - log: string; + log?: string; /** nondeterministic */ - info: string; - index: string; - key: Uint8Array; - value: Uint8Array; + info?: string; + index?: string; + key?: string; + value?: string; proof_ops?: ProofOpsAmino; - height: string; - codespace: string; + height?: string; + codespace?: string; } export interface ResponseQueryAminoMsg { type: "/tendermint.abci.ResponseQuery"; @@ -890,11 +890,11 @@ export interface ResponseQuerySDKType { code: number; log: string; info: string; - index: Long; + index: bigint; key: Uint8Array; value: Uint8Array; - proof_ops: ProofOpsSDKType; - height: Long; + proof_ops?: ProofOpsSDKType; + height: bigint; codespace: string; } export interface ResponseBeginBlock { @@ -905,7 +905,7 @@ export interface ResponseBeginBlockProtoMsg { value: Uint8Array; } export interface ResponseBeginBlockAmino { - events: EventAmino[]; + events?: EventAmino[]; } export interface ResponseBeginBlockAminoMsg { type: "/tendermint.abci.ResponseBeginBlock"; @@ -921,12 +921,12 @@ export interface ResponseCheckTx { log: string; /** nondeterministic */ info: string; - gasWanted: Long; - gasUsed: Long; + gasWanted: bigint; + gasUsed: bigint; events: Event[]; codespace: string; sender: string; - priority: Long; + priority: bigint; /** * mempool_error is set by CometBFT. * ABCI applictions creating a ResponseCheckTX should not set mempool_error. @@ -938,23 +938,23 @@ export interface ResponseCheckTxProtoMsg { value: Uint8Array; } export interface ResponseCheckTxAmino { - code: number; - data: Uint8Array; + code?: number; + data?: string; /** nondeterministic */ - log: string; + log?: string; /** nondeterministic */ - info: string; - gas_wanted: string; - gas_used: string; - events: EventAmino[]; - codespace: string; - sender: string; - priority: string; + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; + sender?: string; + priority?: string; /** * mempool_error is set by CometBFT. * ABCI applictions creating a ResponseCheckTX should not set mempool_error. */ - mempool_error: string; + mempool_error?: string; } export interface ResponseCheckTxAminoMsg { type: "/tendermint.abci.ResponseCheckTx"; @@ -965,12 +965,12 @@ export interface ResponseCheckTxSDKType { data: Uint8Array; log: string; info: string; - gas_wanted: Long; - gas_used: Long; + gas_wanted: bigint; + gas_used: bigint; events: EventSDKType[]; codespace: string; sender: string; - priority: Long; + priority: bigint; mempool_error: string; } export interface ResponseDeliverTx { @@ -980,8 +980,8 @@ export interface ResponseDeliverTx { log: string; /** nondeterministic */ info: string; - gasWanted: Long; - gasUsed: Long; + gasWanted: bigint; + gasUsed: bigint; events: Event[]; codespace: string; } @@ -990,16 +990,16 @@ export interface ResponseDeliverTxProtoMsg { value: Uint8Array; } export interface ResponseDeliverTxAmino { - code: number; - data: Uint8Array; + code?: number; + data?: string; /** nondeterministic */ - log: string; + log?: string; /** nondeterministic */ - info: string; - gas_wanted: string; - gas_used: string; - events: EventAmino[]; - codespace: string; + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; } export interface ResponseDeliverTxAminoMsg { type: "/tendermint.abci.ResponseDeliverTx"; @@ -1010,14 +1010,14 @@ export interface ResponseDeliverTxSDKType { data: Uint8Array; log: string; info: string; - gas_wanted: Long; - gas_used: Long; + gas_wanted: bigint; + gas_used: bigint; events: EventSDKType[]; codespace: string; } export interface ResponseEndBlock { validatorUpdates: ValidatorUpdate[]; - consensusParamUpdates: ConsensusParams; + consensusParamUpdates?: ConsensusParams; events: Event[]; } export interface ResponseEndBlockProtoMsg { @@ -1025,9 +1025,9 @@ export interface ResponseEndBlockProtoMsg { value: Uint8Array; } export interface ResponseEndBlockAmino { - validator_updates: ValidatorUpdateAmino[]; + validator_updates?: ValidatorUpdateAmino[]; consensus_param_updates?: ConsensusParamsAmino; - events: EventAmino[]; + events?: EventAmino[]; } export interface ResponseEndBlockAminoMsg { type: "/tendermint.abci.ResponseEndBlock"; @@ -1035,13 +1035,13 @@ export interface ResponseEndBlockAminoMsg { } export interface ResponseEndBlockSDKType { validator_updates: ValidatorUpdateSDKType[]; - consensus_param_updates: ConsensusParamsSDKType; + consensus_param_updates?: ConsensusParamsSDKType; events: EventSDKType[]; } export interface ResponseCommit { /** reserve 1 */ data: Uint8Array; - retainHeight: Long; + retainHeight: bigint; } export interface ResponseCommitProtoMsg { typeUrl: "/tendermint.abci.ResponseCommit"; @@ -1049,8 +1049,8 @@ export interface ResponseCommitProtoMsg { } export interface ResponseCommitAmino { /** reserve 1 */ - data: Uint8Array; - retain_height: string; + data?: string; + retain_height?: string; } export interface ResponseCommitAminoMsg { type: "/tendermint.abci.ResponseCommit"; @@ -1058,7 +1058,7 @@ export interface ResponseCommitAminoMsg { } export interface ResponseCommitSDKType { data: Uint8Array; - retain_height: Long; + retain_height: bigint; } export interface ResponseListSnapshots { snapshots: Snapshot[]; @@ -1068,7 +1068,7 @@ export interface ResponseListSnapshotsProtoMsg { value: Uint8Array; } export interface ResponseListSnapshotsAmino { - snapshots: SnapshotAmino[]; + snapshots?: SnapshotAmino[]; } export interface ResponseListSnapshotsAminoMsg { type: "/tendermint.abci.ResponseListSnapshots"; @@ -1085,7 +1085,7 @@ export interface ResponseOfferSnapshotProtoMsg { value: Uint8Array; } export interface ResponseOfferSnapshotAmino { - result: ResponseOfferSnapshot_Result; + result?: ResponseOfferSnapshot_Result; } export interface ResponseOfferSnapshotAminoMsg { type: "/tendermint.abci.ResponseOfferSnapshot"; @@ -1102,7 +1102,7 @@ export interface ResponseLoadSnapshotChunkProtoMsg { value: Uint8Array; } export interface ResponseLoadSnapshotChunkAmino { - chunk: Uint8Array; + chunk?: string; } export interface ResponseLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseLoadSnapshotChunk"; @@ -1123,11 +1123,11 @@ export interface ResponseApplySnapshotChunkProtoMsg { value: Uint8Array; } export interface ResponseApplySnapshotChunkAmino { - result: ResponseApplySnapshotChunk_Result; + result?: ResponseApplySnapshotChunk_Result; /** Chunks to refetch and reapply */ - refetch_chunks: number[]; + refetch_chunks?: number[]; /** Chunk senders to reject and ban */ - reject_senders: string[]; + reject_senders?: string[]; } export interface ResponseApplySnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseApplySnapshotChunk"; @@ -1146,7 +1146,7 @@ export interface ResponsePrepareProposalProtoMsg { value: Uint8Array; } export interface ResponsePrepareProposalAmino { - txs: Uint8Array[]; + txs?: string[]; } export interface ResponsePrepareProposalAminoMsg { type: "/tendermint.abci.ResponsePrepareProposal"; @@ -1163,7 +1163,7 @@ export interface ResponseProcessProposalProtoMsg { value: Uint8Array; } export interface ResponseProcessProposalAmino { - status: ResponseProcessProposal_ProposalStatus; + status?: ResponseProcessProposal_ProposalStatus; } export interface ResponseProcessProposalAminoMsg { type: "/tendermint.abci.ResponseProcessProposal"; @@ -1181,8 +1181,8 @@ export interface CommitInfoProtoMsg { value: Uint8Array; } export interface CommitInfoAmino { - round: number; - votes: VoteInfoAmino[]; + round?: number; + votes?: VoteInfoAmino[]; } export interface CommitInfoAminoMsg { type: "/tendermint.abci.CommitInfo"; @@ -1207,12 +1207,12 @@ export interface ExtendedCommitInfoProtoMsg { } export interface ExtendedCommitInfoAmino { /** The round at which the block proposer decided in the previous height. */ - round: number; + round?: number; /** * List of validators' addresses in the last validator set with their voting * information, including vote extensions. */ - votes: ExtendedVoteInfoAmino[]; + votes?: ExtendedVoteInfoAmino[]; } export interface ExtendedCommitInfoAminoMsg { type: "/tendermint.abci.ExtendedCommitInfo"; @@ -1241,8 +1241,8 @@ export interface EventProtoMsg { * Later, transactions may be queried using these events. */ export interface EventAmino { - type: string; - attributes: EventAttributeAmino[]; + type?: string; + attributes?: EventAttributeAmino[]; } export interface EventAminoMsg { type: "/tendermint.abci.Event"; @@ -1270,10 +1270,10 @@ export interface EventAttributeProtoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeAmino { - key: string; - value: string; + key?: string; + value?: string; /** nondeterministic */ - index: boolean; + index?: boolean; } export interface EventAttributeAminoMsg { type: "/tendermint.abci.EventAttribute"; @@ -1291,7 +1291,7 @@ export interface EventAttributeSDKType { * One usage is indexing transaction results. */ export interface TxResult { - height: Long; + height: bigint; index: number; tx: Uint8Array; result: ResponseDeliverTx; @@ -1306,9 +1306,9 @@ export interface TxResultProtoMsg { * One usage is indexing transaction results. */ export interface TxResultAmino { - height: string; - index: number; - tx: Uint8Array; + height?: string; + index?: number; + tx?: string; result?: ResponseDeliverTxAmino; } export interface TxResultAminoMsg { @@ -1321,7 +1321,7 @@ export interface TxResultAminoMsg { * One usage is indexing transaction results. */ export interface TxResultSDKType { - height: Long; + height: bigint; index: number; tx: Uint8Array; result: ResponseDeliverTxSDKType; @@ -1334,7 +1334,7 @@ export interface Validator { */ address: Uint8Array; /** The voting power */ - power: Long; + power: bigint; } export interface ValidatorProtoMsg { typeUrl: "/tendermint.abci.Validator"; @@ -1346,9 +1346,9 @@ export interface ValidatorAmino { * The first 20 bytes of SHA256(public key) * PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ - address: Uint8Array; + address?: string; /** The voting power */ - power: string; + power?: string; } export interface ValidatorAminoMsg { type: "/tendermint.abci.Validator"; @@ -1357,12 +1357,12 @@ export interface ValidatorAminoMsg { /** Validator */ export interface ValidatorSDKType { address: Uint8Array; - power: Long; + power: bigint; } /** ValidatorUpdate */ export interface ValidatorUpdate { pubKey: PublicKey; - power: Long; + power: bigint; } export interface ValidatorUpdateProtoMsg { typeUrl: "/tendermint.abci.ValidatorUpdate"; @@ -1371,7 +1371,7 @@ export interface ValidatorUpdateProtoMsg { /** ValidatorUpdate */ export interface ValidatorUpdateAmino { pub_key?: PublicKeyAmino; - power: string; + power?: string; } export interface ValidatorUpdateAminoMsg { type: "/tendermint.abci.ValidatorUpdate"; @@ -1380,7 +1380,7 @@ export interface ValidatorUpdateAminoMsg { /** ValidatorUpdate */ export interface ValidatorUpdateSDKType { pub_key: PublicKeySDKType; - power: Long; + power: bigint; } /** VoteInfo */ export interface VoteInfo { @@ -1394,7 +1394,7 @@ export interface VoteInfoProtoMsg { /** VoteInfo */ export interface VoteInfoAmino { validator?: ValidatorAmino; - signed_last_block: boolean; + signed_last_block?: boolean; } export interface VoteInfoAminoMsg { type: "/tendermint.abci.VoteInfo"; @@ -1417,9 +1417,9 @@ export interface ExtendedVoteInfoProtoMsg { } export interface ExtendedVoteInfoAmino { validator?: ValidatorAmino; - signed_last_block: boolean; + signed_last_block?: boolean; /** Reserved for future use */ - vote_extension: Uint8Array; + vote_extension?: string; } export interface ExtendedVoteInfoAminoMsg { type: "/tendermint.abci.ExtendedVoteInfo"; @@ -1435,7 +1435,7 @@ export interface Misbehavior { /** The offending validator */ validator: Validator; /** The height when the offense occurred */ - height: Long; + height: bigint; /** The corresponding time where the offense occurred */ time: Timestamp; /** @@ -1443,26 +1443,26 @@ export interface Misbehavior { * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ - totalVotingPower: Long; + totalVotingPower: bigint; } export interface MisbehaviorProtoMsg { typeUrl: "/tendermint.abci.Misbehavior"; value: Uint8Array; } export interface MisbehaviorAmino { - type: MisbehaviorType; + type?: MisbehaviorType; /** The offending validator */ validator?: ValidatorAmino; /** The height when the offense occurred */ - height: string; + height?: string; /** The corresponding time where the offense occurred */ - time?: TimestampAmino; + time?: string; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ - total_voting_power: string; + total_voting_power?: string; } export interface MisbehaviorAminoMsg { type: "/tendermint.abci.Misbehavior"; @@ -1471,13 +1471,13 @@ export interface MisbehaviorAminoMsg { export interface MisbehaviorSDKType { type: MisbehaviorType; validator: ValidatorSDKType; - height: Long; + height: bigint; time: TimestampSDKType; - total_voting_power: Long; + total_voting_power: bigint; } export interface Snapshot { /** The height at which the snapshot was taken */ - height: Long; + height: bigint; /** The application-specific snapshot format */ format: number; /** Number of chunks in the snapshot */ @@ -1493,22 +1493,22 @@ export interface SnapshotProtoMsg { } export interface SnapshotAmino { /** The height at which the snapshot was taken */ - height: string; + height?: string; /** The application-specific snapshot format */ - format: number; + format?: number; /** Number of chunks in the snapshot */ - chunks: number; + chunks?: number; /** Arbitrary snapshot hash, equal only if identical */ - hash: Uint8Array; + hash?: string; /** Arbitrary application metadata */ - metadata: Uint8Array; + metadata?: string; } export interface SnapshotAminoMsg { type: "/tendermint.abci.Snapshot"; value: SnapshotAmino; } export interface SnapshotSDKType { - height: Long; + height: bigint; format: number; chunks: number; hash: Uint8Array; @@ -1535,7 +1535,8 @@ function createBaseRequest(): Request { }; } export const Request = { - encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.Request", + encode(message: Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.echo !== undefined) { RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); } @@ -1586,8 +1587,8 @@ export const Request = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Request { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Request { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequest(); while (reader.pos < end) { @@ -1709,24 +1710,56 @@ export const Request = { return message; }, fromAmino(object: RequestAmino): Request { - return { - echo: object?.echo ? RequestEcho.fromAmino(object.echo) : undefined, - flush: object?.flush ? RequestFlush.fromAmino(object.flush) : undefined, - info: object?.info ? RequestInfo.fromAmino(object.info) : undefined, - initChain: object?.init_chain ? RequestInitChain.fromAmino(object.init_chain) : undefined, - query: object?.query ? RequestQuery.fromAmino(object.query) : undefined, - beginBlock: object?.begin_block ? RequestBeginBlock.fromAmino(object.begin_block) : undefined, - checkTx: object?.check_tx ? RequestCheckTx.fromAmino(object.check_tx) : undefined, - deliverTx: object?.deliver_tx ? RequestDeliverTx.fromAmino(object.deliver_tx) : undefined, - endBlock: object?.end_block ? RequestEndBlock.fromAmino(object.end_block) : undefined, - commit: object?.commit ? RequestCommit.fromAmino(object.commit) : undefined, - listSnapshots: object?.list_snapshots ? RequestListSnapshots.fromAmino(object.list_snapshots) : undefined, - offerSnapshot: object?.offer_snapshot ? RequestOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, - loadSnapshotChunk: object?.load_snapshot_chunk ? RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined, - prepareProposal: object?.prepare_proposal ? RequestPrepareProposal.fromAmino(object.prepare_proposal) : undefined, - processProposal: object?.process_proposal ? RequestProcessProposal.fromAmino(object.process_proposal) : undefined - }; + const message = createBaseRequest(); + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromAmino(object.info); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = RequestInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = RequestBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = RequestCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = RequestDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = RequestEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = RequestPrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = RequestProcessProposal.fromAmino(object.process_proposal); + } + return message; }, toAmino(message: Request): RequestAmino { const obj: any = {}; @@ -1770,14 +1803,15 @@ function createBaseRequestEcho(): RequestEcho { }; } export const RequestEcho = { - encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestEcho", + encode(message: RequestEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestEcho(); while (reader.pos < end) { @@ -1809,13 +1843,15 @@ export const RequestEcho = { return message; }, fromAmino(object: RequestEchoAmino): RequestEcho { - return { - message: object.message - }; + const message = createBaseRequestEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; }, toAmino(message: RequestEcho): RequestEchoAmino { const obj: any = {}; - obj.message = message.message; + obj.message = message.message === "" ? undefined : message.message; return obj; }, fromAminoMsg(object: RequestEchoAminoMsg): RequestEcho { @@ -1838,11 +1874,12 @@ function createBaseRequestFlush(): RequestFlush { return {}; } export const RequestFlush = { - encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestFlush", + encode(_: RequestFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestFlush(); while (reader.pos < end) { @@ -1867,7 +1904,8 @@ export const RequestFlush = { return message; }, fromAmino(_: RequestFlushAmino): RequestFlush { - return {}; + const message = createBaseRequestFlush(); + return message; }, toAmino(_: RequestFlush): RequestFlushAmino { const obj: any = {}; @@ -1892,20 +1930,21 @@ export const RequestFlush = { function createBaseRequestInfo(): RequestInfo { return { version: "", - blockVersion: Long.UZERO, - p2pVersion: Long.UZERO, + blockVersion: BigInt(0), + p2pVersion: BigInt(0), abciVersion: "" }; } export const RequestInfo = { - encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestInfo", + encode(message: RequestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); } - if (!message.blockVersion.isZero()) { + if (message.blockVersion !== BigInt(0)) { writer.uint32(16).uint64(message.blockVersion); } - if (!message.p2pVersion.isZero()) { + if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } if (message.abciVersion !== "") { @@ -1913,8 +1952,8 @@ export const RequestInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestInfo(); while (reader.pos < end) { @@ -1924,10 +1963,10 @@ export const RequestInfo = { message.version = reader.string(); break; case 2: - message.blockVersion = (reader.uint64() as Long); + message.blockVersion = reader.uint64(); break; case 3: - message.p2pVersion = (reader.uint64() as Long); + message.p2pVersion = reader.uint64(); break; case 4: message.abciVersion = reader.string(); @@ -1942,41 +1981,49 @@ export const RequestInfo = { fromJSON(object: any): RequestInfo { return { version: isSet(object.version) ? String(object.version) : "", - blockVersion: isSet(object.blockVersion) ? Long.fromValue(object.blockVersion) : Long.UZERO, - p2pVersion: isSet(object.p2pVersion) ? Long.fromValue(object.p2pVersion) : Long.UZERO, + blockVersion: isSet(object.blockVersion) ? BigInt(object.blockVersion.toString()) : BigInt(0), + p2pVersion: isSet(object.p2pVersion) ? BigInt(object.p2pVersion.toString()) : BigInt(0), abciVersion: isSet(object.abciVersion) ? String(object.abciVersion) : "" }; }, toJSON(message: RequestInfo): unknown { const obj: any = {}; message.version !== undefined && (obj.version = message.version); - message.blockVersion !== undefined && (obj.blockVersion = (message.blockVersion || Long.UZERO).toString()); - message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || Long.UZERO).toString()); + message.blockVersion !== undefined && (obj.blockVersion = (message.blockVersion || BigInt(0)).toString()); + message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || BigInt(0)).toString()); message.abciVersion !== undefined && (obj.abciVersion = message.abciVersion); return obj; }, fromPartial(object: Partial): RequestInfo { const message = createBaseRequestInfo(); message.version = object.version ?? ""; - message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? Long.fromValue(object.blockVersion) : Long.UZERO; - message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? Long.fromValue(object.p2pVersion) : Long.UZERO; + message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); + message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); message.abciVersion = object.abciVersion ?? ""; return message; }, fromAmino(object: RequestInfoAmino): RequestInfo { - return { - version: object.version, - blockVersion: Long.fromString(object.block_version), - p2pVersion: Long.fromString(object.p2p_version), - abciVersion: object.abci_version - }; + const message = createBaseRequestInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.block_version !== undefined && object.block_version !== null) { + message.blockVersion = BigInt(object.block_version); + } + if (object.p2p_version !== undefined && object.p2p_version !== null) { + message.p2pVersion = BigInt(object.p2p_version); + } + if (object.abci_version !== undefined && object.abci_version !== null) { + message.abciVersion = object.abci_version; + } + return message; }, toAmino(message: RequestInfo): RequestInfoAmino { const obj: any = {}; - obj.version = message.version; - obj.block_version = message.blockVersion ? message.blockVersion.toString() : undefined; - obj.p2p_version = message.p2pVersion ? message.p2pVersion.toString() : undefined; - obj.abci_version = message.abciVersion; + obj.version = message.version === "" ? undefined : message.version; + obj.block_version = message.blockVersion !== BigInt(0) ? message.blockVersion.toString() : undefined; + obj.p2p_version = message.p2pVersion !== BigInt(0) ? message.p2pVersion.toString() : undefined; + obj.abci_version = message.abciVersion === "" ? undefined : message.abciVersion; return obj; }, fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { @@ -1997,16 +2044,17 @@ export const RequestInfo = { }; function createBaseRequestInitChain(): RequestInitChain { return { - time: undefined, + time: Timestamp.fromPartial({}), chainId: "", - consensusParams: ConsensusParams.fromPartial({}), + consensusParams: undefined, validators: [], appStateBytes: new Uint8Array(), - initialHeight: Long.ZERO + initialHeight: BigInt(0) }; } export const RequestInitChain = { - encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestInitChain", + encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.time !== undefined) { Timestamp.encode(message.time, writer.uint32(10).fork()).ldelim(); } @@ -2022,13 +2070,13 @@ export const RequestInitChain = { if (message.appStateBytes.length !== 0) { writer.uint32(42).bytes(message.appStateBytes); } - if (!message.initialHeight.isZero()) { + if (message.initialHeight !== BigInt(0)) { writer.uint32(48).int64(message.initialHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestInitChain(); while (reader.pos < end) { @@ -2050,7 +2098,7 @@ export const RequestInitChain = { message.appStateBytes = reader.bytes(); break; case 6: - message.initialHeight = (reader.int64() as Long); + message.initialHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -2066,7 +2114,7 @@ export const RequestInitChain = { consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)) : [], appStateBytes: isSet(object.appStateBytes) ? bytesFromBase64(object.appStateBytes) : new Uint8Array(), - initialHeight: isSet(object.initialHeight) ? Long.fromValue(object.initialHeight) : Long.ZERO + initialHeight: isSet(object.initialHeight) ? BigInt(object.initialHeight.toString()) : BigInt(0) }; }, toJSON(message: RequestInitChain): unknown { @@ -2080,7 +2128,7 @@ export const RequestInitChain = { obj.validators = []; } message.appStateBytes !== undefined && (obj.appStateBytes = base64FromBytes(message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array())); - message.initialHeight !== undefined && (obj.initialHeight = (message.initialHeight || Long.ZERO).toString()); + message.initialHeight !== undefined && (obj.initialHeight = (message.initialHeight || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): RequestInitChain { @@ -2090,31 +2138,41 @@ export const RequestInitChain = { message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; message.appStateBytes = object.appStateBytes ?? new Uint8Array(); - message.initialHeight = object.initialHeight !== undefined && object.initialHeight !== null ? Long.fromValue(object.initialHeight) : Long.ZERO; + message.initialHeight = object.initialHeight !== undefined && object.initialHeight !== null ? BigInt(object.initialHeight.toString()) : BigInt(0); return message; }, fromAmino(object: RequestInitChainAmino): RequestInitChain { - return { - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - chainId: object.chain_id, - consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - appStateBytes: object.app_state_bytes, - initialHeight: Long.fromString(object.initial_height) - }; + const message = createBaseRequestInitChain(); + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_state_bytes !== undefined && object.app_state_bytes !== null) { + message.appStateBytes = bytesFromBase64(object.app_state_bytes); + } + if (object.initial_height !== undefined && object.initial_height !== null) { + message.initialHeight = BigInt(object.initial_height); + } + return message; }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; - obj.chain_id = message.chainId; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } - obj.app_state_bytes = message.appStateBytes; - obj.initial_height = message.initialHeight ? message.initialHeight.toString() : undefined; + obj.app_state_bytes = message.appStateBytes ? base64FromBytes(message.appStateBytes) : undefined; + obj.initial_height = message.initialHeight !== BigInt(0) ? message.initialHeight.toString() : undefined; return obj; }, fromAminoMsg(object: RequestInitChainAminoMsg): RequestInitChain { @@ -2137,19 +2195,20 @@ function createBaseRequestQuery(): RequestQuery { return { data: new Uint8Array(), path: "", - height: Long.ZERO, + height: BigInt(0), prove: false }; } export const RequestQuery = { - encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestQuery", + encode(message: RequestQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.prove === true) { @@ -2157,8 +2216,8 @@ export const RequestQuery = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestQuery(); while (reader.pos < end) { @@ -2171,7 +2230,7 @@ export const RequestQuery = { message.path = reader.string(); break; case 3: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 4: message.prove = reader.bool(); @@ -2187,7 +2246,7 @@ export const RequestQuery = { return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), path: isSet(object.path) ? String(object.path) : "", - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), prove: isSet(object.prove) ? Boolean(object.prove) : false }; }, @@ -2195,7 +2254,7 @@ export const RequestQuery = { const obj: any = {}; message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.path !== undefined && (obj.path = message.path); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.prove !== undefined && (obj.prove = message.prove); return obj; }, @@ -2203,24 +2262,32 @@ export const RequestQuery = { const message = createBaseRequestQuery(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.prove = object.prove ?? false; return message; }, fromAmino(object: RequestQueryAmino): RequestQuery { - return { - data: object.data, - path: object.path, - height: Long.fromString(object.height), - prove: object.prove - }; + const message = createBaseRequestQuery(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } + return message; }, toAmino(message: RequestQuery): RequestQueryAmino { const obj: any = {}; - obj.data = message.data; - obj.path = message.path; - obj.height = message.height ? message.height.toString() : undefined; - obj.prove = message.prove; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.path = message.path === "" ? undefined : message.path; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.prove = message.prove === false ? undefined : message.prove; return obj; }, fromAminoMsg(object: RequestQueryAminoMsg): RequestQuery { @@ -2248,7 +2315,8 @@ function createBaseRequestBeginBlock(): RequestBeginBlock { }; } export const RequestBeginBlock = { - encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestBeginBlock", + encode(message: RequestBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } @@ -2263,8 +2331,8 @@ export const RequestBeginBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestBeginBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestBeginBlock(); while (reader.pos < end) { @@ -2318,22 +2386,28 @@ export const RequestBeginBlock = { return message; }, fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { - return { - hash: object.hash, - header: object?.header ? Header.fromAmino(object.header) : undefined, - lastCommitInfo: object?.last_commit_info ? CommitInfo.fromAmino(object.last_commit_info) : undefined, - byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Misbehavior.fromAmino(e)) : [] - }; + const message = createBaseRequestBeginBlock(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.last_commit_info !== undefined && object.last_commit_info !== null) { + message.lastCommitInfo = CommitInfo.fromAmino(object.last_commit_info); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Misbehavior.fromAmino(e)) || []; + return message; }, toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.header = message.header ? Header.toAmino(message.header) : undefined; obj.last_commit_info = message.lastCommitInfo ? CommitInfo.toAmino(message.lastCommitInfo) : undefined; if (message.byzantineValidators) { obj.byzantine_validators = message.byzantineValidators.map(e => e ? Misbehavior.toAmino(e) : undefined); } else { - obj.byzantine_validators = []; + obj.byzantine_validators = message.byzantineValidators; } return obj; }, @@ -2360,7 +2434,8 @@ function createBaseRequestCheckTx(): RequestCheckTx { }; } export const RequestCheckTx = { - encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestCheckTx", + encode(message: RequestCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } @@ -2369,8 +2444,8 @@ export const RequestCheckTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestCheckTx(); while (reader.pos < end) { @@ -2392,7 +2467,7 @@ export const RequestCheckTx = { fromJSON(object: any): RequestCheckTx { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toJSON(message: RequestCheckTx): unknown { @@ -2408,15 +2483,19 @@ export const RequestCheckTx = { return message; }, fromAmino(object: RequestCheckTxAmino): RequestCheckTx { - return { - tx: object.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 - }; + const message = createBaseRequestCheckTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; }, toAmino(message: RequestCheckTx): RequestCheckTxAmino { const obj: any = {}; - obj.tx = message.tx; - obj.type = message.type; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; + obj.type = message.type === 0 ? undefined : message.type; return obj; }, fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { @@ -2441,14 +2520,15 @@ function createBaseRequestDeliverTx(): RequestDeliverTx { }; } export const RequestDeliverTx = { - encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestDeliverTx", + encode(message: RequestDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestDeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestDeliverTx(); while (reader.pos < end) { @@ -2480,13 +2560,15 @@ export const RequestDeliverTx = { return message; }, fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { - return { - tx: object.tx - }; + const message = createBaseRequestDeliverTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + return message; }, toAmino(message: RequestDeliverTx): RequestDeliverTxAmino { const obj: any = {}; - obj.tx = message.tx; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; return obj; }, fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { @@ -2507,25 +2589,26 @@ export const RequestDeliverTx = { }; function createBaseRequestEndBlock(): RequestEndBlock { return { - height: Long.ZERO + height: BigInt(0) }; } export const RequestEndBlock = { - encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/tendermint.abci.RequestEndBlock", + encode(message: RequestEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestEndBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestEndBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -2536,27 +2619,29 @@ export const RequestEndBlock = { }, fromJSON(object: any): RequestEndBlock { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) }; }, toJSON(message: RequestEndBlock): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): RequestEndBlock { const message = createBaseRequestEndBlock(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: RequestEndBlockAmino): RequestEndBlock { - return { - height: Long.fromString(object.height) - }; + const message = createBaseRequestEndBlock(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: RequestEndBlock): RequestEndBlockAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; return obj; }, fromAminoMsg(object: RequestEndBlockAminoMsg): RequestEndBlock { @@ -2579,11 +2664,12 @@ function createBaseRequestCommit(): RequestCommit { return {}; } export const RequestCommit = { - encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestCommit", + encode(_: RequestCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestCommit(); while (reader.pos < end) { @@ -2608,7 +2694,8 @@ export const RequestCommit = { return message; }, fromAmino(_: RequestCommitAmino): RequestCommit { - return {}; + const message = createBaseRequestCommit(); + return message; }, toAmino(_: RequestCommit): RequestCommitAmino { const obj: any = {}; @@ -2634,11 +2721,12 @@ function createBaseRequestListSnapshots(): RequestListSnapshots { return {}; } export const RequestListSnapshots = { - encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestListSnapshots", + encode(_: RequestListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestListSnapshots(); while (reader.pos < end) { @@ -2663,7 +2751,8 @@ export const RequestListSnapshots = { return message; }, fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { - return {}; + const message = createBaseRequestListSnapshots(); + return message; }, toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { const obj: any = {}; @@ -2687,12 +2776,13 @@ export const RequestListSnapshots = { }; function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { return { - snapshot: Snapshot.fromPartial({}), + snapshot: undefined, appHash: new Uint8Array() }; } export const RequestOfferSnapshot = { - encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestOfferSnapshot", + encode(message: RequestOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.snapshot !== undefined) { Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); } @@ -2701,8 +2791,8 @@ export const RequestOfferSnapshot = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestOfferSnapshot(); while (reader.pos < end) { @@ -2740,15 +2830,19 @@ export const RequestOfferSnapshot = { return message; }, fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { - return { - snapshot: object?.snapshot ? Snapshot.fromAmino(object.snapshot) : undefined, - appHash: object.app_hash - }; + const message = createBaseRequestOfferSnapshot(); + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromAmino(object.snapshot); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; }, toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { const obj: any = {}; obj.snapshot = message.snapshot ? Snapshot.toAmino(message.snapshot) : undefined; - obj.app_hash = message.appHash; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { @@ -2769,14 +2863,15 @@ export const RequestOfferSnapshot = { }; function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { return { - height: Long.UZERO, + height: BigInt(0), format: 0, chunk: 0 }; } export const RequestLoadSnapshotChunk = { - encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + encode(message: RequestLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { @@ -2787,15 +2882,15 @@ export const RequestLoadSnapshotChunk = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestLoadSnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.uint64() as Long); + message.height = reader.uint64(); break; case 2: message.format = reader.uint32(); @@ -2812,37 +2907,43 @@ export const RequestLoadSnapshotChunk = { }, fromJSON(object: any): RequestLoadSnapshotChunk { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), format: isSet(object.format) ? Number(object.format) : 0, chunk: isSet(object.chunk) ? Number(object.chunk) : 0 }; }, toJSON(message: RequestLoadSnapshotChunk): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.format !== undefined && (obj.format = Math.round(message.format)); message.chunk !== undefined && (obj.chunk = Math.round(message.chunk)); return obj; }, fromPartial(object: Partial): RequestLoadSnapshotChunk { const message = createBaseRequestLoadSnapshotChunk(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.UZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.format = object.format ?? 0; message.chunk = object.chunk ?? 0; return message; }, fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { - return { - height: Long.fromString(object.height), - format: object.format, - chunk: object.chunk - }; + const message = createBaseRequestLoadSnapshotChunk(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } + return message; }, toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; - obj.format = message.format; - obj.chunk = message.chunk; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunk = message.chunk === 0 ? undefined : message.chunk; return obj; }, fromAminoMsg(object: RequestLoadSnapshotChunkAminoMsg): RequestLoadSnapshotChunk { @@ -2869,7 +2970,8 @@ function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { }; } export const RequestApplySnapshotChunk = { - encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + encode(message: RequestApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -2881,8 +2983,8 @@ export const RequestApplySnapshotChunk = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestApplySnapshotChunk(); while (reader.pos < end) { @@ -2926,17 +3028,23 @@ export const RequestApplySnapshotChunk = { return message; }, fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { - return { - index: object.index, - chunk: object.chunk, - sender: object.sender - }; + const message = createBaseRequestApplySnapshotChunk(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { const obj: any = {}; - obj.index = message.index; - obj.chunk = message.chunk; - obj.sender = message.sender; + obj.index = message.index === 0 ? undefined : message.index; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; + obj.sender = message.sender === "" ? undefined : message.sender; return obj; }, fromAminoMsg(object: RequestApplySnapshotChunkAminoMsg): RequestApplySnapshotChunk { @@ -2957,19 +3065,20 @@ export const RequestApplySnapshotChunk = { }; function createBaseRequestPrepareProposal(): RequestPrepareProposal { return { - maxTxBytes: Long.ZERO, + maxTxBytes: BigInt(0), txs: [], localLastCommit: ExtendedCommitInfo.fromPartial({}), misbehavior: [], - height: Long.ZERO, - time: undefined, + height: BigInt(0), + time: Timestamp.fromPartial({}), nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array() }; } export const RequestPrepareProposal = { - encode(message: RequestPrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxTxBytes.isZero()) { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { writer.uint32(8).int64(message.maxTxBytes); } for (const v of message.txs) { @@ -2981,7 +3090,7 @@ export const RequestPrepareProposal = { for (const v of message.misbehavior) { Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(40).int64(message.height); } if (message.time !== undefined) { @@ -2995,15 +3104,15 @@ export const RequestPrepareProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestPrepareProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestPrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestPrepareProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxTxBytes = (reader.int64() as Long); + message.maxTxBytes = reader.int64(); break; case 2: message.txs.push(reader.bytes()); @@ -3015,7 +3124,7 @@ export const RequestPrepareProposal = { message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 5: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 6: message.time = Timestamp.decode(reader, reader.uint32()); @@ -3035,11 +3144,11 @@ export const RequestPrepareProposal = { }, fromJSON(object: any): RequestPrepareProposal { return { - maxTxBytes: isSet(object.maxTxBytes) ? Long.fromValue(object.maxTxBytes) : Long.ZERO, + maxTxBytes: isSet(object.maxTxBytes) ? BigInt(object.maxTxBytes.toString()) : BigInt(0), txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [], localLastCommit: isSet(object.localLastCommit) ? ExtendedCommitInfo.fromJSON(object.localLastCommit) : undefined, misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) : [], - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(), proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array() @@ -3047,7 +3156,7 @@ export const RequestPrepareProposal = { }, toJSON(message: RequestPrepareProposal): unknown { const obj: any = {}; - message.maxTxBytes !== undefined && (obj.maxTxBytes = (message.maxTxBytes || Long.ZERO).toString()); + message.maxTxBytes !== undefined && (obj.maxTxBytes = (message.maxTxBytes || BigInt(0)).toString()); if (message.txs) { obj.txs = message.txs.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { @@ -3059,7 +3168,7 @@ export const RequestPrepareProposal = { } else { obj.misbehavior = []; } - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array())); message.proposerAddress !== undefined && (obj.proposerAddress = base64FromBytes(message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array())); @@ -3067,46 +3176,58 @@ export const RequestPrepareProposal = { }, fromPartial(object: Partial): RequestPrepareProposal { const message = createBaseRequestPrepareProposal(); - message.maxTxBytes = object.maxTxBytes !== undefined && object.maxTxBytes !== null ? Long.fromValue(object.maxTxBytes) : Long.ZERO; + message.maxTxBytes = object.maxTxBytes !== undefined && object.maxTxBytes !== null ? BigInt(object.maxTxBytes.toString()) : BigInt(0); message.txs = object.txs?.map(e => e) || []; message.localLastCommit = object.localLastCommit !== undefined && object.localLastCommit !== null ? ExtendedCommitInfo.fromPartial(object.localLastCommit) : undefined; message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.time = object.time !== undefined && object.time !== null ? Timestamp.fromPartial(object.time) : undefined; message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, fromAmino(object: RequestPrepareProposalAmino): RequestPrepareProposal { - return { - maxTxBytes: Long.fromString(object.max_tx_bytes), - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [], - localLastCommit: object?.local_last_commit ? ExtendedCommitInfo.fromAmino(object.local_last_commit) : undefined, - misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromAmino(e)) : [], - height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - nextValidatorsHash: object.next_validators_hash, - proposerAddress: object.proposer_address - }; + const message = createBaseRequestPrepareProposal(); + if (object.max_tx_bytes !== undefined && object.max_tx_bytes !== null) { + message.maxTxBytes = BigInt(object.max_tx_bytes); + } + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.local_last_commit !== undefined && object.local_last_commit !== null) { + message.localLastCommit = ExtendedCommitInfo.fromAmino(object.local_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; }, toAmino(message: RequestPrepareProposal): RequestPrepareProposalAmino { const obj: any = {}; - obj.max_tx_bytes = message.maxTxBytes ? message.maxTxBytes.toString() : undefined; + obj.max_tx_bytes = message.maxTxBytes !== BigInt(0) ? message.maxTxBytes.toString() : undefined; if (message.txs) { - obj.txs = message.txs.map(e => e); + obj.txs = message.txs.map(e => base64FromBytes(e)); } else { - obj.txs = []; + obj.txs = message.txs; } obj.local_last_commit = message.localLastCommit ? ExtendedCommitInfo.toAmino(message.localLastCommit) : undefined; if (message.misbehavior) { obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); } else { - obj.misbehavior = []; + obj.misbehavior = message.misbehavior; } - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; - obj.next_validators_hash = message.nextValidatorsHash; - obj.proposer_address = message.proposerAddress; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, fromAminoMsg(object: RequestPrepareProposalAminoMsg): RequestPrepareProposal { @@ -3131,14 +3252,15 @@ function createBaseRequestProcessProposal(): RequestProcessProposal { proposedLastCommit: CommitInfo.fromPartial({}), misbehavior: [], hash: new Uint8Array(), - height: Long.ZERO, - time: undefined, + height: BigInt(0), + time: Timestamp.fromPartial({}), nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array() }; } export const RequestProcessProposal = { - encode(message: RequestProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.RequestProcessProposal", + encode(message: RequestProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { writer.uint32(10).bytes(v!); } @@ -3151,7 +3273,7 @@ export const RequestProcessProposal = { if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(40).int64(message.height); } if (message.time !== undefined) { @@ -3165,8 +3287,8 @@ export const RequestProcessProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestProcessProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestProcessProposal(); while (reader.pos < end) { @@ -3185,7 +3307,7 @@ export const RequestProcessProposal = { message.hash = reader.bytes(); break; case 5: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 6: message.time = Timestamp.decode(reader, reader.uint32()); @@ -3209,7 +3331,7 @@ export const RequestProcessProposal = { proposedLastCommit: isSet(object.proposedLastCommit) ? CommitInfo.fromJSON(object.proposedLastCommit) : undefined, misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) : [], hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(), proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array() @@ -3229,7 +3351,7 @@ export const RequestProcessProposal = { obj.misbehavior = []; } message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array())); message.proposerAddress !== undefined && (obj.proposerAddress = base64FromBytes(message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array())); @@ -3241,42 +3363,54 @@ export const RequestProcessProposal = { message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; message.hash = object.hash ?? new Uint8Array(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.time = object.time !== undefined && object.time !== null ? Timestamp.fromPartial(object.time) : undefined; message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, fromAmino(object: RequestProcessProposalAmino): RequestProcessProposal { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [], - proposedLastCommit: object?.proposed_last_commit ? CommitInfo.fromAmino(object.proposed_last_commit) : undefined, - misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromAmino(e)) : [], - hash: object.hash, - height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - nextValidatorsHash: object.next_validators_hash, - proposerAddress: object.proposer_address - }; + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.proposed_last_commit !== undefined && object.proposed_last_commit !== null) { + message.proposedLastCommit = CommitInfo.fromAmino(object.proposed_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; }, toAmino(message: RequestProcessProposal): RequestProcessProposalAmino { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map(e => e); + obj.txs = message.txs.map(e => base64FromBytes(e)); } else { - obj.txs = []; + obj.txs = message.txs; } obj.proposed_last_commit = message.proposedLastCommit ? CommitInfo.toAmino(message.proposedLastCommit) : undefined; if (message.misbehavior) { obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); } else { - obj.misbehavior = []; + obj.misbehavior = message.misbehavior; } - obj.hash = message.hash; - obj.height = message.height ? message.height.toString() : undefined; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; - obj.next_validators_hash = message.nextValidatorsHash; - obj.proposer_address = message.proposerAddress; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, fromAminoMsg(object: RequestProcessProposalAminoMsg): RequestProcessProposal { @@ -3317,7 +3451,8 @@ function createBaseResponse(): Response { }; } export const Response = { - encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.Response", + encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exception !== undefined) { ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); } @@ -3371,8 +3506,8 @@ export const Response = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Response { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponse(); while (reader.pos < end) { @@ -3500,25 +3635,59 @@ export const Response = { return message; }, fromAmino(object: ResponseAmino): Response { - return { - exception: object?.exception ? ResponseException.fromAmino(object.exception) : undefined, - echo: object?.echo ? ResponseEcho.fromAmino(object.echo) : undefined, - flush: object?.flush ? ResponseFlush.fromAmino(object.flush) : undefined, - info: object?.info ? ResponseInfo.fromAmino(object.info) : undefined, - initChain: object?.init_chain ? ResponseInitChain.fromAmino(object.init_chain) : undefined, - query: object?.query ? ResponseQuery.fromAmino(object.query) : undefined, - beginBlock: object?.begin_block ? ResponseBeginBlock.fromAmino(object.begin_block) : undefined, - checkTx: object?.check_tx ? ResponseCheckTx.fromAmino(object.check_tx) : undefined, - deliverTx: object?.deliver_tx ? ResponseDeliverTx.fromAmino(object.deliver_tx) : undefined, - endBlock: object?.end_block ? ResponseEndBlock.fromAmino(object.end_block) : undefined, - commit: object?.commit ? ResponseCommit.fromAmino(object.commit) : undefined, - listSnapshots: object?.list_snapshots ? ResponseListSnapshots.fromAmino(object.list_snapshots) : undefined, - offerSnapshot: object?.offer_snapshot ? ResponseOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, - loadSnapshotChunk: object?.load_snapshot_chunk ? ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined, - prepareProposal: object?.prepare_proposal ? ResponsePrepareProposal.fromAmino(object.prepare_proposal) : undefined, - processProposal: object?.process_proposal ? ResponseProcessProposal.fromAmino(object.process_proposal) : undefined - }; + const message = createBaseResponse(); + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromAmino(object.exception); + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromAmino(object.info); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = ResponseInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = ResponseBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = ResponseDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = ResponseEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = ResponsePrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = ResponseProcessProposal.fromAmino(object.process_proposal); + } + return message; }, toAmino(message: Response): ResponseAmino { const obj: any = {}; @@ -3563,14 +3732,15 @@ function createBaseResponseException(): ResponseException { }; } export const ResponseException = { - encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseException", + encode(message: ResponseException, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.error !== "") { writer.uint32(10).string(message.error); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseException { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseException(); while (reader.pos < end) { @@ -3602,13 +3772,15 @@ export const ResponseException = { return message; }, fromAmino(object: ResponseExceptionAmino): ResponseException { - return { - error: object.error - }; + const message = createBaseResponseException(); + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; }, toAmino(message: ResponseException): ResponseExceptionAmino { const obj: any = {}; - obj.error = message.error; + obj.error = message.error === "" ? undefined : message.error; return obj; }, fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { @@ -3633,14 +3805,15 @@ function createBaseResponseEcho(): ResponseEcho { }; } export const ResponseEcho = { - encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseEcho", + encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseEcho(); while (reader.pos < end) { @@ -3672,13 +3845,15 @@ export const ResponseEcho = { return message; }, fromAmino(object: ResponseEchoAmino): ResponseEcho { - return { - message: object.message - }; + const message = createBaseResponseEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; }, toAmino(message: ResponseEcho): ResponseEchoAmino { const obj: any = {}; - obj.message = message.message; + obj.message = message.message === "" ? undefined : message.message; return obj; }, fromAminoMsg(object: ResponseEchoAminoMsg): ResponseEcho { @@ -3701,11 +3876,12 @@ function createBaseResponseFlush(): ResponseFlush { return {}; } export const ResponseFlush = { - encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseFlush", + encode(_: ResponseFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseFlush(); while (reader.pos < end) { @@ -3730,7 +3906,8 @@ export const ResponseFlush = { return message; }, fromAmino(_: ResponseFlushAmino): ResponseFlush { - return {}; + const message = createBaseResponseFlush(); + return message; }, toAmino(_: ResponseFlush): ResponseFlushAmino { const obj: any = {}; @@ -3756,23 +3933,24 @@ function createBaseResponseInfo(): ResponseInfo { return { data: "", version: "", - appVersion: Long.UZERO, - lastBlockHeight: Long.ZERO, + appVersion: BigInt(0), + lastBlockHeight: BigInt(0), lastBlockAppHash: new Uint8Array() }; } export const ResponseInfo = { - encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseInfo", + encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data !== "") { writer.uint32(10).string(message.data); } if (message.version !== "") { writer.uint32(18).string(message.version); } - if (!message.appVersion.isZero()) { + if (message.appVersion !== BigInt(0)) { writer.uint32(24).uint64(message.appVersion); } - if (!message.lastBlockHeight.isZero()) { + if (message.lastBlockHeight !== BigInt(0)) { writer.uint32(32).int64(message.lastBlockHeight); } if (message.lastBlockAppHash.length !== 0) { @@ -3780,8 +3958,8 @@ export const ResponseInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseInfo(); while (reader.pos < end) { @@ -3794,10 +3972,10 @@ export const ResponseInfo = { message.version = reader.string(); break; case 3: - message.appVersion = (reader.uint64() as Long); + message.appVersion = reader.uint64(); break; case 4: - message.lastBlockHeight = (reader.int64() as Long); + message.lastBlockHeight = reader.int64(); break; case 5: message.lastBlockAppHash = reader.bytes(); @@ -3813,8 +3991,8 @@ export const ResponseInfo = { return { data: isSet(object.data) ? String(object.data) : "", version: isSet(object.version) ? String(object.version) : "", - appVersion: isSet(object.appVersion) ? Long.fromValue(object.appVersion) : Long.UZERO, - lastBlockHeight: isSet(object.lastBlockHeight) ? Long.fromValue(object.lastBlockHeight) : Long.ZERO, + appVersion: isSet(object.appVersion) ? BigInt(object.appVersion.toString()) : BigInt(0), + lastBlockHeight: isSet(object.lastBlockHeight) ? BigInt(object.lastBlockHeight.toString()) : BigInt(0), lastBlockAppHash: isSet(object.lastBlockAppHash) ? bytesFromBase64(object.lastBlockAppHash) : new Uint8Array() }; }, @@ -3822,8 +4000,8 @@ export const ResponseInfo = { const obj: any = {}; message.data !== undefined && (obj.data = message.data); message.version !== undefined && (obj.version = message.version); - message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); - message.lastBlockHeight !== undefined && (obj.lastBlockHeight = (message.lastBlockHeight || Long.ZERO).toString()); + message.appVersion !== undefined && (obj.appVersion = (message.appVersion || BigInt(0)).toString()); + message.lastBlockHeight !== undefined && (obj.lastBlockHeight = (message.lastBlockHeight || BigInt(0)).toString()); message.lastBlockAppHash !== undefined && (obj.lastBlockAppHash = base64FromBytes(message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array())); return obj; }, @@ -3831,27 +4009,37 @@ export const ResponseInfo = { const message = createBaseResponseInfo(); message.data = object.data ?? ""; message.version = object.version ?? ""; - message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? Long.fromValue(object.appVersion) : Long.UZERO; - message.lastBlockHeight = object.lastBlockHeight !== undefined && object.lastBlockHeight !== null ? Long.fromValue(object.lastBlockHeight) : Long.ZERO; + message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + message.lastBlockHeight = object.lastBlockHeight !== undefined && object.lastBlockHeight !== null ? BigInt(object.lastBlockHeight.toString()) : BigInt(0); message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); return message; }, fromAmino(object: ResponseInfoAmino): ResponseInfo { - return { - data: object.data, - version: object.version, - appVersion: Long.fromString(object.app_version), - lastBlockHeight: Long.fromString(object.last_block_height), - lastBlockAppHash: object.last_block_app_hash - }; + const message = createBaseResponseInfo(); + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); + } + if (object.last_block_height !== undefined && object.last_block_height !== null) { + message.lastBlockHeight = BigInt(object.last_block_height); + } + if (object.last_block_app_hash !== undefined && object.last_block_app_hash !== null) { + message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); + } + return message; }, toAmino(message: ResponseInfo): ResponseInfoAmino { const obj: any = {}; - obj.data = message.data; - obj.version = message.version; - obj.app_version = message.appVersion ? message.appVersion.toString() : undefined; - obj.last_block_height = message.lastBlockHeight ? message.lastBlockHeight.toString() : undefined; - obj.last_block_app_hash = message.lastBlockAppHash; + obj.data = message.data === "" ? undefined : message.data; + obj.version = message.version === "" ? undefined : message.version; + obj.app_version = message.appVersion !== BigInt(0) ? message.appVersion.toString() : undefined; + obj.last_block_height = message.lastBlockHeight !== BigInt(0) ? message.lastBlockHeight.toString() : undefined; + obj.last_block_app_hash = message.lastBlockAppHash ? base64FromBytes(message.lastBlockAppHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { @@ -3872,13 +4060,14 @@ export const ResponseInfo = { }; function createBaseResponseInitChain(): ResponseInitChain { return { - consensusParams: ConsensusParams.fromPartial({}), + consensusParams: undefined, validators: [], appHash: new Uint8Array() }; } export const ResponseInitChain = { - encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseInitChain", + encode(message: ResponseInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusParams !== undefined) { ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); } @@ -3890,8 +4079,8 @@ export const ResponseInitChain = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseInitChain(); while (reader.pos < end) { @@ -3939,11 +4128,15 @@ export const ResponseInitChain = { return message; }, fromAmino(object: ResponseInitChainAmino): ResponseInitChain { - return { - consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - appHash: object.app_hash - }; + const message = createBaseResponseInitChain(); + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; }, toAmino(message: ResponseInitChain): ResponseInitChainAmino { const obj: any = {}; @@ -3951,9 +4144,9 @@ export const ResponseInitChain = { if (message.validators) { obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } - obj.app_hash = message.appHash; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { @@ -3977,16 +4170,17 @@ function createBaseResponseQuery(): ResponseQuery { code: 0, log: "", info: "", - index: Long.ZERO, + index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), - proofOps: ProofOps.fromPartial({}), - height: Long.ZERO, + proofOps: undefined, + height: BigInt(0), codespace: "" }; } export const ResponseQuery = { - encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseQuery", + encode(message: ResponseQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -3996,7 +4190,7 @@ export const ResponseQuery = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.index.isZero()) { + if (message.index !== BigInt(0)) { writer.uint32(40).int64(message.index); } if (message.key.length !== 0) { @@ -4008,7 +4202,7 @@ export const ResponseQuery = { if (message.proofOps !== undefined) { ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(72).int64(message.height); } if (message.codespace !== "") { @@ -4016,8 +4210,8 @@ export const ResponseQuery = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseQuery(); while (reader.pos < end) { @@ -4033,7 +4227,7 @@ export const ResponseQuery = { message.info = reader.string(); break; case 5: - message.index = (reader.int64() as Long); + message.index = reader.int64(); break; case 6: message.key = reader.bytes(); @@ -4045,7 +4239,7 @@ export const ResponseQuery = { message.proofOps = ProofOps.decode(reader, reader.uint32()); break; case 9: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 10: message.codespace = reader.string(); @@ -4062,11 +4256,11 @@ export const ResponseQuery = { code: isSet(object.code) ? Number(object.code) : 0, log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", - index: isSet(object.index) ? Long.fromValue(object.index) : Long.ZERO, + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), codespace: isSet(object.codespace) ? String(object.codespace) : "" }; }, @@ -4075,11 +4269,11 @@ export const ResponseQuery = { message.code !== undefined && (obj.code = Math.round(message.code)); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.codespace !== undefined && (obj.codespace = message.codespace); return obj; }, @@ -4088,38 +4282,56 @@ export const ResponseQuery = { message.code = object.code ?? 0; message.log = object.log ?? ""; message.info = object.info ?? ""; - message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.ZERO; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.codespace = object.codespace ?? ""; return message; }, fromAmino(object: ResponseQueryAmino): ResponseQuery { - return { - code: object.code, - log: object.log, - info: object.info, - index: Long.fromString(object.index), - key: object.key, - value: object.value, - proofOps: object?.proof_ops ? ProofOps.fromAmino(object.proof_ops) : undefined, - height: Long.fromString(object.height), - codespace: object.codespace - }; + const message = createBaseResponseQuery(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proof_ops !== undefined && object.proof_ops !== null) { + message.proofOps = ProofOps.fromAmino(object.proof_ops); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; }, toAmino(message: ResponseQuery): ResponseQueryAmino { const obj: any = {}; - obj.code = message.code; - obj.log = message.log; - obj.info = message.info; - obj.index = message.index ? message.index.toString() : undefined; - obj.key = message.key; - obj.value = message.value; + obj.code = message.code === 0 ? undefined : message.code; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; - obj.height = message.height ? message.height.toString() : undefined; - obj.codespace = message.codespace; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.codespace = message.codespace === "" ? undefined : message.codespace; return obj; }, fromAminoMsg(object: ResponseQueryAminoMsg): ResponseQuery { @@ -4144,14 +4356,15 @@ function createBaseResponseBeginBlock(): ResponseBeginBlock { }; } export const ResponseBeginBlock = { - encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseBeginBlock", + encode(message: ResponseBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.events) { Event.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseBeginBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseBeginBlock(); while (reader.pos < end) { @@ -4187,16 +4400,16 @@ export const ResponseBeginBlock = { return message; }, fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { - return { - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResponseBeginBlock(); + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { const obj: any = {}; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { - obj.events = []; + obj.events = message.events; } return obj; }, @@ -4222,17 +4435,18 @@ function createBaseResponseCheckTx(): ResponseCheckTx { data: new Uint8Array(), log: "", info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, + gasWanted: BigInt(0), + gasUsed: BigInt(0), events: [], codespace: "", sender: "", - priority: Long.ZERO, + priority: BigInt(0), mempoolError: "" }; } export const ResponseCheckTx = { - encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseCheckTx", + encode(message: ResponseCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -4245,10 +4459,10 @@ export const ResponseCheckTx = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.gasWanted.isZero()) { + if (message.gasWanted !== BigInt(0)) { writer.uint32(40).int64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { @@ -4260,7 +4474,7 @@ export const ResponseCheckTx = { if (message.sender !== "") { writer.uint32(74).string(message.sender); } - if (!message.priority.isZero()) { + if (message.priority !== BigInt(0)) { writer.uint32(80).int64(message.priority); } if (message.mempoolError !== "") { @@ -4268,8 +4482,8 @@ export const ResponseCheckTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseCheckTx(); while (reader.pos < end) { @@ -4288,10 +4502,10 @@ export const ResponseCheckTx = { message.info = reader.string(); break; case 5: - message.gasWanted = (reader.int64() as Long); + message.gasWanted = reader.int64(); break; case 6: - message.gasUsed = (reader.int64() as Long); + message.gasUsed = reader.int64(); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); @@ -4303,7 +4517,7 @@ export const ResponseCheckTx = { message.sender = reader.string(); break; case 10: - message.priority = (reader.int64() as Long); + message.priority = reader.int64(); break; case 11: message.mempoolError = reader.string(); @@ -4321,12 +4535,12 @@ export const ResponseCheckTx = { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", - gasWanted: isSet(object.gas_wanted) ? Long.fromValue(object.gas_wanted) : Long.ZERO, - gasUsed: isSet(object.gas_used) ? Long.fromValue(object.gas_used) : Long.ZERO, + gasWanted: isSet(object.gas_wanted) ? BigInt(object.gas_wanted.toString()) : BigInt(0), + gasUsed: isSet(object.gas_used) ? BigInt(object.gas_used.toString()) : BigInt(0), events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], codespace: isSet(object.codespace) ? String(object.codespace) : "", sender: isSet(object.sender) ? String(object.sender) : "", - priority: isSet(object.priority) ? Long.fromValue(object.priority) : Long.ZERO, + priority: isSet(object.priority) ? BigInt(object.priority.toString()) : BigInt(0), mempoolError: isSet(object.mempoolError) ? String(object.mempoolError) : "" }; }, @@ -4336,8 +4550,8 @@ export const ResponseCheckTx = { message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || Long.ZERO).toString()); + message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || BigInt(0)).toString()); if (message.events) { obj.events = message.events.map(e => e ? Event.toJSON(e) : undefined); } else { @@ -4345,7 +4559,7 @@ export const ResponseCheckTx = { } message.codespace !== undefined && (obj.codespace = message.codespace); message.sender !== undefined && (obj.sender = message.sender); - message.priority !== undefined && (obj.priority = (message.priority || Long.ZERO).toString()); + message.priority !== undefined && (obj.priority = (message.priority || BigInt(0)).toString()); message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError); return obj; }, @@ -4355,47 +4569,67 @@ export const ResponseCheckTx = { message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.info = object.info ?? ""; - message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? Long.fromValue(object.gasWanted) : Long.ZERO; - message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? Long.fromValue(object.gasUsed) : Long.ZERO; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; message.sender = object.sender ?? ""; - message.priority = object.priority !== undefined && object.priority !== null ? Long.fromValue(object.priority) : Long.ZERO; + message.priority = object.priority !== undefined && object.priority !== null ? BigInt(object.priority.toString()) : BigInt(0); message.mempoolError = object.mempoolError ?? ""; return message; }, fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { - return { - code: object.code, - data: object.data, - log: object.log, - info: object.info, - gasWanted: Long.fromString(object.gas_wanted), - gasUsed: Long.fromString(object.gas_used), - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - codespace: object.codespace, - sender: object.sender, - priority: Long.fromString(object.priority), - mempoolError: object.mempool_error - }; + const message = createBaseResponseCheckTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.priority !== undefined && object.priority !== null) { + message.priority = BigInt(object.priority); + } + if (object.mempool_error !== undefined && object.mempool_error !== null) { + message.mempoolError = object.mempool_error; + } + return message; }, toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { const obj: any = {}; - obj.code = message.code; - obj.data = message.data; - obj.log = message.log; - obj.info = message.info; - obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; - obj.gas_used = message.gasUsed ? message.gasUsed.toString() : undefined; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { - obj.events = []; + obj.events = message.events; } - obj.codespace = message.codespace; - obj.sender = message.sender; - obj.priority = message.priority ? message.priority.toString() : undefined; - obj.mempool_error = message.mempoolError; + obj.codespace = message.codespace === "" ? undefined : message.codespace; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.priority = message.priority !== BigInt(0) ? message.priority.toString() : undefined; + obj.mempool_error = message.mempoolError === "" ? undefined : message.mempoolError; return obj; }, fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { @@ -4420,14 +4654,15 @@ function createBaseResponseDeliverTx(): ResponseDeliverTx { data: new Uint8Array(), log: "", info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, + gasWanted: BigInt(0), + gasUsed: BigInt(0), events: [], codespace: "" }; } export const ResponseDeliverTx = { - encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseDeliverTx", + encode(message: ResponseDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -4440,10 +4675,10 @@ export const ResponseDeliverTx = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.gasWanted.isZero()) { + if (message.gasWanted !== BigInt(0)) { writer.uint32(40).int64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { @@ -4454,8 +4689,8 @@ export const ResponseDeliverTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseDeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseDeliverTx(); while (reader.pos < end) { @@ -4474,10 +4709,10 @@ export const ResponseDeliverTx = { message.info = reader.string(); break; case 5: - message.gasWanted = (reader.int64() as Long); + message.gasWanted = reader.int64(); break; case 6: - message.gasUsed = (reader.int64() as Long); + message.gasUsed = reader.int64(); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); @@ -4498,8 +4733,8 @@ export const ResponseDeliverTx = { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), log: isSet(object.log) ? String(object.log) : "", info: isSet(object.info) ? String(object.info) : "", - gasWanted: isSet(object.gas_wanted) ? Long.fromValue(object.gas_wanted) : Long.ZERO, - gasUsed: isSet(object.gas_used) ? Long.fromValue(object.gas_used) : Long.ZERO, + gasWanted: isSet(object.gas_wanted) ? BigInt(object.gas_wanted.toString()) : BigInt(0), + gasUsed: isSet(object.gas_used) ? BigInt(object.gas_used.toString()) : BigInt(0), events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], codespace: isSet(object.codespace) ? String(object.codespace) : "" }; @@ -4510,8 +4745,8 @@ export const ResponseDeliverTx = { message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || Long.ZERO).toString()); + message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || BigInt(0)).toString()); if (message.events) { obj.events = message.events.map(e => e ? Event.toJSON(e) : undefined); } else { @@ -4526,38 +4761,52 @@ export const ResponseDeliverTx = { message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.info = object.info ?? ""; - message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? Long.fromValue(object.gasWanted) : Long.ZERO; - message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? Long.fromValue(object.gasUsed) : Long.ZERO; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; return message; }, fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { - return { - code: object.code, - data: object.data, - log: object.log, - info: object.info, - gasWanted: Long.fromString(object.gas_wanted), - gasUsed: Long.fromString(object.gas_used), - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - codespace: object.codespace - }; + const message = createBaseResponseDeliverTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; }, toAmino(message: ResponseDeliverTx): ResponseDeliverTxAmino { const obj: any = {}; - obj.code = message.code; - obj.data = message.data; - obj.log = message.log; - obj.info = message.info; - obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; - obj.gas_used = message.gasUsed ? message.gasUsed.toString() : undefined; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { - obj.events = []; + obj.events = message.events; } - obj.codespace = message.codespace; + obj.codespace = message.codespace === "" ? undefined : message.codespace; return obj; }, fromAminoMsg(object: ResponseDeliverTxAminoMsg): ResponseDeliverTx { @@ -4579,12 +4828,13 @@ export const ResponseDeliverTx = { function createBaseResponseEndBlock(): ResponseEndBlock { return { validatorUpdates: [], - consensusParamUpdates: ConsensusParams.fromPartial({}), + consensusParamUpdates: undefined, events: [] }; } export const ResponseEndBlock = { - encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseEndBlock", + encode(message: ResponseEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validatorUpdates) { ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -4596,8 +4846,8 @@ export const ResponseEndBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEndBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseEndBlock(); while (reader.pos < end) { @@ -4649,24 +4899,26 @@ export const ResponseEndBlock = { return message; }, fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { - return { - validatorUpdates: Array.isArray(object?.validator_updates) ? object.validator_updates.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - consensusParamUpdates: object?.consensus_param_updates ? ConsensusParams.fromAmino(object.consensus_param_updates) : undefined, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResponseEndBlock(); + message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.consensus_param_updates !== undefined && object.consensus_param_updates !== null) { + message.consensusParamUpdates = ConsensusParams.fromAmino(object.consensus_param_updates); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseEndBlock): ResponseEndBlockAmino { const obj: any = {}; if (message.validatorUpdates) { obj.validator_updates = message.validatorUpdates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); } else { - obj.validator_updates = []; + obj.validator_updates = message.validatorUpdates; } obj.consensus_param_updates = message.consensusParamUpdates ? ConsensusParams.toAmino(message.consensusParamUpdates) : undefined; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { - obj.events = []; + obj.events = message.events; } return obj; }, @@ -4689,21 +4941,22 @@ export const ResponseEndBlock = { function createBaseResponseCommit(): ResponseCommit { return { data: new Uint8Array(), - retainHeight: Long.ZERO + retainHeight: BigInt(0) }; } export const ResponseCommit = { - encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseCommit", + encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); } - if (!message.retainHeight.isZero()) { + if (message.retainHeight !== BigInt(0)) { writer.uint32(24).int64(message.retainHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseCommit(); while (reader.pos < end) { @@ -4713,7 +4966,7 @@ export const ResponseCommit = { message.data = reader.bytes(); break; case 3: - message.retainHeight = (reader.int64() as Long); + message.retainHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -4725,31 +4978,35 @@ export const ResponseCommit = { fromJSON(object: any): ResponseCommit { return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), - retainHeight: isSet(object.retainHeight) ? Long.fromValue(object.retainHeight) : Long.ZERO + retainHeight: isSet(object.retainHeight) ? BigInt(object.retainHeight.toString()) : BigInt(0) }; }, toJSON(message: ResponseCommit): unknown { const obj: any = {}; message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || Long.ZERO).toString()); + message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ResponseCommit { const message = createBaseResponseCommit(); message.data = object.data ?? new Uint8Array(); - message.retainHeight = object.retainHeight !== undefined && object.retainHeight !== null ? Long.fromValue(object.retainHeight) : Long.ZERO; + message.retainHeight = object.retainHeight !== undefined && object.retainHeight !== null ? BigInt(object.retainHeight.toString()) : BigInt(0); return message; }, fromAmino(object: ResponseCommitAmino): ResponseCommit { - return { - data: object.data, - retainHeight: Long.fromString(object.retain_height) - }; + const message = createBaseResponseCommit(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.retain_height !== undefined && object.retain_height !== null) { + message.retainHeight = BigInt(object.retain_height); + } + return message; }, toAmino(message: ResponseCommit): ResponseCommitAmino { const obj: any = {}; - obj.data = message.data; - obj.retain_height = message.retainHeight ? message.retainHeight.toString() : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.retain_height = message.retainHeight !== BigInt(0) ? message.retainHeight.toString() : undefined; return obj; }, fromAminoMsg(object: ResponseCommitAminoMsg): ResponseCommit { @@ -4774,14 +5031,15 @@ function createBaseResponseListSnapshots(): ResponseListSnapshots { }; } export const ResponseListSnapshots = { - encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseListSnapshots", + encode(message: ResponseListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.snapshots) { Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseListSnapshots(); while (reader.pos < end) { @@ -4817,16 +5075,16 @@ export const ResponseListSnapshots = { return message; }, fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { - return { - snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromAmino(e)) : [] - }; + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { const obj: any = {}; if (message.snapshots) { obj.snapshots = message.snapshots.map(e => e ? Snapshot.toAmino(e) : undefined); } else { - obj.snapshots = []; + obj.snapshots = message.snapshots; } return obj; }, @@ -4852,14 +5110,15 @@ function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { }; } export const ResponseOfferSnapshot = { - encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + encode(message: ResponseOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseOfferSnapshot(); while (reader.pos < end) { @@ -4877,7 +5136,7 @@ export const ResponseOfferSnapshot = { }, fromJSON(object: any): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toJSON(message: ResponseOfferSnapshot): unknown { @@ -4891,13 +5150,15 @@ export const ResponseOfferSnapshot = { return message; }, fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { - return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 - }; + const message = createBaseResponseOfferSnapshot(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; }, toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { const obj: any = {}; - obj.result = message.result; + obj.result = message.result === 0 ? undefined : message.result; return obj; }, fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { @@ -4922,14 +5183,15 @@ function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { }; } export const ResponseLoadSnapshotChunk = { - encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + encode(message: ResponseLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chunk.length !== 0) { writer.uint32(10).bytes(message.chunk); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseLoadSnapshotChunk(); while (reader.pos < end) { @@ -4961,13 +5223,15 @@ export const ResponseLoadSnapshotChunk = { return message; }, fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { - return { - chunk: object.chunk - }; + const message = createBaseResponseLoadSnapshotChunk(); + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; }, toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { const obj: any = {}; - obj.chunk = message.chunk; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; return obj; }, fromAminoMsg(object: ResponseLoadSnapshotChunkAminoMsg): ResponseLoadSnapshotChunk { @@ -4994,7 +5258,8 @@ function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { }; } export const ResponseApplySnapshotChunk = { - encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + encode(message: ResponseApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } @@ -5008,8 +5273,8 @@ export const ResponseApplySnapshotChunk = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseApplySnapshotChunk(); while (reader.pos < end) { @@ -5040,7 +5305,7 @@ export const ResponseApplySnapshotChunk = { }, fromJSON(object: any): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [] }; @@ -5068,24 +5333,26 @@ export const ResponseApplySnapshotChunk = { return message; }, fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { - return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, - refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], - rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] - }; + const message = createBaseResponseApplySnapshotChunk(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + message.refetchChunks = object.refetch_chunks?.map(e => e) || []; + message.rejectSenders = object.reject_senders?.map(e => e) || []; + return message; }, toAmino(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkAmino { const obj: any = {}; - obj.result = message.result; + obj.result = message.result === 0 ? undefined : message.result; if (message.refetchChunks) { obj.refetch_chunks = message.refetchChunks.map(e => e); } else { - obj.refetch_chunks = []; + obj.refetch_chunks = message.refetchChunks; } if (message.rejectSenders) { obj.reject_senders = message.rejectSenders.map(e => e); } else { - obj.reject_senders = []; + obj.reject_senders = message.rejectSenders; } return obj; }, @@ -5111,14 +5378,15 @@ function createBaseResponsePrepareProposal(): ResponsePrepareProposal { }; } export const ResponsePrepareProposal = { - encode(message: ResponsePrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponsePrepareProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponsePrepareProposal(); while (reader.pos < end) { @@ -5154,16 +5422,16 @@ export const ResponsePrepareProposal = { return message; }, fromAmino(object: ResponsePrepareProposalAmino): ResponsePrepareProposal { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [] - }; + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: ResponsePrepareProposal): ResponsePrepareProposalAmino { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map(e => e); + obj.txs = message.txs.map(e => base64FromBytes(e)); } else { - obj.txs = []; + obj.txs = message.txs; } return obj; }, @@ -5189,14 +5457,15 @@ function createBaseResponseProcessProposal(): ResponseProcessProposal { }; } export const ResponseProcessProposal = { - encode(message: ResponseProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + encode(message: ResponseProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== 0) { writer.uint32(8).int32(message.status); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseProcessProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseProcessProposal(); while (reader.pos < end) { @@ -5214,7 +5483,7 @@ export const ResponseProcessProposal = { }, fromJSON(object: any): ResponseProcessProposal { return { - status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : 0 + status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : -1 }; }, toJSON(message: ResponseProcessProposal): unknown { @@ -5228,13 +5497,15 @@ export const ResponseProcessProposal = { return message; }, fromAmino(object: ResponseProcessProposalAmino): ResponseProcessProposal { - return { - status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : 0 - }; + const message = createBaseResponseProcessProposal(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; }, toAmino(message: ResponseProcessProposal): ResponseProcessProposalAmino { const obj: any = {}; - obj.status = message.status; + obj.status = message.status === 0 ? undefined : message.status; return obj; }, fromAminoMsg(object: ResponseProcessProposalAminoMsg): ResponseProcessProposal { @@ -5260,7 +5531,8 @@ function createBaseCommitInfo(): CommitInfo { }; } export const CommitInfo = { - encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.CommitInfo", + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } @@ -5269,8 +5541,8 @@ export const CommitInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitInfo(); while (reader.pos < end) { @@ -5312,18 +5584,20 @@ export const CommitInfo = { return message; }, fromAmino(object: CommitInfoAmino): CommitInfo { - return { - round: object.round, - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromAmino(e)) : [] - }; + const message = createBaseCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; + return message; }, toAmino(message: CommitInfo): CommitInfoAmino { const obj: any = {}; - obj.round = message.round; + obj.round = message.round === 0 ? undefined : message.round; if (message.votes) { obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } return obj; }, @@ -5350,7 +5624,8 @@ function createBaseExtendedCommitInfo(): ExtendedCommitInfo { }; } export const ExtendedCommitInfo = { - encode(message: ExtendedCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } @@ -5359,8 +5634,8 @@ export const ExtendedCommitInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedCommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { @@ -5402,18 +5677,20 @@ export const ExtendedCommitInfo = { return message; }, fromAmino(object: ExtendedCommitInfoAmino): ExtendedCommitInfo { - return { - round: object.round, - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => ExtendedVoteInfo.fromAmino(e)) : [] - }; + const message = createBaseExtendedCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromAmino(e)) || []; + return message; }, toAmino(message: ExtendedCommitInfo): ExtendedCommitInfoAmino { const obj: any = {}; - obj.round = message.round; + obj.round = message.round === 0 ? undefined : message.round; if (message.votes) { obj.votes = message.votes.map(e => e ? ExtendedVoteInfo.toAmino(e) : undefined); } else { - obj.votes = []; + obj.votes = message.votes; } return obj; }, @@ -5440,7 +5717,8 @@ function createBaseEvent(): Event { }; } export const Event = { - encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.Event", + encode(message: Event, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -5449,8 +5727,8 @@ export const Event = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Event { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Event { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvent(); while (reader.pos < end) { @@ -5492,18 +5770,20 @@ export const Event = { return message; }, fromAmino(object: EventAmino): Event { - return { - type: object.type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => EventAttribute.fromAmino(e)) : [] - }; + const message = createBaseEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; + return message; }, toAmino(message: Event): EventAmino { const obj: any = {}; - obj.type = message.type; + obj.type = message.type === "" ? undefined : message.type; if (message.attributes) { obj.attributes = message.attributes.map(e => e ? EventAttribute.toAmino(e) : undefined); } else { - obj.attributes = []; + obj.attributes = message.attributes; } return obj; }, @@ -5531,7 +5811,8 @@ function createBaseEventAttribute(): EventAttribute { }; } export const EventAttribute = { - encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.EventAttribute", + encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -5543,8 +5824,8 @@ export const EventAttribute = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventAttribute(); while (reader.pos < end) { @@ -5588,17 +5869,23 @@ export const EventAttribute = { return message; }, fromAmino(object: EventAttributeAmino): EventAttribute { - return { - key: object.key, - value: object.value, - index: object.index - }; + const message = createBaseEventAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + return message; }, toAmino(message: EventAttribute): EventAttributeAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; - obj.index = message.index; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + obj.index = message.index === false ? undefined : message.index; return obj; }, fromAminoMsg(object: EventAttributeAminoMsg): EventAttribute { @@ -5619,15 +5906,16 @@ export const EventAttribute = { }; function createBaseTxResult(): TxResult { return { - height: Long.ZERO, + height: BigInt(0), index: 0, tx: new Uint8Array(), result: ResponseDeliverTx.fromPartial({}) }; } export const TxResult = { - encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/tendermint.abci.TxResult", + encode(message: TxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.index !== 0) { @@ -5641,15 +5929,15 @@ export const TxResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 2: message.index = reader.uint32(); @@ -5669,7 +5957,7 @@ export const TxResult = { }, fromJSON(object: any): TxResult { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), index: isSet(object.index) ? Number(object.index) : 0, tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), result: isSet(object.result) ? ResponseDeliverTx.fromJSON(object.result) : undefined @@ -5677,7 +5965,7 @@ export const TxResult = { }, toJSON(message: TxResult): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.index !== undefined && (obj.index = Math.round(message.index)); message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); message.result !== undefined && (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined); @@ -5685,25 +5973,33 @@ export const TxResult = { }, fromPartial(object: Partial): TxResult { const message = createBaseTxResult(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.index = object.index ?? 0; message.tx = object.tx ?? new Uint8Array(); message.result = object.result !== undefined && object.result !== null ? ResponseDeliverTx.fromPartial(object.result) : undefined; return message; }, fromAmino(object: TxResultAmino): TxResult { - return { - height: Long.fromString(object.height), - index: object.index, - tx: object.tx, - result: object?.result ? ResponseDeliverTx.fromAmino(object.result) : undefined - }; + const message = createBaseTxResult(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromAmino(object.result); + } + return message; }, toAmino(message: TxResult): TxResultAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; - obj.index = message.index; - obj.tx = message.tx; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.index = message.index === 0 ? undefined : message.index; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; obj.result = message.result ? ResponseDeliverTx.toAmino(message.result) : undefined; return obj; }, @@ -5726,21 +6022,22 @@ export const TxResult = { function createBaseValidator(): Validator { return { address: new Uint8Array(), - power: Long.ZERO + power: BigInt(0) }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(24).int64(message.power); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -5750,7 +6047,7 @@ export const Validator = { message.address = reader.bytes(); break; case 3: - message.power = (reader.int64() as Long); + message.power = reader.int64(); break; default: reader.skipType(tag & 7); @@ -5762,31 +6059,35 @@ export const Validator = { fromJSON(object: any): Validator { return { address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), - power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO + power: isSet(object.power) ? BigInt(object.power.toString()) : BigInt(0) }; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); - message.power = object.power !== undefined && object.power !== null ? Long.fromValue(object.power) : Long.ZERO; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - address: object.address, - power: Long.fromString(object.power) - }; + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.address = message.address; - obj.power = message.power ? message.power.toString() : undefined; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { @@ -5808,21 +6109,22 @@ export const Validator = { function createBaseValidatorUpdate(): ValidatorUpdate { return { pubKey: PublicKey.fromPartial({}), - power: Long.ZERO + power: BigInt(0) }; } export const ValidatorUpdate = { - encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ValidatorUpdate", + encode(message: ValidatorUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(16).int64(message.power); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorUpdate(); while (reader.pos < end) { @@ -5832,7 +6134,7 @@ export const ValidatorUpdate = { message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: - message.power = (reader.int64() as Long); + message.power = reader.int64(); break; default: reader.skipType(tag & 7); @@ -5844,31 +6146,35 @@ export const ValidatorUpdate = { fromJSON(object: any): ValidatorUpdate { return { pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, - power: isSet(object.power) ? Long.fromValue(object.power) : Long.ZERO + power: isSet(object.power) ? BigInt(object.power.toString()) : BigInt(0) }; }, toJSON(message: ValidatorUpdate): unknown { const obj: any = {}; message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ValidatorUpdate { const message = createBaseValidatorUpdate(); message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; - message.power = object.power !== undefined && object.power !== null ? Long.fromValue(object.power) : Long.ZERO; + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { - return { - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - power: Long.fromString(object.power) - }; + const message = createBaseValidatorUpdate(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { const obj: any = {}; obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; - obj.power = message.power ? message.power.toString() : undefined; + obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorUpdateAminoMsg): ValidatorUpdate { @@ -5894,7 +6200,8 @@ function createBaseVoteInfo(): VoteInfo { }; } export const VoteInfo = { - encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.VoteInfo", + encode(message: VoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } @@ -5903,8 +6210,8 @@ export const VoteInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVoteInfo(); while (reader.pos < end) { @@ -5942,15 +6249,19 @@ export const VoteInfo = { return message; }, fromAmino(object: VoteInfoAmino): VoteInfo { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, - signedLastBlock: object.signed_last_block - }; + const message = createBaseVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.signed_last_block !== undefined && object.signed_last_block !== null) { + message.signedLastBlock = object.signed_last_block; + } + return message; }, toAmino(message: VoteInfo): VoteInfoAmino { const obj: any = {}; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; - obj.signed_last_block = message.signedLastBlock; + obj.signed_last_block = message.signedLastBlock === false ? undefined : message.signedLastBlock; return obj; }, fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { @@ -5977,7 +6288,8 @@ function createBaseExtendedVoteInfo(): ExtendedVoteInfo { }; } export const ExtendedVoteInfo = { - encode(message: ExtendedVoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + encode(message: ExtendedVoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } @@ -5989,8 +6301,8 @@ export const ExtendedVoteInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedVoteInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtendedVoteInfo(); while (reader.pos < end) { @@ -6034,17 +6346,23 @@ export const ExtendedVoteInfo = { return message; }, fromAmino(object: ExtendedVoteInfoAmino): ExtendedVoteInfo { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, - signedLastBlock: object.signed_last_block, - voteExtension: object.vote_extension - }; + const message = createBaseExtendedVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.signed_last_block !== undefined && object.signed_last_block !== null) { + message.signedLastBlock = object.signed_last_block; + } + if (object.vote_extension !== undefined && object.vote_extension !== null) { + message.voteExtension = bytesFromBase64(object.vote_extension); + } + return message; }, toAmino(message: ExtendedVoteInfo): ExtendedVoteInfoAmino { const obj: any = {}; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; - obj.signed_last_block = message.signedLastBlock; - obj.vote_extension = message.voteExtension; + obj.signed_last_block = message.signedLastBlock === false ? undefined : message.signedLastBlock; + obj.vote_extension = message.voteExtension ? base64FromBytes(message.voteExtension) : undefined; return obj; }, fromAminoMsg(object: ExtendedVoteInfoAminoMsg): ExtendedVoteInfo { @@ -6067,32 +6385,33 @@ function createBaseMisbehavior(): Misbehavior { return { type: 0, validator: Validator.fromPartial({}), - height: Long.ZERO, - time: undefined, - totalVotingPower: Long.ZERO + height: BigInt(0), + time: Timestamp.fromPartial({}), + totalVotingPower: BigInt(0) }; } export const Misbehavior = { - encode(message: Misbehavior, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.abci.Misbehavior", + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(message.time, writer.uint32(34).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(40).int64(message.totalVotingPower); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Misbehavior { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Misbehavior { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMisbehavior(); while (reader.pos < end) { @@ -6105,13 +6424,13 @@ export const Misbehavior = { message.validator = Validator.decode(reader, reader.uint32()); break; case 3: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 4: message.time = Timestamp.decode(reader, reader.uint32()); break; case 5: - message.totalVotingPower = (reader.int64() as Long); + message.totalVotingPower = reader.int64(); break; default: reader.skipType(tag & 7); @@ -6122,47 +6441,57 @@ export const Misbehavior = { }, fromJSON(object: any): Misbehavior { return { - type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : -1, validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO + totalVotingPower: isSet(object.totalVotingPower) ? BigInt(object.totalVotingPower.toString()) : BigInt(0) }; }, toJSON(message: Misbehavior): unknown { const obj: any = {}; message.type !== undefined && (obj.type = misbehaviorTypeToJSON(message.type)); message.validator !== undefined && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); - message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Misbehavior { const message = createBaseMisbehavior(); message.type = object.type ?? 0; message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.time = object.time !== undefined && object.time !== null ? Timestamp.fromPartial(object.time) : undefined; - message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? Long.fromValue(object.totalVotingPower) : Long.ZERO; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); return message; }, fromAmino(object: MisbehaviorAmino): Misbehavior { - return { - type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : 0, - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, - height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - totalVotingPower: Long.fromString(object.total_voting_power) - }; + const message = createBaseMisbehavior(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; }, toAmino(message: Misbehavior): MisbehaviorAmino { const obj: any = {}; - obj.type = message.type; + obj.type = message.type === 0 ? undefined : message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; - obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; return obj; }, fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { @@ -6183,7 +6512,7 @@ export const Misbehavior = { }; function createBaseSnapshot(): Snapshot { return { - height: Long.UZERO, + height: BigInt(0), format: 0, chunks: 0, hash: new Uint8Array(), @@ -6191,8 +6520,9 @@ function createBaseSnapshot(): Snapshot { }; } export const Snapshot = { - encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/tendermint.abci.Snapshot", + encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { @@ -6209,15 +6539,15 @@ export const Snapshot = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.uint64() as Long); + message.height = reader.uint64(); break; case 2: message.format = reader.uint32(); @@ -6240,7 +6570,7 @@ export const Snapshot = { }, fromJSON(object: any): Snapshot { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.UZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), format: isSet(object.format) ? Number(object.format) : 0, chunks: isSet(object.chunks) ? Number(object.chunks) : 0, hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), @@ -6249,7 +6579,7 @@ export const Snapshot = { }, toJSON(message: Snapshot): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.format !== undefined && (obj.format = Math.round(message.format)); message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); @@ -6258,7 +6588,7 @@ export const Snapshot = { }, fromPartial(object: Partial): Snapshot { const message = createBaseSnapshot(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.UZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.format = object.format ?? 0; message.chunks = object.chunks ?? 0; message.hash = object.hash ?? new Uint8Array(); @@ -6266,21 +6596,31 @@ export const Snapshot = { return message; }, fromAmino(object: SnapshotAmino): Snapshot { - return { - height: Long.fromString(object.height), - format: object.format, - chunks: object.chunks, - hash: object.hash, - metadata: object.metadata - }; + const message = createBaseSnapshot(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + return message; }, toAmino(message: Snapshot): SnapshotAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; - obj.format = message.format; - obj.chunks = message.chunks; - obj.hash = message.hash; - obj.metadata = message.metadata; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunks = message.chunks === 0 ? undefined : message.chunks; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; return obj; }, fromAminoMsg(object: SnapshotAminoMsg): Snapshot { diff --git a/packages/api/src/codegen/tendermint/bundle.ts b/packages/api/src/codegen/tendermint/bundle.ts index 0e247573..bc07ef42 100644 --- a/packages/api/src/codegen/tendermint/bundle.ts +++ b/packages/api/src/codegen/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _140 from "./abci/types"; -import * as _141 from "./crypto/keys"; -import * as _142 from "./crypto/proof"; -import * as _143 from "./libs/bits/types"; -import * as _144 from "./p2p/types"; -import * as _145 from "./types/block"; -import * as _146 from "./types/evidence"; -import * as _147 from "./types/params"; -import * as _148 from "./types/types"; -import * as _149 from "./types/validator"; -import * as _150 from "./version/types"; +import * as _141 from "./abci/types"; +import * as _142 from "./crypto/keys"; +import * as _143 from "./crypto/proof"; +import * as _144 from "./libs/bits/types"; +import * as _145 from "./p2p/types"; +import * as _146 from "./types/block"; +import * as _147 from "./types/evidence"; +import * as _148 from "./types/params"; +import * as _149 from "./types/types"; +import * as _150 from "./types/validator"; +import * as _151 from "./version/types"; export namespace tendermint { export const abci = { - ..._140 + ..._141 }; export const crypto = { - ..._141, - ..._142 + ..._142, + ..._143 }; export namespace libs { export const bits = { - ..._143 + ..._144 }; } export const p2p = { - ..._144 + ..._145 }; export const types = { - ..._145, ..._146, ..._147, ..._148, - ..._149 + ..._149, + ..._150 }; export const version = { - ..._150 + ..._151 }; } \ No newline at end of file diff --git a/packages/api/src/codegen/tendermint/crypto/keys.ts b/packages/api/src/codegen/tendermint/crypto/keys.ts index 4b04449f..ee91c178 100644 --- a/packages/api/src/codegen/tendermint/crypto/keys.ts +++ b/packages/api/src/codegen/tendermint/crypto/keys.ts @@ -1,4 +1,4 @@ -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; /** PublicKey defines the keys available for use with Validators */ export interface PublicKey { @@ -11,8 +11,8 @@ export interface PublicKeyProtoMsg { } /** PublicKey defines the keys available for use with Validators */ export interface PublicKeyAmino { - ed25519?: Uint8Array; - secp256k1?: Uint8Array; + ed25519?: string; + secp256k1?: string; } export interface PublicKeyAminoMsg { type: "/tendermint.crypto.PublicKey"; @@ -30,7 +30,8 @@ function createBasePublicKey(): PublicKey { }; } export const PublicKey = { - encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.crypto.PublicKey", + encode(message: PublicKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ed25519 !== undefined) { writer.uint32(10).bytes(message.ed25519); } @@ -39,8 +40,8 @@ export const PublicKey = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePublicKey(); while (reader.pos < end) { @@ -78,15 +79,19 @@ export const PublicKey = { return message; }, fromAmino(object: PublicKeyAmino): PublicKey { - return { - ed25519: object?.ed25519, - secp256k1: object?.secp256k1 - }; + const message = createBasePublicKey(); + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; }, toAmino(message: PublicKey): PublicKeyAmino { const obj: any = {}; - obj.ed25519 = message.ed25519; - obj.secp256k1 = message.secp256k1; + obj.ed25519 = message.ed25519 ? base64FromBytes(message.ed25519) : undefined; + obj.secp256k1 = message.secp256k1 ? base64FromBytes(message.secp256k1) : undefined; return obj; }, fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { diff --git a/packages/api/src/codegen/tendermint/crypto/proof.ts b/packages/api/src/codegen/tendermint/crypto/proof.ts index 34fd7599..06602d95 100644 --- a/packages/api/src/codegen/tendermint/crypto/proof.ts +++ b/packages/api/src/codegen/tendermint/crypto/proof.ts @@ -1,8 +1,8 @@ -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export interface Proof { - total: Long; - index: Long; + total: bigint; + index: bigint; leafHash: Uint8Array; aunts: Uint8Array[]; } @@ -11,18 +11,18 @@ export interface ProofProtoMsg { value: Uint8Array; } export interface ProofAmino { - total: string; - index: string; - leaf_hash: Uint8Array; - aunts: Uint8Array[]; + total?: string; + index?: string; + leaf_hash?: string; + aunts?: string[]; } export interface ProofAminoMsg { type: "/tendermint.crypto.Proof"; value: ProofAmino; } export interface ProofSDKType { - total: Long; - index: Long; + total: bigint; + index: bigint; leaf_hash: Uint8Array; aunts: Uint8Array[]; } @@ -30,7 +30,7 @@ export interface ValueOp { /** Encoded in ProofOp.Key. */ key: Uint8Array; /** To encode in ProofOp.Data */ - proof: Proof; + proof?: Proof; } export interface ValueOpProtoMsg { typeUrl: "/tendermint.crypto.ValueOp"; @@ -38,7 +38,7 @@ export interface ValueOpProtoMsg { } export interface ValueOpAmino { /** Encoded in ProofOp.Key. */ - key: Uint8Array; + key?: string; /** To encode in ProofOp.Data */ proof?: ProofAmino; } @@ -48,7 +48,7 @@ export interface ValueOpAminoMsg { } export interface ValueOpSDKType { key: Uint8Array; - proof: ProofSDKType; + proof?: ProofSDKType; } export interface DominoOp { key: string; @@ -60,9 +60,9 @@ export interface DominoOpProtoMsg { value: Uint8Array; } export interface DominoOpAmino { - key: string; - input: string; - output: string; + key?: string; + input?: string; + output?: string; } export interface DominoOpAminoMsg { type: "/tendermint.crypto.DominoOp"; @@ -93,9 +93,9 @@ export interface ProofOpProtoMsg { * for example neighbouring node hash */ export interface ProofOpAmino { - type: string; - key: Uint8Array; - data: Uint8Array; + type?: string; + key?: string; + data?: string; } export interface ProofOpAminoMsg { type: "/tendermint.crypto.ProofOp"; @@ -121,7 +121,7 @@ export interface ProofOpsProtoMsg { } /** ProofOps is Merkle proof defined by the list of ProofOps */ export interface ProofOpsAmino { - ops: ProofOpAmino[]; + ops?: ProofOpAmino[]; } export interface ProofOpsAminoMsg { type: "/tendermint.crypto.ProofOps"; @@ -133,18 +133,19 @@ export interface ProofOpsSDKType { } function createBaseProof(): Proof { return { - total: Long.ZERO, - index: Long.ZERO, + total: BigInt(0), + index: BigInt(0), leafHash: new Uint8Array(), aunts: [] }; } export const Proof = { - encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.total.isZero()) { + typeUrl: "/tendermint.crypto.Proof", + encode(message: Proof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== BigInt(0)) { writer.uint32(8).int64(message.total); } - if (!message.index.isZero()) { + if (message.index !== BigInt(0)) { writer.uint32(16).int64(message.index); } if (message.leafHash.length !== 0) { @@ -155,18 +156,18 @@ export const Proof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.total = (reader.int64() as Long); + message.total = reader.int64(); break; case 2: - message.index = (reader.int64() as Long); + message.index = reader.int64(); break; case 3: message.leafHash = reader.bytes(); @@ -183,16 +184,16 @@ export const Proof = { }, fromJSON(object: any): Proof { return { - total: isSet(object.total) ? Long.fromValue(object.total) : Long.ZERO, - index: isSet(object.index) ? Long.fromValue(object.index) : Long.ZERO, + total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0), + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), leafHash: isSet(object.leafHash) ? bytesFromBase64(object.leafHash) : new Uint8Array(), aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => bytesFromBase64(e)) : [] }; }, toJSON(message: Proof): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString()); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.leafHash !== undefined && (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); if (message.aunts) { obj.aunts = message.aunts.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); @@ -203,29 +204,35 @@ export const Proof = { }, fromPartial(object: Partial): Proof { const message = createBaseProof(); - message.total = object.total !== undefined && object.total !== null ? Long.fromValue(object.total) : Long.ZERO; - message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.ZERO; + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); message.leafHash = object.leafHash ?? new Uint8Array(); message.aunts = object.aunts?.map(e => e) || []; return message; }, fromAmino(object: ProofAmino): Proof { - return { - total: Long.fromString(object.total), - index: Long.fromString(object.index), - leafHash: object.leaf_hash, - aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => e) : [] - }; + const message = createBaseProof(); + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.leaf_hash !== undefined && object.leaf_hash !== null) { + message.leafHash = bytesFromBase64(object.leaf_hash); + } + message.aunts = object.aunts?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Proof): ProofAmino { const obj: any = {}; - obj.total = message.total ? message.total.toString() : undefined; - obj.index = message.index ? message.index.toString() : undefined; - obj.leaf_hash = message.leafHash; + obj.total = message.total !== BigInt(0) ? message.total.toString() : undefined; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.leaf_hash = message.leafHash ? base64FromBytes(message.leafHash) : undefined; if (message.aunts) { - obj.aunts = message.aunts.map(e => e); + obj.aunts = message.aunts.map(e => base64FromBytes(e)); } else { - obj.aunts = []; + obj.aunts = message.aunts; } return obj; }, @@ -248,11 +255,12 @@ export const Proof = { function createBaseValueOp(): ValueOp { return { key: new Uint8Array(), - proof: Proof.fromPartial({}) + proof: undefined }; } export const ValueOp = { - encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.crypto.ValueOp", + encode(message: ValueOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -261,8 +269,8 @@ export const ValueOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValueOp(); while (reader.pos < end) { @@ -300,14 +308,18 @@ export const ValueOp = { return message; }, fromAmino(object: ValueOpAmino): ValueOp { - return { - key: object.key, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBaseValueOp(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: ValueOp): ValueOpAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, @@ -335,7 +347,8 @@ function createBaseDominoOp(): DominoOp { }; } export const DominoOp = { - encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.crypto.DominoOp", + encode(message: DominoOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -347,8 +360,8 @@ export const DominoOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDominoOp(); while (reader.pos < end) { @@ -392,17 +405,23 @@ export const DominoOp = { return message; }, fromAmino(object: DominoOpAmino): DominoOp { - return { - key: object.key, - input: object.input, - output: object.output - }; + const message = createBaseDominoOp(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } + return message; }, toAmino(message: DominoOp): DominoOpAmino { const obj: any = {}; - obj.key = message.key; - obj.input = message.input; - obj.output = message.output; + obj.key = message.key === "" ? undefined : message.key; + obj.input = message.input === "" ? undefined : message.input; + obj.output = message.output === "" ? undefined : message.output; return obj; }, fromAminoMsg(object: DominoOpAminoMsg): DominoOp { @@ -429,7 +448,8 @@ function createBaseProofOp(): ProofOp { }; } export const ProofOp = { - encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.crypto.ProofOp", + encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -441,8 +461,8 @@ export const ProofOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOp(); while (reader.pos < end) { @@ -486,17 +506,23 @@ export const ProofOp = { return message; }, fromAmino(object: ProofOpAmino): ProofOp { - return { - type: object.type, - key: object.key, - data: object.data - }; + const message = createBaseProofOp(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: ProofOp): ProofOpAmino { const obj: any = {}; - obj.type = message.type; - obj.key = message.key; - obj.data = message.data; + obj.type = message.type === "" ? undefined : message.type; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: ProofOpAminoMsg): ProofOp { @@ -521,14 +547,15 @@ function createBaseProofOps(): ProofOps { }; } export const ProofOps = { - encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.crypto.ProofOps", + encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOps(); while (reader.pos < end) { @@ -564,16 +591,16 @@ export const ProofOps = { return message; }, fromAmino(object: ProofOpsAmino): ProofOps { - return { - ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromAmino(e)) : [] - }; + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; + return message; }, toAmino(message: ProofOps): ProofOpsAmino { const obj: any = {}; if (message.ops) { obj.ops = message.ops.map(e => e ? ProofOp.toAmino(e) : undefined); } else { - obj.ops = []; + obj.ops = message.ops; } return obj; }, diff --git a/packages/api/src/codegen/tendermint/libs/bits/types.ts b/packages/api/src/codegen/tendermint/libs/bits/types.ts index 3d635ff7..23de8970 100644 --- a/packages/api/src/codegen/tendermint/libs/bits/types.ts +++ b/packages/api/src/codegen/tendermint/libs/bits/types.ts @@ -1,34 +1,35 @@ -import { Long, isSet } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export interface BitArray { - bits: Long; - elems: Long[]; + bits: bigint; + elems: bigint[]; } export interface BitArrayProtoMsg { typeUrl: "/tendermint.libs.bits.BitArray"; value: Uint8Array; } export interface BitArrayAmino { - bits: string; - elems: string[]; + bits?: string; + elems?: string[]; } export interface BitArrayAminoMsg { type: "/tendermint.libs.bits.BitArray"; value: BitArrayAmino; } export interface BitArraySDKType { - bits: Long; - elems: Long[]; + bits: bigint; + elems: bigint[]; } function createBaseBitArray(): BitArray { return { - bits: Long.ZERO, + bits: BigInt(0), elems: [] }; } export const BitArray = { - encode(message: BitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.bits.isZero()) { + typeUrl: "/tendermint.libs.bits.BitArray", + encode(message: BitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bits !== BigInt(0)) { writer.uint32(8).int64(message.bits); } writer.uint32(18).fork(); @@ -38,24 +39,24 @@ export const BitArray = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BitArray { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BitArray { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBitArray(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.bits = (reader.int64() as Long); + message.bits = reader.int64(); break; case 2: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.elems.push((reader.uint64() as Long)); + message.elems.push(reader.uint64()); } } else { - message.elems.push((reader.uint64() as Long)); + message.elems.push(reader.uint64()); } break; default: @@ -67,15 +68,15 @@ export const BitArray = { }, fromJSON(object: any): BitArray { return { - bits: isSet(object.bits) ? Long.fromValue(object.bits) : Long.ZERO, - elems: Array.isArray(object?.elems) ? object.elems.map((e: any) => Long.fromValue(e)) : [] + bits: isSet(object.bits) ? BigInt(object.bits.toString()) : BigInt(0), + elems: Array.isArray(object?.elems) ? object.elems.map((e: any) => BigInt(e.toString())) : [] }; }, toJSON(message: BitArray): unknown { const obj: any = {}; - message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString()); + message.bits !== undefined && (obj.bits = (message.bits || BigInt(0)).toString()); if (message.elems) { - obj.elems = message.elems.map(e => (e || Long.UZERO).toString()); + obj.elems = message.elems.map(e => (e || BigInt(0)).toString()); } else { obj.elems = []; } @@ -83,23 +84,25 @@ export const BitArray = { }, fromPartial(object: Partial): BitArray { const message = createBaseBitArray(); - message.bits = object.bits !== undefined && object.bits !== null ? Long.fromValue(object.bits) : Long.ZERO; - message.elems = object.elems?.map(e => Long.fromValue(e)) || []; + message.bits = object.bits !== undefined && object.bits !== null ? BigInt(object.bits.toString()) : BigInt(0); + message.elems = object.elems?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: BitArrayAmino): BitArray { - return { - bits: Long.fromString(object.bits), - elems: Array.isArray(object?.elems) ? object.elems.map((e: any) => e) : [] - }; + const message = createBaseBitArray(); + if (object.bits !== undefined && object.bits !== null) { + message.bits = BigInt(object.bits); + } + message.elems = object.elems?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: BitArray): BitArrayAmino { const obj: any = {}; - obj.bits = message.bits ? message.bits.toString() : undefined; + obj.bits = message.bits !== BigInt(0) ? message.bits.toString() : undefined; if (message.elems) { - obj.elems = message.elems.map(e => e); + obj.elems = message.elems.map(e => e.toString()); } else { - obj.elems = []; + obj.elems = message.elems; } return obj; }, diff --git a/packages/api/src/codegen/tendermint/p2p/types.ts b/packages/api/src/codegen/tendermint/p2p/types.ts index 48e87e99..7f5abb49 100644 --- a/packages/api/src/codegen/tendermint/p2p/types.ts +++ b/packages/api/src/codegen/tendermint/p2p/types.ts @@ -1,5 +1,5 @@ -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export interface NetAddress { id: string; ip: string; @@ -10,9 +10,9 @@ export interface NetAddressProtoMsg { value: Uint8Array; } export interface NetAddressAmino { - id: string; - ip: string; - port: number; + id?: string; + ip?: string; + port?: number; } export interface NetAddressAminoMsg { type: "/tendermint.p2p.NetAddress"; @@ -24,27 +24,27 @@ export interface NetAddressSDKType { port: number; } export interface ProtocolVersion { - p2p: Long; - block: Long; - app: Long; + p2p: bigint; + block: bigint; + app: bigint; } export interface ProtocolVersionProtoMsg { typeUrl: "/tendermint.p2p.ProtocolVersion"; value: Uint8Array; } export interface ProtocolVersionAmino { - p2p: string; - block: string; - app: string; + p2p?: string; + block?: string; + app?: string; } export interface ProtocolVersionAminoMsg { type: "/tendermint.p2p.ProtocolVersion"; value: ProtocolVersionAmino; } export interface ProtocolVersionSDKType { - p2p: Long; - block: Long; - app: Long; + p2p: bigint; + block: bigint; + app: bigint; } export interface DefaultNodeInfo { protocolVersion: ProtocolVersion; @@ -62,12 +62,12 @@ export interface DefaultNodeInfoProtoMsg { } export interface DefaultNodeInfoAmino { protocol_version?: ProtocolVersionAmino; - default_node_id: string; - listen_addr: string; - network: string; - version: string; - channels: Uint8Array; - moniker: string; + default_node_id?: string; + listen_addr?: string; + network?: string; + version?: string; + channels?: string; + moniker?: string; other?: DefaultNodeInfoOtherAmino; } export interface DefaultNodeInfoAminoMsg { @@ -93,8 +93,8 @@ export interface DefaultNodeInfoOtherProtoMsg { value: Uint8Array; } export interface DefaultNodeInfoOtherAmino { - tx_index: string; - rpc_address: string; + tx_index?: string; + rpc_address?: string; } export interface DefaultNodeInfoOtherAminoMsg { type: "/tendermint.p2p.DefaultNodeInfoOther"; @@ -112,7 +112,8 @@ function createBaseNetAddress(): NetAddress { }; } export const NetAddress = { - encode(message: NetAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.p2p.NetAddress", + encode(message: NetAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -124,8 +125,8 @@ export const NetAddress = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): NetAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): NetAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseNetAddress(); while (reader.pos < end) { @@ -169,17 +170,23 @@ export const NetAddress = { return message; }, fromAmino(object: NetAddressAmino): NetAddress { - return { - id: object.id, - ip: object.ip, - port: object.port - }; + const message = createBaseNetAddress(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.ip !== undefined && object.ip !== null) { + message.ip = object.ip; + } + if (object.port !== undefined && object.port !== null) { + message.port = object.port; + } + return message; }, toAmino(message: NetAddress): NetAddressAmino { const obj: any = {}; - obj.id = message.id; - obj.ip = message.ip; - obj.port = message.port; + obj.id = message.id === "" ? undefined : message.id; + obj.ip = message.ip === "" ? undefined : message.ip; + obj.port = message.port === 0 ? undefined : message.port; return obj; }, fromAminoMsg(object: NetAddressAminoMsg): NetAddress { @@ -200,39 +207,40 @@ export const NetAddress = { }; function createBaseProtocolVersion(): ProtocolVersion { return { - p2p: Long.UZERO, - block: Long.UZERO, - app: Long.UZERO + p2p: BigInt(0), + block: BigInt(0), + app: BigInt(0) }; } export const ProtocolVersion = { - encode(message: ProtocolVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.p2p.isZero()) { + typeUrl: "/tendermint.p2p.ProtocolVersion", + encode(message: ProtocolVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.p2p !== BigInt(0)) { writer.uint32(8).uint64(message.p2p); } - if (!message.block.isZero()) { + if (message.block !== BigInt(0)) { writer.uint32(16).uint64(message.block); } - if (!message.app.isZero()) { + if (message.app !== BigInt(0)) { writer.uint32(24).uint64(message.app); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProtocolVersion { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProtocolVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProtocolVersion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.p2p = (reader.uint64() as Long); + message.p2p = reader.uint64(); break; case 2: - message.block = (reader.uint64() as Long); + message.block = reader.uint64(); break; case 3: - message.app = (reader.uint64() as Long); + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -243,37 +251,43 @@ export const ProtocolVersion = { }, fromJSON(object: any): ProtocolVersion { return { - p2p: isSet(object.p2p) ? Long.fromValue(object.p2p) : Long.UZERO, - block: isSet(object.block) ? Long.fromValue(object.block) : Long.UZERO, - app: isSet(object.app) ? Long.fromValue(object.app) : Long.UZERO + p2p: isSet(object.p2p) ? BigInt(object.p2p.toString()) : BigInt(0), + block: isSet(object.block) ? BigInt(object.block.toString()) : BigInt(0), + app: isSet(object.app) ? BigInt(object.app.toString()) : BigInt(0) }; }, toJSON(message: ProtocolVersion): unknown { const obj: any = {}; - message.p2p !== undefined && (obj.p2p = (message.p2p || Long.UZERO).toString()); - message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + message.p2p !== undefined && (obj.p2p = (message.p2p || BigInt(0)).toString()); + message.block !== undefined && (obj.block = (message.block || BigInt(0)).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ProtocolVersion { const message = createBaseProtocolVersion(); - message.p2p = object.p2p !== undefined && object.p2p !== null ? Long.fromValue(object.p2p) : Long.UZERO; - message.block = object.block !== undefined && object.block !== null ? Long.fromValue(object.block) : Long.UZERO; - message.app = object.app !== undefined && object.app !== null ? Long.fromValue(object.app) : Long.UZERO; + message.p2p = object.p2p !== undefined && object.p2p !== null ? BigInt(object.p2p.toString()) : BigInt(0); + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); return message; }, fromAmino(object: ProtocolVersionAmino): ProtocolVersion { - return { - p2p: Long.fromString(object.p2p), - block: Long.fromString(object.block), - app: Long.fromString(object.app) - }; + const message = createBaseProtocolVersion(); + if (object.p2p !== undefined && object.p2p !== null) { + message.p2p = BigInt(object.p2p); + } + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: ProtocolVersion): ProtocolVersionAmino { const obj: any = {}; - obj.p2p = message.p2p ? message.p2p.toString() : undefined; - obj.block = message.block ? message.block.toString() : undefined; - obj.app = message.app ? message.app.toString() : undefined; + obj.p2p = message.p2p !== BigInt(0) ? message.p2p.toString() : undefined; + obj.block = message.block !== BigInt(0) ? message.block.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; return obj; }, fromAminoMsg(object: ProtocolVersionAminoMsg): ProtocolVersion { @@ -305,7 +319,8 @@ function createBaseDefaultNodeInfo(): DefaultNodeInfo { }; } export const DefaultNodeInfo = { - encode(message: DefaultNodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.p2p.DefaultNodeInfo", + encode(message: DefaultNodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.protocolVersion !== undefined) { ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); } @@ -332,8 +347,8 @@ export const DefaultNodeInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDefaultNodeInfo(); while (reader.pos < end) { @@ -407,26 +422,42 @@ export const DefaultNodeInfo = { return message; }, fromAmino(object: DefaultNodeInfoAmino): DefaultNodeInfo { - return { - protocolVersion: object?.protocol_version ? ProtocolVersion.fromAmino(object.protocol_version) : undefined, - defaultNodeId: object.default_node_id, - listenAddr: object.listen_addr, - network: object.network, - version: object.version, - channels: object.channels, - moniker: object.moniker, - other: object?.other ? DefaultNodeInfoOther.fromAmino(object.other) : undefined - }; + const message = createBaseDefaultNodeInfo(); + if (object.protocol_version !== undefined && object.protocol_version !== null) { + message.protocolVersion = ProtocolVersion.fromAmino(object.protocol_version); + } + if (object.default_node_id !== undefined && object.default_node_id !== null) { + message.defaultNodeId = object.default_node_id; + } + if (object.listen_addr !== undefined && object.listen_addr !== null) { + message.listenAddr = object.listen_addr; + } + if (object.network !== undefined && object.network !== null) { + message.network = object.network; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.channels !== undefined && object.channels !== null) { + message.channels = bytesFromBase64(object.channels); + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.other !== undefined && object.other !== null) { + message.other = DefaultNodeInfoOther.fromAmino(object.other); + } + return message; }, toAmino(message: DefaultNodeInfo): DefaultNodeInfoAmino { const obj: any = {}; obj.protocol_version = message.protocolVersion ? ProtocolVersion.toAmino(message.protocolVersion) : undefined; - obj.default_node_id = message.defaultNodeId; - obj.listen_addr = message.listenAddr; - obj.network = message.network; - obj.version = message.version; - obj.channels = message.channels; - obj.moniker = message.moniker; + obj.default_node_id = message.defaultNodeId === "" ? undefined : message.defaultNodeId; + obj.listen_addr = message.listenAddr === "" ? undefined : message.listenAddr; + obj.network = message.network === "" ? undefined : message.network; + obj.version = message.version === "" ? undefined : message.version; + obj.channels = message.channels ? base64FromBytes(message.channels) : undefined; + obj.moniker = message.moniker === "" ? undefined : message.moniker; obj.other = message.other ? DefaultNodeInfoOther.toAmino(message.other) : undefined; return obj; }, @@ -453,7 +484,8 @@ function createBaseDefaultNodeInfoOther(): DefaultNodeInfoOther { }; } export const DefaultNodeInfoOther = { - encode(message: DefaultNodeInfoOther, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther", + encode(message: DefaultNodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txIndex !== "") { writer.uint32(10).string(message.txIndex); } @@ -462,8 +494,8 @@ export const DefaultNodeInfoOther = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfoOther { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfoOther { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDefaultNodeInfoOther(); while (reader.pos < end) { @@ -501,15 +533,19 @@ export const DefaultNodeInfoOther = { return message; }, fromAmino(object: DefaultNodeInfoOtherAmino): DefaultNodeInfoOther { - return { - txIndex: object.tx_index, - rpcAddress: object.rpc_address - }; + const message = createBaseDefaultNodeInfoOther(); + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = object.tx_index; + } + if (object.rpc_address !== undefined && object.rpc_address !== null) { + message.rpcAddress = object.rpc_address; + } + return message; }, toAmino(message: DefaultNodeInfoOther): DefaultNodeInfoOtherAmino { const obj: any = {}; - obj.tx_index = message.txIndex; - obj.rpc_address = message.rpcAddress; + obj.tx_index = message.txIndex === "" ? undefined : message.txIndex; + obj.rpc_address = message.rpcAddress === "" ? undefined : message.rpcAddress; return obj; }, fromAminoMsg(object: DefaultNodeInfoOtherAminoMsg): DefaultNodeInfoOther { diff --git a/packages/api/src/codegen/tendermint/types/block.ts b/packages/api/src/codegen/tendermint/types/block.ts index dce958e8..1b69647e 100644 --- a/packages/api/src/codegen/tendermint/types/block.ts +++ b/packages/api/src/codegen/tendermint/types/block.ts @@ -1,12 +1,12 @@ import { Header, HeaderAmino, HeaderSDKType, Data, DataAmino, DataSDKType, Commit, CommitAmino, CommitSDKType } from "./types"; import { EvidenceList, EvidenceListAmino, EvidenceListSDKType } from "./evidence"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet } from "../../helpers"; export interface Block { header: Header; data: Data; evidence: EvidenceList; - lastCommit: Commit; + lastCommit?: Commit; } export interface BlockProtoMsg { typeUrl: "/tendermint.types.Block"; @@ -26,18 +26,19 @@ export interface BlockSDKType { header: HeaderSDKType; data: DataSDKType; evidence: EvidenceListSDKType; - last_commit: CommitSDKType; + last_commit?: CommitSDKType; } function createBaseBlock(): Block { return { header: Header.fromPartial({}), data: Data.fromPartial({}), evidence: EvidenceList.fromPartial({}), - lastCommit: Commit.fromPartial({}) + lastCommit: undefined }; } export const Block = { - encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Block", + encode(message: Block, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -52,8 +53,8 @@ export const Block = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Block { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Block { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlock(); while (reader.pos < end) { @@ -103,12 +104,20 @@ export const Block = { return message; }, fromAmino(object: BlockAmino): Block { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - data: object?.data ? Data.fromAmino(object.data) : undefined, - evidence: object?.evidence ? EvidenceList.fromAmino(object.evidence) : undefined, - lastCommit: object?.last_commit ? Commit.fromAmino(object.last_commit) : undefined - }; + const message = createBaseBlock(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromAmino(object.data); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromAmino(object.evidence); + } + if (object.last_commit !== undefined && object.last_commit !== null) { + message.lastCommit = Commit.fromAmino(object.last_commit); + } + return message; }, toAmino(message: Block): BlockAmino { const obj: any = {}; diff --git a/packages/api/src/codegen/tendermint/types/evidence.ts b/packages/api/src/codegen/tendermint/types/evidence.ts index e386a2ae..d026ae91 100644 --- a/packages/api/src/codegen/tendermint/types/evidence.ts +++ b/packages/api/src/codegen/tendermint/types/evidence.ts @@ -1,8 +1,8 @@ import { Vote, VoteAmino, VoteSDKType, LightBlock, LightBlockAmino, LightBlockSDKType } from "./types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../google/protobuf/timestamp"; import { Validator, ValidatorAmino, ValidatorSDKType } from "./validator"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../helpers"; export interface Evidence { duplicateVoteEvidence?: DuplicateVoteEvidence; lightClientAttackEvidence?: LightClientAttackEvidence; @@ -25,10 +25,10 @@ export interface EvidenceSDKType { } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidence { - voteA: Vote; - voteB: Vote; - totalVotingPower: Long; - validatorPower: Long; + voteA?: Vote; + voteB?: Vote; + totalVotingPower: bigint; + validatorPower: bigint; timestamp: Timestamp; } export interface DuplicateVoteEvidenceProtoMsg { @@ -39,9 +39,9 @@ export interface DuplicateVoteEvidenceProtoMsg { export interface DuplicateVoteEvidenceAmino { vote_a?: VoteAmino; vote_b?: VoteAmino; - total_voting_power: string; - validator_power: string; - timestamp?: TimestampAmino; + total_voting_power?: string; + validator_power?: string; + timestamp?: string; } export interface DuplicateVoteEvidenceAminoMsg { type: "/tendermint.types.DuplicateVoteEvidence"; @@ -49,18 +49,18 @@ export interface DuplicateVoteEvidenceAminoMsg { } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidenceSDKType { - vote_a: VoteSDKType; - vote_b: VoteSDKType; - total_voting_power: Long; - validator_power: Long; + vote_a?: VoteSDKType; + vote_b?: VoteSDKType; + total_voting_power: bigint; + validator_power: bigint; timestamp: TimestampSDKType; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidence { - conflictingBlock: LightBlock; - commonHeight: Long; + conflictingBlock?: LightBlock; + commonHeight: bigint; byzantineValidators: Validator[]; - totalVotingPower: Long; + totalVotingPower: bigint; timestamp: Timestamp; } export interface LightClientAttackEvidenceProtoMsg { @@ -70,10 +70,10 @@ export interface LightClientAttackEvidenceProtoMsg { /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceAmino { conflicting_block?: LightBlockAmino; - common_height: string; - byzantine_validators: ValidatorAmino[]; - total_voting_power: string; - timestamp?: TimestampAmino; + common_height?: string; + byzantine_validators?: ValidatorAmino[]; + total_voting_power?: string; + timestamp?: string; } export interface LightClientAttackEvidenceAminoMsg { type: "/tendermint.types.LightClientAttackEvidence"; @@ -81,10 +81,10 @@ export interface LightClientAttackEvidenceAminoMsg { } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceSDKType { - conflicting_block: LightBlockSDKType; - common_height: Long; + conflicting_block?: LightBlockSDKType; + common_height: bigint; byzantine_validators: ValidatorSDKType[]; - total_voting_power: Long; + total_voting_power: bigint; timestamp: TimestampSDKType; } export interface EvidenceList { @@ -95,7 +95,7 @@ export interface EvidenceListProtoMsg { value: Uint8Array; } export interface EvidenceListAmino { - evidence: EvidenceAmino[]; + evidence?: EvidenceAmino[]; } export interface EvidenceListAminoMsg { type: "/tendermint.types.EvidenceList"; @@ -111,7 +111,8 @@ function createBaseEvidence(): Evidence { }; } export const Evidence = { - encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Evidence", + encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.duplicateVoteEvidence !== undefined) { DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); } @@ -120,8 +121,8 @@ export const Evidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvidence(); while (reader.pos < end) { @@ -159,10 +160,14 @@ export const Evidence = { return message; }, fromAmino(object: EvidenceAmino): Evidence { - return { - duplicateVoteEvidence: object?.duplicate_vote_evidence ? DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence) : undefined, - lightClientAttackEvidence: object?.light_client_attack_evidence ? LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence) : undefined - }; + const message = createBaseEvidence(); + if (object.duplicate_vote_evidence !== undefined && object.duplicate_vote_evidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence); + } + if (object.light_client_attack_evidence !== undefined && object.light_client_attack_evidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence); + } + return message; }, toAmino(message: Evidence): EvidenceAmino { const obj: any = {}; @@ -188,25 +193,26 @@ export const Evidence = { }; function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { return { - voteA: Vote.fromPartial({}), - voteB: Vote.fromPartial({}), - totalVotingPower: Long.ZERO, - validatorPower: Long.ZERO, - timestamp: undefined + voteA: undefined, + voteB: undefined, + totalVotingPower: BigInt(0), + validatorPower: BigInt(0), + timestamp: Timestamp.fromPartial({}) }; } export const DuplicateVoteEvidence = { - encode(message: DuplicateVoteEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.DuplicateVoteEvidence", + encode(message: DuplicateVoteEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.voteA !== undefined) { Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); } if (message.voteB !== undefined) { Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(24).int64(message.totalVotingPower); } - if (!message.validatorPower.isZero()) { + if (message.validatorPower !== BigInt(0)) { writer.uint32(32).int64(message.validatorPower); } if (message.timestamp !== undefined) { @@ -214,8 +220,8 @@ export const DuplicateVoteEvidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DuplicateVoteEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDuplicateVoteEvidence(); while (reader.pos < end) { @@ -228,10 +234,10 @@ export const DuplicateVoteEvidence = { message.voteB = Vote.decode(reader, reader.uint32()); break; case 3: - message.totalVotingPower = (reader.int64() as Long); + message.totalVotingPower = reader.int64(); break; case 4: - message.validatorPower = (reader.int64() as Long); + message.validatorPower = reader.int64(); break; case 5: message.timestamp = Timestamp.decode(reader, reader.uint32()); @@ -247,8 +253,8 @@ export const DuplicateVoteEvidence = { return { voteA: isSet(object.voteA) ? Vote.fromJSON(object.voteA) : undefined, voteB: isSet(object.voteB) ? Vote.fromJSON(object.voteB) : undefined, - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO, - validatorPower: isSet(object.validatorPower) ? Long.fromValue(object.validatorPower) : Long.ZERO, + totalVotingPower: isSet(object.totalVotingPower) ? BigInt(object.totalVotingPower.toString()) : BigInt(0), + validatorPower: isSet(object.validatorPower) ? BigInt(object.validatorPower.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined }; }, @@ -256,8 +262,8 @@ export const DuplicateVoteEvidence = { const obj: any = {}; message.voteA !== undefined && (obj.voteA = message.voteA ? Vote.toJSON(message.voteA) : undefined); message.voteB !== undefined && (obj.voteB = message.voteB ? Vote.toJSON(message.voteB) : undefined); - message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); - message.validatorPower !== undefined && (obj.validatorPower = (message.validatorPower || Long.ZERO).toString()); + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); + message.validatorPower !== undefined && (obj.validatorPower = (message.validatorPower || BigInt(0)).toString()); message.timestamp !== undefined && (obj.timestamp = fromTimestamp(message.timestamp).toISOString()); return obj; }, @@ -265,26 +271,36 @@ export const DuplicateVoteEvidence = { const message = createBaseDuplicateVoteEvidence(); message.voteA = object.voteA !== undefined && object.voteA !== null ? Vote.fromPartial(object.voteA) : undefined; message.voteB = object.voteB !== undefined && object.voteB !== null ? Vote.fromPartial(object.voteB) : undefined; - message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? Long.fromValue(object.totalVotingPower) : Long.ZERO; - message.validatorPower = object.validatorPower !== undefined && object.validatorPower !== null ? Long.fromValue(object.validatorPower) : Long.ZERO; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); + message.validatorPower = object.validatorPower !== undefined && object.validatorPower !== null ? BigInt(object.validatorPower.toString()) : BigInt(0); message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? Timestamp.fromPartial(object.timestamp) : undefined; return message; }, fromAmino(object: DuplicateVoteEvidenceAmino): DuplicateVoteEvidence { - return { - voteA: object?.vote_a ? Vote.fromAmino(object.vote_a) : undefined, - voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, - totalVotingPower: Long.fromString(object.total_voting_power), - validatorPower: Long.fromString(object.validator_power), - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseDuplicateVoteEvidence(); + if (object.vote_a !== undefined && object.vote_a !== null) { + message.voteA = Vote.fromAmino(object.vote_a); + } + if (object.vote_b !== undefined && object.vote_b !== null) { + message.voteB = Vote.fromAmino(object.vote_b); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.validator_power !== undefined && object.validator_power !== null) { + message.validatorPower = BigInt(object.validator_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { const obj: any = {}; obj.vote_a = message.voteA ? Vote.toAmino(message.voteA) : undefined; obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; - obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; + obj.validator_power = message.validatorPower !== BigInt(0) ? message.validatorPower.toString() : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; }, @@ -306,25 +322,26 @@ export const DuplicateVoteEvidence = { }; function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { return { - conflictingBlock: LightBlock.fromPartial({}), - commonHeight: Long.ZERO, + conflictingBlock: undefined, + commonHeight: BigInt(0), byzantineValidators: [], - totalVotingPower: Long.ZERO, - timestamp: undefined + totalVotingPower: BigInt(0), + timestamp: Timestamp.fromPartial({}) }; } export const LightClientAttackEvidence = { - encode(message: LightClientAttackEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.LightClientAttackEvidence", + encode(message: LightClientAttackEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.conflictingBlock !== undefined) { LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); } - if (!message.commonHeight.isZero()) { + if (message.commonHeight !== BigInt(0)) { writer.uint32(16).int64(message.commonHeight); } for (const v of message.byzantineValidators) { Validator.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(32).int64(message.totalVotingPower); } if (message.timestamp !== undefined) { @@ -332,8 +349,8 @@ export const LightClientAttackEvidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LightClientAttackEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLightClientAttackEvidence(); while (reader.pos < end) { @@ -343,13 +360,13 @@ export const LightClientAttackEvidence = { message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); break; case 2: - message.commonHeight = (reader.int64() as Long); + message.commonHeight = reader.int64(); break; case 3: message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); break; case 4: - message.totalVotingPower = (reader.int64() as Long); + message.totalVotingPower = reader.int64(); break; case 5: message.timestamp = Timestamp.decode(reader, reader.uint32()); @@ -364,53 +381,61 @@ export const LightClientAttackEvidence = { fromJSON(object: any): LightClientAttackEvidence { return { conflictingBlock: isSet(object.conflictingBlock) ? LightBlock.fromJSON(object.conflictingBlock) : undefined, - commonHeight: isSet(object.commonHeight) ? Long.fromValue(object.commonHeight) : Long.ZERO, + commonHeight: isSet(object.commonHeight) ? BigInt(object.commonHeight.toString()) : BigInt(0), byzantineValidators: Array.isArray(object?.byzantineValidators) ? object.byzantineValidators.map((e: any) => Validator.fromJSON(e)) : [], - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO, + totalVotingPower: isSet(object.totalVotingPower) ? BigInt(object.totalVotingPower.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined }; }, toJSON(message: LightClientAttackEvidence): unknown { const obj: any = {}; message.conflictingBlock !== undefined && (obj.conflictingBlock = message.conflictingBlock ? LightBlock.toJSON(message.conflictingBlock) : undefined); - message.commonHeight !== undefined && (obj.commonHeight = (message.commonHeight || Long.ZERO).toString()); + message.commonHeight !== undefined && (obj.commonHeight = (message.commonHeight || BigInt(0)).toString()); if (message.byzantineValidators) { obj.byzantineValidators = message.byzantineValidators.map(e => e ? Validator.toJSON(e) : undefined); } else { obj.byzantineValidators = []; } - message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); message.timestamp !== undefined && (obj.timestamp = fromTimestamp(message.timestamp).toISOString()); return obj; }, fromPartial(object: Partial): LightClientAttackEvidence { const message = createBaseLightClientAttackEvidence(); message.conflictingBlock = object.conflictingBlock !== undefined && object.conflictingBlock !== null ? LightBlock.fromPartial(object.conflictingBlock) : undefined; - message.commonHeight = object.commonHeight !== undefined && object.commonHeight !== null ? Long.fromValue(object.commonHeight) : Long.ZERO; + message.commonHeight = object.commonHeight !== undefined && object.commonHeight !== null ? BigInt(object.commonHeight.toString()) : BigInt(0); message.byzantineValidators = object.byzantineValidators?.map(e => Validator.fromPartial(e)) || []; - message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? Long.fromValue(object.totalVotingPower) : Long.ZERO; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? Timestamp.fromPartial(object.timestamp) : undefined; return message; }, fromAmino(object: LightClientAttackEvidenceAmino): LightClientAttackEvidence { - return { - conflictingBlock: object?.conflicting_block ? LightBlock.fromAmino(object.conflicting_block) : undefined, - commonHeight: Long.fromString(object.common_height), - byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], - totalVotingPower: Long.fromString(object.total_voting_power), - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined - }; + const message = createBaseLightClientAttackEvidence(); + if (object.conflicting_block !== undefined && object.conflicting_block !== null) { + message.conflictingBlock = LightBlock.fromAmino(object.conflicting_block); + } + if (object.common_height !== undefined && object.common_height !== null) { + message.commonHeight = BigInt(object.common_height); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Validator.fromAmino(e)) || []; + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + return message; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { const obj: any = {}; obj.conflicting_block = message.conflictingBlock ? LightBlock.toAmino(message.conflictingBlock) : undefined; - obj.common_height = message.commonHeight ? message.commonHeight.toString() : undefined; + obj.common_height = message.commonHeight !== BigInt(0) ? message.commonHeight.toString() : undefined; if (message.byzantineValidators) { obj.byzantine_validators = message.byzantineValidators.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.byzantine_validators = []; + obj.byzantine_validators = message.byzantineValidators; } - obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; return obj; }, @@ -436,14 +461,15 @@ function createBaseEvidenceList(): EvidenceList { }; } export const EvidenceList = { - encode(message: EvidenceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.EvidenceList", + encode(message: EvidenceList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.evidence) { Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceList { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvidenceList(); while (reader.pos < end) { @@ -479,16 +505,16 @@ export const EvidenceList = { return message; }, fromAmino(object: EvidenceListAmino): EvidenceList { - return { - evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Evidence.fromAmino(e)) : [] - }; + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromAmino(e)) || []; + return message; }, toAmino(message: EvidenceList): EvidenceListAmino { const obj: any = {}; if (message.evidence) { obj.evidence = message.evidence.map(e => e ? Evidence.toAmino(e) : undefined); } else { - obj.evidence = []; + obj.evidence = message.evidence; } return obj; }, diff --git a/packages/api/src/codegen/tendermint/types/params.ts b/packages/api/src/codegen/tendermint/types/params.ts index b0a0acea..7bbaf54e 100644 --- a/packages/api/src/codegen/tendermint/types/params.ts +++ b/packages/api/src/codegen/tendermint/types/params.ts @@ -1,15 +1,15 @@ import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; -import { Long, isSet } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; /** * ConsensusParams contains consensus critical parameters that determine the * validity of blocks. */ export interface ConsensusParams { - block: BlockParams; - evidence: EvidenceParams; - validator: ValidatorParams; - version: VersionParams; + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; } export interface ConsensusParamsProtoMsg { typeUrl: "/tendermint.types.ConsensusParams"; @@ -34,10 +34,10 @@ export interface ConsensusParamsAminoMsg { * validity of blocks. */ export interface ConsensusParamsSDKType { - block: BlockParamsSDKType; - evidence: EvidenceParamsSDKType; - validator: ValidatorParamsSDKType; - version: VersionParamsSDKType; + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; + version?: VersionParamsSDKType; } /** BlockParams contains limits on the block size. */ export interface BlockParams { @@ -45,12 +45,12 @@ export interface BlockParams { * Max block size, in bytes. * Note: must be greater than 0 */ - maxBytes: Long; + maxBytes: bigint; /** * Max gas per block. * Note: must be greater or equal to -1 */ - maxGas: Long; + maxGas: bigint; } export interface BlockParamsProtoMsg { typeUrl: "/tendermint.types.BlockParams"; @@ -62,12 +62,12 @@ export interface BlockParamsAmino { * Max block size, in bytes. * Note: must be greater than 0 */ - max_bytes: string; + max_bytes?: string; /** * Max gas per block. * Note: must be greater or equal to -1 */ - max_gas: string; + max_gas?: string; } export interface BlockParamsAminoMsg { type: "/tendermint.types.BlockParams"; @@ -75,8 +75,8 @@ export interface BlockParamsAminoMsg { } /** BlockParams contains limits on the block size. */ export interface BlockParamsSDKType { - max_bytes: Long; - max_gas: Long; + max_bytes: bigint; + max_gas: bigint; } /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParams { @@ -86,7 +86,7 @@ export interface EvidenceParams { * The basic formula for calculating this is: MaxAgeDuration / {average block * time}. */ - maxAgeNumBlocks: Long; + maxAgeNumBlocks: bigint; /** * Max age of evidence, in time. * @@ -100,7 +100,7 @@ export interface EvidenceParams { * and should fall comfortably under the max block bytes. * Default is 1048576 or 1MB */ - maxBytes: Long; + maxBytes: bigint; } export interface EvidenceParamsProtoMsg { typeUrl: "/tendermint.types.EvidenceParams"; @@ -114,7 +114,7 @@ export interface EvidenceParamsAmino { * The basic formula for calculating this is: MaxAgeDuration / {average block * time}. */ - max_age_num_blocks: string; + max_age_num_blocks?: string; /** * Max age of evidence, in time. * @@ -128,7 +128,7 @@ export interface EvidenceParamsAmino { * and should fall comfortably under the max block bytes. * Default is 1048576 or 1MB */ - max_bytes: string; + max_bytes?: string; } export interface EvidenceParamsAminoMsg { type: "/tendermint.types.EvidenceParams"; @@ -136,9 +136,9 @@ export interface EvidenceParamsAminoMsg { } /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParamsSDKType { - max_age_num_blocks: Long; + max_age_num_blocks: bigint; max_age_duration: DurationSDKType; - max_bytes: Long; + max_bytes: bigint; } /** * ValidatorParams restrict the public key types validators can use. @@ -156,7 +156,7 @@ export interface ValidatorParamsProtoMsg { * NOTE: uses ABCI pubkey naming, not Amino names. */ export interface ValidatorParamsAmino { - pub_key_types: string[]; + pub_key_types?: string[]; } export interface ValidatorParamsAminoMsg { type: "/tendermint.types.ValidatorParams"; @@ -171,7 +171,7 @@ export interface ValidatorParamsSDKType { } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - app: Long; + app: bigint; } export interface VersionParamsProtoMsg { typeUrl: "/tendermint.types.VersionParams"; @@ -179,7 +179,7 @@ export interface VersionParamsProtoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsAmino { - app: string; + app?: string; } export interface VersionParamsAminoMsg { type: "/tendermint.types.VersionParams"; @@ -187,7 +187,7 @@ export interface VersionParamsAminoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsSDKType { - app: Long; + app: bigint; } /** * HashedParams is a subset of ConsensusParams. @@ -195,8 +195,8 @@ export interface VersionParamsSDKType { * It is hashed into the Header.ConsensusHash. */ export interface HashedParams { - blockMaxBytes: Long; - blockMaxGas: Long; + blockMaxBytes: bigint; + blockMaxGas: bigint; } export interface HashedParamsProtoMsg { typeUrl: "/tendermint.types.HashedParams"; @@ -208,8 +208,8 @@ export interface HashedParamsProtoMsg { * It is hashed into the Header.ConsensusHash. */ export interface HashedParamsAmino { - block_max_bytes: string; - block_max_gas: string; + block_max_bytes?: string; + block_max_gas?: string; } export interface HashedParamsAminoMsg { type: "/tendermint.types.HashedParams"; @@ -221,19 +221,20 @@ export interface HashedParamsAminoMsg { * It is hashed into the Header.ConsensusHash. */ export interface HashedParamsSDKType { - block_max_bytes: Long; - block_max_gas: Long; + block_max_bytes: bigint; + block_max_gas: bigint; } function createBaseConsensusParams(): ConsensusParams { return { - block: BlockParams.fromPartial({}), - evidence: EvidenceParams.fromPartial({}), - validator: ValidatorParams.fromPartial({}), - version: VersionParams.fromPartial({}) + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined }; } export const ConsensusParams = { - encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.ConsensusParams", + encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.block !== undefined) { BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); } @@ -248,8 +249,8 @@ export const ConsensusParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensusParams(); while (reader.pos < end) { @@ -299,12 +300,20 @@ export const ConsensusParams = { return message; }, fromAmino(object: ConsensusParamsAmino): ConsensusParams { - return { - block: object?.block ? BlockParams.fromAmino(object.block) : undefined, - evidence: object?.evidence ? EvidenceParams.fromAmino(object.evidence) : undefined, - validator: object?.validator ? ValidatorParams.fromAmino(object.validator) : undefined, - version: object?.version ? VersionParams.fromAmino(object.version) : undefined - }; + const message = createBaseConsensusParams(); + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromAmino(object.version); + } + return message; }, toAmino(message: ConsensusParams): ConsensusParamsAmino { const obj: any = {}; @@ -332,32 +341,33 @@ export const ConsensusParams = { }; function createBaseBlockParams(): BlockParams { return { - maxBytes: Long.ZERO, - maxGas: Long.ZERO + maxBytes: BigInt(0), + maxGas: BigInt(0) }; } export const BlockParams = { - encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxBytes.isZero()) { + typeUrl: "/tendermint.types.BlockParams", + encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxBytes !== BigInt(0)) { writer.uint32(8).int64(message.maxBytes); } - if (!message.maxGas.isZero()) { + if (message.maxGas !== BigInt(0)) { writer.uint32(16).int64(message.maxGas); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxBytes = (reader.int64() as Long); + message.maxBytes = reader.int64(); break; case 2: - message.maxGas = (reader.int64() as Long); + message.maxGas = reader.int64(); break; default: reader.skipType(tag & 7); @@ -368,32 +378,36 @@ export const BlockParams = { }, fromJSON(object: any): BlockParams { return { - maxBytes: isSet(object.maxBytes) ? Long.fromValue(object.maxBytes) : Long.ZERO, - maxGas: isSet(object.maxGas) ? Long.fromValue(object.maxGas) : Long.ZERO + maxBytes: isSet(object.maxBytes) ? BigInt(object.maxBytes.toString()) : BigInt(0), + maxGas: isSet(object.maxGas) ? BigInt(object.maxGas.toString()) : BigInt(0) }; }, toJSON(message: BlockParams): unknown { const obj: any = {}; - message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); - message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || BigInt(0)).toString()); + message.maxGas !== undefined && (obj.maxGas = (message.maxGas || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): BlockParams { const message = createBaseBlockParams(); - message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? Long.fromValue(object.maxBytes) : Long.ZERO; - message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? Long.fromValue(object.maxGas) : Long.ZERO; + message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); + message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); return message; }, fromAmino(object: BlockParamsAmino): BlockParams { - return { - maxBytes: Long.fromString(object.max_bytes), - maxGas: Long.fromString(object.max_gas) - }; + const message = createBaseBlockParams(); + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + if (object.max_gas !== undefined && object.max_gas !== null) { + message.maxGas = BigInt(object.max_gas); + } + return message; }, toAmino(message: BlockParams): BlockParamsAmino { const obj: any = {}; - obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; - obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; + obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; + obj.max_gas = message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; return obj; }, fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { @@ -414,39 +428,40 @@ export const BlockParams = { }; function createBaseEvidenceParams(): EvidenceParams { return { - maxAgeNumBlocks: Long.ZERO, - maxAgeDuration: undefined, - maxBytes: Long.ZERO + maxAgeNumBlocks: BigInt(0), + maxAgeDuration: Duration.fromPartial({}), + maxBytes: BigInt(0) }; } export const EvidenceParams = { - encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxAgeNumBlocks.isZero()) { + typeUrl: "/tendermint.types.EvidenceParams", + encode(message: EvidenceParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxAgeNumBlocks !== BigInt(0)) { writer.uint32(8).int64(message.maxAgeNumBlocks); } if (message.maxAgeDuration !== undefined) { Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); } - if (!message.maxBytes.isZero()) { + if (message.maxBytes !== BigInt(0)) { writer.uint32(24).int64(message.maxBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvidenceParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxAgeNumBlocks = (reader.int64() as Long); + message.maxAgeNumBlocks = reader.int64(); break; case 2: message.maxAgeDuration = Duration.decode(reader, reader.uint32()); break; case 3: - message.maxBytes = (reader.int64() as Long); + message.maxBytes = reader.int64(); break; default: reader.skipType(tag & 7); @@ -457,37 +472,43 @@ export const EvidenceParams = { }, fromJSON(object: any): EvidenceParams { return { - maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) ? Long.fromValue(object.maxAgeNumBlocks) : Long.ZERO, + maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) ? BigInt(object.maxAgeNumBlocks.toString()) : BigInt(0), maxAgeDuration: isSet(object.maxAgeDuration) ? Duration.fromJSON(object.maxAgeDuration) : undefined, - maxBytes: isSet(object.maxBytes) ? Long.fromValue(object.maxBytes) : Long.ZERO + maxBytes: isSet(object.maxBytes) ? BigInt(object.maxBytes.toString()) : BigInt(0) }; }, toJSON(message: EvidenceParams): unknown { const obj: any = {}; - message.maxAgeNumBlocks !== undefined && (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString()); + message.maxAgeNumBlocks !== undefined && (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || BigInt(0)).toString()); message.maxAgeDuration !== undefined && (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); - message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): EvidenceParams { const message = createBaseEvidenceParams(); - message.maxAgeNumBlocks = object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null ? Long.fromValue(object.maxAgeNumBlocks) : Long.ZERO; + message.maxAgeNumBlocks = object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null ? BigInt(object.maxAgeNumBlocks.toString()) : BigInt(0); message.maxAgeDuration = object.maxAgeDuration !== undefined && object.maxAgeDuration !== null ? Duration.fromPartial(object.maxAgeDuration) : undefined; - message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? Long.fromValue(object.maxBytes) : Long.ZERO; + message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); return message; }, fromAmino(object: EvidenceParamsAmino): EvidenceParams { - return { - maxAgeNumBlocks: Long.fromString(object.max_age_num_blocks), - maxAgeDuration: object?.max_age_duration ? Duration.fromAmino(object.max_age_duration) : undefined, - maxBytes: Long.fromString(object.max_bytes) - }; + const message = createBaseEvidenceParams(); + if (object.max_age_num_blocks !== undefined && object.max_age_num_blocks !== null) { + message.maxAgeNumBlocks = BigInt(object.max_age_num_blocks); + } + if (object.max_age_duration !== undefined && object.max_age_duration !== null) { + message.maxAgeDuration = Duration.fromAmino(object.max_age_duration); + } + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + return message; }, toAmino(message: EvidenceParams): EvidenceParamsAmino { const obj: any = {}; - obj.max_age_num_blocks = message.maxAgeNumBlocks ? message.maxAgeNumBlocks.toString() : undefined; + obj.max_age_num_blocks = message.maxAgeNumBlocks !== BigInt(0) ? message.maxAgeNumBlocks.toString() : undefined; obj.max_age_duration = message.maxAgeDuration ? Duration.toAmino(message.maxAgeDuration) : undefined; - obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; + obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; return obj; }, fromAminoMsg(object: EvidenceParamsAminoMsg): EvidenceParams { @@ -512,14 +533,15 @@ function createBaseValidatorParams(): ValidatorParams { }; } export const ValidatorParams = { - encode(message: ValidatorParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.ValidatorParams", + encode(message: ValidatorParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pubKeyTypes) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorParams(); while (reader.pos < end) { @@ -555,16 +577,16 @@ export const ValidatorParams = { return message; }, fromAmino(object: ValidatorParamsAmino): ValidatorParams { - return { - pubKeyTypes: Array.isArray(object?.pub_key_types) ? object.pub_key_types.map((e: any) => e) : [] - }; + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pub_key_types?.map(e => e) || []; + return message; }, toAmino(message: ValidatorParams): ValidatorParamsAmino { const obj: any = {}; if (message.pubKeyTypes) { obj.pub_key_types = message.pubKeyTypes.map(e => e); } else { - obj.pub_key_types = []; + obj.pub_key_types = message.pubKeyTypes; } return obj; }, @@ -586,25 +608,26 @@ export const ValidatorParams = { }; function createBaseVersionParams(): VersionParams { return { - app: Long.UZERO + app: BigInt(0) }; } export const VersionParams = { - encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.app.isZero()) { + typeUrl: "/tendermint.types.VersionParams", + encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.app !== BigInt(0)) { writer.uint32(8).uint64(message.app); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVersionParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.app = (reader.uint64() as Long); + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -615,27 +638,29 @@ export const VersionParams = { }, fromJSON(object: any): VersionParams { return { - app: isSet(object.app) ? Long.fromValue(object.app) : Long.UZERO + app: isSet(object.app) ? BigInt(object.app.toString()) : BigInt(0) }; }, toJSON(message: VersionParams): unknown { const obj: any = {}; - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): VersionParams { const message = createBaseVersionParams(); - message.app = object.app !== undefined && object.app !== null ? Long.fromValue(object.app) : Long.UZERO; + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); return message; }, fromAmino(object: VersionParamsAmino): VersionParams { - return { - app: Long.fromString(object.app) - }; + const message = createBaseVersionParams(); + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: VersionParams): VersionParamsAmino { const obj: any = {}; - obj.app = message.app ? message.app.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; return obj; }, fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { @@ -656,32 +681,33 @@ export const VersionParams = { }; function createBaseHashedParams(): HashedParams { return { - blockMaxBytes: Long.ZERO, - blockMaxGas: Long.ZERO + blockMaxBytes: BigInt(0), + blockMaxGas: BigInt(0) }; } export const HashedParams = { - encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockMaxBytes.isZero()) { + typeUrl: "/tendermint.types.HashedParams", + encode(message: HashedParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockMaxBytes !== BigInt(0)) { writer.uint32(8).int64(message.blockMaxBytes); } - if (!message.blockMaxGas.isZero()) { + if (message.blockMaxGas !== BigInt(0)) { writer.uint32(16).int64(message.blockMaxGas); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHashedParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockMaxBytes = (reader.int64() as Long); + message.blockMaxBytes = reader.int64(); break; case 2: - message.blockMaxGas = (reader.int64() as Long); + message.blockMaxGas = reader.int64(); break; default: reader.skipType(tag & 7); @@ -692,32 +718,36 @@ export const HashedParams = { }, fromJSON(object: any): HashedParams { return { - blockMaxBytes: isSet(object.blockMaxBytes) ? Long.fromValue(object.blockMaxBytes) : Long.ZERO, - blockMaxGas: isSet(object.blockMaxGas) ? Long.fromValue(object.blockMaxGas) : Long.ZERO + blockMaxBytes: isSet(object.blockMaxBytes) ? BigInt(object.blockMaxBytes.toString()) : BigInt(0), + blockMaxGas: isSet(object.blockMaxGas) ? BigInt(object.blockMaxGas.toString()) : BigInt(0) }; }, toJSON(message: HashedParams): unknown { const obj: any = {}; - message.blockMaxBytes !== undefined && (obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString()); - message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString()); + message.blockMaxBytes !== undefined && (obj.blockMaxBytes = (message.blockMaxBytes || BigInt(0)).toString()); + message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): HashedParams { const message = createBaseHashedParams(); - message.blockMaxBytes = object.blockMaxBytes !== undefined && object.blockMaxBytes !== null ? Long.fromValue(object.blockMaxBytes) : Long.ZERO; - message.blockMaxGas = object.blockMaxGas !== undefined && object.blockMaxGas !== null ? Long.fromValue(object.blockMaxGas) : Long.ZERO; + message.blockMaxBytes = object.blockMaxBytes !== undefined && object.blockMaxBytes !== null ? BigInt(object.blockMaxBytes.toString()) : BigInt(0); + message.blockMaxGas = object.blockMaxGas !== undefined && object.blockMaxGas !== null ? BigInt(object.blockMaxGas.toString()) : BigInt(0); return message; }, fromAmino(object: HashedParamsAmino): HashedParams { - return { - blockMaxBytes: Long.fromString(object.block_max_bytes), - blockMaxGas: Long.fromString(object.block_max_gas) - }; + const message = createBaseHashedParams(); + if (object.block_max_bytes !== undefined && object.block_max_bytes !== null) { + message.blockMaxBytes = BigInt(object.block_max_bytes); + } + if (object.block_max_gas !== undefined && object.block_max_gas !== null) { + message.blockMaxGas = BigInt(object.block_max_gas); + } + return message; }, toAmino(message: HashedParams): HashedParamsAmino { const obj: any = {}; - obj.block_max_bytes = message.blockMaxBytes ? message.blockMaxBytes.toString() : undefined; - obj.block_max_gas = message.blockMaxGas ? message.blockMaxGas.toString() : undefined; + obj.block_max_bytes = message.blockMaxBytes !== BigInt(0) ? message.blockMaxBytes.toString() : undefined; + obj.block_max_gas = message.blockMaxGas !== BigInt(0) ? message.blockMaxGas.toString() : undefined; return obj; }, fromAminoMsg(object: HashedParamsAminoMsg): HashedParams { diff --git a/packages/api/src/codegen/tendermint/types/types.ts b/packages/api/src/codegen/tendermint/types/types.ts index 5d41549f..521bbe32 100644 --- a/packages/api/src/codegen/tendermint/types/types.ts +++ b/packages/api/src/codegen/tendermint/types/types.ts @@ -1,9 +1,9 @@ import { Proof, ProofAmino, ProofSDKType } from "../crypto/proof"; import { Consensus, ConsensusAmino, ConsensusSDKType } from "../version/types"; -import { Timestamp, TimestampAmino, TimestampSDKType } from "../../google/protobuf/timestamp"; +import { Timestamp, TimestampSDKType } from "../../google/protobuf/timestamp"; import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "./validator"; -import { Long, isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../helpers"; /** BlockIdFlag indicates which BlcokID the signature is for */ export enum BlockIDFlag { BLOCK_ID_FLAG_UNKNOWN = 0, @@ -107,8 +107,8 @@ export interface PartSetHeaderProtoMsg { } /** PartsetHeader */ export interface PartSetHeaderAmino { - total: number; - hash: Uint8Array; + total?: number; + hash?: string; } export interface PartSetHeaderAminoMsg { type: "/tendermint.types.PartSetHeader"; @@ -129,8 +129,8 @@ export interface PartProtoMsg { value: Uint8Array; } export interface PartAmino { - index: number; - bytes: Uint8Array; + index?: number; + bytes?: string; proof?: ProofAmino; } export interface PartAminoMsg { @@ -153,7 +153,7 @@ export interface BlockIDProtoMsg { } /** BlockID */ export interface BlockIDAmino { - hash: Uint8Array; + hash?: string; part_set_header?: PartSetHeaderAmino; } export interface BlockIDAminoMsg { @@ -170,7 +170,7 @@ export interface Header { /** basic block info */ version: Consensus; chainId: string; - height: Long; + height: bigint; time: Timestamp; /** prev block info */ lastBlockId: BlockID; @@ -199,27 +199,27 @@ export interface HeaderProtoMsg { export interface HeaderAmino { /** basic block info */ version?: ConsensusAmino; - chain_id: string; - height: string; - time?: TimestampAmino; + chain_id?: string; + height?: string; + time?: string; /** prev block info */ last_block_id?: BlockIDAmino; /** hashes of block data */ - last_commit_hash: Uint8Array; - data_hash: Uint8Array; + last_commit_hash?: string; + data_hash?: string; /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; + validators_hash?: string; /** validators for the next block */ - next_validators_hash: Uint8Array; + next_validators_hash?: string; /** consensus params for current block */ - consensus_hash: Uint8Array; + consensus_hash?: string; /** state after txs from the previous block */ - app_hash: Uint8Array; - last_results_hash: Uint8Array; + app_hash?: string; + last_results_hash?: string; /** consensus info */ - evidence_hash: Uint8Array; + evidence_hash?: string; /** original proposer of the block */ - proposer_address: Uint8Array; + proposer_address?: string; } export interface HeaderAminoMsg { type: "/tendermint.types.Header"; @@ -229,7 +229,7 @@ export interface HeaderAminoMsg { export interface HeaderSDKType { version: ConsensusSDKType; chain_id: string; - height: Long; + height: bigint; time: TimestampSDKType; last_block_id: BlockIDSDKType; last_commit_hash: Uint8Array; @@ -262,7 +262,7 @@ export interface DataAmino { * NOTE: not all txs here are valid. We're just agreeing on the order first. * This means that block.AppHash does not include these txs. */ - txs: Uint8Array[]; + txs?: string[]; } export interface DataAminoMsg { type: "/tendermint.types.Data"; @@ -278,7 +278,7 @@ export interface DataSDKType { */ export interface Vote { type: SignedMsgType; - height: Long; + height: bigint; round: number; blockId: BlockID; timestamp: Timestamp; @@ -295,14 +295,14 @@ export interface VoteProtoMsg { * consensus. */ export interface VoteAmino { - type: SignedMsgType; - height: string; - round: number; + type?: SignedMsgType; + height?: string; + round?: number; block_id?: BlockIDAmino; - timestamp?: TimestampAmino; - validator_address: Uint8Array; - validator_index: number; - signature: Uint8Array; + timestamp?: string; + validator_address?: string; + validator_index?: number; + signature?: string; } export interface VoteAminoMsg { type: "/tendermint.types.Vote"; @@ -314,7 +314,7 @@ export interface VoteAminoMsg { */ export interface VoteSDKType { type: SignedMsgType; - height: Long; + height: bigint; round: number; block_id: BlockIDSDKType; timestamp: TimestampSDKType; @@ -324,7 +324,7 @@ export interface VoteSDKType { } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface Commit { - height: Long; + height: bigint; round: number; blockId: BlockID; signatures: CommitSig[]; @@ -335,10 +335,10 @@ export interface CommitProtoMsg { } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface CommitAmino { - height: string; - round: number; + height?: string; + round?: number; block_id?: BlockIDAmino; - signatures: CommitSigAmino[]; + signatures?: CommitSigAmino[]; } export interface CommitAminoMsg { type: "/tendermint.types.Commit"; @@ -346,7 +346,7 @@ export interface CommitAminoMsg { } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface CommitSDKType { - height: Long; + height: bigint; round: number; block_id: BlockIDSDKType; signatures: CommitSigSDKType[]; @@ -364,10 +364,10 @@ export interface CommitSigProtoMsg { } /** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSigAmino { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; - timestamp?: TimestampAmino; - signature: Uint8Array; + block_id_flag?: BlockIDFlag; + validator_address?: string; + timestamp?: string; + signature?: string; } export interface CommitSigAminoMsg { type: "/tendermint.types.CommitSig"; @@ -382,7 +382,7 @@ export interface CommitSigSDKType { } export interface Proposal { type: SignedMsgType; - height: Long; + height: bigint; round: number; polRound: number; blockId: BlockID; @@ -394,13 +394,13 @@ export interface ProposalProtoMsg { value: Uint8Array; } export interface ProposalAmino { - type: SignedMsgType; - height: string; - round: number; - pol_round: number; + type?: SignedMsgType; + height?: string; + round?: number; + pol_round?: number; block_id?: BlockIDAmino; - timestamp?: TimestampAmino; - signature: Uint8Array; + timestamp?: string; + signature?: string; } export interface ProposalAminoMsg { type: "/tendermint.types.Proposal"; @@ -408,7 +408,7 @@ export interface ProposalAminoMsg { } export interface ProposalSDKType { type: SignedMsgType; - height: Long; + height: bigint; round: number; pol_round: number; block_id: BlockIDSDKType; @@ -416,8 +416,8 @@ export interface ProposalSDKType { signature: Uint8Array; } export interface SignedHeader { - header: Header; - commit: Commit; + header?: Header; + commit?: Commit; } export interface SignedHeaderProtoMsg { typeUrl: "/tendermint.types.SignedHeader"; @@ -432,12 +432,12 @@ export interface SignedHeaderAminoMsg { value: SignedHeaderAmino; } export interface SignedHeaderSDKType { - header: HeaderSDKType; - commit: CommitSDKType; + header?: HeaderSDKType; + commit?: CommitSDKType; } export interface LightBlock { - signedHeader: SignedHeader; - validatorSet: ValidatorSet; + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; } export interface LightBlockProtoMsg { typeUrl: "/tendermint.types.LightBlock"; @@ -452,14 +452,14 @@ export interface LightBlockAminoMsg { value: LightBlockAmino; } export interface LightBlockSDKType { - signed_header: SignedHeaderSDKType; - validator_set: ValidatorSetSDKType; + signed_header?: SignedHeaderSDKType; + validator_set?: ValidatorSetSDKType; } export interface BlockMeta { blockId: BlockID; - blockSize: Long; + blockSize: bigint; header: Header; - numTxs: Long; + numTxs: bigint; } export interface BlockMetaProtoMsg { typeUrl: "/tendermint.types.BlockMeta"; @@ -467,9 +467,9 @@ export interface BlockMetaProtoMsg { } export interface BlockMetaAmino { block_id?: BlockIDAmino; - block_size: string; + block_size?: string; header?: HeaderAmino; - num_txs: string; + num_txs?: string; } export interface BlockMetaAminoMsg { type: "/tendermint.types.BlockMeta"; @@ -477,15 +477,15 @@ export interface BlockMetaAminoMsg { } export interface BlockMetaSDKType { block_id: BlockIDSDKType; - block_size: Long; + block_size: bigint; header: HeaderSDKType; - num_txs: Long; + num_txs: bigint; } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProof { rootHash: Uint8Array; data: Uint8Array; - proof: Proof; + proof?: Proof; } export interface TxProofProtoMsg { typeUrl: "/tendermint.types.TxProof"; @@ -493,8 +493,8 @@ export interface TxProofProtoMsg { } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProofAmino { - root_hash: Uint8Array; - data: Uint8Array; + root_hash?: string; + data?: string; proof?: ProofAmino; } export interface TxProofAminoMsg { @@ -505,7 +505,7 @@ export interface TxProofAminoMsg { export interface TxProofSDKType { root_hash: Uint8Array; data: Uint8Array; - proof: ProofSDKType; + proof?: ProofSDKType; } function createBasePartSetHeader(): PartSetHeader { return { @@ -514,7 +514,8 @@ function createBasePartSetHeader(): PartSetHeader { }; } export const PartSetHeader = { - encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.PartSetHeader", + encode(message: PartSetHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.total !== 0) { writer.uint32(8).uint32(message.total); } @@ -523,8 +524,8 @@ export const PartSetHeader = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePartSetHeader(); while (reader.pos < end) { @@ -562,15 +563,19 @@ export const PartSetHeader = { return message; }, fromAmino(object: PartSetHeaderAmino): PartSetHeader { - return { - total: object.total, - hash: object.hash - }; + const message = createBasePartSetHeader(); + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; }, toAmino(message: PartSetHeader): PartSetHeaderAmino { const obj: any = {}; - obj.total = message.total; - obj.hash = message.hash; + obj.total = message.total === 0 ? undefined : message.total; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; return obj; }, fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { @@ -597,7 +602,8 @@ function createBasePart(): Part { }; } export const Part = { - encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Part", + encode(message: Part, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -609,8 +615,8 @@ export const Part = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Part { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Part { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePart(); while (reader.pos < end) { @@ -654,16 +660,22 @@ export const Part = { return message; }, fromAmino(object: PartAmino): Part { - return { - index: object.index, - bytes: object.bytes, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBasePart(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: Part): PartAmino { const obj: any = {}; - obj.index = message.index; - obj.bytes = message.bytes; + obj.index = message.index === 0 ? undefined : message.index; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, @@ -690,7 +702,8 @@ function createBaseBlockID(): BlockID { }; } export const BlockID = { - encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.BlockID", + encode(message: BlockID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } @@ -699,8 +712,8 @@ export const BlockID = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockID(); while (reader.pos < end) { @@ -738,14 +751,18 @@ export const BlockID = { return message; }, fromAmino(object: BlockIDAmino): BlockID { - return { - hash: object.hash, - partSetHeader: object?.part_set_header ? PartSetHeader.fromAmino(object.part_set_header) : undefined - }; + const message = createBaseBlockID(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.part_set_header !== undefined && object.part_set_header !== null) { + message.partSetHeader = PartSetHeader.fromAmino(object.part_set_header); + } + return message; }, toAmino(message: BlockID): BlockIDAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.part_set_header = message.partSetHeader ? PartSetHeader.toAmino(message.partSetHeader) : undefined; return obj; }, @@ -769,8 +786,8 @@ function createBaseHeader(): Header { return { version: Consensus.fromPartial({}), chainId: "", - height: Long.ZERO, - time: undefined, + height: BigInt(0), + time: Timestamp.fromPartial({}), lastBlockId: BlockID.fromPartial({}), lastCommitHash: new Uint8Array(), dataHash: new Uint8Array(), @@ -784,14 +801,15 @@ function createBaseHeader(): Header { }; } export const Header = { - encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); } if (message.chainId !== "") { writer.uint32(18).string(message.chainId); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { @@ -829,8 +847,8 @@ export const Header = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Header { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeader(); while (reader.pos < end) { @@ -843,7 +861,7 @@ export const Header = { message.chainId = reader.string(); break; case 3: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 4: message.time = Timestamp.decode(reader, reader.uint32()); @@ -889,7 +907,7 @@ export const Header = { return { version: isSet(object.version) ? Consensus.fromJSON(object.version) : undefined, chainId: isSet(object.chainId) ? String(object.chainId) : "", - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, lastBlockId: isSet(object.lastBlockId) ? BlockID.fromJSON(object.lastBlockId) : undefined, lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(), @@ -907,7 +925,7 @@ export const Header = { const obj: any = {}; message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); message.chainId !== undefined && (obj.chainId = message.chainId); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.lastBlockId !== undefined && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); message.lastCommitHash !== undefined && (obj.lastCommitHash = base64FromBytes(message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array())); @@ -925,7 +943,7 @@ export const Header = { const message = createBaseHeader(); message.version = object.version !== undefined && object.version !== null ? Consensus.fromPartial(object.version) : undefined; message.chainId = object.chainId ?? ""; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.time = object.time !== undefined && object.time !== null ? Timestamp.fromPartial(object.time) : undefined; message.lastBlockId = object.lastBlockId !== undefined && object.lastBlockId !== null ? BlockID.fromPartial(object.lastBlockId) : undefined; message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); @@ -940,39 +958,67 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - version: object?.version ? Consensus.fromAmino(object.version) : undefined, - chainId: object.chain_id, - height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, - lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, - lastCommitHash: object.last_commit_hash, - dataHash: object.data_hash, - validatorsHash: object.validators_hash, - nextValidatorsHash: object.next_validators_hash, - consensusHash: object.consensus_hash, - appHash: object.app_hash, - lastResultsHash: object.last_results_hash, - evidenceHash: object.evidence_hash, - proposerAddress: object.proposer_address - }; + const message = createBaseHeader(); + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromAmino(object.version); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.last_block_id !== undefined && object.last_block_id !== null) { + message.lastBlockId = BlockID.fromAmino(object.last_block_id); + } + if (object.last_commit_hash !== undefined && object.last_commit_hash !== null) { + message.lastCommitHash = bytesFromBase64(object.last_commit_hash); + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.validators_hash !== undefined && object.validators_hash !== null) { + message.validatorsHash = bytesFromBase64(object.validators_hash); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.consensus_hash !== undefined && object.consensus_hash !== null) { + message.consensusHash = bytesFromBase64(object.consensus_hash); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + if (object.last_results_hash !== undefined && object.last_results_hash !== null) { + message.lastResultsHash = bytesFromBase64(object.last_results_hash); + } + if (object.evidence_hash !== undefined && object.evidence_hash !== null) { + message.evidenceHash = bytesFromBase64(object.evidence_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.version = message.version ? Consensus.toAmino(message.version) : undefined; - obj.chain_id = message.chainId; - obj.height = message.height ? message.height.toString() : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; - obj.last_commit_hash = message.lastCommitHash; - obj.data_hash = message.dataHash; - obj.validators_hash = message.validatorsHash; - obj.next_validators_hash = message.nextValidatorsHash; - obj.consensus_hash = message.consensusHash; - obj.app_hash = message.appHash; - obj.last_results_hash = message.lastResultsHash; - obj.evidence_hash = message.evidenceHash; - obj.proposer_address = message.proposerAddress; + obj.last_commit_hash = message.lastCommitHash ? base64FromBytes(message.lastCommitHash) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.validators_hash = message.validatorsHash ? base64FromBytes(message.validatorsHash) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.consensus_hash = message.consensusHash ? base64FromBytes(message.consensusHash) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.last_results_hash = message.lastResultsHash ? base64FromBytes(message.lastResultsHash) : undefined; + obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, fromAminoMsg(object: HeaderAminoMsg): Header { @@ -997,14 +1043,15 @@ function createBaseData(): Data { }; } export const Data = { - encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Data", + encode(message: Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Data { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseData(); while (reader.pos < end) { @@ -1040,16 +1087,16 @@ export const Data = { return message; }, fromAmino(object: DataAmino): Data { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [] - }; + const message = createBaseData(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Data): DataAmino { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map(e => e); + obj.txs = message.txs.map(e => base64FromBytes(e)); } else { - obj.txs = []; + obj.txs = message.txs; } return obj; }, @@ -1072,21 +1119,22 @@ export const Data = { function createBaseVote(): Vote { return { type: 0, - height: Long.ZERO, + height: BigInt(0), round: 0, blockId: BlockID.fromPartial({}), - timestamp: undefined, + timestamp: Timestamp.fromPartial({}), validatorAddress: new Uint8Array(), validatorIndex: 0, signature: new Uint8Array() }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(16).int64(message.height); } if (message.round !== 0) { @@ -1109,8 +1157,8 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { @@ -1120,7 +1168,7 @@ export const Vote = { message.type = (reader.int32() as any); break; case 2: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 3: message.round = reader.int32(); @@ -1149,8 +1197,8 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, @@ -1162,7 +1210,7 @@ export const Vote = { toJSON(message: Vote): unknown { const obj: any = {}; message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.round !== undefined && (obj.round = Math.round(message.round)); message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); message.timestamp !== undefined && (obj.timestamp = fromTimestamp(message.timestamp).toISOString()); @@ -1174,7 +1222,7 @@ export const Vote = { fromPartial(object: Partial): Vote { const message = createBaseVote(); message.type = object.type ?? 0; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.round = object.round ?? 0; message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? Timestamp.fromPartial(object.timestamp) : undefined; @@ -1184,27 +1232,43 @@ export const Vote = { return message; }, fromAmino(object: VoteAmino): Vote { - return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, - height: Long.fromString(object.height), - round: object.round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, - validatorAddress: object.validator_address, - validatorIndex: object.validator_index, - signature: object.signature - }; + const message = createBaseVote(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.validator_index !== undefined && object.validator_index !== null) { + message.validatorIndex = object.validator_index; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.type = message.type; - obj.height = message.height ? message.height.toString() : undefined; - obj.round = message.round; + obj.type = message.type === 0 ? undefined : message.type; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; - obj.validator_address = message.validatorAddress; - obj.validator_index = message.validatorIndex; - obj.signature = message.signature; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; + obj.validator_index = message.validatorIndex === 0 ? undefined : message.validatorIndex; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { @@ -1225,15 +1289,16 @@ export const Vote = { }; function createBaseCommit(): Commit { return { - height: Long.ZERO, + height: BigInt(0), round: 0, blockId: BlockID.fromPartial({}), signatures: [] }; } export const Commit = { - encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + typeUrl: "/tendermint.types.Commit", + encode(message: Commit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.round !== 0) { @@ -1247,15 +1312,15 @@ export const Commit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Commit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 2: message.round = reader.int32(); @@ -1275,7 +1340,7 @@ export const Commit = { }, fromJSON(object: any): Commit { return { - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromJSON(e)) : [] @@ -1283,7 +1348,7 @@ export const Commit = { }, toJSON(message: Commit): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.round !== undefined && (obj.round = Math.round(message.round)); message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); if (message.signatures) { @@ -1295,29 +1360,35 @@ export const Commit = { }, fromPartial(object: Partial): Commit { const message = createBaseCommit(); - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.round = object.round ?? 0; message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; message.signatures = object.signatures?.map(e => CommitSig.fromPartial(e)) || []; return message; }, fromAmino(object: CommitAmino): Commit { - return { - height: Long.fromString(object.height), - round: object.round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromAmino(e)) : [] - }; + const message = createBaseCommit(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + message.signatures = object.signatures?.map(e => CommitSig.fromAmino(e)) || []; + return message; }, toAmino(message: Commit): CommitAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; - obj.round = message.round; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; if (message.signatures) { obj.signatures = message.signatures.map(e => e ? CommitSig.toAmino(e) : undefined); } else { - obj.signatures = []; + obj.signatures = message.signatures; } return obj; }, @@ -1341,12 +1412,13 @@ function createBaseCommitSig(): CommitSig { return { blockIdFlag: 0, validatorAddress: new Uint8Array(), - timestamp: undefined, + timestamp: Timestamp.fromPartial({}), signature: new Uint8Array() }; } export const CommitSig = { - encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.CommitSig", + encode(message: CommitSig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockIdFlag !== 0) { writer.uint32(8).int32(message.blockIdFlag); } @@ -1361,8 +1433,8 @@ export const CommitSig = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitSig(); while (reader.pos < end) { @@ -1389,7 +1461,7 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { return { - blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : -1, validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() @@ -1412,19 +1484,27 @@ export const CommitSig = { return message; }, fromAmino(object: CommitSigAmino): CommitSig { - return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, - validatorAddress: object.validator_address, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, - signature: object.signature - }; + const message = createBaseCommitSig(); + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = object.block_id_flag; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: CommitSig): CommitSigAmino { const obj: any = {}; - obj.block_id_flag = message.blockIdFlag; - obj.validator_address = message.validatorAddress; + obj.block_id_flag = message.blockIdFlag === 0 ? undefined : message.blockIdFlag; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: CommitSigAminoMsg): CommitSig { @@ -1446,20 +1526,21 @@ export const CommitSig = { function createBaseProposal(): Proposal { return { type: 0, - height: Long.ZERO, + height: BigInt(0), round: 0, polRound: 0, blockId: BlockID.fromPartial({}), - timestamp: undefined, + timestamp: Timestamp.fromPartial({}), signature: new Uint8Array() }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(16).int64(message.height); } if (message.round !== 0) { @@ -1479,8 +1560,8 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { @@ -1490,7 +1571,7 @@ export const Proposal = { message.type = (reader.int32() as any); break; case 2: - message.height = (reader.int64() as Long); + message.height = reader.int64(); break; case 3: message.round = reader.int32(); @@ -1516,8 +1597,8 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, - height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, polRound: isSet(object.polRound) ? Number(object.polRound) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, @@ -1528,7 +1609,7 @@ export const Proposal = { toJSON(message: Proposal): unknown { const obj: any = {}; message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.round !== undefined && (obj.round = Math.round(message.round)); message.polRound !== undefined && (obj.polRound = Math.round(message.polRound)); message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); @@ -1539,7 +1620,7 @@ export const Proposal = { fromPartial(object: Partial): Proposal { const message = createBaseProposal(); message.type = object.type ?? 0; - message.height = object.height !== undefined && object.height !== null ? Long.fromValue(object.height) : Long.ZERO; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.round = object.round ?? 0; message.polRound = object.polRound ?? 0; message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; @@ -1548,25 +1629,39 @@ export const Proposal = { return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, - height: Long.fromString(object.height), - round: object.round, - polRound: object.pol_round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, - signature: object.signature - }; + const message = createBaseProposal(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.pol_round !== undefined && object.pol_round !== null) { + message.polRound = object.pol_round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Timestamp.fromAmino(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; - obj.type = message.type; - obj.height = message.height ? message.height.toString() : undefined; - obj.round = message.round; - obj.pol_round = message.polRound; + obj.type = message.type === 0 ? undefined : message.type; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + obj.pol_round = message.polRound === 0 ? undefined : message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -1587,12 +1682,13 @@ export const Proposal = { }; function createBaseSignedHeader(): SignedHeader { return { - header: Header.fromPartial({}), - commit: Commit.fromPartial({}) + header: undefined, + commit: undefined }; } export const SignedHeader = { - encode(message: SignedHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.SignedHeader", + encode(message: SignedHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -1601,8 +1697,8 @@ export const SignedHeader = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignedHeader(); while (reader.pos < end) { @@ -1640,10 +1736,14 @@ export const SignedHeader = { return message; }, fromAmino(object: SignedHeaderAmino): SignedHeader { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - commit: object?.commit ? Commit.fromAmino(object.commit) : undefined - }; + const message = createBaseSignedHeader(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromAmino(object.commit); + } + return message; }, toAmino(message: SignedHeader): SignedHeaderAmino { const obj: any = {}; @@ -1669,12 +1769,13 @@ export const SignedHeader = { }; function createBaseLightBlock(): LightBlock { return { - signedHeader: SignedHeader.fromPartial({}), - validatorSet: ValidatorSet.fromPartial({}) + signedHeader: undefined, + validatorSet: undefined }; } export const LightBlock = { - encode(message: LightBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.LightBlock", + encode(message: LightBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signedHeader !== undefined) { SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); } @@ -1683,8 +1784,8 @@ export const LightBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLightBlock(); while (reader.pos < end) { @@ -1722,10 +1823,14 @@ export const LightBlock = { return message; }, fromAmino(object: LightBlockAmino): LightBlock { - return { - signedHeader: object?.signed_header ? SignedHeader.fromAmino(object.signed_header) : undefined, - validatorSet: object?.validator_set ? ValidatorSet.fromAmino(object.validator_set) : undefined - }; + const message = createBaseLightBlock(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + return message; }, toAmino(message: LightBlock): LightBlockAmino { const obj: any = {}; @@ -1752,29 +1857,30 @@ export const LightBlock = { function createBaseBlockMeta(): BlockMeta { return { blockId: BlockID.fromPartial({}), - blockSize: Long.ZERO, + blockSize: BigInt(0), header: Header.fromPartial({}), - numTxs: Long.ZERO + numTxs: BigInt(0) }; } export const BlockMeta = { - encode(message: BlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.BlockMeta", + encode(message: BlockMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } - if (!message.blockSize.isZero()) { + if (message.blockSize !== BigInt(0)) { writer.uint32(16).int64(message.blockSize); } if (message.header !== undefined) { Header.encode(message.header, writer.uint32(26).fork()).ldelim(); } - if (!message.numTxs.isZero()) { + if (message.numTxs !== BigInt(0)) { writer.uint32(32).int64(message.numTxs); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockMeta(); while (reader.pos < end) { @@ -1784,13 +1890,13 @@ export const BlockMeta = { message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: - message.blockSize = (reader.int64() as Long); + message.blockSize = reader.int64(); break; case 3: message.header = Header.decode(reader, reader.uint32()); break; case 4: - message.numTxs = (reader.int64() as Long); + message.numTxs = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1802,41 +1908,49 @@ export const BlockMeta = { fromJSON(object: any): BlockMeta { return { blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, - blockSize: isSet(object.blockSize) ? Long.fromValue(object.blockSize) : Long.ZERO, + blockSize: isSet(object.blockSize) ? BigInt(object.blockSize.toString()) : BigInt(0), header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, - numTxs: isSet(object.numTxs) ? Long.fromValue(object.numTxs) : Long.ZERO + numTxs: isSet(object.numTxs) ? BigInt(object.numTxs.toString()) : BigInt(0) }; }, toJSON(message: BlockMeta): unknown { const obj: any = {}; message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.blockSize !== undefined && (obj.blockSize = (message.blockSize || Long.ZERO).toString()); + message.blockSize !== undefined && (obj.blockSize = (message.blockSize || BigInt(0)).toString()); message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.numTxs !== undefined && (obj.numTxs = (message.numTxs || Long.ZERO).toString()); + message.numTxs !== undefined && (obj.numTxs = (message.numTxs || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): BlockMeta { const message = createBaseBlockMeta(); message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; - message.blockSize = object.blockSize !== undefined && object.blockSize !== null ? Long.fromValue(object.blockSize) : Long.ZERO; + message.blockSize = object.blockSize !== undefined && object.blockSize !== null ? BigInt(object.blockSize.toString()) : BigInt(0); message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; - message.numTxs = object.numTxs !== undefined && object.numTxs !== null ? Long.fromValue(object.numTxs) : Long.ZERO; + message.numTxs = object.numTxs !== undefined && object.numTxs !== null ? BigInt(object.numTxs.toString()) : BigInt(0); return message; }, fromAmino(object: BlockMetaAmino): BlockMeta { - return { - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - blockSize: Long.fromString(object.block_size), - header: object?.header ? Header.fromAmino(object.header) : undefined, - numTxs: Long.fromString(object.num_txs) - }; + const message = createBaseBlockMeta(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block_size !== undefined && object.block_size !== null) { + message.blockSize = BigInt(object.block_size); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.num_txs !== undefined && object.num_txs !== null) { + message.numTxs = BigInt(object.num_txs); + } + return message; }, toAmino(message: BlockMeta): BlockMetaAmino { const obj: any = {}; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.block_size = message.blockSize ? message.blockSize.toString() : undefined; + obj.block_size = message.blockSize !== BigInt(0) ? message.blockSize.toString() : undefined; obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.num_txs = message.numTxs ? message.numTxs.toString() : undefined; + obj.num_txs = message.numTxs !== BigInt(0) ? message.numTxs.toString() : undefined; return obj; }, fromAminoMsg(object: BlockMetaAminoMsg): BlockMeta { @@ -1859,11 +1973,12 @@ function createBaseTxProof(): TxProof { return { rootHash: new Uint8Array(), data: new Uint8Array(), - proof: Proof.fromPartial({}) + proof: undefined }; } export const TxProof = { - encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.TxProof", + encode(message: TxProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rootHash.length !== 0) { writer.uint32(10).bytes(message.rootHash); } @@ -1875,8 +1990,8 @@ export const TxProof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxProof(); while (reader.pos < end) { @@ -1920,16 +2035,22 @@ export const TxProof = { return message; }, fromAmino(object: TxProofAmino): TxProof { - return { - rootHash: object.root_hash, - data: object.data, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBaseTxProof(); + if (object.root_hash !== undefined && object.root_hash !== null) { + message.rootHash = bytesFromBase64(object.root_hash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: TxProof): TxProofAmino { const obj: any = {}; - obj.root_hash = message.rootHash; - obj.data = message.data; + obj.root_hash = message.rootHash ? base64FromBytes(message.rootHash) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, diff --git a/packages/api/src/codegen/tendermint/types/validator.ts b/packages/api/src/codegen/tendermint/types/validator.ts index da28f555..67d12b64 100644 --- a/packages/api/src/codegen/tendermint/types/validator.ts +++ b/packages/api/src/codegen/tendermint/types/validator.ts @@ -1,19 +1,19 @@ import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; -import { Long, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export interface ValidatorSet { validators: Validator[]; - proposer: Validator; - totalVotingPower: Long; + proposer?: Validator; + totalVotingPower: bigint; } export interface ValidatorSetProtoMsg { typeUrl: "/tendermint.types.ValidatorSet"; value: Uint8Array; } export interface ValidatorSetAmino { - validators: ValidatorAmino[]; + validators?: ValidatorAmino[]; proposer?: ValidatorAmino; - total_voting_power: string; + total_voting_power?: string; } export interface ValidatorSetAminoMsg { type: "/tendermint.types.ValidatorSet"; @@ -21,24 +21,24 @@ export interface ValidatorSetAminoMsg { } export interface ValidatorSetSDKType { validators: ValidatorSDKType[]; - proposer: ValidatorSDKType; - total_voting_power: Long; + proposer?: ValidatorSDKType; + total_voting_power: bigint; } export interface Validator { address: Uint8Array; pubKey: PublicKey; - votingPower: Long; - proposerPriority: Long; + votingPower: bigint; + proposerPriority: bigint; } export interface ValidatorProtoMsg { typeUrl: "/tendermint.types.Validator"; value: Uint8Array; } export interface ValidatorAmino { - address: Uint8Array; + address?: string; pub_key?: PublicKeyAmino; - voting_power: string; - proposer_priority: string; + voting_power?: string; + proposer_priority?: string; } export interface ValidatorAminoMsg { type: "/tendermint.types.Validator"; @@ -47,12 +47,12 @@ export interface ValidatorAminoMsg { export interface ValidatorSDKType { address: Uint8Array; pub_key: PublicKeySDKType; - voting_power: Long; - proposer_priority: Long; + voting_power: bigint; + proposer_priority: bigint; } export interface SimpleValidator { - pubKey: PublicKey; - votingPower: Long; + pubKey?: PublicKey; + votingPower: bigint; } export interface SimpleValidatorProtoMsg { typeUrl: "/tendermint.types.SimpleValidator"; @@ -60,38 +60,39 @@ export interface SimpleValidatorProtoMsg { } export interface SimpleValidatorAmino { pub_key?: PublicKeyAmino; - voting_power: string; + voting_power?: string; } export interface SimpleValidatorAminoMsg { type: "/tendermint.types.SimpleValidator"; value: SimpleValidatorAmino; } export interface SimpleValidatorSDKType { - pub_key: PublicKeySDKType; - voting_power: Long; + pub_key?: PublicKeySDKType; + voting_power: bigint; } function createBaseValidatorSet(): ValidatorSet { return { validators: [], - proposer: Validator.fromPartial({}), - totalVotingPower: Long.ZERO + proposer: undefined, + totalVotingPower: BigInt(0) }; } export const ValidatorSet = { - encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.ValidatorSet", + encode(message: ValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.proposer !== undefined) { Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(24).int64(message.totalVotingPower); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSet(); while (reader.pos < end) { @@ -104,7 +105,7 @@ export const ValidatorSet = { message.proposer = Validator.decode(reader, reader.uint32()); break; case 3: - message.totalVotingPower = (reader.int64() as Long); + message.totalVotingPower = reader.int64(); break; default: reader.skipType(tag & 7); @@ -117,7 +118,7 @@ export const ValidatorSet = { return { validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], proposer: isSet(object.proposer) ? Validator.fromJSON(object.proposer) : undefined, - totalVotingPower: isSet(object.totalVotingPower) ? Long.fromValue(object.totalVotingPower) : Long.ZERO + totalVotingPower: isSet(object.totalVotingPower) ? BigInt(object.totalVotingPower.toString()) : BigInt(0) }; }, toJSON(message: ValidatorSet): unknown { @@ -128,32 +129,36 @@ export const ValidatorSet = { obj.validators = []; } message.proposer !== undefined && (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); - message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): ValidatorSet { const message = createBaseValidatorSet(); message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; message.proposer = object.proposer !== undefined && object.proposer !== null ? Validator.fromPartial(object.proposer) : undefined; - message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? Long.fromValue(object.totalVotingPower) : Long.ZERO; + message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorSetAmino): ValidatorSet { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - proposer: object?.proposer ? Validator.fromAmino(object.proposer) : undefined, - totalVotingPower: Long.fromString(object.total_voting_power) - }; + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromAmino(object.proposer); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; }, toAmino(message: ValidatorSet): ValidatorSetAmino { const obj: any = {}; if (message.validators) { obj.validators = message.validators.map(e => e ? Validator.toAmino(e) : undefined); } else { - obj.validators = []; + obj.validators = message.validators; } obj.proposer = message.proposer ? Validator.toAmino(message.proposer) : undefined; - obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; + obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorSetAminoMsg): ValidatorSet { @@ -176,28 +181,29 @@ function createBaseValidator(): Validator { return { address: new Uint8Array(), pubKey: PublicKey.fromPartial({}), - votingPower: Long.ZERO, - proposerPriority: Long.ZERO + votingPower: BigInt(0), + proposerPriority: BigInt(0) }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (!message.votingPower.isZero()) { + if (message.votingPower !== BigInt(0)) { writer.uint32(24).int64(message.votingPower); } - if (!message.proposerPriority.isZero()) { + if (message.proposerPriority !== BigInt(0)) { writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -210,10 +216,10 @@ export const Validator = { message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 3: - message.votingPower = (reader.int64() as Long); + message.votingPower = reader.int64(); break; case 4: - message.proposerPriority = (reader.int64() as Long); + message.proposerPriority = reader.int64(); break; default: reader.skipType(tag & 7); @@ -226,40 +232,48 @@ export const Validator = { return { address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, - votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO, - proposerPriority: isSet(object.proposerPriority) ? Long.fromValue(object.proposerPriority) : Long.ZERO + votingPower: isSet(object.votingPower) ? BigInt(object.votingPower.toString()) : BigInt(0), + proposerPriority: isSet(object.proposerPriority) ? BigInt(object.proposerPriority.toString()) : BigInt(0) }; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); - message.proposerPriority !== undefined && (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || BigInt(0)).toString()); + message.proposerPriority !== undefined && (obj.proposerPriority = (message.proposerPriority || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; - message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? Long.fromValue(object.votingPower) : Long.ZERO; - message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? Long.fromValue(object.proposerPriority) : Long.ZERO; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); + message.proposerPriority = object.proposerPriority !== undefined && object.proposerPriority !== null ? BigInt(object.proposerPriority.toString()) : BigInt(0); return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - address: object.address, - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - votingPower: Long.fromString(object.voting_power), - proposerPriority: Long.fromString(object.proposer_priority) - }; + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + if (object.proposer_priority !== undefined && object.proposer_priority !== null) { + message.proposerPriority = BigInt(object.proposer_priority); + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address ? base64FromBytes(message.address) : undefined; obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; - obj.voting_power = message.votingPower ? message.votingPower.toString() : undefined; - obj.proposer_priority = message.proposerPriority ? message.proposerPriority.toString() : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower.toString() : undefined; + obj.proposer_priority = message.proposerPriority !== BigInt(0) ? message.proposerPriority.toString() : undefined; return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { @@ -280,22 +294,23 @@ export const Validator = { }; function createBaseSimpleValidator(): SimpleValidator { return { - pubKey: PublicKey.fromPartial({}), - votingPower: Long.ZERO + pubKey: undefined, + votingPower: BigInt(0) }; } export const SimpleValidator = { - encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + typeUrl: "/tendermint.types.SimpleValidator", + encode(message: SimpleValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } - if (!message.votingPower.isZero()) { + if (message.votingPower !== BigInt(0)) { writer.uint32(16).int64(message.votingPower); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimpleValidator(); while (reader.pos < end) { @@ -305,7 +320,7 @@ export const SimpleValidator = { message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: - message.votingPower = (reader.int64() as Long); + message.votingPower = reader.int64(); break; default: reader.skipType(tag & 7); @@ -317,31 +332,35 @@ export const SimpleValidator = { fromJSON(object: any): SimpleValidator { return { pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, - votingPower: isSet(object.votingPower) ? Long.fromValue(object.votingPower) : Long.ZERO + votingPower: isSet(object.votingPower) ? BigInt(object.votingPower.toString()) : BigInt(0) }; }, toJSON(message: SimpleValidator): unknown { const obj: any = {}; message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): SimpleValidator { const message = createBaseSimpleValidator(); message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; - message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? Long.fromValue(object.votingPower) : Long.ZERO; + message.votingPower = object.votingPower !== undefined && object.votingPower !== null ? BigInt(object.votingPower.toString()) : BigInt(0); return message; }, fromAmino(object: SimpleValidatorAmino): SimpleValidator { - return { - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - votingPower: Long.fromString(object.voting_power) - }; + const message = createBaseSimpleValidator(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + return message; }, toAmino(message: SimpleValidator): SimpleValidatorAmino { const obj: any = {}; obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; - obj.voting_power = message.votingPower ? message.votingPower.toString() : undefined; + obj.voting_power = message.votingPower !== BigInt(0) ? message.votingPower.toString() : undefined; return obj; }, fromAminoMsg(object: SimpleValidatorAminoMsg): SimpleValidator { diff --git a/packages/api/src/codegen/tendermint/version/types.ts b/packages/api/src/codegen/tendermint/version/types.ts index 8b4df7f1..46480faa 100644 --- a/packages/api/src/codegen/tendermint/version/types.ts +++ b/packages/api/src/codegen/tendermint/version/types.ts @@ -1,12 +1,12 @@ -import { Long, isSet } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; /** * App includes the protocol and software version for the application. * This information is included in ResponseInfo. The App.Protocol can be * updated in ResponseEndBlock. */ export interface App { - protocol: Long; + protocol: bigint; software: string; } export interface AppProtoMsg { @@ -19,8 +19,8 @@ export interface AppProtoMsg { * updated in ResponseEndBlock. */ export interface AppAmino { - protocol: string; - software: string; + protocol?: string; + software?: string; } export interface AppAminoMsg { type: "/tendermint.version.App"; @@ -32,7 +32,7 @@ export interface AppAminoMsg { * updated in ResponseEndBlock. */ export interface AppSDKType { - protocol: Long; + protocol: bigint; software: string; } /** @@ -41,8 +41,8 @@ export interface AppSDKType { * state transition machine. */ export interface Consensus { - block: Long; - app: Long; + block: bigint; + app: bigint; } export interface ConsensusProtoMsg { typeUrl: "/tendermint.version.Consensus"; @@ -54,8 +54,8 @@ export interface ConsensusProtoMsg { * state transition machine. */ export interface ConsensusAmino { - block: string; - app: string; + block?: string; + app?: string; } export interface ConsensusAminoMsg { type: "/tendermint.version.Consensus"; @@ -67,18 +67,19 @@ export interface ConsensusAminoMsg { * state transition machine. */ export interface ConsensusSDKType { - block: Long; - app: Long; + block: bigint; + app: bigint; } function createBaseApp(): App { return { - protocol: Long.UZERO, + protocol: BigInt(0), software: "" }; } export const App = { - encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.protocol.isZero()) { + typeUrl: "/tendermint.version.App", + encode(message: App, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.protocol !== BigInt(0)) { writer.uint32(8).uint64(message.protocol); } if (message.software !== "") { @@ -86,15 +87,15 @@ export const App = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): App { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): App { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseApp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.protocol = (reader.uint64() as Long); + message.protocol = reader.uint64(); break; case 2: message.software = reader.string(); @@ -108,32 +109,36 @@ export const App = { }, fromJSON(object: any): App { return { - protocol: isSet(object.protocol) ? Long.fromValue(object.protocol) : Long.UZERO, + protocol: isSet(object.protocol) ? BigInt(object.protocol.toString()) : BigInt(0), software: isSet(object.software) ? String(object.software) : "" }; }, toJSON(message: App): unknown { const obj: any = {}; - message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString()); + message.protocol !== undefined && (obj.protocol = (message.protocol || BigInt(0)).toString()); message.software !== undefined && (obj.software = message.software); return obj; }, fromPartial(object: Partial): App { const message = createBaseApp(); - message.protocol = object.protocol !== undefined && object.protocol !== null ? Long.fromValue(object.protocol) : Long.UZERO; + message.protocol = object.protocol !== undefined && object.protocol !== null ? BigInt(object.protocol.toString()) : BigInt(0); message.software = object.software ?? ""; return message; }, fromAmino(object: AppAmino): App { - return { - protocol: Long.fromString(object.protocol), - software: object.software - }; + const message = createBaseApp(); + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = BigInt(object.protocol); + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } + return message; }, toAmino(message: App): AppAmino { const obj: any = {}; - obj.protocol = message.protocol ? message.protocol.toString() : undefined; - obj.software = message.software; + obj.protocol = message.protocol !== BigInt(0) ? message.protocol.toString() : undefined; + obj.software = message.software === "" ? undefined : message.software; return obj; }, fromAminoMsg(object: AppAminoMsg): App { @@ -154,32 +159,33 @@ export const App = { }; function createBaseConsensus(): Consensus { return { - block: Long.UZERO, - app: Long.UZERO + block: BigInt(0), + app: BigInt(0) }; } export const Consensus = { - encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.block.isZero()) { + typeUrl: "/tendermint.version.Consensus", + encode(message: Consensus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== BigInt(0)) { writer.uint32(8).uint64(message.block); } - if (!message.app.isZero()) { + if (message.app !== BigInt(0)) { writer.uint32(16).uint64(message.app); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Consensus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensus(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = (reader.uint64() as Long); + message.block = reader.uint64(); break; case 2: - message.app = (reader.uint64() as Long); + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -190,32 +196,36 @@ export const Consensus = { }, fromJSON(object: any): Consensus { return { - block: isSet(object.block) ? Long.fromValue(object.block) : Long.UZERO, - app: isSet(object.app) ? Long.fromValue(object.app) : Long.UZERO + block: isSet(object.block) ? BigInt(object.block.toString()) : BigInt(0), + app: isSet(object.app) ? BigInt(object.app.toString()) : BigInt(0) }; }, toJSON(message: Consensus): unknown { const obj: any = {}; - message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + message.block !== undefined && (obj.block = (message.block || BigInt(0)).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): Consensus { const message = createBaseConsensus(); - message.block = object.block !== undefined && object.block !== null ? Long.fromValue(object.block) : Long.UZERO; - message.app = object.app !== undefined && object.app !== null ? Long.fromValue(object.app) : Long.UZERO; + message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); return message; }, fromAmino(object: ConsensusAmino): Consensus { - return { - block: Long.fromString(object.block), - app: Long.fromString(object.app) - }; + const message = createBaseConsensus(); + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: Consensus): ConsensusAmino { const obj: any = {}; - obj.block = message.block ? message.block.toString() : undefined; - obj.app = message.app ? message.app.toString() : undefined; + obj.block = message.block !== BigInt(0) ? message.block.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; return obj; }, fromAminoMsg(object: ConsensusAminoMsg): Consensus { diff --git a/packages/api/src/codegen/utf8.ts b/packages/api/src/codegen/utf8.ts new file mode 100644 index 00000000..3e09013c --- /dev/null +++ b/packages/api/src/codegen/utf8.ts @@ -0,0 +1,148 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.5.2 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"use strict"; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function utf8Length(str: string) { + let len = 0, + c = 0; + for (let i = 0; i < str.length; ++i) { + c = str.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ( + (c & 0xfc00) === 0xd800 && + (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i; + len += 4; + } else len += 3; + } + return len; +} + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function utf8Read( + buffer: ArrayLike, + start: number, + end: number +) { + const len = end - start; + if (len < 1) return ""; + const chunk = []; + let parts: string[] = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63); + else if (t > 239 && t < 365) { + t = + (((t & 7) << 18) | + ((buffer[start++] & 63) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63)) - + 0x10000; + chunk[i++] = 0xd800 + (t >> 10); + chunk[i++] = 0xdc00 + (t & 1023); + } else + chunk[i++] = + ((t & 15) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63); + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode(...chunk)); + i = 0; + } + } + if (parts) { + if (i) parts.push(String.fromCharCode(...chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode(...chunk.slice(0, i)); +} + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function utf8Write( + str: string, + buffer: Uint8Array | Array, + offset: number +) { + const start = offset; + let c1, // character 1 + c2; // character 2 + for (let i = 0; i < str.length; ++i) { + c1 = str.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return offset - start; +} diff --git a/packages/api/src/codegen/varint.ts b/packages/api/src/codegen/varint.ts new file mode 100644 index 00000000..02a02185 --- /dev/null +++ b/packages/api/src/codegen/varint.ts @@ -0,0 +1,488 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.5.2 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + + +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */ + +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read(this: ReaderLike): [number, number] { + let lowBits = 0; + let highBits = 0; + + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + let middleByte = this.buf[this.pos++]; + + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + throw new Error("invalid varint"); +} + +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo: number, hi: number, bytes: number[]): void { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + + if (!hasMoreBits) { + return; + } + + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + bytes.push((hi >>> 31) & 0x01); +} + +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; + +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec: string): { lo: number; hi: number } { + // Check for minus sign. + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + + function add1e6digit(begin: number, end?: number) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} + +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo: number, hi: number): string { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} + +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo: number, hi: number): string { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return ( + digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA) + ); +} + +function toUnsigned(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} + +function newBits(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo | 0, hi: hi | 0 }; +} + +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits: number, highBits: number) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} + +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7: number) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}; + +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value: number, bytes: number[]): void { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} + +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read(this: ReaderLike): number { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + + if ((b & 0x80) != 0) throw new Error("invalid varint"); + + this.assertBounds(); + + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} + +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; + +/** + * encode zig zag + */ +export function zzEncode(lo: number, hi: number) { + let mask = hi >> 31; + hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0; + lo = ((lo << 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * decode zig zag + */ +export function zzDecode(lo: number, hi: number) { + let mask = -(lo & 1); + lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0; + hi = ((hi >>> 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * unsigned int32 without moving pos. + */ +export function readUInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + buf[pos + 3] * 0x1000000 + ); +} + +/** + * signed int32 without moving pos. + */ +export function readInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + (buf[pos + 3] << 24) + ); +} + +/** + * writing varint32 to pos + */ +export function writeVarint32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + while (val > 127) { + buf[pos++] = (val & 127) | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * writing varint64 to pos + */ +export function writeVarint64( + val: { lo: number; hi: number }, + buf: Uint8Array | number[], + pos: number +) { + while (val.hi) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +export function int64Length(lo: number, hi: number) { + let part0 = lo, + part1 = ((lo >>> 28) | (hi << 4)) >>> 0, + part2 = hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 + ? 1 + : 2 + : part0 < 2097152 + ? 3 + : 4 + : part1 < 16384 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 + : part2 < 128 + ? 9 + : 10; +} + +export function writeFixed32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; + buf[pos + 1] = (val >>> 8) & 255; + buf[pos + 2] = (val >>> 16) & 255; + buf[pos + 3] = val >>> 24; +} + +export function writeByte( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255; +} diff --git a/yarn.lock b/yarn.lock index 2aa4c3f0..73b010ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -66,12 +66,20 @@ dependencies: "@babel/highlight" "^7.22.5" +"@babel/code-frame@^7.23.5": + version "7.24.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" + integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== + dependencies: + "@babel/highlight" "^7.24.2" + picocolors "^1.0.0" + "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.5": version "7.21.7" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.7.tgz#61caffb60776e49a57ba61a88f02bedd8714f6bc" integrity sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA== -"@babel/compat-data@^7.21.4", "@babel/compat-data@^7.22.5": +"@babel/compat-data@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.5.tgz#b1f6c86a02d85d2dd3368a2b67c09add8cd0c255" integrity sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA== @@ -97,27 +105,6 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/core@7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz#c6dc73242507b8e2a27fd13a9c1814f9fa34a659" - integrity sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.4" - "@babel/helper-compilation-targets" "^7.21.4" - "@babel/helper-module-transforms" "^7.21.2" - "@babel/helpers" "^7.21.0" - "@babel/parser" "^7.21.4" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.4" - "@babel/types" "^7.21.4" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.2" - semver "^6.3.0" - "@babel/core@7.22.5", "@babel/core@^7.11.1", "@babel/core@^7.7.2", "@babel/core@^7.8.0": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.5.tgz#d67d9747ecf26ee7ecd3ebae1ee22225fe902a89" @@ -178,16 +165,6 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/generator@7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" - integrity sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA== - dependencies: - "@babel/types" "^7.21.4" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - "@babel/generator@^7.18.10", "@babel/generator@^7.21.5": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.5.tgz#c0c0e5449504c7b7de8236d99338c3e2a340745f" @@ -198,7 +175,7 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/generator@^7.21.4", "@babel/generator@^7.22.5", "@babel/generator@^7.7.2": +"@babel/generator@^7.22.5", "@babel/generator@^7.7.2": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.5.tgz#1e7bf768688acfb05cf30b2369ef855e82d984f7" integrity sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA== @@ -208,6 +185,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.23.6": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.1.tgz#e67e06f68568a4ebf194d1c6014235344f0476d0" + integrity sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A== + dependencies: + "@babel/types" "^7.24.0" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" @@ -247,7 +234,7 @@ lru-cache "^5.1.1" semver "^6.3.0" -"@babel/helper-compilation-targets@^7.21.4", "@babel/helper-compilation-targets@^7.22.5": +"@babel/helper-compilation-targets@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz#fc7319fc54c5e2fa14b2909cf3c5fd3046813e02" integrity sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw== @@ -335,6 +322,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz#c769afefd41d171836f7cb63e295bedf689d48ba" integrity sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + "@babel/helper-environment-visitor@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" @@ -356,6 +348,14 @@ "@babel/template" "^7.22.5" "@babel/types" "^7.22.5" +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" + "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" @@ -412,7 +412,7 @@ "@babel/traverse" "^7.21.5" "@babel/types" "^7.21.5" -"@babel/helper-module-transforms@^7.21.2", "@babel/helper-module-transforms@^7.22.5": +"@babel/helper-module-transforms@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz#0f65daa0716961b6e96b164034e737f60a80d2ef" integrity sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw== @@ -536,21 +536,38 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.21.5": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== -"@babel/helper-string-parser@^7.19.4", "@babel/helper-string-parser@^7.22.5": +"@babel/helper-string-parser@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== +"@babel/helper-string-parser@^7.23.4": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" + integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== + "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/helper-validator-identifier@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" @@ -595,7 +612,7 @@ "@babel/traverse" "^7.21.5" "@babel/types" "^7.21.5" -"@babel/helpers@^7.21.0", "@babel/helpers@^7.22.5": +"@babel/helpers@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.5.tgz#74bb4373eb390d1ceed74a15ef97767e63120820" integrity sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q== @@ -622,6 +639,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.24.2": + version "7.24.2" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.2.tgz#3f539503efc83d3c59080a10e6634306e0370d26" + integrity sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/node@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.22.5.tgz#5632c6f5f5d06ac68e34dd1cbe461ef4d5f8e49c" @@ -644,11 +671,16 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== -"@babel/parser@^7.21.4", "@babel/parser@^7.22.5": +"@babel/parser@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.5.tgz#721fd042f3ce1896238cf1b341c77eb7dee7dbea" integrity sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q== +"@babel/parser@^7.23.6", "@babel/parser@^7.24.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" + integrity sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" @@ -794,7 +826,7 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-transform-parameters" "^7.18.8" -"@babel/plugin-proposal-object-rest-spread@7.20.7", "@babel/plugin-proposal-object-rest-spread@^7.18.9", "@babel/plugin-proposal-object-rest-spread@^7.20.7": +"@babel/plugin-proposal-object-rest-spread@^7.18.9", "@babel/plugin-proposal-object-rest-spread@^7.20.7": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== @@ -1057,7 +1089,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.21.5" -"@babel/plugin-transform-arrow-functions@^7.20.7", "@babel/plugin-transform-arrow-functions@^7.22.5": +"@babel/plugin-transform-arrow-functions@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz#e5ba566d0c58a5b2ba2a8b795450641950b71958" integrity sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw== @@ -1175,7 +1207,7 @@ "@babel/helper-plugin-utils" "^7.21.5" "@babel/template" "^7.20.7" -"@babel/plugin-transform-computed-properties@^7.20.7", "@babel/plugin-transform-computed-properties@^7.22.5": +"@babel/plugin-transform-computed-properties@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz#cd1e994bf9f316bd1c2dafcd02063ec261bb3869" integrity sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg== @@ -1274,7 +1306,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.21.5" -"@babel/plugin-transform-for-of@^7.21.0", "@babel/plugin-transform-for-of@^7.22.5": +"@babel/plugin-transform-for-of@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz#ab1b8a200a8f990137aff9a084f8de4099ab173f" integrity sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A== @@ -1368,7 +1400,7 @@ "@babel/helper-plugin-utils" "^7.21.5" "@babel/helper-simple-access" "^7.21.5" -"@babel/plugin-transform-modules-commonjs@^7.21.2", "@babel/plugin-transform-modules-commonjs@^7.22.5": +"@babel/plugin-transform-modules-commonjs@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz#7d9875908d19b8c0536085af7b053fd5bd651bfa" integrity sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA== @@ -1630,7 +1662,7 @@ "@babel/helper-plugin-utils" "^7.21.5" regenerator-transform "^0.15.1" -"@babel/plugin-transform-regenerator@^7.20.5", "@babel/plugin-transform-regenerator@^7.22.5": +"@babel/plugin-transform-regenerator@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz#cd8a68b228a5f75fa01420e8cc2fc400f0fc32aa" integrity sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw== @@ -1664,7 +1696,7 @@ babel-plugin-polyfill-regenerator "^0.4.0" semver "^6.3.0" -"@babel/plugin-transform-runtime@7.21.4", "@babel/plugin-transform-runtime@^7.16.4": +"@babel/plugin-transform-runtime@^7.16.4": version "7.21.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.21.4.tgz#2e1da21ca597a7d01fc96b699b21d8d2023191aa" integrity sha512-1J4dhrw1h1PqnNNpzwxQ2UBymJUF8KuPjAAnlLwZcGhHAIqUigFW7cdK6GHoB64ubY4qXQNYknoUeks4Wz7CUA== @@ -1907,87 +1939,6 @@ core-js-compat "^3.22.1" semver "^6.3.0" -"@babel/preset-env@7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.21.4.tgz#a952482e634a8dd8271a3fe5459a16eb10739c58" - integrity sha512-2W57zHs2yDLm6GD5ZpvNn71lZ0B/iypSdIeq25OurDKji6AdzV07qp4s3n1/x5BqtiGaTrPN3nerlSCaC5qNTw== - dependencies: - "@babel/compat-data" "^7.21.4" - "@babel/helper-compilation-targets" "^7.21.4" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-option" "^7.21.0" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.20.7" - "@babel/plugin-proposal-async-generator-functions" "^7.20.7" - "@babel/plugin-proposal-class-properties" "^7.18.6" - "@babel/plugin-proposal-class-static-block" "^7.21.0" - "@babel/plugin-proposal-dynamic-import" "^7.18.6" - "@babel/plugin-proposal-export-namespace-from" "^7.18.9" - "@babel/plugin-proposal-json-strings" "^7.18.6" - "@babel/plugin-proposal-logical-assignment-operators" "^7.20.7" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" - "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.20.7" - "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.21.0" - "@babel/plugin-proposal-private-methods" "^7.18.6" - "@babel/plugin-proposal-private-property-in-object" "^7.21.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.20.0" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.20.7" - "@babel/plugin-transform-async-to-generator" "^7.20.7" - "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.21.0" - "@babel/plugin-transform-classes" "^7.21.0" - "@babel/plugin-transform-computed-properties" "^7.20.7" - "@babel/plugin-transform-destructuring" "^7.21.3" - "@babel/plugin-transform-dotall-regex" "^7.18.6" - "@babel/plugin-transform-duplicate-keys" "^7.18.9" - "@babel/plugin-transform-exponentiation-operator" "^7.18.6" - "@babel/plugin-transform-for-of" "^7.21.0" - "@babel/plugin-transform-function-name" "^7.18.9" - "@babel/plugin-transform-literals" "^7.18.9" - "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.20.11" - "@babel/plugin-transform-modules-commonjs" "^7.21.2" - "@babel/plugin-transform-modules-systemjs" "^7.20.11" - "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.20.5" - "@babel/plugin-transform-new-target" "^7.18.6" - "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.21.3" - "@babel/plugin-transform-property-literals" "^7.18.6" - "@babel/plugin-transform-regenerator" "^7.20.5" - "@babel/plugin-transform-reserved-words" "^7.18.6" - "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.20.7" - "@babel/plugin-transform-sticky-regex" "^7.18.6" - "@babel/plugin-transform-template-literals" "^7.18.9" - "@babel/plugin-transform-typeof-symbol" "^7.18.9" - "@babel/plugin-transform-unicode-escapes" "^7.18.10" - "@babel/plugin-transform-unicode-regex" "^7.18.6" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.21.4" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" - core-js-compat "^3.25.1" - semver "^6.3.0" - "@babel/preset-env@^7.11.0", "@babel/preset-env@^7.12.1", "@babel/preset-env@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.22.5.tgz#3da66078b181f3d62512c51cf7014392c511504e" @@ -2202,7 +2153,7 @@ "@babel/plugin-transform-modules-commonjs" "^7.21.5" "@babel/plugin-transform-typescript" "^7.21.3" -"@babel/preset-typescript@^7.21.4", "@babel/preset-typescript@^7.22.5": +"@babel/preset-typescript@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz#16367d8b01d640e9a507577ed4ee54e0101e51c8" integrity sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ== @@ -2229,7 +2180,7 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.20.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200" integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q== @@ -2252,6 +2203,15 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" +"@babel/template@^7.22.15": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50" + integrity sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/parser" "^7.24.0" + "@babel/types" "^7.24.0" + "@babel/template@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" @@ -2277,20 +2237,20 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" - integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== +"@babel/traverse@7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" + integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== dependencies: - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.4" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.4" - "@babel/types" "^7.21.4" - debug "^4.1.0" + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.6" + "@babel/types" "^7.23.6" + debug "^4.3.1" globals "^11.1.0" "@babel/traverse@^7.18.10", "@babel/traverse@^7.20.5", "@babel/traverse@^7.21.5": @@ -2309,7 +2269,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.21.4", "@babel/traverse@^7.22.5", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.22.5", "@babel/traverse@^7.7.2": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.5.tgz#44bd276690db6f4940fdb84e1cb4abd2f729ccd1" integrity sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ== @@ -2334,13 +2294,13 @@ "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" -"@babel/types@7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.4.tgz#2d5d6bb7908699b3b416409ffd3b5daa25b030d4" - integrity sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA== +"@babel/types@7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" + integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.4", "@babel/types@^7.21.5", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": @@ -2361,6 +2321,15 @@ "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" +"@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.0.tgz#3b951f435a92e7333eba05b7566fd297960ea1bf" + integrity sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -2490,6 +2459,38 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.0.tgz#3a7ac16856dcff63bbf1bb11e31f975f71ef4f21" integrity sha512-nNcycZWUYLNJlrIXgpcgVRqdl6BXjF4YlXdxobQWpW9Tikk61bEGeAFhDYtC0PwHlokCNw0KxWiHGJL4nL7Q5A== +"@cosmology/ast@^1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.5.2.tgz#d1a22f8390ca1d38354ed75136aa6127db042f99" + integrity sha512-OC7cvaBWalCfYlbPz1uqyf4XPsdTDrKXiPL+KUT+WaNLORNxJDy7a3zJO48Hb0cJy3ixTGgrwbvhTrZFX4x6zA== + dependencies: + "@babel/parser" "^7.23.6" + "@babel/types" "7.23.6" + "@cosmology/types" "^1.5.1" + "@cosmology/utils" "^1.5.1" + case "1.6.3" + dotty "0.1.2" + +"@cosmology/lcd@^0.13.3": + version "0.13.3" + resolved "https://registry.yarnpkg.com/@cosmology/lcd/-/lcd-0.13.3.tgz#4072178cfe979b948ab596c9378b56c4f320d192" + integrity sha512-lihAHCoap0GN/32qcOhiMp6HcoZP8A7GeScZMlmmvBtBk6ocGAStNHjvBR4MayrvyHSCOZCvCAWPh36iFTT8Sw== + dependencies: + axios "1.6.0" + +"@cosmology/proto-parser@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.5.1.tgz#60b46f6cb644ef77ea16918758454331922797ec" + integrity sha512-hrkDEGKI7yomeR4WWAsnBcQRgR59tHFbg7IbYbchcd+ZiCV9CZI4ZQKTPF+tiTfjpuErTLBFpRrgk6URYSxjbw== + dependencies: + "@cosmology/protobufjs" "6.11.6" + "@cosmology/types" "^1.5.1" + "@cosmology/utils" "^1.5.1" + dotty "0.1.2" + glob "8.0.3" + minimatch "5.1.0" + mkdirp "3.0.0" + "@cosmology/protobufjs@6.11.6": version "6.11.6" resolved "https://registry.yarnpkg.com/@cosmology/protobufjs/-/protobufjs-6.11.6.tgz#6f7bd340ab4a27969b1f75b4bff21a74e03b971a" @@ -2509,10 +2510,54 @@ "@types/node" ">=13.7.0" long "^4.0.0" -"@cosmwasm/ts-codegen@0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.30.1.tgz#8b8a635273065261c608a76f8a50cb5045e23980" - integrity sha512-6ATbmtuK2MwG9fJxIi0M+Rwd0SQhsko2nA8qVXC9MRHpZJKNaXYYcof1fel/L5HJCjotmQVsoxons3rGg6dRnw== +"@cosmology/telescope@^1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.5.2.tgz#6e778f2c3f13db60ab79d9443ec9278325b9a89d" + integrity sha512-QeXwsgiuUnaLx0QVZO4gMT8B31gFKITgy4GP1OBFP/gmxQopnCuu11Sl0HggW2CbygbB5+ZkyooQ3ZF6gl4qRQ== + dependencies: + "@babel/generator" "^7.23.6" + "@babel/parser" "^7.23.6" + "@babel/traverse" "7.23.6" + "@babel/types" "7.23.6" + "@cosmology/ast" "^1.5.2" + "@cosmology/proto-parser" "^1.5.1" + "@cosmology/types" "^1.5.1" + "@cosmology/utils" "^1.5.1" + "@cosmwasm/ts-codegen" "0.34.0" + "@types/parse-package-name" "0.1.0" + case "1.6.3" + dargs "7.0.0" + deepmerge "4.3.1" + dotty "0.1.2" + fuzzy "0.1.3" + glob "8.0.3" + inquirerer "0.1.3" + long "^5.2.1" + minimatch "5.1.0" + minimist "1.2.8" + mkdirp "3.0.0" + parse-package-name "1.0.0" + rimraf "5.0.0" + +"@cosmology/types@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.5.1.tgz#4d54c9e6f9d10abdc61c72eee2f65170eabc6943" + integrity sha512-Y/8uz6SAjnvEl4Bj+pCH1Pk5SOryOE73Uqbns6rIMIgsPVGKUBpK8Jypvql6ziCLWjQNK/nCrvytj7IgTzufxw== + dependencies: + case "1.6.3" + +"@cosmology/utils@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.5.1.tgz#193bc490273d04384199c95d30b4bd5bcff279e4" + integrity sha512-wyFyDJsRk1/X51TQTKhhFcAdhMsiq8cFGpHcIdK3R1QN1x+4wJH3n8EKpJ6Z6xpCEiMuG9UK3+NOhZL/z8L/2Q== + dependencies: + "@cosmology/types" "^1.5.1" + dotty "0.1.2" + +"@cosmwasm/ts-codegen@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.34.0.tgz#659bb69fc5f74cbd623567f3090e69072f08b23c" + integrity sha512-Mt/aYj0be9GnA51Arysqr9L8KQNWUJJHoJvtru7hkHmukPSewZDilwHCOJAaehk5gjsP7LFey2o2KEdfzkANhA== dependencies: "@babel/core" "7.18.10" "@babel/generator" "7.18.12" @@ -2540,7 +2585,7 @@ parse-package-name "1.0.0" rimraf "3.0.2" shelljs "0.8.5" - wasm-ast-types "^0.23.1" + wasm-ast-types "^0.25.0" "@csstools/normalize.css@*": version "12.0.0" @@ -3107,16 +3152,35 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + "@jridgewell/source-map@^0.3.3": version "0.3.4" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.4.tgz#856a142864530d4059dda415659b48d37db2d556" @@ -3127,7 +3191,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== @@ -3140,6 +3204,14 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" @@ -4005,95 +4077,6 @@ dependencies: "@octokit/openapi-types" "^12.11.0" -"@osmonauts/ast@^0.85.0": - version "0.85.0" - resolved "https://registry.yarnpkg.com/@osmonauts/ast/-/ast-0.85.0.tgz#3ce5ff4e3b537b957f4c955f1860a5c7732ea713" - integrity sha512-7naxjxXFBf2u5NbtD25kdbE4dLZJZmXwRoe8khT+fLkjBjSOlA7Z1C42Z3bXpsXhi0FIbCIzB73q6Z7wV8JevQ== - dependencies: - "@babel/parser" "^7.21.4" - "@babel/runtime" "^7.21.0" - "@babel/types" "7.21.4" - "@osmonauts/proto-parser" "^0.44.0" - "@osmonauts/types" "^0.35.0" - "@osmonauts/utils" "^0.11.1" - case "1.6.3" - dotty "0.1.2" - -"@osmonauts/lcd@^0.11.1": - version "0.11.1" - resolved "https://registry.yarnpkg.com/@osmonauts/lcd/-/lcd-0.11.1.tgz#30e0d23960ec4a1d4513ecf881e3705de3306d54" - integrity sha512-mri4GnyLfLnT7VLXk6Z53IOd3a7VCQTuMSYGAK042IRgEZXLzjUYDOOTbCTsuJgncAAf51yDBNPOLqw/26jjsg== - dependencies: - "@babel/runtime" "^7.21.0" - axios "0.27.2" - -"@osmonauts/proto-parser@^0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@osmonauts/proto-parser/-/proto-parser-0.44.0.tgz#9ae04a00992d4396db46af652aab86dc7e478c60" - integrity sha512-sJF6E5fn0AYFq98xE0b19PTQD8kc5bzb2Ilq9AniPnY8o3Q0a7p+A4EuPmBXXm3nBslLJCawUDWRlIEZcmKG3Q== - dependencies: - "@babel/runtime" "^7.21.0" - "@cosmology/protobufjs" "6.11.6" - "@osmonauts/types" "^0.35.0" - dotty "0.1.2" - glob "8.0.3" - minimatch "5.1.0" - mkdirp "3.0.0" - -"@osmonauts/telescope@^0.99.0": - version "0.99.0" - resolved "https://registry.yarnpkg.com/@osmonauts/telescope/-/telescope-0.99.0.tgz#0f35c21e8bc65951a63231f34b4caa8a106a6f20" - integrity sha512-djb/Ud+B1CPFbJAQiuxfUdeeZxC1xam5o4kKf8RSnyPx033JuTmz+QSTt25zotvFuZLtL/TI0giOp+Bgc92uZQ== - dependencies: - "@babel/core" "7.21.4" - "@babel/generator" "7.21.4" - "@babel/parser" "^7.21.4" - "@babel/plugin-proposal-class-properties" "7.18.6" - "@babel/plugin-proposal-export-default-from" "7.18.10" - "@babel/plugin-proposal-object-rest-spread" "7.20.7" - "@babel/plugin-transform-runtime" "7.21.4" - "@babel/preset-env" "7.21.4" - "@babel/preset-typescript" "^7.21.4" - "@babel/runtime" "^7.21.0" - "@babel/traverse" "7.21.4" - "@babel/types" "7.21.4" - "@cosmwasm/ts-codegen" "0.30.1" - "@osmonauts/ast" "^0.85.0" - "@osmonauts/proto-parser" "^0.44.0" - "@osmonauts/types" "^0.35.0" - "@osmonauts/utils" "^0.11.1" - "@types/parse-package-name" "0.1.0" - case "1.6.3" - dargs "7.0.0" - deepmerge "4.3.1" - dotty "0.1.2" - fuzzy "0.1.3" - glob "8.0.3" - inquirerer "0.1.3" - long "^5.2.1" - minimatch "5.1.0" - minimist "1.2.8" - mkdirp "3.0.0" - parse-package-name "1.0.0" - rimraf "5.0.0" - shelljs "0.8.5" - -"@osmonauts/types@^0.35.0": - version "0.35.0" - resolved "https://registry.yarnpkg.com/@osmonauts/types/-/types-0.35.0.tgz#1a1d2b1588e017fb9c04227d01a97be9c3b416ce" - integrity sha512-RHjc/hGpZ9Q0okWiRMO98V8NduFAB4YQIb0BwP9jQJC39R6uSBtYUGKuk6CxnMyitmA6JeMV0EslOoh/OX0Dyg== - dependencies: - "@babel/runtime" "^7.21.0" - "@osmonauts/utils" "^0.11.1" - case "1.6.3" - -"@osmonauts/utils@^0.11.1": - version "0.11.1" - resolved "https://registry.yarnpkg.com/@osmonauts/utils/-/utils-0.11.1.tgz#26f08c842770cc2d79271fd65ac8e576db72d114" - integrity sha512-N2tVi+nnFy7vI+wEPLOryhKgbakBYkpo8TD37NcCs99+VliwXQGz+3L6BCtWGhDI32Ongu37PVks5tqRCgb+kQ== - dependencies: - "@babel/runtime" "^7.21.0" - "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -5681,13 +5664,14 @@ axe-core@^4.6.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.0.tgz#34ba5a48a8b564f67e103f0aa5768d76e15bbbbf" integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ== -axios@0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== +axios@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" + integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== dependencies: - follow-redirects "^1.14.9" + follow-redirects "^1.15.0" form-data "^4.0.0" + proxy-from-env "^1.1.0" axios@^0.21.2: version "0.21.4" @@ -8790,11 +8774,16 @@ flush-write-stream@^1.0.0: inherits "^2.0.3" readable-stream "^2.3.6" -follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.9: +follow-redirects@^1.0.0, follow-redirects@^1.14.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.15.0: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -13609,6 +13598,11 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + psl@^1.1.28, psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" @@ -16156,10 +16150,10 @@ walker@^1.0.7, walker@^1.0.8: dependencies: makeerror "1.0.12" -wasm-ast-types@^0.23.1: - version "0.23.1" - resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.23.1.tgz#b849629aa9f7a56dbb52c581ddbcb6b5ed7e2a07" - integrity sha512-igLcEk8VHZq62ZEwn4Jp+WRTp2D9yvTeiQd2Pc+s7LZouzSn3CwRpD42sHK2wV0UlSt2/cNbV6QywFm9Z6eM/A== +wasm-ast-types@^0.25.0: + version "0.25.0" + resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.25.0.tgz#9f4056803c99fae6899c1f226e46cf730d9fe2db" + integrity sha512-ZTjXuBqRf3ntxXmskO1TyTTr8UbmAZGr72JGGctizzpdokMtuLsk5q8jHaFUv/qgQni1KuBxZnHIyaj1lnZegQ== dependencies: "@babel/runtime" "^7.18.9" "@babel/types" "7.18.10"