2022-01-08 00:39:27 +00:00
|
|
|
syntax = "proto3";
|
2024-05-01 03:56:00 +00:00
|
|
|
package zgc.bep3.v1beta1;
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2022-11-22 23:22:07 +00:00
|
|
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
import "cosmos_proto/cosmos.proto";
|
2022-11-22 23:22:07 +00:00
|
|
|
import "gogoproto/gogo.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
import "google/api/annotations.proto";
|
|
|
|
import "google/protobuf/duration.proto";
|
2024-05-01 03:56:00 +00:00
|
|
|
import "zgc/bep3/v1beta1/bep3.proto";
|
2022-01-08 00:39:27 +00:00
|
|
|
|
2024-05-01 03:17:24 +00:00
|
|
|
option go_package = "github.com/0glabs/0g-chain/x/bep3/types";
|
2022-01-08 00:39:27 +00:00
|
|
|
|
|
|
|
// Query defines the gRPC querier service for bep3 module
|
|
|
|
service Query {
|
|
|
|
// Params queries module params
|
|
|
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
2024-05-01 03:56:00 +00:00
|
|
|
option (google.api.http).get = "/0g-chain/bep3/v1beta1/params";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// AssetSupply queries info about an asset's supply
|
|
|
|
rpc AssetSupply(QueryAssetSupplyRequest) returns (QueryAssetSupplyResponse) {
|
2024-05-01 03:56:00 +00:00
|
|
|
option (google.api.http).get = "/0g-chain/bep3/v1beta1/assetsupply/{denom}";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// AssetSupplies queries a list of asset supplies
|
|
|
|
rpc AssetSupplies(QueryAssetSuppliesRequest) returns (QueryAssetSuppliesResponse) {
|
2024-05-01 03:56:00 +00:00
|
|
|
option (google.api.http).get = "/0g-chain/bep3/v1beta1/assetsupplies";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// AtomicSwap queries info about an atomic swap
|
|
|
|
rpc AtomicSwap(QueryAtomicSwapRequest) returns (QueryAtomicSwapResponse) {
|
2024-05-01 03:56:00 +00:00
|
|
|
option (google.api.http).get = "/0g-chain/bep3/v1beta1/atomicswap/{swap_id}";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// AtomicSwaps queries a list of atomic swaps
|
|
|
|
rpc AtomicSwaps(QueryAtomicSwapsRequest) returns (QueryAtomicSwapsResponse) {
|
2024-05-01 03:56:00 +00:00
|
|
|
option (google.api.http).get = "/0g-chain/bep3/v1beta1/atomicswaps";
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryParamsRequest defines the request type for querying x/bep3 parameters.
|
|
|
|
message QueryParamsRequest {}
|
|
|
|
|
|
|
|
// QueryParamsResponse defines the response type for querying x/bep3 parameters.
|
|
|
|
message QueryParamsResponse {
|
|
|
|
// params represents the parameters of the module
|
|
|
|
Params params = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAssetSupplyRequest is the request type for the Query/AssetSupply RPC method.
|
|
|
|
message QueryAssetSupplyRequest {
|
2022-11-22 23:22:07 +00:00
|
|
|
option (gogoproto.equal) = false;
|
2022-01-08 00:39:27 +00:00
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
// denom filters the asset response for the specified denom
|
|
|
|
string denom = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AssetSupplyResponse defines information about an asset's supply.
|
|
|
|
message AssetSupplyResponse {
|
|
|
|
// incoming_supply represents the incoming supply of an asset
|
|
|
|
cosmos.base.v1beta1.Coin incoming_supply = 1 [(gogoproto.nullable) = false];
|
|
|
|
// outgoing_supply represents the outgoing supply of an asset
|
|
|
|
cosmos.base.v1beta1.Coin outgoing_supply = 2 [(gogoproto.nullable) = false];
|
|
|
|
// current_supply represents the current on-chain supply of an asset
|
|
|
|
cosmos.base.v1beta1.Coin current_supply = 3 [(gogoproto.nullable) = false];
|
|
|
|
// time_limited_current_supply represents the time limited current supply of an asset
|
|
|
|
cosmos.base.v1beta1.Coin time_limited_current_supply = 4 [(gogoproto.nullable) = false];
|
|
|
|
// time_elapsed represents the time elapsed
|
2022-11-22 23:22:07 +00:00
|
|
|
google.protobuf.Duration time_elapsed = 5 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.stdduration) = true
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAssetSupplyResponse is the response type for the Query/AssetSupply RPC method.
|
|
|
|
message QueryAssetSupplyResponse {
|
|
|
|
// asset_supply represents the supply of the asset
|
|
|
|
AssetSupplyResponse asset_supply = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAssetSuppliesRequest is the request type for the Query/AssetSupplies RPC method.
|
|
|
|
message QueryAssetSuppliesRequest {
|
2022-11-22 23:22:07 +00:00
|
|
|
option (gogoproto.equal) = false;
|
2022-01-08 00:39:27 +00:00
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAssetSuppliesResponse is the response type for the Query/AssetSupplies RPC method.
|
|
|
|
message QueryAssetSuppliesResponse {
|
|
|
|
// asset_supplies represents the supplies of returned assets
|
|
|
|
repeated AssetSupplyResponse asset_supplies = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAtomicSwapRequest is the request type for the Query/AtomicSwap RPC method.
|
|
|
|
message QueryAtomicSwapRequest {
|
2022-11-22 23:22:07 +00:00
|
|
|
option (gogoproto.equal) = false;
|
2022-01-08 00:39:27 +00:00
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
// swap_id represents the id of the swap to query
|
|
|
|
string swap_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAtomicSwapResponse is the response type for the Query/AtomicSwap RPC method.
|
|
|
|
message QueryAtomicSwapResponse {
|
|
|
|
AtomicSwapResponse atomic_swap = 2 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// AtomicSwapResponse represents the returned atomic swap properties
|
|
|
|
message AtomicSwapResponse {
|
|
|
|
// id represents the id of the atomic swap
|
|
|
|
string id = 1;
|
|
|
|
// amount represents the amount being swapped
|
2022-11-22 23:22:07 +00:00
|
|
|
repeated cosmos.base.v1beta1.Coin amount = 2 [
|
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2022-01-08 00:39:27 +00:00
|
|
|
// random_number_hash represents the hash of the random number
|
|
|
|
string random_number_hash = 3;
|
|
|
|
// expire_height represents the height when the swap expires
|
|
|
|
uint64 expire_height = 4;
|
|
|
|
// timestamp represents the timestamp of the swap
|
|
|
|
int64 timestamp = 5;
|
2024-05-01 03:56:00 +00:00
|
|
|
// sender is the 0g-chain sender of the swap
|
2022-01-08 00:39:27 +00:00
|
|
|
string sender = 6 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
2024-05-01 03:56:00 +00:00
|
|
|
// recipient is the 0g-chain recipient of the swap
|
2022-01-08 00:39:27 +00:00
|
|
|
string recipient = 7 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
|
|
// sender_other_chain is the sender on the other chain
|
|
|
|
string sender_other_chain = 8;
|
|
|
|
// recipient_other_chain is the recipient on the other chain
|
|
|
|
string recipient_other_chain = 9;
|
|
|
|
// closed_block is the block when the swap is closed
|
|
|
|
int64 closed_block = 10;
|
|
|
|
// status represents the current status of the swap
|
|
|
|
SwapStatus status = 11;
|
|
|
|
// cross_chain identifies whether the atomic swap is cross chain
|
|
|
|
bool cross_chain = 12;
|
|
|
|
// direction identifies if the swap is incoming or outgoing
|
|
|
|
SwapDirection direction = 13;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAtomicSwapsRequest is the request type for the Query/AtomicSwaps RPC method.
|
|
|
|
message QueryAtomicSwapsRequest {
|
2022-11-22 23:22:07 +00:00
|
|
|
option (gogoproto.equal) = false;
|
2022-01-08 00:39:27 +00:00
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
// involve filters by address
|
|
|
|
string involve = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
|
|
// expiration filters by expiration block height
|
|
|
|
uint64 expiration = 2;
|
|
|
|
// status filters by swap status
|
|
|
|
SwapStatus status = 3;
|
|
|
|
// direction fitlers by swap direction
|
|
|
|
SwapDirection direction = 4;
|
|
|
|
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAtomicSwapsResponse is the response type for the Query/AtomicSwaps RPC method.
|
|
|
|
message QueryAtomicSwapsResponse {
|
|
|
|
// atomic_swap represents the returned atomic swaps for the request
|
|
|
|
repeated AtomicSwapResponse atomic_swaps = 1 [(gogoproto.nullable) = false];
|
|
|
|
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 3;
|
|
|
|
}
|