Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions docs-v2/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/transaction/metadata-blob:
post:
tags:
- transaction
summary: Get the metadata blob for offline signers.
description: Returns the minimal metadata ("metadata blob" or "proof") needed by offline
signers to decode a transaction's signing payload, along with the metadata
hash for the CheckMetadataHash signed extension per RFC-0078.
operationId: getTransactionMetadataBlob
requestBody:
$ref: '#/components/requestBodies/TransactionMetadataBlob'
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionMetadataBlob'
"400":
description: invalid request body or metadata V15 not available
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/pallets/assets/{assetId}/asset-info:
get:
tags:
Expand Down Expand Up @@ -8406,6 +8430,74 @@ components:
- `RuntimeVersion`: https://crates.parity.io/sp_version/struct.RuntimeVersion.html
- `SignedExtension`: https://crates.parity.io/sp_runtime/traits/trait.SignedExtension.html
- FRAME Support: https://crates.parity.io/frame_support/metadata/index.html
MetadataBlobBody:
type: object
properties:
tx:
type: string
format: hex
description: Full encoded extrinsic as a hex string.
txAdditionalSigned:
type: string
format: hex
description: Optional additional signed data for the extrinsic. Used together with `tx`.
callData:
type: string
format: hex
description: Call data as hex string. Use this alongside includedInExtrinsic
and includedInSignedData instead of `tx`.
includedInExtrinsic:
type: string
format: hex
description: Signed extension data included in the extrinsic. Required when using callData.
includedInSignedData:
type: string
format: hex
description: Signed extension data included in the signature. Required when using callData.
at:
type: string
description: Block hash or number to query at. Defaults to finalized head.
format: unsignedInteger or $hex
description: >-
Request body for generating the metadata blob. You must provide either:
(1) `tx` (full extrinsic) with optional `txAdditionalSigned`, or
(2) `callData` with `includedInExtrinsic` and `includedInSignedData`.
TransactionMetadataBlob:
type: object
properties:
at:
$ref: '#/components/schemas/BlockIdentifiers'
metadataHash:
type: string
format: hex
description: The 32-byte metadata hash (hex-encoded) that should be used with
the CheckMetadataHash signed extension.
metadataBlob:
type: string
format: hex
description: The metadata blob (hex-encoded) containing the minimal metadata
required for offline signers to decode the transaction. This is a SCALE-encoded
Proof structure per RFC-0078.
specVersion:
type: number
description: The chain's spec version.
specName:
type: string
description: The chain's spec name.
base58Prefix:
type: number
description: The chain's SS58 address prefix.
decimals:
type: number
description: Number of decimals for the chain's native token.
tokenSymbol:
type: string
description: Symbol for the chain's native token.
description: >-
Response containing the metadata blob for offline signers. The metadataBlob
contains type definitions needed to decode the specific transaction, Merkle
proofs verifying these types are part of the full metadata, and extra chain
info.
TransactionPool:
type: object
properties:
Expand Down Expand Up @@ -8533,6 +8625,12 @@ components:
schema:
$ref: '#/components/schemas/DryRunBody'
required: true
TransactionMetadataBlob:
content:
application/json:
schema:
$ref: '#/components/schemas/MetadataBlobBody'
required: true
ContractMetadata:
content:
application/json:
Expand Down
112 changes: 112 additions & 0 deletions docs/src/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,44 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/transaction/metadata-blob:
post:
tags:
- transaction
summary: Get the metadata blob for offline signers.
description: >-
Returns the minimal metadata ("metadata blob" or "proof") needed by offline
signers to decode a transaction's signing payload, along with the metadata
hash for the CheckMetadataHash signed extension per RFC-0078.


The metadata blob contains type definitions needed to decode the specific
transaction, Merkle proofs verifying these types are part of the full metadata,
and extra chain info (specVersion, specName, base58Prefix, decimals, tokenSymbol).


Offline signers can use this to decode the transaction to display what the user
is signing and verify the metadata subset matches the on-chain metadata via
Merkle proofs.


Reference: RFC-0078 https://polkadot-fellows.github.io/RFCs/approved/0078-merkleized-metadata.html
operationId: getTransactionMetadataBlob
requestBody:
$ref: '#/components/requestBodies/TransactionMetadataBlob'
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionMetadataBlob'
"400":
description: invalid request body or metadata V15 not available
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/pallets/assets/{assetId}/asset-info:
get:
tags:
Expand Down Expand Up @@ -8406,6 +8444,74 @@ components:
- `RuntimeVersion`: https://crates.parity.io/sp_version/struct.RuntimeVersion.html
- `SignedExtension`: https://crates.parity.io/sp_runtime/traits/trait.SignedExtension.html
- FRAME Support: https://crates.parity.io/frame_support/metadata/index.html
MetadataBlobBody:
type: object
properties:
tx:
type: string
format: hex
description: Full encoded extrinsic as a hex string.
txAdditionalSigned:
type: string
format: hex
description: Optional additional signed data for the extrinsic. Used together with `tx`.
callData:
type: string
format: hex
description: Call data as hex string. Use this alongside includedInExtrinsic
and includedInSignedData instead of `tx`.
includedInExtrinsic:
type: string
format: hex
description: Signed extension data included in the extrinsic. Required when using callData.
includedInSignedData:
type: string
format: hex
description: Signed extension data included in the signature. Required when using callData.
at:
type: string
description: Block hash or number to query at. Defaults to finalized head.
format: unsignedInteger or $hex
description: >-
Request body for generating the metadata blob. You must provide either:
(1) `tx` (full extrinsic) with optional `txAdditionalSigned`, or
(2) `callData` with `includedInExtrinsic` and `includedInSignedData`.
TransactionMetadataBlob:
type: object
properties:
at:
$ref: '#/components/schemas/BlockIdentifiers'
metadataHash:
type: string
format: hex
description: The 32-byte metadata hash (hex-encoded) that should be used with
the CheckMetadataHash signed extension.
metadataBlob:
type: string
format: hex
description: The metadata blob (hex-encoded) containing the minimal metadata
required for offline signers to decode the transaction. This is a SCALE-encoded
Proof structure per RFC-0078.
specVersion:
type: number
description: The chain's spec version.
specName:
type: string
description: The chain's spec name.
base58Prefix:
type: number
description: The chain's SS58 address prefix.
decimals:
type: number
description: Number of decimals for the chain's native token.
tokenSymbol:
type: string
description: Symbol for the chain's native token.
description: >-
Response containing the metadata blob for offline signers. The metadataBlob
contains type definitions needed to decode the specific transaction, Merkle
proofs verifying these types are part of the full metadata, and extra chain
info.
TransactionPool:
type: object
properties:
Expand Down Expand Up @@ -8533,6 +8639,12 @@ components:
schema:
$ref: '#/components/schemas/DryRunBody'
required: true
TransactionMetadataBlob:
content:
application/json:
schema:
$ref: '#/components/schemas/MetadataBlobBody'
required: true
ContractMetadata:
content:
application/json:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"test:test-release": "yarn build:scripts && node scripts/build/runYarnPack.js"
},
"dependencies": {
"@polkadot-api/merkleize-metadata": "^1.1.29",
"@polkadot/api": "16.5.2",
"@polkadot/api-augment": "16.5.2",
"@polkadot/api-contract": "16.5.2",
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/assetHubKusamaControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -88,6 +88,7 @@ export const assetHubKusamaControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/assetHubNextWestendControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -86,6 +86,7 @@ export const assetHubNextWestendControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/assetHubPolkadotControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -88,6 +88,7 @@ export const assetHubPolkadotControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/assetHubWestendControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -87,6 +87,7 @@ export const assetHubWestendControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/defaultControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -54,6 +54,7 @@ export const defaultControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/kusamaControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -56,6 +56,7 @@ export const kusamaControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/polkadotControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -55,6 +55,7 @@ export const polkadotControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
3 changes: 2 additions & 1 deletion src/chains-config/westendControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2025 Parity Technologies (UK) Ltd.
// Copyright 2017-2026 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -55,6 +55,7 @@ export const westendControllers: ControllerConfig = {
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionMetadataBlob',
'TransactionSubmit',
],
options: {
Expand Down
Loading
Loading