Adds support for hyperbridge (#10585)

* add support for hyperbridge

* revert stray changes

* fix builds

* lint
This commit is contained in:
Web3 Philosopher 2024-05-16 23:12:37 +01:00 committed by GitHub
parent 7268a60cd0
commit 31d72e9e13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 50 additions and 1 deletions

View File

@ -44,6 +44,7 @@
"@polkadot/types": "^11.0.3",
"@polkadot/types-codec": "^11.0.3",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/wasm-util": "^7.3.2",
"@polkadot/x-fetch": "^12.6.2",
"@polkadot/x-ws": "^12.6.2",

View File

@ -5,6 +5,7 @@ import type { OverrideBundleDefinition, OverrideBundleType } from '@polkadot/typ
import equilibrium from './spec/equilibrium.js';
import genshiro from './spec/genshiro.js';
import hyperbridge from './spec/hyperbridge.js';
import interbtc from './spec/interbtc.js';
import mangata from './spec/mangata.js';
import subspace from './spec/subspace.js';
@ -17,6 +18,10 @@ const mapping: [OverrideBundleDefinition, string[]][] = [
[mangata, ['mangata', 'mangata-parachain']]
];
const specMappings: [OverrideBundleDefinition, string[]][] = [
[hyperbridge, ['nexus', 'messier', 'gargantua']]
];
export function applyDerives (typesBundle: OverrideBundleType): OverrideBundleType {
mapping.forEach(([{ derives }, chains]): void => {
chains.forEach((chain): void => {
@ -26,5 +31,13 @@ export function applyDerives (typesBundle: OverrideBundleType): OverrideBundleTy
});
});
specMappings.forEach(([spec, chains]): void => {
chains.forEach((chain): void => {
if (typesBundle.spec?.[chain]) {
typesBundle.spec[chain] = spec;
}
});
});
return typesBundle;
}

View File

@ -0,0 +1,12 @@
// Copyright 2017-2024 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition } from '@polkadot/types/types';
import { keccakAsU8a } from '@polkadot/util-crypto';
const definitions: OverrideBundleDefinition = {
hasher: keccakAsU8a
};
export default definitions;

View File

@ -56,6 +56,7 @@ import gamepower from './gamepower.js';
import genshiro from './genshiro.js';
import hanonycash from './hanonycash.js';
import hydrate from './hydrate.js';
import hyperbridge from './hyperbridge.js';
import idavoll from './idavoll.js';
import imbue from './imbue.js';
import integritee from './integritee.js';
@ -209,11 +210,13 @@ const spec: Record<string, OverrideBundleDefinition> = {
galital,
'galital-collator': galitalParachain,
gamepower,
gargantua: hyperbridge,
'hack-hydra-dx': hydrate,
halongbay: polkafoundry,
hanonycash,
heiko: parallel,
'hydra-dx': hydrate,
hyperbridge,
idavoll,
imbue,
'integritee-parachain': integritee,
@ -242,6 +245,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
'manta-node': manta,
mathchain,
'mathchain-galois': galois,
messier: hyperbridge,
moonbase: moonbeam,
moonbeam,
moonriver: moonbeam,
@ -251,6 +255,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
mythos,
neatcoin,
neuroweb,
nexus: hyperbridge,
nftmart,
'node-moonbeam': moonbeam,
'node-polkadex': polkadex,

View File

@ -57999,6 +57999,7 @@ export const typesBundle = {
}
]
},
"gargantua": {},
"hack-hydra-dx": {
"types": [
{
@ -58051,6 +58052,7 @@ export const typesBundle = {
}
]
},
"hyperbridge": {},
"halongbay": {
"types": [
{
@ -64642,6 +64644,7 @@ export const typesBundle = {
}
]
},
"messier": {},
"moonbase": {
"alias": {
"assetManager": {
@ -71650,6 +71653,7 @@ export const typesBundle = {
}
]
},
"nexus": {},
"nftmart": {
"types": [
{

View File

@ -4,7 +4,7 @@
import type { EndpointOption } from './types.js';
import { chainsFrequencyPaseoSVG, chainsLaosOmegaPNG, chainsPaseoPNG, chainsPopNetworkSVG } from '@polkadot/apps-config/ui/logos/chains';
import { nodesAssetHubSVG, nodesIntegriteeSVG, nodesKiltPNG, nodesNodleSVG } from '@polkadot/apps-config/ui/logos/nodes';
import { nodesAssetHubSVG, nodesHyperbridgeSVG, nodesIntegriteeSVG, nodesKiltPNG, nodesNodleSVG } from '@polkadot/apps-config/ui/logos/nodes';
import { PASEO_GENESIS } from '../api/constants.js';
// import { testnetParachainSVG } from '../ui/logos/nodes/index.js';
@ -44,6 +44,19 @@ export const testParasPaseo: Omit<EndpointOption, 'teleport'>[] = [
logo: chainsFrequencyPaseoSVG
}
},
{
homepage: 'https://hyperbridge.network',
info: 'Hyperbridge',
paraId: 4009,
providers: {
BlockOps: 'wss://hyperbridge-paseo-rpc.blockops.network'
},
text: 'Hyperbridge (Gargantua)',
ui: {
color: '#ED6FF1',
logo: nodesHyperbridgeSVG
}
},
{
homepage: 'https://integritee.network',
info: 'integritee',

View File

@ -1745,6 +1745,7 @@ __metadata:
"@polkadot/types": "npm:^11.0.3"
"@polkadot/types-codec": "npm:^11.0.3"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
"@polkadot/wasm-util": "npm:^7.3.2"
"@polkadot/x-fetch": "npm:^12.6.2"
"@polkadot/x-ws": "npm:^12.6.2"