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

Wrap and implement submitAndAwaitStatus at provider level #3526

Closed
danielbate opened this issue Jan 2, 2025 · 2 comments · Fixed by #3541
Closed

Wrap and implement submitAndAwaitStatus at provider level #3526

danielbate opened this issue Jan 2, 2025 · 2 comments · Fixed by #3541
Assignees
Labels
feat Issue is a feature

Comments

@danielbate
Copy link
Member

danielbate commented Jan 2, 2025

Since #3101, we have used the submitAndAwaitStatus subscription in SDK to submit transactions and poll it's result as part of a TransactionResponse.waitForResult(). This way we package both the transaction and the response for the consumer.

We should expose a more raw version of this endpoint like we do with other operations (simulate, dryRun, getBlobs etc) that still assists with the submission of the request but less heavy lifting with the response. This should reduce friction for consumers with obtaining the results of the subscription.

The expected API will look like so:

const txRequest = await wallet.createTransfer(wallet.address, 100_000);
const response = await provider.sendAndAwaitStatus(txRequest);
// { status: 'success', transactionId: '0x...', receipts: [] }

Ideally the response should use the outcome of #3536.

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

Right now I think we should only do this for the provider, accounts have their own considerations and this is simply providing a slight abstraction over that subscription endpoint.

@danielbate
Copy link
Member Author

Closed by #3541

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 a pull request may close this issue.

1 participant