diff --git a/packages/cosmic-proto/MAINTAINERS.md b/packages/cosmic-proto/MAINTAINERS.md index 1b5b1825d04..cd189fe54fd 100644 --- a/packages/cosmic-proto/MAINTAINERS.md +++ b/packages/cosmic-proto/MAINTAINERS.md @@ -8,7 +8,9 @@ The generated code is determined by the contents of `protos` and the config of ` ## Maintaining protos -The `protos` are held in this source tree and updated from `golang/cosmos/proto` during `yarn codegen` by `yarn protos-update`. The `cosmos` protos were sourced from [@protobufjs/cosmos](https://www.npmjs.com/package/@protobufs/cosmos) per [Telescope's instructions](https://github.com/cosmology-tech/telescope?tab=readme-ov-file#add-protobufs). However we don't use that as a dependency of the package because we need a more manual approach to merge with the Golang-managed protos in the repo. +The `protos` are held in this source tree. + +To update existing definitions, simply run `yarn codegen`. To add new protobuf definitions: diff --git a/packages/cosmic-proto/package.json b/packages/cosmic-proto/package.json index 7b07751c559..26f90f21d2c 100644 --- a/packages/cosmic-proto/package.json +++ b/packages/cosmic-proto/package.json @@ -78,9 +78,8 @@ "scripts": { "build": "tsc --project tsconfig.build.json", "clean": "rimraf dist", - "codegen": "yarn protos-update && node scripts/codegen.cjs", + "codegen": "./update-protos.sh && node scripts/codegen.cjs", "prepare": "npm run build", - "protos-update": "cp -rf ../../golang/cosmos/third_party/proto . && cp -rf ../../golang/cosmos/proto/agoric proto", "lint-fix": "yarn lint:eslint --fix", "lint": "tsc", "test": "ava", diff --git a/packages/cosmic-proto/proto/cosmos/app/v1alpha1/config.proto b/packages/cosmic-proto/proto/cosmos/app/v1alpha1/config.proto deleted file mode 100644 index ed77500611a..00000000000 --- a/packages/cosmic-proto/proto/cosmos/app/v1alpha1/config.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.v1alpha1; - -import "google/protobuf/any.proto"; - -// Config represents the configuration for a Cosmos SDK ABCI app. -// It is intended that all state machine logic including the version of -// baseapp and tx handlers (and possibly even Tendermint) that an app needs -// can be described in a config object. For compatibility, the framework should -// allow a mixture of declarative and imperative app wiring, however, apps -// that strive for the maximum ease of maintainability should be able to describe -// their state machine with a config object alone. -message Config { - // modules are the module configurations for the app. - repeated ModuleConfig modules = 1; -} - -// ModuleConfig is a module configuration for an app. -message ModuleConfig { - // name is the unique name of the module within the app. It should be a name - // that persists between different versions of a module so that modules - // can be smoothly upgraded to new versions. - // - // For example, for the module cosmos.bank.module.v1.Module, we may chose - // to simply name the module "bank" in the app. When we upgrade to - // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same - // and the framework knows that the v2 module should receive all the same state - // that the v1 module had. Note: modules should provide info on which versions - // they can migrate from in the ModuleDescriptor.can_migration_from field. - string name = 1; - - // config is the config object for the module. Module config messages should - // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. - google.protobuf.Any config = 2; -} diff --git a/packages/cosmic-proto/proto/cosmos/app/v1alpha1/module.proto b/packages/cosmic-proto/proto/cosmos/app/v1alpha1/module.proto deleted file mode 100644 index 599078d7ee0..00000000000 --- a/packages/cosmic-proto/proto/cosmos/app/v1alpha1/module.proto +++ /dev/null @@ -1,93 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.v1alpha1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - // module indicates that this proto type is a config object for an app module - // and optionally provides other descriptive information about the module. - // It is recommended that a new module config object and go module is versioned - // for every state machine breaking version of a module. The recommended - // pattern for doing this is to put module config objects in a separate proto - // package from the API they expose. Ex: the cosmos.group.v1 API would be - // exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc. - ModuleDescriptor module = 57193479; -} - -// ModuleDescriptor describes an app module. -message ModuleDescriptor { - // go_import names the package that should be imported by an app to load the - // module in the runtime module registry. Either go_import must be defined here - // or the go_package option must be defined at the file level to indicate - // to users where to location the module implementation. go_import takes - // precedence over go_package when both are defined. - string go_import = 1; - - // 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. - repeated PackageReference use_package = 2; - - // can_migrate_from defines which module versions this module can migrate - // state from. The framework will check that one module version is able to - // migrate from a previous module version before attempting to update its - // config. It is assumed that modules can transitively migrate from earlier - // versions. For instance if v3 declares it can migrate from v2, and v2 - // 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. - repeated MigrateFromInfo can_migrate_from = 3; -} - -// PackageReference is a reference to a protobuf package used by a module. -message PackageReference { - // name is the fully-qualified name of the package. - string name = 1; - - // revision is the optional revision of the package that is being used. - // Protobuf packages used in Cosmos should generally have a major version - // as the last part of the package name, ex. foo.bar.baz.v1. - // The revision of a package can be thought of as the minor version of a - // package which has additional backwards compatible definitions that weren't - // present in a previous version. - // - // A package should indicate its revision with a source code comment - // above the package declaration in one of its fields containing the - // test "Revision N" where N is an integer revision. All packages start - // at revision 0 the first time they are released in a module. - // - // When a new version of a module is released and items are added to existing - // .proto files, these definitions should contain comments of the form - // "Since Revision N" where N is an integer revision. - // - // When the module runtime starts up, it will check the pinned proto - // image and panic if there are runtime protobuf definitions that are not - // in the pinned descriptor which do not have - // a "Since Revision N" comment or have a "Since Revision N" comment where - // N is <= to the revision specified here. This indicates that the protobuf - // files have been updated, but the pinned file descriptor hasn't. - // - // If there are items in the pinned file descriptor with a revision - // greater than the value indicated here, this will also cause a panic - // as it may mean that the pinned descriptor for a legacy module has been - // improperly updated or that there is some other versioning discrepancy. - // Runtime protobuf definitions will also be checked for compatibility - // with pinned file descriptors to make sure there are no incompatible changes. - // - // This behavior ensures that: - // * pinned proto images are up-to-date - // * protobuf files are carefully annotated with revision comments which - // are important good client UX - // * protobuf files are changed in backwards and forwards compatible ways - uint32 revision = 2; -} - -// MigrateFromInfo is information on a module version that a newer module -// can migrate from. -message MigrateFromInfo { - - // module is the fully-qualified protobuf name of the module config object - // for the previous module version, ex: "cosmos.group.module.v1.Module". - string module = 1; -} diff --git a/packages/cosmic-proto/proto/cosmos/app/v1alpha1/query.proto b/packages/cosmic-proto/proto/cosmos/app/v1alpha1/query.proto deleted file mode 100644 index efec9c81ad7..00000000000 --- a/packages/cosmic-proto/proto/cosmos/app/v1alpha1/query.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; - -package cosmos.app.v1alpha1; - -import "cosmos/app/v1alpha1/config.proto"; - -// Query is the app module query service. -service Query { - - // Config returns the current app config. - rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} -} - -// QueryConfigRequest is the Query/Config request type. -message QueryConfigRequest {} - -// QueryConfigRequest is the Query/Config response type. -message QueryConfigResponse { - - // config is the current app config. - Config config = 1; -} diff --git a/packages/cosmic-proto/proto/cosmos/auth/v1beta1/auth.proto b/packages/cosmic-proto/proto/cosmos/auth/v1beta1/auth.proto index 486d507f648..963c6f15198 100644 --- a/packages/cosmic-proto/proto/cosmos/auth/v1beta1/auth.proto +++ b/packages/cosmic-proto/proto/cosmos/auth/v1beta1/auth.proto @@ -15,7 +15,7 @@ message BaseAccount { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = false; - option (cosmos_proto.implements_interface) = "cosmos.auth.AccountI"; + option (cosmos_proto.implements_interface) = "AccountI"; string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"]; @@ -27,7 +27,7 @@ message BaseAccount { message ModuleAccount { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "cosmos.auth.ModuleAccountI"; + option (cosmos_proto.implements_interface) = "ModuleAccountI"; BaseAccount base_account = 1 [(gogoproto.embed) = true]; string name = 2; diff --git a/packages/cosmic-proto/proto/cosmos/auth/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/auth/v1beta1/query.proto index 8de4d09dc20..1775f12865a 100644 --- a/packages/cosmic-proto/proto/cosmos/auth/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/auth/v1beta1/query.proto @@ -24,27 +24,47 @@ service Query { option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; } + // AccountAddressByID returns account address based on account number. + // + // Since: cosmos-sdk 0.46.2 + rpc AccountAddressByID(QueryAccountAddressByIDRequest) returns (QueryAccountAddressByIDResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; + } + // Params queries all parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/params"; } // ModuleAccounts returns all the existing module accounts. + // + // Since: cosmos-sdk 0.46 rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; } - // Bech32 queries bech32Prefix + // ModuleAccountByName returns the module account info by module name + rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; + } + + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/bech32"; } // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}"; } // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) { option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}"; } @@ -63,7 +83,7 @@ message QueryAccountsRequest { // Since: cosmos-sdk 0.43 message QueryAccountsResponse { // accounts are the existing accounts - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.AccountI"]; + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -78,53 +98,96 @@ message QueryAccountRequest { string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } -// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. -message QueryModuleAccountsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - // QueryAccountResponse is the response type for the Query/Account RPC method. message QueryAccountResponse { // account defines the account of the corresponding address. - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.AccountI"]; + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; } // QueryParamsRequest is the request type for the Query/Params RPC method. message QueryParamsRequest {} +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryModuleAccountsRequest {} + // QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 message QueryModuleAccountsResponse { - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.ModuleAccountI"]; + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"]; } -// Bech32PrefixRequest is the request type for Bech32Prefix rpc method +// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. +message QueryModuleAccountByNameRequest { + string name = 1; +} + +// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +message QueryModuleAccountByNameResponse { + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"]; +} + +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 message Bech32PrefixRequest {} -// Bech32PrefixResponse is the response type for Bech32Prefix rpc method +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 message Bech32PrefixResponse { string bech32_prefix = 1; } -// AddressBytesToStringRequest is the request type for AddressString rpc method +// AddressBytesToStringRequest is the request type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 message AddressBytesToStringRequest { bytes address_bytes = 1; } -// AddressBytesToStringResponse is the response type for AddressString rpc method +// AddressBytesToStringResponse is the response type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 message AddressBytesToStringResponse { string address_string = 1; } -// AddressStringToBytesRequest is the request type for AccountBytes rpc method +// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +// +// Since: cosmos-sdk 0.46 message AddressStringToBytesRequest { string address_string = 1; } -// AddressStringToBytesResponse is the response type for AddressBytes rpc method +// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +// +// Since: cosmos-sdk 0.46 message AddressStringToBytesResponse { bytes address_bytes = 1; } + +// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDRequest { + // id is the account number of the address to be queried. This field + // should have been an uint64 (like all account numbers), and will be + // updated to uint64 in a future version of the auth query. + int64 id = 1; +} + +// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDResponse { + string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/packages/cosmic-proto/proto/cosmos/authz/v1beta1/authz.proto b/packages/cosmic-proto/proto/cosmos/authz/v1beta1/authz.proto index 2dce1ce0d73..06ce288ab01 100644 --- a/packages/cosmic-proto/proto/cosmos/authz/v1beta1/authz.proto +++ b/packages/cosmic-proto/proto/cosmos/authz/v1beta1/authz.proto @@ -13,7 +13,7 @@ option (gogoproto.goproto_getters_all) = false; // GenericAuthorization gives the grantee unrestricted permissions to execute // the provided method on behalf of the granter's account. message GenericAuthorization { - option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + option (cosmos_proto.implements_interface) = "Authorization"; // Msg, identified by it's type URL, to grant unrestricted permissions to execute string msg = 1; @@ -22,7 +22,7 @@ message GenericAuthorization { // Grant gives permissions to execute // the provide method with expiration time. message Grant { - google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "cosmos.authz.Authorization"]; + google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"]; // 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` // may apply to invalidate the grant) @@ -35,7 +35,7 @@ message GrantAuthorization { string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "cosmos.authz.Authorization"]; + google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"]; google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true]; } diff --git a/packages/cosmic-proto/proto/cosmos/authz/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/authz/v1beta1/tx.proto index 9c8ae160bce..068218fff8c 100644 --- a/packages/cosmic-proto/proto/cosmos/authz/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/authz/v1beta1/tx.proto @@ -55,7 +55,7 @@ message MsgExec { // 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. - repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, cosmos.authz.Authorization"]; + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"]; } // MsgGrantResponse defines the Msg/MsgGrant response type. diff --git a/packages/cosmic-proto/proto/cosmos/bank/v1beta1/authz.proto b/packages/cosmic-proto/proto/cosmos/bank/v1beta1/authz.proto index e3e600b4e30..4f58b15e497 100644 --- a/packages/cosmic-proto/proto/cosmos/bank/v1beta1/authz.proto +++ b/packages/cosmic-proto/proto/cosmos/bank/v1beta1/authz.proto @@ -12,7 +12,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // // Since: cosmos-sdk 0.43 message SendAuthorization { - option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + option (cosmos_proto.implements_interface) = "Authorization"; repeated cosmos.base.v1beta1.Coin spend_limit = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; diff --git a/packages/cosmic-proto/proto/cosmos/bank/v1beta1/bank.proto b/packages/cosmic-proto/proto/cosmos/bank/v1beta1/bank.proto index f70c24ab398..7bc9819d2aa 100644 --- a/packages/cosmic-proto/proto/cosmos/bank/v1beta1/bank.proto +++ b/packages/cosmic-proto/proto/cosmos/bank/v1beta1/bank.proto @@ -55,7 +55,7 @@ message Supply { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "SupplyI"; + option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/migrations/v040.SupplyI"; repeated cosmos.base.v1beta1.Coin total = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; diff --git a/packages/cosmic-proto/proto/cosmos/bank/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/bank/v1beta1/query.proto index cbe7f38adcf..635471c4b9d 100644 --- a/packages/cosmic-proto/proto/cosmos/bank/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/bank/v1beta1/query.proto @@ -24,6 +24,8 @@ service Query { // SpendableBalances queries the spenable balance of all coins for a single // account. + // + // Since: cosmos-sdk 0.46 rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; } @@ -56,6 +58,8 @@ service Query { // DenomOwners queries for all account addresses that own a particular token // denomination. + // + // Since: cosmos-sdk 0.46 rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; } @@ -104,6 +108,8 @@ message QueryAllBalancesResponse { // QuerySpendableBalancesRequest defines the gRPC request structure for querying // an account's spendable balances. +// +// Since: cosmos-sdk 0.46 message QuerySpendableBalancesRequest { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -117,6 +123,8 @@ message QuerySpendableBalancesRequest { // QuerySpendableBalancesResponse defines the gRPC response structure for querying // an account's spendable balances. +// +// Since: cosmos-sdk 0.46 message QuerySpendableBalancesResponse { // balances is the spendable balances of all the coins. repeated cosmos.base.v1beta1.Coin balances = 1 @@ -214,6 +222,8 @@ message QueryDenomOwnersRequest { // DenomOwner defines structure representing an account that owns or holds a // particular denominated token. It contains the account address and account // balance of the denominated token. +// +// Since: cosmos-sdk 0.46 message DenomOwner { // address defines the address that owns a particular denomination. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -223,6 +233,8 @@ message DenomOwner { } // QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +// +// Since: cosmos-sdk 0.46 message QueryDenomOwnersResponse { repeated DenomOwner denom_owners = 1; diff --git a/packages/cosmic-proto/proto/cosmos/base/abci/v1beta1/abci.proto b/packages/cosmic-proto/proto/cosmos/base/abci/v1beta1/abci.proto index 09a2fcc4789..ddaa6356177 100644 --- a/packages/cosmic-proto/proto/cosmos/base/abci/v1beta1/abci.proto +++ b/packages/cosmic-proto/proto/cosmos/base/abci/v1beta1/abci.proto @@ -41,7 +41,7 @@ message TxResponse { string timestamp = 12; // Events defines all the events emitted by processing a transaction. Note, // these events include those emitted by processing all the messages and those - // emitted from the ante handler. Whereas Logs contains the events, with + // emitted from the ante. Whereas Logs contains the events, with // additional metadata, emitted only by processing the messages. // // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 diff --git a/packages/cosmic-proto/proto/cosmos/base/node/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/base/node/v1beta1/query.proto new file mode 100644 index 00000000000..8070f7b904f --- /dev/null +++ b/packages/cosmic-proto/proto/cosmos/base/node/v1beta1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.base.node.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/node"; + +// Service defines the gRPC querier service for node related queries. +service Service { + // Config queries for the operator configuration. + rpc Config(ConfigRequest) returns (ConfigResponse) { + option (google.api.http).get = "/cosmos/base/node/v1beta1/config"; + } +} + +// ConfigRequest defines the request structure for the Config gRPC query. +message ConfigRequest {} + +// ConfigResponse defines the response structure for the Config gRPC query. +message ConfigResponse { + string minimum_gas_price = 1; +} diff --git a/packages/cosmic-proto/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/packages/cosmic-proto/proto/cosmos/base/snapshots/v1beta1/snapshot.proto index a89e0b4c361..5dba369fd44 100644 --- a/packages/cosmic-proto/proto/cosmos/base/snapshots/v1beta1/snapshot.proto +++ b/packages/cosmic-proto/proto/cosmos/base/snapshots/v1beta1/snapshot.proto @@ -7,10 +7,10 @@ option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types"; // Snapshot contains Tendermint state sync snapshot info. message Snapshot { - uint64 height = 1; - uint32 format = 2; - uint32 chunks = 3; - bytes hash = 4; + uint64 height = 1; + uint32 format = 2; + uint32 chunks = 3; + bytes hash = 4; Metadata metadata = 5 [(gogoproto.nullable) = false]; } @@ -20,26 +20,32 @@ message Metadata { } // SnapshotItem is an item contained in a rootmulti.Store snapshot. +// +// Since: cosmos-sdk 0.46 message SnapshotItem { // item is the specific type of snapshot item. oneof item { - SnapshotStoreItem store = 1; - SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; - SnapshotExtensionMeta extension = 3; - SnapshotExtensionPayload extension_payload = 4; - SnapshotKVItem kv = 5 [(gogoproto.customname) = "KV"]; - SnapshotSchema schema = 6; + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + SnapshotExtensionMeta extension = 3; + SnapshotExtensionPayload extension_payload = 4; + SnapshotKVItem kv = 5 [(gogoproto.customname) = "KV"]; + SnapshotSchema schema = 6; } } // SnapshotStoreItem contains metadata about a snapshotted store. +// +// Since: cosmos-sdk 0.46 message SnapshotStoreItem { string name = 1; } // SnapshotIAVLItem is an exported IAVL node. +// +// Since: cosmos-sdk 0.46 message SnapshotIAVLItem { - bytes key = 1; + bytes key = 1; bytes value = 2; // version is block height int64 version = 3; @@ -48,23 +54,31 @@ message SnapshotIAVLItem { } // SnapshotExtensionMeta contains metadata about an external snapshotter. +// +// Since: cosmos-sdk 0.46 message SnapshotExtensionMeta { - string name = 1; + string name = 1; uint32 format = 2; } // SnapshotExtensionPayload contains payloads of an external snapshotter. +// +// Since: cosmos-sdk 0.46 message SnapshotExtensionPayload { bytes payload = 1; } // SnapshotKVItem is an exported Key/Value Pair +// +// Since: cosmos-sdk 0.46 message SnapshotKVItem { - bytes key = 1; + bytes key = 1; bytes value = 2; } // SnapshotSchema is an exported schema of smt store -message SnapshotSchema{ +// +// Since: cosmos-sdk 0.46 +message SnapshotSchema { repeated bytes keys = 1; } diff --git a/packages/cosmic-proto/proto/cosmos/base/store/v1beta1/listening.proto b/packages/cosmic-proto/proto/cosmos/base/store/v1beta1/listening.proto index 359997109c1..753f7c16551 100644 --- a/packages/cosmic-proto/proto/cosmos/base/store/v1beta1/listening.proto +++ b/packages/cosmic-proto/proto/cosmos/base/store/v1beta1/listening.proto @@ -1,6 +1,8 @@ syntax = "proto3"; package cosmos.base.store.v1beta1; +import "tendermint/abci/types.proto"; + option go_package = "github.com/cosmos/cosmos-sdk/store/types"; // StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) @@ -14,3 +16,19 @@ message StoreKVPair { bytes key = 3; bytes value = 4; } + +// BlockMetadata contains all the abci event data of a block +// the file streamer dump them into files together with the state changes. +message BlockMetadata { + // DeliverTx encapulate deliver tx request and response. + message DeliverTx { + tendermint.abci.RequestDeliverTx request = 1; + tendermint.abci.ResponseDeliverTx response = 2; + } + tendermint.abci.RequestBeginBlock request_begin_block = 1; + tendermint.abci.ResponseBeginBlock response_begin_block = 2; + repeated DeliverTx deliver_txs = 3; + tendermint.abci.RequestEndBlock request_end_block = 4; + tendermint.abci.ResponseEndBlock response_end_block = 5; + tendermint.abci.ResponseCommit response_commit = 6; +} diff --git a/packages/cosmic-proto/proto/cosmos/base/tendermint/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/base/tendermint/v1beta1/query.proto index 96a46e53cb6..2d516901218 100644 --- a/packages/cosmic-proto/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -1,13 +1,15 @@ syntax = "proto3"; package cosmos.base.tendermint.v1beta1; +import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "tendermint/p2p/types.proto"; -import "tendermint/types/block.proto"; import "tendermint/types/types.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/tendermint/v1beta1/types.proto"; import "cosmos_proto/cosmos.proto"; +import "tendermint/types/block.proto"; option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; @@ -17,14 +19,17 @@ service Service { rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; } + // GetSyncing queries node syncing. rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; } + // GetLatestBlock returns the latest block. rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; } + // GetBlockByHeight queries block for given height. rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; @@ -34,20 +39,32 @@ service Service { rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; } + // GetValidatorSetByHeight queries validator-set at a given height. rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; } + + // ABCIQuery defines a query handler that supports ABCI queries directly to + // the application, bypassing Tendermint completely. The ABCI query must + // contain a valid and supported path, including app, custom, p2p, and store. + // + // Since: cosmos-sdk 0.46 + rpc ABCIQuery(ABCIQueryRequest) returns (ABCIQueryResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/abci_query"; + } } -// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +// GetValidatorSetByHeightRequest is the request type for the +// Query/GetValidatorSetByHeight RPC method. message GetValidatorSetByHeightRequest { int64 height = 1; // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } -// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +// GetValidatorSetByHeightResponse is the response type for the +// Query/GetValidatorSetByHeight RPC method. message GetValidatorSetByHeightResponse { int64 block_height = 1; repeated Validator validators = 2; @@ -55,13 +72,15 @@ message GetValidatorSetByHeightResponse { cosmos.base.query.v1beta1.PageResponse pagination = 3; } -// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +// GetLatestValidatorSetRequest is the request type for the +// Query/GetValidatorSetByHeight RPC method. message GetLatestValidatorSetRequest { // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 1; } -// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +// GetLatestValidatorSetResponse is the response type for the +// Query/GetValidatorSetByHeight RPC method. message GetLatestValidatorSetResponse { int64 block_height = 1; repeated Validator validators = 2; @@ -77,24 +96,38 @@ message Validator { int64 proposer_priority = 4; } -// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight +// RPC method. message GetBlockByHeightRequest { int64 height = 1; } -// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight +// RPC method. message GetBlockByHeightResponse { .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; } -// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC +// method. message GetLatestBlockRequest {} -// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC +// method. message GetLatestBlockResponse { .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; } // GetSyncingRequest is the request type for the Query/GetSyncing RPC method. @@ -108,10 +141,11 @@ message GetSyncingResponse { // GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. message GetNodeInfoRequest {} -// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC +// method. message GetNodeInfoResponse { - .tendermint.p2p.NodeInfo node_info = 1; - VersionInfo application_version = 2; + .tendermint.p2p.DefaultNodeInfo default_node_info = 1; + VersionInfo application_version = 2; } // VersionInfo is the type for the GetNodeInfoResponse message. @@ -136,3 +170,50 @@ message Module { // checksum string sum = 3; } + +// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +message ABCIQueryRequest { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC +// query. +// +// Note: This type is a duplicate of the ResponseQuery proto type defined in +// Tendermint. +message ABCIQueryResponse { + uint32 code = 1; + // DEPRECATED: use "value" instead + reserved 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +// ProofOp defines an operation used for calculating Merkle root. The data could +// be arbitrary format, providing nessecary data for example neighbouring node +// hash. +// +// Note: This type is a duplicate of the ProofOp proto type defined in +// Tendermint. +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps. +// +// Note: This type is a duplicate of the ProofOps proto type defined in +// Tendermint. +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/cosmic-proto/proto/cosmos/base/tendermint/v1beta1/types.proto b/packages/cosmic-proto/proto/cosmos/base/tendermint/v1beta1/types.proto new file mode 100644 index 00000000000..3d6c04c26a8 --- /dev/null +++ b/packages/cosmic-proto/proto/cosmos/base/tendermint/v1beta1/types.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; +import "tendermint/version/types.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; + +// Block is tendermint type Block, with the Header proposer address +// field converted to bech32 string. +message Block { + Header header = 1 [(gogoproto.nullable) = false]; + .tendermint.types.Data data = 2 [(gogoproto.nullable) = false]; + .tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + .tendermint.types.Commit last_commit = 4; +} + +// Header defines the structure of a Tendermint block header. +message Header { + // basic block info + .tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + + // prev block info + .tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false]; + + // hashes of block data + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + + // 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. + string proposer_address = 14; // original proposer of the block +} diff --git a/packages/cosmic-proto/proto/cosmos/crypto/hd/v1/hd.proto b/packages/cosmic-proto/proto/cosmos/crypto/hd/v1/hd.proto index e4a95afcba9..bb079ce6650 100644 --- a/packages/cosmic-proto/proto/cosmos/crypto/hd/v1/hd.proto +++ b/packages/cosmic-proto/proto/cosmos/crypto/hd/v1/hd.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.crypto.hd.v1; diff --git a/packages/cosmic-proto/proto/cosmos/crypto/keyring/v1/record.proto b/packages/cosmic-proto/proto/cosmos/crypto/keyring/v1/record.proto index 9b2d3c96439..14c6da63eb5 100644 --- a/packages/cosmic-proto/proto/cosmos/crypto/keyring/v1/record.proto +++ b/packages/cosmic-proto/proto/cosmos/crypto/keyring/v1/record.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.crypto.keyring.v1; @@ -17,21 +18,20 @@ message Record { // Record contains one of the following items oneof item { - // local stores the public information about a locally stored key + // local stores the private key locally. Local local = 3; - // ledger stores the public information about a Ledger key + // ledger stores the information about a Ledger key. Ledger ledger = 4; - // Multi does not store any information. + // Multi does not store any other information. Multi multi = 5; - // Offline does not store any information. + // Offline does not store any other information. Offline offline = 6; } // Item is a keyring item stored in a keyring backend. // Local item message Local { - google.protobuf.Any priv_key = 1; - string priv_key_type = 2; + google.protobuf.Any priv_key = 1; } // Ledger item diff --git a/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/distribution.proto b/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/distribution.proto index 1afe25ae4ff..73174303fb7 100644 --- a/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/distribution.proto +++ b/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/distribution.proto @@ -99,9 +99,9 @@ message FeePool { // together with how many coins are proposed to be spent, and to which // recipient account. message CommunityPoolSpendProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; @@ -142,8 +142,8 @@ message DelegationDelegatorReward { // CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal // with a deposit message CommunityPoolSpendProposalWithDeposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; diff --git a/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/tx.proto index 7f22dce9520..68fea0c27c1 100644 --- a/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/distribution/v1beta1/tx.proto @@ -57,6 +57,7 @@ message MsgWithdrawDelegatorReward { // MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. message MsgWithdrawDelegatorRewardResponse { + // Since: cosmos-sdk 0.46 repeated cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } @@ -74,6 +75,7 @@ message MsgWithdrawValidatorCommission { // MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. message MsgWithdrawValidatorCommissionResponse { + // Since: cosmos-sdk 0.46 repeated cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } diff --git a/packages/cosmic-proto/proto/cosmos/evidence/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/evidence/v1beta1/tx.proto index 90f6296478a..223f7e1110a 100644 --- a/packages/cosmic-proto/proto/cosmos/evidence/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/evidence/v1beta1/tx.proto @@ -25,7 +25,7 @@ message MsgSubmitEvidence { option (gogoproto.goproto_getters) = false; string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.Evidence"]; + google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; } // MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. diff --git a/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/feegrant.proto b/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/feegrant.proto index 25fec10b262..ec4e7a1e096 100644 --- a/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ b/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -11,13 +11,13 @@ import "google/protobuf/duration.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; -// BasicAllowance implements Allowance with a one-time grant of tokens +// BasicAllowance implements Allowance with a one-time grant of coins // that optionally expires. The grantee can use up to SpendLimit to cover fees. message BasicAllowance { - option (cosmos_proto.implements_interface) = "cosmos.feegrant.FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - // spend_limit specifies the maximum amount of tokens that can be spent - // by this allowance and will be updated as tokens are spent. If it is + // 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 // empty, there is no spend limit and any amount of coins can be spent. repeated cosmos.base.v1beta1.Coin spend_limit = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; @@ -29,7 +29,7 @@ message BasicAllowance { // PeriodicAllowance extends Allowance to allow for both a maximum cap, // as well as a limit per time period. message PeriodicAllowance { - option (cosmos_proto.implements_interface) = "cosmos.feegrant.FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "FeeAllowanceI"; // basic specifies a struct of `BasicAllowance` BasicAllowance basic = 1 [(gogoproto.nullable) = false]; @@ -56,10 +56,10 @@ message PeriodicAllowance { // AllowedMsgAllowance creates allowance only for specified message types. message AllowedMsgAllowance { option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "cosmos.feegrant.FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "FeeAllowanceI"; // allowance can be any of basic and periodic fee allowance. - google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.FeeAllowanceI"]; + google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; // allowed_messages are the messages for which the grantee has the access. repeated string allowed_messages = 2; @@ -74,5 +74,5 @@ message Grant { string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // allowance can be any of basic, periodic, allowed fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.FeeAllowanceI"]; + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; } diff --git a/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/query.proto index 59c992c911d..baef7770162 100644 --- a/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/query.proto @@ -23,7 +23,8 @@ service Query { } // AllowancesByGranter returns all the grants given by an address - // Since v0.46 + // + // Since: cosmos-sdk 0.46 rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; } @@ -62,6 +63,8 @@ message QueryAllowancesResponse { } // QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 message QueryAllowancesByGranterRequest { string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -70,6 +73,8 @@ message QueryAllowancesByGranterRequest { } // QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 message QueryAllowancesByGranterResponse { // allowances that have been issued by the granter. repeated cosmos.feegrant.v1beta1.Grant allowances = 1; diff --git a/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/tx.proto index 5cef05579c9..a12d9aaab12 100644 --- a/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/feegrant/v1beta1/tx.proto @@ -32,7 +32,7 @@ message MsgGrantAllowance { string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // allowance can be any of basic, periodic, allowed fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.FeeAllowanceI"]; + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; } // MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. diff --git a/packages/cosmic-proto/proto/cosmos/gov/v1/gov.proto b/packages/cosmic-proto/proto/cosmos/gov/v1/gov.proto index fb014d65ce6..8a8572335d7 100644 --- a/packages/cosmic-proto/proto/cosmos/gov/v1/gov.proto +++ b/packages/cosmic-proto/proto/cosmos/gov/v1/gov.proto @@ -60,7 +60,7 @@ message Proposal { // ProposalStatus enumerates the valid statuses of a proposal. enum ProposalStatus { - // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. PROPOSAL_STATUS_UNSPECIFIED = 0; // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit // period. diff --git a/packages/cosmic-proto/proto/cosmos/gov/v1/query.proto b/packages/cosmic-proto/proto/cosmos/gov/v1/query.proto index ea46472aa72..b9d5914507d 100644 --- a/packages/cosmic-proto/proto/cosmos/gov/v1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/gov/v1/query.proto @@ -93,7 +93,7 @@ message QueryVoteRequest { // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; - // voter defines the oter address for the proposals. + // voter defines the voter address for the proposals. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/packages/cosmic-proto/proto/cosmos/gov/v1/tx.proto b/packages/cosmic-proto/proto/cosmos/gov/v1/tx.proto index 7aee99917bb..9306c51e8c0 100644 --- a/packages/cosmic-proto/proto/cosmos/gov/v1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/gov/v1/tx.proto @@ -53,7 +53,7 @@ message MsgExecLegacyContent { option (cosmos.msg.v1.signer) = "authority"; // content is the proposal's content. - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; // authority must be the gov module address. string authority = 2; } diff --git a/packages/cosmic-proto/proto/cosmos/gov/v1beta1/gov.proto b/packages/cosmic-proto/proto/cosmos/gov/v1beta1/gov.proto index c23dd925a24..0e65d65b20d 100644 --- a/packages/cosmic-proto/proto/cosmos/gov/v1beta1/gov.proto +++ b/packages/cosmic-proto/proto/cosmos/gov/v1beta1/gov.proto @@ -45,7 +45,7 @@ message WeightedVoteOption { // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval. message TextProposal { - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (cosmos_proto.implements_interface) = "Content"; option (gogoproto.equal) = true; @@ -70,7 +70,7 @@ message Proposal { option (gogoproto.equal) = true; uint64 proposal_id = 1; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; ProposalStatus status = 3; // final_tally_result is the final tally result of the proposal. When // querying a proposal via gRPC, this field is not populated until the @@ -88,7 +88,7 @@ message Proposal { enum ProposalStatus { option (gogoproto.goproto_enum_prefix) = false; - // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit // period. diff --git a/packages/cosmic-proto/proto/cosmos/gov/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/gov/v1beta1/query.proto index e8837fd275a..168e1f5e077 100644 --- a/packages/cosmic-proto/proto/cosmos/gov/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/gov/v1beta1/query.proto @@ -98,7 +98,7 @@ message QueryVoteRequest { // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; - // voter defines the oter address for the proposals. + // voter defines the voter address for the proposals. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/packages/cosmic-proto/proto/cosmos/gov/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/gov/v1beta1/tx.proto index 6b2f1689c12..00ce2253ef7 100644 --- a/packages/cosmic-proto/proto/cosmos/gov/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/gov/v1beta1/tx.proto @@ -38,7 +38,7 @@ message MsgSubmitProposal { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/packages/cosmic-proto/proto/cosmos/group/v1/events.proto b/packages/cosmic-proto/proto/cosmos/group/v1/events.proto index e8907243aa1..2b98ec9abc3 100644 --- a/packages/cosmic-proto/proto/cosmos/group/v1/events.proto +++ b/packages/cosmic-proto/proto/cosmos/group/v1/events.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.group.v1; @@ -64,6 +65,9 @@ message EventExec { // result is the proposal execution result. ProposalExecutorResult result = 2; + + // logs contains error logs in case the execution result is FAILURE. + string logs = 3; } // EventLeaveGroup is an event emitted when group member leaves the group. @@ -75,3 +79,16 @@ message EventLeaveGroup { // address is the account address of the group member. string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } + +// EventProposalPruned is an event emitted when a proposal is pruned. +message EventProposalPruned { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). + ProposalStatus status = 2; + + // tally_result is the proposal tally result (when applicable). + TallyResult tally_result = 3; +} diff --git a/packages/cosmic-proto/proto/cosmos/group/v1/genesis.proto b/packages/cosmic-proto/proto/cosmos/group/v1/genesis.proto index 49655ad2faf..e4c895e96ee 100644 --- a/packages/cosmic-proto/proto/cosmos/group/v1/genesis.proto +++ b/packages/cosmic-proto/proto/cosmos/group/v1/genesis.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.group.v1; diff --git a/packages/cosmic-proto/proto/cosmos/group/v1/query.proto b/packages/cosmic-proto/proto/cosmos/group/v1/query.proto index 1690d5b731c..20516d32770 100644 --- a/packages/cosmic-proto/proto/cosmos/group/v1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/group/v1/query.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.group.v1; @@ -73,10 +74,21 @@ service Query { option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}"; }; - // TallyResult queries the tally of a proposal votes. + // TallyResult returns the tally result of a proposal. If the proposal is + // still in voting period, then this query computes the current tally state, + // which might not be final. On the other hand, if the proposal is final, + // then it simply returns the `final_tally_result` state stored in the + // proposal itself. rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; }; + + // Groups queries all groups in state. + // + // Since: cosmos-sdk 0.47.1 + rpc Groups(QueryGroupsRequest) returns (QueryGroupsResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups"; + }; } // QueryGroupInfoRequest is the Query/GroupInfo request type. @@ -306,3 +318,23 @@ message QueryTallyResultResponse { // tally defines the requested tally. TallyResult tally = 1 [(gogoproto.nullable) = false]; } + +// QueryGroupsRequest is the Query/Groups request type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsRequest { + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsResponse is the Query/Groups response type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsResponse { + // `groups` is all the groups present in state. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/cosmic-proto/proto/cosmos/group/v1/tx.proto b/packages/cosmic-proto/proto/cosmos/group/v1/tx.proto index 9fb0caa1978..1983d31ba86 100644 --- a/packages/cosmic-proto/proto/cosmos/group/v1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/group/v1/tx.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.group.v1; @@ -45,7 +46,7 @@ service Msg { // SubmitProposal submits a new proposal. rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); - // WithdrawProposal aborts a proposal. + // WithdrawProposal withdraws a proposal. rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse); // Vote allows a voter to vote on a proposal. @@ -65,11 +66,12 @@ service Msg { // MsgCreateGroup is the Msg/CreateGroup request type. message MsgCreateGroup { option (cosmos.msg.v1.signer) = "admin"; + // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // members defines the group members. - repeated Member members = 2 [(gogoproto.nullable) = false]; + repeated MemberRequest members = 2 [(gogoproto.nullable) = false]; // metadata is any arbitrary metadata to attached to the group. string metadata = 3; @@ -94,7 +96,7 @@ message MsgUpdateGroupMembers { // member_updates is the list of members to update, // set weight to 0 to remove a member. - repeated Member member_updates = 3 [(gogoproto.nullable) = false]; + repeated MemberRequest member_updates = 3 [(gogoproto.nullable) = false]; } // MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. @@ -154,7 +156,7 @@ message MsgCreateGroupPolicy { string metadata = 3; // decision_policy specifies the group policy's decision policy. - google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; + google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; } // MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. @@ -171,8 +173,8 @@ message MsgUpdateGroupPolicyAdmin { // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // address is the account address of the group policy. - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // group_policy_address is the account address of the group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // new_admin is the new group policy admin. string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -180,13 +182,14 @@ message MsgUpdateGroupPolicyAdmin { // MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. message MsgCreateGroupWithPolicy { + option (cosmos.msg.v1.signer) = "admin"; option (gogoproto.goproto_getters) = false; // admin is the account address of the group and group policy admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // members defines the group members. - repeated Member members = 2 [(gogoproto.nullable) = false]; + repeated MemberRequest members = 2 [(gogoproto.nullable) = false]; // group_metadata is any arbitrary metadata attached to the group. string group_metadata = 3; @@ -194,11 +197,12 @@ message MsgCreateGroupWithPolicy { // group_policy_metadata is any arbitrary metadata attached to the group policy. string group_policy_metadata = 4; - // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. - bool group_policy_as_admin = 5; + // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + // and group policy admin. + bool group_policy_as_admin = 5; // decision_policy specifies the group policy's decision policy. - google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; } // MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. @@ -223,11 +227,11 @@ message MsgUpdateGroupPolicyDecisionPolicy { // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // address is the account address of group policy. - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // decision_policy is the updated group policy's decision policy. - google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; + google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; } // MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. @@ -240,8 +244,8 @@ message MsgUpdateGroupPolicyMetadata { // admin is the account address of the group admin. string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // address is the account address of group policy. - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is the updated group policy metadata. string metadata = 3; @@ -274,8 +278,8 @@ message MsgSubmitProposal { option (gogoproto.goproto_getters) = false; - // address is the account address of group policy. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // group_policy_address is the account address of group policy. + string group_policy_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // proposers are the account addresses of the proposers. // Proposers signatures will be counted as yes votes. @@ -302,6 +306,8 @@ message MsgSubmitProposalResponse { // MsgWithdrawProposal is the Msg/WithdrawProposal request type. message MsgWithdrawProposal { + option (cosmos.msg.v1.signer) = "address"; + // proposal is the unique ID of the proposal. uint64 proposal_id = 1; @@ -342,12 +348,15 @@ message MsgExec { // proposal is the unique ID of the proposal. uint64 proposal_id = 1; - // signer is the account address used to execute the proposal. - string signer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // executor is the account address used to execute the proposal. + string executor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgExecResponse is the Msg/Exec request type. -message MsgExecResponse {} +message MsgExecResponse { + // result is the final result of the proposal execution. + ProposalExecutorResult result = 2; +} // MsgLeaveGroup is the Msg/LeaveGroup request type. message MsgLeaveGroup { diff --git a/packages/cosmic-proto/proto/cosmos/group/v1/types.proto b/packages/cosmic-proto/proto/cosmos/group/v1/types.proto index 604fe0aec84..d975d6b62da 100644 --- a/packages/cosmic-proto/proto/cosmos/group/v1/types.proto +++ b/packages/cosmic-proto/proto/cosmos/group/v1/types.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.group.v1; @@ -11,45 +12,63 @@ import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; // Member represents a group member with an account address, -// non-zero weight and metadata. +// non-zero weight, metadata and added_at timestamp. message Member { - // address is the member's account address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // weight is the member's voting weight that should be greater than 0. string weight = 2; - // metadata is any arbitrary metadata to attached to the member. + // metadata is any arbitrary metadata attached to the member. string metadata = 3; // added_at is a timestamp specifying when a member was added. google.protobuf.Timestamp added_at = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } -// Members defines a repeated slice of Member objects. -message Members { +// MemberRequest represents a group member to be used in Msg server requests. +// Contrary to `Member`, it doesn't have any `added_at` field +// since this field cannot be set as part of requests. +message MemberRequest { + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // members is the list of members. - repeated Member members = 1 [(gogoproto.nullable) = false]; + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata attached to the member. + string metadata = 3; } -// ThresholdDecisionPolicy implements the DecisionPolicy interface +// ThresholdDecisionPolicy is a decision policy where a proposal passes when it +// satisfies the two following conditions: +// 1. The sum of all `YES` voters' weights is greater or equal than the defined +// `threshold`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. message ThresholdDecisionPolicy { - option (cosmos_proto.implements_interface) = "cosmos.group.DecisionPolicy"; + option (cosmos_proto.implements_interface) = "DecisionPolicy"; - // threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. + // threshold is the minimum weighted sum of `YES` votes that must be met or + // exceeded for a proposal to succeed. string threshold = 1; // windows defines the different windows for voting and execution. DecisionPolicyWindows windows = 2; } -// PercentageDecisionPolicy implements the DecisionPolicy interface +// PercentageDecisionPolicy is a decision policy where a proposal passes when +// it satisfies the two following conditions: +// 1. The percentage of all `YES` voters' weights out of the total group weight +// is greater or equal than the given `percentage`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. message PercentageDecisionPolicy { - option (cosmos_proto.implements_interface) = "cosmos.group.DecisionPolicy"; + option (cosmos_proto.implements_interface) = "DecisionPolicy"; - // percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. + // percentage is the minimum percentage the weighted sum of `YES` votes must + // meet for a proposal to succeed. string percentage = 1; // windows defines the different windows for voting and execution. @@ -80,7 +99,8 @@ message DecisionPolicyWindows { enum VoteOption { option (gogoproto.goproto_enum_prefix) = false; - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + // VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + // return an error. VOTE_OPTION_UNSPECIFIED = 0; // VOTE_OPTION_YES defines a yes vote option. VOTE_OPTION_YES = 1; @@ -98,7 +118,6 @@ enum VoteOption { // GroupInfo represents the high-level on-chain information for a group. message GroupInfo { - // id is the unique ID of the group. uint64 id = 1; @@ -123,7 +142,6 @@ message GroupInfo { // GroupMember represents the relationship between a group and a member. message GroupMember { - // group_id is the unique ID of the group. uint64 group_id = 1; @@ -153,7 +171,7 @@ message GroupPolicyInfo { uint64 version = 5; // decision_policy specifies the group policy's decision policy. - google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.DecisionPolicy"]; + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; // created_at is a timestamp specifying when a group policy was created. google.protobuf.Timestamp created_at = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; @@ -169,8 +187,8 @@ message Proposal { // id is the unique id of the proposal. uint64 id = 1; - // address is the account address of group policy. - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is any arbitrary metadata to attached to the proposal. string metadata = 3; @@ -181,39 +199,37 @@ message Proposal { // submit_time is a timestamp specifying when a proposal was submitted. google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - // group_version tracks the version of the group that this proposal corresponds to. - // When group membership is changed, existing proposals from previous group versions will become invalid. + // group_version tracks the version of the group at proposal submission. + // This field is here for informational purposes only. uint64 group_version = 6; - // group_policy_version tracks the version of the group policy that this proposal corresponds to. - // When a decision policy is changed, existing proposals from previous policy versions will become invalid. + // 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. uint64 group_policy_version = 7; // status represents the high level position in the life cycle of the proposal. Initial value is Submitted. ProposalStatus status = 8; - // result is the final result based on the votes and election rule. Initial value is unfinalized. - // The result is persisted so that clients can always rely on this state and not have to replicate the logic. - ProposalResult result = 9; - // final_tally_result contains the sums of all weighted votes for this - // proposal for each vote option, after tallying. When querying a proposal - // via gRPC, this field is not populated until the proposal's voting period - // has ended. - TallyResult final_tally_result = 10 [(gogoproto.nullable) = false]; + // proposal for each vote option. It is empty at submission, and only + // populated after tallying, at voting period end or at proposal execution, + // whichever happens first. + TallyResult final_tally_result = 9 [(gogoproto.nullable) = false]; // voting_period_end is the timestamp before which voting must be done. // Unless a successfull MsgExec is called before (to execute a proposal whose // tally is successful before the voting period ends), tallying will be done - // at this point, and the `final_tally_result`, as well - // as `status` and `result` fields will be accordingly updated. - google.protobuf.Timestamp voting_period_end = 11 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // at this point, and the `final_tally_result`and `status` fields will be + // accordingly updated. + google.protobuf.Timestamp voting_period_end = 10 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - // executor_result is the final result based on the votes and election rule. Initial value is NotRun. - ProposalExecutorResult executor_result = 12; + // executor_result is the final result of the proposal execution. Initial value is NotRun. + ProposalExecutorResult executor_result = 11; - // messages is a list of Msgs that will be executed if the proposal passes. - repeated google.protobuf.Any messages = 13; + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 12; } // ProposalStatus defines proposal statuses. @@ -223,35 +239,24 @@ enum ProposalStatus { // An empty value is invalid and not allowed. PROPOSAL_STATUS_UNSPECIFIED = 0; - // Initial status of a proposal when persisted. + // Initial status of a proposal when submitted. PROPOSAL_STATUS_SUBMITTED = 1; - // Final status of a proposal when the final tally was executed. - PROPOSAL_STATUS_CLOSED = 2; + // Final status of a proposal when the final tally is done and the outcome + // passes the group policy's decision policy. + PROPOSAL_STATUS_ACCEPTED = 2; - // Final status of a proposal when the group was modified before the final tally. - PROPOSAL_STATUS_ABORTED = 3; + // Final status of a proposal when the final tally is done and the outcome + // is rejected by the group policy's decision policy. + PROPOSAL_STATUS_REJECTED = 3; - // A proposal can be deleted before the voting start time by the owner. When this happens the final status - // is Withdrawn. - PROPOSAL_STATUS_WITHDRAWN = 4; -} - -// ProposalResult defines types of proposal results. -enum ProposalResult { - option (gogoproto.goproto_enum_prefix) = false; + // Final status of a proposal when the group policy is modified before the + // final tally. + PROPOSAL_STATUS_ABORTED = 4; - // An empty value is invalid and not allowed - PROPOSAL_RESULT_UNSPECIFIED = 0; - - // Until a final tally has happened the status is unfinalized - PROPOSAL_RESULT_UNFINALIZED = 1; - - // Final result of the tally - PROPOSAL_RESULT_ACCEPTED = 2; - - // Final result of the tally - PROPOSAL_RESULT_REJECTED = 3; + // A proposal can be withdrawn before the voting start time by the owner. + // When this happens the final status is Withdrawn. + PROPOSAL_STATUS_WITHDRAWN = 5; } // ProposalExecutorResult defines types of proposal executor results. @@ -281,7 +286,7 @@ message TallyResult { // abstain_count is the weighted sum of abstainers. string abstain_count = 2; - // no is the weighted sum of no votes. + // no_count is the weighted sum of no votes. string no_count = 3; // no_with_veto_count is the weighted sum of veto. @@ -290,7 +295,6 @@ message TallyResult { // Vote represents a vote for a proposal. message Vote { - // proposal is the unique ID of the proposal. uint64 proposal_id = 1; diff --git a/packages/cosmic-proto/proto/cosmos/orm/v1/orm.proto b/packages/cosmic-proto/proto/cosmos/orm/v1/orm.proto deleted file mode 100644 index abfbbd4f5ce..00000000000 --- a/packages/cosmic-proto/proto/cosmos/orm/v1/orm.proto +++ /dev/null @@ -1,104 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.v1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - - // table specifies that this message will be used as an ORM table. It cannot - // be used together with the singleton option. - TableDescriptor table = 104503790; - - // singleton specifies that this message will be used as an ORM singleton. It cannot - // be used together with the table option. - SingletonDescriptor singleton = 104503791; -} - -// TableDescriptor describes an ORM table. -message TableDescriptor { - - // primary_key defines the primary key for the table. - PrimaryKeyDescriptor primary_key = 1; - - // index defines one or more secondary indexes. - repeated SecondaryIndexDescriptor index = 2; - - // 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. - uint32 id = 3; -} - -// PrimaryKeyDescriptor describes a table primary key. -message PrimaryKeyDescriptor { - - // fields is a comma-separated list of fields in the primary key. Spaces are - // not allowed. Supported field types, their encodings, and any applicable constraints - // are described below. - // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers. - // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers such as auto-incrementing sequences. - // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support - // sorted iteration. These types are well-suited for encoding fixed with - // decimals as integers. - // - string's are encoded as raw bytes in terminal key segments and null-terminated - // in non-terminal segments. Null characters are thus forbidden in strings. - // string fields support sorted iteration. - // - bytes are encoded as raw bytes in terminal segments and length-prefixed - // with a 32-bit unsigned varint in non-terminal segments. - // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with - // an encoding that enables sorted iteration. - // - google.protobuf.Timestamp and google.protobuf.Duration are encoded - // as 12 bytes using an encoding that enables sorted iteration. - // - enum fields are encoded using varint encoding and do not support sorted - // iteration. - // - bool fields are encoded as a single byte 0 or 1. - // - // All other fields types are unsupported in keys including repeated and - // oneof fields. - // - // Primary keys are prefixed by the varint encoded table id and the byte 0x0 - // plus any additional prefix specified by the schema. - string fields = 1; - - // 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. - bool auto_increment = 2; -} - -// PrimaryKeyDescriptor describes a table secondary index. -message SecondaryIndexDescriptor { - - // fields is a comma-separated list of fields in the index. The supported - // field types are the same as those for PrimaryKeyDescriptor.fields. - // Index keys are prefixed by the varint encoded table id and the varint - // encoded index id plus any additional prefix specified by the schema. - // - // In addition the the field segments, non-unique index keys are suffixed with - // any additional primary key fields not present in the index fields so that the - // primary key can be reconstructed. Unique indexes instead of being suffixed - // store the remaining primary key fields in the value.. - string fields = 1; - - // 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. - uint32 id = 2; - - // unique specifies that this an unique index. - bool unique = 3; -} - -// TableDescriptor describes an ORM singleton table which has at most one instance. -message SingletonDescriptor { - - // 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. - uint32 id = 1; -} \ No newline at end of file diff --git a/packages/cosmic-proto/proto/cosmos/orm/v1alpha1/schema.proto b/packages/cosmic-proto/proto/cosmos/orm/v1alpha1/schema.proto deleted file mode 100644 index ab713340e3f..00000000000 --- a/packages/cosmic-proto/proto/cosmos/orm/v1alpha1/schema.proto +++ /dev/null @@ -1,76 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.v1alpha1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - // module_schema is used to define the ORM schema for an app module. - // All module config messages that use module_schema must also declare - // themselves as app module config messages using the cosmos.app.v1.is_module - // option. - ModuleSchemaDescriptor module_schema = 104503792; -} - -// ModuleSchemaDescriptor describe's a module's ORM schema. -message ModuleSchemaDescriptor { - repeated FileEntry schema_file = 1; - - // FileEntry describes an ORM file used in a module. - message FileEntry { - // id is a prefix that will be varint encoded and prepended to all the - // table keys specified in the file's tables. - uint32 id = 1; - - // 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. - string proto_file_name = 2; - - // 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. - StorageType storage_type = 3; - } - - // prefix is an optional prefix that precedes all keys in this module's - // store. - bytes prefix = 2; -} - -// StorageType -enum StorageType { - // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent - // KV-storage where primary key entries are stored in merkle-tree - // backed commitment storage and indexes and seqs are stored in - // fast index storage. Note that the Cosmos SDK before store/v2alpha1 - // does not support this. - STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; - - // STORAGE_TYPE_MEMORY indicates in-memory storage that will be - // reloaded every time an app restarts. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - STORAGE_TYPE_MEMORY = 1; - - // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset - // at the end of every block. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - STORAGE_TYPE_TRANSIENT = 2; - - // STORAGE_TYPE_INDEX indicates persistent storage which is not backed - // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK - // before store/v2alpha1 does not support this. - STORAGE_TYPE_INDEX = 3; - - // STORAGE_TYPE_INDEX indicates persistent storage which is backed by - // a merkle-tree. With this type of storage, both primary and index keys - // will affect the app hash and this is generally less efficient - // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index - // keys into index storage. Note that modules built with the - // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT - // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX - // because this is the only type of persistent storage available. - STORAGE_TYPE_COMMITMENT = 4; -} diff --git a/packages/cosmic-proto/proto/cosmos/params/v1beta1/params.proto b/packages/cosmic-proto/proto/cosmos/params/v1beta1/params.proto index e5aabfeca4c..da23e1a9892 100644 --- a/packages/cosmic-proto/proto/cosmos/params/v1beta1/params.proto +++ b/packages/cosmic-proto/proto/cosmos/params/v1beta1/params.proto @@ -9,8 +9,8 @@ import "cosmos_proto/cosmos.proto"; // ParameterChangeProposal defines a proposal to change one or more parameters. message ParameterChangeProposal { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; diff --git a/packages/cosmic-proto/proto/cosmos/params/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/params/v1beta1/query.proto index 3b1c9a76009..97d0a71d7f5 100644 --- a/packages/cosmic-proto/proto/cosmos/params/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/params/v1beta1/query.proto @@ -16,6 +16,8 @@ service Query { } // Subspaces queries for all registered subspaces and all keys for a subspace. + // + // Since: cosmos-sdk 0.46 rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) { option (google.api.http).get = "/cosmos/params/v1beta1/subspaces"; } @@ -38,16 +40,22 @@ message QueryParamsResponse { // QuerySubspacesRequest defines a request type for querying for all registered // subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 message QuerySubspacesRequest {} // QuerySubspacesResponse defines the response types for querying for all // registered subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 message QuerySubspacesResponse { repeated Subspace subspaces = 1; } // Subspace defines a parameter subspace name and all the keys that exist for // the subspace. +// +// Since: cosmos-sdk 0.46 message Subspace { string subspace = 1; repeated string keys = 2; diff --git a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/authz.proto b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/authz.proto index 981da1dba63..677edaad1a2 100644 --- a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/authz.proto +++ b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/authz.proto @@ -11,7 +11,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // // Since: cosmos-sdk 0.43 message StakeAuthorization { - option (cosmos_proto.implements_interface) = "cosmos.authz.Authorization"; + option (cosmos_proto.implements_interface) = "Authorization"; // 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. diff --git a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/query.proto index 02469232ba0..2cbb750b0bd 100644 --- a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/query.proto @@ -119,7 +119,7 @@ message QueryValidatorRequest { // QueryValidatorResponse is response type for the Query/Validator RPC method message QueryValidatorResponse { - // validator defines the the validator info. + // validator defines the validator info. Validator validator = 1 [(gogoproto.nullable) = false]; } @@ -289,7 +289,7 @@ message QueryDelegatorValidatorsRequest { // QueryDelegatorValidatorsResponse is response type for the // Query/DelegatorValidators RPC method. message QueryDelegatorValidatorsResponse { - // validators defines the the validators' info of a delegator. + // validators defines the validators' info of a delegator. repeated Validator validators = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. @@ -312,7 +312,7 @@ message QueryDelegatorValidatorRequest { // QueryDelegatorValidatorResponse response type for the // Query/DelegatorValidator RPC method. message QueryDelegatorValidatorResponse { - // validator defines the the validator info. + // validator defines the validator info. Validator validator = 1 [(gogoproto.nullable) = false]; } diff --git a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/staking.proto b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/staking.proto index dcf2645fa24..6dc965feab4 100644 --- a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/staking.proto +++ b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/staking.proto @@ -117,6 +117,8 @@ message Validator { // commission defines the commission parameters. Commission commission = 10 [(gogoproto.nullable) = false]; // min_self_delegation is the validator's self declared minimum self delegation. + // + // Since: cosmos-sdk 0.46 string min_self_delegation = 11 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", diff --git a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/tx.proto index 6c8d40a76d9..b4866d36dba 100644 --- a/packages/cosmic-proto/proto/cosmos/staking/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/staking/v1beta1/tx.proto @@ -32,6 +32,12 @@ service Msg { // Undelegate defines a method for performing an undelegation from a // delegate and a validator. rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); + + // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + // and delegate back to previous validator. + // + // Since: cosmos-sdk 0.46 + rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse); } // MsgCreateValidator defines a SDK message for creating a new validator. @@ -89,8 +95,7 @@ message MsgEditValidatorResponse {} message MsgDelegate { option (cosmos.msg.v1.signer) = "delegator_address"; - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -105,8 +110,7 @@ message MsgDelegateResponse {} message MsgBeginRedelegate { option (cosmos.msg.v1.signer) = "delegator_address"; - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -124,8 +128,7 @@ message MsgBeginRedelegateResponse { message MsgUndelegate { option (cosmos.msg.v1.signer) = "delegator_address"; - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -136,3 +139,23 @@ message MsgUndelegate { message MsgUndelegateResponse { google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } + +// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegation { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (gogoproto.equal) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // amount is always less than or equal to unbonding delegation entry balance + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + // creation_height is the height which the unbonding took place. + int64 creation_height = 4; +} + +// MsgCancelUnbondingDelegationResponse +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegationResponse {} diff --git a/packages/cosmic-proto/proto/cosmos/tx/signing/v1beta1/signing.proto b/packages/cosmic-proto/proto/cosmos/tx/signing/v1beta1/signing.proto index 5a22616fe8d..12d5868ba8f 100644 --- a/packages/cosmic-proto/proto/cosmos/tx/signing/v1beta1/signing.proto +++ b/packages/cosmic-proto/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -39,6 +39,18 @@ enum SignMode { // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses // Amino JSON and will be removed in the future. SIGN_MODE_LEGACY_AMINO_JSON = 127; + + // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + // + // Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + // but is not implemented on the SDK by default. To enable EIP-191, you need + // to pass a custom `TxConfig` that has an implementation of + // `SignModeHandler` for EIP-191. The SDK may decide to fully support + // EIP-191 in the future. + // + // Since: cosmos-sdk 0.45.2 + SIGN_MODE_EIP_191 = 191; } // SignatureDescriptors wraps multiple SignatureDescriptor's. diff --git a/packages/cosmic-proto/proto/cosmos/tx/v1beta1/service.proto b/packages/cosmic-proto/proto/cosmos/tx/v1beta1/service.proto index e7af15269bf..f6c39d52baa 100644 --- a/packages/cosmic-proto/proto/cosmos/tx/v1beta1/service.proto +++ b/packages/cosmic-proto/proto/cosmos/tx/v1beta1/service.proto @@ -8,7 +8,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "tendermint/types/block.proto"; import "tendermint/types/types.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; // Service defines a gRPC service for interacting with transactions. service Service { @@ -48,8 +48,15 @@ message GetTxsEventRequest { // events is the list of transaction event type. repeated string events = 1; // pagination defines a pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; - OrderBy order_by = 3; + // Deprecated post v0.46.x: use page and limit instead. + cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; + + OrderBy order_by = 3; + // page is the page number to query, starts at 1. If not provided, will default to first page. + uint64 page = 4; + // 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. + uint64 limit = 5; } // OrderBy defines the sorting order @@ -70,7 +77,10 @@ message GetTxsEventResponse { // tx_responses is the list of queried TxResponses. repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; // pagination defines a pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; + // Deprecated post v0.46.x: use total instead. + cosmos.base.query.v1beta1.PageResponse pagination = 3 [deprecated = true]; + // total is total number of results available + uint64 total = 4; } // BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -155,9 +165,9 @@ message GetBlockWithTxsRequest { // Since: cosmos-sdk 0.45.2 message GetBlockWithTxsResponse { // txs are the transactions in the block. - repeated cosmos.tx.v1beta1.Tx txs = 1; - .tendermint.types.BlockID block_id = 2; - .tendermint.types.Block block = 3; + repeated cosmos.tx.v1beta1.Tx txs = 1; + .tendermint.types.BlockID block_id = 2; + .tendermint.types.Block block = 3; // pagination defines a pagination for the response. cosmos.base.query.v1beta1.PageResponse pagination = 4; } \ No newline at end of file diff --git a/packages/cosmic-proto/proto/cosmos/tx/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/tx/v1beta1/tx.proto index ac7b690f466..a71a3e115dc 100644 --- a/packages/cosmic-proto/proto/cosmos/tx/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/tx/v1beta1/tx.proto @@ -87,8 +87,12 @@ message SignDocDirectAux { // sequence is the sequence number of the signing account. uint64 sequence = 5; - // Tip is the optional tip used for meta-transactions. It should be left - // empty if the signer is not the tipper for this transaction. + // 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 + // transaction. + // + // This field is ignored if the chain didn't enable tips, i.e. didn't add the + // `TipDecorator` in its posthandler. Tip tip = 6; } @@ -138,7 +142,10 @@ message AuthInfo { // of the signers. This can be estimated via simulation. Fee fee = 2; - // Tip is the optional tip used for meta-transactions. + // Tip is the optional tip used for transactions fees paid in another denom. + // + // This field is ignored if the chain didn't enable tips, i.e. didn't add the + // `TipDecorator` in its posthandler. // // Since: cosmos-sdk 0.46 Tip tip = 3; @@ -238,11 +245,11 @@ message AuxSignerData { // AuxSignerData across different chains, the bech32 prefix of the target // chain (where the final transaction is broadcasted) should be used. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer + // 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 // LEGACY_AMINO_JSON. SignDocDirectAux sign_doc = 2; - // mode is the signing mode of the single signer + // mode is the signing mode of the single signer. cosmos.tx.signing.v1beta1.SignMode mode = 3; // sig is the signature of the sign doc. bytes sig = 4; diff --git a/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/query.proto b/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/query.proto index e8c4baa0d66..870cf9ee6bb 100644 --- a/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/query.proto +++ b/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/query.proto @@ -37,6 +37,8 @@ service Query { } // Returns the account with authority to conduct upgrades + // + // Since: cosmos-sdk 0.46 rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) { option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority"; } diff --git a/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/tx.proto index 9b04bf44beb..7a2931da214 100644 --- a/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/upgrade/v1beta1/tx.proto @@ -1,3 +1,4 @@ +// Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.upgrade.v1beta1; @@ -52,4 +53,4 @@ message MsgCancelUpgrade { // MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. // // Since: cosmos-sdk 0.46 -message MsgCancelUpgradeResponse {} \ No newline at end of file +message MsgCancelUpgradeResponse {} diff --git a/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/tx.proto b/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/tx.proto index 211bad09e0a..52b5e68a111 100644 --- a/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/tx.proto +++ b/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/tx.proto @@ -17,10 +17,21 @@ service Msg { rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); // CreatePermanentLockedAccount defines a method that enables creating a permanent // locked account. + // + // Since: cosmos-sdk 0.46 rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse); // CreatePeriodicVestingAccount defines a method that enables creating a // periodic vesting account. + // + // Since: cosmos-sdk 0.46 rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse); + // CreateClawbackVestingAccount defines a method that enables creating a + // vesting account that is subject to clawback. + rpc CreateClawbackVestingAccount(MsgCreateClawbackVestingAccount) returns (MsgCreateClawbackVestingAccountResponse); + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + rpc Clawback(MsgClawback) returns (MsgClawbackResponse); + // ReturnGrants returns vesting grants to the funder. + rpc ReturnGrants(MsgReturnGrants) returns (MsgReturnGrantsResponse); } // MsgCreateVestingAccount defines a message that enables creating a vesting @@ -35,6 +46,7 @@ message MsgCreateVestingAccount { repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // end of vesting as unix time (in seconds). int64 end_time = 4; bool delayed = 5; } @@ -44,6 +56,8 @@ message MsgCreateVestingAccountResponse {} // MsgCreatePermanentLockedAccount defines a message that enables creating a permanent // locked account. +// +// Since: cosmos-sdk 0.46 message MsgCreatePermanentLockedAccount { option (gogoproto.equal) = true; @@ -54,10 +68,14 @@ message MsgCreatePermanentLockedAccount { } // MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. +// +// Since: cosmos-sdk 0.46 message MsgCreatePermanentLockedAccountResponse {} // MsgCreateVestingAccount defines a message that enables creating a vesting // account. +// +// Since: cosmos-sdk 0.46 message MsgCreatePeriodicVestingAccount { option (cosmos.msg.v1.signer) = "from_address"; @@ -65,10 +83,67 @@ message MsgCreatePeriodicVestingAccount { string from_address = 1; string to_address = 2; + // start of vesting as unix time (in seconds). int64 start_time = 3; repeated Period vesting_periods = 4 [(gogoproto.nullable) = false]; + // If true, merge this new grant into an existing PeriodicVestingAccount, + // or create it if it does not exist. If false, creates a new account, + // or fails if an account already exists + bool merge = 5; } // MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount // response type. +// +// Since: cosmos-sdk 0.46 message MsgCreatePeriodicVestingAccountResponse {} + +// MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. +message MsgCreateClawbackVestingAccount { + option (gogoproto.equal) = false; + + // Address of the account providing the funds, which must also sign the request. + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + // Address of the account to receive the funds. + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + // Start time of the vesting. Periods start relative to this time. + int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; + // Unlocking events as a sequence of durations and amounts, starting relative to start_time. + repeated Period lockup_periods = 4 [(gogoproto.nullable) = false]; + // Vesting events as a sequence of durations and amounts, starting relative to start_time. + repeated Period vesting_periods = 5 [(gogoproto.nullable) = false]; + // If true, merge this new grant into an existing ClawbackVestingAccount, + // or create it if it does not exist. If false, creates a new account. + // New grants to an existing account must be from the same from_address. + bool merge = 6; +} + +// MsgCreateClawbackVestingAccountResponse defines the MsgCreateClawbackVestingAccount response type. +message MsgCreateClawbackVestingAccountResponse {} + +// MsgClawback defines a message that removes unvested tokens from a ClawbackVestingAccount. +message MsgClawback { + // funder_address is the address which funded the account + string funder_address = 1; + // address is the address of the ClawbackVestingAccount to claw back from. + string address = 2; + // dest_address specifies where the clawed-back tokens should be transferred. + // If empty, the tokens will be transferred back to the original funder of the account. + string dest_address = 3; +} + +// MsgClawbackResponse defines the MsgClawback response type. +message MsgClawbackResponse {} + +// MsgReturnGrants defines a message for a grantee to return all granted assets, +// including delegated, undelegated and unbonding, vested and unvested, +// are transferred to the original funder of the account. Might not be complete if +// some vested assets have been transferred out of the account. Currently only applies to +// ClawbackVesting accounts. +message MsgReturnGrants { + // address is the address of the grantee account returning the grant. + string address = 1; +} + +// MsgReturnGrantsResponse defines the ReturnGrants response type. +message MsgReturnGrantsResponse {} diff --git a/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/vesting.proto b/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/vesting.proto index 824cc30d8bb..8c2687096a2 100644 --- a/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/packages/cosmic-proto/proto/cosmos/vesting/v1beta1/vesting.proto @@ -20,6 +20,7 @@ message BaseVestingAccount { [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // Vesting end time, as unix timestamp (in seconds). int64 end_time = 5; } @@ -30,6 +31,7 @@ message ContinuousVestingAccount { option (gogoproto.goproto_stringer) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + // Vesting start time, as unix timestamp (in seconds). int64 start_time = 2; } @@ -44,9 +46,13 @@ message DelayedVestingAccount { } // Period defines a length of time and amount of coins that will vest. +// A sequence of periods defines a sequence of vesting events, with the +// first period relative to an externally-provided start time, +// and subsequent periods relatie to their predecessor. message Period { option (gogoproto.goproto_stringer) = false; + // Period duration in seconds. int64 length = 1; repeated cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; @@ -74,3 +80,22 @@ message PermanentLockedAccount { BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; } + +// ClawbackVestingAccount implements the VestingAccount interface. It provides +// an account that can hold contributions subject to "lockup" (like a +// PeriodicVestingAccount), or vesting which is subject to clawback +// of unvested tokens, or a combination (tokens vest, but are still locked). +message ClawbackVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + + // funder_address specifies the account which can perform clawback. + string funder_address = 2 [(gogoproto.moretags) = "yaml:\"funder_address\""]; + int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; + // unlocking schedule relative to the BaseVestingAccount start_time. + repeated Period lockup_periods = 4 [(gogoproto.moretags) = "yaml:\"lockup_periods\"", (gogoproto.nullable) = false]; + // vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. + repeated Period vesting_periods = 5 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false]; +} diff --git a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts index 6fbd26bffe1..b50c767bfb5 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts @@ -74,27 +74,6 @@ export interface QueryAccountRequestProtoMsg { export interface QueryAccountRequestSDKType { address: string; } -/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */ -export interface QueryModuleAccountsRequest {} -export interface QueryModuleAccountsRequestProtoMsg { - typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsRequest'; - value: Uint8Array; -} -/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */ -export interface QueryModuleAccountsRequestSDKType {} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponse { - /** params defines the parameters of the module. */ - params: Params; -} -export interface QueryParamsResponseProtoMsg { - typeUrl: '/cosmos.auth.v1beta1.QueryParamsResponse'; - value: Uint8Array; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseSDKType { - params: ParamsSDKType; -} /** QueryAccountResponse is the response type for the Query/Account RPC method. */ export interface QueryAccountResponse { /** account defines the account of the corresponding address. */ @@ -116,7 +95,40 @@ export interface QueryParamsRequestProtoMsg { } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType {} -/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.QueryParamsResponse'; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** + * QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsRequest {} +export interface QueryModuleAccountsRequestProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsRequest'; + value: Uint8Array; +} +/** + * QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsRequestSDKType {} +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryModuleAccountsResponse { accounts: (ModuleAccount & Any)[] | Any[]; } @@ -124,19 +136,59 @@ export interface QueryModuleAccountsResponseProtoMsg { typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsResponse'; value: Uint8Array; } -/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryModuleAccountsResponseSDKType { accounts: (ModuleAccountSDKType | AnySDKType)[]; } -/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */ +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequest { + name: string; +} +export interface QueryModuleAccountByNameRequestProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest'; + value: Uint8Array; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequestSDKType { + name: string; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponse { + account?: (ModuleAccount & Any) | undefined; +} +export interface QueryModuleAccountByNameResponseProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse'; + value: Uint8Array; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponseSDKType { + account?: ModuleAccountSDKType | AnySDKType | undefined; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface Bech32PrefixRequest {} export interface Bech32PrefixRequestProtoMsg { typeUrl: '/cosmos.auth.v1beta1.Bech32PrefixRequest'; value: Uint8Array; } -/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */ +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface Bech32PrefixRequestSDKType {} -/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface Bech32PrefixResponse { bech32Prefix: string; } @@ -144,11 +196,19 @@ export interface Bech32PrefixResponseProtoMsg { typeUrl: '/cosmos.auth.v1beta1.Bech32PrefixResponse'; value: Uint8Array; } -/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface Bech32PrefixResponseSDKType { bech32_prefix: string; } -/** AddressBytesToStringRequest is the request type for AddressString rpc method */ +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressBytesToStringRequest { addressBytes: Uint8Array; } @@ -156,11 +216,19 @@ export interface AddressBytesToStringRequestProtoMsg { typeUrl: '/cosmos.auth.v1beta1.AddressBytesToStringRequest'; value: Uint8Array; } -/** AddressBytesToStringRequest is the request type for AddressString rpc method */ +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressBytesToStringRequestSDKType { address_bytes: Uint8Array; } -/** AddressBytesToStringResponse is the response type for AddressString rpc method */ +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressBytesToStringResponse { addressString: string; } @@ -168,11 +236,19 @@ export interface AddressBytesToStringResponseProtoMsg { typeUrl: '/cosmos.auth.v1beta1.AddressBytesToStringResponse'; value: Uint8Array; } -/** AddressBytesToStringResponse is the response type for AddressString rpc method */ +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressBytesToStringResponseSDKType { address_string: string; } -/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */ +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressStringToBytesRequest { addressString: string; } @@ -180,11 +256,19 @@ export interface AddressStringToBytesRequestProtoMsg { typeUrl: '/cosmos.auth.v1beta1.AddressStringToBytesRequest'; value: Uint8Array; } -/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */ +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressStringToBytesRequestSDKType { address_string: string; } -/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */ +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressStringToBytesResponse { addressBytes: Uint8Array; } @@ -192,10 +276,59 @@ export interface AddressStringToBytesResponseProtoMsg { typeUrl: '/cosmos.auth.v1beta1.AddressStringToBytesResponse'; value: Uint8Array; } -/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */ +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ export interface AddressStringToBytesResponseSDKType { address_bytes: Uint8Array; } +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequest { + /** + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + */ + id: bigint; +} +export interface QueryAccountAddressByIDRequestProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest'; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequestSDKType { + id: bigint; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponse { + accountAddress: string; +} +export interface QueryAccountAddressByIDResponseProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse'; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponseSDKType { + account_address: string; +} function createBaseQueryAccountsRequest(): QueryAccountsRequest { return { pagination: undefined, @@ -426,13 +559,82 @@ export const QueryAccountRequest = { }; }, }; -function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { +function createBaseQueryAccountResponse(): QueryAccountResponse { + return { + account: undefined, + }; +} +export const QueryAccountResponse = { + 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: 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) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = AccountI_InterfaceDecoder(reader) as Any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountResponse { + return { + account: isSet(object.account) ? Any.fromJSON(object.account) : undefined, + }; + }, + toJSON(message: QueryAccountResponse): unknown { + const obj: any = {}; + message.account !== undefined && + (obj.account = message.account ? Any.toJSON(message.account) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + message.account = + object.account !== undefined && object.account !== null + ? Any.fromPartial(object.account) + : undefined; + return message; + }, + fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse { + return QueryAccountResponse.decode(message.value); + }, + toProto(message: QueryAccountResponse): Uint8Array { + return QueryAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountResponse): QueryAccountResponseProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.QueryAccountResponse', + value: QueryAccountResponse.encode(message).finish(), + }; + }, +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } -export const QueryModuleAccountsRequest = { - typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsRequest', +export const QueryParamsRequest = { + typeUrl: '/cosmos.auth.v1beta1.QueryParamsRequest', encode( - _: QueryModuleAccountsRequest, + _: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create(), ): BinaryWriter { return writer; @@ -440,11 +642,11 @@ export const QueryModuleAccountsRequest = { decode( input: BinaryReader | Uint8Array, length?: number, - ): QueryModuleAccountsRequest { + ): QueryParamsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountsRequest(); + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -455,33 +657,27 @@ export const QueryModuleAccountsRequest = { } return message; }, - fromJSON(_: any): QueryModuleAccountsRequest { + fromJSON(_: any): QueryParamsRequest { return {}; }, - toJSON(_: QueryModuleAccountsRequest): unknown { + toJSON(_: QueryParamsRequest): unknown { const obj: any = {}; return obj; }, - fromPartial( - _: Partial, - ): QueryModuleAccountsRequest { - const message = createBaseQueryModuleAccountsRequest(); + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, - fromProtoMsg( - message: QueryModuleAccountsRequestProtoMsg, - ): QueryModuleAccountsRequest { - return QueryModuleAccountsRequest.decode(message.value); + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); }, - toProto(message: QueryModuleAccountsRequest): Uint8Array { - return QueryModuleAccountsRequest.encode(message).finish(); + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); }, - toProtoMsg( - message: QueryModuleAccountsRequest, - ): QueryModuleAccountsRequestProtoMsg { + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { return { - typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsRequest', - value: QueryModuleAccountsRequest.encode(message).finish(), + typeUrl: '/cosmos.auth.v1beta1.QueryParamsRequest', + value: QueryParamsRequest.encode(message).finish(), }; }, }; @@ -554,35 +750,94 @@ export const QueryParamsResponse = { }; }, }; -function createBaseQueryAccountResponse(): QueryAccountResponse { +function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { + return {}; +} +export const QueryModuleAccountsRequest = { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsRequest', + encode( + _: QueryModuleAccountsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + return writer; + }, + 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) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryModuleAccountsRequest { + return {}; + }, + toJSON(_: QueryModuleAccountsRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial( + _: Partial, + ): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, + fromProtoMsg( + message: QueryModuleAccountsRequestProtoMsg, + ): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.decode(message.value); + }, + toProto(message: QueryModuleAccountsRequest): Uint8Array { + return QueryModuleAccountsRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryModuleAccountsRequest, + ): QueryModuleAccountsRequestProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsRequest', + value: QueryModuleAccountsRequest.encode(message).finish(), + }; + }, +}; +function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { return { - account: undefined, + accounts: [], }; } -export const QueryAccountResponse = { - typeUrl: '/cosmos.auth.v1beta1.QueryAccountResponse', +export const QueryModuleAccountsResponse = { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsResponse', encode( - message: QueryAccountResponse, + message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create(), ): BinaryWriter { - if (message.account !== undefined) { - Any.encode(message.account as Any, writer.uint32(10).fork()).ldelim(); + for (const v of message.accounts) { + Any.encode(v! as Any, writer.uint32(10).fork()).ldelim(); } return writer; }, decode( input: BinaryReader | Uint8Array, length?: number, - ): QueryAccountResponse { + ): QueryModuleAccountsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAccountResponse(); + const message = createBaseQueryModuleAccountsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.account = Cosmos_authAccountI_InterfaceDecoder(reader) as Any; + message.accounts.push(Any.decode(reader, reader.uint32()) as Any); break; default: reader.skipType(tag & 7); @@ -591,60 +846,76 @@ export const QueryAccountResponse = { } return message; }, - fromJSON(object: any): QueryAccountResponse { + fromJSON(object: any): QueryModuleAccountsResponse { return { - account: isSet(object.account) ? Any.fromJSON(object.account) : undefined, + accounts: Array.isArray(object?.accounts) + ? object.accounts.map((e: any) => Any.fromJSON(e)) + : [], }; }, - toJSON(message: QueryAccountResponse): unknown { + toJSON(message: QueryModuleAccountsResponse): unknown { const obj: any = {}; - message.account !== undefined && - (obj.account = message.account ? Any.toJSON(message.account) : undefined); + if (message.accounts) { + obj.accounts = message.accounts.map(e => (e ? Any.toJSON(e) : undefined)); + } else { + obj.accounts = []; + } return obj; }, - fromPartial(object: Partial): QueryAccountResponse { - const message = createBaseQueryAccountResponse(); - message.account = - object.account !== undefined && object.account !== null - ? Any.fromPartial(object.account) - : undefined; + fromPartial( + object: Partial, + ): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; return message; }, - fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse { - return QueryAccountResponse.decode(message.value); + fromProtoMsg( + message: QueryModuleAccountsResponseProtoMsg, + ): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.decode(message.value); }, - toProto(message: QueryAccountResponse): Uint8Array { - return QueryAccountResponse.encode(message).finish(); + toProto(message: QueryModuleAccountsResponse): Uint8Array { + return QueryModuleAccountsResponse.encode(message).finish(); }, - toProtoMsg(message: QueryAccountResponse): QueryAccountResponseProtoMsg { + toProtoMsg( + message: QueryModuleAccountsResponse, + ): QueryModuleAccountsResponseProtoMsg { return { - typeUrl: '/cosmos.auth.v1beta1.QueryAccountResponse', - value: QueryAccountResponse.encode(message).finish(), + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsResponse', + value: QueryModuleAccountsResponse.encode(message).finish(), }; }, }; -function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; +function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { + return { + name: '', + }; } -export const QueryParamsRequest = { - typeUrl: '/cosmos.auth.v1beta1.QueryParamsRequest', +export const QueryModuleAccountByNameRequest = { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest', encode( - _: QueryParamsRequest, + message: QueryModuleAccountByNameRequest, writer: BinaryWriter = BinaryWriter.create(), ): BinaryWriter { + if (message.name !== '') { + writer.uint32(10).string(message.name); + } return writer; }, decode( input: BinaryReader | Uint8Array, length?: number, - ): QueryParamsRequest { + ): QueryModuleAccountByNameRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); + const message = createBaseQueryModuleAccountByNameRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -652,59 +923,69 @@ export const QueryParamsRequest = { } return message; }, - fromJSON(_: any): QueryParamsRequest { - return {}; + fromJSON(object: any): QueryModuleAccountByNameRequest { + return { + name: isSet(object.name) ? String(object.name) : '', + }; }, - toJSON(_: QueryParamsRequest): unknown { + toJSON(message: QueryModuleAccountByNameRequest): unknown { const obj: any = {}; + message.name !== undefined && (obj.name = message.name); return obj; }, - fromPartial(_: Partial): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); + fromPartial( + object: Partial, + ): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + message.name = object.name ?? ''; return message; }, - fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { - return QueryParamsRequest.decode(message.value); + fromProtoMsg( + message: QueryModuleAccountByNameRequestProtoMsg, + ): QueryModuleAccountByNameRequest { + return QueryModuleAccountByNameRequest.decode(message.value); }, - toProto(message: QueryParamsRequest): Uint8Array { - return QueryParamsRequest.encode(message).finish(); + toProto(message: QueryModuleAccountByNameRequest): Uint8Array { + return QueryModuleAccountByNameRequest.encode(message).finish(); }, - toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + toProtoMsg( + message: QueryModuleAccountByNameRequest, + ): QueryModuleAccountByNameRequestProtoMsg { return { - typeUrl: '/cosmos.auth.v1beta1.QueryParamsRequest', - value: QueryParamsRequest.encode(message).finish(), + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest', + value: QueryModuleAccountByNameRequest.encode(message).finish(), }; }, }; -function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { +function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { return { - accounts: [], + account: undefined, }; } -export const QueryModuleAccountsResponse = { - typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsResponse', +export const QueryModuleAccountByNameResponse = { + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse', encode( - message: QueryModuleAccountsResponse, + message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create(), ): BinaryWriter { - for (const v of message.accounts) { - Any.encode(v! as Any, writer.uint32(10).fork()).ldelim(); + if (message.account !== undefined) { + Any.encode(message.account as Any, writer.uint32(10).fork()).ldelim(); } return writer; }, decode( input: BinaryReader | Uint8Array, length?: number, - ): QueryModuleAccountsResponse { + ): QueryModuleAccountByNameResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountsResponse(); + const message = createBaseQueryModuleAccountByNameResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push(Any.decode(reader, reader.uint32()) as Any); + message.account = ModuleAccountI_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -713,43 +994,41 @@ export const QueryModuleAccountsResponse = { } return message; }, - fromJSON(object: any): QueryModuleAccountsResponse { + fromJSON(object: any): QueryModuleAccountByNameResponse { return { - accounts: Array.isArray(object?.accounts) - ? object.accounts.map((e: any) => Any.fromJSON(e)) - : [], + account: isSet(object.account) ? Any.fromJSON(object.account) : undefined, }; }, - toJSON(message: QueryModuleAccountsResponse): unknown { + toJSON(message: QueryModuleAccountByNameResponse): unknown { const obj: any = {}; - if (message.accounts) { - obj.accounts = message.accounts.map(e => (e ? Any.toJSON(e) : undefined)); - } else { - obj.accounts = []; - } + message.account !== undefined && + (obj.account = message.account ? Any.toJSON(message.account) : undefined); return obj; }, fromPartial( - object: Partial, - ): QueryModuleAccountsResponse { - const message = createBaseQueryModuleAccountsResponse(); - message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; + object: Partial, + ): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + message.account = + object.account !== undefined && object.account !== null + ? Any.fromPartial(object.account) + : undefined; return message; }, fromProtoMsg( - message: QueryModuleAccountsResponseProtoMsg, - ): QueryModuleAccountsResponse { - return QueryModuleAccountsResponse.decode(message.value); + message: QueryModuleAccountByNameResponseProtoMsg, + ): QueryModuleAccountByNameResponse { + return QueryModuleAccountByNameResponse.decode(message.value); }, - toProto(message: QueryModuleAccountsResponse): Uint8Array { - return QueryModuleAccountsResponse.encode(message).finish(); + toProto(message: QueryModuleAccountByNameResponse): Uint8Array { + return QueryModuleAccountByNameResponse.encode(message).finish(); }, toProtoMsg( - message: QueryModuleAccountsResponse, - ): QueryModuleAccountsResponseProtoMsg { + message: QueryModuleAccountByNameResponse, + ): QueryModuleAccountByNameResponseProtoMsg { return { - typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsResponse', - value: QueryModuleAccountsResponse.encode(message).finish(), + typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse', + value: QueryModuleAccountByNameResponse.encode(message).finish(), }; }, }; @@ -1178,7 +1457,155 @@ export const AddressStringToBytesResponse = { }; }, }; -export const Cosmos_authAccountI_InterfaceDecoder = ( +function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { + return { + id: BigInt(0), + }; +} +export const QueryAccountAddressByIDRequest = { + 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: 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(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountAddressByIDRequest { + return { + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), + }; + }, + toJSON(message: QueryAccountAddressByIDRequest): unknown { + const obj: any = {}; + 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 + ? BigInt(object.id.toString()) + : BigInt(0); + return message; + }, + fromProtoMsg( + message: QueryAccountAddressByIDRequestProtoMsg, + ): QueryAccountAddressByIDRequest { + return QueryAccountAddressByIDRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDRequest): Uint8Array { + return QueryAccountAddressByIDRequest.encode(message).finish(); + }, + toProtoMsg( + message: QueryAccountAddressByIDRequest, + ): QueryAccountAddressByIDRequestProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest', + value: QueryAccountAddressByIDRequest.encode(message).finish(), + }; + }, +}; +function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDResponse { + return { + accountAddress: '', + }; +} +export const QueryAccountAddressByIDResponse = { + 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: 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) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountAddressByIDResponse { + return { + accountAddress: isSet(object.accountAddress) + ? String(object.accountAddress) + : '', + }; + }, + toJSON(message: QueryAccountAddressByIDResponse): unknown { + const obj: any = {}; + message.accountAddress !== undefined && + (obj.accountAddress = message.accountAddress); + return obj; + }, + fromPartial( + object: Partial, + ): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + message.accountAddress = object.accountAddress ?? ''; + return message; + }, + fromProtoMsg( + message: QueryAccountAddressByIDResponseProtoMsg, + ): QueryAccountAddressByIDResponse { + return QueryAccountAddressByIDResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDResponse): Uint8Array { + return QueryAccountAddressByIDResponse.encode(message).finish(); + }, + toProtoMsg( + message: QueryAccountAddressByIDResponse, + ): QueryAccountAddressByIDResponseProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse', + value: QueryAccountAddressByIDResponse.encode(message).finish(), + }; + }, +}; +export const AccountI_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): BaseAccount | Any => { const reader = @@ -1191,7 +1618,7 @@ export const Cosmos_authAccountI_InterfaceDecoder = ( return data; } }; -export const Cosmos_authModuleAccountI_InterfaceDecoder = ( +export const ModuleAccountI_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): ModuleAccount | Any => { const reader = diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts index ac9f38c5bf3..edd0f19a161 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -214,9 +214,7 @@ export const Grant = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authorization = Cosmos_authzAuthorization_InterfaceDecoder( - reader, - ) as Any; + message.authorization = Authorization_InterfaceDecoder(reader) as Any; break; case 2: message.expiration = fromTimestamp( @@ -324,9 +322,7 @@ export const GrantAuthorization = { message.grantee = reader.string(); break; case 3: - message.authorization = Cosmos_authzAuthorization_InterfaceDecoder( - reader, - ) as Any; + message.authorization = Authorization_InterfaceDecoder(reader) as Any; break; case 4: message.expiration = fromTimestamp( @@ -456,7 +452,7 @@ export const GrantQueueItem = { }; }, }; -export const Cosmos_authzAuthorization_InterfaceDecoder = ( +export const Authorization_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): GenericAuthorization | SendAuthorization | StakeAuthorization | Any => { const reader = diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts index ae5b631bf73..3f7e60b377b 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts @@ -1,8 +1,6 @@ //@ts-nocheck -import { Grant, GrantSDKType, GenericAuthorization } from './authz.js'; +import { Grant, GrantSDKType } from './authz.js'; import { Any, AnySDKType } from '../../../google/protobuf/any.js'; -import { SendAuthorization } from '../../bank/v1beta1/authz.js'; -import { StakeAuthorization } from '../../staking/v1beta1/authz.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../../helpers.js'; /** @@ -531,19 +529,13 @@ export const Sdk_Msg_InterfaceDecoder = ( return data; } }; -export const Cosmos_authzAuthorization_InterfaceDecoder = ( +export const Authz_Authorization_InterfaceDecoder = ( input: BinaryReader | Uint8Array, -): GenericAuthorization | SendAuthorization | StakeAuthorization | Any => { +): 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': - return GenericAuthorization.decode(data.value); - case '/cosmos.bank.v1beta1.SendAuthorization': - return SendAuthorization.decode(data.value); - case '/cosmos.staking.v1beta1.StakeAuthorization': - return StakeAuthorization.decode(data.value); default: return data; } diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts index 1b6edf95469..2872f3fe459 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts @@ -79,6 +79,8 @@ export interface QueryAllBalancesResponseSDKType { /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesRequest { /** address is the address to query spendable balances for. */ @@ -93,6 +95,8 @@ export interface QuerySpendableBalancesRequestProtoMsg { /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesRequestSDKType { address: string; @@ -101,6 +105,8 @@ export interface QuerySpendableBalancesRequestSDKType { /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesResponse { /** balances is the spendable balances of all the coins. */ @@ -115,6 +121,8 @@ export interface QuerySpendableBalancesResponseProtoMsg { /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesResponseSDKType { balances: CoinSDKType[]; @@ -310,6 +318,8 @@ export interface QueryDenomOwnersRequestSDKType { * DenomOwner defines structure representing an account that owns or holds a * particular denominated token. It contains the account address and account * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 */ export interface DenomOwner { /** address defines the address that owns a particular denomination. */ @@ -325,12 +335,18 @@ export interface DenomOwnerProtoMsg { * DenomOwner defines structure representing an account that owns or holds a * particular denominated token. It contains the account address and account * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 */ export interface DenomOwnerSDKType { address: string; balance: CoinSDKType; } -/** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryDenomOwnersResponse { denomOwners: DenomOwner[]; /** pagination defines the pagination in the response. */ @@ -340,7 +356,11 @@ export interface QueryDenomOwnersResponseProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QueryDenomOwnersResponse'; value: Uint8Array; } -/** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryDenomOwnersResponseSDKType { denom_owners: DenomOwnerSDKType[]; pagination?: PageResponseSDKType; diff --git a/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts b/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts index 961b0a68ace..84731513a38 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts @@ -46,7 +46,7 @@ export interface TxResponse { /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 diff --git a/packages/cosmic-proto/src/codegen/cosmos/base/node/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/base/node/v1beta1/query.ts new file mode 100644 index 00000000000..b0cd69351d0 --- /dev/null +++ b/packages/cosmic-proto/src/codegen/cosmos/base/node/v1beta1/query.ts @@ -0,0 +1,138 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary.js'; +import { isSet } from '../../../../helpers.js'; +/** ConfigRequest defines the request structure for the Config gRPC query. */ +export interface ConfigRequest {} +export interface ConfigRequestProtoMsg { + typeUrl: '/cosmos.base.node.v1beta1.ConfigRequest'; + value: Uint8Array; +} +/** ConfigRequest defines the request structure for the Config gRPC query. */ +export interface ConfigRequestSDKType {} +/** ConfigResponse defines the response structure for the Config gRPC query. */ +export interface ConfigResponse { + minimumGasPrice: string; +} +export interface ConfigResponseProtoMsg { + typeUrl: '/cosmos.base.node.v1beta1.ConfigResponse'; + value: Uint8Array; +} +/** ConfigResponse defines the response structure for the Config gRPC query. */ +export interface ConfigResponseSDKType { + minimum_gas_price: string; +} +function createBaseConfigRequest(): ConfigRequest { + return {}; +} +export const ConfigRequest = { + typeUrl: '/cosmos.base.node.v1beta1.ConfigRequest', + encode( + _: ConfigRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + return writer; + }, + 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) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): ConfigRequest { + return {}; + }, + toJSON(_: ConfigRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): ConfigRequest { + const message = createBaseConfigRequest(); + return message; + }, + fromProtoMsg(message: ConfigRequestProtoMsg): ConfigRequest { + return ConfigRequest.decode(message.value); + }, + toProto(message: ConfigRequest): Uint8Array { + return ConfigRequest.encode(message).finish(); + }, + toProtoMsg(message: ConfigRequest): ConfigRequestProtoMsg { + return { + typeUrl: '/cosmos.base.node.v1beta1.ConfigRequest', + value: ConfigRequest.encode(message).finish(), + }; + }, +}; +function createBaseConfigResponse(): ConfigResponse { + return { + minimumGasPrice: '', + }; +} +export const ConfigResponse = { + 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: 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) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minimumGasPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConfigResponse { + return { + minimumGasPrice: isSet(object.minimumGasPrice) + ? String(object.minimumGasPrice) + : '', + }; + }, + toJSON(message: ConfigResponse): unknown { + const obj: any = {}; + message.minimumGasPrice !== undefined && + (obj.minimumGasPrice = message.minimumGasPrice); + return obj; + }, + fromPartial(object: Partial): ConfigResponse { + const message = createBaseConfigResponse(); + message.minimumGasPrice = object.minimumGasPrice ?? ''; + return message; + }, + fromProtoMsg(message: ConfigResponseProtoMsg): ConfigResponse { + return ConfigResponse.decode(message.value); + }, + toProto(message: ConfigResponse): Uint8Array { + return ConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: ConfigResponse): ConfigResponseProtoMsg { + return { + typeUrl: '/cosmos.base.node.v1beta1.ConfigResponse', + value: ConfigResponse.encode(message).finish(), + }; + }, +}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/bundle.ts b/packages/cosmic-proto/src/codegen/cosmos/bundle.ts index e672c1e36a7..7a9d55a8823 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bundle.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bundle.ts @@ -13,54 +13,55 @@ import * as _27 from './bank/v1beta1/genesis.js'; import * as _28 from './bank/v1beta1/query.js'; import * as _29 from './bank/v1beta1/tx.js'; import * as _30 from './base/abci/v1beta1/abci.js'; -import * as _31 from './base/query/v1beta1/pagination.js'; -import * as _32 from './base/reflection/v2alpha1/reflection.js'; -import * as _33 from './base/v1beta1/coin.js'; -import * as _34 from './crypto/ed25519/keys.js'; -import * as _35 from './crypto/hd/v1/hd.js'; -import * as _36 from './crypto/keyring/v1/record.js'; -import * as _37 from './crypto/multisig/keys.js'; -import * as _38 from './crypto/secp256k1/keys.js'; -import * as _39 from './crypto/secp256r1/keys.js'; -import * as _40 from './distribution/v1beta1/distribution.js'; -import * as _41 from './distribution/v1beta1/genesis.js'; -import * as _42 from './distribution/v1beta1/query.js'; -import * as _43 from './distribution/v1beta1/tx.js'; -import * as _44 from './feegrant/v1beta1/feegrant.js'; -import * as _45 from './feegrant/v1beta1/genesis.js'; -import * as _46 from './feegrant/v1beta1/query.js'; -import * as _47 from './feegrant/v1beta1/tx.js'; -import * as _48 from './gov/v1/genesis.js'; -import * as _49 from './gov/v1/gov.js'; -import * as _50 from './gov/v1/query.js'; -import * as _51 from './gov/v1/tx.js'; -import * as _52 from './gov/v1beta1/genesis.js'; -import * as _53 from './gov/v1beta1/gov.js'; -import * as _54 from './gov/v1beta1/query.js'; -import * as _55 from './gov/v1beta1/tx.js'; -import * as _56 from './group/v1/events.js'; -import * as _57 from './group/v1/genesis.js'; -import * as _58 from './group/v1/query.js'; -import * as _59 from './group/v1/tx.js'; -import * as _60 from './group/v1/types.js'; -import * as _61 from './mint/v1beta1/genesis.js'; -import * as _62 from './mint/v1beta1/mint.js'; -import * as _63 from './mint/v1beta1/query.js'; -import * as _64 from './params/v1beta1/params.js'; -import * as _65 from './params/v1beta1/query.js'; -import * as _66 from './staking/v1beta1/authz.js'; -import * as _67 from './staking/v1beta1/genesis.js'; -import * as _68 from './staking/v1beta1/query.js'; -import * as _69 from './staking/v1beta1/staking.js'; -import * as _70 from './staking/v1beta1/tx.js'; -import * as _71 from './tx/signing/v1beta1/signing.js'; -import * as _72 from './tx/v1beta1/service.js'; -import * as _73 from './tx/v1beta1/tx.js'; -import * as _74 from './upgrade/v1beta1/query.js'; -import * as _75 from './upgrade/v1beta1/tx.js'; -import * as _76 from './upgrade/v1beta1/upgrade.js'; -import * as _77 from './vesting/v1beta1/tx.js'; -import * as _78 from './vesting/v1beta1/vesting.js'; +import * as _31 from './base/node/v1beta1/query.js'; +import * as _32 from './base/query/v1beta1/pagination.js'; +import * as _33 from './base/reflection/v2alpha1/reflection.js'; +import * as _34 from './base/v1beta1/coin.js'; +import * as _35 from './crypto/ed25519/keys.js'; +import * as _36 from './crypto/hd/v1/hd.js'; +import * as _37 from './crypto/keyring/v1/record.js'; +import * as _38 from './crypto/multisig/keys.js'; +import * as _39 from './crypto/secp256k1/keys.js'; +import * as _40 from './crypto/secp256r1/keys.js'; +import * as _41 from './distribution/v1beta1/distribution.js'; +import * as _42 from './distribution/v1beta1/genesis.js'; +import * as _43 from './distribution/v1beta1/query.js'; +import * as _44 from './distribution/v1beta1/tx.js'; +import * as _45 from './feegrant/v1beta1/feegrant.js'; +import * as _46 from './feegrant/v1beta1/genesis.js'; +import * as _47 from './feegrant/v1beta1/query.js'; +import * as _48 from './feegrant/v1beta1/tx.js'; +import * as _49 from './gov/v1/genesis.js'; +import * as _50 from './gov/v1/gov.js'; +import * as _51 from './gov/v1/query.js'; +import * as _52 from './gov/v1/tx.js'; +import * as _53 from './gov/v1beta1/genesis.js'; +import * as _54 from './gov/v1beta1/gov.js'; +import * as _55 from './gov/v1beta1/query.js'; +import * as _56 from './gov/v1beta1/tx.js'; +import * as _57 from './group/v1/events.js'; +import * as _58 from './group/v1/genesis.js'; +import * as _59 from './group/v1/query.js'; +import * as _60 from './group/v1/tx.js'; +import * as _61 from './group/v1/types.js'; +import * as _62 from './mint/v1beta1/genesis.js'; +import * as _63 from './mint/v1beta1/mint.js'; +import * as _64 from './mint/v1beta1/query.js'; +import * as _65 from './params/v1beta1/params.js'; +import * as _66 from './params/v1beta1/query.js'; +import * as _67 from './staking/v1beta1/authz.js'; +import * as _68 from './staking/v1beta1/genesis.js'; +import * as _69 from './staking/v1beta1/query.js'; +import * as _70 from './staking/v1beta1/staking.js'; +import * as _71 from './staking/v1beta1/tx.js'; +import * as _72 from './tx/signing/v1beta1/signing.js'; +import * as _73 from './tx/v1beta1/service.js'; +import * as _74 from './tx/v1beta1/tx.js'; +import * as _75 from './upgrade/v1beta1/query.js'; +import * as _76 from './upgrade/v1beta1/tx.js'; +import * as _77 from './upgrade/v1beta1/upgrade.js'; +import * as _78 from './vesting/v1beta1/tx.js'; +import * as _79 from './vesting/v1beta1/vesting.js'; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -93,127 +94,132 @@ export namespace cosmos { ..._30, }; } - export namespace query { + export namespace node { export const v1beta1 = { ..._31, }; } + export namespace query { + export const v1beta1 = { + ..._32, + }; + } export namespace reflection { export const v2alpha1 = { - ..._32, + ..._33, }; } export const v1beta1 = { - ..._33, + ..._34, }; } export namespace crypto { export const ed25519 = { - ..._34, + ..._35, }; export namespace hd { export const v1 = { - ..._35, + ..._36, }; } export namespace keyring { export const v1 = { - ..._36, + ..._37, }; } export const multisig = { - ..._37, + ..._38, }; export const secp256k1 = { - ..._38, + ..._39, }; export const secp256r1 = { - ..._39, + ..._40, }; } export namespace distribution { export const v1beta1 = { - ..._40, ..._41, ..._42, ..._43, + ..._44, }; } export namespace feegrant { export const v1beta1 = { - ..._44, ..._45, ..._46, ..._47, + ..._48, }; } export namespace gov { export const v1 = { - ..._48, ..._49, ..._50, ..._51, + ..._52, }; export const v1beta1 = { - ..._52, ..._53, ..._54, ..._55, + ..._56, }; } export namespace group { export const v1 = { - ..._56, ..._57, ..._58, ..._59, ..._60, + ..._61, }; } export namespace mint { export const v1beta1 = { - ..._61, ..._62, ..._63, + ..._64, }; } export namespace params { export const v1beta1 = { - ..._64, ..._65, + ..._66, }; } export namespace staking { export const v1beta1 = { - ..._66, ..._67, ..._68, ..._69, ..._70, + ..._71, }; } export namespace tx { export namespace signing { export const v1beta1 = { - ..._71, + ..._72, }; } export const v1beta1 = { - ..._72, ..._73, + ..._74, }; } export namespace upgrade { export const v1beta1 = { - ..._74, ..._75, ..._76, + ..._77, }; } export namespace vesting { export const v1beta1 = { - ..._77, ..._78, + ..._79, }; } } diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts index 293bdbe8e33..043d8dc657d 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts @@ -9,13 +9,13 @@ export interface Record { name: string; /** pub_key represents a public key in any format */ pubKey?: Any; - /** local stores the public information about a locally stored key */ + /** local stores the private key locally. */ local?: Record_Local; - /** ledger stores the public information about a Ledger key */ + /** ledger stores the information about a Ledger key. */ ledger?: Record_Ledger; - /** Multi does not store any information. */ + /** Multi does not store any other information. */ multi?: Record_Multi; - /** Offline does not store any information. */ + /** Offline does not store any other information. */ offline?: Record_Offline; } export interface RecordProtoMsg { @@ -37,7 +37,6 @@ export interface RecordSDKType { */ export interface Record_Local { privKey?: Any; - privKeyType: string; } export interface Record_LocalProtoMsg { typeUrl: '/cosmos.crypto.keyring.v1.Local'; @@ -49,7 +48,6 @@ export interface Record_LocalProtoMsg { */ export interface Record_LocalSDKType { priv_key?: AnySDKType; - priv_key_type: string; } /** Ledger item */ export interface Record_Ledger { @@ -230,7 +228,6 @@ export const Record = { function createBaseRecord_Local(): Record_Local { return { privKey: undefined, - privKeyType: '', }; } export const Record_Local = { @@ -242,9 +239,6 @@ export const Record_Local = { if (message.privKey !== undefined) { Any.encode(message.privKey, writer.uint32(10).fork()).ldelim(); } - if (message.privKeyType !== '') { - writer.uint32(18).string(message.privKeyType); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Record_Local { @@ -258,9 +252,6 @@ export const Record_Local = { case 1: message.privKey = Any.decode(reader, reader.uint32()); break; - case 2: - message.privKeyType = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -271,15 +262,12 @@ export const Record_Local = { fromJSON(object: any): Record_Local { return { privKey: isSet(object.privKey) ? Any.fromJSON(object.privKey) : undefined, - privKeyType: isSet(object.privKeyType) ? String(object.privKeyType) : '', }; }, toJSON(message: Record_Local): unknown { const obj: any = {}; message.privKey !== undefined && (obj.privKey = message.privKey ? Any.toJSON(message.privKey) : undefined); - message.privKeyType !== undefined && - (obj.privKeyType = message.privKeyType); return obj; }, fromPartial(object: Partial): Record_Local { @@ -288,7 +276,6 @@ export const Record_Local = { object.privKey !== undefined && object.privKey !== null ? Any.fromPartial(object.privKey) : undefined; - message.privKeyType = object.privKeyType ?? ''; return message; }, fromProtoMsg(message: Record_LocalProtoMsg): Record_Local { diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts index ac708857dca..45ea5d2317f 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts @@ -52,6 +52,7 @@ export interface MsgWithdrawDelegatorRewardSDKType { } /** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ export interface MsgWithdrawDelegatorRewardResponse { + /** Since: cosmos-sdk 0.46 */ amount: Coin[]; } export interface MsgWithdrawDelegatorRewardResponseProtoMsg { @@ -82,6 +83,7 @@ export interface MsgWithdrawValidatorCommissionSDKType { } /** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ export interface MsgWithdrawValidatorCommissionResponse { + /** Since: cosmos-sdk 0.46 */ amount: Coin[]; } export interface MsgWithdrawValidatorCommissionResponseProtoMsg { diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts index 4abdaf33c9d..9eeb42ff75c 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts @@ -14,14 +14,14 @@ import { fromJsonTimestamp, } from '../../../helpers.js'; /** - * BasicAllowance implements Allowance with a one-time grant of tokens + * 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?: '/cosmos.feegrant.v1beta1.BasicAllowance'; /** - * spend_limit specifies the maximum amount of tokens that can be spent - * by this allowance and will be updated as tokens are spent. If it is + * 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 * empty, there is no spend limit and any amount of coins can be spent. */ spendLimit: Coin[]; @@ -33,7 +33,7 @@ export interface BasicAllowanceProtoMsg { value: Uint8Array; } /** - * BasicAllowance implements Allowance with a one-time grant of tokens + * 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 BasicAllowanceSDKType { @@ -402,9 +402,7 @@ export const AllowedMsgAllowance = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.allowance = Cosmos_feegrantFeeAllowanceI_InterfaceDecoder( - reader, - ) as Any; + message.allowance = FeeAllowanceI_InterfaceDecoder(reader) as Any; break; case 2: message.allowedMessages.push(reader.string()); @@ -500,9 +498,7 @@ export const Grant = { message.grantee = reader.string(); break; case 3: - message.allowance = Cosmos_feegrantFeeAllowanceI_InterfaceDecoder( - reader, - ) as Any; + message.allowance = FeeAllowanceI_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -553,7 +549,7 @@ export const Grant = { }; }, }; -export const Cosmos_feegrantFeeAllowanceI_InterfaceDecoder = ( +export const FeeAllowanceI_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { const reader = diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts index 4cfc27c9c67..cec82bfab4c 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts @@ -68,7 +68,11 @@ export interface QueryAllowancesResponseSDKType { allowances: GrantSDKType[]; pagination?: PageResponseSDKType; } -/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterRequest { granter: string; /** pagination defines an pagination for the request. */ @@ -78,12 +82,20 @@ export interface QueryAllowancesByGranterRequestProtoMsg { typeUrl: '/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest'; value: Uint8Array; } -/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterRequestSDKType { granter: string; pagination?: PageRequestSDKType; } -/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterResponse { /** allowances that have been issued by the granter. */ allowances: Grant[]; @@ -94,7 +106,11 @@ export interface QueryAllowancesByGranterResponseProtoMsg { typeUrl: '/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse'; value: Uint8Array; } -/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterResponseSDKType { allowances: GrantSDKType[]; pagination?: PageResponseSDKType; diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts index 83dffbcf63a..bc8a0a5be4e 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts @@ -113,9 +113,7 @@ export const MsgGrantAllowance = { message.grantee = reader.string(); break; case 3: - message.allowance = Cosmos_feegrantFeeAllowanceI_InterfaceDecoder( - reader, - ) as Any; + message.allowance = FeeAllowanceI_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -359,7 +357,7 @@ export const MsgRevokeAllowanceResponse = { }; }, }; -export const Cosmos_feegrantFeeAllowanceI_InterfaceDecoder = ( +export const FeeAllowanceI_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { const reader = diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts index dedb2493a84..036677bf93e 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts @@ -70,7 +70,7 @@ export function voteOptionToJSON(object: VoteOption): string { } /** ProposalStatus enumerates the valid statuses of a proposal. */ export enum ProposalStatus { - /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ PROPOSAL_STATUS_UNSPECIFIED = 0, /** * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts index 54e70dda194..8273ad09bdb 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts @@ -98,7 +98,7 @@ export interface QueryProposalsResponseSDKType { export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; - /** voter defines the oter address for the proposals. */ + /** voter defines the voter address for the proposals. */ voter: string; } export interface QueryVoteRequestProtoMsg { diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts index 0583c7ec1e0..7490091d930 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts @@ -8,29 +8,7 @@ import { voteOptionFromJSON, voteOptionToJSON, } from './gov.js'; -import { - CommunityPoolSpendProposal, - CommunityPoolSpendProposalSDKType, - CommunityPoolSpendProposalWithDeposit, - CommunityPoolSpendProposalWithDepositSDKType, -} from '../../distribution/v1beta1/distribution.js'; import { TextProposal, TextProposalSDKType } from '../v1beta1/gov.js'; -import { - ParameterChangeProposal, - ParameterChangeProposalSDKType, -} from '../../params/v1beta1/params.js'; -import { - SoftwareUpgradeProposal, - SoftwareUpgradeProposalSDKType, - CancelSoftwareUpgradeProposal, - CancelSoftwareUpgradeProposalSDKType, -} from '../../upgrade/v1beta1/upgrade.js'; -import { - ClientUpdateProposal, - ClientUpdateProposalSDKType, - UpgradeProposal, - UpgradeProposalSDKType, -} from '../../../ibc/core/client/v1/client.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -76,17 +54,7 @@ export interface MsgSubmitProposalResponseSDKType { */ export interface MsgExecLegacyContent { /** content is the proposal's content. */ - content?: - | (CommunityPoolSpendProposal & - CommunityPoolSpendProposalWithDeposit & - TextProposal & - ParameterChangeProposal & - SoftwareUpgradeProposal & - CancelSoftwareUpgradeProposal & - ClientUpdateProposal & - UpgradeProposal & - Any) - | undefined; + content?: (TextProposal & Any) | undefined; /** authority must be the gov module address. */ authority: string; } @@ -99,17 +67,7 @@ export interface MsgExecLegacyContentProtoMsg { * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentSDKType { - content?: - | CommunityPoolSpendProposalSDKType - | CommunityPoolSpendProposalWithDepositSDKType - | TextProposalSDKType - | ParameterChangeProposalSDKType - | SoftwareUpgradeProposalSDKType - | CancelSoftwareUpgradeProposalSDKType - | ClientUpdateProposalSDKType - | UpgradeProposalSDKType - | AnySDKType - | undefined; + content?: TextProposalSDKType | AnySDKType | undefined; authority: string; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ @@ -412,9 +370,7 @@ export const MsgExecLegacyContent = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = Cosmos_govv1beta1Content_InterfaceDecoder( - reader, - ) as Any; + message.content = Content_InterfaceDecoder(reader) as Any; break; case 2: message.authority = reader.string(); @@ -982,38 +938,15 @@ export const MsgDepositResponse = { }; }, }; -export const Cosmos_govv1beta1Content_InterfaceDecoder = ( +export const Content_InterfaceDecoder = ( input: BinaryReader | Uint8Array, -): - | CommunityPoolSpendProposal - | CommunityPoolSpendProposalWithDeposit - | TextProposal - | ParameterChangeProposal - | SoftwareUpgradeProposal - | CancelSoftwareUpgradeProposal - | ClientUpdateProposal - | UpgradeProposal - | Any => { +): TextProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': - return CommunityPoolSpendProposal.decode(data.value); - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': - return CommunityPoolSpendProposalWithDeposit.decode(data.value); case '/cosmos.gov.v1beta1.TextProposal': return TextProposal.decode(data.value); - case '/cosmos.params.v1beta1.ParameterChangeProposal': - return ParameterChangeProposal.decode(data.value); - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': - return SoftwareUpgradeProposal.decode(data.value); - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': - return CancelSoftwareUpgradeProposal.decode(data.value); - case '/ibc.core.client.v1.ClientUpdateProposal': - return ClientUpdateProposal.decode(data.value); - case '/ibc.core.client.v1.UpgradeProposal': - return UpgradeProposal.decode(data.value); default: return data; } diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts index ef7aa729053..3c82002acc1 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -6,28 +6,6 @@ import { Duration, DurationSDKType, } from '../../../google/protobuf/duration.js'; -import { - CommunityPoolSpendProposal, - CommunityPoolSpendProposalSDKType, - CommunityPoolSpendProposalWithDeposit, - CommunityPoolSpendProposalWithDepositSDKType, -} from '../../distribution/v1beta1/distribution.js'; -import { - ParameterChangeProposal, - ParameterChangeProposalSDKType, -} from '../../params/v1beta1/params.js'; -import { - SoftwareUpgradeProposal, - SoftwareUpgradeProposalSDKType, - CancelSoftwareUpgradeProposal, - CancelSoftwareUpgradeProposalSDKType, -} from '../../upgrade/v1beta1/upgrade.js'; -import { - ClientUpdateProposal, - ClientUpdateProposalSDKType, - UpgradeProposal, - UpgradeProposalSDKType, -} from '../../../ibc/core/client/v1/client.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { Decimal } from '@cosmjs/math'; import { @@ -95,7 +73,7 @@ export function voteOptionToJSON(object: VoteOption): string { } /** ProposalStatus enumerates the valid statuses of a proposal. */ export enum ProposalStatus { - /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ PROPOSAL_STATUS_UNSPECIFIED = 0, /** * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit @@ -239,17 +217,7 @@ export interface DepositSDKType { /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { proposalId: bigint; - content?: - | (TextProposal & - CommunityPoolSpendProposal & - CommunityPoolSpendProposalWithDeposit & - ParameterChangeProposal & - SoftwareUpgradeProposal & - CancelSoftwareUpgradeProposal & - ClientUpdateProposal & - UpgradeProposal & - Any) - | undefined; + content?: (TextProposal & Any) | undefined; status: ProposalStatus; /** * final_tally_result is the final tally result of the proposal. When @@ -270,17 +238,7 @@ export interface ProposalProtoMsg { /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { proposal_id: bigint; - content?: - | TextProposalSDKType - | CommunityPoolSpendProposalSDKType - | CommunityPoolSpendProposalWithDepositSDKType - | ParameterChangeProposalSDKType - | SoftwareUpgradeProposalSDKType - | CancelSoftwareUpgradeProposalSDKType - | ClientUpdateProposalSDKType - | UpgradeProposalSDKType - | AnySDKType - | undefined; + content?: TextProposalSDKType | AnySDKType | undefined; status: ProposalStatus; final_tally_result: TallyResultSDKType; submit_time: Date; @@ -717,9 +675,7 @@ export const Proposal = { message.proposalId = reader.uint64(); break; case 2: - message.content = Cosmos_govv1beta1Content_InterfaceDecoder( - reader, - ) as Any; + message.content = Content_InterfaceDecoder(reader) as Any; break; case 3: message.status = reader.int32() as any; @@ -1314,38 +1270,15 @@ export const TallyParams = { }; }, }; -export const Cosmos_govv1beta1Content_InterfaceDecoder = ( +export const Content_InterfaceDecoder = ( input: BinaryReader | Uint8Array, -): - | CommunityPoolSpendProposal - | CommunityPoolSpendProposalWithDeposit - | TextProposal - | ParameterChangeProposal - | SoftwareUpgradeProposal - | CancelSoftwareUpgradeProposal - | ClientUpdateProposal - | UpgradeProposal - | Any => { +): TextProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': - return CommunityPoolSpendProposal.decode(data.value); - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': - return CommunityPoolSpendProposalWithDeposit.decode(data.value); case '/cosmos.gov.v1beta1.TextProposal': return TextProposal.decode(data.value); - case '/cosmos.params.v1beta1.ParameterChangeProposal': - return ParameterChangeProposal.decode(data.value); - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': - return SoftwareUpgradeProposal.decode(data.value); - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': - return CancelSoftwareUpgradeProposal.decode(data.value); - case '/ibc.core.client.v1.ClientUpdateProposal': - return ClientUpdateProposal.decode(data.value); - case '/ibc.core.client.v1.UpgradeProposal': - return UpgradeProposal.decode(data.value); default: return data; } diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts index 8505b1bed41..ef9960c5ea3 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts @@ -98,7 +98,7 @@ export interface QueryProposalsResponseSDKType { export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; - /** voter defines the oter address for the proposals. */ + /** voter defines the voter address for the proposals. */ voter: string; } export interface QueryVoteRequestProtoMsg { diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts index aaaaa69b5a9..0bfb0a456ed 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -10,28 +10,6 @@ import { voteOptionFromJSON, voteOptionToJSON, } from './gov.js'; -import { - CommunityPoolSpendProposal, - CommunityPoolSpendProposalSDKType, - CommunityPoolSpendProposalWithDeposit, - CommunityPoolSpendProposalWithDepositSDKType, -} from '../../distribution/v1beta1/distribution.js'; -import { - ParameterChangeProposal, - ParameterChangeProposalSDKType, -} from '../../params/v1beta1/params.js'; -import { - SoftwareUpgradeProposal, - SoftwareUpgradeProposalSDKType, - CancelSoftwareUpgradeProposal, - CancelSoftwareUpgradeProposalSDKType, -} from '../../upgrade/v1beta1/upgrade.js'; -import { - ClientUpdateProposal, - ClientUpdateProposalSDKType, - UpgradeProposal, - UpgradeProposalSDKType, -} from '../../../ibc/core/client/v1/client.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -39,17 +17,7 @@ import { isSet } from '../../../helpers.js'; * proposal Content. */ export interface MsgSubmitProposal { - content?: - | (CommunityPoolSpendProposal & - CommunityPoolSpendProposalWithDeposit & - TextProposal & - ParameterChangeProposal & - SoftwareUpgradeProposal & - CancelSoftwareUpgradeProposal & - ClientUpdateProposal & - UpgradeProposal & - Any) - | undefined; + content?: (TextProposal & Any) | undefined; initialDeposit: Coin[]; proposer: string; } @@ -62,17 +30,7 @@ export interface MsgSubmitProposalProtoMsg { * proposal Content. */ export interface MsgSubmitProposalSDKType { - content?: - | CommunityPoolSpendProposalSDKType - | CommunityPoolSpendProposalWithDepositSDKType - | TextProposalSDKType - | ParameterChangeProposalSDKType - | SoftwareUpgradeProposalSDKType - | CancelSoftwareUpgradeProposalSDKType - | ClientUpdateProposalSDKType - | UpgradeProposalSDKType - | AnySDKType - | undefined; + content?: TextProposalSDKType | AnySDKType | undefined; initial_deposit: CoinSDKType[]; proposer: string; } @@ -209,9 +167,7 @@ export const MsgSubmitProposal = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = Cosmos_govv1beta1Content_InterfaceDecoder( - reader, - ) as Any; + message.content = Content_InterfaceDecoder(reader) as Any; break; case 2: message.initialDeposit.push(Coin.decode(reader, reader.uint32())); @@ -792,38 +748,15 @@ export const MsgDepositResponse = { }; }, }; -export const Cosmos_govv1beta1Content_InterfaceDecoder = ( +export const Content_InterfaceDecoder = ( input: BinaryReader | Uint8Array, -): - | CommunityPoolSpendProposal - | CommunityPoolSpendProposalWithDeposit - | TextProposal - | ParameterChangeProposal - | SoftwareUpgradeProposal - | CancelSoftwareUpgradeProposal - | ClientUpdateProposal - | UpgradeProposal - | Any => { +): TextProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); switch (data.typeUrl) { - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': - return CommunityPoolSpendProposal.decode(data.value); - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': - return CommunityPoolSpendProposalWithDeposit.decode(data.value); case '/cosmos.gov.v1beta1.TextProposal': return TextProposal.decode(data.value); - case '/cosmos.params.v1beta1.ParameterChangeProposal': - return ParameterChangeProposal.decode(data.value); - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': - return SoftwareUpgradeProposal.decode(data.value); - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': - return CancelSoftwareUpgradeProposal.decode(data.value); - case '/ibc.core.client.v1.ClientUpdateProposal': - return ClientUpdateProposal.decode(data.value); - case '/ibc.core.client.v1.UpgradeProposal': - return UpgradeProposal.decode(data.value); default: return data; } diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts index fd2577ef7dd..da15ee7716b 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts @@ -1,8 +1,13 @@ //@ts-nocheck import { ProposalExecutorResult, + ProposalStatus, + TallyResult, + TallyResultSDKType, proposalExecutorResultFromJSON, proposalExecutorResultToJSON, + proposalStatusFromJSON, + proposalStatusToJSON, } from './types.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; @@ -103,6 +108,8 @@ export interface EventExec { proposalId: bigint; /** result is the proposal execution result. */ result: ProposalExecutorResult; + /** logs contains error logs in case the execution result is FAILURE. */ + logs: string; } export interface EventExecProtoMsg { typeUrl: '/cosmos.group.v1.EventExec'; @@ -112,6 +119,7 @@ export interface EventExecProtoMsg { export interface EventExecSDKType { proposal_id: bigint; result: ProposalExecutorResult; + logs: string; } /** EventLeaveGroup is an event emitted when group member leaves the group. */ export interface EventLeaveGroup { @@ -129,6 +137,25 @@ export interface EventLeaveGroupSDKType { group_id: bigint; address: string; } +/** EventProposalPruned is an event emitted when a proposal is pruned. */ +export interface EventProposalPruned { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; + /** status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). */ + status: ProposalStatus; + /** tally_result is the proposal tally result (when applicable). */ + tallyResult?: TallyResult; +} +export interface EventProposalPrunedProtoMsg { + typeUrl: '/cosmos.group.v1.EventProposalPruned'; + value: Uint8Array; +} +/** EventProposalPruned is an event emitted when a proposal is pruned. */ +export interface EventProposalPrunedSDKType { + proposal_id: bigint; + status: ProposalStatus; + tally_result?: TallyResultSDKType; +} function createBaseEventCreateGroup(): EventCreateGroup { return { groupId: BigInt(0), @@ -613,6 +640,7 @@ function createBaseEventExec(): EventExec { return { proposalId: BigInt(0), result: 0, + logs: '', }; } export const EventExec = { @@ -627,6 +655,9 @@ export const EventExec = { if (message.result !== 0) { writer.uint32(16).int32(message.result); } + if (message.logs !== '') { + writer.uint32(26).string(message.logs); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventExec { @@ -643,6 +674,9 @@ export const EventExec = { case 2: message.result = reader.int32() as any; break; + case 3: + message.logs = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -658,6 +692,7 @@ export const EventExec = { result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1, + logs: isSet(object.logs) ? String(object.logs) : '', }; }, toJSON(message: EventExec): unknown { @@ -666,6 +701,7 @@ export const EventExec = { (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 { @@ -675,6 +711,7 @@ export const EventExec = { ? BigInt(object.proposalId.toString()) : BigInt(0); message.result = object.result ?? 0; + message.logs = object.logs ?? ''; return message; }, fromProtoMsg(message: EventExecProtoMsg): EventExec { @@ -768,3 +805,106 @@ export const EventLeaveGroup = { }; }, }; +function createBaseEventProposalPruned(): EventProposalPruned { + return { + proposalId: BigInt(0), + status: 0, + tallyResult: undefined, + }; +} +export const EventProposalPruned = { + typeUrl: '/cosmos.group.v1.EventProposalPruned', + encode( + message: EventProposalPruned, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.status !== 0) { + writer.uint32(16).int32(message.status); + } + if (message.tallyResult !== undefined) { + TallyResult.encode( + message.tallyResult, + writer.uint32(26).fork(), + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): EventProposalPruned { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventProposalPruned(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.status = reader.int32() as any; + break; + case 3: + message.tallyResult = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EventProposalPruned { + return { + proposalId: isSet(object.proposalId) + ? BigInt(object.proposalId.toString()) + : BigInt(0), + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + tallyResult: isSet(object.tallyResult) + ? TallyResult.fromJSON(object.tallyResult) + : undefined, + }; + }, + toJSON(message: EventProposalPruned): unknown { + const obj: any = {}; + message.proposalId !== undefined && + (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + message.status !== undefined && + (obj.status = proposalStatusToJSON(message.status)); + message.tallyResult !== undefined && + (obj.tallyResult = message.tallyResult + ? TallyResult.toJSON(message.tallyResult) + : undefined); + return obj; + }, + fromPartial(object: Partial): EventProposalPruned { + const message = createBaseEventProposalPruned(); + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0); + message.status = object.status ?? 0; + message.tallyResult = + object.tallyResult !== undefined && object.tallyResult !== null + ? TallyResult.fromPartial(object.tallyResult) + : undefined; + return message; + }, + fromProtoMsg(message: EventProposalPrunedProtoMsg): EventProposalPruned { + return EventProposalPruned.decode(message.value); + }, + toProto(message: EventProposalPruned): Uint8Array { + return EventProposalPruned.encode(message).finish(); + }, + toProtoMsg(message: EventProposalPruned): EventProposalPrunedProtoMsg { + return { + typeUrl: '/cosmos.group.v1.EventProposalPruned', + value: EventProposalPruned.encode(message).finish(), + }; + }, +}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts index dd639469481..02b5660dac4 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts @@ -410,6 +410,51 @@ export interface QueryTallyResultResponseProtoMsg { export interface QueryTallyResultResponseSDKType { tally: TallyResultSDKType; } +/** + * QueryGroupsRequest is the Query/Groups request type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupsRequestProtoMsg { + typeUrl: '/cosmos.group.v1.QueryGroupsRequest'; + value: Uint8Array; +} +/** + * QueryGroupsRequest is the Query/Groups request type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryGroupsResponse is the Query/Groups response type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsResponse { + /** `groups` is all the groups present in state. */ + groups: GroupInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupsResponseProtoMsg { + typeUrl: '/cosmos.group.v1.QueryGroupsResponse'; + value: Uint8Array; +} +/** + * QueryGroupsResponse is the Query/Groups response type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsResponseSDKType { + groups: GroupInfoSDKType[]; + pagination?: PageResponseSDKType; +} function createBaseQueryGroupInfoRequest(): QueryGroupInfoRequest { return { groupId: BigInt(0), @@ -2698,3 +2743,170 @@ export const QueryTallyResultResponse = { }; }, }; +function createBaseQueryGroupsRequest(): QueryGroupsRequest { + return { + pagination: undefined, + }; +} +export const QueryGroupsRequest = { + typeUrl: '/cosmos.group.v1.QueryGroupsRequest', + encode( + message: QueryGroupsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): QueryGroupsRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryGroupsRequest { + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + toJSON(message: QueryGroupsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + fromPartial(object: Partial): QueryGroupsRequest { + const message = createBaseQueryGroupsRequest(); + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, + fromProtoMsg(message: QueryGroupsRequestProtoMsg): QueryGroupsRequest { + return QueryGroupsRequest.decode(message.value); + }, + toProto(message: QueryGroupsRequest): Uint8Array { + return QueryGroupsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsRequest): QueryGroupsRequestProtoMsg { + return { + typeUrl: '/cosmos.group.v1.QueryGroupsRequest', + value: QueryGroupsRequest.encode(message).finish(), + }; + }, +}; +function createBaseQueryGroupsResponse(): QueryGroupsResponse { + return { + groups: [], + pagination: undefined, + }; +} +export const QueryGroupsResponse = { + typeUrl: '/cosmos.group.v1.QueryGroupsResponse', + encode( + message: QueryGroupsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): QueryGroupsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryGroupsResponse { + return { + groups: Array.isArray(object?.groups) + ? object.groups.map((e: any) => GroupInfo.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + toJSON(message: QueryGroupsResponse): unknown { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => + e ? GroupInfo.toJSON(e) : undefined, + ); + } else { + obj.groups = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + fromPartial(object: Partial): QueryGroupsResponse { + const message = createBaseQueryGroupsResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, + fromProtoMsg(message: QueryGroupsResponseProtoMsg): QueryGroupsResponse { + return QueryGroupsResponse.decode(message.value); + }, + toProto(message: QueryGroupsResponse): Uint8Array { + return QueryGroupsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsResponse): QueryGroupsResponseProtoMsg { + return { + typeUrl: '/cosmos.group.v1.QueryGroupsResponse', + value: QueryGroupsResponse.encode(message).finish(), + }; + }, +}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts index b73c9db7622..ed9cb60b370 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts @@ -1,14 +1,13 @@ //@ts-nocheck import { - Member, - MemberSDKType, + MemberRequest, + MemberRequestSDKType, VoteOption, - ThresholdDecisionPolicy, - ThresholdDecisionPolicySDKType, - PercentageDecisionPolicy, - PercentageDecisionPolicySDKType, + ProposalExecutorResult, voteOptionFromJSON, voteOptionToJSON, + proposalExecutorResultFromJSON, + proposalExecutorResultToJSON, } from './types.js'; import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -60,7 +59,7 @@ export interface MsgCreateGroup { /** admin is the account address of the group admin. */ admin: string; /** members defines the group members. */ - members: Member[]; + members: MemberRequest[]; /** metadata is any arbitrary metadata to attached to the group. */ metadata: string; } @@ -71,7 +70,7 @@ export interface MsgCreateGroupProtoMsg { /** MsgCreateGroup is the Msg/CreateGroup request type. */ export interface MsgCreateGroupSDKType { admin: string; - members: MemberSDKType[]; + members: MemberRequestSDKType[]; metadata: string; } /** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ @@ -97,7 +96,7 @@ export interface MsgUpdateGroupMembers { * member_updates is the list of members to update, * set weight to 0 to remove a member. */ - memberUpdates: Member[]; + memberUpdates: MemberRequest[]; } export interface MsgUpdateGroupMembersProtoMsg { typeUrl: '/cosmos.group.v1.MsgUpdateGroupMembers'; @@ -107,7 +106,7 @@ export interface MsgUpdateGroupMembersProtoMsg { export interface MsgUpdateGroupMembersSDKType { admin: string; group_id: bigint; - member_updates: MemberSDKType[]; + member_updates: MemberRequestSDKType[]; } /** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ export interface MsgUpdateGroupMembersResponse {} @@ -180,9 +179,7 @@ export interface MsgCreateGroupPolicy { /** 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?: Any | undefined; } export interface MsgCreateGroupPolicyProtoMsg { typeUrl: '/cosmos.group.v1.MsgCreateGroupPolicy'; @@ -193,11 +190,7 @@ export interface MsgCreateGroupPolicySDKType { admin: string; group_id: bigint; metadata: string; - decision_policy?: - | ThresholdDecisionPolicySDKType - | PercentageDecisionPolicySDKType - | AnySDKType - | undefined; + decision_policy?: AnySDKType | undefined; } /** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ export interface MsgCreateGroupPolicyResponse { @@ -216,8 +209,8 @@ export interface MsgCreateGroupPolicyResponseSDKType { export interface MsgUpdateGroupPolicyAdmin { /** admin is the account address of the group admin. */ admin: string; - /** address is the account address of the group policy. */ - address: string; + /** group_policy_address is the account address of the group policy. */ + groupPolicyAddress: string; /** new_admin is the new group policy admin. */ newAdmin: string; } @@ -228,7 +221,7 @@ export interface MsgUpdateGroupPolicyAdminProtoMsg { /** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ export interface MsgUpdateGroupPolicyAdminSDKType { admin: string; - address: string; + group_policy_address: string; new_admin: string; } /** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ @@ -236,17 +229,18 @@ export interface MsgCreateGroupWithPolicy { /** admin is the account address of the group and group policy admin. */ admin: string; /** members defines the group members. */ - members: Member[]; + members: MemberRequest[]; /** group_metadata is any arbitrary metadata attached to the group. */ groupMetadata: string; /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ groupPolicyMetadata: string; - /** group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. */ + /** + * group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + * and group policy admin. + */ groupPolicyAsAdmin: boolean; /** decision_policy specifies the group policy's decision policy. */ - decisionPolicy?: - | (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) - | undefined; + decisionPolicy?: Any | undefined; } export interface MsgCreateGroupWithPolicyProtoMsg { typeUrl: '/cosmos.group.v1.MsgCreateGroupWithPolicy'; @@ -255,15 +249,11 @@ export interface MsgCreateGroupWithPolicyProtoMsg { /** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ export interface MsgCreateGroupWithPolicySDKType { admin: string; - members: MemberSDKType[]; + members: MemberRequestSDKType[]; group_metadata: string; group_policy_metadata: string; group_policy_as_admin: boolean; - decision_policy?: - | ThresholdDecisionPolicySDKType - | PercentageDecisionPolicySDKType - | AnySDKType - | undefined; + decision_policy?: AnySDKType | undefined; } /** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ export interface MsgCreateGroupWithPolicyResponse { @@ -293,12 +283,10 @@ export interface MsgUpdateGroupPolicyAdminResponseSDKType {} export interface MsgUpdateGroupPolicyDecisionPolicy { /** admin is the account address of the group admin. */ admin: string; - /** address is the account address of group policy. */ - address: string; + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; /** decision_policy is the updated group policy's decision policy. */ - decisionPolicy?: - | (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) - | undefined; + decisionPolicy?: Any | undefined; } export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy'; @@ -307,12 +295,8 @@ export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { /** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ export interface MsgUpdateGroupPolicyDecisionPolicySDKType { admin: string; - address: string; - decision_policy?: - | ThresholdDecisionPolicySDKType - | PercentageDecisionPolicySDKType - | AnySDKType - | undefined; + group_policy_address: string; + decision_policy?: AnySDKType | undefined; } /** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ export interface MsgUpdateGroupPolicyDecisionPolicyResponse {} @@ -326,8 +310,8 @@ export interface MsgUpdateGroupPolicyDecisionPolicyResponseSDKType {} export interface MsgUpdateGroupPolicyMetadata { /** admin is the account address of the group admin. */ admin: string; - /** address is the account address of group policy. */ - address: string; + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; /** metadata is the updated group policy metadata. */ metadata: string; } @@ -338,7 +322,7 @@ export interface MsgUpdateGroupPolicyMetadataProtoMsg { /** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ export interface MsgUpdateGroupPolicyMetadataSDKType { admin: string; - address: string; + group_policy_address: string; metadata: string; } /** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ @@ -351,8 +335,8 @@ export interface MsgUpdateGroupPolicyMetadataResponseProtoMsg { export interface MsgUpdateGroupPolicyMetadataResponseSDKType {} /** MsgSubmitProposal is the Msg/SubmitProposal request type. */ export interface MsgSubmitProposal { - /** address is the account address of group policy. */ - address: string; + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; /** * proposers are the account addresses of the proposers. * Proposers signatures will be counted as yes votes. @@ -375,7 +359,7 @@ export interface MsgSubmitProposalProtoMsg { } /** MsgSubmitProposal is the Msg/SubmitProposal request type. */ export interface MsgSubmitProposalSDKType { - address: string; + group_policy_address: string; proposers: string[]; metadata: string; messages: AnySDKType[]; @@ -458,8 +442,8 @@ export interface MsgVoteResponseSDKType {} export interface MsgExec { /** proposal is the unique ID of the proposal. */ proposalId: bigint; - /** signer is the account address used to execute the proposal. */ - signer: string; + /** executor is the account address used to execute the proposal. */ + executor: string; } export interface MsgExecProtoMsg { typeUrl: '/cosmos.group.v1.MsgExec'; @@ -468,16 +452,21 @@ export interface MsgExecProtoMsg { /** MsgExec is the Msg/Exec request type. */ export interface MsgExecSDKType { proposal_id: bigint; - signer: string; + executor: string; } /** MsgExecResponse is the Msg/Exec request type. */ -export interface MsgExecResponse {} +export interface MsgExecResponse { + /** result is the final result of the proposal execution. */ + result: ProposalExecutorResult; +} export interface MsgExecResponseProtoMsg { typeUrl: '/cosmos.group.v1.MsgExecResponse'; value: Uint8Array; } /** MsgExecResponse is the Msg/Exec request type. */ -export interface MsgExecResponseSDKType {} +export interface MsgExecResponseSDKType { + result: ProposalExecutorResult; +} /** MsgLeaveGroup is the Msg/LeaveGroup request type. */ export interface MsgLeaveGroup { /** address is the account address of the group member. */ @@ -519,7 +508,7 @@ export const MsgCreateGroup = { writer.uint32(10).string(message.admin); } for (const v of message.members) { - Member.encode(v!, writer.uint32(18).fork()).ldelim(); + MemberRequest.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.metadata !== '') { writer.uint32(26).string(message.metadata); @@ -538,7 +527,7 @@ export const MsgCreateGroup = { message.admin = reader.string(); break; case 2: - message.members.push(Member.decode(reader, reader.uint32())); + message.members.push(MemberRequest.decode(reader, reader.uint32())); break; case 3: message.metadata = reader.string(); @@ -554,7 +543,7 @@ export const MsgCreateGroup = { return { admin: isSet(object.admin) ? String(object.admin) : '', members: Array.isArray(object?.members) - ? object.members.map((e: any) => Member.fromJSON(e)) + ? object.members.map((e: any) => MemberRequest.fromJSON(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : '', }; @@ -564,7 +553,7 @@ export const MsgCreateGroup = { message.admin !== undefined && (obj.admin = message.admin); if (message.members) { obj.members = message.members.map(e => - e ? Member.toJSON(e) : undefined, + e ? MemberRequest.toJSON(e) : undefined, ); } else { obj.members = []; @@ -575,7 +564,8 @@ export const MsgCreateGroup = { fromPartial(object: Partial): MsgCreateGroup { const message = createBaseMsgCreateGroup(); message.admin = object.admin ?? ''; - message.members = object.members?.map(e => Member.fromPartial(e)) || []; + message.members = + object.members?.map(e => MemberRequest.fromPartial(e)) || []; message.metadata = object.metadata ?? ''; return message; }, @@ -685,7 +675,7 @@ export const MsgUpdateGroupMembers = { writer.uint32(16).uint64(message.groupId); } for (const v of message.memberUpdates) { - Member.encode(v!, writer.uint32(26).fork()).ldelim(); + MemberRequest.encode(v!, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -707,7 +697,9 @@ export const MsgUpdateGroupMembers = { message.groupId = reader.uint64(); break; case 3: - message.memberUpdates.push(Member.decode(reader, reader.uint32())); + message.memberUpdates.push( + MemberRequest.decode(reader, reader.uint32()), + ); break; default: reader.skipType(tag & 7); @@ -723,7 +715,7 @@ export const MsgUpdateGroupMembers = { ? BigInt(object.groupId.toString()) : BigInt(0), memberUpdates: Array.isArray(object?.memberUpdates) - ? object.memberUpdates.map((e: any) => Member.fromJSON(e)) + ? object.memberUpdates.map((e: any) => MemberRequest.fromJSON(e)) : [], }; }, @@ -734,7 +726,7 @@ export const MsgUpdateGroupMembers = { (obj.groupId = (message.groupId || BigInt(0)).toString()); if (message.memberUpdates) { obj.memberUpdates = message.memberUpdates.map(e => - e ? Member.toJSON(e) : undefined, + e ? MemberRequest.toJSON(e) : undefined, ); } else { obj.memberUpdates = []; @@ -749,7 +741,7 @@ export const MsgUpdateGroupMembers = { ? BigInt(object.groupId.toString()) : BigInt(0); message.memberUpdates = - object.memberUpdates?.map(e => Member.fromPartial(e)) || []; + object.memberUpdates?.map(e => MemberRequest.fromPartial(e)) || []; return message; }, fromProtoMsg(message: MsgUpdateGroupMembersProtoMsg): MsgUpdateGroupMembers { @@ -1178,9 +1170,8 @@ export const MsgCreateGroupPolicy = { message.metadata = reader.string(); break; case 4: - message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder( - reader, - ) as Any; + message.decisionPolicy = + Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -1314,7 +1305,7 @@ export const MsgCreateGroupPolicyResponse = { function createBaseMsgUpdateGroupPolicyAdmin(): MsgUpdateGroupPolicyAdmin { return { admin: '', - address: '', + groupPolicyAddress: '', newAdmin: '', }; } @@ -1327,8 +1318,8 @@ export const MsgUpdateGroupPolicyAdmin = { if (message.admin !== '') { writer.uint32(10).string(message.admin); } - if (message.address !== '') { - writer.uint32(18).string(message.address); + if (message.groupPolicyAddress !== '') { + writer.uint32(18).string(message.groupPolicyAddress); } if (message.newAdmin !== '') { writer.uint32(26).string(message.newAdmin); @@ -1350,7 +1341,7 @@ export const MsgUpdateGroupPolicyAdmin = { message.admin = reader.string(); break; case 2: - message.address = reader.string(); + message.groupPolicyAddress = reader.string(); break; case 3: message.newAdmin = reader.string(); @@ -1365,14 +1356,17 @@ export const MsgUpdateGroupPolicyAdmin = { fromJSON(object: any): MsgUpdateGroupPolicyAdmin { return { admin: isSet(object.admin) ? String(object.admin) : '', - address: isSet(object.address) ? String(object.address) : '', + groupPolicyAddress: isSet(object.groupPolicyAddress) + ? String(object.groupPolicyAddress) + : '', newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : '', }; }, toJSON(message: MsgUpdateGroupPolicyAdmin): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.address !== undefined && (obj.address = message.address); + message.groupPolicyAddress !== undefined && + (obj.groupPolicyAddress = message.groupPolicyAddress); message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); return obj; }, @@ -1381,7 +1375,7 @@ export const MsgUpdateGroupPolicyAdmin = { ): MsgUpdateGroupPolicyAdmin { const message = createBaseMsgUpdateGroupPolicyAdmin(); message.admin = object.admin ?? ''; - message.address = object.address ?? ''; + message.groupPolicyAddress = object.groupPolicyAddress ?? ''; message.newAdmin = object.newAdmin ?? ''; return message; }, @@ -1422,7 +1416,7 @@ export const MsgCreateGroupWithPolicy = { writer.uint32(10).string(message.admin); } for (const v of message.members) { - Member.encode(v!, writer.uint32(18).fork()).ldelim(); + MemberRequest.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.groupMetadata !== '') { writer.uint32(26).string(message.groupMetadata); @@ -1456,7 +1450,7 @@ export const MsgCreateGroupWithPolicy = { message.admin = reader.string(); break; case 2: - message.members.push(Member.decode(reader, reader.uint32())); + message.members.push(MemberRequest.decode(reader, reader.uint32())); break; case 3: message.groupMetadata = reader.string(); @@ -1468,9 +1462,8 @@ export const MsgCreateGroupWithPolicy = { message.groupPolicyAsAdmin = reader.bool(); break; case 6: - message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder( - reader, - ) as Any; + message.decisionPolicy = + Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -1483,7 +1476,7 @@ export const MsgCreateGroupWithPolicy = { return { admin: isSet(object.admin) ? String(object.admin) : '', members: Array.isArray(object?.members) - ? object.members.map((e: any) => Member.fromJSON(e)) + ? object.members.map((e: any) => MemberRequest.fromJSON(e)) : [], groupMetadata: isSet(object.groupMetadata) ? String(object.groupMetadata) @@ -1504,7 +1497,7 @@ export const MsgCreateGroupWithPolicy = { message.admin !== undefined && (obj.admin = message.admin); if (message.members) { obj.members = message.members.map(e => - e ? Member.toJSON(e) : undefined, + e ? MemberRequest.toJSON(e) : undefined, ); } else { obj.members = []; @@ -1526,7 +1519,8 @@ export const MsgCreateGroupWithPolicy = { ): MsgCreateGroupWithPolicy { const message = createBaseMsgCreateGroupWithPolicy(); message.admin = object.admin ?? ''; - message.members = object.members?.map(e => Member.fromPartial(e)) || []; + message.members = + object.members?.map(e => MemberRequest.fromPartial(e)) || []; message.groupMetadata = object.groupMetadata ?? ''; message.groupPolicyMetadata = object.groupPolicyMetadata ?? ''; message.groupPolicyAsAdmin = object.groupPolicyAsAdmin ?? false; @@ -1705,7 +1699,7 @@ export const MsgUpdateGroupPolicyAdminResponse = { function createBaseMsgUpdateGroupPolicyDecisionPolicy(): MsgUpdateGroupPolicyDecisionPolicy { return { admin: '', - address: '', + groupPolicyAddress: '', decisionPolicy: undefined, }; } @@ -1718,8 +1712,8 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { if (message.admin !== '') { writer.uint32(10).string(message.admin); } - if (message.address !== '') { - writer.uint32(18).string(message.address); + if (message.groupPolicyAddress !== '') { + writer.uint32(18).string(message.groupPolicyAddress); } if (message.decisionPolicy !== undefined) { Any.encode( @@ -1744,12 +1738,11 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { message.admin = reader.string(); break; case 2: - message.address = reader.string(); + message.groupPolicyAddress = reader.string(); break; case 3: - message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder( - reader, - ) as Any; + message.decisionPolicy = + Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -1761,7 +1754,9 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { fromJSON(object: any): MsgUpdateGroupPolicyDecisionPolicy { return { admin: isSet(object.admin) ? String(object.admin) : '', - address: isSet(object.address) ? String(object.address) : '', + groupPolicyAddress: isSet(object.groupPolicyAddress) + ? String(object.groupPolicyAddress) + : '', decisionPolicy: isSet(object.decisionPolicy) ? Any.fromJSON(object.decisionPolicy) : undefined, @@ -1770,7 +1765,8 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { toJSON(message: MsgUpdateGroupPolicyDecisionPolicy): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.address !== undefined && (obj.address = message.address); + message.groupPolicyAddress !== undefined && + (obj.groupPolicyAddress = message.groupPolicyAddress); message.decisionPolicy !== undefined && (obj.decisionPolicy = message.decisionPolicy ? Any.toJSON(message.decisionPolicy) @@ -1782,7 +1778,7 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { ): MsgUpdateGroupPolicyDecisionPolicy { const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); message.admin = object.admin ?? ''; - message.address = object.address ?? ''; + message.groupPolicyAddress = object.groupPolicyAddress ?? ''; message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) @@ -1869,7 +1865,7 @@ export const MsgUpdateGroupPolicyDecisionPolicyResponse = { function createBaseMsgUpdateGroupPolicyMetadata(): MsgUpdateGroupPolicyMetadata { return { admin: '', - address: '', + groupPolicyAddress: '', metadata: '', }; } @@ -1882,8 +1878,8 @@ export const MsgUpdateGroupPolicyMetadata = { if (message.admin !== '') { writer.uint32(10).string(message.admin); } - if (message.address !== '') { - writer.uint32(18).string(message.address); + if (message.groupPolicyAddress !== '') { + writer.uint32(18).string(message.groupPolicyAddress); } if (message.metadata !== '') { writer.uint32(26).string(message.metadata); @@ -1905,7 +1901,7 @@ export const MsgUpdateGroupPolicyMetadata = { message.admin = reader.string(); break; case 2: - message.address = reader.string(); + message.groupPolicyAddress = reader.string(); break; case 3: message.metadata = reader.string(); @@ -1920,14 +1916,17 @@ export const MsgUpdateGroupPolicyMetadata = { fromJSON(object: any): MsgUpdateGroupPolicyMetadata { return { admin: isSet(object.admin) ? String(object.admin) : '', - address: isSet(object.address) ? String(object.address) : '', + groupPolicyAddress: isSet(object.groupPolicyAddress) + ? String(object.groupPolicyAddress) + : '', metadata: isSet(object.metadata) ? String(object.metadata) : '', }; }, toJSON(message: MsgUpdateGroupPolicyMetadata): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.address !== undefined && (obj.address = message.address); + message.groupPolicyAddress !== undefined && + (obj.groupPolicyAddress = message.groupPolicyAddress); message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, @@ -1936,7 +1935,7 @@ export const MsgUpdateGroupPolicyMetadata = { ): MsgUpdateGroupPolicyMetadata { const message = createBaseMsgUpdateGroupPolicyMetadata(); message.admin = object.admin ?? ''; - message.address = object.address ?? ''; + message.groupPolicyAddress = object.groupPolicyAddress ?? ''; message.metadata = object.metadata ?? ''; return message; }, @@ -2018,7 +2017,7 @@ export const MsgUpdateGroupPolicyMetadataResponse = { }; function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { - address: '', + groupPolicyAddress: '', proposers: [], metadata: '', messages: [], @@ -2031,8 +2030,8 @@ export const MsgSubmitProposal = { message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create(), ): BinaryWriter { - if (message.address !== '') { - writer.uint32(10).string(message.address); + if (message.groupPolicyAddress !== '') { + writer.uint32(10).string(message.groupPolicyAddress); } for (const v of message.proposers) { writer.uint32(18).string(v!); @@ -2057,7 +2056,7 @@ export const MsgSubmitProposal = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.address = reader.string(); + message.groupPolicyAddress = reader.string(); break; case 2: message.proposers.push(reader.string()); @@ -2080,7 +2079,9 @@ export const MsgSubmitProposal = { }, fromJSON(object: any): MsgSubmitProposal { return { - address: isSet(object.address) ? String(object.address) : '', + groupPolicyAddress: isSet(object.groupPolicyAddress) + ? String(object.groupPolicyAddress) + : '', proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], @@ -2093,7 +2094,8 @@ export const MsgSubmitProposal = { }, toJSON(message: MsgSubmitProposal): unknown { const obj: any = {}; - message.address !== undefined && (obj.address = message.address); + message.groupPolicyAddress !== undefined && + (obj.groupPolicyAddress = message.groupPolicyAddress); if (message.proposers) { obj.proposers = message.proposers.map(e => e); } else { @@ -2110,7 +2112,7 @@ export const MsgSubmitProposal = { }, fromPartial(object: Partial): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); - message.address = object.address ?? ''; + message.groupPolicyAddress = object.groupPolicyAddress ?? ''; message.proposers = object.proposers?.map(e => e) || []; message.metadata = object.metadata ?? ''; message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; @@ -2509,7 +2511,7 @@ export const MsgVoteResponse = { function createBaseMsgExec(): MsgExec { return { proposalId: BigInt(0), - signer: '', + executor: '', }; } export const MsgExec = { @@ -2521,8 +2523,8 @@ export const MsgExec = { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } - if (message.signer !== '') { - writer.uint32(18).string(message.signer); + if (message.executor !== '') { + writer.uint32(18).string(message.executor); } return writer; }, @@ -2538,7 +2540,7 @@ export const MsgExec = { message.proposalId = reader.uint64(); break; case 2: - message.signer = reader.string(); + message.executor = reader.string(); break; default: reader.skipType(tag & 7); @@ -2552,14 +2554,14 @@ export const MsgExec = { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), - signer: isSet(object.signer) ? String(object.signer) : '', + executor: isSet(object.executor) ? String(object.executor) : '', }; }, toJSON(message: MsgExec): unknown { const obj: any = {}; message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); - message.signer !== undefined && (obj.signer = message.signer); + message.executor !== undefined && (obj.executor = message.executor); return obj; }, fromPartial(object: Partial): MsgExec { @@ -2568,7 +2570,7 @@ export const MsgExec = { object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - message.signer = object.signer ?? ''; + message.executor = object.executor ?? ''; return message; }, fromProtoMsg(message: MsgExecProtoMsg): MsgExec { @@ -2585,14 +2587,19 @@ export const MsgExec = { }, }; function createBaseMsgExecResponse(): MsgExecResponse { - return {}; + return { + result: 0, + }; } export const MsgExecResponse = { typeUrl: '/cosmos.group.v1.MsgExecResponse', encode( - _: MsgExecResponse, + message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create(), ): BinaryWriter { + if (message.result !== 0) { + writer.uint32(16).int32(message.result); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { @@ -2603,6 +2610,9 @@ export const MsgExecResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 2: + message.result = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -2610,15 +2620,22 @@ export const MsgExecResponse = { } return message; }, - fromJSON(_: any): MsgExecResponse { - return {}; + fromJSON(object: any): MsgExecResponse { + return { + result: isSet(object.result) + ? proposalExecutorResultFromJSON(object.result) + : -1, + }; }, - toJSON(_: MsgExecResponse): unknown { + toJSON(message: MsgExecResponse): unknown { const obj: any = {}; + message.result !== undefined && + (obj.result = proposalExecutorResultToJSON(message.result)); return obj; }, - fromPartial(_: Partial): MsgExecResponse { + fromPartial(object: Partial): MsgExecResponse { const message = createBaseMsgExecResponse(); + message.result = object.result ?? 0; return message; }, fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { @@ -2765,17 +2782,13 @@ export const MsgLeaveGroupResponse = { }; }, }; -export const Cosmos_groupDecisionPolicy_InterfaceDecoder = ( +export const Cosmos_groupv1DecisionPolicy_InterfaceDecoder = ( input: BinaryReader | Uint8Array, -): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { +): 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': - return ThresholdDecisionPolicy.decode(data.value); - case '/cosmos.group.v1.PercentageDecisionPolicy': - return PercentageDecisionPolicy.decode(data.value); default: return data; } diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts index eb9b3d9720c..366d40b29d4 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts @@ -14,7 +14,10 @@ import { } from '../../../helpers.js'; /** VoteOption enumerates the valid vote options for a given proposal. */ export enum VoteOption { - /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + /** + * VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + * return an error. + */ VOTE_OPTION_UNSPECIFIED = 0, /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ VOTE_OPTION_YES = 1, @@ -71,17 +74,28 @@ export function voteOptionToJSON(object: VoteOption): string { export enum ProposalStatus { /** PROPOSAL_STATUS_UNSPECIFIED - An empty value is invalid and not allowed. */ PROPOSAL_STATUS_UNSPECIFIED = 0, - /** PROPOSAL_STATUS_SUBMITTED - Initial status of a proposal when persisted. */ + /** PROPOSAL_STATUS_SUBMITTED - Initial status of a proposal when submitted. */ PROPOSAL_STATUS_SUBMITTED = 1, - /** PROPOSAL_STATUS_CLOSED - Final status of a proposal when the final tally was executed. */ - PROPOSAL_STATUS_CLOSED = 2, - /** PROPOSAL_STATUS_ABORTED - Final status of a proposal when the group was modified before the final tally. */ - PROPOSAL_STATUS_ABORTED = 3, /** - * PROPOSAL_STATUS_WITHDRAWN - A proposal can be deleted before the voting start time by the owner. When this happens the final status - * is Withdrawn. + * PROPOSAL_STATUS_ACCEPTED - Final status of a proposal when the final tally is done and the outcome + * passes the group policy's decision policy. + */ + PROPOSAL_STATUS_ACCEPTED = 2, + /** + * PROPOSAL_STATUS_REJECTED - Final status of a proposal when the final tally is done and the outcome + * is rejected by the group policy's decision policy. */ - PROPOSAL_STATUS_WITHDRAWN = 4, + PROPOSAL_STATUS_REJECTED = 3, + /** + * PROPOSAL_STATUS_ABORTED - Final status of a proposal when the group policy is modified before the + * final tally. + */ + PROPOSAL_STATUS_ABORTED = 4, + /** + * PROPOSAL_STATUS_WITHDRAWN - A proposal can be withdrawn before the voting start time by the owner. + * When this happens the final status is Withdrawn. + */ + PROPOSAL_STATUS_WITHDRAWN = 5, UNRECOGNIZED = -1, } export const ProposalStatusSDKType = ProposalStatus; @@ -94,12 +108,15 @@ export function proposalStatusFromJSON(object: any): ProposalStatus { case 'PROPOSAL_STATUS_SUBMITTED': return ProposalStatus.PROPOSAL_STATUS_SUBMITTED; case 2: - case 'PROPOSAL_STATUS_CLOSED': - return ProposalStatus.PROPOSAL_STATUS_CLOSED; + case 'PROPOSAL_STATUS_ACCEPTED': + return ProposalStatus.PROPOSAL_STATUS_ACCEPTED; case 3: + case 'PROPOSAL_STATUS_REJECTED': + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 4: case 'PROPOSAL_STATUS_ABORTED': return ProposalStatus.PROPOSAL_STATUS_ABORTED; - case 4: + case 5: case 'PROPOSAL_STATUS_WITHDRAWN': return ProposalStatus.PROPOSAL_STATUS_WITHDRAWN; case -1: @@ -114,8 +131,10 @@ export function proposalStatusToJSON(object: ProposalStatus): string { return 'PROPOSAL_STATUS_UNSPECIFIED'; case ProposalStatus.PROPOSAL_STATUS_SUBMITTED: return 'PROPOSAL_STATUS_SUBMITTED'; - case ProposalStatus.PROPOSAL_STATUS_CLOSED: - return 'PROPOSAL_STATUS_CLOSED'; + case ProposalStatus.PROPOSAL_STATUS_ACCEPTED: + return 'PROPOSAL_STATUS_ACCEPTED'; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return 'PROPOSAL_STATUS_REJECTED'; case ProposalStatus.PROPOSAL_STATUS_ABORTED: return 'PROPOSAL_STATUS_ABORTED'; case ProposalStatus.PROPOSAL_STATUS_WITHDRAWN: @@ -125,54 +144,6 @@ export function proposalStatusToJSON(object: ProposalStatus): string { return 'UNRECOGNIZED'; } } -/** ProposalResult defines types of proposal results. */ -export enum ProposalResult { - /** PROPOSAL_RESULT_UNSPECIFIED - An empty value is invalid and not allowed */ - PROPOSAL_RESULT_UNSPECIFIED = 0, - /** PROPOSAL_RESULT_UNFINALIZED - Until a final tally has happened the status is unfinalized */ - PROPOSAL_RESULT_UNFINALIZED = 1, - /** PROPOSAL_RESULT_ACCEPTED - Final result of the tally */ - PROPOSAL_RESULT_ACCEPTED = 2, - /** PROPOSAL_RESULT_REJECTED - Final result of the tally */ - PROPOSAL_RESULT_REJECTED = 3, - UNRECOGNIZED = -1, -} -export const ProposalResultSDKType = ProposalResult; -export function proposalResultFromJSON(object: any): ProposalResult { - switch (object) { - case 0: - case 'PROPOSAL_RESULT_UNSPECIFIED': - return ProposalResult.PROPOSAL_RESULT_UNSPECIFIED; - case 1: - case 'PROPOSAL_RESULT_UNFINALIZED': - return ProposalResult.PROPOSAL_RESULT_UNFINALIZED; - case 2: - case 'PROPOSAL_RESULT_ACCEPTED': - return ProposalResult.PROPOSAL_RESULT_ACCEPTED; - case 3: - case 'PROPOSAL_RESULT_REJECTED': - return ProposalResult.PROPOSAL_RESULT_REJECTED; - case -1: - case 'UNRECOGNIZED': - default: - return ProposalResult.UNRECOGNIZED; - } -} -export function proposalResultToJSON(object: ProposalResult): string { - switch (object) { - case ProposalResult.PROPOSAL_RESULT_UNSPECIFIED: - return 'PROPOSAL_RESULT_UNSPECIFIED'; - case ProposalResult.PROPOSAL_RESULT_UNFINALIZED: - return 'PROPOSAL_RESULT_UNFINALIZED'; - case ProposalResult.PROPOSAL_RESULT_ACCEPTED: - return 'PROPOSAL_RESULT_ACCEPTED'; - case ProposalResult.PROPOSAL_RESULT_REJECTED: - return 'PROPOSAL_RESULT_REJECTED'; - case ProposalResult.UNRECOGNIZED: - default: - return 'UNRECOGNIZED'; - } -} /** ProposalExecutorResult defines types of proposal executor results. */ export enum ProposalExecutorResult { /** PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED - An empty value is not allowed. */ @@ -227,14 +198,14 @@ export function proposalExecutorResultToJSON( } /** * Member represents a group member with an account address, - * non-zero weight and metadata. + * non-zero weight, metadata and added_at timestamp. */ export interface Member { /** address is the member's account address. */ address: string; /** weight is the member's voting weight that should be greater than 0. */ weight: string; - /** metadata is any arbitrary metadata to attached to the member. */ + /** metadata is any arbitrary metadata attached to the member. */ metadata: string; /** added_at is a timestamp specifying when a member was added. */ addedAt: Date; @@ -245,7 +216,7 @@ export interface MemberProtoMsg { } /** * Member represents a group member with an account address, - * non-zero weight and metadata. + * non-zero weight, metadata and added_at timestamp. */ export interface MemberSDKType { address: string; @@ -253,23 +224,47 @@ export interface MemberSDKType { metadata: string; added_at: Date; } -/** Members defines a repeated slice of Member objects. */ -export interface Members { - /** members is the list of members. */ - members: Member[]; +/** + * MemberRequest represents a group member to be used in Msg server requests. + * Contrary to `Member`, it doesn't have any `added_at` field + * since this field cannot be set as part of requests. + */ +export interface MemberRequest { + /** address is the member's account address. */ + address: string; + /** weight is the member's voting weight that should be greater than 0. */ + weight: string; + /** metadata is any arbitrary metadata attached to the member. */ + metadata: string; } -export interface MembersProtoMsg { - typeUrl: '/cosmos.group.v1.Members'; +export interface MemberRequestProtoMsg { + typeUrl: '/cosmos.group.v1.MemberRequest'; value: Uint8Array; } -/** Members defines a repeated slice of Member objects. */ -export interface MembersSDKType { - members: MemberSDKType[]; +/** + * MemberRequest represents a group member to be used in Msg server requests. + * Contrary to `Member`, it doesn't have any `added_at` field + * since this field cannot be set as part of requests. + */ +export interface MemberRequestSDKType { + address: string; + weight: string; + metadata: string; } -/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ +/** + * ThresholdDecisionPolicy is a decision policy where a proposal passes when it + * satisfies the two following conditions: + * 1. The sum of all `YES` voters' weights is greater or equal than the defined + * `threshold`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ export interface ThresholdDecisionPolicy { $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 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; @@ -278,16 +273,33 @@ export interface ThresholdDecisionPolicyProtoMsg { typeUrl: '/cosmos.group.v1.ThresholdDecisionPolicy'; value: Uint8Array; } -/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ +/** + * ThresholdDecisionPolicy is a decision policy where a proposal passes when it + * satisfies the two following conditions: + * 1. The sum of all `YES` voters' weights is greater or equal than the defined + * `threshold`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ export interface ThresholdDecisionPolicySDKType { $typeUrl?: '/cosmos.group.v1.ThresholdDecisionPolicy'; threshold: string; windows?: DecisionPolicyWindowsSDKType; } -/** PercentageDecisionPolicy implements the DecisionPolicy interface */ +/** + * PercentageDecisionPolicy is a decision policy where a proposal passes when + * it satisfies the two following conditions: + * 1. The percentage of all `YES` voters' weights out of the total group weight + * is greater or equal than the given `percentage`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ export interface PercentageDecisionPolicy { $typeUrl?: '/cosmos.group.v1.PercentageDecisionPolicy'; - /** percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. */ + /** + * 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; @@ -296,7 +308,14 @@ export interface PercentageDecisionPolicyProtoMsg { typeUrl: '/cosmos.group.v1.PercentageDecisionPolicy'; value: Uint8Array; } -/** PercentageDecisionPolicy implements the DecisionPolicy interface */ +/** + * PercentageDecisionPolicy is a decision policy where a proposal passes when + * it satisfies the two following conditions: + * 1. The percentage of all `YES` voters' weights out of the total group weight + * is greater or equal than the given `percentage`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ export interface PercentageDecisionPolicySDKType { $typeUrl?: '/cosmos.group.v1.PercentageDecisionPolicy'; percentage: string; @@ -398,9 +417,7 @@ export interface GroupPolicyInfo { */ version: bigint; /** decision_policy specifies the group policy's decision policy. */ - decisionPolicy?: - | (ThresholdDecisionPolicy & PercentageDecisionPolicy & Any) - | undefined; + decisionPolicy?: Any | undefined; /** created_at is a timestamp specifying when a group policy was created. */ createdAt: Date; } @@ -415,11 +432,7 @@ export interface GroupPolicyInfoSDKType { admin: string; metadata: string; version: bigint; - decision_policy?: - | ThresholdDecisionPolicySDKType - | PercentageDecisionPolicySDKType - | AnySDKType - | undefined; + decision_policy?: AnySDKType | undefined; created_at: Date; } /** @@ -431,8 +444,8 @@ export interface GroupPolicyInfoSDKType { export interface Proposal { /** id is the unique id of the proposal. */ id: bigint; - /** address is the account address of group policy. */ - address: string; + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; /** metadata is any arbitrary metadata to attached to the proposal. */ metadata: string; /** proposers are the account addresses of the proposers. */ @@ -440,40 +453,37 @@ export interface Proposal { /** submit_time is a timestamp specifying when a proposal was submitted. */ submitTime: Date; /** - * group_version tracks the version of the group that this proposal corresponds to. - * When group membership is changed, existing proposals from previous group versions will become invalid. + * group_version tracks the version of the group at proposal submission. + * This field is here for informational purposes only. */ groupVersion: bigint; /** - * group_policy_version tracks the version of the group policy that this proposal corresponds to. - * When a decision policy is changed, existing proposals from previous policy versions will become invalid. + * 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: bigint; /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ status: ProposalStatus; - /** - * result is the final result based on the votes and election rule. Initial value is unfinalized. - * The result is persisted so that clients can always rely on this state and not have to replicate the logic. - */ - result: ProposalResult; /** * final_tally_result contains the sums of all weighted votes for this - * proposal for each vote option, after tallying. When querying a proposal - * via gRPC, this field is not populated until the proposal's voting period - * has ended. + * proposal for each vote option. It is empty at submission, and only + * populated after tallying, at voting period end or at proposal execution, + * whichever happens first. */ finalTallyResult: TallyResult; /** * voting_period_end is the timestamp before which voting must be done. * Unless a successfull MsgExec is called before (to execute a proposal whose * tally is successful before the voting period ends), tallying will be done - * at this point, and the `final_tally_result`, as well - * as `status` and `result` fields will be accordingly updated. + * at this point, and the `final_tally_result`and `status` fields will be + * accordingly updated. */ votingPeriodEnd: Date; - /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ + /** executor_result is the final result of the proposal execution. Initial value is NotRun. */ executorResult: ProposalExecutorResult; - /** messages is a list of Msgs that will be executed if the proposal passes. */ + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ messages: Any[]; } export interface ProposalProtoMsg { @@ -488,14 +498,13 @@ export interface ProposalProtoMsg { */ export interface ProposalSDKType { id: bigint; - address: string; + group_policy_address: string; metadata: string; proposers: string[]; submit_time: Date; group_version: bigint; group_policy_version: bigint; status: ProposalStatus; - result: ProposalResult; final_tally_result: TallyResultSDKType; voting_period_end: Date; executor_result: ProposalExecutorResult; @@ -507,7 +516,7 @@ export interface TallyResult { yesCount: string; /** abstain_count is the weighted sum of abstainers. */ abstainCount: string; - /** no is the weighted sum of no votes. */ + /** no_count is the weighted sum of no votes. */ noCount: string; /** no_with_veto_count is the weighted sum of veto. */ noWithVetoCount: string; @@ -648,32 +657,46 @@ export const Member = { }; }, }; -function createBaseMembers(): Members { +function createBaseMemberRequest(): MemberRequest { return { - members: [], + address: '', + weight: '', + metadata: '', }; } -export const Members = { - typeUrl: '/cosmos.group.v1.Members', +export const MemberRequest = { + typeUrl: '/cosmos.group.v1.MemberRequest', encode( - message: Members, + message: MemberRequest, writer: BinaryWriter = BinaryWriter.create(), ): BinaryWriter { - for (const v of message.members) { - Member.encode(v!, writer.uint32(10).fork()).ldelim(); + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + if (message.weight !== '') { + writer.uint32(18).string(message.weight); + } + if (message.metadata !== '') { + writer.uint32(26).string(message.metadata); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Members { + 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 = createBaseMembers(); + const message = createBaseMemberRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.members.push(Member.decode(reader, reader.uint32())); + message.address = reader.string(); + break; + case 2: + message.weight = reader.string(); + break; + case 3: + message.metadata = reader.string(); break; default: reader.skipType(tag & 7); @@ -682,39 +705,37 @@ export const Members = { } return message; }, - fromJSON(object: any): Members { + fromJSON(object: any): MemberRequest { return { - members: Array.isArray(object?.members) - ? object.members.map((e: any) => Member.fromJSON(e)) - : [], + address: isSet(object.address) ? String(object.address) : '', + weight: isSet(object.weight) ? String(object.weight) : '', + metadata: isSet(object.metadata) ? String(object.metadata) : '', }; }, - toJSON(message: Members): unknown { + toJSON(message: MemberRequest): unknown { const obj: any = {}; - if (message.members) { - obj.members = message.members.map(e => - e ? Member.toJSON(e) : undefined, - ); - } else { - obj.members = []; - } + message.address !== undefined && (obj.address = message.address); + message.weight !== undefined && (obj.weight = message.weight); + message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial(object: Partial): Members { - const message = createBaseMembers(); - message.members = object.members?.map(e => Member.fromPartial(e)) || []; + fromPartial(object: Partial): MemberRequest { + const message = createBaseMemberRequest(); + message.address = object.address ?? ''; + message.weight = object.weight ?? ''; + message.metadata = object.metadata ?? ''; return message; }, - fromProtoMsg(message: MembersProtoMsg): Members { - return Members.decode(message.value); + fromProtoMsg(message: MemberRequestProtoMsg): MemberRequest { + return MemberRequest.decode(message.value); }, - toProto(message: Members): Uint8Array { - return Members.encode(message).finish(); + toProto(message: MemberRequest): Uint8Array { + return MemberRequest.encode(message).finish(); }, - toProtoMsg(message: Members): MembersProtoMsg { + toProtoMsg(message: MemberRequest): MemberRequestProtoMsg { return { - typeUrl: '/cosmos.group.v1.Members', - value: Members.encode(message).finish(), + typeUrl: '/cosmos.group.v1.MemberRequest', + value: MemberRequest.encode(message).finish(), }; }, }; @@ -1287,9 +1308,8 @@ export const GroupPolicyInfo = { message.version = reader.uint64(); break; case 6: - message.decisionPolicy = Cosmos_groupDecisionPolicy_InterfaceDecoder( - reader, - ) as Any; + message.decisionPolicy = + Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; case 7: message.createdAt = fromTimestamp( @@ -1375,14 +1395,13 @@ export const GroupPolicyInfo = { function createBaseProposal(): Proposal { return { id: BigInt(0), - address: '', + groupPolicyAddress: '', metadata: '', proposers: [], submitTime: new Date(), groupVersion: BigInt(0), groupPolicyVersion: BigInt(0), status: 0, - result: 0, finalTallyResult: TallyResult.fromPartial({}), votingPeriodEnd: new Date(), executorResult: 0, @@ -1398,8 +1417,8 @@ export const Proposal = { if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } - if (message.address !== '') { - writer.uint32(18).string(message.address); + if (message.groupPolicyAddress !== '') { + writer.uint32(18).string(message.groupPolicyAddress); } if (message.metadata !== '') { writer.uint32(26).string(message.metadata); @@ -1422,26 +1441,23 @@ export const Proposal = { if (message.status !== 0) { writer.uint32(64).int32(message.status); } - if (message.result !== 0) { - writer.uint32(72).int32(message.result); - } if (message.finalTallyResult !== undefined) { TallyResult.encode( message.finalTallyResult, - writer.uint32(82).fork(), + writer.uint32(74).fork(), ).ldelim(); } if (message.votingPeriodEnd !== undefined) { Timestamp.encode( toTimestamp(message.votingPeriodEnd), - writer.uint32(90).fork(), + writer.uint32(82).fork(), ).ldelim(); } if (message.executorResult !== 0) { - writer.uint32(96).int32(message.executorResult); + writer.uint32(88).int32(message.executorResult); } for (const v of message.messages) { - Any.encode(v!, writer.uint32(106).fork()).ldelim(); + Any.encode(v!, writer.uint32(98).fork()).ldelim(); } return writer; }, @@ -1457,7 +1473,7 @@ export const Proposal = { message.id = reader.uint64(); break; case 2: - message.address = reader.string(); + message.groupPolicyAddress = reader.string(); break; case 3: message.metadata = reader.string(); @@ -1480,23 +1496,20 @@ export const Proposal = { message.status = reader.int32() as any; break; case 9: - message.result = reader.int32() as any; - break; - case 10: message.finalTallyResult = TallyResult.decode( reader, reader.uint32(), ); break; - case 11: + case 10: message.votingPeriodEnd = fromTimestamp( Timestamp.decode(reader, reader.uint32()), ); break; - case 12: + case 11: message.executorResult = reader.int32() as any; break; - case 13: + case 12: message.messages.push(Any.decode(reader, reader.uint32())); break; default: @@ -1509,7 +1522,9 @@ export const Proposal = { fromJSON(object: any): Proposal { return { id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), - address: isSet(object.address) ? String(object.address) : '', + 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)) @@ -1524,7 +1539,6 @@ export const Proposal = { ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0), status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, @@ -1542,7 +1556,8 @@ export const Proposal = { toJSON(message: Proposal): unknown { const obj: any = {}; message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); - message.address !== undefined && (obj.address = message.address); + message.groupPolicyAddress !== undefined && + (obj.groupPolicyAddress = message.groupPolicyAddress); message.metadata !== undefined && (obj.metadata = message.metadata); if (message.proposers) { obj.proposers = message.proposers.map(e => e); @@ -1559,8 +1574,6 @@ export const Proposal = { ).toString()); message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); - message.result !== undefined && - (obj.result = proposalResultToJSON(message.result)); message.finalTallyResult !== undefined && (obj.finalTallyResult = message.finalTallyResult ? TallyResult.toJSON(message.finalTallyResult) @@ -1584,7 +1597,7 @@ export const Proposal = { object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); - message.address = object.address ?? ''; + message.groupPolicyAddress = object.groupPolicyAddress ?? ''; message.metadata = object.metadata ?? ''; message.proposers = object.proposers?.map(e => e) || []; message.submitTime = object.submitTime ?? undefined; @@ -1598,7 +1611,6 @@ export const Proposal = { ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0); message.status = object.status ?? 0; - message.result = object.result ?? 0; message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) @@ -1836,17 +1848,13 @@ export const Vote = { }; }, }; -export const Cosmos_groupDecisionPolicy_InterfaceDecoder = ( +export const Cosmos_groupv1DecisionPolicy_InterfaceDecoder = ( input: BinaryReader | Uint8Array, -): ThresholdDecisionPolicy | PercentageDecisionPolicy | Any => { +): 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': - return ThresholdDecisionPolicy.decode(data.value); - case '/cosmos.group.v1.PercentageDecisionPolicy': - return PercentageDecisionPolicy.decode(data.value); default: return data; } diff --git a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts index 2dd6c5737b7..dadb8fd9b18 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts @@ -34,6 +34,8 @@ export interface QueryParamsResponseSDKType { /** * QuerySubspacesRequest defines a request type for querying for all registered * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySubspacesRequest {} export interface QuerySubspacesRequestProtoMsg { @@ -43,11 +45,15 @@ export interface QuerySubspacesRequestProtoMsg { /** * QuerySubspacesRequest defines a request type for querying for all registered * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySubspacesRequestSDKType {} /** * QuerySubspacesResponse defines the response types for querying for all * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySubspacesResponse { subspaces: Subspace[]; @@ -59,6 +65,8 @@ export interface QuerySubspacesResponseProtoMsg { /** * QuerySubspacesResponse defines the response types for querying for all * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySubspacesResponseSDKType { subspaces: SubspaceSDKType[]; @@ -66,6 +74,8 @@ export interface QuerySubspacesResponseSDKType { /** * Subspace defines a parameter subspace name and all the keys that exist for * the subspace. + * + * Since: cosmos-sdk 0.46 */ export interface Subspace { subspace: string; @@ -78,6 +88,8 @@ export interface SubspaceProtoMsg { /** * Subspace defines a parameter subspace name and all the keys that exist for * the subspace. + * + * Since: cosmos-sdk 0.46 */ export interface SubspaceSDKType { subspace: string; diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts index 09a595c46bd..0f25fe3a4f4 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts @@ -70,7 +70,7 @@ export interface QueryValidatorRequestSDKType { } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryValidatorResponseProtoMsg { @@ -400,7 +400,7 @@ export interface QueryDelegatorValidatorsRequestSDKType { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators: Validator[]; /** pagination defines the pagination in the response. */ pagination?: PageResponse; @@ -444,7 +444,7 @@ export interface QueryDelegatorValidatorRequestSDKType { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryDelegatorValidatorResponseProtoMsg { diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts index 5a8f4b630b9..025984de2c0 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -184,7 +184,11 @@ export interface Validator { unbondingTime: Date; /** commission defines the commission parameters. */ commission: Commission; - /** min_self_delegation is the validator's self declared minimum self delegation. */ + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ minSelfDelegation: string; } export interface ValidatorProtoMsg { diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts index 0834df3ff60..ab78d056ac0 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -180,6 +180,50 @@ export interface MsgUndelegateResponseProtoMsg { export interface MsgUndelegateResponseSDKType { completion_time: Date; } +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegation { + delegatorAddress: string; + validatorAddress: string; + /** 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: bigint; +} +export interface MsgCancelUnbondingDelegationProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation'; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; + creation_height: bigint; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponse {} +export interface MsgCancelUnbondingDelegationResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse'; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponseSDKType {} function createBaseMsgCreateValidator(): MsgCreateValidator { return { description: Description.fromPartial({}), @@ -1074,6 +1118,182 @@ export const MsgUndelegateResponse = { }; }, }; +function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation { + return { + delegatorAddress: '', + validatorAddress: '', + amount: Coin.fromPartial({}), + creationHeight: BigInt(0), + }; +} +export const MsgCancelUnbondingDelegation = { + typeUrl: '/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation', + encode( + message: MsgCancelUnbondingDelegation, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.delegatorAddress !== '') { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + if (message.creationHeight !== BigInt(0)) { + writer.uint32(32).int64(message.creationHeight); + } + return writer; + }, + 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) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.creationHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCancelUnbondingDelegation { + return { + 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) + ? BigInt(object.creationHeight.toString()) + : BigInt(0), + }; + }, + toJSON(message: MsgCancelUnbondingDelegation): unknown { + const obj: any = {}; + 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 || BigInt(0)).toString()); + return obj; + }, + fromPartial( + object: Partial, + ): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + 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 + ? BigInt(object.creationHeight.toString()) + : BigInt(0); + return message; + }, + fromProtoMsg( + message: MsgCancelUnbondingDelegationProtoMsg, + ): MsgCancelUnbondingDelegation { + return MsgCancelUnbondingDelegation.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegation): Uint8Array { + return MsgCancelUnbondingDelegation.encode(message).finish(); + }, + toProtoMsg( + message: MsgCancelUnbondingDelegation, + ): MsgCancelUnbondingDelegationProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation', + value: MsgCancelUnbondingDelegation.encode(message).finish(), + }; + }, +}; +function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDelegationResponse { + return {}; +} +export const MsgCancelUnbondingDelegationResponse = { + typeUrl: '/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse', + encode( + _: MsgCancelUnbondingDelegationResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + return writer; + }, + 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) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgCancelUnbondingDelegationResponse { + return {}; + }, + toJSON(_: MsgCancelUnbondingDelegationResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial( + _: Partial, + ): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, + fromProtoMsg( + message: MsgCancelUnbondingDelegationResponseProtoMsg, + ): MsgCancelUnbondingDelegationResponse { + return MsgCancelUnbondingDelegationResponse.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegationResponse): Uint8Array { + return MsgCancelUnbondingDelegationResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCancelUnbondingDelegationResponse, + ): MsgCancelUnbondingDelegationResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse', + value: MsgCancelUnbondingDelegationResponse.encode(message).finish(), + }; + }, +}; export const Cosmos_cryptoPubKey_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): Any => { diff --git a/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index 0ed1c5ed7bf..b6b98d41cd5 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -51,6 +51,19 @@ export enum SignMode { * Amino JSON and will be removed in the future. */ SIGN_MODE_LEGACY_AMINO_JSON = 127, + /** + * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + * + * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + * but is not implemented on the SDK by default. To enable EIP-191, you need + * to pass a custom `TxConfig` that has an implementation of + * `SignModeHandler` for EIP-191. The SDK may decide to fully support + * EIP-191 in the future. + * + * Since: cosmos-sdk 0.45.2 + */ + SIGN_MODE_EIP_191 = 191, UNRECOGNIZED = -1, } export const SignModeSDKType = SignMode; @@ -71,6 +84,9 @@ export function signModeFromJSON(object: any): SignMode { case 127: case 'SIGN_MODE_LEGACY_AMINO_JSON': return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; + case 191: + case 'SIGN_MODE_EIP_191': + return SignMode.SIGN_MODE_EIP_191; case -1: case 'UNRECOGNIZED': default: @@ -89,6 +105,8 @@ export function signModeToJSON(object: SignMode): string { return 'SIGN_MODE_DIRECT_AUX'; case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: return 'SIGN_MODE_LEGACY_AMINO_JSON'; + case SignMode.SIGN_MODE_EIP_191: + return 'SIGN_MODE_EIP_191'; case SignMode.UNRECOGNIZED: default: return 'UNRECOGNIZED'; diff --git a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts index 412285699d6..667c3ccb293 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts @@ -123,9 +123,20 @@ export function broadcastModeToJSON(object: BroadcastMode): string { export interface GetTxsEventRequest { /** events is the list of transaction event type. */ events: string[]; - /** pagination defines a pagination for the request. */ + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + */ + /** @deprecated */ pagination?: PageRequest; orderBy: OrderBy; + /** page is the page number to query, starts at 1. If not provided, will default to first page. */ + 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: bigint; } export interface GetTxsEventRequestProtoMsg { typeUrl: '/cosmos.tx.v1beta1.GetTxsEventRequest'; @@ -137,8 +148,11 @@ export interface GetTxsEventRequestProtoMsg { */ export interface GetTxsEventRequestSDKType { events: string[]; + /** @deprecated */ pagination?: PageRequestSDKType; order_by: OrderBy; + page: bigint; + limit: bigint; } /** * GetTxsEventResponse is the response type for the Service.TxsByEvents @@ -149,8 +163,14 @@ export interface GetTxsEventResponse { txs: Tx[]; /** tx_responses is the list of queried TxResponses. */ txResponses: TxResponse[]; - /** pagination defines a pagination for the response. */ + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ + /** @deprecated */ pagination?: PageResponse; + /** total is total number of results available */ + total: bigint; } export interface GetTxsEventResponseProtoMsg { typeUrl: '/cosmos.tx.v1beta1.GetTxsEventResponse'; @@ -163,7 +183,9 @@ export interface GetTxsEventResponseProtoMsg { export interface GetTxsEventResponseSDKType { txs: TxSDKType[]; tx_responses: TxResponseSDKType[]; + /** @deprecated */ pagination?: PageResponseSDKType; + total: bigint; } /** * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -352,6 +374,8 @@ function createBaseGetTxsEventRequest(): GetTxsEventRequest { events: [], pagination: undefined, orderBy: 0, + page: BigInt(0), + limit: BigInt(0), }; } export const GetTxsEventRequest = { @@ -369,6 +393,12 @@ export const GetTxsEventRequest = { if (message.orderBy !== 0) { writer.uint32(24).int32(message.orderBy); } + if (message.page !== BigInt(0)) { + writer.uint32(32).uint64(message.page); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).uint64(message.limit); + } return writer; }, decode( @@ -391,6 +421,12 @@ export const GetTxsEventRequest = { case 3: message.orderBy = reader.int32() as any; break; + case 4: + message.page = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -407,6 +443,8 @@ export const GetTxsEventRequest = { ? PageRequest.fromJSON(object.pagination) : undefined, 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 { @@ -422,6 +460,10 @@ export const GetTxsEventRequest = { : undefined); message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)); + 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 { @@ -432,6 +474,14 @@ export const GetTxsEventRequest = { ? PageRequest.fromPartial(object.pagination) : undefined; message.orderBy = object.orderBy ?? 0; + 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; }, fromProtoMsg(message: GetTxsEventRequestProtoMsg): GetTxsEventRequest { @@ -452,6 +502,7 @@ function createBaseGetTxsEventResponse(): GetTxsEventResponse { txs: [], txResponses: [], pagination: undefined, + total: BigInt(0), }; } export const GetTxsEventResponse = { @@ -472,6 +523,9 @@ export const GetTxsEventResponse = { writer.uint32(26).fork(), ).ldelim(); } + if (message.total !== BigInt(0)) { + writer.uint32(32).uint64(message.total); + } return writer; }, decode( @@ -494,6 +548,9 @@ export const GetTxsEventResponse = { case 3: message.pagination = PageResponse.decode(reader, reader.uint32()); break; + case 4: + message.total = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -512,6 +569,7 @@ export const GetTxsEventResponse = { pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0), }; }, toJSON(message: GetTxsEventResponse): unknown { @@ -532,6 +590,8 @@ export const GetTxsEventResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.total !== undefined && + (obj.total = (message.total || BigInt(0)).toString()); return obj; }, fromPartial(object: Partial): GetTxsEventResponse { @@ -543,6 +603,10 @@ export const GetTxsEventResponse = { object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.total = + object.total !== undefined && object.total !== null + ? BigInt(object.total.toString()) + : BigInt(0); return message; }, fromProtoMsg(message: GetTxsEventResponseProtoMsg): GetTxsEventResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts index ed5efe3c98b..424d920c378 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -136,8 +136,12 @@ export interface SignDocDirectAux { /** sequence is the sequence number of the signing account. */ sequence: bigint; /** - * Tip is the optional tip used for meta-transactions. It should be left - * empty if the signer is not the tipper for this transaction. + * 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 + * transaction. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. */ tip?: Tip; } @@ -227,7 +231,10 @@ export interface AuthInfo { */ fee?: Fee; /** - * Tip is the optional tip used for meta-transactions. + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. * * Since: cosmos-sdk 0.46 */ @@ -419,12 +426,12 @@ export interface AuxSignerData { */ address: string; /** - * sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer + * 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 * LEGACY_AMINO_JSON. */ signDoc?: SignDocDirectAux; - /** mode is the signing mode of the single signer */ + /** mode is the signing mode of the single signer. */ mode: SignMode; /** sig is the signature of the sign doc. */ sig: Uint8Array; diff --git a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts index fb263a84747..a73e1b88e61 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts @@ -11,6 +11,7 @@ export interface MsgCreateVestingAccount { fromAddress: string; toAddress: string; amount: Coin[]; + /** end of vesting as unix time (in seconds). */ endTime: bigint; delayed: boolean; } @@ -40,6 +41,8 @@ export interface MsgCreateVestingAccountResponseSDKType {} /** * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent * locked account. + * + * Since: cosmos-sdk 0.46 */ export interface MsgCreatePermanentLockedAccount { fromAddress: string; @@ -53,29 +56,48 @@ export interface MsgCreatePermanentLockedAccountProtoMsg { /** * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent * locked account. + * + * Since: cosmos-sdk 0.46 */ export interface MsgCreatePermanentLockedAccountSDKType { from_address: string; to_address: string; amount: CoinSDKType[]; } -/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +/** + * MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. + * + * Since: cosmos-sdk 0.46 + */ export interface MsgCreatePermanentLockedAccountResponse {} export interface MsgCreatePermanentLockedAccountResponseProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse'; value: Uint8Array; } -/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ +/** + * MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. + * + * Since: cosmos-sdk 0.46 + */ export interface MsgCreatePermanentLockedAccountResponseSDKType {} /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. + * + * Since: cosmos-sdk 0.46 */ export interface MsgCreatePeriodicVestingAccount { fromAddress: string; toAddress: string; + /** start of vesting as unix time (in seconds). */ startTime: bigint; vestingPeriods: Period[]; + /** + * If true, merge this new grant into an existing PeriodicVestingAccount, + * or create it if it does not exist. If false, creates a new account, + * or fails if an account already exists + */ + merge: boolean; } export interface MsgCreatePeriodicVestingAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount'; @@ -84,16 +106,21 @@ export interface MsgCreatePeriodicVestingAccountProtoMsg { /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. + * + * Since: cosmos-sdk 0.46 */ export interface MsgCreatePeriodicVestingAccountSDKType { from_address: string; to_address: string; start_time: bigint; vesting_periods: PeriodSDKType[]; + merge: boolean; } /** * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount * response type. + * + * Since: cosmos-sdk 0.46 */ export interface MsgCreatePeriodicVestingAccountResponse {} export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { @@ -103,8 +130,113 @@ export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { /** * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount * response type. + * + * Since: cosmos-sdk 0.46 */ export interface MsgCreatePeriodicVestingAccountResponseSDKType {} +/** MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. */ +export interface MsgCreateClawbackVestingAccount { + /** Address of the account providing the funds, which must also sign the request. */ + fromAddress: string; + /** Address of the account to receive the funds. */ + toAddress: string; + /** Start time of the vesting. Periods start relative to this time. */ + startTime: bigint; + /** Unlocking events as a sequence of durations and amounts, starting relative to start_time. */ + lockupPeriods: Period[]; + /** Vesting events as a sequence of durations and amounts, starting relative to start_time. */ + vestingPeriods: Period[]; + /** + * If true, merge this new grant into an existing ClawbackVestingAccount, + * or create it if it does not exist. If false, creates a new account. + * New grants to an existing account must be from the same from_address. + */ + merge: boolean; +} +export interface MsgCreateClawbackVestingAccountProtoMsg { + typeUrl: '/cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount'; + value: Uint8Array; +} +/** MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. */ +export interface MsgCreateClawbackVestingAccountSDKType { + from_address: string; + to_address: string; + start_time: bigint; + lockup_periods: PeriodSDKType[]; + vesting_periods: PeriodSDKType[]; + merge: boolean; +} +/** MsgCreateClawbackVestingAccountResponse defines the MsgCreateClawbackVestingAccount response type. */ +export interface MsgCreateClawbackVestingAccountResponse {} +export interface MsgCreateClawbackVestingAccountResponseProtoMsg { + typeUrl: '/cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse'; + value: Uint8Array; +} +/** MsgCreateClawbackVestingAccountResponse defines the MsgCreateClawbackVestingAccount response type. */ +export interface MsgCreateClawbackVestingAccountResponseSDKType {} +/** MsgClawback defines a message that removes unvested tokens from a ClawbackVestingAccount. */ +export interface MsgClawback { + /** funder_address is the address which funded the account */ + funderAddress: string; + /** address is the address of the ClawbackVestingAccount to claw back from. */ + address: string; + /** + * dest_address specifies where the clawed-back tokens should be transferred. + * If empty, the tokens will be transferred back to the original funder of the account. + */ + destAddress: string; +} +export interface MsgClawbackProtoMsg { + typeUrl: '/cosmos.vesting.v1beta1.MsgClawback'; + value: Uint8Array; +} +/** MsgClawback defines a message that removes unvested tokens from a ClawbackVestingAccount. */ +export interface MsgClawbackSDKType { + funder_address: string; + address: string; + dest_address: string; +} +/** MsgClawbackResponse defines the MsgClawback response type. */ +export interface MsgClawbackResponse {} +export interface MsgClawbackResponseProtoMsg { + typeUrl: '/cosmos.vesting.v1beta1.MsgClawbackResponse'; + value: Uint8Array; +} +/** MsgClawbackResponse defines the MsgClawback response type. */ +export interface MsgClawbackResponseSDKType {} +/** + * MsgReturnGrants defines a message for a grantee to return all granted assets, + * including delegated, undelegated and unbonding, vested and unvested, + * are transferred to the original funder of the account. Might not be complete if + * some vested assets have been transferred out of the account. Currently only applies to + * ClawbackVesting accounts. + */ +export interface MsgReturnGrants { + /** address is the address of the grantee account returning the grant. */ + address: string; +} +export interface MsgReturnGrantsProtoMsg { + typeUrl: '/cosmos.vesting.v1beta1.MsgReturnGrants'; + value: Uint8Array; +} +/** + * MsgReturnGrants defines a message for a grantee to return all granted assets, + * including delegated, undelegated and unbonding, vested and unvested, + * are transferred to the original funder of the account. Might not be complete if + * some vested assets have been transferred out of the account. Currently only applies to + * ClawbackVesting accounts. + */ +export interface MsgReturnGrantsSDKType { + address: string; +} +/** MsgReturnGrantsResponse defines the ReturnGrants response type. */ +export interface MsgReturnGrantsResponse {} +export interface MsgReturnGrantsResponseProtoMsg { + typeUrl: '/cosmos.vesting.v1beta1.MsgReturnGrantsResponse'; + value: Uint8Array; +} +/** MsgReturnGrantsResponse defines the ReturnGrants response type. */ +export interface MsgReturnGrantsResponseSDKType {} function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { return { fromAddress: '', @@ -452,6 +584,7 @@ function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAc toAddress: '', startTime: BigInt(0), vestingPeriods: [], + merge: false, }; } export const MsgCreatePeriodicVestingAccount = { @@ -472,6 +605,9 @@ export const MsgCreatePeriodicVestingAccount = { for (const v of message.vestingPeriods) { Period.encode(v!, writer.uint32(34).fork()).ldelim(); } + if (message.merge === true) { + writer.uint32(40).bool(message.merge); + } return writer; }, decode( @@ -497,6 +633,9 @@ export const MsgCreatePeriodicVestingAccount = { case 4: message.vestingPeriods.push(Period.decode(reader, reader.uint32())); break; + case 5: + message.merge = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -514,6 +653,7 @@ export const MsgCreatePeriodicVestingAccount = { vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) : [], + merge: isSet(object.merge) ? Boolean(object.merge) : false, }; }, toJSON(message: MsgCreatePeriodicVestingAccount): unknown { @@ -530,6 +670,7 @@ export const MsgCreatePeriodicVestingAccount = { } else { obj.vestingPeriods = []; } + message.merge !== undefined && (obj.merge = message.merge); return obj; }, fromPartial( @@ -544,6 +685,7 @@ export const MsgCreatePeriodicVestingAccount = { : BigInt(0); message.vestingPeriods = object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; + message.merge = object.merge ?? false; return message; }, fromProtoMsg( @@ -623,3 +765,467 @@ export const MsgCreatePeriodicVestingAccountResponse = { }; }, }; +function createBaseMsgCreateClawbackVestingAccount(): MsgCreateClawbackVestingAccount { + return { + fromAddress: '', + toAddress: '', + startTime: BigInt(0), + lockupPeriods: [], + vestingPeriods: [], + merge: false, + }; +} +export const MsgCreateClawbackVestingAccount = { + typeUrl: '/cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount', + encode( + message: MsgCreateClawbackVestingAccount, + 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 !== BigInt(0)) { + writer.uint32(24).int64(message.startTime); + } + for (const v of message.lockupPeriods) { + Period.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.merge === true) { + writer.uint32(48).bool(message.merge); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): MsgCreateClawbackVestingAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClawbackVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.startTime = reader.int64(); + break; + case 4: + message.lockupPeriods.push(Period.decode(reader, reader.uint32())); + break; + case 5: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + case 6: + message.merge = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCreateClawbackVestingAccount { + return { + fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : '', + toAddress: isSet(object.toAddress) ? String(object.toAddress) : '', + startTime: isSet(object.startTime) + ? BigInt(object.startTime.toString()) + : BigInt(0), + lockupPeriods: Array.isArray(object?.lockupPeriods) + ? object.lockupPeriods.map((e: any) => Period.fromJSON(e)) + : [], + vestingPeriods: Array.isArray(object?.vestingPeriods) + ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) + : [], + merge: isSet(object.merge) ? Boolean(object.merge) : false, + }; + }, + toJSON(message: MsgCreateClawbackVestingAccount): unknown { + const obj: any = {}; + message.fromAddress !== undefined && + (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + message.startTime !== undefined && + (obj.startTime = (message.startTime || BigInt(0)).toString()); + if (message.lockupPeriods) { + obj.lockupPeriods = message.lockupPeriods.map(e => + e ? Period.toJSON(e) : undefined, + ); + } else { + obj.lockupPeriods = []; + } + if (message.vestingPeriods) { + obj.vestingPeriods = message.vestingPeriods.map(e => + e ? Period.toJSON(e) : undefined, + ); + } else { + obj.vestingPeriods = []; + } + message.merge !== undefined && (obj.merge = message.merge); + return obj; + }, + fromPartial( + object: Partial, + ): MsgCreateClawbackVestingAccount { + const message = createBaseMsgCreateClawbackVestingAccount(); + message.fromAddress = object.fromAddress ?? ''; + message.toAddress = object.toAddress ?? ''; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? BigInt(object.startTime.toString()) + : BigInt(0); + message.lockupPeriods = + object.lockupPeriods?.map(e => Period.fromPartial(e)) || []; + message.vestingPeriods = + object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; + message.merge = object.merge ?? false; + return message; + }, + fromProtoMsg( + message: MsgCreateClawbackVestingAccountProtoMsg, + ): MsgCreateClawbackVestingAccount { + return MsgCreateClawbackVestingAccount.decode(message.value); + }, + toProto(message: MsgCreateClawbackVestingAccount): Uint8Array { + return MsgCreateClawbackVestingAccount.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreateClawbackVestingAccount, + ): MsgCreateClawbackVestingAccountProtoMsg { + return { + typeUrl: '/cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount', + value: MsgCreateClawbackVestingAccount.encode(message).finish(), + }; + }, +}; +function createBaseMsgCreateClawbackVestingAccountResponse(): MsgCreateClawbackVestingAccountResponse { + return {}; +} +export const MsgCreateClawbackVestingAccountResponse = { + typeUrl: '/cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse', + encode( + _: MsgCreateClawbackVestingAccountResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): MsgCreateClawbackVestingAccountResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClawbackVestingAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgCreateClawbackVestingAccountResponse { + return {}; + }, + toJSON(_: MsgCreateClawbackVestingAccountResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial( + _: Partial, + ): MsgCreateClawbackVestingAccountResponse { + const message = createBaseMsgCreateClawbackVestingAccountResponse(); + return message; + }, + fromProtoMsg( + message: MsgCreateClawbackVestingAccountResponseProtoMsg, + ): MsgCreateClawbackVestingAccountResponse { + return MsgCreateClawbackVestingAccountResponse.decode(message.value); + }, + toProto(message: MsgCreateClawbackVestingAccountResponse): Uint8Array { + return MsgCreateClawbackVestingAccountResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgCreateClawbackVestingAccountResponse, + ): MsgCreateClawbackVestingAccountResponseProtoMsg { + return { + typeUrl: + '/cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse', + value: MsgCreateClawbackVestingAccountResponse.encode(message).finish(), + }; + }, +}; +function createBaseMsgClawback(): MsgClawback { + return { + funderAddress: '', + address: '', + destAddress: '', + }; +} +export const MsgClawback = { + typeUrl: '/cosmos.vesting.v1beta1.MsgClawback', + encode( + message: MsgClawback, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.funderAddress !== '') { + writer.uint32(10).string(message.funderAddress); + } + if (message.address !== '') { + writer.uint32(18).string(message.address); + } + if (message.destAddress !== '') { + writer.uint32(26).string(message.destAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClawback { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClawback(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.funderAddress = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.destAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgClawback { + return { + funderAddress: isSet(object.funderAddress) + ? String(object.funderAddress) + : '', + address: isSet(object.address) ? String(object.address) : '', + destAddress: isSet(object.destAddress) ? String(object.destAddress) : '', + }; + }, + toJSON(message: MsgClawback): unknown { + const obj: any = {}; + message.funderAddress !== undefined && + (obj.funderAddress = message.funderAddress); + message.address !== undefined && (obj.address = message.address); + message.destAddress !== undefined && + (obj.destAddress = message.destAddress); + return obj; + }, + fromPartial(object: Partial): MsgClawback { + const message = createBaseMsgClawback(); + message.funderAddress = object.funderAddress ?? ''; + message.address = object.address ?? ''; + message.destAddress = object.destAddress ?? ''; + return message; + }, + fromProtoMsg(message: MsgClawbackProtoMsg): MsgClawback { + return MsgClawback.decode(message.value); + }, + toProto(message: MsgClawback): Uint8Array { + return MsgClawback.encode(message).finish(); + }, + toProtoMsg(message: MsgClawback): MsgClawbackProtoMsg { + return { + typeUrl: '/cosmos.vesting.v1beta1.MsgClawback', + value: MsgClawback.encode(message).finish(), + }; + }, +}; +function createBaseMsgClawbackResponse(): MsgClawbackResponse { + return {}; +} +export const MsgClawbackResponse = { + typeUrl: '/cosmos.vesting.v1beta1.MsgClawbackResponse', + encode( + _: MsgClawbackResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): MsgClawbackResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClawbackResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgClawbackResponse { + return {}; + }, + toJSON(_: MsgClawbackResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgClawbackResponse { + const message = createBaseMsgClawbackResponse(); + return message; + }, + fromProtoMsg(message: MsgClawbackResponseProtoMsg): MsgClawbackResponse { + return MsgClawbackResponse.decode(message.value); + }, + toProto(message: MsgClawbackResponse): Uint8Array { + return MsgClawbackResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClawbackResponse): MsgClawbackResponseProtoMsg { + return { + typeUrl: '/cosmos.vesting.v1beta1.MsgClawbackResponse', + value: MsgClawbackResponse.encode(message).finish(), + }; + }, +}; +function createBaseMsgReturnGrants(): MsgReturnGrants { + return { + address: '', + }; +} +export const MsgReturnGrants = { + typeUrl: '/cosmos.vesting.v1beta1.MsgReturnGrants', + encode( + message: MsgReturnGrants, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.address !== '') { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgReturnGrants { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReturnGrants(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgReturnGrants { + return { + address: isSet(object.address) ? String(object.address) : '', + }; + }, + toJSON(message: MsgReturnGrants): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + fromPartial(object: Partial): MsgReturnGrants { + const message = createBaseMsgReturnGrants(); + message.address = object.address ?? ''; + return message; + }, + fromProtoMsg(message: MsgReturnGrantsProtoMsg): MsgReturnGrants { + return MsgReturnGrants.decode(message.value); + }, + toProto(message: MsgReturnGrants): Uint8Array { + return MsgReturnGrants.encode(message).finish(); + }, + toProtoMsg(message: MsgReturnGrants): MsgReturnGrantsProtoMsg { + return { + typeUrl: '/cosmos.vesting.v1beta1.MsgReturnGrants', + value: MsgReturnGrants.encode(message).finish(), + }; + }, +}; +function createBaseMsgReturnGrantsResponse(): MsgReturnGrantsResponse { + return {}; +} +export const MsgReturnGrantsResponse = { + typeUrl: '/cosmos.vesting.v1beta1.MsgReturnGrantsResponse', + encode( + _: MsgReturnGrantsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): MsgReturnGrantsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReturnGrantsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgReturnGrantsResponse { + return {}; + }, + toJSON(_: MsgReturnGrantsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgReturnGrantsResponse { + const message = createBaseMsgReturnGrantsResponse(); + return message; + }, + fromProtoMsg( + message: MsgReturnGrantsResponseProtoMsg, + ): MsgReturnGrantsResponse { + return MsgReturnGrantsResponse.decode(message.value); + }, + toProto(message: MsgReturnGrantsResponse): Uint8Array { + return MsgReturnGrantsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgReturnGrantsResponse, + ): MsgReturnGrantsResponseProtoMsg { + return { + typeUrl: '/cosmos.vesting.v1beta1.MsgReturnGrantsResponse', + value: MsgReturnGrantsResponse.encode(message).finish(), + }; + }, +}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts index e8d40a269a3..f2549147327 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts @@ -12,6 +12,7 @@ export interface BaseVestingAccount { originalVesting: Coin[]; delegatedFree: Coin[]; delegatedVesting: Coin[]; + /** Vesting end time, as unix timestamp (in seconds). */ endTime: bigint; } export interface BaseVestingAccountProtoMsg { @@ -35,6 +36,7 @@ export interface BaseVestingAccountSDKType { */ export interface ContinuousVestingAccount { baseVestingAccount?: BaseVestingAccount; + /** Vesting start time, as unix timestamp (in seconds). */ startTime: bigint; } export interface ContinuousVestingAccountProtoMsg { @@ -69,8 +71,14 @@ export interface DelayedVestingAccountProtoMsg { export interface DelayedVestingAccountSDKType { base_vesting_account?: BaseVestingAccountSDKType; } -/** Period defines a length of time and amount of coins that will vest. */ +/** + * Period defines a length of time and amount of coins that will vest. + * A sequence of periods defines a sequence of vesting events, with the + * first period relative to an externally-provided start time, + * and subsequent periods relatie to their predecessor. + */ export interface Period { + /** Period duration in seconds. */ length: bigint; amount: Coin[]; } @@ -78,7 +86,12 @@ export interface PeriodProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.Period'; value: Uint8Array; } -/** Period defines a length of time and amount of coins that will vest. */ +/** + * Period defines a length of time and amount of coins that will vest. + * A sequence of periods defines a sequence of vesting events, with the + * first period relative to an externally-provided start time, + * and subsequent periods relatie to their predecessor. + */ export interface PeriodSDKType { length: bigint; amount: CoinSDKType[]; @@ -129,6 +142,39 @@ export interface PermanentLockedAccountProtoMsg { export interface PermanentLockedAccountSDKType { base_vesting_account?: BaseVestingAccountSDKType; } +/** + * ClawbackVestingAccount implements the VestingAccount interface. It provides + * an account that can hold contributions subject to "lockup" (like a + * PeriodicVestingAccount), or vesting which is subject to clawback + * of unvested tokens, or a combination (tokens vest, but are still locked). + */ +export interface ClawbackVestingAccount { + baseVestingAccount?: BaseVestingAccount; + /** funder_address specifies the account which can perform clawback. */ + funderAddress: string; + startTime: bigint; + /** unlocking schedule relative to the BaseVestingAccount start_time. */ + lockupPeriods: Period[]; + /** vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. */ + vestingPeriods: Period[]; +} +export interface ClawbackVestingAccountProtoMsg { + typeUrl: '/cosmos.vesting.v1beta1.ClawbackVestingAccount'; + value: Uint8Array; +} +/** + * ClawbackVestingAccount implements the VestingAccount interface. It provides + * an account that can hold contributions subject to "lockup" (like a + * PeriodicVestingAccount), or vesting which is subject to clawback + * of unvested tokens, or a combination (tokens vest, but are still locked). + */ +export interface ClawbackVestingAccountSDKType { + base_vesting_account?: BaseVestingAccountSDKType; + funder_address: string; + start_time: bigint; + lockup_periods: PeriodSDKType[]; + vesting_periods: PeriodSDKType[]; +} function createBaseBaseVestingAccount(): BaseVestingAccount { return { baseAccount: undefined, @@ -743,3 +789,152 @@ export const PermanentLockedAccount = { }; }, }; +function createBaseClawbackVestingAccount(): ClawbackVestingAccount { + return { + baseVestingAccount: undefined, + funderAddress: '', + startTime: BigInt(0), + lockupPeriods: [], + vestingPeriods: [], + }; +} +export const ClawbackVestingAccount = { + typeUrl: '/cosmos.vesting.v1beta1.ClawbackVestingAccount', + encode( + message: ClawbackVestingAccount, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode( + message.baseVestingAccount, + writer.uint32(10).fork(), + ).ldelim(); + } + if (message.funderAddress !== '') { + writer.uint32(18).string(message.funderAddress); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(24).int64(message.startTime); + } + for (const v of message.lockupPeriods) { + Period.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): ClawbackVestingAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClawbackVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode( + reader, + reader.uint32(), + ); + break; + case 2: + message.funderAddress = reader.string(); + break; + case 3: + message.startTime = reader.int64(); + break; + case 4: + message.lockupPeriods.push(Period.decode(reader, reader.uint32())); + break; + case 5: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClawbackVestingAccount { + return { + baseVestingAccount: isSet(object.baseVestingAccount) + ? BaseVestingAccount.fromJSON(object.baseVestingAccount) + : undefined, + funderAddress: isSet(object.funderAddress) + ? String(object.funderAddress) + : '', + startTime: isSet(object.startTime) + ? BigInt(object.startTime.toString()) + : BigInt(0), + lockupPeriods: Array.isArray(object?.lockupPeriods) + ? object.lockupPeriods.map((e: any) => Period.fromJSON(e)) + : [], + vestingPeriods: Array.isArray(object?.vestingPeriods) + ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) + : [], + }; + }, + toJSON(message: ClawbackVestingAccount): unknown { + const obj: any = {}; + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); + message.funderAddress !== undefined && + (obj.funderAddress = message.funderAddress); + message.startTime !== undefined && + (obj.startTime = (message.startTime || BigInt(0)).toString()); + if (message.lockupPeriods) { + obj.lockupPeriods = message.lockupPeriods.map(e => + e ? Period.toJSON(e) : undefined, + ); + } else { + obj.lockupPeriods = []; + } + if (message.vestingPeriods) { + obj.vestingPeriods = message.vestingPeriods.map(e => + e ? Period.toJSON(e) : undefined, + ); + } else { + obj.vestingPeriods = []; + } + return obj; + }, + fromPartial(object: Partial): ClawbackVestingAccount { + const message = createBaseClawbackVestingAccount(); + message.baseVestingAccount = + object.baseVestingAccount !== undefined && + object.baseVestingAccount !== null + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined; + message.funderAddress = object.funderAddress ?? ''; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? BigInt(object.startTime.toString()) + : BigInt(0); + message.lockupPeriods = + object.lockupPeriods?.map(e => Period.fromPartial(e)) || []; + message.vestingPeriods = + object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; + return message; + }, + fromProtoMsg( + message: ClawbackVestingAccountProtoMsg, + ): ClawbackVestingAccount { + return ClawbackVestingAccount.decode(message.value); + }, + toProto(message: ClawbackVestingAccount): Uint8Array { + return ClawbackVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: ClawbackVestingAccount): ClawbackVestingAccountProtoMsg { + return { + typeUrl: '/cosmos.vesting.v1beta1.ClawbackVestingAccount', + value: ClawbackVestingAccount.encode(message).finish(), + }; + }, +}; diff --git a/packages/cosmic-proto/src/codegen/gogoproto/bundle.ts b/packages/cosmic-proto/src/codegen/gogoproto/bundle.ts index 68f13a35ac6..6c0fd47dfb0 100644 --- a/packages/cosmic-proto/src/codegen/gogoproto/bundle.ts +++ b/packages/cosmic-proto/src/codegen/gogoproto/bundle.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import * as _79 from './gogo.js'; +import * as _80 from './gogo.js'; export const gogoproto = { - ..._79, + ..._80, }; diff --git a/packages/cosmic-proto/src/codegen/google/bundle.ts b/packages/cosmic-proto/src/codegen/google/bundle.ts index a1084329912..e69ec26ce86 100644 --- a/packages/cosmic-proto/src/codegen/google/bundle.ts +++ b/packages/cosmic-proto/src/codegen/google/bundle.ts @@ -1,15 +1,15 @@ //@ts-nocheck -import * as _80 from './protobuf/any.js'; -import * as _81 from './protobuf/descriptor.js'; -import * as _82 from './protobuf/duration.js'; -import * as _83 from './protobuf/empty.js'; -import * as _84 from './protobuf/timestamp.js'; +import * as _81 from './protobuf/any.js'; +import * as _82 from './protobuf/descriptor.js'; +import * as _83 from './protobuf/duration.js'; +import * as _84 from './protobuf/empty.js'; +import * as _85 from './protobuf/timestamp.js'; export namespace google { export const protobuf = { - ..._80, ..._81, ..._82, ..._83, ..._84, + ..._85, }; } diff --git a/packages/cosmic-proto/src/codegen/ibc/bundle.ts b/packages/cosmic-proto/src/codegen/ibc/bundle.ts index 71a96ac1b3c..c2871e3274f 100644 --- a/packages/cosmic-proto/src/codegen/ibc/bundle.ts +++ b/packages/cosmic-proto/src/codegen/ibc/bundle.ts @@ -1,16 +1,16 @@ //@ts-nocheck -import * as _85 from './core/channel/v1/channel.js'; -import * as _86 from './core/client/v1/client.js'; +import * as _86 from './core/channel/v1/channel.js'; +import * as _87 from './core/client/v1/client.js'; export namespace ibc { export namespace core { export namespace channel { export const v1 = { - ..._85, + ..._86, }; } export namespace client { export const v1 = { - ..._86, + ..._87, }; } } diff --git a/packages/cosmic-proto/src/codegen/tendermint/bundle.ts b/packages/cosmic-proto/src/codegen/tendermint/bundle.ts index a224aeb6d0d..296c848c91d 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/bundle.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/bundle.ts @@ -1,39 +1,39 @@ //@ts-nocheck -import * as _87 from './abci/types.js'; -import * as _88 from './crypto/keys.js'; -import * as _89 from './crypto/proof.js'; -import * as _90 from './libs/bits/types.js'; -import * as _91 from './p2p/types.js'; -import * as _92 from './types/block.js'; -import * as _93 from './types/evidence.js'; -import * as _94 from './types/params.js'; -import * as _95 from './types/types.js'; -import * as _96 from './types/validator.js'; -import * as _97 from './version/types.js'; +import * as _88 from './abci/types.js'; +import * as _89 from './crypto/keys.js'; +import * as _90 from './crypto/proof.js'; +import * as _91 from './libs/bits/types.js'; +import * as _92 from './p2p/types.js'; +import * as _93 from './types/block.js'; +import * as _94 from './types/evidence.js'; +import * as _95 from './types/params.js'; +import * as _96 from './types/types.js'; +import * as _97 from './types/validator.js'; +import * as _98 from './version/types.js'; export namespace tendermint { export const abci = { - ..._87, + ..._88, }; export const crypto = { - ..._88, ..._89, + ..._90, }; export namespace libs { export const bits = { - ..._90, + ..._91, }; } export const p2p = { - ..._91, + ..._92, }; export const types = { - ..._92, ..._93, ..._94, ..._95, ..._96, + ..._97, }; export const version = { - ..._97, + ..._98, }; } diff --git a/packages/cosmic-proto/update-protos.sh b/packages/cosmic-proto/update-protos.sh new file mode 100755 index 00000000000..e5b0e7065ad --- /dev/null +++ b/packages/cosmic-proto/update-protos.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +# ugly way to get SDK path regardless of cwd +AG_SDK=$(readlink -f "$(dirname -- "$(readlink -f -- "$0")")/../..") + +# go ensure fresh build +cd "$AG_SDK"/golang/cosmos +make all +COSMOS_SDK=$(go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-sdk) +cd - + +# update proto files in this package +cp -rf "$COSMOS_SDK"/proto/cosmos proto +cp -rf "$AG_SDK"/golang/cosmos/third_party/proto . +cp -rf "$AG_SDK"/golang/cosmos/proto/agoric proto + +# clean up what we don't need +chmod -R u+w proto +rm -rf proto/cosmos/app +rm -rf proto/cosmos/orm diff --git a/packages/orchestration/src/types.d.ts b/packages/orchestration/src/types.d.ts index 283dacdeee1..e41541f3957 100644 --- a/packages/orchestration/src/types.d.ts +++ b/packages/orchestration/src/types.d.ts @@ -3,7 +3,10 @@ import type { Timestamp } from '@agoric/time'; import type { Invitation } from '@agoric/zoe/exported.js'; import type { Any } from '@agoric/cosmic-proto/google/protobuf/any'; import type { AnyJson } from '@agoric/cosmic-proto'; -import type { MsgUndelegateResponse } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js'; +import type { + MsgCancelUnbondingDelegation, + MsgUndelegateResponse, +} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js'; import type { Delegation, Redelegation, @@ -255,8 +258,7 @@ export interface ChainAccount { } export interface Undelegation { - // TODO return MsgCancelUnbondingDelegationResponse when that type is available - cancel: () => Promise; + cancel: () => Promise; response: MsgUndelegateResponse; /** * Resolves when the undelegation is complete and the tokens are no longer bonded.