Skip to content

Commit

Permalink
feat(bank): Add secondary query for bank metadata (cosmos#16852)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattverse committed Jul 27, 2023
1 parent 31eb54c commit c295832
Show file tree
Hide file tree
Showing 11 changed files with 2,226 additions and 363 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
## [Unreleased]

### Features

* (x/bank) [#16795](https://github.com/cosmos/cosmos-sdk/pull/16852) Add `DenomMetadataByQueryString` query in bank module to support metadata query by query string.
### Improvements

* (x/group, x/gov) [#17109](https://github.com/cosmos/cosmos-sdk/pull/17109) Let proposal summary be 40x longer than metadata limit.
Expand Down
4 changes: 2 additions & 2 deletions api/cosmos/bank/module/v1/module.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,515 changes: 1,250 additions & 265 deletions api/cosmos/bank/v1beta1/query.pulsar.go

Large diffs are not rendered by default.

61 changes: 50 additions & 11 deletions api/cosmos/bank/v1beta1/query_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

228 changes: 228 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3919,6 +3919,141 @@ paths:
type: string
tags:
- Query
/cosmos/bank/v1beta1/denoms_metadata_by_query_string:
get:
summary: DenomsMetadata queries the client metadata of a given coin denomination.
operationId: DenomMetadataByQueryString
responses:
'200':
description: A successful response.
schema:
type: object
properties:
metadata:
type: object
properties:
description:
type: string
denom_units:
type: array
items:
type: object
properties:
denom:
type: string
description: >-
denom represents the string name of the given denom
unit (e.g uatom).
exponent:
type: integer
format: int64
description: >-
exponent represents power of 10 exponent that one
must

raise the base_denom to in order to equal the given
DenomUnit's denom

1 denom = 10^exponent base_denom

(e.g. with a base_denom of uatom, one can create a
DenomUnit of 'atom' with

exponent = 6, thus: 1 atom = 10^6 uatom).
aliases:
type: array
items:
type: string
title: >-
aliases is a list of string aliases for the given
denom
description: |-
DenomUnit represents a struct that describes a given
denomination unit of the basic token.
title: >-
denom_units represents the list of DenomUnit's for a given
coin
base:
type: string
description: >-
base represents the base denom (should be the DenomUnit
with exponent = 0).
display:
type: string
description: |-
display indicates the suggested denom that should be
displayed in clients.
name:
type: string
description: 'Since: cosmos-sdk 0.43'
title: 'name defines the name of the token (eg: Cosmos Atom)'
symbol:
type: string
description: >-
symbol is the token symbol usually shown on exchanges (eg:
ATOM). This can

be the same as the display.


Since: cosmos-sdk 0.43
uri:
type: string
description: >-
URI to a document (on or off-chain) that contains
additional information. Optional.


Since: cosmos-sdk 0.46
uri_hash:
type: string
description: >-
URIHash is a sha256 hash of a document pointed by URI.
It's used to verify that

the document didn't change. Optional.


Since: cosmos-sdk 0.46
description: |-
Metadata represents a struct that describes
a basic token.
description: >-
QueryDenomMetadataByQueryStringResponse is the response type for
the Query/DenomMetadata RPC

method. Identical with QueryDenomMetadataResponse but receives
denom as query string in request.
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: denom
description: denom is the coin denom to query the metadata for.
in: query
required: false
type: string
tags:
- Query
/cosmos/bank/v1beta1/params:
get:
summary: Params queries the parameters of x/bank module.
Expand Down Expand Up @@ -40165,6 +40300,99 @@ definitions:
description: >-
QueryBalanceResponse is the response type for the Query/Balance RPC
method.
cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse:
type: object
properties:
metadata:
type: object
properties:
description:
type: string
denom_units:
type: array
items:
type: object
properties:
denom:
type: string
description: >-
denom represents the string name of the given denom unit
(e.g uatom).
exponent:
type: integer
format: int64
description: >-
exponent represents power of 10 exponent that one must

raise the base_denom to in order to equal the given
DenomUnit's denom

1 denom = 10^exponent base_denom

(e.g. with a base_denom of uatom, one can create a DenomUnit
of 'atom' with

exponent = 6, thus: 1 atom = 10^6 uatom).
aliases:
type: array
items:
type: string
title: aliases is a list of string aliases for the given denom
description: |-
DenomUnit represents a struct that describes a given
denomination unit of the basic token.
title: denom_units represents the list of DenomUnit's for a given coin
base:
type: string
description: >-
base represents the base denom (should be the DenomUnit with
exponent = 0).
display:
type: string
description: |-
display indicates the suggested denom that should be
displayed in clients.
name:
type: string
description: 'Since: cosmos-sdk 0.43'
title: 'name defines the name of the token (eg: Cosmos Atom)'
symbol:
type: string
description: >-
symbol is the token symbol usually shown on exchanges (eg: ATOM).
This can

be the same as the display.


Since: cosmos-sdk 0.43
uri:
type: string
description: >-
URI to a document (on or off-chain) that contains additional
information. Optional.


Since: cosmos-sdk 0.46
uri_hash:
type: string
description: >-
URIHash is a sha256 hash of a document pointed by URI. It's used
to verify that

the document didn't change. Optional.


Since: cosmos-sdk 0.46
description: |-
Metadata represents a struct that describes
a basic token.
description: >-
QueryDenomMetadataByQueryStringResponse is the response type for the
Query/DenomMetadata RPC

method. Identical with QueryDenomMetadataResponse but receives denom as
query string in request.
cosmos.bank.v1beta1.QueryDenomMetadataResponse:
type: object
properties:
Expand Down
Loading

0 comments on commit c295832

Please sign in to comment.