Documentation
¶
Index ¶
- Constants
- Variables
- type Abi
- type Block
- type BlockStatus
- type BlockTag
- type Contract
- type ContractInfo
- type DeployedContract
- type Dictionary
- type EthAddress
- type Event
- type EventInfo
- type Fact
- type IValue
- type IsTransaction
- type MemoryCell
- type MsgToL1
- type MsgToL2
- type PagesHash
- type StateUpdate
- type StorageDiff
- type SyncStatus
- type TransactionDeclare
- type TransactionDeploy
- type TransactionInvoke
- type TxnDeclareReceipt
- type TxnDeployReceipt
- type TxnHash
- type TxnInvokeReceipt
- type TxnReceipt
- type TxnReceiptCommon
- type TxnStatus
Constants ¶
const ( BlockOfStarknetDeploymentContractMainnet = 13617000 BlockOfStarknetDeploymentContractGoerli = 5840000 MemoryPagesContractAddressMainnet = "0x96375087b2f6efc59e5e0dd5111b4d090ebfdd8b" MemoryPagesContractAddressGoerli = "0x743789ff2ff82bfb907009c9911a7da636d34fa7" GpsVerifierContractAddressMainnet = "0xa739b175325cca7b71fcb51c3032935ef7ac338f" GpsVerifierContractAddressGoerli = "0x5ef3c980bf970fce5bbc217835743ea9f0388f4f" )
Variables ¶
var ( BlockStatusName = map[BlockStatus]string{ BlockStatusUnknown: "UNKNOWN", BlockStatusPending: "PENDING", BlockStatusProven: "PROVEN", BlockStatusAcceptedOnL2: "ACCEPTED_ON_L2", BlockStatusAcceptedOnL1: "ACCEPTED_ON_L1", BlockStatusRejected: "REJECTED", } BlockStatusValue = map[string]BlockStatus{ "UNKNOWN": BlockStatusUnknown, "PENDING": BlockStatusPending, "PROVEN": BlockStatusProven, "ACCEPTED_ON_L2": BlockStatusAcceptedOnL2, "ACCEPTED_ON_L1": BlockStatusAcceptedOnL1, "REJECTED": BlockStatusRejected, } )
var ( TxStatusName = map[TxnStatus]string{ TxStatusUnknown: "UNKNOWN", TxStatusNotReceived: "NOT_RECEIVED", TxStatusReceived: "RECEIVED", TxStatusPending: "PENDING", TxStatusRejected: "REJECTED", TxStatusAcceptedOnL2: "ACCEPTED_ON_L2", TxStatusAcceptedOnL1: "ACCEPTED_ON_L1", } TxStatusValue = map[string]TxnStatus{ "UNKNOWN": TxStatusUnknown, "NOT_RECEIVED": TxStatusNotReceived, "RECEIVED": TxStatusReceived, "PENDING": TxStatusPending, "REJECTED": TxStatusRejected, "ACCEPTED_ON_L2": TxStatusAcceptedOnL2, "ACCEPTED_ON_L1": TxStatusAcceptedOnL1, } )
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
BlockHash *felt.Felt `json:"bloch_hash"`
ParentHash *felt.Felt `json:"parent_hash"`
BlockNumber uint64 `json:"block_number"`
Status BlockStatus `json:"status"`
Sequencer *felt.Felt `json:"sequencer"`
NewRoot *felt.Felt `json:"new_root,omitempty"`
OldRoot *felt.Felt `json:"old_root"`
AcceptedTime int64 `json:"accepted_time"`
TimeStamp int64 `json:"time_stamp"`
TxCount uint64 `json:"tx_count"`
TxCommitment *felt.Felt `json:"tx_commitment"`
TxHashes []*felt.Felt
EventCount uint64 `json:"event_count"`
EventCommitment *felt.Felt `json:"event_commitment"`
}
type BlockStatus ¶
type BlockStatus int32
const ( BlockStatusUnknown BlockStatus = iota BlockStatusPending BlockStatusProven BlockStatusAcceptedOnL2 BlockStatusAcceptedOnL1 BlockStatusRejected )
func StringToBlockStatus ¶
func StringToBlockStatus(s string) BlockStatus
func (BlockStatus) String ¶
func (b BlockStatus) String() string
type Contract ¶
type Contract struct {
Abi Abi
Bytecode []*felt.Felt
FullDef json.RawMessage
}
func (*Contract) MarshalJSON ¶
MarshalJSON marshals the contract into JSON-encoded data. notest
func (*Contract) UnmarshalJSON ¶
UnmarshalJSON unmarshal the JSON-encoded data into the contract.
func (*Contract) UnmarshalRaw ¶
func (c *Contract) UnmarshalRaw(raw *json.RawMessage) error
UnmarshalRaw unmarshal the raw message data into the contract. notest
type ContractInfo ¶
ContractInfo represent the info associated to one contract
type DeployedContract ¶
type DeployedContract struct {
Address *felt.Felt `json:"address"`
Hash *felt.Felt `json:"contract_hash"`
ConstructorCallData []*felt.Felt `json:"constructor_call_data"`
}
DeployedContract represent the contracts that have been deployed in this Block and the information stored on-chain
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
Dictionary - the dictionary object with key of type interface{} & value of type IValue
func NewDictionary ¶
func NewDictionary() *Dictionary
func (*Dictionary) Add ¶
func (dict *Dictionary) Add(key interface{}, value IValue)
Add adds a new item to the dictionary
func (*Dictionary) Exist ¶
func (dict *Dictionary) Exist(key interface{}) bool
Exist returns true if the key exists in the dictionary
func (*Dictionary) Get ¶
func (dict *Dictionary) Get(key interface{}) (interface{}, bool)
Get returns the value associated with the key
func (*Dictionary) Remove ¶
func (dict *Dictionary) Remove(key interface{})
Remove removes a value from the dictionary, given its key
func (*Dictionary) Size ¶
func (dict *Dictionary) Size() int
type EthAddress ¶
func BytesToEthAddress ¶
func BytesToEthAddress(b []byte) EthAddress
func HexToEthAddress ¶
func HexToEthAddress(s string) EthAddress
func (EthAddress) Bytes ¶
func (a EthAddress) Bytes() []byte
func (EthAddress) MarshalJSON ¶
func (a EthAddress) MarshalJSON() ([]byte, error)
type EventInfo ¶
type EventInfo struct {
Block uint64
Address common.Address
Event map[string]interface{}
TxnHash common.Hash
InitialBlockLogged int64
}
EventInfo represent the information retrieved from events that comes from L1
type Fact ¶
type Fact struct {
StateRoot *felt.Felt `json:"state_root"`
SequenceNumber uint64 `json:"block_number"`
Value common.Hash `json:"value"`
InitialBlockLogged int64 `json:"initial_block_logged"`
}
Fact represent to the struct that save the Facts that comes from L1 notest
type IsTransaction ¶
type MemoryCell ¶
MemoryCell represents a memory cell in Cairo
type MsgToL1 ¶
type MsgToL1 struct {
FromAddress *felt.Felt
ToAddress EthAddress
Payload []*felt.Felt
}
type MsgToL2 ¶
type MsgToL2 struct {
FromAddress EthAddress
ToAddress *felt.Felt
Payload []*felt.Felt
}
type StateUpdate ¶
type StateUpdate struct {
StorageDiff `json:"storage_diffs"`
BlockHash *felt.Felt `json:"block_hash"`
BlockNumber int64 `json:"block_number"`
NewRoot *felt.Felt `json:"new_root"`
OldRoot *felt.Felt `json:"old_root"`
DeployedContracts []DeployedContract `json:"deployed_contracts"`
DeclaredContracts []*felt.Felt `json:"declared_contracts"`
}
StateUpdate Represent the deployed contracts and the storage diffs for those and for the one's already deployed
type StorageDiff ¶
type StorageDiff map[felt.Felt][]MemoryCell
type SyncStatus ¶
type SyncStatus struct {
// StartingBlockHash is the hash of the block that the node started syncing from
StartingBlockHash string `json:"starting_block_hash"`
// StartingBlockNumber is the number of the block that the node started syncing from
StartingBlockNumber string `json:"starting_block_number"`
// CurrentBlockHash is the hash of the block that the node is currently syncing to
CurrentBlockHash string `json:"current_block_hash"`
// CurrentBlockNumber is the number of the block that the node is currently syncing to
CurrentBlockNumber string `json:"current_block_number"`
// HighestBlockHash is the hash of the block that the node is currently syncing to
HighestBlockHash string `json:"highest_block_hash"`
// HighestBlockNumber is the number of the block that the node is currently syncing to
HighestBlockNumber string `json:"highest_block_number"`
}
SyncStatus is an object describing the node synchronization status
type TransactionDeclare ¶
type TransactionDeclare struct {
Hash *felt.Felt
ClassHash *felt.Felt
SenderAddress *felt.Felt
MaxFee *felt.Felt
Signature []*felt.Felt
Nonce *felt.Felt
Version *felt.Felt
}
func (*TransactionDeclare) GetHash ¶
func (tx *TransactionDeclare) GetHash() *felt.Felt
type TransactionDeploy ¶
type TransactionDeploy struct {
Hash *felt.Felt
ClassHash *felt.Felt
ContractAddress *felt.Felt
ContractAddressSalt *felt.Felt
ConstructorCallData []*felt.Felt
}
func (*TransactionDeploy) GetHash ¶
func (tx *TransactionDeploy) GetHash() *felt.Felt
type TransactionInvoke ¶
type TransactionInvoke struct {
Hash *felt.Felt `json:"txn_hash"`
ContractAddress *felt.Felt `json:"contract_address"`
EntryPointSelector *felt.Felt `json:"entry_point_selector"`
CallData []*felt.Felt `json:"calldata"`
Signature []*felt.Felt `json:"-"`
MaxFee *felt.Felt `json:"max_fee"`
}
func (*TransactionInvoke) GetHash ¶
func (tx *TransactionInvoke) GetHash() *felt.Felt
type TxnDeclareReceipt ¶
type TxnDeclareReceipt struct {
TxnReceiptCommon
}
type TxnDeployReceipt ¶
type TxnDeployReceipt struct {
TxnReceiptCommon
}
type TxnInvokeReceipt ¶
type TxnInvokeReceipt struct {
TxnReceiptCommon
MessagesSent []*MsgToL1
L1OriginMessage *MsgToL2
Events []*Event
}
type TxnReceipt ¶
type TxnReceipt interface {
// contains filtered or unexported methods
}