Skip to content

Commit

Permalink
Update OriginTrail Parachain on polkadotjs (polkadot-js#7416)
Browse files Browse the repository at this point in the history
* Update OriginTrail Parachain on polkadotjs

* Update OriginTrail Parachain on polkadotjs
  • Loading branch information
kotlarmilos authored Apr 21, 2022
1 parent a510ed3 commit 5e7f20c
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 212 deletions.
193 changes: 6 additions & 187 deletions packages/apps-config/src/api/spec/origintrail.ts
Original file line number Diff line number Diff line change
@@ -1,203 +1,22 @@
// Copyright 2017-2022 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { DefinitionRpc, DefinitionRpcSub, OverrideBundleDefinition, OverrideBundleType } from '@polkadot/types/types';
import type { OverrideBundleDefinition } from '@polkadot/types/types';

// structs need to be in order
/* eslint-disable sort-keys */

export const rpcDefinitions: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> = {
txpool: {
content: {
aliasSection: 'txpool',
description:
'The detailed information regarding Ethereum transactions that are currently in the ' +
'Substrate transaction pool.',
params: [],
type: 'TxPoolResultContent'
},
inspect: {
aliasSection: 'txpool',
description:
'Summarized information of the Ethereum transactions that are currently in the Substrate' +
' transaction pool.',
params: [],
type: 'TxPoolResultInspect'
},
status: {
aliasSection: 'txpool',
description:
'The number of Ethereum transaction that are currently in the Substrate transaction pool.',
params: [],
type: 'TxPoolResultStatus'
}
}
};

// structs need to be in order
/* eslint-disable sort-keys */

const origintrailDefinitions = {
rpc: rpcDefinitions,
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
AccountId: 'EthereumAccountId',
AccountId32: 'H256',
AccountInfo: 'AccountInfoWithTripleRefCount',
Address: 'AccountId',
AuthorId: 'AccountId32',
Balance: 'u128',
LookupSource: 'AccountId',
Account: {
nonce: 'U256',
balance: 'u128'
},
ExtrinsicSignature: 'EthereumSignature',
RoundIndex: 'u32',
Candidate: {
id: 'AccountId',
fee: 'Perbill',
bond: 'Balance',
nominators: 'Vec<Bond>',
total: 'Balance',
state: 'CollatorStatus'
},
Nominator: {
nominations: 'Vec<Bond>',
total: 'Balance'
},
NominatorStatus: {
_enum: ['Active', { Leaving: 'RoundIndex' }]
},
Nominator2: {
nominations: 'Vec<Bond>',
revocations: 'Vec<AccountId>',
total: 'Balance',
scheduled_revocations_count: 'u32',
scheduled_revocations_total: 'Balance',
status: 'NominatorStatus'
},
Bond: {
owner: 'AccountId',
amount: 'Balance'
},
CollatorStatus: {
_enum: ['Active', 'Idle', { Leaving: 'RoundIndex' }]
},
TxPoolResultContent: {
pending: 'HashMap<H160, HashMap<U256, PoolTransaction>>',
queued: 'HashMap<H160, HashMap<U256, PoolTransaction>>'
},
TxPoolResultInspect: {
pending: 'HashMap<H160, HashMap<U256, Summary>>',
queued: 'HashMap<H160, HashMap<U256, Summary>>'
},
TxPoolResultStatus: {
pending: 'U256',
queued: 'U256'
},
Summary: 'Bytes',
PoolTransaction: {
hash: 'H256',
nonce: 'U256',
block_hash: 'Option<H256>',
block_number: 'Option<U256>',
from: 'H160',
to: 'Option<H160>',
value: 'U256',
gas_price: 'U256',
gas: 'U256',
input: 'Bytes'
},
// Staking inflation
Range: 'RangeBalance',
RangeBalance: {
min: 'Balance',
ideal: 'Balance',
max: 'Balance'
},
RangePerbill: {
min: 'Perbill',
ideal: 'Perbill',
max: 'Perbill'
},
InflationInfo: {
expect: 'RangeBalance',
annual: 'RangePerbill',
round: 'RangePerbill'
},
OrderedSet: 'Vec<Bond>',
Collator: {
id: 'AccountId',
bond: 'Balance',
nominators: 'Vec<Bond>',
total: 'Balance',
state: 'CollatorStatus'
},
Collator2: {
id: 'AccountId',
bond: 'Balance',
nominators: 'Vec<AccountId>',
top_nominators: 'Vec<Bond>',
bottom_nominators: 'Vec<Bond>',
total_counted: 'Balance',
total_backing: 'Balance',
state: 'CollatorStatus'
},
NominatorAdded: {
_enum: [{ AddedToTop: 'Balance' }, 'AddedToBottom']
},
CollatorSnapshot: {
bond: 'Balance',
nominators: 'Vec<Bond>',
total: 'Balance'
},
SystemInherentData: {
validation_data: 'PersistedValidationData',
relay_chain_state: 'StorageProof',
downward_messages: 'Vec<InboundDownwardMessage>',
horizontal_messages: 'BTreeMap<ParaId, Vec<InboundHrmpMessage>>'
},
RelayChainAccountId: 'AccountId32',
RoundInfo: {
current: 'RoundIndex',
first: 'BlockNumber',
length: 'u32'
},
RewardInfo: {
total_reward: 'Balance',
claimed_reward: 'Balance'
},
RegistrationInfo: {
account: 'AccountId',
deposit: 'Balance'
},
ParachainBondConfig: {
account: 'AccountId',
deposit: 'Balance'
},
EthereumSignature: {
r: 'H256',
s: 'H256',
v: 'U8'
},
ExitQ: {
candidates: 'Vec<AccountId>',
nominators_leaving: 'Vec<AccountId>',
candidate_schedule: 'Vec<(AccountId, RoundIndex)>',
nominator_schedule: 'Vec<(AccountId, Option<AccountId>, RoundIndex)>'
}
LookupSource: 'AccountId'
}
}
]
} as OverrideBundleDefinition;

export default origintrailDefinitions;
};

export const typesBundle = {
spec: {
'origintrail-parachain': origintrailDefinitions
}
} as OverrideBundleType;
export default definitions;
10 changes: 10 additions & 0 deletions packages/apps-config/src/endpoints/productionRelayPolkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@ export function createPolkadot (t: TFunction): EndpointOption {
Dwellir: 'wss://eden-rpc.dwellir.com'
}
},
{
info: 'origintrail-parachain',
homepage: 'https://parachain.origintrail.io',
isUnreachable: true,
text: t('rpc.polkadot.origintrail', 'OriginTrail Parachain', { ns: 'apps-config' }),
paraId: 2042,
providers: {
TraceLabs: 'wss://parachain-rpc.origin-trail.network'
}
},
{
info: 'parallel',
homepage: 'https://parallel.fi',
Expand Down
7 changes: 0 additions & 7 deletions packages/apps-config/src/endpoints/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,6 @@ export function createTesting (t: TFunction, firstOnly: boolean, withSort: boole
'Standard Protocol': 'wss://rpc.opportunity.standard.tech'
}
},
{
info: 'origintrail-parachain-testnet',
text: t('rpc.test.origintrail', 'OriginTrail Parachain Testnet', { ns: 'apps-config' }),
providers: {
'Trace Labs': 'wss://parachain-rpc.origin-trail.network'
}
},
{
info: 'pangolin',
text: t('rpc.test.pangolin', 'Pangolin', { ns: 'apps-config' }),
Expand Down
3 changes: 1 addition & 2 deletions packages/apps-config/src/settings/ethereumChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ export const ethereumChains = [
'moonbase',
'moonbeam',
'moonriver',
'moonshadow',
'origintrail-parachain'
'moonshadow'
];
6 changes: 2 additions & 4 deletions packages/apps-config/src/ui/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const chainMoonsama = '#000000';
const chainNeumann = '#A8278C';
const chainNFTMart = '#815287';
const chainNodle = '#1ab394';
const chainOriginTrail = '#FB5DEB';
const chainPangolin = '#5744ff';
const chainPangoro = '#5745de';
const chainParallel = '#ef18ac';
Expand Down Expand Up @@ -185,7 +186,6 @@ const nodeNFTMart = '#307182';
const nodeNodle = '#1ab394';
const nodeOdyssey = '#1295F0';
const nodeOpportunity = '#6143bc';
const nodeOriginTrail = '#131415';
const nodePangolin = '#5744ff';
const nodePangoro = '#5745de';
const nodeParallel = '#ef18ac';
Expand Down Expand Up @@ -358,8 +358,7 @@ export const chainColors: Record<string, string> = Object.entries({
'Nodle Testing Parachain': chainNodle,
Odyssey: nodeOdyssey,
'Opal Node': chainOpal,
'OriginTrail Parachain': nodeOriginTrail,
'OriginTrail Parachain Testnet': nodeOriginTrail,
'OriginTrail Parachain': chainOriginTrail,
Pangolin: chainPangolin,
'Pangolin Parachain': chainPangolin,
Pangoro: chainPangoro,
Expand Down Expand Up @@ -490,7 +489,6 @@ export const nodeColors = Object.entries({
'nodle chain node': nodeNodle,
'Opal Node': nodeOpal,
'Opportunity Standalone Testnet': nodeOpportunity,
'OriginTrail Parachain': nodeOriginTrail,
Pangolin: nodePangolin,
'Pangolin Parachain': nodePangolin,
Pangoro: nodePangoro,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 3 additions & 7 deletions packages/apps-config/src/ui/logos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import chainListen from './chains/listen.png';
import chainMangata from './chains/mangatax.svg';
import chainMoonsamaDevelopment from './chains/moonsama.png';
import chainOpal from './chains/opal-logo.png';
import chainOriginTrail from './chains/origintrail.png';
import chainParallel from './chains/parallel.svg';
import chainComposable from './chains/picasso.svg';
import chainQuartz from './chains/quartz.png';
Expand Down Expand Up @@ -136,7 +137,6 @@ import nodeNodle from './nodes/nodle.svg';
import oak from './nodes/oak.png';
import nodeUniqueWestend from './nodes/opal-logo.png';
import nodeOpportunity from './nodes/opportunity.png';
import nodeOriginTrail from './nodes/origintrail.png';
import nodePangolin from './nodes/pangolin.svg';
import nodePangoro from './nodes/pangoro.svg';
import nodeParallel from './nodes/parallel.svg';
Expand Down Expand Up @@ -312,8 +312,7 @@ export const chainLogos = Object.entries({
'NFTMart Testnet': nodeNFTMart,
Odyssey: nodeAresGladios,
'OPAL by UNIQUE': chainOpal,
'OriginTrail Parachain': nodeOriginTrail,
'OriginTrail Parachain Testnet': nodeOriginTrail,
'OriginTrail Parachain': chainOriginTrail,
Pangolin: nodePangolin,
Pangoro: nodePangoro,
Parallel: chainParallel,
Expand Down Expand Up @@ -488,8 +487,6 @@ export const nodeLogos = Object.entries({
'Nodle Chain Node': nodeNodle,
'Opal Node': nodeUniqueWestend,
'Opportunity Standalone Testnet': nodeOpportunity,
'OriginTrail Parachain': nodeOriginTrail,
'OriginTrail Parachain Testnet': nodeOriginTrail,
Pangolin: nodePangolin,
Pangoro: nodePangoro,
Parallel: nodeParallel,
Expand Down Expand Up @@ -689,7 +686,7 @@ export const namedLogos: Record<string, unknown> = {
odyssey: nodeAresGladios,
opal: nodeUniqueWestend,
opportunity: nodeOpportunity,
'origintrail-parachain-testnet': nodeOriginTrail,
'origintrail-parachain': chainOriginTrail,
pangolin: nodePangolin,
pangoro: nodePangoro,
parallel: chainParallel,
Expand Down Expand Up @@ -745,7 +742,6 @@ export const namedLogos: Record<string, unknown> = {
rococoMoonrock: nodeMoonrock,
rococoMoonsama: chainMoonsamaDevelopment,
rococoNodle: nodeNodle,
rococoOriginTrail: nodeOriginTrail,
rococoPangolin: nodePangolin,
rococoParami: nodeParami,
rococoPhala: nodePhala,
Expand Down
Binary file not shown.
3 changes: 1 addition & 2 deletions packages/apps/public/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,6 @@
"rpc.mandala": "Mandala (Acala Testnet, ospitato by Acala)",
"rpc.manta": "",
"rpc.nodle-arcadia": "Arcadia (Nodle Testnet, ospitato da Nodle)",
"rpc.origintrail": "",
"rpc.phoenix": "PHOENIX Protocol (PHOENIX Mashnet, ospitato da PHOENIX Protocol)",
"rpc.polkadot.darwinia": "Darwinia",
"rpc.polkadot.parity": "",
Expand Down Expand Up @@ -2135,4 +2134,4 @@
"{{threshold}}, passing": "{{threshold}}, approvato",
"{{type}} copied": "{{type}} copiato",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}} x moltiplicatore di voto, fondi bloccati per {{lock}}x = {{period}} giorni"
}
}
4 changes: 1 addition & 3 deletions packages/apps/public/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,6 @@
"rpc.rococo.manta": "",
"rpc.rococo.mathchain": "",
"rpc.rococo.moonrock": "",
"rpc.rococo.origintrail": "",
"rpc.rococo.parami": "",
"rpc.rococo.phala": "",
"rpc.rococo.phoenix": "",
Expand Down Expand Up @@ -1954,7 +1953,6 @@
"rpc.test.nodle-arcadia": "",
"rpc.test.oak": "",
"rpc.test.opportunity": "",
"rpc.test.origintrail": "",
"rpc.test.pangolin": "",
"rpc.test.pangoro": "",
"rpc.test.phala": "",
Expand Down Expand Up @@ -2214,4 +2212,4 @@
"{{threshold}}, passing": "{{threshold}}, проходит",
"{{type}} copied": "",
"{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x баланс голосования, заблокировано на {{lock}}x ({{period}} дней)"
}
}

0 comments on commit 5e7f20c

Please sign in to comment.