Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typeBundle for Cere Network #9789

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions packages/apps-config/src/api/chain/cere.ts
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 2 additions & 0 deletions packages/apps-config/src/api/chain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
78 changes: 78 additions & 0 deletions packages/apps-config/src/api/typesBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down