From abca622c10cb3a2746e743510ec010526336bdcb Mon Sep 17 00:00:00 2001 From: Justin Pham Date: Wed, 5 May 2021 20:56:10 +1200 Subject: [PATCH] update BitCountry latest customType and upgrade paraId to 1008 (#5207) * update BitCountry customType and paraId * fix single quote lint * spacing by formatter --- .../src/api/spec/bitcountry-rococo.ts | 128 ++++++++++++++++++ .../apps-config/src/api/spec/bitcountry.ts | 42 ++++-- packages/apps-config/src/api/spec/index.ts | 2 + .../src/endpoints/testingRococo.ts | 3 +- 4 files changed, 162 insertions(+), 13 deletions(-) create mode 100644 packages/apps-config/src/api/spec/bitcountry-rococo.ts diff --git a/packages/apps-config/src/api/spec/bitcountry-rococo.ts b/packages/apps-config/src/api/spec/bitcountry-rococo.ts new file mode 100644 index 0000000000..7227253550 --- /dev/null +++ b/packages/apps-config/src/api/spec/bitcountry-rococo.ts @@ -0,0 +1,128 @@ +// Copyright 2017-2021 @polkadot/apps-config authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { OverrideBundleDefinition } from '@polkadot/types/types'; + +// structs need to be in order +/* eslint-disable sort-keys */ + +const definitions: OverrideBundleDefinition = { + types: [ + { + // on all versions + minmax: [0, undefined], + types: { + Address: 'MultiAddress', + LookupSource: 'MultiAddress', + AssetInfo: { + owner: 'AccountId', + data: 'AssetData' + }, + AssetData: { + name: 'Text', + description: 'Text', + properties: 'Text', + supporters: 'Vec' + }, + AuctionId: 'u64', + AuctionItem: { + asset_id: 'TokenId', + class_id: 'ClassId', + recipient: 'AccountId', + initial_amount: 'Balance', + amount: 'Balance', + start_time: 'u32', + end_time: 'u32' + }, + AuctionInfo: { + bid: 'Option<(AccountId,Balance)>', + start: 'BlockNumber', + end: 'Option' + }, + RentId: 'u64', + RentalInfo: { + owner: 'AccountId', + start: 'BlockNumber', + end: 'Option', + price_per_block: 'Balance' + }, + CountryId: 'u64', + CollectionId: 'u64', + ClassId: 'u32', + TokenId: 'u64', + ClassInfoOf: { + metadata: 'Vec', + total_issuance: 'TokenId', + owner: 'AccountId', + data: 'NftClassData' + }, + TokenInfoOf: { + metadata: 'Vec', + owner: 'AccountId', + data: 'NftAssetData' + }, + NftCollectionData: { + name: 'Vec', + owner: 'AccountId', + properties: 'Vec' + }, + TokenType: { + _enum: [ + 'Transferrable', + 'BoundToAddress' + ] + }, + NftAssetData: { + name: 'Vec', + description: 'Vec', + properties: 'Vec' + }, + NftClassData: { + deposit: 'Balance', + properties: 'Vec', + token_type: 'TokenType' + }, + NetworkId: { + _enum: { + Any: 'Null', + Named: 'Vec', + Polkadot: 'Null', + Kusama: 'Null' + } + }, + CurrencyId: { + _enum: { + Token: 'TokenSymbol' + } + }, + TokenSymbol: { + _enum: [ + 'NUUM', + 'AUSD', + 'ACA', + 'DOT' + ] + }, + CountryCurrencyId: 'u32', + CurrencyIdOf: 'CurrencyId', + BalanceIdOf: 'Balance', + ChainId: { + _enum: { + RelayChain: 'Null', + ParaChain: 'ParaId' + } + }, + XCurrencyId: { + chain_id: 'ChainId', + currency_id: 'CurrencyId' + }, + GroupCollectionId: 'u64', + ClassIdOf: 'u32', + TokenIdOf: 'u32', + SpotId: 'u32' + } + } + ] +}; + +export default definitions; diff --git a/packages/apps-config/src/api/spec/bitcountry.ts b/packages/apps-config/src/api/spec/bitcountry.ts index 3c4f85f69e..1d88c9b092 100644 --- a/packages/apps-config/src/api/spec/bitcountry.ts +++ b/packages/apps-config/src/api/spec/bitcountry.ts @@ -14,34 +14,32 @@ const definitions: OverrideBundleDefinition = { types: { Address: 'MultiAddress', LookupSource: 'MultiAddress', - Balance: 'u128', - AssetId: 'u64', - BlockNumber: 'u32', AssetInfo: { owner: 'AccountId', data: 'AssetData' }, AssetData: { - name: 'Vec', - description: 'Vec', - properties: 'Vec', + name: 'Text', + description: 'Text', + properties: 'Text', supporters: 'Vec' }, AuctionId: 'u64', AuctionItem: { - asset_id: 'AssetId', + asset_id: 'TokenId', + class_id: 'ClassId', recipient: 'AccountId', initial_amount: 'Balance', amount: 'Balance', start_time: 'u32', - ed_time: 'u32' + end_time: 'u32' }, AuctionInfo: { bid: 'Option<(AccountId,Balance)>', start: 'BlockNumber', end: 'Option' }, - RentId: 'u64 ', + RentId: 'u64', RentalInfo: { owner: 'AccountId', start: 'BlockNumber', @@ -49,11 +47,33 @@ const definitions: OverrideBundleDefinition = { price_per_block: 'Balance' }, CountryId: 'u64', + CountryCurrencyId: 'u32', CollectionId: 'u64', - CurrencyId: 'u32', + ClassId: 'u32', TokenId: 'u64', + ClassInfoOf: { + metadata: 'Vec', + total_issuance: 'TokenId', + owner: 'AccountId', + data: 'NftClassData' + }, + TokenInfoOf: { + metadata: 'Vec', + owner: 'AccountId', + data: 'NftAssetData' + }, + NftCollectionData: { + name: 'Vec', + owner: 'AccountId', + properties: 'Vec' + }, + CurrencyId: 'u32', CurrencyIdOf: 'CurrencyId', - BalanceIdOf: 'Balance' + BalanceIdOf: 'Balance', + GroupCollectionId: 'u64', + ClassIdOf: 'u32', + TokenIdOf: 'u32', + SpotId: 'u32' } } ] diff --git a/packages/apps-config/src/api/spec/index.ts b/packages/apps-config/src/api/spec/index.ts index a4a745e11c..3d4769da12 100644 --- a/packages/apps-config/src/api/spec/index.ts +++ b/packages/apps-config/src/api/spec/index.ts @@ -9,6 +9,7 @@ import aresParachain from './ares-parachain'; import bifrost from './bifrost'; import bifrostParachain from './bifrost-parachain'; import bitcountry from './bitcountry'; +import bitcountryParachain from './bitcountry-rococo'; import canvas from './canvas'; import centrifugeChain from './centrifuge-chain'; import chainx from './chainx'; @@ -96,6 +97,7 @@ const spec: Record = { bifrost: bifrost, 'bifrost-parachain': bifrostParachain, 'bitcountry-node': bitcountry, + 'bitcountry-parachain': bitcountryParachain, 'btc-parachain': polkabtc, canvas, 'centrifuge-chain': centrifugeChain, diff --git a/packages/apps-config/src/endpoints/testingRococo.ts b/packages/apps-config/src/endpoints/testingRococo.ts index f99f96477f..d30776b944 100644 --- a/packages/apps-config/src/endpoints/testingRococo.ts +++ b/packages/apps-config/src/endpoints/testingRococo.ts @@ -92,8 +92,7 @@ export function createRococo (t: TFunction): LinkOption[] { info: 'rococoBitCountry', // Needs paraId >= 1000, below that is reserved for system parachains // Update paraId to new selection, remove this flag to enable - isDisabled: true, - paraId: 8, + paraId: 1008, text: t('rpc.rococo.bitcountry', 'Bit.Country PC1', { ns: 'apps-config' }), providers: { BitCountry: 'wss://tewai-parachain.bit.country:9955'