git.gammaspectra.live/P2Pool/consensus/v3@v3.8.0/monero/client/zmq/types.go (about)

     1  package zmq
     2  
     3  import (
     4  	"git.gammaspectra.live/P2Pool/consensus/v3/monero/crypto"
     5  	"git.gammaspectra.live/P2Pool/consensus/v3/p2pool/mempool"
     6  	"git.gammaspectra.live/P2Pool/consensus/v3/types"
     7  )
     8  
     9  type Topic string
    10  
    11  const (
    12  	TopicUnknown Topic = "unknown"
    13  
    14  	TopicMinimalTxPoolAdd Topic = "json-minimal-txpool_add"
    15  	TopicFullTxPoolAdd    Topic = "json-full-txpool_add"
    16  
    17  	TopicMinimalChainMain Topic = "json-minimal-chain_main"
    18  	TopicFullChainMain    Topic = "json-full-chain_main"
    19  
    20  	TopicFullMinerData Topic = "json-full-miner_data"
    21  )
    22  
    23  type MinimalChainMain struct {
    24  	FirstHeight uint64       `json:"first_height"`
    25  	FirstPrevID types.Hash   `json:"first_prev_id"`
    26  	Ids         []types.Hash `json:"ids"`
    27  }
    28  
    29  type TxOutput struct {
    30  	Amount uint64 `json:"amount"`
    31  	ToKey  *struct {
    32  		Key crypto.PublicKeyBytes `json:"key"`
    33  	} `json:"to_key,omitempty"`
    34  	ToTaggedKey *struct {
    35  		Key     crypto.PublicKeyBytes `json:"key"`
    36  		ViewTag string                `json:"view_tag"`
    37  	} `json:"to_tagged_key,omitempty"`
    38  }
    39  
    40  type FullChainMain struct {
    41  	MajorVersion int        `json:"major_version"`
    42  	MinorVersion int        `json:"minor_version"`
    43  	Timestamp    int64      `json:"timestamp"`
    44  	PrevID       types.Hash `json:"prev_id"`
    45  	Nonce        uint64     `json:"nonce"`
    46  	MinerTx      struct {
    47  		Version    int   `json:"version"`
    48  		UnlockTime int64 `json:"unlock_time"`
    49  		Inputs     []struct {
    50  			Gen struct {
    51  				Height uint64 `json:"height"`
    52  			} `json:"gen"`
    53  		} `json:"inputs"`
    54  		Outputs    []TxOutput    `json:"outputs"`
    55  		Extra      string        `json:"extra"`
    56  		Signatures []interface{} `json:"signatures"`
    57  		Ringct     struct {
    58  			Type        int           `json:"type"`
    59  			Encrypted   []interface{} `json:"encrypted"`
    60  			Commitments []interface{} `json:"commitments"`
    61  			Fee         uint64        `json:"fee"`
    62  		} `json:"ringct"`
    63  	} `json:"miner_tx"`
    64  	TxHashes []types.Hash `json:"tx_hashes"`
    65  }
    66  
    67  type FullTxPoolAdd struct {
    68  	Version    int   `json:"version"`
    69  	UnlockTime int64 `json:"unlock_time"`
    70  	Inputs     []struct {
    71  		ToKey struct {
    72  			Amount     uint64     `json:"amount"`
    73  			KeyOffsets []uint64   `json:"key_offsets"`
    74  			KeyImage   types.Hash `json:"key_image"`
    75  		} `json:"to_key"`
    76  	} `json:"inputs"`
    77  	Outputs    []TxOutput    `json:"outputs"`
    78  	Extra      string        `json:"extra"`
    79  	Signatures []interface{} `json:"signatures"`
    80  	Ringct     struct {
    81  		Type      int `json:"type"`
    82  		Encrypted []struct {
    83  			Mask   string `json:"mask"`
    84  			Amount string `json:"amount"`
    85  		} `json:"encrypted"`
    86  		Commitments []string `json:"commitments"`
    87  		Fee         int      `json:"fee"`
    88  		Prunable    struct {
    89  			RangeProofs  []any `json:"range_proofs"`
    90  			Bulletproofs []struct {
    91  				V      []string `json:"V"`
    92  				AUpper string   `json:"A"`
    93  				S      string   `json:"S"`
    94  				T1     string   `json:"T1"`
    95  				T2     string   `json:"T2"`
    96  				Taux   string   `json:"taux"`
    97  				Mu     string   `json:"mu"`
    98  				L      []string `json:"L"`
    99  				R      []string `json:"R"`
   100  				ALower string   `json:"a"`
   101  				B      string   `json:"b"`
   102  				T      string   `json:"t"`
   103  			} `json:"bulletproofs"`
   104  			Mlsags     []interface{} `json:"mlsags"`
   105  			PseudoOuts []string      `json:"pseudo_outs"`
   106  		} `json:"prunable"`
   107  	} `json:"ringct"`
   108  }
   109  
   110  type FullMinerData struct {
   111  	MajorVersion          uint8            `json:"major_version"`
   112  	Height                uint64           `json:"height"`
   113  	PrevId                types.Hash       `json:"prev_id"`
   114  	SeedHash              types.Hash       `json:"seed_hash"`
   115  	Difficulty            types.Difficulty `json:"difficulty"`
   116  	MedianWeight          uint64           `json:"median_weight"`
   117  	AlreadyGeneratedCoins uint64           `json:"already_generated_coins"`
   118  	MedianTimestamp       uint64           `json:"median_timestamp"`
   119  	TxBacklog             []*mempool.Entry `json:"tx_backlog"`
   120  }