Align runtime APIs with latest Substrate (#5521)

This commit is contained in:
Jaco
2023-03-07 08:49:10 +02:00
committed by GitHub
parent 0e96488024
commit 97c7625557
17 changed files with 326 additions and 5 deletions
@@ -7,6 +7,11 @@ export const runtime: DefinitionsCall = {
BeefyApi: [
{
methods: {
beefy_genesis: {
description: 'Return the block number where BEEFY consensus is enabled/started',
params: [],
type: 'Option<BlockNumber>'
},
validator_set: {
description: 'Return the current active BEEFY validator set',
params: [],
@@ -29,6 +29,7 @@ export { default as identity } from './identity/definitions';
export { default as imOnline } from './imOnline/definitions';
export { default as lottery } from './lottery/definitions';
export { default as mmr } from './mmr/definitions';
export { default as nfts } from './nfts/definitions';
export { default as nompools } from './nompools/definitions';
export { default as offences } from './offences/definitions';
export { default as pow } from './pow/definitions';
@@ -0,0 +1,18 @@
// Copyright 2017-2023 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types';
import { runtime } from './runtime';
export default {
rpc: {},
runtime,
types: {
NftCollectionId: 'u32',
NftItemId: 'u32'
}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -0,0 +1,110 @@
// Copyright 2017-2023 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DefinitionsCall } from '../../types';
export const runtime: DefinitionsCall = {
NftsApi: [
{
methods: {
attribute: {
description: 'An attribute',
params: [
{
name: 'collection',
type: 'NftCollectionId'
},
{
name: 'item',
type: 'NftItemId'
},
{
name: 'key',
type: 'Bytes'
}
],
type: 'Option<Bytes>'
},
collection_attribute: {
description: 'A collection attribute',
params: [
{
name: 'collection',
type: 'NftCollectionId'
},
{
name: 'key',
type: 'Bytes'
}
],
type: 'Option<Bytes>'
},
collection_owner: {
description: 'A collection owner',
params: [
{
name: 'collection',
type: 'NftCollectionId'
}
],
type: 'Option<AccountId>'
},
custom_attribute: {
description: 'A custom attribute',
params: [
{
name: 'account',
type: 'AccountId'
},
{
name: 'collection',
type: 'NftCollectionId'
},
{
name: 'item',
type: 'NftItemId'
},
{
name: 'key',
type: 'Bytes'
}
],
type: 'Option<Bytes>'
},
owner: {
description: 'Collection owner',
params: [
{
name: 'collection',
type: 'NftCollectionId'
},
{
name: 'item',
type: 'NftItemId'
}
],
type: 'Option<AccountId>'
},
system_attribute: {
description: 'System attribute',
params: [
{
name: 'collection',
type: 'NftCollectionId'
},
{
name: 'item',
type: 'NftItemId'
},
{
name: 'key',
type: 'Bytes'
}
],
type: 'Option<Bytes>'
}
},
version: 1
}
]
};
@@ -0,0 +1,12 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { u32 } from '@polkadot/types-codec';
/** @name NftCollectionId */
export interface NftCollectionId extends u32 {}
/** @name NftItemId */
export interface NftItemId extends u32 {}
export type PHANTOM_NFTS = 'nfts';
@@ -14,6 +14,7 @@ export default {
types: {
NpApiError: {
_enum: ['MemberNotFound', 'OverflowInPendingRewards']
}
},
NpPoolId: 'u32'
}
} as Definitions;
@@ -7,6 +7,20 @@ export const runtime: DefinitionsCall = {
NominationPoolsApi: [
{
methods: {
balance_to_points: {
description: 'Returns the equivalent points of `new_funds` for a given pool.',
params: [
{
name: 'poolId',
type: 'NpPoolId'
},
{
name: 'newFunds',
type: 'Balance'
}
],
type: 'Balance'
},
pending_rewards: {
description: 'Returns the pending rewards for the given member.',
params: [
@@ -16,6 +30,20 @@ export const runtime: DefinitionsCall = {
}
],
type: 'Balance'
},
points_to_balance: {
description: 'Returns the equivalent balance of `points` for a given pool.',
params: [
{
name: 'poolId',
type: 'NpPoolId'
},
{
name: 'points',
type: 'Balance'
}
],
type: 'Balance'
}
},
version: 1
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Enum } from '@polkadot/types-codec';
import type { Enum, u32 } from '@polkadot/types-codec';
/** @name NpApiError */
export interface NpApiError extends Enum {
@@ -10,4 +10,7 @@ export interface NpApiError extends Enum {
readonly type: 'MemberNotFound' | 'OverflowInPendingRewards';
}
/** @name NpPoolId */
export interface NpPoolId extends u32 {}
export type PHANTOM_NOMPOOLS = 'nompools';
@@ -8,6 +8,8 @@ import type { Definitions } from '../../types';
import { objectSpread } from '@polkadot/util';
import { runtime } from './runtime';
const deprecated = {
Points: 'u32',
EraPoints: {
@@ -174,6 +176,7 @@ const phragmen = {
export default {
rpc: {},
runtime,
types: objectSpread({}, deprecated, phragmen, {
ActiveEraInfo: {
index: 'EraIndex',
@@ -0,0 +1,24 @@
// Copyright 2017-2023 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DefinitionsCall } from '../../types';
export const runtime: DefinitionsCall = {
StakingApi: [
{
methods: {
nominations_quota: {
description: 'Returns the nominations quota for a nominator with a given balance.',
params: [
{
name: 'balance',
type: 'Balance'
}
],
type: 'u32'
}
},
version: 1
}
]
};
+1
View File
@@ -38,6 +38,7 @@ export * from './imOnline/types';
export * from './lottery/types';
export * from './metadata/types';
export * from './mmr/types';
export * from './nfts/types';
export * from './nimbus/types';
export * from './nompools/types';
export * from './offchain/types';