Documentation
¶
Index ¶
- Variables
- type BlockHeader
- type BlockId
- type BlockNumberAndHash
- type BlockWithTxHashes
- type BlockWithTxs
- type DeployedContract
- type Entry
- type Event
- type Handler
- func (h *Handler) BlockNumber() (uint64, *jsonrpc.Error)
- func (h *Handler) BlockNumberAndHash() (*BlockNumberAndHash, *jsonrpc.Error)
- func (h *Handler) ChainId() (*felt.Felt, *jsonrpc.Error)
- func (h *Handler) GetBlockTransactionCount(id *BlockId) (uint64, *jsonrpc.Error)
- func (h *Handler) GetBlockWithTxHashes(id *BlockId) (*BlockWithTxHashes, *jsonrpc.Error)
- func (h *Handler) GetBlockWithTxs(id *BlockId) (*BlockWithTxs, *jsonrpc.Error)
- func (h *Handler) GetStateUpdate(id *BlockId) (*StateUpdate, *jsonrpc.Error)
- func (h *Handler) GetTransactionByBlockIdAndIndex(id *BlockId, txIndex int) (*Transaction, *jsonrpc.Error)
- func (h *Handler) GetTransactionByHash(hash *felt.Felt) (*Transaction, *jsonrpc.Error)
- func (h *Handler) GetTransactionReceiptByHash(hash *felt.Felt) (*TransactionReceipt, *jsonrpc.Error)
- type MsgToL1
- type Nonce
- type StateDiff
- type StateUpdate
- type Status
- type StorageDiff
- type Transaction
- type TransactionReceipt
- type TransactionType
Constants ¶
This section is empty.
Variables ¶
var ( ErrPendingNotSupported = errors.New("pending block is not supported yet") ErrBlockNotFound = &jsonrpc.Error{Code: 24, Message: "Block not found"} ErrTxnHashNotFound = &jsonrpc.Error{Code: 25, Message: "Transaction hash not found"} ErrNoBlock = &jsonrpc.Error{Code: 32, Message: "There are no blocks"} ErrInvalidTxIndex = &jsonrpc.Error{Code: 27, Message: "Invalid transaction index in a block"} )
Functions ¶
This section is empty.
Types ¶
type BlockHeader ¶
type BlockId ¶
func (*BlockId) UnmarshalJSON ¶
type BlockNumberAndHash ¶
type BlockWithTxHashes ¶
type BlockWithTxHashes struct {
Status Status `json:"status"`
BlockHeader
TxnHashes []*felt.Felt `json:"transactions"`
}
type BlockWithTxs ¶
type BlockWithTxs struct {
Status Status `json:"status"`
BlockHeader
Transactions []*Transaction `json:"transactions"`
}
type DeployedContract ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) BlockNumberAndHash ¶
func (h *Handler) BlockNumberAndHash() (*BlockNumberAndHash, *jsonrpc.Error)
func (*Handler) GetBlockTransactionCount ¶
GetBlockTransactionCount https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L373
func (*Handler) GetBlockWithTxHashes ¶
func (h *Handler) GetBlockWithTxHashes(id *BlockId) (*BlockWithTxHashes, *jsonrpc.Error)
func (*Handler) GetBlockWithTxs ¶
func (h *Handler) GetBlockWithTxs(id *BlockId) (*BlockWithTxs, *jsonrpc.Error)
func (*Handler) GetStateUpdate ¶
func (h *Handler) GetStateUpdate(id *BlockId) (*StateUpdate, *jsonrpc.Error)
https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L77
func (*Handler) GetTransactionByBlockIdAndIndex ¶
func (h *Handler) GetTransactionByBlockIdAndIndex(id *BlockId, txIndex int) (*Transaction, *jsonrpc.Error)
GetTransactionByBlockIdAndIndex https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L184
func (*Handler) GetTransactionByHash ¶
GetTransactionByHash https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L158
func (*Handler) GetTransactionReceiptByHash ¶
func (h *Handler) GetTransactionReceiptByHash(hash *felt.Felt) (*TransactionReceipt, *jsonrpc.Error)
GetTransactionReceiptByHash https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L222
type StateDiff ¶
type StateDiff struct {
StorageDiffs []StorageDiff `json:"storage_diffs"`
Nonces []Nonce `json:"nonces"`
DeployedContracts []DeployedContract `json:"deployed_contracts"`
DeclaredClasses []*felt.Felt `json:"declared_contract_hashes"`
}
type StateUpdate ¶
type StorageDiff ¶
type Transaction ¶
type Transaction struct {
Hash *felt.Felt `json:"transaction_hash,omitempty"`
Type TransactionType `json:"type"`
Version *felt.Felt `json:"version,omitempty"`
Nonce *felt.Felt `json:"nonce,omitempty"`
MaxFee *felt.Felt `json:"max_fee,omitempty"`
ContractAddress *felt.Felt `json:"contract_address,omitempty"`
ContractAddressSalt *felt.Felt `json:"contract_address_salt,omitempty"`
ClassHash *felt.Felt `json:"class_hash,omitempty"`
ConstructorCalldata []*felt.Felt `json:"constructor_calldata,omitempty"`
SenderAddress *felt.Felt `json:"sender_address,omitempty"`
Signature *[]*felt.Felt `json:"signature,omitempty"`
Calldata *[]*felt.Felt `json:"calldata,omitempty"`
EntryPointSelector *felt.Felt `json:"entry_point_selector,omitempty"`
CompiledClassHash *felt.Felt `json:"compiled_class_hash,omitempty"`
}
type TransactionReceipt ¶
type TransactionReceipt struct {
Type TransactionType `json:"type"`
Hash *felt.Felt `json:"transaction_hash"`
ActualFee *felt.Felt `json:"actual_fee"`
Status Status `json:"status"`
BlockHash *felt.Felt `json:"block_hash"`
BlockNumber uint64 `json:"block_number"`
MessagesSent []*MsgToL1 `json:"messages_sent"`
Events []*Event `json:"events"`
ContractAddress *felt.Felt `json:"contract_address,omitempty"`
}
https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L1871
type TransactionType ¶
type TransactionType uint8
const ( TxnDeclare TransactionType = iota TxnDeploy TxnDeployAccount TxnInvoke TxnL1Handler )
func (TransactionType) MarshalJSON ¶
func (t TransactionType) MarshalJSON() ([]byte, error)