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

Solana: Add confirmTransaction endpoint based on web3.js #44

Open
aniketfuryrocks opened this issue Oct 6, 2022 · 3 comments
Open

Solana: Add confirmTransaction endpoint based on web3.js #44

aniketfuryrocks opened this issue Oct 6, 2022 · 3 comments
Assignees

Comments

@aniketfuryrocks
Copy link
Collaborator

Implement the feature confirmTransaction

Feature request moved from issue #40

@Lioncat2002 Lioncat2002 changed the title feat: confirmTransaction Add confirmTransaction endpoint based on web3js Oct 7, 2022
@Lioncat2002 Lioncat2002 changed the title Add confirmTransaction endpoint based on web3js Solana: Add confirmTransaction endpoint based on web3js Oct 7, 2022
@Lioncat2002 Lioncat2002 changed the title Solana: Add confirmTransaction endpoint based on web3js Solana: Add confirmTransaction endpoint based on web3.js Oct 7, 2022
@mschneider
Copy link
Owner

mschneider commented Oct 11, 2022

https://github.com/blockworks-foundation/mango-client-v3/blob/d34d248a3c9a97d51d977139f61cd982278b7f01/src/client.ts#L546

this is a working and well tested implementation for confirmTransaction in typescript
the way this works:

a) define timeout, either by constant time (bad) or by optional BlockhashWithExpiryBlockHeight
b) open a onSignature websocket connection - would leave this out for now and add it later when websockets are working
c) poll every 2 seconds getSignatureStatuses - should work well enough for now

@Lioncat2002
Copy link
Collaborator

Lioncat2002 commented Oct 14, 2022

Implementation based on c done.
After testing, I will open a new PR once the current gets merged

@mschneider
Copy link
Owner

This issue is worked on in #58 given that @pSN0W is not ready yet,
please try to implement a simplified version that uses a blockheight and signature status. Any timing based implementation won’t work reliably

mschneider pushed a commit that referenced this issue Oct 29, 2022
* feat: added confirmTransaction

* refactor: formatting

* refactor: use smaller datatypes

* doc: added documentaion for confirm transaction

* fix: remove timeout in the confirmTransaction function

* refactor: formatting

* chore: rewrite confirmtransaction based on block height

* refactor: rewrite to use the Commitment enums

* fix: added timeout for confirmTransaction

* refactor: change default timeout to be about 3 mins and changed sleep to 500 ms

* refactor: add a timeout of about 2 mins to tests and example

* fix: wrong method params

* fix: failing CI/CD

* fix: overflow error with timeout

* refactor: rename timeout to retries

* fix: wrong method params

* fix: move currentblockheight into while loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants