Split rpc.system.* definitions (#4906)

This commit is contained in:
Jaco
2022-06-08 12:28:03 +03:00
committed by GitHub
parent 89a2ff2cda
commit 7edff67240
5 changed files with 149 additions and 133 deletions
@@ -6,138 +6,10 @@
import type { Definitions } from '../../types';
import { rpc } from './rpc';
export default {
rpc: {
accountNextIndex: {
alias: ['account_nextIndex'],
description: 'Retrieves the next accountIndex as available on the node',
params: [
{
name: 'accountId',
type: 'AccountId'
}
],
type: 'Index'
},
dryRun: {
alias: ['system_dryRunAt'],
description: 'Dry run an extrinsic at a given block',
params: [
{
name: 'extrinsic',
type: 'Bytes'
},
{
name: 'at',
type: 'BlockHash',
isHistoric: true,
isOptional: true
}
],
type: 'ApplyExtrinsicResult'
},
name: {
description: 'Retrieves the node name',
params: [],
type: 'Text'
},
version: {
description: 'Retrieves the version of the node',
params: [],
type: 'Text'
},
chain: {
description: 'Retrieves the chain',
params: [],
type: 'Text'
},
chainType: {
description: 'Retrieves the chain type',
params: [],
type: 'ChainType'
},
properties: {
description: 'Get a custom set of properties as a JSON object, defined in the chain spec',
params: [],
type: 'ChainProperties'
},
health: {
description: 'Return health status of the node',
params: [],
type: 'Health'
},
localPeerId: {
description: 'Returns the base58-encoded PeerId of the node',
params: [],
type: 'Text'
},
localListenAddresses: {
description: 'The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example',
params: [],
type: 'Vec<Text>'
},
peers: {
description: 'Returns the currently connected peers',
params: [],
type: 'Vec<PeerInfo>'
},
networkState: {
alias: ['system_unstable_networkState'],
description: 'Returns current state of the network',
params: [],
type: 'NetworkState'
},
addReservedPeer: {
description: 'Adds a reserved peer',
params: [
{
name: 'peer',
type: 'Text'
}
],
type: 'Text'
},
removeReservedPeer: {
description: 'Remove a reserved peer',
params: [
{
name: 'peerId',
type: 'Text'
}
],
type: 'Text'
},
reservedPeers: {
description: 'Returns the list of reserved peers',
params: [],
type: 'Vec<Text>'
},
nodeRoles: {
description: 'Returns the roles the node is running as',
params: [],
type: 'Vec<NodeRole>'
},
syncState: {
description: 'Returns the state of the syncing of the node',
params: [],
type: 'SyncState'
},
addLogFilter: {
description: 'Adds the supplied directives to the current log filter',
params: [
{
name: 'directives',
type: 'Text'
}
],
type: 'Null'
},
resetLogFilter: {
description: 'Resets the log filter to Substrate defaults',
params: [],
type: 'Null'
}
},
rpc,
types: {
AccountInfo: 'AccountInfoWithTripleRefCount',
AccountInfoWithRefCountU8: {
+139
View File
@@ -0,0 +1,139 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// As per frontier
import type { DefinitionsRpc } from '../../types';
export const rpc: DefinitionsRpc = {
accountNextIndex: {
alias: ['account_nextIndex'],
description: 'Retrieves the next accountIndex as available on the node',
params: [
{
name: 'accountId',
type: 'AccountId'
}
],
type: 'Index'
},
addLogFilter: {
description: 'Adds the supplied directives to the current log filter',
params: [
{
name: 'directives',
type: 'Text'
}
],
type: 'Null'
},
addReservedPeer: {
description: 'Adds a reserved peer',
params: [
{
name: 'peer',
type: 'Text'
}
],
type: 'Text'
},
chain: {
description: 'Retrieves the chain',
params: [],
type: 'Text'
},
chainType: {
description: 'Retrieves the chain type',
params: [],
type: 'ChainType'
},
dryRun: {
alias: ['system_dryRunAt'],
description: 'Dry run an extrinsic at a given block',
params: [
{
name: 'extrinsic',
type: 'Bytes'
},
{
isHistoric: true,
isOptional: true,
name: 'at',
type: 'BlockHash'
}
],
type: 'ApplyExtrinsicResult'
},
health: {
description: 'Return health status of the node',
noErrorLog: true,
params: [],
type: 'Health'
},
localListenAddresses: {
description: 'The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example',
params: [],
type: 'Vec<Text>'
},
localPeerId: {
description: 'Returns the base58-encoded PeerId of the node',
params: [],
type: 'Text'
},
name: {
description: 'Retrieves the node name',
params: [],
type: 'Text'
},
networkState: {
alias: ['system_unstable_networkState'],
description: 'Returns current state of the network',
params: [],
type: 'NetworkState'
},
nodeRoles: {
description: 'Returns the roles the node is running as',
params: [],
type: 'Vec<NodeRole>'
},
peers: {
description: 'Returns the currently connected peers',
params: [],
type: 'Vec<PeerInfo>'
},
properties: {
description: 'Get a custom set of properties as a JSON object, defined in the chain spec',
params: [],
type: 'ChainProperties'
},
removeReservedPeer: {
description: 'Remove a reserved peer',
params: [
{
name: 'peerId',
type: 'Text'
}
],
type: 'Text'
},
reservedPeers: {
description: 'Returns the list of reserved peers',
params: [],
type: 'Vec<Text>'
},
resetLogFilter: {
description: 'Resets the log filter to Substrate defaults',
params: [],
type: 'Null'
},
syncState: {
description: 'Returns the state of the syncing of the node',
params: [],
type: 'SyncState'
},
version: {
description: 'Retrieves the version of the node',
params: [],
type: 'Text'
}
};
+1
View File
@@ -29,6 +29,7 @@ export interface DefinitionRpc {
description: string;
endpoint?: string;
isSigned?: boolean;
noErrorLog?: boolean;
params: DefinitionRpcParam[];
type: DefinitionTypeType;
}