diff --git a/packages/apps-config/src/endpoints/productionRelayKusama.ts b/packages/apps-config/src/endpoints/productionRelayKusama.ts index 1645316396..2d6d06117f 100644 --- a/packages/apps-config/src/endpoints/productionRelayKusama.ts +++ b/packages/apps-config/src/endpoints/productionRelayKusama.ts @@ -893,7 +893,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [ Stakeworld: 'wss://ksm-rpc.stakeworld.io/assethub' }, relayName: 'kusama', - teleport: [-1], + teleport: [-1, 1002, 1005, 1001, 1004], text: 'AssetHub', ui: { color: '#113911', @@ -916,7 +916,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [ Stakeworld: 'wss://ksm-rpc.stakeworld.io/bridgehub' }, relayName: 'kusama', - teleport: [-1], + teleport: [-1, 1000], text: 'BridgeHub', ui: { logo: nodesBridgeHubBlackSVG @@ -936,7 +936,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [ Stakeworld: 'wss://ksm-rpc.stakeworld.io/coretime' }, relayName: 'kusama', - teleport: [-1], + teleport: [-1, 1000], text: 'Coretime', ui: { color: '#113911', @@ -958,7 +958,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [ // Stakeworld: 'wss://ksm-rpc.stakeworld.io/encointer' }, relayName: 'kusama', - teleport: [-1], + teleport: [-1, 1000], text: 'Encointer Network', ui: { color: '#0000cc', @@ -981,7 +981,7 @@ export const prodParasKusamaCommon: EndpointOption[] = [ Stakeworld: 'wss://ksm-rpc.stakeworld.io/people' }, relayName: 'kusama', - teleport: [-1], + teleport: [-1, 1000], text: 'People', ui: { color: '#36454F', diff --git a/packages/apps-config/src/endpoints/productionRelayPolkadot.ts b/packages/apps-config/src/endpoints/productionRelayPolkadot.ts index 5e93d4ed00..69b8f8e834 100644 --- a/packages/apps-config/src/endpoints/productionRelayPolkadot.ts +++ b/packages/apps-config/src/endpoints/productionRelayPolkadot.ts @@ -909,7 +909,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [ Stakeworld: 'wss://dot-rpc.stakeworld.io/assethub' }, relayName: 'polkadot', - teleport: [-1], + teleport: [-1, 1002, 1001, 1005, 1004], text: 'AssetHub', ui: { color: '#86e62a', @@ -932,7 +932,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [ Stakeworld: 'wss://dot-rpc.stakeworld.io/bridgehub' }, relayName: 'polkadot', - teleport: [-1], + teleport: [-1, 1000], text: 'BridgeHub', ui: { logo: nodesBridgeHubSVG @@ -954,7 +954,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [ Stakeworld: 'wss://dot-rpc.stakeworld.io/collectives' }, relayName: 'polkadot', - teleport: [-1], + teleport: [-1, 1000], text: 'Collectives', ui: { color: '#e6777a', @@ -975,7 +975,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [ Stakeworld: 'wss://dot-rpc.stakeworld.io/coretime' }, relayName: 'polkadot', - teleport: [-1], + teleport: [-1, 1000], text: 'Coretime', ui: {} }, @@ -995,7 +995,7 @@ export const prodParasPolkadotCommon: EndpointOption[] = [ Stakeworld: 'wss://dot-rpc.stakeworld.io/people' }, relayName: 'polkadot', - teleport: [-1], + teleport: [-1, 1000], text: 'People', ui: { color: '#e84366', diff --git a/packages/apps-config/src/endpoints/testingRelayPaseo.ts b/packages/apps-config/src/endpoints/testingRelayPaseo.ts index 88da15d6f6..06ce166c68 100644 --- a/packages/apps-config/src/endpoints/testingRelayPaseo.ts +++ b/packages/apps-config/src/endpoints/testingRelayPaseo.ts @@ -423,7 +423,7 @@ export const testParasPaseoCommon: EndpointOption[] = [ TurboFlakes: 'wss://sys.turboflakes.io/asset-hub-paseo' }, relayName: 'paseo', - teleport: [-1], + teleport: [-1, 1002, 1111], text: 'AssetHub', ui: { color: '#77bb77', @@ -439,7 +439,7 @@ export const testParasPaseoCommon: EndpointOption[] = [ IBP2: 'wss://bridge-hub-paseo.dotters.network' }, relayName: 'paseo', - teleport: [-1], + teleport: [-1, 1000], text: 'BridgeHub', ui: { color: '#AAADD7', @@ -473,7 +473,7 @@ export const testParasPaseoCommon: EndpointOption[] = [ Parity: 'wss://testnet-passet-hub.polkadot.io' }, relayName: 'paseo', - teleport: [-1], + teleport: [-1, 1000], text: 'PAssetHub - Contracts', ui: { color: '#77bb77', diff --git a/packages/apps-config/src/endpoints/testingRelayWestend.ts b/packages/apps-config/src/endpoints/testingRelayWestend.ts index 6c79b9d966..25fd715b56 100644 --- a/packages/apps-config/src/endpoints/testingRelayWestend.ts +++ b/packages/apps-config/src/endpoints/testingRelayWestend.ts @@ -137,7 +137,7 @@ export const testParasWestendCommon: EndpointOption[] = [ // Stakeworld: 'wss://wnd-rpc.stakeworld.io/assethub' }, relayName: 'westend', - teleport: [-1], + teleport: [-1, 1002, 1001, 1005, 1004], text: 'AssetHub', ui: { color: '#77bb77', @@ -155,6 +155,7 @@ export const testParasWestendCommon: EndpointOption[] = [ Parity: 'wss://westend-bridge-hub-rpc.polkadot.io' }, relayName: 'westend', + teleport: [-1, 1000], text: 'BridgeHub', ui: { logo: nodesBridgeHubSVG @@ -170,7 +171,7 @@ export const testParasWestendCommon: EndpointOption[] = [ Parity: 'wss://westend-collectives-rpc.polkadot.io' }, relayName: 'westend', - teleport: [-1], + teleport: [-1, 1000], text: 'Collectives', ui: { color: '#e6777a', @@ -186,7 +187,7 @@ export const testParasWestendCommon: EndpointOption[] = [ Parity: 'wss://westend-coretime-rpc.polkadot.io' }, relayName: 'westend', - teleport: [-1], + teleport: [-1, 1000], text: 'Coretime', ui: { color: '#f19135' @@ -202,7 +203,7 @@ export const testParasWestendCommon: EndpointOption[] = [ Parity: 'wss://westend-people-rpc.polkadot.io' }, relayName: 'westend', - teleport: [-1], + teleport: [-1, 1000], text: 'People', ui: { color: '#ec03fc', diff --git a/packages/page-parachains/src/Teleport.tsx b/packages/page-parachains/src/Teleport.tsx index 23289146c4..e4ce8ed4f2 100644 --- a/packages/page-parachains/src/Teleport.tsx +++ b/packages/page-parachains/src/Teleport.tsx @@ -23,6 +23,36 @@ interface Props { const INVALID_PARAID = Number.MAX_SAFE_INTEGER; const XCM_LOC = ['xcm', 'xcmPallet', 'polkadotXcm']; +function getDestMultilocation (isParaTeleport: boolean | undefined, recipientParaId: number) { + if (isParaTeleport) { + if (recipientParaId === -1) { // para -> relay + return { + interior: 'Here', + parents: 1 + }; + } else { // para -> para + return { + interior: { + X1: [{ + ParaChain: recipientParaId + }] + }, + parents: 1 + }; + } + } + + // relay -> para + return { + interior: { + X1: [{ + ParaChain: recipientParaId + }] + }, + parents: 0 + }; +} + function createOption ({ paraId, text, ui }: LinkOption): Option { return { text: ( @@ -79,46 +109,30 @@ function Teleport ({ onClose }: Props): React.ReactElement | null { const params = useMemo( () => [ + { V4: getDestMultilocation(isParaTeleport, recipientParaId) }, { - V3: isParaTeleport - ? { - interior: 'Here', - parents: 1 - } - : { - interior: { - X1: { - ParaChain: recipientParaId - } - }, - parents: 0 - } - }, - { - V3: { + V4: { interior: { - X1: { + X1: [{ AccountId32: { id: api.createType('AccountId32', recipientId).toHex(), network: null } - } + }] }, parents: 0 } }, { - V3: [{ + V4: [{ fun: { Fungible: amount }, id: { - Concrete: { - interior: 'Here', - parents: isParaTeleport - ? 1 - : 0 - } + interior: 'Here', + parents: isParaTeleport + ? 1 + : 0 } }] },