Skip to content

Commit c6466d0

Browse files
committed
fix: bitcoin data encoding
1 parent 116b24f commit c6466d0

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/services/request-handler/index.ts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -856,25 +856,32 @@ export class RequestHandlerService {
856856
const data = encodeAbiParameters(
857857
[
858858
{
859-
type: "tuple[]",
860-
name: "utxos",
859+
type: "tuple",
861860
components: [
862-
{ type: "bytes32", name: "txid" },
863-
{ type: "uint32", name: "index" },
864-
{ type: "uint64", name: "value" },
865-
{ type: "bytes", name: "scriptPubKey" },
861+
{
862+
type: "tuple[]",
863+
name: "utxos",
864+
components: [
865+
{ type: "bytes32", name: "txid" },
866+
{ type: "uint32", name: "index" },
867+
{ type: "uint64", name: "value" },
868+
{ type: "bytes", name: "scriptPubKey" },
869+
],
870+
},
871+
{ type: "uint64", name: "feeRate" },
866872
],
867873
},
868-
{ type: "uint64", name: "feeRate" },
869874
],
870875
[
871-
bitcoinAdditionalData.allocatorUtxos.map((utxo) => ({
872-
txid: toLittleEndianTxid(utxo.txid),
873-
index: utxo.vout,
874-
value: BigInt(utxo.value),
875-
scriptPubKey: allocatorScriptPubKey,
876-
})),
877-
BigInt(bitcoinAdditionalData.feeRate!),
876+
{
877+
utxos: bitcoinAdditionalData.allocatorUtxos.map((utxo) => ({
878+
txid: toLittleEndianTxid(utxo.txid),
879+
index: utxo.vout,
880+
value: BigInt(utxo.value),
881+
scriptPubKey: allocatorScriptPubKey,
882+
})),
883+
feeRate: BigInt(bitcoinAdditionalData.feeRate!),
884+
},
878885
],
879886
);
880887

0 commit comments

Comments
 (0)