From b1ef7b599b624a009cd338d74a985d1d315ee13a Mon Sep 17 00:00:00 2001 From: Nishant Ghodke <64554492+iamcrazycoder@users.noreply.github.com> Date: Fri, 29 Sep 2023 10:47:14 +0530 Subject: [PATCH] fix(sdk): update output order to ensure inscription is on 0th index (#74) fix: update output to ensure inscription is on 0th index --- packages/sdk/src/transactions/Inscriber.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/sdk/src/transactions/Inscriber.ts b/packages/sdk/src/transactions/Inscriber.ts index a8b5f696..71d021b2 100644 --- a/packages/sdk/src/transactions/Inscriber.ts +++ b/packages/sdk/src/transactions/Inscriber.ts @@ -119,10 +119,12 @@ export class Inscriber extends PSBTBuilder { ] if (!this.recovery) { - this.outputs.push({ - address: this.destinationAddress || this.address, - value: this.postage - }) + this.outputs = [ + { + address: this.destinationAddress || this.address, + value: this.postage + } + ].concat(this.outputs) } if (this.recovery) { @@ -195,7 +197,7 @@ export class Inscriber extends PSBTBuilder { this.initPSBT() this.suitableUnspent = null this.ready = false - this.outputs.pop() + this.outputs.shift() this.previewMode = false } }