Documentation
¶
Index ¶
- Constants
- func AdaptBroadcastedTransaction(broadcastedTxn *BroadcastedTransaction, network *utils.Network) (core.Transaction, core.Class, *felt.Felt, error)
- func MakeContractError(err json.RawMessage) *jsonrpc.Error
- type AddTxResponse
- type BlockHashAndNumber
- type BlockHeader
- type BlockID
- type BlockStatus
- type BlockWithReceipts
- type BlockWithTxHashes
- type BlockWithTxs
- type BroadcastedTransaction
- type Class
- type ComputationResources
- type ContractErrorData
- type DataAvailability
- type DataAvailabilityMode
- type DeclaredClass
- type DeployedContract
- type EmittedEvent
- type Entry
- type EntryPoint
- type EntryPoints
- type Event
- type EventFilter
- type EventsArg
- type EventsChunk
- type ExecuteInvocation
- type ExecutionResources
- type FeeEstimate
- type FeePayment
- type FeeUnit
- type FunctionCall
- type FunctionInvocation
- type Handler
- func (h *Handler) AddTransaction(ctx context.Context, tx BroadcastedTransaction) (*AddTxResponse, *jsonrpc.Error)
- func (h *Handler) BlockHashAndNumber() (*BlockHashAndNumber, *jsonrpc.Error)
- func (h *Handler) BlockNumber() (uint64, *jsonrpc.Error)
- func (h *Handler) BlockTransactionCount(id BlockID) (uint64, *jsonrpc.Error)
- func (h *Handler) BlockWithReceipts(id BlockID) (*BlockWithReceipts, *jsonrpc.Error)
- func (h *Handler) BlockWithTxHashes(id BlockID) (*BlockWithTxHashes, *jsonrpc.Error)
- func (h *Handler) BlockWithTxs(id BlockID) (*BlockWithTxs, *jsonrpc.Error)
- func (h *Handler) Call(funcCall *FunctionCall, id *BlockID) ([]*felt.Felt, *jsonrpc.Error)
- func (h *Handler) ChainID() (*felt.Felt, *jsonrpc.Error)
- func (h *Handler) Class(id BlockID, classHash felt.Felt) (*Class, *jsonrpc.Error)
- func (h *Handler) ClassAt(id BlockID, address felt.Felt) (*Class, *jsonrpc.Error)
- func (h *Handler) ClassHashAt(id BlockID, address felt.Felt) (*felt.Felt, *jsonrpc.Error)
- func (h *Handler) EstimateFee(broadcastedTxns []BroadcastedTransaction, simulationFlags []SimulationFlag, ...) ([]FeeEstimate, *jsonrpc.Error)
- func (h *Handler) EstimateMessageFee(msg MsgFromL1, id BlockID) (*FeeEstimate, *jsonrpc.Error)
- func (h *Handler) Events(args EventsArg) (*EventsChunk, *jsonrpc.Error)
- func (h *Handler) Nonce(id BlockID, address felt.Felt) (*felt.Felt, *jsonrpc.Error)
- func (h *Handler) Run(ctx context.Context) error
- func (h *Handler) SimulateTransactions(id BlockID, broadcastedTxns []BroadcastedTransaction, ...) ([]SimulatedTransaction, *jsonrpc.Error)
- func (h *Handler) SpecVersion() (string, *jsonrpc.Error)
- func (h *Handler) StateUpdate(id BlockID) (*StateUpdate, *jsonrpc.Error)
- func (h *Handler) StorageAt(address, key felt.Felt, id BlockID) (*felt.Felt, *jsonrpc.Error)
- func (h *Handler) SubscribeNewHeads(ctx context.Context) (uint64, *jsonrpc.Error)
- func (h *Handler) Syncing() (*Sync, *jsonrpc.Error)
- func (h *Handler) TraceBlockTransactions(ctx context.Context, id BlockID) ([]TracedBlockTransaction, *jsonrpc.Error)
- func (h *Handler) TraceTransaction(ctx context.Context, hash felt.Felt) (*TransactionTrace, *jsonrpc.Error)
- func (h *Handler) TransactionByBlockIDAndIndex(id BlockID, txIndex int) (*Transaction, *jsonrpc.Error)
- func (h *Handler) TransactionByHash(hash felt.Felt) (*Transaction, *jsonrpc.Error)
- func (h *Handler) TransactionReceiptByHash(hash felt.Felt) (*TransactionReceipt, *jsonrpc.Error)
- func (h *Handler) TransactionStatus(ctx context.Context, hash felt.Felt) (*TransactionStatus, *jsonrpc.Error)
- func (h *Handler) Unsubscribe(ctx context.Context, id uint64) (bool, *jsonrpc.Error)
- func (h *Handler) Version() (string, *jsonrpc.Error)
- func (h *Handler) WithCallMaxSteps(maxSteps uint64) *Handler
- func (h *Handler) WithFeeder(feederClient *feeder.Client) *Handler
- func (h *Handler) WithFilterLimit(limit uint) *Handler
- func (h *Handler) WithGateway(gatewayClient rpccore.Gateway) *Handler
- func (h *Handler) WithIDGen(idgen func() uint64) *Handler
- type L1DAMode
- type MsgFromL1
- type MsgToL1
- type Nonce
- type OrderedEvent
- type OrderedL2toL1Message
- type ReplacedClass
- type Resource
- type ResourceBounds
- type ResourcePrice
- type ResultPageRequest
- type SimulatedTransaction
- type SimulationFlag
- type StateDiff
- type StateUpdate
- type StorageDiff
- type Sync
- type TracedBlockTransaction
- type Transaction
- type TransactionExecutionErrorData
- type TransactionReceipt
- type TransactionStatus
- type TransactionTrace
- type TransactionType
- type TransactionWithReceipt
- type TxnExecutionStatus
- type TxnFinalityStatus
- type TxnStatus
Constants ¶
const ExecutionStepsHeader string = "X-Cairo-Steps"
Variables ¶
This section is empty.
Functions ¶
func AdaptBroadcastedTransaction ¶ added in v0.14.3
func AdaptBroadcastedTransaction(broadcastedTxn *BroadcastedTransaction, network *utils.Network, ) (core.Transaction, core.Class, *felt.Felt, error)
func MakeContractError ¶
func MakeContractError(err json.RawMessage) *jsonrpc.Error
Types ¶
type AddTxResponse ¶
type BlockHashAndNumber ¶
type BlockHeader ¶
type BlockHeader struct { Hash *felt.Felt `json:"block_hash,omitempty"` ParentHash *felt.Felt `json:"parent_hash"` Number *uint64 `json:"block_number,omitempty"` NewRoot *felt.Felt `json:"new_root,omitempty"` Timestamp uint64 `json:"timestamp"` SequencerAddress *felt.Felt `json:"sequencer_address,omitempty"` L1GasPrice *ResourcePrice `json:"l1_gas_price"` L1DataGasPrice *ResourcePrice `json:"l1_data_gas_price,omitempty"` L1DAMode *L1DAMode `json:"l1_da_mode,omitempty"` StarknetVersion string `json:"starknet_version"` }
type BlockID ¶
func (*BlockID) UnmarshalJSON ¶
type BlockStatus ¶
type BlockStatus uint8
const ( BlockPending BlockStatus = iota BlockAcceptedL2 BlockAcceptedL1 BlockRejected )
func (BlockStatus) MarshalText ¶
func (s BlockStatus) MarshalText() ([]byte, error)
type BlockWithReceipts ¶
type BlockWithReceipts struct { Status BlockStatus `json:"status,omitempty"` BlockHeader Transactions []TransactionWithReceipt `json:"transactions"` }
type BlockWithTxHashes ¶
type BlockWithTxHashes struct { Status BlockStatus `json:"status,omitempty"` BlockHeader TxnHashes []*felt.Felt `json:"transactions"` }
type BlockWithTxs ¶
type BlockWithTxs struct { Status BlockStatus `json:"status,omitempty"` BlockHeader Transactions []*Transaction `json:"transactions"` }
type BroadcastedTransaction ¶
type BroadcastedTransaction struct { Transaction ContractClass json.RawMessage `json:"contract_class,omitempty" validate:"required_if=Transaction.Type DECLARE"` PaidFeeOnL1 *felt.Felt `json:"paid_fee_on_l1,omitempty" validate:"required_if=Transaction.Type L1_HANDLER"` }
type Class ¶
type ComputationResources ¶
type ComputationResources struct { Steps uint64 `json:"steps"` MemoryHoles uint64 `json:"memory_holes,omitempty"` Pedersen uint64 `json:"pedersen_builtin_applications,omitempty"` RangeCheck uint64 `json:"range_check_builtin_applications,omitempty"` Bitwise uint64 `json:"bitwise_builtin_applications,omitempty"` Ecdsa uint64 `json:"ecdsa_builtin_applications,omitempty"` EcOp uint64 `json:"ec_op_builtin_applications,omitempty"` Keccak uint64 `json:"keccak_builtin_applications,omitempty"` Poseidon uint64 `json:"poseidon_builtin_applications,omitempty"` SegmentArena uint64 `json:"segment_arena_builtin,omitempty"` }
type ContractErrorData ¶
type ContractErrorData struct {
RevertError json.RawMessage `json:"revert_error"`
}
type DataAvailability ¶
type DataAvailabilityMode ¶
type DataAvailabilityMode uint32
const ( DAModeL1 DataAvailabilityMode = iota DAModeL2 )
func (DataAvailabilityMode) MarshalText ¶
func (m DataAvailabilityMode) MarshalText() ([]byte, error)
func (*DataAvailabilityMode) UnmarshalJSON ¶
func (m *DataAvailabilityMode) UnmarshalJSON(data []byte) error
type DeclaredClass ¶
type DeployedContract ¶
type EmittedEvent ¶
type EntryPoint ¶
type EntryPoints ¶
type EntryPoints struct { Constructor []EntryPoint `json:"CONSTRUCTOR"` External []EntryPoint `json:"EXTERNAL"` L1Handler []EntryPoint `json:"L1_HANDLER"` }
type EventFilter ¶
type EventsArg ¶
type EventsArg struct { EventFilter ResultPageRequest }
type EventsChunk ¶
type EventsChunk struct { Events []*EmittedEvent `json:"events"` ContinuationToken string `json:"continuation_token,omitempty"` }
type ExecuteInvocation ¶ added in v0.13.3
type ExecuteInvocation struct { RevertReason string `json:"revert_reason"` *FunctionInvocation `json:",omitempty"` }
func AdaptVMExecuteInvocation ¶ added in v0.13.3
func AdaptVMExecuteInvocation(vmFnInvocation *vm.ExecuteInvocation) ExecuteInvocation
func (ExecuteInvocation) MarshalJSON ¶ added in v0.13.3
func (e ExecuteInvocation) MarshalJSON() ([]byte, error)
type ExecutionResources ¶
type ExecutionResources struct { ComputationResources DataAvailability *DataAvailability `json:"data_availability,omitempty"` }
TODO: specs say no DataAvailability I will remove this in another PR because it causes a bit of code deletion
type FeeEstimate ¶
type FeePayment ¶
type FunctionCall ¶
type FunctionCall struct { ContractAddress felt.Felt `json:"contract_address"` EntryPointSelector felt.Felt `json:"entry_point_selector"` Calldata []felt.Felt `json:"calldata"` }
https://github.com/starkware-libs/starknet-specs/blob/v0.3.0/api/starknet_api_openrpc.json#L2344
type FunctionInvocation ¶ added in v0.13.3
type FunctionInvocation struct { ContractAddress felt.Felt `json:"contract_address"` EntryPointSelector *felt.Felt `json:"entry_point_selector"` Calldata []felt.Felt `json:"calldata"` CallerAddress felt.Felt `json:"caller_address"` ClassHash *felt.Felt `json:"class_hash"` EntryPointType string `json:"entry_point_type"` CallType string `json:"call_type"` Result []felt.Felt `json:"result"` Calls []FunctionInvocation `json:"calls"` Events []OrderedEvent `json:"events"` Messages []OrderedL2toL1Message `json:"messages"` ExecutionResources *ComputationResources `json:"execution_resources"` }
func AdaptFeederFunctionInvocation ¶ added in v0.13.3
func AdaptFeederFunctionInvocation(snFnInvocation *starknet.FunctionInvocation) FunctionInvocation
func AdaptVMFunctionInvocation ¶ added in v0.13.3
func AdaptVMFunctionInvocation(vmFnInvocation *vm.FunctionInvocation) FunctionInvocation
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) AddTransaction ¶
func (h *Handler) AddTransaction(ctx context.Context, tx BroadcastedTransaction) (*AddTxResponse, *jsonrpc.Error)
AddTransaction relays a transaction to the gateway.
func (*Handler) BlockHashAndNumber ¶
func (h *Handler) BlockHashAndNumber() (*BlockHashAndNumber, *jsonrpc.Error)
BlockHashAndNumber returns the block hash and number of the latest synced block.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L517
func (*Handler) BlockNumber ¶
BlockNumber returns the latest synced block number.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L500
func (*Handler) BlockTransactionCount ¶
BlockTransactionCount returns the number of transactions in a block identified by the given BlockID.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L373
func (*Handler) BlockWithReceipts ¶
func (h *Handler) BlockWithReceipts(id BlockID) (*BlockWithReceipts, *jsonrpc.Error)
func (*Handler) BlockWithTxHashes ¶
func (h *Handler) BlockWithTxHashes(id BlockID) (*BlockWithTxHashes, *jsonrpc.Error)
func (*Handler) BlockWithTxs ¶
func (h *Handler) BlockWithTxs(id BlockID) (*BlockWithTxs, *jsonrpc.Error)
func (*Handler) ChainID ¶
ChainID returns the chain ID of the currently configured network.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L542
func (*Handler) Class ¶
Class gets the contract class definition in the given block associated with the given hash
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L248
func (*Handler) ClassAt ¶
ClassAt gets the contract class definition in the given block instantiated by the given contract address
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L329
func (*Handler) ClassHashAt ¶
ClassHashAt gets the class hash for the contract deployed at the given address in the given block.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L292
func (*Handler) EstimateFee ¶
func (h *Handler) EstimateFee(broadcastedTxns []BroadcastedTransaction, simulationFlags []SimulationFlag, id BlockID, ) ([]FeeEstimate, *jsonrpc.Error)
func (*Handler) EstimateMessageFee ¶
func (*Handler) Events ¶
func (h *Handler) Events(args EventsArg) (*EventsChunk, *jsonrpc.Error)
Events gets the events matching a filter
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/94a969751b31f5d3e25a0c6850c723ddadeeb679/api/starknet_api_openrpc.json#L642
func (*Handler) Nonce ¶
Nonce returns the nonce associated with the given address in the given block number
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L633
func (*Handler) SimulateTransactions ¶
func (h *Handler) SimulateTransactions(id BlockID, broadcastedTxns []BroadcastedTransaction, simulationFlags []SimulationFlag, ) ([]SimulatedTransaction, *jsonrpc.Error)
pre 13.1
func (*Handler) StateUpdate ¶
func (h *Handler) StateUpdate(id BlockID) (*StateUpdate, *jsonrpc.Error)
StateUpdate returns the state update identified by the given BlockID.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L77
func (*Handler) StorageAt ¶
StorageAt gets the value of the storage at the given address and key for a given block.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L110
func (*Handler) SubscribeNewHeads ¶
func (*Handler) Syncing ¶
Syncing returns the syncing status of the node.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L569
func (*Handler) TraceBlockTransactions ¶
func (*Handler) TraceTransaction ¶
func (h *Handler) TraceTransaction(ctx context.Context, hash felt.Felt) (*TransactionTrace, *jsonrpc.Error)
TraceTransaction returns the trace for a given executed transaction, including internal calls
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/1ae810e0137cc5d175ace4554892a4f43052be56/api/starknet_trace_api_openrpc.json#L11
func (*Handler) TransactionByBlockIDAndIndex ¶
func (h *Handler) TransactionByBlockIDAndIndex(id BlockID, txIndex int) (*Transaction, *jsonrpc.Error)
TransactionByBlockIDAndIndex returns the details of a transaction identified by the given BlockID and index.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L184
func (*Handler) TransactionByHash ¶
TransactionByHash returns the details of a transaction identified by the given hash.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L158
func (*Handler) TransactionReceiptByHash ¶
TransactionReceiptByHash returns the receipt of a transaction identified by the given hash.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L222
func (*Handler) TransactionStatus ¶
func (*Handler) Unsubscribe ¶
func (*Handler) WithCallMaxSteps ¶
func (*Handler) WithFilterLimit ¶
WithFilterLimit sets the maximum number of blocks to scan in a single call for event filtering.
type MsgFromL1 ¶
type MsgFromL1 struct { // The address of the L1 contract sending the message. From common.Address `json:"from_address" validate:"required"` // The address of the L2 contract receiving the message. To felt.Felt `json:"to_address" validate:"required"` // The payload of the message. Payload []felt.Felt `json:"payload" validate:"required"` Selector felt.Felt `json:"entry_point_selector" validate:"required"` }
type OrderedEvent ¶ added in v0.13.3
type OrderedL2toL1Message ¶ added in v0.13.3
type ReplacedClass ¶
type Resource ¶
type Resource uint32
func (Resource) MarshalText ¶
func (*Resource) UnmarshalJSON ¶
func (*Resource) UnmarshalText ¶
type ResourceBounds ¶
type ResourcePrice ¶
type ResultPageRequest ¶
type SimulatedTransaction ¶
type SimulatedTransaction struct { TransactionTrace *TransactionTrace `json:"transaction_trace,omitempty"` FeeEstimation FeeEstimate `json:"fee_estimation,omitzero"` }
type SimulationFlag ¶
type SimulationFlag int
const ( SkipValidateFlag SimulationFlag = iota + 1 SkipFeeChargeFlag )
func (*SimulationFlag) UnmarshalJSON ¶
func (s *SimulationFlag) UnmarshalJSON(bytes []byte) (err error)
type StateDiff ¶
type StateDiff struct { StorageDiffs []StorageDiff `json:"storage_diffs"` Nonces []Nonce `json:"nonces"` DeployedContracts []DeployedContract `json:"deployed_contracts"` DeprecatedDeclaredClasses []*felt.Felt `json:"deprecated_declared_classes"` DeclaredClasses []DeclaredClass `json:"declared_classes"` ReplacedClasses []ReplacedClass `json:"replaced_classes"` }
func AdaptVMStateDiff ¶ added in v0.13.3
type StateUpdate ¶
type StorageDiff ¶
type Sync ¶
type Sync struct { Syncing *bool `json:"-"` StartingBlockHash *felt.Felt `json:"starting_block_hash,omitempty"` StartingBlockNumber *uint64 `json:"starting_block_num,omitempty"` CurrentBlockHash *felt.Felt `json:"current_block_hash,omitempty"` CurrentBlockNumber *uint64 `json:"current_block_num,omitempty"` HighestBlockHash *felt.Felt `json:"highest_block_hash,omitempty"` HighestBlockNumber *uint64 `json:"highest_block_num,omitempty"` }
func (Sync) MarshalJSON ¶
type TracedBlockTransaction ¶
type TracedBlockTransaction struct { TraceRoot *TransactionTrace `json:"trace_root,omitempty"` TransactionHash *felt.Felt `json:"transaction_hash,omitempty"` }
func AdaptFeederBlockTrace ¶ added in v0.13.3
func AdaptFeederBlockTrace(block *BlockWithTxs, blockTrace *starknet.BlockTrace) ([]TracedBlockTransaction, error)
type Transaction ¶
type Transaction struct { Hash *felt.Felt `json:"transaction_hash,omitempty"` Type TransactionType `json:"type" validate:"required"` Version *felt.Felt `json:"version,omitempty" validate:"required"` Nonce *felt.Felt `json:"nonce,omitempty" validate:"required_unless=Version 0x0"` MaxFee *felt.Felt `json:"max_fee,omitempty" validate:"required_if=Version 0x0,required_if=Version 0x1,required_if=Version 0x2"` ContractAddress *felt.Felt `json:"contract_address,omitempty"` ContractAddressSalt *felt.Felt `json:"contract_address_salt,omitempty" validate:"required_if=Type DEPLOY,required_if=Type DEPLOY_ACCOUNT"` ClassHash *felt.Felt `json:"class_hash,omitempty" validate:"required_if=Type DEPLOY,required_if=Type DEPLOY_ACCOUNT"` ConstructorCallData *[]*felt.Felt `json:"constructor_calldata,omitempty" validate:"required_if=Type DEPLOY,required_if=Type DEPLOY_ACCOUNT"` SenderAddress *felt.Felt `` /* 139-byte string literal not displayed */ Signature *[]*felt.Felt `json:"signature,omitempty" validate:"required"` CallData *[]*felt.Felt `json:"calldata,omitempty" validate:"required_if=Type INVOKE"` EntryPointSelector *felt.Felt `json:"entry_point_selector,omitempty" validate:"required_if=Type INVOKE Version 0x0"` CompiledClassHash *felt.Felt `json:"compiled_class_hash,omitempty" validate:"required_if=Type DECLARE Version 0x2"` ResourceBounds *map[Resource]ResourceBounds `json:"resource_bounds,omitempty" validate:"required_if=Version 0x3"` Tip *felt.Felt `json:"tip,omitempty" validate:"required_if=Version 0x3"` PaymasterData *[]*felt.Felt `json:"paymaster_data,omitempty" validate:"required_if=Version 0x3"` AccountDeploymentData *[]*felt.Felt `json:"account_deployment_data,omitempty" validate:"required_if=Type INVOKE Version 0x3,required_if=Type DECLARE Version 0x3"` NonceDAMode *DataAvailabilityMode `json:"nonce_data_availability_mode,omitempty" validate:"required_if=Version 0x3"` FeeDAMode *DataAvailabilityMode `json:"fee_data_availability_mode,omitempty" validate:"required_if=Version 0x3"` }
func AdaptTransaction ¶
func AdaptTransaction(t core.Transaction) *Transaction
type TransactionExecutionErrorData ¶
type TransactionExecutionErrorData struct { TransactionIndex uint64 `json:"transaction_index"` ExecutionError json.RawMessage `json:"execution_error"` }
type TransactionReceipt ¶
type TransactionReceipt struct { Type TransactionType `json:"type"` Hash *felt.Felt `json:"transaction_hash"` ActualFee *FeePayment `json:"actual_fee"` ExecutionStatus TxnExecutionStatus `json:"execution_status"` FinalityStatus TxnFinalityStatus `json:"finality_status"` BlockHash *felt.Felt `json:"block_hash,omitempty"` BlockNumber *uint64 `json:"block_number,omitempty"` MessagesSent []*MsgToL1 `json:"messages_sent"` Events []*Event `json:"events"` ContractAddress *felt.Felt `json:"contract_address,omitempty"` RevertReason string `json:"revert_reason,omitempty"` ExecutionResources *ExecutionResources `json:"execution_resources,omitempty"` MessageHash string `json:"message_hash,omitempty"` }
https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L1871
func AdaptReceipt ¶
func AdaptReceipt(receipt *core.TransactionReceipt, txn core.Transaction, finalityStatus TxnFinalityStatus, blockHash *felt.Felt, blockNumber uint64, v0_6Response bool, ) *TransactionReceipt
todo(Kirill): try to replace core.Transaction with rpc.Transaction type
type TransactionStatus ¶
type TransactionStatus struct { Finality TxnStatus `json:"finality_status"` Execution TxnExecutionStatus `json:"execution_status,omitempty"` }
type TransactionTrace ¶ added in v0.13.3
type TransactionTrace struct { Type TransactionType `json:"type"` ValidateInvocation *FunctionInvocation `json:"validate_invocation,omitempty"` ExecuteInvocation *ExecuteInvocation `json:"execute_invocation,omitempty" validate:"required_if=Type INVOKE"` FeeTransferInvocation *FunctionInvocation `json:"fee_transfer_invocation,omitempty"` ConstructorInvocation *FunctionInvocation `json:"constructor_invocation,omitempty" validate:"required_if=Type DEPLOY_ACCOUNT"` FunctionInvocation *FunctionInvocation `json:"function_invocation,omitempty" validate:"required_if=Type L1_HANDLER"` StateDiff *StateDiff `json:"state_diff,omitempty"` }
func AdaptVMTransactionTrace ¶ added in v0.13.3
func AdaptVMTransactionTrace(trace *vm.TransactionTrace) TransactionTrace
type TransactionType ¶
type TransactionType uint8
const ( Invalid TransactionType = iota TxnDeclare TxnDeploy TxnDeployAccount TxnInvoke TxnL1Handler )
func (TransactionType) MarshalText ¶
func (t TransactionType) MarshalText() ([]byte, error)
func (TransactionType) String ¶
func (t TransactionType) String() string
func (*TransactionType) UnmarshalJSON ¶
func (t *TransactionType) UnmarshalJSON(data []byte) error
type TransactionWithReceipt ¶
type TransactionWithReceipt struct { Transaction *Transaction `json:"transaction"` Receipt *TransactionReceipt `json:"receipt"` }
type TxnExecutionStatus ¶
type TxnExecutionStatus uint8
const ( TxnSuccess TxnExecutionStatus = iota + 1 TxnFailure )
func (TxnExecutionStatus) MarshalText ¶
func (es TxnExecutionStatus) MarshalText() ([]byte, error)
type TxnFinalityStatus ¶
type TxnFinalityStatus uint8
const ( TxnAcceptedOnL1 TxnFinalityStatus = iota + 1 TxnAcceptedOnL2 )
func (TxnFinalityStatus) MarshalText ¶
func (fs TxnFinalityStatus) MarshalText() ([]byte, error)