Skip to content

Commit

Permalink
Update requestRedemption API
Browse files Browse the repository at this point in the history
Adjust request redemption function to the latest changes from
`tbtc-v2.ts` lib. See keep-network/tbtc-v2#632
  • Loading branch information
r-czajkowski committed Jul 6, 2023
1 parent c56ad55 commit cb076fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
14 changes: 4 additions & 10 deletions src/components/Modal/tBTC/InitiateUnminting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,16 @@ const InitiateUnmintingBase: FC<InitiateUnmintingProps> = ({
// TODO: Temporary solution- we will pass this data via props once we merge
// https://github.com/threshold-network/token-dashboard/pull/532
const walletPublicKey =
"028ed84936be6a9f594a2dcc636d4bebf132713da3ce4dac5c61afbf8bbb47d6f7"
"025183c15164e1b2211eb359fce2ceeefc3abad3af6d760cc6355f9de99bf60229"
const utxo: UnspentTransactionOutput = {
transactionHash: Hex.from(
"0x5b6d040eb06b3de1a819890d55d251112e55c31db4a3f5eb7cfacf519fad7adb"
"0xda0e364abb3ed952bcc694e48bbcff19131ba9513fe981b303fa900cff0f9fbc"
),
outputIndex: 0,
value: BigNumber.from("791613461"),
value: BigNumber.from("164380000"),
}

await sendTransaction(
account!,
walletPublicKey,
utxo,
btcAddress,
unmintAmount
)
await sendTransaction(walletPublicKey, utxo, btcAddress, unmintAmount)
}

return (
Expand Down
8 changes: 1 addition & 7 deletions src/threshold-ts/tbtc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ export interface ITBTC {

/**
* Requests a redemption from the on-chain Bridge contract.
* @param redeemer On-chain identifier of the redeemer.
* @param walletPublicKey The Bitcoin public key of the wallet. Must be in
* the compressed form (33 bytes long with 02 or 03 prefix).
* @param mainUtxo The main UTXO of the wallet. Must match the main UTXO
Expand All @@ -217,7 +216,6 @@ export interface ITBTC {
* @returns Transaction hash of the request redemption transaction.
*/
requestRedemption(
redeemer: string,
walletPublicKey: string,
mainUtxo: UnspentTransactionOutput,
btcAddress: string,
Expand Down Expand Up @@ -666,7 +664,6 @@ export class TBTC implements ITBTC {
}

requestRedemption = async (
redeemer: string,
walletPublicKey: string,
mainUtxo: UnspentTransactionOutput,
btcAddress: string,
Expand All @@ -683,13 +680,10 @@ export class TBTC implements ITBTC {
}

const tx = await requestRedemption(
getChainIdentifier(redeemer),
walletPublicKey,
mainUtxo,
createOutputScriptFromAddress(btcAddress),
createOutputScriptFromAddress(btcAddress).toString(),
BigNumber.from(amount),
getChainIdentifier(this._tbtcVault.address),
this._bridge,
this._token
)

Expand Down

0 comments on commit cb076fb

Please sign in to comment.