git.gammaspectra.live/P2Pool/consensus@v0.0.0-20240403173234-a039820b20c9/monero/client/zmq/types.go (about)

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