You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncstake(fundingTxHash?: Hex): Promise<Hex>{if(!this.#signedMessage){thrownewError("Sign message first")}constutxos=awaitthis.#tbtcDeposit.detectFunding()if(utxos.length===0){thrownewError("Deposit not found yet")}// NEW CODE HERE: Find utxo by transaction hash letutxo: BitcoinUtxoif(fundingTxHash){constfoundUtxo=utxos.find(({ transactionHash })=>transactionHash.equals(fundingTxHash),)if(!foundUtxo)thrownewError("Deposit not found yet")utxo=foundUtxo};[utxo]=utxosconst{ transactionHash, outputIndex }=utxoconstdepositFundingTx=extractBitcoinRawTxVectors(awaitthis.#bitcoinClient.getRawTransaction(transactionHash),)const{depositor: _, ...restDepositReceipt}=this.#tbtcDeposit.getReceipt()constrevealDepositInfo={fundingOutputIndex: outputIndex,
...restDepositReceipt,}// TODO: change it to the deposit details submission to the relayer bot.returnthis.#contracts.tbtcDepositor.initializeStake(depositFundingTx,revealDepositInfo,this.#staker,this.#referral,)}
We could improve it for the Ledger Live integration, as we should be able to get a Bitcoin transaction hash while broadcasting it in the staking flow.
Originally posted by @nkuba in #106 (comment)
The text was updated successfully, but these errors were encountered: