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

feat: add SignedExtrinsicRune from and fromHex methods #853

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

harrysolovay
Copy link
Contributor

A follow-up to #756

Simplifies taking a signed extrinsic hex and turning it into a SignedExtrinsicRune (ostensibly for submission).

// Create and sign the extrinsic. Extract the hex.
const hex = await Balances
  .transfer({
    value: 12345n,
    dest: billy.address,
  })
  .signed(signature({ sender: alexa }))
  .hex()
  .run()

// Save `hex` however you'd like (potentially sending to a relayer service,
// writing to disk, etc.).
save(hex)

// Hydrate the signed extrinsic, submit it and await finalization.
await SignedExtrinsicRune
  .fromHex(chain, hex)
  .sent()
  .dbgStatus("Tx status:")
  .finalized()
  .run()

@harrysolovay harrysolovay requested a review from tjjfvi as a code owner April 6, 2023 21:41
@harrysolovay harrysolovay added this pull request to the merge queue Apr 6, 2023
Merged via the queue into main with commit 56743de Apr 6, 2023
@harrysolovay harrysolovay deleted the offline-signing branch April 6, 2023 22:16
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