diff --git a/packages/sdk/src/brc20/BRC20TransferBase.ts b/packages/sdk/src/brc20/BRC20TransferBase.ts index 092d641e..7d271edc 100644 --- a/packages/sdk/src/brc20/BRC20TransferBase.ts +++ b/packages/sdk/src/brc20/BRC20TransferBase.ts @@ -47,14 +47,11 @@ export class BRC20TransferBase extends Inscriber { address: address }) const balance = balances.find((b) => b.tick === tick) - if (!balance) { - throw new Error("Owner does not have any balance for this token") - } return { - total: balance.total, - available: balance.available, - transferable: balance.transferable + total: balance?.total || 0, + available: balance?.available || 0, + transferable: balance?.transferable || 0 } } diff --git a/packages/sdk/src/brc20/BRC20TransferExecutor.ts b/packages/sdk/src/brc20/BRC20TransferExecutor.ts index de88809e..e6ad440b 100644 --- a/packages/sdk/src/brc20/BRC20TransferExecutor.ts +++ b/packages/sdk/src/brc20/BRC20TransferExecutor.ts @@ -1,4 +1,5 @@ -import { generateTxUniqueIdentifier, Inscription, processInput, PSBTBuilder } from ".." +import { generateTxUniqueIdentifier, Inscription, processInput } from ".." +import { PSBTBuilder } from "../transactions/PSBTBuilder" import { BRC20TransferBase } from "./BRC20TransferBase" import { BRC20TransferExecutorOptions, BRC20TransferPayloadAttributes } from "./types" @@ -83,7 +84,7 @@ export class BRC20TransferExecutor extends PSBTBuilder { if (!isBRC20TransferInscription) continue - if (content.amt === this.amount.toString()) { + if (content.amt >= this.amount.toString()) { filterInscriptions.push({ ...inscription, content