Skip to content

Commit

Permalink
Merge commit 'e040eafaf1f6dba51b55ec72b134f22aeeb57744' into feature/…
Browse files Browse the repository at this point in the history
…notifications
  • Loading branch information
MarkNerdi committed May 27, 2024
2 parents 8d49b47 + e040eaf commit e9d2609
Show file tree
Hide file tree
Showing 18 changed files with 436 additions and 353 deletions.
29 changes: 15 additions & 14 deletions firefly.diff
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,15 @@
rename packages/desktop/views/dashboard/developer/{index.js => index.ts} (100%)
rename packages/desktop/{lib/routers/enums => views/dashboard/drawers/network-config}/network-config-route.enum.ts (86%)
rename packages/desktop/{components/menu-buttons/ProposalDetailsButton.svelte => views/dashboard/governance/components/ProposalDetailsMenu.svelte} (55%)
rename packages/desktop/{ => views/dashboard/governance}/components/ProposalQuestion.svelte (59%)
rename packages/desktop/{ => views/dashboard/governance}/components/ProposalQuestion.svelte (58%)
rename packages/desktop/views/dashboard/{index.js => index.ts} (77%)
rename packages/desktop/views/dashboard/send-flow/{index.js => index.ts} (100%)
delete mode 100644 packages/desktop/views/dashboard/send-flow/views/SendFlowTemplate.svelte
delete mode 100644 packages/desktop/views/dashboard/send-flow/views/components/DateTimePicker.svelte
delete mode 100644 packages/desktop/views/dashboard/send-flow/views/components/DateTimePickerButton.svelte
delete mode 100644 packages/desktop/views/dashboard/send-flow/views/components/TokenAmountTile.svelte
delete mode 100644 packages/desktop/views/dashboard/send-flow/views/components/TransactionDetails.svelte
delete mode 100644 packages/desktop/views/dashboard/send-flow/views/components/index.js
rename packages/desktop/views/dashboard/send-flow/views/{index.js => index.ts} (100%)
delete mode 100644 packages/desktop/views/dashboard/settings/Settings.svelte
delete mode 100644 packages/desktop/views/dashboard/settings/views/SettingsNavigator.svelte
Expand Down Expand Up @@ -242,8 +243,7 @@
rename packages/desktop/views/{index.js => index.ts} (83%)
rename packages/desktop/views/login/{index.js => index.ts} (100%)
delete mode 100644 packages/desktop/views/login/views/EnterPinView.svelte
delete mode 100644 packages/desktop/views/login/views/index.js
rename packages/{mobile/views/login/views/index.js => desktop/views/login/views/index.ts} (69%)
rename packages/desktop/views/login/views/{index.js => index.ts} (69%)
rename packages/desktop/views/onboarding/{index.js => index.ts} (100%)
rename packages/desktop/views/onboarding/views/create-from-ledger/{index.js => index.ts} (100%)
rename packages/desktop/views/onboarding/views/create-from-ledger/views/{index.js => index.ts} (77%)
Expand Down Expand Up @@ -589,6 +589,7 @@
delete mode 100644 packages/mobile/views/login/views/EnterPinView.svelte
delete mode 100644 packages/mobile/views/login/views/LoadProfileView.svelte
delete mode 100644 packages/mobile/views/login/views/SelectProfileView.svelte
delete mode 100644 packages/mobile/views/login/views/index.js
delete mode 100644 packages/mobile/views/onboarding/OnboardingRouter.svelte
delete mode 100644 packages/mobile/views/onboarding/index.js
delete mode 100644 packages/mobile/views/onboarding/views/CongratulationsView.svelte
Expand Down Expand Up @@ -1103,6 +1104,7 @@
delete mode 100644 packages/shared/lib/core/layer-2/constants/gas-budget.constant.ts
delete mode 100644 packages/shared/lib/core/layer-2/constants/gas-multiplier.constant.ts
delete mode 100644 packages/shared/lib/core/layer-2/enums/allowance.enum.ts
delete mode 100644 packages/shared/lib/core/layer-2/enums/contract-type.enum.ts
delete mode 100644 packages/shared/lib/core/layer-2/enums/destination-network.enum.ts
delete mode 100644 packages/shared/lib/core/layer-2/enums/index.ts
delete mode 100644 packages/shared/lib/core/layer-2/helpers/encodeAddress.ts
Expand All @@ -1115,7 +1117,10 @@
delete mode 100644 packages/shared/lib/core/layer-2/interfaces/layer2-parameters.interface.ts
delete mode 100644 packages/shared/lib/core/layer-2/interfaces/layer2-profile-balance.interface.ts
delete mode 100644 packages/shared/lib/core/layer-2/stores/layer2-balances.store.ts
delete mode 100644 packages/shared/lib/core/layer-2/types/abi.type.ts
delete mode 100644 packages/shared/lib/core/layer-2/types/contract.type.ts
delete mode 100644 packages/shared/lib/core/layer-2/types/evm-transaction-data.type.ts
delete mode 100644 packages/shared/lib/core/layer-2/types/index.ts
delete mode 100644 packages/shared/lib/core/layer-2/types/layer2-metadata.interface.ts
delete mode 100644 packages/shared/lib/core/layer-2/utils/addGasBudget.ts
delete mode 100644 packages/shared/lib/core/layer-2/utils/getAbiForContractType.ts
Expand Down Expand Up @@ -1189,6 +1194,7 @@
delete mode 100644 packages/shared/lib/core/network/enums/explorer-endpoint.enum.ts
delete mode 100644 packages/shared/lib/core/network/enums/index.ts
delete mode 100644 packages/shared/lib/core/network/interfaces/auth.interface.ts
delete mode 100644 packages/shared/lib/core/network/interfaces/block.interface.ts
delete mode 100644 packages/shared/lib/core/network/interfaces/chain-configuration.interface.ts
delete mode 100644 packages/shared/lib/core/network/interfaces/chain-status.interface.ts
delete mode 100644 packages/shared/lib/core/network/interfaces/chain.interface.ts
Expand Down Expand Up @@ -1586,10 +1592,10 @@
rename packages/shared/{ => src}/lib/contexts/governance/stores/selected-participation-event-status.store.ts (64%)
rename packages/shared/{ => src}/lib/contexts/governance/stores/selected-proposal.store.ts (57%)
rename packages/shared/{ => src}/lib/contexts/governance/types/index.ts (100%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/calculateTotalVotesForTrackedParticipations.ts (65%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/calculateTotalVotesForTrackedParticipations.ts (64%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/createProposalFromError.ts (52%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/getActiveParticipation.ts (82%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/getNumberOfActiveProposals.ts (54%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/getNumberOfActiveProposals.ts (53%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/getNumberOfTotalProposals.ts (100%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/getNumberOfVotedProposals.ts (92%)
rename packages/shared/{ => src}/lib/contexts/governance/utils/getNumberOfVotingProposals.ts (94%)
Expand Down Expand Up @@ -1837,23 +1843,22 @@
rename packages/shared/{ => src}/lib/core/i18n/utils/getGroupSeparator.ts (83%)
rename packages/shared/{ => src}/lib/core/i18n/utils/index.ts (100%)
rename packages/shared/{ => src}/lib/core/i18n/utils/replaceCurrencyDecimal.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/abis/erc20.abi.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/abis/erc20.abi.ts (98%)
rename packages/shared/{ => src}/lib/core/layer-2/abis/index.ts (68%)
rename packages/shared/{ => src}/lib/core/layer-2/abis/isc-sandbox.abi.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/abis/isc-sandbox.abi.ts (99%)
rename packages/shared/{ => src}/lib/core/layer-2/classes/simple-buffer.class.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/accounts-contract.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/contract-functions.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/empty-buffer.constants.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/erc20-tokens-poll-interval.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/externally-owned-account-type-id.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/externally-owned-account.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/index.ts (66%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/index.ts (78%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/isc-magic-contract-address.constant.ts (51%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/layer2-tokens-poll-interval.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/target-contracts.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/constants/transfer-allowance.constant.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/enums/abi-type.enum.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/enums/contract-type.enum.ts (77%)
rename packages/shared/{ => src}/lib/core/layer-2/enums/state-mutability-type.enum.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/errors/index.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/errors/layer1-recipient.error.ts (100%)
Expand All @@ -1869,10 +1874,7 @@
rename packages/shared/{lib/core/token/types/native-token-amount.type.ts => src/lib/core/layer-2/interfaces/native-token-amount.interface.ts} (73%)
rename packages/shared/{ => src}/lib/core/layer-2/stores/index.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/tests/parseLayer2MetadataForTransfer.test.ts (63%)
rename packages/shared/{ => src}/lib/core/layer-2/types/abi.type.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/types/contract.type.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/types/evm-transaction-options.type.ts (100%)
rename packages/shared/{ => src}/lib/core/layer-2/types/index.ts (54%)
rename packages/shared/{ => src}/lib/core/layer-2/utils/parseLayer2Metadata.ts (56%)
rename packages/shared/{ => src}/lib/core/ledger/classes/index.ts (100%)
rename packages/shared/{ => src}/lib/core/ledger/constants/ledger-error-locales.constant.ts (100%)
Expand Down Expand Up @@ -1921,7 +1923,6 @@
rename packages/shared/{ => src}/lib/core/network/helpers/getNetworkStatusFromNodeInfo.ts (69%)
rename packages/shared/{ => src}/lib/core/network/helpers/index.ts (100%)
rename packages/shared/{ => src}/lib/core/network/index.ts (100%)
rename packages/shared/{ => src}/lib/core/network/interfaces/block.interface.ts (100%)
rename packages/shared/{ => src}/lib/core/network/interfaces/client-options.interface.ts (54%)
rename packages/shared/{ => src}/lib/core/network/interfaces/connected-chain.interface.ts (100%)
rename packages/shared/{ => src}/lib/core/network/interfaces/evm-addresses.interface.ts (100%)
Expand All @@ -1931,7 +1932,7 @@
rename packages/shared/{ => src}/lib/core/network/interfaces/node-info-response.interface.ts (62%)
rename packages/shared/{ => src}/lib/core/network/interfaces/protocol.interface.ts (62%)
rename packages/shared/{ => src}/lib/core/network/types/network-metadata.type.ts (100%)
rename packages/shared/{ => src}/lib/core/network/types/web3-provider.type.ts (100%)
rename packages/shared/{ => src}/lib/core/network/types/web3-provider.type.ts (54%)
rename packages/shared/{ => src}/lib/core/network/utils/checkNodeUrlValidity.ts (95%)
rename packages/shared/{lib/core/network/utils/getDefaultPersistedNetwork.ts => src/lib/core/network/utils/getDefaultStardustNetwork.ts} (50%)
rename packages/shared/{ => src}/lib/core/network/utils/getEvmTransactionOptions.ts (88%)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<script lang="ts">
import { Table } from '@bloomwalletio/ui'
import { localize } from '@core/i18n'
import { IParsedSmartContractData } from '@core/layer-2'
import { EvmNetworkId } from '@core/network'
import { EvmTransactionAlert } from '.'
export let parsedSmartContract: IParsedSmartContractData
export let networkId: EvmNetworkId
function getMethodSignature(parsedMethod) {
const parameterSignatures = parsedMethod.inputs.map((input) => `${input.name} ${input.type}`)
return `${parsedMethod.name}(${parameterSignatures.join(', ')})`
}
</script>

{#if parsedSmartContract.parsedMethod}
<EvmTransactionAlert
variant="warning"
message={localize('popups.smartContractCall.partiallyVerified')}
{networkId}
contractAddress={parsedSmartContract.recipientAddress}
>
<Table
collapsible
collapsibleTitle={getMethodSignature(parsedSmartContract.parsedMethod)}
items={parsedSmartContract?.parsedMethod.inputs.map((input) => ({
key: input.name,
value: String(input.value) ?? localize('general.unknown'),
}))}
/>
</EvmTransactionAlert>
{:else}
<EvmTransactionAlert
variant="danger"
message={localize('popups.smartContractCall.unableToVerify')}
{networkId}
contractAddress={parsedSmartContract.recipientAddress}
>
<Table
items={[
{
key: localize('general.data'),
value: parsedSmartContract.rawData,
copyable: true,
},
]}
/>
</EvmTransactionAlert>
{/if}
1 change: 1 addition & 0 deletions packages/desktop/components/evm-transactions/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as EvmSmartContractAlert } from './EvmSmartContractAlert.svelte'
export { default as EvmTokenApprovalAlert } from './EvmTokenApprovalAlert.svelte'
export { default as EvmTransactionAlert } from './EvmTransactionAlert.svelte'
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import { DappVerification, RpcMethod } from '@auxiliary/wallet-connect/enums'
import { IConnectedDapp } from '@auxiliary/wallet-connect/interface'
import { CallbackParameters } from '@auxiliary/wallet-connect/types'
import { Table } from '@bloomwalletio/ui'
import { EvmTokenApprovalAlert } from '@components'
import { EvmSmartContractAlert } from '@components/evm-transactions'
import { IAccountState } from '@core/account'
import { getSelectedAccount, selectedAccount } from '@core/account/stores'
import { openUrlInBrowser } from '@core/app'
import { handleError } from '@core/error/handlers'
import { localize } from '@core/i18n'
import {
Expand All @@ -14,9 +14,11 @@
getHexEncodedTransaction,
parseSmartContractDataFromTransactionData,
} from '@core/layer-2'
import { ParsedSmartContractType } from '@core/layer-2/enums/parsed-smart-contract-type.enum'
import { EvmTransactionData } from '@core/layer-2/types'
import { ParsedSmartContractData } from '@core/layer-2/types/parsed-smart-contract-data.type'
import { LedgerAppName } from '@core/ledger'
import { ExplorerEndpoint, IEvmNetwork, getExplorerUrl } from '@core/network'
import { IEvmNetwork } from '@core/network'
import { getNftByIdForAccount } from '@core/nfts/stores'
import { checkActiveProfileAuth } from '@core/profile/actions'
import { getActiveProfileId } from '@core/profile/stores'
Expand All @@ -27,12 +29,9 @@
import { PopupId, closePopup, modifyPopupState, openPopup } from '@desktop/auxiliary/popup'
import { LegacyTransaction } from '@ethereumjs/tx'
import { DappInfo, TransactionAssetSection } from '@ui'
import { EvmTransactionAlert, EvmTokenApprovalAlert } from '@components'
import { EvmTransactionDetails } from '@views/dashboard/send-flow/views/components'
import { onDestroy, onMount } from 'svelte'
import PopupTemplate from '../PopupTemplate.svelte'
import { ParsedSmartContractType } from '@core/layer-2/enums/parsed-smart-contract-type.enum'
import { ParsedSmartContractData } from '@core/layer-2/types/parsed-smart-contract-data.type'
export let preparedTransaction: EvmTransactionData
export let evmNetwork: IEvmNetwork
Expand Down Expand Up @@ -185,11 +184,6 @@
closePopup({ callOnCancel: true })
}
function onExplorerClick(contractAddress: string): void {
const url = getExplorerUrl(evmNetwork.id, ExplorerEndpoint.Address, contractAddress)
openUrlInBrowser(url)
}
let intervalId: NodeJS.Timeout
onMount(async () => {
await setGasPrices()
Expand Down Expand Up @@ -250,33 +244,7 @@
</div>
{:else if parsedData?.type === ParsedSmartContractType.SmartContract}
<div class="flex flex-col gap-3">
<EvmTransactionAlert
variant="warning"
message={localize('popups.smartContractCall.unableToVerify')}
networkId={evmNetwork.id}
contractAddress={String(preparedTransaction.to)}
>
<Table
collapsible
collapsibleTitle={localize('general.details')}
items={[
{
key: localize('general.address'),
value: truncateString(String(preparedTransaction.to), 16, 16),
onClick: () => onExplorerClick(String(preparedTransaction.to)),
},
{ key: localize('general.methodName'), value: parsedData.parsedMethod?.name },
{
key: localize('general.parameters'),
value: parsedData?.parsedMethod?.inputs.reduce((acc, input) => {
acc[input.name] = input.value
return acc
}, {}),
},
{ key: localize('general.data'), value: String(preparedTransaction.data), copyable: true },
]}
/>
</EvmTransactionAlert>
<EvmSmartContractAlert parsedSmartContract={parsedData} networkId={evmNetwork.id} />
</div>
{/if}
<EvmTransactionDetails
Expand Down
41 changes: 41 additions & 0 deletions packages/desktop/public/about.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@font-face {
font-family: 'Silka';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url('./assets/fonts/silka/silka-medium-webfont.woff2') format('woff2');
}

body,
html {
width: 100%;
height: 100%;
user-select: none;
-webkit-user-drag: none;
overflow: hidden;
}

body {
margin: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #ffffff;
background-color: #161926;
font-size: 11px;
font-family: 'Silka';
}

#app-icon {
margin-top: 20px;
-webkit-user-drag: none;
}

#app-version {
margin-bottom: 0.05rem;
}

#footer {
margin-bottom: 30px;
}
Loading

0 comments on commit e9d2609

Please sign in to comment.