openapi: 3.1.0 info: title: Polkadot REST Account rc transaction API description: High-performance Rust REST API for Substrate/Polkadot blockchain data. Drop-in replacement for substrate-api-sidecar. contact: url: https://github.com/paritytech/polkadot-rest-api license: name: GPL-3.0-or-later version: 0.1.3 servers: - url: http://localhost:8080/v1 description: Localhost tags: - name: rc transaction paths: /rc/transaction: post: tags: - rc transaction summary: Submit a transaction to the relay chain node's transaction pool. description: Accepts a valid signed extrinsic for the relay chain. Replaces `/tx` from versions < v1.0.0. operationId: submitRcTransaction requestBody: $ref: '#/components/requestBodies/Transaction' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/TransactionSuccess' '400': description: failed to parse or submit transaction content: application/json: schema: $ref: '#/components/schemas/TransactionFailure' /rc/transaction/dry-run: post: tags: - rc transaction summary: Dry run an extrinsic on the relay chain. description: Use the `dryRun` call to simulate the submission of a transaction to the relay chain without executing it so that you can check for potential errors and validate the expected outcome. operationId: dryrunRcTransaction requestBody: $ref: '#/components/requestBodies/TransactionDryRun' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/TransactionDryRun' '400': description: failed to dry-run transaction content: application/json: schema: $ref: '#/components/schemas/TransactionFailure' /rc/transaction/fee-estimate: post: tags: - rc transaction summary: Receive a fee estimate for a relay chain transaction. description: 'Send a serialized transaction and receive back a naive fee estimate for the relay chain. Note: `partialFee` does not include any tips that you may add to increase a transaction''s priority. See the reference on `compute_fee`. Replaces `/tx/fee-estimate` from versions < v1.0.0. Substrate Reference: - `RuntimeDispatchInfo`: https://crates.parity.io/pallet_transaction_payment_rpc_runtime_api/struct.RuntimeDispatchInfo.html - `query_info`: https://crates.parity.io/pallet_transaction_payment/struct.Module.html#method.query_info - `compute_fee`: https://crates.parity.io/pallet_transaction_payment/struct.Module.html#method.compute_fee' operationId: feeEstimateRcTransaction requestBody: $ref: '#/components/requestBodies/Transaction' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/TransactionFeeEstimate' '400': description: fee estimation failure content: application/json: schema: $ref: '#/components/schemas/TransactionFeeEstimateFailure' /rc/transaction/material: get: tags: - rc transaction summary: Get all the relay chain network information needed to construct a transaction offline. description: Returns the material that is universal to constructing any signed transaction offline for the relay chain. Replaces `/tx/artifacts` from versions < v1.0.0. operationId: getRcTransactionMaterial parameters: - name: at in: query description: Block at which to retrieve the transaction construction material from the relay chain. required: false schema: type: string description: Block identifier, as the block height or block hash. format: unsignedInteger or $hex - name: noMeta in: query description: DEPRECATED! This is no longer supported schema: type: boolean 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 responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/TransactionMaterial' '400': description: invalid blockId supplied for at query param content: application/json: schema: $ref: '#/components/schemas/Error' /rc/transaction/material/{metadataVersion}: get: tags: - rc transaction summary: Get all the relay chain network information needed to construct a transaction offline and the version of metadata specified in `metadataVersion`. description: Returns all the materials necessary for constructing any signed transactions offline for the relay chain. operationId: getRcTransactionMaterialwithVersionedMetadata parameters: - name: metadataVersion in: path description: The version of metadata. The input is expected in a `vX` format, where `X` represents the version number (e.g. `v14`, `v15`). By default, metadata is outputted in 'json' format, unless the `metadata` query parameter is provided, in which case it can be either in 'json' or 'scale' format. required: true schema: type: string - name: at in: query description: Block at which to retrieve the transaction construction material from the relay chain. required: false schema: type: string description: Block identifier, as the block height or block hash. format: unsignedInteger or $hex - 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. schema: type: string responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/TransactionMaterial' '400': description: invalid blockId supplied for at query param content: application/json: schema: $ref: '#/components/schemas/Error' components: requestBodies: Transaction: content: application/json: schema: $ref: '#/components/schemas/Transaction' required: true TransactionDryRun: content: application/json: schema: $ref: '#/components/schemas/DryRunBody' required: true schemas: TransactionFailedToSubmit: type: object properties: code: type: number error: type: string description: Failed to submit transaction. transaction: type: string format: hex cause: type: string stack: type: string description: Error message when the node rejects the submitted transaction. TransactionFailedToParse: type: object properties: code: type: number error: type: string description: '`Failed to parse a tx.`' transaction: type: string format: hex cause: type: string stack: type: string description: Error message when Sidecar fails to parse the transaction. TransactionFailure: oneOf: - $ref: '#/components/schemas/TransactionFailedToSubmit' - $ref: '#/components/schemas/TransactionFailedToParse' WeightsV2: type: object properties: refTime: type: string description: The weight of computational time used based on some reference hardware. proofSize: type: string description: The weight of storage space used by proof of validity. TransactionDryRun: type: object properties: resultType: type: string enum: - DispatchOutcome - DispatchError - TransactionValidityError description: The result will be either a `DispatchOutcome` if the transaction is valid, a `DispatchError` if the transaction failed, or a `TransactionValidityError` if the transaction is invalid. result: oneOf: - $ref: '#/components/schemas/TransactionDispatchOutcome' - $ref: '#/components/schemas/TransactionDispatchError' - $ref: '#/components/schemas/TransactionValidityError' description: "References:\n - `PostDispatchInfo`: https://docs.rs/frame-support/38.0.0/frame_support/dispatch/struct.PostDispatchInfo.html\n - `DispatchError`: https://docs.rs/sp-runtime/39.0.1/sp_runtime/enum.DispatchError.html\n - `Error Type`: https://paritytech.github.io/polkadot-sdk/master/xcm_runtime_apis/dry_run/enum.Error.html" TransactionFeeEstimate: type: object properties: weight: $ref: '#/components/schemas/WeightsV2' description: Weights represented as WeightsV2 (two dimensional weights). When querying historical blocks that use WeightsV1, the weight will be returned as a weight key that points to a number represented as a string. class: type: string description: Extrinsic class. enum: - Normal - Operational - Mandatory partialFee: type: string description: Expected inclusion fee for the transaction. Note that the fee rate changes up to 30% in a 24 hour period and this will not be the exact fee. format: unsignedInteger description: 'Note: `partialFee` does not include any tips that you may add to increase a transaction''s priority. See [compute_fee](https://crates.parity.io/pallet_transaction_payment/struct.Module.html#method.compute_fee).' TransactionFeeEstimateFailure: type: object properties: code: type: number at: type: object properties: hash: type: string error: type: string description: Error description. transaction: type: string format: hex block: type: string description: Block hash of the block fee estimation was attempted at. cause: type: string description: Error message from the client. stack: type: string Error: type: object properties: code: type: number message: type: string stack: type: string level: type: string TransactionSuccess: type: object properties: hash: type: string description: The hash of the encoded transaction. TransactionDispatchError: type: object description: The reason why the dispatch call failed. properties: errorType: type: string enum: - Other - CannotLookup - BadOrigin - ModuleError - ConsumerRemaining - NoProviders - TooManyConsumers - TokenError - ArithmeticError - TransactionalError - Exhausted - Corruption - Unavailable - RootNotAllowed description: The type of transaction error. TransactionValidityError: type: object description: The error result from an invalid transaction submitted via the `dry-run` endpoint. properties: errorType: type: string enum: - Unimplemented - VersionedConversionFailed description: The type of transaction error, either `Unimplemented` or `VersionedConversionFailed`. Transaction: type: object properties: tx: type: string format: hex TransactionMaterial: type: object properties: at: $ref: '#/components/schemas/BlockIdentifiers' genesisHash: type: string description: The hash of the chain's genesis block. format: blockHash chainName: type: string description: The chain's name. specName: type: string description: The chain's spec. specVersion: type: string description: The spec version. Always increased in a runtime upgrade. txVersion: type: string description: The transaction version. Common `txVersion` numbers indicate that the transaction encoding format and method indices are the same. Needed for decoding in an offline environment. Adding new transactions does not change `txVersion`. metadata: type: string 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 this registry, but in other Substrate-based chains that re-launch their network without changing the `specName`, the `chainName` would be needed to create the correct registry. Substrate Reference: - `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' TransactionDispatchOutcome: type: object description: The result of a valid transaction submitted via the `dry-run` endpoint. properties: actualWeight: type: string format: unsignedInteger description: The actual weight of the transaction. paysFee: type: string format: boolean description: Whether the transaction pays a fee. BlockIdentifiers: type: object properties: hash: type: string description: The block's hash. format: hex height: type: string description: The block's height. format: unsignedInteger DryRunBody: type: object properties: at: type: string format: unsignedInteger tx: type: string format: hex senderAddress: type: string format: ss58