Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement sendAndAwaitStatus subscription #3541

Merged
merged 40 commits into from
Jan 7, 2025

Conversation

danielbate
Copy link
Member

@danielbate danielbate commented Jan 3, 2025

Release notes

In this release, we:

  • Added a frictionless subscription endpoint for submitting transactions and obtaining it's status

Summary

Added a new method on the provider which wraps the sendAndAwaitStatus subscription. This is a blocking call for consumers that want to frictionlessly submit a transaction and retrieve it's updated status.

The primary gain here is it allows a consumer (especially connector consumers) to package a tx, and then send and receive tx info with minimal SDK abstraction.

Usage:

const txRequest = new ScriptTransactionRequest();
txRequest.addResources(resources);
const { transactionId, status, receipts } = await provider.sendTransactionAndAwaitStatus(txRequest);

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@danielbate danielbate added the feat Issue is a feature label Jan 3, 2025
@danielbate danielbate self-assigned this Jan 3, 2025
Copy link

vercel bot commented Jan 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 11:33am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 11:33am
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 11:33am

@Dhaiwat10
Copy link
Member

This is awesome. Thanks @danielbate

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Coverage Report:

Lines Branches Functions Statements
76.97%(+0.02%) 70.53%(+0.12%) 75.02%(+0.01%) 76.97%(+0.02%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/account.ts 78.23%
(+0%)
65.27%
(+1.39%)
80%
(+0%)
78.03%
(+0%)
🔴 packages/account/src/providers/provider.ts 69.14%
(+0.44%)
58.08%
(+1.23%)
71.27%
(+0.31%)
68.85%
(+0.42%)

@danielbate danielbate merged commit 40d9960 into master Jan 7, 2025
24 checks passed
@danielbate danielbate deleted the db/feat/send-and-await-status branch January 7, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrap and implement submitAndAwaitStatus at provider level
6 participants