Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/eslint-plugin-sve…
Browse files Browse the repository at this point in the history
…lte-2.38.0
  • Loading branch information
jeeanribeiro committed May 7, 2024
2 parents 47279c6 + 502a84b commit d04c51e
Show file tree
Hide file tree
Showing 165 changed files with 1,618 additions and 1,396 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build Test

on:
pull_request:
types: [ready_for_review]
pull_request_review:
types: [submitted]

jobs:
trigger-build:
name: Build (Trigger) - ${{ inputs.os }}
if: github.event.pull_request.user.login == 'dependabot[bot]'
uses: ./.github/workflows/reusable_build.yml
strategy:
matrix:
os: [ubuntu-20.04, windows-2022, macos-11]
fail-fast: true
with:
os: ${{ matrix.os }}
stage: prod
secrets: inherit
372 changes: 186 additions & 186 deletions firefly.diff

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions packages/desktop/components/NetworkCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
import { localize } from '@core/i18n'
import { generateAndStoreEvmAddressForAccounts, pollEvmBalancesForAccount } from '@core/layer-2/actions'
import { LedgerAppName } from '@core/ledger'
import { ExplorerEndpoint, Network, NetworkNamespace, getDefaultExplorerUrl, setSelectedChain } from '@core/network'
import {
ExplorerEndpoint,
Network,
NetworkNamespace,
getDefaultExplorerUrl,
setSelectedNetworkForNetworkDrawer,
} from '@core/network'
import { ProfileType } from '@core/profile'
import { checkActiveProfileAuth } from '@core/profile/actions'
import { activeProfile } from '@core/profile/stores'
Expand All @@ -32,19 +38,15 @@
}
function onCardClick(): void {
if (network.namespace === NetworkNamespace.Stardust) {
$networkConfigRouter.goTo(NetworkConfigRoute.NetworkSettings)
} else {
setSelectedChain(network)
$networkConfigRouter.goTo(NetworkConfigRoute.ChainInformation)
}
setSelectedNetworkForNetworkDrawer(network)
$networkConfigRouter.goTo(NetworkConfigRoute.ChainInformation)
}
function onQrCodeIconClick(): void {
if (network.namespace === NetworkNamespace.Stardust) {
$networkConfigRouter.goTo(NetworkConfigRoute.ChainDepositAddress)
} else {
setSelectedChain(network)
setSelectedNetworkForNetworkDrawer(network)
$networkConfigRouter.goTo(NetworkConfigRoute.ChainDepositAddress)
}
}
Expand All @@ -61,7 +63,7 @@
}
try {
setSelectedChain(network)
setSelectedNetworkForNetworkDrawer(network)
await generateAndStoreEvmAddressForAccounts(
$activeProfile.type,
network.coinType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { localize } from '@core/i18n'
import { isEvmNetwork } from '@core/network'
import { IIrc27Nft, Nft, getPrimaryNftUrl, isNftLocked, isValidNftUri } from '@core/nfts'
import { addNftsToDownloadQueue, updateNftInAllAccountNfts } from '@core/nfts/actions'
import { updatePersistedNft } from '@core/nfts/stores'
import { addNftsToDownloadQueue } from '@core/nfts/actions'
import { updateNftForAllAccounts, updatePersistedNft } from '@core/nfts/stores'
import { activeProfile, updateActiveProfile } from '@core/profile/stores'
import { Platform } from '@core/app'
Expand Down Expand Up @@ -36,14 +36,14 @@
}
updatePersistedNft(nft.id, { downloadMetadata: {} })
updateNftInAllAccountNfts(nft.id, { downloadMetadata: {}, isLoaded: false })
updateNftForAllAccounts({ id: nft.id, downloadMetadata: {}, isLoaded: false })
addNftsToDownloadQueue([nft])
menu?.close()
}
function onHideClick(): void {
updatePersistedNft(nft.id, { hidden: !nft.hidden })
updateNftInAllAccountNfts(nft.id, { hidden: !nft.hidden })
updateNftForAllAccounts({ id: nft.id, hidden: !nft.hidden })
menu?.close()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
} from '@iota/sdk/out/types'
import { closePopup } from '@desktop/auxiliary/popup'
import { api, getClient } from '@core/profile-manager'
import { formatTokenAmountPrecise } from '@core/token'
import { formatTokenAmountBestMatch } from '@core/token'
import { getActiveNetworkId } from '@core/network'
import PopupTemplate from '../PopupTemplate.svelte'
Expand All @@ -38,7 +38,7 @@
try {
const client = await getClient()
const resp = await client.buildAliasOutput(params)
storageDeposit = formatTokenAmountPrecise(Number(resp.amount), getBaseToken())
storageDeposit = formatTokenAmountBestMatch(BigInt(resp.amount), getBaseToken())
} catch (err) {
handleError(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import { ExplorerEndpoint } from '@core/network'
import { getDefaultExplorerUrl } from '@core/network/utils'
import { NftStandard } from '@core/nfts'
import { getNftByIdFromAllAccountNfts } from '@core/nfts/actions'
import { Nft } from '@core/nfts/interfaces'
import { ownedNfts, selectedNftId } from '@core/nfts/stores'
import { ownedNfts, selectedNftId, getNftByIdForAccount } from '@core/nfts/stores'
import { CollectiblesRoute, DashboardRoute, collectiblesRouter, dashboardRouter } from '@core/router'
import { getTokenFromSelectedAccountTokens } from '@core/token/stores'
import { buildUrl, setClipboard, truncateString } from '@core/utils'
Expand Down Expand Up @@ -45,7 +44,7 @@
_activity.tokenTransfer.standard === NftStandard.Erc721 ||
_activity.tokenTransfer.standard === NftStandard.Irc27
) {
return getNftByIdFromAllAccountNfts($selectedAccountIndex, _activity.tokenTransfer.tokenId) as Nft
return getNftByIdForAccount($selectedAccountIndex, _activity.tokenTransfer.tokenId)
}
}
}
Expand All @@ -62,7 +61,7 @@
const { tokenId, rawAmount, standard } = _activity.tokenTransfer
if (standard === NftStandard.Erc721 || standard === NftStandard.Irc27) {
return {
nft: getNftByIdFromAllAccountNfts($selectedAccountIndex, _activity.tokenTransfer.tokenId) as Nft,
nft: getNftByIdForAccount($selectedAccountIndex, _activity.tokenTransfer.tokenId) as Nft,
}
} else {
const token = getTokenFromSelectedAccountTokens(tokenId, _activity.sourceNetworkId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import { getTransferInfoFromTransactionData } from '@core/layer-2/utils/getTransferInfoFromTransactionData'
import { TokenTransferData } from '@core/wallet'
import { Nft } from '@core/nfts'
import { getNftByIdFromAllAccountNfts } from '@core/nfts/actions'
import { Alert, Link, Table, Text } from '@bloomwalletio/ui'
import { PopupId, closePopup, modifyPopupState, openPopup } from '@desktop/auxiliary/popup'
import { buildUrl, truncateString } from '@core/utils'
Expand All @@ -33,6 +32,7 @@
import { LegacyTransaction } from '@ethereumjs/tx'
import { getActiveProfileId } from '@core/profile/stores'
import { IAccountState } from '@core/account'
import { getNftByIdForAccount } from '@core/nfts/stores'
export let preparedTransaction: EvmTransactionData
export let evmNetwork: IEvmNetwork
Expand Down Expand Up @@ -77,7 +77,7 @@
break
}
case StardustActivityType.Nft: {
nft = getNftByIdFromAllAccountNfts($selectedAccount.index, transferInfo.nftId)
nft = getNftByIdForAccount($selectedAccount.index, transferInfo.nftId)
break
}
case StardustActivityType.SmartContract: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@
import PopupTemplate from '../PopupTemplate.svelte'
import { closePopup } from '@desktop/auxiliary/popup'
import { showNotification } from '@auxiliary/notification'
import {
addNftsToDownloadQueue,
addNewTrackedNftToActiveProfile,
persistErc721Nft,
updateAllAccountNftsForAccount,
} from '@core/nfts/actions'
import { addNftsToDownloadQueue, addNewTrackedNftToActiveProfile, persistErc721Nft } from '@core/nfts/actions'
import { buildNftFromPersistedErc721Nft } from '@core/nfts/utils'
import { activeAccounts } from '@core/profile/stores'
import { getAddressFromAccountForNetwork } from '@core/account'
import { TokenTrackingStatus } from '@core/token'
import { selectedAccount } from '@core/account/stores'
import { addOrUpdateNftForAccount } from '@core/nfts/stores'
let busy = false
Expand Down Expand Up @@ -46,7 +42,7 @@
for (const account of $activeAccounts) {
const l2Address = getAddressFromAccountForNetwork(account, networkId)
const nft = buildNftFromPersistedErc721Nft(persistedNft, l2Address)
updateAllAccountNftsForAccount(account.index, nft)
addOrUpdateNftForAccount(account.index, nft)
void addNftsToDownloadQueue([nft])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { getBaseToken, checkActiveProfileAuth } from '@core/profile/actions'
import { mintNativeToken, mintTokenDetails, buildFoundryOutputBuilderParams, IMintTokenDetails } from '@core/wallet'
import { closePopup, openPopup, PopupId } from '@desktop/auxiliary/popup'
import { IIrc30Metadata, TokenStandard, formatTokenAmountPrecise } from '@core/token'
import { IIrc30Metadata, TokenStandard, formatTokenAmountBestMatch } from '@core/token'
import { getClient } from '@core/profile-manager'
import PopupTemplate from '../PopupTemplate.svelte'
Expand All @@ -28,7 +28,7 @@
)
const client = await getClient()
const preparedOutput = await client.buildFoundryOutput(foundryOutputParams)
storageDeposit = formatTokenAmountPrecise(Number(preparedOutput.amount) ?? 0, getBaseToken())
storageDeposit = formatTokenAmountBestMatch(BigInt(preparedOutput.amount ?? 0), getBaseToken())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { CURRENT_IRC27_VERSION, IIrc27Metadata } from '@core/nfts'
import { getClient } from '@core/profile-manager'
import { checkActiveProfileAuth, getBaseToken } from '@core/profile/actions'
import { formatTokenAmountPrecise } from '@core/token'
import { formatTokenAmountBestMatch } from '@core/token'
import { buildNftOutputBuilderParams, mintNftCollection, mintNftCollectionDetails } from '@core/wallet'
import { PopupId, closePopup, openPopup } from '@desktop/auxiliary/popup'
import { MediaIcon, PopupTab, getTabItems } from '@ui'
Expand Down Expand Up @@ -103,7 +103,7 @@
items={[
{
key: localize('general.storageDeposit'),
value: formatTokenAmountPrecise(storageDeposit, getBaseToken()),
value: formatTokenAmountBestMatch(BigInt(storageDeposit), getBaseToken()),
},
{
key: localize('general.immutableIssuer'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { CURRENT_IRC27_VERSION, IIrc27Metadata } from '@core/nfts'
import { getClient } from '@core/profile-manager'
import { checkActiveProfileAuth, getBaseToken } from '@core/profile/actions'
import { formatTokenAmountPrecise } from '@core/token'
import { formatTokenAmountBestMatch } from '@core/token'
import { buildNftOutputBuilderParams, mintNft, mintNftDetails } from '@core/wallet'
import { PopupId, closePopup, openPopup } from '@desktop/auxiliary/popup'
import { MediaIcon, PopupTab, getTabItems } from '@ui'
Expand Down Expand Up @@ -125,20 +125,22 @@
{
key: localize('general.storageDepositPerNft'),
value:
quantity > 1 ? formatTokenAmountPrecise(storageDeposit, getBaseToken()) : undefined,
quantity > 1
? formatTokenAmountBestMatch(storageDeposit, getBaseToken())
: undefined,
},
{
key: localize('general.totalStorageDeposit'),
value:
quantity > 1
? formatTokenAmountPrecise(totalStorageDeposit, getBaseToken())
? formatTokenAmountBestMatch(totalStorageDeposit, getBaseToken())
: undefined,
},
{
key: localize('general.storageDeposit'),
value:
quantity === 1
? formatTokenAmountPrecise(storageDeposit, getBaseToken())
? formatTokenAmountBestMatch(storageDeposit, getBaseToken())
: undefined,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import { localize } from '@core/i18n'
import { ExplorerEndpoint } from '@core/network'
import { getDefaultExplorerUrl } from '@core/network/utils'
import { getNftByIdFromAllAccountNfts } from '@core/nfts/actions'
import { ownedNfts, selectedNftId } from '@core/nfts/stores'
import { getNftByIdForAccount, ownedNfts, selectedNftId } from '@core/nfts/stores'
import { CollectiblesRoute, DashboardRoute, collectiblesRouter, dashboardRouter } from '@core/router'
import { buildUrl, setClipboard, truncateString } from '@core/utils'
import { claimActivity, rejectActivity } from '@core/wallet'
Expand All @@ -34,7 +33,7 @@
$: transactionAssets = getTransactionAssets(activity, $selectedAccountIndex)
$: nft =
activity.type === StardustActivityType.Nft
? getNftByIdFromAllAccountNfts($selectedAccountIndex, activity.nftId)
? getNftByIdForAccount($selectedAccountIndex, activity.nftId)
: undefined
$: nftIsOwned = nft ? $ownedNfts.some((_nft) => _nft.id === nft?.id) : false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
const sendFlowType = token.id === BASE_TOKEN_ID ? SendFlowType.BaseCoinTransfer : SendFlowType.TokenTransfer
setSendFlowParameters({
type: sendFlowType,
sourceNetworkId: token.networkId,
[sendFlowType]: {
token,
},
Expand Down
6 changes: 0 additions & 6 deletions packages/desktop/features/network.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ import { INetworkFeatures } from '@lib/features/interfaces'

const networkFeatures: INetworkFeatures = {
enabled: true,
layer2: {
enabled: true,
},
config: {
enabled: true,
addChain: {
enabled: false,
},
},
evmNetworks: {
enabled: false,
},
}

export default networkFeatures
24 changes: 24 additions & 0 deletions packages/desktop/features/onboarding.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const onboardingFeaturesForIota: IOnboardingFeaturesForNetwork = {
enabled: false,
},
},
defaultIscChains: {
enabled: false,
},
defaultEvmChains: {
enabled: false,
},
}

const onboardingFeaturesForShimmer: IOnboardingFeaturesForNetwork = {
Expand Down Expand Up @@ -82,6 +88,12 @@ const onboardingFeaturesForShimmer: IOnboardingFeaturesForNetwork = {
enabled: true,
},
},
defaultIscChains: {
enabled: true,
},
defaultEvmChains: {
enabled: false,
},
}

const onboardingFeaturesForTestnet: IOnboardingFeaturesForNetwork = {
Expand Down Expand Up @@ -123,6 +135,12 @@ const onboardingFeaturesForTestnet: IOnboardingFeaturesForNetwork = {
enabled: true,
},
},
defaultIscChains: {
enabled: true,
},
defaultEvmChains: {
enabled: true,
},
}

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

const onboardingFeatures: OnboardingFeatures = {
Expand Down
3 changes: 3 additions & 0 deletions packages/desktop/lib/electron/constants/app-path.constant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { app } from 'electron'

export const APP_PATH = app.isPackaged ? app.getAppPath() : __dirname
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import features from '@features/features'
import { WebPreferences, app } from 'electron'

/**
* Default web preferences (see https://www.electronjs.org/docs/tutorial/security)
*/
export const DEFAULT_WEB_PREFERENCES: WebPreferences = {
nodeIntegration: false,
contextIsolation: true,
disableBlinkFeatures: 'Auxclick',
webviewTag: false,
enableWebSQL: false,
devTools: !app.isPackaged || features?.electron?.developerTools?.enabled,
}
Loading

0 comments on commit d04c51e

Please sign in to comment.