add Uniarts Chain types (#4404)

* add Uniarts Chain support

* update uniarts logo

* Updates based on Reviewer's suggestions

* fix lint
This commit is contained in:
Lay Hunt 2021-01-15 21:47:20 +08:00 committed by GitHub
parent 12fc362b6f
commit 0e975e80ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 222 additions and 4 deletions

View File

@ -27,6 +27,7 @@ import robonomics from './robonomics';
import stablePoc from './stable-poc';
import stafi from './stafi';
import subsocial from './subsocial';
import uniarts from './uniarts';
import zero from './zero';
// mapping from specName in state.getRuntimeVersion
@ -59,5 +60,6 @@ export default {
stable_poc: stablePoc,
stafi,
subsocial,
subzero: zero
subzero: zero,
uniarts: uniarts
};

View File

@ -0,0 +1,203 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
// structs need to be in order
/* eslint-disable sort-keys */
/* eslint-disable camelcase */
export default {
Keys: 'SessionKeys2',
Address: 'AccountId',
LookupSource: 'AccountId',
WorkId: 'u32',
Id: 'u32',
Name: 'Vec<u8>',
Value: 'Vec<u8>',
ReasonIndex: 'u32',
LottoIndex: 'u32',
LotteryKind: {
_enum: {
Routine: 'Null',
TreasuryFunded: 'ReasonIndex'
}
},
LottoResult: {
_enum: {
Routine: '(AccountId, Balance)',
TreasuryFunded: 'Balance'
}
},
Lottery: {
round: 'LottoIndex',
kind: 'LotteryKind',
jackpot: 'Balance',
next_ticket_id: 'u32',
players: 'BTreeMap<AccountId, bool>',
tickets: 'BTreeMap<u32, AccountId>',
result: 'Option<LottoResult>'
},
NameData: {
value: 'Value',
owner: 'AccountId',
expiration: 'Option<u32>'
},
Token: {
hash: 'H256',
symbol: 'Vec<u8>',
total_supply: 'Balance'
},
OrderType: {
_enum: ['Buy', 'Sell']
},
OrderStatus: {
_enum: ['Created', 'PartialFilled', 'Filled', 'Canceled']
},
TradePair: {
hash: 'H256',
base: 'H256',
quote: 'H256',
buy_one_price: 'Option<Price>',
sell_one_price: 'Option<Price>',
latest_matched_price: 'Option<Price>',
one_day_trade_volume: 'Option<Price>',
one_day_highest_price: 'Option<Price>',
one_day_lowest_price: 'Option<Price>'
},
Price: 'u128',
LimitOrder: {
hash: 'H256',
base: 'H256',
quote: 'H256',
owner: 'AccountId',
price: 'Price',
sell_amount: 'Balance',
buy_amount: 'Balance',
remained_sell_amount: 'Balance',
remained_buy_amount: 'Balance',
otype: 'OrderType',
status: 'OrderStatus'
},
Trade: {
hash: 'H256',
base: 'H256',
quote: 'H256',
buyer: 'AccountId',
seller: 'AccountId',
maker: 'AccountId',
taker: 'AccountId',
otype: 'OrderType',
price: 'Price',
base_amount: 'Balance',
quote_amount: 'Balance'
},
OrderLinkedItem: {
prev: 'Option<Price>',
next: 'Option<Price>',
price: 'Option<Price>',
orders: 'Vec<H256>'
},
CollectionMode: {
_enum: {
Invalid: null,
NFT: 'u32',
Fungible: 'u32',
ReFungible: '(u32, u32)'
}
},
NftItemType: {
Collection: 'u64',
Owner: 'AccountId',
Data: 'Vec<u8>',
item_hash: 'H160'
},
FungibleItemType: {
Collection: 'u64',
Owner: 'AccountId',
value: 'u128'
},
ApprovePermissions: {
approved: 'AccountId',
amount: 'u64'
},
AccessMode: {
_enum: ['Normal', 'WhiteList']
},
SaleOrder: {
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
owner: 'AccountId',
price: 'u64'
},
SaleOrderHistory: {
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
seller: 'AccountId',
buyer: 'AccountId',
price: 'u64',
buy_time: 'BlockNumber'
},
SignatureAuthentication: {
collection: 'u64',
item: 'u64',
names: 'Name',
names_owner: 'AccountId',
sign_time: 'BlockNumber',
memo: 'Vec<u8>',
expiration: 'Option<BlockNumber>'
},
Ownership: {
owner: 'AccountId',
fraction: 'u128'
},
ReFungibleItemType: {
Collection: 'u64',
Owner: 'Vec<Ownership>',
Data: 'Vec<u8>'
},
CollectionType: {
Owner: 'AccountId',
Mode: 'CollectionMode',
Access: 'u8',
DecimalPoints: 'u32',
Name: 'Vec<u16>',
Description: 'Vec<u16>',
TokenPrefix: 'Vec<u8>',
CustomDataSize: 'u32',
OffchainSchema: 'Vec<u8>',
Sponsor: 'AccountId',
UnconfirmedSponsor: 'AccountId'
},
Auction: {
id: 'u64',
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
owner: 'AccountId',
start_price: 'u64',
increment: 'u64',
current_price: 'u64',
start_time: 'BlockNumber',
end_time: 'BlockNumber'
},
BidHistory: {
auction_id: 'u64',
bidder: 'AccountId',
bid_price: 'u64',
bid_time: 'BlockNumber'
},
Pool: {
id: 'Id',
account: 'AccountId',
acc_rewards_per_share: 'Balance',
last_reward_block: 'BlockNumber',
asset_id: 'Id',
total_balance: 'Balance'
},
Staker: {
amount: 'Balance',
reward: 'Balance',
debt: 'Balance'
}
};

View File

@ -203,6 +203,13 @@ export function createTesting (t: TFunction): LinkOption[] {
providers: {
ZERO: 'wss://alphaville-0.zero.io'
}
},
{
info: 'uniarts',
text: t('rpc.uniarts', 'Uniarts', { ns: 'apps-config' }),
providers: {
Uniarts: 'wss://testnet.uniarts.me'
}
}
]);
}

View File

@ -31,6 +31,7 @@ const chainWestend = '#da68a7';
const chainGalois = '#000000';
const chainZero = '#000000';
const chainJupiter = '#7143ff';
const chainUniarts = '#b39ef7';
// based on node name
// alphabetical
@ -84,7 +85,8 @@ export const chainColors: Record<string, any> = [
['Trick', chainRoccoTrick],
['Westend', chainWestend],
['Galois', chainGalois],
['ZΞRO Alphaville', chainZero]
['ZΞRO Alphaville', chainZero],
['Uniarts', chainUniarts]
].reduce((colors, [chain, color]): Record<string, any> => ({
...colors,
[chain.toLowerCase()]: color

View File

@ -50,6 +50,7 @@ import nodeSora from './nodes/sora-substrate.svg';
import nodeStafi from './nodes/stafi.png';
import nodeSubsocial from './nodes/subsocial.svg';
import nodeSubstrate from './nodes/substrate-hexagon.svg';
import nodeUniarts from './nodes/uniarts.png';
import nodeZero from './nodes/zero.svg';
// last-resort fallback, just something empty
import emptyLogo from './empty.svg';
@ -70,7 +71,8 @@ export const chainLogos: Record<string, unknown> = [
['Rococo', chainRococo],
['Tick', chainRococoTick],
['Track', chainRococoTrack],
['Trick', chainRococoTrick]
['Trick', chainRococoTrick],
['Uniarts', nodeUniarts]
].reduce((logos, [chain, logo]): Record<string, unknown> => ({
...logos,
[(chain as string).toLowerCase()]: logo
@ -118,7 +120,8 @@ export const nodeLogos: Record<string, unknown> = [
['substrate-node', nodeSubstrate],
['Equilibrium Node', nodeEquilibrium],
['Equilibrium', nodeEquilibrium],
['SUBZΞRO', nodeZero]
['SUBZΞRO', nodeZero],
['Uniarts', nodeUniarts]
].reduce((logos, [node, logo]): Record<string, unknown> => ({
...logos,
[(node as string).toLowerCase().replace(/-/g, ' ')]: logo
@ -172,6 +175,7 @@ export const namedLogos: Record<string, unknown> = {
stafi: nodeStafi,
subsocial: nodeSubsocial,
substrate: nodeSubstrate,
uniarts: nodeUniarts,
westend: nodePolkadot,
zero: nodeZero
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB