@@ -225,7 +225,7 @@ func (i *indexerService) GetTransactionHistory(
225
225
}
226
226
}
227
227
228
- txs , err := vtxosToTxs (spendable , spent , roundTxids )
228
+ txs , err := i . vtxosToTxs (ctx , spendable , spent , roundTxids )
229
229
if err != nil {
230
230
return nil , err
231
231
}
@@ -456,7 +456,9 @@ func flattenNodes(t [][]tree.Node) []Node {
456
456
return result
457
457
}
458
458
459
- func vtxosToTxs (spendable , spent []domain.Vtxo , roundTxids map [string ]any ) ([]TxHistoryRecord , error ) {
459
+ func (i * indexerService ) vtxosToTxs (
460
+ ctx context.Context , spendable , spent []domain.Vtxo , roundTxids map [string ]any ,
461
+ ) ([]TxHistoryRecord , error ) {
460
462
txs := make ([]TxHistoryRecord , 0 )
461
463
462
464
// Receivals
@@ -525,10 +527,17 @@ func vtxosToTxs(spendable, spent []domain.Vtxo, roundTxids map[string]any) ([]Tx
525
527
resultedAmount := reduceVtxosAmount (resultedVtxos )
526
528
spentAmount := reduceVtxosAmount (vtxosBySpentBy [sb ])
527
529
if spentAmount <= resultedAmount {
528
- continue // settlement or change , ignore
530
+ continue // settlement, ignore
529
531
}
530
-
531
532
vtxo := getVtxo (resultedVtxos , vtxosBySpentBy [sb ])
533
+ if resultedAmount == 0 {
534
+ // send all: fetch the created vtxo to source creation and expiration timestamps
535
+ vtxos , err := i .repoManager .Vtxos ().GetVtxos (ctx , []domain.VtxoKey {{Txid : sb , VOut : 0 }})
536
+ if err != nil {
537
+ return nil , err
538
+ }
539
+ vtxo = vtxos [0 ]
540
+ }
532
541
533
542
commitmentTxid := vtxo .RoundTxid
534
543
virtualTxid := ""
0 commit comments