Skip to content

Commit

Permalink
Add 'failed' variant to EdgeTransaction confirmations API
Browse files Browse the repository at this point in the history
  • Loading branch information
samholmes committed Mar 25, 2024
1 parent b6012de commit f015d51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- added: New `'failed'` value to confirmations field on `EdgeTransactions`

## 2.3.0 (2024-03-23)

- added: `EdgeCorePluginOptions.infoPayload`, containing arbitrary JSON provided by the info server.
Expand Down
6 changes: 5 additions & 1 deletion src/core/currency/wallet/currency-wallet-callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ export function watchCurrencyWallet(input: CurrencyWalletInput): void {
const shouldCoreDetermineConfirmations = (
confirmations: EdgeConfirmationState | undefined
): boolean => {
return confirmations !== 'confirmed' && confirmations !== 'dropped'
return (
confirmations !== 'confirmed' &&
confirmations !== 'dropped' &&
confirmations !== 'failed'
)
}

export const determineConfirmations = (
Expand Down
3 changes: 3 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ export type EdgeConfirmationState =
| 'confirmed'
// Dropped from the network without confirmations:
| 'dropped'
// Confirmed, but failed on-chain execution (exceeded gas limit,
// smart-contract failure, etc):
| 'failed'
// We don't know the chain height yet:
| 'syncing'
// No confirmations yet:
Expand Down

0 comments on commit f015d51

Please sign in to comment.