-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ethereum confirmed blocks property (#2533)
* feat: enable default evm chains * feat: add ethereum block confirmation poll * chore: type fix * chore: extract constants * feat: add confirmations to local evm transaction type * feat: persist confirmations * fix linter * feat: use inclusion state for EVM transactions * chore: fetch confirmations on hover * feat: confirmationPill -> pending pill --------- Co-authored-by: Mark Nardi <[email protected]>
- Loading branch information
Showing
25 changed files
with
217 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/shared/src/components/pills/ConfirmationPill.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import { Pill } from '@bloomwalletio/ui' | ||
import { Activity, InclusionState } from '@core/activity' | ||
import { localize } from '@core/i18n' | ||
import { getEvmNetwork } from '@core/network/stores' | ||
import { getPersistedTransaction } from '@core/transactions/stores' | ||
export let activity: Activity | ||
let tooltip = '' | ||
async function onHover(): Promise<void> { | ||
tooltip = 'loading...' | ||
const transaction = getPersistedTransaction(activity.transactionId) | ||
const network = getEvmNetwork(activity?.sourceNetworkId) | ||
const blockHeight = await network?.provider.eth.getBlockNumber() | ||
const confirmations = BigInt(blockHeight ?? 0) - BigInt(transaction?.local?.blockNumber ?? 0) | ||
tooltip = ` | ||
${localize('general.confirmed')}: ${confirmations}\n | ||
${localize('general.required')}: ${network?.blocksUntilConfirmed} | ||
` | ||
} | ||
</script> | ||
|
||
{#if activity.inclusionState === InclusionState.Pending} | ||
<div role="contentinfo" on:focus={onHover} on:mouseover={onHover}> | ||
<Pill color="warning" compact tooltipEvent="hover" {tooltip}> | ||
{localize('general.pending')} | ||
</Pill> | ||
</div> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
packages/shared/src/lib/core/activity/enums/activity-status.enum.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.