@@ -12,39 +12,40 @@ import (
12
12
)
13
13
14
14
type Transaction struct {
15
- ChainId * big.Int `json:"chain_id" ch:"chain_id" swaggertype:"string"`
16
- Hash string `json:"hash" ch:"hash"`
17
- Nonce uint64 `json:"nonce" ch:"nonce"`
18
- BlockHash string `json:"block_hash" ch:"block_hash"`
19
- BlockNumber * big.Int `json:"block_number" ch:"block_number" swaggertype:"string"`
20
- BlockTimestamp time.Time `json:"block_timestamp" ch:"block_timestamp"`
21
- TransactionIndex uint64 `json:"transaction_index" ch:"transaction_index"`
22
- FromAddress string `json:"from_address" ch:"from_address"`
23
- ToAddress string `json:"to_address" ch:"to_address"`
24
- Value * big.Int `json:"value" ch:"value" swaggertype:"string"`
25
- Gas uint64 `json:"gas" ch:"gas"`
26
- GasPrice * big.Int `json:"gas_price" ch:"gas_price" swaggertype:"string"`
27
- Data string `json:"data" ch:"data"`
28
- FunctionSelector string `json:"function_selector" ch:"function_selector"`
29
- MaxFeePerGas * big.Int `json:"max_fee_per_gas" ch:"max_fee_per_gas" swaggertype:"string"`
30
- MaxPriorityFeePerGas * big.Int `json:"max_priority_fee_per_gas" ch:"max_priority_fee_per_gas" swaggertype:"string"`
31
- MaxFeePerBlobGas * big.Int `json:"max_fee_per_blob_gas" ch:"max_fee_per_blob_gas" swaggertype:"string"`
32
- BlobVersionedHashes []string `json:"blob_versioned_hashes" ch:"blob_versioned_hashes"`
33
- TransactionType uint8 `json:"transaction_type" ch:"transaction_type"`
34
- R * big.Int `json:"r" ch:"r" swaggertype:"string"`
35
- S * big.Int `json:"s" ch:"s" swaggertype:"string"`
36
- V * big.Int `json:"v" ch:"v" swaggertype:"string"`
37
- AccessListJson * string `json:"access_list_json" ch:"access_list"`
38
- ContractAddress * string `json:"contract_address" ch:"contract_address"`
39
- GasUsed * uint64 `json:"gas_used" ch:"gas_used"`
40
- CumulativeGasUsed * uint64 `json:"cumulative_gas_used" ch:"cumulative_gas_used"`
41
- EffectiveGasPrice * big.Int `json:"effective_gas_price" ch:"effective_gas_price" swaggertype:"string"`
42
- BlobGasUsed * uint64 `json:"blob_gas_used" ch:"blob_gas_used"`
43
- BlobGasPrice * big.Int `json:"blob_gas_price" ch:"blob_gas_price" swaggertype:"string"`
44
- LogsBloom * string `json:"logs_bloom" ch:"logs_bloom"`
45
- Status * uint64 `json:"status" ch:"status"`
46
- Sign int8 `json:"sign" ch:"sign"`
47
- InsertTimestamp time.Time `json:"insert_timestamp" ch:"insert_timestamp"`
15
+ ChainId * big.Int `json:"chain_id" ch:"chain_id" swaggertype:"string"`
16
+ Hash string `json:"hash" ch:"hash"`
17
+ Nonce uint64 `json:"nonce" ch:"nonce"`
18
+ BlockHash string `json:"block_hash" ch:"block_hash"`
19
+ BlockNumber * big.Int `json:"block_number" ch:"block_number" swaggertype:"string"`
20
+ BlockTimestamp time.Time `json:"block_timestamp" ch:"block_timestamp"`
21
+ TransactionIndex uint64 `json:"transaction_index" ch:"transaction_index"`
22
+ FromAddress string `json:"from_address" ch:"from_address"`
23
+ ToAddress string `json:"to_address" ch:"to_address"`
24
+ Value * big.Int `json:"value" ch:"value" swaggertype:"string"`
25
+ Gas uint64 `json:"gas" ch:"gas"`
26
+ GasPrice * big.Int `json:"gas_price" ch:"gas_price" swaggertype:"string"`
27
+ Data string `json:"data" ch:"data"`
28
+ FunctionSelector string `json:"function_selector" ch:"function_selector"`
29
+ MaxFeePerGas * big.Int `json:"max_fee_per_gas" ch:"max_fee_per_gas" swaggertype:"string"`
30
+ MaxPriorityFeePerGas * big.Int `json:"max_priority_fee_per_gas" ch:"max_priority_fee_per_gas" swaggertype:"string"`
31
+ MaxFeePerBlobGas * big.Int `json:"max_fee_per_blob_gas" ch:"max_fee_per_blob_gas" swaggertype:"string"`
32
+ BlobVersionedHashes []string `json:"blob_versioned_hashes" ch:"blob_versioned_hashes"`
33
+ TransactionType uint8 `json:"transaction_type" ch:"transaction_type"`
34
+ R * big.Int `json:"r" ch:"r" swaggertype:"string"`
35
+ S * big.Int `json:"s" ch:"s" swaggertype:"string"`
36
+ V * big.Int `json:"v" ch:"v" swaggertype:"string"`
37
+ AccessListJson * string `json:"access_list_json" ch:"access_list"`
38
+ AuthorizationListJson * string `json:"authorization_list_json" ch:"authorization_list"`
39
+ ContractAddress * string `json:"contract_address" ch:"contract_address"`
40
+ GasUsed * uint64 `json:"gas_used" ch:"gas_used"`
41
+ CumulativeGasUsed * uint64 `json:"cumulative_gas_used" ch:"cumulative_gas_used"`
42
+ EffectiveGasPrice * big.Int `json:"effective_gas_price" ch:"effective_gas_price" swaggertype:"string"`
43
+ BlobGasUsed * uint64 `json:"blob_gas_used" ch:"blob_gas_used"`
44
+ BlobGasPrice * big.Int `json:"blob_gas_price" ch:"blob_gas_price" swaggertype:"string"`
45
+ LogsBloom * string `json:"logs_bloom" ch:"logs_bloom"`
46
+ Status * uint64 `json:"status" ch:"status"`
47
+ Sign int8 `json:"sign" ch:"sign"`
48
+ InsertTimestamp time.Time `json:"insert_timestamp" ch:"insert_timestamp"`
48
49
}
49
50
50
51
type DecodedTransactionData struct {
@@ -60,37 +61,38 @@ type DecodedTransaction struct {
60
61
61
62
// TransactionModel represents a simplified Transaction structure for Swagger documentation
62
63
type TransactionModel struct {
63
- ChainId string `json:"chain_id"`
64
- Hash string `json:"hash"`
65
- Nonce uint64 `json:"nonce"`
66
- BlockHash string `json:"block_hash"`
67
- BlockNumber uint64 `json:"block_number"`
68
- BlockTimestamp uint64 `json:"block_timestamp"`
69
- TransactionIndex uint64 `json:"transaction_index"`
70
- FromAddress string `json:"from_address"`
71
- ToAddress string `json:"to_address"`
72
- Value string `json:"value"`
73
- Gas uint64 `json:"gas"`
74
- GasPrice string `json:"gas_price"`
75
- Data string `json:"data"`
76
- FunctionSelector string `json:"function_selector"`
77
- MaxFeePerGas string `json:"max_fee_per_gas"`
78
- MaxPriorityFeePerGas string `json:"max_priority_fee_per_gas"`
79
- MaxFeePerBlobGas * string `json:"max_fee_per_blob_gas,omitempty"`
80
- BlobVersionedHashes []string `json:"blob_versioned_hashes,omitempty"`
81
- TransactionType uint8 `json:"transaction_type"`
82
- R string `json:"r"`
83
- S string `json:"s"`
84
- V string `json:"v"`
85
- AccessListJson * string `json:"access_list_json"`
86
- ContractAddress * string `json:"contract_address"`
87
- GasUsed * uint64 `json:"gas_used"`
88
- CumulativeGasUsed * uint64 `json:"cumulative_gas_used"`
89
- EffectiveGasPrice * string `json:"effective_gas_price"`
90
- BlobGasUsed * uint64 `json:"blob_gas_used"`
91
- BlobGasPrice * string `json:"blob_gas_price"`
92
- LogsBloom * string `json:"logs_bloom"`
93
- Status * uint64 `json:"status"`
64
+ ChainId string `json:"chain_id"`
65
+ Hash string `json:"hash"`
66
+ Nonce uint64 `json:"nonce"`
67
+ BlockHash string `json:"block_hash"`
68
+ BlockNumber uint64 `json:"block_number"`
69
+ BlockTimestamp uint64 `json:"block_timestamp"`
70
+ TransactionIndex uint64 `json:"transaction_index"`
71
+ FromAddress string `json:"from_address"`
72
+ ToAddress string `json:"to_address"`
73
+ Value string `json:"value"`
74
+ Gas uint64 `json:"gas"`
75
+ GasPrice string `json:"gas_price"`
76
+ Data string `json:"data"`
77
+ FunctionSelector string `json:"function_selector"`
78
+ MaxFeePerGas string `json:"max_fee_per_gas"`
79
+ MaxPriorityFeePerGas string `json:"max_priority_fee_per_gas"`
80
+ MaxFeePerBlobGas * string `json:"max_fee_per_blob_gas,omitempty"`
81
+ BlobVersionedHashes []string `json:"blob_versioned_hashes,omitempty"`
82
+ TransactionType uint8 `json:"transaction_type"`
83
+ R string `json:"r"`
84
+ S string `json:"s"`
85
+ V string `json:"v"`
86
+ AccessListJson * string `json:"access_list_json"`
87
+ AuthorizationListJson * string `json:"authorization_list_json"`
88
+ ContractAddress * string `json:"contract_address"`
89
+ GasUsed * uint64 `json:"gas_used"`
90
+ CumulativeGasUsed * uint64 `json:"cumulative_gas_used"`
91
+ EffectiveGasPrice * string `json:"effective_gas_price"`
92
+ BlobGasUsed * uint64 `json:"blob_gas_used"`
93
+ BlobGasPrice * string `json:"blob_gas_price"`
94
+ LogsBloom * string `json:"logs_bloom"`
95
+ Status * uint64 `json:"status"`
94
96
}
95
97
96
98
type DecodedTransactionDataModel struct {
@@ -199,15 +201,16 @@ func (t *Transaction) Serialize() TransactionModel {
199
201
v := t .MaxFeePerBlobGas .String ()
200
202
return & v
201
203
}(),
202
- BlobVersionedHashes : t .BlobVersionedHashes ,
203
- TransactionType : t .TransactionType ,
204
- R : t .R .String (),
205
- S : t .S .String (),
206
- V : t .V .String (),
207
- AccessListJson : t .AccessListJson ,
208
- ContractAddress : t .ContractAddress ,
209
- GasUsed : t .GasUsed ,
210
- CumulativeGasUsed : t .CumulativeGasUsed ,
204
+ BlobVersionedHashes : t .BlobVersionedHashes ,
205
+ TransactionType : t .TransactionType ,
206
+ R : t .R .String (),
207
+ S : t .S .String (),
208
+ V : t .V .String (),
209
+ AccessListJson : t .AccessListJson ,
210
+ AuthorizationListJson : t .AuthorizationListJson ,
211
+ ContractAddress : t .ContractAddress ,
212
+ GasUsed : t .GasUsed ,
213
+ CumulativeGasUsed : t .CumulativeGasUsed ,
211
214
EffectiveGasPrice : func () * string {
212
215
if t .EffectiveGasPrice == nil {
213
216
return nil
0 commit comments