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

SDK: Wait for Bitcoin funding transaction in staking flow #255

Closed
Tracked by #146
nkuba opened this issue Feb 19, 2024 · 0 comments · Fixed by #262
Closed
Tracked by #146

SDK: Wait for Bitcoin funding transaction in staking flow #255

nkuba opened this issue Feb 19, 2024 · 0 comments · Fixed by #262
Assignees
Labels
🔌 SDK TypeScript SDK Library

Comments

@nkuba
Copy link
Member

nkuba commented Feb 19, 2024

No description provided.

@nkuba nkuba mentioned this issue Feb 19, 2024
@nkuba nkuba added the 🔌 SDK TypeScript SDK Library label Feb 19, 2024
nkuba added a commit that referenced this issue Mar 13, 2024
Closes: #255

We want to initiate the stake when we are sure the BTC funding
transaction is visible by Bitcoin node. The default implementation of
minting in tbtc-v2 throws an error when the deposit tx is unavailable.
In our SDK, we make sure the deposit transaction is available and then
initiate minting/staking. Here we add the back off mechanism - the SDK
retires the function that looks for a deposit transaction a `retries`
number of times. The result will return the function's return value if
no exceptions are thrown. In our case, we want to try to find the
deposit transaction 5 times with a 5 seconds backoff step that will be
increased exponentially for subsequent retry attempts. If it fails after
6 tries it will throw an error. The consumer (dapp) can override these
options by passing them to `stake` function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌 SDK TypeScript SDK Library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants