1
- // Copyright 2023 Blink Labs Software
1
+ // Copyright 2025 Blink Labs Software
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package chainsync
17
17
import (
18
18
"github.com/blinklabs-io/gouroboros/cbor"
19
19
"github.com/blinklabs-io/gouroboros/ledger"
20
+ lcommon "github.com/blinklabs-io/gouroboros/ledger/common"
20
21
)
21
22
22
23
type TransactionContext struct {
@@ -28,18 +29,19 @@ type TransactionContext struct {
28
29
}
29
30
30
31
type TransactionEvent struct {
31
- Transaction ledger.Transaction `json:"-"`
32
- BlockHash string `json:"blockHash"`
33
- TransactionCbor byteSliceJsonHex `json:"transactionCbor,omitempty"`
34
- Inputs []ledger.TransactionInput `json:"inputs"`
35
- Outputs []ledger.TransactionOutput `json:"outputs"`
36
- Certificates []ledger.Certificate `json:"certificates,omitempty"`
37
- ReferenceInputs []ledger.TransactionInput `json:"referenceInputs,omitempty"`
38
- Metadata * cbor.LazyValue `json:"metadata,omitempty"`
39
- Fee uint64 `json:"fee"`
40
- TTL uint64 `json:"ttl,omitempty"`
41
- ResolvedInputs []ledger.TransactionOutput `json:"resolvedInputs,omitempty"`
42
- Withdrawals map [string ]uint64 `json:"withdrawals,omitempty"`
32
+ Transaction ledger.Transaction `json:"-"`
33
+ BlockHash string `json:"blockHash"`
34
+ TransactionCbor byteSliceJsonHex `json:"transactionCbor,omitempty"`
35
+ Inputs []ledger.TransactionInput `json:"inputs"`
36
+ Outputs []ledger.TransactionOutput `json:"outputs"`
37
+ Certificates []ledger.Certificate `json:"certificates,omitempty"`
38
+ ReferenceInputs []ledger.TransactionInput `json:"referenceInputs,omitempty"`
39
+ Metadata * cbor.LazyValue `json:"metadata,omitempty"`
40
+ Fee uint64 `json:"fee"`
41
+ TTL uint64 `json:"ttl,omitempty"`
42
+ ResolvedInputs []ledger.TransactionOutput `json:"resolvedInputs,omitempty"`
43
+ Withdrawals map [string ]uint64 `json:"withdrawals,omitempty"`
44
+ Witnesses lcommon.TransactionWitnessSet `json:"witnesses,omitempty"`
43
45
}
44
46
45
47
func NewTransactionContext (
@@ -70,6 +72,7 @@ func NewTransactionEvent(
70
72
Inputs : tx .Inputs (),
71
73
Outputs : tx .Outputs (),
72
74
Fee : tx .Fee (),
75
+ Witnesses : tx .Witnesses (),
73
76
}
74
77
if includeCbor {
75
78
evt .TransactionCbor = tx .Cbor ()
0 commit comments