@polkadot/types/types#DefinitionRpcSub TypeScript Examples

The following examples show how to use @polkadot/types/types#DefinitionRpcSub. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts    From moonbeam with GNU General Public License v3.0 5 votes vote down vote up
rpcDefinitions: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> = {
  txpool: {
    content: {
      aliasSection: "txpool",
      description:
        "The detailed information regarding Ethereum transactions that are currently in the " +
        "Substrate transaction pool.",
      params: [],
      type: "TxPoolResultContent",
    },
    inspect: {
      aliasSection: "txpool",
      description:
        "Summarized information of the Ethereum transactions that are currently in the Substrate" +
        " transaction pool.",
      params: [],
      type: "TxPoolResultInspect",
    },
    status: {
      aliasSection: "txpool",
      description:
        "The number of Ethereum transaction that are currently in the Substrate transaction pool.",
      params: [],
      type: "TxPoolResultStatus",
    },
  },
  trace: {
    filter: {
      aliasSection: "trace",
      description: "Trace Filter",
      params: [{ name: "filter", type: "FilterRequest" }],
      type: "Result<Vec<TransactionTrace>>",
    },
  },
  debug: {
    traceTransaction: {
      aliasSection: "debug",
      description: "Debug trace tx",
      params: [{ name: "transaction_hash", type: "H256" }],
      type: "Result<Vec<TransactionTrace>>",
    },
  },
  xcm: {
    injectDownwardMessage: {
      description: "Inject a downward message from the relay chain.",
      params: [{ name: "message", type: "Vec<u8>" }],
      type: "Result<()>",
    },
    injectHrmpMessage: {
      description: "Inject an HRMP message from a dedicated channel from a sibling parachain",
      params: [
        { name: "sender", type: "ParaId" },
        { name: "message", type: "Vec<u8>" },
      ],
      type: "Result<()>",
    },
  },
}
Example #2
Source File: factory.ts    From interbtc-api with Apache License 2.0 5 votes vote down vote up
export function getRPCTypes(): Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> {
    return Object.values(definitions).reduce((res, { providerRpc }) => ({ ...res, ...providerRpc }), {});
}