Skip to content

Commit

Permalink
feat: add support for the IOTA EVM (#8293)
Browse files Browse the repository at this point in the history
* feat: add support for the IOTA EVM

* feat: add iota evm chain data

* chore: rename IOTAEVM to IOTA EVM
  • Loading branch information
begonaalvarezd committed Jun 4, 2024
1 parent 7605339 commit 9d9b336
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
onClick={onViewAddressHistoryClick}
/>
{/if}
{#if $activeProfile?.network?.id === NetworkId.Shimmer || $activeProfile?.network?.id === NetworkId.ShimmerTestnet || $activeProfile?.network?.id === NetworkId.IotaTestnet}
{#if $activeProfile?.network?.id === NetworkId.Shimmer || $activeProfile?.network?.id === NetworkId.ShimmerTestnet || $activeProfile?.network?.id === NetworkId.IotaTestnet || $activeProfile?.network?.id === NetworkId.Iota}
<MenuItem icon={Icon.Transfer} title={localize('actions.withdrawFromL2')} onClick={onWithdrawFromL2Click} />
{/if}
<MenuItem icon={Icon.Customize} title={localize('actions.customizeAcount')} onClick={onCustomiseAccountClick} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export enum DestinationNetwork {
Shimmer = 'Shimmer',
ShimmerEvm = 'ShimmerEVM',
ShimmerEvmTestnet = 'ShimmerEVM Testnet',
IOTAEVM = 'IOTA EVM',
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ export const DEFAULT_CHAIN_CONFIGURATIONS: Readonly<{ [id in NetworkId]?: ChainM
'https://api.evm.testnet.shimmer.network/v1/chains/rms1ppp00k5mmd2m8my8ukkp58nd3rskw6rx8l09aj35984k74uuc5u2cywn3ex',
archiveEndpoint: 'https://archive.evm.testnet.shimmer.network',
},
[NetworkId.Iota]: {
type: ChainType.Iscp,
name: DestinationNetwork.IOTAEVM,
chainId: ChainId.IOTAEVM,
aliasAddress: 'iota1pzt3mstq6khgc3tl0mwuzk3eqddkryqnpdxmk4nr25re2466uxwm28qqxu5',
iscpEndpoint:
'https://api.evm.iotaledger.net/v1/chains/iota1pzt3mstq6khgc3tl0mwuzk3eqddkryqnpdxmk4nr25re2466uxwm28qqxu5',
archiveEndpoint: 'https://archive.evm.iotaledger.net',
},
[NetworkId.IotaTestnet]: {
type: ChainType.Iscp,
name: DestinationNetwork.IotaEvmTestnet,
Expand Down
1 change: 1 addition & 0 deletions packages/shared/lib/core/network/enums/chain-id.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export enum ChainId {
Layer1 = 0,
ShimmerEVM = 148,
ShimmerEVMTestnet = 1073,
IOTAEVM = 8822,
IotaEVMTestnet = 1075,
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const persistedProfileMigrationsMap: Record<number, (existingProfile: unknown) =
15: persistedProfileMigrationToV16,
16: persistedProfileMigrationToV17,
17: persistedProfileMigrationToV18,
18: persistedProfileMigrationToV19,
}

function persistedProfileMigrationToV4(existingProfile: unknown): void {
Expand Down Expand Up @@ -351,7 +352,6 @@ function persistedProfileMigrationToV17(existingProfile: IPersistedProfile): voi
existingProfile.network.chains = newChains
saveProfile(existingProfile)
}

/*
* Migration 18
* Change from 1 testnet to 2: Shimmer Testnet (what we knew as Testnet) & IOTA Testnet.
Expand All @@ -364,3 +364,10 @@ function persistedProfileMigrationToV18(existingProfile: IPersistedProfile): voi
}
saveProfile(existingProfile)
}

function persistedProfileMigrationToV19(existingProfile: IPersistedProfile): void {
const defaultChainConfig = DEFAULT_CHAIN_CONFIGURATIONS[existingProfile.network.id]
const newChains: IIscpChainMetadata[] = defaultChainConfig ? [defaultChainConfig] : []
existingProfile.network.chains = newChains
saveProfile(existingProfile)
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const PROFILE_VERSION = 18
export const PROFILE_VERSION = 19

0 comments on commit 9d9b336

Please sign in to comment.