mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-14 03:55:19 +00:00
d5dcfe73b2
* start makefile refactor to smaller units; break out proto-dep updating; add check-proto-deps target for use in CI in order to determine if depdencies have diverged * add proto check workflow * download go modules before checking proto deps * clean up -- hide output and add error message for check target * add error message for check-rsync * update any type, and ibc-go protos for v3.4.0 * add buf generate files for gogo, docs, and swagger * update swagger dirs and run with latest swagger gen * ignore new build directories * refactor proto makefile logic -- use buf instead of scripts * remove old protobuf scripts * run all proto checks on push * remove moved file * set default value for protoc machine * install build deps seperately * fetch master for buf check breaking * checkout from https url in CI for buf breaking * fix rsync file permissions on darwin * ignore build dirs * fix issue with apple provided make; clean up build deps; switch to buf format * remove clang format file -- using buf format now * run make proto-format (buf format changes) * update generated files for proto format changes
92 lines
3.4 KiB
Protocol Buffer
92 lines
3.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
package kava.cdp.v1beta1;
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
|
import "cosmos_proto/cosmos.proto";
|
|
import "gogoproto/gogo.proto";
|
|
|
|
option go_package = "github.com/kava-labs/kava/x/cdp/types";
|
|
|
|
// Msg defines the cdp Msg service.
|
|
service Msg {
|
|
// CreateCDP defines a method to create a new CDP.
|
|
rpc CreateCDP(MsgCreateCDP) returns (MsgCreateCDPResponse);
|
|
// Deposit defines a method to deposit to a CDP.
|
|
rpc Deposit(MsgDeposit) returns (MsgDepositResponse);
|
|
// Withdraw defines a method to withdraw collateral from a CDP.
|
|
rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse);
|
|
// DrawDebt defines a method to draw debt from a CDP.
|
|
rpc DrawDebt(MsgDrawDebt) returns (MsgDrawDebtResponse);
|
|
// RepayDebt defines a method to repay debt from a CDP.
|
|
rpc RepayDebt(MsgRepayDebt) returns (MsgRepayDebtResponse);
|
|
// Liquidate defines a method to attempt to liquidate a CDP whos
|
|
// collateralization ratio is under its liquidation ratio.
|
|
rpc Liquidate(MsgLiquidate) returns (MsgLiquidateResponse);
|
|
}
|
|
|
|
// MsgCreateCDP defines a message to create a new CDP.
|
|
message MsgCreateCDP {
|
|
string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
cosmos.base.v1beta1.Coin collateral = 2 [(gogoproto.nullable) = false];
|
|
cosmos.base.v1beta1.Coin principal = 3 [(gogoproto.nullable) = false];
|
|
string collateral_type = 4;
|
|
}
|
|
|
|
// MsgCreateCDPResponse defines the Msg/CreateCDP response type.
|
|
message MsgCreateCDPResponse {
|
|
uint64 cdp_id = 1 [(gogoproto.customname) = "CdpID"];
|
|
}
|
|
|
|
// MsgDeposit defines a message to deposit to a CDP.
|
|
message MsgDeposit {
|
|
string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
string owner = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
cosmos.base.v1beta1.Coin collateral = 3 [(gogoproto.nullable) = false];
|
|
string collateral_type = 4;
|
|
}
|
|
|
|
// MsgDepositResponse defines the Msg/Deposit response type.
|
|
message MsgDepositResponse {}
|
|
|
|
// MsgWithdraw defines a message to withdraw collateral from a CDP.
|
|
message MsgWithdraw {
|
|
string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
string owner = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
cosmos.base.v1beta1.Coin collateral = 3 [(gogoproto.nullable) = false];
|
|
string collateral_type = 4;
|
|
}
|
|
|
|
// MsgWithdrawResponse defines the Msg/Withdraw response type.
|
|
message MsgWithdrawResponse {}
|
|
|
|
// MsgDrawDebt defines a message to draw debt from a CDP.
|
|
message MsgDrawDebt {
|
|
string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
string collateral_type = 2;
|
|
cosmos.base.v1beta1.Coin principal = 3 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
// MsgDrawDebtResponse defines the Msg/DrawDebt response type.
|
|
message MsgDrawDebtResponse {}
|
|
|
|
// MsgRepayDebt defines a message to repay debt from a CDP.
|
|
message MsgRepayDebt {
|
|
string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
string collateral_type = 2;
|
|
cosmos.base.v1beta1.Coin payment = 3 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
// MsgRepayDebtResponse defines the Msg/RepayDebt response type.
|
|
message MsgRepayDebtResponse {}
|
|
|
|
// MsgLiquidate defines a message to attempt to liquidate a CDP whos
|
|
// collateralization ratio is under its liquidation ratio.
|
|
message MsgLiquidate {
|
|
string keeper = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
string borrower = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
string collateral_type = 3;
|
|
}
|
|
|
|
// MsgLiquidateResponse defines the Msg/Liquidate response type.
|
|
message MsgLiquidateResponse {}
|