Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slimy-rockets-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rgbpp-sdk/btc": patch
---

Fix the message of INSUFFICIENT_UTXO error when collection failed
2 changes: 1 addition & 1 deletion packages/btc/src/transaction/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export class TxBuilder {
// If not collected enough satoshi, throw error
const insufficientBalance = collected < targetAmount;
if (insufficientBalance) {
const recommendedDeposit = collected - targetAmount + this.minUtxoSatoshi;
const recommendedDeposit = targetAmount - collected + this.minUtxoSatoshi;
throw TxBuildError.withComment(
ErrorCodes.INSUFFICIENT_UTXO,
`expected: ${targetAmount}, actual: ${collected}. You may wanna deposit more satoshi to prevent the error, for example: ${recommendedDeposit}`,
Expand Down