Skip to content

Commit

Permalink
chore: feature flag default isc chains
Browse files Browse the repository at this point in the history
  • Loading branch information
nicole-obrien committed May 6, 2024
1 parent cdd850e commit cffb38e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 44 deletions.
12 changes: 12 additions & 0 deletions packages/desktop/features/onboarding.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const onboardingFeaturesForIota: IOnboardingFeaturesForNetwork = {
enabled: false,
},
},
defaultIscChains: {
enabled: false,
},
}

const onboardingFeaturesForShimmer: IOnboardingFeaturesForNetwork = {
Expand Down Expand Up @@ -82,6 +85,9 @@ const onboardingFeaturesForShimmer: IOnboardingFeaturesForNetwork = {
enabled: true,
},
},
defaultIscChains: {
enabled: true,
},
}

const onboardingFeaturesForTestnet: IOnboardingFeaturesForNetwork = {
Expand Down Expand Up @@ -123,6 +129,9 @@ const onboardingFeaturesForTestnet: IOnboardingFeaturesForNetwork = {
enabled: true,
},
},
defaultIscChains: {
enabled: true,
},
}

const onboardingFeaturesForCustom: IOnboardingFeaturesForNetwork = {
Expand Down Expand Up @@ -164,6 +173,9 @@ const onboardingFeaturesForCustom: IOnboardingFeaturesForNetwork = {
enabled: true,
},
},
defaultIscChains: {
enabled: false,
},
}

const onboardingFeatures: OnboardingFeatures = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const EVM_BASE_TOKEN: IBaseToken = {
decimals: 18,
}

export const DEFAULT_BASE_TOKEN: Readonly<{ [id in NetworkId]?: IBaseToken }> = {
export const DEFAULT_BASE_TOKEN: Readonly<{ [id in NetworkId]: IBaseToken }> = {
[SupportedNetworkId.Iota]: IOTA_BASE_TOKEN,
[SupportedNetworkId.Shimmer]: SHIMMER_BASE_TOKEN,
[SupportedNetworkId.Testnet]: SHIMMER_BASE_TOKEN,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import features from '@features/features'
import { NetworkType, NetworkNamespace, ChainId } from '../enums'
import { IIscChainConfiguration } from '../interfaces'
import { StardustNetworkId } from '../types'
Expand All @@ -6,47 +7,53 @@ import { DEFAULT_COIN_TYPE } from './default-coin-type.constant'
import { SupportedIscNetworkId, SupportedNetworkId, SupportedStardustNetworkId } from './supported-network-id.constant'

export const DEFAULT_ISC_CHAINS_CONFIGURATIONS: Readonly<{ [id in StardustNetworkId]?: IIscChainConfiguration }> = {
[SupportedStardustNetworkId.Iota]: {
id: SupportedIscNetworkId.IotaEvm,
type: NetworkType.Isc,
name: 'IOTA EVM',
chainId: ChainId.IotaEvm,
namespace: NetworkNamespace.Evm,
baseToken: DEFAULT_BASE_TOKEN[SupportedNetworkId.IotaEvm],
coinType: DEFAULT_COIN_TYPE[SupportedNetworkId.IotaEvm],
aliasAddress:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
rpcEndpoint:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
apiEndpoint:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
explorerUrl:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
} as IIscChainConfiguration,
[SupportedStardustNetworkId.Shimmer]: {
id: SupportedIscNetworkId.ShimmerEvm,
type: NetworkType.Isc,
name: 'Shimmer EVM',
chainId: ChainId.ShimmerEvm,
namespace: NetworkNamespace.Evm,
baseToken: DEFAULT_BASE_TOKEN[SupportedNetworkId.ShimmerEVM],
coinType: DEFAULT_COIN_TYPE[SupportedNetworkId.ShimmerEvm] ?? 0,
aliasAddress: 'smr1prxvwqvwf7nru5q5xvh5thwg54zsm2y4wfnk6yk56hj3exxkg92mx20wl3s',
rpcEndpoint: 'https://json-rpc.evm.shimmer.network/',
apiEndpoint: 'https://api.evm.shimmer.network/',
explorerUrl: 'https://explorer.evm.shimmer.network/',
},
[SupportedStardustNetworkId.Testnet]: {
id: SupportedIscNetworkId.TestnetEvm,
type: NetworkType.Isc,
name: 'Testnet EVM',
chainId: ChainId.TestnetEvm,
namespace: NetworkNamespace.Evm,
baseToken: DEFAULT_BASE_TOKEN[SupportedNetworkId.TestnetEvm],
coinType: DEFAULT_COIN_TYPE[SupportedNetworkId.TestnetEvm] ?? 0,
aliasAddress: 'rms1ppp00k5mmd2m8my8ukkp58nd3rskw6rx8l09aj35984k74uuc5u2cywn3ex',
rpcEndpoint: 'https://json-rpc.evm.testnet.shimmer.network/',
apiEndpoint: 'https://api.evm.testnet.shimmer.network/',
explorerUrl: 'https://explorer.evm.testnet.shimmer.network/',
},
...(features.onboarding.iota?.defaultIscChains.enabled && {
[SupportedStardustNetworkId.Iota]: {
id: SupportedIscNetworkId.IotaEvm,
type: NetworkType.Isc,
name: 'IOTA EVM',
chainId: ChainId.IotaEvm,
namespace: NetworkNamespace.Evm,
baseToken: DEFAULT_BASE_TOKEN[SupportedNetworkId.IotaEvm],
coinType: DEFAULT_COIN_TYPE[SupportedNetworkId.IotaEvm],
aliasAddress:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
rpcEndpoint:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
apiEndpoint:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
explorerUrl:
'https://github.com/bloomwalletio/bloom-private/pull/17/files#diff-2e95221dbfb375be5e97b45bad40479c2b3f9a70efa14e66caa1b7fe37df8296',
},
}),
...(features.onboarding.shimmer?.defaultIscChains.enabled && {
[SupportedStardustNetworkId.Shimmer]: {
id: SupportedIscNetworkId.ShimmerEvm,
type: NetworkType.Isc,
name: 'Shimmer EVM',
chainId: ChainId.ShimmerEvm,
namespace: NetworkNamespace.Evm,
baseToken: DEFAULT_BASE_TOKEN[SupportedNetworkId.ShimmerEVM],
coinType: DEFAULT_COIN_TYPE[SupportedNetworkId.ShimmerEvm] ?? 0,
aliasAddress: 'smr1prxvwqvwf7nru5q5xvh5thwg54zsm2y4wfnk6yk56hj3exxkg92mx20wl3s',
rpcEndpoint: 'https://json-rpc.evm.shimmer.network/',
apiEndpoint: 'https://api.evm.shimmer.network/',
explorerUrl: 'https://explorer.evm.shimmer.network/',
},
}),
...(features.onboarding.testnet?.defaultIscChains.enabled && {
[SupportedStardustNetworkId.Testnet]: {
id: SupportedIscNetworkId.TestnetEvm,
type: NetworkType.Isc,
name: 'Testnet EVM',
chainId: ChainId.TestnetEvm,
namespace: NetworkNamespace.Evm,
baseToken: DEFAULT_BASE_TOKEN[SupportedNetworkId.TestnetEvm],
coinType: DEFAULT_COIN_TYPE[SupportedNetworkId.TestnetEvm] ?? 0,
aliasAddress: 'rms1ppp00k5mmd2m8my8ukkp58nd3rskw6rx8l09aj35984k74uuc5u2cywn3ex',
rpcEndpoint: 'https://json-rpc.evm.testnet.shimmer.network/',
apiEndpoint: 'https://api.evm.testnet.shimmer.network/',
explorerUrl: 'https://explorer.evm.testnet.shimmer.network/',
},
}),
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export interface IOnboardingFeaturesForNetwork extends IFeatureFlag {
strongholdBackup: IFeatureFlag
ledgerBackup: IFeatureFlag
}
defaultIscChains: IFeatureFlag
}

0 comments on commit cffb38e

Please sign in to comment.