diff --git a/packages/shared/src/lib/core/activity/utils/helper/getLayer2ActivityInformation.ts b/packages/shared/src/lib/core/activity/utils/helper/getLayer2ActivityInformation.ts index a592e56bb9..51b1c1ab48 100644 --- a/packages/shared/src/lib/core/activity/utils/helper/getLayer2ActivityInformation.ts +++ b/packages/shared/src/lib/core/activity/utils/helper/getLayer2ActivityInformation.ts @@ -1,4 +1,5 @@ -import { parseLayer2Metadata, getDestinationNetworkFromAddress } from '@core/layer-2/utils' +import { parseLayer2Metadata } from '@core/layer-2/utils' +import { getDestinationNetworkFromAddress } from '@core/layer-2/actions' import { Layer2Metadata } from '@core/layer-2/types' import { SenderInfo } from '../../types' import { SubjectType } from '@core/wallet/enums' diff --git a/packages/shared/src/lib/core/activity/utils/helper/getSubjectFromActivity.ts b/packages/shared/src/lib/core/activity/utils/helper/getSubjectFromActivity.ts index 070c904f89..fc53c3f2d1 100644 --- a/packages/shared/src/lib/core/activity/utils/helper/getSubjectFromActivity.ts +++ b/packages/shared/src/lib/core/activity/utils/helper/getSubjectFromActivity.ts @@ -1,7 +1,7 @@ import { ActivityType } from '@core/activity/enums' import { Activity } from '@core/activity/types' import { localize } from '@core/i18n' -import { getLayer2NetworkFromAddress } from '@core/layer-2/utils' +import { getLayer2NetworkFromAddress } from '@core/layer-2/actions' import { truncateString } from '@core/utils' import { SubjectType } from '@core/wallet/enums' import type { Subject } from '@core/wallet/types' diff --git a/packages/shared/src/lib/core/layer-2/utils/buildEvmTransactionData.ts b/packages/shared/src/lib/core/layer-2/actions/buildEvmTransactionData.ts similarity index 92% rename from packages/shared/src/lib/core/layer-2/utils/buildEvmTransactionData.ts rename to packages/shared/src/lib/core/layer-2/actions/buildEvmTransactionData.ts index b1e340f6d9..c985d5d505 100644 --- a/packages/shared/src/lib/core/layer-2/utils/buildEvmTransactionData.ts +++ b/packages/shared/src/lib/core/layer-2/actions/buildEvmTransactionData.ts @@ -1,6 +1,6 @@ import { Converter } from '@core/utils' import Web3 from 'web3' -import { getEvmTransactionValueFromAmount } from './getEvmTransactionValueFromAmount' +import { getEvmTransactionValueFromAmount } from '../helpers/getEvmTransactionValueFromAmount' import { GAS_LIMIT_MULTIPLIER } from '../constants' import { EvmTransactionData } from '../types' diff --git a/packages/shared/src/lib/core/layer-2/utils/buildUnwrapAssetParameters.ts b/packages/shared/src/lib/core/layer-2/actions/buildUnwrapAssetParameters.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/buildUnwrapAssetParameters.ts rename to packages/shared/src/lib/core/layer-2/actions/buildUnwrapAssetParameters.ts diff --git a/packages/shared/src/lib/core/layer-2/utils/buildUnwrapAssetTargetAddress.ts b/packages/shared/src/lib/core/layer-2/actions/buildUnwrapAssetTargetAddress.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/buildUnwrapAssetTargetAddress.ts rename to packages/shared/src/lib/core/layer-2/actions/buildUnwrapAssetTargetAddress.ts diff --git a/packages/shared/src/lib/core/layer-2/actions/estimateGasForLayer1ToLayer2Transaction.ts b/packages/shared/src/lib/core/layer-2/actions/estimateGasForLayer1ToLayer2Transaction.ts index f5d7806684..b3624d06fe 100644 --- a/packages/shared/src/lib/core/layer-2/actions/estimateGasForLayer1ToLayer2Transaction.ts +++ b/packages/shared/src/lib/core/layer-2/actions/estimateGasForLayer1ToLayer2Transaction.ts @@ -4,7 +4,7 @@ import { SendFlowParameters, SendFlowType } from '@core/wallet' import { FALLBACK_ESTIMATED_GAS, ISC_MAGIC_CONTRACT_ADDRESS } from '../constants' import { AssetType } from '../enums' import { TransferredAsset } from '../types' -import { getIscpTransferSmartContractData } from '../utils' +import { getIscpTransferSmartContractData } from './getIscpTransferSmartContractData' export async function estimateGasForLayer1ToLayer2Transaction(sendFlowParameters: SendFlowParameters): Promise { const { recipient, destinationNetworkId } = sendFlowParameters ?? {} diff --git a/packages/shared/src/lib/core/layer-2/actions/fetchSelectedAccountLayer2Balance.ts b/packages/shared/src/lib/core/layer-2/actions/fetchSelectedAccountLayer2Balance.ts index 20893e6820..83a70f49e8 100644 --- a/packages/shared/src/lib/core/layer-2/actions/fetchSelectedAccountLayer2Balance.ts +++ b/packages/shared/src/lib/core/layer-2/actions/fetchSelectedAccountLayer2Balance.ts @@ -1,9 +1,10 @@ -import { ContractType, evmAddressToAgentID, getAgentBalanceParameters, getSmartContractHexName } from '@core/layer-2' +import { ContractType } from '@core/layer-2' import { IChain, getNetwork } from '@core/network' import { ISC_MAGIC_CONTRACT_ADDRESS } from '../constants' import { Converter } from '@core/utils/convert' import { TOKEN_ID_BYTE_LENGTH } from '@core/token/constants' import { setLayer2AccountBalanceForChain } from '../stores' +import { evmAddressToAgentId, getAgentBalanceParameters, getSmartContractHexName } from '../helpers' import { getActiveProfile } from '@core/profile/stores' import { IAccountState } from '@core/account' import { calculateAndAddPersistedBalanceChange } from '@core/activity/actions' @@ -58,7 +59,7 @@ async function getLayer2NativeTokenBalancesForAddress( ): Promise<{ balance: number; tokenId: string }[]> { const accountsCoreContract = getSmartContractHexName('accounts') const getBalanceFunc = getSmartContractHexName('balance') - const agentID = evmAddressToAgentID(evmAddress) + const agentID = evmAddressToAgentId(evmAddress) const parameters = getAgentBalanceParameters(agentID) try { const contract = chain.getContract(ContractType.IscMagic, ISC_MAGIC_CONTRACT_ADDRESS) diff --git a/packages/shared/src/lib/core/layer-2/utils/getDestinationNetworkFromAddress.ts b/packages/shared/src/lib/core/layer-2/actions/getDestinationNetworkFromAddress.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/getDestinationNetworkFromAddress.ts rename to packages/shared/src/lib/core/layer-2/actions/getDestinationNetworkFromAddress.ts diff --git a/packages/shared/src/lib/core/layer-2/actions/getGasFeesForLayer1ToLayer2Transaction.ts b/packages/shared/src/lib/core/layer-2/actions/getGasFeesForLayer1ToLayer2Transaction.ts index 524187855e..ddae720aad 100644 --- a/packages/shared/src/lib/core/layer-2/actions/getGasFeesForLayer1ToLayer2Transaction.ts +++ b/packages/shared/src/lib/core/layer-2/actions/getGasFeesForLayer1ToLayer2Transaction.ts @@ -1,7 +1,7 @@ import { SendFlowParameters } from '@core/wallet' import { BigIntLike } from '@ethereumjs/util' import { GAS_LIMIT_MULTIPLIER } from '../constants' -import { calculateGasFeeInGlow } from '../utils' +import { calculateGasFeeInGlow } from '../helpers' import { estimateGasForLayer1ToLayer2Transaction } from './estimateGasForLayer1ToLayer2Transaction' import { getGasPriceInWei } from './getGasPriceInWei' diff --git a/packages/shared/src/lib/core/layer-2/utils/getIscpTransferSmartContractData.ts b/packages/shared/src/lib/core/layer-2/actions/getIscpTransferSmartContractData.ts similarity index 93% rename from packages/shared/src/lib/core/layer-2/utils/getIscpTransferSmartContractData.ts rename to packages/shared/src/lib/core/layer-2/actions/getIscpTransferSmartContractData.ts index 11f8003247..d99df541cc 100644 --- a/packages/shared/src/lib/core/layer-2/utils/getIscpTransferSmartContractData.ts +++ b/packages/shared/src/lib/core/layer-2/actions/getIscpTransferSmartContractData.ts @@ -1,16 +1,16 @@ import { IChain } from '@core/network' -import { - evmAddressToAgentID, - getAgentBalanceParameters, - buildAssetAllowance, - getSmartContractHexName, -} from '@core/layer-2/utils' import { getSelectedAccount } from '@core/account/stores' import { ContractType } from '@core/layer-2/enums' import { ISC_MAGIC_CONTRACT_ADDRESS } from '@core/layer-2/constants' import { handleError } from '@core/error/handlers' import { IError } from '@core/error/interfaces' import { TransferredAsset } from '../types' +import { + buildAssetAllowance, + evmAddressToAgentId, + getAgentBalanceParameters, + getSmartContractHexName, +} from '../helpers' export function getIscpTransferSmartContractData( recipientAddress: string, @@ -31,7 +31,7 @@ export function getIscpTransferSmartContractData( const accountsCoreContract = getSmartContractHexName('accounts') const transferAllowanceTo = getSmartContractHexName('transferAllowanceTo') - const agentId = evmAddressToAgentID(recipientAddress) + const agentId = evmAddressToAgentId(recipientAddress) const parameters = getAgentBalanceParameters(agentId) const allowance = buildAssetAllowance(transferredAsset) diff --git a/packages/shared/src/lib/core/layer-2/utils/getLayer2NetworkFromAddress.ts b/packages/shared/src/lib/core/layer-2/actions/getLayer2NetworkFromAddress.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/getLayer2NetworkFromAddress.ts rename to packages/shared/src/lib/core/layer-2/actions/getLayer2NetworkFromAddress.ts diff --git a/packages/shared/src/lib/core/layer-2/actions/index.ts b/packages/shared/src/lib/core/layer-2/actions/index.ts index c36395813d..c6fe3ed883 100644 --- a/packages/shared/src/lib/core/layer-2/actions/index.ts +++ b/packages/shared/src/lib/core/layer-2/actions/index.ts @@ -1,7 +1,14 @@ +export * from './buildEvmTransactionData' +export * from './buildUnwrapAssetParameters' +export * from './buildUnwrapAssetTargetAddress' export * from './estimateGasForLayer1ToLayer2Transaction' export * from './fetchSelectedAccountLayer2Balance' export * from './generateAndStoreEvmAddressForAccount' +export * from './getDestinationNetworkFromAddress' export * from './getGasFeesForLayer1ToLayer2Transaction' export * from './getGasPriceInWei' +export * from './getIscpTransferSmartContractData' export * from './getLayer2MetadataForTransfer' +export * from './getLayer2NetworkFromAddress' export * from './pollLayer2Tokens' +export * from './signEvmTransactionWithStronghold' diff --git a/packages/shared/src/lib/core/layer-2/utils/signEvmTransactionWithStronghold.ts b/packages/shared/src/lib/core/layer-2/actions/signEvmTransactionWithStronghold.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/signEvmTransactionWithStronghold.ts rename to packages/shared/src/lib/core/layer-2/actions/signEvmTransactionWithStronghold.ts diff --git a/packages/shared/src/lib/core/layer-2/utils/buildAssetAllowance.ts b/packages/shared/src/lib/core/layer-2/helpers/buildAssetAllowance.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/buildAssetAllowance.ts rename to packages/shared/src/lib/core/layer-2/helpers/buildAssetAllowance.ts diff --git a/packages/shared/src/lib/core/layer-2/utils/calculateGasFeeInGlow.ts b/packages/shared/src/lib/core/layer-2/helpers/calculateGasFeeInGlow.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/calculateGasFeeInGlow.ts rename to packages/shared/src/lib/core/layer-2/helpers/calculateGasFeeInGlow.ts diff --git a/packages/shared/src/lib/core/layer-2/helpers/encodeAssetAllowance.ts b/packages/shared/src/lib/core/layer-2/helpers/encodeAssetAllowance.ts index da9b426c2d..2eaf05f684 100644 --- a/packages/shared/src/lib/core/layer-2/helpers/encodeAssetAllowance.ts +++ b/packages/shared/src/lib/core/layer-2/helpers/encodeAssetAllowance.ts @@ -1,11 +1,11 @@ +import { INft } from '@core/nfts/interfaces' +import { IPersistedToken } from '@core/token/interfaces' +import { SendFlowParameters, SendFlowType, TokenTransferData } from '@core/wallet' import { Converter } from '@iota/util.js' import BigInteger from 'big-integer' -import { SendFlowType, SendFlowParameters, TokenTransferData } from '@core/wallet' import { SpecialStream } from '../classes' import { Allowance } from '../enums' -import { specialNativeTokenAmountEncoding } from '../utils' -import { INft } from '@core/nfts/interfaces' -import { IPersistedToken } from '@core/token/interfaces' +import { specialNativeTokenAmountEncoding } from './' export function encodeAssetAllowance(sendFlowParameters: SendFlowParameters): Uint8Array { const allowance = new SpecialStream() diff --git a/packages/shared/src/lib/core/layer-2/utils/evmAddressToAgentID.ts b/packages/shared/src/lib/core/layer-2/helpers/evmAddressToAgentId.ts similarity index 92% rename from packages/shared/src/lib/core/layer-2/utils/evmAddressToAgentID.ts rename to packages/shared/src/lib/core/layer-2/helpers/evmAddressToAgentId.ts index ea73ef9d2a..b207d1303f 100644 --- a/packages/shared/src/lib/core/layer-2/utils/evmAddressToAgentID.ts +++ b/packages/shared/src/lib/core/layer-2/helpers/evmAddressToAgentId.ts @@ -1,6 +1,6 @@ import { Converter } from '@iota/util.js' -export function evmAddressToAgentID(evmStoreAccount: string): Uint8Array { +export function evmAddressToAgentId(evmStoreAccount: string): Uint8Array { // This function constructs an AgentID that is required to be used with contracts // Wasp understands different AgentID types and each AgentID needs to provide a certain ID that describes it's address type. // In the case of EVM addresses it's ID 3. diff --git a/packages/shared/src/lib/core/layer-2/utils/getAgentBalanceParameters.ts b/packages/shared/src/lib/core/layer-2/helpers/getAgentBalanceParameters.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/getAgentBalanceParameters.ts rename to packages/shared/src/lib/core/layer-2/helpers/getAgentBalanceParameters.ts diff --git a/packages/shared/src/lib/core/layer-2/utils/getEvmTransactionValueFromAmount.ts b/packages/shared/src/lib/core/layer-2/helpers/getEvmTransactionValueFromAmount.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/getEvmTransactionValueFromAmount.ts rename to packages/shared/src/lib/core/layer-2/helpers/getEvmTransactionValueFromAmount.ts diff --git a/packages/shared/src/lib/core/layer-2/utils/getSmartContractHexName.ts b/packages/shared/src/lib/core/layer-2/helpers/getSmartContractHexName.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/getSmartContractHexName.ts rename to packages/shared/src/lib/core/layer-2/helpers/getSmartContractHexName.ts diff --git a/packages/shared/src/lib/core/layer-2/helpers/index.ts b/packages/shared/src/lib/core/layer-2/helpers/index.ts index b183a763af..c55fd09733 100644 --- a/packages/shared/src/lib/core/layer-2/helpers/index.ts +++ b/packages/shared/src/lib/core/layer-2/helpers/index.ts @@ -1,3 +1,10 @@ +export * from './buildAssetAllowance' +export * from './calculateGasFeeInGlow' export * from './encodeAddress' export * from './encodeAssetAllowance' export * from './encodeSmartContractParameters' +export * from './evmAddressToAgentId' +export * from './getAgentBalanceParameters' +export * from './getEvmTransactionValueFromAmount' +export * from './getSmartContractHexName' +export * from './specialNativeTokenAmountEncoding' diff --git a/packages/shared/src/lib/core/layer-2/utils/specialNativeTokenAmountEncoding.ts b/packages/shared/src/lib/core/layer-2/helpers/specialNativeTokenAmountEncoding.ts similarity index 100% rename from packages/shared/src/lib/core/layer-2/utils/specialNativeTokenAmountEncoding.ts rename to packages/shared/src/lib/core/layer-2/helpers/specialNativeTokenAmountEncoding.ts diff --git a/packages/shared/src/lib/core/layer-2/index.ts b/packages/shared/src/lib/core/layer-2/index.ts index 60c30f4ac7..264050151f 100644 --- a/packages/shared/src/lib/core/layer-2/index.ts +++ b/packages/shared/src/lib/core/layer-2/index.ts @@ -1,5 +1,4 @@ export * from './abis' -export * from './actions' export * from './constants' export * from './classes' export * from './constants' diff --git a/packages/shared/src/lib/core/layer-2/utils/calculateEstimatedGasFeeFromTransactionData.ts b/packages/shared/src/lib/core/layer-2/utils/calculateEstimatedGasFeeFromTransactionData.ts index a7c849e20d..626df4cab1 100644 --- a/packages/shared/src/lib/core/layer-2/utils/calculateEstimatedGasFeeFromTransactionData.ts +++ b/packages/shared/src/lib/core/layer-2/utils/calculateEstimatedGasFeeFromTransactionData.ts @@ -1,6 +1,6 @@ import { BigIntLike } from '@ethereumjs/util' import { EvmTransactionData } from '../types' -import { calculateGasFeeInGlow } from './calculateGasFeeInGlow' +import { calculateGasFeeInGlow } from '../helpers' export function calculateEstimatedGasFeeFromTransactionData( transactionData: EvmTransactionData diff --git a/packages/shared/src/lib/core/layer-2/utils/calculateMaxGasFeeFromTransactionData.ts b/packages/shared/src/lib/core/layer-2/utils/calculateMaxGasFeeFromTransactionData.ts index f4172b6112..ac02787ec1 100644 --- a/packages/shared/src/lib/core/layer-2/utils/calculateMaxGasFeeFromTransactionData.ts +++ b/packages/shared/src/lib/core/layer-2/utils/calculateMaxGasFeeFromTransactionData.ts @@ -1,6 +1,6 @@ import { BigIntLike } from '@ethereumjs/util' import { EvmTransactionData } from '../types' -import { calculateGasFeeInGlow } from './calculateGasFeeInGlow' +import { calculateGasFeeInGlow } from '../helpers' export function calculateMaxGasFeeFromTransactionData(transactionData: EvmTransactionData): BigIntLike | undefined { const { gasLimit, gasPrice } = transactionData diff --git a/packages/shared/src/lib/core/layer-2/utils/index.ts b/packages/shared/src/lib/core/layer-2/utils/index.ts index 98fb255519..bc97d0b89b 100644 --- a/packages/shared/src/lib/core/layer-2/utils/index.ts +++ b/packages/shared/src/lib/core/layer-2/utils/index.ts @@ -1,23 +1,9 @@ -export * from './buildAssetAllowance' -export * from './buildEvmTransactionData' -export * from './buildUnwrapAssetParameters' -export * from './buildUnwrapAssetTargetAddress' export * from './calculateEstimatedGasFeeFromTransactionData' -export * from './calculateGasFeeInGlow' export * from './calculateMaxGasFeeFromTransactionData' -export * from './evmAddressToAgentID' export * from './getAbiForContractType' -export * from './getAgentBalanceParameters' export * from './getAmountFromEvmTransactionValue' -export * from './getDestinationNetworkFromAddress' export * from './getErc20TokenMetadata' export * from './getErc20TransferSmartContractData' -export * from './getEvmTransactionValueFromAmount' -export * from './getIscpTransferSmartContractData' -export * from './getLayer2NetworkFromAddress' -export * from './getSmartContractHexName' export * from './parseLayer2Metadata' export * from './parseLayer2MetadataForTransfer' export * from './prepareEvmTransaction' -export * from './signEvmTransactionWithStronghold' -export * from './specialNativeTokenAmountEncoding' diff --git a/packages/shared/src/lib/core/layer-2/utils/prepareEvmTransaction.ts b/packages/shared/src/lib/core/layer-2/utils/prepareEvmTransaction.ts index 6a12caa04a..93601944ed 100644 --- a/packages/shared/src/lib/core/layer-2/utils/prepareEvmTransaction.ts +++ b/packages/shared/src/lib/core/layer-2/utils/prepareEvmTransaction.ts @@ -1,10 +1,9 @@ -import { Transaction } from '@ethereumjs/tx' +import { EvmChainId, getEvmTransactionOptions } from '@core/network' import { RLP } from '@ethereumjs/rlp' +import { Transaction } from '@ethereumjs/tx' import { bufArrToArr } from '@ethereumjs/util' - import { IEvmTransactionSignature } from '../interfaces' import { EvmTransactionData } from '../types' -import { EvmChainId, getEvmTransactionOptions } from '@core/network' export function prepareEvmTransaction( transactionData: EvmTransactionData, diff --git a/packages/shared/src/lib/core/network/classes/iscp-chain.class.ts b/packages/shared/src/lib/core/network/classes/iscp-chain.class.ts index df9c9c1f88..bc5cc673e0 100644 --- a/packages/shared/src/lib/core/network/classes/iscp-chain.class.ts +++ b/packages/shared/src/lib/core/network/classes/iscp-chain.class.ts @@ -1,11 +1,6 @@ +import { Contract, ContractType, getAbiForContractType } from '@core/layer-2' import { get } from 'svelte/store' - import Web3 from 'web3' - -import { ContractType } from '@core/layer-2/enums' -import { getAbiForContractType } from '@core/layer-2/utils' -import { Contract } from '@core/layer-2/types' - import { NetworkHealth } from '../enums' import { IBlock, IChain, IChainStatus, IIscpChainConfiguration, IIscpChainMetadata } from '../interfaces' import { chainStatuses } from '../stores' diff --git a/packages/shared/src/lib/core/wallet/actions/send/createEvmTransactionFromSendFlowParameters.ts b/packages/shared/src/lib/core/wallet/actions/send/createEvmTransactionFromSendFlowParameters.ts index 910c5d86a7..5fbe881082 100644 --- a/packages/shared/src/lib/core/wallet/actions/send/createEvmTransactionFromSendFlowParameters.ts +++ b/packages/shared/src/lib/core/wallet/actions/send/createEvmTransactionFromSendFlowParameters.ts @@ -1,15 +1,15 @@ import { IAccountState } from '@core/account' -import { AssetType } from '@core/layer-2' -import { ISC_MAGIC_CONTRACT_ADDRESS } from '@core/layer-2/constants' -import { EvmTransactionData, TransferredAsset } from '@core/layer-2/types' import { - buildEvmTransactionData, + AssetType, + EvmTransactionData, + ISC_MAGIC_CONTRACT_ADDRESS, + TransferredAsset, getErc20TransferSmartContractData, - getIscpTransferSmartContractData, -} from '@core/layer-2/utils' +} from '@core/layer-2' +import { buildEvmTransactionData, getIscpTransferSmartContractData } from '@core/layer-2/actions' import { IChain } from '@core/network/interfaces' -import { IToken } from '@core/token/interfaces' import { TokenStandard } from '@core/token/enums' +import { IToken } from '@core/token/interfaces' import { SendFlowType } from '@core/wallet/stores' import { SendFlowParameters } from '@core/wallet/types' diff --git a/packages/shared/src/lib/core/wallet/actions/send/signAndSendEvmTransaction.ts b/packages/shared/src/lib/core/wallet/actions/send/signAndSendEvmTransaction.ts index 36db766d66..70d018ce33 100644 --- a/packages/shared/src/lib/core/wallet/actions/send/signAndSendEvmTransaction.ts +++ b/packages/shared/src/lib/core/wallet/actions/send/signAndSendEvmTransaction.ts @@ -2,7 +2,7 @@ import { IAccountState } from '@core/account' import { updateSelectedAccount } from '@core/account/stores' import { handleError } from '@core/error/handlers' import { EvmTransactionData } from '@core/layer-2/types' -import { signEvmTransactionWithStronghold } from '@core/layer-2/utils' +import { signEvmTransactionWithStronghold } from '@core/layer-2/actions' import { Ledger } from '@core/ledger/classes' import { EvmChainId } from '@core/network/enums' import { isActiveLedgerProfile, isSoftwareProfile } from '@core/profile/stores' diff --git a/packages/shared/src/lib/core/wallet/actions/unwrapStardustAsset.ts b/packages/shared/src/lib/core/wallet/actions/unwrapStardustAsset.ts index cc2f39f2a0..b0532a8ac9 100644 --- a/packages/shared/src/lib/core/wallet/actions/unwrapStardustAsset.ts +++ b/packages/shared/src/lib/core/wallet/actions/unwrapStardustAsset.ts @@ -1,17 +1,10 @@ -import Web3 from 'web3' - import { getSelectedAccountIndex } from '@core/account/stores' import { handleError } from '@core/error/handlers' -import { - ContractType, - ISC_MAGIC_CONTRACT_ADDRESS, - buildEvmTransactionData, - ILayer2AssetAllowance, - buildUnwrapAssetParameters, -} from '@core/layer-2' -import { ETHEREUM_COIN_TYPE, IChain, getNetwork, SupportedNetworkId, NetworkId } from '@core/network' +import { ContractType, ILayer2AssetAllowance, ISC_MAGIC_CONTRACT_ADDRESS } from '@core/layer-2' +import { buildEvmTransactionData, buildUnwrapAssetParameters } from '@core/layer-2/actions' +import { ETHEREUM_COIN_TYPE, IChain, NetworkId, SupportedNetworkId, getNetwork } from '@core/network' import { getActiveProfilePersistedEvmAddressesByAccountIndex } from '@core/profile/stores' - +import Web3 from 'web3' import { sendTransactionFromEvm } from '../actions/send' export async function unwrapStardustAsset(