@@ -107,29 +107,35 @@ export class DbSyncChainHistoryProvider extends DbSyncProvider() implements Chai
107
107
} ) ;
108
108
if ( txResults . rows . length === 0 ) return [ ] ;
109
109
110
- const [ inputs , outputs , mints , withdrawals , redeemers , metadata , collaterals , certificates ] = await Promise . all ( [
111
- this . #builder. queryTransactionInputsByIds ( ids ) ,
112
- this . #builder. queryTransactionOutputsByIds ( ids ) ,
113
- this . #builder. queryTxMintByIds ( ids ) ,
114
- this . #builder. queryWithdrawalsByTxIds ( ids ) ,
115
- this . #builder. queryRedeemersByIds ( ids ) ,
116
- // Missing witness datums
117
- this . #metadataService. queryTxMetadataByRecordIds ( ids ) ,
118
- this . #builder. queryTransactionInputsByIds ( ids , true ) ,
119
- this . #builder. queryCertificatesByIds ( ids )
120
- ] ) ;
110
+ const [ inputs , outputs , mints , withdrawals , redeemers , metadata , collaterals , certificates , collateralOutputs ] =
111
+ await Promise . all ( [
112
+ this . #builder. queryTransactionInputsByIds ( ids ) ,
113
+ this . #builder. queryTransactionOutputsByIds ( ids ) ,
114
+ this . #builder. queryTxMintByIds ( ids ) ,
115
+ this . #builder. queryWithdrawalsByTxIds ( ids ) ,
116
+ this . #builder. queryRedeemersByIds ( ids ) ,
117
+ // Missing witness datums
118
+ this . #metadataService. queryTxMetadataByRecordIds ( ids ) ,
119
+ this . #builder. queryTransactionInputsByIds ( ids , true ) ,
120
+ this . #builder. queryCertificatesByIds ( ids ) ,
121
+ this . #builder. queryTransactionOutputsByIds ( ids , true )
122
+ ] ) ;
121
123
122
124
return txResults . rows . map ( ( tx ) => {
123
125
const txId = tx . id . toString ( 'hex' ) as unknown as Cardano . TransactionId ;
124
126
const txInputs = orderBy ( inputs . filter ( ( input ) => input . txInputId === txId ) . map ( mapTxIn ) , [ 'index' ] ) ;
125
127
const txCollaterals = orderBy ( collaterals . filter ( ( col ) => col . txInputId === txId ) . map ( mapTxIn ) , [ 'index' ] ) ;
126
128
const txOutputs = orderBy ( outputs . filter ( ( output ) => output . txId === txId ) . map ( mapTxOut ) , [ 'index' ] ) ;
129
+ const txCollateralOutputs = orderBy ( collateralOutputs . filter ( ( output ) => output . txId === txId ) . map ( mapTxOut ) , [
130
+ 'index'
131
+ ] ) ;
127
132
const inputSource : Cardano . InputSource = tx . valid_contract
128
133
? Cardano . InputSource . inputs
129
134
: Cardano . InputSource . collaterals ;
130
135
131
136
return mapTxAlonzo ( tx , {
132
137
certificates : certificates . get ( txId ) ,
138
+ collateralOutputs : txCollateralOutputs ,
133
139
collaterals : txCollaterals ,
134
140
inputSource,
135
141
inputs : txInputs ,
0 commit comments