2020-06-05 11:10:04 -07:00
|
|
|
syntax = "proto3";
|
2020-06-18 10:04:26 -07:00
|
|
|
package cosmos.bank;
|
2020-06-05 11:10:04 -07:00
|
|
|
|
2020-06-20 16:44:04 -07:00
|
|
|
import "cosmos/query/pagination.proto";
|
2020-06-18 10:04:26 -07:00
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "cosmos/cosmos.proto";
|
2020-06-05 11:10:04 -07:00
|
|
|
|
|
|
|
option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
|
|
|
|
|
|
|
|
// Query provides defines the gRPC querier service
|
|
|
|
service Query {
|
2020-06-30 13:59:21 -07:00
|
|
|
// Balance queries the balance of a single coin for a single account
|
|
|
|
rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {}
|
2020-06-05 11:10:04 -07:00
|
|
|
|
2020-06-30 13:59:21 -07:00
|
|
|
// AllBalances queries the balance of all coins for a single account
|
|
|
|
rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) {}
|
2020-06-05 11:10:04 -07:00
|
|
|
|
2020-06-30 13:59:21 -07:00
|
|
|
// TotalSupply queries the total supply of all coins
|
|
|
|
rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {}
|
2020-06-05 11:10:04 -07:00
|
|
|
|
2020-06-30 13:59:21 -07:00
|
|
|
// SupplyOf queries the supply of a single coin
|
|
|
|
rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) {}
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryBalanceRequest is the request type for the Query/Balance RPC method
|
|
|
|
message QueryBalanceRequest {
|
2020-06-30 13:59:21 -07:00
|
|
|
// address is the address to query balances for
|
|
|
|
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
2020-06-05 11:10:04 -07:00
|
|
|
|
2020-06-30 13:59:21 -07:00
|
|
|
// denom is the coin denom to query balances for
|
|
|
|
string denom = 2;
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryBalanceResponse is the response type for the Query/Balance RPC method
|
|
|
|
message QueryBalanceResponse {
|
2020-06-30 13:59:21 -07:00
|
|
|
// balance is the balance of the coin
|
|
|
|
cosmos.Coin balance = 1;
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryBalanceRequest is the request type for the Query/AllBalances RPC method
|
|
|
|
message QueryAllBalancesRequest {
|
2020-06-30 13:59:21 -07:00
|
|
|
// address is the address to query balances for
|
|
|
|
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
2020-06-20 16:44:04 -07:00
|
|
|
|
2020-07-20 09:51:16 -07:00
|
|
|
cosmos.query.PageRequest pagination = 2;
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC method
|
|
|
|
message QueryAllBalancesResponse {
|
2020-06-30 13:59:21 -07:00
|
|
|
// balances is the balances of the coins
|
|
|
|
repeated cosmos.Coin balances = 1
|
|
|
|
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
2020-06-20 16:44:04 -07:00
|
|
|
|
2020-07-20 09:51:16 -07:00
|
|
|
cosmos.query.PageResponse pagination = 2;
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method
|
2020-06-20 16:44:04 -07:00
|
|
|
message QueryTotalSupplyRequest {}
|
2020-06-05 11:10:04 -07:00
|
|
|
|
|
|
|
// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method
|
|
|
|
message QueryTotalSupplyResponse {
|
2020-06-30 13:59:21 -07:00
|
|
|
// supply is the supply of the coins
|
|
|
|
repeated cosmos.Coin supply = 1
|
|
|
|
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method
|
|
|
|
message QuerySupplyOfRequest {
|
2020-06-30 13:59:21 -07:00
|
|
|
string denom = 1;
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method
|
|
|
|
message QuerySupplyOfResponse {
|
2020-06-30 13:59:21 -07:00
|
|
|
// amount is the supply of the coin
|
|
|
|
cosmos.Coin amount = 1
|
|
|
|
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.nullable) = false];
|
2020-06-05 11:10:04 -07:00
|
|
|
}
|