Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ecocredit direct buy/sell proto definitions #560

Merged
merged 15 commits into from
Oct 28, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 44 additions & 1 deletion proto/regen/ecocredit/v1alpha1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ service Msg {

// UpdateClassMetadata updates the credit class metadata
rpc UpdateClassMetadata(MsgUpdateClassMetadata) returns (MsgUpdateClassMetadataResponse);

rpc Sell(MsgSell) returns (MsgSellResponse);

rpc CancelSellOrder(MsgCancelSellOrder) returns (MsgCancelSellOrderResponse);

rpc BuyDirect (MsgBuyDirect) returns (MsgBuyDirectResponse);
}

// MsgCreateClass is the Msg/CreateClass request type.
Expand Down Expand Up @@ -274,4 +280,41 @@ message MsgUpdateClassMetadata {
}

// MsgUpdateClassMetadataResponse is the MsgUpdateClassMetadata response type.
message MsgUpdateClassMetadataResponse {}
message MsgUpdateClassMetadataResponse {}

message MsgSell {
string owner = 1;
repeated Order orders = 2;

message Order {
string batch_denom = 1;
string quantity = 2;
string ask_denom = 3;
aaronc marked this conversation as resolved.
Show resolved Hide resolved
string ask_price = 4;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this just be one Coin field ask_coin ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that the ask_coin is the price per one unit right?

Copy link
Member

@clevinson clevinson Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that's what my assumption would be. Maybe better to name it ask_coin_price to make it more explicit?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a doc string to specify the details.

bool dont_auto_retire = 5;
ryanchristo marked this conversation as resolved.
Show resolved Hide resolved
}
aaronc marked this conversation as resolved.
Show resolved Hide resolved
}

message MsgSellResponse {
repeated uint64 sell_order_ids = 1;
}

message MsgCancelSellOrder {
string owner = 1;
repeated uint64 sell_order_ids = 2;
}

message MsgCancelSellOrderResponse {}

message MsgBuyDirect {
string buyer = 1;
repeated Order orders = 2;

message Order {
uint64 sell_order_id = 1;
string quantity = 2;
aaronc marked this conversation as resolved.
Show resolved Hide resolved
bool dont_auto_retire = 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean for a buyer to provide an auto_retire flag? Isn't auto-retire something that would be set / determined by the seller only?

Copy link
Member Author

@aaronc aaronc Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we would have both default to auto-retire. Even if the seller checks dont_auto_retire, they'll still retire unless the buyer also checks dont_auto_retire. It biases the whole design towards the intended use (i.e. retirement) which I've gotten the sense is desirable, without making trading impossible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dtkong thoughts on this?

}
}

message MsgBuyDirectResponse {}