diff --git a/.env b/.env index 70eadfc8d..a795f8618 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ UNFINISHED_FEATURES=true ETHERSCAN_API_KEY= WALLET_CONNECT_PROJECT_ID= -TOKEN_SWAP_URL_TESTNET= -TOKEN_SWAP_URL_MAINNET= +TOKEN_SALES_URL_MAINNET= +TOKEN_SALES_URL_TESTNET= diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d5c1505cd..11b79315e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,8 +6,8 @@ jobs: env: APP_NAME: wallet WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} - TOKEN_SWAP_URL_MAINNET: ${{ secrets.TOKEN_SWAP_URL_MAINNET }} - TOKEN_SWAP_URL_TESTNET: ${{ secrets.TOKEN_SWAP_URL_TESTNET }} + TOKEN_SALES_URL_MAINNET: ${{ secrets.TOKEN_SALES_URL_MAINNET }} + TOKEN_SALES_URL_TESTNET: ${{ secrets.TOKEN_SALES_URL_TESTNET }} steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4cba4f66..8b336d175 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,8 +5,8 @@ jobs: runs-on: ubuntu-latest env: APP_NAME: wallet - TOKEN_SWAP_URL_MAINNET: ${{ secrets.TOKEN_SWAP_URL_MAINNET }} - TOKEN_SWAP_URL_TESTNET: ${{ secrets.TOKEN_SWAP_URL_TESTNET }} + TOKEN_SALES_URL_MAINNET: ${{ secrets.TOKEN_SALES_URL_MAINNET }} + TOKEN_SALES_URL_TESTNET: ${{ secrets.TOKEN_SALES_URL_TESTNET }} steps: - uses: actions/checkout@v4 with: diff --git a/src/composables/transactionData.ts b/src/composables/transactionData.ts index 847f37d4d..fe530e78c 100644 --- a/src/composables/transactionData.ts +++ b/src/composables/transactionData.ts @@ -24,7 +24,7 @@ import { TX_FUNCTIONS, TX_FUNCTIONS_MULTISIG, TX_FUNCTIONS_TYPE_DEX, - TX_FUNCTIONS_TOKEN_SWAP, + TX_FUNCTIONS_TOKEN_SALE, } from '@/protocols/aeternity/config'; import { aettosToAe, @@ -40,7 +40,7 @@ import { isTxDex, } from '@/protocols/aeternity/helpers'; import { useFungibleTokens } from '@/composables/fungibleTokens'; -import { useAeTokenSwaps } from '@/protocols/aeternity/composables/aeTokenSwaps'; +import { useAeTokenSales } from '@/protocols/aeternity/composables/aeTokenSales'; import { useAccounts } from './accounts'; import { useAeSdk } from './aeSdk'; @@ -68,9 +68,9 @@ export function useTransactionData({ const { getProtocolAvailableTokens, getTxAmountTotal, getTxAssetSymbol } = useFungibleTokens(); const { tokenContractAddresses, - tokenSwapAddresses, - tokenSwapAddressToTokenContractAddress, - } = useAeTokenSwaps(); + tokenSaleAddresses, + tokenSaleAddressToTokenContractAddress, + } = useAeTokenSales(); const protocol = computed(() => transaction.value?.protocol || PROTOCOLS.aeternity); const outerTx = computed(() => transaction.value?.tx); @@ -116,24 +116,24 @@ export function useTransactionData({ ), ); - const isTokenSwap = computed( + const isTokenSale = computed( (): boolean => [ ...tokenContractAddresses.value, - ...tokenSwapAddresses.value, + ...tokenSaleAddresses.value, ].some((address) => address === innerTx.value?.contractId), ); - const isTokenSwapBuy = computed( + const isTokenSaleBuy = computed( (): boolean => ( - isTokenSwap.value - && includes(TX_FUNCTIONS_TOKEN_SWAP.buy, txFunctionRaw.value) + isTokenSale.value + && includes(TX_FUNCTIONS_TOKEN_SALE.buy, txFunctionRaw.value) ), ); - const isTokenSwapSell = computed( + const isTokenSaleSell = computed( (): boolean => ( - isTokenSwap.value - && includes(TX_FUNCTIONS_TOKEN_SWAP.sell, txFunctionRaw.value) + isTokenSale.value + && includes(TX_FUNCTIONS_TOKEN_SALE.sell, txFunctionRaw.value) ), ); @@ -255,7 +255,7 @@ export function useTransactionData({ if (protocol.value === PROTOCOLS.aeternity) { // AE DEX and wrapped AE (WAE) if ( - (isDex.value || isTokenSwap.value) + (isDex.value || isTokenSale.value) && txFunctionParsed.value && (!isDexAllowance.value || showDetailedAllowanceInfo) ) { @@ -264,7 +264,7 @@ export function useTransactionData({ return functionResolver( { tx: outerTx.value } as ITransaction, protocolTokens, - tokenSwapAddressToTokenContractAddress, + tokenSaleAddressToTokenContractAddress, ) .tokens .map(({ @@ -343,9 +343,9 @@ export function useTransactionData({ isAex9, isErrorTransaction, - isTokenSwap, - isTokenSwapBuy, - isTokenSwapSell, + isTokenSale, + isTokenSaleBuy, + isTokenSaleSell, isDex, isDexAllowance, diff --git a/src/popup/components/Modals/ConfirmTransactionSign.vue b/src/popup/components/Modals/ConfirmTransactionSign.vue index c8c659c48..3bd5bc452 100644 --- a/src/popup/components/Modals/ConfirmTransactionSign.vue +++ b/src/popup/components/Modals/ConfirmTransactionSign.vue @@ -51,7 +51,7 @@ @@ -78,7 +78,7 @@ { - if (!isDex.value && !isDexAllowance.value && !isTokenSwap.value) { + if (!isDex.value && !isDexAllowance.value && !isTokenSale.value) { return [singleToken.value]; } const resolver = getTransactionTokenInfoResolver(txFunctionParsed.value!); if (!resolver) { return []; } - if (protocol === PROTOCOLS.aeternity && isTokenSwap.value) { - // Wait until token swap tokens are resolved - await watchUntilTruthy(areTokenSwapsReady); + if (protocol === PROTOCOLS.aeternity && isTokenSale.value) { + // Wait until token sale tokens are resolved + await watchUntilTruthy(areTokenSalesReady); } const tokens = resolver( { tx: { ...txParams, ...popupProps.value?.tx } } as ITransaction, getProtocolAvailableTokens(PROTOCOLS.aeternity), - tokenSwapAddressToTokenContractAddress, + tokenSaleAddressToTokenContractAddress, )?.tokens; - if (!(isDexPool.value || isTokenSwap.value)) { + if (!(isDexPool.value || isTokenSale.value)) { return tokens; } if (isDexLiquidityAdd.value) { @@ -703,7 +703,7 @@ export default defineComponent({ isDexMaxSpent, isDexMinReceived, isDexSwap, - isTokenSwap, + isTokenSale, isHash, loading, nameAeFee, diff --git a/src/popup/components/SwapRates.vue b/src/popup/components/SwapRates.vue index 413c033f7..1054d6806 100644 --- a/src/popup/components/SwapRates.vue +++ b/src/popup/components/SwapRates.vue @@ -46,7 +46,7 @@ import type { ITransaction } from '@/types'; import { PROTOCOLS } from '@/constants'; import { getTransactionTokenInfoResolver } from '@/protocols/aeternity/helpers'; import { useFungibleTokens, useTransactionData } from '@/composables'; -import { useAeTokenSwaps } from '@/protocols/aeternity/composables/aeTokenSwaps'; +import { useAeTokenSales } from '@/protocols/aeternity/composables/aeTokenSales'; import DetailsItem from './DetailsItem.vue'; import Tokens from './Tokens.vue'; @@ -63,14 +63,14 @@ export default defineComponent({ }, setup(props) { const { getProtocolAvailableTokens } = useFungibleTokens(); - const { tokenSwapAddressToTokenContractAddress } = useAeTokenSwaps(); + const { tokenSaleAddressToTokenContractAddress } = useAeTokenSales(); - const { isDexSwap, txFunctionParsed, isTokenSwap } = useTransactionData({ + const { isDexSwap, txFunctionParsed, isTokenSale } = useTransactionData({ transaction: toRef(() => props.transaction), }); const rates = computed(() => { - if (!isDexSwap.value || !isTokenSwap.value || !txFunctionParsed.value) { + if (!isDexSwap.value || !isTokenSale.value || !txFunctionParsed.value) { return []; } @@ -82,7 +82,7 @@ export default defineComponent({ const { tokens } = resolver( props.transaction, getProtocolAvailableTokens(PROTOCOLS.aeternity), - tokenSwapAddressToTokenContractAddress, + tokenSaleAddressToTokenContractAddress, ); if (tokens?.length <= 1) { diff --git a/src/popup/components/TransactionLabel.vue b/src/popup/components/TransactionLabel.vue index ed6115d0e..d425c3246 100644 --- a/src/popup/components/TransactionLabel.vue +++ b/src/popup/components/TransactionLabel.vue @@ -121,8 +121,8 @@ export default defineComponent({ isDexAllowance, isDexLiquidityAdd, isDexLiquidityRemove, - isTokenSwapBuy, - isTokenSwapSell, + isTokenSaleBuy, + isTokenSaleSell, isErrorTransaction, isTip, txTypeListLabel, @@ -167,10 +167,10 @@ export default defineComponent({ } else if (isDex.value) { text = t('common.swap'); hasComma = true; - } else if (isTokenSwapBuy.value) { - text = t('transaction.tokenSwap.bought'); - } else if (isTokenSwapSell.value) { - text = t('transaction.tokenSwap.sold'); + } else if (isTokenSaleBuy.value) { + text = t('transaction.tokenSale.bought'); + } else if (isTokenSaleSell.value) { + text = t('transaction.tokenSale.sold'); } else if (isTip.value && props.transaction.claim) { text = t('transaction.listType.tipReceived'); } else if (isTip.value) { diff --git a/src/popup/components/TransactionTagList.vue b/src/popup/components/TransactionTagList.vue index 1d7a8fcb6..0263c71f2 100644 --- a/src/popup/components/TransactionTagList.vue +++ b/src/popup/components/TransactionTagList.vue @@ -59,9 +59,9 @@ export default defineComponent({ isDex, isDexPool, isDexAllowance, - isTokenSwap, - isTokenSwapBuy, - isTokenSwapSell, + isTokenSale, + isTokenSaleBuy, + isTokenSaleSell, } = useTransactionData({ transaction: toRef(() => props.transaction), }); @@ -119,13 +119,13 @@ export default defineComponent({ ? t('transaction.dexType.pool') : t('common.swap'), ); - } else if (isTokenSwap.value) { + } else if (isTokenSale.value) { arr.push( - t('transaction.tokenSwap.tag'), - (isTokenSwapBuy.value) + t('transaction.tokenSale.tag'), + (isTokenSaleBuy.value) ? t('common.buy') : '', - (isTokenSwapSell.value) + (isTokenSaleSell.value) ? t('common.sell') : '', ); diff --git a/src/popup/locales/en.json b/src/popup/locales/en.json index ecd11a698..f4ff41a25 100644 --- a/src/popup/locales/en.json +++ b/src/popup/locales/en.json @@ -580,8 +580,8 @@ "abort": "Failed", "revert": "Reverted" }, - "tokenSwap": { - "tag": "token swap", + "tokenSale": { + "tag": "token sale", "bought": "Bought", "sold": "Sold" } @@ -839,7 +839,7 @@ "pooled": "Pooled", "daoBalance": "Dao balance", "ownerAddress": "Dao address", - "swapAddress": "Swap address", + "saleAddress": "Sale address", "creatorAddress": "Creator address" }, "more": { diff --git a/src/popup/pages/Assets/AssetDetailsInfo.vue b/src/popup/pages/Assets/AssetDetailsInfo.vue index 149b51416..1ba458423 100644 --- a/src/popup/pages/Assets/AssetDetailsInfo.vue +++ b/src/popup/pages/Assets/AssetDetailsInfo.vue @@ -56,14 +56,14 @@ @@ -254,7 +254,7 @@ import { } from '@/utils'; import { useAssetDetails, useCurrencies } from '@/composables'; import { PROTOCOLS } from '@/constants'; -import { useAeTokenSwaps } from '@/protocols/aeternity/composables/aeTokenSwaps'; +import { useAeTokenSales } from '@/protocols/aeternity/composables/aeTokenSales'; import DetailsRow from '@/popup/components/Assets/DetailsRow.vue'; import AddressTruncated from '@/popup/components/AddressTruncated.vue'; @@ -277,11 +277,11 @@ export default defineComponent({ setup() { const { sharedAssetDetails } = useAssetDetails(); const { formatCurrency } = useCurrencies(); - const { tokenSwaps } = useAeTokenSwaps(); + const { tokenSales } = useAeTokenSales(); - const tokenSwapInfo = computed(() => ( + const tokenSaleInfo = computed(() => ( sharedAssetDetails.tokenData.protocol === PROTOCOLS.aeternity - ? tokenSwaps.value + ? tokenSales.value .find((token) => token.address === sharedAssetDetails.tokenData.contractId) : undefined )); @@ -293,21 +293,21 @@ export default defineComponent({ const assetData = computed(() => ({ ...sharedAssetDetails.tokenData, ...sharedAssetDetails.tokenBalance, - ...(tokenSwapInfo.value ? { - totalSupply: tokenSwapInfo.value?.totalSupply + ...(tokenSaleInfo.value ? { + totalSupply: tokenSaleInfo.value?.totalSupply ? +toShiftedBigNumber( - tokenSwapInfo.value.totalSupply, + tokenSaleInfo.value.totalSupply, -sharedAssetDetails.tokenData.decimals, ) : undefined, - marketCap: tokenSwapInfo.value?.marketCap - ? +toShiftedBigNumber(tokenSwapInfo.value.marketCap, -adapter.value.coinPrecision) + marketCap: tokenSaleInfo.value?.marketCap + ? +toShiftedBigNumber(tokenSaleInfo.value.marketCap, -adapter.value.coinPrecision) : undefined, - creatorAddress: tokenSwapInfo.value?.creatorAddress, - ownerAddress: tokenSwapInfo.value?.ownerAddress, - swapAddress: tokenSwapInfo.value?.saleAddress, - daoBalance: tokenSwapInfo.value?.daoBalance - ? +toShiftedBigNumber(tokenSwapInfo.value?.daoBalance, -adapter.value.coinPrecision) + creatorAddress: tokenSaleInfo.value?.creatorAddress, + ownerAddress: tokenSaleInfo.value?.ownerAddress, + saleAddress: tokenSaleInfo.value?.saleAddress, + daoBalance: tokenSaleInfo.value?.daoBalance + ? +toShiftedBigNumber(tokenSaleInfo.value?.daoBalance, -adapter.value.coinPrecision) : undefined, } : {} diff --git a/src/protocols/aeternity/composables/aeTokenSwaps.ts b/src/protocols/aeternity/composables/aeTokenSales.ts similarity index 50% rename from src/protocols/aeternity/composables/aeTokenSwaps.ts rename to src/protocols/aeternity/composables/aeTokenSales.ts index 48023d964..6faac9074 100644 --- a/src/protocols/aeternity/composables/aeTokenSwaps.ts +++ b/src/protocols/aeternity/composables/aeTokenSales.ts @@ -1,7 +1,7 @@ import { computed, ref } from 'vue'; import camelCaseKeysDeep from 'camelcase-keys-deep'; -import { ITokenSwap } from '@/types'; +import { ITokenSale } from '@/types'; import { NETWORK_TYPE_CUSTOM } from '@/constants'; import { createCustomScopedComposable, @@ -10,43 +10,43 @@ import { handleUnknownError, } from '@/utils'; import { useNetworks } from '@/composables'; -import { AE_TOKEN_SWAPS_URLS } from '@/protocols/aeternity/config'; +import { AE_TOKEN_SALES_URLS } from '@/protocols/aeternity/config'; import { createPollingBasedOnMountedComponents } from '@/composables/composablesHelpers'; const POLLING_INTERVAL = 60000; let composableInitialized = false; -const areTokenSwapsReady = ref(false); +const areTokenSalesReady = ref(false); -const tokenSwapsUrl = ref(''); +const tokenSalesUrl = ref(''); const initPollingWatcher = createPollingBasedOnMountedComponents(POLLING_INTERVAL); /** - * List of all token swap available + * List of all token sales available */ -const tokenSwaps = ref([]); +const tokenSales = ref([]); -export const useAeTokenSwaps = createCustomScopedComposable(() => { +export const useAeTokenSales = createCustomScopedComposable(() => { const { activeNetwork, onNetworkChange } = useNetworks(); - const tokenSwapAddresses = computed( - () => tokenSwaps.value.map((tokenSwap) => tokenSwap.saleAddress), + const tokenSaleAddresses = computed( + () => tokenSales.value.map((tokenSale) => tokenSale.saleAddress), ); const tokenContractAddresses = computed( - () => tokenSwaps.value.map((tokenSwap) => tokenSwap.address), + () => tokenSales.value.map((tokenSale) => tokenSale.address), ); - function tokenSwapAddressToTokenContractAddress( + function tokenSaleAddressToTokenContractAddress( address: string, ): string { - const tokenSwap = tokenSwaps.value.find((sale) => sale.saleAddress === address); - return tokenSwap?.address ?? address; + const tokenSale = tokenSales.value.find((sale) => sale.saleAddress === address); + return tokenSale?.address ?? address; } - async function fetchTokenSwaps(path: string) { - const res = await fetchJson(`${tokenSwapsUrl.value}/${path}`); + async function fetchTokenSales(path: string) { + const res = await fetchJson(`${tokenSalesUrl.value}/${path}`); const { items, meta } = res || {}; return { data: items, @@ -57,42 +57,42 @@ export const useAeTokenSwaps = createCustomScopedComposable(() => { }; } - async function loadAllTokenSwaps() { - areTokenSwapsReady.value = false; + async function loadAllTokenSales() { + areTokenSalesReady.value = false; if (activeNetwork.value.type !== NETWORK_TYPE_CUSTOM) { - tokenSwapsUrl.value = AE_TOKEN_SWAPS_URLS[activeNetwork.value.type]; + tokenSalesUrl.value = AE_TOKEN_SALES_URLS[activeNetwork.value.type]; try { - const response: ITokenSwap[] = camelCaseKeysDeep(await fetchAllPages( - () => fetchTokenSwaps('tokens'), - fetchTokenSwaps, + const response: ITokenSale[] = camelCaseKeysDeep(await fetchAllPages( + () => fetchTokenSales('tokens'), + fetchTokenSales, )); - tokenSwaps.value = response || []; + tokenSales.value = response || []; } catch (e) { - tokenSwaps.value = []; + tokenSales.value = []; handleUnknownError(e); } } else { - tokenSwaps.value = []; + tokenSales.value = []; } - areTokenSwapsReady.value = true; + areTokenSalesReady.value = true; } if (!composableInitialized) { composableInitialized = true; - initPollingWatcher(() => loadAllTokenSwaps()); + initPollingWatcher(() => loadAllTokenSales()); onNetworkChange(async (network, oldNetwork) => { if (network.type !== oldNetwork.type) { - await loadAllTokenSwaps(); + await loadAllTokenSales(); } }); } return { - tokenSwaps, - tokenSwapAddresses, + tokenSales, + tokenSaleAddresses, tokenContractAddresses, - areTokenSwapsReady, - tokenSwapAddressToTokenContractAddress, + areTokenSalesReady, + tokenSaleAddressToTokenContractAddress, }; }); diff --git a/src/protocols/aeternity/composables/index.ts b/src/protocols/aeternity/composables/index.ts index 05a4bfad9..b2c52e336 100644 --- a/src/protocols/aeternity/composables/index.ts +++ b/src/protocols/aeternity/composables/index.ts @@ -2,4 +2,4 @@ export * from './aeMiddleware'; export * from './aeNetworkSettings'; export * from './aeTippingBackend'; export * from './aeTippingUrls'; -export * from './aeTokenSwaps'; +export * from './aeTokenSales'; diff --git a/src/protocols/aeternity/config.ts b/src/protocols/aeternity/config.ts index 4e35df14a..0522f2c7a 100644 --- a/src/protocols/aeternity/config.ts +++ b/src/protocols/aeternity/config.ts @@ -3,7 +3,7 @@ import type { DexFunctionType, IDefaultNetworkTypeData, IDexContracts, - TokenSwapFunctionType, + TokenSaleFunctionType, TxFunctionRaw, } from '@/types'; import { NETWORK_TYPE_MAINNET, NETWORK_TYPE_TESTNET } from '@/constants'; @@ -42,9 +42,9 @@ export const AE_NETWORK_DEFAULT_SETTINGS: IDefaultNetworkTypeData = { - [NETWORK_TYPE_MAINNET]: process.env.TOKEN_SWAP_URL_MAINNET!, - [NETWORK_TYPE_TESTNET]: process.env.TOKEN_SWAP_URL_TESTNET!, +export const AE_TOKEN_SALES_URLS: IDefaultNetworkTypeData = { + [NETWORK_TYPE_MAINNET]: process.env.TOKEN_SALES_URL_MAINNET!, + [NETWORK_TYPE_TESTNET]: process.env.TOKEN_SALES_URL_TESTNET!, }; export const AE_NETWORK_DEFAULT_ENV_SETTINGS = (process.env.NETWORK === 'Testnet') @@ -136,7 +136,7 @@ export const TX_FUNCTIONS = { gaMetaSpend: 'ga_meta_spend', /** For example Connecting to superhero.chat */ verifyAccount: 'verify_account', - /** token swaps */ + /** token sales */ buy: 'buy', sell: 'sell', } as const; @@ -181,7 +181,7 @@ export const TX_FUNCTIONS_TYPE_DEX: Record = { ], }; -export const TX_FUNCTIONS_TOKEN_SWAP: Record = { +export const TX_FUNCTIONS_TOKEN_SALE: Record = { buy: ['buy'], sell: ['sell'], }; diff --git a/src/protocols/aeternity/helpers/transactionTokenInfoResolvers.ts b/src/protocols/aeternity/helpers/transactionTokenInfoResolvers.ts index d935e2fde..b68afeac3 100644 --- a/src/protocols/aeternity/helpers/transactionTokenInfoResolvers.ts +++ b/src/protocols/aeternity/helpers/transactionTokenInfoResolvers.ts @@ -360,7 +360,7 @@ const withdraw: TransactionResolver = (transaction, tokens = null) => ({ }); /** - * Token Swap Buy + * Token Sale Buy */ const buy: TransactionResolver = (transaction, tokens = null, tokenAddressMapper = undefined) => { const isConfirm = !transaction.tx.return; @@ -389,7 +389,7 @@ const buy: TransactionResolver = (transaction, tokens = null, tokenAddressMapper }; /** - * Token Swap Sell + * Token Sale Sell */ const sell: TransactionResolver = (transaction, tokens = null, tokenAddressMapper = undefined) => { const isConfirm = !transaction.tx.return; diff --git a/src/protocols/aeternity/libs/AeternityAdapter.ts b/src/protocols/aeternity/libs/AeternityAdapter.ts index 5e9536d59..bf1fc49aa 100644 --- a/src/protocols/aeternity/libs/AeternityAdapter.ts +++ b/src/protocols/aeternity/libs/AeternityAdapter.ts @@ -67,7 +67,7 @@ import { AEX9_TRANSFER_EVENT, } from '@/protocols/aeternity/config'; import { AeScan } from '@/protocols/aeternity/libs/AeScan'; -import { useAeMiddleware, useAeNetworkSettings, useAeTokenSwaps } from '@/protocols/aeternity/composables'; +import { useAeMiddleware, useAeNetworkSettings, useAeTokenSales } from '@/protocols/aeternity/composables'; import { aettosToAe } from '../helpers'; @@ -258,7 +258,7 @@ export class AeternityAdapter extends BaseProtocolAdapter { override async fetchAccountTokenBalances(address: string): Promise { const { fetchFromMiddleware } = useAeMiddleware(); - const { areTokenSwapsReady, tokenSwaps } = useAeTokenSwaps(); + const { areTokenSalesReady, tokenSales } = useAeTokenSales(); try { const tokens: ITokenBalanceResponse[] = camelCaseKeysDeep(await fetchAllPages( () => fetchFromMiddleware(`/v2/aex9/account-balances/${address}?limit=100`), @@ -266,7 +266,7 @@ export class AeternityAdapter extends BaseProtocolAdapter { )); if (tokens.length) { await Promise.race([ - watchUntilTruthy(areTokenSwapsReady), + watchUntilTruthy(areTokenSalesReady), sleep(5000), ]); } @@ -276,7 +276,7 @@ export class AeternityAdapter extends BaseProtocolAdapter { contractId, convertedBalance: +amountRounded(toShiftedBigNumber(amount, -decimals)), protocol: PROTOCOLS.aeternity, - price: tokenSwaps.value.find((token) => token.address === contractId)?.price ?? 0, + price: tokenSales.value.find((token) => token.address === contractId)?.price ?? 0, })); } catch (error: any) { handleUnknownError(error); diff --git a/src/protocols/aeternity/views/TransactionDetails.vue b/src/protocols/aeternity/views/TransactionDetails.vue index 601a3074d..1313b10e8 100644 --- a/src/protocols/aeternity/views/TransactionDetails.vue +++ b/src/protocols/aeternity/views/TransactionDetails.vue @@ -15,7 +15,7 @@ isDex || isDexAllowance || isAex9 - || isTokenSwap + || isTokenSale )" :hide-fiat="hideFiat" :hash="hash" @@ -34,7 +34,7 @@