Skip to content

Commit

Permalink
outline liquidvesting proto interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Ivanov committed Jan 11, 2024
1 parent 9f627eb commit a687c4a
Show file tree
Hide file tree
Showing 29 changed files with 2,118 additions and 1,207 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.20
require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1
cosmossdk.io/math v1.1.2
cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d
cosmossdk.io/tools/rosetta v0.2.1
Expand Down Expand Up @@ -58,7 +59,6 @@ require (
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/log v1.2.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand Down
17 changes: 0 additions & 17 deletions proto/haqq/liquidvesting/genesis.proto

This file was deleted.

14 changes: 0 additions & 14 deletions proto/haqq/liquidvesting/module/module.proto

This file was deleted.

15 changes: 0 additions & 15 deletions proto/haqq/liquidvesting/params.proto

This file was deleted.

30 changes: 0 additions & 30 deletions proto/haqq/liquidvesting/query.proto

This file was deleted.

40 changes: 0 additions & 40 deletions proto/haqq/liquidvesting/tx.proto

This file was deleted.

27 changes: 27 additions & 0 deletions proto/haqq/liquidvesting/v1/liquidvesting.proto
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 ];
}
55 changes: 55 additions & 0 deletions proto/haqq/liquidvesting/v1/query.proto
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;
}
45 changes: 45 additions & 0 deletions proto/haqq/liquidvesting/v1/tx.proto
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 {}
24 changes: 0 additions & 24 deletions x/liquidvesting/genesis.go

This file was deleted.

12 changes: 12 additions & 0 deletions x/liquidvesting/keeper/msg_server.go
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")
}
23 changes: 0 additions & 23 deletions x/liquidvesting/keeper/msg_update_params.go

This file was deleted.

31 changes: 0 additions & 31 deletions x/liquidvesting/keeper/params.go

This file was deleted.

12 changes: 12 additions & 0 deletions x/liquidvesting/keeper/query.go
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")
}
Loading

0 comments on commit a687c4a

Please sign in to comment.