-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efaacf8
commit 057b1c6
Showing
210 changed files
with
58,703 additions
and
24 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 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 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 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,10 @@ | ||
syntax = "proto3"; | ||
package stride.records; | ||
|
||
import "stride/records/records.proto"; | ||
|
||
option go_package = "github.com/milkyway-labs/milk/x/records/types"; | ||
|
||
message TransferCallback { uint64 deposit_record_id = 1; } | ||
|
||
message TransferLSMTokenCallback { LSMTokenDeposit deposit = 1; } |
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,24 @@ | ||
syntax = "proto3"; | ||
package stride.records; | ||
|
||
import "stride/records/params.proto"; | ||
import "stride/records/records.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/milkyway-labs/milk/x/records/types"; | ||
|
||
// GenesisState defines the records module's genesis state. | ||
message GenesisState { | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
string port_id = 2; | ||
repeated UserRedemptionRecord user_redemption_record_list = 3 | ||
[ (gogoproto.nullable) = false ]; | ||
uint64 user_redemption_record_count = 4; | ||
repeated EpochUnbondingRecord epoch_unbonding_record_list = 5 | ||
[ (gogoproto.nullable) = false ]; | ||
repeated DepositRecord deposit_record_list = 7 | ||
[ (gogoproto.nullable) = false ]; | ||
uint64 deposit_record_count = 8; | ||
repeated LSMTokenDeposit lsm_token_deposit_list = 9 | ||
[ (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,7 @@ | ||
syntax = "proto3"; | ||
package stride.records; | ||
|
||
option go_package = "github.com/milkyway-labs/milk/x/records/types"; | ||
|
||
// Params defines the parameters for the module. | ||
message Params {} |
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,185 @@ | ||
syntax = "proto3"; | ||
package stride.records; | ||
|
||
import "stride/records/records.proto"; | ||
import "stride/records/params.proto"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
|
||
option go_package = "github.com/milkyway-labs/milk/x/records/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// Parameters queries the parameters of the module. | ||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { | ||
option (google.api.http).get = "/StrideLabs/stride/records/params"; | ||
} | ||
// Queries a UserRedemptionRecord by id. | ||
rpc UserRedemptionRecord(QueryGetUserRedemptionRecordRequest) | ||
returns (QueryGetUserRedemptionRecordResponse) { | ||
option (google.api.http).get = | ||
"/Stride-Labs/stride/records/user_redemption_record/{id}"; | ||
} | ||
|
||
// Queries a list of UserRedemptionRecord items. | ||
rpc UserRedemptionRecordAll(QueryAllUserRedemptionRecordRequest) | ||
returns (QueryAllUserRedemptionRecordResponse) { | ||
option (google.api.http).get = | ||
"/Stride-Labs/stride/records/user_redemption_record"; | ||
} | ||
|
||
// Queries a list of UserRedemptionRecord items by chainId / userId pair. | ||
rpc UserRedemptionRecordForUser(QueryAllUserRedemptionRecordForUserRequest) | ||
returns (QueryAllUserRedemptionRecordForUserResponse) { | ||
option (google.api.http).get = | ||
"/Stride-Labs/stride/records/user_redemption_record_for_user/" | ||
"{chain_id}/{day}/{address}/{limit}"; | ||
} | ||
|
||
// Queries a EpochUnbondingRecord by id. | ||
rpc EpochUnbondingRecord(QueryGetEpochUnbondingRecordRequest) | ||
returns (QueryGetEpochUnbondingRecordResponse) { | ||
option (google.api.http).get = | ||
"/Stride-Labs/stride/records/epoch_unbonding_record/{epoch_number}"; | ||
} | ||
|
||
// Queries a list of EpochUnbondingRecord items. | ||
rpc EpochUnbondingRecordAll(QueryAllEpochUnbondingRecordRequest) | ||
returns (QueryAllEpochUnbondingRecordResponse) { | ||
option (google.api.http).get = | ||
"/Stride-Labs/stride/records/epoch_unbonding_record"; | ||
} | ||
|
||
// Queries a DepositRecord by id. | ||
rpc DepositRecord(QueryGetDepositRecordRequest) | ||
returns (QueryGetDepositRecordResponse) { | ||
option (google.api.http).get = | ||
"/Stride-Labs/stride/records/deposit_record/{id}"; | ||
} | ||
|
||
// Queries a list of DepositRecord items. | ||
rpc DepositRecordAll(QueryAllDepositRecordRequest) | ||
returns (QueryAllDepositRecordResponse) { | ||
option (google.api.http).get = "/Stride-Labs/stride/records/deposit_record"; | ||
} | ||
|
||
// Queries a list of DepositRecord items for a given host zone | ||
rpc DepositRecordByHost(QueryDepositRecordByHostRequest) | ||
returns (QueryDepositRecordByHostResponse) { | ||
option (google.api.http).get = "/Stride-Labs/stride/records/" | ||
"deposit_record_by_host_zone/{host_zone_id}"; | ||
} | ||
|
||
// Queries the existing LSMTokenDeposits for one specific deposit | ||
rpc LSMDeposit(QueryLSMDepositRequest) returns (QueryLSMDepositResponse) { | ||
option (google.api.http).get = | ||
"/Stride-Labs/stride/stakeibc/lsm_deposit/{chain_id}/{denom}"; | ||
} | ||
|
||
// Queries the existing LSMTokenDeposits for all which match filters | ||
// intended use: | ||
// ...stakeibc/lsm_deposits?chain_id=X&validator_address=Y&status=Z | ||
rpc LSMDeposits(QueryLSMDepositsRequest) returns (QueryLSMDepositsResponse) { | ||
option (google.api.http).get = "/Stride-Labs/stride/stakeibc/lsm_deposits"; | ||
} | ||
} | ||
|
||
// QueryParamsRequest is request type for the Query/Params RPC method. | ||
message QueryParamsRequest {} | ||
|
||
// QueryParamsResponse is response type for the Query/Params RPC method. | ||
message QueryParamsResponse { | ||
// params holds all the parameters of this module. | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
message QueryGetDepositRecordRequest { uint64 id = 1; } | ||
|
||
message QueryGetDepositRecordResponse { | ||
DepositRecord deposit_record = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
message QueryAllDepositRecordRequest { | ||
cosmos.base.query.v1beta1.PageRequest pagination = 1; | ||
} | ||
|
||
message QueryAllDepositRecordResponse { | ||
repeated DepositRecord deposit_record = 1 [ (gogoproto.nullable) = false ]; | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
message QueryDepositRecordByHostRequest { string host_zone_id = 1; } | ||
|
||
message QueryDepositRecordByHostResponse { | ||
repeated DepositRecord deposit_record = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
message QueryGetUserRedemptionRecordRequest { string id = 1; } | ||
|
||
message QueryGetUserRedemptionRecordResponse { | ||
UserRedemptionRecord user_redemption_record = 1 | ||
[ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
message QueryAllUserRedemptionRecordRequest { | ||
cosmos.base.query.v1beta1.PageRequest pagination = 1; | ||
} | ||
|
||
message QueryAllUserRedemptionRecordResponse { | ||
repeated UserRedemptionRecord user_redemption_record = 1 | ||
[ (gogoproto.nullable) = false ]; | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
// Query UserRedemptionRecords by chainId / userId pair | ||
message QueryAllUserRedemptionRecordForUserRequest { | ||
string chain_id = 1; | ||
uint64 day = 2; | ||
string address = 3; | ||
uint64 limit = 4; | ||
cosmos.base.query.v1beta1.PageRequest pagination = 5; | ||
} | ||
|
||
message QueryAllUserRedemptionRecordForUserResponse { | ||
repeated UserRedemptionRecord user_redemption_record = 1 | ||
[ (gogoproto.nullable) = false ]; | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
message QueryGetEpochUnbondingRecordRequest { uint64 epoch_number = 1; } | ||
|
||
message QueryGetEpochUnbondingRecordResponse { | ||
EpochUnbondingRecord epoch_unbonding_record = 1 | ||
[ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
message QueryAllEpochUnbondingRecordRequest { | ||
cosmos.base.query.v1beta1.PageRequest pagination = 1; | ||
} | ||
|
||
message QueryAllEpochUnbondingRecordResponse { | ||
repeated EpochUnbondingRecord epoch_unbonding_record = 1 | ||
[ (gogoproto.nullable) = false ]; | ||
cosmos.base.query.v1beta1.PageResponse pagination = 2; | ||
} | ||
|
||
message QueryLSMDepositRequest { | ||
string chain_id = 1; | ||
string denom = 2; | ||
} | ||
|
||
message QueryLSMDepositResponse { | ||
LSMTokenDeposit deposit = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
message QueryLSMDepositsRequest { | ||
string chain_id = 1; | ||
string validator_address = 2; | ||
string status = 3; | ||
} | ||
|
||
message QueryLSMDepositsResponse { | ||
repeated LSMTokenDeposit deposits = 1 [ (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,111 @@ | ||
syntax = "proto3"; | ||
package stride.records; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/milkyway-labs/milk/x/records/types"; | ||
|
||
message UserRedemptionRecord { | ||
string id = 1; // {chain_id}.{epoch}.{receiver} | ||
string receiver = 3; | ||
string native_token_amount = 4 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
string denom = 5; | ||
string host_zone_id = 6; | ||
uint64 epoch_number = 7; | ||
bool claim_is_pending = 8; | ||
reserved 2; | ||
string st_token_amount = 9 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
message DepositRecord { | ||
uint64 id = 1; | ||
string amount = 2 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
string denom = 3; | ||
string host_zone_id = 4; | ||
enum Status { | ||
// in transfer queue to be sent to the delegation ICA | ||
TRANSFER_QUEUE = 0; | ||
// transfer in progress (IBC packet sent, ack not received) | ||
TRANSFER_IN_PROGRESS = 2; | ||
// in staking queue on delegation ICA | ||
DELEGATION_QUEUE = 1; | ||
// staking in progress (ICA packet sent, ack not received) | ||
DELEGATION_IN_PROGRESS = 3; | ||
} | ||
enum Source { | ||
STRIDE = 0; | ||
WITHDRAWAL_ICA = 1; | ||
} | ||
Status status = 6; | ||
uint64 deposit_epoch_number = 7; | ||
Source source = 8; | ||
|
||
reserved 5; | ||
} | ||
|
||
message HostZoneUnbonding { | ||
enum Status { | ||
// tokens bonded on delegate account | ||
UNBONDING_QUEUE = 0; | ||
UNBONDING_IN_PROGRESS = 3; | ||
// unbonding completed on delegate account | ||
EXIT_TRANSFER_QUEUE = 1; | ||
EXIT_TRANSFER_IN_PROGRESS = 4; | ||
// transfer success | ||
CLAIMABLE = 2; | ||
} | ||
string st_token_amount = 1 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
string native_token_amount = 2 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
string denom = 3; | ||
string host_zone_id = 4; | ||
uint64 unbonding_time = 5; | ||
Status status = 6; | ||
repeated string user_redemption_records = 7; | ||
} | ||
|
||
message EpochUnbondingRecord { | ||
uint64 epoch_number = 1; | ||
repeated HostZoneUnbonding host_zone_unbondings = 3; | ||
reserved 2; | ||
} | ||
|
||
message LSMTokenDeposit { | ||
enum Status { | ||
DEPOSIT_PENDING = 0; | ||
TRANSFER_QUEUE = 1; | ||
TRANSFER_IN_PROGRESS = 2; | ||
TRANSFER_FAILED = 3; | ||
DETOKENIZATION_QUEUE = 4; | ||
DETOKENIZATION_IN_PROGRESS = 5; | ||
DETOKENIZATION_FAILED = 6; | ||
} | ||
|
||
string deposit_id = 1; | ||
string chain_id = 2; | ||
string denom = 3; | ||
string ibc_denom = 4; | ||
string staker_address = 5; | ||
string validator_address = 6; | ||
string amount = 7 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
cosmos.base.v1beta1.Coin st_token = 8 [ (gogoproto.nullable) = false ]; | ||
Status status = 9; | ||
} |
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,5 @@ | ||
Some of the data structures used in this module were inspired by Quicksilver. | ||
|
||
Specifically, we used their modeling of interchain accounts and zones (although the implementation has since diverged) for the following data structures | ||
- Icaaccount | ||
- HostZone |
Oops, something went wrong.