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

Nftbackedloan3 #670

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
1 change: 1 addition & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino

// original modules
paramsKeeper.Subspace(nftfactorytypes.ModuleName)

// paramsKeeper.Subspace(nftbackedloantypes.ModuleName)
// paramsKeeper.Subspace(ecosystemincentivetypes.ModuleName)

Expand Down
20 changes: 0 additions & 20 deletions proto/ununifi/eventhook/eventhook.proto

This file was deleted.

16 changes: 0 additions & 16 deletions proto/ununifi/eventhook/genesis.proto

This file was deleted.

12 changes: 0 additions & 12 deletions proto/ununifi/eventhook/params.proto

This file was deleted.

56 changes: 0 additions & 56 deletions proto/ununifi/eventhook/query.proto

This file was deleted.

37 changes: 0 additions & 37 deletions proto/ununifi/eventhook/tx.proto

This file was deleted.

22 changes: 8 additions & 14 deletions proto/ununifi/nftbackedloan/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@ import "cosmos_proto/cosmos.proto";
option go_package = "github.com/UnUniFi/chain/x/nftbackedloan/types";

message Params {
string min_staking_for_listing = 1 [
(gogoproto.moretags) = "yaml:\"min_staking_for_listing\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
string fee_collector_address = 1;
string commission_rate = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
repeated string bid_tokens = 2;
uint64 nft_listing_cancel_required_seconds = 3;
uint64 bid_cancel_required_seconds = 4;
uint64 nft_listing_full_payment_period = 5;
uint64 nft_listing_nft_delivery_period = 6;
string nft_listing_commission_rate = 7 [
(gogoproto.moretags) = "yaml:\"nft_listing_commission_rate\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}

google.protobuf.Duration full_payment_period = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
google.protobuf.Duration nft_delivery_period = 4 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
}
26 changes: 25 additions & 1 deletion proto/ununifi/nftbackedloan/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ package ununifi.nftbackedloan;
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "ununifi/nftbackedloan/nftbackedloan.proto";
import "cosmos_proto/cosmos.proto";
import "ununifi/nftbackedloan/params.proto";

option go_package = "github.com/UnUniFi/chain/x/nftbackedloan/types";

Expand All @@ -19,6 +21,7 @@ service Msg {
rpc PayRemainder(MsgPayRemainder) returns (MsgPayRemainderResponse);
rpc Borrow(MsgBorrow) returns (MsgBorrowResponse);
rpc Repay(MsgRepay) returns (MsgRepayResponse);
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

message MsgListNft {
Expand All @@ -32,12 +35,14 @@ message MsgListNft {
];
google.protobuf.Duration min_bid_period = 5 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
}

message MsgListNftResponse {}

message MsgCancelListing {
string sender = 1;
NftId nft_id = 2 [(gogoproto.nullable) = false];
}

message MsgCancelListingResponse {}

message MsgPlaceBid {
Expand All @@ -53,30 +58,35 @@ message MsgPlaceBid {
bool automatic_payment = 6;
cosmos.base.v1beta1.Coin deposit = 7 [(gogoproto.nullable) = false];
}

message MsgPlaceBidResponse {}

message MsgCancelBid {
string sender = 1;
NftId nft_id = 2 [(gogoproto.nullable) = false];
}

message MsgCancelBidResponse {}

message MsgEndNftListing {
string sender = 1;
NftId nft_id = 2 [(gogoproto.nullable) = false];
}

message MsgEndNftListingResponse {}

message MsgSellingDecision {
string sender = 1;
NftId nft_id = 2 [(gogoproto.nullable) = false];
}

message MsgSellingDecisionResponse {}

message MsgPayRemainder {
string sender = 1;
NftId nft_id = 2 [(gogoproto.nullable) = false];
}

message MsgPayRemainderResponse {}

message BorrowBid {
Expand All @@ -89,11 +99,25 @@ message MsgBorrow {
NftId nft_id = 2 [(gogoproto.nullable) = false];
repeated BorrowBid borrow_bids = 3 [(gogoproto.nullable) = false];
}

message MsgBorrowResponse {}

message MsgRepay {
string sender = 1;
NftId nft_id = 2 [(gogoproto.nullable) = false];
repeated BorrowBid repay_bids = 3 [(gogoproto.nullable) = false];
}

message MsgRepayResponse {}

message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "sender";

option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Params params = 2 [(gogoproto.nullable) = false];
}

message MsgUpdateParamsResponse {}
10 changes: 10 additions & 0 deletions wasmbinding/bindings/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
type UnunifiMsg struct {
SubmitICQRequest *SubmitICQRequest `json:"submit_i_c_q_request,omitempty"`
IBCTransfer *wasmvmtypes.TransferMsg `json:"ibc_transfer,omitempty"`
DeputyListNft *DeputyListNft `json:"deputy_list_nft,omitempty"`
}

type SubmitICQRequest struct {
Expand All @@ -15,3 +16,12 @@ type SubmitICQRequest struct {
QueryPrefix string `json:"query_prefix"`
QueryKey []byte `json:"query_key"`
}

type DeputyListNft struct {
Lister string `json:"lister"`
ClassId string `json:"class_id"`
TokenId string `json:"token_id"`
BidDenom string `json:"bid_denom"`
MinDepositRate string `json:"min_deposit_rate"` // e.g. "0.000144262291094554178391070900057480"
MinBidPeriod string `json:"min_bid_period"` // e.g. "86400s"
}
Loading