@polkadot/types/types#DefinitionRpc TypeScript Examples
The following examples show how to use
@polkadot/types/types#DefinitionRpc.
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: rpcs.ts From crust-apps with Apache License 2.0 | 6 votes |
function toExt (section: string, input: Record<string, DefinitionRpc>): Record<string, DefinitionRpcExt> {
return Object.entries(input).reduce((output: Record<string, DefinitionRpcExt>, [method, def]): Record<string, DefinitionRpcExt> => {
output[method] = {
isSubscription: false,
jsonrpc: `${method}_${section}`,
method,
section,
...def
};
return output;
}, {});
}
Example #2
Source File: rpcs.ts From subscan-multisig-react with Apache License 2.0 | 6 votes |
function toExt(section: string, input: Record<string, DefinitionRpc>): Record<string, DefinitionRpcExt> {
return Object.entries(input).reduce(
(output: Record<string, DefinitionRpcExt>, [method, def]): Record<string, DefinitionRpcExt> => {
output[method] = {
isSubscription: false,
jsonrpc: `${method}_${section}`,
method,
section,
...def,
};
return output;
},
{}
);
}
Example #3
Source File: index.ts From moonbeam with GNU General Public License v3.0 | 5 votes |
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 #4
Source File: factory.ts From interbtc-api with Apache License 2.0 | 5 votes |
export function getRPCTypes(): Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> {
return Object.values(definitions).reduce((res, { providerRpc }) => ({ ...res, ...providerRpc }), {});
}