From 8c5a56f8b930d01cc9d114d2f6aa1348362d2d1c Mon Sep 17 00:00:00 2001 From: Nishant Ghodke Date: Thu, 28 Sep 2023 11:34:05 +0530 Subject: [PATCH 1/3] fix: create outputs for minimum amount in utxo splitter --- packages/sdk/src/utxos/UTXOManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/src/utxos/UTXOManager.ts b/packages/sdk/src/utxos/UTXOManager.ts index c5745c27..9257c559 100644 --- a/packages/sdk/src/utxos/UTXOManager.ts +++ b/packages/sdk/src/utxos/UTXOManager.ts @@ -44,7 +44,7 @@ export default class UTXOManager extends PSBTBuilder { this.outputs.push({ address: destinationAddress || this.address, - value: amount + value: MINIMUM_AMOUNT_IN_SATS }) } From 373a70f49aacdc804259ed748e8099d318877f66 Mon Sep 17 00:00:00 2001 From: Nishant Ghodke Date: Thu, 28 Sep 2023 11:36:25 +0530 Subject: [PATCH 2/3] feat: add split-utxo npm command to run example --- examples/node/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/node/package.json b/examples/node/package.json index f33f44b6..20dd0919 100644 --- a/examples/node/package.json +++ b/examples/node/package.json @@ -11,7 +11,8 @@ "create-psbt": "node create-psbt", "instant-buy": "node instant-buy", "publish-collection": "node collections", - "build-psbt": "node build-psbt" + "build-psbt": "node build-psbt", + "split-utxo": "node split-utxo" }, "author": "", "license": "ISC", From ef6631bef460b41bb3f23b3297375e89fdac59b7 Mon Sep 17 00:00:00 2001 From: Nishant Ghodke Date: Thu, 28 Sep 2023 13:06:03 +0530 Subject: [PATCH 3/3] fix: fetch all inscriptions to find by outpoint --- packages/sdk/src/instant-trade/InstantTradeBuilder.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/instant-trade/InstantTradeBuilder.ts b/packages/sdk/src/instant-trade/InstantTradeBuilder.ts index b1c458a0..8ed49dbe 100644 --- a/packages/sdk/src/instant-trade/InstantTradeBuilder.ts +++ b/packages/sdk/src/instant-trade/InstantTradeBuilder.ts @@ -66,7 +66,8 @@ export default class InstantTradeBuilder extends PSBTBuilder { throw new Error("set inscription outpoint to the class") } - this.inscription = await this.datasource.getInscription(this.inscriptionOutpoint) + const inscriptions = await this.datasource.getInscriptions({ outpoint: this.inscriptionOutpoint }) + this.inscription = inscriptions.find((inscription) => inscription.outpoint === this.inscriptionOutpoint) if (!this.inscription) { throw new Error("Inscription not found") }