Skip to content

Commit 2a199f5

Browse files
mergify[bot]gsai967julienrbrt
authored
feat(x/bank): adding DenomOwnersByQuery for denom owners for token (backport #18956) (#19007)
Co-authored-by: gsai967 <[email protected]> Co-authored-by: Julien Robert <[email protected]>
1 parent fe4b58b commit 2a199f5

File tree

10 files changed

+2615
-333
lines changed

10 files changed

+2615
-333
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4040

4141
### Improvements
4242

43+
* (x/bank) [#18956](https://github.com/cosmos/cosmos-sdk/pull/18956) Introduced a new `DenomOwnersByQuery` query method for `DenomOwners`, which accepts the denom value as a query string parameter, resolving issues with denoms containing slashes.
4344
* (x/gov) [#18707](https://github.com/cosmos/cosmos-sdk/pull/18707) Improve genesis validation.
4445
* (x/auth/tx) [#18772](https://github.com/cosmos/cosmos-sdk/pull/18772) Remove misleading gas wanted from tx simulation failure log.
4546
* (client/tx) [#18852](https://github.com/cosmos/cosmos-sdk/pull/18852) Add `WithFromName` to tx factory.

api/cosmos/bank/v1beta1/query.pulsar.go

Lines changed: 1453 additions & 222 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/cosmos/bank/v1beta1/query_grpc.pb.go

Lines changed: 49 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/docs/swagger-ui/swagger.yaml

Lines changed: 230 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3568,6 +3568,170 @@ paths:
35683568
descending order.
35693569

35703570

3571+
Since: cosmos-sdk 0.43
3572+
in: query
3573+
required: false
3574+
type: boolean
3575+
tags:
3576+
- Query
3577+
/cosmos/bank/v1beta1/denom_owners_by_query:
3578+
get:
3579+
summary: >-
3580+
DenomOwnersByQuery queries for all account addresses that own a
3581+
particular token
3582+
3583+
denomination.
3584+
description: 'Since: cosmos-sdk 0.50.3'
3585+
operationId: DenomOwnersByQuery
3586+
responses:
3587+
'200':
3588+
description: A successful response.
3589+
schema:
3590+
type: object
3591+
properties:
3592+
denom_owners:
3593+
type: array
3594+
items:
3595+
type: object
3596+
properties:
3597+
address:
3598+
type: string
3599+
description: >-
3600+
address defines the address that owns a particular
3601+
denomination.
3602+
balance:
3603+
type: object
3604+
properties:
3605+
denom:
3606+
type: string
3607+
amount:
3608+
type: string
3609+
description: >-
3610+
Coin defines a token with a denomination and an amount.
3611+
3612+
3613+
NOTE: The amount field is an Int which implements the
3614+
custom method
3615+
3616+
signatures required by gogoproto.
3617+
description: >-
3618+
DenomOwner defines structure representing an account that
3619+
owns or holds a
3620+
3621+
particular denominated token. It contains the account
3622+
address and account
3623+
3624+
balance of the denominated token.
3625+
3626+
3627+
Since: cosmos-sdk 0.46
3628+
pagination:
3629+
description: pagination defines the pagination in the response.
3630+
type: object
3631+
properties:
3632+
next_key:
3633+
type: string
3634+
format: byte
3635+
description: |-
3636+
next_key is the key to be passed to PageRequest.key to
3637+
query the next page most efficiently. It will be empty if
3638+
there are no more results.
3639+
total:
3640+
type: string
3641+
format: uint64
3642+
title: >-
3643+
total is total number of results available if
3644+
PageRequest.count_total
3645+
3646+
was set, its value is undefined otherwise
3647+
description: >-
3648+
QueryDenomOwnersByQueryResponse defines the RPC response of a
3649+
DenomOwnersByQuery RPC query.
3650+
3651+
3652+
Since: cosmos-sdk 0.50.3
3653+
default:
3654+
description: An unexpected error response.
3655+
schema:
3656+
type: object
3657+
properties:
3658+
error:
3659+
type: string
3660+
code:
3661+
type: integer
3662+
format: int32
3663+
message:
3664+
type: string
3665+
details:
3666+
type: array
3667+
items:
3668+
type: object
3669+
properties:
3670+
type_url:
3671+
type: string
3672+
value:
3673+
type: string
3674+
format: byte
3675+
parameters:
3676+
- name: denom
3677+
description: >-
3678+
denom defines the coin denomination to query all account holders
3679+
for.
3680+
in: query
3681+
required: false
3682+
type: string
3683+
- name: pagination.key
3684+
description: |-
3685+
key is a value returned in PageResponse.next_key to begin
3686+
querying the next page most efficiently. Only one of offset or key
3687+
should be set.
3688+
in: query
3689+
required: false
3690+
type: string
3691+
format: byte
3692+
- name: pagination.offset
3693+
description: >-
3694+
offset is a numeric offset that can be used when key is unavailable.
3695+
3696+
It is less efficient than using key. Only one of offset or key
3697+
should
3698+
3699+
be set.
3700+
in: query
3701+
required: false
3702+
type: string
3703+
format: uint64
3704+
- name: pagination.limit
3705+
description: >-
3706+
limit is the total number of results to be returned in the result
3707+
page.
3708+
3709+
If left empty it will default to a value to be set by each app.
3710+
in: query
3711+
required: false
3712+
type: string
3713+
format: uint64
3714+
- name: pagination.count_total
3715+
description: >-
3716+
count_total is set to true to indicate that the result set should
3717+
include
3718+
3719+
a count of the total number of items available for pagination in
3720+
UIs.
3721+
3722+
count_total is only respected when offset is used. It is ignored
3723+
when key
3724+
3725+
is set.
3726+
in: query
3727+
required: false
3728+
type: boolean
3729+
- name: pagination.reverse
3730+
description: >-
3731+
reverse is set to true if results are to be returned in the
3732+
descending order.
3733+
3734+
35713735
Since: cosmos-sdk 0.43
35723736
in: query
35733737
required: false
@@ -3787,7 +3951,7 @@ paths:
37873951
- Query
37883952
/cosmos/bank/v1beta1/denoms_metadata/{denom}:
37893953
get:
3790-
summary: DenomsMetadata queries the client metadata of a given coin denomination.
3954+
summary: DenomMetadata queries the client metadata of a given coin denomination.
37913955
operationId: DenomMetadata
37923956
responses:
37933957
'200':
@@ -3921,7 +4085,9 @@ paths:
39214085
- Query
39224086
/cosmos/bank/v1beta1/denoms_metadata_by_query_string:
39234087
get:
3924-
summary: DenomsMetadata queries the client metadata of a given coin denomination.
4088+
summary: >-
4089+
DenomMetadataByQueryString queries the client metadata of a given coin
4090+
denomination.
39254091
operationId: DenomMetadataByQueryString
39264092
responses:
39274093
'200':
@@ -40496,6 +40662,68 @@ definitions:
4049640662
Query/DenomMetadata RPC
4049740663

4049840664
method.
40665+
cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse:
40666+
type: object
40667+
properties:
40668+
denom_owners:
40669+
type: array
40670+
items:
40671+
type: object
40672+
properties:
40673+
address:
40674+
type: string
40675+
description: address defines the address that owns a particular denomination.
40676+
balance:
40677+
type: object
40678+
properties:
40679+
denom:
40680+
type: string
40681+
amount:
40682+
type: string
40683+
description: >-
40684+
Coin defines a token with a denomination and an amount.
40685+
40686+
40687+
NOTE: The amount field is an Int which implements the custom
40688+
method
40689+
40690+
signatures required by gogoproto.
40691+
description: >-
40692+
DenomOwner defines structure representing an account that owns or
40693+
holds a
40694+
40695+
particular denominated token. It contains the account address and
40696+
account
40697+
40698+
balance of the denominated token.
40699+
40700+
40701+
Since: cosmos-sdk 0.46
40702+
pagination:
40703+
description: pagination defines the pagination in the response.
40704+
type: object
40705+
properties:
40706+
next_key:
40707+
type: string
40708+
format: byte
40709+
description: |-
40710+
next_key is the key to be passed to PageRequest.key to
40711+
query the next page most efficiently. It will be empty if
40712+
there are no more results.
40713+
total:
40714+
type: string
40715+
format: uint64
40716+
title: >-
40717+
total is total number of results available if
40718+
PageRequest.count_total
40719+
40720+
was set, its value is undefined otherwise
40721+
description: >-
40722+
QueryDenomOwnersByQueryResponse defines the RPC response of a
40723+
DenomOwnersByQuery RPC query.
40724+
40725+
40726+
Since: cosmos-sdk 0.50.3
4049940727
cosmos.bank.v1beta1.QueryDenomOwnersResponse:
4050040728
type: object
4050140729
properties:

0 commit comments

Comments
 (0)