Skip to content

Commit

Permalink
docs: correct the /transaction/material docs for metadata (#1377)
Browse files Browse the repository at this point in the history
* docs: correct the `/transaction/material` docs for metadata

* Update src/controllers/transaction/TransactionMaterialController.ts

Co-authored-by: Dominique <dominique@imodworks.io>

---------

Co-authored-by: Dominique <dominique@imodworks.io>
  • Loading branch information
TarikGul and Imod7 committed Jan 11, 2024
1 parent 8eca817 commit ca163c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/dist/app.bundle.js

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions docs/src/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1049,17 +1049,17 @@ paths:
format: unsignedInteger or $hex
- name: noMeta
in: query
description: DEPRECATED! This is no longer supported
schema:
type: boolean
description: DEPRECATED! This is no longer supported
default: false
- name: metadata
in: query
description: Specifies the format of the metadata to be returned. Accepted values are
'json', and 'scale'. 'json' being the decoded metadata, and 'scale' being the SCALE encoded metadata.
When `metadata` is not inputted, the `metadata` field will be absent.
schema:
type: string
description: Specifies the format of the metadata to be returned. Accepted values are
'json', and 'scale'. 'json' being the decoded metadata, and 'scale' being the SCALE encoded metadata.
When `metadata` is not inputted, the `metadata` field will be absent.
responses:
"200":
description: successful operation
Expand Down Expand Up @@ -4236,9 +4236,7 @@ components:
does not change `txVersion`.
metadata:
type: string
description: The chain's metadata. It's default return value is hex, but may be returned in
decoded json format.
format: hex
description: The chain's metadata. It will only be present when the metadata query param is used.
description: >-
Note: `chainName`, `specName`, and `specVersion` are used to define a type registry with a set
of signed extensions and types. For Polkadot and Kusama, `chainName` is not used in defining
Expand Down
9 changes: 3 additions & 6 deletions src/controllers/transaction/TransactionMaterialController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export type MetadataOpts = 'json' | 'scale';
* GET all the network information needed to construct a transaction offline.
*
* Query
* - (Optional) `noMeta`: If true, does not return metadata hex. This is useful when metadata is not
* needed and response time is a concern. Defaults to false.
* - (Optional) `metadata`: It accepts `json`, or `scale` values. If it is not present,
* the metadata field will not be included.
* - (Optional) `at`: Block hash or number at which to query. If not provided, queries
* finalized head.
*
Expand Down Expand Up @@ -79,14 +79,11 @@ export default class TransactionMaterialController extends AbstractController<Tr
/**
* The metadata args have two options. `json`, and `scale`.
*
* @param noMeta
* @param metadata
*/
private parseMetadataArgs(metadata: unknown): MetadataOpts | false {
/**
* Checks to see if the `metadata` query param is inputted, if it isnt,
* it will default to the old behavior. This is to be removed once after
* the `noMeta` query param is fully deprecated.
* Checks to see if the `metadata` query param is inputted.
*/
if (metadata) {
switch (metadata) {
Expand Down

0 comments on commit ca163c7

Please sign in to comment.