diff --git a/README.md b/README.md index 176de83..2b61cc5 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ Follow these steps to run the tests: - Add a second account with the following: ```bash ethermintd keys add --keyring-backend test + + # Example + ethermintd keys add key2 --keyring-backend test ``` - Get the account details using: diff --git a/package.json b/package.json index b86f4f3..bca68ed 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "devDependencies": { "@types/jest": "^27.4.1", "jest": "^27.5.1", + "protoc-gen-ts": "^0.8.2", "ts-jest": "^27.1.3", "ts-node": "^10.7.0", "typescript": "^4.6.2" diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto new file mode 100644 index 0000000..72e1d9e --- /dev/null +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// BaseAccount defines a base account type. It contains all the necessary fields +// for basic account functionality. Any custom account type should extend this +// type for additional functionality (e.g. vesting). +message BaseAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + option (cosmos_proto.implements_interface) = "AccountI"; + + string address = 1; + google.protobuf.Any pub_key = 2 + [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; + uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""]; + uint64 sequence = 4; +} + +// ModuleAccount defines an account for modules that holds coins on a pool. +message ModuleAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ModuleAccountI"; + + BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; + string name = 2; + repeated string permissions = 3; +} + +// Params defines the parameters for the auth module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + uint64 max_memo_characters = 1 [(gogoproto.moretags) = "yaml:\"max_memo_characters\""]; + uint64 tx_sig_limit = 2 [(gogoproto.moretags) = "yaml:\"tx_sig_limit\""]; + uint64 tx_size_cost_per_byte = 3 [(gogoproto.moretags) = "yaml:\"tx_size_cost_per_byte\""]; + uint64 sig_verify_cost_ed25519 = 4 + [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; + uint64 sig_verify_cost_secp256k1 = 5 + [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; +} diff --git a/proto/cosmos/auth/v1beta1/genesis.proto b/proto/cosmos/auth/v1beta1/genesis.proto new file mode 100644 index 0000000..c88b94e --- /dev/null +++ b/proto/cosmos/auth/v1beta1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// GenesisState defines the auth module's genesis state. +message GenesisState { + // params defines all the paramaters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // accounts are the accounts present at genesis. + repeated google.protobuf.Any accounts = 2; +} diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto new file mode 100644 index 0000000..76d30dd --- /dev/null +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Query defines the gRPC querier service. +service Query { + // Accounts returns all the existing accounts + rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; + } + + // Account returns account details based on address. + rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + } + + // Params queries all parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + } +} + +// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +message QueryAccountsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +message QueryAccountsResponse { + // accounts are the existing accounts + 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; +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address defines the address to query for. + string address = 1; +} + +// 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) = "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]; +} diff --git a/proto/cosmos/authz/v1beta1/authz.proto b/proto/cosmos/authz/v1beta1/authz.proto new file mode 100644 index 0000000..c69a93c --- /dev/null +++ b/proto/cosmos/authz/v1beta1/authz.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +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) = "Authorization"; + + // Msg, identified by it's type URL, to grant unrestricted permissions to execute + string msg = 1; +} + +// Grant gives permissions to execute +// the provide method with expiration time. +message Grant { + google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"]; + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/authz/v1beta1/event.proto b/proto/cosmos/authz/v1beta1/event.proto new file mode 100644 index 0000000..c77cea3 --- /dev/null +++ b/proto/cosmos/authz/v1beta1/event.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package cosmos.authz.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// EventGrant is emitted on Msg/Grant +message EventGrant { + // Msg type URL for which an autorization is granted + string msg_type_url = 2; + // Granter account address + string granter = 3; + // Grantee account address + string grantee = 4; +} + +// EventRevoke is emitted on Msg/Revoke +message EventRevoke { + // Msg type URL for which an autorization is revoked + string msg_type_url = 2; + // Granter account address + string granter = 3; + // Grantee account address + string grantee = 4; +} diff --git a/proto/cosmos/authz/v1beta1/genesis.proto b/proto/cosmos/authz/v1beta1/genesis.proto new file mode 100644 index 0000000..411fd27 --- /dev/null +++ b/proto/cosmos/authz/v1beta1/genesis.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// GenesisState defines the authz module's genesis state. +message GenesisState { + repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false]; +} + +// GrantAuthorization defines the GenesisState/GrantAuthorization type. +message GrantAuthorization { + string granter = 1; + string grantee = 2; + + google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"]; + google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/cosmos/authz/v1beta1/query.proto b/proto/cosmos/authz/v1beta1/query.proto new file mode 100644 index 0000000..3b66e03 --- /dev/null +++ b/proto/cosmos/authz/v1beta1/query.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/authz/v1beta1/authz.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; + +// Query defines the gRPC querier service. +service Query { + // Returns list of `Authorization`, granted to the grantee by the granter. + rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) { + option (google.api.http).get = "/cosmos/authz/v1beta1/grants"; + } +} + +// QueryGrantsRequest is the request type for the Query/Grants RPC method. +message QueryGrantsRequest { + string granter = 1; + string grantee = 2; + // Optional, msg_type_url, when set, will query only grants matching given msg type. + string msg_type_url = 3; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +message QueryGrantsResponse { + // authorizations is a list of grants granted for grantee by granter. + repeated cosmos.authz.v1beta1.Grant grants = 1; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto new file mode 100644 index 0000000..1829b7a --- /dev/null +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; +package cosmos.authz.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/authz/v1beta1/authz.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the authz Msg service. +service Msg { + // Grant grants the provided authorization to the grantee on the granter's + // account with the provided expiration time. If there is already a grant + // for the given (granter, grantee, Authorization) triple, then the grant + // will be overwritten. + rpc Grant(MsgGrant) returns (MsgGrantResponse); + + // Exec attempts to execute the provided messages using + // authorizations granted to the grantee. Each message should have only + // one signer corresponding to the granter of the authorization. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // Revoke revokes any authorization corresponding to the provided method name on the + // granter's account that has been granted to the grantee. + rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); +} + +// MsgGrant is a request type for Grant method. It declares authorization to the grantee +// on behalf of the granter with the provided expiration time. +message MsgGrant { + string granter = 1; + string grantee = 2; + + cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false]; +} + +// MsgExecResponse defines the Msg/MsgExecResponse response type. +message MsgExecResponse { + repeated bytes results = 1; +} + +// MsgExec attempts to execute the provided messages using +// authorizations granted to the grantee. Each message should have only +// one signer corresponding to the granter of the authorization. +message MsgExec { + string grantee = 1; + // 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, authz.Authorization"]; +} + +// MsgGrantResponse defines the Msg/MsgGrant response type. +message MsgGrantResponse {} + +// MsgRevoke revokes any authorization with the provided sdk.Msg type on the +// granter's account with that has been granted to the grantee. +message MsgRevoke { + string granter = 1; + string grantee = 2; + string msg_type_url = 3; +} + +// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +message MsgRevokeResponse {} diff --git a/proto/cosmos/bank/v1beta1/authz.proto b/proto/cosmos/bank/v1beta1/authz.proto new file mode 100644 index 0000000..f3505ad --- /dev/null +++ b/proto/cosmos/bank/v1beta1/authz.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// SendAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account. +message SendAuthorization { + 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/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto new file mode 100644 index 0000000..eb843b2 --- /dev/null +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Params defines the parameters for the bank module. +message Params { + option (gogoproto.goproto_stringer) = false; + repeated SendEnabled send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled,omitempty\""]; + bool default_send_enabled = 2 [(gogoproto.moretags) = "yaml:\"default_send_enabled,omitempty\""]; +} + +// SendEnabled maps coin denom to a send_enabled status (whether a denom is +// sendable). +message SendEnabled { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + string denom = 1; + bool enabled = 2; +} + +// Input models transaction input. +message Input { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1; + repeated cosmos.base.v1beta1.Coin coins = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// Output models transaction outputs. +message Output { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1; + repeated cosmos.base.v1beta1.Coin coins = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// Supply represents a struct that passively keeps track of the total supply +// amounts in the network. +// This message is deprecated now that supply is indexed by denom. +message Supply { + option deprecated = true; + + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/legacy/v040.SupplyI"; + + repeated cosmos.base.v1beta1.Coin total = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// DenomUnit represents a struct that describes a given +// denomination unit of the basic token. +message DenomUnit { + // denom represents the string name of the given denom unit (e.g uatom). + string denom = 1; + // exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 1^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + uint32 exponent = 2; + // aliases is a list of string aliases for the given denom + repeated string aliases = 3; +} + +// Metadata represents a struct that describes +// a basic token. +message Metadata { + string description = 1; + // denom_units represents the list of DenomUnit's for a given coin + repeated DenomUnit denom_units = 2; + // base represents the base denom (should be the DenomUnit with exponent = 0). + string base = 3; + // display indicates the suggested denom that should be + // displayed in clients. + string display = 4; + // name defines the name of the token (eg: Cosmos Atom) + string name = 5; + // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + string symbol = 6; +} diff --git a/proto/cosmos/bank/v1beta1/genesis.proto b/proto/cosmos/bank/v1beta1/genesis.proto new file mode 100644 index 0000000..8fd7329 --- /dev/null +++ b/proto/cosmos/bank/v1beta1/genesis.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// GenesisState defines the bank module's genesis state. +message GenesisState { + // params defines all the paramaters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // balances is an array containing the balances of all the accounts. + repeated Balance balances = 2 [(gogoproto.nullable) = false]; + + // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + repeated cosmos.base.v1beta1.Coin supply = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + + // denom_metadata defines the metadata of the differents coins. + repeated Metadata denom_metadata = 4 [(gogoproto.moretags) = "yaml:\"denom_metadata\"", (gogoproto.nullable) = false]; +} + +// Balance defines an account address and balance pair used in the bank module's +// genesis state. +message Balance { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the balance holder. + string address = 1; + + // coins defines the different coins this balance holds. + repeated cosmos.base.v1beta1.Coin coins = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto new file mode 100644 index 0000000..e3a464f --- /dev/null +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -0,0 +1,159 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the balance of a single coin for a single account. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/{denom}"; + } + + // AllBalances queries the balance of all coins for a single account. + rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; + } + + // TotalSupply queries the total supply of all coins. + rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; + } + + // SupplyOf queries the supply of a single coin. + rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}"; + } + + // Params queries the parameters of x/bank module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + } + + // DenomsMetadata queries the client metadata of a given coin denomination. + rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; + } + + // DenomsMetadata queries the client metadata for all registered coin denominations. + rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +message QueryBalanceRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +message QueryBalanceResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + +// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +message QueryAllBalancesRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC +// method. +message QueryAllBalancesResponse { + // balances is the balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC +// method. +message QueryTotalSupplyRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC +// method +message QueryTotalSupplyResponse { + // supply is the supply of the coins + repeated cosmos.base.v1beta1.Coin supply = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +message QuerySupplyOfRequest { + // denom is the coin denom to query balances for. + string denom = 1; +} + +// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +message QuerySupplyOfResponse { + // amount is the supply of the coin. + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest defines the request type for querying x/bank parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/bank parameters. +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +message QueryDenomsMetadataRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC +// method. +message QueryDenomsMetadataResponse { + // metadata provides the client information for all the registered tokens. + repeated Metadata metadatas = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +message QueryDenomMetadataRequest { + // denom is the coin denom to query the metadata for. + string denom = 1; +} + +// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +// method. +message QueryDenomMetadataResponse { + // metadata describes and provides all the client information for the requested token. + Metadata metadata = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto new file mode 100644 index 0000000..26b2ab4 --- /dev/null +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package cosmos.bank.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; + +// Msg defines the bank Msg service. +service Msg { + // Send defines a method for sending coins from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); + + // MultiSend defines a method for sending coins from some accounts to other accounts. + rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); +} + +// MsgSend represents a message to send coins from one account to another. +message MsgSend { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} + +// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +message MsgMultiSend { + option (gogoproto.equal) = false; + + repeated Input inputs = 1 [(gogoproto.nullable) = false]; + repeated Output outputs = 2 [(gogoproto.nullable) = false]; +} + +// MsgMultiSendResponse defines the Msg/MultiSend response type. +message MsgMultiSendResponse {} diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto new file mode 100644 index 0000000..72da2aa --- /dev/null +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -0,0 +1,137 @@ +syntax = "proto3"; +package cosmos.base.abci.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; + +// TxResponse defines a structure containing relevant tx data and metadata. The +// tags are stringified and the log is JSON decoded. +message TxResponse { + option (gogoproto.goproto_getters) = false; + // The block height + int64 height = 1; + // The transaction hash. + string txhash = 2 [(gogoproto.customname) = "TxHash"]; + // Namespace for the Code + string codespace = 3; + // Response code. + uint32 code = 4; + // Result bytes, if any. + string data = 5; + // The output of the application's logger (raw string). May be + // non-deterministic. + string raw_log = 6; + // The output of the application's logger (typed). May be non-deterministic. + repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; + // Additional information. May be non-deterministic. + string info = 8; + // Amount of gas requested for transaction. + int64 gas_wanted = 9; + // Amount of gas consumed by transaction. + int64 gas_used = 10; + // The request transaction bytes. + google.protobuf.Any tx = 11; + // Time of the previous block. For heights > 1, it's the weighted median of + // the timestamps of the valid votes in the block.LastCommit. For height == 1, + // it's genesis time. + string timestamp = 12; +} + +// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +message ABCIMessageLog { + option (gogoproto.stringer) = true; + + uint32 msg_index = 1; + string log = 2; + + // Events contains a slice of Event objects that were emitted during some + // execution. + repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; +} + +// StringEvent defines en Event object wrapper where all the attributes +// contain key/value pairs that are strings instead of raw bytes. +message StringEvent { + option (gogoproto.stringer) = true; + + string type = 1; + repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; +} + +// Attribute defines an attribute wrapper where the key and value are +// strings instead of raw bytes. +message Attribute { + string key = 1; + string value = 2; +} + +// GasInfo defines tx execution gas context. +message GasInfo { + // GasWanted is the maximum units of work we allow this tx to perform. + uint64 gas_wanted = 1 [(gogoproto.moretags) = "yaml:\"gas_wanted\""]; + + // GasUsed is the amount of gas actually consumed. + uint64 gas_used = 2 [(gogoproto.moretags) = "yaml:\"gas_used\""]; +} + +// Result is the union of ResponseFormat and ResponseCheckTx. +message Result { + option (gogoproto.goproto_getters) = false; + + // Data is any data returned from message or handler execution. It MUST be + // length prefixed in order to separate data from multiple message executions. + bytes data = 1; + + // Log contains the log information from message or handler execution. + string log = 2; + + // Events contains a slice of Event objects that were emitted during message + // or handler execution. + repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; +} + +// SimulationResponse defines the response generated when a transaction is +// successfully simulated. +message SimulationResponse { + GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Result result = 2; +} + +// MsgData defines the data returned in a Result object during message +// execution. +message MsgData { + option (gogoproto.stringer) = true; + + string msg_type = 1; + bytes data = 2; +} + +// TxMsgData defines a list of MsgData. A transaction will have a MsgData object +// for each message. +message TxMsgData { + option (gogoproto.stringer) = true; + + repeated MsgData data = 1; +} + +// SearchTxsResult defines a structure for querying txs pageable +message SearchTxsResult { + option (gogoproto.stringer) = true; + + // Count of all txs + uint64 total_count = 1 [(gogoproto.moretags) = "yaml:\"total_count\"", (gogoproto.jsontag) = "total_count"]; + // Count of txs in current page + uint64 count = 2; + // Index of current page, start from 1 + uint64 page_number = 3 [(gogoproto.moretags) = "yaml:\"page_number\"", (gogoproto.jsontag) = "page_number"]; + // Count of total pages + uint64 page_total = 4 [(gogoproto.moretags) = "yaml:\"page_total\"", (gogoproto.jsontag) = "page_total"]; + // Max count txs per page + uint64 limit = 5; + // List of txs in current page + repeated TxResponse txs = 6; +} diff --git a/proto/cosmos/base/kv/v1beta1/kv.proto b/proto/cosmos/base/kv/v1beta1/kv.proto new file mode 100644 index 0000000..4e9b8d2 --- /dev/null +++ b/proto/cosmos/base/kv/v1beta1/kv.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.base.kv.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/kv"; + +// Pairs defines a repeated slice of Pair objects. +message Pairs { + repeated Pair pairs = 1 [(gogoproto.nullable) = false]; +} + +// Pair defines a key/value bytes tuple. +message Pair { + bytes key = 1; + bytes value = 2; +} diff --git a/proto/cosmos/base/query/v1beta1/pagination.proto b/proto/cosmos/base/query/v1beta1/pagination.proto new file mode 100644 index 0000000..784c479 --- /dev/null +++ b/proto/cosmos/base/query/v1beta1/pagination.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package cosmos.base.query.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +// PageRequest is to be embedded in gRPC request messages for efficient +// pagination. Ex: +// +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } +message PageRequest { + // key is a value returned in PageResponse.next_key to begin + // querying the next page most efficiently. Only one of offset or key + // should be set. + bytes key = 1; + + // offset is a numeric offset that can be used when key is unavailable. + // It is less efficient than using key. Only one of offset or key should + // be set. + uint64 offset = 2; + + // 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 = 3; + + // count_total is set to true to indicate that the result set should include + // a count of the total number of items available for pagination in UIs. + // count_total is only respected when offset is used. It is ignored when key + // is set. + bool count_total = 4; + + // reverse is set to true if results are to be returned in the descending order. + bool reverse = 5; +} + +// PageResponse is to be embedded in gRPC response messages where the +// corresponding request message has used PageRequest. +// +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } +message PageResponse { + // next_key is the key to be passed to PageRequest.key to + // query the next page most efficiently + bytes next_key = 1; + + // total is total number of results available if PageRequest.count_total + // was set, its value is undefined otherwise + uint64 total = 2; +} diff --git a/proto/cosmos/base/reflection/v1beta1/reflection.proto b/proto/cosmos/base/reflection/v1beta1/reflection.proto new file mode 100644 index 0000000..22670e7 --- /dev/null +++ b/proto/cosmos/base/reflection/v1beta1/reflection.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package cosmos.base.reflection.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection"; + +// ReflectionService defines a service for interface reflection. +service ReflectionService { + // ListAllInterfaces lists all the interfaces registered in the interface + // registry. + rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces"; + }; + + // ListImplementations list all the concrete types that implement a given + // interface. + rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/" + "{interface_name}/implementations"; + }; +} + +// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. +message ListAllInterfacesRequest {} + +// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +message ListAllInterfacesResponse { + // interface_names is an array of all the registered interfaces. + repeated string interface_names = 1; +} + +// ListImplementationsRequest is the request type of the ListImplementations +// RPC. +message ListImplementationsRequest { + // interface_name defines the interface to query the implementations for. + string interface_name = 1; +} + +// ListImplementationsResponse is the response type of the ListImplementations +// RPC. +message ListImplementationsResponse { + repeated string implementation_message_names = 1; +} diff --git a/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/proto/cosmos/base/reflection/v2alpha1/reflection.proto new file mode 100644 index 0000000..3e8e940 --- /dev/null +++ b/proto/cosmos/base/reflection/v2alpha1/reflection.proto @@ -0,0 +1,217 @@ +syntax = "proto3"; +package cosmos.base.reflection.v2alpha1; + +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"; + +// AppDescriptor describes a cosmos-sdk based application +message AppDescriptor { + // AuthnDescriptor provides information on how to authenticate transactions on the application + // NOTE: experimental and subject to change in future releases. + AuthnDescriptor authn = 1; + // chain provides the chain descriptor + ChainDescriptor chain = 2; + // codec provides metadata information regarding codec related types + CodecDescriptor codec = 3; + // configuration provides metadata information regarding the sdk.Config type + ConfigurationDescriptor configuration = 4; + // query_services provides metadata information regarding the available queriable endpoints + QueryServicesDescriptor query_services = 5; + // tx provides metadata information regarding how to send transactions to the given application + TxDescriptor tx = 6; +} + +// TxDescriptor describes the accepted transaction type +message TxDescriptor { + // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + // it is not meant to support polymorphism of transaction types, it is supposed to be used by + // reflection clients to understand if they can handle a specific transaction type in an application. + string fullname = 1; + // msgs lists the accepted application messages (sdk.Msg) + repeated MsgDescriptor msgs = 2; +} + +// AuthnDescriptor provides information on how to sign transactions without relying +// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures +message AuthnDescriptor { + // sign_modes defines the supported signature algorithm + repeated SigningModeDescriptor sign_modes = 1; +} + +// SigningModeDescriptor provides information on a signing flow of the application +// NOTE(fdymylja): here we could go as far as providing an entire flow on how +// to sign a message given a SigningModeDescriptor, but it's better to think about +// this another time +message SigningModeDescriptor { + // name defines the unique name of the signing mode + string name = 1; + // number is the unique int32 identifier for the sign_mode enum + int32 number = 2; + // authn_info_provider_method_fullname defines the fullname of the method to call to get + // the metadata required to authenticate using the provided sign_modes + string authn_info_provider_method_fullname = 3; +} + +// ChainDescriptor describes chain information of the application +message ChainDescriptor { + // id is the chain id + string id = 1; +} + +// CodecDescriptor describes the registered interfaces and provides metadata information on the types +message CodecDescriptor { + // interfaces is a list of the registerted interfaces descriptors + repeated InterfaceDescriptor interfaces = 1; +} + +// InterfaceDescriptor describes the implementation of an interface +message InterfaceDescriptor { + // fullname is the name of the interface + string fullname = 1; + // interface_accepting_messages contains information regarding the proto messages which contain the interface as + // google.protobuf.Any field + repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2; + // interface_implementers is a list of the descriptors of the interface implementers + repeated InterfaceImplementerDescriptor interface_implementers = 3; +} + +// InterfaceImplementerDescriptor describes an interface implementer +message InterfaceImplementerDescriptor { + // fullname is the protobuf queryable name of the interface implementer + string fullname = 1; + // type_url defines the type URL used when marshalling the type as any + // this is required so we can provide type safe google.protobuf.Any marshalling and + // unmarshalling, making sure that we don't accept just 'any' type + // in our interface fields + string type_url = 2; +} + +// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains +// an interface represented as a google.protobuf.Any +message InterfaceAcceptingMessageDescriptor { + // fullname is the protobuf fullname of the type containing the interface + string fullname = 1; + // field_descriptor_names is a list of the protobuf name (not fullname) of the field + // which contains the interface as google.protobuf.Any (the interface is the same, but + // it can be in multiple fields of the same proto message) + repeated string field_descriptor_names = 2; +} + +// ConfigurationDescriptor contains metadata information on the sdk.Config +message ConfigurationDescriptor { + // bech32_account_address_prefix is the account address prefix + string bech32_account_address_prefix = 1; +} + +// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction +message MsgDescriptor { + // msg_type_url contains the TypeURL of a sdk.Msg. + string msg_type_url = 1; +} + +// ReflectionService defines a service for application reflection. +service ReflectionService { + // GetAuthnDescriptor returns information on how to authenticate transactions in the application + // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in + // future releases of the cosmos-sdk. + rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn"; + } + // GetChainDescriptor returns the description of the chain + rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain"; + }; + // GetCodecDescriptor returns the descriptor of the codec of the application + rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec"; + } + // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application + rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration"; + } + // GetQueryServicesDescriptor returns the available gRPC queryable services of the application + rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services"; + } + // GetTxDescriptor returns information on the used transaction object and available msgs that can be used + rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) { + option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor"; + } +} + +// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC +message GetAuthnDescriptorRequest {} +// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC +message GetAuthnDescriptorResponse { + // authn describes how to authenticate to the application when sending transactions + AuthnDescriptor authn = 1; +} + +// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC +message GetChainDescriptorRequest {} +// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC +message GetChainDescriptorResponse { + // chain describes application chain information + ChainDescriptor chain = 1; +} + +// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC +message GetCodecDescriptorRequest {} +// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC +message GetCodecDescriptorResponse { + // codec describes the application codec such as registered interfaces and implementations + CodecDescriptor codec = 1; +} + +// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorRequest {} +// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC +message GetConfigurationDescriptorResponse { + // config describes the application's sdk.Config + ConfigurationDescriptor config = 1; +} + +// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorRequest {} +// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC +message GetQueryServicesDescriptorResponse { + // queries provides information on the available queryable services + QueryServicesDescriptor queries = 1; +} + +// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC +message GetTxDescriptorRequest {} +// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC +message GetTxDescriptorResponse { + // tx provides information on msgs that can be forwarded to the application + // alongside the accepted transaction protobuf type + TxDescriptor tx = 1; +} + +// QueryServicesDescriptor contains the list of cosmos-sdk queriable services +message QueryServicesDescriptor { + // query_services is a list of cosmos-sdk QueryServiceDescriptor + repeated QueryServiceDescriptor query_services = 1; +} + +// QueryServiceDescriptor describes a cosmos-sdk queryable service +message QueryServiceDescriptor { + // fullname is the protobuf fullname of the service descriptor + string fullname = 1; + // is_module describes if this service is actually exposed by an application's module + bool is_module = 2; + // methods provides a list of query service methods + repeated QueryMethodDescriptor methods = 3; +} + +// QueryMethodDescriptor describes a queryable method of a query service +// no other info is provided beside method name and tendermint queryable path +// because it would be redundant with the grpc reflection service +message QueryMethodDescriptor { + // name is the protobuf name (not fullname) of the method + string name = 1; + // full_query_path is the path that can be used to query + // this method via tendermint abci.Query + string full_query_path = 2; +} diff --git a/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/proto/cosmos/base/snapshots/v1beta1/snapshot.proto new file mode 100644 index 0000000..9ac5a7c --- /dev/null +++ b/proto/cosmos/base/snapshots/v1beta1/snapshot.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package cosmos.base.snapshots.v1beta1; + +import "gogoproto/gogo.proto"; + +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; + Metadata metadata = 5 [(gogoproto.nullable) = false]; +} + +// Metadata contains SDK-specific snapshot metadata. +message Metadata { + repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes +} \ No newline at end of file diff --git a/proto/cosmos/base/store/v1beta1/commit_info.proto b/proto/cosmos/base/store/v1beta1/commit_info.proto new file mode 100644 index 0000000..98a33d3 --- /dev/null +++ b/proto/cosmos/base/store/v1beta1/commit_info.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// CommitInfo defines commit information used by the multi-store when committing +// a version/height. +message CommitInfo { + int64 version = 1; + repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; +} + +// StoreInfo defines store-specific commit information. It contains a reference +// between a store name and the commit ID. +message StoreInfo { + string name = 1; + CommitID commit_id = 2 [(gogoproto.nullable) = false]; +} + +// CommitID defines the committment information when a specific store is +// committed. +message CommitID { + option (gogoproto.goproto_stringer) = false; + + int64 version = 1; + bytes hash = 2; +} diff --git a/proto/cosmos/base/store/v1beta1/listening.proto b/proto/cosmos/base/store/v1beta1/listening.proto new file mode 100644 index 0000000..186ecee --- /dev/null +++ b/proto/cosmos/base/store/v1beta1/listening.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +// Deletes +message StoreKVPair { + string store_key = 1; // the store key for the KVStore this pair originates from + bool delete = 2; // true indicates a delete operation, false indicates a set operation + bytes key = 3; + bytes value = 4; +} diff --git a/proto/cosmos/base/store/v1beta1/snapshot.proto b/proto/cosmos/base/store/v1beta1/snapshot.proto new file mode 100644 index 0000000..8348550 --- /dev/null +++ b/proto/cosmos/base/store/v1beta1/snapshot.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package cosmos.base.store.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/store/types"; + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +message SnapshotItem { + // item is the specific type of snapshot item. + oneof item { + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +message SnapshotStoreItem { + string name = 1; +} + +// SnapshotIAVLItem is an exported IAVL node. +message SnapshotIAVLItem { + bytes key = 1; + bytes value = 2; + int64 version = 3; + int32 height = 4; +} \ No newline at end of file diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto new file mode 100644 index 0000000..c98110c --- /dev/null +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -0,0 +1,136 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +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"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; + +// Service defines the gRPC querier service for tendermint queries. +service Service { + // GetNodeInfo queries the current node info. + 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}"; + } + + // GetLatestValidatorSet queries latest validator-set. + 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}"; + } +} + +// 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. +message GetValidatorSetByHeightResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// 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. +message GetLatestValidatorSetResponse { + int64 block_height = 1; + repeated Validator validators = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// Validator is the type for the validator-set. +message Validator { + string address = 1; + google.protobuf.Any pub_key = 2; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +// 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. +message GetBlockByHeightResponse { + .tendermint.types.BlockID block_id = 1; + .tendermint.types.Block block = 2; +} + +// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +message GetLatestBlockRequest {} + +// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +message GetLatestBlockResponse { + .tendermint.types.BlockID block_id = 1; + .tendermint.types.Block block = 2; +} + +// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +message GetSyncingRequest {} + +// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +message GetSyncingResponse { + bool syncing = 1; +} + +// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +message GetNodeInfoRequest {} + +// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. +message GetNodeInfoResponse { + .tendermint.p2p.DefaultNodeInfo default_node_info = 1; + VersionInfo application_version = 2; +} + +// VersionInfo is the type for the GetNodeInfoResponse message. +message VersionInfo { + string name = 1; + string app_name = 2; + string version = 3; + string git_commit = 4; + string build_tags = 5; + string go_version = 6; + repeated Module build_deps = 7; + string cosmos_sdk_version = 8; +} + +// Module is the type for VersionInfo +message Module { + // module path + string path = 1; + // module version + string version = 2; + // checksum + string sum = 3; +} diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto new file mode 100644 index 0000000..fab7528 --- /dev/null +++ b/proto/cosmos/base/v1beta1/coin.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package cosmos.base.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; + +// Coin defines a token with a denomination and an amount. +// +// NOTE: The amount field is an Int which implements the custom method +// signatures required by gogoproto. +message Coin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecCoin defines a token with a denomination and a decimal amount. +// +// NOTE: The amount field is an Dec which implements the custom method +// signatures required by gogoproto. +message DecCoin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} + +// IntProto defines a Protobuf wrapper around an Int object. +message IntProto { + string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecProto defines a Protobuf wrapper around a Dec object. +message DecProto { + string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/capability/v1beta1/capability.proto b/proto/cosmos/capability/v1beta1/capability.proto new file mode 100644 index 0000000..1c8332f --- /dev/null +++ b/proto/cosmos/capability/v1beta1/capability.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +import "gogoproto/gogo.proto"; + +// Capability defines an implementation of an object capability. The index +// provided to a Capability must be globally unique. +message Capability { + option (gogoproto.goproto_stringer) = false; + + uint64 index = 1 [(gogoproto.moretags) = "yaml:\"index\""]; +} + +// Owner defines a single capability owner. An owner is defined by the name of +// capability and the module name. +message Owner { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + string module = 1 [(gogoproto.moretags) = "yaml:\"module\""]; + string name = 2 [(gogoproto.moretags) = "yaml:\"name\""]; +} + +// CapabilityOwners defines a set of owners of a single Capability. The set of +// owners must be unique. +message CapabilityOwners { + repeated Owner owners = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/capability/v1beta1/genesis.proto b/proto/cosmos/capability/v1beta1/genesis.proto new file mode 100644 index 0000000..05bb0af --- /dev/null +++ b/proto/cosmos/capability/v1beta1/genesis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package cosmos.capability.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/capability/v1beta1/capability.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; + +// GenesisOwners defines the capability owners with their corresponding index. +message GenesisOwners { + // index is the index of the capability owner. + uint64 index = 1; + + // index_owners are the owners at the given index. + CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"index_owners\""]; +} + +// GenesisState defines the capability module's genesis state. +message GenesisState { + // index is the capability global index. + uint64 index = 1; + + // owners represents a map from index to owners of the capability index + // index key is string to allow amino marshalling. + repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/crisis/v1beta1/genesis.proto b/proto/cosmos/crisis/v1beta1/genesis.proto new file mode 100644 index 0000000..5b0ff7e --- /dev/null +++ b/proto/cosmos/crisis/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// GenesisState defines the crisis module's genesis state. +message GenesisState { + // constant_fee is the fee used to verify the invariant in the crisis + // module. + cosmos.base.v1beta1.Coin constant_fee = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"constant_fee\""]; +} diff --git a/proto/cosmos/crisis/v1beta1/tx.proto b/proto/cosmos/crisis/v1beta1/tx.proto new file mode 100644 index 0000000..26457ad --- /dev/null +++ b/proto/cosmos/crisis/v1beta1/tx.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.crisis.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; + +import "gogoproto/gogo.proto"; + +// Msg defines the bank Msg service. +service Msg { + // VerifyInvariant defines a method to verify a particular invariance. + rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); +} + +// MsgVerifyInvariant represents a message to verify a particular invariance. +message MsgVerifyInvariant { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string sender = 1; + string invariant_module_name = 2 [(gogoproto.moretags) = "yaml:\"invariant_module_name\""]; + string invariant_route = 3 [(gogoproto.moretags) = "yaml:\"invariant_route\""]; +} + +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +message MsgVerifyInvariantResponse {} diff --git a/proto/cosmos/crypto/ed25519/keys.proto b/proto/cosmos/crypto/ed25519/keys.proto new file mode 100644 index 0000000..6ffec34 --- /dev/null +++ b/proto/cosmos/crypto/ed25519/keys.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package cosmos.crypto.ed25519; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; + +// PubKey is an ed25519 public key for handling Tendermint keys in SDK. +// It's needed for Any serialization and SDK compatibility. +// It must not be used in a non Tendermint key context because it doesn't implement +// ADR-28. Nevertheless, you will like to use ed25519 in app user level +// then you must create a new proto message and follow ADR-28 for Address construction. +message PubKey { + option (gogoproto.goproto_stringer) = false; + + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; +} + +// Deprecated: PrivKey defines a ed25519 private key. +// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. +message PrivKey { + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; +} diff --git a/proto/cosmos/crypto/multisig/keys.proto b/proto/cosmos/crypto/multisig/keys.proto new file mode 100644 index 0000000..f8398e8 --- /dev/null +++ b/proto/cosmos/crypto/multisig/keys.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package cosmos.crypto.multisig; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; + +// LegacyAminoPubKey specifies a public key type +// which nests multiple public keys and a threshold, +// it uses legacy amino address rules. +message LegacyAminoPubKey { + option (gogoproto.goproto_getters) = false; + + uint32 threshold = 1 [(gogoproto.moretags) = "yaml:\"threshold\""]; + repeated google.protobuf.Any public_keys = 2 + [(gogoproto.customname) = "PubKeys", (gogoproto.moretags) = "yaml:\"pubkeys\""]; +} diff --git a/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/proto/cosmos/crypto/multisig/v1beta1/multisig.proto new file mode 100644 index 0000000..bf671f1 --- /dev/null +++ b/proto/cosmos/crypto/multisig/v1beta1/multisig.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.crypto.multisig.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; + +// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. +// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers +// signed and with which modes. +message MultiSignature { + option (gogoproto.goproto_unrecognized) = true; + repeated bytes signatures = 1; +} + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after proto encoding. +// This is not thread safe, and is not intended for concurrent usage. +message CompactBitArray { + option (gogoproto.goproto_stringer) = false; + + uint32 extra_bits_stored = 1; + bytes elems = 2; +} diff --git a/proto/cosmos/crypto/secp256k1/keys.proto b/proto/cosmos/crypto/secp256k1/keys.proto new file mode 100644 index 0000000..a227257 --- /dev/null +++ b/proto/cosmos/crypto/secp256k1/keys.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.crypto.secp256k1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; + +// PubKey defines a secp256k1 public key +// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte +// if the y-coordinate is the lexicographically largest of the two associated with +// the x-coordinate. Otherwise the first byte is a 0x03. +// This prefix is followed with the x-coordinate. +message PubKey { + option (gogoproto.goproto_stringer) = false; + + bytes key = 1; +} + +// PrivKey defines a secp256k1 private key. +message PrivKey { + bytes key = 1; +} diff --git a/proto/cosmos/crypto/secp256r1/keys.proto b/proto/cosmos/crypto/secp256r1/keys.proto new file mode 100644 index 0000000..b0aad99 --- /dev/null +++ b/proto/cosmos/crypto/secp256r1/keys.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package cosmos.crypto.secp256r1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; +option (gogoproto.messagename_all) = true; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// PubKey defines a secp256r1 ECDSA public key. +message PubKey { + // Point on secp256r1 curve in a compressed representation as specified in section + // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; +} + +// PrivKey defines a secp256r1 ECDSA private key. +message PrivKey { + // secret number serialized using big-endian encoding + bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; +} diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto new file mode 100644 index 0000000..ae98ec0 --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/distribution.proto @@ -0,0 +1,157 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Params defines the set of params for the distribution module. +message Params { + option (gogoproto.goproto_stringer) = false; + string community_tax = 1 [ + (gogoproto.moretags) = "yaml:\"community_tax\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string base_proposer_reward = 2 [ + (gogoproto.moretags) = "yaml:\"base_proposer_reward\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string bonus_proposer_reward = 3 [ + (gogoproto.moretags) = "yaml:\"bonus_proposer_reward\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + bool withdraw_addr_enabled = 4 [(gogoproto.moretags) = "yaml:\"withdraw_addr_enabled\""]; +} + +// ValidatorHistoricalRewards represents historical rewards for a validator. +// Height is implicit within the store key. +// Cumulative reward ratio is the sum from the zeroeth period +// until this period of rewards / tokens, per the spec. +// The reference count indicates the number of objects +// which might need to reference this historical entry at any point. +// ReferenceCount = +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization +message ValidatorHistoricalRewards { + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ + (gogoproto.moretags) = "yaml:\"cumulative_reward_ratio\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + uint32 reference_count = 2 [(gogoproto.moretags) = "yaml:\"reference_count\""]; +} + +// ValidatorCurrentRewards represents current rewards and current +// period for a validator kept as a running counter and incremented +// each block as long as the validator's tokens remain constant. +message ValidatorCurrentRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + uint64 period = 2; +} + +// ValidatorAccumulatedCommission represents accumulated commission +// for a validator kept as a running counter, can be withdrawn at any time. +message ValidatorAccumulatedCommission { + repeated cosmos.base.v1beta1.DecCoin commission = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +// for a validator inexpensive to track, allows simple sanity checks. +message ValidatorOutstandingRewards { + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.moretags) = "yaml:\"rewards\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; +} + +// ValidatorSlashEvent represents a validator slash event. +// Height is implicit within the store key. +// This is needed to calculate appropriate amount of staking tokens +// for delegations which are withdrawn after a slash has occurred. +message ValidatorSlashEvent { + uint64 validator_period = 1 [(gogoproto.moretags) = "yaml:\"validator_period\""]; + string fraction = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +message ValidatorSlashEvents { + option (gogoproto.goproto_stringer) = false; + repeated ValidatorSlashEvent validator_slash_events = 1 + [(gogoproto.moretags) = "yaml:\"validator_slash_events\"", (gogoproto.nullable) = false]; +} + +// FeePool is the global fee pool for distribution. +message FeePool { + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.moretags) = "yaml:\"community_pool\"" + ]; +} + +// CommunityPoolSpendProposal details a proposal for use of community funds, +// 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; + + string title = 1; + string description = 2; + string recipient = 3; + repeated cosmos.base.v1beta1.Coin amount = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// DelegatorStartingInfo represents the starting info for a delegator reward +// period. It tracks the previous validator period, the delegation's amount of +// staking token, and the creation height (to check later on if any slashes have +// occurred). NOTE: Even though validators are slashed to whole staking tokens, +// the delegators within the validator may be left with less than a full token, +// thus sdk.Dec is used. +message DelegatorStartingInfo { + uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""]; + string stake = 2 [ + (gogoproto.moretags) = "yaml:\"stake\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 height = 3 [(gogoproto.moretags) = "yaml:\"creation_height\"", (gogoproto.jsontag) = "creation_height"]; +} + +// DelegationDelegatorReward represents the properties +// of a delegator's delegation reward. +message DelegationDelegatorReward { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + + repeated cosmos.base.v1beta1.DecCoin reward = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +// with a deposit +message CommunityPoolSpendProposalWithDeposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; + string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; + string recipient = 3 [(gogoproto.moretags) = "yaml:\"recipient\""]; + string amount = 4 [(gogoproto.moretags) = "yaml:\"amount\""]; + string deposit = 5 [(gogoproto.moretags) = "yaml:\"deposit\""]; +} diff --git a/proto/cosmos/distribution/v1beta1/genesis.proto b/proto/cosmos/distribution/v1beta1/genesis.proto new file mode 100644 index 0000000..c0b17cd --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/genesis.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; + +// DelegatorWithdrawInfo is the address for where distributions rewards are +// withdrawn to by default this struct is only used at genesis to feed in +// default withdraw addresses. +message DelegatorWithdrawInfo { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + + // withdraw_address is the address to withdraw the delegation rewards to. + string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; +} + +// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +message ValidatorOutstandingRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + + // outstanding_rewards represents the oustanding rewards of a validator. + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outstanding_rewards\"" + ]; +} + +// ValidatorAccumulatedCommissionRecord is used for import / export via genesis +// json. +message ValidatorAccumulatedCommissionRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + + // accumulated is the accumulated commission of a validator. + ValidatorAccumulatedCommission accumulated = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"accumulated\""]; +} + +// ValidatorHistoricalRewardsRecord is used for import / export via genesis +// json. +message ValidatorHistoricalRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + + // period defines the period the historical rewards apply to. + uint64 period = 2; + + // rewards defines the historical rewards of a validator. + ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; +} + +// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +message ValidatorCurrentRewardsRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + + // rewards defines the current rewards of a validator. + ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; +} + +// DelegatorStartingInfoRecord used for import / export via genesis json. +message DelegatorStartingInfoRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address is the address of the delegator. + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + + // validator_address is the address of the validator. + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + + // starting_info defines the starting info of a delegator. + DelegatorStartingInfo starting_info = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"starting_info\""]; +} + +// ValidatorSlashEventRecord is used for import / export via genesis json. +message ValidatorSlashEventRecord { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator_address is the address of the validator. + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + // height defines the block height at which the slash event occured. + uint64 height = 2; + // period is the period of the slash event. + uint64 period = 3; + // validator_slash_event describes the slash event. + ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"event\""]; +} + +// GenesisState defines the distribution module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the paramaters of the module. + Params params = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"params\""]; + + // fee_pool defines the fee pool at genesis. + FeePool fee_pool = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"fee_pool\""]; + + // fee_pool defines the delegator withdraw infos at genesis. + repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_withdraw_infos\""]; + + // fee_pool defines the previous proposer at genesis. + string previous_proposer = 4 [(gogoproto.moretags) = "yaml:\"previous_proposer\""]; + + // fee_pool defines the outstanding rewards of all validators at genesis. + repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards\""]; + + // fee_pool defines the accumulated commisions of all validators at genesis. + repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_accumulated_commissions\""]; + + // fee_pool defines the historical rewards of all validators at genesis. + repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_historical_rewards\""]; + + // fee_pool defines the current rewards of all validators at genesis. + repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_current_rewards\""]; + + // fee_pool defines the delegator starting infos at genesis. + repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_starting_infos\""]; + + // fee_pool defines the validator slash events at genesis. + repeated ValidatorSlashEventRecord validator_slash_events = 10 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_slash_events\""]; +} diff --git a/proto/cosmos/distribution/v1beta1/query.proto b/proto/cosmos/distribution/v1beta1/query.proto new file mode 100644 index 0000000..2991218 --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/query.proto @@ -0,0 +1,218 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; + +// Query defines the gRPC querier service for distribution module. +service Query { + // Params queries params of the distribution module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; + } + + // ValidatorOutstandingRewards queries rewards of a validator address. + rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) + returns (QueryValidatorOutstandingRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/outstanding_rewards"; + } + + // ValidatorCommission queries accumulated commission for a validator. + rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" + "{validator_address}/commission"; + } + + // ValidatorSlashes queries slash events of a validator. + rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes"; + } + + // DelegationRewards queries the total rewards accrued by a delegation. + rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/" + "{validator_address}"; + } + + // DelegationTotalRewards queries the total rewards accrued by a each + // validator. + rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; + } + + // DelegatorValidators queries the validators of a delegator. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/validators"; + } + + // DelegatorWithdrawAddress queries withdraw address of a delegator. + rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" + "{delegator_address}/withdraw_address"; + } + + // CommunityPool queries the community pool coins. + rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; + } +} + +// 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]; +} + +// QueryValidatorOutstandingRewardsRequest is the request type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsRequest { + // validator_address defines the validator address to query for. + string validator_address = 1; +} + +// QueryValidatorOutstandingRewardsResponse is the response type for the +// Query/ValidatorOutstandingRewards RPC method. +message QueryValidatorOutstandingRewardsResponse { + ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorCommissionRequest is the request type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionRequest { + // validator_address defines the validator address to query for. + string validator_address = 1; +} + +// QueryValidatorCommissionResponse is the response type for the +// Query/ValidatorCommission RPC method +message QueryValidatorCommissionResponse { + // commission defines the commision the validator received. + ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorSlashesRequest is the request type for the +// Query/ValidatorSlashes RPC method +message QueryValidatorSlashesRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + // validator_address defines the validator address to query for. + string validator_address = 1; + // starting_height defines the optional starting height to query the slashes. + uint64 starting_height = 2; + // starting_height defines the optional ending height to query the slashes. + uint64 ending_height = 3; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryValidatorSlashesResponse is the response type for the +// Query/ValidatorSlashes RPC method. +message QueryValidatorSlashesResponse { + // slashes defines the slashes the validator received. + repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRewardsRequest is the request type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1; + // validator_address defines the validator address to query for. + string validator_address = 2; +} + +// QueryDelegationRewardsResponse is the response type for the +// Query/DelegationRewards RPC method. +message QueryDelegationRewardsResponse { + // rewards defines the rewards accrued by a delegation. + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; +} + +// QueryDelegationTotalRewardsRequest is the request type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // delegator_address defines the delegator address to query for. + string delegator_address = 1; +} + +// QueryDelegationTotalRewardsResponse is the response type for the +// Query/DelegationTotalRewards RPC method. +message QueryDelegationTotalRewardsResponse { + // rewards defines all the rewards accrued by a delegator. + repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false]; + // total defines the sum of all the rewards. + repeated cosmos.base.v1beta1.DecCoin total = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; +} + +// QueryDelegatorValidatorsRequest is the request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1; +} + +// QueryDelegatorValidatorsResponse is the response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validators defines the validators a delegator is delegating for. + repeated string validators = 1; +} + +// QueryDelegatorWithdrawAddressRequest is the request type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_address defines the delegator address to query for. + string delegator_address = 1; +} + +// QueryDelegatorWithdrawAddressResponse is the response type for the +// Query/DelegatorWithdrawAddress RPC method. +message QueryDelegatorWithdrawAddressResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // withdraw_address defines the delegator address to query for. + string withdraw_address = 1; +} + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +message QueryCommunityPoolRequest {} + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +message QueryCommunityPoolResponse { + // pool defines community pool's coins. + repeated cosmos.base.v1beta1.DecCoin pool = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto new file mode 100644 index 0000000..e6ce478 --- /dev/null +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; +package cosmos.distribution.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Msg defines the distribution Msg service. +service Msg { + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); + + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); + + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); + + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); +} + +// MsgSetWithdrawAddress sets the withdraw address for +// a delegator (or validator self-delegation). +message MsgSetWithdrawAddress { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; +} + +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +message MsgSetWithdrawAddressResponse {} + +// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator +// from a single validator. +message MsgWithdrawDelegatorReward { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; +} + +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +message MsgWithdrawDelegatorRewardResponse {} + +// MsgWithdrawValidatorCommission withdraws the full commission to the validator +// address. +message MsgWithdrawValidatorCommission { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; +} + +// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +message MsgWithdrawValidatorCommissionResponse {} + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +message MsgFundCommunityPool { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string depositor = 2; +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +message MsgFundCommunityPoolResponse {} diff --git a/proto/cosmos/evidence/v1beta1/evidence.proto b/proto/cosmos/evidence/v1beta1/evidence.proto new file mode 100644 index 0000000..14612c3 --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/evidence.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +// Equivocation implements the Evidence interface and defines evidence of double +// signing misbehavior. +message Equivocation { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + int64 height = 1; + google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + int64 power = 3; + string consensus_address = 4 [(gogoproto.moretags) = "yaml:\"consensus_address\""]; +} \ No newline at end of file diff --git a/proto/cosmos/evidence/v1beta1/genesis.proto b/proto/cosmos/evidence/v1beta1/genesis.proto new file mode 100644 index 0000000..199f446 --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +import "google/protobuf/any.proto"; + +// GenesisState defines the evidence module's genesis state. +message GenesisState { + // evidence defines all the evidence at genesis. + repeated google.protobuf.Any evidence = 1; +} diff --git a/proto/cosmos/evidence/v1beta1/query.proto b/proto/cosmos/evidence/v1beta1/query.proto new file mode 100644 index 0000000..eda0054 --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/query.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; + +// Query defines the gRPC querier service. +service Query { + // Evidence queries evidence based on evidence hash. + rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{evidence_hash}"; + } + + // AllEvidence queries all evidence. + rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) { + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence"; + } +} + +// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +message QueryEvidenceRequest { + // evidence_hash defines the hash of the requested evidence. + bytes evidence_hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; +} + +// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +message QueryEvidenceResponse { + // evidence returns the requested evidence. + google.protobuf.Any evidence = 1; +} + +// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +// method. +message QueryAllEvidenceResponse { + // evidence returns all evidences. + repeated google.protobuf.Any evidence = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/evidence/v1beta1/tx.proto b/proto/cosmos/evidence/v1beta1/tx.proto new file mode 100644 index 0000000..38795f2 --- /dev/null +++ b/proto/cosmos/evidence/v1beta1/tx.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +// Msg defines the evidence Msg service. +service Msg { + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); +} + +// MsgSubmitEvidence represents a message that supports submitting arbitrary +// Evidence of misbehavior such as equivocation or counterfactual signing. +message MsgSubmitEvidence { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string submitter = 1; + google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; +} + +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +message MsgSubmitEvidenceResponse { + // hash defines the hash of the evidence. + bytes hash = 4; +} diff --git a/proto/cosmos/feegrant/v1beta1/feegrant.proto b/proto/cosmos/feegrant/v1beta1/feegrant.proto new file mode 100644 index 0000000..dfd9b78 --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +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 +// that optionally expires. The grantee can use up to SpendLimit to cover fees. +message BasicAllowance { + 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 + // 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"]; + + // expiration specifies an optional time when this allowance expires + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; +} + +// 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) = "FeeAllowanceI"; + + // basic specifies a struct of `BasicAllowance` + BasicAllowance basic = 1 [(gogoproto.nullable) = false]; + + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + + // period_spend_limit specifies the maximum number of coins that can be spent + // in the period + repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // period_can_spend is the number of coins left to be spent before the period_reset time + repeated cosmos.base.v1beta1.Coin period_can_spend = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // period_reset is the time at which this period resets and a new one begins, + // it is calculated from the start time of the first transaction after the + // last period ended + google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +// AllowedMsgAllowance creates allowance only for specified message types. +message AllowedMsgAllowance { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + + // allowance can be any of basic and filtered fee allowance. + 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; +} + +// Grant is stored in the KVStore to record a grant with full context +message Grant { + // granter is the address of the user granting an allowance of their funds. + string granter = 1; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2; + + // allowance can be any of basic and filtered fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; +} diff --git a/proto/cosmos/feegrant/v1beta1/genesis.proto b/proto/cosmos/feegrant/v1beta1/genesis.proto new file mode 100644 index 0000000..4c1e51f --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/feegrant/v1beta1/feegrant.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// GenesisState contains a set of fee allowances, persisted from the store +message GenesisState { + repeated Grant allowances = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/feegrant/v1beta1/query.proto b/proto/cosmos/feegrant/v1beta1/query.proto new file mode 100644 index 0000000..00ea598 --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/query.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Query defines the gRPC querier service. +service Query { + + // Allowance returns fee granted to the grantee by the granter. + rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; + } + + // Allowances returns all the grants for address. + rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; + } +} + +// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +message QueryAllowanceRequest { + // granter is the address of the user granting an allowance of their funds. + string granter = 1; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2; +} + +// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. +message QueryAllowanceResponse { + // allowance is a allowance granted for grantee by granter. + cosmos.feegrant.v1beta1.Grant allowance = 1; +} + +// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +message QueryAllowancesRequest { + string grantee = 1; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +message QueryAllowancesResponse { + // allowances are allowance's granted for grantee by granter. + repeated cosmos.feegrant.v1beta1.Grant allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto new file mode 100644 index 0000000..e7134be --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/tx.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; + +// Msg defines the feegrant msg service. +service Msg { + + // GrantAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); + + // RevokeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); +} + +// MsgGrantAllowance adds permission for Grantee to spend up to Allowance +// of fees from the account of Granter. +message MsgGrantAllowance { + // granter is the address of the user granting an allowance of their funds. + string granter = 1; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2; + + // allowance can be any of basic and filtered fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; +} + +// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. +message MsgGrantAllowanceResponse {} + +// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +message MsgRevokeAllowance { + // granter is the address of the user granting an allowance of their funds. + string granter = 1; + + // grantee is the address of the user being granted an allowance of another user's funds. + string grantee = 2; +} + +// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +message MsgRevokeAllowanceResponse {} diff --git a/proto/cosmos/genutil/v1beta1/genesis.proto b/proto/cosmos/genutil/v1beta1/genesis.proto new file mode 100644 index 0000000..a020779 --- /dev/null +++ b/proto/cosmos/genutil/v1beta1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package cosmos.genutil.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; + +// GenesisState defines the raw genesis transaction in JSON. +message GenesisState { + // gen_txs defines the genesis transactions. + repeated bytes gen_txs = 1 [ + (gogoproto.casttype) = "encoding/json.RawMessage", + (gogoproto.jsontag) = "gentxs", + (gogoproto.moretags) = "yaml:\"gentxs\"" + ]; +} diff --git a/proto/cosmos/gov/v1beta1/genesis.proto b/proto/cosmos/gov/v1beta1/genesis.proto new file mode 100644 index 0000000..a999500 --- /dev/null +++ b/proto/cosmos/gov/v1beta1/genesis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package cosmos.gov.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/gov/v1beta1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""]; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; + // votes defines all the votes present at genesis. + repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; + // params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; + // params defines all the paramaters of related to voting. + VotingParams voting_params = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; + // params defines all the paramaters of related to tally. + TallyParams tally_params = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; +} diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto new file mode 100644 index 0000000..f040772 --- /dev/null +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -0,0 +1,197 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; +} + +// WeightedVoteOption defines a unit of vote for vote split. +message WeightedVoteOption { + VoteOption option = 1; + string weight = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"weight\"" + ]; +} + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval. +message TextProposal { + option (cosmos_proto.implements_interface) = "Content"; + + option (gogoproto.equal) = true; + + string title = 1; + string description = 2; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string depositor = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + option (gogoproto.equal) = true; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; + ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + TallyResult final_tally_result = 4 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; + google.protobuf.Timestamp deposit_end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"total_deposit\"" + ]; + google.protobuf.Timestamp voting_start_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; + google.protobuf.Timestamp voting_end_time = 9 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + option (gogoproto.equal) = true; + + string yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string no_with_veto = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"no_with_veto\"" + ]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if and only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + VoteOption option = 3 [deprecated = true]; + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"min_deposit\"", + (gogoproto.jsontag) = "min_deposit,omitempty" + ]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "max_deposit_period,omitempty", + (gogoproto.moretags) = "yaml:\"max_deposit_period\"" + ]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Length of the voting period. + google.protobuf.Duration voting_period = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "voting_period,omitempty", + (gogoproto.moretags) = "yaml:\"voting_period\"" + ]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + bytes quorum = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "quorum,omitempty" + ]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "threshold,omitempty" + ]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + bytes veto_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto_threshold,omitempty", + (gogoproto.moretags) = "yaml:\"veto_threshold\"" + ]; +} diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1beta1/query.proto new file mode 100644 index 0000000..da62bdb --- /dev/null +++ b/proto/cosmos/gov/v1beta1/query.proto @@ -0,0 +1,190 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1beta1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + Proposal proposal = 1 [(gogoproto.nullable) = false]; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the oter address for the proposals. + string voter = 2; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defined the queried vote. + Vote vote = 1 [(gogoproto.nullable) = false]; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defined the queried votes. + repeated Vote votes = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [(gogoproto.nullable) = false]; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1 [(gogoproto.nullable) = false]; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto new file mode 100644 index 0000000..ecb1cdf --- /dev/null +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; + +// Msg defines the bank Msg service. +service Msg { + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + 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", + (gogoproto.moretags) = "yaml:\"initial_deposit\"" + ]; + string proposer = 3; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; +} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + VoteOption option = 3; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +message MsgVoteWeighted { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + string depositor = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} diff --git a/proto/cosmos/mint/v1beta1/genesis.proto b/proto/cosmos/mint/v1beta1/genesis.proto new file mode 100644 index 0000000..4e783fb --- /dev/null +++ b/proto/cosmos/mint/v1beta1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/mint/v1beta1/mint.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// GenesisState defines the mint module's genesis state. +message GenesisState { + // minter is a space for holding current inflation information. + Minter minter = 1 [(gogoproto.nullable) = false]; + + // params defines all the paramaters of the module. + Params params = 2 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/mint/v1beta1/mint.proto b/proto/cosmos/mint/v1beta1/mint.proto new file mode 100644 index 0000000..f94d4ae --- /dev/null +++ b/proto/cosmos/mint/v1beta1/mint.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "gogoproto/gogo.proto"; + +// Minter represents the minting state. +message Minter { + // current annual inflation rate + string inflation = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + // current annual expected provisions + string annual_provisions = 2 [ + (gogoproto.moretags) = "yaml:\"annual_provisions\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Params holds parameters for the mint module. +message Params { + option (gogoproto.goproto_stringer) = false; + + // type of coin to mint + string mint_denom = 1; + // maximum annual change in inflation rate + string inflation_rate_change = 2 [ + (gogoproto.moretags) = "yaml:\"inflation_rate_change\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // maximum inflation rate + string inflation_max = 3 [ + (gogoproto.moretags) = "yaml:\"inflation_max\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // minimum inflation rate + string inflation_min = 4 [ + (gogoproto.moretags) = "yaml:\"inflation_min\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // goal of percent bonded atoms + string goal_bonded = 5 [ + (gogoproto.moretags) = "yaml:\"goal_bonded\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // expected blocks per year + uint64 blocks_per_year = 6 [(gogoproto.moretags) = "yaml:\"blocks_per_year\""]; +} diff --git a/proto/cosmos/mint/v1beta1/query.proto b/proto/cosmos/mint/v1beta1/query.proto new file mode 100644 index 0000000..acd341d --- /dev/null +++ b/proto/cosmos/mint/v1beta1/query.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/mint/v1beta1/mint.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/params"; + } + + // Inflation returns the current minting inflation value. + rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; + } + + // AnnualProvisions current minting annual provisions value. + rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; + } +} + +// 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]; +} + +// QueryInflationRequest is the request type for the Query/Inflation RPC method. +message QueryInflationRequest {} + +// QueryInflationResponse is the response type for the Query/Inflation RPC +// method. +message QueryInflationResponse { + // inflation is the current minting inflation value. + bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// QueryAnnualProvisionsRequest is the request type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsRequest {} + +// QueryAnnualProvisionsResponse is the response type for the +// Query/AnnualProvisions RPC method. +message QueryAnnualProvisionsResponse { + // annual_provisions is the current minting annual provisions value. + bytes annual_provisions = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/params/v1beta1/params.proto b/proto/cosmos/params/v1beta1/params.proto new file mode 100644 index 0000000..5382fd7 --- /dev/null +++ b/proto/cosmos/params/v1beta1/params.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; + +// ParameterChangeProposal defines a proposal to change one or more parameters. +message ParameterChangeProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + repeated ParamChange changes = 3 [(gogoproto.nullable) = false]; +} + +// ParamChange defines an individual parameter change, for use in +// ParameterChangeProposal. +message ParamChange { + option (gogoproto.goproto_stringer) = false; + + string subspace = 1; + string key = 2; + string value = 3; +} diff --git a/proto/cosmos/params/v1beta1/query.proto b/proto/cosmos/params/v1beta1/query.proto new file mode 100644 index 0000000..1078e02 --- /dev/null +++ b/proto/cosmos/params/v1beta1/query.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package cosmos.params.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/params/v1beta1/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; + +// Query defines the gRPC querier service. +service Query { + // Params queries a specific parameter of a module, given its subspace and + // key. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/params"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest { + // subspace defines the module to query the parameter for. + string subspace = 1; + + // key defines the key of the parameter in the subspace. + string key = 2; +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // param defines the queried parameter. + ParamChange param = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/slashing/v1beta1/genesis.proto b/proto/cosmos/slashing/v1beta1/genesis.proto new file mode 100644 index 0000000..a7aebcf --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/genesis.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; + +// GenesisState defines the slashing module's genesis state. +message GenesisState { + // params defines all the paramaters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false]; + + // signing_infos represents a map between validator addresses and their + // signing infos. + repeated SigningInfo signing_infos = 2 + [(gogoproto.moretags) = "yaml:\"signing_infos\"", (gogoproto.nullable) = false]; + + // missed_blocks represents a map between validator addresses and their + // missed blocks. + repeated ValidatorMissedBlocks missed_blocks = 3 + [(gogoproto.moretags) = "yaml:\"missed_blocks\"", (gogoproto.nullable) = false]; +} + +// SigningInfo stores validator signing info of corresponding address. +message SigningInfo { + // address is the validator address. + string address = 1; + // validator_signing_info represents the signing info of this validator. + ValidatorSigningInfo validator_signing_info = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_signing_info\""]; +} + +// ValidatorMissedBlocks contains array of missed blocks of corresponding +// address. +message ValidatorMissedBlocks { + // address is the validator address. + string address = 1; + // missed_blocks is an array of missed blocks by the validator. + repeated MissedBlock missed_blocks = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"missed_blocks\""]; +} + +// MissedBlock contains height and missed status as boolean. +message MissedBlock { + // index is the height at which the block was missed. + int64 index = 1; + // missed is the missed status. + bool missed = 2; +} diff --git a/proto/cosmos/slashing/v1beta1/query.proto b/proto/cosmos/slashing/v1beta1/query.proto new file mode 100644 index 0000000..869049a --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/query.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; + +// Query provides defines the gRPC querier service +service Query { + // Params queries the parameters of slashing module + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; + } + + // SigningInfo queries the signing info of given cons address + rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; + } + + // SigningInfos queries signing info of all validators + rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { + option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; + } +} + +// 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 params = 1 [(gogoproto.nullable) = false]; +} + +// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC +// method +message QuerySigningInfoRequest { + // cons_address is the address to query signing info of + string cons_address = 1; +} + +// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC +// method +message QuerySigningInfoResponse { + // val_signing_info is the signing info of requested val cons address + ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false]; +} + +// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC +// method +message QuerySigningInfosRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC +// method +message QuerySigningInfosResponse { + // info is the signing info of all validators + repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto new file mode 100644 index 0000000..882a0fb --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +// ValidatorSigningInfo defines a validator's signing info for monitoring their +// liveness activity. +message ValidatorSigningInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string address = 1; + // Height at which validator was first a candidate OR was unjailed + int64 start_height = 2 [(gogoproto.moretags) = "yaml:\"start_height\""]; + // Index which is incremented each time the validator was a bonded + // in a block and may have signed a precommit or not. This in conjunction with the + // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + int64 index_offset = 3 [(gogoproto.moretags) = "yaml:\"index_offset\""]; + // Timestamp until which the validator is jailed due to liveness downtime. + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.moretags) = "yaml:\"jailed_until\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // Whether or not a validator has been tombstoned (killed out of validator set). It is set + // once the validator commits an equivocation or for any other configured misbehiavor. + bool tombstoned = 5; + // A counter kept to avoid unnecessary array reads. + // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + int64 missed_blocks_counter = 6 [(gogoproto.moretags) = "yaml:\"missed_blocks_counter\""]; +} + +// Params represents the parameters used for by the slashing module. +message Params { + int64 signed_blocks_window = 1 [(gogoproto.moretags) = "yaml:\"signed_blocks_window\""]; + bytes min_signed_per_window = 2 [ + (gogoproto.moretags) = "yaml:\"min_signed_per_window\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + google.protobuf.Duration downtime_jail_duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"downtime_jail_duration\"" + ]; + bytes slash_fraction_double_sign = 4 [ + (gogoproto.moretags) = "yaml:\"slash_fraction_double_sign\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + bytes slash_fraction_downtime = 5 [ + (gogoproto.moretags) = "yaml:\"slash_fraction_downtime\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} diff --git a/proto/cosmos/slashing/v1beta1/tx.proto b/proto/cosmos/slashing/v1beta1/tx.proto new file mode 100644 index 0000000..4d63370 --- /dev/null +++ b/proto/cosmos/slashing/v1beta1/tx.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package cosmos.slashing.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; + +// Msg defines the slashing Msg service. +service Msg { + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); +} + +// MsgUnjail defines the Msg/Unjail request type +message MsgUnjail { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string validator_addr = 1 [(gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; +} + +// MsgUnjailResponse defines the Msg/Unjail response type +message MsgUnjailResponse {} \ No newline at end of file diff --git a/proto/cosmos/staking/v1beta1/authz.proto b/proto/cosmos/staking/v1beta1/authz.proto new file mode 100644 index 0000000..6345612 --- /dev/null +++ b/proto/cosmos/staking/v1beta1/authz.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// StakeAuthorization defines authorization for delegate/undelegate/redelegate. +message StakeAuthorization { + 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. + cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; + // validators is the oneof that represents either allow_list or deny_list + oneof validators { + // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + // account. + Validators allow_list = 2; + // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. + Validators deny_list = 3; + } + // Validators defines list of validator addresses. + message Validators { + repeated string address = 1; + } + // authorization_type defines one of AuthorizationType. + AuthorizationType authorization_type = 4; +} + +// AuthorizationType defines the type of staking module authorization type +enum AuthorizationType { + // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type + AUTHORIZATION_TYPE_UNSPECIFIED = 0; + // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate + AUTHORIZATION_TYPE_DELEGATE = 1; + // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + AUTHORIZATION_TYPE_UNDELEGATE = 2; + // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate + AUTHORIZATION_TYPE_REDELEGATE = 3; +} diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto new file mode 100644 index 0000000..d1563db --- /dev/null +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +// GenesisState defines the staking module's genesis state. +message GenesisState { + // params defines all the paramaters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false]; + + // last_total_power tracks the total amounts of bonded tokens recorded during + // the previous end block. + bytes last_total_power = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"last_total_power\"", + (gogoproto.nullable) = false + ]; + + // last_validator_powers is a special index that provides a historical list + // of the last-block's bonded validators. + repeated LastValidatorPower last_validator_powers = 3 + [(gogoproto.moretags) = "yaml:\"last_validator_powers\"", (gogoproto.nullable) = false]; + + // delegations defines the validator set at genesis. + repeated Validator validators = 4 [(gogoproto.nullable) = false]; + + // delegations defines the delegations active at genesis. + repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; + + // unbonding_delegations defines the unbonding delegations active at genesis. + repeated UnbondingDelegation unbonding_delegations = 6 + [(gogoproto.moretags) = "yaml:\"unbonding_delegations\"", (gogoproto.nullable) = false]; + + // redelegations defines the redelegations active at genesis. + repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; + + bool exported = 8; +} + +// LastValidatorPower required for validator set update logic. +message LastValidatorPower { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address of the validator. + string address = 1; + + // power defines the power of the validator. + int64 power = 2; +} diff --git a/proto/cosmos/staking/v1beta1/query.proto b/proto/cosmos/staking/v1beta1/query.proto new file mode 100644 index 0000000..4852c53 --- /dev/null +++ b/proto/cosmos/staking/v1beta1/query.proto @@ -0,0 +1,348 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Query defines the gRPC querier service. +service Query { + // Validators queries all validators that match the given status. + rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; + } + + // Validator queries validator info for given validator address. + rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; + } + + // ValidatorDelegations queries delegate info for given validator. + rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; + } + + // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) + returns (QueryValidatorUnbondingDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" + "{validator_addr}/unbonding_delegations"; + } + + // Delegation queries delegate info for given validator delegator pair. + rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}"; + } + + // UnbondingDelegation queries unbonding info for given validator delegator + // pair. + rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}/unbonding_delegation"; + } + + // DelegatorDelegations queries all delegations of a given delegator address. + rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; + } + + // DelegatorUnbondingDelegations queries all unbonding delegations of a given + // delegator address. + rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) + returns (QueryDelegatorUnbondingDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" + "{delegator_addr}/unbonding_delegations"; + } + + // Redelegations queries redelegations of given address. + rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; + } + + // DelegatorValidators queries all validators info for given delegator + // address. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; + } + + // DelegatorValidator queries validator info for given delegator validator + // pair. + rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" + "{validator_addr}"; + } + + // HistoricalInfo queries the historical info for given height. + rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; + } + + // Pool queries the pool info. + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; + } + + // Parameters queries the staking parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + } +} + +// QueryValidatorsRequest is request type for Query/Validators RPC method. +message QueryValidatorsRequest { + // status enables to query for validators matching a given status. + string status = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorsResponse is response type for the Query/Validators RPC method +message QueryValidatorsResponse { + // validators contains all the queried validators. + repeated Validator validators = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorRequest is response type for the Query/Validator RPC method +message QueryValidatorRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1; +} + +// QueryValidatorResponse is response type for the Query/Validator RPC method +message QueryValidatorResponse { + // validator defines the the validator info. + Validator validator = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorDelegationsRequest is request type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorDelegationsResponse is response type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsResponse { + repeated DelegationResponse delegation_responses = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorUnbondingDelegationsRequest is required type for the +// Query/ValidatorUnbondingDelegations RPC method +message QueryValidatorUnbondingDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorUnbondingDelegationsResponse is response type for the +// Query/ValidatorUnbondingDelegations RPC method. +message QueryValidatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRequest is request type for the Query/Delegation RPC method. +message QueryDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // validator_addr defines the validator address to query for. + string validator_addr = 2; +} + +// QueryDelegationResponse is response type for the Query/Delegation RPC method. +message QueryDelegationResponse { + // delegation_responses defines the delegation info of a delegation. + DelegationResponse delegation_response = 1; +} + +// QueryUnbondingDelegationRequest is request type for the +// Query/UnbondingDelegation RPC method. +message QueryUnbondingDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // validator_addr defines the validator address to query for. + string validator_addr = 2; +} + +// QueryDelegationResponse is response type for the Query/UnbondingDelegation +// RPC method. +message QueryUnbondingDelegationResponse { + // unbond defines the unbonding information of a delegation. + UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false]; +} + +// QueryDelegatorDelegationsRequest is request type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorDelegationsResponse is response type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsResponse { + // delegation_responses defines all the delegations' info of a delegator. + repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorUnbondingDelegationsRequest is request type for the +// Query/DelegatorUnbondingDelegations RPC method. +message QueryDelegatorUnbondingDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryUnbondingDelegatorDelegationsResponse is response type for the +// Query/UnbondingDelegatorDelegations RPC method. +message QueryDelegatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRedelegationsRequest is request type for the Query/Redelegations RPC +// method. +message QueryRedelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // src_validator_addr defines the validator address to redelegate from. + string src_validator_addr = 2; + + // dst_validator_addr defines the validator address to redelegate to. + string dst_validator_addr = 3; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryRedelegationsResponse is response type for the Query/Redelegations RPC +// method. +message QueryRedelegationsResponse { + repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorsRequest is request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorValidatorsResponse is response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + // validators defines the the validators' info of a delegator. + repeated Validator validators = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorRequest is request type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // validator_addr defines the validator address to query for. + string validator_addr = 2; +} + +// QueryDelegatorValidatorResponse response type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorResponse { + // validator defines the the validator info. + Validator validator = 1 [(gogoproto.nullable) = false]; +} + +// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoRequest { + // height defines at which height to query the historical info. + int64 height = 1; +} + +// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoResponse { + // hist defines the historical info at the given height. + HistoricalInfo hist = 1; +} + +// QueryPoolRequest is request type for the Query/Pool RPC method. +message QueryPoolRequest {} + +// QueryPoolResponse is response type for the Query/Pool RPC method. +message QueryPoolResponse { + // pool defines the pool info. + Pool pool = 1 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto new file mode 100644 index 0000000..76e9599 --- /dev/null +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -0,0 +1,334 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "tendermint/types/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// HistoricalInfo contains header and validator information for a given block. +// It is stored as part of staking module's state, which persists the `n` most +// recent HistoricalInfo +// (`n` is set by the staking module's `historical_entries` parameter). +message HistoricalInfo { + tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; + repeated Validator valset = 2 [(gogoproto.nullable) = false]; +} + +// CommissionRates defines the initial commission rates to be used for creating +// a validator. +message CommissionRates { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // rate is the commission rate charged to delegators, as a fraction. + string rate = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. + string max_rate = 2 [ + (gogoproto.moretags) = "yaml:\"max_rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. + string max_change_rate = 3 [ + (gogoproto.moretags) = "yaml:\"max_change_rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Commission defines commission parameters for a given validator. +message Commission { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // commission_rates defines the initial commission rates to be used for creating a validator. + CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // update_time is the last time the commission rate was changed. + google.protobuf.Timestamp update_time = 2 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"update_time\""]; +} + +// Description defines a validator description. +message Description { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // moniker defines a human-readable name for the validator. + string moniker = 1; + // identity defines an optional identity signature (ex. UPort or Keybase). + string identity = 2; + // website defines an optional website link. + string website = 3; + // security_contact defines an optional email for security contact. + string security_contact = 4 [(gogoproto.moretags) = "yaml:\"security_contact\""]; + // details define other optional details. + string details = 5; +} + +// Validator defines a validator, together with the total amount of the +// Validator's bond shares and their exchange rate to coins. Slashing results in +// a decrease in the exchange rate, allowing correct calculation of future +// undelegations without iterating over delegators. When coins are delegated to +// this validator, the validator is credited with a delegation whose number of +// bond shares is based on the amount of coins delegated divided by the current +// exchange rate. Voting power can be calculated as total bonded shares +// multiplied by exchange rate. +message Validator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech encoded in JSON. + string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; + // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. + google.protobuf.Any consensus_pubkey = 2 + [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", (gogoproto.moretags) = "yaml:\"consensus_pubkey\""]; + // jailed defined whether the validator has been jailed from bonded status or not. + bool jailed = 3; + // status is the validator status (bonded/unbonding/unbonded). + BondStatus status = 4; + // tokens define the delegated tokens (incl. self-delegation). + string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + // delegator_shares defines total shares issued to a validator's delegators. + string delegator_shares = 6 [ + (gogoproto.moretags) = "yaml:\"delegator_shares\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // description defines the description terms for the validator. + Description description = 7 [(gogoproto.nullable) = false]; + // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. + int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""]; + // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. + google.protobuf.Timestamp unbonding_time = 9 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; + // commission defines the commission parameters. + Commission commission = 10 [(gogoproto.nullable) = false]; + // min_self_delegation is the validator's self declared minimum self delegation. + string min_self_delegation = 11 [ + (gogoproto.moretags) = "yaml:\"min_self_delegation\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// BondStatus is the status of a validator. +enum BondStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an invalid validator status. + BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + // UNBONDED defines a validator that is not bonded. + BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; + // UNBONDING defines a validator that is unbonding. + BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; + // BONDED defines a validator that is bonded. + BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; +} + +// ValAddresses defines a repeated set of validator addresses. +message ValAddresses { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = true; + + repeated string addresses = 1; +} + +// DVPair is struct that just has a delegator-validator pair with no other data. +// It is intended to be used as a marshalable pointer. For example, a DVPair can +// be used to construct the key to getting an UnbondingDelegation from state. +message DVPair { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; +} + +// DVPairs defines an array of DVPair objects. +message DVPairs { + repeated DVPair pairs = 1 [(gogoproto.nullable) = false]; +} + +// DVVTriplet is struct that just has a delegator-validator-validator triplet +// with no other data. It is intended to be used as a marshalable pointer. For +// example, a DVVTriplet can be used to construct the key to getting a +// Redelegation from state. +message DVVTriplet { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; + string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; +} + +// DVVTriplets defines an array of DVVTriplet objects. +message DVVTriplets { + repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false]; +} + +// Delegation represents the bond with tokens held by an account. It is +// owned by one delegator, and is associated with the voting power of one +// validator. +message Delegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + // shares define the delegation shares received. + string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// UnbondingDelegation stores all of a single delegator's unbonding bonds +// for a single validator in an time-ordered list. +message UnbondingDelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + // validator_address is the bech32-encoded address of the validator. + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + // entries are the unbonding delegation entries. + repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries +} + +// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +message UnbondingDelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height is the height which the unbonding took place. + int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; + // completion_time is the unix time for unbonding completion. + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; + // initial_balance defines the tokens initially scheduled to receive at completion. + string initial_balance = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"initial_balance\"" + ]; + // balance defines the tokens to receive at completion. + string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// RedelegationEntry defines a redelegation object with relevant metadata. +message RedelegationEntry { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // creation_height defines the height which the redelegation took place. + int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; + // completion_time defines the unix time for redelegation completion. + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; + // initial_balance defines the initial balance when redelegation started. + string initial_balance = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"initial_balance\"" + ]; + // shares_dst is the amount of destination-validator shares created by redelegation. + string shares_dst = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// Redelegation contains the list of a particular delegator's redelegating bonds +// from a particular source validator to a particular destination validator. +message Redelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // delegator_address is the bech32-encoded address of the delegator. + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + // validator_src_address is the validator redelegation source operator address. + string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; + // validator_dst_address is the validator redelegation destination operator address. + string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; + // entries are the redelegation entries. + repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries +} + +// Params defines the parameters for the staking module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // unbonding_time is the time duration of unbonding. + google.protobuf.Duration unbonding_time = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; + // max_validators is the maximum number of validators. + uint32 max_validators = 2 [(gogoproto.moretags) = "yaml:\"max_validators\""]; + // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + uint32 max_entries = 3 [(gogoproto.moretags) = "yaml:\"max_entries\""]; + // historical_entries is the number of historical entries to persist. + uint32 historical_entries = 4 [(gogoproto.moretags) = "yaml:\"historical_entries\""]; + // bond_denom defines the bondable coin denomination. + string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""]; +} + +// DelegationResponse is equivalent to Delegation except that it contains a +// balance in addition to shares which is more suitable for client responses. +message DelegationResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + + Delegation delegation = 1 [(gogoproto.nullable) = false]; + + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; +} + +// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +// contains a balance in addition to shares which is more suitable for client +// responses. +message RedelegationEntryResponse { + option (gogoproto.equal) = true; + + RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; + string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + +// RedelegationResponse is equivalent to a Redelegation except that its entries +// contain a balance in addition to shares which is more suitable for client +// responses. +message RedelegationResponse { + option (gogoproto.equal) = false; + + Redelegation redelegation = 1 [(gogoproto.nullable) = false]; + repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false]; +} + +// Pool is used for tracking bonded and not-bonded token supply of the bond +// denomination. +message Pool { + option (gogoproto.description) = true; + option (gogoproto.equal) = true; + string not_bonded_tokens = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.jsontag) = "not_bonded_tokens", + (gogoproto.nullable) = false + ]; + string bonded_tokens = 2 [ + (gogoproto.jsontag) = "bonded_tokens", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"bonded_tokens\"" + ]; +} diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto new file mode 100644 index 0000000..7b05d89 --- /dev/null +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -0,0 +1,126 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Msg defines the staking Msg service. +service Msg { + // CreateValidator defines a method for creating a new validator. + rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); + + // EditValidator defines a method for editing an existing validator. + rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); + + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); + + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); +} + +// MsgCreateValidator defines a SDK message for creating a new validator. +message MsgCreateValidator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false]; + CommissionRates commission = 2 [(gogoproto.nullable) = false]; + string min_self_delegation = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"min_self_delegation\"", + (gogoproto.nullable) = false + ]; + string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; +} + +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +message MsgCreateValidatorResponse {} + +// MsgEditValidator defines a SDK message for editing an existing validator. +message MsgEditValidator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + Description description = 1 [(gogoproto.nullable) = false]; + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"address\""]; + + // We pass a reference to the new commission rate and min self delegation as + // it's not mandatory to update. If not updated, the deserialized rate will be + // zero with no way to distinguish if an update was intended. + // REF: #2373 + string commission_rate = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"commission_rate\"" + ]; + string min_self_delegation = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"min_self_delegation\"" + ]; +} + +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +message MsgEditValidatorResponse {} + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message MsgDelegate { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; +} + +// MsgDelegateResponse defines the Msg/Delegate response type. +message MsgDelegateResponse {} + +// MsgBeginRedelegate defines a SDK message for performing a redelegation +// of coins from a delegator and source validator to a destination validator. +message MsgBeginRedelegate { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; + string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; +} + +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +message MsgBeginRedelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a +// delegate and a validator. +message MsgUndelegate { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; +} + +// MsgUndelegateResponse defines the Msg/Undelegate response type. +message MsgUndelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto new file mode 100644 index 0000000..4c1be40 --- /dev/null +++ b/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; +package cosmos.tx.signing.v1beta1; + +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; + +// SignMode represents a signing mode with its own security guarantees. +enum SignMode { + // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + // rejected + SIGN_MODE_UNSPECIFIED = 0; + + // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + // verified with raw bytes from Tx + SIGN_MODE_DIRECT = 1; + + // SIGN_MODE_TEXTUAL is a future signing mode that will verify some + // human-readable textual representation on top of the binary representation + // from SIGN_MODE_DIRECT + SIGN_MODE_TEXTUAL = 2; + + // 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; +} + +// SignatureDescriptors wraps multiple SignatureDescriptor's. +message SignatureDescriptors { + // signatures are the signature descriptors + repeated SignatureDescriptor signatures = 1; +} + +// SignatureDescriptor is a convenience type which represents the full data for +// a signature including the public key of the signer, signing modes and the +// signature itself. It is primarily used for coordinating signatures between +// clients. +message SignatureDescriptor { + // public_key is the public key of the signer + google.protobuf.Any public_key = 1; + + Data data = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to prevent + // replay attacks. + uint64 sequence = 3; + + // Data represents signature data + message Data { + // sum is the oneof that specifies whether this represents single or multi-signature data + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a multisig signer + Multi multi = 2; + } + + // Single is the signature data for a single signer + message Single { + // mode is the signing mode of the single signer + SignMode mode = 1; + + // signature is the raw signature bytes + bytes signature = 2; + } + + // Multi is the signature data for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // signatures is the signatures of the multi-signature + repeated Data signatures = 2; + } + } +} diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto new file mode 100644 index 0000000..646175c --- /dev/null +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/base/abci/v1beta1/abci.proto"; +import "cosmos/tx/v1beta1/tx.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option (gogoproto.goproto_registration) = true; +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Service defines a gRPC service for interacting with transactions. +service Service { + // Simulate simulates executing a transaction for estimating gas usage. + rpc Simulate(SimulateRequest) returns (SimulateResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/simulate" + body: "*" + }; + } + // GetTx fetches a tx by hash. + rpc GetTx(GetTxRequest) returns (GetTxResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; + } + // BroadcastTx broadcast transaction. + rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/txs" + body: "*" + }; + } + // GetTxsEvent fetches txs by event. + rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { + option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; + } +} + +// GetTxsEventRequest is the request type for the Service.TxsByEvents +// RPC method. +message GetTxsEventRequest { + // events is the list of transaction event type. + repeated string events = 1; + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; + OrderBy order_by = 3; +} + +// OrderBy defines the sorting order +enum OrderBy { + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + ORDER_BY_UNSPECIFIED = 0; + // ORDER_BY_ASC defines ascending order + ORDER_BY_ASC = 1; + // ORDER_BY_DESC defines descending order + ORDER_BY_DESC = 2; +} + +// GetTxsEventResponse is the response type for the Service.TxsByEvents +// RPC method. +message GetTxsEventResponse { + // txs is the list of queried transactions. + repeated cosmos.tx.v1beta1.Tx txs = 1; + // tx_responses is the list of queried TxResponses. + repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +// RPC method. +message BroadcastTxRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; + BroadcastMode mode = 2; +} + +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +enum BroadcastMode { + // zero-value for mode ordering + BROADCAST_MODE_UNSPECIFIED = 0; + // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + // the tx to be committed in a block. + BROADCAST_MODE_BLOCK = 1; + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + // a CheckTx execution response only. + BROADCAST_MODE_SYNC = 2; + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + // immediately. + BROADCAST_MODE_ASYNC = 3; +} + +// BroadcastTxResponse is the response type for the +// Service.BroadcastTx method. +message BroadcastTxResponse { + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 1; +} + +// SimulateRequest is the request type for the Service.Simulate +// RPC method. +message SimulateRequest { + // tx is the transaction to simulate. + // Deprecated. Send raw tx bytes instead. + cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; + // tx_bytes is the raw transaction. + bytes tx_bytes = 2; +} + +// SimulateResponse is the response type for the +// Service.SimulateRPC method. +message SimulateResponse { + // gas_info is the information about gas used in the simulation. + cosmos.base.abci.v1beta1.GasInfo gas_info = 1; + // result is the result of the simulation. + cosmos.base.abci.v1beta1.Result result = 2; +} + +// GetTxRequest is the request type for the Service.GetTx +// RPC method. +message GetTxRequest { + // hash is the tx hash to query, encoded as a hex string. + string hash = 1; +} + +// GetTxResponse is the response type for the Service.GetTx method. +message GetTxResponse { + // tx is the queried transaction. + cosmos.tx.v1beta1.Tx tx = 1; + // tx_response is the queried TxResponses. + cosmos.base.abci.v1beta1.TxResponse tx_response = 2; +} \ No newline at end of file diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto new file mode 100644 index 0000000..6d5caf1 --- /dev/null +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -0,0 +1,183 @@ +syntax = "proto3"; +package cosmos.tx.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/tx/signing/v1beta1/signing.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; + +// Tx is the standard type used for broadcasting transactions. +message Tx { + // body is the processable content of the transaction + TxBody body = 1; + + // auth_info is the authorization related content of the transaction, + // specifically signers, signer modes and fee + AuthInfo auth_info = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// TxRaw is a variant of Tx that pins the signer's exact binary representation +// of body and auth_info. This is used for signing, broadcasting and +// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and +// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used +// as the transaction ID. +message TxRaw { + // body_bytes is a protobuf serialization of a TxBody that matches the + // representation in SignDoc. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in SignDoc. + bytes auth_info_bytes = 2; + + // signatures is a list of signatures that matches the length and order of + // AuthInfo's signer_infos to allow connecting signature meta information like + // public key and signing mode by position. + repeated bytes signatures = 3; +} + +// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +message SignDoc { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + // representation in TxRaw. + bytes auth_info_bytes = 2; + + // chain_id is the unique identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker + string chain_id = 3; + + // account_number is the account number of the account in state + uint64 account_number = 4; +} + +// TxBody is the body of a transaction that all signers sign over. +message TxBody { + // messages is a list of messages to be executed. The required signers of + // those messages define the number and order of elements in AuthInfo's + // signer_infos and Tx's signatures. Each required signer address is added to + // the list only the first time it occurs. + // By convention, the first required signer (usually from the first message) + // is referred to as the primary signer and pays the fee for the whole + // transaction. + repeated google.protobuf.Any messages = 1; + + // memo is any arbitrary note/comment to be added to the transaction. + // WARNING: in clients, any publicly exposed text should not be called memo, + // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + string memo = 2; + + // timeout is the block height after which this transaction will not + // be processed by the chain + uint64 timeout_height = 3; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, the transaction will be rejected + repeated google.protobuf.Any extension_options = 1023; + + // extension_options are arbitrary options that can be added by chains + // when the default options are not sufficient. If any of these are present + // and can't be handled, they will be ignored + repeated google.protobuf.Any non_critical_extension_options = 2047; +} + +// AuthInfo describes the fee and signer modes that are used to sign a +// transaction. +message AuthInfo { + // signer_infos defines the signing modes for the required signers. The number + // and order of elements must match the required signers from TxBody's + // messages. The first element is the primary signer and the one which pays + // the fee. + repeated SignerInfo signer_infos = 1; + + // Fee is the fee and gas limit for the transaction. The first signer is the + // primary signer and the one which pays the fee. The fee can be calculated + // based on the cost of evaluating the body and doing signature verification + // of the signers. This can be estimated via simulation. + Fee fee = 2; +} + +// SignerInfo describes the public key and signing mode of a single top-level +// signer. +message SignerInfo { + // public_key is the public key of the signer. It is optional for accounts + // that already exist in state. If unset, the verifier can use the required \ + // signer address for this position and lookup the public key. + google.protobuf.Any public_key = 1; + + // mode_info describes the signing mode of the signer and is a nested + // structure to support nested multisig pubkey's + ModeInfo mode_info = 2; + + // sequence is the sequence of the account, which describes the + // number of committed transactions signed by a given address. It is used to + // prevent replay attacks. + uint64 sequence = 3; +} + +// ModeInfo describes the signing mode of a single or nested multisig signer. +message ModeInfo { + // sum is the oneof that specifies whether this represents a single or nested + // multisig signer + oneof sum { + // single represents a single signer + Single single = 1; + + // multi represents a nested multisig signer + Multi multi = 2; + } + + // Single is the mode info for a single signer. It is structured as a message + // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + // future + message Single { + // mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 1; + } + + // Multi is the mode info for a multisig public key + message Multi { + // bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; + + // mode_infos is the corresponding modes of the signers of the multisig + // which could include nested multisig public keys + repeated ModeInfo mode_infos = 2; + } +} + +// Fee includes the amount of coins paid in fees and the maximum +// gas to be used by the transaction. The ratio yields an effective "gasprice", +// which must be above some miminum to be accepted into the mempool. +message Fee { + // amount is the amount of coins to be paid as a fee + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + // gas_limit is the maximum gas that can be used in transaction processing + // before an out of gas error occurs + uint64 gas_limit = 2; + + // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + // the payer must be a tx signer (and thus have signed this field in AuthInfo). + // setting this field does *not* change the ordering of required signers for the transaction. + string payer = 3; + + // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + // not support fee grants, this will fail + string granter = 4; +} diff --git a/proto/cosmos/upgrade/v1beta1/query.proto b/proto/cosmos/upgrade/v1beta1/query.proto new file mode 100644 index 0000000..3afb04e --- /dev/null +++ b/proto/cosmos/upgrade/v1beta1/query.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; + +// Query defines the gRPC upgrade querier service. +service Query { + // CurrentPlan queries the current upgrade plan. + rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan"; + } + + // AppliedPlan queries a previously applied upgrade plan by its name. + rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}"; + } + + // UpgradedConsensusState queries the consensus state that will serve + // as a trusted kernel for the next version of this chain. It will only be + // stored at the last height of this chain. + // UpgradedConsensusState RPC not supported with legacy querier + rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}"; + } + + // ModuleVersions queries the list of module versions from state. + rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; + } +} + +// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanRequest {} + +// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +// method. +message QueryCurrentPlanResponse { + // plan is the current upgrade plan. + Plan plan = 1; +} + +// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanRequest { + // name is the name of the applied plan to query for. + string name = 1; +} + +// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +// method. +message QueryAppliedPlanResponse { + // height is the block height at which the plan was applied. + int64 height = 1; +} + +// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateRequest { + // last height of the current chain must be sent in request + // as this is the height under which next consensus state is stored + int64 last_height = 1; +} + +// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +// RPC method. +message QueryUpgradedConsensusStateResponse { + reserved 1; + + bytes upgraded_consensus_state = 2; +} + +// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions +// RPC method. +message QueryModuleVersionsRequest { + // module_name is a field to query a specific module + // consensus version from state. Leaving this empty will + // fetch the full list of module versions from state + string module_name = 1; +} + +// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions +// RPC method. +message QueryModuleVersionsResponse { + // module_versions is a list of module names with their consensus versions. + repeated ModuleVersion module_versions = 1; +} diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto new file mode 100644 index 0000000..4e1d69a --- /dev/null +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; +option (gogoproto.goproto_getters_all) = false; + +// Plan specifies information about a planned upgrade and when it should occur. +message Plan { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // Sets the name for the upgrade. This name will be used by the upgraded + // version of the software to apply any special "on-upgrade" commands during + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + string name = 1; + + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + // The height at which the upgrade must be performed. + // Only used if Time is not set. + int64 height = 3; + + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; + + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. + google.protobuf.Any upgraded_client_state = 5 + [deprecated = true, (gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; +} + +// SoftwareUpgradeProposal is a gov Content type for initiating a software +// upgrade. +message SoftwareUpgradeProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + Plan plan = 3 [(gogoproto.nullable) = false]; +} + +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +// upgrade. +message CancelSoftwareUpgradeProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; +} + +// ModuleVersion specifies a module and its consensus version. +message ModuleVersion { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // name of the app module + string name = 1; + + // consensus version of the app module + uint64 version = 2; +} diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto new file mode 100644 index 0000000..c49be80 --- /dev/null +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// Msg defines the bank Msg service. +service Msg { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); +} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +message MsgCreateVestingAccount { + option (gogoproto.equal) = true; + + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + + int64 end_time = 4 [(gogoproto.moretags) = "yaml:\"end_time\""]; + bool delayed = 5; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +message MsgCreateVestingAccountResponse {} \ No newline at end of file diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto new file mode 100644 index 0000000..26e7868 --- /dev/null +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +package cosmos.vesting.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// BaseVestingAccount implements the VestingAccount interface. It contains all +// the necessary fields needed for any vesting account implementation. +message BaseVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; + repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"original_vesting\"" + ]; + repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"delegated_free\"" + ]; + repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"delegated_vesting\"" + ]; + int64 end_time = 5 [(gogoproto.moretags) = "yaml:\"end_time\""]; +} + +// ContinuousVestingAccount implements the VestingAccount interface. It +// continuously vests by unlocking coins linearly with respect to time. +message ContinuousVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; +} + +// DelayedVestingAccount implements the VestingAccount interface. It vests all +// coins after a specific time, but non prior. In other words, it keeps them +// locked until a specified time. +message DelayedVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} + +// Period defines a length of time and amount of coins that will vest. +message Period { + option (gogoproto.goproto_stringer) = false; + + int64 length = 1; + repeated cosmos.base.v1beta1.Coin amount = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// PeriodicVestingAccount implements the VestingAccount interface. It +// periodically vests by unlocking coins during each specified period. +message PeriodicVestingAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; + repeated Period vesting_periods = 3 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false]; +} + +// PermanentLockedAccount implements the VestingAccount interface. It does +// not ever release coins, locking them indefinitely. Coins in this account can +// still be used for delegating and for governance votes even while locked. +message PermanentLockedAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; +} diff --git a/proto/cosmos_proto/cosmos.proto b/proto/cosmos_proto/cosmos.proto new file mode 100644 index 0000000..167b170 --- /dev/null +++ b/proto/cosmos_proto/cosmos.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/regen-network/cosmos-proto"; + +extend google.protobuf.MessageOptions { + string interface_type = 93001; + + string implements_interface = 93002; +} + +extend google.protobuf.FieldOptions { + string accepts_interface = 93001; +} diff --git a/proto/gogoproto/gogo.proto b/proto/gogoproto/gogo.proto new file mode 100644 index 0000000..49e78f9 --- /dev/null +++ b/proto/gogoproto/gogo.proto @@ -0,0 +1,145 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/gogo/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "GoGoProtos"; +option go_package = "github.com/gogo/protobuf/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; + + optional string castrepeated = 65013; +} diff --git a/proto/google/api/annotations.proto b/proto/google/api/annotations.proto new file mode 100644 index 0000000..7b67d58 --- /dev/null +++ b/proto/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright (c) 2015, Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/proto/google/api/http.proto b/proto/google/api/http.proto new file mode 100644 index 0000000..401fcb7 --- /dev/null +++ b/proto/google/api/http.proto @@ -0,0 +1,325 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parmeters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// `HttpRule` defines the mapping of an RPC method to one or more HTTP +// REST API methods. The mapping specifies how different portions of the RPC +// request message are mapped to URL path, URL query parameters, and +// HTTP request body. The mapping is typically specified as an +// `google.api.http` annotation on the RPC method, +// see "google/api/annotations.proto" for details. +// +// The mapping consists of a field specifying the path template and +// method kind. The path template can refer to fields in the request +// message, as in the example below which describes a REST GET +// operation on a resource collection of messages: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = +// "/v1/messages/{message_id}/{sub.subfield}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// SubMessage sub = 2; // `sub.subfield` is url-mapped +// } +// message Message { +// string text = 1; // content of the resource +// } +// +// The same http annotation can alternatively be expressed inside the +// `GRPC API Configuration` YAML file. +// +// http: +// rules: +// - selector: .Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// This definition enables an automatic, bidrectional mapping of HTTP +// JSON to RPC. Example: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: +// SubMessage(subfield: "foo"))` +// +// In general, not only fields but also field paths can be referenced +// from a path pattern. Fields mapped to the path pattern cannot be +// repeated and must have a primitive (non-message) type. +// +// Any fields in the request message which are not bound by the path +// pattern automatically become (optional) HTTP query +// parameters. Assume the following definition of the request message: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// int64 revision = 2; // becomes a parameter +// SubMessage sub = 3; // `sub.subfield` becomes a parameter +// } +// +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to HTTP parameters must have a +// primitive type or a repeated primitive type. Message types are not +// allowed. In the case of a repeated type, the parameter can be +// repeated in the URL, as in `...?param=A¶m=B`. +// +// For HTTP method kinds which allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice of +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// +// This enables the following two alternative HTTP JSON to RPC +// mappings: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// # Rules for HTTP mapping +// +// The rules for mapping HTTP path, query parameters, and body fields +// to the request message are as follows: +// +// 1. The `body` field specifies either `*` or a field path, or is +// omitted. If omitted, it indicates there is no HTTP request body. +// 2. Leaf fields (recursive expansion of nested messages in the +// request) can be classified into three types: +// (a) Matched in the URL template. +// (b) Covered by body (if body is `*`, everything except (a) fields; +// else everything under the body field) +// (c) All other fields. +// 3. URL query parameters found in the HTTP request are mapped to (c) fields. +// 4. Any body sent with an HTTP request can contain only (b) fields. +// +// The syntax of the path template is as follows: +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single path segment. The syntax `**` matches zero +// or more path segments, which must be the last part of the path except the +// `Verb`. The syntax `LITERAL` matches literal text in the path. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path, all characters +// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the +// Discovery Document as `{var}`. +// +// If a variable contains one or more path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path, all +// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables +// show up in the Discovery Document as `{+var}`. +// +// NOTE: While the single segment variable matches the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 +// Simple String Expansion, the multi segment variable **does not** match +// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. +// +// NOTE: the field paths in variables and in the `body` must not refer to +// repeated fields or map fields. +message HttpRule { + // Selects methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax + // details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Used for listing and getting information about resources. + string get = 2; + + // Used for updating a resource. + string put = 3; + + // Used for creating a resource. + string post = 4; + + // Used for deleting a resource. + string delete = 5; + + // Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP body, or + // `*` for mapping all fields not captured by the path pattern to the HTTP + // body. NOTE: the referred field must not be a repeated field and must be + // present at the top-level of request message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // body of response. Other response fields are ignored. When + // not set, the response message will be used as HTTP body of response. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/proto/google/api/httpbody.proto b/proto/google/api/httpbody.proto new file mode 100644 index 0000000..573f8d1 --- /dev/null +++ b/proto/google/api/httpbody.proto @@ -0,0 +1,78 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) returns +// (google.protobuf.Empty); +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} \ No newline at end of file diff --git a/proto/google/protobuf/any.proto b/proto/google/protobuf/any.proto new file mode 100644 index 0000000..e1faae4 --- /dev/null +++ b/proto/google/protobuf/any.proto @@ -0,0 +1,161 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "gogoproto/gogo.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "types"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := ptypes.MarshalAny(foo) +// ... +// foo := &pb.Foo{} +// if err := ptypes.UnmarshalAny(any, foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; + + option (gogoproto.typedecl) = false; +} + +option (gogoproto.goproto_registration) = false; diff --git a/proto/google/protobuf/descriptor.proto b/proto/google/protobuf/descriptor.proto new file mode 100644 index 0000000..42832c9 --- /dev/null +++ b/proto/google/protobuf/descriptor.proto @@ -0,0 +1,895 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must be belong to a oneof to + // signal to old proto3 clients that presence is tracked for this field. This + // oneof is known as a "synthetic" oneof, and this field must be its sole + // member (each proto3 optional field gets its own synthetic oneof). Synthetic + // oneofs exist in the descriptor only, and do not generate any API. Synthetic + // oneofs must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + // If set, all the classes from the .proto file are wrapped in a single + // outer class with the given name. This applies to both Proto1 + // (equivalent to the old "--one_java_file" option) and Proto2 (where + // a .proto always translates to a single class, but you may want to + // explicitly choose the class name). + optional string java_outer_classname = 8; + + // If set true, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the outer class + // named by java_outer_classname. However, the outer class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + optional bool lazy = 5 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto new file mode 100644 index 0000000..8e3a909 --- /dev/null +++ b/proto/tendermint/abci/types.proto @@ -0,0 +1,407 @@ +syntax = "proto3"; +package tendermint.abci; + +option go_package = "github.com/tendermint/tendermint/abci/types"; + +// For more information on gogo.proto, see: +// https://github.com/gogo/protobuf/blob/master/extensions.md +import "tendermint/crypto/proof.proto"; +import "tendermint/types/types.proto"; +import "tendermint/crypto/keys.proto"; +import "tendermint/types/params.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +// This file is copied from http://github.com/tendermint/abci +// NOTE: When using custom types, mind the warnings. +// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues + +//---------------------------------------- +// Request types + +message Request { + oneof value { + RequestEcho echo = 1; + RequestFlush flush = 2; + RequestInfo info = 3; + RequestSetOption set_option = 4; + RequestInitChain init_chain = 5; + RequestQuery query = 6; + RequestBeginBlock begin_block = 7; + RequestCheckTx check_tx = 8; + RequestDeliverTx deliver_tx = 9; + RequestEndBlock end_block = 10; + RequestCommit commit = 11; + RequestListSnapshots list_snapshots = 12; + RequestOfferSnapshot offer_snapshot = 13; + RequestLoadSnapshotChunk load_snapshot_chunk = 14; + RequestApplySnapshotChunk apply_snapshot_chunk = 15; + } +} + +message RequestEcho { + string message = 1; +} + +message RequestFlush {} + +message RequestInfo { + string version = 1; + uint64 block_version = 2; + uint64 p2p_version = 3; +} + +// nondeterministic +message RequestSetOption { + string key = 1; + string value = 2; +} + +message RequestInitChain { + google.protobuf.Timestamp time = 1 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2; + ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; +} + +message RequestQuery { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +message RequestBeginBlock { + bytes hash = 1; + tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; + LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; +} + +enum CheckTxType { + NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; + RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; +} + +message RequestCheckTx { + bytes tx = 1; + CheckTxType type = 2; +} + +message RequestDeliverTx { + bytes tx = 1; +} + +message RequestEndBlock { + int64 height = 1; +} + +message RequestCommit {} + +// lists available snapshots +message RequestListSnapshots { +} + +// offers a snapshot to the application +message RequestOfferSnapshot { + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height +} + +// loads a snapshot chunk +message RequestLoadSnapshotChunk { + uint64 height = 1; + uint32 format = 2; + uint32 chunk = 3; +} + +// Applies a snapshot chunk +message RequestApplySnapshotChunk { + uint32 index = 1; + bytes chunk = 2; + string sender = 3; +} + +//---------------------------------------- +// Response types + +message Response { + oneof value { + ResponseException exception = 1; + ResponseEcho echo = 2; + ResponseFlush flush = 3; + ResponseInfo info = 4; + ResponseSetOption set_option = 5; + ResponseInitChain init_chain = 6; + ResponseQuery query = 7; + ResponseBeginBlock begin_block = 8; + ResponseCheckTx check_tx = 9; + ResponseDeliverTx deliver_tx = 10; + ResponseEndBlock end_block = 11; + ResponseCommit commit = 12; + ResponseListSnapshots list_snapshots = 13; + ResponseOfferSnapshot offer_snapshot = 14; + ResponseLoadSnapshotChunk load_snapshot_chunk = 15; + ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + } +} + +// nondeterministic +message ResponseException { + string error = 1; +} + +message ResponseEcho { + string message = 1; +} + +message ResponseFlush {} + +message ResponseInfo { + string data = 1; + + string version = 2; + uint64 app_version = 3; + + int64 last_block_height = 4; + bytes last_block_app_hash = 5; +} + +// nondeterministic +message ResponseSetOption { + uint32 code = 1; + // bytes data = 2; + string log = 3; + string info = 4; +} + +message ResponseInitChain { + ConsensusParams consensus_params = 1; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + bytes app_hash = 3; +} + +message ResponseQuery { + uint32 code = 1; + // bytes data = 2; // use "value" instead. + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + tendermint.crypto.ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +message ResponseBeginBlock { + repeated Event events = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCheckTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; +} + +message ResponseDeliverTx { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic + string codespace = 8; +} + +message ResponseEndBlock { + repeated ValidatorUpdate validator_updates = 1 + [(gogoproto.nullable) = false]; + ConsensusParams consensus_param_updates = 2; + repeated Event events = 3 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; +} + +message ResponseCommit { + // reserve 1 + bytes data = 2; + int64 retain_height = 3; +} + +message ResponseListSnapshots { + repeated Snapshot snapshots = 1; +} + +message ResponseOfferSnapshot { + Result result = 1; + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + } +} + +message ResponseLoadSnapshotChunk { + bytes chunk = 1; +} + +message ResponseApplySnapshotChunk { + Result result = 1; + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban + + enum Result { + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + } +} + +//---------------------------------------- +// Misc. + +// ConsensusParams contains all consensus-relevant parameters +// that can be adjusted by the abci app +message ConsensusParams { + BlockParams block = 1; + tendermint.types.EvidenceParams evidence = 2; + tendermint.types.ValidatorParams validator = 3; + tendermint.types.VersionParams version = 4; +} + +// BlockParams contains limits on the block size. +message BlockParams { + // Note: must be greater than 0 + int64 max_bytes = 1; + // Note: must be greater or equal to -1 + int64 max_gas = 2; +} + +message LastCommitInfo { + int32 round = 1; + repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; +} + +// Event allows application developers to attach additional information to +// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. +// Later, transactions may be queried using these events. +message Event { + string type = 1; + repeated EventAttribute attributes = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "attributes,omitempty" + ]; +} + +// EventAttribute is a single key-value pair, associated with an event. +message EventAttribute { + bytes key = 1; + bytes value = 2; + bool index = 3; // nondeterministic +} + +// TxResult contains results of executing the transaction. +// +// One usage is indexing transaction results. +message TxResult { + int64 height = 1; + uint32 index = 2; + bytes tx = 3; + ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; +} + +//---------------------------------------- +// Blockchain Types + +// Validator +message Validator { + bytes address = 1; // The first 20 bytes of SHA256(public key) + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; + int64 power = 3; // The voting power +} + +// ValidatorUpdate +message ValidatorUpdate { + tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; + int64 power = 2; +} + +// VoteInfo +message VoteInfo { + Validator validator = 1 [(gogoproto.nullable) = false]; + bool signed_last_block = 2; +} + +enum EvidenceType { + UNKNOWN = 0; + DUPLICATE_VOTE = 1; + LIGHT_CLIENT_ATTACK = 2; +} + +message Evidence { + EvidenceType type = 1; + // The offending validator + Validator validator = 2 [(gogoproto.nullable) = false]; + // The height when the offense occurred + int64 height = 3; + // The corresponding time where the offense occurred + google.protobuf.Timestamp time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + // Total voting power of the validator set in case the ABCI application does + // not store historical validators. + // https://github.com/tendermint/tendermint/issues/4581 + int64 total_voting_power = 5; +} + +//---------------------------------------- +// State Sync Types + +message Snapshot { + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata +} + +//---------------------------------------- +// Service Definition + +service ABCIApplication { + rpc Echo(RequestEcho) returns (ResponseEcho); + rpc Flush(RequestFlush) returns (ResponseFlush); + rpc Info(RequestInfo) returns (ResponseInfo); + rpc SetOption(RequestSetOption) returns (ResponseSetOption); + rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); + rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); + rpc Query(RequestQuery) returns (ResponseQuery); + rpc Commit(RequestCommit) returns (ResponseCommit); + rpc InitChain(RequestInitChain) returns (ResponseInitChain); + rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); + rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); + rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); + rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); +} diff --git a/proto/tendermint/crypto/keys.proto b/proto/tendermint/crypto/keys.proto new file mode 100644 index 0000000..16fd7ad --- /dev/null +++ b/proto/tendermint/crypto/keys.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +// PublicKey defines the keys available for use with Tendermint Validators +message PublicKey { + option (gogoproto.compare) = true; + option (gogoproto.equal) = true; + + oneof sum { + bytes ed25519 = 1; + bytes secp256k1 = 2; + } +} diff --git a/proto/tendermint/crypto/proof.proto b/proto/tendermint/crypto/proof.proto new file mode 100644 index 0000000..975df76 --- /dev/null +++ b/proto/tendermint/crypto/proof.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package tendermint.crypto; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; + +import "gogoproto/gogo.proto"; + +message Proof { + int64 total = 1; + int64 index = 2; + bytes leaf_hash = 3; + repeated bytes aunts = 4; +} + +message ValueOp { + // Encoded in ProofOp.Key. + bytes key = 1; + + // To encode in ProofOp.Data + Proof proof = 2; +} + +message DominoOp { + string key = 1; + string input = 2; + string output = 3; +} + +// ProofOp defines an operation used for calculating Merkle root +// The data could be arbitrary format, providing nessecary data +// for example neighbouring node hash +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/tendermint/libs/bits/types.proto b/proto/tendermint/libs/bits/types.proto new file mode 100644 index 0000000..3111d11 --- /dev/null +++ b/proto/tendermint/libs/bits/types.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package tendermint.libs.bits; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits"; + +message BitArray { + int64 bits = 1; + repeated uint64 elems = 2; +} diff --git a/proto/tendermint/p2p/types.proto b/proto/tendermint/p2p/types.proto new file mode 100644 index 0000000..0d42ea4 --- /dev/null +++ b/proto/tendermint/p2p/types.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package tendermint.p2p; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; + +import "gogoproto/gogo.proto"; + +message NetAddress { + string id = 1 [(gogoproto.customname) = "ID"]; + string ip = 2 [(gogoproto.customname) = "IP"]; + uint32 port = 3; +} + +message ProtocolVersion { + uint64 p2p = 1 [(gogoproto.customname) = "P2P"]; + uint64 block = 2; + uint64 app = 3; +} + +message DefaultNodeInfo { + ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false]; + string default_node_id = 2 [(gogoproto.customname) = "DefaultNodeID"]; + string listen_addr = 3; + string network = 4; + string version = 5; + bytes channels = 6; + string moniker = 7; + DefaultNodeInfoOther other = 8 [(gogoproto.nullable) = false]; +} + +message DefaultNodeInfoOther { + string tx_index = 1; + string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"]; +} diff --git a/proto/tendermint/types/block.proto b/proto/tendermint/types/block.proto new file mode 100644 index 0000000..84e9bb1 --- /dev/null +++ b/proto/tendermint/types/block.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; + +message Block { + Header header = 1 [(gogoproto.nullable) = false]; + Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + Commit last_commit = 4; +} diff --git a/proto/tendermint/types/evidence.proto b/proto/tendermint/types/evidence.proto new file mode 100644 index 0000000..3b23457 --- /dev/null +++ b/proto/tendermint/types/evidence.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/validator.proto"; + +message Evidence { + oneof sum { + DuplicateVoteEvidence duplicate_vote_evidence = 1; + LightClientAttackEvidence light_client_attack_evidence = 2; + } +} + +// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. +message DuplicateVoteEvidence { + tendermint.types.Vote vote_a = 1; + tendermint.types.Vote vote_b = 2; + int64 total_voting_power = 3; + int64 validator_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. +message LightClientAttackEvidence { + tendermint.types.LightBlock conflicting_block = 1; + int64 common_height = 2; + repeated tendermint.types.Validator byzantine_validators = 3; + int64 total_voting_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +message EvidenceList { + repeated Evidence evidence = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/tendermint/types/params.proto b/proto/tendermint/types/params.proto new file mode 100644 index 0000000..0de7d84 --- /dev/null +++ b/proto/tendermint/types/params.proto @@ -0,0 +1,80 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option (gogoproto.equal_all) = true; + +// ConsensusParams contains consensus critical parameters that determine the +// validity of blocks. +message ConsensusParams { + BlockParams block = 1 [(gogoproto.nullable) = false]; + EvidenceParams evidence = 2 [(gogoproto.nullable) = false]; + ValidatorParams validator = 3 [(gogoproto.nullable) = false]; + VersionParams version = 4 [(gogoproto.nullable) = false]; +} + +// BlockParams contains limits on the block size. +message BlockParams { + // Max block size, in bytes. + // Note: must be greater than 0 + int64 max_bytes = 1; + // Max gas per block. + // Note: must be greater or equal to -1 + int64 max_gas = 2; + // Minimum time increment between consecutive blocks (in milliseconds) If the + // block header timestamp is ahead of the system clock, decrease this value. + // + // Not exposed to the application. + int64 time_iota_ms = 3; +} + +// EvidenceParams determine how we handle evidence of malfeasance. +message EvidenceParams { + // Max age of evidence, in blocks. + // + // The basic formula for calculating this is: MaxAgeDuration / {average block + // time}. + int64 max_age_num_blocks = 1; + + // Max age of evidence, in time. + // + // It should correspond with an app's "unbonding period" or other similar + // mechanism for handling [Nothing-At-Stake + // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + google.protobuf.Duration max_age_duration = 2 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + + // This sets the maximum size of total evidence in bytes that can be committed in a single block. + // and should fall comfortably under the max block bytes. + // Default is 1048576 or 1MB + int64 max_bytes = 3; +} + +// ValidatorParams restrict the public key types validators can use. +// NOTE: uses ABCI pubkey naming, not Amino names. +message ValidatorParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + repeated string pub_key_types = 1; +} + +// VersionParams contains the ABCI application version. +message VersionParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + uint64 app_version = 1; +} + +// HashedParams is a subset of ConsensusParams. +// +// It is hashed into the Header.ConsensusHash. +message HashedParams { + int64 block_max_bytes = 1; + int64 block_max_gas = 2; +} diff --git a/proto/tendermint/types/types.proto b/proto/tendermint/types/types.proto new file mode 100644 index 0000000..7f7ea74 --- /dev/null +++ b/proto/tendermint/types/types.proto @@ -0,0 +1,157 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/crypto/proof.proto"; +import "tendermint/version/types.proto"; +import "tendermint/types/validator.proto"; + +// BlockIdFlag indicates which BlcokID the signature is for +enum BlockIDFlag { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; + BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; + BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; + BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; +} + +// SignedMsgType is a type of signed message in the consensus. +enum SignedMsgType { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; + // Votes + SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; + SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; + + // Proposals + SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; +} + +// PartsetHeader +message PartSetHeader { + uint32 total = 1; + bytes hash = 2; +} + +message Part { + uint32 index = 1; + bytes bytes = 2; + tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; +} + +// BlockID +message BlockID { + bytes hash = 1; + PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; +} + +// -------------------------------- + +// 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 + 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 + bytes proposer_address = 14; // original proposer of the block +} + +// Data contains the set of transactions included in the block +message Data { + // Txs that will be applied by state @ block.Height+1. + // NOTE: not all txs here are valid. We're just agreeing on the order first. + // This means that block.AppHash does not include these txs. + repeated bytes txs = 1; +} + +// Vote represents a prevote, precommit, or commit vote from validators for +// consensus. +message Vote { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + BlockID block_id = 4 + [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; + bytes signature = 8; +} + +// Commit contains the evidence that a block was committed by a set of validators. +message Commit { + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; +} + +// CommitSig is a part of the Vote included in a Commit. +message CommitSig { + BlockIDFlag block_id_flag = 1; + bytes validator_address = 2; + google.protobuf.Timestamp timestamp = 3 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; +} + +message Proposal { + SignedMsgType type = 1; + int64 height = 2; + int32 round = 3; + int32 pol_round = 4; + BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + google.protobuf.Timestamp timestamp = 6 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; +} + +message SignedHeader { + Header header = 1; + Commit commit = 2; +} + +message LightBlock { + SignedHeader signed_header = 1; + tendermint.types.ValidatorSet validator_set = 2; +} + +message BlockMeta { + BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; + int64 block_size = 2; + Header header = 3 [(gogoproto.nullable) = false]; + int64 num_txs = 4; +} + +// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. +message TxProof { + bytes root_hash = 1; + bytes data = 2; + tendermint.crypto.Proof proof = 3; +} diff --git a/proto/tendermint/types/validator.proto b/proto/tendermint/types/validator.proto new file mode 100644 index 0000000..49860b9 --- /dev/null +++ b/proto/tendermint/types/validator.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package tendermint.types; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; + +import "gogoproto/gogo.proto"; +import "tendermint/crypto/keys.proto"; + +message ValidatorSet { + repeated Validator validators = 1; + Validator proposer = 2; + int64 total_voting_power = 3; +} + +message Validator { + bytes address = 1; + tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; + int64 voting_power = 3; + int64 proposer_priority = 4; +} + +message SimpleValidator { + tendermint.crypto.PublicKey pub_key = 1; + int64 voting_power = 2; +} diff --git a/proto/tendermint/version/types.proto b/proto/tendermint/version/types.proto new file mode 100644 index 0000000..6061868 --- /dev/null +++ b/proto/tendermint/version/types.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package tendermint.version; + +option go_package = "github.com/tendermint/tendermint/proto/tendermint/version"; + +import "gogoproto/gogo.proto"; + +// App includes the protocol and software version for the application. +// This information is included in ResponseInfo. The App.Protocol can be +// updated in ResponseEndBlock. +message App { + uint64 protocol = 1; + string software = 2; +} + +// Consensus captures the consensus rules for processing a block in the blockchain, +// including all blockchain data structures and the rules of the application's +// state transition machine. +message Consensus { + option (gogoproto.equal) = true; + + uint64 block = 1; + uint64 app = 2; +} diff --git a/proto/vulcanize/auction/v1beta1/genesis.proto b/proto/vulcanize/auction/v1beta1/genesis.proto new file mode 100644 index 0000000..9a50e3f --- /dev/null +++ b/proto/vulcanize/auction/v1beta1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package vulcanize.auction.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/auction/v1beta1/types.proto"; + +option go_package = "github.com/tharsis/ethermint/x/auction/types"; + +// GenesisState defines the genesis state of the auction module +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + repeated Auction auctions = 2 [ + (gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\"" + ]; +} diff --git a/proto/vulcanize/auction/v1beta1/query.proto b/proto/vulcanize/auction/v1beta1/query.proto new file mode 100644 index 0000000..6ef39d2 --- /dev/null +++ b/proto/vulcanize/auction/v1beta1/query.proto @@ -0,0 +1,149 @@ +syntax = "proto3"; +package vulcanize.auction.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "vulcanize/auction/v1beta1/types.proto"; + +option go_package = "github.com/tharsis/ethermint/x/auction/types"; + +// AuctionsRequest is the format for querying all the auctions +message AuctionsRequest { + // pagination defines an optional pagination info for the next request + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// AuctionsResponse returns the list of all auctions +message AuctionsResponse { + // List of auctions + Auctions auctions = 1; + // pagination defines an optional pagination info for the next request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// AuctionRequest is the format for querying a specific auction +message AuctionRequest { + // Auction ID + string id = 1; +} + +// AuctionResponse returns the details of the queried auction +message AuctionResponse { + // Auction details + Auction auction = 1; +} + +// BidRequest is the format for querying a specific bid in an auction +message BidRequest { + // Auction ID + string auction_id = 1; + // Bidder address + string bidder = 2; +} + +// BidResponse returns the details of the queried bid +message BidResponse { + // Bid details + Bid bid = 1; +} + +// BidsRequest is the format for querying all bids in an auction +message BidsRequest { + // Auction ID + string auction_id = 1; +} + +// BidsResponse returns details of all bids in an auction +message BidsResponse { + // List of bids in the auction + repeated Bid bids = 1; +} + +// AuctionsByBidderRequest is the format for querying all auctions containing a bidder address +message AuctionsByBidderRequest { + // Address of the bidder + string bidder_address = 1; +} + +// AuctionsByBidderResponse returns all auctions containing a bidder +message AuctionsByBidderResponse { + // List of auctions + Auctions auctions = 1; +} + +// AuctionsByOwnerRequest is the format for querying all auctions created by an owner +message AuctionsByOwnerRequest { + // Address of the owner + string owner_address = 1; +} + +// AuctionsByOwnerResponse returns all auctions created by an owner +message AuctionsByOwnerResponse { + // List of auctions + Auctions auctions = 1; +} + +// QueryParamsRequest is the format to query the parameters of the auction module +message QueryParamsRequest { +} + +// QueryParamsResponse returns parameters of the auction module +message QueryParamsResponse { + Params params = 1; +} + +// BalanceRequest is the format to fetch all balances +message BalanceRequest { +} + +message BalanceResponse { + // Set of all balances within the auction + repeated cosmos.base.v1beta1.Coin balance = 1 [ + (gogoproto.nullable) = false + ]; +} + +// Query defines the gRPC querier interface for the auction module +service Query { + // Auctions queries all auctions + rpc Auctions(AuctionsRequest) returns (AuctionsResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/auctions"; + } + + // GetAuction queries an auction + rpc GetAuction(AuctionRequest) returns (AuctionResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/auctions/{id}"; + } + + // GetBid queries an auction bid + rpc GetBid(BidRequest) returns (BidResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/bids/{auction_id}/{bidder}"; + } + + // GetBids queries all auction bids + rpc GetBids(BidsRequest) returns (BidsResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/bids/{auction_id}"; + } + + // AuctionsByBidder queries auctions by bidder + rpc AuctionsByBidder(AuctionsByBidderRequest) returns (AuctionsByBidderResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/by-bidder/{bidder_address}"; + } + + // AuctionsByOwner queries auctions by owner + rpc AuctionsByOwner(AuctionsByOwnerRequest) returns (AuctionsByOwnerResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/by-owner/{owner_address}"; + } + + // QueryParams implements the params query command + rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/params"; + } + + // Balance queries the auction module account balance + rpc Balance(BalanceRequest) returns (BalanceResponse) { + option (google.api.http).get = "/vulcanize/auction/v1beta1/balance"; + } +} diff --git a/proto/vulcanize/auction/v1beta1/tx.proto b/proto/vulcanize/auction/v1beta1/tx.proto new file mode 100644 index 0000000..9602dec --- /dev/null +++ b/proto/vulcanize/auction/v1beta1/tx.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; +package vulcanize.auction.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "vulcanize/auction/v1beta1/types.proto"; + +option go_package = "github.com/tharsis/ethermint/x/auction/types"; + +// MsgCreateAuction defines a create auction message +message MsgCreateAuction { + option (gogoproto.goproto_getters) = false; + + // Duration of the commits phase in seconds + google.protobuf.Duration commits_duration = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\"" + ]; + // Duration of the reveals phase in seconds + google.protobuf.Duration reveals_duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\"" + ]; + // Commit fees + cosmos.base.v1beta1.Coin commit_fee = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" + ]; + // Reveal fees + cosmos.base.v1beta1.Coin reveal_fee = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" + ]; + // Minimum acceptable bid amount + cosmos.base.v1beta1.Coin minimum_bid = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" + ]; + // Address of the signer + string signer = 6 [ + (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" + ]; +} + +// MsgCreateAuctionResponse returns the details of the created auction +message MsgCreateAuctionResponse { + option (gogoproto.goproto_getters) = false; + // Auction details + Auction auction = 1 [ + (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" + ]; +} + +// CommitBid defines the message to commit a bid +message MsgCommitBid { + option (gogoproto.goproto_getters) = false; + + // Auction ID + string auction_id = 1 [ + (gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\"" + ]; + // Commit Hash + string commit_hash = 2 [ + (gogoproto.moretags) = "json:\"commit_hash\" yaml:\"commit_hash\"" + ]; + // Address of the signer + string signer = 3 [ + (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" + ]; +} + +// RevealBid defines the message to reveal a bid +message MsgRevealBid { + option (gogoproto.goproto_getters) = false; + + // Auction ID + string auction_id = 1 [ + (gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\"" + ]; + // Commit Hash + string reveal = 2 [ + (gogoproto.moretags) = "json:\"reveal\" yaml:\"reveal\"" + ]; + // Address of the signer + string signer = 3 [ + (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" + ]; +} + +// MsgCommitBidResponse returns the state of the auction after the bid creation +message MsgCommitBidResponse { + option (gogoproto.goproto_getters) = false; + // Auction details + Bid bid = 1 [ + (gogoproto.moretags) = "json:\"bid\" yaml:\"bid\"" + ]; +} + +// MsgRevealBidResponse returns the state of the auction after the bid reveal +message MsgRevealBidResponse { + option (gogoproto.goproto_getters) = false; + // Auction details + Auction auction = 1 [ + (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" + ]; +} + +// Tx defines the gRPC tx interface +service Msg { + // CreateAuction is the command for creating an auction + rpc CreateAuction(MsgCreateAuction) returns (MsgCreateAuctionResponse); + + // CommitBid is the command for committing a bid + rpc CommitBid(MsgCommitBid) returns (MsgCommitBidResponse); + + //RevealBid is the command for revealing a bid + rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse); +} + diff --git a/proto/vulcanize/auction/v1beta1/types.proto b/proto/vulcanize/auction/v1beta1/types.proto new file mode 100644 index 0000000..4ec5462 --- /dev/null +++ b/proto/vulcanize/auction/v1beta1/types.proto @@ -0,0 +1,135 @@ +syntax = "proto3"; +package vulcanize.auction.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/tharsis/ethermint/x/auction/types"; + +// Params defines the auction module parameters +message Params { + option (gogoproto.goproto_stringer) = false; + + // Duration of the commits phase in seconds + google.protobuf.Duration commits_duration = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\"" + ]; + // Duration of the reveals phase in seconds + google.protobuf.Duration reveals_duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\"" + ]; + // Commit fees + cosmos.base.v1beta1.Coin commit_fee = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" + ]; + // Reveal fees + cosmos.base.v1beta1.Coin reveal_fee = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" + ]; + // Minimum acceptable bid amount + cosmos.base.v1beta1.Coin minimum_bid = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" + ]; +} + +// Auction represents a sealed-bid on-chain auction +message Auction { + option (gogoproto.goproto_getters) = false; + + string id = 1; + string status = 2; + // Address of the creator of the auction + string owner_address = 3; + // Timestamp at which the auction was created + google.protobuf.Timestamp create_time = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\"" + ]; + // Timestamp at which the commits phase concluded + google.protobuf.Timestamp commits_end_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\"" + ]; + // Timestamp at which the reveals phase concluded + google.protobuf.Timestamp reveals_end_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\"" + ]; + // Commit and reveal fees must both be paid when committing a bid + // Reveal fee is returned only if the bid is revealed + cosmos.base.v1beta1.Coin commit_fee = 7 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" + ]; + cosmos.base.v1beta1.Coin reveal_fee = 8 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" + ]; + // Minimum acceptable bid amount for a valid commit + cosmos.base.v1beta1.Coin minimum_bid = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" + ]; + // Address of the winner + string winner_address = 10; + // Winning bid, i.e., the highest bid + cosmos.base.v1beta1.Coin winning_bid = 11 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"winning_bid\" yaml:\"winning_bid\"" + ]; + // Amount the winner pays, i.e. the second highest auction + cosmos.base.v1beta1.Coin winning_price = 12 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" + ]; +} + +message Auctions { + option (gogoproto.goproto_getters) = false; + + repeated Auction auctions = 1 [(gogoproto.nullable) = false]; +} + +// Bid represents a sealed bid (commit) made during the auction +message Bid { + option (gogoproto.goproto_getters) = false; + + string auction_id = 1; + string bidder_address = 2; + string status = 3; + string commit_hash = 4; + google.protobuf.Timestamp commit_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"commit_time\" yaml:\"commit_time\"" + ]; + cosmos.base.v1beta1.Coin commit_fee = 6 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" + ]; + google.protobuf.Timestamp reveal_time = 7 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"reveal_time\" yaml:\"reveal_time\"" + ]; + cosmos.base.v1beta1.Coin reveal_fee = 8 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" + ]; + cosmos.base.v1beta1.Coin bid_amount = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"bid_amount\" yaml:\"bid_amount\"" + ];; +} diff --git a/proto/vulcanize/bond/v1beta1/bond.proto b/proto/vulcanize/bond/v1beta1/bond.proto new file mode 100644 index 0000000..c5b3214 --- /dev/null +++ b/proto/vulcanize/bond/v1beta1/bond.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package vulcanize.bond.v1beta1; + +option go_package = "github.com/tharsis/ethermint/x/bond/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Params defines the bond module parameters +message Params { + // max_bond_amount is maximum amount to bond + cosmos.base.v1beta1.Coin max_bond_amount = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"max_bond_amount\" yaml:\"max_bond_amount\"" + ]; +} + +// Bond represents funds deposited by an account for record rent payments. +message Bond { + // id is unique identifier of the bond + string id = 1; + // owner of the bond + string owner = 2; + // balance of the bond + repeated cosmos.base.v1beta1.Coin balance = 3 [ + (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"balance\" yaml:\"balance\"" + ]; +} diff --git a/proto/vulcanize/bond/v1beta1/genesis.proto b/proto/vulcanize/bond/v1beta1/genesis.proto new file mode 100644 index 0000000..7f46f06 --- /dev/null +++ b/proto/vulcanize/bond/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package vulcanize.bond.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/bond/v1beta1/bond.proto"; + +option go_package = "github.com/tharsis/ethermint/x/bond/types"; + +// GenesisState defines the bond module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // bonds defines all the bonds + repeated Bond bonds = 2 [ + (gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\"" + ]; +} diff --git a/proto/vulcanize/bond/v1beta1/query.proto b/proto/vulcanize/bond/v1beta1/query.proto new file mode 100644 index 0000000..866c3c0 --- /dev/null +++ b/proto/vulcanize/bond/v1beta1/query.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; +package vulcanize.bond.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/bond/v1beta1/bond.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/tharsis/ethermint/x/bond/types"; + +// Query defines the gRPC querier service for bond module +service Query { + // Params queries bonds module params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/vulcanize/bond/v1beta1/params"; + } + + // Bonds queries bonds list. + rpc Bonds(QueryGetBondsRequest) returns (QueryGetBondsResponse) { + option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds"; + } + + // GetBondById + rpc GetBondById(QueryGetBondByIdRequest) returns (QueryGetBondByIdResponse){ + option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds/{id}"; + } + + // Get Bonds List by Owner + rpc GetBondsByOwner(QueryGetBondsByOwnerRequest) returns (QueryGetBondsByOwnerResponse){ + option (google.api.http).get = "/vulcanize/bond/v1beta1/by-owner/{owner}"; + } + + // Get Bonds module balance + rpc GetBondsModuleBalance(QueryGetBondModuleBalanceRequest) returns (QueryGetBondModuleBalanceResponse){ + option (google.api.http).get = "/vulcanize/bond/v1beta1/balance"; + } +} + +// QueryParamsRequest is request for query the bond module params +message QueryParamsRequest{ +} + +// QueryParamsResponse returns response type of bond module params +message QueryParamsResponse{ + Params params = 1 [ + (gogoproto.moretags) = "json:\"params\" yaml:\"params\"" + ]; +} + +// QueryGetBondById queries a bond by bond-id. +message QueryGetBondsRequest{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGetBondsResponse is response type for get the bonds by bond-id +message QueryGetBondsResponse{ + repeated Bond bonds = 1 [ + (gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\"" + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGetBondById +message QueryGetBondByIdRequest{ + string id = 1 [ + (gogoproto.moretags) = "json:\"id\" yaml:\"id\"" + ]; +} + +// QueryGetBondByIdResponse returns QueryGetBondById query response +message QueryGetBondByIdResponse{ + Bond bond = 1 [ + (gogoproto.moretags) = "json:\"bond\" yaml:\"bond\"" + ]; +} + +// QueryGetBondsByOwnerRequest is request type for Query/GetBondsByOwner RPC Method +message QueryGetBondsByOwnerRequest{ + string owner = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGetBondsByOwnerResponse is response type for Query/GetBondsByOwner RPC Method +message QueryGetBondsByOwnerResponse { + repeated Bond bonds = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\"" + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGetBondModuleBalanceRequest is request type for bond module balance rpc method +message QueryGetBondModuleBalanceRequest{ + +} + +// QueryGetBondModuleBalanceResponse is the response type for bond module balance rpc method +message QueryGetBondModuleBalanceResponse{ + repeated cosmos.base.v1beta1.Coin balance = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"coins\" yaml:\"coins\"" + ]; +} diff --git a/proto/vulcanize/bond/v1beta1/tx.proto b/proto/vulcanize/bond/v1beta1/tx.proto new file mode 100644 index 0000000..16cfe8e --- /dev/null +++ b/proto/vulcanize/bond/v1beta1/tx.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; +package vulcanize.bond.v1beta1; + +option go_package = "github.com/tharsis/ethermint/x/bond/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Msg defines the bond Msg service. +service Msg { + // CreateBond defines a method for creating a new bond. + rpc CreateBond(MsgCreateBond) returns (MsgCreateBondResponse); + + // RefillBond defines a method for refilling amount for bond. + rpc RefillBond(MsgRefillBond) returns (MsgRefillBondResponse); + + // WithdrawBond defines a method for withdrawing amount from bond. + rpc WithdrawBond(MsgWithdrawBond) returns (MsgWithdrawBondResponse); + + // CancelBond defines a method for cancelling a bond. + rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse); +} + +// MsgCreateBond defines a SDK message for creating a new bond. +message MsgCreateBond{ + string signer = 1; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"coins\" yaml:\"coins\"" + ]; +} + +// MsgCreateBondResponse defines the Msg/CreateBond response type. +message MsgCreateBondResponse{ + string id = 1; +} + +// MsgRefillBond defines a SDK message for refill the amount for bond. +message MsgRefillBond{ + string id = 1; + string signer = 2; + repeated cosmos.base.v1beta1.Coin coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"coins\" yaml:\"coins\"" + ]; +} + +// MsgRefillBondResponse defines the Msg/RefillBond response type. +message MsgRefillBondResponse{ +} + +// MsgWithdrawBond defines a SDK message for withdrawing amount from bond. +message MsgWithdrawBond { + string id = 1; + string signer = 2; + repeated cosmos.base.v1beta1.Coin coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"coins\" yaml:\"coins\"" + ]; +} + +// MsgWithdrawBondResponse defines the Msg/WithdrawBond response type. +message MsgWithdrawBondResponse{ +} + +// MsgCancelBond defines a SDK message for the cancel the bond. +message MsgCancelBond{ + string id = 1; + string signer = 2; +} + +// MsgCancelBondResponse defines the Msg/CancelBond response type. +message MsgCancelBondResponse{ +} diff --git a/proto/vulcanize/nameservice/v1beta1/genesis.proto b/proto/vulcanize/nameservice/v1beta1/genesis.proto new file mode 100644 index 0000000..8d71c3e --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/nameservice/v1beta1/nameservice.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// GenesisState defines the nameservice module's genesis state. +message GenesisState { + // params defines all the params of nameservice module. + Params params = 1 [ + (gogoproto.nullable) = false + ]; + // records + repeated Record records = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"records\" yaml:\"records\"" + ]; + // authorities + repeated AuthorityEntry authorities = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\"" + ]; + // names + repeated NameEntry names = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"names\" yaml:\"names\"" + ]; +} diff --git a/proto/vulcanize/nameservice/v1beta1/nameservice.proto b/proto/vulcanize/nameservice/v1beta1/nameservice.proto new file mode 100644 index 0000000..eaea814 --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/nameservice.proto @@ -0,0 +1,170 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// Params defines the nameservice module parameters +message Params { + cosmos.base.v1beta1.Coin record_rent = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\"" + ]; + google.protobuf.Duration record_rent_duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\"" + ]; + cosmos.base.v1beta1.Coin authority_rent = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\"" + ]; + google.protobuf.Duration authority_rent_duration = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\"" + ]; + google.protobuf.Duration authority_grace_period = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\"" + ]; + bool authority_auction_enabled = 6 [ + (gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\"" + ]; + google.protobuf.Duration authority_auction_commits_duration = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\"" + ]; + google.protobuf.Duration authority_auction_reveals_duration = 8 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\"" + ]; +} + +// Params defines the nameservice module records +message Record { + string id = 1 [ + (gogoproto.moretags) = "json:\"id\" yaml:\"id\"" + ]; + string bond_id = 2 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + google.protobuf.Timestamp create_time = 3 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\"" + ]; + google.protobuf.Timestamp expiry_time = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" + ]; + bool deleted = 5; + repeated string owners = 6 [ + (gogoproto.moretags) = "json:\"owners\" yaml:\"owners\"" + ]; + bytes attributes = 7 [ + (gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\"" + ]; +} + +// AuthorityEntry defines the nameservice module AuthorityEntries +message AuthorityEntry{ + string name = 1; + NameAuthority entry = 2; +} + +// NameAuthority +message NameAuthority { + // Owner public key. + string owner_public_key = 1 [ + (gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\"" + ]; + // Owner address. + string owner_address = 2 [ + (gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\"" + ]; + // height at which name/authority was created. + uint64 height = 3; + string status = 4; + string auction_id = 5 [ + (gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\"" + ]; + string bond_id = 6 [ + (gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\"" + ]; + google.protobuf.Timestamp expiry_time = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" + ]; +} + +// NameEntry +message NameEntry{ + string name = 1; + NameRecord entry = 2; +} + +// NameRecord +message NameRecord { + NameRecordEntry latest = 1; + repeated NameRecordEntry history = 2; +} + +// NameRecordEntry +message NameRecordEntry{ + string id = 1; + uint64 height = 2; +} + +// Signature +message Signature{ + string sig = 1 [ + (gogoproto.moretags) = "json:\"sig\" yaml:\"sig\"" + ]; + string pub_key = 2 [ + (gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\"" + ]; +} + +// BlockChangeSet +message BlockChangeSet{ + int64 height = 1; + repeated string records = 2; + repeated string auctions = 3; + repeated AuctionBidInfo auction_bids = 4 [ + (gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\"" + ]; + repeated string authorities = 5; + repeated string names = 6; +} + +// AuctionBidInfo +message AuctionBidInfo { + string auction_id = 1 [ + (gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\"" + ]; + string bidder_address = 2 [ + (gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\"" + ]; +} \ No newline at end of file diff --git a/proto/vulcanize/nameservice/v1beta1/query.proto b/proto/vulcanize/nameservice/v1beta1/query.proto new file mode 100644 index 0000000..6a3b376 --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/query.proto @@ -0,0 +1,211 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "vulcanize/nameservice/v1beta1/nameservice.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// Query defines the gRPC querier service for nameservice module +service Query { + // Params queries the nameservice module params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/params"; + } + // List records + rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records"; + } + // Get record by id + rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records/{id}"; + } + // Get records by bond id + rpc GetRecordByBondId(QueryRecordByBondIdRequest) returns (QueryRecordByBondIdResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}"; + } + // Get nameservice module balance + rpc GetNameServiceModuleBalance(GetNameServiceModuleBalanceRequest) returns (GetNameServiceModuleBalanceResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/balance"; + } + // List name records + rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/names"; + } + // Whois method retrieve the name authority info + rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/whois/{name}"; + } + // LookupWrn + rpc LookupWrn(QueryLookupWrn) returns (QueryLookupWrnResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/lookup"; + } + // ResolveWrn + rpc ResolveWrn(QueryResolveWrn) returns (QueryResolveWrnResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/resolve"; + } + // GetRecordExpiryQueue + rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/record-expiry"; + } + // GetAuthorityExpiryQueue + rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse){ + option (google.api.http).get = "/vulcanize/nameservice/v1beta1/authority-expiry"; + } +} + +// QueryParamsRequest is request type for nameservice params +message QueryParamsRequest{ +} + +// QueryParamsResponse is response type for nameservice params +message QueryParamsResponse{ + Params params = 1; +} + +// QueryListRecordsRequest is request type for nameservice records list +message QueryListRecordsRequest{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryListRecordsResponse is response type for nameservice records list +message QueryListRecordsResponse{ + repeated Record records = 1 [ + (gogoproto.nullable) = false + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +//QueryRecordByIdRequest is request type for nameservice records by id +message QueryRecordByIdRequest{ + string id = 1 ; +} + +// QueryRecordByIdResponse is response type for nameservice records by id +message QueryRecordByIdResponse{ + Record record = 1[ + (gogoproto.nullable) = false + ]; +} + +// QueryRecordByBondIdRequest is request type for get the records by bond-id +message QueryRecordByBondIdRequest{ + string id = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryRecordByBondIdResponse is response type for records list by bond-id +message QueryRecordByBondIdResponse{ + repeated Record records = 1 [ + (gogoproto.nullable) = false + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// GetNameServiceModuleBalanceRequest is request type for nameservice module accounts balance +message GetNameServiceModuleBalanceRequest{ +} + +// GetNameServiceModuleBalanceResponse is response type for nameservice module accounts balance +message GetNameServiceModuleBalanceResponse{ + repeated AccountBalance balances = 1; +} + +// AccountBalance is nameservice module account balance +message AccountBalance { + string account_name = 1 [ + (gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\"" + ]; + repeated cosmos.base.v1beta1.Coin balance = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"balance\" yaml:\"balance\"" + ]; +} + +// QueryListNameRecordsRequest is request type for nameservice names records +message QueryListNameRecordsRequest{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryListNameRecordsResponse is response type for nameservice names records +message QueryListNameRecordsResponse{ + repeated NameEntry names = 1 [ + (gogoproto.nullable) = false + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryWhoisRequest is request type for Get NameAuthority +message QueryWhoisRequest{ + string name = 1; +} + +// QueryWhoisResponse is response type for whois request +message QueryWhoisResponse{ + NameAuthority name_authority = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\"" + ]; +} + +// QueryLookupWrn is request type for LookupWrn +message QueryLookupWrn{ + string wrn = 1; +} + +// QueryLookupWrnResponse is response type for QueryLookupWrn +message QueryLookupWrnResponse{ + NameRecord name = 1; +} + +// QueryResolveWrn is request type for ResolveWrn +message QueryResolveWrn{ + string wrn = 1; +} + +// QueryResolveWrnResponse is response type for QueryResolveWrn +message QueryResolveWrnResponse{ + Record record = 1; +} + +// QueryGetRecordExpiryQueue +message QueryGetRecordExpiryQueue{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGetRecordExpiryQueueResponse +message QueryGetRecordExpiryQueueResponse{ + repeated ExpiryQueueRecord records = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// ExpiryQueueRecord +message ExpiryQueueRecord{ + string id = 1; + repeated string value = 2; +} + +// QueryGetAuthorityExpiryQueue +message QueryGetAuthorityExpiryQueue{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGetAuthorityExpiryQueueResponse +message QueryGetAuthorityExpiryQueueResponse{ + repeated ExpiryQueueRecord authorities = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/vulcanize/nameservice/v1beta1/tx.proto b/proto/vulcanize/nameservice/v1beta1/tx.proto new file mode 100644 index 0000000..5662aa6 --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/tx.proto @@ -0,0 +1,167 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/nameservice/v1beta1/nameservice.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// Msg +service Msg { + // SetRecord will records a new record with given payload and bond id + rpc SetRecord(MsgSetRecord) returns(MsgSetRecordResponse){} + // Renew Record will renew the expire record + rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse){} + // AssociateBond + rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse){} + // DissociateBond + rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse){} + // DissociateRecords + rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse){} + // ReAssociateRecords + rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse){} + // SetName will store the name with given wrn and name + rpc SetName(MsgSetName) returns (MsgSetNameResponse){} + // Reserve name + rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse){} + // Delete Name method will remove authority name + rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse){} + // SetAuthorityBond + rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse){} +} + +// MsgSetRecord +message MsgSetRecord{ + string bond_id = 1 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 2; + Payload payload = 3 [ + (gogoproto.nullable) = false + ]; +} + +// MsgSetRecordResponse +message MsgSetRecordResponse{ +} + +// Payload +message Payload { + Record record = 1; + repeated Signature signatures = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\"" + ]; +} + +// MsgSetName +message MsgSetName{ + string wrn = 1; + string cid = 2; + string signer = 3; +} + +// MsgSetNameResponse +message MsgSetNameResponse{ +} + +// MsgReserveName +message MsgReserveAuthority{ + string name = 1; + string signer = 2; + // if creating a sub-authority. + string owner = 3; +} + +// MsgReserveNameResponse +message MsgReserveAuthorityResponse{ +} + +// MsgSetAuthorityBond is SDK message for SetAuthorityBond +message MsgSetAuthorityBond{ + string name = 1; + string bond_id = 2 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 3; +} + +// MsgSetAuthorityBondResponse +message MsgSetAuthorityBondResponse{ +} + +// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority +message MsgDeleteNameAuthority{ + string wrn = 1; + string signer = 2; +} + +// MsgDeleteNameAuthorityResponse +message MsgDeleteNameAuthorityResponse{ +} + +//MsgRenewRecord is SDK message for Renew a record +message MsgRenewRecord{ + string record_id = 1 [ + (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" + ]; + string signer = 2; +} + +// MsgRenewRecordResponse +message MsgRenewRecordResponse{ +} + +// MsgAssociateBond +message MsgAssociateBond{ + string record_id = 1 [ + (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" + ]; + string bond_id = 2 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 3; +} + +// MsgAssociateBondResponse +message MsgAssociateBondResponse{ +} + +// MsgDissociateBond is SDK message for Msg/DissociateBond +message MsgDissociateBond{ + string record_id = 1 [ + (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" + ]; + string signer = 2; +} + +// MsgDissociateBondResponse is response type for MsgDissociateBond +message MsgDissociateBondResponse{ +} + +// MsgDissociateRecords is SDK message for Msg/DissociateRecords +message MsgDissociateRecords{ + string bond_id = 1 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 2; +} + +// MsgDissociateRecordsResponse is response type for MsgDissociateRecords +message MsgDissociateRecordsResponse{ +} + +// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords +message MsgReAssociateRecords{ + string new_bond_id = 1 [ + (gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\"" + ]; + string old_bond_id = 2 [ + (gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\"" + ]; + string signer = 3; +} + +// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords +message MsgReAssociateRecordsResponse{ +} diff --git a/scripts/create-proto-files.sh b/scripts/create-proto-files.sh new file mode 100755 index 0000000..962a851 --- /dev/null +++ b/scripts/create-proto-files.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# NOTE: protoc is required + +I=$(pwd)/proto +DEST_TS=$(pwd)/src/proto/ +mkdir -p $DEST_TS + +protoc \ +--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ +--ts_out=$DEST_TS \ +--proto_path=$I \ +$(find $(pwd)/proto/vulcanize -iname "*.proto") diff --git a/scripts/remove-grpc.sh b/scripts/remove-grpc.sh new file mode 100755 index 0000000..c92ca12 --- /dev/null +++ b/scripts/remove-grpc.sh @@ -0,0 +1,16 @@ +#!/bin/bash +echo $PWD +for file in $(find src/proto -type f) +do + line=$(grep -n '@grpc/grpc-js' $file | cut -f1 -d':') + if [[ $line -gt 0 ]]; + then + echo "Processing file... $file" + sed -i "${line}d" ${file} + functions=$(grep -n 'interface GrpcUnaryServiceInterface' $file | cut -f1 -d':') + sed -i "${functions},\$d" ${file} + echo '}' >> $file + fi + sed -i '1s#^#/* eslint-disable */\n#' $file + sed -i '1s#^#// @ts-nocheck\n#' $file +done diff --git a/src/bond.ts b/src/bond.ts new file mode 100644 index 0000000..c27ceec --- /dev/null +++ b/src/bond.ts @@ -0,0 +1,130 @@ +import { + createEIP712, + generateFee, + generateMessage, + generateTypes, +} from '@tharsis/eip712' +import { + Chain, + Sender, + Fee, +} from '@tharsis/transactions' +import { createTransaction } from '@tharsis/proto' + +import * as bondTx from './proto/vulcanize/bond/v1beta1/tx' +import * as coin from './proto/cosmos/base/v1beta1/coin' + +const MSG_CREATE_BOND_TYPES = { + MsgValue: [ + { name: 'signer', type: 'string' }, + { name: 'coins', type: 'TypeCoin[]' }, + ], + TypeCoin: [ + { name: 'denom', type: 'string' }, + { name: 'amount', type: 'string' }, + ], +} + +export interface MessageMsgCreateBond { + amount: string + denom: string +} + +export function createTxMsgCreateBond( + chain: Chain, + sender: Sender, + fee: Fee, + memo: string, + params: MessageMsgCreateBond, +) { + // EIP712 + const feeObject = generateFee( + fee.amount, + fee.denom, + fee.gas, + sender.accountAddress, + ) + const types = generateTypes(MSG_CREATE_BOND_TYPES) + + const msg = createMsgCreateBond( + sender.accountAddress, + params.amount, + params.denom + ) + + const messages = generateMessage( + sender.accountNumber.toString(), + sender.sequence.toString(), + chain.cosmosChainId, + memo, + feeObject, + msg, + ) + const eipToSign = createEIP712(types, chain.chainId, messages) + + // Cosmos + const msgCosmos = protoCreateMsgCreateBond( + sender.accountAddress, + params.amount, + params.denom + ) + + const tx = createTransaction( + msgCosmos, + memo, + fee.amount, + fee.denom, + parseInt(fee.gas, 10), + 'ethsecp256', + sender.pubkey, + sender.sequence, + sender.accountNumber, + chain.cosmosChainId, + ) + + return { + signDirect: tx.signDirect, + legacyAmino: tx.legacyAmino, + eipToSign, + } +} + +function createMsgCreateBond( + signer: string, + amount: string, + denom: string, +) { + return { + type: 'bond/MsgCreateBond', + value: { + signer, + coins: [ + { + amount, + denom, + }, + ], + }, + } +} + +const protoCreateMsgCreateBond = ( + signer: string, + amount: string, + denom: string, +) => { + const value = new coin.cosmos.base.v1beta1.Coin({ + denom, + amount, + }) + + const depositMessage = new bondTx.vulcanize.bond.v1beta1.MsgCreateBond({ + signer, + coins: [value] + }) + + return { + message: depositMessage, + path: 'vulcanize.bond.v1beta1.MsgCreateBond', + } +} diff --git a/src/gov.ts b/src/gov.ts new file mode 100644 index 0000000..4583044 --- /dev/null +++ b/src/gov.ts @@ -0,0 +1,136 @@ +import { + createEIP712, + generateFee, + generateMessage, + generateTypes, +} from '@tharsis/eip712' +import { + Chain, + Sender, + Fee, +} from '@tharsis/transactions' +import { createTransaction } from '@tharsis/proto' +import * as govTx from '@tharsis/proto/dist/proto/cosmos/gov/v1beta1/tx' +import * as coin from '@tharsis/proto/dist/proto/cosmos/base/v1beta1/coin' + +const MSG_DEPOSIT_TYPES = { + MsgValue: [ + { name: 'proposal_id', type: 'uint64' }, + { name: 'depositor', type: 'string' }, + { name: 'amount', type: 'TypeAmount[]' }, + ], + TypeAmount: [ + { name: 'denom', type: 'string' }, + { name: 'amount', type: 'string' }, + ], +} + +export interface MessageMsgDeposit { + proposalId: number + amount: string + denom: string +} + +export function createTxMsgDeposit( + chain: Chain, + sender: Sender, + fee: Fee, + memo: string, + params: MessageMsgDeposit, +) { + // EIP712 + const feeObject = generateFee( + fee.amount, + fee.denom, + fee.gas, + sender.accountAddress, + ) + const types = generateTypes(MSG_DEPOSIT_TYPES) + + const msg = createMsgDeposit( + params.proposalId, + sender.accountAddress, + params.amount, + params.denom + ) + + const messages = generateMessage( + sender.accountNumber.toString(), + sender.sequence.toString(), + chain.cosmosChainId, + memo, + feeObject, + msg, + ) + const eipToSign = createEIP712(types, chain.chainId, messages) + + // Cosmos + const msgCosmos = protoCreateMsgDeposit( + params.proposalId, + sender.accountAddress, + params.amount, + params.denom + ) + const tx = createTransaction( + msgCosmos, + memo, + fee.amount, + fee.denom, + parseInt(fee.gas, 10), + 'ethsecp256', + sender.pubkey, + sender.sequence, + sender.accountNumber, + chain.cosmosChainId, + ) + + return { + signDirect: tx.signDirect, + legacyAmino: tx.legacyAmino, + eipToSign, + } +} + +function createMsgDeposit( + proposalId: number, + depositor: string, + amount: string, + denom: string, +) { + return { + type: 'cosmos-sdk/MsgDeposit', + value: { + proposal_id: proposalId, + depositor, + amount: [ + { + amount, + denom, + }, + ], + }, + } +} + +const protoCreateMsgDeposit = ( + proposalId: number, + depositor: string, + amount: string, + denom: string, +) => { + const value = new coin.cosmos.base.v1beta1.Coin({ + denom, + amount, + }) + + const depositMessage = new govTx.cosmos.gov.v1beta1.MsgDeposit({ + proposal_id: proposalId, + depositor, + amount: [value] + }) + + return { + message: depositMessage, + path: 'cosmos.gov.v1beta1.MsgDeposit', + } +} diff --git a/src/index.test.ts b/src/index.test.ts index c9f23cc..9b7a380 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,18 +1,41 @@ -import { sendTokens, sendVote } from './index' +import { createBond, sendDeposit, sendTokens, sendVote } from './index' -const SENDER_ADDRESS = 'ethm1ayxjyxxa3z9z0rjff7rpr67h8aqfgn2t9009zc'; -const SENDER_PRIVATE_KEY = '5041b1ace7ea207794f4c5c1c5f987ff8a9d782f194ef5b24bcffaafaf4a019f'; -const TO_ADDRESS = 'ethm12x63cgg82ek97cf8ew9hf6r7je75s5w2smejqv'; +const SENDER_ADDRESS = 'ethm1ztkuzewqh0att04kn4gpkfk7vupmylcp3gr4zj'; +const SENDER_PRIVATE_KEY = '765082238ae967c6e6514a7984410dfe268f233959a01c7dc746e8a5ac0faa9a'; +const TO_ADDRESS = 'ethm1h3drdgazq4m4gtnxtl6kkuq3cxczrmnq6u24eq'; test('Send tokens', async () => { await sendTokens(SENDER_PRIVATE_KEY, SENDER_ADDRESS, TO_ADDRESS) }); -test('Send vote', async () => { - const voteParams = { - proposalId: 1, - option: 1 - } +describe('Gov module', () => { + test('Send deposit', async () => { + const depositParams = { + proposalId: 1, + amount: '10', + denom: 'aphoton', + } - await sendVote(SENDER_PRIVATE_KEY, SENDER_ADDRESS, voteParams) + await sendDeposit(SENDER_PRIVATE_KEY, SENDER_ADDRESS, depositParams) + }) + + test('Send vote', async () => { + const voteParams = { + proposalId: 1, + option: 1 + } + + await sendVote(SENDER_PRIVATE_KEY, SENDER_ADDRESS, voteParams) + }) +}) + +xdescribe('Bond module', () => { + test('Create bond', async () => { + const bondParams = { + amount: '100', + denom: 'aphoton', + } + + await createBond(SENDER_PRIVATE_KEY, SENDER_ADDRESS, bondParams) + }) }) diff --git a/src/index.ts b/src/index.ts index 62e1999..055fa3e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,9 +7,13 @@ import { signatureToWeb3Extension, createTxMsgVote, Chain, - Sender + Sender, + MessageMsgVote } from '@tharsis/transactions' +import { createTxMsgDeposit, MessageMsgDeposit } from "./gov"; +import { createTxMsgCreateBond, MessageMsgCreateBond } from "./bond"; + const ETHERMINT_REST_ENDPOINT = 'http://127.0.0.1:1317' interface TypedMessageDomain { @@ -20,11 +24,6 @@ interface TypedMessageDomain { salt?: ArrayBuffer; } -interface VoteParams { - proposalId: number; - option: number; -} - export const sendTokens = async (senderPrivateKey: string, senderAddress: string, destinationAddress: string) => { let { data: addrData} = await axios.get(`${ETHERMINT_REST_ENDPOINT}${generateEndpointAccount(senderAddress)}`) @@ -60,7 +59,7 @@ export const sendTokens = async (senderPrivateKey: string, senderAddress: string await signAndSendMessage(senderPrivateKey, chain, sender, msg) } -export const sendVote = async (senderPrivateKey: string, senderAddress: string, params: VoteParams) => { +export const sendVote = async (senderPrivateKey: string, senderAddress: string, params: MessageMsgVote) => { let { data: addrData} = await axios.get(`${ETHERMINT_REST_ENDPOINT}${generateEndpointAccount(senderAddress)}`) const chain = { @@ -87,6 +86,60 @@ export const sendVote = async (senderPrivateKey: string, senderAddress: string, await signAndSendMessage(senderPrivateKey, chain, sender, msg) } +export const sendDeposit = async (senderPrivateKey: string, senderAddress: string, params: MessageMsgDeposit) => { + let { data: addrData} = await axios.get(`${ETHERMINT_REST_ENDPOINT}${generateEndpointAccount(senderAddress)}`) + + const chain = { + chainId: 9000, + cosmosChainId: 'ethermint_9000-1', + } + + const sender = { + accountAddress: addrData.account.base_account.address, + sequence: addrData.account.base_account.sequence, + accountNumber: addrData.account.base_account.account_number, + pubkey: addrData.account.base_account.pub_key.key, + } + + const fee = { + amount: '20', + denom: 'aphoton', + gas: '200000', + } + + const memo = '' + + const msg = createTxMsgDeposit(chain, sender, fee, memo, params) + await signAndSendMessage(senderPrivateKey, chain, sender, msg) +} + +export const createBond = async (senderPrivateKey: string, senderAddress: string, params: MessageMsgCreateBond) => { + let { data: addrData} = await axios.get(`${ETHERMINT_REST_ENDPOINT}${generateEndpointAccount(senderAddress)}`) + + const chain = { + chainId: 9000, + cosmosChainId: 'ethermint_9000-1', + } + + const sender = { + accountAddress: addrData.account.base_account.address, + sequence: addrData.account.base_account.sequence, + accountNumber: addrData.account.base_account.account_number, + pubkey: addrData.account.base_account.pub_key.key, + } + + const fee = { + amount: '20', + denom: 'aphoton', + gas: '200000', + } + + const memo = '' + + const msg = createTxMsgCreateBond(chain, sender, fee, memo, params) + await signAndSendMessage(senderPrivateKey, chain, sender, msg) +} + const signAndSendMessage = async (senderPrivateKey: string, chain: Chain, sender: Sender, msg: any) => { const eipMessageDomain: any = msg.eipToSign.domain; diff --git a/src/proto/cosmos/base/query/v1beta1/pagination.ts b/src/proto/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000..83e69d8 --- /dev/null +++ b/src/proto/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,257 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: cosmos/base/query/v1beta1/pagination.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as pb_1 from "google-protobuf"; +export namespace cosmos.base.query.v1beta1 { + export class PageRequest extends pb_1.Message { + constructor(data?: any[] | { + key?: Uint8Array; + offset?: number; + limit?: number; + count_total?: boolean; + reverse?: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("key" in data && data.key != undefined) { + this.key = data.key; + } + if ("offset" in data && data.offset != undefined) { + this.offset = data.offset; + } + if ("limit" in data && data.limit != undefined) { + this.limit = data.limit; + } + if ("count_total" in data && data.count_total != undefined) { + this.count_total = data.count_total; + } + if ("reverse" in data && data.reverse != undefined) { + this.reverse = data.reverse; + } + } + } + get key() { + return pb_1.Message.getField(this, 1) as Uint8Array; + } + set key(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + get offset() { + return pb_1.Message.getField(this, 2) as number; + } + set offset(value: number) { + pb_1.Message.setField(this, 2, value); + } + get limit() { + return pb_1.Message.getField(this, 3) as number; + } + set limit(value: number) { + pb_1.Message.setField(this, 3, value); + } + get count_total() { + return pb_1.Message.getField(this, 4) as boolean; + } + set count_total(value: boolean) { + pb_1.Message.setField(this, 4, value); + } + get reverse() { + return pb_1.Message.getField(this, 5) as boolean; + } + set reverse(value: boolean) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + key?: Uint8Array; + offset?: number; + limit?: number; + count_total?: boolean; + reverse?: boolean; + }) { + const message = new PageRequest({}); + if (data.key != null) { + message.key = data.key; + } + if (data.offset != null) { + message.offset = data.offset; + } + if (data.limit != null) { + message.limit = data.limit; + } + if (data.count_total != null) { + message.count_total = data.count_total; + } + if (data.reverse != null) { + message.reverse = data.reverse; + } + return message; + } + toObject() { + const data: { + key?: Uint8Array; + offset?: number; + limit?: number; + count_total?: boolean; + reverse?: boolean; + } = {}; + if (this.key != null) { + data.key = this.key; + } + if (this.offset != null) { + data.offset = this.offset; + } + if (this.limit != null) { + data.limit = this.limit; + } + if (this.count_total != null) { + data.count_total = this.count_total; + } + if (this.reverse != null) { + data.reverse = this.reverse; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.key !== undefined) + writer.writeBytes(1, this.key); + if (this.offset !== undefined) + writer.writeUint64(2, this.offset); + if (this.limit !== undefined) + writer.writeUint64(3, this.limit); + if (this.count_total !== undefined) + writer.writeBool(4, this.count_total); + if (this.reverse !== undefined) + writer.writeBool(5, this.reverse); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PageRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PageRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.key = reader.readBytes(); + break; + case 2: + message.offset = reader.readUint64(); + break; + case 3: + message.limit = reader.readUint64(); + break; + case 4: + message.count_total = reader.readBool(); + break; + case 5: + message.reverse = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): PageRequest { + return PageRequest.deserialize(bytes); + } + } + export class PageResponse extends pb_1.Message { + constructor(data?: any[] | { + next_key?: Uint8Array; + total?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("next_key" in data && data.next_key != undefined) { + this.next_key = data.next_key; + } + if ("total" in data && data.total != undefined) { + this.total = data.total; + } + } + } + get next_key() { + return pb_1.Message.getField(this, 1) as Uint8Array; + } + set next_key(value: Uint8Array) { + pb_1.Message.setField(this, 1, value); + } + get total() { + return pb_1.Message.getField(this, 2) as number; + } + set total(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + next_key?: Uint8Array; + total?: number; + }) { + const message = new PageResponse({}); + if (data.next_key != null) { + message.next_key = data.next_key; + } + if (data.total != null) { + message.total = data.total; + } + return message; + } + toObject() { + const data: { + next_key?: Uint8Array; + total?: number; + } = {}; + if (this.next_key != null) { + data.next_key = this.next_key; + } + if (this.total != null) { + data.total = this.total; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.next_key !== undefined) + writer.writeBytes(1, this.next_key); + if (this.total !== undefined) + writer.writeUint64(2, this.total); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PageResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PageResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.next_key = reader.readBytes(); + break; + case 2: + message.total = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): PageResponse { + return PageResponse.deserialize(bytes); + } + } +} diff --git a/src/proto/cosmos/base/v1beta1/coin.ts b/src/proto/cosmos/base/v1beta1/coin.ts new file mode 100644 index 0000000..4807b01 --- /dev/null +++ b/src/proto/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,321 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: cosmos/base/v1beta1/coin.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as pb_1 from "google-protobuf"; +export namespace cosmos.base.v1beta1 { + export class Coin extends pb_1.Message { + constructor(data?: any[] | { + denom?: string; + amount?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("denom" in data && data.denom != undefined) { + this.denom = data.denom; + } + if ("amount" in data && data.amount != undefined) { + this.amount = data.amount; + } + } + } + get denom() { + return pb_1.Message.getField(this, 1) as string; + } + set denom(value: string) { + pb_1.Message.setField(this, 1, value); + } + get amount() { + return pb_1.Message.getField(this, 2) as string; + } + set amount(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + denom?: string; + amount?: string; + }) { + const message = new Coin({}); + if (data.denom != null) { + message.denom = data.denom; + } + if (data.amount != null) { + message.amount = data.amount; + } + return message; + } + toObject() { + const data: { + denom?: string; + amount?: string; + } = {}; + if (this.denom != null) { + data.denom = this.denom; + } + if (this.amount != null) { + data.amount = this.amount; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.denom === "string" && this.denom.length) + writer.writeString(1, this.denom); + if (typeof this.amount === "string" && this.amount.length) + writer.writeString(2, this.amount); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Coin { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Coin(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.denom = reader.readString(); + break; + case 2: + message.amount = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Coin { + return Coin.deserialize(bytes); + } + } + export class DecCoin extends pb_1.Message { + constructor(data?: any[] | { + denom?: string; + amount?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("denom" in data && data.denom != undefined) { + this.denom = data.denom; + } + if ("amount" in data && data.amount != undefined) { + this.amount = data.amount; + } + } + } + get denom() { + return pb_1.Message.getField(this, 1) as string; + } + set denom(value: string) { + pb_1.Message.setField(this, 1, value); + } + get amount() { + return pb_1.Message.getField(this, 2) as string; + } + set amount(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + denom?: string; + amount?: string; + }) { + const message = new DecCoin({}); + if (data.denom != null) { + message.denom = data.denom; + } + if (data.amount != null) { + message.amount = data.amount; + } + return message; + } + toObject() { + const data: { + denom?: string; + amount?: string; + } = {}; + if (this.denom != null) { + data.denom = this.denom; + } + if (this.amount != null) { + data.amount = this.amount; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.denom === "string" && this.denom.length) + writer.writeString(1, this.denom); + if (typeof this.amount === "string" && this.amount.length) + writer.writeString(2, this.amount); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DecCoin { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DecCoin(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.denom = reader.readString(); + break; + case 2: + message.amount = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DecCoin { + return DecCoin.deserialize(bytes); + } + } + export class IntProto extends pb_1.Message { + constructor(data?: any[] | { + int?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("int" in data && data.int != undefined) { + this.int = data.int; + } + } + } + get int() { + return pb_1.Message.getField(this, 1) as string; + } + set int(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + int?: string; + }) { + const message = new IntProto({}); + if (data.int != null) { + message.int = data.int; + } + return message; + } + toObject() { + const data: { + int?: string; + } = {}; + if (this.int != null) { + data.int = this.int; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.int === "string" && this.int.length) + writer.writeString(1, this.int); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IntProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IntProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.int = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): IntProto { + return IntProto.deserialize(bytes); + } + } + export class DecProto extends pb_1.Message { + constructor(data?: any[] | { + dec?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("dec" in data && data.dec != undefined) { + this.dec = data.dec; + } + } + } + get dec() { + return pb_1.Message.getField(this, 1) as string; + } + set dec(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + dec?: string; + }) { + const message = new DecProto({}); + if (data.dec != null) { + message.dec = data.dec; + } + return message; + } + toObject() { + const data: { + dec?: string; + } = {}; + if (this.dec != null) { + data.dec = this.dec; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.dec === "string" && this.dec.length) + writer.writeString(1, this.dec); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DecProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DecProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.dec = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DecProto { + return DecProto.deserialize(bytes); + } + } +} diff --git a/src/proto/gogoproto/gogo.ts b/src/proto/gogoproto/gogo.ts new file mode 100644 index 0000000..9ca76e1 --- /dev/null +++ b/src/proto/gogoproto/gogo.ts @@ -0,0 +1,9 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: gogoproto/gogo.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/descriptor"; +export namespace gogoproto { } diff --git a/src/proto/google/api/annotations.ts b/src/proto/google/api/annotations.ts new file mode 100644 index 0000000..8c702e6 --- /dev/null +++ b/src/proto/google/api/annotations.ts @@ -0,0 +1,10 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: google/api/annotations.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./http"; +import * as dependency_2 from "./../protobuf/descriptor"; +export namespace google.api { } diff --git a/src/proto/google/api/http.ts b/src/proto/google/api/http.ts new file mode 100644 index 0000000..5566d36 --- /dev/null +++ b/src/proto/google/api/http.ts @@ -0,0 +1,511 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: google/api/http.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as pb_1 from "google-protobuf"; +export namespace google.api { + export class Http extends pb_1.Message { + constructor(data?: any[] | { + rules?: HttpRule[]; + fully_decode_reserved_expansion?: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("rules" in data && data.rules != undefined) { + this.rules = data.rules; + } + if ("fully_decode_reserved_expansion" in data && data.fully_decode_reserved_expansion != undefined) { + this.fully_decode_reserved_expansion = data.fully_decode_reserved_expansion; + } + } + } + get rules() { + return pb_1.Message.getRepeatedWrapperField(this, HttpRule, 1) as HttpRule[]; + } + set rules(value: HttpRule[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get fully_decode_reserved_expansion() { + return pb_1.Message.getField(this, 2) as boolean; + } + set fully_decode_reserved_expansion(value: boolean) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + rules?: ReturnType[]; + fully_decode_reserved_expansion?: boolean; + }) { + const message = new Http({}); + if (data.rules != null) { + message.rules = data.rules.map(item => HttpRule.fromObject(item)); + } + if (data.fully_decode_reserved_expansion != null) { + message.fully_decode_reserved_expansion = data.fully_decode_reserved_expansion; + } + return message; + } + toObject() { + const data: { + rules?: ReturnType[]; + fully_decode_reserved_expansion?: boolean; + } = {}; + if (this.rules != null) { + data.rules = this.rules.map((item: HttpRule) => item.toObject()); + } + if (this.fully_decode_reserved_expansion != null) { + data.fully_decode_reserved_expansion = this.fully_decode_reserved_expansion; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.rules !== undefined) + writer.writeRepeatedMessage(1, this.rules, (item: HttpRule) => item.serialize(writer)); + if (this.fully_decode_reserved_expansion !== undefined) + writer.writeBool(2, this.fully_decode_reserved_expansion); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Http { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Http(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.rules, () => pb_1.Message.addToRepeatedWrapperField(message, 1, HttpRule.deserialize(reader), HttpRule)); + break; + case 2: + message.fully_decode_reserved_expansion = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Http { + return Http.deserialize(bytes); + } + } + export class HttpRule extends pb_1.Message { + constructor(data?: any[] | ({ + selector?: string; + body?: string; + response_body?: string; + additional_bindings?: HttpRule[]; + } & (({ + get?: string; + put?: never; + post?: never; + delete?: never; + patch?: never; + custom?: never; + } | { + get?: never; + put?: string; + post?: never; + delete?: never; + patch?: never; + custom?: never; + } | { + get?: never; + put?: never; + post?: string; + delete?: never; + patch?: never; + custom?: never; + } | { + get?: never; + put?: never; + post?: never; + delete?: string; + patch?: never; + custom?: never; + } | { + get?: never; + put?: never; + post?: never; + delete?: never; + patch?: string; + custom?: never; + } | { + get?: never; + put?: never; + post?: never; + delete?: never; + patch?: never; + custom?: CustomHttpPattern; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], [[2, 3, 4, 5, 6, 8]]); + if (!Array.isArray(data) && typeof data == "object") { + if ("selector" in data && data.selector != undefined) { + this.selector = data.selector; + } + if ("get" in data && data.get != undefined) { + this.get = data.get; + } + if ("put" in data && data.put != undefined) { + this.put = data.put; + } + if ("post" in data && data.post != undefined) { + this.post = data.post; + } + if ("delete" in data && data.delete != undefined) { + this.delete = data.delete; + } + if ("patch" in data && data.patch != undefined) { + this.patch = data.patch; + } + if ("custom" in data && data.custom != undefined) { + this.custom = data.custom; + } + if ("body" in data && data.body != undefined) { + this.body = data.body; + } + if ("response_body" in data && data.response_body != undefined) { + this.response_body = data.response_body; + } + if ("additional_bindings" in data && data.additional_bindings != undefined) { + this.additional_bindings = data.additional_bindings; + } + } + } + get selector() { + return pb_1.Message.getField(this, 1) as string; + } + set selector(value: string) { + pb_1.Message.setField(this, 1, value); + } + get get() { + return pb_1.Message.getField(this, 2) as string; + } + set get(value: string) { + pb_1.Message.setOneofField(this, 2, [2, 3, 4, 5, 6, 8], value); + } + get put() { + return pb_1.Message.getField(this, 3) as string; + } + set put(value: string) { + pb_1.Message.setOneofField(this, 3, [2, 3, 4, 5, 6, 8], value); + } + get post() { + return pb_1.Message.getField(this, 4) as string; + } + set post(value: string) { + pb_1.Message.setOneofField(this, 4, [2, 3, 4, 5, 6, 8], value); + } + get delete() { + return pb_1.Message.getField(this, 5) as string; + } + set delete(value: string) { + pb_1.Message.setOneofField(this, 5, [2, 3, 4, 5, 6, 8], value); + } + get patch() { + return pb_1.Message.getField(this, 6) as string; + } + set patch(value: string) { + pb_1.Message.setOneofField(this, 6, [2, 3, 4, 5, 6, 8], value); + } + get custom() { + return pb_1.Message.getWrapperField(this, CustomHttpPattern, 8) as CustomHttpPattern; + } + set custom(value: CustomHttpPattern) { + pb_1.Message.setOneofWrapperField(this, 8, [2, 3, 4, 5, 6, 8], value); + } + get body() { + return pb_1.Message.getField(this, 7) as string; + } + set body(value: string) { + pb_1.Message.setField(this, 7, value); + } + get response_body() { + return pb_1.Message.getField(this, 12) as string; + } + set response_body(value: string) { + pb_1.Message.setField(this, 12, value); + } + get additional_bindings() { + return pb_1.Message.getRepeatedWrapperField(this, HttpRule, 11) as HttpRule[]; + } + set additional_bindings(value: HttpRule[]) { + pb_1.Message.setRepeatedWrapperField(this, 11, value); + } + get pattern() { + const cases: { + [index: number]: "none" | "get" | "put" | "post" | "delete" | "patch" | "custom"; + } = { + 0: "none", + 2: "get", + 3: "put", + 4: "post", + 5: "delete", + 6: "patch", + 8: "custom" + }; + return cases[pb_1.Message.computeOneofCase(this, [2, 3, 4, 5, 6, 8])]; + } + static fromObject(data: { + selector?: string; + get?: string; + put?: string; + post?: string; + delete?: string; + patch?: string; + custom?: ReturnType; + body?: string; + response_body?: string; + additional_bindings?: ReturnType[]; + }) { + const message = new HttpRule({}); + if (data.selector != null) { + message.selector = data.selector; + } + if (data.get != null) { + message.get = data.get; + } + if (data.put != null) { + message.put = data.put; + } + if (data.post != null) { + message.post = data.post; + } + if (data.delete != null) { + message.delete = data.delete; + } + if (data.patch != null) { + message.patch = data.patch; + } + if (data.custom != null) { + message.custom = CustomHttpPattern.fromObject(data.custom); + } + if (data.body != null) { + message.body = data.body; + } + if (data.response_body != null) { + message.response_body = data.response_body; + } + if (data.additional_bindings != null) { + message.additional_bindings = data.additional_bindings.map(item => HttpRule.fromObject(item)); + } + return message; + } + toObject() { + const data: { + selector?: string; + get?: string; + put?: string; + post?: string; + delete?: string; + patch?: string; + custom?: ReturnType; + body?: string; + response_body?: string; + additional_bindings?: ReturnType[]; + } = {}; + if (this.selector != null) { + data.selector = this.selector; + } + if (this.get != null) { + data.get = this.get; + } + if (this.put != null) { + data.put = this.put; + } + if (this.post != null) { + data.post = this.post; + } + if (this.delete != null) { + data.delete = this.delete; + } + if (this.patch != null) { + data.patch = this.patch; + } + if (this.custom != null) { + data.custom = this.custom.toObject(); + } + if (this.body != null) { + data.body = this.body; + } + if (this.response_body != null) { + data.response_body = this.response_body; + } + if (this.additional_bindings != null) { + data.additional_bindings = this.additional_bindings.map((item: HttpRule) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.selector === "string" && this.selector.length) + writer.writeString(1, this.selector); + if (typeof this.get === "string" && this.get.length) + writer.writeString(2, this.get); + if (typeof this.put === "string" && this.put.length) + writer.writeString(3, this.put); + if (typeof this.post === "string" && this.post.length) + writer.writeString(4, this.post); + if (typeof this.delete === "string" && this.delete.length) + writer.writeString(5, this.delete); + if (typeof this.patch === "string" && this.patch.length) + writer.writeString(6, this.patch); + if (this.custom !== undefined) + writer.writeMessage(8, this.custom, () => this.custom.serialize(writer)); + if (typeof this.body === "string" && this.body.length) + writer.writeString(7, this.body); + if (typeof this.response_body === "string" && this.response_body.length) + writer.writeString(12, this.response_body); + if (this.additional_bindings !== undefined) + writer.writeRepeatedMessage(11, this.additional_bindings, (item: HttpRule) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): HttpRule { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new HttpRule(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.selector = reader.readString(); + break; + case 2: + message.get = reader.readString(); + break; + case 3: + message.put = reader.readString(); + break; + case 4: + message.post = reader.readString(); + break; + case 5: + message.delete = reader.readString(); + break; + case 6: + message.patch = reader.readString(); + break; + case 8: + reader.readMessage(message.custom, () => message.custom = CustomHttpPattern.deserialize(reader)); + break; + case 7: + message.body = reader.readString(); + break; + case 12: + message.response_body = reader.readString(); + break; + case 11: + reader.readMessage(message.additional_bindings, () => pb_1.Message.addToRepeatedWrapperField(message, 11, HttpRule.deserialize(reader), HttpRule)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): HttpRule { + return HttpRule.deserialize(bytes); + } + } + export class CustomHttpPattern extends pb_1.Message { + constructor(data?: any[] | { + kind?: string; + path?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("kind" in data && data.kind != undefined) { + this.kind = data.kind; + } + if ("path" in data && data.path != undefined) { + this.path = data.path; + } + } + } + get kind() { + return pb_1.Message.getField(this, 1) as string; + } + set kind(value: string) { + pb_1.Message.setField(this, 1, value); + } + get path() { + return pb_1.Message.getField(this, 2) as string; + } + set path(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + kind?: string; + path?: string; + }) { + const message = new CustomHttpPattern({}); + if (data.kind != null) { + message.kind = data.kind; + } + if (data.path != null) { + message.path = data.path; + } + return message; + } + toObject() { + const data: { + kind?: string; + path?: string; + } = {}; + if (this.kind != null) { + data.kind = this.kind; + } + if (this.path != null) { + data.path = this.path; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.kind === "string" && this.kind.length) + writer.writeString(1, this.kind); + if (typeof this.path === "string" && this.path.length) + writer.writeString(2, this.path); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CustomHttpPattern { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CustomHttpPattern(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.kind = reader.readString(); + break; + case 2: + message.path = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CustomHttpPattern { + return CustomHttpPattern.deserialize(bytes); + } + } +} diff --git a/src/proto/google/protobuf/descriptor.ts b/src/proto/google/protobuf/descriptor.ts new file mode 100644 index 0000000..e2bd862 --- /dev/null +++ b/src/proto/google/protobuf/descriptor.ts @@ -0,0 +1,3924 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: google/protobuf/descriptor.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as pb_1 from "google-protobuf"; +export namespace google.protobuf { + export class FileDescriptorSet extends pb_1.Message { + constructor(data?: any[] | { + file: FileDescriptorProto[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + this.file = data.file; + } + } + get file() { + return pb_1.Message.getRepeatedWrapperField(this, FileDescriptorProto, 1) as FileDescriptorProto[]; + } + set file(value: FileDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + static fromObject(data: { + file: ReturnType[]; + }) { + const message = new FileDescriptorSet({ + file: data.file.map(item => FileDescriptorProto.fromObject(item)) + }); + return message; + } + toObject() { + const data: { + file: ReturnType[]; + } = { + file: this.file.map((item: FileDescriptorProto) => item.toObject()) + }; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.file !== undefined) + writer.writeRepeatedMessage(1, this.file, (item: FileDescriptorProto) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FileDescriptorSet { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FileDescriptorSet(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.file, () => pb_1.Message.addToRepeatedWrapperField(message, 1, FileDescriptorProto.deserialize(reader), FileDescriptorProto)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): FileDescriptorSet { + return FileDescriptorSet.deserialize(bytes); + } + } + export class FileDescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + package?: string; + dependency: string[]; + public_dependency: number[]; + weak_dependency: number[]; + message_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + source_code_info?: SourceCodeInfo; + syntax?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 10, 11, 4, 5, 6, 7], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("package" in data && data.package != undefined) { + this.package = data.package; + } + this.dependency = data.dependency; + this.public_dependency = data.public_dependency; + this.weak_dependency = data.weak_dependency; + this.message_type = data.message_type; + this.enum_type = data.enum_type; + this.service = data.service; + this.extension = data.extension; + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + if ("source_code_info" in data && data.source_code_info != undefined) { + this.source_code_info = data.source_code_info; + } + if ("syntax" in data && data.syntax != undefined) { + this.syntax = data.syntax; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get package() { + return pb_1.Message.getField(this, 2) as string; + } + set package(value: string) { + pb_1.Message.setField(this, 2, value); + } + get dependency() { + return pb_1.Message.getField(this, 3) as string[]; + } + set dependency(value: string[]) { + pb_1.Message.setField(this, 3, value); + } + get public_dependency() { + return pb_1.Message.getField(this, 10) as number[]; + } + set public_dependency(value: number[]) { + pb_1.Message.setField(this, 10, value); + } + get weak_dependency() { + return pb_1.Message.getField(this, 11) as number[]; + } + set weak_dependency(value: number[]) { + pb_1.Message.setField(this, 11, value); + } + get message_type() { + return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto, 4) as DescriptorProto[]; + } + set message_type(value: DescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get enum_type() { + return pb_1.Message.getRepeatedWrapperField(this, EnumDescriptorProto, 5) as EnumDescriptorProto[]; + } + set enum_type(value: EnumDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 5, value); + } + get service() { + return pb_1.Message.getRepeatedWrapperField(this, ServiceDescriptorProto, 6) as ServiceDescriptorProto[]; + } + set service(value: ServiceDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 6, value); + } + get extension() { + return pb_1.Message.getRepeatedWrapperField(this, FieldDescriptorProto, 7) as FieldDescriptorProto[]; + } + set extension(value: FieldDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 7, value); + } + get options() { + return pb_1.Message.getWrapperField(this, FileOptions, 8) as FileOptions; + } + set options(value: FileOptions) { + pb_1.Message.setWrapperField(this, 8, value); + } + get source_code_info() { + return pb_1.Message.getWrapperField(this, SourceCodeInfo, 9) as SourceCodeInfo; + } + set source_code_info(value: SourceCodeInfo) { + pb_1.Message.setWrapperField(this, 9, value); + } + get syntax() { + return pb_1.Message.getField(this, 12) as string; + } + set syntax(value: string) { + pb_1.Message.setField(this, 12, value); + } + static fromObject(data: { + name?: string; + package?: string; + dependency: string[]; + public_dependency: number[]; + weak_dependency: number[]; + message_type: ReturnType[]; + enum_type: ReturnType[]; + service: ReturnType[]; + extension: ReturnType[]; + options?: ReturnType; + source_code_info?: ReturnType; + syntax?: string; + }) { + const message = new FileDescriptorProto({ + dependency: data.dependency, + public_dependency: data.public_dependency, + weak_dependency: data.weak_dependency, + message_type: data.message_type.map(item => DescriptorProto.fromObject(item)), + enum_type: data.enum_type.map(item => EnumDescriptorProto.fromObject(item)), + service: data.service.map(item => ServiceDescriptorProto.fromObject(item)), + extension: data.extension.map(item => FieldDescriptorProto.fromObject(item)) + }); + if (data.name != null) { + message.name = data.name; + } + if (data.package != null) { + message.package = data.package; + } + if (data.options != null) { + message.options = FileOptions.fromObject(data.options); + } + if (data.source_code_info != null) { + message.source_code_info = SourceCodeInfo.fromObject(data.source_code_info); + } + if (data.syntax != null) { + message.syntax = data.syntax; + } + return message; + } + toObject() { + const data: { + name?: string; + package?: string; + dependency: string[]; + public_dependency: number[]; + weak_dependency: number[]; + message_type: ReturnType[]; + enum_type: ReturnType[]; + service: ReturnType[]; + extension: ReturnType[]; + options?: ReturnType; + source_code_info?: ReturnType; + syntax?: string; + } = { + dependency: this.dependency, + public_dependency: this.public_dependency, + weak_dependency: this.weak_dependency, + message_type: this.message_type.map((item: DescriptorProto) => item.toObject()), + enum_type: this.enum_type.map((item: EnumDescriptorProto) => item.toObject()), + service: this.service.map((item: ServiceDescriptorProto) => item.toObject()), + extension: this.extension.map((item: FieldDescriptorProto) => item.toObject()) + }; + if (this.name != null) { + data.name = this.name; + } + if (this.package != null) { + data.package = this.package; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + if (this.source_code_info != null) { + data.source_code_info = this.source_code_info.toObject(); + } + if (this.syntax != null) { + data.syntax = this.syntax; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (typeof this.package === "string" && this.package.length) + writer.writeString(2, this.package); + if (this.dependency !== undefined) + writer.writeRepeatedString(3, this.dependency); + if (this.public_dependency !== undefined) + writer.writeRepeatedInt32(10, this.public_dependency); + if (this.weak_dependency !== undefined) + writer.writeRepeatedInt32(11, this.weak_dependency); + if (this.message_type !== undefined) + writer.writeRepeatedMessage(4, this.message_type, (item: DescriptorProto) => item.serialize(writer)); + if (this.enum_type !== undefined) + writer.writeRepeatedMessage(5, this.enum_type, (item: EnumDescriptorProto) => item.serialize(writer)); + if (this.service !== undefined) + writer.writeRepeatedMessage(6, this.service, (item: ServiceDescriptorProto) => item.serialize(writer)); + if (this.extension !== undefined) + writer.writeRepeatedMessage(7, this.extension, (item: FieldDescriptorProto) => item.serialize(writer)); + if (this.options !== undefined) + writer.writeMessage(8, this.options, () => this.options.serialize(writer)); + if (this.source_code_info !== undefined) + writer.writeMessage(9, this.source_code_info, () => this.source_code_info.serialize(writer)); + if (typeof this.syntax === "string" && this.syntax.length) + writer.writeString(12, this.syntax); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FileDescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FileDescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + message.package = reader.readString(); + break; + case 3: + pb_1.Message.addToRepeatedField(message, 3, reader.readString()); + break; + case 10: + pb_1.Message.addToRepeatedField(message, 10, reader.readInt32()); + break; + case 11: + pb_1.Message.addToRepeatedField(message, 11, reader.readInt32()); + break; + case 4: + reader.readMessage(message.message_type, () => pb_1.Message.addToRepeatedWrapperField(message, 4, DescriptorProto.deserialize(reader), DescriptorProto)); + break; + case 5: + reader.readMessage(message.enum_type, () => pb_1.Message.addToRepeatedWrapperField(message, 5, EnumDescriptorProto.deserialize(reader), EnumDescriptorProto)); + break; + case 6: + reader.readMessage(message.service, () => pb_1.Message.addToRepeatedWrapperField(message, 6, ServiceDescriptorProto.deserialize(reader), ServiceDescriptorProto)); + break; + case 7: + reader.readMessage(message.extension, () => pb_1.Message.addToRepeatedWrapperField(message, 7, FieldDescriptorProto.deserialize(reader), FieldDescriptorProto)); + break; + case 8: + reader.readMessage(message.options, () => message.options = FileOptions.deserialize(reader)); + break; + case 9: + reader.readMessage(message.source_code_info, () => message.source_code_info = SourceCodeInfo.deserialize(reader)); + break; + case 12: + message.syntax = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): FileDescriptorProto { + return FileDescriptorProto.deserialize(bytes); + } + } + export class DescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nested_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + extension_range: DescriptorProto.ExtensionRange[]; + oneof_decl: OneofDescriptorProto[]; + options?: MessageOptions; + reserved_range: DescriptorProto.ReservedRange[]; + reserved_name: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 6, 3, 4, 5, 8, 9, 10], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + this.field = data.field; + this.extension = data.extension; + this.nested_type = data.nested_type; + this.enum_type = data.enum_type; + this.extension_range = data.extension_range; + this.oneof_decl = data.oneof_decl; + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + this.reserved_range = data.reserved_range; + this.reserved_name = data.reserved_name; + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get field() { + return pb_1.Message.getRepeatedWrapperField(this, FieldDescriptorProto, 2) as FieldDescriptorProto[]; + } + set field(value: FieldDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get extension() { + return pb_1.Message.getRepeatedWrapperField(this, FieldDescriptorProto, 6) as FieldDescriptorProto[]; + } + set extension(value: FieldDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 6, value); + } + get nested_type() { + return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto, 3) as DescriptorProto[]; + } + set nested_type(value: DescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + get enum_type() { + return pb_1.Message.getRepeatedWrapperField(this, EnumDescriptorProto, 4) as EnumDescriptorProto[]; + } + set enum_type(value: EnumDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get extension_range() { + return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto.ExtensionRange, 5) as DescriptorProto.ExtensionRange[]; + } + set extension_range(value: DescriptorProto.ExtensionRange[]) { + pb_1.Message.setRepeatedWrapperField(this, 5, value); + } + get oneof_decl() { + return pb_1.Message.getRepeatedWrapperField(this, OneofDescriptorProto, 8) as OneofDescriptorProto[]; + } + set oneof_decl(value: OneofDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 8, value); + } + get options() { + return pb_1.Message.getWrapperField(this, MessageOptions, 7) as MessageOptions; + } + set options(value: MessageOptions) { + pb_1.Message.setWrapperField(this, 7, value); + } + get reserved_range() { + return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto.ReservedRange, 9) as DescriptorProto.ReservedRange[]; + } + set reserved_range(value: DescriptorProto.ReservedRange[]) { + pb_1.Message.setRepeatedWrapperField(this, 9, value); + } + get reserved_name() { + return pb_1.Message.getField(this, 10) as string[]; + } + set reserved_name(value: string[]) { + pb_1.Message.setField(this, 10, value); + } + static fromObject(data: { + name?: string; + field: ReturnType[]; + extension: ReturnType[]; + nested_type: ReturnType[]; + enum_type: ReturnType[]; + extension_range: ReturnType[]; + oneof_decl: ReturnType[]; + options?: ReturnType; + reserved_range: ReturnType[]; + reserved_name: string[]; + }) { + const message = new DescriptorProto({ + field: data.field.map(item => FieldDescriptorProto.fromObject(item)), + extension: data.extension.map(item => FieldDescriptorProto.fromObject(item)), + nested_type: data.nested_type.map(item => DescriptorProto.fromObject(item)), + enum_type: data.enum_type.map(item => EnumDescriptorProto.fromObject(item)), + extension_range: data.extension_range.map(item => DescriptorProto.ExtensionRange.fromObject(item)), + oneof_decl: data.oneof_decl.map(item => OneofDescriptorProto.fromObject(item)), + reserved_range: data.reserved_range.map(item => DescriptorProto.ReservedRange.fromObject(item)), + reserved_name: data.reserved_name + }); + if (data.name != null) { + message.name = data.name; + } + if (data.options != null) { + message.options = MessageOptions.fromObject(data.options); + } + return message; + } + toObject() { + const data: { + name?: string; + field: ReturnType[]; + extension: ReturnType[]; + nested_type: ReturnType[]; + enum_type: ReturnType[]; + extension_range: ReturnType[]; + oneof_decl: ReturnType[]; + options?: ReturnType; + reserved_range: ReturnType[]; + reserved_name: string[]; + } = { + field: this.field.map((item: FieldDescriptorProto) => item.toObject()), + extension: this.extension.map((item: FieldDescriptorProto) => item.toObject()), + nested_type: this.nested_type.map((item: DescriptorProto) => item.toObject()), + enum_type: this.enum_type.map((item: EnumDescriptorProto) => item.toObject()), + extension_range: this.extension_range.map((item: DescriptorProto.ExtensionRange) => item.toObject()), + oneof_decl: this.oneof_decl.map((item: OneofDescriptorProto) => item.toObject()), + reserved_range: this.reserved_range.map((item: DescriptorProto.ReservedRange) => item.toObject()), + reserved_name: this.reserved_name + }; + if (this.name != null) { + data.name = this.name; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.field !== undefined) + writer.writeRepeatedMessage(2, this.field, (item: FieldDescriptorProto) => item.serialize(writer)); + if (this.extension !== undefined) + writer.writeRepeatedMessage(6, this.extension, (item: FieldDescriptorProto) => item.serialize(writer)); + if (this.nested_type !== undefined) + writer.writeRepeatedMessage(3, this.nested_type, (item: DescriptorProto) => item.serialize(writer)); + if (this.enum_type !== undefined) + writer.writeRepeatedMessage(4, this.enum_type, (item: EnumDescriptorProto) => item.serialize(writer)); + if (this.extension_range !== undefined) + writer.writeRepeatedMessage(5, this.extension_range, (item: DescriptorProto.ExtensionRange) => item.serialize(writer)); + if (this.oneof_decl !== undefined) + writer.writeRepeatedMessage(8, this.oneof_decl, (item: OneofDescriptorProto) => item.serialize(writer)); + if (this.options !== undefined) + writer.writeMessage(7, this.options, () => this.options.serialize(writer)); + if (this.reserved_range !== undefined) + writer.writeRepeatedMessage(9, this.reserved_range, (item: DescriptorProto.ReservedRange) => item.serialize(writer)); + if (this.reserved_name !== undefined) + writer.writeRepeatedString(10, this.reserved_name); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage(message.field, () => pb_1.Message.addToRepeatedWrapperField(message, 2, FieldDescriptorProto.deserialize(reader), FieldDescriptorProto)); + break; + case 6: + reader.readMessage(message.extension, () => pb_1.Message.addToRepeatedWrapperField(message, 6, FieldDescriptorProto.deserialize(reader), FieldDescriptorProto)); + break; + case 3: + reader.readMessage(message.nested_type, () => pb_1.Message.addToRepeatedWrapperField(message, 3, DescriptorProto.deserialize(reader), DescriptorProto)); + break; + case 4: + reader.readMessage(message.enum_type, () => pb_1.Message.addToRepeatedWrapperField(message, 4, EnumDescriptorProto.deserialize(reader), EnumDescriptorProto)); + break; + case 5: + reader.readMessage(message.extension_range, () => pb_1.Message.addToRepeatedWrapperField(message, 5, DescriptorProto.ExtensionRange.deserialize(reader), DescriptorProto.ExtensionRange)); + break; + case 8: + reader.readMessage(message.oneof_decl, () => pb_1.Message.addToRepeatedWrapperField(message, 8, OneofDescriptorProto.deserialize(reader), OneofDescriptorProto)); + break; + case 7: + reader.readMessage(message.options, () => message.options = MessageOptions.deserialize(reader)); + break; + case 9: + reader.readMessage(message.reserved_range, () => pb_1.Message.addToRepeatedWrapperField(message, 9, DescriptorProto.ReservedRange.deserialize(reader), DescriptorProto.ReservedRange)); + break; + case 10: + pb_1.Message.addToRepeatedField(message, 10, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DescriptorProto { + return DescriptorProto.deserialize(bytes); + } + } + export namespace DescriptorProto { + export class ExtensionRange extends pb_1.Message { + constructor(data?: any[] | { + start?: number; + end?: number; + options?: ExtensionRangeOptions; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("start" in data && data.start != undefined) { + this.start = data.start; + } + if ("end" in data && data.end != undefined) { + this.end = data.end; + } + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + } + } + get start() { + return pb_1.Message.getField(this, 1) as number; + } + set start(value: number) { + pb_1.Message.setField(this, 1, value); + } + get end() { + return pb_1.Message.getField(this, 2) as number; + } + set end(value: number) { + pb_1.Message.setField(this, 2, value); + } + get options() { + return pb_1.Message.getWrapperField(this, ExtensionRangeOptions, 3) as ExtensionRangeOptions; + } + set options(value: ExtensionRangeOptions) { + pb_1.Message.setWrapperField(this, 3, value); + } + static fromObject(data: { + start?: number; + end?: number; + options?: ReturnType; + }) { + const message = new ExtensionRange({}); + if (data.start != null) { + message.start = data.start; + } + if (data.end != null) { + message.end = data.end; + } + if (data.options != null) { + message.options = ExtensionRangeOptions.fromObject(data.options); + } + return message; + } + toObject() { + const data: { + start?: number; + end?: number; + options?: ReturnType; + } = {}; + if (this.start != null) { + data.start = this.start; + } + if (this.end != null) { + data.end = this.end; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.start !== undefined) + writer.writeInt32(1, this.start); + if (this.end !== undefined) + writer.writeInt32(2, this.end); + if (this.options !== undefined) + writer.writeMessage(3, this.options, () => this.options.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExtensionRange { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ExtensionRange(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.start = reader.readInt32(); + break; + case 2: + message.end = reader.readInt32(); + break; + case 3: + reader.readMessage(message.options, () => message.options = ExtensionRangeOptions.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ExtensionRange { + return ExtensionRange.deserialize(bytes); + } + } + export class ReservedRange extends pb_1.Message { + constructor(data?: any[] | { + start?: number; + end?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("start" in data && data.start != undefined) { + this.start = data.start; + } + if ("end" in data && data.end != undefined) { + this.end = data.end; + } + } + } + get start() { + return pb_1.Message.getField(this, 1) as number; + } + set start(value: number) { + pb_1.Message.setField(this, 1, value); + } + get end() { + return pb_1.Message.getField(this, 2) as number; + } + set end(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + start?: number; + end?: number; + }) { + const message = new ReservedRange({}); + if (data.start != null) { + message.start = data.start; + } + if (data.end != null) { + message.end = data.end; + } + return message; + } + toObject() { + const data: { + start?: number; + end?: number; + } = {}; + if (this.start != null) { + data.start = this.start; + } + if (this.end != null) { + data.end = this.end; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.start !== undefined) + writer.writeInt32(1, this.start); + if (this.end !== undefined) + writer.writeInt32(2, this.end); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ReservedRange { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ReservedRange(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.start = reader.readInt32(); + break; + case 2: + message.end = reader.readInt32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ReservedRange { + return ReservedRange.deserialize(bytes); + } + } + } + export class ExtensionRangeOptions extends pb_1.Message { + constructor(data?: any[] | { + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + this.uninterpreted_option = data.uninterpreted_option; + } + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + uninterpreted_option: ReturnType[]; + }) { + const message = new ExtensionRangeOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + return message; + } + toObject() { + const data: { + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExtensionRangeOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ExtensionRangeOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ExtensionRangeOptions { + return ExtensionRangeOptions.deserialize(bytes); + } + } + export class FieldDescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + number?: number; + label?: FieldDescriptorProto.Label; + type?: FieldDescriptorProto.Type; + type_name?: string; + extendee?: string; + default_value?: string; + oneof_index?: number; + json_name?: string; + options?: FieldOptions; + proto3_optional?: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("number" in data && data.number != undefined) { + this.number = data.number; + } + if ("label" in data && data.label != undefined) { + this.label = data.label; + } + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("type_name" in data && data.type_name != undefined) { + this.type_name = data.type_name; + } + if ("extendee" in data && data.extendee != undefined) { + this.extendee = data.extendee; + } + if ("default_value" in data && data.default_value != undefined) { + this.default_value = data.default_value; + } + if ("oneof_index" in data && data.oneof_index != undefined) { + this.oneof_index = data.oneof_index; + } + if ("json_name" in data && data.json_name != undefined) { + this.json_name = data.json_name; + } + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + if ("proto3_optional" in data && data.proto3_optional != undefined) { + this.proto3_optional = data.proto3_optional; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get number() { + return pb_1.Message.getField(this, 3) as number; + } + set number(value: number) { + pb_1.Message.setField(this, 3, value); + } + get label() { + return pb_1.Message.getField(this, 4) as FieldDescriptorProto.Label; + } + set label(value: FieldDescriptorProto.Label) { + pb_1.Message.setField(this, 4, value); + } + get type() { + return pb_1.Message.getField(this, 5) as FieldDescriptorProto.Type; + } + set type(value: FieldDescriptorProto.Type) { + pb_1.Message.setField(this, 5, value); + } + get type_name() { + return pb_1.Message.getField(this, 6) as string; + } + set type_name(value: string) { + pb_1.Message.setField(this, 6, value); + } + get extendee() { + return pb_1.Message.getField(this, 2) as string; + } + set extendee(value: string) { + pb_1.Message.setField(this, 2, value); + } + get default_value() { + return pb_1.Message.getField(this, 7) as string; + } + set default_value(value: string) { + pb_1.Message.setField(this, 7, value); + } + get oneof_index() { + return pb_1.Message.getField(this, 9) as number; + } + set oneof_index(value: number) { + pb_1.Message.setField(this, 9, value); + } + get json_name() { + return pb_1.Message.getField(this, 10) as string; + } + set json_name(value: string) { + pb_1.Message.setField(this, 10, value); + } + get options() { + return pb_1.Message.getWrapperField(this, FieldOptions, 8) as FieldOptions; + } + set options(value: FieldOptions) { + pb_1.Message.setWrapperField(this, 8, value); + } + get proto3_optional() { + return pb_1.Message.getField(this, 17) as boolean; + } + set proto3_optional(value: boolean) { + pb_1.Message.setField(this, 17, value); + } + static fromObject(data: { + name?: string; + number?: number; + label?: FieldDescriptorProto.Label; + type?: FieldDescriptorProto.Type; + type_name?: string; + extendee?: string; + default_value?: string; + oneof_index?: number; + json_name?: string; + options?: ReturnType; + proto3_optional?: boolean; + }) { + const message = new FieldDescriptorProto({}); + if (data.name != null) { + message.name = data.name; + } + if (data.number != null) { + message.number = data.number; + } + if (data.label != null) { + message.label = data.label; + } + if (data.type != null) { + message.type = data.type; + } + if (data.type_name != null) { + message.type_name = data.type_name; + } + if (data.extendee != null) { + message.extendee = data.extendee; + } + if (data.default_value != null) { + message.default_value = data.default_value; + } + if (data.oneof_index != null) { + message.oneof_index = data.oneof_index; + } + if (data.json_name != null) { + message.json_name = data.json_name; + } + if (data.options != null) { + message.options = FieldOptions.fromObject(data.options); + } + if (data.proto3_optional != null) { + message.proto3_optional = data.proto3_optional; + } + return message; + } + toObject() { + const data: { + name?: string; + number?: number; + label?: FieldDescriptorProto.Label; + type?: FieldDescriptorProto.Type; + type_name?: string; + extendee?: string; + default_value?: string; + oneof_index?: number; + json_name?: string; + options?: ReturnType; + proto3_optional?: boolean; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.number != null) { + data.number = this.number; + } + if (this.label != null) { + data.label = this.label; + } + if (this.type != null) { + data.type = this.type; + } + if (this.type_name != null) { + data.type_name = this.type_name; + } + if (this.extendee != null) { + data.extendee = this.extendee; + } + if (this.default_value != null) { + data.default_value = this.default_value; + } + if (this.oneof_index != null) { + data.oneof_index = this.oneof_index; + } + if (this.json_name != null) { + data.json_name = this.json_name; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + if (this.proto3_optional != null) { + data.proto3_optional = this.proto3_optional; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.number !== undefined) + writer.writeInt32(3, this.number); + if (this.label !== undefined) + writer.writeEnum(4, this.label); + if (this.type !== undefined) + writer.writeEnum(5, this.type); + if (typeof this.type_name === "string" && this.type_name.length) + writer.writeString(6, this.type_name); + if (typeof this.extendee === "string" && this.extendee.length) + writer.writeString(2, this.extendee); + if (typeof this.default_value === "string" && this.default_value.length) + writer.writeString(7, this.default_value); + if (this.oneof_index !== undefined) + writer.writeInt32(9, this.oneof_index); + if (typeof this.json_name === "string" && this.json_name.length) + writer.writeString(10, this.json_name); + if (this.options !== undefined) + writer.writeMessage(8, this.options, () => this.options.serialize(writer)); + if (this.proto3_optional !== undefined) + writer.writeBool(17, this.proto3_optional); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FieldDescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FieldDescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 3: + message.number = reader.readInt32(); + break; + case 4: + message.label = reader.readEnum(); + break; + case 5: + message.type = reader.readEnum(); + break; + case 6: + message.type_name = reader.readString(); + break; + case 2: + message.extendee = reader.readString(); + break; + case 7: + message.default_value = reader.readString(); + break; + case 9: + message.oneof_index = reader.readInt32(); + break; + case 10: + message.json_name = reader.readString(); + break; + case 8: + reader.readMessage(message.options, () => message.options = FieldOptions.deserialize(reader)); + break; + case 17: + message.proto3_optional = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): FieldDescriptorProto { + return FieldDescriptorProto.deserialize(bytes); + } + } + export namespace FieldDescriptorProto { + export enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + export enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + export class OneofDescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + options?: OneofOptions; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get options() { + return pb_1.Message.getWrapperField(this, OneofOptions, 2) as OneofOptions; + } + set options(value: OneofOptions) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + name?: string; + options?: ReturnType; + }) { + const message = new OneofDescriptorProto({}); + if (data.name != null) { + message.name = data.name; + } + if (data.options != null) { + message.options = OneofOptions.fromObject(data.options); + } + return message; + } + toObject() { + const data: { + name?: string; + options?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.options !== undefined) + writer.writeMessage(2, this.options, () => this.options.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OneofDescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new OneofDescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage(message.options, () => message.options = OneofOptions.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): OneofDescriptorProto { + return OneofDescriptorProto.deserialize(bytes); + } + } + export class EnumDescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + reserved_range: EnumDescriptorProto.EnumReservedRange[]; + reserved_name: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 4, 5], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + this.value = data.value; + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + this.reserved_range = data.reserved_range; + this.reserved_name = data.reserved_name; + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get value() { + return pb_1.Message.getRepeatedWrapperField(this, EnumValueDescriptorProto, 2) as EnumValueDescriptorProto[]; + } + set value(value: EnumValueDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get options() { + return pb_1.Message.getWrapperField(this, EnumOptions, 3) as EnumOptions; + } + set options(value: EnumOptions) { + pb_1.Message.setWrapperField(this, 3, value); + } + get reserved_range() { + return pb_1.Message.getRepeatedWrapperField(this, EnumDescriptorProto.EnumReservedRange, 4) as EnumDescriptorProto.EnumReservedRange[]; + } + set reserved_range(value: EnumDescriptorProto.EnumReservedRange[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get reserved_name() { + return pb_1.Message.getField(this, 5) as string[]; + } + set reserved_name(value: string[]) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + name?: string; + value: ReturnType[]; + options?: ReturnType; + reserved_range: ReturnType[]; + reserved_name: string[]; + }) { + const message = new EnumDescriptorProto({ + value: data.value.map(item => EnumValueDescriptorProto.fromObject(item)), + reserved_range: data.reserved_range.map(item => EnumDescriptorProto.EnumReservedRange.fromObject(item)), + reserved_name: data.reserved_name + }); + if (data.name != null) { + message.name = data.name; + } + if (data.options != null) { + message.options = EnumOptions.fromObject(data.options); + } + return message; + } + toObject() { + const data: { + name?: string; + value: ReturnType[]; + options?: ReturnType; + reserved_range: ReturnType[]; + reserved_name: string[]; + } = { + value: this.value.map((item: EnumValueDescriptorProto) => item.toObject()), + reserved_range: this.reserved_range.map((item: EnumDescriptorProto.EnumReservedRange) => item.toObject()), + reserved_name: this.reserved_name + }; + if (this.name != null) { + data.name = this.name; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.value !== undefined) + writer.writeRepeatedMessage(2, this.value, (item: EnumValueDescriptorProto) => item.serialize(writer)); + if (this.options !== undefined) + writer.writeMessage(3, this.options, () => this.options.serialize(writer)); + if (this.reserved_range !== undefined) + writer.writeRepeatedMessage(4, this.reserved_range, (item: EnumDescriptorProto.EnumReservedRange) => item.serialize(writer)); + if (this.reserved_name !== undefined) + writer.writeRepeatedString(5, this.reserved_name); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumDescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumDescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage(message.value, () => pb_1.Message.addToRepeatedWrapperField(message, 2, EnumValueDescriptorProto.deserialize(reader), EnumValueDescriptorProto)); + break; + case 3: + reader.readMessage(message.options, () => message.options = EnumOptions.deserialize(reader)); + break; + case 4: + reader.readMessage(message.reserved_range, () => pb_1.Message.addToRepeatedWrapperField(message, 4, EnumDescriptorProto.EnumReservedRange.deserialize(reader), EnumDescriptorProto.EnumReservedRange)); + break; + case 5: + pb_1.Message.addToRepeatedField(message, 5, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EnumDescriptorProto { + return EnumDescriptorProto.deserialize(bytes); + } + } + export namespace EnumDescriptorProto { + export class EnumReservedRange extends pb_1.Message { + constructor(data?: any[] | { + start?: number; + end?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("start" in data && data.start != undefined) { + this.start = data.start; + } + if ("end" in data && data.end != undefined) { + this.end = data.end; + } + } + } + get start() { + return pb_1.Message.getField(this, 1) as number; + } + set start(value: number) { + pb_1.Message.setField(this, 1, value); + } + get end() { + return pb_1.Message.getField(this, 2) as number; + } + set end(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + start?: number; + end?: number; + }) { + const message = new EnumReservedRange({}); + if (data.start != null) { + message.start = data.start; + } + if (data.end != null) { + message.end = data.end; + } + return message; + } + toObject() { + const data: { + start?: number; + end?: number; + } = {}; + if (this.start != null) { + data.start = this.start; + } + if (this.end != null) { + data.end = this.end; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.start !== undefined) + writer.writeInt32(1, this.start); + if (this.end !== undefined) + writer.writeInt32(2, this.end); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumReservedRange { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumReservedRange(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.start = reader.readInt32(); + break; + case 2: + message.end = reader.readInt32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EnumReservedRange { + return EnumReservedRange.deserialize(bytes); + } + } + } + export class EnumValueDescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + number?: number; + options?: EnumValueOptions; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("number" in data && data.number != undefined) { + this.number = data.number; + } + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get number() { + return pb_1.Message.getField(this, 2) as number; + } + set number(value: number) { + pb_1.Message.setField(this, 2, value); + } + get options() { + return pb_1.Message.getWrapperField(this, EnumValueOptions, 3) as EnumValueOptions; + } + set options(value: EnumValueOptions) { + pb_1.Message.setWrapperField(this, 3, value); + } + static fromObject(data: { + name?: string; + number?: number; + options?: ReturnType; + }) { + const message = new EnumValueDescriptorProto({}); + if (data.name != null) { + message.name = data.name; + } + if (data.number != null) { + message.number = data.number; + } + if (data.options != null) { + message.options = EnumValueOptions.fromObject(data.options); + } + return message; + } + toObject() { + const data: { + name?: string; + number?: number; + options?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.number != null) { + data.number = this.number; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.number !== undefined) + writer.writeInt32(2, this.number); + if (this.options !== undefined) + writer.writeMessage(3, this.options, () => this.options.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumValueDescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumValueDescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + message.number = reader.readInt32(); + break; + case 3: + reader.readMessage(message.options, () => message.options = EnumValueOptions.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EnumValueDescriptorProto { + return EnumValueDescriptorProto.deserialize(bytes); + } + } + export class ServiceDescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + this.method = data.method; + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get method() { + return pb_1.Message.getRepeatedWrapperField(this, MethodDescriptorProto, 2) as MethodDescriptorProto[]; + } + set method(value: MethodDescriptorProto[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get options() { + return pb_1.Message.getWrapperField(this, ServiceOptions, 3) as ServiceOptions; + } + set options(value: ServiceOptions) { + pb_1.Message.setWrapperField(this, 3, value); + } + static fromObject(data: { + name?: string; + method: ReturnType[]; + options?: ReturnType; + }) { + const message = new ServiceDescriptorProto({ + method: data.method.map(item => MethodDescriptorProto.fromObject(item)) + }); + if (data.name != null) { + message.name = data.name; + } + if (data.options != null) { + message.options = ServiceOptions.fromObject(data.options); + } + return message; + } + toObject() { + const data: { + name?: string; + method: ReturnType[]; + options?: ReturnType; + } = { + method: this.method.map((item: MethodDescriptorProto) => item.toObject()) + }; + if (this.name != null) { + data.name = this.name; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.method !== undefined) + writer.writeRepeatedMessage(2, this.method, (item: MethodDescriptorProto) => item.serialize(writer)); + if (this.options !== undefined) + writer.writeMessage(3, this.options, () => this.options.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ServiceDescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ServiceDescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage(message.method, () => pb_1.Message.addToRepeatedWrapperField(message, 2, MethodDescriptorProto.deserialize(reader), MethodDescriptorProto)); + break; + case 3: + reader.readMessage(message.options, () => message.options = ServiceOptions.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ServiceDescriptorProto { + return ServiceDescriptorProto.deserialize(bytes); + } + } + export class MethodDescriptorProto extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + input_type?: string; + output_type?: string; + options?: MethodOptions; + client_streaming?: boolean; + server_streaming?: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("input_type" in data && data.input_type != undefined) { + this.input_type = data.input_type; + } + if ("output_type" in data && data.output_type != undefined) { + this.output_type = data.output_type; + } + if ("options" in data && data.options != undefined) { + this.options = data.options; + } + if ("client_streaming" in data && data.client_streaming != undefined) { + this.client_streaming = data.client_streaming; + } + if ("server_streaming" in data && data.server_streaming != undefined) { + this.server_streaming = data.server_streaming; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get input_type() { + return pb_1.Message.getField(this, 2) as string; + } + set input_type(value: string) { + pb_1.Message.setField(this, 2, value); + } + get output_type() { + return pb_1.Message.getField(this, 3) as string; + } + set output_type(value: string) { + pb_1.Message.setField(this, 3, value); + } + get options() { + return pb_1.Message.getWrapperField(this, MethodOptions, 4) as MethodOptions; + } + set options(value: MethodOptions) { + pb_1.Message.setWrapperField(this, 4, value); + } + get client_streaming() { + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; + } + set client_streaming(value: boolean) { + pb_1.Message.setField(this, 5, value); + } + get server_streaming() { + return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; + } + set server_streaming(value: boolean) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + name?: string; + input_type?: string; + output_type?: string; + options?: ReturnType; + client_streaming?: boolean; + server_streaming?: boolean; + }) { + const message = new MethodDescriptorProto({}); + if (data.name != null) { + message.name = data.name; + } + if (data.input_type != null) { + message.input_type = data.input_type; + } + if (data.output_type != null) { + message.output_type = data.output_type; + } + if (data.options != null) { + message.options = MethodOptions.fromObject(data.options); + } + if (data.client_streaming != null) { + message.client_streaming = data.client_streaming; + } + if (data.server_streaming != null) { + message.server_streaming = data.server_streaming; + } + return message; + } + toObject() { + const data: { + name?: string; + input_type?: string; + output_type?: string; + options?: ReturnType; + client_streaming?: boolean; + server_streaming?: boolean; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.input_type != null) { + data.input_type = this.input_type; + } + if (this.output_type != null) { + data.output_type = this.output_type; + } + if (this.options != null) { + data.options = this.options.toObject(); + } + if (this.client_streaming != null) { + data.client_streaming = this.client_streaming; + } + if (this.server_streaming != null) { + data.server_streaming = this.server_streaming; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (typeof this.input_type === "string" && this.input_type.length) + writer.writeString(2, this.input_type); + if (typeof this.output_type === "string" && this.output_type.length) + writer.writeString(3, this.output_type); + if (this.options !== undefined) + writer.writeMessage(4, this.options, () => this.options.serialize(writer)); + if (this.client_streaming !== undefined) + writer.writeBool(5, this.client_streaming); + if (this.server_streaming !== undefined) + writer.writeBool(6, this.server_streaming); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MethodDescriptorProto { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MethodDescriptorProto(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + message.input_type = reader.readString(); + break; + case 3: + message.output_type = reader.readString(); + break; + case 4: + reader.readMessage(message.options, () => message.options = MethodOptions.deserialize(reader)); + break; + case 5: + message.client_streaming = reader.readBool(); + break; + case 6: + message.server_streaming = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MethodDescriptorProto { + return MethodDescriptorProto.deserialize(bytes); + } + } + export class FileOptions extends pb_1.Message { + constructor(data?: any[] | { + java_package?: string; + java_outer_classname?: string; + java_multiple_files?: boolean; + /** @deprecated*/ + java_generate_equals_and_hash?: boolean; + java_string_check_utf8?: boolean; + optimize_for?: FileOptions.OptimizeMode; + go_package?: string; + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: boolean; + deprecated?: boolean; + cc_enable_arenas?: boolean; + objc_class_prefix?: string; + csharp_namespace?: string; + swift_prefix?: string; + php_class_prefix?: string; + php_namespace?: string; + php_metadata_namespace?: string; + ruby_package?: string; + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("java_package" in data && data.java_package != undefined) { + this.java_package = data.java_package; + } + if ("java_outer_classname" in data && data.java_outer_classname != undefined) { + this.java_outer_classname = data.java_outer_classname; + } + if ("java_multiple_files" in data && data.java_multiple_files != undefined) { + this.java_multiple_files = data.java_multiple_files; + } + if ("java_generate_equals_and_hash" in data && data.java_generate_equals_and_hash != undefined) { + this.java_generate_equals_and_hash = data.java_generate_equals_and_hash; + } + if ("java_string_check_utf8" in data && data.java_string_check_utf8 != undefined) { + this.java_string_check_utf8 = data.java_string_check_utf8; + } + if ("optimize_for" in data && data.optimize_for != undefined) { + this.optimize_for = data.optimize_for; + } + if ("go_package" in data && data.go_package != undefined) { + this.go_package = data.go_package; + } + if ("cc_generic_services" in data && data.cc_generic_services != undefined) { + this.cc_generic_services = data.cc_generic_services; + } + if ("java_generic_services" in data && data.java_generic_services != undefined) { + this.java_generic_services = data.java_generic_services; + } + if ("py_generic_services" in data && data.py_generic_services != undefined) { + this.py_generic_services = data.py_generic_services; + } + if ("php_generic_services" in data && data.php_generic_services != undefined) { + this.php_generic_services = data.php_generic_services; + } + if ("deprecated" in data && data.deprecated != undefined) { + this.deprecated = data.deprecated; + } + if ("cc_enable_arenas" in data && data.cc_enable_arenas != undefined) { + this.cc_enable_arenas = data.cc_enable_arenas; + } + if ("objc_class_prefix" in data && data.objc_class_prefix != undefined) { + this.objc_class_prefix = data.objc_class_prefix; + } + if ("csharp_namespace" in data && data.csharp_namespace != undefined) { + this.csharp_namespace = data.csharp_namespace; + } + if ("swift_prefix" in data && data.swift_prefix != undefined) { + this.swift_prefix = data.swift_prefix; + } + if ("php_class_prefix" in data && data.php_class_prefix != undefined) { + this.php_class_prefix = data.php_class_prefix; + } + if ("php_namespace" in data && data.php_namespace != undefined) { + this.php_namespace = data.php_namespace; + } + if ("php_metadata_namespace" in data && data.php_metadata_namespace != undefined) { + this.php_metadata_namespace = data.php_metadata_namespace; + } + if ("ruby_package" in data && data.ruby_package != undefined) { + this.ruby_package = data.ruby_package; + } + this.uninterpreted_option = data.uninterpreted_option; + } + } + get java_package() { + return pb_1.Message.getField(this, 1) as string; + } + set java_package(value: string) { + pb_1.Message.setField(this, 1, value); + } + get java_outer_classname() { + return pb_1.Message.getField(this, 8) as string; + } + set java_outer_classname(value: string) { + pb_1.Message.setField(this, 8, value); + } + get java_multiple_files() { + return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; + } + set java_multiple_files(value: boolean) { + pb_1.Message.setField(this, 10, value); + } + /** @deprecated*/ + get java_generate_equals_and_hash() { + return pb_1.Message.getField(this, 20) as boolean; + } + /** @deprecated*/ + set java_generate_equals_and_hash(value: boolean) { + pb_1.Message.setField(this, 20, value); + } + get java_string_check_utf8() { + return pb_1.Message.getFieldWithDefault(this, 27, false) as boolean; + } + set java_string_check_utf8(value: boolean) { + pb_1.Message.setField(this, 27, value); + } + get optimize_for() { + return pb_1.Message.getFieldWithDefault(this, 9, FileOptions.OptimizeMode.SPEED) as FileOptions.OptimizeMode; + } + set optimize_for(value: FileOptions.OptimizeMode) { + pb_1.Message.setField(this, 9, value); + } + get go_package() { + return pb_1.Message.getField(this, 11) as string; + } + set go_package(value: string) { + pb_1.Message.setField(this, 11, value); + } + get cc_generic_services() { + return pb_1.Message.getFieldWithDefault(this, 16, false) as boolean; + } + set cc_generic_services(value: boolean) { + pb_1.Message.setField(this, 16, value); + } + get java_generic_services() { + return pb_1.Message.getFieldWithDefault(this, 17, false) as boolean; + } + set java_generic_services(value: boolean) { + pb_1.Message.setField(this, 17, value); + } + get py_generic_services() { + return pb_1.Message.getFieldWithDefault(this, 18, false) as boolean; + } + set py_generic_services(value: boolean) { + pb_1.Message.setField(this, 18, value); + } + get php_generic_services() { + return pb_1.Message.getFieldWithDefault(this, 42, false) as boolean; + } + set php_generic_services(value: boolean) { + pb_1.Message.setField(this, 42, value); + } + get deprecated() { + return pb_1.Message.getFieldWithDefault(this, 23, false) as boolean; + } + set deprecated(value: boolean) { + pb_1.Message.setField(this, 23, value); + } + get cc_enable_arenas() { + return pb_1.Message.getFieldWithDefault(this, 31, true) as boolean; + } + set cc_enable_arenas(value: boolean) { + pb_1.Message.setField(this, 31, value); + } + get objc_class_prefix() { + return pb_1.Message.getField(this, 36) as string; + } + set objc_class_prefix(value: string) { + pb_1.Message.setField(this, 36, value); + } + get csharp_namespace() { + return pb_1.Message.getField(this, 37) as string; + } + set csharp_namespace(value: string) { + pb_1.Message.setField(this, 37, value); + } + get swift_prefix() { + return pb_1.Message.getField(this, 39) as string; + } + set swift_prefix(value: string) { + pb_1.Message.setField(this, 39, value); + } + get php_class_prefix() { + return pb_1.Message.getField(this, 40) as string; + } + set php_class_prefix(value: string) { + pb_1.Message.setField(this, 40, value); + } + get php_namespace() { + return pb_1.Message.getField(this, 41) as string; + } + set php_namespace(value: string) { + pb_1.Message.setField(this, 41, value); + } + get php_metadata_namespace() { + return pb_1.Message.getField(this, 44) as string; + } + set php_metadata_namespace(value: string) { + pb_1.Message.setField(this, 44, value); + } + get ruby_package() { + return pb_1.Message.getField(this, 45) as string; + } + set ruby_package(value: string) { + pb_1.Message.setField(this, 45, value); + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + java_package?: string; + java_outer_classname?: string; + java_multiple_files?: boolean; + java_generate_equals_and_hash?: boolean; + java_string_check_utf8?: boolean; + optimize_for?: FileOptions.OptimizeMode; + go_package?: string; + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: boolean; + deprecated?: boolean; + cc_enable_arenas?: boolean; + objc_class_prefix?: string; + csharp_namespace?: string; + swift_prefix?: string; + php_class_prefix?: string; + php_namespace?: string; + php_metadata_namespace?: string; + ruby_package?: string; + uninterpreted_option: ReturnType[]; + }) { + const message = new FileOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + if (data.java_package != null) { + message.java_package = data.java_package; + } + if (data.java_outer_classname != null) { + message.java_outer_classname = data.java_outer_classname; + } + if (data.java_multiple_files != null) { + message.java_multiple_files = data.java_multiple_files; + } + if (data.java_generate_equals_and_hash != null) { + message.java_generate_equals_and_hash = data.java_generate_equals_and_hash; + } + if (data.java_string_check_utf8 != null) { + message.java_string_check_utf8 = data.java_string_check_utf8; + } + if (data.optimize_for != null) { + message.optimize_for = data.optimize_for; + } + if (data.go_package != null) { + message.go_package = data.go_package; + } + if (data.cc_generic_services != null) { + message.cc_generic_services = data.cc_generic_services; + } + if (data.java_generic_services != null) { + message.java_generic_services = data.java_generic_services; + } + if (data.py_generic_services != null) { + message.py_generic_services = data.py_generic_services; + } + if (data.php_generic_services != null) { + message.php_generic_services = data.php_generic_services; + } + if (data.deprecated != null) { + message.deprecated = data.deprecated; + } + if (data.cc_enable_arenas != null) { + message.cc_enable_arenas = data.cc_enable_arenas; + } + if (data.objc_class_prefix != null) { + message.objc_class_prefix = data.objc_class_prefix; + } + if (data.csharp_namespace != null) { + message.csharp_namespace = data.csharp_namespace; + } + if (data.swift_prefix != null) { + message.swift_prefix = data.swift_prefix; + } + if (data.php_class_prefix != null) { + message.php_class_prefix = data.php_class_prefix; + } + if (data.php_namespace != null) { + message.php_namespace = data.php_namespace; + } + if (data.php_metadata_namespace != null) { + message.php_metadata_namespace = data.php_metadata_namespace; + } + if (data.ruby_package != null) { + message.ruby_package = data.ruby_package; + } + return message; + } + toObject() { + const data: { + java_package?: string; + java_outer_classname?: string; + java_multiple_files?: boolean; + java_generate_equals_and_hash?: boolean; + java_string_check_utf8?: boolean; + optimize_for?: FileOptions.OptimizeMode; + go_package?: string; + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: boolean; + deprecated?: boolean; + cc_enable_arenas?: boolean; + objc_class_prefix?: string; + csharp_namespace?: string; + swift_prefix?: string; + php_class_prefix?: string; + php_namespace?: string; + php_metadata_namespace?: string; + ruby_package?: string; + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + if (this.java_package != null) { + data.java_package = this.java_package; + } + if (this.java_outer_classname != null) { + data.java_outer_classname = this.java_outer_classname; + } + if (this.java_multiple_files != null) { + data.java_multiple_files = this.java_multiple_files; + } + if (this.java_generate_equals_and_hash != null) { + data.java_generate_equals_and_hash = this.java_generate_equals_and_hash; + } + if (this.java_string_check_utf8 != null) { + data.java_string_check_utf8 = this.java_string_check_utf8; + } + if (this.optimize_for != null) { + data.optimize_for = this.optimize_for; + } + if (this.go_package != null) { + data.go_package = this.go_package; + } + if (this.cc_generic_services != null) { + data.cc_generic_services = this.cc_generic_services; + } + if (this.java_generic_services != null) { + data.java_generic_services = this.java_generic_services; + } + if (this.py_generic_services != null) { + data.py_generic_services = this.py_generic_services; + } + if (this.php_generic_services != null) { + data.php_generic_services = this.php_generic_services; + } + if (this.deprecated != null) { + data.deprecated = this.deprecated; + } + if (this.cc_enable_arenas != null) { + data.cc_enable_arenas = this.cc_enable_arenas; + } + if (this.objc_class_prefix != null) { + data.objc_class_prefix = this.objc_class_prefix; + } + if (this.csharp_namespace != null) { + data.csharp_namespace = this.csharp_namespace; + } + if (this.swift_prefix != null) { + data.swift_prefix = this.swift_prefix; + } + if (this.php_class_prefix != null) { + data.php_class_prefix = this.php_class_prefix; + } + if (this.php_namespace != null) { + data.php_namespace = this.php_namespace; + } + if (this.php_metadata_namespace != null) { + data.php_metadata_namespace = this.php_metadata_namespace; + } + if (this.ruby_package != null) { + data.ruby_package = this.ruby_package; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.java_package === "string" && this.java_package.length) + writer.writeString(1, this.java_package); + if (typeof this.java_outer_classname === "string" && this.java_outer_classname.length) + writer.writeString(8, this.java_outer_classname); + if (this.java_multiple_files !== undefined) + writer.writeBool(10, this.java_multiple_files); + if (this.java_generate_equals_and_hash !== undefined) + writer.writeBool(20, this.java_generate_equals_and_hash); + if (this.java_string_check_utf8 !== undefined) + writer.writeBool(27, this.java_string_check_utf8); + if (this.optimize_for !== undefined) + writer.writeEnum(9, this.optimize_for); + if (typeof this.go_package === "string" && this.go_package.length) + writer.writeString(11, this.go_package); + if (this.cc_generic_services !== undefined) + writer.writeBool(16, this.cc_generic_services); + if (this.java_generic_services !== undefined) + writer.writeBool(17, this.java_generic_services); + if (this.py_generic_services !== undefined) + writer.writeBool(18, this.py_generic_services); + if (this.php_generic_services !== undefined) + writer.writeBool(42, this.php_generic_services); + if (this.deprecated !== undefined) + writer.writeBool(23, this.deprecated); + if (this.cc_enable_arenas !== undefined) + writer.writeBool(31, this.cc_enable_arenas); + if (typeof this.objc_class_prefix === "string" && this.objc_class_prefix.length) + writer.writeString(36, this.objc_class_prefix); + if (typeof this.csharp_namespace === "string" && this.csharp_namespace.length) + writer.writeString(37, this.csharp_namespace); + if (typeof this.swift_prefix === "string" && this.swift_prefix.length) + writer.writeString(39, this.swift_prefix); + if (typeof this.php_class_prefix === "string" && this.php_class_prefix.length) + writer.writeString(40, this.php_class_prefix); + if (typeof this.php_namespace === "string" && this.php_namespace.length) + writer.writeString(41, this.php_namespace); + if (typeof this.php_metadata_namespace === "string" && this.php_metadata_namespace.length) + writer.writeString(44, this.php_metadata_namespace); + if (typeof this.ruby_package === "string" && this.ruby_package.length) + writer.writeString(45, this.ruby_package); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FileOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FileOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.java_package = reader.readString(); + break; + case 8: + message.java_outer_classname = reader.readString(); + break; + case 10: + message.java_multiple_files = reader.readBool(); + break; + case 20: + message.java_generate_equals_and_hash = reader.readBool(); + break; + case 27: + message.java_string_check_utf8 = reader.readBool(); + break; + case 9: + message.optimize_for = reader.readEnum(); + break; + case 11: + message.go_package = reader.readString(); + break; + case 16: + message.cc_generic_services = reader.readBool(); + break; + case 17: + message.java_generic_services = reader.readBool(); + break; + case 18: + message.py_generic_services = reader.readBool(); + break; + case 42: + message.php_generic_services = reader.readBool(); + break; + case 23: + message.deprecated = reader.readBool(); + break; + case 31: + message.cc_enable_arenas = reader.readBool(); + break; + case 36: + message.objc_class_prefix = reader.readString(); + break; + case 37: + message.csharp_namespace = reader.readString(); + break; + case 39: + message.swift_prefix = reader.readString(); + break; + case 40: + message.php_class_prefix = reader.readString(); + break; + case 41: + message.php_namespace = reader.readString(); + break; + case 44: + message.php_metadata_namespace = reader.readString(); + break; + case 45: + message.ruby_package = reader.readString(); + break; + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): FileOptions { + return FileOptions.deserialize(bytes); + } + } + export namespace FileOptions { + export enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + export class MessageOptions extends pb_1.Message { + constructor(data?: any[] | { + message_set_wire_format?: boolean; + no_standard_descriptor_accessor?: boolean; + deprecated?: boolean; + map_entry?: boolean; + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("message_set_wire_format" in data && data.message_set_wire_format != undefined) { + this.message_set_wire_format = data.message_set_wire_format; + } + if ("no_standard_descriptor_accessor" in data && data.no_standard_descriptor_accessor != undefined) { + this.no_standard_descriptor_accessor = data.no_standard_descriptor_accessor; + } + if ("deprecated" in data && data.deprecated != undefined) { + this.deprecated = data.deprecated; + } + if ("map_entry" in data && data.map_entry != undefined) { + this.map_entry = data.map_entry; + } + this.uninterpreted_option = data.uninterpreted_option; + } + } + get message_set_wire_format() { + return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; + } + set message_set_wire_format(value: boolean) { + pb_1.Message.setField(this, 1, value); + } + get no_standard_descriptor_accessor() { + return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; + } + set no_standard_descriptor_accessor(value: boolean) { + pb_1.Message.setField(this, 2, value); + } + get deprecated() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set deprecated(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get map_entry() { + return pb_1.Message.getField(this, 7) as boolean; + } + set map_entry(value: boolean) { + pb_1.Message.setField(this, 7, value); + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + message_set_wire_format?: boolean; + no_standard_descriptor_accessor?: boolean; + deprecated?: boolean; + map_entry?: boolean; + uninterpreted_option: ReturnType[]; + }) { + const message = new MessageOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + if (data.message_set_wire_format != null) { + message.message_set_wire_format = data.message_set_wire_format; + } + if (data.no_standard_descriptor_accessor != null) { + message.no_standard_descriptor_accessor = data.no_standard_descriptor_accessor; + } + if (data.deprecated != null) { + message.deprecated = data.deprecated; + } + if (data.map_entry != null) { + message.map_entry = data.map_entry; + } + return message; + } + toObject() { + const data: { + message_set_wire_format?: boolean; + no_standard_descriptor_accessor?: boolean; + deprecated?: boolean; + map_entry?: boolean; + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + if (this.message_set_wire_format != null) { + data.message_set_wire_format = this.message_set_wire_format; + } + if (this.no_standard_descriptor_accessor != null) { + data.no_standard_descriptor_accessor = this.no_standard_descriptor_accessor; + } + if (this.deprecated != null) { + data.deprecated = this.deprecated; + } + if (this.map_entry != null) { + data.map_entry = this.map_entry; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.message_set_wire_format !== undefined) + writer.writeBool(1, this.message_set_wire_format); + if (this.no_standard_descriptor_accessor !== undefined) + writer.writeBool(2, this.no_standard_descriptor_accessor); + if (this.deprecated !== undefined) + writer.writeBool(3, this.deprecated); + if (this.map_entry !== undefined) + writer.writeBool(7, this.map_entry); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MessageOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MessageOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.message_set_wire_format = reader.readBool(); + break; + case 2: + message.no_standard_descriptor_accessor = reader.readBool(); + break; + case 3: + message.deprecated = reader.readBool(); + break; + case 7: + message.map_entry = reader.readBool(); + break; + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MessageOptions { + return MessageOptions.deserialize(bytes); + } + } + export class FieldOptions extends pb_1.Message { + constructor(data?: any[] | { + ctype?: FieldOptions.CType; + packed?: boolean; + jstype?: FieldOptions.JSType; + lazy?: boolean; + deprecated?: boolean; + weak?: boolean; + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("ctype" in data && data.ctype != undefined) { + this.ctype = data.ctype; + } + if ("packed" in data && data.packed != undefined) { + this.packed = data.packed; + } + if ("jstype" in data && data.jstype != undefined) { + this.jstype = data.jstype; + } + if ("lazy" in data && data.lazy != undefined) { + this.lazy = data.lazy; + } + if ("deprecated" in data && data.deprecated != undefined) { + this.deprecated = data.deprecated; + } + if ("weak" in data && data.weak != undefined) { + this.weak = data.weak; + } + this.uninterpreted_option = data.uninterpreted_option; + } + } + get ctype() { + return pb_1.Message.getFieldWithDefault(this, 1, FieldOptions.CType.STRING) as FieldOptions.CType; + } + set ctype(value: FieldOptions.CType) { + pb_1.Message.setField(this, 1, value); + } + get packed() { + return pb_1.Message.getField(this, 2) as boolean; + } + set packed(value: boolean) { + pb_1.Message.setField(this, 2, value); + } + get jstype() { + return pb_1.Message.getFieldWithDefault(this, 6, FieldOptions.JSType.JS_NORMAL) as FieldOptions.JSType; + } + set jstype(value: FieldOptions.JSType) { + pb_1.Message.setField(this, 6, value); + } + get lazy() { + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; + } + set lazy(value: boolean) { + pb_1.Message.setField(this, 5, value); + } + get deprecated() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set deprecated(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get weak() { + return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; + } + set weak(value: boolean) { + pb_1.Message.setField(this, 10, value); + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + ctype?: FieldOptions.CType; + packed?: boolean; + jstype?: FieldOptions.JSType; + lazy?: boolean; + deprecated?: boolean; + weak?: boolean; + uninterpreted_option: ReturnType[]; + }) { + const message = new FieldOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + if (data.ctype != null) { + message.ctype = data.ctype; + } + if (data.packed != null) { + message.packed = data.packed; + } + if (data.jstype != null) { + message.jstype = data.jstype; + } + if (data.lazy != null) { + message.lazy = data.lazy; + } + if (data.deprecated != null) { + message.deprecated = data.deprecated; + } + if (data.weak != null) { + message.weak = data.weak; + } + return message; + } + toObject() { + const data: { + ctype?: FieldOptions.CType; + packed?: boolean; + jstype?: FieldOptions.JSType; + lazy?: boolean; + deprecated?: boolean; + weak?: boolean; + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + if (this.ctype != null) { + data.ctype = this.ctype; + } + if (this.packed != null) { + data.packed = this.packed; + } + if (this.jstype != null) { + data.jstype = this.jstype; + } + if (this.lazy != null) { + data.lazy = this.lazy; + } + if (this.deprecated != null) { + data.deprecated = this.deprecated; + } + if (this.weak != null) { + data.weak = this.weak; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.ctype !== undefined) + writer.writeEnum(1, this.ctype); + if (this.packed !== undefined) + writer.writeBool(2, this.packed); + if (this.jstype !== undefined) + writer.writeEnum(6, this.jstype); + if (this.lazy !== undefined) + writer.writeBool(5, this.lazy); + if (this.deprecated !== undefined) + writer.writeBool(3, this.deprecated); + if (this.weak !== undefined) + writer.writeBool(10, this.weak); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FieldOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FieldOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.ctype = reader.readEnum(); + break; + case 2: + message.packed = reader.readBool(); + break; + case 6: + message.jstype = reader.readEnum(); + break; + case 5: + message.lazy = reader.readBool(); + break; + case 3: + message.deprecated = reader.readBool(); + break; + case 10: + message.weak = reader.readBool(); + break; + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): FieldOptions { + return FieldOptions.deserialize(bytes); + } + } + export namespace FieldOptions { + export enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + export enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + export class OneofOptions extends pb_1.Message { + constructor(data?: any[] | { + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + this.uninterpreted_option = data.uninterpreted_option; + } + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + uninterpreted_option: ReturnType[]; + }) { + const message = new OneofOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + return message; + } + toObject() { + const data: { + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OneofOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new OneofOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): OneofOptions { + return OneofOptions.deserialize(bytes); + } + } + export class EnumOptions extends pb_1.Message { + constructor(data?: any[] | { + allow_alias?: boolean; + deprecated?: boolean; + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("allow_alias" in data && data.allow_alias != undefined) { + this.allow_alias = data.allow_alias; + } + if ("deprecated" in data && data.deprecated != undefined) { + this.deprecated = data.deprecated; + } + this.uninterpreted_option = data.uninterpreted_option; + } + } + get allow_alias() { + return pb_1.Message.getField(this, 2) as boolean; + } + set allow_alias(value: boolean) { + pb_1.Message.setField(this, 2, value); + } + get deprecated() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set deprecated(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + allow_alias?: boolean; + deprecated?: boolean; + uninterpreted_option: ReturnType[]; + }) { + const message = new EnumOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + if (data.allow_alias != null) { + message.allow_alias = data.allow_alias; + } + if (data.deprecated != null) { + message.deprecated = data.deprecated; + } + return message; + } + toObject() { + const data: { + allow_alias?: boolean; + deprecated?: boolean; + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + if (this.allow_alias != null) { + data.allow_alias = this.allow_alias; + } + if (this.deprecated != null) { + data.deprecated = this.deprecated; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.allow_alias !== undefined) + writer.writeBool(2, this.allow_alias); + if (this.deprecated !== undefined) + writer.writeBool(3, this.deprecated); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 2: + message.allow_alias = reader.readBool(); + break; + case 3: + message.deprecated = reader.readBool(); + break; + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EnumOptions { + return EnumOptions.deserialize(bytes); + } + } + export class EnumValueOptions extends pb_1.Message { + constructor(data?: any[] | { + deprecated?: boolean; + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("deprecated" in data && data.deprecated != undefined) { + this.deprecated = data.deprecated; + } + this.uninterpreted_option = data.uninterpreted_option; + } + } + get deprecated() { + return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; + } + set deprecated(value: boolean) { + pb_1.Message.setField(this, 1, value); + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + deprecated?: boolean; + uninterpreted_option: ReturnType[]; + }) { + const message = new EnumValueOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + if (data.deprecated != null) { + message.deprecated = data.deprecated; + } + return message; + } + toObject() { + const data: { + deprecated?: boolean; + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + if (this.deprecated != null) { + data.deprecated = this.deprecated; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.deprecated !== undefined) + writer.writeBool(1, this.deprecated); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumValueOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumValueOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.deprecated = reader.readBool(); + break; + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EnumValueOptions { + return EnumValueOptions.deserialize(bytes); + } + } + export class ServiceOptions extends pb_1.Message { + constructor(data?: any[] | { + deprecated?: boolean; + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("deprecated" in data && data.deprecated != undefined) { + this.deprecated = data.deprecated; + } + this.uninterpreted_option = data.uninterpreted_option; + } + } + get deprecated() { + return pb_1.Message.getFieldWithDefault(this, 33, false) as boolean; + } + set deprecated(value: boolean) { + pb_1.Message.setField(this, 33, value); + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + deprecated?: boolean; + uninterpreted_option: ReturnType[]; + }) { + const message = new ServiceOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + if (data.deprecated != null) { + message.deprecated = data.deprecated; + } + return message; + } + toObject() { + const data: { + deprecated?: boolean; + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + if (this.deprecated != null) { + data.deprecated = this.deprecated; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.deprecated !== undefined) + writer.writeBool(33, this.deprecated); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ServiceOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ServiceOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 33: + message.deprecated = reader.readBool(); + break; + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ServiceOptions { + return ServiceOptions.deserialize(bytes); + } + } + export class MethodOptions extends pb_1.Message { + constructor(data?: any[] | { + deprecated?: boolean; + idempotency_level?: MethodOptions.IdempotencyLevel; + uninterpreted_option: UninterpretedOption[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("deprecated" in data && data.deprecated != undefined) { + this.deprecated = data.deprecated; + } + if ("idempotency_level" in data && data.idempotency_level != undefined) { + this.idempotency_level = data.idempotency_level; + } + this.uninterpreted_option = data.uninterpreted_option; + } + } + get deprecated() { + return pb_1.Message.getFieldWithDefault(this, 33, false) as boolean; + } + set deprecated(value: boolean) { + pb_1.Message.setField(this, 33, value); + } + get idempotency_level() { + return pb_1.Message.getFieldWithDefault(this, 34, MethodOptions.IdempotencyLevel.IDEMPOTENCY_UNKNOWN) as MethodOptions.IdempotencyLevel; + } + set idempotency_level(value: MethodOptions.IdempotencyLevel) { + pb_1.Message.setField(this, 34, value); + } + get uninterpreted_option() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; + } + set uninterpreted_option(value: UninterpretedOption[]) { + pb_1.Message.setRepeatedWrapperField(this, 999, value); + } + static fromObject(data: { + deprecated?: boolean; + idempotency_level?: MethodOptions.IdempotencyLevel; + uninterpreted_option: ReturnType[]; + }) { + const message = new MethodOptions({ + uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) + }); + if (data.deprecated != null) { + message.deprecated = data.deprecated; + } + if (data.idempotency_level != null) { + message.idempotency_level = data.idempotency_level; + } + return message; + } + toObject() { + const data: { + deprecated?: boolean; + idempotency_level?: MethodOptions.IdempotencyLevel; + uninterpreted_option: ReturnType[]; + } = { + uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) + }; + if (this.deprecated != null) { + data.deprecated = this.deprecated; + } + if (this.idempotency_level != null) { + data.idempotency_level = this.idempotency_level; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.deprecated !== undefined) + writer.writeBool(33, this.deprecated); + if (this.idempotency_level !== undefined) + writer.writeEnum(34, this.idempotency_level); + if (this.uninterpreted_option !== undefined) + writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MethodOptions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MethodOptions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 33: + message.deprecated = reader.readBool(); + break; + case 34: + message.idempotency_level = reader.readEnum(); + break; + case 999: + reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MethodOptions { + return MethodOptions.deserialize(bytes); + } + } + export namespace MethodOptions { + export enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + export class UninterpretedOption extends pb_1.Message { + constructor(data?: any[] | { + name: UninterpretedOption.NamePart[]; + identifier_value?: string; + positive_int_value?: number; + negative_int_value?: number; + double_value?: number; + string_value?: Uint8Array; + aggregate_value?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + this.name = data.name; + if ("identifier_value" in data && data.identifier_value != undefined) { + this.identifier_value = data.identifier_value; + } + if ("positive_int_value" in data && data.positive_int_value != undefined) { + this.positive_int_value = data.positive_int_value; + } + if ("negative_int_value" in data && data.negative_int_value != undefined) { + this.negative_int_value = data.negative_int_value; + } + if ("double_value" in data && data.double_value != undefined) { + this.double_value = data.double_value; + } + if ("string_value" in data && data.string_value != undefined) { + this.string_value = data.string_value; + } + if ("aggregate_value" in data && data.aggregate_value != undefined) { + this.aggregate_value = data.aggregate_value; + } + } + } + get name() { + return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption.NamePart, 2) as UninterpretedOption.NamePart[]; + } + set name(value: UninterpretedOption.NamePart[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get identifier_value() { + return pb_1.Message.getField(this, 3) as string; + } + set identifier_value(value: string) { + pb_1.Message.setField(this, 3, value); + } + get positive_int_value() { + return pb_1.Message.getField(this, 4) as number; + } + set positive_int_value(value: number) { + pb_1.Message.setField(this, 4, value); + } + get negative_int_value() { + return pb_1.Message.getField(this, 5) as number; + } + set negative_int_value(value: number) { + pb_1.Message.setField(this, 5, value); + } + get double_value() { + return pb_1.Message.getField(this, 6) as number; + } + set double_value(value: number) { + pb_1.Message.setField(this, 6, value); + } + get string_value() { + return pb_1.Message.getField(this, 7) as Uint8Array; + } + set string_value(value: Uint8Array) { + pb_1.Message.setField(this, 7, value); + } + get aggregate_value() { + return pb_1.Message.getField(this, 8) as string; + } + set aggregate_value(value: string) { + pb_1.Message.setField(this, 8, value); + } + static fromObject(data: { + name: ReturnType[]; + identifier_value?: string; + positive_int_value?: number; + negative_int_value?: number; + double_value?: number; + string_value?: Uint8Array; + aggregate_value?: string; + }) { + const message = new UninterpretedOption({ + name: data.name.map(item => UninterpretedOption.NamePart.fromObject(item)) + }); + if (data.identifier_value != null) { + message.identifier_value = data.identifier_value; + } + if (data.positive_int_value != null) { + message.positive_int_value = data.positive_int_value; + } + if (data.negative_int_value != null) { + message.negative_int_value = data.negative_int_value; + } + if (data.double_value != null) { + message.double_value = data.double_value; + } + if (data.string_value != null) { + message.string_value = data.string_value; + } + if (data.aggregate_value != null) { + message.aggregate_value = data.aggregate_value; + } + return message; + } + toObject() { + const data: { + name: ReturnType[]; + identifier_value?: string; + positive_int_value?: number; + negative_int_value?: number; + double_value?: number; + string_value?: Uint8Array; + aggregate_value?: string; + } = { + name: this.name.map((item: UninterpretedOption.NamePart) => item.toObject()) + }; + if (this.identifier_value != null) { + data.identifier_value = this.identifier_value; + } + if (this.positive_int_value != null) { + data.positive_int_value = this.positive_int_value; + } + if (this.negative_int_value != null) { + data.negative_int_value = this.negative_int_value; + } + if (this.double_value != null) { + data.double_value = this.double_value; + } + if (this.string_value != null) { + data.string_value = this.string_value; + } + if (this.aggregate_value != null) { + data.aggregate_value = this.aggregate_value; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.name !== undefined) + writer.writeRepeatedMessage(2, this.name, (item: UninterpretedOption.NamePart) => item.serialize(writer)); + if (typeof this.identifier_value === "string" && this.identifier_value.length) + writer.writeString(3, this.identifier_value); + if (this.positive_int_value !== undefined) + writer.writeUint64(4, this.positive_int_value); + if (this.negative_int_value !== undefined) + writer.writeInt64(5, this.negative_int_value); + if (this.double_value !== undefined) + writer.writeDouble(6, this.double_value); + if (this.string_value !== undefined) + writer.writeBytes(7, this.string_value); + if (typeof this.aggregate_value === "string" && this.aggregate_value.length) + writer.writeString(8, this.aggregate_value); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UninterpretedOption { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UninterpretedOption(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 2: + reader.readMessage(message.name, () => pb_1.Message.addToRepeatedWrapperField(message, 2, UninterpretedOption.NamePart.deserialize(reader), UninterpretedOption.NamePart)); + break; + case 3: + message.identifier_value = reader.readString(); + break; + case 4: + message.positive_int_value = reader.readUint64(); + break; + case 5: + message.negative_int_value = reader.readInt64(); + break; + case 6: + message.double_value = reader.readDouble(); + break; + case 7: + message.string_value = reader.readBytes(); + break; + case 8: + message.aggregate_value = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): UninterpretedOption { + return UninterpretedOption.deserialize(bytes); + } + } + export namespace UninterpretedOption { + export class NamePart extends pb_1.Message { + constructor(data?: any[] | { + name_part: string; + is_extension: boolean; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + this.name_part = data.name_part; + this.is_extension = data.is_extension; + } + } + get name_part() { + return pb_1.Message.getField(this, 1) as string; + } + set name_part(value: string) { + pb_1.Message.setField(this, 1, value); + } + get is_extension() { + return pb_1.Message.getField(this, 2) as boolean; + } + set is_extension(value: boolean) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + name_part: string; + is_extension: boolean; + }) { + const message = new NamePart({ + name_part: data.name_part, + is_extension: data.is_extension + }); + return message; + } + toObject() { + const data: { + name_part: string; + is_extension: boolean; + } = { + name_part: this.name_part, + is_extension: this.is_extension + }; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name_part === "string" && this.name_part.length) + writer.writeString(1, this.name_part); + if (this.is_extension !== undefined) + writer.writeBool(2, this.is_extension); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NamePart { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NamePart(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name_part = reader.readString(); + break; + case 2: + message.is_extension = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): NamePart { + return NamePart.deserialize(bytes); + } + } + } + export class SourceCodeInfo extends pb_1.Message { + constructor(data?: any[] | { + location: SourceCodeInfo.Location[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + this.location = data.location; + } + } + get location() { + return pb_1.Message.getRepeatedWrapperField(this, SourceCodeInfo.Location, 1) as SourceCodeInfo.Location[]; + } + set location(value: SourceCodeInfo.Location[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + static fromObject(data: { + location: ReturnType[]; + }) { + const message = new SourceCodeInfo({ + location: data.location.map(item => SourceCodeInfo.Location.fromObject(item)) + }); + return message; + } + toObject() { + const data: { + location: ReturnType[]; + } = { + location: this.location.map((item: SourceCodeInfo.Location) => item.toObject()) + }; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.location !== undefined) + writer.writeRepeatedMessage(1, this.location, (item: SourceCodeInfo.Location) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SourceCodeInfo { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SourceCodeInfo(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.location, () => pb_1.Message.addToRepeatedWrapperField(message, 1, SourceCodeInfo.Location.deserialize(reader), SourceCodeInfo.Location)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SourceCodeInfo { + return SourceCodeInfo.deserialize(bytes); + } + } + export namespace SourceCodeInfo { + export class Location extends pb_1.Message { + constructor(data?: any[] | { + path: number[]; + span: number[]; + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 6], []); + if (!Array.isArray(data) && typeof data == "object") { + this.path = data.path; + this.span = data.span; + if ("leading_comments" in data && data.leading_comments != undefined) { + this.leading_comments = data.leading_comments; + } + if ("trailing_comments" in data && data.trailing_comments != undefined) { + this.trailing_comments = data.trailing_comments; + } + this.leading_detached_comments = data.leading_detached_comments; + } + } + get path() { + return pb_1.Message.getField(this, 1) as number[]; + } + set path(value: number[]) { + pb_1.Message.setField(this, 1, value); + } + get span() { + return pb_1.Message.getField(this, 2) as number[]; + } + set span(value: number[]) { + pb_1.Message.setField(this, 2, value); + } + get leading_comments() { + return pb_1.Message.getField(this, 3) as string; + } + set leading_comments(value: string) { + pb_1.Message.setField(this, 3, value); + } + get trailing_comments() { + return pb_1.Message.getField(this, 4) as string; + } + set trailing_comments(value: string) { + pb_1.Message.setField(this, 4, value); + } + get leading_detached_comments() { + return pb_1.Message.getField(this, 6) as string[]; + } + set leading_detached_comments(value: string[]) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + path: number[]; + span: number[]; + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments: string[]; + }) { + const message = new Location({ + path: data.path, + span: data.span, + leading_detached_comments: data.leading_detached_comments + }); + if (data.leading_comments != null) { + message.leading_comments = data.leading_comments; + } + if (data.trailing_comments != null) { + message.trailing_comments = data.trailing_comments; + } + return message; + } + toObject() { + const data: { + path: number[]; + span: number[]; + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments: string[]; + } = { + path: this.path, + span: this.span, + leading_detached_comments: this.leading_detached_comments + }; + if (this.leading_comments != null) { + data.leading_comments = this.leading_comments; + } + if (this.trailing_comments != null) { + data.trailing_comments = this.trailing_comments; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.path !== undefined) + writer.writePackedInt32(1, this.path); + if (this.span !== undefined) + writer.writePackedInt32(2, this.span); + if (typeof this.leading_comments === "string" && this.leading_comments.length) + writer.writeString(3, this.leading_comments); + if (typeof this.trailing_comments === "string" && this.trailing_comments.length) + writer.writeString(4, this.trailing_comments); + if (this.leading_detached_comments !== undefined) + writer.writeRepeatedString(6, this.leading_detached_comments); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Location { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Location(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.path = reader.readPackedInt32(); + break; + case 2: + message.span = reader.readPackedInt32(); + break; + case 3: + message.leading_comments = reader.readString(); + break; + case 4: + message.trailing_comments = reader.readString(); + break; + case 6: + pb_1.Message.addToRepeatedField(message, 6, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Location { + return Location.deserialize(bytes); + } + } + } + export class GeneratedCodeInfo extends pb_1.Message { + constructor(data?: any[] | { + annotation: GeneratedCodeInfo.Annotation[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + this.annotation = data.annotation; + } + } + get annotation() { + return pb_1.Message.getRepeatedWrapperField(this, GeneratedCodeInfo.Annotation, 1) as GeneratedCodeInfo.Annotation[]; + } + set annotation(value: GeneratedCodeInfo.Annotation[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + static fromObject(data: { + annotation: ReturnType[]; + }) { + const message = new GeneratedCodeInfo({ + annotation: data.annotation.map(item => GeneratedCodeInfo.Annotation.fromObject(item)) + }); + return message; + } + toObject() { + const data: { + annotation: ReturnType[]; + } = { + annotation: this.annotation.map((item: GeneratedCodeInfo.Annotation) => item.toObject()) + }; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.annotation !== undefined) + writer.writeRepeatedMessage(1, this.annotation, (item: GeneratedCodeInfo.Annotation) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GeneratedCodeInfo { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GeneratedCodeInfo(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.annotation, () => pb_1.Message.addToRepeatedWrapperField(message, 1, GeneratedCodeInfo.Annotation.deserialize(reader), GeneratedCodeInfo.Annotation)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GeneratedCodeInfo { + return GeneratedCodeInfo.deserialize(bytes); + } + } + export namespace GeneratedCodeInfo { + export class Annotation extends pb_1.Message { + constructor(data?: any[] | { + path: number[]; + source_file?: string; + begin?: number; + end?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + this.path = data.path; + if ("source_file" in data && data.source_file != undefined) { + this.source_file = data.source_file; + } + if ("begin" in data && data.begin != undefined) { + this.begin = data.begin; + } + if ("end" in data && data.end != undefined) { + this.end = data.end; + } + } + } + get path() { + return pb_1.Message.getField(this, 1) as number[]; + } + set path(value: number[]) { + pb_1.Message.setField(this, 1, value); + } + get source_file() { + return pb_1.Message.getField(this, 2) as string; + } + set source_file(value: string) { + pb_1.Message.setField(this, 2, value); + } + get begin() { + return pb_1.Message.getField(this, 3) as number; + } + set begin(value: number) { + pb_1.Message.setField(this, 3, value); + } + get end() { + return pb_1.Message.getField(this, 4) as number; + } + set end(value: number) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + path: number[]; + source_file?: string; + begin?: number; + end?: number; + }) { + const message = new Annotation({ + path: data.path + }); + if (data.source_file != null) { + message.source_file = data.source_file; + } + if (data.begin != null) { + message.begin = data.begin; + } + if (data.end != null) { + message.end = data.end; + } + return message; + } + toObject() { + const data: { + path: number[]; + source_file?: string; + begin?: number; + end?: number; + } = { + path: this.path + }; + if (this.source_file != null) { + data.source_file = this.source_file; + } + if (this.begin != null) { + data.begin = this.begin; + } + if (this.end != null) { + data.end = this.end; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.path !== undefined) + writer.writePackedInt32(1, this.path); + if (typeof this.source_file === "string" && this.source_file.length) + writer.writeString(2, this.source_file); + if (this.begin !== undefined) + writer.writeInt32(3, this.begin); + if (this.end !== undefined) + writer.writeInt32(4, this.end); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Annotation { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Annotation(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.path = reader.readPackedInt32(); + break; + case 2: + message.source_file = reader.readString(); + break; + case 3: + message.begin = reader.readInt32(); + break; + case 4: + message.end = reader.readInt32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Annotation { + return Annotation.deserialize(bytes); + } + } + } +} diff --git a/src/proto/google/protobuf/duration.ts b/src/proto/google/protobuf/duration.ts new file mode 100644 index 0000000..7934a4b --- /dev/null +++ b/src/proto/google/protobuf/duration.ts @@ -0,0 +1,99 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: google/protobuf/duration.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as pb_1 from "google-protobuf"; +export namespace google.protobuf { + export class Duration extends pb_1.Message { + constructor(data?: any[] | { + seconds?: number; + nanos?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("seconds" in data && data.seconds != undefined) { + this.seconds = data.seconds; + } + if ("nanos" in data && data.nanos != undefined) { + this.nanos = data.nanos; + } + } + } + get seconds() { + return pb_1.Message.getField(this, 1) as number; + } + set seconds(value: number) { + pb_1.Message.setField(this, 1, value); + } + get nanos() { + return pb_1.Message.getField(this, 2) as number; + } + set nanos(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + seconds?: number; + nanos?: number; + }) { + const message = new Duration({}); + if (data.seconds != null) { + message.seconds = data.seconds; + } + if (data.nanos != null) { + message.nanos = data.nanos; + } + return message; + } + toObject() { + const data: { + seconds?: number; + nanos?: number; + } = {}; + if (this.seconds != null) { + data.seconds = this.seconds; + } + if (this.nanos != null) { + data.nanos = this.nanos; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.seconds !== undefined) + writer.writeInt64(1, this.seconds); + if (this.nanos !== undefined) + writer.writeInt32(2, this.nanos); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Duration { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Duration(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.seconds = reader.readInt64(); + break; + case 2: + message.nanos = reader.readInt32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Duration { + return Duration.deserialize(bytes); + } + } +} diff --git a/src/proto/google/protobuf/timestamp.ts b/src/proto/google/protobuf/timestamp.ts new file mode 100644 index 0000000..4ddcd9d --- /dev/null +++ b/src/proto/google/protobuf/timestamp.ts @@ -0,0 +1,99 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: google/protobuf/timestamp.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as pb_1 from "google-protobuf"; +export namespace google.protobuf { + export class Timestamp extends pb_1.Message { + constructor(data?: any[] | { + seconds?: number; + nanos?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("seconds" in data && data.seconds != undefined) { + this.seconds = data.seconds; + } + if ("nanos" in data && data.nanos != undefined) { + this.nanos = data.nanos; + } + } + } + get seconds() { + return pb_1.Message.getField(this, 1) as number; + } + set seconds(value: number) { + pb_1.Message.setField(this, 1, value); + } + get nanos() { + return pb_1.Message.getField(this, 2) as number; + } + set nanos(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + seconds?: number; + nanos?: number; + }) { + const message = new Timestamp({}); + if (data.seconds != null) { + message.seconds = data.seconds; + } + if (data.nanos != null) { + message.nanos = data.nanos; + } + return message; + } + toObject() { + const data: { + seconds?: number; + nanos?: number; + } = {}; + if (this.seconds != null) { + data.seconds = this.seconds; + } + if (this.nanos != null) { + data.nanos = this.nanos; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.seconds !== undefined) + writer.writeInt64(1, this.seconds); + if (this.nanos !== undefined) + writer.writeInt32(2, this.nanos); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Timestamp { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Timestamp(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.seconds = reader.readInt64(); + break; + case 2: + message.nanos = reader.readInt32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Timestamp { + return Timestamp.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/auction/v1beta1/genesis.ts b/src/proto/vulcanize/auction/v1beta1/genesis.ts new file mode 100644 index 0000000..0cc3c81 --- /dev/null +++ b/src/proto/vulcanize/auction/v1beta1/genesis.ts @@ -0,0 +1,101 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/auction/v1beta1/genesis.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./types"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.auction.v1beta1 { + export class GenesisState extends pb_1.Message { + constructor(data?: any[] | { + params?: dependency_2.vulcanize.auction.v1beta1.Params; + auctions?: dependency_2.vulcanize.auction.v1beta1.Auction[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + if ("auctions" in data && data.auctions != undefined) { + this.auctions = data.auctions; + } + } + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Params, 1) as dependency_2.vulcanize.auction.v1beta1.Params; + } + set params(value: dependency_2.vulcanize.auction.v1beta1.Params) { + pb_1.Message.setWrapperField(this, 1, value); + } + get auctions() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Auction, 2) as dependency_2.vulcanize.auction.v1beta1.Auction[]; + } + set auctions(value: dependency_2.vulcanize.auction.v1beta1.Auction[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + params?: ReturnType; + auctions?: ReturnType[]; + }) { + const message = new GenesisState({}); + if (data.params != null) { + message.params = dependency_2.vulcanize.auction.v1beta1.Params.fromObject(data.params); + } + if (data.auctions != null) { + message.auctions = data.auctions.map(item => dependency_2.vulcanize.auction.v1beta1.Auction.fromObject(item)); + } + return message; + } + toObject() { + const data: { + params?: ReturnType; + auctions?: ReturnType[]; + } = {}; + if (this.params != null) { + data.params = this.params.toObject(); + } + if (this.auctions != null) { + data.auctions = this.auctions.map((item: dependency_2.vulcanize.auction.v1beta1.Auction) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.params !== undefined) + writer.writeMessage(1, this.params, () => this.params.serialize(writer)); + if (this.auctions !== undefined) + writer.writeRepeatedMessage(2, this.auctions, (item: dependency_2.vulcanize.auction.v1beta1.Auction) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.auction.v1beta1.Params.deserialize(reader)); + break; + case 2: + reader.readMessage(message.auctions, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.auction.v1beta1.Auction.deserialize(reader), dependency_2.vulcanize.auction.v1beta1.Auction)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GenesisState { + return GenesisState.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/auction/v1beta1/query.ts b/src/proto/vulcanize/auction/v1beta1/query.ts new file mode 100644 index 0000000..31d280e --- /dev/null +++ b/src/proto/vulcanize/auction/v1beta1/query.ts @@ -0,0 +1,1063 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/auction/v1beta1/query.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./../../../google/api/annotations"; +import * as dependency_3 from "./../../../cosmos/base/query/v1beta1/pagination"; +import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; +import * as dependency_5 from "./types"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.auction.v1beta1 { + export class AuctionsRequest extends pb_1.Message { + constructor(data?: any[] | { + pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + pagination?: ReturnType; + }) { + const message = new AuctionsRequest({}); + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + pagination?: ReturnType; + } = {}; + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.pagination !== undefined) + writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionsRequest { + return AuctionsRequest.deserialize(bytes); + } + } + export class AuctionsResponse extends pb_1.Message { + constructor(data?: any[] | { + auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; + pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auctions" in data && data.auctions != undefined) { + this.auctions = data.auctions; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get auctions() { + return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1) as dependency_5.vulcanize.auction.v1beta1.Auctions; + } + set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { + pb_1.Message.setWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_3.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + auctions?: ReturnType; + pagination?: ReturnType; + }) { + const message = new AuctionsResponse({}); + if (data.auctions != null) { + message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); + } + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + auctions?: ReturnType; + pagination?: ReturnType; + } = {}; + if (this.auctions != null) { + data.auctions = this.auctions.toObject(); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.auctions !== undefined) + writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionsResponse { + return AuctionsResponse.deserialize(bytes); + } + } + export class AuctionRequest extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + id?: string; + }) { + const message = new AuctionRequest({}); + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + id?: string; + } = {}; + if (this.id != null) { + data.id = this.id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionRequest { + return AuctionRequest.deserialize(bytes); + } + } + export class AuctionResponse extends pb_1.Message { + constructor(data?: any[] | { + auction?: dependency_5.vulcanize.auction.v1beta1.Auction; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction" in data && data.auction != undefined) { + this.auction = data.auction; + } + } + } + get auction() { + return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auction, 1) as dependency_5.vulcanize.auction.v1beta1.Auction; + } + set auction(value: dependency_5.vulcanize.auction.v1beta1.Auction) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + auction?: ReturnType; + }) { + const message = new AuctionResponse({}); + if (data.auction != null) { + message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); + } + return message; + } + toObject() { + const data: { + auction?: ReturnType; + } = {}; + if (this.auction != null) { + data.auction = this.auction.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.auction !== undefined) + writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.auction, () => message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionResponse { + return AuctionResponse.deserialize(bytes); + } + } + export class BidRequest extends pb_1.Message { + constructor(data?: any[] | { + auction_id?: string; + bidder?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction_id" in data && data.auction_id != undefined) { + this.auction_id = data.auction_id; + } + if ("bidder" in data && data.bidder != undefined) { + this.bidder = data.bidder; + } + } + } + get auction_id() { + return pb_1.Message.getField(this, 1) as string; + } + set auction_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get bidder() { + return pb_1.Message.getField(this, 2) as string; + } + set bidder(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + auction_id?: string; + bidder?: string; + }) { + const message = new BidRequest({}); + if (data.auction_id != null) { + message.auction_id = data.auction_id; + } + if (data.bidder != null) { + message.bidder = data.bidder; + } + return message; + } + toObject() { + const data: { + auction_id?: string; + bidder?: string; + } = {}; + if (this.auction_id != null) { + data.auction_id = this.auction_id; + } + if (this.bidder != null) { + data.bidder = this.bidder; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.auction_id === "string" && this.auction_id.length) + writer.writeString(1, this.auction_id); + if (typeof this.bidder === "string" && this.bidder.length) + writer.writeString(2, this.bidder); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.auction_id = reader.readString(); + break; + case 2: + message.bidder = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BidRequest { + return BidRequest.deserialize(bytes); + } + } + export class BidResponse extends pb_1.Message { + constructor(data?: any[] | { + bid?: dependency_5.vulcanize.auction.v1beta1.Bid; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bid" in data && data.bid != undefined) { + this.bid = data.bid; + } + } + } + get bid() { + return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Bid, 1) as dependency_5.vulcanize.auction.v1beta1.Bid; + } + set bid(value: dependency_5.vulcanize.auction.v1beta1.Bid) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + bid?: ReturnType; + }) { + const message = new BidResponse({}); + if (data.bid != null) { + message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(data.bid); + } + return message; + } + toObject() { + const data: { + bid?: ReturnType; + } = {}; + if (this.bid != null) { + data.bid = this.bid.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.bid !== undefined) + writer.writeMessage(1, this.bid, () => this.bid.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.bid, () => message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BidResponse { + return BidResponse.deserialize(bytes); + } + } + export class BidsRequest extends pb_1.Message { + constructor(data?: any[] | { + auction_id?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction_id" in data && data.auction_id != undefined) { + this.auction_id = data.auction_id; + } + } + } + get auction_id() { + return pb_1.Message.getField(this, 1) as string; + } + set auction_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + auction_id?: string; + }) { + const message = new BidsRequest({}); + if (data.auction_id != null) { + message.auction_id = data.auction_id; + } + return message; + } + toObject() { + const data: { + auction_id?: string; + } = {}; + if (this.auction_id != null) { + data.auction_id = this.auction_id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.auction_id === "string" && this.auction_id.length) + writer.writeString(1, this.auction_id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.auction_id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BidsRequest { + return BidsRequest.deserialize(bytes); + } + } + export class BidsResponse extends pb_1.Message { + constructor(data?: any[] | { + bids?: dependency_5.vulcanize.auction.v1beta1.Bid[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bids" in data && data.bids != undefined) { + this.bids = data.bids; + } + } + } + get bids() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Bid, 1) as dependency_5.vulcanize.auction.v1beta1.Bid[]; + } + set bids(value: dependency_5.vulcanize.auction.v1beta1.Bid[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + static fromObject(data: { + bids?: ReturnType[]; + }) { + const message = new BidsResponse({}); + if (data.bids != null) { + message.bids = data.bids.map(item => dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(item)); + } + return message; + } + toObject() { + const data: { + bids?: ReturnType[]; + } = {}; + if (this.bids != null) { + data.bids = this.bids.map((item: dependency_5.vulcanize.auction.v1beta1.Bid) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.bids !== undefined) + writer.writeRepeatedMessage(1, this.bids, (item: dependency_5.vulcanize.auction.v1beta1.Bid) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.bids, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_5.vulcanize.auction.v1beta1.Bid.deserialize(reader), dependency_5.vulcanize.auction.v1beta1.Bid)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BidsResponse { + return BidsResponse.deserialize(bytes); + } + } + export class AuctionsByBidderRequest extends pb_1.Message { + constructor(data?: any[] | { + bidder_address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bidder_address" in data && data.bidder_address != undefined) { + this.bidder_address = data.bidder_address; + } + } + } + get bidder_address() { + return pb_1.Message.getField(this, 1) as string; + } + set bidder_address(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + bidder_address?: string; + }) { + const message = new AuctionsByBidderRequest({}); + if (data.bidder_address != null) { + message.bidder_address = data.bidder_address; + } + return message; + } + toObject() { + const data: { + bidder_address?: string; + } = {}; + if (this.bidder_address != null) { + data.bidder_address = this.bidder_address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.bidder_address === "string" && this.bidder_address.length) + writer.writeString(1, this.bidder_address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByBidderRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByBidderRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.bidder_address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionsByBidderRequest { + return AuctionsByBidderRequest.deserialize(bytes); + } + } + export class AuctionsByBidderResponse extends pb_1.Message { + constructor(data?: any[] | { + auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auctions" in data && data.auctions != undefined) { + this.auctions = data.auctions; + } + } + } + get auctions() { + return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1) as dependency_5.vulcanize.auction.v1beta1.Auctions; + } + set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + auctions?: ReturnType; + }) { + const message = new AuctionsByBidderResponse({}); + if (data.auctions != null) { + message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); + } + return message; + } + toObject() { + const data: { + auctions?: ReturnType; + } = {}; + if (this.auctions != null) { + data.auctions = this.auctions.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.auctions !== undefined) + writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByBidderResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByBidderResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionsByBidderResponse { + return AuctionsByBidderResponse.deserialize(bytes); + } + } + export class AuctionsByOwnerRequest extends pb_1.Message { + constructor(data?: any[] | { + owner_address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("owner_address" in data && data.owner_address != undefined) { + this.owner_address = data.owner_address; + } + } + } + get owner_address() { + return pb_1.Message.getField(this, 1) as string; + } + set owner_address(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + owner_address?: string; + }) { + const message = new AuctionsByOwnerRequest({}); + if (data.owner_address != null) { + message.owner_address = data.owner_address; + } + return message; + } + toObject() { + const data: { + owner_address?: string; + } = {}; + if (this.owner_address != null) { + data.owner_address = this.owner_address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.owner_address === "string" && this.owner_address.length) + writer.writeString(1, this.owner_address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByOwnerRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByOwnerRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.owner_address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionsByOwnerRequest { + return AuctionsByOwnerRequest.deserialize(bytes); + } + } + export class AuctionsByOwnerResponse extends pb_1.Message { + constructor(data?: any[] | { + auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auctions" in data && data.auctions != undefined) { + this.auctions = data.auctions; + } + } + } + get auctions() { + return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1) as dependency_5.vulcanize.auction.v1beta1.Auctions; + } + set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + auctions?: ReturnType; + }) { + const message = new AuctionsByOwnerResponse({}); + if (data.auctions != null) { + message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); + } + return message; + } + toObject() { + const data: { + auctions?: ReturnType; + } = {}; + if (this.auctions != null) { + data.auctions = this.auctions.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.auctions !== undefined) + writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByOwnerResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByOwnerResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionsByOwnerResponse { + return AuctionsByOwnerResponse.deserialize(bytes); + } + } + export class QueryParamsRequest extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new QueryParamsRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsRequest { + return QueryParamsRequest.deserialize(bytes); + } + } + export class QueryParamsResponse extends pb_1.Message { + constructor(data?: any[] | { + params?: dependency_5.vulcanize.auction.v1beta1.Params; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + } + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Params, 1) as dependency_5.vulcanize.auction.v1beta1.Params; + } + set params(value: dependency_5.vulcanize.auction.v1beta1.Params) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + params?: ReturnType; + }) { + const message = new QueryParamsResponse({}); + if (data.params != null) { + message.params = dependency_5.vulcanize.auction.v1beta1.Params.fromObject(data.params); + } + return message; + } + toObject() { + const data: { + params?: ReturnType; + } = {}; + if (this.params != null) { + data.params = this.params.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.params !== undefined) + writer.writeMessage(1, this.params, () => this.params.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.params, () => message.params = dependency_5.vulcanize.auction.v1beta1.Params.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsResponse { + return QueryParamsResponse.deserialize(bytes); + } + } + export class BalanceRequest extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new BalanceRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BalanceRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BalanceRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BalanceRequest { + return BalanceRequest.deserialize(bytes); + } + } + export class BalanceResponse extends pb_1.Message { + constructor(data?: any[] | { + balance?: dependency_4.cosmos.base.v1beta1.Coin[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("balance" in data && data.balance != undefined) { + this.balance = data.balance; + } + } + } + get balance() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 1) as dependency_4.cosmos.base.v1beta1.Coin[]; + } + set balance(value: dependency_4.cosmos.base.v1beta1.Coin[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + static fromObject(data: { + balance?: ReturnType[]; + }) { + const message = new BalanceResponse({}); + if (data.balance != null) { + message.balance = data.balance.map(item => dependency_4.cosmos.base.v1beta1.Coin.fromObject(item)); + } + return message; + } + toObject() { + const data: { + balance?: ReturnType[]; + } = {}; + if (this.balance != null) { + data.balance = this.balance.map((item: dependency_4.cosmos.base.v1beta1.Coin) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.balance !== undefined) + writer.writeRepeatedMessage(1, this.balance, (item: dependency_4.cosmos.base.v1beta1.Coin) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BalanceResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BalanceResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_4.cosmos.base.v1beta1.Coin)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BalanceResponse { + return BalanceResponse.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/auction/v1beta1/tx.ts b/src/proto/vulcanize/auction/v1beta1/tx.ts new file mode 100644 index 0000000..96ee727 --- /dev/null +++ b/src/proto/vulcanize/auction/v1beta1/tx.ts @@ -0,0 +1,617 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/auction/v1beta1/tx.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./../../../google/protobuf/duration"; +import * as dependency_3 from "./../../../cosmos/base/v1beta1/coin"; +import * as dependency_4 from "./types"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.auction.v1beta1 { + export class MsgCreateAuction extends pb_1.Message { + constructor(data?: any[] | { + commits_duration?: dependency_2.google.protobuf.Duration; + reveals_duration?: dependency_2.google.protobuf.Duration; + commit_fee?: dependency_3.cosmos.base.v1beta1.Coin; + reveal_fee?: dependency_3.cosmos.base.v1beta1.Coin; + minimum_bid?: dependency_3.cosmos.base.v1beta1.Coin; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("commits_duration" in data && data.commits_duration != undefined) { + this.commits_duration = data.commits_duration; + } + if ("reveals_duration" in data && data.reveals_duration != undefined) { + this.reveals_duration = data.reveals_duration; + } + if ("commit_fee" in data && data.commit_fee != undefined) { + this.commit_fee = data.commit_fee; + } + if ("reveal_fee" in data && data.reveal_fee != undefined) { + this.reveal_fee = data.reveal_fee; + } + if ("minimum_bid" in data && data.minimum_bid != undefined) { + this.minimum_bid = data.minimum_bid; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get commits_duration() { + return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 1) as dependency_2.google.protobuf.Duration; + } + set commits_duration(value: dependency_2.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 1, value); + } + get reveals_duration() { + return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration; + } + set reveals_duration(value: dependency_2.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 2, value); + } + get commit_fee() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 3) as dependency_3.cosmos.base.v1beta1.Coin; + } + set commit_fee(value: dependency_3.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 3, value); + } + get reveal_fee() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 4) as dependency_3.cosmos.base.v1beta1.Coin; + } + set reveal_fee(value: dependency_3.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 4, value); + } + get minimum_bid() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 5) as dependency_3.cosmos.base.v1beta1.Coin; + } + set minimum_bid(value: dependency_3.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 5, value); + } + get signer() { + return pb_1.Message.getField(this, 6) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + commits_duration?: ReturnType; + reveals_duration?: ReturnType; + commit_fee?: ReturnType; + reveal_fee?: ReturnType; + minimum_bid?: ReturnType; + signer?: string; + }) { + const message = new MsgCreateAuction({}); + if (data.commits_duration != null) { + message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration); + } + if (data.reveals_duration != null) { + message.reveals_duration = dependency_2.google.protobuf.Duration.fromObject(data.reveals_duration); + } + if (data.commit_fee != null) { + message.commit_fee = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee); + } + if (data.reveal_fee != null) { + message.reveal_fee = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee); + } + if (data.minimum_bid != null) { + message.minimum_bid = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid); + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + commits_duration?: ReturnType; + reveals_duration?: ReturnType; + commit_fee?: ReturnType; + reveal_fee?: ReturnType; + minimum_bid?: ReturnType; + signer?: string; + } = {}; + if (this.commits_duration != null) { + data.commits_duration = this.commits_duration.toObject(); + } + if (this.reveals_duration != null) { + data.reveals_duration = this.reveals_duration.toObject(); + } + if (this.commit_fee != null) { + data.commit_fee = this.commit_fee.toObject(); + } + if (this.reveal_fee != null) { + data.reveal_fee = this.reveal_fee.toObject(); + } + if (this.minimum_bid != null) { + data.minimum_bid = this.minimum_bid.toObject(); + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.commits_duration !== undefined) + writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer)); + if (this.reveals_duration !== undefined) + writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer)); + if (this.commit_fee !== undefined) + writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer)); + if (this.reveal_fee !== undefined) + writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer)); + if (this.minimum_bid !== undefined) + writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer)); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(6, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateAuction { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateAuction(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.commits_duration, () => message.commits_duration = dependency_2.google.protobuf.Duration.deserialize(reader)); + break; + case 2: + reader.readMessage(message.reveals_duration, () => message.reveals_duration = dependency_2.google.protobuf.Duration.deserialize(reader)); + break; + case 3: + reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 4: + reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 5: + reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 6: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCreateAuction { + return MsgCreateAuction.deserialize(bytes); + } + } + export class MsgCreateAuctionResponse extends pb_1.Message { + constructor(data?: any[] | { + auction?: dependency_4.vulcanize.auction.v1beta1.Auction; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction" in data && data.auction != undefined) { + this.auction = data.auction; + } + } + } + get auction() { + return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Auction, 1) as dependency_4.vulcanize.auction.v1beta1.Auction; + } + set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + auction?: ReturnType; + }) { + const message = new MsgCreateAuctionResponse({}); + if (data.auction != null) { + message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); + } + return message; + } + toObject() { + const data: { + auction?: ReturnType; + } = {}; + if (this.auction != null) { + data.auction = this.auction.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.auction !== undefined) + writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateAuctionResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateAuctionResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.auction, () => message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCreateAuctionResponse { + return MsgCreateAuctionResponse.deserialize(bytes); + } + } + export class MsgCommitBid extends pb_1.Message { + constructor(data?: any[] | { + auction_id?: string; + commit_hash?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction_id" in data && data.auction_id != undefined) { + this.auction_id = data.auction_id; + } + if ("commit_hash" in data && data.commit_hash != undefined) { + this.commit_hash = data.commit_hash; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get auction_id() { + return pb_1.Message.getField(this, 1) as string; + } + set auction_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get commit_hash() { + return pb_1.Message.getField(this, 2) as string; + } + set commit_hash(value: string) { + pb_1.Message.setField(this, 2, value); + } + get signer() { + return pb_1.Message.getField(this, 3) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + auction_id?: string; + commit_hash?: string; + signer?: string; + }) { + const message = new MsgCommitBid({}); + if (data.auction_id != null) { + message.auction_id = data.auction_id; + } + if (data.commit_hash != null) { + message.commit_hash = data.commit_hash; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + auction_id?: string; + commit_hash?: string; + signer?: string; + } = {}; + if (this.auction_id != null) { + data.auction_id = this.auction_id; + } + if (this.commit_hash != null) { + data.commit_hash = this.commit_hash; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.auction_id === "string" && this.auction_id.length) + writer.writeString(1, this.auction_id); + if (typeof this.commit_hash === "string" && this.commit_hash.length) + writer.writeString(2, this.commit_hash); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(3, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCommitBid { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCommitBid(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.auction_id = reader.readString(); + break; + case 2: + message.commit_hash = reader.readString(); + break; + case 3: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCommitBid { + return MsgCommitBid.deserialize(bytes); + } + } + export class MsgRevealBid extends pb_1.Message { + constructor(data?: any[] | { + auction_id?: string; + reveal?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction_id" in data && data.auction_id != undefined) { + this.auction_id = data.auction_id; + } + if ("reveal" in data && data.reveal != undefined) { + this.reveal = data.reveal; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get auction_id() { + return pb_1.Message.getField(this, 1) as string; + } + set auction_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get reveal() { + return pb_1.Message.getField(this, 2) as string; + } + set reveal(value: string) { + pb_1.Message.setField(this, 2, value); + } + get signer() { + return pb_1.Message.getField(this, 3) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + auction_id?: string; + reveal?: string; + signer?: string; + }) { + const message = new MsgRevealBid({}); + if (data.auction_id != null) { + message.auction_id = data.auction_id; + } + if (data.reveal != null) { + message.reveal = data.reveal; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + auction_id?: string; + reveal?: string; + signer?: string; + } = {}; + if (this.auction_id != null) { + data.auction_id = this.auction_id; + } + if (this.reveal != null) { + data.reveal = this.reveal; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.auction_id === "string" && this.auction_id.length) + writer.writeString(1, this.auction_id); + if (typeof this.reveal === "string" && this.reveal.length) + writer.writeString(2, this.reveal); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(3, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRevealBid { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRevealBid(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.auction_id = reader.readString(); + break; + case 2: + message.reveal = reader.readString(); + break; + case 3: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgRevealBid { + return MsgRevealBid.deserialize(bytes); + } + } + export class MsgCommitBidResponse extends pb_1.Message { + constructor(data?: any[] | { + bid?: dependency_4.vulcanize.auction.v1beta1.Bid; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bid" in data && data.bid != undefined) { + this.bid = data.bid; + } + } + } + get bid() { + return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Bid, 1) as dependency_4.vulcanize.auction.v1beta1.Bid; + } + set bid(value: dependency_4.vulcanize.auction.v1beta1.Bid) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + bid?: ReturnType; + }) { + const message = new MsgCommitBidResponse({}); + if (data.bid != null) { + message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.fromObject(data.bid); + } + return message; + } + toObject() { + const data: { + bid?: ReturnType; + } = {}; + if (this.bid != null) { + data.bid = this.bid.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.bid !== undefined) + writer.writeMessage(1, this.bid, () => this.bid.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCommitBidResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCommitBidResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.bid, () => message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCommitBidResponse { + return MsgCommitBidResponse.deserialize(bytes); + } + } + export class MsgRevealBidResponse extends pb_1.Message { + constructor(data?: any[] | { + auction?: dependency_4.vulcanize.auction.v1beta1.Auction; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction" in data && data.auction != undefined) { + this.auction = data.auction; + } + } + } + get auction() { + return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Auction, 1) as dependency_4.vulcanize.auction.v1beta1.Auction; + } + set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + auction?: ReturnType; + }) { + const message = new MsgRevealBidResponse({}); + if (data.auction != null) { + message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); + } + return message; + } + toObject() { + const data: { + auction?: ReturnType; + } = {}; + if (this.auction != null) { + data.auction = this.auction.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.auction !== undefined) + writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRevealBidResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRevealBidResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.auction, () => message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgRevealBidResponse { + return MsgRevealBidResponse.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/auction/v1beta1/types.ts b/src/proto/vulcanize/auction/v1beta1/types.ts new file mode 100644 index 0000000..6e6c324 --- /dev/null +++ b/src/proto/vulcanize/auction/v1beta1/types.ts @@ -0,0 +1,807 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/auction/v1beta1/types.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./../../../google/protobuf/duration"; +import * as dependency_3 from "./../../../google/protobuf/timestamp"; +import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.auction.v1beta1 { + export class Params extends pb_1.Message { + constructor(data?: any[] | { + commits_duration?: dependency_2.google.protobuf.Duration; + reveals_duration?: dependency_2.google.protobuf.Duration; + commit_fee?: dependency_4.cosmos.base.v1beta1.Coin; + reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin; + minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("commits_duration" in data && data.commits_duration != undefined) { + this.commits_duration = data.commits_duration; + } + if ("reveals_duration" in data && data.reveals_duration != undefined) { + this.reveals_duration = data.reveals_duration; + } + if ("commit_fee" in data && data.commit_fee != undefined) { + this.commit_fee = data.commit_fee; + } + if ("reveal_fee" in data && data.reveal_fee != undefined) { + this.reveal_fee = data.reveal_fee; + } + if ("minimum_bid" in data && data.minimum_bid != undefined) { + this.minimum_bid = data.minimum_bid; + } + } + } + get commits_duration() { + return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 1) as dependency_2.google.protobuf.Duration; + } + set commits_duration(value: dependency_2.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 1, value); + } + get reveals_duration() { + return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration; + } + set reveals_duration(value: dependency_2.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 2, value); + } + get commit_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin; + } + set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 3, value); + } + get reveal_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 4) as dependency_4.cosmos.base.v1beta1.Coin; + } + set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 4, value); + } + get minimum_bid() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 5) as dependency_4.cosmos.base.v1beta1.Coin; + } + set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 5, value); + } + static fromObject(data: { + commits_duration?: ReturnType; + reveals_duration?: ReturnType; + commit_fee?: ReturnType; + reveal_fee?: ReturnType; + minimum_bid?: ReturnType; + }) { + const message = new Params({}); + if (data.commits_duration != null) { + message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration); + } + if (data.reveals_duration != null) { + message.reveals_duration = dependency_2.google.protobuf.Duration.fromObject(data.reveals_duration); + } + if (data.commit_fee != null) { + message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee); + } + if (data.reveal_fee != null) { + message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee); + } + if (data.minimum_bid != null) { + message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid); + } + return message; + } + toObject() { + const data: { + commits_duration?: ReturnType; + reveals_duration?: ReturnType; + commit_fee?: ReturnType; + reveal_fee?: ReturnType; + minimum_bid?: ReturnType; + } = {}; + if (this.commits_duration != null) { + data.commits_duration = this.commits_duration.toObject(); + } + if (this.reveals_duration != null) { + data.reveals_duration = this.reveals_duration.toObject(); + } + if (this.commit_fee != null) { + data.commit_fee = this.commit_fee.toObject(); + } + if (this.reveal_fee != null) { + data.reveal_fee = this.reveal_fee.toObject(); + } + if (this.minimum_bid != null) { + data.minimum_bid = this.minimum_bid.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.commits_duration !== undefined) + writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer)); + if (this.reveals_duration !== undefined) + writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer)); + if (this.commit_fee !== undefined) + writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer)); + if (this.reveal_fee !== undefined) + writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer)); + if (this.minimum_bid !== undefined) + writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.commits_duration, () => message.commits_duration = dependency_2.google.protobuf.Duration.deserialize(reader)); + break; + case 2: + reader.readMessage(message.reveals_duration, () => message.reveals_duration = dependency_2.google.protobuf.Duration.deserialize(reader)); + break; + case 3: + reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 4: + reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 5: + reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Params { + return Params.deserialize(bytes); + } + } + export class Auction extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + status?: string; + owner_address?: string; + create_time?: dependency_3.google.protobuf.Timestamp; + commits_end_time?: dependency_3.google.protobuf.Timestamp; + reveals_end_time?: dependency_3.google.protobuf.Timestamp; + commit_fee?: dependency_4.cosmos.base.v1beta1.Coin; + reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin; + minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin; + winner_address?: string; + winning_bid?: dependency_4.cosmos.base.v1beta1.Coin; + winning_price?: dependency_4.cosmos.base.v1beta1.Coin; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("status" in data && data.status != undefined) { + this.status = data.status; + } + if ("owner_address" in data && data.owner_address != undefined) { + this.owner_address = data.owner_address; + } + if ("create_time" in data && data.create_time != undefined) { + this.create_time = data.create_time; + } + if ("commits_end_time" in data && data.commits_end_time != undefined) { + this.commits_end_time = data.commits_end_time; + } + if ("reveals_end_time" in data && data.reveals_end_time != undefined) { + this.reveals_end_time = data.reveals_end_time; + } + if ("commit_fee" in data && data.commit_fee != undefined) { + this.commit_fee = data.commit_fee; + } + if ("reveal_fee" in data && data.reveal_fee != undefined) { + this.reveal_fee = data.reveal_fee; + } + if ("minimum_bid" in data && data.minimum_bid != undefined) { + this.minimum_bid = data.minimum_bid; + } + if ("winner_address" in data && data.winner_address != undefined) { + this.winner_address = data.winner_address; + } + if ("winning_bid" in data && data.winning_bid != undefined) { + this.winning_bid = data.winning_bid; + } + if ("winning_price" in data && data.winning_price != undefined) { + this.winning_price = data.winning_price; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get status() { + return pb_1.Message.getField(this, 2) as string; + } + set status(value: string) { + pb_1.Message.setField(this, 2, value); + } + get owner_address() { + return pb_1.Message.getField(this, 3) as string; + } + set owner_address(value: string) { + pb_1.Message.setField(this, 3, value); + } + get create_time() { + return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 4) as dependency_3.google.protobuf.Timestamp; + } + set create_time(value: dependency_3.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 4, value); + } + get commits_end_time() { + return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5) as dependency_3.google.protobuf.Timestamp; + } + set commits_end_time(value: dependency_3.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 5, value); + } + get reveals_end_time() { + return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 6) as dependency_3.google.protobuf.Timestamp; + } + set reveals_end_time(value: dependency_3.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 6, value); + } + get commit_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 7) as dependency_4.cosmos.base.v1beta1.Coin; + } + set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 7, value); + } + get reveal_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin; + } + set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 8, value); + } + get minimum_bid() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; + } + set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 9, value); + } + get winner_address() { + return pb_1.Message.getField(this, 10) as string; + } + set winner_address(value: string) { + pb_1.Message.setField(this, 10, value); + } + get winning_bid() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11) as dependency_4.cosmos.base.v1beta1.Coin; + } + set winning_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 11, value); + } + get winning_price() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 12) as dependency_4.cosmos.base.v1beta1.Coin; + } + set winning_price(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 12, value); + } + static fromObject(data: { + id?: string; + status?: string; + owner_address?: string; + create_time?: ReturnType; + commits_end_time?: ReturnType; + reveals_end_time?: ReturnType; + commit_fee?: ReturnType; + reveal_fee?: ReturnType; + minimum_bid?: ReturnType; + winner_address?: string; + winning_bid?: ReturnType; + winning_price?: ReturnType; + }) { + const message = new Auction({}); + if (data.id != null) { + message.id = data.id; + } + if (data.status != null) { + message.status = data.status; + } + if (data.owner_address != null) { + message.owner_address = data.owner_address; + } + if (data.create_time != null) { + message.create_time = dependency_3.google.protobuf.Timestamp.fromObject(data.create_time); + } + if (data.commits_end_time != null) { + message.commits_end_time = dependency_3.google.protobuf.Timestamp.fromObject(data.commits_end_time); + } + if (data.reveals_end_time != null) { + message.reveals_end_time = dependency_3.google.protobuf.Timestamp.fromObject(data.reveals_end_time); + } + if (data.commit_fee != null) { + message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee); + } + if (data.reveal_fee != null) { + message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee); + } + if (data.minimum_bid != null) { + message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid); + } + if (data.winner_address != null) { + message.winner_address = data.winner_address; + } + if (data.winning_bid != null) { + message.winning_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.winning_bid); + } + if (data.winning_price != null) { + message.winning_price = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.winning_price); + } + return message; + } + toObject() { + const data: { + id?: string; + status?: string; + owner_address?: string; + create_time?: ReturnType; + commits_end_time?: ReturnType; + reveals_end_time?: ReturnType; + commit_fee?: ReturnType; + reveal_fee?: ReturnType; + minimum_bid?: ReturnType; + winner_address?: string; + winning_bid?: ReturnType; + winning_price?: ReturnType; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.status != null) { + data.status = this.status; + } + if (this.owner_address != null) { + data.owner_address = this.owner_address; + } + if (this.create_time != null) { + data.create_time = this.create_time.toObject(); + } + if (this.commits_end_time != null) { + data.commits_end_time = this.commits_end_time.toObject(); + } + if (this.reveals_end_time != null) { + data.reveals_end_time = this.reveals_end_time.toObject(); + } + if (this.commit_fee != null) { + data.commit_fee = this.commit_fee.toObject(); + } + if (this.reveal_fee != null) { + data.reveal_fee = this.reveal_fee.toObject(); + } + if (this.minimum_bid != null) { + data.minimum_bid = this.minimum_bid.toObject(); + } + if (this.winner_address != null) { + data.winner_address = this.winner_address; + } + if (this.winning_bid != null) { + data.winning_bid = this.winning_bid.toObject(); + } + if (this.winning_price != null) { + data.winning_price = this.winning_price.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (typeof this.status === "string" && this.status.length) + writer.writeString(2, this.status); + if (typeof this.owner_address === "string" && this.owner_address.length) + writer.writeString(3, this.owner_address); + if (this.create_time !== undefined) + writer.writeMessage(4, this.create_time, () => this.create_time.serialize(writer)); + if (this.commits_end_time !== undefined) + writer.writeMessage(5, this.commits_end_time, () => this.commits_end_time.serialize(writer)); + if (this.reveals_end_time !== undefined) + writer.writeMessage(6, this.reveals_end_time, () => this.reveals_end_time.serialize(writer)); + if (this.commit_fee !== undefined) + writer.writeMessage(7, this.commit_fee, () => this.commit_fee.serialize(writer)); + if (this.reveal_fee !== undefined) + writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer)); + if (this.minimum_bid !== undefined) + writer.writeMessage(9, this.minimum_bid, () => this.minimum_bid.serialize(writer)); + if (typeof this.winner_address === "string" && this.winner_address.length) + writer.writeString(10, this.winner_address); + if (this.winning_bid !== undefined) + writer.writeMessage(11, this.winning_bid, () => this.winning_bid.serialize(writer)); + if (this.winning_price !== undefined) + writer.writeMessage(12, this.winning_price, () => this.winning_price.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Auction { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Auction(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.status = reader.readString(); + break; + case 3: + message.owner_address = reader.readString(); + break; + case 4: + reader.readMessage(message.create_time, () => message.create_time = dependency_3.google.protobuf.Timestamp.deserialize(reader)); + break; + case 5: + reader.readMessage(message.commits_end_time, () => message.commits_end_time = dependency_3.google.protobuf.Timestamp.deserialize(reader)); + break; + case 6: + reader.readMessage(message.reveals_end_time, () => message.reveals_end_time = dependency_3.google.protobuf.Timestamp.deserialize(reader)); + break; + case 7: + reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 8: + reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 9: + reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 10: + message.winner_address = reader.readString(); + break; + case 11: + reader.readMessage(message.winning_bid, () => message.winning_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 12: + reader.readMessage(message.winning_price, () => message.winning_price = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Auction { + return Auction.deserialize(bytes); + } + } + export class Auctions extends pb_1.Message { + constructor(data?: any[] | { + auctions?: Auction[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auctions" in data && data.auctions != undefined) { + this.auctions = data.auctions; + } + } + } + get auctions() { + return pb_1.Message.getRepeatedWrapperField(this, Auction, 1) as Auction[]; + } + set auctions(value: Auction[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + static fromObject(data: { + auctions?: ReturnType[]; + }) { + const message = new Auctions({}); + if (data.auctions != null) { + message.auctions = data.auctions.map(item => Auction.fromObject(item)); + } + return message; + } + toObject() { + const data: { + auctions?: ReturnType[]; + } = {}; + if (this.auctions != null) { + data.auctions = this.auctions.map((item: Auction) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.auctions !== undefined) + writer.writeRepeatedMessage(1, this.auctions, (item: Auction) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Auctions { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Auctions(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.auctions, () => pb_1.Message.addToRepeatedWrapperField(message, 1, Auction.deserialize(reader), Auction)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Auctions { + return Auctions.deserialize(bytes); + } + } + export class Bid extends pb_1.Message { + constructor(data?: any[] | { + auction_id?: string; + bidder_address?: string; + status?: string; + commit_hash?: string; + commit_time?: dependency_3.google.protobuf.Timestamp; + commit_fee?: dependency_4.cosmos.base.v1beta1.Coin; + reveal_time?: dependency_3.google.protobuf.Timestamp; + reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin; + bid_amount?: dependency_4.cosmos.base.v1beta1.Coin; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction_id" in data && data.auction_id != undefined) { + this.auction_id = data.auction_id; + } + if ("bidder_address" in data && data.bidder_address != undefined) { + this.bidder_address = data.bidder_address; + } + if ("status" in data && data.status != undefined) { + this.status = data.status; + } + if ("commit_hash" in data && data.commit_hash != undefined) { + this.commit_hash = data.commit_hash; + } + if ("commit_time" in data && data.commit_time != undefined) { + this.commit_time = data.commit_time; + } + if ("commit_fee" in data && data.commit_fee != undefined) { + this.commit_fee = data.commit_fee; + } + if ("reveal_time" in data && data.reveal_time != undefined) { + this.reveal_time = data.reveal_time; + } + if ("reveal_fee" in data && data.reveal_fee != undefined) { + this.reveal_fee = data.reveal_fee; + } + if ("bid_amount" in data && data.bid_amount != undefined) { + this.bid_amount = data.bid_amount; + } + } + } + get auction_id() { + return pb_1.Message.getField(this, 1) as string; + } + set auction_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get bidder_address() { + return pb_1.Message.getField(this, 2) as string; + } + set bidder_address(value: string) { + pb_1.Message.setField(this, 2, value); + } + get status() { + return pb_1.Message.getField(this, 3) as string; + } + set status(value: string) { + pb_1.Message.setField(this, 3, value); + } + get commit_hash() { + return pb_1.Message.getField(this, 4) as string; + } + set commit_hash(value: string) { + pb_1.Message.setField(this, 4, value); + } + get commit_time() { + return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5) as dependency_3.google.protobuf.Timestamp; + } + set commit_time(value: dependency_3.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 5, value); + } + get commit_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 6) as dependency_4.cosmos.base.v1beta1.Coin; + } + set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 6, value); + } + get reveal_time() { + return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 7) as dependency_3.google.protobuf.Timestamp; + } + set reveal_time(value: dependency_3.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 7, value); + } + get reveal_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin; + } + set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 8, value); + } + get bid_amount() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; + } + set bid_amount(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 9, value); + } + static fromObject(data: { + auction_id?: string; + bidder_address?: string; + status?: string; + commit_hash?: string; + commit_time?: ReturnType; + commit_fee?: ReturnType; + reveal_time?: ReturnType; + reveal_fee?: ReturnType; + bid_amount?: ReturnType; + }) { + const message = new Bid({}); + if (data.auction_id != null) { + message.auction_id = data.auction_id; + } + if (data.bidder_address != null) { + message.bidder_address = data.bidder_address; + } + if (data.status != null) { + message.status = data.status; + } + if (data.commit_hash != null) { + message.commit_hash = data.commit_hash; + } + if (data.commit_time != null) { + message.commit_time = dependency_3.google.protobuf.Timestamp.fromObject(data.commit_time); + } + if (data.commit_fee != null) { + message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee); + } + if (data.reveal_time != null) { + message.reveal_time = dependency_3.google.protobuf.Timestamp.fromObject(data.reveal_time); + } + if (data.reveal_fee != null) { + message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee); + } + if (data.bid_amount != null) { + message.bid_amount = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.bid_amount); + } + return message; + } + toObject() { + const data: { + auction_id?: string; + bidder_address?: string; + status?: string; + commit_hash?: string; + commit_time?: ReturnType; + commit_fee?: ReturnType; + reveal_time?: ReturnType; + reveal_fee?: ReturnType; + bid_amount?: ReturnType; + } = {}; + if (this.auction_id != null) { + data.auction_id = this.auction_id; + } + if (this.bidder_address != null) { + data.bidder_address = this.bidder_address; + } + if (this.status != null) { + data.status = this.status; + } + if (this.commit_hash != null) { + data.commit_hash = this.commit_hash; + } + if (this.commit_time != null) { + data.commit_time = this.commit_time.toObject(); + } + if (this.commit_fee != null) { + data.commit_fee = this.commit_fee.toObject(); + } + if (this.reveal_time != null) { + data.reveal_time = this.reveal_time.toObject(); + } + if (this.reveal_fee != null) { + data.reveal_fee = this.reveal_fee.toObject(); + } + if (this.bid_amount != null) { + data.bid_amount = this.bid_amount.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.auction_id === "string" && this.auction_id.length) + writer.writeString(1, this.auction_id); + if (typeof this.bidder_address === "string" && this.bidder_address.length) + writer.writeString(2, this.bidder_address); + if (typeof this.status === "string" && this.status.length) + writer.writeString(3, this.status); + if (typeof this.commit_hash === "string" && this.commit_hash.length) + writer.writeString(4, this.commit_hash); + if (this.commit_time !== undefined) + writer.writeMessage(5, this.commit_time, () => this.commit_time.serialize(writer)); + if (this.commit_fee !== undefined) + writer.writeMessage(6, this.commit_fee, () => this.commit_fee.serialize(writer)); + if (this.reveal_time !== undefined) + writer.writeMessage(7, this.reveal_time, () => this.reveal_time.serialize(writer)); + if (this.reveal_fee !== undefined) + writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer)); + if (this.bid_amount !== undefined) + writer.writeMessage(9, this.bid_amount, () => this.bid_amount.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Bid { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Bid(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.auction_id = reader.readString(); + break; + case 2: + message.bidder_address = reader.readString(); + break; + case 3: + message.status = reader.readString(); + break; + case 4: + message.commit_hash = reader.readString(); + break; + case 5: + reader.readMessage(message.commit_time, () => message.commit_time = dependency_3.google.protobuf.Timestamp.deserialize(reader)); + break; + case 6: + reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 7: + reader.readMessage(message.reveal_time, () => message.reveal_time = dependency_3.google.protobuf.Timestamp.deserialize(reader)); + break; + case 8: + reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 9: + reader.readMessage(message.bid_amount, () => message.bid_amount = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Bid { + return Bid.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/bond/v1beta1/bond.ts b/src/proto/vulcanize/bond/v1beta1/bond.ts new file mode 100644 index 0000000..099c0e2 --- /dev/null +++ b/src/proto/vulcanize/bond/v1beta1/bond.ts @@ -0,0 +1,190 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/bond/v1beta1/bond.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.bond.v1beta1 { + export class Params extends pb_1.Message { + constructor(data?: any[] | { + max_bond_amount?: dependency_2.cosmos.base.v1beta1.Coin; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("max_bond_amount" in data && data.max_bond_amount != undefined) { + this.max_bond_amount = data.max_bond_amount; + } + } + } + get max_bond_amount() { + return pb_1.Message.getWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 1) as dependency_2.cosmos.base.v1beta1.Coin; + } + set max_bond_amount(value: dependency_2.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + max_bond_amount?: ReturnType; + }) { + const message = new Params({}); + if (data.max_bond_amount != null) { + message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.fromObject(data.max_bond_amount); + } + return message; + } + toObject() { + const data: { + max_bond_amount?: ReturnType; + } = {}; + if (this.max_bond_amount != null) { + data.max_bond_amount = this.max_bond_amount.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.max_bond_amount !== undefined) + writer.writeMessage(1, this.max_bond_amount, () => this.max_bond_amount.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.max_bond_amount, () => message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Params { + return Params.deserialize(bytes); + } + } + export class Bond extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + owner?: string; + balance?: dependency_2.cosmos.base.v1beta1.Coin[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("owner" in data && data.owner != undefined) { + this.owner = data.owner; + } + if ("balance" in data && data.balance != undefined) { + this.balance = data.balance; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get owner() { + return pb_1.Message.getField(this, 2) as string; + } + set owner(value: string) { + pb_1.Message.setField(this, 2, value); + } + get balance() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3) as dependency_2.cosmos.base.v1beta1.Coin[]; + } + set balance(value: dependency_2.cosmos.base.v1beta1.Coin[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + id?: string; + owner?: string; + balance?: ReturnType[]; + }) { + const message = new Bond({}); + if (data.id != null) { + message.id = data.id; + } + if (data.owner != null) { + message.owner = data.owner; + } + if (data.balance != null) { + message.balance = data.balance.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item)); + } + return message; + } + toObject() { + const data: { + id?: string; + owner?: string; + balance?: ReturnType[]; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.owner != null) { + data.owner = this.owner; + } + if (this.balance != null) { + data.balance = this.balance.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (typeof this.owner === "string" && this.owner.length) + writer.writeString(2, this.owner); + if (this.balance !== undefined) + writer.writeRepeatedMessage(3, this.balance, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Bond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Bond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.owner = reader.readString(); + break; + case 3: + reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Bond { + return Bond.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/bond/v1beta1/genesis.ts b/src/proto/vulcanize/bond/v1beta1/genesis.ts new file mode 100644 index 0000000..e930dba --- /dev/null +++ b/src/proto/vulcanize/bond/v1beta1/genesis.ts @@ -0,0 +1,101 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/bond/v1beta1/genesis.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./bond"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.bond.v1beta1 { + export class GenesisState extends pb_1.Message { + constructor(data?: any[] | { + params?: dependency_2.vulcanize.bond.v1beta1.Params; + bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + if ("bonds" in data && data.bonds != undefined) { + this.bonds = data.bonds; + } + } + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Params, 1) as dependency_2.vulcanize.bond.v1beta1.Params; + } + set params(value: dependency_2.vulcanize.bond.v1beta1.Params) { + pb_1.Message.setWrapperField(this, 1, value); + } + get bonds() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 2) as dependency_2.vulcanize.bond.v1beta1.Bond[]; + } + set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + params?: ReturnType; + bonds?: ReturnType[]; + }) { + const message = new GenesisState({}); + if (data.params != null) { + message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params); + } + if (data.bonds != null) { + message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item)); + } + return message; + } + toObject() { + const data: { + params?: ReturnType; + bonds?: ReturnType[]; + } = {}; + if (this.params != null) { + data.params = this.params.toObject(); + } + if (this.bonds != null) { + data.bonds = this.bonds.map((item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.params !== undefined) + writer.writeMessage(1, this.params, () => this.params.serialize(writer)); + if (this.bonds !== undefined) + writer.writeRepeatedMessage(2, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.bond.v1beta1.Params.deserialize(reader)); + break; + case 2: + reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GenesisState { + return GenesisState.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/bond/v1beta1/query.ts b/src/proto/vulcanize/bond/v1beta1/query.ts new file mode 100644 index 0000000..c12adb2 --- /dev/null +++ b/src/proto/vulcanize/bond/v1beta1/query.ts @@ -0,0 +1,690 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/bond/v1beta1/query.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./bond"; +import * as dependency_3 from "./../../../google/api/annotations"; +import * as dependency_4 from "./../../../cosmos/base/query/v1beta1/pagination"; +import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.bond.v1beta1 { + export class QueryParamsRequest extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new QueryParamsRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsRequest { + return QueryParamsRequest.deserialize(bytes); + } + } + export class QueryParamsResponse extends pb_1.Message { + constructor(data?: any[] | { + params?: dependency_2.vulcanize.bond.v1beta1.Params; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + } + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Params, 1) as dependency_2.vulcanize.bond.v1beta1.Params; + } + set params(value: dependency_2.vulcanize.bond.v1beta1.Params) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + params?: ReturnType; + }) { + const message = new QueryParamsResponse({}); + if (data.params != null) { + message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params); + } + return message; + } + toObject() { + const data: { + params?: ReturnType; + } = {}; + if (this.params != null) { + data.params = this.params.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.params !== undefined) + writer.writeMessage(1, this.params, () => this.params.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.bond.v1beta1.Params.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsResponse { + return QueryParamsResponse.deserialize(bytes); + } + } + export class QueryGetBondsRequest extends pb_1.Message { + constructor(data?: any[] | { + pagination?: dependency_4.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_4.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + pagination?: ReturnType; + }) { + const message = new QueryGetBondsRequest({}); + if (data.pagination != null) { + message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + pagination?: ReturnType; + } = {}; + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.pagination !== undefined) + writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondsRequest { + return QueryGetBondsRequest.deserialize(bytes); + } + } + export class QueryGetBondsResponse extends pb_1.Message { + constructor(data?: any[] | { + bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; + pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bonds" in data && data.bonds != undefined) { + this.bonds = data.bonds; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get bonds() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1) as dependency_2.vulcanize.bond.v1beta1.Bond[]; + } + set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_4.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + bonds?: ReturnType[]; + pagination?: ReturnType; + }) { + const message = new QueryGetBondsResponse({}); + if (data.bonds != null) { + message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + bonds?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.bonds != null) { + data.bonds = this.bonds.map((item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.bonds !== undefined) + writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondsResponse { + return QueryGetBondsResponse.deserialize(bytes); + } + } + export class QueryGetBondByIdRequest extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + id?: string; + }) { + const message = new QueryGetBondByIdRequest({}); + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + id?: string; + } = {}; + if (this.id != null) { + data.id = this.id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondByIdRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondByIdRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondByIdRequest { + return QueryGetBondByIdRequest.deserialize(bytes); + } + } + export class QueryGetBondByIdResponse extends pb_1.Message { + constructor(data?: any[] | { + bond?: dependency_2.vulcanize.bond.v1beta1.Bond; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bond" in data && data.bond != undefined) { + this.bond = data.bond; + } + } + } + get bond() { + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1) as dependency_2.vulcanize.bond.v1beta1.Bond; + } + set bond(value: dependency_2.vulcanize.bond.v1beta1.Bond) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + bond?: ReturnType; + }) { + const message = new QueryGetBondByIdResponse({}); + if (data.bond != null) { + message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(data.bond); + } + return message; + } + toObject() { + const data: { + bond?: ReturnType; + } = {}; + if (this.bond != null) { + data.bond = this.bond.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.bond !== undefined) + writer.writeMessage(1, this.bond, () => this.bond.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondByIdResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondByIdResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.bond, () => message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondByIdResponse { + return QueryGetBondByIdResponse.deserialize(bytes); + } + } + export class QueryGetBondsByOwnerRequest extends pb_1.Message { + constructor(data?: any[] | { + owner?: string; + pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("owner" in data && data.owner != undefined) { + this.owner = data.owner; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get owner() { + return pb_1.Message.getField(this, 1) as string; + } + set owner(value: string) { + pb_1.Message.setField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_4.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + owner?: string; + pagination?: ReturnType; + }) { + const message = new QueryGetBondsByOwnerRequest({}); + if (data.owner != null) { + message.owner = data.owner; + } + if (data.pagination != null) { + message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + owner?: string; + pagination?: ReturnType; + } = {}; + if (this.owner != null) { + data.owner = this.owner; + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.owner === "string" && this.owner.length) + writer.writeString(1, this.owner); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsByOwnerRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsByOwnerRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.owner = reader.readString(); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondsByOwnerRequest { + return QueryGetBondsByOwnerRequest.deserialize(bytes); + } + } + export class QueryGetBondsByOwnerResponse extends pb_1.Message { + constructor(data?: any[] | { + bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; + pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bonds" in data && data.bonds != undefined) { + this.bonds = data.bonds; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get bonds() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1) as dependency_2.vulcanize.bond.v1beta1.Bond[]; + } + set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_4.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + bonds?: ReturnType[]; + pagination?: ReturnType; + }) { + const message = new QueryGetBondsByOwnerResponse({}); + if (data.bonds != null) { + message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + bonds?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.bonds != null) { + data.bonds = this.bonds.map((item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.bonds !== undefined) + writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsByOwnerResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsByOwnerResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondsByOwnerResponse { + return QueryGetBondsByOwnerResponse.deserialize(bytes); + } + } + export class QueryGetBondModuleBalanceRequest extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new QueryGetBondModuleBalanceRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondModuleBalanceRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondModuleBalanceRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondModuleBalanceRequest { + return QueryGetBondModuleBalanceRequest.deserialize(bytes); + } + } + export class QueryGetBondModuleBalanceResponse extends pb_1.Message { + constructor(data?: any[] | { + balance?: dependency_5.cosmos.base.v1beta1.Coin[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("balance" in data && data.balance != undefined) { + this.balance = data.balance; + } + } + } + get balance() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_5.cosmos.base.v1beta1.Coin, 2) as dependency_5.cosmos.base.v1beta1.Coin[]; + } + set balance(value: dependency_5.cosmos.base.v1beta1.Coin[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + balance?: ReturnType[]; + }) { + const message = new QueryGetBondModuleBalanceResponse({}); + if (data.balance != null) { + message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item)); + } + return message; + } + toObject() { + const data: { + balance?: ReturnType[]; + } = {}; + if (this.balance != null) { + data.balance = this.balance.map((item: dependency_5.cosmos.base.v1beta1.Coin) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.balance !== undefined) + writer.writeRepeatedMessage(2, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondModuleBalanceResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondModuleBalanceResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 2: + reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_5.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_5.cosmos.base.v1beta1.Coin)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetBondModuleBalanceResponse { + return QueryGetBondModuleBalanceResponse.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/bond/v1beta1/tx.ts b/src/proto/vulcanize/bond/v1beta1/tx.ts new file mode 100644 index 0000000..2931056 --- /dev/null +++ b/src/proto/vulcanize/bond/v1beta1/tx.ts @@ -0,0 +1,597 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/bond/v1beta1/tx.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.bond.v1beta1 { + export class MsgCreateBond extends pb_1.Message { + constructor(data?: any[] | { + signer?: string; + coins?: dependency_2.cosmos.base.v1beta1.Coin[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + if ("coins" in data && data.coins != undefined) { + this.coins = data.coins; + } + } + } + get signer() { + return pb_1.Message.getField(this, 1) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 1, value); + } + get coins() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 2) as dependency_2.cosmos.base.v1beta1.Coin[]; + } + set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + signer?: string; + coins?: ReturnType[]; + }) { + const message = new MsgCreateBond({}); + if (data.signer != null) { + message.signer = data.signer; + } + if (data.coins != null) { + message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item)); + } + return message; + } + toObject() { + const data: { + signer?: string; + coins?: ReturnType[]; + } = {}; + if (this.signer != null) { + data.signer = this.signer; + } + if (this.coins != null) { + data.coins = this.coins.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(1, this.signer); + if (this.coins !== undefined) + writer.writeRepeatedMessage(2, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateBond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateBond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.signer = reader.readString(); + break; + case 2: + reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCreateBond { + return MsgCreateBond.deserialize(bytes); + } + } + export class MsgCreateBondResponse extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + id?: string; + }) { + const message = new MsgCreateBondResponse({}); + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + id?: string; + } = {}; + if (this.id != null) { + data.id = this.id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateBondResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateBondResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCreateBondResponse { + return MsgCreateBondResponse.deserialize(bytes); + } + } + export class MsgRefillBond extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + signer?: string; + coins?: dependency_2.cosmos.base.v1beta1.Coin[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + if ("coins" in data && data.coins != undefined) { + this.coins = data.coins; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + get coins() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3) as dependency_2.cosmos.base.v1beta1.Coin[]; + } + set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + id?: string; + signer?: string; + coins?: ReturnType[]; + }) { + const message = new MsgRefillBond({}); + if (data.id != null) { + message.id = data.id; + } + if (data.signer != null) { + message.signer = data.signer; + } + if (data.coins != null) { + message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item)); + } + return message; + } + toObject() { + const data: { + id?: string; + signer?: string; + coins?: ReturnType[]; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.signer != null) { + data.signer = this.signer; + } + if (this.coins != null) { + data.coins = this.coins.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (this.coins !== undefined) + writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRefillBond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRefillBond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + case 3: + reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgRefillBond { + return MsgRefillBond.deserialize(bytes); + } + } + export class MsgRefillBondResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgRefillBondResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRefillBondResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRefillBondResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgRefillBondResponse { + return MsgRefillBondResponse.deserialize(bytes); + } + } + export class MsgWithdrawBond extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + signer?: string; + coins?: dependency_2.cosmos.base.v1beta1.Coin[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + if ("coins" in data && data.coins != undefined) { + this.coins = data.coins; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + get coins() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3) as dependency_2.cosmos.base.v1beta1.Coin[]; + } + set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + id?: string; + signer?: string; + coins?: ReturnType[]; + }) { + const message = new MsgWithdrawBond({}); + if (data.id != null) { + message.id = data.id; + } + if (data.signer != null) { + message.signer = data.signer; + } + if (data.coins != null) { + message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item)); + } + return message; + } + toObject() { + const data: { + id?: string; + signer?: string; + coins?: ReturnType[]; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.signer != null) { + data.signer = this.signer; + } + if (this.coins != null) { + data.coins = this.coins.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (this.coins !== undefined) + writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgWithdrawBond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgWithdrawBond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + case 3: + reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgWithdrawBond { + return MsgWithdrawBond.deserialize(bytes); + } + } + export class MsgWithdrawBondResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgWithdrawBondResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgWithdrawBondResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgWithdrawBondResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgWithdrawBondResponse { + return MsgWithdrawBondResponse.deserialize(bytes); + } + } + export class MsgCancelBond extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + id?: string; + signer?: string; + }) { + const message = new MsgCancelBond({}); + if (data.id != null) { + message.id = data.id; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + id?: string; + signer?: string; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCancelBond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCancelBond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCancelBond { + return MsgCancelBond.deserialize(bytes); + } + } + export class MsgCancelBondResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgCancelBondResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCancelBondResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCancelBondResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgCancelBondResponse { + return MsgCancelBondResponse.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/nameservice/v1beta1/genesis.ts b/src/proto/vulcanize/nameservice/v1beta1/genesis.ts new file mode 100644 index 0000000..f84b8eb --- /dev/null +++ b/src/proto/vulcanize/nameservice/v1beta1/genesis.ts @@ -0,0 +1,147 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/nameservice/v1beta1/genesis.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./nameservice"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.nameservice.v1beta1 { + export class GenesisState extends pb_1.Message { + constructor(data?: any[] | { + params?: dependency_2.vulcanize.nameservice.v1beta1.Params; + records?: dependency_2.vulcanize.nameservice.v1beta1.Record[]; + authorities?: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]; + names?: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + if ("records" in data && data.records != undefined) { + this.records = data.records; + } + if ("authorities" in data && data.authorities != undefined) { + this.authorities = data.authorities; + } + if ("names" in data && data.names != undefined) { + this.names = data.names; + } + } + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Params, 1) as dependency_2.vulcanize.nameservice.v1beta1.Params; + } + set params(value: dependency_2.vulcanize.nameservice.v1beta1.Params) { + pb_1.Message.setWrapperField(this, 1, value); + } + get records() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 2) as dependency_2.vulcanize.nameservice.v1beta1.Record[]; + } + set records(value: dependency_2.vulcanize.nameservice.v1beta1.Record[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get authorities() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry, 3) as dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]; + } + set authorities(value: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + get names() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.NameEntry, 4) as dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]; + } + set names(value: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + static fromObject(data: { + params?: ReturnType; + records?: ReturnType[]; + authorities?: ReturnType[]; + names?: ReturnType[]; + }) { + const message = new GenesisState({}); + if (data.params != null) { + message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.fromObject(data.params); + } + if (data.records != null) { + message.records = data.records.map(item => dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(item)); + } + if (data.authorities != null) { + message.authorities = data.authorities.map(item => dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.fromObject(item)); + } + if (data.names != null) { + message.names = data.names.map(item => dependency_2.vulcanize.nameservice.v1beta1.NameEntry.fromObject(item)); + } + return message; + } + toObject() { + const data: { + params?: ReturnType; + records?: ReturnType[]; + authorities?: ReturnType[]; + names?: ReturnType[]; + } = {}; + if (this.params != null) { + data.params = this.params.toObject(); + } + if (this.records != null) { + data.records = this.records.map((item: dependency_2.vulcanize.nameservice.v1beta1.Record) => item.toObject()); + } + if (this.authorities != null) { + data.authorities = this.authorities.map((item: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry) => item.toObject()); + } + if (this.names != null) { + data.names = this.names.map((item: dependency_2.vulcanize.nameservice.v1beta1.NameEntry) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.params !== undefined) + writer.writeMessage(1, this.params, () => this.params.serialize(writer)); + if (this.records !== undefined) + writer.writeRepeatedMessage(2, this.records, (item: dependency_2.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); + if (this.authorities !== undefined) + writer.writeRepeatedMessage(3, this.authorities, (item: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry) => item.serialize(writer)); + if (this.names !== undefined) + writer.writeRepeatedMessage(4, this.names, (item: dependency_2.vulcanize.nameservice.v1beta1.NameEntry) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.deserialize(reader)); + break; + case 2: + reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.Record)); + break; + case 3: + reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry)); + break; + case 4: + reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_2.vulcanize.nameservice.v1beta1.NameEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.NameEntry)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GenesisState { + return GenesisState.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts b/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts new file mode 100644 index 0000000..5fc55df --- /dev/null +++ b/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts @@ -0,0 +1,1433 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/nameservice/v1beta1/nameservice.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../google/protobuf/duration"; +import * as dependency_2 from "./../../../google/protobuf/timestamp"; +import * as dependency_3 from "./../../../gogoproto/gogo"; +import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.nameservice.v1beta1 { + export class Params extends pb_1.Message { + constructor(data?: any[] | { + record_rent?: dependency_4.cosmos.base.v1beta1.Coin; + record_rent_duration?: dependency_1.google.protobuf.Duration; + authority_rent?: dependency_4.cosmos.base.v1beta1.Coin; + authority_rent_duration?: dependency_1.google.protobuf.Duration; + authority_grace_period?: dependency_1.google.protobuf.Duration; + authority_auction_enabled?: boolean; + authority_auction_commits_duration?: dependency_1.google.protobuf.Duration; + authority_auction_reveals_duration?: dependency_1.google.protobuf.Duration; + authority_auction_commit_fee?: dependency_4.cosmos.base.v1beta1.Coin; + authority_auction_reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin; + authority_auction_minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("record_rent" in data && data.record_rent != undefined) { + this.record_rent = data.record_rent; + } + if ("record_rent_duration" in data && data.record_rent_duration != undefined) { + this.record_rent_duration = data.record_rent_duration; + } + if ("authority_rent" in data && data.authority_rent != undefined) { + this.authority_rent = data.authority_rent; + } + if ("authority_rent_duration" in data && data.authority_rent_duration != undefined) { + this.authority_rent_duration = data.authority_rent_duration; + } + if ("authority_grace_period" in data && data.authority_grace_period != undefined) { + this.authority_grace_period = data.authority_grace_period; + } + if ("authority_auction_enabled" in data && data.authority_auction_enabled != undefined) { + this.authority_auction_enabled = data.authority_auction_enabled; + } + if ("authority_auction_commits_duration" in data && data.authority_auction_commits_duration != undefined) { + this.authority_auction_commits_duration = data.authority_auction_commits_duration; + } + if ("authority_auction_reveals_duration" in data && data.authority_auction_reveals_duration != undefined) { + this.authority_auction_reveals_duration = data.authority_auction_reveals_duration; + } + if ("authority_auction_commit_fee" in data && data.authority_auction_commit_fee != undefined) { + this.authority_auction_commit_fee = data.authority_auction_commit_fee; + } + if ("authority_auction_reveal_fee" in data && data.authority_auction_reveal_fee != undefined) { + this.authority_auction_reveal_fee = data.authority_auction_reveal_fee; + } + if ("authority_auction_minimum_bid" in data && data.authority_auction_minimum_bid != undefined) { + this.authority_auction_minimum_bid = data.authority_auction_minimum_bid; + } + } + } + get record_rent() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 1) as dependency_4.cosmos.base.v1beta1.Coin; + } + set record_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 1, value); + } + get record_rent_duration() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 2) as dependency_1.google.protobuf.Duration; + } + set record_rent_duration(value: dependency_1.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 2, value); + } + get authority_rent() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin; + } + set authority_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 3, value); + } + get authority_rent_duration() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 4) as dependency_1.google.protobuf.Duration; + } + set authority_rent_duration(value: dependency_1.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 4, value); + } + get authority_grace_period() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 5) as dependency_1.google.protobuf.Duration; + } + set authority_grace_period(value: dependency_1.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 5, value); + } + get authority_auction_enabled() { + return pb_1.Message.getField(this, 6) as boolean; + } + set authority_auction_enabled(value: boolean) { + pb_1.Message.setField(this, 6, value); + } + get authority_auction_commits_duration() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 7) as dependency_1.google.protobuf.Duration; + } + set authority_auction_commits_duration(value: dependency_1.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 7, value); + } + get authority_auction_reveals_duration() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 8) as dependency_1.google.protobuf.Duration; + } + set authority_auction_reveals_duration(value: dependency_1.google.protobuf.Duration) { + pb_1.Message.setWrapperField(this, 8, value); + } + get authority_auction_commit_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; + } + set authority_auction_commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 9, value); + } + get authority_auction_reveal_fee() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 10) as dependency_4.cosmos.base.v1beta1.Coin; + } + set authority_auction_reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 10, value); + } + get authority_auction_minimum_bid() { + return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11) as dependency_4.cosmos.base.v1beta1.Coin; + } + set authority_auction_minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { + pb_1.Message.setWrapperField(this, 11, value); + } + static fromObject(data: { + record_rent?: ReturnType; + record_rent_duration?: ReturnType; + authority_rent?: ReturnType; + authority_rent_duration?: ReturnType; + authority_grace_period?: ReturnType; + authority_auction_enabled?: boolean; + authority_auction_commits_duration?: ReturnType; + authority_auction_reveals_duration?: ReturnType; + authority_auction_commit_fee?: ReturnType; + authority_auction_reveal_fee?: ReturnType; + authority_auction_minimum_bid?: ReturnType; + }) { + const message = new Params({}); + if (data.record_rent != null) { + message.record_rent = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.record_rent); + } + if (data.record_rent_duration != null) { + message.record_rent_duration = dependency_1.google.protobuf.Duration.fromObject(data.record_rent_duration); + } + if (data.authority_rent != null) { + message.authority_rent = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_rent); + } + if (data.authority_rent_duration != null) { + message.authority_rent_duration = dependency_1.google.protobuf.Duration.fromObject(data.authority_rent_duration); + } + if (data.authority_grace_period != null) { + message.authority_grace_period = dependency_1.google.protobuf.Duration.fromObject(data.authority_grace_period); + } + if (data.authority_auction_enabled != null) { + message.authority_auction_enabled = data.authority_auction_enabled; + } + if (data.authority_auction_commits_duration != null) { + message.authority_auction_commits_duration = dependency_1.google.protobuf.Duration.fromObject(data.authority_auction_commits_duration); + } + if (data.authority_auction_reveals_duration != null) { + message.authority_auction_reveals_duration = dependency_1.google.protobuf.Duration.fromObject(data.authority_auction_reveals_duration); + } + if (data.authority_auction_commit_fee != null) { + message.authority_auction_commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_auction_commit_fee); + } + if (data.authority_auction_reveal_fee != null) { + message.authority_auction_reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_auction_reveal_fee); + } + if (data.authority_auction_minimum_bid != null) { + message.authority_auction_minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_auction_minimum_bid); + } + return message; + } + toObject() { + const data: { + record_rent?: ReturnType; + record_rent_duration?: ReturnType; + authority_rent?: ReturnType; + authority_rent_duration?: ReturnType; + authority_grace_period?: ReturnType; + authority_auction_enabled?: boolean; + authority_auction_commits_duration?: ReturnType; + authority_auction_reveals_duration?: ReturnType; + authority_auction_commit_fee?: ReturnType; + authority_auction_reveal_fee?: ReturnType; + authority_auction_minimum_bid?: ReturnType; + } = {}; + if (this.record_rent != null) { + data.record_rent = this.record_rent.toObject(); + } + if (this.record_rent_duration != null) { + data.record_rent_duration = this.record_rent_duration.toObject(); + } + if (this.authority_rent != null) { + data.authority_rent = this.authority_rent.toObject(); + } + if (this.authority_rent_duration != null) { + data.authority_rent_duration = this.authority_rent_duration.toObject(); + } + if (this.authority_grace_period != null) { + data.authority_grace_period = this.authority_grace_period.toObject(); + } + if (this.authority_auction_enabled != null) { + data.authority_auction_enabled = this.authority_auction_enabled; + } + if (this.authority_auction_commits_duration != null) { + data.authority_auction_commits_duration = this.authority_auction_commits_duration.toObject(); + } + if (this.authority_auction_reveals_duration != null) { + data.authority_auction_reveals_duration = this.authority_auction_reveals_duration.toObject(); + } + if (this.authority_auction_commit_fee != null) { + data.authority_auction_commit_fee = this.authority_auction_commit_fee.toObject(); + } + if (this.authority_auction_reveal_fee != null) { + data.authority_auction_reveal_fee = this.authority_auction_reveal_fee.toObject(); + } + if (this.authority_auction_minimum_bid != null) { + data.authority_auction_minimum_bid = this.authority_auction_minimum_bid.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.record_rent !== undefined) + writer.writeMessage(1, this.record_rent, () => this.record_rent.serialize(writer)); + if (this.record_rent_duration !== undefined) + writer.writeMessage(2, this.record_rent_duration, () => this.record_rent_duration.serialize(writer)); + if (this.authority_rent !== undefined) + writer.writeMessage(3, this.authority_rent, () => this.authority_rent.serialize(writer)); + if (this.authority_rent_duration !== undefined) + writer.writeMessage(4, this.authority_rent_duration, () => this.authority_rent_duration.serialize(writer)); + if (this.authority_grace_period !== undefined) + writer.writeMessage(5, this.authority_grace_period, () => this.authority_grace_period.serialize(writer)); + if (this.authority_auction_enabled !== undefined) + writer.writeBool(6, this.authority_auction_enabled); + if (this.authority_auction_commits_duration !== undefined) + writer.writeMessage(7, this.authority_auction_commits_duration, () => this.authority_auction_commits_duration.serialize(writer)); + if (this.authority_auction_reveals_duration !== undefined) + writer.writeMessage(8, this.authority_auction_reveals_duration, () => this.authority_auction_reveals_duration.serialize(writer)); + if (this.authority_auction_commit_fee !== undefined) + writer.writeMessage(9, this.authority_auction_commit_fee, () => this.authority_auction_commit_fee.serialize(writer)); + if (this.authority_auction_reveal_fee !== undefined) + writer.writeMessage(10, this.authority_auction_reveal_fee, () => this.authority_auction_reveal_fee.serialize(writer)); + if (this.authority_auction_minimum_bid !== undefined) + writer.writeMessage(11, this.authority_auction_minimum_bid, () => this.authority_auction_minimum_bid.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.record_rent, () => message.record_rent = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 2: + reader.readMessage(message.record_rent_duration, () => message.record_rent_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); + break; + case 3: + reader.readMessage(message.authority_rent, () => message.authority_rent = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 4: + reader.readMessage(message.authority_rent_duration, () => message.authority_rent_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); + break; + case 5: + reader.readMessage(message.authority_grace_period, () => message.authority_grace_period = dependency_1.google.protobuf.Duration.deserialize(reader)); + break; + case 6: + message.authority_auction_enabled = reader.readBool(); + break; + case 7: + reader.readMessage(message.authority_auction_commits_duration, () => message.authority_auction_commits_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); + break; + case 8: + reader.readMessage(message.authority_auction_reveals_duration, () => message.authority_auction_reveals_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); + break; + case 9: + reader.readMessage(message.authority_auction_commit_fee, () => message.authority_auction_commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 10: + reader.readMessage(message.authority_auction_reveal_fee, () => message.authority_auction_reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + case 11: + reader.readMessage(message.authority_auction_minimum_bid, () => message.authority_auction_minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Params { + return Params.deserialize(bytes); + } + } + export class Record extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + bond_id?: string; + create_time?: dependency_2.google.protobuf.Timestamp; + expiry_time?: dependency_2.google.protobuf.Timestamp; + deleted?: boolean; + owners?: string[]; + attributes?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("bond_id" in data && data.bond_id != undefined) { + this.bond_id = data.bond_id; + } + if ("create_time" in data && data.create_time != undefined) { + this.create_time = data.create_time; + } + if ("expiry_time" in data && data.expiry_time != undefined) { + this.expiry_time = data.expiry_time; + } + if ("deleted" in data && data.deleted != undefined) { + this.deleted = data.deleted; + } + if ("owners" in data && data.owners != undefined) { + this.owners = data.owners; + } + if ("attributes" in data && data.attributes != undefined) { + this.attributes = data.attributes; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get bond_id() { + return pb_1.Message.getField(this, 2) as string; + } + set bond_id(value: string) { + pb_1.Message.setField(this, 2, value); + } + get create_time() { + return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Timestamp, 3) as dependency_2.google.protobuf.Timestamp; + } + set create_time(value: dependency_2.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 3, value); + } + get expiry_time() { + return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Timestamp, 4) as dependency_2.google.protobuf.Timestamp; + } + set expiry_time(value: dependency_2.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 4, value); + } + get deleted() { + return pb_1.Message.getField(this, 5) as boolean; + } + set deleted(value: boolean) { + pb_1.Message.setField(this, 5, value); + } + get owners() { + return pb_1.Message.getField(this, 6) as string[]; + } + set owners(value: string[]) { + pb_1.Message.setField(this, 6, value); + } + get attributes() { + return pb_1.Message.getField(this, 7) as Uint8Array; + } + set attributes(value: Uint8Array) { + pb_1.Message.setField(this, 7, value); + } + static fromObject(data: { + id?: string; + bond_id?: string; + create_time?: ReturnType; + expiry_time?: ReturnType; + deleted?: boolean; + owners?: string[]; + attributes?: Uint8Array; + }) { + const message = new Record({}); + if (data.id != null) { + message.id = data.id; + } + if (data.bond_id != null) { + message.bond_id = data.bond_id; + } + if (data.create_time != null) { + message.create_time = dependency_2.google.protobuf.Timestamp.fromObject(data.create_time); + } + if (data.expiry_time != null) { + message.expiry_time = dependency_2.google.protobuf.Timestamp.fromObject(data.expiry_time); + } + if (data.deleted != null) { + message.deleted = data.deleted; + } + if (data.owners != null) { + message.owners = data.owners; + } + if (data.attributes != null) { + message.attributes = data.attributes; + } + return message; + } + toObject() { + const data: { + id?: string; + bond_id?: string; + create_time?: ReturnType; + expiry_time?: ReturnType; + deleted?: boolean; + owners?: string[]; + attributes?: Uint8Array; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.bond_id != null) { + data.bond_id = this.bond_id; + } + if (this.create_time != null) { + data.create_time = this.create_time.toObject(); + } + if (this.expiry_time != null) { + data.expiry_time = this.expiry_time.toObject(); + } + if (this.deleted != null) { + data.deleted = this.deleted; + } + if (this.owners != null) { + data.owners = this.owners; + } + if (this.attributes != null) { + data.attributes = this.attributes; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (typeof this.bond_id === "string" && this.bond_id.length) + writer.writeString(2, this.bond_id); + if (this.create_time !== undefined) + writer.writeMessage(3, this.create_time, () => this.create_time.serialize(writer)); + if (this.expiry_time !== undefined) + writer.writeMessage(4, this.expiry_time, () => this.expiry_time.serialize(writer)); + if (this.deleted !== undefined) + writer.writeBool(5, this.deleted); + if (this.owners !== undefined) + writer.writeRepeatedString(6, this.owners); + if (this.attributes !== undefined) + writer.writeBytes(7, this.attributes); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Record { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Record(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.bond_id = reader.readString(); + break; + case 3: + reader.readMessage(message.create_time, () => message.create_time = dependency_2.google.protobuf.Timestamp.deserialize(reader)); + break; + case 4: + reader.readMessage(message.expiry_time, () => message.expiry_time = dependency_2.google.protobuf.Timestamp.deserialize(reader)); + break; + case 5: + message.deleted = reader.readBool(); + break; + case 6: + pb_1.Message.addToRepeatedField(message, 6, reader.readString()); + break; + case 7: + message.attributes = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Record { + return Record.deserialize(bytes); + } + } + export class AuthorityEntry extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + entry?: NameAuthority; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("entry" in data && data.entry != undefined) { + this.entry = data.entry; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get entry() { + return pb_1.Message.getWrapperField(this, NameAuthority, 2) as NameAuthority; + } + set entry(value: NameAuthority) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + name?: string; + entry?: ReturnType; + }) { + const message = new AuthorityEntry({}); + if (data.name != null) { + message.name = data.name; + } + if (data.entry != null) { + message.entry = NameAuthority.fromObject(data.entry); + } + return message; + } + toObject() { + const data: { + name?: string; + entry?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.entry != null) { + data.entry = this.entry.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.entry !== undefined) + writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuthorityEntry { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuthorityEntry(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage(message.entry, () => message.entry = NameAuthority.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuthorityEntry { + return AuthorityEntry.deserialize(bytes); + } + } + export class NameAuthority extends pb_1.Message { + constructor(data?: any[] | { + owner_public_key?: string; + owner_address?: string; + height?: number; + status?: string; + auction_id?: string; + bond_id?: string; + expiry_time?: dependency_2.google.protobuf.Timestamp; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("owner_public_key" in data && data.owner_public_key != undefined) { + this.owner_public_key = data.owner_public_key; + } + if ("owner_address" in data && data.owner_address != undefined) { + this.owner_address = data.owner_address; + } + if ("height" in data && data.height != undefined) { + this.height = data.height; + } + if ("status" in data && data.status != undefined) { + this.status = data.status; + } + if ("auction_id" in data && data.auction_id != undefined) { + this.auction_id = data.auction_id; + } + if ("bond_id" in data && data.bond_id != undefined) { + this.bond_id = data.bond_id; + } + if ("expiry_time" in data && data.expiry_time != undefined) { + this.expiry_time = data.expiry_time; + } + } + } + get owner_public_key() { + return pb_1.Message.getField(this, 1) as string; + } + set owner_public_key(value: string) { + pb_1.Message.setField(this, 1, value); + } + get owner_address() { + return pb_1.Message.getField(this, 2) as string; + } + set owner_address(value: string) { + pb_1.Message.setField(this, 2, value); + } + get height() { + return pb_1.Message.getField(this, 3) as number; + } + set height(value: number) { + pb_1.Message.setField(this, 3, value); + } + get status() { + return pb_1.Message.getField(this, 4) as string; + } + set status(value: string) { + pb_1.Message.setField(this, 4, value); + } + get auction_id() { + return pb_1.Message.getField(this, 5) as string; + } + set auction_id(value: string) { + pb_1.Message.setField(this, 5, value); + } + get bond_id() { + return pb_1.Message.getField(this, 6) as string; + } + set bond_id(value: string) { + pb_1.Message.setField(this, 6, value); + } + get expiry_time() { + return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Timestamp, 7) as dependency_2.google.protobuf.Timestamp; + } + set expiry_time(value: dependency_2.google.protobuf.Timestamp) { + pb_1.Message.setWrapperField(this, 7, value); + } + static fromObject(data: { + owner_public_key?: string; + owner_address?: string; + height?: number; + status?: string; + auction_id?: string; + bond_id?: string; + expiry_time?: ReturnType; + }) { + const message = new NameAuthority({}); + if (data.owner_public_key != null) { + message.owner_public_key = data.owner_public_key; + } + if (data.owner_address != null) { + message.owner_address = data.owner_address; + } + if (data.height != null) { + message.height = data.height; + } + if (data.status != null) { + message.status = data.status; + } + if (data.auction_id != null) { + message.auction_id = data.auction_id; + } + if (data.bond_id != null) { + message.bond_id = data.bond_id; + } + if (data.expiry_time != null) { + message.expiry_time = dependency_2.google.protobuf.Timestamp.fromObject(data.expiry_time); + } + return message; + } + toObject() { + const data: { + owner_public_key?: string; + owner_address?: string; + height?: number; + status?: string; + auction_id?: string; + bond_id?: string; + expiry_time?: ReturnType; + } = {}; + if (this.owner_public_key != null) { + data.owner_public_key = this.owner_public_key; + } + if (this.owner_address != null) { + data.owner_address = this.owner_address; + } + if (this.height != null) { + data.height = this.height; + } + if (this.status != null) { + data.status = this.status; + } + if (this.auction_id != null) { + data.auction_id = this.auction_id; + } + if (this.bond_id != null) { + data.bond_id = this.bond_id; + } + if (this.expiry_time != null) { + data.expiry_time = this.expiry_time.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.owner_public_key === "string" && this.owner_public_key.length) + writer.writeString(1, this.owner_public_key); + if (typeof this.owner_address === "string" && this.owner_address.length) + writer.writeString(2, this.owner_address); + if (this.height !== undefined) + writer.writeUint64(3, this.height); + if (typeof this.status === "string" && this.status.length) + writer.writeString(4, this.status); + if (typeof this.auction_id === "string" && this.auction_id.length) + writer.writeString(5, this.auction_id); + if (typeof this.bond_id === "string" && this.bond_id.length) + writer.writeString(6, this.bond_id); + if (this.expiry_time !== undefined) + writer.writeMessage(7, this.expiry_time, () => this.expiry_time.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameAuthority { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameAuthority(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.owner_public_key = reader.readString(); + break; + case 2: + message.owner_address = reader.readString(); + break; + case 3: + message.height = reader.readUint64(); + break; + case 4: + message.status = reader.readString(); + break; + case 5: + message.auction_id = reader.readString(); + break; + case 6: + message.bond_id = reader.readString(); + break; + case 7: + reader.readMessage(message.expiry_time, () => message.expiry_time = dependency_2.google.protobuf.Timestamp.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): NameAuthority { + return NameAuthority.deserialize(bytes); + } + } + export class NameEntry extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + entry?: NameRecord; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("entry" in data && data.entry != undefined) { + this.entry = data.entry; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get entry() { + return pb_1.Message.getWrapperField(this, NameRecord, 2) as NameRecord; + } + set entry(value: NameRecord) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + name?: string; + entry?: ReturnType; + }) { + const message = new NameEntry({}); + if (data.name != null) { + message.name = data.name; + } + if (data.entry != null) { + message.entry = NameRecord.fromObject(data.entry); + } + return message; + } + toObject() { + const data: { + name?: string; + entry?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.entry != null) { + data.entry = this.entry.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (this.entry !== undefined) + writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameEntry { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameEntry(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage(message.entry, () => message.entry = NameRecord.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): NameEntry { + return NameEntry.deserialize(bytes); + } + } + export class NameRecord extends pb_1.Message { + constructor(data?: any[] | { + latest?: NameRecordEntry; + history?: NameRecordEntry[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("latest" in data && data.latest != undefined) { + this.latest = data.latest; + } + if ("history" in data && data.history != undefined) { + this.history = data.history; + } + } + } + get latest() { + return pb_1.Message.getWrapperField(this, NameRecordEntry, 1) as NameRecordEntry; + } + set latest(value: NameRecordEntry) { + pb_1.Message.setWrapperField(this, 1, value); + } + get history() { + return pb_1.Message.getRepeatedWrapperField(this, NameRecordEntry, 2) as NameRecordEntry[]; + } + set history(value: NameRecordEntry[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + latest?: ReturnType; + history?: ReturnType[]; + }) { + const message = new NameRecord({}); + if (data.latest != null) { + message.latest = NameRecordEntry.fromObject(data.latest); + } + if (data.history != null) { + message.history = data.history.map(item => NameRecordEntry.fromObject(item)); + } + return message; + } + toObject() { + const data: { + latest?: ReturnType; + history?: ReturnType[]; + } = {}; + if (this.latest != null) { + data.latest = this.latest.toObject(); + } + if (this.history != null) { + data.history = this.history.map((item: NameRecordEntry) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.latest !== undefined) + writer.writeMessage(1, this.latest, () => this.latest.serialize(writer)); + if (this.history !== undefined) + writer.writeRepeatedMessage(2, this.history, (item: NameRecordEntry) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameRecord { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameRecord(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.latest, () => message.latest = NameRecordEntry.deserialize(reader)); + break; + case 2: + reader.readMessage(message.history, () => pb_1.Message.addToRepeatedWrapperField(message, 2, NameRecordEntry.deserialize(reader), NameRecordEntry)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): NameRecord { + return NameRecord.deserialize(bytes); + } + } + export class NameRecordEntry extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + height?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("height" in data && data.height != undefined) { + this.height = data.height; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get height() { + return pb_1.Message.getField(this, 2) as number; + } + set height(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + id?: string; + height?: number; + }) { + const message = new NameRecordEntry({}); + if (data.id != null) { + message.id = data.id; + } + if (data.height != null) { + message.height = data.height; + } + return message; + } + toObject() { + const data: { + id?: string; + height?: number; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.height != null) { + data.height = this.height; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (this.height !== undefined) + writer.writeUint64(2, this.height); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameRecordEntry { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameRecordEntry(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + message.height = reader.readUint64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): NameRecordEntry { + return NameRecordEntry.deserialize(bytes); + } + } + export class Signature extends pb_1.Message { + constructor(data?: any[] | { + sig?: string; + pub_key?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("sig" in data && data.sig != undefined) { + this.sig = data.sig; + } + if ("pub_key" in data && data.pub_key != undefined) { + this.pub_key = data.pub_key; + } + } + } + get sig() { + return pb_1.Message.getField(this, 1) as string; + } + set sig(value: string) { + pb_1.Message.setField(this, 1, value); + } + get pub_key() { + return pb_1.Message.getField(this, 2) as string; + } + set pub_key(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + sig?: string; + pub_key?: string; + }) { + const message = new Signature({}); + if (data.sig != null) { + message.sig = data.sig; + } + if (data.pub_key != null) { + message.pub_key = data.pub_key; + } + return message; + } + toObject() { + const data: { + sig?: string; + pub_key?: string; + } = {}; + if (this.sig != null) { + data.sig = this.sig; + } + if (this.pub_key != null) { + data.pub_key = this.pub_key; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.sig === "string" && this.sig.length) + writer.writeString(1, this.sig); + if (typeof this.pub_key === "string" && this.pub_key.length) + writer.writeString(2, this.pub_key); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signature { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Signature(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.sig = reader.readString(); + break; + case 2: + message.pub_key = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Signature { + return Signature.deserialize(bytes); + } + } + export class BlockChangeSet extends pb_1.Message { + constructor(data?: any[] | { + height?: number; + records?: string[]; + auctions?: string[]; + auction_bids?: AuctionBidInfo[]; + authorities?: string[]; + names?: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("height" in data && data.height != undefined) { + this.height = data.height; + } + if ("records" in data && data.records != undefined) { + this.records = data.records; + } + if ("auctions" in data && data.auctions != undefined) { + this.auctions = data.auctions; + } + if ("auction_bids" in data && data.auction_bids != undefined) { + this.auction_bids = data.auction_bids; + } + if ("authorities" in data && data.authorities != undefined) { + this.authorities = data.authorities; + } + if ("names" in data && data.names != undefined) { + this.names = data.names; + } + } + } + get height() { + return pb_1.Message.getField(this, 1) as number; + } + set height(value: number) { + pb_1.Message.setField(this, 1, value); + } + get records() { + return pb_1.Message.getField(this, 2) as string[]; + } + set records(value: string[]) { + pb_1.Message.setField(this, 2, value); + } + get auctions() { + return pb_1.Message.getField(this, 3) as string[]; + } + set auctions(value: string[]) { + pb_1.Message.setField(this, 3, value); + } + get auction_bids() { + return pb_1.Message.getRepeatedWrapperField(this, AuctionBidInfo, 4) as AuctionBidInfo[]; + } + set auction_bids(value: AuctionBidInfo[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get authorities() { + return pb_1.Message.getField(this, 5) as string[]; + } + set authorities(value: string[]) { + pb_1.Message.setField(this, 5, value); + } + get names() { + return pb_1.Message.getField(this, 6) as string[]; + } + set names(value: string[]) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + height?: number; + records?: string[]; + auctions?: string[]; + auction_bids?: ReturnType[]; + authorities?: string[]; + names?: string[]; + }) { + const message = new BlockChangeSet({}); + if (data.height != null) { + message.height = data.height; + } + if (data.records != null) { + message.records = data.records; + } + if (data.auctions != null) { + message.auctions = data.auctions; + } + if (data.auction_bids != null) { + message.auction_bids = data.auction_bids.map(item => AuctionBidInfo.fromObject(item)); + } + if (data.authorities != null) { + message.authorities = data.authorities; + } + if (data.names != null) { + message.names = data.names; + } + return message; + } + toObject() { + const data: { + height?: number; + records?: string[]; + auctions?: string[]; + auction_bids?: ReturnType[]; + authorities?: string[]; + names?: string[]; + } = {}; + if (this.height != null) { + data.height = this.height; + } + if (this.records != null) { + data.records = this.records; + } + if (this.auctions != null) { + data.auctions = this.auctions; + } + if (this.auction_bids != null) { + data.auction_bids = this.auction_bids.map((item: AuctionBidInfo) => item.toObject()); + } + if (this.authorities != null) { + data.authorities = this.authorities; + } + if (this.names != null) { + data.names = this.names; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.height !== undefined) + writer.writeInt64(1, this.height); + if (this.records !== undefined) + writer.writeRepeatedString(2, this.records); + if (this.auctions !== undefined) + writer.writeRepeatedString(3, this.auctions); + if (this.auction_bids !== undefined) + writer.writeRepeatedMessage(4, this.auction_bids, (item: AuctionBidInfo) => item.serialize(writer)); + if (this.authorities !== undefined) + writer.writeRepeatedString(5, this.authorities); + if (this.names !== undefined) + writer.writeRepeatedString(6, this.names); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BlockChangeSet { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BlockChangeSet(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.height = reader.readInt64(); + break; + case 2: + pb_1.Message.addToRepeatedField(message, 2, reader.readString()); + break; + case 3: + pb_1.Message.addToRepeatedField(message, 3, reader.readString()); + break; + case 4: + reader.readMessage(message.auction_bids, () => pb_1.Message.addToRepeatedWrapperField(message, 4, AuctionBidInfo.deserialize(reader), AuctionBidInfo)); + break; + case 5: + pb_1.Message.addToRepeatedField(message, 5, reader.readString()); + break; + case 6: + pb_1.Message.addToRepeatedField(message, 6, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BlockChangeSet { + return BlockChangeSet.deserialize(bytes); + } + } + export class AuctionBidInfo extends pb_1.Message { + constructor(data?: any[] | { + auction_id?: string; + bidder_address?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("auction_id" in data && data.auction_id != undefined) { + this.auction_id = data.auction_id; + } + if ("bidder_address" in data && data.bidder_address != undefined) { + this.bidder_address = data.bidder_address; + } + } + } + get auction_id() { + return pb_1.Message.getField(this, 1) as string; + } + set auction_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get bidder_address() { + return pb_1.Message.getField(this, 2) as string; + } + set bidder_address(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + auction_id?: string; + bidder_address?: string; + }) { + const message = new AuctionBidInfo({}); + if (data.auction_id != null) { + message.auction_id = data.auction_id; + } + if (data.bidder_address != null) { + message.bidder_address = data.bidder_address; + } + return message; + } + toObject() { + const data: { + auction_id?: string; + bidder_address?: string; + } = {}; + if (this.auction_id != null) { + data.auction_id = this.auction_id; + } + if (this.bidder_address != null) { + data.bidder_address = this.bidder_address; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.auction_id === "string" && this.auction_id.length) + writer.writeString(1, this.auction_id); + if (typeof this.bidder_address === "string" && this.bidder_address.length) + writer.writeString(2, this.bidder_address); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionBidInfo { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionBidInfo(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.auction_id = reader.readString(); + break; + case 2: + message.bidder_address = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AuctionBidInfo { + return AuctionBidInfo.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/nameservice/v1beta1/query.ts b/src/proto/vulcanize/nameservice/v1beta1/query.ts new file mode 100644 index 0000000..ec43f19 --- /dev/null +++ b/src/proto/vulcanize/nameservice/v1beta1/query.ts @@ -0,0 +1,1729 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/nameservice/v1beta1/query.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./nameservice"; +import * as dependency_2 from "./../../../google/api/annotations"; +import * as dependency_3 from "./../../../cosmos/base/query/v1beta1/pagination"; +import * as dependency_4 from "./../../../gogoproto/gogo"; +import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.nameservice.v1beta1 { + export class QueryParamsRequest extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new QueryParamsRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsRequest { + return QueryParamsRequest.deserialize(bytes); + } + } + export class QueryParamsResponse extends pb_1.Message { + constructor(data?: any[] | { + params?: dependency_1.vulcanize.nameservice.v1beta1.Params; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + } + } + get params() { + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Params, 1) as dependency_1.vulcanize.nameservice.v1beta1.Params; + } + set params(value: dependency_1.vulcanize.nameservice.v1beta1.Params) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + params?: ReturnType; + }) { + const message = new QueryParamsResponse({}); + if (data.params != null) { + message.params = dependency_1.vulcanize.nameservice.v1beta1.Params.fromObject(data.params); + } + return message; + } + toObject() { + const data: { + params?: ReturnType; + } = {}; + if (this.params != null) { + data.params = this.params.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.params !== undefined) + writer.writeMessage(1, this.params, () => this.params.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.params, () => message.params = dependency_1.vulcanize.nameservice.v1beta1.Params.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryParamsResponse { + return QueryParamsResponse.deserialize(bytes); + } + } + export class QueryListRecordsRequest extends pb_1.Message { + constructor(data?: any[] | { + pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + pagination?: ReturnType; + }) { + const message = new QueryListRecordsRequest({}); + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + pagination?: ReturnType; + } = {}; + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.pagination !== undefined) + writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListRecordsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListRecordsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryListRecordsRequest { + return QueryListRecordsRequest.deserialize(bytes); + } + } + export class QueryListRecordsResponse extends pb_1.Message { + constructor(data?: any[] | { + records?: dependency_1.vulcanize.nameservice.v1beta1.Record[]; + pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("records" in data && data.records != undefined) { + this.records = data.records; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get records() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record[]; + } + set records(value: dependency_1.vulcanize.nameservice.v1beta1.Record[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + records?: ReturnType[]; + pagination?: ReturnType; + }) { + const message = new QueryListRecordsResponse({}); + if (data.records != null) { + message.records = data.records.map(item => dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + records?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.records != null) { + data.records = this.records.map((item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.records !== undefined) + writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListRecordsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListRecordsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.nameservice.v1beta1.Record)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryListRecordsResponse { + return QueryListRecordsResponse.deserialize(bytes); + } + } + export class QueryRecordByIdRequest extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + id?: string; + }) { + const message = new QueryRecordByIdRequest({}); + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + id?: string; + } = {}; + if (this.id != null) { + data.id = this.id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIdRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIdRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryRecordByIdRequest { + return QueryRecordByIdRequest.deserialize(bytes); + } + } + export class QueryRecordByIdResponse extends pb_1.Message { + constructor(data?: any[] | { + record?: dependency_1.vulcanize.nameservice.v1beta1.Record; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("record" in data && data.record != undefined) { + this.record = data.record; + } + } + } + get record() { + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record; + } + set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + record?: ReturnType; + }) { + const message = new QueryRecordByIdResponse({}); + if (data.record != null) { + message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); + } + return message; + } + toObject() { + const data: { + record?: ReturnType; + } = {}; + if (this.record != null) { + data.record = this.record.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.record !== undefined) + writer.writeMessage(1, this.record, () => this.record.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIdResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIdResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryRecordByIdResponse { + return QueryRecordByIdResponse.deserialize(bytes); + } + } + export class QueryRecordByBondIdRequest extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_3.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + id?: string; + pagination?: ReturnType; + }) { + const message = new QueryRecordByBondIdRequest({}); + if (data.id != null) { + message.id = data.id; + } + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + id?: string; + pagination?: ReturnType; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIdRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIdRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIdRequest { + return QueryRecordByBondIdRequest.deserialize(bytes); + } + } + export class QueryRecordByBondIdResponse extends pb_1.Message { + constructor(data?: any[] | { + records?: dependency_1.vulcanize.nameservice.v1beta1.Record[]; + pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("records" in data && data.records != undefined) { + this.records = data.records; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get records() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record[]; + } + set records(value: dependency_1.vulcanize.nameservice.v1beta1.Record[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + records?: ReturnType[]; + pagination?: ReturnType; + }) { + const message = new QueryRecordByBondIdResponse({}); + if (data.records != null) { + message.records = data.records.map(item => dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + records?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.records != null) { + data.records = this.records.map((item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.records !== undefined) + writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIdResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIdResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.nameservice.v1beta1.Record)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIdResponse { + return QueryRecordByBondIdResponse.deserialize(bytes); + } + } + export class GetNameServiceModuleBalanceRequest extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new GetNameServiceModuleBalanceRequest({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNameServiceModuleBalanceRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetNameServiceModuleBalanceRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetNameServiceModuleBalanceRequest { + return GetNameServiceModuleBalanceRequest.deserialize(bytes); + } + } + export class GetNameServiceModuleBalanceResponse extends pb_1.Message { + constructor(data?: any[] | { + balances?: AccountBalance[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("balances" in data && data.balances != undefined) { + this.balances = data.balances; + } + } + } + get balances() { + return pb_1.Message.getRepeatedWrapperField(this, AccountBalance, 1) as AccountBalance[]; + } + set balances(value: AccountBalance[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + static fromObject(data: { + balances?: ReturnType[]; + }) { + const message = new GetNameServiceModuleBalanceResponse({}); + if (data.balances != null) { + message.balances = data.balances.map(item => AccountBalance.fromObject(item)); + } + return message; + } + toObject() { + const data: { + balances?: ReturnType[]; + } = {}; + if (this.balances != null) { + data.balances = this.balances.map((item: AccountBalance) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.balances !== undefined) + writer.writeRepeatedMessage(1, this.balances, (item: AccountBalance) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNameServiceModuleBalanceResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetNameServiceModuleBalanceResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.balances, () => pb_1.Message.addToRepeatedWrapperField(message, 1, AccountBalance.deserialize(reader), AccountBalance)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetNameServiceModuleBalanceResponse { + return GetNameServiceModuleBalanceResponse.deserialize(bytes); + } + } + export class AccountBalance extends pb_1.Message { + constructor(data?: any[] | { + account_name?: string; + balance?: dependency_5.cosmos.base.v1beta1.Coin[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("account_name" in data && data.account_name != undefined) { + this.account_name = data.account_name; + } + if ("balance" in data && data.balance != undefined) { + this.balance = data.balance; + } + } + } + get account_name() { + return pb_1.Message.getField(this, 1) as string; + } + set account_name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get balance() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_5.cosmos.base.v1beta1.Coin, 3) as dependency_5.cosmos.base.v1beta1.Coin[]; + } + set balance(value: dependency_5.cosmos.base.v1beta1.Coin[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + account_name?: string; + balance?: ReturnType[]; + }) { + const message = new AccountBalance({}); + if (data.account_name != null) { + message.account_name = data.account_name; + } + if (data.balance != null) { + message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item)); + } + return message; + } + toObject() { + const data: { + account_name?: string; + balance?: ReturnType[]; + } = {}; + if (this.account_name != null) { + data.account_name = this.account_name; + } + if (this.balance != null) { + data.balance = this.balance.map((item: dependency_5.cosmos.base.v1beta1.Coin) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.account_name === "string" && this.account_name.length) + writer.writeString(1, this.account_name); + if (this.balance !== undefined) + writer.writeRepeatedMessage(3, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AccountBalance { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AccountBalance(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.account_name = reader.readString(); + break; + case 3: + reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_5.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_5.cosmos.base.v1beta1.Coin)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AccountBalance { + return AccountBalance.deserialize(bytes); + } + } + export class QueryListNameRecordsRequest extends pb_1.Message { + constructor(data?: any[] | { + pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + pagination?: ReturnType; + }) { + const message = new QueryListNameRecordsRequest({}); + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + pagination?: ReturnType; + } = {}; + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.pagination !== undefined) + writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListNameRecordsRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListNameRecordsRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryListNameRecordsRequest { + return QueryListNameRecordsRequest.deserialize(bytes); + } + } + export class QueryListNameRecordsResponse extends pb_1.Message { + constructor(data?: any[] | { + names?: dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]; + pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("names" in data && data.names != undefined) { + this.names = data.names; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get names() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.NameEntry, 1) as dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]; + } + set names(value: dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + names?: ReturnType[]; + pagination?: ReturnType; + }) { + const message = new QueryListNameRecordsResponse({}); + if (data.names != null) { + message.names = data.names.map(item => dependency_1.vulcanize.nameservice.v1beta1.NameEntry.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + names?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.names != null) { + data.names = this.names.map((item: dependency_1.vulcanize.nameservice.v1beta1.NameEntry) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.names !== undefined) + writer.writeRepeatedMessage(1, this.names, (item: dependency_1.vulcanize.nameservice.v1beta1.NameEntry) => item.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListNameRecordsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListNameRecordsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.nameservice.v1beta1.NameEntry.deserialize(reader), dependency_1.vulcanize.nameservice.v1beta1.NameEntry)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryListNameRecordsResponse { + return QueryListNameRecordsResponse.deserialize(bytes); + } + } + export class QueryWhoisRequest extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + name?: string; + }) { + const message = new QueryWhoisRequest({}); + if (data.name != null) { + message.name = data.name; + } + return message; + } + toObject() { + const data: { + name?: string; + } = {}; + if (this.name != null) { + data.name = this.name; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryWhoisRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryWhoisRequest(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryWhoisRequest { + return QueryWhoisRequest.deserialize(bytes); + } + } + export class QueryWhoisResponse extends pb_1.Message { + constructor(data?: any[] | { + name_authority?: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name_authority" in data && data.name_authority != undefined) { + this.name_authority = data.name_authority; + } + } + } + get name_authority() { + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.NameAuthority, 1) as dependency_1.vulcanize.nameservice.v1beta1.NameAuthority; + } + set name_authority(value: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + name_authority?: ReturnType; + }) { + const message = new QueryWhoisResponse({}); + if (data.name_authority != null) { + message.name_authority = dependency_1.vulcanize.nameservice.v1beta1.NameAuthority.fromObject(data.name_authority); + } + return message; + } + toObject() { + const data: { + name_authority?: ReturnType; + } = {}; + if (this.name_authority != null) { + data.name_authority = this.name_authority.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.name_authority !== undefined) + writer.writeMessage(1, this.name_authority, () => this.name_authority.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryWhoisResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryWhoisResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.name_authority, () => message.name_authority = dependency_1.vulcanize.nameservice.v1beta1.NameAuthority.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryWhoisResponse { + return QueryWhoisResponse.deserialize(bytes); + } + } + export class QueryLookupWrn extends pb_1.Message { + constructor(data?: any[] | { + wrn?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("wrn" in data && data.wrn != undefined) { + this.wrn = data.wrn; + } + } + } + get wrn() { + return pb_1.Message.getField(this, 1) as string; + } + set wrn(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + wrn?: string; + }) { + const message = new QueryLookupWrn({}); + if (data.wrn != null) { + message.wrn = data.wrn; + } + return message; + } + toObject() { + const data: { + wrn?: string; + } = {}; + if (this.wrn != null) { + data.wrn = this.wrn; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.wrn === "string" && this.wrn.length) + writer.writeString(1, this.wrn); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryLookupWrn { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryLookupWrn(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.wrn = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryLookupWrn { + return QueryLookupWrn.deserialize(bytes); + } + } + export class QueryLookupWrnResponse extends pb_1.Message { + constructor(data?: any[] | { + name?: dependency_1.vulcanize.nameservice.v1beta1.NameRecord; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + } + } + get name() { + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.NameRecord, 1) as dependency_1.vulcanize.nameservice.v1beta1.NameRecord; + } + set name(value: dependency_1.vulcanize.nameservice.v1beta1.NameRecord) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + name?: ReturnType; + }) { + const message = new QueryLookupWrnResponse({}); + if (data.name != null) { + message.name = dependency_1.vulcanize.nameservice.v1beta1.NameRecord.fromObject(data.name); + } + return message; + } + toObject() { + const data: { + name?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.name !== undefined) + writer.writeMessage(1, this.name, () => this.name.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryLookupWrnResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryLookupWrnResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.name, () => message.name = dependency_1.vulcanize.nameservice.v1beta1.NameRecord.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryLookupWrnResponse { + return QueryLookupWrnResponse.deserialize(bytes); + } + } + export class QueryResolveWrn extends pb_1.Message { + constructor(data?: any[] | { + wrn?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("wrn" in data && data.wrn != undefined) { + this.wrn = data.wrn; + } + } + } + get wrn() { + return pb_1.Message.getField(this, 1) as string; + } + set wrn(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + wrn?: string; + }) { + const message = new QueryResolveWrn({}); + if (data.wrn != null) { + message.wrn = data.wrn; + } + return message; + } + toObject() { + const data: { + wrn?: string; + } = {}; + if (this.wrn != null) { + data.wrn = this.wrn; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.wrn === "string" && this.wrn.length) + writer.writeString(1, this.wrn); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryResolveWrn { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryResolveWrn(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.wrn = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryResolveWrn { + return QueryResolveWrn.deserialize(bytes); + } + } + export class QueryResolveWrnResponse extends pb_1.Message { + constructor(data?: any[] | { + record?: dependency_1.vulcanize.nameservice.v1beta1.Record; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("record" in data && data.record != undefined) { + this.record = data.record; + } + } + } + get record() { + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record; + } + set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + record?: ReturnType; + }) { + const message = new QueryResolveWrnResponse({}); + if (data.record != null) { + message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); + } + return message; + } + toObject() { + const data: { + record?: ReturnType; + } = {}; + if (this.record != null) { + data.record = this.record.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.record !== undefined) + writer.writeMessage(1, this.record, () => this.record.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryResolveWrnResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryResolveWrnResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryResolveWrnResponse { + return QueryResolveWrnResponse.deserialize(bytes); + } + } + export class QueryGetRecordExpiryQueue extends pb_1.Message { + constructor(data?: any[] | { + pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + pagination?: ReturnType; + }) { + const message = new QueryGetRecordExpiryQueue({}); + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + pagination?: ReturnType; + } = {}; + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.pagination !== undefined) + writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetRecordExpiryQueue { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetRecordExpiryQueue(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetRecordExpiryQueue { + return QueryGetRecordExpiryQueue.deserialize(bytes); + } + } + export class QueryGetRecordExpiryQueueResponse extends pb_1.Message { + constructor(data?: any[] | { + records?: ExpiryQueueRecord[]; + pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("records" in data && data.records != undefined) { + this.records = data.records; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get records() { + return pb_1.Message.getRepeatedWrapperField(this, ExpiryQueueRecord, 1) as ExpiryQueueRecord[]; + } + set records(value: ExpiryQueueRecord[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + records?: ReturnType[]; + pagination?: ReturnType; + }) { + const message = new QueryGetRecordExpiryQueueResponse({}); + if (data.records != null) { + message.records = data.records.map(item => ExpiryQueueRecord.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + records?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.records != null) { + data.records = this.records.map((item: ExpiryQueueRecord) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.records !== undefined) + writer.writeRepeatedMessage(1, this.records, (item: ExpiryQueueRecord) => item.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetRecordExpiryQueueResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetRecordExpiryQueueResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, ExpiryQueueRecord.deserialize(reader), ExpiryQueueRecord)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetRecordExpiryQueueResponse { + return QueryGetRecordExpiryQueueResponse.deserialize(bytes); + } + } + export class ExpiryQueueRecord extends pb_1.Message { + constructor(data?: any[] | { + id?: string; + value?: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("id" in data && data.id != undefined) { + this.id = data.id; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + } + } + get id() { + return pb_1.Message.getField(this, 1) as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get value() { + return pb_1.Message.getField(this, 2) as string[]; + } + set value(value: string[]) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + id?: string; + value?: string[]; + }) { + const message = new ExpiryQueueRecord({}); + if (data.id != null) { + message.id = data.id; + } + if (data.value != null) { + message.value = data.value; + } + return message; + } + toObject() { + const data: { + id?: string; + value?: string[]; + } = {}; + if (this.id != null) { + data.id = this.id; + } + if (this.value != null) { + data.value = this.value; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.id === "string" && this.id.length) + writer.writeString(1, this.id); + if (this.value !== undefined) + writer.writeRepeatedString(2, this.value); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExpiryQueueRecord { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ExpiryQueueRecord(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + case 2: + pb_1.Message.addToRepeatedField(message, 2, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ExpiryQueueRecord { + return ExpiryQueueRecord.deserialize(bytes); + } + } + export class QueryGetAuthorityExpiryQueue extends pb_1.Message { + constructor(data?: any[] | { + pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { + pb_1.Message.setWrapperField(this, 1, value); + } + static fromObject(data: { + pagination?: ReturnType; + }) { + const message = new QueryGetAuthorityExpiryQueue({}); + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + pagination?: ReturnType; + } = {}; + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.pagination !== undefined) + writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetAuthorityExpiryQueue { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetAuthorityExpiryQueue(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetAuthorityExpiryQueue { + return QueryGetAuthorityExpiryQueue.deserialize(bytes); + } + } + export class QueryGetAuthorityExpiryQueueResponse extends pb_1.Message { + constructor(data?: any[] | { + authorities?: ExpiryQueueRecord[]; + pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("authorities" in data && data.authorities != undefined) { + this.authorities = data.authorities; + } + if ("pagination" in data && data.pagination != undefined) { + this.pagination = data.pagination; + } + } + } + get authorities() { + return pb_1.Message.getRepeatedWrapperField(this, ExpiryQueueRecord, 1) as ExpiryQueueRecord[]; + } + set authorities(value: ExpiryQueueRecord[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get pagination() { + return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; + } + set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { + pb_1.Message.setWrapperField(this, 2, value); + } + static fromObject(data: { + authorities?: ReturnType[]; + pagination?: ReturnType; + }) { + const message = new QueryGetAuthorityExpiryQueueResponse({}); + if (data.authorities != null) { + message.authorities = data.authorities.map(item => ExpiryQueueRecord.fromObject(item)); + } + if (data.pagination != null) { + message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); + } + return message; + } + toObject() { + const data: { + authorities?: ReturnType[]; + pagination?: ReturnType; + } = {}; + if (this.authorities != null) { + data.authorities = this.authorities.map((item: ExpiryQueueRecord) => item.toObject()); + } + if (this.pagination != null) { + data.pagination = this.pagination.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.authorities !== undefined) + writer.writeRepeatedMessage(1, this.authorities, (item: ExpiryQueueRecord) => item.serialize(writer)); + if (this.pagination !== undefined) + writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetAuthorityExpiryQueueResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetAuthorityExpiryQueueResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 1, ExpiryQueueRecord.deserialize(reader), ExpiryQueueRecord)); + break; + case 2: + reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): QueryGetAuthorityExpiryQueueResponse { + return QueryGetAuthorityExpiryQueueResponse.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/nameservice/v1beta1/tx.ts b/src/proto/vulcanize/nameservice/v1beta1/tx.ts new file mode 100644 index 0000000..5d2680a --- /dev/null +++ b/src/proto/vulcanize/nameservice/v1beta1/tx.ts @@ -0,0 +1,1519 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.14.0 + * source: vulcanize/nameservice/v1beta1/tx.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as dependency_2 from "./nameservice"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.nameservice.v1beta1 { + export class MsgSetRecord extends pb_1.Message { + constructor(data?: any[] | { + bond_id?: string; + signer?: string; + payload?: Payload; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bond_id" in data && data.bond_id != undefined) { + this.bond_id = data.bond_id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + if ("payload" in data && data.payload != undefined) { + this.payload = data.payload; + } + } + } + get bond_id() { + return pb_1.Message.getField(this, 1) as string; + } + set bond_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + get payload() { + return pb_1.Message.getWrapperField(this, Payload, 3) as Payload; + } + set payload(value: Payload) { + pb_1.Message.setWrapperField(this, 3, value); + } + static fromObject(data: { + bond_id?: string; + signer?: string; + payload?: ReturnType; + }) { + const message = new MsgSetRecord({}); + if (data.bond_id != null) { + message.bond_id = data.bond_id; + } + if (data.signer != null) { + message.signer = data.signer; + } + if (data.payload != null) { + message.payload = Payload.fromObject(data.payload); + } + return message; + } + toObject() { + const data: { + bond_id?: string; + signer?: string; + payload?: ReturnType; + } = {}; + if (this.bond_id != null) { + data.bond_id = this.bond_id; + } + if (this.signer != null) { + data.signer = this.signer; + } + if (this.payload != null) { + data.payload = this.payload.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.bond_id === "string" && this.bond_id.length) + writer.writeString(1, this.bond_id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (this.payload !== undefined) + writer.writeMessage(3, this.payload, () => this.payload.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetRecord { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetRecord(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.bond_id = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + case 3: + reader.readMessage(message.payload, () => message.payload = Payload.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgSetRecord { + return MsgSetRecord.deserialize(bytes); + } + } + export class MsgSetRecordResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgSetRecordResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetRecordResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetRecordResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgSetRecordResponse { + return MsgSetRecordResponse.deserialize(bytes); + } + } + export class Payload extends pb_1.Message { + constructor(data?: any[] | { + record?: dependency_2.vulcanize.nameservice.v1beta1.Record; + signatures?: dependency_2.vulcanize.nameservice.v1beta1.Signature[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("record" in data && data.record != undefined) { + this.record = data.record; + } + if ("signatures" in data && data.signatures != undefined) { + this.signatures = data.signatures; + } + } + } + get record() { + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 1) as dependency_2.vulcanize.nameservice.v1beta1.Record; + } + set record(value: dependency_2.vulcanize.nameservice.v1beta1.Record) { + pb_1.Message.setWrapperField(this, 1, value); + } + get signatures() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Signature, 2) as dependency_2.vulcanize.nameservice.v1beta1.Signature[]; + } + set signatures(value: dependency_2.vulcanize.nameservice.v1beta1.Signature[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + record?: ReturnType; + signatures?: ReturnType[]; + }) { + const message = new Payload({}); + if (data.record != null) { + message.record = dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); + } + if (data.signatures != null) { + message.signatures = data.signatures.map(item => dependency_2.vulcanize.nameservice.v1beta1.Signature.fromObject(item)); + } + return message; + } + toObject() { + const data: { + record?: ReturnType; + signatures?: ReturnType[]; + } = {}; + if (this.record != null) { + data.record = this.record.toObject(); + } + if (this.signatures != null) { + data.signatures = this.signatures.map((item: dependency_2.vulcanize.nameservice.v1beta1.Signature) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.record !== undefined) + writer.writeMessage(1, this.record, () => this.record.serialize(writer)); + if (this.signatures !== undefined) + writer.writeRepeatedMessage(2, this.signatures, (item: dependency_2.vulcanize.nameservice.v1beta1.Signature) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Payload { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Payload(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.record, () => message.record = dependency_2.vulcanize.nameservice.v1beta1.Record.deserialize(reader)); + break; + case 2: + reader.readMessage(message.signatures, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.nameservice.v1beta1.Signature.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.Signature)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Payload { + return Payload.deserialize(bytes); + } + } + export class MsgSetName extends pb_1.Message { + constructor(data?: any[] | { + wrn?: string; + cid?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("wrn" in data && data.wrn != undefined) { + this.wrn = data.wrn; + } + if ("cid" in data && data.cid != undefined) { + this.cid = data.cid; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get wrn() { + return pb_1.Message.getField(this, 1) as string; + } + set wrn(value: string) { + pb_1.Message.setField(this, 1, value); + } + get cid() { + return pb_1.Message.getField(this, 2) as string; + } + set cid(value: string) { + pb_1.Message.setField(this, 2, value); + } + get signer() { + return pb_1.Message.getField(this, 3) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + wrn?: string; + cid?: string; + signer?: string; + }) { + const message = new MsgSetName({}); + if (data.wrn != null) { + message.wrn = data.wrn; + } + if (data.cid != null) { + message.cid = data.cid; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + wrn?: string; + cid?: string; + signer?: string; + } = {}; + if (this.wrn != null) { + data.wrn = this.wrn; + } + if (this.cid != null) { + data.cid = this.cid; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.wrn === "string" && this.wrn.length) + writer.writeString(1, this.wrn); + if (typeof this.cid === "string" && this.cid.length) + writer.writeString(2, this.cid); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(3, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetName { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetName(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.wrn = reader.readString(); + break; + case 2: + message.cid = reader.readString(); + break; + case 3: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgSetName { + return MsgSetName.deserialize(bytes); + } + } + export class MsgSetNameResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgSetNameResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetNameResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetNameResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgSetNameResponse { + return MsgSetNameResponse.deserialize(bytes); + } + } + export class MsgReserveAuthority extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + signer?: string; + owner?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + if ("owner" in data && data.owner != undefined) { + this.owner = data.owner; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + get owner() { + return pb_1.Message.getField(this, 3) as string; + } + set owner(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + name?: string; + signer?: string; + owner?: string; + }) { + const message = new MsgReserveAuthority({}); + if (data.name != null) { + message.name = data.name; + } + if (data.signer != null) { + message.signer = data.signer; + } + if (data.owner != null) { + message.owner = data.owner; + } + return message; + } + toObject() { + const data: { + name?: string; + signer?: string; + owner?: string; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.signer != null) { + data.signer = this.signer; + } + if (this.owner != null) { + data.owner = this.owner; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (typeof this.owner === "string" && this.owner.length) + writer.writeString(3, this.owner); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReserveAuthority { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReserveAuthority(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + case 3: + message.owner = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgReserveAuthority { + return MsgReserveAuthority.deserialize(bytes); + } + } + export class MsgReserveAuthorityResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgReserveAuthorityResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReserveAuthorityResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReserveAuthorityResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgReserveAuthorityResponse { + return MsgReserveAuthorityResponse.deserialize(bytes); + } + } + export class MsgSetAuthorityBond extends pb_1.Message { + constructor(data?: any[] | { + name?: string; + bond_id?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("name" in data && data.name != undefined) { + this.name = data.name; + } + if ("bond_id" in data && data.bond_id != undefined) { + this.bond_id = data.bond_id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get name() { + return pb_1.Message.getField(this, 1) as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get bond_id() { + return pb_1.Message.getField(this, 2) as string; + } + set bond_id(value: string) { + pb_1.Message.setField(this, 2, value); + } + get signer() { + return pb_1.Message.getField(this, 3) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + name?: string; + bond_id?: string; + signer?: string; + }) { + const message = new MsgSetAuthorityBond({}); + if (data.name != null) { + message.name = data.name; + } + if (data.bond_id != null) { + message.bond_id = data.bond_id; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + name?: string; + bond_id?: string; + signer?: string; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.bond_id != null) { + data.bond_id = this.bond_id; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.name === "string" && this.name.length) + writer.writeString(1, this.name); + if (typeof this.bond_id === "string" && this.bond_id.length) + writer.writeString(2, this.bond_id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(3, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetAuthorityBond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetAuthorityBond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + message.bond_id = reader.readString(); + break; + case 3: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgSetAuthorityBond { + return MsgSetAuthorityBond.deserialize(bytes); + } + } + export class MsgSetAuthorityBondResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgSetAuthorityBondResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetAuthorityBondResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetAuthorityBondResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgSetAuthorityBondResponse { + return MsgSetAuthorityBondResponse.deserialize(bytes); + } + } + export class MsgDeleteNameAuthority extends pb_1.Message { + constructor(data?: any[] | { + wrn?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("wrn" in data && data.wrn != undefined) { + this.wrn = data.wrn; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get wrn() { + return pb_1.Message.getField(this, 1) as string; + } + set wrn(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + wrn?: string; + signer?: string; + }) { + const message = new MsgDeleteNameAuthority({}); + if (data.wrn != null) { + message.wrn = data.wrn; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + wrn?: string; + signer?: string; + } = {}; + if (this.wrn != null) { + data.wrn = this.wrn; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.wrn === "string" && this.wrn.length) + writer.writeString(1, this.wrn); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDeleteNameAuthority { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDeleteNameAuthority(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.wrn = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgDeleteNameAuthority { + return MsgDeleteNameAuthority.deserialize(bytes); + } + } + export class MsgDeleteNameAuthorityResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgDeleteNameAuthorityResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDeleteNameAuthorityResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDeleteNameAuthorityResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgDeleteNameAuthorityResponse { + return MsgDeleteNameAuthorityResponse.deserialize(bytes); + } + } + export class MsgRenewRecord extends pb_1.Message { + constructor(data?: any[] | { + record_id?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("record_id" in data && data.record_id != undefined) { + this.record_id = data.record_id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get record_id() { + return pb_1.Message.getField(this, 1) as string; + } + set record_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + record_id?: string; + signer?: string; + }) { + const message = new MsgRenewRecord({}); + if (data.record_id != null) { + message.record_id = data.record_id; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + record_id?: string; + signer?: string; + } = {}; + if (this.record_id != null) { + data.record_id = this.record_id; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.record_id === "string" && this.record_id.length) + writer.writeString(1, this.record_id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRenewRecord { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRenewRecord(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.record_id = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgRenewRecord { + return MsgRenewRecord.deserialize(bytes); + } + } + export class MsgRenewRecordResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgRenewRecordResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRenewRecordResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRenewRecordResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgRenewRecordResponse { + return MsgRenewRecordResponse.deserialize(bytes); + } + } + export class MsgAssociateBond extends pb_1.Message { + constructor(data?: any[] | { + record_id?: string; + bond_id?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("record_id" in data && data.record_id != undefined) { + this.record_id = data.record_id; + } + if ("bond_id" in data && data.bond_id != undefined) { + this.bond_id = data.bond_id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get record_id() { + return pb_1.Message.getField(this, 1) as string; + } + set record_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get bond_id() { + return pb_1.Message.getField(this, 2) as string; + } + set bond_id(value: string) { + pb_1.Message.setField(this, 2, value); + } + get signer() { + return pb_1.Message.getField(this, 3) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + record_id?: string; + bond_id?: string; + signer?: string; + }) { + const message = new MsgAssociateBond({}); + if (data.record_id != null) { + message.record_id = data.record_id; + } + if (data.bond_id != null) { + message.bond_id = data.bond_id; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + record_id?: string; + bond_id?: string; + signer?: string; + } = {}; + if (this.record_id != null) { + data.record_id = this.record_id; + } + if (this.bond_id != null) { + data.bond_id = this.bond_id; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.record_id === "string" && this.record_id.length) + writer.writeString(1, this.record_id); + if (typeof this.bond_id === "string" && this.bond_id.length) + writer.writeString(2, this.bond_id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(3, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgAssociateBond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgAssociateBond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.record_id = reader.readString(); + break; + case 2: + message.bond_id = reader.readString(); + break; + case 3: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgAssociateBond { + return MsgAssociateBond.deserialize(bytes); + } + } + export class MsgAssociateBondResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgAssociateBondResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgAssociateBondResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgAssociateBondResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgAssociateBondResponse { + return MsgAssociateBondResponse.deserialize(bytes); + } + } + export class MsgDissociateBond extends pb_1.Message { + constructor(data?: any[] | { + record_id?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("record_id" in data && data.record_id != undefined) { + this.record_id = data.record_id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get record_id() { + return pb_1.Message.getField(this, 1) as string; + } + set record_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + record_id?: string; + signer?: string; + }) { + const message = new MsgDissociateBond({}); + if (data.record_id != null) { + message.record_id = data.record_id; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + record_id?: string; + signer?: string; + } = {}; + if (this.record_id != null) { + data.record_id = this.record_id; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.record_id === "string" && this.record_id.length) + writer.writeString(1, this.record_id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateBond { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateBond(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.record_id = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgDissociateBond { + return MsgDissociateBond.deserialize(bytes); + } + } + export class MsgDissociateBondResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgDissociateBondResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateBondResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateBondResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgDissociateBondResponse { + return MsgDissociateBondResponse.deserialize(bytes); + } + } + export class MsgDissociateRecords extends pb_1.Message { + constructor(data?: any[] | { + bond_id?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("bond_id" in data && data.bond_id != undefined) { + this.bond_id = data.bond_id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get bond_id() { + return pb_1.Message.getField(this, 1) as string; + } + set bond_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get signer() { + return pb_1.Message.getField(this, 2) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + bond_id?: string; + signer?: string; + }) { + const message = new MsgDissociateRecords({}); + if (data.bond_id != null) { + message.bond_id = data.bond_id; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + bond_id?: string; + signer?: string; + } = {}; + if (this.bond_id != null) { + data.bond_id = this.bond_id; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.bond_id === "string" && this.bond_id.length) + writer.writeString(1, this.bond_id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(2, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateRecords { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateRecords(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.bond_id = reader.readString(); + break; + case 2: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgDissociateRecords { + return MsgDissociateRecords.deserialize(bytes); + } + } + export class MsgDissociateRecordsResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgDissociateRecordsResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateRecordsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateRecordsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgDissociateRecordsResponse { + return MsgDissociateRecordsResponse.deserialize(bytes); + } + } + export class MsgReAssociateRecords extends pb_1.Message { + constructor(data?: any[] | { + new_bond_id?: string; + old_bond_id?: string; + signer?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { + if ("new_bond_id" in data && data.new_bond_id != undefined) { + this.new_bond_id = data.new_bond_id; + } + if ("old_bond_id" in data && data.old_bond_id != undefined) { + this.old_bond_id = data.old_bond_id; + } + if ("signer" in data && data.signer != undefined) { + this.signer = data.signer; + } + } + } + get new_bond_id() { + return pb_1.Message.getField(this, 1) as string; + } + set new_bond_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get old_bond_id() { + return pb_1.Message.getField(this, 2) as string; + } + set old_bond_id(value: string) { + pb_1.Message.setField(this, 2, value); + } + get signer() { + return pb_1.Message.getField(this, 3) as string; + } + set signer(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + new_bond_id?: string; + old_bond_id?: string; + signer?: string; + }) { + const message = new MsgReAssociateRecords({}); + if (data.new_bond_id != null) { + message.new_bond_id = data.new_bond_id; + } + if (data.old_bond_id != null) { + message.old_bond_id = data.old_bond_id; + } + if (data.signer != null) { + message.signer = data.signer; + } + return message; + } + toObject() { + const data: { + new_bond_id?: string; + old_bond_id?: string; + signer?: string; + } = {}; + if (this.new_bond_id != null) { + data.new_bond_id = this.new_bond_id; + } + if (this.old_bond_id != null) { + data.old_bond_id = this.old_bond_id; + } + if (this.signer != null) { + data.signer = this.signer; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (typeof this.new_bond_id === "string" && this.new_bond_id.length) + writer.writeString(1, this.new_bond_id); + if (typeof this.old_bond_id === "string" && this.old_bond_id.length) + writer.writeString(2, this.old_bond_id); + if (typeof this.signer === "string" && this.signer.length) + writer.writeString(3, this.signer); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReAssociateRecords { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReAssociateRecords(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.new_bond_id = reader.readString(); + break; + case 2: + message.old_bond_id = reader.readString(); + break; + case 3: + message.signer = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgReAssociateRecords { + return MsgReAssociateRecords.deserialize(bytes); + } + } + export class MsgReAssociateRecordsResponse extends pb_1.Message { + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}) { + const message = new MsgReAssociateRecordsResponse({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReAssociateRecordsResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReAssociateRecordsResponse(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): MsgReAssociateRecordsResponse { + return MsgReAssociateRecordsResponse.deserialize(bytes); + } + } +} diff --git a/yarn.lock b/yarn.lock index 5597233..ac24ad9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3249,6 +3249,11 @@ protobufjs@~6.10.2: "@types/node" "^13.7.0" long "^4.0.0" +protoc-gen-ts@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/protoc-gen-ts/-/protoc-gen-ts-0.8.2.tgz#d762eef409cc3721684078b2b9a2bf5a0c2e761a" + integrity sha512-KRHMRLQqhDnaGq31qLDxhW4vcGmPqS2NS1XflDJyUBt2G6Egy9exBKFA2leyDgRab0BBRshoSXpJMkqmRtoQ6w== + psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"