-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
query.proto
408 lines (348 loc) · 15.8 KB
/
query.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
syntax = "proto3";
package cosmos.bank.v1beta1;
import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/bank/v1beta1/bank.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/query/v1/query.proto";
import "amino/amino.proto";
option go_package = "cosmossdk.io/x/bank/types";
// Query defines the gRPC querier service.
service Query {
// Balance queries the balance of a single coin for a single account.
rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom";
}
// AllBalances queries the balance of all coins for a single account.
//
// When called from another module, this query might consume a high amount of
// gas if the pagination field is incorrectly set.
rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}";
}
// SpendableBalances queries the spendable balance of all coins for a single
// account.
//
// When called from another module, this query might consume a high amount of
// gas if the pagination field is incorrectly set.
//
// Since: cosmos-sdk 0.46
rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}";
}
// SpendableBalanceByDenom queries the spendable balance of a single denom for
// a single account.
//
// When called from another module, this query might consume a high amount of
// gas if the pagination field is incorrectly set.
//
// Since: cosmos-sdk 0.47
rpc SpendableBalanceByDenom(QuerySpendableBalanceByDenomRequest) returns (QuerySpendableBalanceByDenomResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}/by_denom";
}
// TotalSupply queries the total supply of all coins.
//
// When called from another module, this query might consume a high amount of
// gas if the pagination field is incorrectly set.
rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/supply";
}
// SupplyOf queries the supply of a single coin.
//
// When called from another module, this query might consume a high amount of
// gas if the pagination field is incorrectly set.
rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom";
}
// Params queries the parameters of x/bank module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/params";
}
// DenomMetadata queries the client metadata of a given coin denomination.
rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}";
}
// DenomMetadataByQueryString queries the client metadata of a given coin denomination.
rpc DenomMetadataByQueryString(QueryDenomMetadataByQueryStringRequest)
returns (QueryDenomMetadataByQueryStringResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata_by_query_string";
}
// DenomsMetadata queries the client metadata for all registered coin
// denominations.
rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata";
}
// DenomOwners queries for all account addresses that own a particular token
// denomination.
//
// When called from another module, this query might consume a high amount of
// gas if the pagination field is incorrectly set.
//
// Since: cosmos-sdk 0.46
rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}";
}
// DenomOwnersByQuery queries for all account addresses that own a particular token
// denomination.
//
// Since: cosmos-sdk 0.50.3
rpc DenomOwnersByQuery(QueryDenomOwnersByQueryRequest) returns (QueryDenomOwnersByQueryResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners_by_query";
}
// SendEnabled queries for SendEnabled entries.
//
// This query only returns denominations that have specific SendEnabled settings.
// Any denomination that does not have a specific setting will use the default
// params.default_send_enabled, and will not be returned by this query.
//
// Since: cosmos-sdk 0.47
rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled";
}
}
// QueryBalanceRequest is the request type for the Query/Balance RPC method.
message QueryBalanceRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address to query balances for.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// denom is the coin denom to query balances for.
string denom = 2;
}
// QueryBalanceResponse is the response type for the Query/Balance RPC method.
message QueryBalanceResponse {
// balance is the balance of the coin.
cosmos.base.v1beta1.Coin balance = 1;
}
// QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
message QueryAllBalancesRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address to query balances for.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
// resolve_denom is the flag to resolve the denom into a human-readable form from the metadata.
//
// Since: cosmos-sdk 0.50
bool resolve_denom = 3;
}
// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC
// method.
message QueryAllBalancesResponse {
// balances is the balances of all the coins.
repeated cosmos.base.v1beta1.Coin balances = 1 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(amino.encoding) = "legacy_coins",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QuerySpendableBalancesRequest defines the gRPC request structure for querying
// an account's spendable balances.
//
// Since: cosmos-sdk 0.46
message QuerySpendableBalancesRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address to query spendable balances for.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QuerySpendableBalancesResponse defines the gRPC response structure for querying
// an account's spendable balances.
//
// Since: cosmos-sdk 0.46
message QuerySpendableBalancesResponse {
// balances is the spendable balances of all the coins.
repeated cosmos.base.v1beta1.Coin balances = 1 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(amino.encoding) = "legacy_coins",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for
// querying an account's spendable balance for a specific denom.
//
// Since: cosmos-sdk 0.47
message QuerySpendableBalanceByDenomRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// address is the address to query balances for.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// denom is the coin denom to query balances for.
string denom = 2;
}
// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for
// querying an account's spendable balance for a specific denom.
//
// Since: cosmos-sdk 0.47
message QuerySpendableBalanceByDenomResponse {
// balance is the balance of the coin.
cosmos.base.v1beta1.Coin balance = 1;
}
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
// method.
message QueryTotalSupplyRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
// pagination defines an optional pagination for the request.
//
// Since: cosmos-sdk 0.43
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
// method
message QueryTotalSupplyResponse {
// supply is the supply of the coins
repeated cosmos.base.v1beta1.Coin supply = 1 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(amino.encoding) = "legacy_coins",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// pagination defines the pagination in the response.
//
// Since: cosmos-sdk 0.43
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
message QuerySupplyOfRequest {
// denom is the coin denom to query balances for.
string denom = 1;
}
// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method.
message QuerySupplyOfResponse {
// amount is the supply of the coin.
cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
// QueryParamsRequest defines the request type for querying x/bank parameters.
message QueryParamsRequest {}
// QueryParamsResponse defines the response type for querying x/bank parameters.
message QueryParamsResponse {
// params provides the parameters of the bank module.
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.
message QueryDenomsMetadataRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC
// method.
message QueryDenomsMetadataResponse {
// metadata provides the client information for all the registered tokens.
repeated Metadata metadatas = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method.
message QueryDenomMetadataRequest {
// denom is the coin denom to query the metadata for.
string denom = 1;
}
// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC
// method.
message QueryDenomMetadataResponse {
// metadata describes and provides all the client information for the requested token.
Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method.
// Identical with QueryDenomMetadataRequest but receives denom as query string.
message QueryDenomMetadataByQueryStringRequest {
// denom is the coin denom to query the metadata for.
string denom = 1;
}
// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC
// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request.
message QueryDenomMetadataByQueryStringResponse {
// metadata describes and provides all the client information for the requested token.
Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query,
// which queries for a paginated set of all account holders of a particular
// denomination.
message QueryDenomOwnersRequest {
// denom defines the coin denomination to query all account holders for.
string denom = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// DenomOwner defines structure representing an account that owns or holds a
// particular denominated token. It contains the account address and account
// balance of the denominated token.
//
// Since: cosmos-sdk 0.46
message DenomOwner {
// address defines the address that owns a particular denomination.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// balance is the balance of the denominated coin for an account.
cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query.
//
// Since: cosmos-sdk 0.46
message QueryDenomOwnersResponse {
repeated DenomOwner denom_owners = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query,
// which queries for a paginated set of all account holders of a particular
// denomination.
//
// Since: cosmos-sdk 0.50.3
message QueryDenomOwnersByQueryRequest {
// denom defines the coin denomination to query all account holders for.
string denom = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query.
//
// Since: cosmos-sdk 0.50.3
message QueryDenomOwnersByQueryResponse {
repeated DenomOwner denom_owners = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries.
//
// Since: cosmos-sdk 0.47
message QuerySendEnabledRequest {
// denoms is the specific denoms you want look up. Leave empty to get all entries.
repeated string denoms = 1;
// pagination defines an optional pagination for the request. This field is
// only read if the denoms field is empty.
cosmos.base.query.v1beta1.PageRequest pagination = 99;
}
// QuerySendEnabledResponse defines the RPC response of a SendEnable query.
//
// Since: cosmos-sdk 0.47
message QuerySendEnabledResponse {
repeated SendEnabled send_enabled = 1;
// pagination defines the pagination in the response. This field is only
// populated if the denoms field in the request is empty.
cosmos.base.query.v1beta1.PageResponse pagination = 99;
}