Add typeBundle for Cere Network (#9789)

* Add typeBundle for Cere Network

* Add auto generation of Cere Network type bundle.
This commit is contained in:
Shamilkhan 2023-08-18 00:08:49 +04:00 committed by GitHub
parent b8ed57ab37
commit 2e5b0a2213
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 163 additions and 0 deletions

View File

@ -0,0 +1,83 @@
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition } from '@polkadot/types/types';
/* eslint-disable sort-keys */
const definitions: OverrideBundleDefinition = {
types: [
{
minmax: [
266,
281
],
types: {
ChainId: 'u8',
DepositNonce: 'u64',
ResourceId: '[u8; 32]',
ProposalStatus: {
_enum: [
'Initiated',
'Approved',
'Rejected'
]
},
ProposalVotes: {
votes_for: 'Vec<AccountId>',
votes_against: 'Vec<AccountId>',
status: 'ProposalStatus',
expiry: 'BlockNumber'
},
TokenId: 'u256',
Erc721Token: {
id: 'TokenId',
metadata: 'Vec<u8>'
},
Address: 'IndicesLookupSource',
LookupSource: 'IndicesLookupSource',
AccountInfo: 'AccountInfoWithDualRefCount',
ValidatorPrefs: {
commission: 'Compact<Perbill>'
}
}
},
{
minmax: [
282,
294
],
types: {
ChainId: 'u8',
DepositNonce: 'u64',
ResourceId: '[u8; 32]',
ProposalStatus: {
_enum: [
'Initiated',
'Approved',
'Rejected'
]
},
ProposalVotes: {
votes_for: 'Vec<AccountId>',
votes_against: 'Vec<AccountId>',
status: 'ProposalStatus',
expiry: 'BlockNumber'
},
TokenId: 'u256',
Erc721Token: {
id: 'TokenId',
metadata: 'Vec<u8>'
},
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
AccountInfo: 'AccountInfoWithDualRefCount'
}
},
{
minmax: [295, null],
types: {}
}
]
};
export default definitions;

View File

@ -3,10 +3,12 @@
import type { OverrideBundleDefinition } from '@polkadot/types/types';
import cere from './cere.js';
import kilt from './kilt.js';
// NOTE: The mapping is done from chain name in system.chain
const chain: Record<string, OverrideBundleDefinition> = {
'Cere Mainnet Beta': cere,
'KILT Mashnet': kilt['KILT Mashnet'],
'KILT Peregrine': kilt['KILT Peregrine'],
'KILT Peregrine Stagenet': kilt['KILT Peregrine Stagenet'],

View File

@ -11,6 +11,84 @@ import type { OverrideBundleType } from '@polkadot/types/types';
export const typesBundle = {
"chain": {
"Cere Mainnet Beta": {
"types": [
{
"minmax": [
266,
281
],
"types": {
"ChainId": "u8",
"DepositNonce": "u64",
"ResourceId": "[u8; 32]",
"ProposalStatus": {
"_enum": [
"Initiated",
"Approved",
"Rejected"
]
},
"ProposalVotes": {
"votes_for": "Vec<AccountId>",
"votes_against": "Vec<AccountId>",
"status": "ProposalStatus",
"expiry": "BlockNumber"
},
"TokenId": "u256",
"Erc721Token": {
"id": "TokenId",
"metadata": "Vec<u8>"
},
"Address": "IndicesLookupSource",
"LookupSource": "IndicesLookupSource",
"AccountInfo": "AccountInfoWithDualRefCount",
"ValidatorPrefs": {
"commission": "Compact<Perbill>"
}
}
},
{
"minmax": [
282,
294
],
"types": {
"ChainId": "u8",
"DepositNonce": "u64",
"ResourceId": "[u8; 32]",
"ProposalStatus": {
"_enum": [
"Initiated",
"Approved",
"Rejected"
]
},
"ProposalVotes": {
"votes_for": "Vec<AccountId>",
"votes_against": "Vec<AccountId>",
"status": "ProposalStatus",
"expiry": "BlockNumber"
},
"TokenId": "u256",
"Erc721Token": {
"id": "TokenId",
"metadata": "Vec<u8>"
},
"Address": "MultiAddress",
"LookupSource": "MultiAddress",
"AccountInfo": "AccountInfoWithDualRefCount"
}
},
{
"minmax": [
295,
null
],
"types": {}
}
]
},
"KILT Mashnet": {
"runtime": {
"DidApi": [