Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

feat: add misc methods to ExtrinsicStatusRune + processing stages example #1176

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

harrysolovay
Copy link
Contributor

@harrysolovay harrysolovay commented Jul 13, 2023

@SaltyCucumber

Allows one to attain promises corresponding to other transaction statuses.

One such example is the ready method, which resolves to true (or unhandles with a NeverReadyError).

const sent = westendDev.Balances
  .transfer({
    value: 12345n,
    dest: billy.address,
  })
  .signed(signature({ sender: alexa }))
  .sent()

/// Attach callbacks to the pending status-specific promises.
sent.ready().run().then(() => console.log(`Ready`))
sent.inBlock().run().then((hash) => console.log(`In block ${hash}`))
sent.finalized().run().then((hash) => console.log(`Finalized ${hash}`))

@VadimSaveljev
Copy link
Contributor

I vote for having this ready method + not making transactionStatuses private (just in case)

@harrysolovay harrysolovay changed the title feat: add ready method to ExtrinsicStatusRune + processing stages example feat: add misc methods to ExtrinsicStatusRune + processing stages example Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants