Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Display notifications about transaction status #52

Closed
danielpetroff opened this issue Feb 14, 2023 · 2 comments
Closed

Display notifications about transaction status #52

danielpetroff opened this issue Feb 14, 2023 · 2 comments
Assignees

Comments

@danielpetroff
Copy link
Contributor

danielpetroff commented Feb 14, 2023

We have a component for notifications here https://github.com/paritytech/capi-multisig-app/blob/main/www/src/components/Notifications.tsx

The notification text we have in Figma is not indicative of chain events. Ex: "Executed transaction Ox34ea34ea...1f0f1f0f"
I suggest we stick with Substrate event / error messages for now.

use transactionStatuses() on the ExtrinsicStatusRune to capture events in real-time

@ryanleecode do we have an example in capi for this? (couldn't find one)

@danielpetroff danielpetroff changed the title MVP 1 - Notifications MVP 1 - Feb 18, 2023
@danielpetroff danielpetroff changed the title MVP 1 - Notifications Feb 18, 2023
@statictype statictype changed the title Notifications Display notifications about transaction status May 12, 2023
@ryanleecode
Copy link
Contributor

@statictype something like this is what im doing

await signedExtrinsicRune
    .sent()
    .dbgStatus("tx status")
    .transactionStatuses((txStatus) => {
      if (typeof txStatus === "string") {
        send({ status: txStatus })
      } else {
        const status = Object.keys(txStatus)[0]!
        switch (status) {
          case "future":
          case "ready":
          case "broadcast":
          case "inBlock":
          case "retracted":
          case "finalityTimeout":
          case "usurped":
          case "dropped":
          case "invalid":
            send({ status })
            break
          case "finalized":
            const hash: string = txStatus["finalized"]! as string
            send({ status, hash })
            break
        }
      }

      return false
    })
    .run()

@statictype statictype self-assigned this Jun 16, 2023
@statictype
Copy link
Contributor

closed in #218

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants