mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Wrap promises with try blocks
This commit is contained in:
@@ -5,15 +5,22 @@ import {
|
||||
|
||||
const examplePrepareRedeemOnchainFunds = async (feeRate: number) => {
|
||||
// ANCHOR: prepare-redeem-onchain-funds
|
||||
const toAddress = 'bc1..'
|
||||
const satPerVbyte = feeRate
|
||||
|
||||
const prepareRedeemOnchainFundsResp = await prepareRedeemOnchainFunds({ toAddress, satPerVbyte })
|
||||
try {
|
||||
const toAddress = 'bc1..'
|
||||
const satPerVbyte = feeRate
|
||||
const prepareRedeemOnchainFundsResp = await prepareRedeemOnchainFunds({ toAddress, satPerVbyte })
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
// ANCHOR_END: prepare-redeem-onchain-funds
|
||||
}
|
||||
|
||||
const exampleRedeemOnchainFunds = async (satPerVbyte: number, toAddress: string) => {
|
||||
// ANCHOR: redeem-onchain-funds
|
||||
const redeemOnchainFundsResp = await redeemOnchainFunds({ toAddress, satPerVbyte })
|
||||
try {
|
||||
const redeemOnchainFundsResp = await redeemOnchainFunds({ toAddress, satPerVbyte })
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
// ANCHOR_END: redeem-onchain-funds
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user