From 27ea0ac2b1974046605cb232ef7c86fb9308f5e5 Mon Sep 17 00:00:00 2001 From: pan Date: Tue, 22 Jun 2021 16:56:37 +0800 Subject: [PATCH] fix Bifrost connect bug (#5645) * fix Bifrost connect bug * Update Bifrost Asgard node --- .../src/api/spec/bifrost-parachain.ts | 114 ++++++++++-------- .../src/endpoints/productionRelayKusama.ts | 1 - packages/apps-config/src/endpoints/testing.ts | 2 +- 3 files changed, 63 insertions(+), 54 deletions(-) diff --git a/packages/apps-config/src/api/spec/bifrost-parachain.ts b/packages/apps-config/src/api/spec/bifrost-parachain.ts index b16929eaef..57aaf61ab6 100644 --- a/packages/apps-config/src/api/spec/bifrost-parachain.ts +++ b/packages/apps-config/src/api/spec/bifrost-parachain.ts @@ -15,39 +15,39 @@ const definitions: OverrideBundleDefinition = { TokenSymbol: { _enum: { ASG: 0, - aUSD: 1, - DOT: 2, - vDOT: 3, + aUSD: 2, + DOT: 3, KSM: 4, - vKSM: 5, - ETH: 6, - vETH: 7, - EOS: 8, - vEOS: 9, - IOST: 10, - vIOST: 11 + ETH: 5 } }, CurrencyId: { _enum: { - Token: 'TokenSymbol' + Token: 'TokenSymbol', + VToken: 'TokenSymbol', + Native: 'TokenSymbol', + Stable: 'TokenSymbol', + VSToken: 'TokenSymbol', + VSBond: '(TokenSymbol, ParaId, LeasePeriod, LeasePeriod)' } }, - AmountOf: 'i128', - ChainId: { - _enum: { - RelayChain: 'Null', - ParaChain: 'ParaId' - } - }, - XCurrencyId: { - chainId: 'ChainId', - currencyId: 'Vec' - }, CurrencyIdOf: 'CurrencyId', - IsExtended: 'bool', + TAssetBalance: 'Balance', + AmountOf: 'i128', StorageVersion: 'Releases', ShareWeight: 'Balance', + OrmlAccountData: { + free: 'Balance', + reserved: 'Balance', + frozen: 'Balance' + }, + BancorPool: { + currency_id: 'CurrencyId', + token_pool: 'Balance', + vstoken_pool: 'Balance', + token_base_supply: 'Balance', + vstoken_base_supply: 'Balance' + }, PalletBalanceOf: 'Balance', BlockNumberFor: 'BlockNumber', NumberOrHex: { @@ -56,40 +56,50 @@ const definitions: OverrideBundleDefinition = { Hex: 'U256' } }, - TokenBalance: 'Balance', - TokenId: 'u32', - PairId: 'u32', - Pair: { - token_0: 'AssetId', - token_1: 'AssetId', - account: 'AccountId', - total_liquidity: 'TokenBalance', - lp_asset_id: 'AssetId' + IsExtended: 'bool', + SystemPalletId: 'PalletId', + RewardRecord: { + account_id: 'AccountId', + record_amount: 'Balance' }, - PairInfo: { - token_0: 'AssetId', - token_1: 'AssetId', - account: 'AccountId', - total_liquidity: 'TokenBalance', - holding_liquidity: 'TokenBalance', - reserve_0: 'TokenBalance', - reserve_1: 'TokenBalance', - lp_asset_id: 'AssetId' + MaxLocksOf: 'u32', + VestingInfo: { + locked: 'Balance', + per_block: 'Balance', + starting_block: 'BlockNumber' }, - AssetId: { + OrderId: 'u64', + OrderInfo: { + owner: 'AccountIdOf', + currency_sold: 'CurrencyIdOf', + amount_sold: 'BalanceOf', + currency_expected: 'CurrencyIdOf', + amount_expected: 'BalanceOf', + order_id: 'OrderId', + order_state: 'OrderState' + }, + OrderState: { + _enum: [ + 'InTrade', + 'Revoked', + 'Clinchd' + ] + }, + ZenlinkAssetId: { chain_id: 'u32', - module_index: 'u8', + asset_type: 'u8', asset_index: 'u32' }, - AssetProperty: { - _enum: { - Foreign: null, - Lp: 'LpProperty' - } - }, - LpProperty: { - token_0: 'AssetId', - token_1: 'AssetId' + ZenlinkAssetBalance: 'u128', + PairInfo: { + asset0: 'ZenlinkAssetId', + asset1: 'ZenlinkAssetId', + account: 'AccountId', + totalLiquidity: 'ZenlinkAssetBalance', + holdingLiquidity: 'ZenlinkAssetBalance', + reserve0: 'ZenlinkAssetBalance', + reserve1: 'ZenlinkAssetBalance', + lpAssetId: 'ZenlinkAssetId' } } diff --git a/packages/apps-config/src/endpoints/productionRelayKusama.ts b/packages/apps-config/src/endpoints/productionRelayKusama.ts index a13987425f..9c285ed0ef 100644 --- a/packages/apps-config/src/endpoints/productionRelayKusama.ts +++ b/packages/apps-config/src/endpoints/productionRelayKusama.ts @@ -55,7 +55,6 @@ export function createKusama (t: TFunction): EndpointOption { }, { info: 'bifrost', - isUnreachable: true, // https://github.com/polkadot-js/apps/issues/5619 (duplicated in testing networks) homepage: 'https://ksm.vtoken.io/?ref=polkadotjs', paraId: 2001, text: t('rpc.kusama.bifrost', 'Bifrost', { ns: 'apps-config' }), diff --git a/packages/apps-config/src/endpoints/testing.ts b/packages/apps-config/src/endpoints/testing.ts index 17ffc7f7c0..ee54501988 100644 --- a/packages/apps-config/src/endpoints/testing.ts +++ b/packages/apps-config/src/endpoints/testing.ts @@ -43,7 +43,7 @@ export function createTesting (t: TFunction, firstOnly?: boolean): LinkOption[] isUnreachable: true, // https://github.com/polkadot-js/apps/issues/5619 text: t('rpc.test.bifrost', 'Bifrost Asgard', { ns: 'apps-config' }), providers: { - Bifrost: 'wss://bifrost-rpc.liebi.com/ws' + Bifrost: 'wss://asgard-rpc.liebi.com/ws' } }, {