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

Redemption- select wallet #532

Merged
merged 6 commits into from
Jul 10, 2023
Merged

Redemption- select wallet #532

merged 6 commits into from
Jul 10, 2023

Conversation

r-czajkowski
Copy link
Collaborator

@r-czajkowski r-czajkowski commented Jun 7, 2023

Depends on: keep-network/tbtc-v2#630
Depends on: #523

Check if there is a wallet in network that has enough BTC to handle a redemption request. If such a wallet exists we trigger the submit function and pass the wallet data to this function. Otherwise, the function from the threshold-ts lib throws an error and we set an error message for the amount field.

Check if there is a wallet in network that has enough BTC to handle a
redemption request. If such a wallet exists we trigger the submit
function and pass the wallet data to this function. Otherewise the
function from the threshold-ts lib throws an error and we set an error
message for the `amount` field.
@r-czajkowski r-czajkowski self-assigned this Jun 8, 2023
r-czajkowski added a commit that referenced this pull request Jun 9, 2023
Add a new method to the `ITBTC` interface that requests redemption. The
implementation of this interface uses the `requestRedemption` fn from
`tbtc-v2.ts` lib.

As a temporary soultion here we hardcode the redemption request data in
component- once we merge the
#532 we will
pass these params via props to the component.
@r-czajkowski r-czajkowski mentioned this pull request Jun 9, 2023
To request redemption we need the wallet public key(compressed public
key of the ECDSA Wallet) instead of hash. Here we update wallet data
prop field name to point out that this is a wallet public key not wallet
public key hash.
Base automatically changed from unmint-details to main June 22, 2023 14:41
Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🔥

Tested it out using electrum and goerli contracts + linked tbtc-v2.ts lib and it found the wallet. Left some minor comments here and there.

Since keep-network/tbtc-v2#630 is merged then we could release the new version of tbtc-v2.ts lib and add it here to package.json before we merge it.

src/threshold-ts/tbtc/index.ts Outdated Show resolved Hide resolved
src/threshold-ts/tbtc/index.ts Outdated Show resolved Hide resolved
src/threshold-ts/tbtc/index.ts Outdated Show resolved Hide resolved
To use the latest redemption API.
Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one more comment here:

src/pages/tBTC/Bridge/Unmint.tsx Outdated Show resolved Hide resolved
@r-czajkowski r-czajkowski marked this pull request as ready for review July 10, 2023 13:44
Adjust the code to the latest changes from `tbtc-v2.ts` lib. We must
pass redeemer output script to the `findWalletForRedemption` fn from the
`tbtc-v2.ts` lib. In the dapp we operate on the bitcoin address so we
convert this address to a script under the hood and then call the
function from `tbtc-v2.ts` lib.
Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one small comment

src/pages/tBTC/Bridge/Unmint.tsx Outdated Show resolved Hide resolved
Print errors that will happen on submit function above the `Unmint`
button.
Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🔥

@michalsmiarowski michalsmiarowski merged commit 7c8a3f7 into main Jul 10, 2023
4 of 5 checks passed
@michalsmiarowski michalsmiarowski deleted the redemption-select-wallet branch July 10, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants