Split rpc definitions into rpc.ts files (#4989)
This commit is contained in:
@@ -6,98 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
hasKey: {
|
||||
description: 'Returns true if the keystore has private keys for the given public key and key type.',
|
||||
params: [
|
||||
{
|
||||
name: 'publicKey',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
name: 'keyType',
|
||||
type: 'Text'
|
||||
}
|
||||
],
|
||||
type: 'bool'
|
||||
},
|
||||
hasSessionKeys: {
|
||||
description: 'Returns true if the keystore has private keys for the given session public keys.',
|
||||
params: [
|
||||
{
|
||||
name: 'sessionKeys',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'bool'
|
||||
},
|
||||
removeExtrinsic: {
|
||||
description: 'Remove given extrinsic from the pool and temporarily ban it to prevent reimporting',
|
||||
params: [
|
||||
{
|
||||
name: 'bytesOrHash',
|
||||
type: 'Vec<ExtrinsicOrHash>'
|
||||
}
|
||||
],
|
||||
type: 'Vec<Hash>'
|
||||
},
|
||||
insertKey: {
|
||||
description: 'Insert a key into the keystore.',
|
||||
params: [
|
||||
{
|
||||
name: 'keyType',
|
||||
type: 'Text'
|
||||
},
|
||||
{
|
||||
name: 'suri',
|
||||
type: 'Text'
|
||||
},
|
||||
{
|
||||
name: 'publicKey',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'Bytes'
|
||||
},
|
||||
rotateKeys: {
|
||||
description: 'Generate new session keys and returns the corresponding public keys',
|
||||
params: [],
|
||||
type: 'Bytes'
|
||||
},
|
||||
pendingExtrinsics: {
|
||||
description: 'Returns all pending extrinsics, potentially grouped by sender',
|
||||
params: [],
|
||||
type: 'Vec<Extrinsic>'
|
||||
},
|
||||
submitExtrinsic: {
|
||||
isSigned: true,
|
||||
description: 'Submit a fully formatted extrinsic for block inclusion',
|
||||
params: [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Extrinsic'
|
||||
}
|
||||
],
|
||||
type: 'Hash'
|
||||
},
|
||||
submitAndWatchExtrinsic: {
|
||||
description: 'Submit and subscribe to watch an extrinsic until unsubscribed',
|
||||
isSigned: true,
|
||||
params: [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Extrinsic'
|
||||
}
|
||||
],
|
||||
pubsub: [
|
||||
'extrinsicUpdate',
|
||||
'submitAndWatchExtrinsic',
|
||||
'unwatchExtrinsic'
|
||||
],
|
||||
type: 'ExtrinsicStatus'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
ExtrinsicOrHash: {
|
||||
_enum: {
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
hasKey: {
|
||||
description: 'Returns true if the keystore has private keys for the given public key and key type.',
|
||||
params: [
|
||||
{
|
||||
name: 'publicKey',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
name: 'keyType',
|
||||
type: 'Text'
|
||||
}
|
||||
],
|
||||
type: 'bool'
|
||||
},
|
||||
hasSessionKeys: {
|
||||
description: 'Returns true if the keystore has private keys for the given session public keys.',
|
||||
params: [
|
||||
{
|
||||
name: 'sessionKeys',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'bool'
|
||||
},
|
||||
insertKey: {
|
||||
description: 'Insert a key into the keystore.',
|
||||
params: [
|
||||
{
|
||||
name: 'keyType',
|
||||
type: 'Text'
|
||||
},
|
||||
{
|
||||
name: 'suri',
|
||||
type: 'Text'
|
||||
},
|
||||
{
|
||||
name: 'publicKey',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'Bytes'
|
||||
},
|
||||
pendingExtrinsics: {
|
||||
description: 'Returns all pending extrinsics, potentially grouped by sender',
|
||||
params: [],
|
||||
type: 'Vec<Extrinsic>'
|
||||
},
|
||||
removeExtrinsic: {
|
||||
description: 'Remove given extrinsic from the pool and temporarily ban it to prevent reimporting',
|
||||
params: [
|
||||
{
|
||||
name: 'bytesOrHash',
|
||||
type: 'Vec<ExtrinsicOrHash>'
|
||||
}
|
||||
],
|
||||
type: 'Vec<Hash>'
|
||||
},
|
||||
rotateKeys: {
|
||||
description: 'Generate new session keys and returns the corresponding public keys',
|
||||
params: [],
|
||||
type: 'Bytes'
|
||||
},
|
||||
submitAndWatchExtrinsic: {
|
||||
description: 'Submit and subscribe to watch an extrinsic until unsubscribed',
|
||||
isSigned: true,
|
||||
params: [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Extrinsic'
|
||||
}
|
||||
],
|
||||
pubsub: [
|
||||
'extrinsicUpdate',
|
||||
'submitAndWatchExtrinsic',
|
||||
'unwatchExtrinsic'
|
||||
],
|
||||
type: 'ExtrinsicStatus'
|
||||
},
|
||||
submitExtrinsic: {
|
||||
description: 'Submit a fully formatted extrinsic for block inclusion',
|
||||
isSigned: true,
|
||||
params: [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Extrinsic'
|
||||
}
|
||||
],
|
||||
type: 'Hash'
|
||||
}
|
||||
};
|
||||
@@ -6,14 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
epochAuthorship: {
|
||||
description: 'Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore',
|
||||
params: [],
|
||||
type: 'HashMap<AuthorityId, EpochAuthorship>'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
AllowedSlots: {
|
||||
_enum: ['PrimarySlots', 'PrimaryAndSecondaryPlainSlots', 'PrimaryAndSecondaryVRFSlots']
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
epochAuthorship: {
|
||||
description: 'Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore',
|
||||
params: [],
|
||||
type: 'HashMap<AuthorityId, EpochAuthorship>'
|
||||
}
|
||||
};
|
||||
@@ -6,24 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
subscribeJustifications: {
|
||||
description: 'Returns the block most recently finalized by BEEFY, alongside side its justification.',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'justifications',
|
||||
'subscribeJustifications',
|
||||
'unsubscribeJustifications'
|
||||
],
|
||||
type: 'BeefySignedCommitment'
|
||||
},
|
||||
getFinalizedHead: {
|
||||
description: 'Returns hash of the latest BEEFY finalized block as seen by this client.',
|
||||
params: [],
|
||||
type: 'H256'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
BeefyCommitment: {
|
||||
payload: 'BeefyPayload',
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
getFinalizedHead: {
|
||||
description: 'Returns hash of the latest BEEFY finalized block as seen by this client.',
|
||||
params: [],
|
||||
type: 'H256'
|
||||
},
|
||||
subscribeJustifications: {
|
||||
description: 'Returns the block most recently finalized by BEEFY, alongside side its justification.',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'justifications',
|
||||
'subscribeJustifications',
|
||||
'unsubscribeJustifications'
|
||||
],
|
||||
type: 'BeefySignedCommitment'
|
||||
}
|
||||
};
|
||||
@@ -6,84 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
getHeader: {
|
||||
alias: ['chain_getHead'],
|
||||
description: 'Retrieves the header for a specific block',
|
||||
params: [
|
||||
{
|
||||
name: 'hash',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Header'
|
||||
},
|
||||
getBlock: {
|
||||
description: 'Get header and body of a relay chain block',
|
||||
params: [
|
||||
{
|
||||
name: 'hash',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'SignedBlock'
|
||||
},
|
||||
getBlockHash: {
|
||||
description: 'Get the block hash for a specific block',
|
||||
params: [
|
||||
{
|
||||
name: 'blockNumber',
|
||||
type: 'BlockNumber',
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'BlockHash'
|
||||
},
|
||||
getFinalizedHead: {
|
||||
alias: ['chain_getFinalisedHead'],
|
||||
description: 'Get hash of the last finalized block in the canon chain',
|
||||
params: [],
|
||||
type: 'BlockHash'
|
||||
},
|
||||
subscribeNewHeads: {
|
||||
alias: ['chain_unsubscribeNewHeads', 'subscribe_newHead', 'unsubscribe_newHead'],
|
||||
description: 'Retrieves the best header via subscription',
|
||||
params: [],
|
||||
// NOTE These still has the aliassed version, compatible with 1.x
|
||||
pubsub: [
|
||||
'newHead',
|
||||
'subscribeNewHead',
|
||||
'unsubscribeNewHead'
|
||||
],
|
||||
type: 'Header'
|
||||
},
|
||||
subscribeFinalizedHeads: {
|
||||
alias: ['chain_subscribeFinalisedHeads', 'chain_unsubscribeFinalisedHeads'],
|
||||
description: 'Retrieves the best finalized header via subscription',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'finalizedHead',
|
||||
'subscribeFinalizedHeads',
|
||||
'unsubscribeFinalizedHeads'
|
||||
],
|
||||
type: 'Header'
|
||||
},
|
||||
subscribeAllHeads: {
|
||||
description: 'Retrieves the newest header via subscription',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'allHead',
|
||||
'subscribeAllHeads',
|
||||
'unsubscribeAllHeads'
|
||||
],
|
||||
type: 'Header'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
BlockHash: 'Hash'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
getBlock: {
|
||||
description: 'Get header and body of a relay chain block',
|
||||
params: [
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'hash',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'SignedBlock'
|
||||
},
|
||||
getBlockHash: {
|
||||
description: 'Get the block hash for a specific block',
|
||||
params: [
|
||||
{
|
||||
isOptional: true,
|
||||
name: 'blockNumber',
|
||||
type: 'BlockNumber'
|
||||
}
|
||||
],
|
||||
type: 'BlockHash'
|
||||
},
|
||||
getFinalizedHead: {
|
||||
alias: ['chain_getFinalisedHead'],
|
||||
description: 'Get hash of the last finalized block in the canon chain',
|
||||
params: [],
|
||||
type: 'BlockHash'
|
||||
},
|
||||
getHeader: {
|
||||
alias: ['chain_getHead'],
|
||||
description: 'Retrieves the header for a specific block',
|
||||
params: [
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'hash',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Header'
|
||||
},
|
||||
subscribeAllHeads: {
|
||||
description: 'Retrieves the newest header via subscription',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'allHead',
|
||||
'subscribeAllHeads',
|
||||
'unsubscribeAllHeads'
|
||||
],
|
||||
type: 'Header'
|
||||
},
|
||||
subscribeFinalizedHeads: {
|
||||
alias: ['chain_subscribeFinalisedHeads', 'chain_unsubscribeFinalisedHeads'],
|
||||
description: 'Retrieves the best finalized header via subscription',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'finalizedHead',
|
||||
'subscribeFinalizedHeads',
|
||||
'unsubscribeFinalizedHeads'
|
||||
],
|
||||
type: 'Header'
|
||||
},
|
||||
subscribeNewHeads: {
|
||||
alias: ['chain_unsubscribeNewHeads', 'subscribe_newHead', 'unsubscribe_newHead'],
|
||||
description: 'Retrieves the best header via subscription',
|
||||
params: [],
|
||||
// NOTE These still has the aliassed version, compatible with 1.x
|
||||
pubsub: [
|
||||
'newHead',
|
||||
'subscribeNewHead',
|
||||
'unsubscribeNewHead'
|
||||
],
|
||||
type: 'Header'
|
||||
}
|
||||
};
|
||||
@@ -6,139 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
getKeys: {
|
||||
description: 'Returns the keys with prefix from a child storage, leave empty to get all the keys',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'prefix',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getKeysPaged: {
|
||||
alias: ['childstate_getKeysPagedAt'],
|
||||
description: 'Returns the keys with prefix from a child storage with pagination support',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'prefix',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'count',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'startKey',
|
||||
type: 'StorageKey',
|
||||
isOptional: true
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getStorage: {
|
||||
description: 'Returns a child storage entry at a specific block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Option<StorageData>'
|
||||
},
|
||||
getStorageEntries: {
|
||||
description: 'Returns child storage entries for multiple keys at a specific block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<Option<StorageData>>'
|
||||
},
|
||||
getStorageHash: {
|
||||
description: 'Returns the hash of a child storage entry at a block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Option<Hash>'
|
||||
},
|
||||
getStorageSize: {
|
||||
description: 'Returns the size of a child storage entry at a block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Option<u64>'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
// StorageKey extends Bytes
|
||||
PrefixedStorageKey: 'StorageKey'
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
getKeys: {
|
||||
description: 'Returns the keys with prefix from a child storage, leave empty to get all the keys',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'prefix',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'Hash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getKeysPaged: {
|
||||
alias: ['childstate_getKeysPagedAt'],
|
||||
description: 'Returns the keys with prefix from a child storage with pagination support',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'prefix',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'count',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
isOptional: true,
|
||||
name: 'startKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'Hash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getStorage: {
|
||||
description: 'Returns a child storage entry at a specific block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'Hash'
|
||||
}
|
||||
],
|
||||
type: 'Option<StorageData>'
|
||||
},
|
||||
getStorageEntries: {
|
||||
description: 'Returns child storage entries for multiple keys at a specific block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'Hash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<Option<StorageData>>'
|
||||
},
|
||||
getStorageHash: {
|
||||
description: 'Returns the hash of a child storage entry at a block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'Hash'
|
||||
}
|
||||
],
|
||||
type: 'Option<Hash>'
|
||||
},
|
||||
getStorageSize: {
|
||||
description: 'Returns the size of a child storage entry at a block state',
|
||||
params: [
|
||||
{
|
||||
name: 'childKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'Hash'
|
||||
}
|
||||
],
|
||||
type: 'Option<u64>'
|
||||
}
|
||||
};
|
||||
@@ -6,20 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
getBlockStats: {
|
||||
description: 'Reexecute the specified `block_hash` and gather statistics while doing so',
|
||||
params: [
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true
|
||||
}
|
||||
],
|
||||
type: 'Option<BlockStats>'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
BlockStats: {
|
||||
witnessLen: 'u64',
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
getBlockStats: {
|
||||
description: 'Reexecute the specified `block_hash` and gather statistics while doing so',
|
||||
params: [
|
||||
{
|
||||
isHistoric: true,
|
||||
name: 'at',
|
||||
type: 'Hash'
|
||||
}
|
||||
],
|
||||
type: 'Option<BlockStats>'
|
||||
}
|
||||
};
|
||||
@@ -6,43 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
createBlock: {
|
||||
description: 'Instructs the manual-seal authorship task to create a new block',
|
||||
params: [
|
||||
{
|
||||
name: 'createEmpty',
|
||||
type: 'bool'
|
||||
},
|
||||
{
|
||||
name: 'finalize',
|
||||
type: 'bool'
|
||||
},
|
||||
{
|
||||
name: 'parentHash',
|
||||
type: 'BlockHash',
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'CreatedBlock'
|
||||
},
|
||||
finalizeBlock: {
|
||||
description: 'Instructs the manual-seal authorship task to finalize a block',
|
||||
params: [
|
||||
{
|
||||
name: 'hash',
|
||||
type: 'BlockHash'
|
||||
},
|
||||
{
|
||||
name: 'justification',
|
||||
type: 'Justification',
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'bool'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
CreatedBlock: {
|
||||
_alias: {
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
createBlock: {
|
||||
description: 'Instructs the manual-seal authorship task to create a new block',
|
||||
params: [
|
||||
{
|
||||
name: 'createEmpty',
|
||||
type: 'bool'
|
||||
},
|
||||
{
|
||||
name: 'finalize',
|
||||
type: 'bool'
|
||||
},
|
||||
{
|
||||
isOptional: true,
|
||||
name: 'parentHash',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'CreatedBlock'
|
||||
},
|
||||
finalizeBlock: {
|
||||
description: 'Instructs the manual-seal authorship task to finalize a block',
|
||||
params: [
|
||||
{
|
||||
name: 'hash',
|
||||
type: 'BlockHash'
|
||||
},
|
||||
{
|
||||
isOptional: true,
|
||||
name: 'justification',
|
||||
type: 'Justification'
|
||||
}
|
||||
],
|
||||
type: 'bool'
|
||||
}
|
||||
};
|
||||
@@ -6,41 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
generateBatchProof: {
|
||||
description: 'Generate MMR proof for the given leaf indices.',
|
||||
params: [
|
||||
{
|
||||
name: 'leafIndices',
|
||||
type: 'Vec<u64>'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'MmrLeafProof'
|
||||
},
|
||||
generateProof: {
|
||||
description: 'Generate MMR proof for given leaf index.',
|
||||
params: [
|
||||
{
|
||||
name: 'leafIndex',
|
||||
type: 'u64'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'MmrLeafBatchProof'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
MmrLeafBatchProof: {
|
||||
blockHash: 'BlockHash',
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
generateBatchProof: {
|
||||
description: 'Generate MMR proof for the given leaf indices.',
|
||||
params: [
|
||||
{
|
||||
name: 'leafIndices',
|
||||
type: 'Vec<u64>'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'MmrLeafProof'
|
||||
},
|
||||
generateProof: {
|
||||
description: 'Generate MMR proof for given leaf index.',
|
||||
params: [
|
||||
{
|
||||
name: 'leafIndex',
|
||||
type: 'u64'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'MmrLeafBatchProof'
|
||||
}
|
||||
};
|
||||
@@ -6,41 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
localStorageSet: {
|
||||
description: 'Set offchain local storage under given key and prefix',
|
||||
params: [
|
||||
{
|
||||
name: 'kind',
|
||||
type: 'StorageKind'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
name: 'value',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'Null'
|
||||
},
|
||||
localStorageGet: {
|
||||
description: 'Get offchain local storage under given key and prefix',
|
||||
params: [
|
||||
{
|
||||
name: 'kind',
|
||||
type: 'StorageKind'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'Option<Bytes>'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
StorageKind: {
|
||||
_enum: {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
localStorageGet: {
|
||||
description: 'Get offchain local storage under given key and prefix',
|
||||
params: [
|
||||
{
|
||||
name: 'kind',
|
||||
type: 'StorageKind'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'Option<Bytes>'
|
||||
},
|
||||
localStorageSet: {
|
||||
description: 'Set offchain local storage under given key and prefix',
|
||||
params: [
|
||||
{
|
||||
name: 'kind',
|
||||
type: 'StorageKind'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
name: 'value',
|
||||
type: 'Bytes'
|
||||
}
|
||||
],
|
||||
type: 'Null'
|
||||
}
|
||||
};
|
||||
@@ -6,32 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
const QUERY_PARAMS = [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
];
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
queryInfo: {
|
||||
description: 'Retrieves the fee information for an encoded extrinsic',
|
||||
params: QUERY_PARAMS,
|
||||
type: 'RuntimeDispatchInfo'
|
||||
},
|
||||
queryFeeDetails: {
|
||||
description: 'Query the detailed fee of a given encoded extrinsic',
|
||||
params: QUERY_PARAMS,
|
||||
type: 'FeeDetails'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
FeeDetails: {
|
||||
inclusionFee: 'Option<InclusionFee>'
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
queryFeeDetails: {
|
||||
description: 'Query the detailed fee of a given encoded extrinsic',
|
||||
params: [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'FeeDetails'
|
||||
},
|
||||
queryInfo: {
|
||||
description: 'Retrieves the fee information for an encoded extrinsic',
|
||||
params: [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'RuntimeDispatchInfo'
|
||||
}
|
||||
};
|
||||
@@ -6,14 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
methods: {
|
||||
description: 'Retrieves the list of RPC methods that are exposed by the node',
|
||||
params: [],
|
||||
type: 'RpcMethods'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
RpcMethods: {
|
||||
version: 'u32',
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
methods: {
|
||||
description: 'Retrieves the list of RPC methods that are exposed by the node',
|
||||
params: [],
|
||||
type: 'RpcMethods'
|
||||
}
|
||||
};
|
||||
@@ -6,408 +6,10 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
call: {
|
||||
alias: ['state_callAt'],
|
||||
description: 'Perform a call to a builtin on the chain',
|
||||
params: [
|
||||
{
|
||||
name: 'method',
|
||||
type: 'Text'
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Bytes'
|
||||
},
|
||||
getKeys: {
|
||||
description: 'Retrieves the keys with a certain prefix',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getPairs: {
|
||||
description: 'Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)',
|
||||
params: [
|
||||
{
|
||||
name: 'prefix',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<KeyValue>'
|
||||
},
|
||||
getKeysPaged: {
|
||||
alias: ['state_getKeysPagedAt'],
|
||||
description: 'Returns the keys with prefix with pagination support.',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'count',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'startKey',
|
||||
type: 'StorageKey',
|
||||
isOptional: true
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getStorage: {
|
||||
alias: ['state_getStorageAt'],
|
||||
description: 'Retrieves the storage for a key',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'StorageData'
|
||||
},
|
||||
getStorageHash: {
|
||||
alias: ['state_getStorageHashAt'],
|
||||
description: 'Retrieves the storage hash',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Hash'
|
||||
},
|
||||
getStorageSize: {
|
||||
alias: ['state_getStorageSizeAt'],
|
||||
description: 'Retrieves the storage size',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'u64'
|
||||
},
|
||||
getChildKeys: {
|
||||
description: 'Retrieves the keys with prefix of a specific child storage',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getChildStorage: {
|
||||
description: 'Retrieves the child storage for a key',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'StorageData'
|
||||
},
|
||||
getChildStorageHash: {
|
||||
description: 'Retrieves the child storage hash',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Hash'
|
||||
},
|
||||
getChildStorageSize: {
|
||||
description: 'Retrieves the child storage size',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'u64'
|
||||
},
|
||||
getMetadata: {
|
||||
description: 'Returns the runtime metadata',
|
||||
params: [
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Metadata'
|
||||
},
|
||||
getRuntimeVersion: {
|
||||
alias: ['chain_getRuntimeVersion'],
|
||||
description: 'Get the runtime version',
|
||||
params: [
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'RuntimeVersion'
|
||||
},
|
||||
queryStorage: {
|
||||
description: 'Query historical storage entries (by key) starting from a start block',
|
||||
params: [
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
name: 'fromBlock',
|
||||
type: 'Hash'
|
||||
},
|
||||
{
|
||||
name: 'toBlock',
|
||||
type: 'BlockHash',
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageChangeSet>'
|
||||
},
|
||||
queryStorageAt: {
|
||||
description: 'Query storage entries (by key) starting at block hash given as the second parameter',
|
||||
params: [
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageChangeSet>'
|
||||
},
|
||||
getChildReadProof: {
|
||||
description: 'Returns proof of storage for child key entries at a specific block state.',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'ReadProof'
|
||||
},
|
||||
getReadProof: {
|
||||
description: 'Returns proof of storage entries at a specific block state',
|
||||
params: [
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'ReadProof'
|
||||
},
|
||||
subscribeRuntimeVersion: {
|
||||
alias: ['chain_subscribeRuntimeVersion', 'chain_unsubscribeRuntimeVersion'],
|
||||
description: 'Retrieves the runtime version via subscription',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'runtimeVersion',
|
||||
'subscribeRuntimeVersion',
|
||||
'unsubscribeRuntimeVersion'
|
||||
],
|
||||
type: 'RuntimeVersion'
|
||||
},
|
||||
subscribeStorage: {
|
||||
description: 'Subscribes to storage changes for the provided keys',
|
||||
params: [
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>',
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
pubsub: [
|
||||
'storage',
|
||||
'subscribeStorage',
|
||||
'unsubscribeStorage'
|
||||
],
|
||||
type: 'StorageChangeSet'
|
||||
},
|
||||
traceBlock: {
|
||||
description: 'Provides a way to trace the re-execution of a single block',
|
||||
params: [
|
||||
{
|
||||
name: 'block',
|
||||
type: 'Hash'
|
||||
},
|
||||
{
|
||||
name: 'targets',
|
||||
type: 'Option<Text>'
|
||||
},
|
||||
{
|
||||
name: 'storageKeys',
|
||||
type: 'Option<Text>'
|
||||
},
|
||||
{
|
||||
name: 'methods',
|
||||
type: 'Option<Text>'
|
||||
}
|
||||
],
|
||||
type: 'TraceBlockResponse'
|
||||
},
|
||||
trieMigrationStatus: {
|
||||
description: 'Check current migration state',
|
||||
params: [
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'MigrationStatusResult'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {
|
||||
ApiId: '[u8; 8]',
|
||||
BlockTrace: {
|
||||
|
||||
@@ -0,0 +1,406 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
call: {
|
||||
alias: ['state_callAt'],
|
||||
description: 'Perform a call to a builtin on the chain',
|
||||
params: [
|
||||
{
|
||||
name: 'method',
|
||||
type: 'Text'
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'Bytes'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Bytes'
|
||||
},
|
||||
getChildKeys: {
|
||||
description: 'Retrieves the keys with prefix of a specific child storage',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getChildReadProof: {
|
||||
description: 'Returns proof of storage for child key entries at a specific block state.',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'PrefixedStorageKey'
|
||||
},
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'ReadProof'
|
||||
},
|
||||
getChildStorage: {
|
||||
description: 'Retrieves the child storage for a key',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'StorageData'
|
||||
},
|
||||
getChildStorageHash: {
|
||||
description: 'Retrieves the child storage hash',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Hash'
|
||||
},
|
||||
getChildStorageSize: {
|
||||
description: 'Retrieves the child storage size',
|
||||
params: [
|
||||
{
|
||||
name: 'childStorageKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childDefinition',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'childType',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'u64'
|
||||
},
|
||||
getKeys: {
|
||||
description: 'Retrieves the keys with a certain prefix',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getKeysPaged: {
|
||||
alias: ['state_getKeysPagedAt'],
|
||||
description: 'Returns the keys with prefix with pagination support.',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
name: 'count',
|
||||
type: 'u32'
|
||||
},
|
||||
{
|
||||
isOptional: true,
|
||||
name: 'startKey',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
getMetadata: {
|
||||
description: 'Returns the runtime metadata',
|
||||
params: [
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Metadata'
|
||||
},
|
||||
getPairs: {
|
||||
description: 'Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)',
|
||||
params: [
|
||||
{
|
||||
name: 'prefix',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<KeyValue>'
|
||||
},
|
||||
getReadProof: {
|
||||
description: 'Returns proof of storage entries at a specific block state',
|
||||
params: [
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'ReadProof'
|
||||
},
|
||||
getRuntimeVersion: {
|
||||
alias: ['chain_getRuntimeVersion'],
|
||||
description: 'Get the runtime version',
|
||||
params: [
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'RuntimeVersion'
|
||||
},
|
||||
getStorage: {
|
||||
alias: ['state_getStorageAt'],
|
||||
description: 'Retrieves the storage for a key',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'StorageData'
|
||||
},
|
||||
getStorageHash: {
|
||||
alias: ['state_getStorageHashAt'],
|
||||
description: 'Retrieves the storage hash',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Hash'
|
||||
},
|
||||
getStorageSize: {
|
||||
alias: ['state_getStorageSizeAt'],
|
||||
description: 'Retrieves the storage size',
|
||||
params: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'StorageKey'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'u64'
|
||||
},
|
||||
queryStorage: {
|
||||
description: 'Query historical storage entries (by key) starting from a start block',
|
||||
params: [
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
name: 'fromBlock',
|
||||
type: 'Hash'
|
||||
},
|
||||
{
|
||||
isOptional: true,
|
||||
name: 'toBlock',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageChangeSet>'
|
||||
},
|
||||
queryStorageAt: {
|
||||
description: 'Query storage entries (by key) starting at block hash given as the second parameter',
|
||||
params: [
|
||||
{
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'Vec<StorageChangeSet>'
|
||||
},
|
||||
subscribeRuntimeVersion: {
|
||||
alias: ['chain_subscribeRuntimeVersion', 'chain_unsubscribeRuntimeVersion'],
|
||||
description: 'Retrieves the runtime version via subscription',
|
||||
params: [],
|
||||
pubsub: [
|
||||
'runtimeVersion',
|
||||
'subscribeRuntimeVersion',
|
||||
'unsubscribeRuntimeVersion'
|
||||
],
|
||||
type: 'RuntimeVersion'
|
||||
},
|
||||
subscribeStorage: {
|
||||
description: 'Subscribes to storage changes for the provided keys',
|
||||
params: [
|
||||
{
|
||||
isOptional: true,
|
||||
name: 'keys',
|
||||
type: 'Vec<StorageKey>'
|
||||
}
|
||||
],
|
||||
pubsub: [
|
||||
'storage',
|
||||
'subscribeStorage',
|
||||
'unsubscribeStorage'
|
||||
],
|
||||
type: 'StorageChangeSet'
|
||||
},
|
||||
traceBlock: {
|
||||
description: 'Provides a way to trace the re-execution of a single block',
|
||||
params: [
|
||||
{
|
||||
name: 'block',
|
||||
type: 'Hash'
|
||||
},
|
||||
{
|
||||
name: 'targets',
|
||||
type: 'Option<Text>'
|
||||
},
|
||||
{
|
||||
name: 'storageKeys',
|
||||
type: 'Option<Text>'
|
||||
},
|
||||
{
|
||||
name: 'methods',
|
||||
type: 'Option<Text>'
|
||||
}
|
||||
],
|
||||
type: 'TraceBlockResponse'
|
||||
},
|
||||
trieMigrationStatus: {
|
||||
description: 'Check current migration state',
|
||||
params: [
|
||||
{
|
||||
isHistoric: true,
|
||||
isOptional: true,
|
||||
name: 'at',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'MigrationStatusResult'
|
||||
}
|
||||
};
|
||||
@@ -6,19 +6,9 @@
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
genSyncSpec: {
|
||||
endpoint: 'sync_state_genSyncSpec',
|
||||
description: 'Returns the json-serialized chainspec running the node, with a sync state.',
|
||||
params: [
|
||||
{
|
||||
name: 'raw',
|
||||
type: 'bool'
|
||||
}
|
||||
],
|
||||
type: 'Json'
|
||||
}
|
||||
},
|
||||
rpc,
|
||||
types: {}
|
||||
} as Definitions;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsRpc } from '../../types';
|
||||
|
||||
export const rpc: DefinitionsRpc = {
|
||||
genSyncSpec: {
|
||||
description: 'Returns the json-serialized chainspec running the node, with a sync state.',
|
||||
endpoint: 'sync_state_genSyncSpec',
|
||||
params: [
|
||||
{
|
||||
name: 'raw',
|
||||
type: 'bool'
|
||||
}
|
||||
],
|
||||
type: 'Json'
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user