forked from cerc-io/registry-sdk
Update proto files and regenerate ts bindings (#1)
* Update proto files * Update script to generate typescript definitions * Generate typescript definitions from protobuf files * Cleanup unnecessary proto files --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com>
This commit is contained in:
parent
73bef00dd3
commit
ce3cfbd457
@ -14,7 +14,7 @@
|
||||
"dotenv": "^16.0.0",
|
||||
"google-protobuf": "^3.21.0",
|
||||
"jest": "29.0.0",
|
||||
"protoc-gen-ts": "^0.8.7",
|
||||
"ts-proto": "1.121.6",
|
||||
"ts-jest": "^29.0.2",
|
||||
"typescript": "^4.6.2"
|
||||
},
|
||||
|
84
proto/amino/amino.proto
Normal file
84
proto/amino/amino.proto
Normal file
@ -0,0 +1,84 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package amino;
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated.
|
||||
// We need this right now because gogoproto codegen needs to import the extension.
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino";
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
// name is the string used when registering a concrete
|
||||
// type into the Amino type registry, via the Amino codec's
|
||||
// `RegisterConcrete()` method. This string MUST be at most 39
|
||||
// characters long, or else the message will be rejected by the
|
||||
// Ledger hardware device.
|
||||
string name = 11110001;
|
||||
|
||||
// encoding describes the encoding format used by Amino for the given
|
||||
// message. The field type is chosen to be a string for
|
||||
// flexibility, but it should ideally be short and expected to be
|
||||
// machine-readable, for example "base64" or "utf8_json". We
|
||||
// highly recommend to use underscores for word separation instead of spaces.
|
||||
//
|
||||
// If left empty, then the Amino encoding is expected to be the same as the
|
||||
// Protobuf one.
|
||||
//
|
||||
// This annotation should not be confused with the `encoding`
|
||||
// one which operates on the field level.
|
||||
string message_encoding = 11110002;
|
||||
}
|
||||
|
||||
extend google.protobuf.FieldOptions {
|
||||
// encoding describes the encoding format used by Amino for
|
||||
// the given field. The field type is chosen to be a string for
|
||||
// flexibility, but it should ideally be short and expected to be
|
||||
// machine-readable, for example "base64" or "utf8_json". We
|
||||
// highly recommend to use underscores for word separation instead of spaces.
|
||||
//
|
||||
// If left empty, then the Amino encoding is expected to be the same as the
|
||||
// Protobuf one.
|
||||
//
|
||||
// This annotation should not be confused with the
|
||||
// `message_encoding` one which operates on the message level.
|
||||
string encoding = 11110003;
|
||||
|
||||
// field_name sets a different field name (i.e. key name) in
|
||||
// the amino JSON object for the given field.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// message Foo {
|
||||
// string bar = 1 [(amino.field_name) = "baz"];
|
||||
// }
|
||||
//
|
||||
// Then the Amino encoding of Foo will be:
|
||||
// `{"baz":"some value"}`
|
||||
string field_name = 11110004;
|
||||
|
||||
// dont_omitempty sets the field in the JSON object even if
|
||||
// its value is empty, i.e. equal to the Golang zero value. To learn what
|
||||
// the zero values are, see https://go.dev/ref/spec#The_zero_value.
|
||||
//
|
||||
// Fields default to `omitempty`, which is the default behavior when this
|
||||
// annotation is unset. When set to true, then the field value in the
|
||||
// JSON object will be set, i.e. not `undefined`.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// message Foo {
|
||||
// string bar = 1;
|
||||
// string baz = 2 [(amino.dont_omitempty) = true];
|
||||
// }
|
||||
//
|
||||
// f := Foo{};
|
||||
// out := AminoJSONEncoder(&f);
|
||||
// out == {"baz":""}
|
||||
bool dont_omitempty = 11110005;
|
||||
|
||||
// oneof_name sets the type name for the given field oneof field. This is used
|
||||
// by the Amino JSON encoder to encode the type of the oneof field, and must be the same string in
|
||||
// the RegisterConcrete() method usage used to register the concrete type.
|
||||
string oneof_name = 11110006;
|
||||
}
|
13
proto/cerc/auction/module/v1/module.proto
Normal file
13
proto/cerc/auction/module/v1/module.proto
Normal file
@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.auction.module.v1;
|
||||
|
||||
import "cosmos/app/v1alpha1/module.proto";
|
||||
|
||||
// Module is the app config object of the module.
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconic2d/x/auction"
|
||||
};
|
||||
}
|
@ -1,15 +1,18 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.auction.v1beta1;
|
||||
|
||||
package cerc.auction.v1;
|
||||
|
||||
|
||||
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";
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
// Params defines the auction module parameters
|
||||
message Params {
|
||||
// Write custom stringer method
|
||||
option (gogoproto.goproto_stringer) = false;
|
||||
|
||||
// Duration of the commits phase in seconds
|
||||
@ -18,22 +21,26 @@ message Params {
|
||||
(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,
|
||||
@ -47,26 +54,31 @@ message Auction {
|
||||
|
||||
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 [
|
||||
@ -77,18 +89,22 @@ message Auction {
|
||||
(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,
|
||||
@ -110,26 +126,31 @@ message Bid {
|
||||
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\""
|
||||
];;
|
||||
];
|
||||
}
|
14
proto/cerc/auction/v1/genesis.proto
Normal file
14
proto/cerc/auction/v1/genesis.proto
Normal file
@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.auction.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
// GenesisState defines the genesis state of the auction module
|
||||
message GenesisState {
|
||||
Params params = 1 [(gogoproto.nullable) = false];
|
||||
Auctions auctions = 2 [(gogoproto.moretags) = "json:\"auctions\" yaml:\"auctions\""];
|
||||
}
|
@ -1,22 +1,74 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.auction.v1beta1;
|
||||
|
||||
package cerc.auction.v1;
|
||||
|
||||
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";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/auction/types";
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
// Query defines the gRPC querier interface for the auction module
|
||||
service Query {
|
||||
// Params queries auction module params
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/params";
|
||||
}
|
||||
|
||||
// Auctions queries all auctions
|
||||
rpc Auctions(QueryAuctionsRequest) returns (QueryAuctionsResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/auctions";
|
||||
}
|
||||
|
||||
// GetAuction queries an auction
|
||||
rpc GetAuction(QueryAuctionRequest) returns (QueryAuctionResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/auctions/{id}";
|
||||
}
|
||||
|
||||
// GetBid queries an auction bid
|
||||
rpc GetBid(QueryBidRequest) returns (QueryBidResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/bids/{auction_id}/{bidder}";
|
||||
}
|
||||
|
||||
// GetBids queries all auction bids
|
||||
rpc GetBids(QueryBidsRequest) returns (QueryBidsResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/bids/{auction_id}";
|
||||
}
|
||||
|
||||
// AuctionsByBidder queries auctions by bidder
|
||||
rpc AuctionsByBidder(QueryAuctionsByBidderRequest) returns (QueryAuctionsByBidderResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/by-bidder/{bidder_address}";
|
||||
}
|
||||
|
||||
// AuctionsByOwner queries auctions by owner
|
||||
rpc AuctionsByOwner(QueryAuctionsByOwnerRequest) returns (QueryAuctionsByOwnerResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/by-owner/{owner_address}";
|
||||
}
|
||||
|
||||
// GetAuctionModuleBalance queries the auction module account balance
|
||||
rpc GetAuctionModuleBalance(QueryGetAuctionModuleBalanceRequest) returns (QueryGetAuctionModuleBalanceResponse) {
|
||||
option (google.api.http).get = "/cerc/auction/v1/balance";
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// AuctionsRequest is the format for querying all the auctions
|
||||
message AuctionsRequest {
|
||||
message QueryAuctionsRequest {
|
||||
// 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 {
|
||||
message QueryAuctionsResponse {
|
||||
// List of auctions
|
||||
Auctions auctions = 1;
|
||||
// pagination defines an optional pagination info for the next request
|
||||
@ -24,126 +76,75 @@ message AuctionsResponse {
|
||||
}
|
||||
|
||||
// AuctionRequest is the format for querying a specific auction
|
||||
message AuctionRequest {
|
||||
// Auction ID
|
||||
message QueryAuctionRequest {
|
||||
// Auction id
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// AuctionResponse returns the details of the queried auction
|
||||
message AuctionResponse {
|
||||
message QueryAuctionResponse {
|
||||
// Auction details
|
||||
Auction auction = 1;
|
||||
}
|
||||
|
||||
// BidRequest is the format for querying a specific bid in an auction
|
||||
message BidRequest {
|
||||
// Auction ID
|
||||
message QueryBidRequest {
|
||||
// Auction id
|
||||
string auction_id = 1;
|
||||
// Bidder address
|
||||
string bidder = 2;
|
||||
}
|
||||
|
||||
// BidResponse returns the details of the queried bid
|
||||
message BidResponse {
|
||||
message QueryBidResponse {
|
||||
// Bid details
|
||||
Bid bid = 1;
|
||||
}
|
||||
|
||||
// BidsRequest is the format for querying all bids in an auction
|
||||
message BidsRequest {
|
||||
// Auction ID
|
||||
message QueryBidsRequest {
|
||||
// Auction id
|
||||
string auction_id = 1;
|
||||
}
|
||||
|
||||
// BidsResponse returns details of all bids in an auction
|
||||
message BidsResponse {
|
||||
message QueryBidsResponse {
|
||||
// List of bids in the auction
|
||||
repeated Bid bids = 1;
|
||||
}
|
||||
|
||||
// AuctionsByBidderRequest is the format for querying all auctions containing a bidder address
|
||||
message AuctionsByBidderRequest {
|
||||
message QueryAuctionsByBidderRequest {
|
||||
// Address of the bidder
|
||||
string bidder_address = 1;
|
||||
}
|
||||
|
||||
// AuctionsByBidderResponse returns all auctions containing a bidder
|
||||
message AuctionsByBidderResponse {
|
||||
message QueryAuctionsByBidderResponse {
|
||||
// List of auctions
|
||||
Auctions auctions = 1;
|
||||
}
|
||||
|
||||
// AuctionsByOwnerRequest is the format for querying all auctions created by an owner
|
||||
message AuctionsByOwnerRequest {
|
||||
message QueryAuctionsByOwnerRequest {
|
||||
// Address of the owner
|
||||
string owner_address = 1;
|
||||
}
|
||||
|
||||
// AuctionsByOwnerResponse returns all auctions created by an owner
|
||||
message AuctionsByOwnerResponse {
|
||||
message QueryAuctionsByOwnerResponse {
|
||||
// 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 QueryGetAuctionModuleBalanceRequest {}
|
||||
|
||||
message BalanceResponse {
|
||||
message QueryGetAuctionModuleBalanceResponse {
|
||||
// Set of all balances within the auction
|
||||
repeated cosmos.base.v1beta1.Coin balance = 1 [
|
||||
(gogoproto.nullable) = false
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
||||
(gogoproto.moretags) = "json:\"coins\" yaml:\"coins\""
|
||||
];
|
||||
}
|
||||
|
||||
// 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";
|
||||
}
|
||||
}
|
@ -1,16 +1,40 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.auction.v1beta1;
|
||||
|
||||
package cerc.auction.v1;
|
||||
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "vulcanize/auction/v1beta1/types.proto";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/auction/types";
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
// Tx defines the gRPC tx interface
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
// CreateAuction is the command for creating an auction
|
||||
rpc CreateAuction(MsgCreateAuction) returns (MsgCreateAuctionResponse) {
|
||||
option (google.api.http).post = "/cerc/auction/v1/create_auction";
|
||||
};
|
||||
|
||||
// CommitBid is the command for committing a bid
|
||||
rpc CommitBid(MsgCommitBid) returns (MsgCommitBidResponse) {
|
||||
option (google.api.http).post = "/cerc/auction/v1/commit_bid";
|
||||
};
|
||||
|
||||
// RevealBid is the command for revealing a bid
|
||||
rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse) {
|
||||
option (google.api.http).post = "/cerc/auction/v1/reveal_bid";
|
||||
};
|
||||
}
|
||||
|
||||
// MsgCreateAuction defines a create auction message
|
||||
message MsgCreateAuction {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
// Duration of the commits phase in seconds
|
||||
google.protobuf.Duration commits_duration = 1 [
|
||||
@ -18,105 +42,88 @@ message MsgCreateAuction {
|
||||
(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\""
|
||||
];
|
||||
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\""
|
||||
];
|
||||
Auction auction = 1 [(gogoproto.moretags) = "json:\"auction\" yaml:\"auction\""];
|
||||
}
|
||||
|
||||
// CommitBid defines the message to commit a bid
|
||||
message MsgCommitBid {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
// Auction id
|
||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
||||
|
||||
// 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\""
|
||||
];
|
||||
}
|
||||
string commit_hash = 2 [(gogoproto.moretags) = "json:\"commit_hash\" yaml:\"commit_hash\""];
|
||||
|
||||
// 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\""
|
||||
];
|
||||
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\""
|
||||
];
|
||||
Bid bid = 1 [(gogoproto.moretags) = "json:\"bid\" yaml:\"bid\""];
|
||||
}
|
||||
|
||||
|
||||
// RevealBid defines the message to reveal a bid
|
||||
message MsgRevealBid {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
// 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\""];
|
||||
}
|
||||
|
||||
|
||||
// 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\""
|
||||
];
|
||||
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);
|
||||
}
|
||||
|
13
proto/cerc/bond/module/v1/module.proto
Normal file
13
proto/cerc/bond/module/v1/module.proto
Normal file
@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.bond.module.v1;
|
||||
|
||||
import "cosmos/app/v1alpha1/module.proto";
|
||||
|
||||
// Module is the app config object of the module.
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconic2d/x/bond"
|
||||
};
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.bond.v1beta1;
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/bond/types";
|
||||
package cerc.bond.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
// Params defines the bond module parameters
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// Params defines the parameters of the bond module.
|
||||
message Params {
|
||||
// max_bond_amount is maximum amount to bond
|
||||
cosmos.base.v1beta1.Coin max_bond_amount = 1 [
|
||||
@ -19,11 +20,14 @@ message Params {
|
||||
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.nullable) = false,
|
||||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
||||
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
|
||||
];
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.bond.v1beta1;
|
||||
|
||||
package cerc.bond.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "vulcanize/bond/v1beta1/bond.proto";
|
||||
import "cerc/bond/v1/bond.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/bond/types";
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// GenesisState defines the bond module's genesis state.
|
||||
message GenesisState {
|
||||
@ -12,7 +13,5 @@ message GenesisState {
|
||||
Params params = 1 [(gogoproto.nullable) = false];
|
||||
|
||||
// bonds defines all the bonds
|
||||
repeated Bond bonds = 2 [
|
||||
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
|
||||
];
|
||||
repeated Bond bonds = 2 [(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""];
|
||||
}
|
@ -1,54 +1,55 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.bond.v1beta1;
|
||||
|
||||
package cerc.bond.v1;
|
||||
|
||||
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";
|
||||
import "cerc/bond/v1/bond.proto";
|
||||
// import "cosmos/query/v1/query.proto";
|
||||
|
||||
option go_package = "github.com/tharsis/ethermint/x/bond/types";
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// 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";
|
||||
option (google.api.http).get = "/cerc/bond/v1/params";
|
||||
}
|
||||
|
||||
// Bonds queries bonds list.
|
||||
// Bonds queries bonds list
|
||||
rpc Bonds(QueryGetBondsRequest) returns (QueryGetBondsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds";
|
||||
// Mark query as module_query_safe?
|
||||
// option (cosmos.query.v1.module_query_safe) = true;
|
||||
option (google.api.http).get = "/cerc/bond/v1/bonds";
|
||||
}
|
||||
|
||||
// GetBondById
|
||||
rpc GetBondById(QueryGetBondByIdRequest) returns (QueryGetBondByIdResponse) {
|
||||
option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds/{id}";
|
||||
option (google.api.http).get = "/cerc/bond/v1/bonds/{id}";
|
||||
}
|
||||
|
||||
// Get Bonds List by Owner
|
||||
// Get Bonds list by Owner
|
||||
rpc GetBondsByOwner(QueryGetBondsByOwnerRequest) returns (QueryGetBondsByOwnerResponse) {
|
||||
option (google.api.http).get = "/vulcanize/bond/v1beta1/by-owner/{owner}";
|
||||
option (google.api.http).get = "/cerc/bond/v1/by-owner/{owner}";
|
||||
}
|
||||
|
||||
// Get Bonds module balance
|
||||
// Get Bond module balance
|
||||
rpc GetBondsModuleBalance(QueryGetBondModuleBalanceRequest) returns (QueryGetBondModuleBalanceResponse) {
|
||||
option (google.api.http).get = "/vulcanize/bond/v1beta1/balance";
|
||||
option (google.api.http).get = "/cerc/bond/v1/balance";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is request for query the bond module params
|
||||
message QueryParamsRequest{
|
||||
}
|
||||
message QueryParamsRequest {}
|
||||
|
||||
// QueryParamsResponse returns response type of bond module params
|
||||
message QueryParamsResponse {
|
||||
Params params = 1 [
|
||||
(gogoproto.moretags) = "json:\"params\" yaml:\"params\""
|
||||
];
|
||||
Params params = 1 [(gogoproto.moretags) = "json:\"params\" yaml:\"params\""];
|
||||
}
|
||||
|
||||
// QueryGetBondById queries a bond by bond-id.
|
||||
// QueryGetBondById queries a bonds.
|
||||
message QueryGetBondsRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
@ -56,25 +57,20 @@ message QueryGetBondsRequest{
|
||||
|
||||
// QueryGetBondsResponse is response type for get the bonds by bond-id
|
||||
message QueryGetBondsResponse {
|
||||
repeated Bond bonds = 1 [
|
||||
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
|
||||
];
|
||||
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\""
|
||||
];
|
||||
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\""
|
||||
];
|
||||
Bond bond = 1 [(gogoproto.moretags) = "json:\"bond\" yaml:\"bond\""];
|
||||
}
|
||||
|
||||
// QueryGetBondsByOwnerRequest is request type for Query/GetBondsByOwner RPC Method
|
||||
@ -90,18 +86,17 @@ message QueryGetBondsByOwnerResponse {
|
||||
(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{
|
||||
|
||||
}
|
||||
message QueryGetBondModuleBalanceRequest {}
|
||||
|
||||
// QueryGetBondModuleBalanceResponse is the response type for bond module balance rpc method
|
||||
message QueryGetBondModuleBalanceResponse {
|
||||
repeated cosmos.base.v1beta1.Coin balance = 2 [
|
||||
repeated cosmos.base.v1beta1.Coin balance = 1 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
||||
(gogoproto.moretags) = "json:\"coins\" yaml:\"coins\""
|
95
proto/cerc/bond/v1/tx.proto
Normal file
95
proto/cerc/bond/v1/tx.proto
Normal file
@ -0,0 +1,95 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.bond.v1;
|
||||
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// Msg defines the bond Msg service.
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
// CreateBond defines a method for creating a new bond.
|
||||
rpc CreateBond(MsgCreateBond) returns (MsgCreateBondResponse) {
|
||||
option (google.api.http).post = "/cerc/bond/v1/create_bond";
|
||||
};
|
||||
|
||||
// RefillBond defines a method for refilling amount for bond.
|
||||
rpc RefillBond(MsgRefillBond) returns (MsgRefillBondResponse) {
|
||||
option (google.api.http).post = "/cerc/bond/v1/refill_bond";
|
||||
};
|
||||
|
||||
// WithdrawBond defines a method for withdrawing amount from bond.
|
||||
rpc WithdrawBond(MsgWithdrawBond) returns (MsgWithdrawBondResponse) {
|
||||
option (google.api.http).post = "/cerc/bond/v1/withdraw_bond";
|
||||
};
|
||||
|
||||
// CancelBond defines a method for cancelling a bond.
|
||||
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse) {
|
||||
option (google.api.http).post = "/cerc/bond/v1/cancel_bond";
|
||||
};
|
||||
}
|
||||
|
||||
// MsgCreateBond defines a SDK message for creating a new bond.
|
||||
message MsgCreateBond {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
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 {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
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 {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
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 {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string id = 1;
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgCancelBondResponse defines the Msg/CancelBond response type.
|
||||
message MsgCancelBondResponse {}
|
13
proto/cerc/registry/module/v1/module.proto
Normal file
13
proto/cerc/registry/module/v1/module.proto
Normal file
@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.module.v1;
|
||||
|
||||
import "cosmos/app/v1alpha1/module.proto";
|
||||
|
||||
// Module is the app config object of the module.
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconic2d/x/registry"
|
||||
};
|
||||
}
|
32
proto/cerc/registry/v1/genesis.proto
Normal file
32
proto/cerc/registry/v1/genesis.proto
Normal file
@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// GenesisState defines the registry module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the params of registry 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\""
|
||||
];
|
||||
}
|
200
proto/cerc/registry/v1/query.proto
Normal file
200
proto/cerc/registry/v1/query.proto
Normal file
@ -0,0 +1,200 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// Query defines the gRPC querier service for registry module
|
||||
service Query {
|
||||
// Params queries the registry module params.
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/params";
|
||||
}
|
||||
|
||||
// Records queries all records
|
||||
rpc Records(QueryRecordsRequest) returns (QueryRecordsResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/records";
|
||||
}
|
||||
|
||||
// Get record by id
|
||||
rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/records/{id}";
|
||||
}
|
||||
|
||||
// Get records by bond id
|
||||
rpc GetRecordsByBondId(QueryRecordsByBondIdRequest) returns (QueryRecordsByBondIdResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/records-by-bond-id/{id}";
|
||||
}
|
||||
|
||||
// NameRecords queries all name records
|
||||
rpc NameRecords(QueryNameRecordsRequest) returns (QueryNameRecordsResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/names";
|
||||
}
|
||||
|
||||
// Whois method retrieve the name authority info
|
||||
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/whois/{name}";
|
||||
}
|
||||
|
||||
// LookupLrn
|
||||
rpc LookupLrn(QueryLookupLrnRequest) returns (QueryLookupLrnResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/lookup";
|
||||
}
|
||||
|
||||
// ResolveLrn
|
||||
rpc ResolveLrn(QueryResolveLrnRequest) returns (QueryResolveLrnResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/resolve";
|
||||
}
|
||||
|
||||
// Get registry module balance
|
||||
rpc GetRegistryModuleBalance(QueryGetRegistryModuleBalanceRequest) returns (QueryGetRegistryModuleBalanceResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/balance";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is request type for registry params
|
||||
message QueryParamsRequest {}
|
||||
|
||||
// QueryParamsResponse is response type for registry params
|
||||
message QueryParamsResponse {
|
||||
Params params = 1;
|
||||
}
|
||||
|
||||
// QueryRecordsRequest is request type for registry records list
|
||||
message QueryRecordsRequest {
|
||||
// TODO: Unused, check
|
||||
// message LinkInput {
|
||||
// string id = 1;
|
||||
// }
|
||||
|
||||
message ArrayInput {
|
||||
repeated ValueInput values = 1;
|
||||
}
|
||||
message MapInput {
|
||||
map<string, ValueInput> values = 1;
|
||||
}
|
||||
message ValueInput {
|
||||
// Type of record attribute value
|
||||
oneof value {
|
||||
string string = 1;
|
||||
int64 int = 2;
|
||||
double float = 3;
|
||||
bool boolean = 4;
|
||||
string link = 5;
|
||||
ArrayInput array = 6;
|
||||
MapInput map = 7;
|
||||
}
|
||||
}
|
||||
message KeyValueInput {
|
||||
string key = 1;
|
||||
ValueInput value = 2;
|
||||
}
|
||||
|
||||
repeated KeyValueInput attributes = 1;
|
||||
|
||||
bool all = 2;
|
||||
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
||||
}
|
||||
|
||||
// QueryRecordsResponse is response type for registry records list
|
||||
message QueryRecordsResponse {
|
||||
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 registry records by id
|
||||
message QueryRecordByIdRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// QueryRecordByIdResponse is response type for registry records by id
|
||||
message QueryRecordByIdResponse {
|
||||
Record record = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// QueryRecordsByBondIdRequest is request type for get the records by bond-id
|
||||
message QueryRecordsByBondIdRequest {
|
||||
string id = 1;
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||
}
|
||||
|
||||
// QueryRecordsByBondIdResponse is response type for records list by bond-id
|
||||
message QueryRecordsByBondIdResponse {
|
||||
repeated Record records = 1 [(gogoproto.nullable) = false];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryNameRecordsRequest is request type for registry names records
|
||||
message QueryNameRecordsRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryNameRecordsResponse is response type for registry names records
|
||||
message QueryNameRecordsResponse {
|
||||
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:\"name_authority\" yaml:\"name_authority\""
|
||||
];
|
||||
}
|
||||
|
||||
// QueryLookupLrnRequest is request type for LookupLrn
|
||||
message QueryLookupLrnRequest {
|
||||
string lrn = 1;
|
||||
}
|
||||
|
||||
// QueryLookupLrnResponse is response type for QueryLookupLrnRequest
|
||||
message QueryLookupLrnResponse {
|
||||
NameRecord name = 1;
|
||||
}
|
||||
|
||||
// QueryResolveLrnRequest is request type for ResolveLrn
|
||||
message QueryResolveLrnRequest {
|
||||
string lrn = 1;
|
||||
}
|
||||
|
||||
// QueryResolveLrnResponse is response type for QueryResolveLrnRequest
|
||||
message QueryResolveLrnResponse {
|
||||
Record record = 1;
|
||||
}
|
||||
|
||||
// QueryGetRegistryModuleBalanceRequest is request type for registry module accounts balance
|
||||
message QueryGetRegistryModuleBalanceRequest {}
|
||||
|
||||
// QueryGetRegistryModuleBalanceResponse is response type for registry module accounts balance
|
||||
message QueryGetRegistryModuleBalanceResponse {
|
||||
repeated AccountBalance balances = 1;
|
||||
}
|
||||
|
||||
// AccountBalance is registry module account balance
|
||||
message AccountBalance {
|
||||
string account_name = 1 [(gogoproto.moretags) = "json:\"account_name\" yaml:\"account_name\""];
|
||||
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\""
|
||||
];
|
||||
}
|
@ -1,66 +1,80 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
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/cerc-io/laconicd/x/registry/types";
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// Params defines the registry module parameters
|
||||
message Params {
|
||||
cosmos.base.v1beta1.Coin record_rent = 1
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""];
|
||||
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\""];
|
||||
|
||||
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\""];
|
||||
|
||||
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 registry module records
|
||||
// Record defines a registry record
|
||||
message Record {
|
||||
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
|
||||
string create_time = 3 [(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""];
|
||||
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""];
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string create_time = 3 [(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""];
|
||||
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiry_time\" yaml:\"expiry_time\""];
|
||||
bool deleted = 5;
|
||||
repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""];
|
||||
bytes attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""];
|
||||
@ -68,7 +82,7 @@ message Record {
|
||||
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
|
||||
}
|
||||
|
||||
// AuthorityEntry defines the registry module AuthorityEntries
|
||||
// AuthorityEntry defines a registry authority
|
||||
message AuthorityEntry {
|
||||
string name = 1;
|
||||
NameAuthority entry = 2;
|
||||
@ -77,18 +91,19 @@ message AuthorityEntry {
|
||||
// NameAuthority
|
||||
message NameAuthority {
|
||||
// Owner public key.
|
||||
string owner_public_key = 1 [(gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\""];
|
||||
string owner_public_key = 1 [(gogoproto.moretags) = "json:\"owner_public_key\" yaml:\"owner_public_key\""];
|
||||
// Owner address.
|
||||
string owner_address = 2 [(gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\""];
|
||||
string owner_address = 2 [(gogoproto.moretags) = "json:\"owner_address\" yaml:\"owner_address\""];
|
||||
// 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\""];
|
||||
string auction_id = 5 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
||||
string bond_id = 6 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
|
||||
google.protobuf.Timestamp expiry_time = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdtime) = true,
|
||||
(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""
|
||||
(gogoproto.moretags) = "json:\"expiry_time\" yaml:\"expiry_time\""
|
||||
];
|
||||
}
|
||||
|
||||
@ -98,7 +113,7 @@ message NameEntry {
|
||||
NameRecord entry = 2;
|
||||
}
|
||||
|
||||
// NameRecord
|
||||
// NameRecord defines a versioned name record
|
||||
message NameRecord {
|
||||
NameRecordEntry latest = 1;
|
||||
repeated NameRecordEntry history = 2;
|
||||
@ -113,21 +128,19 @@ message NameRecordEntry {
|
||||
// Signature
|
||||
message Signature {
|
||||
string sig = 1 [(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""];
|
||||
string pub_key = 2 [(gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\""];
|
||||
string pub_key = 2 [(gogoproto.moretags) = "json:\"pub_key\" yaml:\"pub_key\""];
|
||||
}
|
||||
|
||||
// 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;
|
||||
// ExpiryQueue: record / authority expiry queue type
|
||||
// id: expiry time
|
||||
// value: array of ids (record cids / authority names)
|
||||
message ExpiryQueue {
|
||||
string id = 1;
|
||||
repeated string value = 2;
|
||||
}
|
||||
|
||||
// AuctionBidInfo
|
||||
message AuctionBidInfo {
|
||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
|
||||
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""];
|
||||
// List of record ids
|
||||
// Value type to be used in AttributesMap
|
||||
message RecordsList {
|
||||
repeated string value = 1;
|
||||
}
|
194
proto/cerc/registry/v1/tx.proto
Normal file
194
proto/cerc/registry/v1/tx.proto
Normal file
@ -0,0 +1,194 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// Msg is a service which exposes the registry functionality
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
// SetRecord records a new record with given payload and bond id
|
||||
rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/set_record";
|
||||
}
|
||||
|
||||
// Renew Record renews an expired record
|
||||
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/renew_record";
|
||||
}
|
||||
|
||||
// AssociateBond
|
||||
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/associate_bond";
|
||||
}
|
||||
|
||||
// DissociateBond
|
||||
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/dissociate_bond";
|
||||
}
|
||||
|
||||
// DissociateRecords
|
||||
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/dissociate_records";
|
||||
}
|
||||
|
||||
// ReassociateRecords
|
||||
rpc ReassociateRecords(MsgReassociateRecords) returns (MsgReassociateRecordsResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/reassociate_records";
|
||||
}
|
||||
|
||||
// SetName will store the name with given lrn and name
|
||||
rpc SetName(MsgSetName) returns (MsgSetNameResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/set_name";
|
||||
}
|
||||
|
||||
// Reserve name
|
||||
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/reserve_name";
|
||||
}
|
||||
|
||||
// Delete Name method will remove authority name
|
||||
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/delete_name";
|
||||
}
|
||||
|
||||
// SetAuthorityBond
|
||||
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/set_authority_bond";
|
||||
}
|
||||
}
|
||||
|
||||
// MsgSetRecord
|
||||
message MsgSetRecord {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string bond_id = 1 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 2;
|
||||
Payload payload = 3 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// MsgSetRecordResponse
|
||||
message MsgSetRecordResponse {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// Payload
|
||||
message Payload {
|
||||
Record record = 1;
|
||||
repeated Signature signatures = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""
|
||||
];
|
||||
}
|
||||
|
||||
// MsgSetName
|
||||
message MsgSetName {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string lrn = 1;
|
||||
string cid = 2;
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetNameResponse
|
||||
message MsgSetNameResponse {}
|
||||
|
||||
// MsgReserveName
|
||||
message MsgReserveAuthority {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string name = 1;
|
||||
string signer = 2;
|
||||
|
||||
// if creating a sub-authority.
|
||||
string owner = 3;
|
||||
}
|
||||
|
||||
// MsgReserveNameResponse
|
||||
message MsgReserveAuthorityResponse {}
|
||||
|
||||
// MsgSetAuthorityBond
|
||||
message MsgSetAuthorityBond {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string name = 1;
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetAuthorityBondResponse
|
||||
message MsgSetAuthorityBondResponse {}
|
||||
|
||||
// MsgDeleteNameAuthority
|
||||
message MsgDeleteNameAuthority {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string lrn = 1;
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDeleteNameAuthorityResponse
|
||||
message MsgDeleteNameAuthorityResponse {}
|
||||
|
||||
// MsgRenewRecord
|
||||
message MsgRenewRecord {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgRenewRecordResponse
|
||||
message MsgRenewRecordResponse {}
|
||||
|
||||
// MsgAssociateBond
|
||||
message MsgAssociateBond {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgAssociateBondResponse
|
||||
message MsgAssociateBondResponse {}
|
||||
|
||||
// MsgDissociateBond
|
||||
message MsgDissociateBond {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateBondResponse
|
||||
message MsgDissociateBondResponse {}
|
||||
|
||||
// MsgDissociateRecords
|
||||
message MsgDissociateRecords {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string bond_id = 1 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateRecordsResponse
|
||||
message MsgDissociateRecordsResponse {}
|
||||
|
||||
// MsgReassociateRecords
|
||||
message MsgReassociateRecords {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string new_bond_id = 1 [(gogoproto.moretags) = "json:\"new_bond_id\" yaml:\"new_bond_id\""];
|
||||
string old_bond_id = 2 [(gogoproto.moretags) = "json:\"old_bond_id\" yaml:\"old_bond_id\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgReassociateRecordsResponse
|
||||
message MsgReassociateRecordsResponse {}
|
91
proto/cosmos/app/v1alpha1/module.proto
Normal file
91
proto/cosmos/app/v1alpha1/module.proto
Normal file
@ -0,0 +1,91 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cosmos.app.v1alpha1;
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
// module indicates that this proto type is a config object for an app module
|
||||
// and optionally provides other descriptive information about the module.
|
||||
// It is recommended that a new module config object and go module is versioned
|
||||
// for every state machine breaking version of a module. The recommended
|
||||
// pattern for doing this is to put module config objects in a separate proto
|
||||
// package from the API they expose. Ex: the cosmos.group.v1 API would be
|
||||
// exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc.
|
||||
ModuleDescriptor module = 57193479;
|
||||
}
|
||||
|
||||
// ModuleDescriptor describes an app module.
|
||||
message ModuleDescriptor {
|
||||
// go_import names the package that should be imported by an app to load the
|
||||
// module in the runtime module registry. It is required to make debugging
|
||||
// of configuration errors easier for users.
|
||||
string go_import = 1;
|
||||
|
||||
// use_package refers to a protobuf package that this module
|
||||
// uses and exposes to the world. In an app, only one module should "use"
|
||||
// or own a single protobuf package. It is assumed that the module uses
|
||||
// all of the .proto files in a single package.
|
||||
repeated PackageReference use_package = 2;
|
||||
|
||||
// can_migrate_from defines which module versions this module can migrate
|
||||
// state from. The framework will check that one module version is able to
|
||||
// migrate from a previous module version before attempting to update its
|
||||
// config. It is assumed that modules can transitively migrate from earlier
|
||||
// versions. For instance if v3 declares it can migrate from v2, and v2
|
||||
// declares it can migrate from v1, the framework knows how to migrate
|
||||
// from v1 to v3, assuming all 3 module versions are registered at runtime.
|
||||
repeated MigrateFromInfo can_migrate_from = 3;
|
||||
}
|
||||
|
||||
// PackageReference is a reference to a protobuf package used by a module.
|
||||
message PackageReference {
|
||||
// name is the fully-qualified name of the package.
|
||||
string name = 1;
|
||||
|
||||
// revision is the optional revision of the package that is being used.
|
||||
// Protobuf packages used in Cosmos should generally have a major version
|
||||
// as the last part of the package name, ex. foo.bar.baz.v1.
|
||||
// The revision of a package can be thought of as the minor version of a
|
||||
// package which has additional backwards compatible definitions that weren't
|
||||
// present in a previous version.
|
||||
//
|
||||
// A package should indicate its revision with a source code comment
|
||||
// above the package declaration in one of its files containing the
|
||||
// text "Revision N" where N is an integer revision. All packages start
|
||||
// at revision 0 the first time they are released in a module.
|
||||
//
|
||||
// When a new version of a module is released and items are added to existing
|
||||
// .proto files, these definitions should contain comments of the form
|
||||
// "Since: Revision N" where N is an integer revision.
|
||||
//
|
||||
// When the module runtime starts up, it will check the pinned proto
|
||||
// image and panic if there are runtime protobuf definitions that are not
|
||||
// in the pinned descriptor which do not have
|
||||
// a "Since Revision N" comment or have a "Since Revision N" comment where
|
||||
// N is <= to the revision specified here. This indicates that the protobuf
|
||||
// files have been updated, but the pinned file descriptor hasn't.
|
||||
//
|
||||
// If there are items in the pinned file descriptor with a revision
|
||||
// greater than the value indicated here, this will also cause a panic
|
||||
// as it may mean that the pinned descriptor for a legacy module has been
|
||||
// improperly updated or that there is some other versioning discrepancy.
|
||||
// Runtime protobuf definitions will also be checked for compatibility
|
||||
// with pinned file descriptors to make sure there are no incompatible changes.
|
||||
//
|
||||
// This behavior ensures that:
|
||||
// * pinned proto images are up-to-date
|
||||
// * protobuf files are carefully annotated with revision comments which
|
||||
// are important good client UX
|
||||
// * protobuf files are changed in backwards and forwards compatible ways
|
||||
uint32 revision = 2;
|
||||
}
|
||||
|
||||
// MigrateFromInfo is information on a module version that a newer module
|
||||
// can migrate from.
|
||||
message MigrateFromInfo {
|
||||
|
||||
// module is the fully-qualified protobuf name of the module config object
|
||||
// for the previous module version, ex: "cosmos.group.module.v1.Module".
|
||||
string module = 1;
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
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;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
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;
|
||||
}
|
@ -32,6 +32,8 @@ message PageRequest {
|
||||
bool count_total = 4;
|
||||
|
||||
// reverse is set to true if results are to be returned in the descending order.
|
||||
//
|
||||
// Since: cosmos-sdk 0.43
|
||||
bool reverse = 5;
|
||||
}
|
||||
|
||||
@ -44,7 +46,8 @@ message PageRequest {
|
||||
// }
|
||||
message PageResponse {
|
||||
// next_key is the key to be passed to PageRequest.key to
|
||||
// query the next page most efficiently
|
||||
// query the next page most efficiently. It will be empty if
|
||||
// there are no more results.
|
||||
bytes next_key = 1;
|
||||
|
||||
// total is total number of results available if PageRequest.count_total
|
||||
|
@ -1,44 +0,0 @@
|
||||
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;
|
||||
}
|
@ -1,217 +0,0 @@
|
||||
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;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
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
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
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;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
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;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
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;
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
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;
|
||||
}
|
@ -2,6 +2,8 @@ syntax = "proto3";
|
||||
package cosmos.base.v1beta1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos_proto/cosmos.proto";
|
||||
import "amino/amino.proto";
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/types";
|
||||
option (gogoproto.goproto_stringer_all) = false;
|
||||
@ -15,7 +17,12 @@ message Coin {
|
||||
option (gogoproto.equal) = true;
|
||||
|
||||
string denom = 1;
|
||||
string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
|
||||
string amount = 2 [
|
||||
(cosmos_proto.scalar) = "cosmos.Int",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.Int",
|
||||
(gogoproto.nullable) = false,
|
||||
(amino.dont_omitempty) = true
|
||||
];
|
||||
}
|
||||
|
||||
// DecCoin defines a token with a denomination and a decimal amount.
|
||||
@ -26,15 +33,29 @@ message DecCoin {
|
||||
option (gogoproto.equal) = true;
|
||||
|
||||
string denom = 1;
|
||||
string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
|
||||
string amount = 2 [
|
||||
(cosmos_proto.scalar) = "cosmos.Dec",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
||||
// IntProto defines a Protobuf wrapper around an Int object.
|
||||
// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
|
||||
message IntProto {
|
||||
string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
|
||||
string int = 1 [
|
||||
(cosmos_proto.scalar) = "cosmos.Int",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.Int",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
||||
// DecProto defines a Protobuf wrapper around a Dec object.
|
||||
// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
|
||||
message DecProto {
|
||||
string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
|
||||
string dec = 1 [
|
||||
(cosmos_proto.scalar) = "cosmos.Dec",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
}
|
||||
|
30
proto/cosmos/msg/v1/msg.proto
Normal file
30
proto/cosmos/msg/v1/msg.proto
Normal file
@ -0,0 +1,30 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cosmos.msg.v1;
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated.
|
||||
// We need this right now because gogoproto codegen needs to import the extension.
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice";
|
||||
|
||||
extend google.protobuf.ServiceOptions {
|
||||
// service indicates that the service is a Msg service and that requests
|
||||
// must be transported via blockchain transactions rather than gRPC.
|
||||
// Tooling can use this annotation to distinguish between Msg services and
|
||||
// other types of services via reflection.
|
||||
bool service = 11110000;
|
||||
}
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
// signer must be used in cosmos messages in order
|
||||
// to signal to external clients which fields in a
|
||||
// given cosmos message must be filled with signer
|
||||
// information (address).
|
||||
// The field must be the protobuf name of the message
|
||||
// field extended with this MessageOption.
|
||||
// The field must either be of string kind, or of message
|
||||
// kind in case the signer information is contained within
|
||||
// a message inside the cosmos message.
|
||||
repeated string signer = 11110000;
|
||||
}
|
97
proto/cosmos_proto/cosmos.proto
Normal file
97
proto/cosmos_proto/cosmos.proto
Normal file
@ -0,0 +1,97 @@
|
||||
syntax = "proto3";
|
||||
package cosmos_proto;
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto";
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
|
||||
// implements_interface is used to indicate the type name of the interface
|
||||
// that a message implements so that it can be used in google.protobuf.Any
|
||||
// fields that accept that interface. A message can implement multiple
|
||||
// interfaces. Interfaces should be declared using a declare_interface
|
||||
// file option.
|
||||
repeated string implements_interface = 93001;
|
||||
}
|
||||
|
||||
extend google.protobuf.FieldOptions {
|
||||
|
||||
// accepts_interface is used to annotate that a google.protobuf.Any
|
||||
// field accepts messages that implement the specified interface.
|
||||
// Interfaces should be declared using a declare_interface file option.
|
||||
string accepts_interface = 93001;
|
||||
|
||||
// scalar is used to indicate that this field follows the formatting defined
|
||||
// by the named scalar which should be declared with declare_scalar. Code
|
||||
// generators may choose to use this information to map this field to a
|
||||
// language-specific type representing the scalar.
|
||||
string scalar = 93002;
|
||||
}
|
||||
|
||||
extend google.protobuf.FileOptions {
|
||||
|
||||
// declare_interface declares an interface type to be used with
|
||||
// accepts_interface and implements_interface. Interface names are
|
||||
// expected to follow the following convention such that their declaration
|
||||
// can be discovered by tools: for a given interface type a.b.C, it is
|
||||
// expected that the declaration will be found in a protobuf file named
|
||||
// a/b/interfaces.proto in the file descriptor set.
|
||||
repeated InterfaceDescriptor declare_interface = 793021;
|
||||
|
||||
// declare_scalar declares a scalar type to be used with
|
||||
// the scalar field option. Scalar names are
|
||||
// expected to follow the following convention such that their declaration
|
||||
// can be discovered by tools: for a given scalar type a.b.C, it is
|
||||
// expected that the declaration will be found in a protobuf file named
|
||||
// a/b/scalars.proto in the file descriptor set.
|
||||
repeated ScalarDescriptor declare_scalar = 793022;
|
||||
}
|
||||
|
||||
// InterfaceDescriptor describes an interface type to be used with
|
||||
// accepts_interface and implements_interface and declared by declare_interface.
|
||||
message InterfaceDescriptor {
|
||||
|
||||
// name is the name of the interface. It should be a short-name (without
|
||||
// a period) such that the fully qualified name of the interface will be
|
||||
// package.name, ex. for the package a.b and interface named C, the
|
||||
// fully-qualified name will be a.b.C.
|
||||
string name = 1;
|
||||
|
||||
// description is a human-readable description of the interface and its
|
||||
// purpose.
|
||||
string description = 2;
|
||||
}
|
||||
|
||||
// ScalarDescriptor describes an scalar type to be used with
|
||||
// the scalar field option and declared by declare_scalar.
|
||||
// Scalars extend simple protobuf built-in types with additional
|
||||
// syntax and semantics, for instance to represent big integers.
|
||||
// Scalars should ideally define an encoding such that there is only one
|
||||
// valid syntactical representation for a given semantic meaning,
|
||||
// i.e. the encoding should be deterministic.
|
||||
message ScalarDescriptor {
|
||||
|
||||
// name is the name of the scalar. It should be a short-name (without
|
||||
// a period) such that the fully qualified name of the scalar will be
|
||||
// package.name, ex. for the package a.b and scalar named C, the
|
||||
// fully-qualified name will be a.b.C.
|
||||
string name = 1;
|
||||
|
||||
// description is a human-readable description of the scalar and its
|
||||
// encoding format. For instance a big integer or decimal scalar should
|
||||
// specify precisely the expected encoding format.
|
||||
string description = 2;
|
||||
|
||||
// field_type is the type of field with which this scalar can be used.
|
||||
// Scalars can be used with one and only one type of field so that
|
||||
// encoding standards and simple and clear. Currently only string and
|
||||
// bytes fields are supported for scalars.
|
||||
repeated ScalarType field_type = 3;
|
||||
}
|
||||
|
||||
enum ScalarType {
|
||||
SCALAR_TYPE_UNSPECIFIED = 0;
|
||||
SCALAR_TYPE_STRING = 1;
|
||||
SCALAR_TYPE_BYTES = 2;
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
// 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;
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
// 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": <string>,
|
||||
// "lastName": <string>
|
||||
// }
|
||||
//
|
||||
// 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;
|
@ -36,6 +36,7 @@
|
||||
// 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;
|
||||
@ -128,6 +129,7 @@ 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;
|
||||
}
|
||||
@ -197,7 +199,6 @@ message FieldDescriptorProto {
|
||||
// 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
|
||||
@ -304,6 +305,7 @@ message MethodDescriptorProto {
|
||||
optional bool server_streaming = 6 [default = false];
|
||||
}
|
||||
|
||||
|
||||
// ===================================================================
|
||||
// Options
|
||||
|
||||
@ -344,17 +346,18 @@ message FileOptions {
|
||||
// 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).
|
||||
|
||||
// Controls the name of the wrapper Java class generated for the .proto file.
|
||||
// That class will always contain the .proto file's getDescriptor() method as
|
||||
// well as any top-level extensions defined in the .proto file.
|
||||
// If java_multiple_files is disabled, then all the other classes from the
|
||||
// .proto file will be nested inside the single wrapper outer class.
|
||||
optional string java_outer_classname = 8;
|
||||
|
||||
// If set true, then the Java code generator will generate a separate .java
|
||||
// If enabled, 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
|
||||
// file. Thus, these types will *not* be nested inside the wrapper class
|
||||
// named by java_outer_classname. However, the wrapper 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];
|
||||
@ -370,6 +373,7 @@ message FileOptions {
|
||||
// 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,
|
||||
@ -386,6 +390,9 @@ message FileOptions {
|
||||
// - 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).
|
||||
@ -411,6 +418,7 @@ message FileOptions {
|
||||
// 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;
|
||||
@ -443,6 +451,7 @@ message FileOptions {
|
||||
// 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;
|
||||
@ -486,6 +495,8 @@ message MessageOptions {
|
||||
// this is a formalization for deprecating messages.
|
||||
optional bool deprecated = 3 [default = false];
|
||||
|
||||
reserved 4, 5, 6;
|
||||
|
||||
// Whether the message is an automatically generated map entry type for the
|
||||
// maps field.
|
||||
//
|
||||
@ -512,6 +523,7 @@ message MessageOptions {
|
||||
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;
|
||||
|
||||
@ -591,8 +603,19 @@ message FieldOptions {
|
||||
// implementation must either *always* check its required fields, or *never*
|
||||
// check its required fields, regardless of whether or not the message has
|
||||
// been parsed.
|
||||
//
|
||||
// As of 2021, lazy does no correctness checks on the byte stream during
|
||||
// parsing. This may lead to crashes if and when an invalid byte stream is
|
||||
// finally parsed upon access.
|
||||
//
|
||||
// TODO(b/211906113): Enable validation on lazy fields.
|
||||
optional bool lazy = 5 [default = false];
|
||||
|
||||
// unverified_lazy does no correctness checks on the byte stream. This should
|
||||
// only be used where lazy with verification is prohibitive for performance
|
||||
// reasons.
|
||||
optional bool unverified_lazy = 15 [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
|
||||
@ -602,6 +625,7 @@ message FieldOptions {
|
||||
// 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;
|
||||
|
||||
@ -695,7 +719,8 @@ message MethodOptions {
|
||||
NO_SIDE_EFFECTS = 1; // implies idempotent
|
||||
IDEMPOTENT = 2; // idempotent, but may have side effects
|
||||
}
|
||||
optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];
|
||||
optional IdempotencyLevel idempotency_level = 34
|
||||
[default = IDEMPOTENCY_UNKNOWN];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
@ -704,6 +729,7 @@ message MethodOptions {
|
||||
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,
|
||||
@ -714,8 +740,8 @@ 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".
|
||||
// E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
|
||||
// "foo.(bar.baz).moo".
|
||||
message NamePart {
|
||||
required string name_part = 1;
|
||||
required bool is_extension = 2;
|
||||
@ -787,8 +813,8 @@ message SourceCodeInfo {
|
||||
// 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:
|
||||
// the root FileDescriptorProto to the place where the definition occurs.
|
||||
// For example, this path:
|
||||
// [ 4, 3, 2, 7, 1 ]
|
||||
// refers to:
|
||||
// file.message_type(3) // 4, 3
|
||||
@ -842,13 +868,13 @@ message SourceCodeInfo {
|
||||
// // Comment attached to baz.
|
||||
// // Another line attached to baz.
|
||||
//
|
||||
// // Comment attached to qux.
|
||||
// // Comment attached to moo.
|
||||
// //
|
||||
// // Another line attached to qux.
|
||||
// optional double qux = 4;
|
||||
// // Another line attached to moo.
|
||||
// optional double moo = 4;
|
||||
//
|
||||
// // Detached comment for corge. This is not leading or trailing comments
|
||||
// // to qux or corge because there are blank lines separating it from
|
||||
// // to moo or corge because there are blank lines separating it from
|
||||
// // both.
|
||||
//
|
||||
// // Detached comment for corge paragraph 2.
|
||||
|
@ -32,13 +32,13 @@ syntax = "proto3";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "google.golang.org/protobuf/types/known/durationpb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "DurationProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
|
||||
// A Duration represents a signed, fixed-length span of time represented
|
||||
// as a count of seconds and fractions of seconds at nanosecond
|
||||
@ -99,6 +99,7 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
||||
// microsecond should be expressed in JSON format as "3.000001s".
|
||||
//
|
||||
//
|
||||
message Duration {
|
||||
// Signed seconds of the span of time. Must be from -315,576,000,000
|
||||
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
||||
|
@ -32,13 +32,13 @@ syntax = "proto3";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "google.golang.org/protobuf/types/known/timestamppb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "TimestampProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
|
||||
// A Timestamp represents a point in time independent of any time zone or local
|
||||
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||
@ -90,6 +90,7 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
//
|
||||
//
|
||||
// Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
//
|
||||
// Instant now = Instant.now();
|
||||
@ -98,6 +99,7 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
// .setNanos(now.getNano()).build();
|
||||
//
|
||||
//
|
||||
// Example 6: Compute Timestamp from current time in Python.
|
||||
//
|
||||
// timestamp = Timestamp()
|
||||
@ -127,9 +129,10 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
//
|
||||
message Timestamp {
|
||||
// Represents seconds of UTC time since Unix epoch
|
||||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
|
@ -1,15 +0,0 @@
|
||||
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\""
|
||||
];
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
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{
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "vulcanize/registry/v1beta1/registry.proto";
|
||||
|
||||
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
|
||||
|
||||
// GenesisState defines the registry module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the params of registry 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\""];
|
||||
}
|
@ -1,225 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
import "vulcanize/registry/v1beta1/registry.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/cerc-io/laconicd/x/registry/types";
|
||||
|
||||
// Query defines the gRPC querier service for registry module
|
||||
service Query {
|
||||
// Params queries the registry module params.
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/params";
|
||||
}
|
||||
// List records
|
||||
rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/records";
|
||||
}
|
||||
// Get record by id
|
||||
rpc GetRecord(QueryRecordByIDRequest) returns (QueryRecordByIDResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/records/{id}";
|
||||
}
|
||||
// Get records by bond id
|
||||
rpc GetRecordByBondID(QueryRecordByBondIDRequest) returns (QueryRecordByBondIDResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/records-by-bond-id/{id}";
|
||||
}
|
||||
// Get registry module balance
|
||||
rpc GetRegistryModuleBalance(GetRegistryModuleBalanceRequest) returns (GetRegistryModuleBalanceResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/balance";
|
||||
}
|
||||
// List name records
|
||||
rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/names";
|
||||
}
|
||||
// Whois method retrieve the name authority info
|
||||
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/whois/{name}";
|
||||
}
|
||||
// LookupCrn
|
||||
rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/lookup";
|
||||
}
|
||||
// ResolveCrn
|
||||
rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/resolve";
|
||||
}
|
||||
// GetRecordExpiryQueue
|
||||
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/record-expiry";
|
||||
}
|
||||
// GetAuthorityExpiryQueue
|
||||
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse) {
|
||||
option (google.api.http).get = "/vulcanize/registry/v1beta1/authority-expiry";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is request type for registry params
|
||||
message QueryParamsRequest {}
|
||||
|
||||
// QueryParamsResponse is response type for registry params
|
||||
message QueryParamsResponse {
|
||||
Params params = 1;
|
||||
}
|
||||
|
||||
// QueryListRecordsRequest is request type for registry records list
|
||||
message QueryListRecordsRequest {
|
||||
message LinkInput {
|
||||
string id = 1;
|
||||
}
|
||||
message ArrayInput {
|
||||
repeated ValueInput values = 1;
|
||||
}
|
||||
message MapInput {
|
||||
map<string, ValueInput> values = 1;
|
||||
}
|
||||
message ValueInput {
|
||||
oneof value {
|
||||
string string = 1;
|
||||
int64 int = 2;
|
||||
double float = 3;
|
||||
bool boolean = 4;
|
||||
string link = 5;
|
||||
ArrayInput array = 6;
|
||||
MapInput map = 7;
|
||||
}
|
||||
}
|
||||
message KeyValueInput {
|
||||
string key = 1;
|
||||
ValueInput value = 2;
|
||||
}
|
||||
repeated KeyValueInput attributes = 1;
|
||||
|
||||
bool all = 2;
|
||||
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
||||
}
|
||||
|
||||
// QueryListRecordsResponse is response type for registry 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 registry records by id
|
||||
message QueryRecordByIDRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// QueryRecordByIDResponse is response type for registry 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;
|
||||
}
|
||||
|
||||
// GetRegistryModuleBalanceRequest is request type for registry module accounts balance
|
||||
message GetRegistryModuleBalanceRequest {}
|
||||
|
||||
// GetRegistryModuleBalanceResponse is response type for registry module accounts balance
|
||||
message GetRegistryModuleBalanceResponse {
|
||||
repeated AccountBalance balances = 1;
|
||||
}
|
||||
|
||||
// AccountBalance is registry 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 registry names records
|
||||
message QueryListNameRecordsRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryListNameRecordsResponse is response type for registry 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\""];
|
||||
}
|
||||
|
||||
// QueryLookupCrn is request type for LookupCrn
|
||||
message QueryLookupCrn {
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryLookupCrnResponse is response type for QueryLookupCrn
|
||||
message QueryLookupCrnResponse {
|
||||
NameRecord name = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrn is request type for ResolveCrn
|
||||
message QueryResolveCrn {
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrnResponse is response type for QueryResolveCrn
|
||||
message QueryResolveCrnResponse {
|
||||
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;
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package vulcanize.registry.v1beta1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "vulcanize/registry/v1beta1/registry.proto";
|
||||
|
||||
option go_package = "github.com/cerc-io/laconicd/x/registry/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 crn 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 {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// Payload
|
||||
message Payload {
|
||||
Record record = 1;
|
||||
repeated Signature signatures = 2
|
||||
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""];
|
||||
}
|
||||
|
||||
// MsgSetName
|
||||
message MsgSetName {
|
||||
string crn = 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 crn = 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 {}
|
@ -5,36 +5,15 @@ set -e
|
||||
|
||||
REPO_ROOT=$(pwd)
|
||||
I=$REPO_ROOT/proto
|
||||
DEST_TS=$REPO_ROOT/src/proto/
|
||||
DEST_TS=$REPO_ROOT/src/proto2/
|
||||
|
||||
echo "Generating protobuf files"
|
||||
|
||||
mkdir -p $DEST_TS
|
||||
|
||||
protoc \
|
||||
--plugin=protoc-gen-ts=$REPO_ROOT/node_modules/.bin/protoc-gen-ts \
|
||||
--ts_out=$DEST_TS \
|
||||
--plugin=$REPO_ROOT/node_modules/.bin/protoc-gen-ts_proto \
|
||||
--ts_proto_out=$DEST_TS \
|
||||
--proto_path=$I \
|
||||
$(find $REPO_ROOT/proto/vulcanize -iname "*.proto")
|
||||
|
||||
SED='sed -i'
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
SED='sed -i ""'
|
||||
fi
|
||||
|
||||
echo "Removing gRPC references..."
|
||||
# https://github.com/tharsis/evmosjs/tree/main/packages/proto#note
|
||||
|
||||
for file in $(find $REPO_ROOT/src/proto -type f)
|
||||
do
|
||||
line=$(grep -n '@grpc/grpc-js' $file | cut -f1 -d':')
|
||||
if [[ -n "$line" ]] && [[ "$line" -gt 0 ]]; then
|
||||
echo "Processing file: $file"
|
||||
$SED "${line}d" ${file}
|
||||
functions=$(grep -n 'interface GrpcUnaryServiceInterface' $file | cut -f1 -d':')
|
||||
$SED "${functions},\$d" ${file}
|
||||
echo '}' >> $file
|
||||
fi
|
||||
$SED '1s#^#/* eslint-disable */\n#' $file
|
||||
$SED '1s#^#// @ts-nocheck\n#' $file
|
||||
done
|
||||
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=messages" \
|
||||
$(find $REPO_ROOT/proto/cerc -iname "*.proto")
|
||||
|
2
src/proto2/amino/amino.ts
Normal file
2
src/proto2/amino/amino.ts
Normal file
@ -0,0 +1,2 @@
|
||||
/* eslint-disable */
|
||||
export const protobufPackage = "amino";
|
83
src/proto2/cerc/auction/module/v1/module.ts
Normal file
83
src/proto2/cerc/auction/module/v1/module.ts
Normal file
@ -0,0 +1,83 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.auction.module.v1";
|
||||
|
||||
/**
|
||||
* Module is the app config object of the module.
|
||||
* Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
*/
|
||||
export interface Module {}
|
||||
|
||||
function createBaseModule(): Module {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const Module = {
|
||||
encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Module {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseModule();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): Module {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: Module): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Module>, I>>(_: I): Module {
|
||||
const message = createBaseModule();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
739
src/proto2/cerc/auction/v1/auction.ts
Normal file
739
src/proto2/cerc/auction/v1/auction.ts
Normal file
@ -0,0 +1,739 @@
|
||||
/* eslint-disable */
|
||||
import { Duration } from "../../../google/protobuf/duration";
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
import { Timestamp } from "../../../google/protobuf/timestamp";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.auction.v1";
|
||||
|
||||
/** Params defines the auction module parameters */
|
||||
export interface Params {
|
||||
/** Duration of the commits phase in seconds */
|
||||
commitsDuration?: Duration;
|
||||
/** Duration of the reveals phase in seconds */
|
||||
revealsDuration?: Duration;
|
||||
/** Commit fees */
|
||||
commitFee?: Coin;
|
||||
/** Reveal fees */
|
||||
revealFee?: Coin;
|
||||
/** Minimum acceptable bid amount */
|
||||
minimumBid?: Coin;
|
||||
}
|
||||
|
||||
/** Auction represents a sealed-bid on-chain auction */
|
||||
export interface Auction {
|
||||
id: string;
|
||||
status: string;
|
||||
/** Address of the creator of the auction */
|
||||
ownerAddress: string;
|
||||
/** Timestamp at which the auction was created */
|
||||
createTime?: Date;
|
||||
/** Timestamp at which the commits phase concluded */
|
||||
commitsEndTime?: Date;
|
||||
/** Timestamp at which the reveals phase concluded */
|
||||
revealsEndTime?: Date;
|
||||
/**
|
||||
* Commit and reveal fees must both be paid when committing a bid
|
||||
* Reveal fee is returned only if the bid is revealed
|
||||
*/
|
||||
commitFee?: Coin;
|
||||
revealFee?: Coin;
|
||||
/** Minimum acceptable bid amount for a valid commit */
|
||||
minimumBid?: Coin;
|
||||
/** Address of the winner */
|
||||
winnerAddress: string;
|
||||
/** Winning bid, i.e., the highest bid */
|
||||
winningBid?: Coin;
|
||||
/** Amount the winner pays, i.e. the second highest auction */
|
||||
winningPrice?: Coin;
|
||||
}
|
||||
|
||||
export interface Auctions {
|
||||
auctions: Auction[];
|
||||
}
|
||||
|
||||
/** Bid represents a sealed bid (commit) made during the auction */
|
||||
export interface Bid {
|
||||
auctionId: string;
|
||||
bidderAddress: string;
|
||||
status: string;
|
||||
commitHash: string;
|
||||
commitTime?: Date;
|
||||
commitFee?: Coin;
|
||||
revealTime?: Date;
|
||||
revealFee?: Coin;
|
||||
bidAmount?: Coin;
|
||||
}
|
||||
|
||||
function createBaseParams(): Params {
|
||||
return {
|
||||
commitsDuration: undefined,
|
||||
revealsDuration: undefined,
|
||||
commitFee: undefined,
|
||||
revealFee: undefined,
|
||||
minimumBid: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export const Params = {
|
||||
encode(
|
||||
message: Params,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.commitsDuration !== undefined) {
|
||||
Duration.encode(
|
||||
message.commitsDuration,
|
||||
writer.uint32(10).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.revealsDuration !== undefined) {
|
||||
Duration.encode(
|
||||
message.revealsDuration,
|
||||
writer.uint32(18).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.commitFee !== undefined) {
|
||||
Coin.encode(message.commitFee, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
if (message.revealFee !== undefined) {
|
||||
Coin.encode(message.revealFee, writer.uint32(34).fork()).ldelim();
|
||||
}
|
||||
if (message.minimumBid !== undefined) {
|
||||
Coin.encode(message.minimumBid, writer.uint32(42).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseParams();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.commitsDuration = Duration.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 2:
|
||||
message.revealsDuration = Duration.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 3:
|
||||
message.commitFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 4:
|
||||
message.revealFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 5:
|
||||
message.minimumBid = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Params {
|
||||
return {
|
||||
commitsDuration: isSet(object.commitsDuration)
|
||||
? Duration.fromJSON(object.commitsDuration)
|
||||
: undefined,
|
||||
revealsDuration: isSet(object.revealsDuration)
|
||||
? Duration.fromJSON(object.revealsDuration)
|
||||
: undefined,
|
||||
commitFee: isSet(object.commitFee)
|
||||
? Coin.fromJSON(object.commitFee)
|
||||
: undefined,
|
||||
revealFee: isSet(object.revealFee)
|
||||
? Coin.fromJSON(object.revealFee)
|
||||
: undefined,
|
||||
minimumBid: isSet(object.minimumBid)
|
||||
? Coin.fromJSON(object.minimumBid)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Params): unknown {
|
||||
const obj: any = {};
|
||||
message.commitsDuration !== undefined &&
|
||||
(obj.commitsDuration = message.commitsDuration
|
||||
? Duration.toJSON(message.commitsDuration)
|
||||
: undefined);
|
||||
message.revealsDuration !== undefined &&
|
||||
(obj.revealsDuration = message.revealsDuration
|
||||
? Duration.toJSON(message.revealsDuration)
|
||||
: undefined);
|
||||
message.commitFee !== undefined &&
|
||||
(obj.commitFee = message.commitFee
|
||||
? Coin.toJSON(message.commitFee)
|
||||
: undefined);
|
||||
message.revealFee !== undefined &&
|
||||
(obj.revealFee = message.revealFee
|
||||
? Coin.toJSON(message.revealFee)
|
||||
: undefined);
|
||||
message.minimumBid !== undefined &&
|
||||
(obj.minimumBid = message.minimumBid
|
||||
? Coin.toJSON(message.minimumBid)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params {
|
||||
const message = createBaseParams();
|
||||
message.commitsDuration =
|
||||
object.commitsDuration !== undefined && object.commitsDuration !== null
|
||||
? Duration.fromPartial(object.commitsDuration)
|
||||
: undefined;
|
||||
message.revealsDuration =
|
||||
object.revealsDuration !== undefined && object.revealsDuration !== null
|
||||
? Duration.fromPartial(object.revealsDuration)
|
||||
: undefined;
|
||||
message.commitFee =
|
||||
object.commitFee !== undefined && object.commitFee !== null
|
||||
? Coin.fromPartial(object.commitFee)
|
||||
: undefined;
|
||||
message.revealFee =
|
||||
object.revealFee !== undefined && object.revealFee !== null
|
||||
? Coin.fromPartial(object.revealFee)
|
||||
: undefined;
|
||||
message.minimumBid =
|
||||
object.minimumBid !== undefined && object.minimumBid !== null
|
||||
? Coin.fromPartial(object.minimumBid)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAuction(): Auction {
|
||||
return {
|
||||
id: "",
|
||||
status: "",
|
||||
ownerAddress: "",
|
||||
createTime: undefined,
|
||||
commitsEndTime: undefined,
|
||||
revealsEndTime: undefined,
|
||||
commitFee: undefined,
|
||||
revealFee: undefined,
|
||||
minimumBid: undefined,
|
||||
winnerAddress: "",
|
||||
winningBid: undefined,
|
||||
winningPrice: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export const Auction = {
|
||||
encode(
|
||||
message: Auction,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
if (message.status !== "") {
|
||||
writer.uint32(18).string(message.status);
|
||||
}
|
||||
if (message.ownerAddress !== "") {
|
||||
writer.uint32(26).string(message.ownerAddress);
|
||||
}
|
||||
if (message.createTime !== undefined) {
|
||||
Timestamp.encode(
|
||||
toTimestamp(message.createTime),
|
||||
writer.uint32(34).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.commitsEndTime !== undefined) {
|
||||
Timestamp.encode(
|
||||
toTimestamp(message.commitsEndTime),
|
||||
writer.uint32(42).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.revealsEndTime !== undefined) {
|
||||
Timestamp.encode(
|
||||
toTimestamp(message.revealsEndTime),
|
||||
writer.uint32(50).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.commitFee !== undefined) {
|
||||
Coin.encode(message.commitFee, writer.uint32(58).fork()).ldelim();
|
||||
}
|
||||
if (message.revealFee !== undefined) {
|
||||
Coin.encode(message.revealFee, writer.uint32(66).fork()).ldelim();
|
||||
}
|
||||
if (message.minimumBid !== undefined) {
|
||||
Coin.encode(message.minimumBid, writer.uint32(74).fork()).ldelim();
|
||||
}
|
||||
if (message.winnerAddress !== "") {
|
||||
writer.uint32(82).string(message.winnerAddress);
|
||||
}
|
||||
if (message.winningBid !== undefined) {
|
||||
Coin.encode(message.winningBid, writer.uint32(90).fork()).ldelim();
|
||||
}
|
||||
if (message.winningPrice !== undefined) {
|
||||
Coin.encode(message.winningPrice, writer.uint32(98).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Auction {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAuction();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.id = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.status = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.ownerAddress = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.createTime = fromTimestamp(
|
||||
Timestamp.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 5:
|
||||
message.commitsEndTime = fromTimestamp(
|
||||
Timestamp.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 6:
|
||||
message.revealsEndTime = fromTimestamp(
|
||||
Timestamp.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 7:
|
||||
message.commitFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 8:
|
||||
message.revealFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 9:
|
||||
message.minimumBid = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 10:
|
||||
message.winnerAddress = reader.string();
|
||||
break;
|
||||
case 11:
|
||||
message.winningBid = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 12:
|
||||
message.winningPrice = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Auction {
|
||||
return {
|
||||
id: isSet(object.id) ? String(object.id) : "",
|
||||
status: isSet(object.status) ? String(object.status) : "",
|
||||
ownerAddress: isSet(object.ownerAddress)
|
||||
? String(object.ownerAddress)
|
||||
: "",
|
||||
createTime: isSet(object.createTime)
|
||||
? fromJsonTimestamp(object.createTime)
|
||||
: undefined,
|
||||
commitsEndTime: isSet(object.commitsEndTime)
|
||||
? fromJsonTimestamp(object.commitsEndTime)
|
||||
: undefined,
|
||||
revealsEndTime: isSet(object.revealsEndTime)
|
||||
? fromJsonTimestamp(object.revealsEndTime)
|
||||
: undefined,
|
||||
commitFee: isSet(object.commitFee)
|
||||
? Coin.fromJSON(object.commitFee)
|
||||
: undefined,
|
||||
revealFee: isSet(object.revealFee)
|
||||
? Coin.fromJSON(object.revealFee)
|
||||
: undefined,
|
||||
minimumBid: isSet(object.minimumBid)
|
||||
? Coin.fromJSON(object.minimumBid)
|
||||
: undefined,
|
||||
winnerAddress: isSet(object.winnerAddress)
|
||||
? String(object.winnerAddress)
|
||||
: "",
|
||||
winningBid: isSet(object.winningBid)
|
||||
? Coin.fromJSON(object.winningBid)
|
||||
: undefined,
|
||||
winningPrice: isSet(object.winningPrice)
|
||||
? Coin.fromJSON(object.winningPrice)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Auction): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = message.id);
|
||||
message.status !== undefined && (obj.status = message.status);
|
||||
message.ownerAddress !== undefined &&
|
||||
(obj.ownerAddress = message.ownerAddress);
|
||||
message.createTime !== undefined &&
|
||||
(obj.createTime = message.createTime.toISOString());
|
||||
message.commitsEndTime !== undefined &&
|
||||
(obj.commitsEndTime = message.commitsEndTime.toISOString());
|
||||
message.revealsEndTime !== undefined &&
|
||||
(obj.revealsEndTime = message.revealsEndTime.toISOString());
|
||||
message.commitFee !== undefined &&
|
||||
(obj.commitFee = message.commitFee
|
||||
? Coin.toJSON(message.commitFee)
|
||||
: undefined);
|
||||
message.revealFee !== undefined &&
|
||||
(obj.revealFee = message.revealFee
|
||||
? Coin.toJSON(message.revealFee)
|
||||
: undefined);
|
||||
message.minimumBid !== undefined &&
|
||||
(obj.minimumBid = message.minimumBid
|
||||
? Coin.toJSON(message.minimumBid)
|
||||
: undefined);
|
||||
message.winnerAddress !== undefined &&
|
||||
(obj.winnerAddress = message.winnerAddress);
|
||||
message.winningBid !== undefined &&
|
||||
(obj.winningBid = message.winningBid
|
||||
? Coin.toJSON(message.winningBid)
|
||||
: undefined);
|
||||
message.winningPrice !== undefined &&
|
||||
(obj.winningPrice = message.winningPrice
|
||||
? Coin.toJSON(message.winningPrice)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Auction>, I>>(object: I): Auction {
|
||||
const message = createBaseAuction();
|
||||
message.id = object.id ?? "";
|
||||
message.status = object.status ?? "";
|
||||
message.ownerAddress = object.ownerAddress ?? "";
|
||||
message.createTime = object.createTime ?? undefined;
|
||||
message.commitsEndTime = object.commitsEndTime ?? undefined;
|
||||
message.revealsEndTime = object.revealsEndTime ?? undefined;
|
||||
message.commitFee =
|
||||
object.commitFee !== undefined && object.commitFee !== null
|
||||
? Coin.fromPartial(object.commitFee)
|
||||
: undefined;
|
||||
message.revealFee =
|
||||
object.revealFee !== undefined && object.revealFee !== null
|
||||
? Coin.fromPartial(object.revealFee)
|
||||
: undefined;
|
||||
message.minimumBid =
|
||||
object.minimumBid !== undefined && object.minimumBid !== null
|
||||
? Coin.fromPartial(object.minimumBid)
|
||||
: undefined;
|
||||
message.winnerAddress = object.winnerAddress ?? "";
|
||||
message.winningBid =
|
||||
object.winningBid !== undefined && object.winningBid !== null
|
||||
? Coin.fromPartial(object.winningBid)
|
||||
: undefined;
|
||||
message.winningPrice =
|
||||
object.winningPrice !== undefined && object.winningPrice !== null
|
||||
? Coin.fromPartial(object.winningPrice)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAuctions(): Auctions {
|
||||
return { auctions: [] };
|
||||
}
|
||||
|
||||
export const Auctions = {
|
||||
encode(
|
||||
message: Auctions,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
for (const v of message.auctions) {
|
||||
Auction.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Auctions {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAuctions();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.auctions.push(Auction.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Auctions {
|
||||
return {
|
||||
auctions: Array.isArray(object?.auctions)
|
||||
? object.auctions.map((e: any) => Auction.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Auctions): unknown {
|
||||
const obj: any = {};
|
||||
if (message.auctions) {
|
||||
obj.auctions = message.auctions.map((e) =>
|
||||
e ? Auction.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.auctions = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Auctions>, I>>(object: I): Auctions {
|
||||
const message = createBaseAuctions();
|
||||
message.auctions =
|
||||
object.auctions?.map((e) => Auction.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseBid(): Bid {
|
||||
return {
|
||||
auctionId: "",
|
||||
bidderAddress: "",
|
||||
status: "",
|
||||
commitHash: "",
|
||||
commitTime: undefined,
|
||||
commitFee: undefined,
|
||||
revealTime: undefined,
|
||||
revealFee: undefined,
|
||||
bidAmount: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export const Bid = {
|
||||
encode(message: Bid, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.auctionId !== "") {
|
||||
writer.uint32(10).string(message.auctionId);
|
||||
}
|
||||
if (message.bidderAddress !== "") {
|
||||
writer.uint32(18).string(message.bidderAddress);
|
||||
}
|
||||
if (message.status !== "") {
|
||||
writer.uint32(26).string(message.status);
|
||||
}
|
||||
if (message.commitHash !== "") {
|
||||
writer.uint32(34).string(message.commitHash);
|
||||
}
|
||||
if (message.commitTime !== undefined) {
|
||||
Timestamp.encode(
|
||||
toTimestamp(message.commitTime),
|
||||
writer.uint32(42).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.commitFee !== undefined) {
|
||||
Coin.encode(message.commitFee, writer.uint32(50).fork()).ldelim();
|
||||
}
|
||||
if (message.revealTime !== undefined) {
|
||||
Timestamp.encode(
|
||||
toTimestamp(message.revealTime),
|
||||
writer.uint32(58).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.revealFee !== undefined) {
|
||||
Coin.encode(message.revealFee, writer.uint32(66).fork()).ldelim();
|
||||
}
|
||||
if (message.bidAmount !== undefined) {
|
||||
Coin.encode(message.bidAmount, writer.uint32(74).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Bid {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseBid();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.auctionId = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.bidderAddress = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.status = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.commitHash = reader.string();
|
||||
break;
|
||||
case 5:
|
||||
message.commitTime = fromTimestamp(
|
||||
Timestamp.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 6:
|
||||
message.commitFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 7:
|
||||
message.revealTime = fromTimestamp(
|
||||
Timestamp.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 8:
|
||||
message.revealFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 9:
|
||||
message.bidAmount = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Bid {
|
||||
return {
|
||||
auctionId: isSet(object.auctionId) ? String(object.auctionId) : "",
|
||||
bidderAddress: isSet(object.bidderAddress)
|
||||
? String(object.bidderAddress)
|
||||
: "",
|
||||
status: isSet(object.status) ? String(object.status) : "",
|
||||
commitHash: isSet(object.commitHash) ? String(object.commitHash) : "",
|
||||
commitTime: isSet(object.commitTime)
|
||||
? fromJsonTimestamp(object.commitTime)
|
||||
: undefined,
|
||||
commitFee: isSet(object.commitFee)
|
||||
? Coin.fromJSON(object.commitFee)
|
||||
: undefined,
|
||||
revealTime: isSet(object.revealTime)
|
||||
? fromJsonTimestamp(object.revealTime)
|
||||
: undefined,
|
||||
revealFee: isSet(object.revealFee)
|
||||
? Coin.fromJSON(object.revealFee)
|
||||
: undefined,
|
||||
bidAmount: isSet(object.bidAmount)
|
||||
? Coin.fromJSON(object.bidAmount)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Bid): unknown {
|
||||
const obj: any = {};
|
||||
message.auctionId !== undefined && (obj.auctionId = message.auctionId);
|
||||
message.bidderAddress !== undefined &&
|
||||
(obj.bidderAddress = message.bidderAddress);
|
||||
message.status !== undefined && (obj.status = message.status);
|
||||
message.commitHash !== undefined && (obj.commitHash = message.commitHash);
|
||||
message.commitTime !== undefined &&
|
||||
(obj.commitTime = message.commitTime.toISOString());
|
||||
message.commitFee !== undefined &&
|
||||
(obj.commitFee = message.commitFee
|
||||
? Coin.toJSON(message.commitFee)
|
||||
: undefined);
|
||||
message.revealTime !== undefined &&
|
||||
(obj.revealTime = message.revealTime.toISOString());
|
||||
message.revealFee !== undefined &&
|
||||
(obj.revealFee = message.revealFee
|
||||
? Coin.toJSON(message.revealFee)
|
||||
: undefined);
|
||||
message.bidAmount !== undefined &&
|
||||
(obj.bidAmount = message.bidAmount
|
||||
? Coin.toJSON(message.bidAmount)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Bid>, I>>(object: I): Bid {
|
||||
const message = createBaseBid();
|
||||
message.auctionId = object.auctionId ?? "";
|
||||
message.bidderAddress = object.bidderAddress ?? "";
|
||||
message.status = object.status ?? "";
|
||||
message.commitHash = object.commitHash ?? "";
|
||||
message.commitTime = object.commitTime ?? undefined;
|
||||
message.commitFee =
|
||||
object.commitFee !== undefined && object.commitFee !== null
|
||||
? Coin.fromPartial(object.commitFee)
|
||||
: undefined;
|
||||
message.revealTime = object.revealTime ?? undefined;
|
||||
message.revealFee =
|
||||
object.revealFee !== undefined && object.revealFee !== null
|
||||
? Coin.fromPartial(object.revealFee)
|
||||
: undefined;
|
||||
message.bidAmount =
|
||||
object.bidAmount !== undefined && object.bidAmount !== null
|
||||
? Coin.fromPartial(object.bidAmount)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
function toTimestamp(date: Date): Timestamp {
|
||||
const seconds = numberToLong(date.getTime() / 1_000);
|
||||
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
||||
return { seconds, nanos };
|
||||
}
|
||||
|
||||
function fromTimestamp(t: Timestamp): Date {
|
||||
let millis = t.seconds.toNumber() * 1_000;
|
||||
millis += t.nanos / 1_000_000;
|
||||
return new Date(millis);
|
||||
}
|
||||
|
||||
function fromJsonTimestamp(o: any): Date {
|
||||
if (o instanceof Date) {
|
||||
return o;
|
||||
} else if (typeof o === "string") {
|
||||
return new Date(o);
|
||||
} else {
|
||||
return fromTimestamp(Timestamp.fromJSON(o));
|
||||
}
|
||||
}
|
||||
|
||||
function numberToLong(number: number) {
|
||||
return Long.fromNumber(number);
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
124
src/proto2/cerc/auction/v1/genesis.ts
Normal file
124
src/proto2/cerc/auction/v1/genesis.ts
Normal file
@ -0,0 +1,124 @@
|
||||
/* eslint-disable */
|
||||
import { Params, Auctions } from "./auction";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.auction.v1";
|
||||
|
||||
/** GenesisState defines the genesis state of the auction module */
|
||||
export interface GenesisState {
|
||||
params?: Params;
|
||||
auctions?: Auctions;
|
||||
}
|
||||
|
||||
function createBaseGenesisState(): GenesisState {
|
||||
return { params: undefined, auctions: undefined };
|
||||
}
|
||||
|
||||
export const GenesisState = {
|
||||
encode(
|
||||
message: GenesisState,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.params !== undefined) {
|
||||
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.auctions !== undefined) {
|
||||
Auctions.encode(message.auctions, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGenesisState();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.params = Params.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 2:
|
||||
message.auctions = Auctions.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GenesisState {
|
||||
return {
|
||||
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
|
||||
auctions: isSet(object.auctions)
|
||||
? Auctions.fromJSON(object.auctions)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GenesisState): unknown {
|
||||
const obj: any = {};
|
||||
message.params !== undefined &&
|
||||
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
|
||||
message.auctions !== undefined &&
|
||||
(obj.auctions = message.auctions
|
||||
? Auctions.toJSON(message.auctions)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<GenesisState>, I>>(
|
||||
object: I
|
||||
): GenesisState {
|
||||
const message = createBaseGenesisState();
|
||||
message.params =
|
||||
object.params !== undefined && object.params !== null
|
||||
? Params.fromPartial(object.params)
|
||||
: undefined;
|
||||
message.auctions =
|
||||
object.auctions !== undefined && object.auctions !== null
|
||||
? Auctions.fromPartial(object.auctions)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
1236
src/proto2/cerc/auction/v1/query.ts
Normal file
1236
src/proto2/cerc/auction/v1/query.ts
Normal file
File diff suppressed because it is too large
Load Diff
641
src/proto2/cerc/auction/v1/tx.ts
Normal file
641
src/proto2/cerc/auction/v1/tx.ts
Normal file
@ -0,0 +1,641 @@
|
||||
/* eslint-disable */
|
||||
import { Duration } from "../../../google/protobuf/duration";
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
import { Auction, Bid } from "./auction";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.auction.v1";
|
||||
|
||||
/** MsgCreateAuction defines a create auction message */
|
||||
export interface MsgCreateAuction {
|
||||
/** Duration of the commits phase in seconds */
|
||||
commitsDuration?: Duration;
|
||||
/** Duration of the reveals phase in seconds */
|
||||
revealsDuration?: Duration;
|
||||
/** Commit fees */
|
||||
commitFee?: Coin;
|
||||
/** Reveal fees */
|
||||
revealFee?: Coin;
|
||||
/** Minimum acceptable bid amount */
|
||||
minimumBid?: Coin;
|
||||
/** Address of the signer */
|
||||
signer: string;
|
||||
}
|
||||
|
||||
/** MsgCreateAuctionResponse returns the details of the created auction */
|
||||
export interface MsgCreateAuctionResponse {
|
||||
/** Auction details */
|
||||
auction?: Auction;
|
||||
}
|
||||
|
||||
/** CommitBid defines the message to commit a bid */
|
||||
export interface MsgCommitBid {
|
||||
/** Auction id */
|
||||
auctionId: string;
|
||||
/** Commit Hash */
|
||||
commitHash: string;
|
||||
/** Address of the signer */
|
||||
signer: string;
|
||||
}
|
||||
|
||||
/** MsgCommitBidResponse returns the state of the auction after the bid creation */
|
||||
export interface MsgCommitBidResponse {
|
||||
/** Auction details */
|
||||
bid?: Bid;
|
||||
}
|
||||
|
||||
/** RevealBid defines the message to reveal a bid */
|
||||
export interface MsgRevealBid {
|
||||
/** Auction id */
|
||||
auctionId: string;
|
||||
/** Commit Hash */
|
||||
reveal: string;
|
||||
/** Address of the signer */
|
||||
signer: string;
|
||||
}
|
||||
|
||||
/** MsgRevealBidResponse returns the state of the auction after the bid reveal */
|
||||
export interface MsgRevealBidResponse {
|
||||
/** Auction details */
|
||||
auction?: Auction;
|
||||
}
|
||||
|
||||
function createBaseMsgCreateAuction(): MsgCreateAuction {
|
||||
return {
|
||||
commitsDuration: undefined,
|
||||
revealsDuration: undefined,
|
||||
commitFee: undefined,
|
||||
revealFee: undefined,
|
||||
minimumBid: undefined,
|
||||
signer: "",
|
||||
};
|
||||
}
|
||||
|
||||
export const MsgCreateAuction = {
|
||||
encode(
|
||||
message: MsgCreateAuction,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.commitsDuration !== undefined) {
|
||||
Duration.encode(
|
||||
message.commitsDuration,
|
||||
writer.uint32(10).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.revealsDuration !== undefined) {
|
||||
Duration.encode(
|
||||
message.revealsDuration,
|
||||
writer.uint32(18).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.commitFee !== undefined) {
|
||||
Coin.encode(message.commitFee, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
if (message.revealFee !== undefined) {
|
||||
Coin.encode(message.revealFee, writer.uint32(34).fork()).ldelim();
|
||||
}
|
||||
if (message.minimumBid !== undefined) {
|
||||
Coin.encode(message.minimumBid, writer.uint32(42).fork()).ldelim();
|
||||
}
|
||||
if (message.signer !== "") {
|
||||
writer.uint32(50).string(message.signer);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateAuction {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCreateAuction();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.commitsDuration = Duration.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 2:
|
||||
message.revealsDuration = Duration.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 3:
|
||||
message.commitFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 4:
|
||||
message.revealFee = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 5:
|
||||
message.minimumBid = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 6:
|
||||
message.signer = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgCreateAuction {
|
||||
return {
|
||||
commitsDuration: isSet(object.commitsDuration)
|
||||
? Duration.fromJSON(object.commitsDuration)
|
||||
: undefined,
|
||||
revealsDuration: isSet(object.revealsDuration)
|
||||
? Duration.fromJSON(object.revealsDuration)
|
||||
: undefined,
|
||||
commitFee: isSet(object.commitFee)
|
||||
? Coin.fromJSON(object.commitFee)
|
||||
: undefined,
|
||||
revealFee: isSet(object.revealFee)
|
||||
? Coin.fromJSON(object.revealFee)
|
||||
: undefined,
|
||||
minimumBid: isSet(object.minimumBid)
|
||||
? Coin.fromJSON(object.minimumBid)
|
||||
: undefined,
|
||||
signer: isSet(object.signer) ? String(object.signer) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgCreateAuction): unknown {
|
||||
const obj: any = {};
|
||||
message.commitsDuration !== undefined &&
|
||||
(obj.commitsDuration = message.commitsDuration
|
||||
? Duration.toJSON(message.commitsDuration)
|
||||
: undefined);
|
||||
message.revealsDuration !== undefined &&
|
||||
(obj.revealsDuration = message.revealsDuration
|
||||
? Duration.toJSON(message.revealsDuration)
|
||||
: undefined);
|
||||
message.commitFee !== undefined &&
|
||||
(obj.commitFee = message.commitFee
|
||||
? Coin.toJSON(message.commitFee)
|
||||
: undefined);
|
||||
message.revealFee !== undefined &&
|
||||
(obj.revealFee = message.revealFee
|
||||
? Coin.toJSON(message.revealFee)
|
||||
: undefined);
|
||||
message.minimumBid !== undefined &&
|
||||
(obj.minimumBid = message.minimumBid
|
||||
? Coin.toJSON(message.minimumBid)
|
||||
: undefined);
|
||||
message.signer !== undefined && (obj.signer = message.signer);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCreateAuction>, I>>(
|
||||
object: I
|
||||
): MsgCreateAuction {
|
||||
const message = createBaseMsgCreateAuction();
|
||||
message.commitsDuration =
|
||||
object.commitsDuration !== undefined && object.commitsDuration !== null
|
||||
? Duration.fromPartial(object.commitsDuration)
|
||||
: undefined;
|
||||
message.revealsDuration =
|
||||
object.revealsDuration !== undefined && object.revealsDuration !== null
|
||||
? Duration.fromPartial(object.revealsDuration)
|
||||
: undefined;
|
||||
message.commitFee =
|
||||
object.commitFee !== undefined && object.commitFee !== null
|
||||
? Coin.fromPartial(object.commitFee)
|
||||
: undefined;
|
||||
message.revealFee =
|
||||
object.revealFee !== undefined && object.revealFee !== null
|
||||
? Coin.fromPartial(object.revealFee)
|
||||
: undefined;
|
||||
message.minimumBid =
|
||||
object.minimumBid !== undefined && object.minimumBid !== null
|
||||
? Coin.fromPartial(object.minimumBid)
|
||||
: undefined;
|
||||
message.signer = object.signer ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgCreateAuctionResponse(): MsgCreateAuctionResponse {
|
||||
return { auction: undefined };
|
||||
}
|
||||
|
||||
export const MsgCreateAuctionResponse = {
|
||||
encode(
|
||||
message: MsgCreateAuctionResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.auction !== undefined) {
|
||||
Auction.encode(message.auction, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgCreateAuctionResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCreateAuctionResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.auction = Auction.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgCreateAuctionResponse {
|
||||
return {
|
||||
auction: isSet(object.auction)
|
||||
? Auction.fromJSON(object.auction)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgCreateAuctionResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.auction !== undefined &&
|
||||
(obj.auction = message.auction
|
||||
? Auction.toJSON(message.auction)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCreateAuctionResponse>, I>>(
|
||||
object: I
|
||||
): MsgCreateAuctionResponse {
|
||||
const message = createBaseMsgCreateAuctionResponse();
|
||||
message.auction =
|
||||
object.auction !== undefined && object.auction !== null
|
||||
? Auction.fromPartial(object.auction)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgCommitBid(): MsgCommitBid {
|
||||
return { auctionId: "", commitHash: "", signer: "" };
|
||||
}
|
||||
|
||||
export const MsgCommitBid = {
|
||||
encode(
|
||||
message: MsgCommitBid,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.auctionId !== "") {
|
||||
writer.uint32(10).string(message.auctionId);
|
||||
}
|
||||
if (message.commitHash !== "") {
|
||||
writer.uint32(18).string(message.commitHash);
|
||||
}
|
||||
if (message.signer !== "") {
|
||||
writer.uint32(26).string(message.signer);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCommitBid {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCommitBid();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.auctionId = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.commitHash = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.signer = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgCommitBid {
|
||||
return {
|
||||
auctionId: isSet(object.auctionId) ? String(object.auctionId) : "",
|
||||
commitHash: isSet(object.commitHash) ? String(object.commitHash) : "",
|
||||
signer: isSet(object.signer) ? String(object.signer) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgCommitBid): unknown {
|
||||
const obj: any = {};
|
||||
message.auctionId !== undefined && (obj.auctionId = message.auctionId);
|
||||
message.commitHash !== undefined && (obj.commitHash = message.commitHash);
|
||||
message.signer !== undefined && (obj.signer = message.signer);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCommitBid>, I>>(
|
||||
object: I
|
||||
): MsgCommitBid {
|
||||
const message = createBaseMsgCommitBid();
|
||||
message.auctionId = object.auctionId ?? "";
|
||||
message.commitHash = object.commitHash ?? "";
|
||||
message.signer = object.signer ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgCommitBidResponse(): MsgCommitBidResponse {
|
||||
return { bid: undefined };
|
||||
}
|
||||
|
||||
export const MsgCommitBidResponse = {
|
||||
encode(
|
||||
message: MsgCommitBidResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.bid !== undefined) {
|
||||
Bid.encode(message.bid, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgCommitBidResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCommitBidResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.bid = Bid.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgCommitBidResponse {
|
||||
return {
|
||||
bid: isSet(object.bid) ? Bid.fromJSON(object.bid) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgCommitBidResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.bid !== undefined &&
|
||||
(obj.bid = message.bid ? Bid.toJSON(message.bid) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCommitBidResponse>, I>>(
|
||||
object: I
|
||||
): MsgCommitBidResponse {
|
||||
const message = createBaseMsgCommitBidResponse();
|
||||
message.bid =
|
||||
object.bid !== undefined && object.bid !== null
|
||||
? Bid.fromPartial(object.bid)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgRevealBid(): MsgRevealBid {
|
||||
return { auctionId: "", reveal: "", signer: "" };
|
||||
}
|
||||
|
||||
export const MsgRevealBid = {
|
||||
encode(
|
||||
message: MsgRevealBid,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.auctionId !== "") {
|
||||
writer.uint32(10).string(message.auctionId);
|
||||
}
|
||||
if (message.reveal !== "") {
|
||||
writer.uint32(18).string(message.reveal);
|
||||
}
|
||||
if (message.signer !== "") {
|
||||
writer.uint32(26).string(message.signer);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevealBid {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgRevealBid();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.auctionId = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.reveal = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.signer = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgRevealBid {
|
||||
return {
|
||||
auctionId: isSet(object.auctionId) ? String(object.auctionId) : "",
|
||||
reveal: isSet(object.reveal) ? String(object.reveal) : "",
|
||||
signer: isSet(object.signer) ? String(object.signer) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgRevealBid): unknown {
|
||||
const obj: any = {};
|
||||
message.auctionId !== undefined && (obj.auctionId = message.auctionId);
|
||||
message.reveal !== undefined && (obj.reveal = message.reveal);
|
||||
message.signer !== undefined && (obj.signer = message.signer);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgRevealBid>, I>>(
|
||||
object: I
|
||||
): MsgRevealBid {
|
||||
const message = createBaseMsgRevealBid();
|
||||
message.auctionId = object.auctionId ?? "";
|
||||
message.reveal = object.reveal ?? "";
|
||||
message.signer = object.signer ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgRevealBidResponse(): MsgRevealBidResponse {
|
||||
return { auction: undefined };
|
||||
}
|
||||
|
||||
export const MsgRevealBidResponse = {
|
||||
encode(
|
||||
message: MsgRevealBidResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.auction !== undefined) {
|
||||
Auction.encode(message.auction, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgRevealBidResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgRevealBidResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.auction = Auction.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgRevealBidResponse {
|
||||
return {
|
||||
auction: isSet(object.auction)
|
||||
? Auction.fromJSON(object.auction)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgRevealBidResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.auction !== undefined &&
|
||||
(obj.auction = message.auction
|
||||
? Auction.toJSON(message.auction)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgRevealBidResponse>, I>>(
|
||||
object: I
|
||||
): MsgRevealBidResponse {
|
||||
const message = createBaseMsgRevealBidResponse();
|
||||
message.auction =
|
||||
object.auction !== undefined && object.auction !== null
|
||||
? Auction.fromPartial(object.auction)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
/** Tx defines the gRPC tx interface */
|
||||
export interface Msg {
|
||||
/** CreateAuction is the command for creating an auction */
|
||||
CreateAuction(request: MsgCreateAuction): Promise<MsgCreateAuctionResponse>;
|
||||
/** CommitBid is the command for committing a bid */
|
||||
CommitBid(request: MsgCommitBid): Promise<MsgCommitBidResponse>;
|
||||
/** RevealBid is the command for revealing a bid */
|
||||
RevealBid(request: MsgRevealBid): Promise<MsgRevealBidResponse>;
|
||||
}
|
||||
|
||||
export class MsgClientImpl implements Msg {
|
||||
private readonly rpc: Rpc;
|
||||
constructor(rpc: Rpc) {
|
||||
this.rpc = rpc;
|
||||
this.CreateAuction = this.CreateAuction.bind(this);
|
||||
this.CommitBid = this.CommitBid.bind(this);
|
||||
this.RevealBid = this.RevealBid.bind(this);
|
||||
}
|
||||
CreateAuction(request: MsgCreateAuction): Promise<MsgCreateAuctionResponse> {
|
||||
const data = MsgCreateAuction.encode(request).finish();
|
||||
const promise = this.rpc.request(
|
||||
"cerc.auction.v1.Msg",
|
||||
"CreateAuction",
|
||||
data
|
||||
);
|
||||
return promise.then((data) =>
|
||||
MsgCreateAuctionResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
CommitBid(request: MsgCommitBid): Promise<MsgCommitBidResponse> {
|
||||
const data = MsgCommitBid.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.auction.v1.Msg", "CommitBid", data);
|
||||
return promise.then((data) =>
|
||||
MsgCommitBidResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
RevealBid(request: MsgRevealBid): Promise<MsgRevealBidResponse> {
|
||||
const data = MsgRevealBid.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.auction.v1.Msg", "RevealBid", data);
|
||||
return promise.then((data) =>
|
||||
MsgRevealBidResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
request(
|
||||
service: string,
|
||||
method: string,
|
||||
data: Uint8Array
|
||||
): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
83
src/proto2/cerc/bond/module/v1/module.ts
Normal file
83
src/proto2/cerc/bond/module/v1/module.ts
Normal file
@ -0,0 +1,83 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.bond.module.v1";
|
||||
|
||||
/**
|
||||
* Module is the app config object of the module.
|
||||
* Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
*/
|
||||
export interface Module {}
|
||||
|
||||
function createBaseModule(): Module {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const Module = {
|
||||
encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Module {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseModule();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): Module {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: Module): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Module>, I>>(_: I): Module {
|
||||
const message = createBaseModule();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
194
src/proto2/cerc/bond/v1/bond.ts
Normal file
194
src/proto2/cerc/bond/v1/bond.ts
Normal file
@ -0,0 +1,194 @@
|
||||
/* eslint-disable */
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.bond.v1";
|
||||
|
||||
/** Params defines the parameters of the bond module. */
|
||||
export interface Params {
|
||||
/** max_bond_amount is maximum amount to bond */
|
||||
maxBondAmount?: Coin;
|
||||
}
|
||||
|
||||
/** Bond represents funds deposited by an account for record rent payments. */
|
||||
export interface Bond {
|
||||
/** id is unique identifier of the bond */
|
||||
id: string;
|
||||
/** owner of the bond */
|
||||
owner: string;
|
||||
/** balance of the bond */
|
||||
balance: Coin[];
|
||||
}
|
||||
|
||||
function createBaseParams(): Params {
|
||||
return { maxBondAmount: undefined };
|
||||
}
|
||||
|
||||
export const Params = {
|
||||
encode(
|
||||
message: Params,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.maxBondAmount !== undefined) {
|
||||
Coin.encode(message.maxBondAmount, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseParams();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.maxBondAmount = Coin.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Params {
|
||||
return {
|
||||
maxBondAmount: isSet(object.maxBondAmount)
|
||||
? Coin.fromJSON(object.maxBondAmount)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Params): unknown {
|
||||
const obj: any = {};
|
||||
message.maxBondAmount !== undefined &&
|
||||
(obj.maxBondAmount = message.maxBondAmount
|
||||
? Coin.toJSON(message.maxBondAmount)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params {
|
||||
const message = createBaseParams();
|
||||
message.maxBondAmount =
|
||||
object.maxBondAmount !== undefined && object.maxBondAmount !== null
|
||||
? Coin.fromPartial(object.maxBondAmount)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseBond(): Bond {
|
||||
return { id: "", owner: "", balance: [] };
|
||||
}
|
||||
|
||||
export const Bond = {
|
||||
encode(message: Bond, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
if (message.owner !== "") {
|
||||
writer.uint32(18).string(message.owner);
|
||||
}
|
||||
for (const v of message.balance) {
|
||||
Coin.encode(v!, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Bond {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseBond();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.id = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.owner = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.balance.push(Coin.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Bond {
|
||||
return {
|
||||
id: isSet(object.id) ? String(object.id) : "",
|
||||
owner: isSet(object.owner) ? String(object.owner) : "",
|
||||
balance: Array.isArray(object?.balance)
|
||||
? object.balance.map((e: any) => Coin.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Bond): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = message.id);
|
||||
message.owner !== undefined && (obj.owner = message.owner);
|
||||
if (message.balance) {
|
||||
obj.balance = message.balance.map((e) =>
|
||||
e ? Coin.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.balance = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Bond>, I>>(object: I): Bond {
|
||||
const message = createBaseBond();
|
||||
message.id = object.id ?? "";
|
||||
message.owner = object.owner ?? "";
|
||||
message.balance = object.balance?.map((e) => Coin.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
124
src/proto2/cerc/bond/v1/genesis.ts
Normal file
124
src/proto2/cerc/bond/v1/genesis.ts
Normal file
@ -0,0 +1,124 @@
|
||||
/* eslint-disable */
|
||||
import { Params, Bond } from "./bond";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.bond.v1";
|
||||
|
||||
/** GenesisState defines the bond module's genesis state. */
|
||||
export interface GenesisState {
|
||||
/** params defines all the parameters of the module. */
|
||||
params?: Params;
|
||||
/** bonds defines all the bonds */
|
||||
bonds: Bond[];
|
||||
}
|
||||
|
||||
function createBaseGenesisState(): GenesisState {
|
||||
return { params: undefined, bonds: [] };
|
||||
}
|
||||
|
||||
export const GenesisState = {
|
||||
encode(
|
||||
message: GenesisState,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.params !== undefined) {
|
||||
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
for (const v of message.bonds) {
|
||||
Bond.encode(v!, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGenesisState();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.params = Params.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 2:
|
||||
message.bonds.push(Bond.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GenesisState {
|
||||
return {
|
||||
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
|
||||
bonds: Array.isArray(object?.bonds)
|
||||
? object.bonds.map((e: any) => Bond.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GenesisState): unknown {
|
||||
const obj: any = {};
|
||||
message.params !== undefined &&
|
||||
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
|
||||
if (message.bonds) {
|
||||
obj.bonds = message.bonds.map((e) => (e ? Bond.toJSON(e) : undefined));
|
||||
} else {
|
||||
obj.bonds = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<GenesisState>, I>>(
|
||||
object: I
|
||||
): GenesisState {
|
||||
const message = createBaseGenesisState();
|
||||
message.params =
|
||||
object.params !== undefined && object.params !== null
|
||||
? Params.fromPartial(object.params)
|
||||
: undefined;
|
||||
message.bonds = object.bonds?.map((e) => Bond.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
834
src/proto2/cerc/bond/v1/query.ts
Normal file
834
src/proto2/cerc/bond/v1/query.ts
Normal file
@ -0,0 +1,834 @@
|
||||
/* eslint-disable */
|
||||
import { Params, Bond } from "./bond";
|
||||
import {
|
||||
PageRequest,
|
||||
PageResponse,
|
||||
} from "../../../cosmos/base/query/v1beta1/pagination";
|
||||
import Long from "long";
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.bond.v1";
|
||||
|
||||
/** QueryParamsRequest is request for query the bond module params */
|
||||
export interface QueryParamsRequest {}
|
||||
|
||||
/** QueryParamsResponse returns response type of bond module params */
|
||||
export interface QueryParamsResponse {
|
||||
params?: Params;
|
||||
}
|
||||
|
||||
/** QueryGetBondById queries a bonds. */
|
||||
export interface QueryGetBondsRequest {
|
||||
/** pagination defines an optional pagination for the request. */
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
|
||||
/** QueryGetBondsResponse is response type for get the bonds by bond-id */
|
||||
export interface QueryGetBondsResponse {
|
||||
bonds: Bond[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
/** QueryGetBondById */
|
||||
export interface QueryGetBondByIdRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
/** QueryGetBondByIdResponse returns QueryGetBondById query response */
|
||||
export interface QueryGetBondByIdResponse {
|
||||
bond?: Bond;
|
||||
}
|
||||
|
||||
/** QueryGetBondsByOwnerRequest is request type for Query/GetBondsByOwner RPC Method */
|
||||
export interface QueryGetBondsByOwnerRequest {
|
||||
owner: string;
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
/** QueryGetBondsByOwnerResponse is response type for Query/GetBondsByOwner RPC Method */
|
||||
export interface QueryGetBondsByOwnerResponse {
|
||||
bonds: Bond[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
/** QueryGetBondModuleBalanceRequest is request type for bond module balance rpc method */
|
||||
export interface QueryGetBondModuleBalanceRequest {}
|
||||
|
||||
/** QueryGetBondModuleBalanceResponse is the response type for bond module balance rpc method */
|
||||
export interface QueryGetBondModuleBalanceResponse {
|
||||
balance: Coin[];
|
||||
}
|
||||
|
||||
function createBaseQueryParamsRequest(): QueryParamsRequest {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const QueryParamsRequest = {
|
||||
encode(
|
||||
_: QueryParamsRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryParamsRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): QueryParamsRequest {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: QueryParamsRequest): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryParamsRequest>, I>>(
|
||||
_: I
|
||||
): QueryParamsRequest {
|
||||
const message = createBaseQueryParamsRequest();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryParamsResponse(): QueryParamsResponse {
|
||||
return { params: undefined };
|
||||
}
|
||||
|
||||
export const QueryParamsResponse = {
|
||||
encode(
|
||||
message: QueryParamsResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.params !== undefined) {
|
||||
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryParamsResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.params = Params.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryParamsResponse {
|
||||
return {
|
||||
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryParamsResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.params !== undefined &&
|
||||
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryParamsResponse>, I>>(
|
||||
object: I
|
||||
): QueryParamsResponse {
|
||||
const message = createBaseQueryParamsResponse();
|
||||
message.params =
|
||||
object.params !== undefined && object.params !== null
|
||||
? Params.fromPartial(object.params)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondsRequest(): QueryGetBondsRequest {
|
||||
return { pagination: undefined };
|
||||
}
|
||||
|
||||
export const QueryGetBondsRequest = {
|
||||
encode(
|
||||
message: QueryGetBondsRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.pagination !== undefined) {
|
||||
PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondsRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondsRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.pagination = PageRequest.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryGetBondsRequest {
|
||||
return {
|
||||
pagination: isSet(object.pagination)
|
||||
? PageRequest.fromJSON(object.pagination)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryGetBondsRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination
|
||||
? PageRequest.toJSON(message.pagination)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryGetBondsRequest>, I>>(
|
||||
object: I
|
||||
): QueryGetBondsRequest {
|
||||
const message = createBaseQueryGetBondsRequest();
|
||||
message.pagination =
|
||||
object.pagination !== undefined && object.pagination !== null
|
||||
? PageRequest.fromPartial(object.pagination)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondsResponse(): QueryGetBondsResponse {
|
||||
return { bonds: [], pagination: undefined };
|
||||
}
|
||||
|
||||
export const QueryGetBondsResponse = {
|
||||
encode(
|
||||
message: QueryGetBondsResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
for (const v of message.bonds) {
|
||||
Bond.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.pagination !== undefined) {
|
||||
PageResponse.encode(
|
||||
message.pagination,
|
||||
writer.uint32(18).fork()
|
||||
).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondsResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondsResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.bonds.push(Bond.decode(reader, reader.uint32()));
|
||||
break;
|
||||
case 2:
|
||||
message.pagination = PageResponse.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryGetBondsResponse {
|
||||
return {
|
||||
bonds: Array.isArray(object?.bonds)
|
||||
? object.bonds.map((e: any) => Bond.fromJSON(e))
|
||||
: [],
|
||||
pagination: isSet(object.pagination)
|
||||
? PageResponse.fromJSON(object.pagination)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryGetBondsResponse): unknown {
|
||||
const obj: any = {};
|
||||
if (message.bonds) {
|
||||
obj.bonds = message.bonds.map((e) => (e ? Bond.toJSON(e) : undefined));
|
||||
} else {
|
||||
obj.bonds = [];
|
||||
}
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination
|
||||
? PageResponse.toJSON(message.pagination)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryGetBondsResponse>, I>>(
|
||||
object: I
|
||||
): QueryGetBondsResponse {
|
||||
const message = createBaseQueryGetBondsResponse();
|
||||
message.bonds = object.bonds?.map((e) => Bond.fromPartial(e)) || [];
|
||||
message.pagination =
|
||||
object.pagination !== undefined && object.pagination !== null
|
||||
? PageResponse.fromPartial(object.pagination)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondByIdRequest(): QueryGetBondByIdRequest {
|
||||
return { id: "" };
|
||||
}
|
||||
|
||||
export const QueryGetBondByIdRequest = {
|
||||
encode(
|
||||
message: QueryGetBondByIdRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondByIdRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondByIdRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.id = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryGetBondByIdRequest {
|
||||
return {
|
||||
id: isSet(object.id) ? String(object.id) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryGetBondByIdRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = message.id);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryGetBondByIdRequest>, I>>(
|
||||
object: I
|
||||
): QueryGetBondByIdRequest {
|
||||
const message = createBaseQueryGetBondByIdRequest();
|
||||
message.id = object.id ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondByIdResponse(): QueryGetBondByIdResponse {
|
||||
return { bond: undefined };
|
||||
}
|
||||
|
||||
export const QueryGetBondByIdResponse = {
|
||||
encode(
|
||||
message: QueryGetBondByIdResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.bond !== undefined) {
|
||||
Bond.encode(message.bond, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondByIdResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondByIdResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.bond = Bond.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryGetBondByIdResponse {
|
||||
return {
|
||||
bond: isSet(object.bond) ? Bond.fromJSON(object.bond) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryGetBondByIdResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.bond !== undefined &&
|
||||
(obj.bond = message.bond ? Bond.toJSON(message.bond) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryGetBondByIdResponse>, I>>(
|
||||
object: I
|
||||
): QueryGetBondByIdResponse {
|
||||
const message = createBaseQueryGetBondByIdResponse();
|
||||
message.bond =
|
||||
object.bond !== undefined && object.bond !== null
|
||||
? Bond.fromPartial(object.bond)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondsByOwnerRequest(): QueryGetBondsByOwnerRequest {
|
||||
return { owner: "", pagination: undefined };
|
||||
}
|
||||
|
||||
export const QueryGetBondsByOwnerRequest = {
|
||||
encode(
|
||||
message: QueryGetBondsByOwnerRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.owner !== "") {
|
||||
writer.uint32(10).string(message.owner);
|
||||
}
|
||||
if (message.pagination !== undefined) {
|
||||
PageResponse.encode(
|
||||
message.pagination,
|
||||
writer.uint32(18).fork()
|
||||
).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondsByOwnerRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondsByOwnerRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.owner = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.pagination = PageResponse.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryGetBondsByOwnerRequest {
|
||||
return {
|
||||
owner: isSet(object.owner) ? String(object.owner) : "",
|
||||
pagination: isSet(object.pagination)
|
||||
? PageResponse.fromJSON(object.pagination)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryGetBondsByOwnerRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.owner !== undefined && (obj.owner = message.owner);
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination
|
||||
? PageResponse.toJSON(message.pagination)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryGetBondsByOwnerRequest>, I>>(
|
||||
object: I
|
||||
): QueryGetBondsByOwnerRequest {
|
||||
const message = createBaseQueryGetBondsByOwnerRequest();
|
||||
message.owner = object.owner ?? "";
|
||||
message.pagination =
|
||||
object.pagination !== undefined && object.pagination !== null
|
||||
? PageResponse.fromPartial(object.pagination)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondsByOwnerResponse(): QueryGetBondsByOwnerResponse {
|
||||
return { bonds: [], pagination: undefined };
|
||||
}
|
||||
|
||||
export const QueryGetBondsByOwnerResponse = {
|
||||
encode(
|
||||
message: QueryGetBondsByOwnerResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
for (const v of message.bonds) {
|
||||
Bond.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.pagination !== undefined) {
|
||||
PageResponse.encode(
|
||||
message.pagination,
|
||||
writer.uint32(18).fork()
|
||||
).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondsByOwnerResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondsByOwnerResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.bonds.push(Bond.decode(reader, reader.uint32()));
|
||||
break;
|
||||
case 2:
|
||||
message.pagination = PageResponse.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryGetBondsByOwnerResponse {
|
||||
return {
|
||||
bonds: Array.isArray(object?.bonds)
|
||||
? object.bonds.map((e: any) => Bond.fromJSON(e))
|
||||
: [],
|
||||
pagination: isSet(object.pagination)
|
||||
? PageResponse.fromJSON(object.pagination)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryGetBondsByOwnerResponse): unknown {
|
||||
const obj: any = {};
|
||||
if (message.bonds) {
|
||||
obj.bonds = message.bonds.map((e) => (e ? Bond.toJSON(e) : undefined));
|
||||
} else {
|
||||
obj.bonds = [];
|
||||
}
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination
|
||||
? PageResponse.toJSON(message.pagination)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryGetBondsByOwnerResponse>, I>>(
|
||||
object: I
|
||||
): QueryGetBondsByOwnerResponse {
|
||||
const message = createBaseQueryGetBondsByOwnerResponse();
|
||||
message.bonds = object.bonds?.map((e) => Bond.fromPartial(e)) || [];
|
||||
message.pagination =
|
||||
object.pagination !== undefined && object.pagination !== null
|
||||
? PageResponse.fromPartial(object.pagination)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondModuleBalanceRequest(): QueryGetBondModuleBalanceRequest {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const QueryGetBondModuleBalanceRequest = {
|
||||
encode(
|
||||
_: QueryGetBondModuleBalanceRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondModuleBalanceRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondModuleBalanceRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): QueryGetBondModuleBalanceRequest {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: QueryGetBondModuleBalanceRequest): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<
|
||||
I extends Exact<DeepPartial<QueryGetBondModuleBalanceRequest>, I>
|
||||
>(_: I): QueryGetBondModuleBalanceRequest {
|
||||
const message = createBaseQueryGetBondModuleBalanceRequest();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryGetBondModuleBalanceResponse(): QueryGetBondModuleBalanceResponse {
|
||||
return { balance: [] };
|
||||
}
|
||||
|
||||
export const QueryGetBondModuleBalanceResponse = {
|
||||
encode(
|
||||
message: QueryGetBondModuleBalanceResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
for (const v of message.balance) {
|
||||
Coin.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryGetBondModuleBalanceResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryGetBondModuleBalanceResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.balance.push(Coin.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryGetBondModuleBalanceResponse {
|
||||
return {
|
||||
balance: Array.isArray(object?.balance)
|
||||
? object.balance.map((e: any) => Coin.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryGetBondModuleBalanceResponse): unknown {
|
||||
const obj: any = {};
|
||||
if (message.balance) {
|
||||
obj.balance = message.balance.map((e) =>
|
||||
e ? Coin.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.balance = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<
|
||||
I extends Exact<DeepPartial<QueryGetBondModuleBalanceResponse>, I>
|
||||
>(object: I): QueryGetBondModuleBalanceResponse {
|
||||
const message = createBaseQueryGetBondModuleBalanceResponse();
|
||||
message.balance = object.balance?.map((e) => Coin.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
/** Query defines the gRPC querier service for bond module */
|
||||
export interface Query {
|
||||
/** Params queries bonds module params. */
|
||||
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
|
||||
/** Bonds queries bonds list */
|
||||
Bonds(request: QueryGetBondsRequest): Promise<QueryGetBondsResponse>;
|
||||
/** GetBondById */
|
||||
GetBondById(
|
||||
request: QueryGetBondByIdRequest
|
||||
): Promise<QueryGetBondByIdResponse>;
|
||||
/** Get Bonds list by Owner */
|
||||
GetBondsByOwner(
|
||||
request: QueryGetBondsByOwnerRequest
|
||||
): Promise<QueryGetBondsByOwnerResponse>;
|
||||
/** Get Bond module balance */
|
||||
GetBondsModuleBalance(
|
||||
request: QueryGetBondModuleBalanceRequest
|
||||
): Promise<QueryGetBondModuleBalanceResponse>;
|
||||
}
|
||||
|
||||
export class QueryClientImpl implements Query {
|
||||
private readonly rpc: Rpc;
|
||||
constructor(rpc: Rpc) {
|
||||
this.rpc = rpc;
|
||||
this.Params = this.Params.bind(this);
|
||||
this.Bonds = this.Bonds.bind(this);
|
||||
this.GetBondById = this.GetBondById.bind(this);
|
||||
this.GetBondsByOwner = this.GetBondsByOwner.bind(this);
|
||||
this.GetBondsModuleBalance = this.GetBondsModuleBalance.bind(this);
|
||||
}
|
||||
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
|
||||
const data = QueryParamsRequest.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.bond.v1.Query", "Params", data);
|
||||
return promise.then((data) =>
|
||||
QueryParamsResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
Bonds(request: QueryGetBondsRequest): Promise<QueryGetBondsResponse> {
|
||||
const data = QueryGetBondsRequest.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.bond.v1.Query", "Bonds", data);
|
||||
return promise.then((data) =>
|
||||
QueryGetBondsResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
GetBondById(
|
||||
request: QueryGetBondByIdRequest
|
||||
): Promise<QueryGetBondByIdResponse> {
|
||||
const data = QueryGetBondByIdRequest.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.bond.v1.Query", "GetBondById", data);
|
||||
return promise.then((data) =>
|
||||
QueryGetBondByIdResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
GetBondsByOwner(
|
||||
request: QueryGetBondsByOwnerRequest
|
||||
): Promise<QueryGetBondsByOwnerResponse> {
|
||||
const data = QueryGetBondsByOwnerRequest.encode(request).finish();
|
||||
const promise = this.rpc.request(
|
||||
"cerc.bond.v1.Query",
|
||||
"GetBondsByOwner",
|
||||
data
|
||||
);
|
||||
return promise.then((data) =>
|
||||
QueryGetBondsByOwnerResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
GetBondsModuleBalance(
|
||||
request: QueryGetBondModuleBalanceRequest
|
||||
): Promise<QueryGetBondModuleBalanceResponse> {
|
||||
const data = QueryGetBondModuleBalanceRequest.encode(request).finish();
|
||||
const promise = this.rpc.request(
|
||||
"cerc.bond.v1.Query",
|
||||
"GetBondsModuleBalance",
|
||||
data
|
||||
);
|
||||
return promise.then((data) =>
|
||||
QueryGetBondModuleBalanceResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
request(
|
||||
service: string,
|
||||
method: string,
|
||||
data: Uint8Array
|
||||
): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
631
src/proto2/cerc/bond/v1/tx.ts
Normal file
631
src/proto2/cerc/bond/v1/tx.ts
Normal file
@ -0,0 +1,631 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.bond.v1";
|
||||
|
||||
/** MsgCreateBond defines a SDK message for creating a new bond. */
|
||||
export interface MsgCreateBond {
|
||||
signer: string;
|
||||
coins: Coin[];
|
||||
}
|
||||
|
||||
/** MsgCreateBondResponse defines the Msg/CreateBond response type. */
|
||||
export interface MsgCreateBondResponse {
|
||||
id: string;
|
||||
}
|
||||
|
||||
/** MsgRefillBond defines a SDK message for refill the amount for bond. */
|
||||
export interface MsgRefillBond {
|
||||
id: string;
|
||||
signer: string;
|
||||
coins: Coin[];
|
||||
}
|
||||
|
||||
/** MsgRefillBondResponse defines the Msg/RefillBond response type. */
|
||||
export interface MsgRefillBondResponse {}
|
||||
|
||||
/** MsgWithdrawBond defines a SDK message for withdrawing amount from bond. */
|
||||
export interface MsgWithdrawBond {
|
||||
id: string;
|
||||
signer: string;
|
||||
coins: Coin[];
|
||||
}
|
||||
|
||||
/** MsgWithdrawBondResponse defines the Msg/WithdrawBond response type. */
|
||||
export interface MsgWithdrawBondResponse {}
|
||||
|
||||
/** MsgCancelBond defines a SDK message for the cancel the bond. */
|
||||
export interface MsgCancelBond {
|
||||
id: string;
|
||||
signer: string;
|
||||
}
|
||||
|
||||
/** MsgCancelBondResponse defines the Msg/CancelBond response type. */
|
||||
export interface MsgCancelBondResponse {}
|
||||
|
||||
function createBaseMsgCreateBond(): MsgCreateBond {
|
||||
return { signer: "", coins: [] };
|
||||
}
|
||||
|
||||
export const MsgCreateBond = {
|
||||
encode(
|
||||
message: MsgCreateBond,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.signer !== "") {
|
||||
writer.uint32(10).string(message.signer);
|
||||
}
|
||||
for (const v of message.coins) {
|
||||
Coin.encode(v!, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBond {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCreateBond();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.signer = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.coins.push(Coin.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgCreateBond {
|
||||
return {
|
||||
signer: isSet(object.signer) ? String(object.signer) : "",
|
||||
coins: Array.isArray(object?.coins)
|
||||
? object.coins.map((e: any) => Coin.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgCreateBond): unknown {
|
||||
const obj: any = {};
|
||||
message.signer !== undefined && (obj.signer = message.signer);
|
||||
if (message.coins) {
|
||||
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
|
||||
} else {
|
||||
obj.coins = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCreateBond>, I>>(
|
||||
object: I
|
||||
): MsgCreateBond {
|
||||
const message = createBaseMsgCreateBond();
|
||||
message.signer = object.signer ?? "";
|
||||
message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgCreateBondResponse(): MsgCreateBondResponse {
|
||||
return { id: "" };
|
||||
}
|
||||
|
||||
export const MsgCreateBondResponse = {
|
||||
encode(
|
||||
message: MsgCreateBondResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgCreateBondResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCreateBondResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.id = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgCreateBondResponse {
|
||||
return {
|
||||
id: isSet(object.id) ? String(object.id) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgCreateBondResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = message.id);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCreateBondResponse>, I>>(
|
||||
object: I
|
||||
): MsgCreateBondResponse {
|
||||
const message = createBaseMsgCreateBondResponse();
|
||||
message.id = object.id ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgRefillBond(): MsgRefillBond {
|
||||
return { id: "", signer: "", coins: [] };
|
||||
}
|
||||
|
||||
export const MsgRefillBond = {
|
||||
encode(
|
||||
message: MsgRefillBond,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
if (message.signer !== "") {
|
||||
writer.uint32(18).string(message.signer);
|
||||
}
|
||||
for (const v of message.coins) {
|
||||
Coin.encode(v!, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgRefillBond {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgRefillBond();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.id = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.coins.push(Coin.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgRefillBond {
|
||||
return {
|
||||
id: isSet(object.id) ? String(object.id) : "",
|
||||
signer: isSet(object.signer) ? String(object.signer) : "",
|
||||
coins: Array.isArray(object?.coins)
|
||||
? object.coins.map((e: any) => Coin.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgRefillBond): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = message.id);
|
||||
message.signer !== undefined && (obj.signer = message.signer);
|
||||
if (message.coins) {
|
||||
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
|
||||
} else {
|
||||
obj.coins = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgRefillBond>, I>>(
|
||||
object: I
|
||||
): MsgRefillBond {
|
||||
const message = createBaseMsgRefillBond();
|
||||
message.id = object.id ?? "";
|
||||
message.signer = object.signer ?? "";
|
||||
message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgRefillBondResponse(): MsgRefillBondResponse {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const MsgRefillBondResponse = {
|
||||
encode(
|
||||
_: MsgRefillBondResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgRefillBondResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgRefillBondResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): MsgRefillBondResponse {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: MsgRefillBondResponse): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgRefillBondResponse>, I>>(
|
||||
_: I
|
||||
): MsgRefillBondResponse {
|
||||
const message = createBaseMsgRefillBondResponse();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgWithdrawBond(): MsgWithdrawBond {
|
||||
return { id: "", signer: "", coins: [] };
|
||||
}
|
||||
|
||||
export const MsgWithdrawBond = {
|
||||
encode(
|
||||
message: MsgWithdrawBond,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
if (message.signer !== "") {
|
||||
writer.uint32(18).string(message.signer);
|
||||
}
|
||||
for (const v of message.coins) {
|
||||
Coin.encode(v!, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawBond {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgWithdrawBond();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.id = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.coins.push(Coin.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgWithdrawBond {
|
||||
return {
|
||||
id: isSet(object.id) ? String(object.id) : "",
|
||||
signer: isSet(object.signer) ? String(object.signer) : "",
|
||||
coins: Array.isArray(object?.coins)
|
||||
? object.coins.map((e: any) => Coin.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgWithdrawBond): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = message.id);
|
||||
message.signer !== undefined && (obj.signer = message.signer);
|
||||
if (message.coins) {
|
||||
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
|
||||
} else {
|
||||
obj.coins = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgWithdrawBond>, I>>(
|
||||
object: I
|
||||
): MsgWithdrawBond {
|
||||
const message = createBaseMsgWithdrawBond();
|
||||
message.id = object.id ?? "";
|
||||
message.signer = object.signer ?? "";
|
||||
message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgWithdrawBondResponse(): MsgWithdrawBondResponse {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const MsgWithdrawBondResponse = {
|
||||
encode(
|
||||
_: MsgWithdrawBondResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgWithdrawBondResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgWithdrawBondResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): MsgWithdrawBondResponse {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: MsgWithdrawBondResponse): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgWithdrawBondResponse>, I>>(
|
||||
_: I
|
||||
): MsgWithdrawBondResponse {
|
||||
const message = createBaseMsgWithdrawBondResponse();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgCancelBond(): MsgCancelBond {
|
||||
return { id: "", signer: "" };
|
||||
}
|
||||
|
||||
export const MsgCancelBond = {
|
||||
encode(
|
||||
message: MsgCancelBond,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.id !== "") {
|
||||
writer.uint32(10).string(message.id);
|
||||
}
|
||||
if (message.signer !== "") {
|
||||
writer.uint32(18).string(message.signer);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelBond {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCancelBond();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.id = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgCancelBond {
|
||||
return {
|
||||
id: isSet(object.id) ? String(object.id) : "",
|
||||
signer: isSet(object.signer) ? String(object.signer) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgCancelBond): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = message.id);
|
||||
message.signer !== undefined && (obj.signer = message.signer);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCancelBond>, I>>(
|
||||
object: I
|
||||
): MsgCancelBond {
|
||||
const message = createBaseMsgCancelBond();
|
||||
message.id = object.id ?? "";
|
||||
message.signer = object.signer ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgCancelBondResponse(): MsgCancelBondResponse {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const MsgCancelBondResponse = {
|
||||
encode(
|
||||
_: MsgCancelBondResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgCancelBondResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgCancelBondResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): MsgCancelBondResponse {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: MsgCancelBondResponse): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgCancelBondResponse>, I>>(
|
||||
_: I
|
||||
): MsgCancelBondResponse {
|
||||
const message = createBaseMsgCancelBondResponse();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
/** Msg defines the bond Msg service. */
|
||||
export interface Msg {
|
||||
/** CreateBond defines a method for creating a new bond. */
|
||||
CreateBond(request: MsgCreateBond): Promise<MsgCreateBondResponse>;
|
||||
/** RefillBond defines a method for refilling amount for bond. */
|
||||
RefillBond(request: MsgRefillBond): Promise<MsgRefillBondResponse>;
|
||||
/** WithdrawBond defines a method for withdrawing amount from bond. */
|
||||
WithdrawBond(request: MsgWithdrawBond): Promise<MsgWithdrawBondResponse>;
|
||||
/** CancelBond defines a method for cancelling a bond. */
|
||||
CancelBond(request: MsgCancelBond): Promise<MsgCancelBondResponse>;
|
||||
}
|
||||
|
||||
export class MsgClientImpl implements Msg {
|
||||
private readonly rpc: Rpc;
|
||||
constructor(rpc: Rpc) {
|
||||
this.rpc = rpc;
|
||||
this.CreateBond = this.CreateBond.bind(this);
|
||||
this.RefillBond = this.RefillBond.bind(this);
|
||||
this.WithdrawBond = this.WithdrawBond.bind(this);
|
||||
this.CancelBond = this.CancelBond.bind(this);
|
||||
}
|
||||
CreateBond(request: MsgCreateBond): Promise<MsgCreateBondResponse> {
|
||||
const data = MsgCreateBond.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.bond.v1.Msg", "CreateBond", data);
|
||||
return promise.then((data) =>
|
||||
MsgCreateBondResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
RefillBond(request: MsgRefillBond): Promise<MsgRefillBondResponse> {
|
||||
const data = MsgRefillBond.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.bond.v1.Msg", "RefillBond", data);
|
||||
return promise.then((data) =>
|
||||
MsgRefillBondResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
WithdrawBond(request: MsgWithdrawBond): Promise<MsgWithdrawBondResponse> {
|
||||
const data = MsgWithdrawBond.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.bond.v1.Msg", "WithdrawBond", data);
|
||||
return promise.then((data) =>
|
||||
MsgWithdrawBondResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
CancelBond(request: MsgCancelBond): Promise<MsgCancelBondResponse> {
|
||||
const data = MsgCancelBond.encode(request).finish();
|
||||
const promise = this.rpc.request("cerc.bond.v1.Msg", "CancelBond", data);
|
||||
return promise.then((data) =>
|
||||
MsgCancelBondResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
request(
|
||||
service: string,
|
||||
method: string,
|
||||
data: Uint8Array
|
||||
): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
83
src/proto2/cerc/registry/module/v1/module.ts
Normal file
83
src/proto2/cerc/registry/module/v1/module.ts
Normal file
@ -0,0 +1,83 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.registry.module.v1";
|
||||
|
||||
/**
|
||||
* Module is the app config object of the module.
|
||||
* Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
*/
|
||||
export interface Module {}
|
||||
|
||||
function createBaseModule(): Module {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const Module = {
|
||||
encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Module {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseModule();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): Module {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: Module): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Module>, I>>(_: I): Module {
|
||||
const message = createBaseModule();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
167
src/proto2/cerc/registry/v1/genesis.ts
Normal file
167
src/proto2/cerc/registry/v1/genesis.ts
Normal file
@ -0,0 +1,167 @@
|
||||
/* eslint-disable */
|
||||
import { Params, Record, AuthorityEntry, NameEntry } from "./registry";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.registry.v1";
|
||||
|
||||
/** GenesisState defines the registry module's genesis state. */
|
||||
export interface GenesisState {
|
||||
/** params defines all the params of registry module. */
|
||||
params?: Params;
|
||||
/** records */
|
||||
records: Record[];
|
||||
/** authorities */
|
||||
authorities: AuthorityEntry[];
|
||||
/** names */
|
||||
names: NameEntry[];
|
||||
}
|
||||
|
||||
function createBaseGenesisState(): GenesisState {
|
||||
return { params: undefined, records: [], authorities: [], names: [] };
|
||||
}
|
||||
|
||||
export const GenesisState = {
|
||||
encode(
|
||||
message: GenesisState,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.params !== undefined) {
|
||||
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
for (const v of message.records) {
|
||||
Record.encode(v!, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
for (const v of message.authorities) {
|
||||
AuthorityEntry.encode(v!, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
for (const v of message.names) {
|
||||
NameEntry.encode(v!, writer.uint32(34).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGenesisState();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.params = Params.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 2:
|
||||
message.records.push(Record.decode(reader, reader.uint32()));
|
||||
break;
|
||||
case 3:
|
||||
message.authorities.push(
|
||||
AuthorityEntry.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 4:
|
||||
message.names.push(NameEntry.decode(reader, reader.uint32()));
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GenesisState {
|
||||
return {
|
||||
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
|
||||
records: Array.isArray(object?.records)
|
||||
? object.records.map((e: any) => Record.fromJSON(e))
|
||||
: [],
|
||||
authorities: Array.isArray(object?.authorities)
|
||||
? object.authorities.map((e: any) => AuthorityEntry.fromJSON(e))
|
||||
: [],
|
||||
names: Array.isArray(object?.names)
|
||||
? object.names.map((e: any) => NameEntry.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GenesisState): unknown {
|
||||
const obj: any = {};
|
||||
message.params !== undefined &&
|
||||
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
|
||||
if (message.records) {
|
||||
obj.records = message.records.map((e) =>
|
||||
e ? Record.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.records = [];
|
||||
}
|
||||
if (message.authorities) {
|
||||
obj.authorities = message.authorities.map((e) =>
|
||||
e ? AuthorityEntry.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.authorities = [];
|
||||
}
|
||||
if (message.names) {
|
||||
obj.names = message.names.map((e) =>
|
||||
e ? NameEntry.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.names = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<GenesisState>, I>>(
|
||||
object: I
|
||||
): GenesisState {
|
||||
const message = createBaseGenesisState();
|
||||
message.params =
|
||||
object.params !== undefined && object.params !== null
|
||||
? Params.fromPartial(object.params)
|
||||
: undefined;
|
||||
message.records = object.records?.map((e) => Record.fromPartial(e)) || [];
|
||||
message.authorities =
|
||||
object.authorities?.map((e) => AuthorityEntry.fromPartial(e)) || [];
|
||||
message.names = object.names?.map((e) => NameEntry.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
2068
src/proto2/cerc/registry/v1/query.ts
Normal file
2068
src/proto2/cerc/registry/v1/query.ts
Normal file
File diff suppressed because it is too large
Load Diff
1259
src/proto2/cerc/registry/v1/registry.ts
Normal file
1259
src/proto2/cerc/registry/v1/registry.ts
Normal file
File diff suppressed because it is too large
Load Diff
1584
src/proto2/cerc/registry/v1/tx.ts
Normal file
1584
src/proto2/cerc/registry/v1/tx.ts
Normal file
File diff suppressed because it is too large
Load Diff
337
src/proto2/cosmos/app/v1alpha1/module.ts
Normal file
337
src/proto2/cosmos/app/v1alpha1/module.ts
Normal file
@ -0,0 +1,337 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.app.v1alpha1";
|
||||
|
||||
/** ModuleDescriptor describes an app module. */
|
||||
export interface ModuleDescriptor {
|
||||
/**
|
||||
* go_import names the package that should be imported by an app to load the
|
||||
* module in the runtime module registry. It is required to make debugging
|
||||
* of configuration errors easier for users.
|
||||
*/
|
||||
goImport: string;
|
||||
/**
|
||||
* use_package refers to a protobuf package that this module
|
||||
* uses and exposes to the world. In an app, only one module should "use"
|
||||
* or own a single protobuf package. It is assumed that the module uses
|
||||
* all of the .proto files in a single package.
|
||||
*/
|
||||
usePackage: PackageReference[];
|
||||
/**
|
||||
* can_migrate_from defines which module versions this module can migrate
|
||||
* state from. The framework will check that one module version is able to
|
||||
* migrate from a previous module version before attempting to update its
|
||||
* config. It is assumed that modules can transitively migrate from earlier
|
||||
* versions. For instance if v3 declares it can migrate from v2, and v2
|
||||
* declares it can migrate from v1, the framework knows how to migrate
|
||||
* from v1 to v3, assuming all 3 module versions are registered at runtime.
|
||||
*/
|
||||
canMigrateFrom: MigrateFromInfo[];
|
||||
}
|
||||
|
||||
/** PackageReference is a reference to a protobuf package used by a module. */
|
||||
export interface PackageReference {
|
||||
/** name is the fully-qualified name of the package. */
|
||||
name: string;
|
||||
/**
|
||||
* revision is the optional revision of the package that is being used.
|
||||
* Protobuf packages used in Cosmos should generally have a major version
|
||||
* as the last part of the package name, ex. foo.bar.baz.v1.
|
||||
* The revision of a package can be thought of as the minor version of a
|
||||
* package which has additional backwards compatible definitions that weren't
|
||||
* present in a previous version.
|
||||
*
|
||||
* A package should indicate its revision with a source code comment
|
||||
* above the package declaration in one of its files containing the
|
||||
* text "Revision N" where N is an integer revision. All packages start
|
||||
* at revision 0 the first time they are released in a module.
|
||||
*
|
||||
* When a new version of a module is released and items are added to existing
|
||||
* .proto files, these definitions should contain comments of the form
|
||||
* "Since: Revision N" where N is an integer revision.
|
||||
*
|
||||
* When the module runtime starts up, it will check the pinned proto
|
||||
* image and panic if there are runtime protobuf definitions that are not
|
||||
* in the pinned descriptor which do not have
|
||||
* a "Since Revision N" comment or have a "Since Revision N" comment where
|
||||
* N is <= to the revision specified here. This indicates that the protobuf
|
||||
* files have been updated, but the pinned file descriptor hasn't.
|
||||
*
|
||||
* If there are items in the pinned file descriptor with a revision
|
||||
* greater than the value indicated here, this will also cause a panic
|
||||
* as it may mean that the pinned descriptor for a legacy module has been
|
||||
* improperly updated or that there is some other versioning discrepancy.
|
||||
* Runtime protobuf definitions will also be checked for compatibility
|
||||
* with pinned file descriptors to make sure there are no incompatible changes.
|
||||
*
|
||||
* This behavior ensures that:
|
||||
* * pinned proto images are up-to-date
|
||||
* * protobuf files are carefully annotated with revision comments which
|
||||
* are important good client UX
|
||||
* * protobuf files are changed in backwards and forwards compatible ways
|
||||
*/
|
||||
revision: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* MigrateFromInfo is information on a module version that a newer module
|
||||
* can migrate from.
|
||||
*/
|
||||
export interface MigrateFromInfo {
|
||||
/**
|
||||
* module is the fully-qualified protobuf name of the module config object
|
||||
* for the previous module version, ex: "cosmos.group.module.v1.Module".
|
||||
*/
|
||||
module: string;
|
||||
}
|
||||
|
||||
function createBaseModuleDescriptor(): ModuleDescriptor {
|
||||
return { goImport: "", usePackage: [], canMigrateFrom: [] };
|
||||
}
|
||||
|
||||
export const ModuleDescriptor = {
|
||||
encode(
|
||||
message: ModuleDescriptor,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.goImport !== "") {
|
||||
writer.uint32(10).string(message.goImport);
|
||||
}
|
||||
for (const v of message.usePackage) {
|
||||
PackageReference.encode(v!, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
for (const v of message.canMigrateFrom) {
|
||||
MigrateFromInfo.encode(v!, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ModuleDescriptor {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseModuleDescriptor();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.goImport = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.usePackage.push(
|
||||
PackageReference.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 3:
|
||||
message.canMigrateFrom.push(
|
||||
MigrateFromInfo.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ModuleDescriptor {
|
||||
return {
|
||||
goImport: isSet(object.goImport) ? String(object.goImport) : "",
|
||||
usePackage: Array.isArray(object?.usePackage)
|
||||
? object.usePackage.map((e: any) => PackageReference.fromJSON(e))
|
||||
: [],
|
||||
canMigrateFrom: Array.isArray(object?.canMigrateFrom)
|
||||
? object.canMigrateFrom.map((e: any) => MigrateFromInfo.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ModuleDescriptor): unknown {
|
||||
const obj: any = {};
|
||||
message.goImport !== undefined && (obj.goImport = message.goImport);
|
||||
if (message.usePackage) {
|
||||
obj.usePackage = message.usePackage.map((e) =>
|
||||
e ? PackageReference.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.usePackage = [];
|
||||
}
|
||||
if (message.canMigrateFrom) {
|
||||
obj.canMigrateFrom = message.canMigrateFrom.map((e) =>
|
||||
e ? MigrateFromInfo.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.canMigrateFrom = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<ModuleDescriptor>, I>>(
|
||||
object: I
|
||||
): ModuleDescriptor {
|
||||
const message = createBaseModuleDescriptor();
|
||||
message.goImport = object.goImport ?? "";
|
||||
message.usePackage =
|
||||
object.usePackage?.map((e) => PackageReference.fromPartial(e)) || [];
|
||||
message.canMigrateFrom =
|
||||
object.canMigrateFrom?.map((e) => MigrateFromInfo.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePackageReference(): PackageReference {
|
||||
return { name: "", revision: 0 };
|
||||
}
|
||||
|
||||
export const PackageReference = {
|
||||
encode(
|
||||
message: PackageReference,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.name !== "") {
|
||||
writer.uint32(10).string(message.name);
|
||||
}
|
||||
if (message.revision !== 0) {
|
||||
writer.uint32(16).uint32(message.revision);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PackageReference {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePackageReference();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.name = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.revision = reader.uint32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PackageReference {
|
||||
return {
|
||||
name: isSet(object.name) ? String(object.name) : "",
|
||||
revision: isSet(object.revision) ? Number(object.revision) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PackageReference): unknown {
|
||||
const obj: any = {};
|
||||
message.name !== undefined && (obj.name = message.name);
|
||||
message.revision !== undefined &&
|
||||
(obj.revision = Math.round(message.revision));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<PackageReference>, I>>(
|
||||
object: I
|
||||
): PackageReference {
|
||||
const message = createBasePackageReference();
|
||||
message.name = object.name ?? "";
|
||||
message.revision = object.revision ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMigrateFromInfo(): MigrateFromInfo {
|
||||
return { module: "" };
|
||||
}
|
||||
|
||||
export const MigrateFromInfo = {
|
||||
encode(
|
||||
message: MigrateFromInfo,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.module !== "") {
|
||||
writer.uint32(10).string(message.module);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): MigrateFromInfo {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMigrateFromInfo();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.module = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MigrateFromInfo {
|
||||
return {
|
||||
module: isSet(object.module) ? String(object.module) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MigrateFromInfo): unknown {
|
||||
const obj: any = {};
|
||||
message.module !== undefined && (obj.module = message.module);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MigrateFromInfo>, I>>(
|
||||
object: I
|
||||
): MigrateFromInfo {
|
||||
const message = createBaseMigrateFromInfo();
|
||||
message.module = object.module ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
322
src/proto2/cosmos/base/query/v1beta1/pagination.ts
Normal file
322
src/proto2/cosmos/base/query/v1beta1/pagination.ts
Normal file
@ -0,0 +1,322 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.query.v1beta1";
|
||||
|
||||
/**
|
||||
* PageRequest is to be embedded in gRPC request messages for efficient
|
||||
* pagination. Ex:
|
||||
*
|
||||
* message SomeRequest {
|
||||
* Foo some_parameter = 1;
|
||||
* PageRequest pagination = 2;
|
||||
* }
|
||||
*/
|
||||
export interface 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.
|
||||
*/
|
||||
key: Uint8Array;
|
||||
/**
|
||||
* offset is a numeric offset that can be used when key is unavailable.
|
||||
* It is less efficient than using key. Only one of offset or key should
|
||||
* be set.
|
||||
*/
|
||||
offset: Long;
|
||||
/**
|
||||
* limit is the total number of results to be returned in the result page.
|
||||
* If left empty it will default to a value to be set by each app.
|
||||
*/
|
||||
limit: Long;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
countTotal: boolean;
|
||||
/**
|
||||
* reverse is set to true if results are to be returned in the descending order.
|
||||
*
|
||||
* Since: cosmos-sdk 0.43
|
||||
*/
|
||||
reverse: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
* }
|
||||
*/
|
||||
export interface PageResponse {
|
||||
/**
|
||||
* next_key is the key to be passed to PageRequest.key to
|
||||
* query the next page most efficiently. It will be empty if
|
||||
* there are no more results.
|
||||
*/
|
||||
nextKey: Uint8Array;
|
||||
/**
|
||||
* total is total number of results available if PageRequest.count_total
|
||||
* was set, its value is undefined otherwise
|
||||
*/
|
||||
total: Long;
|
||||
}
|
||||
|
||||
function createBasePageRequest(): PageRequest {
|
||||
return {
|
||||
key: new Uint8Array(),
|
||||
offset: Long.UZERO,
|
||||
limit: Long.UZERO,
|
||||
countTotal: false,
|
||||
reverse: false,
|
||||
};
|
||||
}
|
||||
|
||||
export const PageRequest = {
|
||||
encode(
|
||||
message: PageRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.key.length !== 0) {
|
||||
writer.uint32(10).bytes(message.key);
|
||||
}
|
||||
if (!message.offset.isZero()) {
|
||||
writer.uint32(16).uint64(message.offset);
|
||||
}
|
||||
if (!message.limit.isZero()) {
|
||||
writer.uint32(24).uint64(message.limit);
|
||||
}
|
||||
if (message.countTotal === true) {
|
||||
writer.uint32(32).bool(message.countTotal);
|
||||
}
|
||||
if (message.reverse === true) {
|
||||
writer.uint32(40).bool(message.reverse);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePageRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.key = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.offset = reader.uint64() as Long;
|
||||
break;
|
||||
case 3:
|
||||
message.limit = reader.uint64() as Long;
|
||||
break;
|
||||
case 4:
|
||||
message.countTotal = reader.bool();
|
||||
break;
|
||||
case 5:
|
||||
message.reverse = reader.bool();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageRequest {
|
||||
return {
|
||||
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
|
||||
offset: isSet(object.offset) ? Long.fromValue(object.offset) : Long.UZERO,
|
||||
limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO,
|
||||
countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false,
|
||||
reverse: isSet(object.reverse) ? Boolean(object.reverse) : false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PageRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.key !== undefined &&
|
||||
(obj.key = base64FromBytes(
|
||||
message.key !== undefined ? message.key : new Uint8Array()
|
||||
));
|
||||
message.offset !== undefined &&
|
||||
(obj.offset = (message.offset || Long.UZERO).toString());
|
||||
message.limit !== undefined &&
|
||||
(obj.limit = (message.limit || Long.UZERO).toString());
|
||||
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
|
||||
message.reverse !== undefined && (obj.reverse = message.reverse);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<PageRequest>, I>>(
|
||||
object: I
|
||||
): PageRequest {
|
||||
const message = createBasePageRequest();
|
||||
message.key = object.key ?? new Uint8Array();
|
||||
message.offset =
|
||||
object.offset !== undefined && object.offset !== null
|
||||
? Long.fromValue(object.offset)
|
||||
: Long.UZERO;
|
||||
message.limit =
|
||||
object.limit !== undefined && object.limit !== null
|
||||
? Long.fromValue(object.limit)
|
||||
: Long.UZERO;
|
||||
message.countTotal = object.countTotal ?? false;
|
||||
message.reverse = object.reverse ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePageResponse(): PageResponse {
|
||||
return { nextKey: new Uint8Array(), total: Long.UZERO };
|
||||
}
|
||||
|
||||
export const PageResponse = {
|
||||
encode(
|
||||
message: PageResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.nextKey.length !== 0) {
|
||||
writer.uint32(10).bytes(message.nextKey);
|
||||
}
|
||||
if (!message.total.isZero()) {
|
||||
writer.uint32(16).uint64(message.total);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePageResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.nextKey = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.total = reader.uint64() as Long;
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageResponse {
|
||||
return {
|
||||
nextKey: isSet(object.nextKey)
|
||||
? bytesFromBase64(object.nextKey)
|
||||
: new Uint8Array(),
|
||||
total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PageResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.nextKey !== undefined &&
|
||||
(obj.nextKey = base64FromBytes(
|
||||
message.nextKey !== undefined ? message.nextKey : new Uint8Array()
|
||||
));
|
||||
message.total !== undefined &&
|
||||
(obj.total = (message.total || Long.UZERO).toString());
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<PageResponse>, I>>(
|
||||
object: I
|
||||
): PageResponse {
|
||||
const message = createBasePageResponse();
|
||||
message.nextKey = object.nextKey ?? new Uint8Array();
|
||||
message.total =
|
||||
object.total !== undefined && object.total !== null
|
||||
? Long.fromValue(object.total)
|
||||
: Long.UZERO;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare var self: any | undefined;
|
||||
declare var window: any | undefined;
|
||||
declare var global: any | undefined;
|
||||
var globalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") return globalThis;
|
||||
if (typeof self !== "undefined") return self;
|
||||
if (typeof window !== "undefined") return window;
|
||||
if (typeof global !== "undefined") return global;
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
function bytesFromBase64(b64: string): Uint8Array {
|
||||
if (globalThis.Buffer) {
|
||||
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
||||
} else {
|
||||
const bin = globalThis.atob(b64);
|
||||
const arr = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; ++i) {
|
||||
arr[i] = bin.charCodeAt(i);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
function base64FromBytes(arr: Uint8Array): string {
|
||||
if (globalThis.Buffer) {
|
||||
return globalThis.Buffer.from(arr).toString("base64");
|
||||
} else {
|
||||
const bin: string[] = [];
|
||||
arr.forEach((byte) => {
|
||||
bin.push(String.fromCharCode(byte));
|
||||
});
|
||||
return globalThis.btoa(bin.join(""));
|
||||
}
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
303
src/proto2/cosmos/base/v1beta1/coin.ts
Normal file
303
src/proto2/cosmos/base/v1beta1/coin.ts
Normal file
@ -0,0 +1,303 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.v1beta1";
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export interface Coin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export interface DecCoin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* IntProto defines a Protobuf wrapper around an Int object.
|
||||
* Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
|
||||
*/
|
||||
export interface IntProto {
|
||||
int: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DecProto defines a Protobuf wrapper around a Dec object.
|
||||
* Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
|
||||
*/
|
||||
export interface DecProto {
|
||||
dec: string;
|
||||
}
|
||||
|
||||
function createBaseCoin(): Coin {
|
||||
return { denom: "", amount: "" };
|
||||
}
|
||||
|
||||
export const Coin = {
|
||||
encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.denom !== "") {
|
||||
writer.uint32(10).string(message.denom);
|
||||
}
|
||||
if (message.amount !== "") {
|
||||
writer.uint32(18).string(message.amount);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Coin {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCoin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Coin {
|
||||
return {
|
||||
denom: isSet(object.denom) ? String(object.denom) : "",
|
||||
amount: isSet(object.amount) ? String(object.amount) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Coin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Coin>, I>>(object: I): Coin {
|
||||
const message = createBaseCoin();
|
||||
message.denom = object.denom ?? "";
|
||||
message.amount = object.amount ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDecCoin(): DecCoin {
|
||||
return { denom: "", amount: "" };
|
||||
}
|
||||
|
||||
export const DecCoin = {
|
||||
encode(
|
||||
message: DecCoin,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.denom !== "") {
|
||||
writer.uint32(10).string(message.denom);
|
||||
}
|
||||
if (message.amount !== "") {
|
||||
writer.uint32(18).string(message.amount);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDecCoin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecCoin {
|
||||
return {
|
||||
denom: isSet(object.denom) ? String(object.denom) : "",
|
||||
amount: isSet(object.amount) ? String(object.amount) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: DecCoin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<DecCoin>, I>>(object: I): DecCoin {
|
||||
const message = createBaseDecCoin();
|
||||
message.denom = object.denom ?? "";
|
||||
message.amount = object.amount ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseIntProto(): IntProto {
|
||||
return { int: "" };
|
||||
}
|
||||
|
||||
export const IntProto = {
|
||||
encode(
|
||||
message: IntProto,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.int !== "") {
|
||||
writer.uint32(10).string(message.int);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): IntProto {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseIntProto();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.int = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): IntProto {
|
||||
return {
|
||||
int: isSet(object.int) ? String(object.int) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: IntProto): unknown {
|
||||
const obj: any = {};
|
||||
message.int !== undefined && (obj.int = message.int);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<IntProto>, I>>(object: I): IntProto {
|
||||
const message = createBaseIntProto();
|
||||
message.int = object.int ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDecProto(): DecProto {
|
||||
return { dec: "" };
|
||||
}
|
||||
|
||||
export const DecProto = {
|
||||
encode(
|
||||
message: DecProto,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.dec !== "") {
|
||||
writer.uint32(10).string(message.dec);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecProto {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDecProto();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.dec = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecProto {
|
||||
return {
|
||||
dec: isSet(object.dec) ? String(object.dec) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: DecProto): unknown {
|
||||
const obj: any = {};
|
||||
message.dec !== undefined && (obj.dec = message.dec);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<DecProto>, I>>(object: I): DecProto {
|
||||
const message = createBaseDecProto();
|
||||
message.dec = object.dec ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
2
src/proto2/cosmos/msg/v1/msg.ts
Normal file
2
src/proto2/cosmos/msg/v1/msg.ts
Normal file
@ -0,0 +1,2 @@
|
||||
/* eslint-disable */
|
||||
export const protobufPackage = "cosmos.msg.v1";
|
284
src/proto2/cosmos_proto/cosmos.ts
Normal file
284
src/proto2/cosmos_proto/cosmos.ts
Normal file
@ -0,0 +1,284 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos_proto";
|
||||
|
||||
export enum ScalarType {
|
||||
SCALAR_TYPE_UNSPECIFIED = 0,
|
||||
SCALAR_TYPE_STRING = 1,
|
||||
SCALAR_TYPE_BYTES = 2,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function scalarTypeFromJSON(object: any): ScalarType {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "SCALAR_TYPE_UNSPECIFIED":
|
||||
return ScalarType.SCALAR_TYPE_UNSPECIFIED;
|
||||
case 1:
|
||||
case "SCALAR_TYPE_STRING":
|
||||
return ScalarType.SCALAR_TYPE_STRING;
|
||||
case 2:
|
||||
case "SCALAR_TYPE_BYTES":
|
||||
return ScalarType.SCALAR_TYPE_BYTES;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return ScalarType.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function scalarTypeToJSON(object: ScalarType): string {
|
||||
switch (object) {
|
||||
case ScalarType.SCALAR_TYPE_UNSPECIFIED:
|
||||
return "SCALAR_TYPE_UNSPECIFIED";
|
||||
case ScalarType.SCALAR_TYPE_STRING:
|
||||
return "SCALAR_TYPE_STRING";
|
||||
case ScalarType.SCALAR_TYPE_BYTES:
|
||||
return "SCALAR_TYPE_BYTES";
|
||||
case ScalarType.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* InterfaceDescriptor describes an interface type to be used with
|
||||
* accepts_interface and implements_interface and declared by declare_interface.
|
||||
*/
|
||||
export interface InterfaceDescriptor {
|
||||
/**
|
||||
* name is the name of the interface. It should be a short-name (without
|
||||
* a period) such that the fully qualified name of the interface will be
|
||||
* package.name, ex. for the package a.b and interface named C, the
|
||||
* fully-qualified name will be a.b.C.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* description is a human-readable description of the interface and its
|
||||
* purpose.
|
||||
*/
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ScalarDescriptor describes an scalar type to be used with
|
||||
* the scalar field option and declared by declare_scalar.
|
||||
* Scalars extend simple protobuf built-in types with additional
|
||||
* syntax and semantics, for instance to represent big integers.
|
||||
* Scalars should ideally define an encoding such that there is only one
|
||||
* valid syntactical representation for a given semantic meaning,
|
||||
* i.e. the encoding should be deterministic.
|
||||
*/
|
||||
export interface ScalarDescriptor {
|
||||
/**
|
||||
* name is the name of the scalar. It should be a short-name (without
|
||||
* a period) such that the fully qualified name of the scalar will be
|
||||
* package.name, ex. for the package a.b and scalar named C, the
|
||||
* fully-qualified name will be a.b.C.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* description is a human-readable description of the scalar and its
|
||||
* encoding format. For instance a big integer or decimal scalar should
|
||||
* specify precisely the expected encoding format.
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* field_type is the type of field with which this scalar can be used.
|
||||
* Scalars can be used with one and only one type of field so that
|
||||
* encoding standards and simple and clear. Currently only string and
|
||||
* bytes fields are supported for scalars.
|
||||
*/
|
||||
fieldType: ScalarType[];
|
||||
}
|
||||
|
||||
function createBaseInterfaceDescriptor(): InterfaceDescriptor {
|
||||
return { name: "", description: "" };
|
||||
}
|
||||
|
||||
export const InterfaceDescriptor = {
|
||||
encode(
|
||||
message: InterfaceDescriptor,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.name !== "") {
|
||||
writer.uint32(10).string(message.name);
|
||||
}
|
||||
if (message.description !== "") {
|
||||
writer.uint32(18).string(message.description);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseInterfaceDescriptor();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.name = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.description = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): InterfaceDescriptor {
|
||||
return {
|
||||
name: isSet(object.name) ? String(object.name) : "",
|
||||
description: isSet(object.description) ? String(object.description) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: InterfaceDescriptor): unknown {
|
||||
const obj: any = {};
|
||||
message.name !== undefined && (obj.name = message.name);
|
||||
message.description !== undefined &&
|
||||
(obj.description = message.description);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<InterfaceDescriptor>, I>>(
|
||||
object: I
|
||||
): InterfaceDescriptor {
|
||||
const message = createBaseInterfaceDescriptor();
|
||||
message.name = object.name ?? "";
|
||||
message.description = object.description ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseScalarDescriptor(): ScalarDescriptor {
|
||||
return { name: "", description: "", fieldType: [] };
|
||||
}
|
||||
|
||||
export const ScalarDescriptor = {
|
||||
encode(
|
||||
message: ScalarDescriptor,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.name !== "") {
|
||||
writer.uint32(10).string(message.name);
|
||||
}
|
||||
if (message.description !== "") {
|
||||
writer.uint32(18).string(message.description);
|
||||
}
|
||||
writer.uint32(26).fork();
|
||||
for (const v of message.fieldType) {
|
||||
writer.int32(v);
|
||||
}
|
||||
writer.ldelim();
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseScalarDescriptor();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.name = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.description = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
if ((tag & 7) === 2) {
|
||||
const end2 = reader.uint32() + reader.pos;
|
||||
while (reader.pos < end2) {
|
||||
message.fieldType.push(reader.int32() as any);
|
||||
}
|
||||
} else {
|
||||
message.fieldType.push(reader.int32() as any);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ScalarDescriptor {
|
||||
return {
|
||||
name: isSet(object.name) ? String(object.name) : "",
|
||||
description: isSet(object.description) ? String(object.description) : "",
|
||||
fieldType: Array.isArray(object?.fieldType)
|
||||
? object.fieldType.map((e: any) => scalarTypeFromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ScalarDescriptor): unknown {
|
||||
const obj: any = {};
|
||||
message.name !== undefined && (obj.name = message.name);
|
||||
message.description !== undefined &&
|
||||
(obj.description = message.description);
|
||||
if (message.fieldType) {
|
||||
obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e));
|
||||
} else {
|
||||
obj.fieldType = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<ScalarDescriptor>, I>>(
|
||||
object: I
|
||||
): ScalarDescriptor {
|
||||
const message = createBaseScalarDescriptor();
|
||||
message.name = object.name ?? "";
|
||||
message.description = object.description ?? "";
|
||||
message.fieldType = object.fieldType?.map((e) => e) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
2
src/proto2/gogoproto/gogo.ts
Normal file
2
src/proto2/gogoproto/gogo.ts
Normal file
@ -0,0 +1,2 @@
|
||||
/* eslint-disable */
|
||||
export const protobufPackage = "gogoproto";
|
2
src/proto2/google/api/annotations.ts
Normal file
2
src/proto2/google/api/annotations.ts
Normal file
@ -0,0 +1,2 @@
|
||||
/* eslint-disable */
|
||||
export const protobufPackage = "google.api";
|
647
src/proto2/google/api/http.ts
Normal file
647
src/proto2/google/api/http.ts
Normal file
@ -0,0 +1,647 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.api";
|
||||
|
||||
/**
|
||||
* Defines the HTTP configuration for an API service. It contains a list of
|
||||
* [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
|
||||
* to one or more HTTP REST API methods.
|
||||
*/
|
||||
export interface Http {
|
||||
/**
|
||||
* A list of HTTP configuration rules that apply to individual API methods.
|
||||
*
|
||||
* **NOTE:** All service configuration rules follow "last one wins" order.
|
||||
*/
|
||||
rules: HttpRule[];
|
||||
/**
|
||||
* When set to true, URL path 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.
|
||||
*/
|
||||
fullyDecodeReservedExpansion: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* `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: <proto_package_name>.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.
|
||||
*/
|
||||
export interface HttpRule {
|
||||
/**
|
||||
* Selects methods to which this rule applies.
|
||||
*
|
||||
* Refer to [selector][google.api.DocumentationRule.selector] for syntax
|
||||
* details.
|
||||
*/
|
||||
selector: string;
|
||||
/** Used for listing and getting information about resources. */
|
||||
get: string | undefined;
|
||||
/** Used for updating a resource. */
|
||||
put: string | undefined;
|
||||
/** Used for creating a resource. */
|
||||
post: string | undefined;
|
||||
/** Used for deleting a resource. */
|
||||
delete: string | undefined;
|
||||
/** Used for updating a resource. */
|
||||
patch: string | undefined;
|
||||
/**
|
||||
* The custom pattern is used for specifying an HTTP method that is not
|
||||
* included in the `pattern` field, such as HEAD, or "*" to leave the
|
||||
* HTTP method unspecified for this rule. The wild-card rule is useful
|
||||
* for services that provide content to Web (HTML) clients.
|
||||
*/
|
||||
custom?: CustomHttpPattern | undefined;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
responseBody: string;
|
||||
/**
|
||||
* Additional HTTP bindings for the selector. Nested bindings must
|
||||
* not contain an `additional_bindings` field themselves (that is,
|
||||
* the nesting may only be one level deep).
|
||||
*/
|
||||
additionalBindings: HttpRule[];
|
||||
}
|
||||
|
||||
/** A custom pattern is used for defining custom HTTP verb. */
|
||||
export interface CustomHttpPattern {
|
||||
/** The name of this custom HTTP verb. */
|
||||
kind: string;
|
||||
/** The path matched by this custom verb. */
|
||||
path: string;
|
||||
}
|
||||
|
||||
function createBaseHttp(): Http {
|
||||
return { rules: [], fullyDecodeReservedExpansion: false };
|
||||
}
|
||||
|
||||
export const Http = {
|
||||
encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.rules) {
|
||||
HttpRule.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.fullyDecodeReservedExpansion === true) {
|
||||
writer.uint32(16).bool(message.fullyDecodeReservedExpansion);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Http {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseHttp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.rules.push(HttpRule.decode(reader, reader.uint32()));
|
||||
break;
|
||||
case 2:
|
||||
message.fullyDecodeReservedExpansion = reader.bool();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Http {
|
||||
return {
|
||||
rules: Array.isArray(object?.rules)
|
||||
? object.rules.map((e: any) => HttpRule.fromJSON(e))
|
||||
: [],
|
||||
fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion)
|
||||
? Boolean(object.fullyDecodeReservedExpansion)
|
||||
: false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Http): unknown {
|
||||
const obj: any = {};
|
||||
if (message.rules) {
|
||||
obj.rules = message.rules.map((e) =>
|
||||
e ? HttpRule.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.rules = [];
|
||||
}
|
||||
message.fullyDecodeReservedExpansion !== undefined &&
|
||||
(obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Http>, I>>(object: I): Http {
|
||||
const message = createBaseHttp();
|
||||
message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || [];
|
||||
message.fullyDecodeReservedExpansion =
|
||||
object.fullyDecodeReservedExpansion ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseHttpRule(): HttpRule {
|
||||
return {
|
||||
selector: "",
|
||||
get: undefined,
|
||||
put: undefined,
|
||||
post: undefined,
|
||||
delete: undefined,
|
||||
patch: undefined,
|
||||
custom: undefined,
|
||||
body: "",
|
||||
responseBody: "",
|
||||
additionalBindings: [],
|
||||
};
|
||||
}
|
||||
|
||||
export const HttpRule = {
|
||||
encode(
|
||||
message: HttpRule,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.selector !== "") {
|
||||
writer.uint32(10).string(message.selector);
|
||||
}
|
||||
if (message.get !== undefined) {
|
||||
writer.uint32(18).string(message.get);
|
||||
}
|
||||
if (message.put !== undefined) {
|
||||
writer.uint32(26).string(message.put);
|
||||
}
|
||||
if (message.post !== undefined) {
|
||||
writer.uint32(34).string(message.post);
|
||||
}
|
||||
if (message.delete !== undefined) {
|
||||
writer.uint32(42).string(message.delete);
|
||||
}
|
||||
if (message.patch !== undefined) {
|
||||
writer.uint32(50).string(message.patch);
|
||||
}
|
||||
if (message.custom !== undefined) {
|
||||
CustomHttpPattern.encode(
|
||||
message.custom,
|
||||
writer.uint32(66).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.body !== "") {
|
||||
writer.uint32(58).string(message.body);
|
||||
}
|
||||
if (message.responseBody !== "") {
|
||||
writer.uint32(98).string(message.responseBody);
|
||||
}
|
||||
for (const v of message.additionalBindings) {
|
||||
HttpRule.encode(v!, writer.uint32(90).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseHttpRule();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.selector = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.get = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.put = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.post = reader.string();
|
||||
break;
|
||||
case 5:
|
||||
message.delete = reader.string();
|
||||
break;
|
||||
case 6:
|
||||
message.patch = reader.string();
|
||||
break;
|
||||
case 8:
|
||||
message.custom = CustomHttpPattern.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 7:
|
||||
message.body = reader.string();
|
||||
break;
|
||||
case 12:
|
||||
message.responseBody = reader.string();
|
||||
break;
|
||||
case 11:
|
||||
message.additionalBindings.push(
|
||||
HttpRule.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): HttpRule {
|
||||
return {
|
||||
selector: isSet(object.selector) ? String(object.selector) : "",
|
||||
get: isSet(object.get) ? String(object.get) : undefined,
|
||||
put: isSet(object.put) ? String(object.put) : undefined,
|
||||
post: isSet(object.post) ? String(object.post) : undefined,
|
||||
delete: isSet(object.delete) ? String(object.delete) : undefined,
|
||||
patch: isSet(object.patch) ? String(object.patch) : undefined,
|
||||
custom: isSet(object.custom)
|
||||
? CustomHttpPattern.fromJSON(object.custom)
|
||||
: undefined,
|
||||
body: isSet(object.body) ? String(object.body) : "",
|
||||
responseBody: isSet(object.responseBody)
|
||||
? String(object.responseBody)
|
||||
: "",
|
||||
additionalBindings: Array.isArray(object?.additionalBindings)
|
||||
? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: HttpRule): unknown {
|
||||
const obj: any = {};
|
||||
message.selector !== undefined && (obj.selector = message.selector);
|
||||
message.get !== undefined && (obj.get = message.get);
|
||||
message.put !== undefined && (obj.put = message.put);
|
||||
message.post !== undefined && (obj.post = message.post);
|
||||
message.delete !== undefined && (obj.delete = message.delete);
|
||||
message.patch !== undefined && (obj.patch = message.patch);
|
||||
message.custom !== undefined &&
|
||||
(obj.custom = message.custom
|
||||
? CustomHttpPattern.toJSON(message.custom)
|
||||
: undefined);
|
||||
message.body !== undefined && (obj.body = message.body);
|
||||
message.responseBody !== undefined &&
|
||||
(obj.responseBody = message.responseBody);
|
||||
if (message.additionalBindings) {
|
||||
obj.additionalBindings = message.additionalBindings.map((e) =>
|
||||
e ? HttpRule.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.additionalBindings = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<HttpRule>, I>>(object: I): HttpRule {
|
||||
const message = createBaseHttpRule();
|
||||
message.selector = object.selector ?? "";
|
||||
message.get = object.get ?? undefined;
|
||||
message.put = object.put ?? undefined;
|
||||
message.post = object.post ?? undefined;
|
||||
message.delete = object.delete ?? undefined;
|
||||
message.patch = object.patch ?? undefined;
|
||||
message.custom =
|
||||
object.custom !== undefined && object.custom !== null
|
||||
? CustomHttpPattern.fromPartial(object.custom)
|
||||
: undefined;
|
||||
message.body = object.body ?? "";
|
||||
message.responseBody = object.responseBody ?? "";
|
||||
message.additionalBindings =
|
||||
object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCustomHttpPattern(): CustomHttpPattern {
|
||||
return { kind: "", path: "" };
|
||||
}
|
||||
|
||||
export const CustomHttpPattern = {
|
||||
encode(
|
||||
message: CustomHttpPattern,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.kind !== "") {
|
||||
writer.uint32(10).string(message.kind);
|
||||
}
|
||||
if (message.path !== "") {
|
||||
writer.uint32(18).string(message.path);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCustomHttpPattern();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.kind = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.path = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CustomHttpPattern {
|
||||
return {
|
||||
kind: isSet(object.kind) ? String(object.kind) : "",
|
||||
path: isSet(object.path) ? String(object.path) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: CustomHttpPattern): unknown {
|
||||
const obj: any = {};
|
||||
message.kind !== undefined && (obj.kind = message.kind);
|
||||
message.path !== undefined && (obj.path = message.path);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<CustomHttpPattern>, I>>(
|
||||
object: I
|
||||
): CustomHttpPattern {
|
||||
const message = createBaseCustomHttpPattern();
|
||||
message.kind = object.kind ?? "";
|
||||
message.path = object.path ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
4395
src/proto2/google/protobuf/descriptor.ts
Normal file
4395
src/proto2/google/protobuf/descriptor.ts
Normal file
File diff suppressed because it is too large
Load Diff
187
src/proto2/google/protobuf/duration.ts
Normal file
187
src/proto2/google/protobuf/duration.ts
Normal file
@ -0,0 +1,187 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* A Duration represents a signed, fixed-length span of time represented
|
||||
* as a count of seconds and fractions of seconds at nanosecond
|
||||
* resolution. It is independent of any calendar and concepts like "day"
|
||||
* or "month". It is related to Timestamp in that the difference between
|
||||
* two Timestamp values is a Duration and it can be added or subtracted
|
||||
* from a Timestamp. Range is approximately +-10,000 years.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* Example 1: Compute Duration from two Timestamps in pseudo code.
|
||||
*
|
||||
* Timestamp start = ...;
|
||||
* Timestamp end = ...;
|
||||
* Duration duration = ...;
|
||||
*
|
||||
* duration.seconds = end.seconds - start.seconds;
|
||||
* duration.nanos = end.nanos - start.nanos;
|
||||
*
|
||||
* if (duration.seconds < 0 && duration.nanos > 0) {
|
||||
* duration.seconds += 1;
|
||||
* duration.nanos -= 1000000000;
|
||||
* } else if (duration.seconds > 0 && duration.nanos < 0) {
|
||||
* duration.seconds -= 1;
|
||||
* duration.nanos += 1000000000;
|
||||
* }
|
||||
*
|
||||
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
||||
*
|
||||
* Timestamp start = ...;
|
||||
* Duration duration = ...;
|
||||
* Timestamp end = ...;
|
||||
*
|
||||
* end.seconds = start.seconds + duration.seconds;
|
||||
* end.nanos = start.nanos + duration.nanos;
|
||||
*
|
||||
* if (end.nanos < 0) {
|
||||
* end.seconds -= 1;
|
||||
* end.nanos += 1000000000;
|
||||
* } else if (end.nanos >= 1000000000) {
|
||||
* end.seconds += 1;
|
||||
* end.nanos -= 1000000000;
|
||||
* }
|
||||
*
|
||||
* Example 3: Compute Duration from datetime.timedelta in Python.
|
||||
*
|
||||
* td = datetime.timedelta(days=3, minutes=10)
|
||||
* duration = Duration()
|
||||
* duration.FromTimedelta(td)
|
||||
*
|
||||
* # JSON Mapping
|
||||
*
|
||||
* In JSON format, the Duration type is encoded as a string rather than an
|
||||
* object, where the string ends in the suffix "s" (indicating seconds) and
|
||||
* is preceded by the number of seconds, with nanoseconds expressed as
|
||||
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
||||
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
||||
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
||||
* microsecond should be expressed in JSON format as "3.000001s".
|
||||
*/
|
||||
export interface Duration {
|
||||
/**
|
||||
* Signed seconds of the span of time. Must be from -315,576,000,000
|
||||
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
||||
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
||||
*/
|
||||
seconds: Long;
|
||||
/**
|
||||
* Signed fractions of a second at nanosecond resolution of the span
|
||||
* of time. Durations less than one second are represented with a 0
|
||||
* `seconds` field and a positive or negative `nanos` field. For durations
|
||||
* of one second or more, a non-zero value for the `nanos` field must be
|
||||
* of the same sign as the `seconds` field. Must be from -999,999,999
|
||||
* to +999,999,999 inclusive.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseDuration(): Duration {
|
||||
return { seconds: Long.ZERO, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Duration = {
|
||||
encode(
|
||||
message: Duration,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (!message.seconds.isZero()) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Duration {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDuration();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.seconds = reader.int64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.int32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Duration {
|
||||
return {
|
||||
seconds: isSet(object.seconds)
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Duration): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined &&
|
||||
(obj.seconds = (message.seconds || Long.ZERO).toString());
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Duration>, I>>(object: I): Duration {
|
||||
const message = createBaseDuration();
|
||||
message.seconds =
|
||||
object.seconds !== undefined && object.seconds !== null
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
220
src/proto2/google/protobuf/timestamp.ts
Normal file
220
src/proto2/google/protobuf/timestamp.ts
Normal file
@ -0,0 +1,220 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* A Timestamp represents a point in time independent of any time zone or local
|
||||
* calendar, encoded as a count of seconds and fractions of seconds at
|
||||
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||
* Gregorian calendar backwards to year one.
|
||||
*
|
||||
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||
* second table is needed for interpretation, using a [24-hour linear
|
||||
* smear](https://developers.google.com/time/smear).
|
||||
*
|
||||
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||
* restricting to that range, we ensure that we can convert to and from [RFC
|
||||
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* Example 1: Compute Timestamp from POSIX `time()`.
|
||||
*
|
||||
* Timestamp timestamp;
|
||||
* timestamp.set_seconds(time(NULL));
|
||||
* timestamp.set_nanos(0);
|
||||
*
|
||||
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
*
|
||||
* struct timeval tv;
|
||||
* gettimeofday(&tv, NULL);
|
||||
*
|
||||
* Timestamp timestamp;
|
||||
* timestamp.set_seconds(tv.tv_sec);
|
||||
* timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
*
|
||||
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
*
|
||||
* FILETIME ft;
|
||||
* GetSystemTimeAsFileTime(&ft);
|
||||
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
*
|
||||
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
* Timestamp timestamp;
|
||||
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
*
|
||||
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
*
|
||||
* long millis = System.currentTimeMillis();
|
||||
*
|
||||
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
*
|
||||
*
|
||||
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
*
|
||||
* Instant now = Instant.now();
|
||||
*
|
||||
* Timestamp timestamp =
|
||||
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
* .setNanos(now.getNano()).build();
|
||||
*
|
||||
*
|
||||
* Example 6: Compute Timestamp from current time in Python.
|
||||
*
|
||||
* timestamp = Timestamp()
|
||||
* timestamp.GetCurrentTime()
|
||||
*
|
||||
* # JSON Mapping
|
||||
*
|
||||
* In JSON format, the Timestamp type is encoded as a string in the
|
||||
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
||||
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
||||
* where {year} is always expressed using four digits while {month}, {day},
|
||||
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||
* able to accept both UTC and other timezones (as indicated by an offset).
|
||||
*
|
||||
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
* 01:30 UTC on January 15, 2017.
|
||||
*
|
||||
* In JavaScript, one can convert a Date object to this format using the
|
||||
* standard
|
||||
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
* method. In Python, a standard `datetime.datetime` object can be converted
|
||||
* to this format using
|
||||
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
* ) to obtain a formatter capable of generating timestamps in this format.
|
||||
*/
|
||||
export interface Timestamp {
|
||||
/**
|
||||
* Represents seconds of UTC time since Unix epoch
|
||||
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
* 9999-12-31T23:59:59Z inclusive.
|
||||
*/
|
||||
seconds: Long;
|
||||
/**
|
||||
* Non-negative fractions of a second at nanosecond resolution. Negative
|
||||
* second values with fractions must still have non-negative nanos values
|
||||
* that count forward in time. Must be from 0 to 999,999,999
|
||||
* inclusive.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseTimestamp(): Timestamp {
|
||||
return { seconds: Long.ZERO, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Timestamp = {
|
||||
encode(
|
||||
message: Timestamp,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (!message.seconds.isZero()) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTimestamp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.seconds = reader.int64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.int32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Timestamp {
|
||||
return {
|
||||
seconds: isSet(object.seconds)
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Timestamp): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined &&
|
||||
(obj.seconds = (message.seconds || Long.ZERO).toString());
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(
|
||||
object: I
|
||||
): Timestamp {
|
||||
const message = createBaseTimestamp();
|
||||
message.seconds =
|
||||
object.seconds !== undefined && object.seconds !== null
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
78
yarn.lock
78
yarn.lock
@ -1250,6 +1250,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190"
|
||||
integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==
|
||||
|
||||
"@types/object-hash@^1.3.0":
|
||||
version "1.3.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/object-hash/-/object-hash-1.3.4.tgz#079ba142be65833293673254831b5e3e847fe58b"
|
||||
integrity sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==
|
||||
|
||||
"@types/pbkdf2@^3.0.0":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1"
|
||||
@ -1776,6 +1781,11 @@ crypto-addr-codec@^0.1.7:
|
||||
safe-buffer "^5.2.0"
|
||||
sha3 "^2.1.1"
|
||||
|
||||
dataloader@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8"
|
||||
integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==
|
||||
|
||||
debug@^4.1.0, debug@^4.1.1:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
||||
@ -2780,7 +2790,7 @@ lodash.memoize@4.x:
|
||||
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
|
||||
integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==
|
||||
|
||||
lodash@^4.17.21:
|
||||
lodash@^4.17.15, lodash@^4.17.21:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
@ -2790,7 +2800,7 @@ long@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
|
||||
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
|
||||
|
||||
long@^5.2.0:
|
||||
long@^5.0.0, long@^5.2.0:
|
||||
version "5.2.3"
|
||||
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
|
||||
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
|
||||
@ -2938,6 +2948,11 @@ npm-run-path@^4.0.1:
|
||||
dependencies:
|
||||
path-key "^3.0.0"
|
||||
|
||||
object-hash@^1.3.1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df"
|
||||
integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
@ -3041,6 +3056,11 @@ pkg-dir@^4.2.0:
|
||||
dependencies:
|
||||
find-up "^4.0.0"
|
||||
|
||||
prettier@^2.5.1:
|
||||
version "2.8.8"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
|
||||
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
|
||||
|
||||
pretty-format@^27.0.0, pretty-format@^27.5.1:
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"
|
||||
@ -3074,7 +3094,26 @@ prompts@^2.0.1:
|
||||
kleur "^3.0.3"
|
||||
sisteransi "^1.0.5"
|
||||
|
||||
protobufjs@~6.11.2:
|
||||
protobufjs@7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.0.0.tgz#8c678e1351fd926178fce5a4213913e8d990974f"
|
||||
integrity sha512-ffNIEm+quOcYtQvHdW406v1NQmZSuqVklxsXk076BtuFnlYZfigLU+JOMrTD8TUOyqHYbRI/fSVNvgd25YeN3w==
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.2"
|
||||
"@protobufjs/base64" "^1.1.2"
|
||||
"@protobufjs/codegen" "^2.0.4"
|
||||
"@protobufjs/eventemitter" "^1.1.0"
|
||||
"@protobufjs/fetch" "^1.1.0"
|
||||
"@protobufjs/float" "^1.0.2"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
"@protobufjs/path" "^1.1.2"
|
||||
"@protobufjs/pool" "^1.1.0"
|
||||
"@protobufjs/utf8" "^1.1.0"
|
||||
"@types/long" "^4.0.1"
|
||||
"@types/node" ">=13.7.0"
|
||||
long "^5.0.0"
|
||||
|
||||
protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2:
|
||||
version "6.11.4"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa"
|
||||
integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==
|
||||
@ -3093,11 +3132,6 @@ protobufjs@~6.11.2:
|
||||
"@types/node" ">=13.7.0"
|
||||
long "^4.0.0"
|
||||
|
||||
protoc-gen-ts@^0.8.7:
|
||||
version "0.8.7"
|
||||
resolved "https://registry.yarnpkg.com/protoc-gen-ts/-/protoc-gen-ts-0.8.7.tgz#63e4d9af2ad30b753acf6f739323d01fc9f80b52"
|
||||
integrity sha512-jr4VJey2J9LVYCV7EVyVe53g1VMw28cCmYJhBe5e3YX5wiyiDwgxWxeDf9oTqAe4P1bN/YGAkW2jhlH8LohwiQ==
|
||||
|
||||
pure-rand@^6.0.0:
|
||||
version "6.0.3"
|
||||
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.3.tgz#3c9e6b53c09e52ac3cedffc85ab7c1c7094b38cb"
|
||||
@ -3442,6 +3476,34 @@ ts-jest@^29.0.2:
|
||||
semver "^7.5.3"
|
||||
yargs-parser "^21.0.1"
|
||||
|
||||
ts-poet@^4.15.0:
|
||||
version "4.15.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-4.15.0.tgz#637145fa554d3b27c56541578df0ce08cd9eb328"
|
||||
integrity sha512-sLLR8yQBvHzi9d4R1F4pd+AzQxBfzOSSjfxiJxQhkUoH5bL7RsAC6wgvtVUQdGqiCsyS9rT6/8X2FI7ipdir5g==
|
||||
dependencies:
|
||||
lodash "^4.17.15"
|
||||
prettier "^2.5.1"
|
||||
|
||||
ts-proto-descriptors@1.7.1:
|
||||
version "1.7.1"
|
||||
resolved "https://registry.yarnpkg.com/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz#685d00305b06adfa929fd5a016a419382cd64c50"
|
||||
integrity sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw==
|
||||
dependencies:
|
||||
long "^4.0.0"
|
||||
protobufjs "^6.8.8"
|
||||
|
||||
ts-proto@1.121.6:
|
||||
version "1.121.6"
|
||||
resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.121.6.tgz#7eceac6149f5e6c5f89bd29ed4bf7207d4d9212e"
|
||||
integrity sha512-RURk69YVm5ZL537tRXi+9C1xyK4Upf4kcMdactxakHsF4c4CQoUSCQXqRP4At2rslS6hD+tGWpPG5wIvOUIzVw==
|
||||
dependencies:
|
||||
"@types/object-hash" "^1.3.0"
|
||||
dataloader "^1.4.0"
|
||||
object-hash "^1.3.1"
|
||||
protobufjs "^6.11.3"
|
||||
ts-poet "^4.15.0"
|
||||
ts-proto-descriptors "1.7.1"
|
||||
|
||||
tweetnacl-util@^0.15.1:
|
||||
version "0.15.1"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b"
|
||||
|
Loading…
Reference in New Issue
Block a user