-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
outline liquidvesting proto interface
- Loading branch information
Petr Ivanov
committed
Jan 11, 2024
1 parent
9f627eb
commit a687c4a
Showing
29 changed files
with
2,118 additions
and
1,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
syntax = "proto3"; | ||
package haqq.liquidvesting; | ||
|
||
import "amino/amino.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "cosmos/vesting/v1beta1/vesting.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
|
||
option go_package = "github.com/haqq-network/haqq/x/liquidvesting/types"; | ||
|
||
// Denom represents liquid token bonded to some specific vesting schedule | ||
message Denom { | ||
cosmos.base.v1beta1.Coin total_supply = 1 [ | ||
(gogoproto.nullable) = false | ||
]; | ||
// lockup periods | ||
repeated cosmos.vesting.v1beta1.Period lockup_periods = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = | ||
"github.com/cosmos/cosmos-sdk/x/auth/vesting/types.Periods" | ||
]; | ||
// start date | ||
google.protobuf.Timestamp start_time = 3 | ||
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
syntax = "proto3"; | ||
package haqq.liquidvesting; | ||
|
||
import "amino/amino.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
import "haqq/liquidvesting/v1/liquidvesting.proto"; | ||
|
||
option go_package = "github.com/haqq-network/haqq/x/liquidvesting/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// Denom queries liquid vesting token info by denom | ||
rpc Denom(QueryDenomRequest) returns (QueryDenomResponse) { | ||
option (google.api.http).get = "/haqq/liquidvesting/v1/denom"; | ||
}; | ||
// Denoms queries liquid vesting tokens info | ||
rpc Denoms(QueryDenomsRequest) returns (QueryDenomsResponse) { | ||
option (google.api.http).get = "/haqq/liquidvesting/v1/denoms"; | ||
}; | ||
} | ||
|
||
// QueryDenomRequest is request fo Denom rpc method | ||
message QueryDenomRequest { | ||
// denom is liquidated vesting token | ||
string denom = 1; | ||
} | ||
|
||
// QueryDenomResponse is response for Denom rpc method | ||
message QueryDenomResponse { | ||
// denom is liquidated vesting token | ||
Denom denom = 1 [ | ||
(gogoproto.nullable) = false, | ||
(amino.dont_omitempty) = true | ||
]; | ||
} | ||
|
||
// QueryDenomsRequest is request for Denoms rpc method | ||
message QueryDenomsRequest { | ||
// pagination defines an optional pagination for the request. | ||
cosmos.base.query.v1beta1.PageRequest pagination = 1; | ||
} | ||
|
||
// QueryDenomsResponse is response for Denoms rpc method | ||
message QueryDenomsResponse { | ||
// denoms are liquidated vesting tokens | ||
repeated Denom denoms = 1 [ | ||
(gogoproto.nullable) = false, | ||
(amino.dont_omitempty) = true | ||
]; | ||
|
||
// pagination defines the pagination in the response. | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
syntax = "proto3"; | ||
package haqq.liquidvesting; | ||
|
||
import "amino/amino.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
|
||
option go_package = "github.com/haqq-network/haqq/x/liquidvesting/types"; | ||
|
||
// Msg defines the Msg service. | ||
service Msg { | ||
// Liquidate transforms specified amount of tokens locked on vesting account into a new liquid token | ||
rpc Liquidate(MsgLiquidate) returns (MsgLiquidateResponse) { | ||
option (google.api.http).get = "/haqq/liquidvesting/v1/tx/liquidate"; | ||
}; | ||
|
||
// Redeem burns liquid token and deposits corresponding amount of vesting token to the specified account | ||
rpc Redeem (MsgRedeem) returns (MsgRedeemResponse) { | ||
option (google.api.http).get = "/haqq/liquidvesting/v1/tx/redeem"; | ||
}; | ||
} | ||
|
||
// MsgLiquidate represents message to liquidate arbitrary amount of tokens locked in vesting | ||
message MsgLiquidate { | ||
// account address for liquidation of tokens locked in vesting | ||
string address = 1; | ||
// amount of tokens subject for liquidation | ||
cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} | ||
|
||
// MsgLiquidateResponse defines the Msg/Liquidate response type | ||
message MsgLiquidateResponse {} | ||
|
||
// MsgLiquidate represents message to redeem arbitrary amount of liquid vesting tokens | ||
message MsgRedeem { | ||
// destination address for vesting tokens | ||
string redeem_to = 1; | ||
// amount of vesting tokens to redeem from liquidation module | ||
cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} | ||
|
||
// MsgRedeemResponse defines the Msg/Redeem response type | ||
message MsgRedeemResponse {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
package keeper | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/haqq-network/haqq/x/liquidvesting/types" | ||
) | ||
|
||
var _ types.MsgServer = Keeper{} | ||
|
||
func (k Keeper) Liquidate(ctx context.Context, liquidate *types.MsgLiquidate) (*types.MsgLiquidateResponse, error) { | ||
// TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (k Keeper) Redeem(ctx context.Context, redeem *types.MsgRedeem) (*types.MsgRedeemResponse, error) { | ||
// TODO implement me | ||
panic("implement me") | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
package keeper | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/haqq-network/haqq/x/liquidvesting/types" | ||
) | ||
|
||
var _ types.QueryServer = Keeper{} | ||
|
||
func (k Keeper) Denom(ctx context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error) { | ||
// TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (k Keeper) Denoms(ctx context.Context, request *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error) { | ||
// TODO implement me | ||
panic("implement me") | ||
} |
Oops, something went wrong.