Add methods for creating auctions and add auction tests #28

Merged
nabarun merged 32 commits from deep-stack/registry-sdk:iv-create-auction-test into main 2024-09-25 13:21:05 +00:00
18 changed files with 852 additions and 109 deletions
Showing only changes of commit e55f37b5e0 - Show all commits

View File

@ -10,4 +10,8 @@ message Module {
option (cosmos.app.v1alpha1.module) = { option (cosmos.app.v1alpha1.module) = {
go_import : "git.vdb.to/cerc-io/laconicd/x/auction" go_import : "git.vdb.to/cerc-io/laconicd/x/auction"
}; };
// authority defines the custom module authority. If not set, defaults to the
// governance module.
string authority = 2;
} }

View File

@ -52,27 +52,33 @@ message Auction {
option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_getters) = false;
string id = 1; string id = 1;
string status = 2;
// Auction's kind (vickrey | service_provider)
string kind = 2 [
(gogoproto.moretags) = "json:\"kind\" yaml:\"kind\""
];
string status = 3;
// Address of the creator of the auction // Address of the creator of the auction
string owner_address = 3; string owner_address = 4;
// Timestamp at which the auction was created // Timestamp at which the auction was created
google.protobuf.Timestamp create_time = 4 [ google.protobuf.Timestamp create_time = 5 [
(gogoproto.stdtime) = true, (gogoproto.stdtime) = true,
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\"" (gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""
]; ];
// Timestamp at which the commits phase concluded // Timestamp at which the commits phase concluded
google.protobuf.Timestamp commits_end_time = 5 [ google.protobuf.Timestamp commits_end_time = 6 [
(gogoproto.stdtime) = true, (gogoproto.stdtime) = true,
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\"" (gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\""
]; ];
// Timestamp at which the reveals phase concluded // Timestamp at which the reveals phase concluded
google.protobuf.Timestamp reveals_end_time = 6 [ google.protobuf.Timestamp reveals_end_time = 7 [
(gogoproto.stdtime) = true, (gogoproto.stdtime) = true,
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\"" (gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\""
@ -80,35 +86,44 @@ message Auction {
// Commit and reveal fees must both be paid when committing a bid // Commit and reveal fees must both be paid when committing a bid
// Reveal fee is returned only if the bid is revealed // Reveal fee is returned only if the bid is revealed
cosmos.base.v1beta1.Coin commit_fee = 7 [ cosmos.base.v1beta1.Coin commit_fee = 8 [
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\""
]; ];
cosmos.base.v1beta1.Coin reveal_fee = 8 [ cosmos.base.v1beta1.Coin reveal_fee = 9 [
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\""
]; ];
// Minimum acceptable bid amount for a valid commit // Minimum acceptable bid amount for a valid commit
cosmos.base.v1beta1.Coin minimum_bid = 9 [ cosmos.base.v1beta1.Coin minimum_bid = 10 [
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\""
]; ];
// Address of the winner // Addresses of the winners (one for vickrey and can be multiple for service_provider)
string winner_address = 10; repeated string winner_addresses = 11;
// Winning bid, i.e., the highest bid // Winning bids, i.e., the best bids
cosmos.base.v1beta1.Coin winning_bid = 11 [ repeated cosmos.base.v1beta1.Coin winning_bids = 12 [
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"winning_bid\" yaml:\"winning_bid\"" (gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\""
]; ];
// Amount the winner pays, i.e. the second highest auction // Amount the winner pays, i.e. the second best bid
cosmos.base.v1beta1.Coin winning_price = 12 [ cosmos.base.v1beta1.Coin winning_price = 13 [
(gogoproto.nullable) = false, (gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\""
]; ];
// Maximum acceptable bid amount for a valid commit for service provider auctions
cosmos.base.v1beta1.Coin max_price = 14 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\""
];
// Number of providers to be selected
int32 num_providers = 15;
} }
// Auctions represent all the auctions in the module // Auctions represent all the auctions in the module

View File

@ -7,6 +7,7 @@ import "gogoproto/gogo.proto";
import "google/api/annotations.proto"; import "google/api/annotations.proto";
import "google/protobuf/duration.proto"; import "google/protobuf/duration.proto";
import "cosmos/base/v1beta1/coin.proto"; import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "cerc/auction/v1/auction.proto"; import "cerc/auction/v1/auction.proto";
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction"; option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
@ -29,6 +30,10 @@ service Msg {
rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse) { rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse) {
option (google.api.http).post = "/cerc/auction/v1/reveal_bid"; option (google.api.http).post = "/cerc/auction/v1/reveal_bid";
}; };
// UpdateParams defines an operation for updating the x/staking module
// parameters.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
} }
// MsgCreateAuction defines a create auction message // MsgCreateAuction defines a create auction message
@ -71,6 +76,20 @@ message MsgCreateAuction {
// Address of the signer // Address of the signer
string signer = 6 string signer = 6
[ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ];
// Auction's kind (vickrey | service_provider)
string kind = 7 [
(gogoproto.moretags) = "json:\"kind\" yaml:\"kind\""
];
// Maximum acceptable bid amount (for service provider auctions)
cosmos.base.v1beta1.Coin max_price = 8 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\""
];
// Number of providers to be selected
int32 num_providers = 9;
} }
// MsgCreateAuctionResponse returns the details of the created auction // MsgCreateAuctionResponse returns the details of the created auction
@ -134,3 +153,21 @@ message MsgRevealBidResponse {
Auction auction = 1 Auction auction = 1
[ (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" ]; [ (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" ];
} }
// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// params defines the x/auction parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [ (gogoproto.nullable) = false ];
}
// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {};

View File

@ -10,4 +10,8 @@ message Module {
option (cosmos.app.v1alpha1.module) = { option (cosmos.app.v1alpha1.module) = {
go_import : "git.vdb.to/cerc-io/laconicd/x/bond" go_import : "git.vdb.to/cerc-io/laconicd/x/bond"
}; };
// authority defines the custom module authority. If not set, defaults to the
// governance module.
string authority = 2;
} }

View File

@ -6,6 +6,8 @@ import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "google/api/annotations.proto"; import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto"; import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "cerc/bond/v1/bond.proto";
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond"; option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
@ -32,6 +34,10 @@ service Msg {
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse) { rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse) {
option (google.api.http).post = "/cerc/bond/v1/cancel_bond"; option (google.api.http).post = "/cerc/bond/v1/cancel_bond";
}; };
// UpdateParams defines an operation for updating the x/staking module
// parameters.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
} }
// MsgCreateBond defines a SDK message for creating a new bond. // MsgCreateBond defines a SDK message for creating a new bond.
@ -91,3 +97,21 @@ message MsgCancelBond {
// MsgCancelBondResponse defines the Msg/CancelBond response type. // MsgCancelBondResponse defines the Msg/CancelBond response type.
message MsgCancelBondResponse {} message MsgCancelBondResponse {}
// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// params defines the x/bond parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [ (gogoproto.nullable) = false ];
}
// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {};

View File

@ -10,4 +10,8 @@ message Module {
option (cosmos.app.v1alpha1.module) = { option (cosmos.app.v1alpha1.module) = {
go_import : "git.vdb.to/cerc-io/laconicd/x/registry" go_import : "git.vdb.to/cerc-io/laconicd/x/registry"
}; };
// authority defines the custom module authority. If not set, defaults to the
// governance module.
string authority = 2;
} }

View File

@ -6,6 +6,7 @@ import "google/api/annotations.proto";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "cosmos/msg/v1/msg.proto"; import "cosmos/msg/v1/msg.proto";
import "cerc/registry/v1/registry.proto"; import "cerc/registry/v1/registry.proto";
import "cosmos_proto/cosmos.proto";
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry"; option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
@ -66,6 +67,10 @@ service Msg {
returns (MsgSetAuthorityBondResponse) { returns (MsgSetAuthorityBondResponse) {
option (google.api.http).post = "/cerc/registry/v1/set_authority_bond"; option (google.api.http).post = "/cerc/registry/v1/set_authority_bond";
} }
// UpdateParams defines an operation for updating the x/staking module
// parameters.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
} }
// MsgSetRecord // MsgSetRecord
@ -203,3 +208,21 @@ message MsgReassociateRecords {
// MsgReassociateRecordsResponse // MsgReassociateRecordsResponse
message MsgReassociateRecordsResponse {} message MsgReassociateRecordsResponse {}
// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// params defines the x/registry parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [ (gogoproto.nullable) = false ];
}
// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {}

View File

@ -8,14 +8,26 @@ export const protobufPackage = "cerc.auction.module.v1";
* Module is the app config object of the module. * Module is the app config object of the module.
* Learn more: https://docs.cosmos.network/main/building-modules/depinject * Learn more: https://docs.cosmos.network/main/building-modules/depinject
*/ */
export interface Module {} export interface Module {
/**
* authority defines the custom module authority. If not set, defaults to the
* governance module.
*/
authority: string;
}
function createBaseModule(): Module { function createBaseModule(): Module {
return {}; return { authority: "" };
} }
export const Module = { export const Module = {
encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { encode(
message: Module,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.authority !== "") {
writer.uint32(18).string(message.authority);
}
return writer; return writer;
}, },
@ -26,6 +38,9 @@ export const Module = {
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
case 2:
message.authority = reader.string();
break;
default: default:
reader.skipType(tag & 7); reader.skipType(tag & 7);
break; break;
@ -34,17 +49,21 @@ export const Module = {
return message; return message;
}, },
fromJSON(_: any): Module { fromJSON(object: any): Module {
return {}; return {
authority: isSet(object.authority) ? String(object.authority) : "",
};
}, },
toJSON(_: Module): unknown { toJSON(message: Module): unknown {
const obj: any = {}; const obj: any = {};
message.authority !== undefined && (obj.authority = message.authority);
return obj; return obj;
}, },
fromPartial<I extends Exact<DeepPartial<Module>, I>>(_: I): Module { fromPartial<I extends Exact<DeepPartial<Module>, I>>(object: I): Module {
const message = createBaseModule(); const message = createBaseModule();
message.authority = object.authority ?? "";
return message; return message;
}, },
}; };
@ -81,3 +100,7 @@ if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any; _m0.util.Long = Long as any;
_m0.configure(); _m0.configure();
} }
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}

View File

@ -24,6 +24,8 @@ export interface Params {
/** Auction represents a sealed-bid on-chain auction */ /** Auction represents a sealed-bid on-chain auction */
export interface Auction { export interface Auction {
id: string; id: string;
/** Auction's kind (vickrey | service_provider) */
kind: string;
status: string; status: string;
/** Address of the creator of the auction */ /** Address of the creator of the auction */
ownerAddress: string; ownerAddress: string;
@ -41,12 +43,16 @@ export interface Auction {
revealFee?: Coin; revealFee?: Coin;
/** Minimum acceptable bid amount for a valid commit */ /** Minimum acceptable bid amount for a valid commit */
minimumBid?: Coin; minimumBid?: Coin;
/** Address of the winner */ /** Addresses of the winners (one for vickrey and can be multiple for service_provider) */
winnerAddress: string; winnerAddresses: string[];
/** Winning bid, i.e., the highest bid */ /** Winning bids, i.e., the best bids */
winningBid?: Coin; winningBids: Coin[];
/** Amount the winner pays, i.e. the second highest auction */ /** Amount the winner pays, i.e. the second best bid */
winningPrice?: Coin; winningPrice?: Coin;
/** Maximum acceptable bid amount for a valid commit for service provider auctions */
maxPrice?: Coin;
/** Number of providers to be selected */
numProviders: number;
} }
/** Auctions represent all the auctions in the module */ /** Auctions represent all the auctions in the module */
@ -210,6 +216,7 @@ export const Params = {
function createBaseAuction(): Auction { function createBaseAuction(): Auction {
return { return {
id: "", id: "",
kind: "",
status: "", status: "",
ownerAddress: "", ownerAddress: "",
createTime: undefined, createTime: undefined,
@ -218,9 +225,11 @@ function createBaseAuction(): Auction {
commitFee: undefined, commitFee: undefined,
revealFee: undefined, revealFee: undefined,
minimumBid: undefined, minimumBid: undefined,
winnerAddress: "", winnerAddresses: [],
winningBid: undefined, winningBids: [],
winningPrice: undefined, winningPrice: undefined,
maxPrice: undefined,
numProviders: 0,
}; };
} }
@ -232,47 +241,56 @@ export const Auction = {
if (message.id !== "") { if (message.id !== "") {
writer.uint32(10).string(message.id); writer.uint32(10).string(message.id);
} }
if (message.kind !== "") {
writer.uint32(18).string(message.kind);
}
if (message.status !== "") { if (message.status !== "") {
writer.uint32(18).string(message.status); writer.uint32(26).string(message.status);
} }
if (message.ownerAddress !== "") { if (message.ownerAddress !== "") {
writer.uint32(26).string(message.ownerAddress); writer.uint32(34).string(message.ownerAddress);
} }
if (message.createTime !== undefined) { if (message.createTime !== undefined) {
Timestamp.encode( Timestamp.encode(
toTimestamp(message.createTime), toTimestamp(message.createTime),
writer.uint32(34).fork() writer.uint32(42).fork()
).ldelim(); ).ldelim();
} }
if (message.commitsEndTime !== undefined) { if (message.commitsEndTime !== undefined) {
Timestamp.encode( Timestamp.encode(
toTimestamp(message.commitsEndTime), toTimestamp(message.commitsEndTime),
writer.uint32(42).fork() writer.uint32(50).fork()
).ldelim(); ).ldelim();
} }
if (message.revealsEndTime !== undefined) { if (message.revealsEndTime !== undefined) {
Timestamp.encode( Timestamp.encode(
toTimestamp(message.revealsEndTime), toTimestamp(message.revealsEndTime),
writer.uint32(50).fork() writer.uint32(58).fork()
).ldelim(); ).ldelim();
} }
if (message.commitFee !== undefined) { if (message.commitFee !== undefined) {
Coin.encode(message.commitFee, writer.uint32(58).fork()).ldelim(); Coin.encode(message.commitFee, writer.uint32(66).fork()).ldelim();
} }
if (message.revealFee !== undefined) { if (message.revealFee !== undefined) {
Coin.encode(message.revealFee, writer.uint32(66).fork()).ldelim(); Coin.encode(message.revealFee, writer.uint32(74).fork()).ldelim();
} }
if (message.minimumBid !== undefined) { if (message.minimumBid !== undefined) {
Coin.encode(message.minimumBid, writer.uint32(74).fork()).ldelim(); Coin.encode(message.minimumBid, writer.uint32(82).fork()).ldelim();
} }
if (message.winnerAddress !== "") { for (const v of message.winnerAddresses) {
writer.uint32(82).string(message.winnerAddress); writer.uint32(90).string(v!);
} }
if (message.winningBid !== undefined) { for (const v of message.winningBids) {
Coin.encode(message.winningBid, writer.uint32(90).fork()).ldelim(); Coin.encode(v!, writer.uint32(98).fork()).ldelim();
} }
if (message.winningPrice !== undefined) { if (message.winningPrice !== undefined) {
Coin.encode(message.winningPrice, writer.uint32(98).fork()).ldelim(); Coin.encode(message.winningPrice, writer.uint32(106).fork()).ldelim();
}
if (message.maxPrice !== undefined) {
Coin.encode(message.maxPrice, writer.uint32(114).fork()).ldelim();
}
if (message.numProviders !== 0) {
writer.uint32(120).int32(message.numProviders);
} }
return writer; return writer;
}, },
@ -288,44 +306,53 @@ export const Auction = {
message.id = reader.string(); message.id = reader.string();
break; break;
case 2: case 2:
message.status = reader.string(); message.kind = reader.string();
break; break;
case 3: case 3:
message.ownerAddress = reader.string(); message.status = reader.string();
break; break;
case 4: case 4:
message.ownerAddress = reader.string();
break;
case 5:
message.createTime = fromTimestamp( message.createTime = fromTimestamp(
Timestamp.decode(reader, reader.uint32()) Timestamp.decode(reader, reader.uint32())
); );
break; break;
case 5: case 6:
message.commitsEndTime = fromTimestamp( message.commitsEndTime = fromTimestamp(
Timestamp.decode(reader, reader.uint32()) Timestamp.decode(reader, reader.uint32())
); );
break; break;
case 6: case 7:
message.revealsEndTime = fromTimestamp( message.revealsEndTime = fromTimestamp(
Timestamp.decode(reader, reader.uint32()) Timestamp.decode(reader, reader.uint32())
); );
break; break;
case 7: case 8:
message.commitFee = Coin.decode(reader, reader.uint32()); message.commitFee = Coin.decode(reader, reader.uint32());
break; break;
case 8: case 9:
message.revealFee = Coin.decode(reader, reader.uint32()); message.revealFee = Coin.decode(reader, reader.uint32());
break; break;
case 9: case 10:
message.minimumBid = Coin.decode(reader, reader.uint32()); message.minimumBid = Coin.decode(reader, reader.uint32());
break; break;
case 10:
message.winnerAddress = reader.string();
break;
case 11: case 11:
message.winningBid = Coin.decode(reader, reader.uint32()); message.winnerAddresses.push(reader.string());
break; break;
case 12: case 12:
message.winningBids.push(Coin.decode(reader, reader.uint32()));
break;
case 13:
message.winningPrice = Coin.decode(reader, reader.uint32()); message.winningPrice = Coin.decode(reader, reader.uint32());
break; break;
case 14:
message.maxPrice = Coin.decode(reader, reader.uint32());
break;
case 15:
message.numProviders = reader.int32();
break;
default: default:
reader.skipType(tag & 7); reader.skipType(tag & 7);
break; break;
@ -337,6 +364,7 @@ export const Auction = {
fromJSON(object: any): Auction { fromJSON(object: any): Auction {
return { return {
id: isSet(object.id) ? String(object.id) : "", id: isSet(object.id) ? String(object.id) : "",
kind: isSet(object.kind) ? String(object.kind) : "",
status: isSet(object.status) ? String(object.status) : "", status: isSet(object.status) ? String(object.status) : "",
ownerAddress: isSet(object.ownerAddress) ownerAddress: isSet(object.ownerAddress)
? String(object.ownerAddress) ? String(object.ownerAddress)
@ -359,21 +387,28 @@ export const Auction = {
minimumBid: isSet(object.minimumBid) minimumBid: isSet(object.minimumBid)
? Coin.fromJSON(object.minimumBid) ? Coin.fromJSON(object.minimumBid)
: undefined, : undefined,
winnerAddress: isSet(object.winnerAddress) winnerAddresses: Array.isArray(object?.winnerAddresses)
? String(object.winnerAddress) ? object.winnerAddresses.map((e: any) => String(e))
: "", : [],
winningBid: isSet(object.winningBid) winningBids: Array.isArray(object?.winningBids)
? Coin.fromJSON(object.winningBid) ? object.winningBids.map((e: any) => Coin.fromJSON(e))
: undefined, : [],
winningPrice: isSet(object.winningPrice) winningPrice: isSet(object.winningPrice)
? Coin.fromJSON(object.winningPrice) ? Coin.fromJSON(object.winningPrice)
: undefined, : undefined,
maxPrice: isSet(object.maxPrice)
? Coin.fromJSON(object.maxPrice)
: undefined,
numProviders: isSet(object.numProviders)
? Number(object.numProviders)
: 0,
}; };
}, },
toJSON(message: Auction): unknown { toJSON(message: Auction): unknown {
const obj: any = {}; const obj: any = {};
message.id !== undefined && (obj.id = message.id); message.id !== undefined && (obj.id = message.id);
message.kind !== undefined && (obj.kind = message.kind);
message.status !== undefined && (obj.status = message.status); message.status !== undefined && (obj.status = message.status);
message.ownerAddress !== undefined && message.ownerAddress !== undefined &&
(obj.ownerAddress = message.ownerAddress); (obj.ownerAddress = message.ownerAddress);
@ -395,22 +430,35 @@ export const Auction = {
(obj.minimumBid = message.minimumBid (obj.minimumBid = message.minimumBid
? Coin.toJSON(message.minimumBid) ? Coin.toJSON(message.minimumBid)
: undefined); : undefined);
message.winnerAddress !== undefined && if (message.winnerAddresses) {
(obj.winnerAddress = message.winnerAddress); obj.winnerAddresses = message.winnerAddresses.map((e) => e);
message.winningBid !== undefined && } else {
(obj.winningBid = message.winningBid obj.winnerAddresses = [];
? Coin.toJSON(message.winningBid) }
: undefined); if (message.winningBids) {
obj.winningBids = message.winningBids.map((e) =>
e ? Coin.toJSON(e) : undefined
);
} else {
obj.winningBids = [];
}
message.winningPrice !== undefined && message.winningPrice !== undefined &&
(obj.winningPrice = message.winningPrice (obj.winningPrice = message.winningPrice
? Coin.toJSON(message.winningPrice) ? Coin.toJSON(message.winningPrice)
: undefined); : undefined);
message.maxPrice !== undefined &&
(obj.maxPrice = message.maxPrice
? Coin.toJSON(message.maxPrice)
: undefined);
message.numProviders !== undefined &&
(obj.numProviders = Math.round(message.numProviders));
return obj; return obj;
}, },
fromPartial<I extends Exact<DeepPartial<Auction>, I>>(object: I): Auction { fromPartial<I extends Exact<DeepPartial<Auction>, I>>(object: I): Auction {
const message = createBaseAuction(); const message = createBaseAuction();
message.id = object.id ?? ""; message.id = object.id ?? "";
message.kind = object.kind ?? "";
message.status = object.status ?? ""; message.status = object.status ?? "";
message.ownerAddress = object.ownerAddress ?? ""; message.ownerAddress = object.ownerAddress ?? "";
message.createTime = object.createTime ?? undefined; message.createTime = object.createTime ?? undefined;
@ -428,15 +476,18 @@ export const Auction = {
object.minimumBid !== undefined && object.minimumBid !== null object.minimumBid !== undefined && object.minimumBid !== null
? Coin.fromPartial(object.minimumBid) ? Coin.fromPartial(object.minimumBid)
: undefined; : undefined;
message.winnerAddress = object.winnerAddress ?? ""; message.winnerAddresses = object.winnerAddresses?.map((e) => e) || [];
message.winningBid = message.winningBids =
object.winningBid !== undefined && object.winningBid !== null object.winningBids?.map((e) => Coin.fromPartial(e)) || [];
? Coin.fromPartial(object.winningBid)
: undefined;
message.winningPrice = message.winningPrice =
object.winningPrice !== undefined && object.winningPrice !== null object.winningPrice !== undefined && object.winningPrice !== null
? Coin.fromPartial(object.winningPrice) ? Coin.fromPartial(object.winningPrice)
: undefined; : undefined;
message.maxPrice =
object.maxPrice !== undefined && object.maxPrice !== null
? Coin.fromPartial(object.maxPrice)
: undefined;
message.numProviders = object.numProviders ?? 0;
return message; return message;
}, },
}; };

View File

@ -1,7 +1,7 @@
/* eslint-disable */ /* eslint-disable */
import { Duration } from "../../../google/protobuf/duration"; import { Duration } from "../../../google/protobuf/duration";
import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Coin } from "../../../cosmos/base/v1beta1/coin";
import { Auction, Bid } from "./auction"; import { Auction, Bid, Params } from "./auction";
import Long from "long"; import Long from "long";
import _m0 from "protobufjs/minimal"; import _m0 from "protobufjs/minimal";
@ -21,6 +21,12 @@ export interface MsgCreateAuction {
minimumBid?: Coin; minimumBid?: Coin;
/** Address of the signer */ /** Address of the signer */
signer: string; signer: string;
/** Auction's kind (vickrey | service_provider) */
kind: string;
/** Maximum acceptable bid amount (for service provider auctions) */
maxPrice?: Coin;
/** Number of providers to be selected */
numProviders: number;
} }
/** MsgCreateAuctionResponse returns the details of the created auction */ /** MsgCreateAuctionResponse returns the details of the created auction */
@ -61,6 +67,27 @@ export interface MsgRevealBidResponse {
auction?: Auction; auction?: Auction;
} }
/** MsgUpdateParams is the Msg/UpdateParams request type. */
export interface MsgUpdateParams {
/**
* authority is the address that controls the module (defaults to x/gov unless
* overwritten).
*/
authority: string;
/**
* params defines the x/auction parameters to update.
*
* NOTE: All parameters must be supplied.
*/
params?: Params;
}
/**
* MsgUpdateParamsResponse defines the response structure for executing a
* MsgUpdateParams message.
*/
export interface MsgUpdateParamsResponse {}
function createBaseMsgCreateAuction(): MsgCreateAuction { function createBaseMsgCreateAuction(): MsgCreateAuction {
return { return {
commitsDuration: undefined, commitsDuration: undefined,
@ -69,6 +96,9 @@ function createBaseMsgCreateAuction(): MsgCreateAuction {
revealFee: undefined, revealFee: undefined,
minimumBid: undefined, minimumBid: undefined,
signer: "", signer: "",
kind: "",
maxPrice: undefined,
numProviders: 0,
}; };
} }
@ -101,6 +131,15 @@ export const MsgCreateAuction = {
if (message.signer !== "") { if (message.signer !== "") {
writer.uint32(50).string(message.signer); writer.uint32(50).string(message.signer);
} }
if (message.kind !== "") {
writer.uint32(58).string(message.kind);
}
if (message.maxPrice !== undefined) {
Coin.encode(message.maxPrice, writer.uint32(66).fork()).ldelim();
}
if (message.numProviders !== 0) {
writer.uint32(72).int32(message.numProviders);
}
return writer; return writer;
}, },
@ -129,6 +168,15 @@ export const MsgCreateAuction = {
case 6: case 6:
message.signer = reader.string(); message.signer = reader.string();
break; break;
case 7:
message.kind = reader.string();
break;
case 8:
message.maxPrice = Coin.decode(reader, reader.uint32());
break;
case 9:
message.numProviders = reader.int32();
break;
default: default:
reader.skipType(tag & 7); reader.skipType(tag & 7);
break; break;
@ -155,6 +203,13 @@ export const MsgCreateAuction = {
? Coin.fromJSON(object.minimumBid) ? Coin.fromJSON(object.minimumBid)
: undefined, : undefined,
signer: isSet(object.signer) ? String(object.signer) : "", signer: isSet(object.signer) ? String(object.signer) : "",
kind: isSet(object.kind) ? String(object.kind) : "",
maxPrice: isSet(object.maxPrice)
? Coin.fromJSON(object.maxPrice)
: undefined,
numProviders: isSet(object.numProviders)
? Number(object.numProviders)
: 0,
}; };
}, },
@ -181,6 +236,13 @@ export const MsgCreateAuction = {
? Coin.toJSON(message.minimumBid) ? Coin.toJSON(message.minimumBid)
: undefined); : undefined);
message.signer !== undefined && (obj.signer = message.signer); message.signer !== undefined && (obj.signer = message.signer);
message.kind !== undefined && (obj.kind = message.kind);
message.maxPrice !== undefined &&
(obj.maxPrice = message.maxPrice
? Coin.toJSON(message.maxPrice)
: undefined);
message.numProviders !== undefined &&
(obj.numProviders = Math.round(message.numProviders));
return obj; return obj;
}, },
@ -209,6 +271,12 @@ export const MsgCreateAuction = {
? Coin.fromPartial(object.minimumBid) ? Coin.fromPartial(object.minimumBid)
: undefined; : undefined;
message.signer = object.signer ?? ""; message.signer = object.signer ?? "";
message.kind = object.kind ?? "";
message.maxPrice =
object.maxPrice !== undefined && object.maxPrice !== null
? Coin.fromPartial(object.maxPrice)
: undefined;
message.numProviders = object.numProviders ?? 0;
return message; return message;
}, },
}; };
@ -548,6 +616,120 @@ export const MsgRevealBidResponse = {
}, },
}; };
function createBaseMsgUpdateParams(): MsgUpdateParams {
return { authority: "", params: undefined };
}
export const MsgUpdateParams = {
encode(
message: MsgUpdateParams,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParams();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.authority = reader.string();
break;
case 2:
message.params = Params.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): MsgUpdateParams {
return {
authority: isSet(object.authority) ? String(object.authority) : "",
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
};
},
toJSON(message: MsgUpdateParams): unknown {
const obj: any = {};
message.authority !== undefined && (obj.authority = message.authority);
message.params !== undefined &&
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial<I extends Exact<DeepPartial<MsgUpdateParams>, I>>(
object: I
): MsgUpdateParams {
const message = createBaseMsgUpdateParams();
message.authority = object.authority ?? "";
message.params =
object.params !== undefined && object.params !== null
? Params.fromPartial(object.params)
: undefined;
return message;
},
};
function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse {
return {};
}
export const MsgUpdateParamsResponse = {
encode(
_: MsgUpdateParamsResponse,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
return writer;
},
decode(
input: _m0.Reader | Uint8Array,
length?: number
): MsgUpdateParamsResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParamsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(_: any): MsgUpdateParamsResponse {
return {};
},
toJSON(_: MsgUpdateParamsResponse): unknown {
const obj: any = {};
return obj;
},
fromPartial<I extends Exact<DeepPartial<MsgUpdateParamsResponse>, I>>(
_: I
): MsgUpdateParamsResponse {
const message = createBaseMsgUpdateParamsResponse();
return message;
},
};
/** Tx defines the gRPC tx interface */ /** Tx defines the gRPC tx interface */
export interface Msg { export interface Msg {
/** CreateAuction is the command for creating an auction */ /** CreateAuction is the command for creating an auction */
@ -556,6 +738,11 @@ export interface Msg {
CommitBid(request: MsgCommitBid): Promise<MsgCommitBidResponse>; CommitBid(request: MsgCommitBid): Promise<MsgCommitBidResponse>;
/** RevealBid is the command for revealing a bid */ /** RevealBid is the command for revealing a bid */
RevealBid(request: MsgRevealBid): Promise<MsgRevealBidResponse>; RevealBid(request: MsgRevealBid): Promise<MsgRevealBidResponse>;
/**
* UpdateParams defines an operation for updating the x/staking module
* parameters.
*/
UpdateParams(request: MsgUpdateParams): Promise<MsgUpdateParamsResponse>;
} }
export class MsgClientImpl implements Msg { export class MsgClientImpl implements Msg {
@ -565,6 +752,7 @@ export class MsgClientImpl implements Msg {
this.CreateAuction = this.CreateAuction.bind(this); this.CreateAuction = this.CreateAuction.bind(this);
this.CommitBid = this.CommitBid.bind(this); this.CommitBid = this.CommitBid.bind(this);
this.RevealBid = this.RevealBid.bind(this); this.RevealBid = this.RevealBid.bind(this);
this.UpdateParams = this.UpdateParams.bind(this);
} }
CreateAuction(request: MsgCreateAuction): Promise<MsgCreateAuctionResponse> { CreateAuction(request: MsgCreateAuction): Promise<MsgCreateAuctionResponse> {
const data = MsgCreateAuction.encode(request).finish(); const data = MsgCreateAuction.encode(request).finish();
@ -593,6 +781,18 @@ export class MsgClientImpl implements Msg {
MsgRevealBidResponse.decode(new _m0.Reader(data)) MsgRevealBidResponse.decode(new _m0.Reader(data))
); );
} }
UpdateParams(request: MsgUpdateParams): Promise<MsgUpdateParamsResponse> {
const data = MsgUpdateParams.encode(request).finish();
const promise = this.rpc.request(
"cerc.auction.v1.Msg",
"UpdateParams",
data
);
return promise.then((data) =>
MsgUpdateParamsResponse.decode(new _m0.Reader(data))
);
}
} }
interface Rpc { interface Rpc {

View File

@ -8,14 +8,26 @@ export const protobufPackage = "cerc.bond.module.v1";
* Module is the app config object of the module. * Module is the app config object of the module.
* Learn more: https://docs.cosmos.network/main/building-modules/depinject * Learn more: https://docs.cosmos.network/main/building-modules/depinject
*/ */
export interface Module {} export interface Module {
/**
* authority defines the custom module authority. If not set, defaults to the
* governance module.
*/
authority: string;
}
function createBaseModule(): Module { function createBaseModule(): Module {
return {}; return { authority: "" };
} }
export const Module = { export const Module = {
encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { encode(
message: Module,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.authority !== "") {
writer.uint32(18).string(message.authority);
}
return writer; return writer;
}, },
@ -26,6 +38,9 @@ export const Module = {
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
case 2:
message.authority = reader.string();
break;
default: default:
reader.skipType(tag & 7); reader.skipType(tag & 7);
break; break;
@ -34,17 +49,21 @@ export const Module = {
return message; return message;
}, },
fromJSON(_: any): Module { fromJSON(object: any): Module {
return {}; return {
authority: isSet(object.authority) ? String(object.authority) : "",
};
}, },
toJSON(_: Module): unknown { toJSON(message: Module): unknown {
const obj: any = {}; const obj: any = {};
message.authority !== undefined && (obj.authority = message.authority);
return obj; return obj;
}, },
fromPartial<I extends Exact<DeepPartial<Module>, I>>(_: I): Module { fromPartial<I extends Exact<DeepPartial<Module>, I>>(object: I): Module {
const message = createBaseModule(); const message = createBaseModule();
message.authority = object.authority ?? "";
return message; return message;
}, },
}; };
@ -81,3 +100,7 @@ if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any; _m0.util.Long = Long as any;
_m0.configure(); _m0.configure();
} }
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}

View File

@ -1,4 +1,5 @@
/* eslint-disable */ /* eslint-disable */
import { Params } from "./bond";
import Long from "long"; import Long from "long";
import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Coin } from "../../../cosmos/base/v1beta1/coin";
import _m0 from "protobufjs/minimal"; import _m0 from "protobufjs/minimal";
@ -45,6 +46,27 @@ export interface MsgCancelBond {
/** MsgCancelBondResponse defines the Msg/CancelBond response type. */ /** MsgCancelBondResponse defines the Msg/CancelBond response type. */
export interface MsgCancelBondResponse {} export interface MsgCancelBondResponse {}
/** MsgUpdateParams is the Msg/UpdateParams request type. */
export interface MsgUpdateParams {
/**
* authority is the address that controls the module (defaults to x/gov unless
* overwritten).
*/
authority: string;
/**
* params defines the x/bond parameters to update.
*
* NOTE: All parameters must be supplied.
*/
params?: Params;
}
/**
* MsgUpdateParamsResponse defines the response structure for executing a
* MsgUpdateParams message.
*/
export interface MsgUpdateParamsResponse {}
function createBaseMsgCreateBond(): MsgCreateBond { function createBaseMsgCreateBond(): MsgCreateBond {
return { signer: "", coins: [] }; return { signer: "", coins: [] };
} }
@ -531,6 +553,120 @@ export const MsgCancelBondResponse = {
}, },
}; };
function createBaseMsgUpdateParams(): MsgUpdateParams {
return { authority: "", params: undefined };
}
export const MsgUpdateParams = {
encode(
message: MsgUpdateParams,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParams();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.authority = reader.string();
break;
case 2:
message.params = Params.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): MsgUpdateParams {
return {
authority: isSet(object.authority) ? String(object.authority) : "",
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
};
},
toJSON(message: MsgUpdateParams): unknown {
const obj: any = {};
message.authority !== undefined && (obj.authority = message.authority);
message.params !== undefined &&
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial<I extends Exact<DeepPartial<MsgUpdateParams>, I>>(
object: I
): MsgUpdateParams {
const message = createBaseMsgUpdateParams();
message.authority = object.authority ?? "";
message.params =
object.params !== undefined && object.params !== null
? Params.fromPartial(object.params)
: undefined;
return message;
},
};
function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse {
return {};
}
export const MsgUpdateParamsResponse = {
encode(
_: MsgUpdateParamsResponse,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
return writer;
},
decode(
input: _m0.Reader | Uint8Array,
length?: number
): MsgUpdateParamsResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParamsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(_: any): MsgUpdateParamsResponse {
return {};
},
toJSON(_: MsgUpdateParamsResponse): unknown {
const obj: any = {};
return obj;
},
fromPartial<I extends Exact<DeepPartial<MsgUpdateParamsResponse>, I>>(
_: I
): MsgUpdateParamsResponse {
const message = createBaseMsgUpdateParamsResponse();
return message;
},
};
/** Msg defines the bond Msg service. */ /** Msg defines the bond Msg service. */
export interface Msg { export interface Msg {
/** CreateBond defines a method for creating a new bond. */ /** CreateBond defines a method for creating a new bond. */
@ -541,6 +677,11 @@ export interface Msg {
WithdrawBond(request: MsgWithdrawBond): Promise<MsgWithdrawBondResponse>; WithdrawBond(request: MsgWithdrawBond): Promise<MsgWithdrawBondResponse>;
/** CancelBond defines a method for cancelling a bond. */ /** CancelBond defines a method for cancelling a bond. */
CancelBond(request: MsgCancelBond): Promise<MsgCancelBondResponse>; CancelBond(request: MsgCancelBond): Promise<MsgCancelBondResponse>;
/**
* UpdateParams defines an operation for updating the x/staking module
* parameters.
*/
UpdateParams(request: MsgUpdateParams): Promise<MsgUpdateParamsResponse>;
} }
export class MsgClientImpl implements Msg { export class MsgClientImpl implements Msg {
@ -551,6 +692,7 @@ export class MsgClientImpl implements Msg {
this.RefillBond = this.RefillBond.bind(this); this.RefillBond = this.RefillBond.bind(this);
this.WithdrawBond = this.WithdrawBond.bind(this); this.WithdrawBond = this.WithdrawBond.bind(this);
this.CancelBond = this.CancelBond.bind(this); this.CancelBond = this.CancelBond.bind(this);
this.UpdateParams = this.UpdateParams.bind(this);
} }
CreateBond(request: MsgCreateBond): Promise<MsgCreateBondResponse> { CreateBond(request: MsgCreateBond): Promise<MsgCreateBondResponse> {
const data = MsgCreateBond.encode(request).finish(); const data = MsgCreateBond.encode(request).finish();
@ -583,6 +725,14 @@ export class MsgClientImpl implements Msg {
MsgCancelBondResponse.decode(new _m0.Reader(data)) MsgCancelBondResponse.decode(new _m0.Reader(data))
); );
} }
UpdateParams(request: MsgUpdateParams): Promise<MsgUpdateParamsResponse> {
const data = MsgUpdateParams.encode(request).finish();
const promise = this.rpc.request("cerc.bond.v1.Msg", "UpdateParams", data);
return promise.then((data) =>
MsgUpdateParamsResponse.decode(new _m0.Reader(data))
);
}
} }
interface Rpc { interface Rpc {

View File

@ -8,14 +8,26 @@ export const protobufPackage = "cerc.registry.module.v1";
* Module is the app config object of the module. * Module is the app config object of the module.
* Learn more: https://docs.cosmos.network/main/building-modules/depinject * Learn more: https://docs.cosmos.network/main/building-modules/depinject
*/ */
export interface Module {} export interface Module {
/**
* authority defines the custom module authority. If not set, defaults to the
* governance module.
*/
authority: string;
}
function createBaseModule(): Module { function createBaseModule(): Module {
return {}; return { authority: "" };
} }
export const Module = { export const Module = {
encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { encode(
message: Module,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.authority !== "") {
writer.uint32(18).string(message.authority);
}
return writer; return writer;
}, },
@ -26,6 +38,9 @@ export const Module = {
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
case 2:
message.authority = reader.string();
break;
default: default:
reader.skipType(tag & 7); reader.skipType(tag & 7);
break; break;
@ -34,17 +49,21 @@ export const Module = {
return message; return message;
}, },
fromJSON(_: any): Module { fromJSON(object: any): Module {
return {}; return {
authority: isSet(object.authority) ? String(object.authority) : "",
};
}, },
toJSON(_: Module): unknown { toJSON(message: Module): unknown {
const obj: any = {}; const obj: any = {};
message.authority !== undefined && (obj.authority = message.authority);
return obj; return obj;
}, },
fromPartial<I extends Exact<DeepPartial<Module>, I>>(_: I): Module { fromPartial<I extends Exact<DeepPartial<Module>, I>>(object: I): Module {
const message = createBaseModule(); const message = createBaseModule();
message.authority = object.authority ?? "";
return message; return message;
}, },
}; };
@ -81,3 +100,7 @@ if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any; _m0.util.Long = Long as any;
_m0.configure(); _m0.configure();
} }
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}

View File

@ -1162,7 +1162,7 @@ export const RecordsList = {
declare var self: any | undefined; declare var self: any | undefined;
declare var window: any | undefined; declare var window: any | undefined;
declare var global: any | undefined; declare var global: any | undefined;
var _globalThis: any = (() => { var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis; if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self; if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window; if (typeof window !== "undefined") return window;
@ -1171,10 +1171,10 @@ var _globalThis: any = (() => {
})(); })();
function bytesFromBase64(b64: string): Uint8Array { function bytesFromBase64(b64: string): Uint8Array {
if (_globalThis.Buffer) { if (globalThis.Buffer) {
return Uint8Array.from(_globalThis.Buffer.from(b64, "base64")); return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
} else { } else {
const bin = _globalThis.atob(b64); const bin = globalThis.atob(b64);
const arr = new Uint8Array(bin.length); const arr = new Uint8Array(bin.length);
for (let i = 0; i < bin.length; ++i) { for (let i = 0; i < bin.length; ++i) {
arr[i] = bin.charCodeAt(i); arr[i] = bin.charCodeAt(i);
@ -1184,14 +1184,14 @@ function bytesFromBase64(b64: string): Uint8Array {
} }
function base64FromBytes(arr: Uint8Array): string { function base64FromBytes(arr: Uint8Array): string {
if (_globalThis.Buffer) { if (globalThis.Buffer) {
return _globalThis.Buffer.from(arr).toString("base64"); return globalThis.Buffer.from(arr).toString("base64");
} else { } else {
const bin: string[] = []; const bin: string[] = [];
arr.forEach((byte) => { arr.forEach((byte) => {
bin.push(String.fromCharCode(byte)); bin.push(String.fromCharCode(byte));
}); });
return _globalThis.btoa(bin.join("")); return globalThis.btoa(bin.join(""));
} }
} }

View File

@ -1,5 +1,5 @@
/* eslint-disable */ /* eslint-disable */
import { Record, Signature } from "./registry"; import { Record, Params, Signature } from "./registry";
import Long from "long"; import Long from "long";
import _m0 from "protobufjs/minimal"; import _m0 from "protobufjs/minimal";
@ -110,6 +110,27 @@ export interface MsgReassociateRecords {
/** MsgReassociateRecordsResponse */ /** MsgReassociateRecordsResponse */
export interface MsgReassociateRecordsResponse {} export interface MsgReassociateRecordsResponse {}
/** MsgUpdateParams is the Msg/UpdateParams request type. */
export interface MsgUpdateParams {
/**
* authority is the address that controls the module (defaults to x/gov unless
* overwritten).
*/
authority: string;
/**
* params defines the x/registry parameters to update.
*
* NOTE: All parameters must be supplied.
*/
params?: Params;
}
/**
* MsgUpdateParamsResponse defines the response structure for executing a
* MsgUpdateParams message.
*/
export interface MsgUpdateParamsResponse {}
function createBaseMsgSetRecord(): MsgSetRecord { function createBaseMsgSetRecord(): MsgSetRecord {
return { bondId: "", signer: "", payload: undefined }; return { bondId: "", signer: "", payload: undefined };
} }
@ -1359,6 +1380,120 @@ export const MsgReassociateRecordsResponse = {
}, },
}; };
function createBaseMsgUpdateParams(): MsgUpdateParams {
return { authority: "", params: undefined };
}
export const MsgUpdateParams = {
encode(
message: MsgUpdateParams,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParams();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.authority = reader.string();
break;
case 2:
message.params = Params.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): MsgUpdateParams {
return {
authority: isSet(object.authority) ? String(object.authority) : "",
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
};
},
toJSON(message: MsgUpdateParams): unknown {
const obj: any = {};
message.authority !== undefined && (obj.authority = message.authority);
message.params !== undefined &&
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial<I extends Exact<DeepPartial<MsgUpdateParams>, I>>(
object: I
): MsgUpdateParams {
const message = createBaseMsgUpdateParams();
message.authority = object.authority ?? "";
message.params =
object.params !== undefined && object.params !== null
? Params.fromPartial(object.params)
: undefined;
return message;
},
};
function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse {
return {};
}
export const MsgUpdateParamsResponse = {
encode(
_: MsgUpdateParamsResponse,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
return writer;
},
decode(
input: _m0.Reader | Uint8Array,
length?: number
): MsgUpdateParamsResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParamsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(_: any): MsgUpdateParamsResponse {
return {};
},
toJSON(_: MsgUpdateParamsResponse): unknown {
const obj: any = {};
return obj;
},
fromPartial<I extends Exact<DeepPartial<MsgUpdateParamsResponse>, I>>(
_: I
): MsgUpdateParamsResponse {
const message = createBaseMsgUpdateParamsResponse();
return message;
},
};
/** Msg is a service which exposes the registry functionality */ /** Msg is a service which exposes the registry functionality */
export interface Msg { export interface Msg {
/** SetRecord records a new record with given payload and bond id */ /** SetRecord records a new record with given payload and bond id */
@ -1391,6 +1526,11 @@ export interface Msg {
SetAuthorityBond( SetAuthorityBond(
request: MsgSetAuthorityBond request: MsgSetAuthorityBond
): Promise<MsgSetAuthorityBondResponse>; ): Promise<MsgSetAuthorityBondResponse>;
/**
* UpdateParams defines an operation for updating the x/staking module
* parameters.
*/
UpdateParams(request: MsgUpdateParams): Promise<MsgUpdateParamsResponse>;
} }
export class MsgClientImpl implements Msg { export class MsgClientImpl implements Msg {
@ -1407,6 +1547,7 @@ export class MsgClientImpl implements Msg {
this.DeleteName = this.DeleteName.bind(this); this.DeleteName = this.DeleteName.bind(this);
this.ReserveAuthority = this.ReserveAuthority.bind(this); this.ReserveAuthority = this.ReserveAuthority.bind(this);
this.SetAuthorityBond = this.SetAuthorityBond.bind(this); this.SetAuthorityBond = this.SetAuthorityBond.bind(this);
this.UpdateParams = this.UpdateParams.bind(this);
} }
SetRecord(request: MsgSetRecord): Promise<MsgSetRecordResponse> { SetRecord(request: MsgSetRecord): Promise<MsgSetRecordResponse> {
const data = MsgSetRecord.encode(request).finish(); const data = MsgSetRecord.encode(request).finish();
@ -1529,6 +1670,18 @@ export class MsgClientImpl implements Msg {
MsgSetAuthorityBondResponse.decode(new _m0.Reader(data)) MsgSetAuthorityBondResponse.decode(new _m0.Reader(data))
); );
} }
UpdateParams(request: MsgUpdateParams): Promise<MsgUpdateParamsResponse> {
const data = MsgUpdateParams.encode(request).finish();
const promise = this.rpc.request(
"cerc.registry.v1.Msg",
"UpdateParams",
data
);
return promise.then((data) =>
MsgUpdateParamsResponse.decode(new _m0.Reader(data))
);
}
} }
interface Rpc { interface Rpc {

View File

@ -251,7 +251,7 @@ export const PageResponse = {
declare var self: any | undefined; declare var self: any | undefined;
declare var window: any | undefined; declare var window: any | undefined;
declare var global: any | undefined; declare var global: any | undefined;
var _globalThis: any = (() => { var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis; if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self; if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window; if (typeof window !== "undefined") return window;
@ -260,10 +260,10 @@ var _globalThis: any = (() => {
})(); })();
function bytesFromBase64(b64: string): Uint8Array { function bytesFromBase64(b64: string): Uint8Array {
if (_globalThis.Buffer) { if (globalThis.Buffer) {
return Uint8Array.from(_globalThis.Buffer.from(b64, "base64")); return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
} else { } else {
const bin = _globalThis.atob(b64); const bin = globalThis.atob(b64);
const arr = new Uint8Array(bin.length); const arr = new Uint8Array(bin.length);
for (let i = 0; i < bin.length; ++i) { for (let i = 0; i < bin.length; ++i) {
arr[i] = bin.charCodeAt(i); arr[i] = bin.charCodeAt(i);
@ -273,14 +273,14 @@ function bytesFromBase64(b64: string): Uint8Array {
} }
function base64FromBytes(arr: Uint8Array): string { function base64FromBytes(arr: Uint8Array): string {
if (_globalThis.Buffer) { if (globalThis.Buffer) {
return _globalThis.Buffer.from(arr).toString("base64"); return globalThis.Buffer.from(arr).toString("base64");
} else { } else {
const bin: string[] = []; const bin: string[] = [];
arr.forEach((byte) => { arr.forEach((byte) => {
bin.push(String.fromCharCode(byte)); bin.push(String.fromCharCode(byte));
}); });
return _globalThis.btoa(bin.join("")); return globalThis.btoa(bin.join(""));
} }
} }

View File

@ -4324,7 +4324,7 @@ export const GeneratedCodeInfo_Annotation = {
declare var self: any | undefined; declare var self: any | undefined;
declare var window: any | undefined; declare var window: any | undefined;
declare var global: any | undefined; declare var global: any | undefined;
var _globalThis: any = (() => { var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis; if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self; if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window; if (typeof window !== "undefined") return window;
@ -4333,10 +4333,10 @@ var _globalThis: any = (() => {
})(); })();
function bytesFromBase64(b64: string): Uint8Array { function bytesFromBase64(b64: string): Uint8Array {
if (_globalThis.Buffer) { if (globalThis.Buffer) {
return Uint8Array.from(_globalThis.Buffer.from(b64, "base64")); return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
} else { } else {
const bin = _globalThis.atob(b64); const bin = globalThis.atob(b64);
const arr = new Uint8Array(bin.length); const arr = new Uint8Array(bin.length);
for (let i = 0; i < bin.length; ++i) { for (let i = 0; i < bin.length; ++i) {
arr[i] = bin.charCodeAt(i); arr[i] = bin.charCodeAt(i);
@ -4346,14 +4346,14 @@ function bytesFromBase64(b64: string): Uint8Array {
} }
function base64FromBytes(arr: Uint8Array): string { function base64FromBytes(arr: Uint8Array): string {
if (_globalThis.Buffer) { if (globalThis.Buffer) {
return _globalThis.Buffer.from(arr).toString("base64"); return globalThis.Buffer.from(arr).toString("base64");
} else { } else {
const bin: string[] = []; const bin: string[] = [];
arr.forEach((byte) => { arr.forEach((byte) => {
bin.push(String.fromCharCode(byte)); bin.push(String.fromCharCode(byte));
}); });
return _globalThis.btoa(bin.join("")); return globalThis.btoa(bin.join(""));
} }
} }

View File

@ -1,19 +1,28 @@
import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing'; import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
import { MsgCommitBidResponse, MsgCommitBid, MsgRevealBid, MsgRevealBidResponse } from '../../../proto/cerc/auction/v1/tx'; import { MsgCommitBidResponse, MsgCommitBid, MsgRevealBid, MsgRevealBidResponse, MsgCreateAuction, MsgCreateAuctionResponse } from '../../../proto/cerc/auction/v1/tx';
export const typeUrlMsgCreateAuction = '/cerc.auction.v1.MsgCreateAuction';
export const typeUrlMsgCommitBid = '/cerc.auction.v1.MsgCommitBid'; export const typeUrlMsgCommitBid = '/cerc.auction.v1.MsgCommitBid';
export const typeUrlMsgCommitBidResponse = '/cerc.auction.v1.MsgCommitBidResponse'; export const typeUrlMsgCommitBidResponse = '/cerc.auction.v1.MsgCommitBidResponse';
export const typeUrlMsgRevealBid = '/cerc.auction.v1.MsgRevealBid'; export const typeUrlMsgRevealBid = '/cerc.auction.v1.MsgRevealBid';
export const typeUrlMsgRevealBidResponse = '/cerc.auction.v1.MsgRevealBidResponse'; export const typeUrlMsgRevealBidResponse = '/cerc.auction.v1.MsgRevealBidResponse';
export const typeUrlMsgCreateAuctionResponse = '/cerc.auction.v1.MsgCreateAuctionResponse';
export const auctionTypes: ReadonlyArray<[string, GeneratedType]> = [ export const auctionTypes: ReadonlyArray<[string, GeneratedType]> = [
[typeUrlMsgCreateAuction, MsgCreateAuction],
[typeUrlMsgCommitBid, MsgCommitBid], [typeUrlMsgCommitBid, MsgCommitBid],
[typeUrlMsgCommitBidResponse, MsgCommitBidResponse], [typeUrlMsgCommitBidResponse, MsgCommitBidResponse],
[typeUrlMsgRevealBid, MsgRevealBid], [typeUrlMsgRevealBid, MsgRevealBid],
[typeUrlMsgRevealBidResponse, MsgRevealBidResponse] [typeUrlMsgRevealBidResponse, MsgRevealBidResponse],
[typeUrlMsgCreateAuctionResponse, MsgCreateAuctionResponse]
]; ];
export interface MsgCreateAuctionEncodeObject extends EncodeObject {
readonly typeUrl: '/cerc.auction.v1.MsgCreateAuction';
readonly value: Partial<MsgCreateAuction>;
}
export interface MsgCommitBidEncodeObject extends EncodeObject { export interface MsgCommitBidEncodeObject extends EncodeObject {
readonly typeUrl: '/cerc.auction.v1.MsgCommitBid'; readonly typeUrl: '/cerc.auction.v1.MsgCommitBid';
readonly value: Partial<MsgCommitBid>; readonly value: Partial<MsgCommitBid>;