From f7ba6bb3ae1fa4ad68b88d34c1cfe03f487cb44d Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 24 Apr 2022 09:15:10 -0700 Subject: [PATCH] fix(Utxo.get()): Hydrating mint batons for tokens --- src/utxo.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utxo.js b/src/utxo.js index cff27f3..f873407 100644 --- a/src/utxo.js +++ b/src/utxo.js @@ -157,10 +157,14 @@ class UTXO { // Hydrate the UTXOs with additional token data. type1TokenUtxos = await this.hydrateTokenData(type1TokenUtxos) + // Collect and hydrate any baton UTXOs const bchUtxos = utxos.filter(x => x.isSlp === false) - const type1BatonUtxos = utxos.filter( + let type1BatonUtxos = utxos.filter( x => x.isSlp === true && x.type === 'baton' ) + type1BatonUtxos = await this.hydrateTokenData(type1BatonUtxos) + + // Isolate any UTXOs that are marked null by the SLP indexer. const nullUtxos = utxos.filter(x => x.isSlp === null) const outObj = {