diff --git a/rpc/types_block.go b/rpc/types_block.go index 143ee34a..3e30a92c 100644 --- a/rpc/types_block.go +++ b/rpc/types_block.go @@ -89,14 +89,8 @@ type Block struct { } type PendingBlock struct { - // ParentHash The hash of this block's parent - ParentHash *felt.Felt `json:"parent_hash"` - // Timestamp the time in which the block was created, encoded in Unix time - Timestamp uint64 `json:"timestamp"` - // SequencerAddress the StarkNet identity of the sequencer submitting this block - SequencerAddress *felt.Felt `json:"sequencer_address"` - // Transactions The transactions in this block - Transactions BlockTransactions `json:"transactions"` + PendingBlockHeader PendingBlockHeader + BlockTransactions BlockTransactions } type BlockTxHashes struct { @@ -107,14 +101,8 @@ type BlockTxHashes struct { } type PendingBlockTxHashes struct { - // ParentHash The hash of this block's parent - ParentHash *felt.Felt `json:"parent_hash"` - // Timestamp the time in which the block was created, encoded in Unix time - Timestamp uint64 `json:"timestamp"` - // SequencerAddress the StarkNet identity of the sequencer submitting this block - SequencerAddress *felt.Felt `json:"sequencer_address"` - // Transactions The hashes of the transactions included in this block - Transactions []*felt.Felt `json:"transactions"` + PendingBlockHeader PendingBlockHeader + BlockTxHashes BlockTxHashes } type BlockHeader struct { @@ -130,4 +118,28 @@ type BlockHeader struct { Timestamp uint64 `json:"timestamp"` // SequencerAddress the StarkNet identity of the sequencer submitting this block SequencerAddress *felt.Felt `json:"sequencer_address"` + // The price of l1 gas in the block + L1GasPrice ResourcePrice `json:"l1_gas_price"` + // Semver of the current Starknet protocol + StarknetVersion string `json:"starknet_version"` +} + +type PendingBlockHeader struct { + // ParentHash The hash of this block's parent + ParentHash *felt.Felt `json:"parent_hash"` + // Timestamp the time in which the block was created, encoded in Unix time + Timestamp uint64 `json:"timestamp"` + // SequencerAddress the StarkNet identity of the sequencer submitting this block + SequencerAddress *felt.Felt `json:"sequencer_address"` + // The price of l1 gas in the block + L1GasPrice ResourcePrice `json:"l1_gas_price"` + // Semver of the current Starknet protocol + StarknetVersion string `json:"starknet_version"` +} + +type ResourcePrice struct { + // The price of one unit of the given resource, denominated in strk + PriceInStrk NumAsHex `json:"price_in_strk,omitempty"` + // The price of one unit of the given resource, denominated in wei + PriceInWei string `json:"price_in_wei"` }