Update RPCs (babe, contracts) (#2074)
* Update RPCs (babe, contracts) * Babe in rpc-core
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import { AnyNumber, Codec, IExtrinsic } from '@polkadot/types/types';
|
||||
import { Option, Vec } from '@polkadot/types/codec';
|
||||
import { HashMap, Option, Vec } from '@polkadot/types/codec';
|
||||
import { Bytes, Null, StorageKey, Text, bool, u32, u64 } from '@polkadot/types/primitive';
|
||||
import { Metadata } from '@polkadot/types';
|
||||
import { EpochAuthorship } from '@polkadot/types/interfaces/babe';
|
||||
import { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import { ContractCallRequest, ContractExecResult } from '@polkadot/types/interfaces/contracts';
|
||||
import { CreatedBlock } from '@polkadot/types/interfaces/engine';
|
||||
import { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
@@ -56,6 +58,12 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
|
||||
**/
|
||||
submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<Hash>>;
|
||||
};
|
||||
babe: {
|
||||
/**
|
||||
* Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore
|
||||
**/
|
||||
epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
|
||||
};
|
||||
chain: {
|
||||
/**
|
||||
* Get header and body of a relay chain block
|
||||
@@ -95,6 +103,10 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
|
||||
* Returns the value under a specified storage key in a contract
|
||||
**/
|
||||
getStorage: AugmentedRpc<(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<Bytes>>>;
|
||||
/**
|
||||
* Returns the projected time a given contract will be able to sustain paying its rent
|
||||
**/
|
||||
rentProjection: AugmentedRpc<(address: AccountId | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<BlockNumber>>>;
|
||||
};
|
||||
engine: {
|
||||
/**
|
||||
|
||||
@@ -79,6 +79,8 @@ export default class Rpc implements RpcInterface {
|
||||
|
||||
public readonly author!: RpcInterface['author'];
|
||||
|
||||
public readonly babe!: RpcInterface['babe'];
|
||||
|
||||
public readonly chain!: RpcInterface['chain'];
|
||||
|
||||
public readonly contracts!: RpcInterface['contracts'];
|
||||
|
||||
@@ -6,7 +6,7 @@ import { BitVec, Bytes, Data, Null, StorageKey, Text, Type, U256, Unconstructabl
|
||||
import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
|
||||
import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
|
||||
import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
|
||||
import { BabeAuthorityWeight, BabeBlockWeight, BabeWeight, MaybeVrf, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondary, RawBabePreDigestSecondaryTo159, RawBabePreDigestTo159, SlotNumber, VrfData, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import { BabeAuthorityWeight, BabeBlockWeight, BabeWeight, EpochAuthorship, MaybeVrf, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondary, RawBabePreDigestSecondaryTo159, RawBabePreDigestTo159, SlotNumber, VrfData, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import { AccountData, BalanceLock, BalanceLockTo212, Reasons, ReleasesBalances, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
|
||||
import { EthereumAddress } from '@polkadot/types/interfaces/claims';
|
||||
import { MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
@@ -292,6 +292,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Compact<BabeWeight>': Compact<BabeWeight>;
|
||||
'Option<BabeWeight>': Option<BabeWeight>;
|
||||
'Vec<BabeWeight>': Vec<BabeWeight>;
|
||||
EpochAuthorship: EpochAuthorship;
|
||||
'Option<EpochAuthorship>': Option<EpochAuthorship>;
|
||||
'Vec<EpochAuthorship>': Vec<EpochAuthorship>;
|
||||
RawBabePreDigest: RawBabePreDigest;
|
||||
'Option<RawBabePreDigest>': Option<RawBabePreDigest>;
|
||||
'Vec<RawBabePreDigest>': Vec<RawBabePreDigest>;
|
||||
|
||||
@@ -5,13 +5,23 @@
|
||||
import { Definitions } from '../../types';
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
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>'
|
||||
}
|
||||
},
|
||||
types: {
|
||||
BabeAuthorityWeight: 'u64',
|
||||
BabeBlockWeight: 'u32',
|
||||
MaybeVrf: 'Option<VrfData>',
|
||||
// TODO Remove as soon as merged and metadata static updated
|
||||
BabeWeight: 'u64',
|
||||
EpochAuthorship: {
|
||||
primary: 'Vec<u64>',
|
||||
secondary: 'Vec<u64>'
|
||||
},
|
||||
RawBabePreDigest: {
|
||||
_enum: {
|
||||
Phantom: 'Null', // index starts at 1... empty slot at 0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import { Enum, Option, Struct, U8aFixed } from '@polkadot/types/codec';
|
||||
import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec';
|
||||
import { u32, u64 } from '@polkadot/types/primitive';
|
||||
|
||||
/** @name BabeAuthorityWeight */
|
||||
@@ -13,6 +13,12 @@ export interface BabeBlockWeight extends u32 {}
|
||||
/** @name BabeWeight */
|
||||
export interface BabeWeight extends u64 {}
|
||||
|
||||
/** @name EpochAuthorship */
|
||||
export interface EpochAuthorship extends Struct {
|
||||
readonly primary: Vec<u64>;
|
||||
readonly secondary: Vec<u64>;
|
||||
}
|
||||
|
||||
/** @name MaybeVrf */
|
||||
export interface MaybeVrf extends Option<VrfData> {}
|
||||
|
||||
|
||||
@@ -39,6 +39,21 @@ export default {
|
||||
}
|
||||
],
|
||||
type: 'Option<Bytes>'
|
||||
},
|
||||
rentProjection: {
|
||||
description: 'Returns the projected time a given contract will be able to sustain paying its rent',
|
||||
params: [
|
||||
{
|
||||
name: 'address',
|
||||
type: 'AccountId'
|
||||
},
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'Option<BlockNumber>'
|
||||
}
|
||||
},
|
||||
types: {
|
||||
|
||||
Reference in New Issue
Block a user