Skip to content

Commit

Permalink
fix: add network type to network address object
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuditi committed Oct 20, 2022
1 parent d9d1f7b commit 023e73f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
5 changes: 3 additions & 2 deletions packages/shared/components/modals/NetworkSelector.svelte
@@ -1,5 +1,6 @@
<script lang="typescript">
import { DestinationNetwork, DESTINATION_NETWORK_ADDRESS } from '@core/network'
import { activeProfile } from '@core/profile'
import { DestinationNetwork, NETWORK_ADDRESS } from '@core/network'
import { truncateString } from '@lib/helpers'
import { Modal, Text, TextType } from 'shared/components'
import { fade } from 'svelte/transition'
Expand All @@ -26,7 +27,7 @@
>
<Text type={TextType.pre} fontSize="sm" color="gray-800">{network}</Text>
<Text type={TextType.pre} fontSize="sm" color="gray-600">
{truncateString(DESTINATION_NETWORK_ADDRESS[network], 6, 6)}
{truncateString(NETWORK_ADDRESS[$activeProfile.networkType][network], 6, 6)}
</Text>
</button>
{/each}
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion packages/shared/lib/core/network/constants/index.ts
@@ -1,6 +1,6 @@
export * from './base-token.constant'
export * from './coin-type.constant'
export * from './destination-network-address.constant'
export * from './network-address.constant'
export * from './explorer-urls.constant'
export * from './faucet-urls.constant'
export * from './network-health-colours.constant'
Expand Down
@@ -0,0 +1,12 @@
import { DestinationNetwork, NetworkType } from '../enums'

export const NETWORK_ADDRESS: Readonly<{ [key in NetworkType]?: { [key in DestinationNetwork]?: string } }> = {
[NetworkType.Mainnet]: {
[DestinationNetwork.Shimmer]: '-',
[DestinationNetwork.ShimmerEvm]: 'rms1qrut5ajyfrtgjs325kd9chwfwyyy2z3fewy4vgy0vvdtf2pr8prg5u3zwjn',
},
[NetworkType.Devnet]: {
[DestinationNetwork.Shimmer]: '-',
[DestinationNetwork.ShimmerEvm]: 'TO_DO_FILL_IN_WITH_REAL_NETWORK_ADDRESS',
},
}

0 comments on commit 023e73f

Please sign in to comment.