Documentation
¶
Index ¶
- Variables
- type BlockBodyWithTxHashes
- type BlockBodyWithTxs
- type BlockHeader
- type BlockId
- type BlockIdType
- type BlockWithTxHashes
- type BlockWithTxs
- type CommonReceiptProperties
- type CommonTxnProperties
- type ContractClass
- type ContractEntryPoint
- type DeclareTxReceipt
- type DeclareTxn
- type DeclatedContractItem
- type DeployTxReceipt
- type DeployTxn
- type DeployedContractItem
- type Event
- type FeeEstimate
- type FunctionCall
- type InvokeTxReceipt
- type InvokeTxn
- type MsgToL1
- type MsgToL2
- type Receipt
- type RpcFelt
- type StarkNetError
- type StarkNetRpc
- func (s *StarkNetRpc) BlockHashAndNumber() (any, error)
- func (s *StarkNetRpc) BlockNumber() (any, error)
- func (s *StarkNetRpc) Call(blockId *BlockId, request *FunctionCall) (any, error)
- func (s *StarkNetRpc) ChainId() (any, error)
- func (s *StarkNetRpc) EstimateFee(request *InvokeTxn, blockId *BlockId) (any, error)
- func (s *StarkNetRpc) GetBlockTransactionCount(blockId *BlockId) (any, error)
- func (s *StarkNetRpc) GetBlockWithTxHashes(blockId *BlockId) (any, error)
- func (s *StarkNetRpc) GetBlockWithTxs(blockId *BlockId) (any, error)
- func (s *StarkNetRpc) GetClass(classHash *RpcFelt) (any, error)
- func (s *StarkNetRpc) GetClassHashAt(blockId *BlockId, address *RpcFelt) (any, error)
- func (s *StarkNetRpc) GetStateUpdate(blockId *BlockId) (any, error)
- func (s *StarkNetRpc) GetStorageAt(address *RpcFelt, key *StorageKey, blockId *BlockId) (any, error)
- func (s *StarkNetRpc) GetTransactionByBlockIdAndIndex(blockId *BlockId, index *uint64) (any, error)
- func (s *StarkNetRpc) GetTransactionByHash(transactionHash *RpcFelt) (any, error)
- func (s *StarkNetRpc) GetTransactionReceipt(transactionHash *RpcFelt) (any, error)
- func (s *StarkNetRpc) HealthCheck() (any, error)
- func (s *StarkNetRpc) PendingTransactions() (any, error)
- func (s *StarkNetRpc) ProtocolVersion() (any, error)
- func (s *StarkNetRpc) Syncing() (any, error)
- type StateDiff
- type StateUpdate
- type Status
- type StorageDiffItem
- type StorageKey
- type SyncStatus
- type Txn
- type TxnType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContractNotFound = StarkNetError{ Code: 20, Message: "Contract not found", } InvalidMessageSelector = StarkNetError{ Code: 21, Message: "Invalid message selector", } InvalidCallData = StarkNetError{ Code: 22, Message: "Invalid call data", } InvalidBlockId = StarkNetError{ Code: 24, Message: "Invalid block id", } InvalidTxnHash = StarkNetError{ Code: 25, Message: "Invalid txn hash", } InvalidTxnIndex = StarkNetError{ Code: 27, Message: "Invalid transaction index in a block", } InvalidContractClassHash = StarkNetError{ Code: 28, Message: "The supplied contract class hash is invalid or unknown", } NoBlocks = StarkNetError{ Code: 32, Message: "There are no blocks", } )
View Source
var ErrInvalidBlockId = errors.New("invalid block id")
Functions ¶
This section is empty.
Types ¶
type BlockBodyWithTxHashes ¶
type BlockBodyWithTxHashes struct {
Transactions []string `json:"transactions"`
}
type BlockBodyWithTxs ¶
type BlockBodyWithTxs struct {
Transactions []Txn `json:"transactions"`
}
type BlockHeader ¶
type BlockId ¶
type BlockId struct {
// contains filtered or unexported fields
}
func (*BlockId) UnmarshalJSON ¶
type BlockIdType ¶
type BlockIdType int
type BlockWithTxHashes ¶
type BlockWithTxHashes struct {
BlockStatus string `json:"status"`
BlockHeader
BlockBodyWithTxHashes
}
func NewBlockWithTxHashes ¶
func NewBlockWithTxHashes(block *types.Block) *BlockWithTxHashes
type BlockWithTxs ¶
type BlockWithTxs struct {
Status string `json:"status"`
BlockHeader
BlockBodyWithTxs
}
func NewBlockWithTxs ¶
func NewBlockWithTxs(block *types.Block, txnManager *transaction.Manager) (*BlockWithTxs, error)
type CommonReceiptProperties ¶
type CommonTxnProperties ¶
type ContractClass ¶
type ContractClass struct {
Program string `json:"program"`
EntryPointsByType struct {
Constructor []*ContractEntryPoint `json:"CONSTRUCTOR"`
External []*ContractEntryPoint `json:"EXTERNAL"`
L1Handler []*ContractEntryPoint `json:"L1_HANDLER"`
}
}
type ContractEntryPoint ¶
type DeclareTxReceipt ¶
type DeclareTxReceipt struct {
CommonReceiptProperties
}
type DeclareTxn ¶
type DeclareTxn struct {
CommonTxnProperties
ClassHash string `json:"class_hash"`
SenderAddress string `json:"sender_address"`
}
func NewDeclareTxn ¶
func NewDeclareTxn(txn *types.TransactionDeclare) *DeclareTxn
type DeclatedContractItem ¶
type DeclatedContractItem struct {
ClassHash string `json:"class_hash"`
}
type DeployTxReceipt ¶
type DeployTxReceipt struct {
CommonReceiptProperties
}
type DeployTxn ¶
type DeployTxn struct {
TxnHash string `json:"txn_hash"`
ClassHash string `json:"class_hash"`
Version string `json:"version"`
Type string `json:"type"`
ContractAddress string `json:"contract_address"`
ContractAddressSalt string `json:"contract_address_salt"`
ConstructorCalldata []string `json:"constructor_calldata"`
}
func NewDeployTxn ¶
func NewDeployTxn(txn *types.TransactionDeploy) *DeployTxn
type DeployedContractItem ¶
type Event ¶
type FeeEstimate ¶
type FunctionCall ¶
type InvokeTxReceipt ¶
type InvokeTxReceipt struct {
CommonReceiptProperties
MessagesSent []*MsgToL1 `json:"messages_sent"`
L1OriginMessage *MsgToL2 `json:"l1_origin_message,omitempty"`
Events []*Event `json:"events"`
}
type InvokeTxn ¶
type InvokeTxn struct {
CommonTxnProperties
FunctionCall
}
func NewInvokeTxn ¶
func NewInvokeTxn(txn *types.TransactionInvoke) *InvokeTxn
type MsgToL1 ¶
type MsgToL1 struct {
ToAddress types.EthAddress `json:"to_address"`
Payload []string `json:"payload"`
}
func NewMsgToL1 ¶
type MsgToL2 ¶
type MsgToL2 struct {
FromAddress types.EthAddress `json:"from_address"`
Payload []string `json:"payload"`
}
func NewMsgToL2 ¶
type Receipt ¶
type Receipt interface {
// contains filtered or unexported methods
}
func NewReceipt ¶
func NewReceipt(receipt types.TxnReceipt) (Receipt, error)
type StarkNetError ¶
func (StarkNetError) Error ¶
func (s StarkNetError) Error() string
type StarkNetRpc ¶
type StarkNetRpc struct {
// contains filtered or unexported fields
}
func New ¶
func New(stateManager state.StateManager, blockManager *block.Manager, txnManager *transaction.Manager, synchronizer *sync2.Synchronizer, vm *cairovm.VirtualMachine, ) *StarkNetRpc
func (*StarkNetRpc) BlockHashAndNumber ¶
func (s *StarkNetRpc) BlockHashAndNumber() (any, error)
func (*StarkNetRpc) BlockNumber ¶
func (s *StarkNetRpc) BlockNumber() (any, error)
func (*StarkNetRpc) Call ¶
func (s *StarkNetRpc) Call(blockId *BlockId, request *FunctionCall) (any, error)
func (*StarkNetRpc) ChainId ¶
func (s *StarkNetRpc) ChainId() (any, error)
func (*StarkNetRpc) EstimateFee ¶
func (s *StarkNetRpc) EstimateFee(request *InvokeTxn, blockId *BlockId) (any, error)
notest
func (*StarkNetRpc) GetBlockTransactionCount ¶
func (s *StarkNetRpc) GetBlockTransactionCount(blockId *BlockId) (any, error)
func (*StarkNetRpc) GetBlockWithTxHashes ¶
func (s *StarkNetRpc) GetBlockWithTxHashes(blockId *BlockId) (any, error)
func (*StarkNetRpc) GetBlockWithTxs ¶
func (s *StarkNetRpc) GetBlockWithTxs(blockId *BlockId) (any, error)
func (*StarkNetRpc) GetClassHashAt ¶
func (s *StarkNetRpc) GetClassHashAt(blockId *BlockId, address *RpcFelt) (any, error)
func (*StarkNetRpc) GetStateUpdate ¶
func (s *StarkNetRpc) GetStateUpdate(blockId *BlockId) (any, error)
func (*StarkNetRpc) GetStorageAt ¶
func (s *StarkNetRpc) GetStorageAt(address *RpcFelt, key *StorageKey, blockId *BlockId) (any, error)
func (*StarkNetRpc) GetTransactionByBlockIdAndIndex ¶
func (s *StarkNetRpc) GetTransactionByBlockIdAndIndex(blockId *BlockId, index *uint64) (any, error)
func (*StarkNetRpc) GetTransactionByHash ¶
func (s *StarkNetRpc) GetTransactionByHash(transactionHash *RpcFelt) (any, error)
func (*StarkNetRpc) GetTransactionReceipt ¶
func (s *StarkNetRpc) GetTransactionReceipt(transactionHash *RpcFelt) (any, error)
func (*StarkNetRpc) HealthCheck ¶
func (s *StarkNetRpc) HealthCheck() (any, error)
func (*StarkNetRpc) PendingTransactions ¶
func (s *StarkNetRpc) PendingTransactions() (any, error)
func (*StarkNetRpc) ProtocolVersion ¶
func (s *StarkNetRpc) ProtocolVersion() (any, error)
func (*StarkNetRpc) Syncing ¶
func (s *StarkNetRpc) Syncing() (any, error)
type StateDiff ¶
type StateDiff struct {
StorageDiffs []*StorageDiffItem `json:"storage_diffs"`
DeployedContracts []*DeployedContractItem `json:"deployed_contracts"`
DeclaredContracts []*DeclatedContractItem `json:"declared_contracts"`
}
type StateUpdate ¶
type StateUpdate struct {
BlockHash string `json:"block_hash"`
NewRoot string `json:"new_root"`
OldRoot string `json:"old_root"`
StateDiff *StateDiff `json:"state_diff"`
}
func NewStateUpdate ¶
func NewStateUpdate(s *types.StateUpdate) *StateUpdate
type StorageDiffItem ¶
type StorageKey ¶
type StorageKey string
func (*StorageKey) Felt ¶
func (s *StorageKey) Felt() *felt.Felt
func (*StorageKey) UnmarshalJSON ¶
func (s *StorageKey) UnmarshalJSON(data []byte) error
type SyncStatus ¶
type SyncStatus struct {
StartingBlockHash string `json:"starting_block_hash"`
StartingBlockNumber string `json:"starting_block_number"`
CurrentBlockHash string `json:"current_block_hash"`
CurrentBlockNumber string `json:"current_block_number"`
HighestBlockHash string `json:"highest_block_hash"`
HighestBlockNumber string `json:"highest_block_number"`
}
Click to show internal directories.
Click to hide internal directories.