-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.go
868 lines (738 loc) · 25 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
package daemon
// RPCResultFooter contains the set of fields that every RPC result message
// will contain.
//
type RPCResultFooter struct {
// Status dictates whether the request worked or not. "OK" means good.
//
Status string `json:"status"`
// States if the result is obtained using the bootstrap mode, and is
// therefore not trusted (`true`), or when the daemon is fully synced
// and thus handles the RPC locally (`false`).
//
Untrusted bool `json:"untrusted"`
// Credits indicates the number of credits available to the requesting
// client, if payment for RPC is enabled, otherwise, 0.
//
Credits uint64 `json:"credits,omitempty"`
// TopHash is the hash of the highest block in the chain, If payment
// for RPC is enabled, otherwise, empty.
//
TopHash string `json:"top_hash,omitempty"`
}
// GetAlternateChainsResult is the result of a call to the GetAlternateChains
// RPC method.
//
type GetAlternateChainsResult struct {
// Chains is the array of alternate chains seen by the node.
//
Chains []struct {
// BlockHash is the hash of the first diverging block of this
// alternative chain.
//
BlockHash string `json:"block_hash"`
// BlockHashes TODO
//
BlockHashes []string `json:"block_hashes"`
// Difficulty is the cumulative difficulty of all blocks in the
// alternative chain.
//
Difficulty int64 `json:"difficulty"`
// DifficultyTop64 is the most-significant 64 bits of the
// 128-bit network difficulty.
//
DifficultyTop64 int `json:"difficulty_top64"`
// Height is the block height of the first diverging block of
// this alternative chain.
//
Height uint64 `json:"height"`
// Length is the length in blocks of this alternative chain,
// after divergence.
//
Length uint64 `json:"length"`
// MainChainParentBlock TODO
//
MainChainParentBlock string `json:"main_chain_parent_block"`
// WideDifficulty is the network difficulty as a hexadecimal
// string representing a 128-bit number.
//
WideDifficulty string `json:"wide_difficulty"`
} `json:"chains"`
RPCResultFooter `json:",inline"`
}
// AccessTrackingResult is the result of a call to the RPCAccessTracking RPC
// method.
//
type RPCAccessTrackingResult struct {
Data []struct {
// Count is the number of times that the monero daemon received
// a request for this RPC method.
//
Count uint64 `json:"count"`
// RPC is the name of the remote procedure call.
//
RPC string `json:"rpc"`
// Time indicates how much time the daemon spent serving this
// procedure.
//
Time uint64 `json:"time"`
// Credits indicates the number of credits consumed for this
// method.
//
Credits uint64 `json:"credits"`
} `json:"data"`
RPCResultFooter `json:",inline"`
}
// HardForkInfoResult is the result of a call to the HardForkInfo RPC method.
//
type HardForkInfoResult struct {
// EarliestHeight is the earliest height at which <version> is allowed.
//
EarliestHeight int `json:"earliest_height"`
// Whether of not the hard fork is enforced.
//
Enabled bool `json:"enabled"`
// State indicates the current hard fork state:
//
// 0 - likely forked
// 1 - update needed
// 2 - ready
//
State int `json:"state"`
// The number of votes required to enable <version>.
//
Threshold int `json:"threshold"`
// Version (<version>) corresponds to the major block version for the
// fork.
//
Version int `json:"version"`
// Votes is the number of votes to enable <version>
//
Votes int `json:"votes"`
// Voting indicates which version this node is voting for/using.
//
Voting int `json:"voting"`
// Window is the size of the voting window.
//
Window int `json:"window"`
RPCResultFooter `json:",inline"`
}
// GetVersionResult is the result of a call to the GetVersion RPC method.
//
type GetVersionResult struct {
Release bool `json:"release"`
Version uint64 `json:"version"`
RPCResultFooter `json:",inline"`
}
// GetBansResult is the result of a call to the GetBans RPC method.
//
type GetBansResult struct {
// Bans contains the list of nodes banned by this node.
//
Bans []struct {
// Host is the string representation of the node that is
// banned.
//
Host string `json:"host"`
// IP is the integer representation of the host banned.
//
IP int `json:"ip"`
// Seconds represents how many seconds are left for the ban to
// be lifted.
//
Seconds uint `json:"seconds"`
} `json:"bans"`
RPCResultFooter `json:",inline"`
}
// SetBansResult is the result of a call to the SetBans RPC method.
//
type SetBansResult struct {
RPCResultFooter `json:",inline"`
}
// GetFeeEstimateResult is the result of a call to the GetFeeEstimate RPC
// method.
//
type GetFeeEstimateResult struct {
// Fee is the per kB fee estimate.
//
Fee int `json:"fee"`
// QuantizationMask indicates that the fee should be rounded up to an
// even multiple of this value.
//
QuantizationMask int `json:"quantization_mask"`
RPCResultFooter `json:",inline"`
}
// GetInfoResult is the result of a call to the GetInfo RPC method.
//
type GetInfoResult struct {
AdjustedTime uint64 `json:"adjusted_time"`
AltBlocksCount int `json:"alt_blocks_count"`
BlockSizeLimit uint64 `json:"block_size_limit"`
BlockSizeMedian uint64 `json:"block_size_median"`
BlockWeightLimit uint64 `json:"block_weight_limit"`
BlockWeightMedian uint64 `json:"block_weight_median"`
BootstrapDaemonAddress string `json:"bootstrap_daemon_address"`
BusySyncing bool `json:"busy_syncing"`
CumulativeDifficulty int64 `json:"cumulative_difficulty"`
CumulativeDifficultyTop64 uint64 `json:"cumulative_difficulty_top64"`
DatabaseSize uint64 `json:"database_size"`
Difficulty uint64 `json:"difficulty"`
DifficultyTop64 uint64 `json:"difficulty_top64"`
FreeSpace uint64 `json:"free_space"`
GreyPeerlistSize uint `json:"grey_peerlist_size"`
Height uint64 `json:"height"`
HeightWithoutBootstrap uint64 `json:"height_without_bootstrap"`
IncomingConnectionsCount uint `json:"incoming_connections_count"`
Mainnet bool `json:"mainnet"`
Nettype string `json:"nettype"`
Offline bool `json:"offline"`
OutgoingConnectionsCount uint `json:"outgoing_connections_count"`
RPCConnectionsCount uint `json:"rpc_connections_count"`
Stagenet bool `json:"stagenet"`
StartTime uint64 `json:"start_time"`
Synchronized bool `json:"synchronized"`
Target uint64 `json:"target"`
TargetHeight uint64 `json:"target_height"`
Testnet bool `json:"testnet"`
TopBlockHash string `json:"top_block_hash"`
TxCount uint64 `json:"tx_count"`
TxPoolSize uint64 `json:"tx_pool_size"`
UpdateAvailable bool `json:"update_available"`
Version string `json:"version"`
WasBootstrapEverUsed bool `json:"was_bootstrap_ever_used"`
WhitePeerlistSize uint `json:"white_peerlist_size"`
WideCumulativeDifficulty string `json:"wide_cumulative_difficulty"`
WideDifficulty string `json:"wide_difficulty"`
RPCResultFooter `json:",inline"`
}
// GetBlockTemplateResult is the result of a call to the GetBlockTemplate RPC
// method.
//
type GetBlockTemplateResult struct {
// BlockhashingBlob is the blob on which to try to find a valid nonce.
//
BlockhashingBlob string `json:"blockhashing_blob"`
// BlocktemplateBlob is the blob on which to try to mine a new block.
//
BlocktemplateBlob string `json:"blocktemplate_blob"`
// Difficulty is the difficulty of the next block.
Difficulty int64 `json:"difficulty"`
// ExpectedReward is the coinbase reward expected to be received if the
// block is successfully mined.
//
ExpectedReward int64 `json:"expected_reward"`
// Height is the height on which to mine.
//
Height int `json:"height"`
// PrevHash is the hash of the most recent block on which to mine the
// next block.
//
PrevHash string `json:"prev_hash"`
// ReservedOffset TODO
//
ReservedOffset int `json:"reserved_offset"`
RPCResultFooter `json:",inline"`
}
type Peer struct {
Host string `json:"host"`
ID uint64 `json:"id"`
IP uint32 `json:"ip"`
LastSeen int64 `json:"last_seen"`
Port uint16 `json:"port"`
PruningSeed uint32 `json:"pruning_seed"`
RPCPort uint16 `json:"rpc_port"`
}
// GetPeerListResult is the result of a call to the GetPeerList RPC method.
//
type GetPeerListResult struct {
GrayList []Peer `json:"gray_list"`
WhiteList []Peer `json:"white_list"`
RPCResultFooter `json:",inline"`
}
// GetConnectionsResult is the result of a call to the GetConnections RPC
// method.
//
type GetConnectionsResult struct {
Connections []struct {
Address string `json:"address"`
AvgDownload uint64 `json:"avg_download"`
AvgUpload uint64 `json:"avg_upload"`
ConnectionID string `json:"connection_id"`
CurrentDownload uint64 `json:"current_download"`
CurrentUpload uint64 `json:"current_upload"`
Height uint64 `json:"height"`
Host string `json:"host"`
Incoming bool `json:"incoming"`
IP string `json:"ip"`
LiveTime uint64 `json:"live_time"`
LocalIP bool `json:"local_ip"`
Localhost bool `json:"localhost"`
PeerID string `json:"peer_id"`
Port string `json:"port"`
RecvCount uint64 `json:"recv_count"`
RecvIdleTime uint64 `json:"recv_idle_time"`
SendCount uint64 `json:"send_count"`
SendIdleTime uint64 `json:"send_idle_time"`
State string `json:"state"`
SupportFlags uint64 `json:"support_flags"`
} `json:"connections"`
RPCResultFooter `json:",inline"`
}
type GetOutsResult struct {
Outs []struct {
Height uint64 `json:"height"`
Key string `json:"key"`
Mask string `json:"mask"`
Txid string `json:"txid"`
Unlocked bool `json:"unlocked"`
} `json:"outs"`
RPCResultFooter `json:",inline"`
}
// GetHeightResult is the result of a call to the GetHeight RPC method.
//
type GetHeightResult struct {
Hash string `json:"hash"`
Height uint64 `json:"height"`
RPCResultFooter `json:",inline"`
}
// GetNetStatsResult is the result of a call to the GetNetStats RPC method.
//
type GetNetStatsResult struct {
StartTime int64 `json:"start_time"`
TotalBytesIn uint64 `json:"total_bytes_in"`
TotalBytesOut uint64 `json:"total_bytes_out"`
TotalPacketsIn uint64 `json:"total_packets_in"`
TotalPacketsOut uint64 `json:"total_packets_out"`
RPCResultFooter `json:",inline"`
}
// GetPublicNodesResult is the result of a call to the GetPublicNodes RPC
// method.
//
type GetPublicNodesResult struct {
WhiteList []Peer `json:"white"`
GrayList []Peer `json:"gray"`
RPCResultFooter `json:",inline"`
}
// GenerateBlocksResult is the result of a call to the GenerateBlocks RPC
// method.
//
type GenerateBlocksResult struct {
Blocks []string `json:"blocks"`
Height int `json:"height"`
RPCResultFooter `json:",inline"`
}
// GetBlockCountResult is the result of a call to the GetBlockCount RPC method.
//
type GetBlockCountResult struct {
Count uint64 `json:"count"`
RPCResultFooter `json:",inline"`
}
// RelayTxResult is the result of a call to the RelayTx RPC method.
//
type RelayTxResult struct {
RPCResultFooter `json:",inline"`
}
// GetCoinbaseTxSumResult is the result of a call to the GetCoinbaseTxSum RPC
// method.
//
type GetCoinbaseTxSumResult struct {
EmissionAmount int64 `json:"emission_amount"`
EmissionAmountTop64 int `json:"emission_amount_top64"`
FeeAmount int `json:"fee_amount"`
FeeAmountTop64 int `json:"fee_amount_top64"`
WideEmissionAmount string `json:"wide_emission_amount"`
WideFeeAmount string `json:"wide_fee_amount"`
RPCResultFooter `json:",inline"`
}
type BlockHeader struct {
// BlockSize is the block size in bytes.
//
BlockSize uint64 `json:"block_size"`
// BlockWeight TODO
//
BlockWeight uint64 `json:"block_weight"`
// CumulativeDifficulty is the cumulative difficulty of all
// blocks up to this one.
//
CumulativeDifficulty uint64 `json:"cumulative_difficulty"`
// CumulativeDifficultyTop64 most significant 64 bits of the
// 128-bit cumulative difficulty.
//
CumulativeDifficultyTop64 uint64 `json:"cumulative_difficulty_top64"`
// Depth is the number of blocks succeeding this block on the
// blockchain. (the larger this number, the oldest this block
// is).
//
Depth uint64 `json:"depth"`
// Difficulty is the difficulty that was set for mining this block.
//
Difficulty uint64 `json:"difficulty"`
// DifficultyTop64 corresponds to the most significant 64-bit of
// the 128-bit difficulty.
//
DifficultyTop64 uint64 `json:"difficulty_top64"`
// Hash is the hash of this block.
//
Hash string `json:"hash"`
// Height is the number of blocks preceding this block on the
// blockchain.
//
Height uint64 `json:"height"`
// LongTermWeight TODO
//
LongTermWeight uint64 `json:"long_term_weight"`
// MajorVersion is the major version of the monero protocol at
// this block height.
//
MajorVersion uint `json:"major_version"`
// MinerTxHash TODO
//
MinerTxHash string `json:"miner_tx_hash"`
// MinorVersion is the minor version of the monero protocol at
// this block height.
//
MinorVersion uint `json:"minor_version"`
// Nonce is the cryptographic random one-time number used in
// mining this block.
//
Nonce uint64 `json:"nonce"`
// NumTxes is the number of transactions in this block, not
// counting the coinbase tx.
//
NumTxes uint `json:"num_txes"`
// OrphanStatus indicates whether this block is part of the
// longest chain or not (true == not part of it).
//
OrphanStatus bool `json:"orphan_status"`
// PowHash TODO
//
PowHash string `json:"pow_hash"`
// PrevHash is the hash of the block immediately preceding this
// block in the chain.
//
PrevHash string `json:"prev_hash"`
// Reward the amount of new atomic-units generated in this
// block and rewarded to the miner (1XMR = 1e12 atomic units).
//
Reward uint64 `json:"reward"`
// Timestamp is the unix timestamp at which the block was
// recorded into the blockchain.
//
Timestamp int64 `json:"timestamp"`
// WideCumulativeDifficulty is the cumulative difficulty of all
// blocks in the blockchain as a hexadecimal string
// representing a 128-bit number.
//
WideCumulativeDifficulty string `json:"wide_cumulative_difficulty"`
// WideDifficulty is the network difficulty as a hexadecimal
// string representing a 128-bit number.
//
WideDifficulty string `json:"wide_difficulty"`
}
// GetBlockResult is the result of a call to the GetBlock RPC method.
//
type GetBlockResult struct {
// Blob is a hexadecimal representation of the block.
//
Blob string `json:"blob"`
// BlockHeader contains the details from the block header.
//
BlockHeader BlockHeader `json:"block_header"`
// JSON is a json representation of the block - see
// `GetBlockResultJSON`.
//
JSON string `json:"json"`
// MinerTxHash is the hash of the coinbase transaction
//
MinerTxHash string `json:"miner_tx_hash"`
RPCResultFooter `json:",inline"`
}
// GetBlockResultJSON is the internal json-formatted block information.
//
type GetBlockResultJSON struct {
// MajorVersion (same as in the block header)
//
MajorVersion uint `json:"major_version"`
// MinorVersion (same as in the block header)
//
MinorVersion uint `json:"minor_version"`
// Timestamp (same as in the block header)
//
Timestamp uint64 `json:"timestamp"`
// PrevID (same as `block_hash` in the block header)
//
PrevID string `json:"prev_id"`
// Nonce (same as in the block header)
//
Nonce int `json:"nonce"`
// MinerTx contains the miner transaction information.
//
MinerTx struct {
// Version is the transaction version number
//
Version int `json:"version"`
// UnlockTime is the block height when the coinbase transaction
// becomes spendable.
//
UnlockTime int `json:"unlock_time"`
// Vin lists the transaction inputs.
//
Vin []struct {
Gen struct {
Height int `json:"height"`
} `json:"gen"`
} `json:"vin"`
// Vout lists the transaction outputs.
//
Vout []struct {
Amount uint64 `json:"amount"`
Target struct {
Key string `json:"key"`
} `json:"target"`
} `json:"vout"`
// Extra (aka the transaction id) can be used to include any
// random 32byte/64char hex string.
//
Extra []int `json:"extra"`
// RctSignatures contain the signatures of tx signers.
//
// ps.: coinbase txs DO NOT have signatures.
//
RctSignatures struct {
Type int `json:"type"`
} `json:"rct_signatures"`
} `json:"miner_tx"`
// TxHashes is the list of hashes of non-coinbase transactions in the
// block.
//
TxHashes []string `json:"tx_hashes"`
}
func (c *GetBlockResultJSON) MinerOutputs() uint64 {
res := uint64(0)
for _, vout := range c.MinerTx.Vout {
res += vout.Amount
}
return res
}
// SyncInfoResult is the result of a call to the SyncInfo RPC method.
//
type SyncInfoResult struct {
Credits uint64 `json:"credits"`
Height uint64 `json:"height"`
NextNeededPruningSeed uint64 `json:"next_needed_pruning_seed"`
Overview string `json:"overview"`
Status string `json:"status"`
TargetHeight uint64 `json:"target_height"`
TopHash string `json:"top_hash"`
Untrusted bool `json:"untrusted"`
Peers []struct {
Info struct {
Address string `json:"address"`
AddressType uint64 `json:"address_type"`
AvgDownload uint64 `json:"avg_download"`
AvgUpload uint64 `json:"avg_upload"`
ConnectionID string `json:"connection_id"`
CurrentDownload uint64 `json:"current_download"`
CurrentUpload uint64 `json:"current_upload"`
Height uint64 `json:"height"`
Host string `json:"host"`
IP string `json:"ip"`
Incoming bool `json:"incoming"`
LiveTime uint64 `json:"live_time"`
LocalIP bool `json:"local_ip"`
Localhost bool `json:"localhost"`
PeerID string `json:"peer_id"`
Port string `json:"port"`
PruningSeed uint64 `json:"pruning_seed"`
RPCCreditsPerHash uint64 `json:"rpc_credits_per_hash"`
RPCPort uint64 `json:"rpc_port"`
RecvCount uint64 `json:"recv_count"`
RecvIdleTime uint64 `json:"recv_idle_time"`
SendCount uint64 `json:"send_count"`
SendIdleTime uint64 `json:"send_idle_time"`
State string `json:"state"`
SupportFlags int `json:"support_flags"`
} `json:"info"`
} `json:"peers"`
RPCResultFooter `json:",inline"`
}
// GetLastBlockHeaderResult is the result of a call to the GetLastBlockHeader
// RPC method.
//
type GetLastBlockHeaderResult struct {
BlockHeader BlockHeader `json:"block_header"`
RPCResultFooter `json:",inline"`
}
// GetBlockHeadersRangeResult is the result of a call to the
// GetBlockHeadersRange RPC method.
//
type GetBlockHeadersRangeResult struct {
Headers []BlockHeader `json:"headers"`
RPCResultFooter `json:",inline"`
}
// GetBlockHeaderByHeightResult is the result of a call to the
// GetBlockHeaderByHeight RPC method.
//
type GetBlockHeaderByHeightResult struct {
BlockHeader BlockHeader `json:"block_header"`
RPCResultFooter `json:",inline"`
}
// GetBlockHeaderByHashResult is the result of a call to the
// GetBlockHeaderByHash RPC method.
//
type GetBlockHeaderByHashResult struct {
BlockHeader BlockHeader `json:"block_header"`
BlockHeaders []BlockHeader `json:"block_headers"`
RPCResultFooter `json:",inline"`
}
type MiningStatusResult struct {
Active bool `json:"active"`
Address string `json:"address"`
BgIdleThreshold int `json:"bg_idle_threshold"`
BgIgnoreBattery bool `json:"bg_ignore_battery"`
BgMinIdleSeconds uint64 `json:"bg_min_idle_seconds"`
BgTarget uint64 `json:"bg_target"`
BlockReward uint64 `json:"block_reward"`
BlockTarget uint64 `json:"block_target"`
Difficulty uint64 `json:"difficulty"`
DifficultyTop64 uint64 `json:"difficulty_top64"`
IsBackgroundMiningEnabled bool `json:"is_background_mining_enabled"`
PowAlgorithm string `json:"pow_algorithm"`
Speed uint64 `json:"speed"`
ThreadsCount uint64 `json:"threads_count"`
WideDifficulty string `json:"wide_difficulty"`
RPCResultFooter `json:",inline"`
}
// GetTransactionPoolStatsResult is the result of a call to the
// GetTransactionPoolStats RPC method.
//
type GetTransactionPoolStatsResult struct {
PoolStats struct {
BytesMax uint64 `json:"bytes_max"`
BytesMed uint64 `json:"bytes_med"`
BytesMin uint64 `json:"bytes_min"`
BytesTotal uint64 `json:"bytes_total"`
FeeTotal uint64 `json:"fee_total"`
Histo []struct {
Bytes uint64 `json:"bytes"`
Txs uint64 `json:"txs"`
} `json:"histo"`
Histo98Pc uint64 `json:"histo_98pc"`
Num10M uint64 `json:"num_10m"`
NumDoubleSpends uint64 `json:"num_double_spends"`
NumFailing uint64 `json:"num_failing"`
NumNotRelayed uint64 `json:"num_not_relayed"`
Oldest int64 `json:"oldest"`
TxsTotal uint64 `json:"txs_total"`
} `json:"pool_stats"`
RPCResultFooter `json:",inline"`
}
type GetTransactionsResultTransaction struct {
AsHex string `json:"as_hex"`
AsJSON string `json:"as_json"`
BlockHeight uint64 `json:"block_height"`
BlockTimestamp int64 `json:"block_timestamp"`
DoubleSpendSeen bool `json:"double_spend_seen"`
InPool bool `json:"in_pool"`
OutputIndices []int `json:"output_indices"`
PrunableAsHex string `json:"prunable_as_hex"`
PrunableHash string `json:"prunable_hash"`
PrunedAsHex string `json:"pruned_as_hex"`
TxHash string `json:"tx_hash"`
}
type GetTransactionsResult struct {
Credits int `json:"credits"`
Status string `json:"status"`
TopHash string `json:"top_hash"`
Txs []GetTransactionsResultTransaction `json:"txs"`
TxsAsHex []string `json:"txs_as_hex"`
Untrusted bool `json:"untrusted"`
}
type TransactionJSON struct {
Version int `json:"version"`
UnlockTime int `json:"unlock_time"`
Vin []struct {
Key struct {
Amount int `json:"amount"`
KeyOffsets []uint `json:"key_offsets"`
KImage string `json:"k_image"`
} `json:"key"`
} `json:"vin"`
Vout []struct {
Amount uint64 `json:"amount"`
Target struct {
Key string `json:"key"`
} `json:"target"`
} `json:"vout"`
Extra []byte `json:"extra"`
RctSignatures struct {
Type int `json:"type"`
Txnfee uint64 `json:"txnFee"`
Ecdhinfo []struct {
Amount string `json:"amount"`
} `json:"ecdhInfo"`
Outpk []string `json:"outPk"`
} `json:"rct_signatures"`
RctsigPrunable struct {
Nbp int `json:"nbp"`
Bp []struct {
A string `json:"A"`
S string `json:"S"`
T1 string `json:"T1"`
T2 string `json:"T2"`
Taux string `json:"taux"`
Mu string `json:"mu"`
L []string `json:"L"`
R []string `json:"R"`
LowerA string `json:"a"`
B string `json:"b"`
T string `json:"t"`
} `json:"bp"`
Clsags []struct {
S []string `json:"s"`
C1 string `json:"c1"`
D string `json:"D"`
} `json:"CLSAGs"`
Pseudoouts []string `json:"pseudoOuts"`
} `json:"rctsig_prunable"`
}
type GetTransactionPoolResult struct {
Credits int `json:"credits"`
SpentKeyImages []struct {
IDHash string `json:"id_hash"`
TxsHashes []string `json:"txs_hashes"`
} `json:"spent_key_images"`
Status string `json:"status"`
TopHash string `json:"top_hash"`
Transactions []struct {
BlobSize uint64 `json:"blob_size"`
DoNotRelay bool `json:"do_not_relay"`
DoubleSpendSeen bool `json:"double_spend_seen"`
Fee uint64 `json:"fee"`
IDHash string `json:"id_hash"`
KeptByBlock bool `json:"kept_by_block"`
LastFailedHeight uint64 `json:"last_failed_height"`
LastFailedIDHash string `json:"last_failed_id_hash"`
LastRelayedTime uint64 `json:"last_relayed_time"`
MaxUsedBlockHeight uint64 `json:"max_used_block_height"`
MaxUsedBlockIDHash string `json:"max_used_block_id_hash"`
ReceiveTime int64 `json:"receive_time"`
Relayed bool `json:"relayed"`
TxBlob string `json:"tx_blob"`
TxJSON string `json:"tx_json"`
Weight uint64 `json:"weight"`
} `json:"transactions"`
Untrusted bool `json:"untrusted"`
}
type StartMiningRequestParameters struct {
MinerAddress string `json:"miner_address"`
BackgroundMining bool `json:"background_mining"`
IgnoreBattery bool `json:"ignore_battery"`
ThreadsCount uint `json:"threads_count"`
}
type StartMiningResult struct {
RPCResultFooter `json:",inline"`
}
type StopMiningResult struct {
RPCResultFooter `json:",inline"`
}