Documentation
¶
Index ¶
- Constants
- Variables
- func AdaptBroadcastedTransactionToCore(ctx context.Context, broadcastedTxn *BroadcastedTransaction, ...) (core.Transaction, error)
- func AdaptBroadcastedTransactionToFeeder(rpcTx *BroadcastedTransaction) starknet.Transaction
- func ContractClassToGatewayPayload(class *ContractClass) ([]byte, error)
- func MakeContractError(err json.RawMessage) *jsonrpc.Error
- func MakeJSONErrorFromGatewayError(err error) *jsonrpc.Error
- func MakeTransactionExecutionError(err *vm.TransactionExecutionError) *jsonrpc.Error
- func Validator() *validator.Validate
- type AddTxGatewayPayload
- type AddTxResponse
- type AddressList
- type BinaryNode
- type BlockHashAndNumber
- type BlockHeader
- type BlockID
- func (b *BlockID) Hash() *felt.Felt
- func (b *BlockID) IsHash() bool
- func (b *BlockID) IsL1Accepted() bool
- func (b *BlockID) IsLatest() bool
- func (b *BlockID) IsNumber() bool
- func (b *BlockID) IsPreConfirmed() bool
- func (b *BlockID) Number() uint64
- func (b *BlockID) Type() blockIDType
- func (b *BlockID) UnmarshalJSON(data []byte) error
- type BlockStatus
- type BlockWithReceipts
- type BlockWithTxHashes
- type BlockWithTxs
- type BroadcastedTransaction
- type BroadcastedTransactionInputs
- type CalldataInputs
- type Class
- type ClassEntryPoint
- type ClassEntryPointsByType
- type ClassHashEntry
- type CompiledCasmResponse
- type ComputationResources
- type ContractClass
- type ContractClassEntryPoint
- type ContractClassEntryPoints
- type ContractErrorData
- type ContractProof
- type DataAvailabilityMode
- type DeclaredClass
- type DeclaredContractEntry
- type DeployedContract
- type EdgeNode
- type EmittedEvent
- type Entry
- type EntryPoint
- type EntryPointsByType
- type EstimateFlag
- type Event
- type EventArgs
- type EventFilter
- type EventsChunk
- type ExecuteInvocation
- type ExecutionResources
- type FeeEstimate
- type FeePayment
- type FeeUnit
- type FunctionCall
- type FunctionInvocation
- type GlobalRoots
- 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, responseFlags ResponseFlags) (*BlockWithReceipts, *jsonrpc.Error)
- func (h *Handler) BlockWithTxHashes(id *BlockID) (*BlockWithTxHashes, *jsonrpc.Error)
- func (h *Handler) BlockWithTxs(blockID *BlockID, responseFlags ResponseFlags) (*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) CompiledCasm(classHash *felt.Felt) (CompiledCasmResponse, *jsonrpc.Error)
- func (h *Handler) EstimateFee(ctx context.Context, broadcastedTxns BroadcastedTransactionInputs, ...) ([]FeeEstimate, http.Header, *jsonrpc.Error)
- func (h *Handler) EstimateMessageFee(ctx context.Context, msg *MsgFromL1, id *BlockID) (FeeEstimate, http.Header, *jsonrpc.Error)
- func (h *Handler) Events(args *EventArgs) (EventsChunk, *jsonrpc.Error)
- func (h *Handler) GetMessageStatus(ctx context.Context, l1TxnHash *eth.Hash) ([]MsgStatus, *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(ctx context.Context, id *BlockID, transactions BroadcastedTransactionInputs, ...) (SimulateTransactionsResponse, http.Header, *jsonrpc.Error)
- func (h *Handler) SpecVersion() (string, *jsonrpc.Error)
- func (h *Handler) StateUpdate(id *BlockID, contractAddresses AddressList) (StateUpdate, *jsonrpc.Error)
- func (h *Handler) StorageAt(address *felt.Address, key *felt.Felt, id *BlockID, ...) (*StorageAtResponse, *jsonrpc.Error)
- func (h *Handler) StorageProof(id *BlockID, classes, contracts []felt.Felt, storageKeys []StorageKeys) (*StorageProofResult, *jsonrpc.Error)
- func (h *Handler) SubscribeEvents(ctx context.Context, fromAddrs AddressList, keys [][]felt.Felt, ...) (SubscriptionID, *jsonrpc.Error)
- func (h *Handler) SubscribeNewHeads(ctx context.Context, blockID *SubscriptionBlockID) (SubscriptionID, *jsonrpc.Error)
- func (h *Handler) SubscribeNewTransactionReceipts(ctx context.Context, senderAddress []felt.Address, ...) (SubscriptionID, *jsonrpc.Error)
- func (h *Handler) SubscribeNewTransactions(ctx context.Context, finalityStatus []TxnStatusWithoutL1, ...) (SubscriptionID, *jsonrpc.Error)
- func (h *Handler) SubscribeTransactionStatus(ctx context.Context, txHash *felt.Felt) (SubscriptionID, *jsonrpc.Error)
- func (h *Handler) Syncing() (*Sync, *jsonrpc.Error)
- func (h *Handler) TraceBlockTransactions(ctx context.Context, id *BlockID, traceFlags []TraceFlag) (TraceBlockTransactionsResponse, http.Header, *jsonrpc.Error)
- func (h *Handler) TraceTransaction(ctx context.Context, hash *felt.Felt) (TransactionTrace, http.Header, *jsonrpc.Error)
- func (h *Handler) TransactionByBlockIDAndIndex(blockID *BlockID, txIndex int, responseFlags ResponseFlags) (*Transaction, *jsonrpc.Error)
- func (h *Handler) TransactionByHash(hash *felt.Felt, responseFlags ResponseFlags) (*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 string) (bool, *jsonrpc.Error)
- func (h *Handler) WithCallMaxGas(maxGas uint64) *Handler
- func (h *Handler) WithCallMaxSteps(maxSteps uint64) *Handler
- func (h *Handler) WithCompiler(compiler compiler.Compiler) *Handler
- func (h *Handler) WithFeeder(feederClient feeder.Reader) *Handler
- func (h *Handler) WithFilterLimit(limit uint) *Handler
- func (h *Handler) WithGateway(gatewayClient rpccore.Gateway) *Handler
- func (h *Handler) WithIDGen(idgen func() string) *Handler
- func (h *Handler) WithL1Client(l1Client rpccore.L1Client) *Handler
- func (h *Handler) WithMempool(memPool mempool.Pool) *Handler
- func (h *Handler) WithReceivedTransactionFeed(feed *feed.Feed[core.Transaction]) *Handler
- func (h *Handler) WithSubmittedTransactionsCache(cache *rpccore.TransactionCache) *Handler
- type HashToNode
- type InitialReads
- type InnerExecutionResources
- type L1DAMode
- type LeafData
- type MigratedCompiledClass
- type MsgFromL1
- type MsgStatus
- type MsgToL1
- type Node
- type Nonce
- type NonceEntry
- type OrderedEvent
- type OrderedL2toL1Message
- type ReorgEvent
- type ReplacedClass
- type Resource
- type ResourceBounds
- type ResourceBoundsMap
- type ResourcePrice
- type ResponseFlags
- type ResultPageRequest
- type SentEvent
- type SimulateTransactionsResponse
- type SimulatedTransaction
- type SimulationFlag
- type StateDiff
- type StateUpdate
- type StorageAtResponse
- type StorageAtResponseFlags
- type StorageDiff
- type StorageEntry
- type StorageKeys
- type StorageProofResult
- type SubscriptionBlockID
- func (b *SubscriptionBlockID) Hash() *felt.Felt
- func (b *SubscriptionBlockID) IsHash() bool
- func (b *SubscriptionBlockID) IsLatest() bool
- func (b *SubscriptionBlockID) IsNumber() bool
- func (b *SubscriptionBlockID) Number() uint64
- func (b *SubscriptionBlockID) Type() blockIDType
- func (b *SubscriptionBlockID) UnmarshalJSON(data []byte) error
- type SubscriptionEmittedEvent
- type SubscriptionID
- type SubscriptionNewTransaction
- type SubscriptionResponse
- type SubscriptionTags
- type SubscriptionTransactionStatus
- type Sync
- type TraceBlockTransactionsResponse
- type TraceFlag
- type TracedBlockTransaction
- type Transaction
- type TransactionExecutionErrorData
- type TransactionReceipt
- type TransactionStatus
- type TransactionTrace
- type TransactionType
- type TransactionWithReceipt
- type TxnExecutionStatus
- type TxnFinalityStatus
- type TxnFinalityStatusWithoutL1
- type TxnStatus
- type TxnStatusWithoutL1
Constants ¶
const ( MissingContractAddress = "missing field: contract_address" MissingStorageKeys = "missing field: storage_keys" )
const ExecutionStepsHeader string = "X-Cairo-Steps"
Variables ¶
var ErrTransactionNotFound = errors.New("transaction not found")
Functions ¶
func AdaptBroadcastedTransactionToCore ¶ added in v0.16.5
func AdaptBroadcastedTransactionToCore( ctx context.Context, broadcastedTxn *BroadcastedTransaction, classHash *felt.Felt, network *networks.Network, ) (core.Transaction, error)
AdaptBroadcastedTransactionToCore adapts a BroadcastedTransaction to a core.Transaction, and populates the transaction hash.
func AdaptBroadcastedTransactionToFeeder ¶ added in v0.16.5
func AdaptBroadcastedTransactionToFeeder(rpcTx *BroadcastedTransaction) starknet.Transaction
func ContractClassToGatewayPayload ¶ added in v0.16.5
func ContractClassToGatewayPayload(class *ContractClass) ([]byte, error)
ContractClassToGatewayPayload returns the contract class payload in the format expected by the gateway.
func MakeContractError ¶ added in v0.15.20
func MakeContractError(err json.RawMessage) *jsonrpc.Error
func MakeJSONErrorFromGatewayError ¶ added in v0.15.20
func MakeTransactionExecutionError ¶ added in v0.15.20
func MakeTransactionExecutionError(err *vm.TransactionExecutionError) *jsonrpc.Error
Types ¶
type AddTxGatewayPayload ¶ added in v0.15.20
type AddTxGatewayPayload struct {
starknet.Transaction
ContractClass json.RawMessage `json:"contract_class,omitempty"`
Proof core.Base64 `json:"proof,omitempty"`
}
AddTxGatewayPayload embeds a starknet.Transaction along with an optional ContractClass.
type AddTxResponse ¶ added in v0.15.20
type AddressList ¶ added in v0.15.20
AddressList is a list of addresses, that can be unmarshalled from a single address or a list of addresses. It also removes duplicates from the list.
func (AddressList) Contains ¶ added in v0.15.20
func (a AddressList) Contains(addr *felt.Address) bool
func (*AddressList) UnmarshalJSON ¶ added in v0.15.20
func (a *AddressList) UnmarshalJSON(data []byte) error
type BinaryNode ¶ added in v0.16.0
func (*BinaryNode) AsProofNode ¶ added in v0.16.0
func (b *BinaryNode) AsProofNode() trie.ProofNode
type BlockHashAndNumber ¶ added in v0.16.0
type BlockHeader ¶ added in v0.15.13
type BlockHeader struct {
Hash *felt.Felt `json:"block_hash,omitempty"`
ParentHash *felt.Felt `json:"parent_hash,omitempty"`
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"`
L2GasPrice *ResourcePrice `json:"l2_gas_price"`
TransactionCommitment *felt.Hash `json:"transaction_commitment,omitempty"`
EventCommitment *felt.Hash `json:"event_commitment,omitempty"`
ReceiptCommitment *felt.Hash `json:"receipt_commitment,omitempty"`
StateDiffCommitment *felt.Hash `json:"state_diff_commitment,omitempty"`
EventCount *uint64 `json:"event_count,omitempty"`
TransactionCount *uint64 `json:"transaction_count,omitempty"`
StateDiffLength *uint64 `json:"state_diff_length,omitempty"`
}
BLOCK_HEADER https://github.com/starkware-libs/starknet-specs/blob/cce1563eff702c87590bad3a48382d2febf1f7d9/api/starknet_api_openrpc.json#L1591 PRE_CONFIRMED_BLOCK_HEADER https://github.com/starkware-libs/starknet-specs/blob/cce1563eff702c87590bad3a48382d2febf1f7d9/api/starknet_api_openrpc.json#L1711
func AdaptBlockHeader ¶ added in v0.15.13
func AdaptBlockHeader( header *core.Header, commitments *core.BlockCommitments, stateDiff *core.StateDiff, ) BlockHeader
type BlockID ¶ added in v0.15.20
type BlockID struct {
// contains filtered or unexported fields
}
BlockID represents a block identifier (by hash, number, or tag).
func BlockIDFromHash ¶ added in v0.15.20
func BlockIDFromNumber ¶ added in v0.15.20
func BlockIDL1Accepted ¶ added in v0.15.20
func BlockIDL1Accepted() BlockID
func BlockIDLatest ¶ added in v0.15.20
func BlockIDLatest() BlockID
func BlockIDPreConfirmed ¶ added in v0.15.20
func BlockIDPreConfirmed() BlockID
func (*BlockID) IsL1Accepted ¶ added in v0.15.20
func (*BlockID) IsPreConfirmed ¶ added in v0.15.20
func (*BlockID) UnmarshalJSON ¶ added in v0.15.20
type BlockStatus ¶ added in v0.15.20
type BlockStatus uint8
BlockStatus represents the status of a block.
const ( BlockPreConfirmed BlockStatus = iota BlockAcceptedL2 BlockAcceptedL1 BlockRejected )
func (BlockStatus) MarshalText ¶ added in v0.15.20
func (s BlockStatus) MarshalText() ([]byte, error)
type BlockWithReceipts ¶ added in v0.15.13
type BlockWithReceipts struct {
Status BlockStatus `json:"status,omitempty"`
BlockHeader
Transactions []TransactionWithReceipt `json:"transactions"`
}
type BlockWithTxHashes ¶ added in v0.15.13
type BlockWithTxHashes struct {
Status BlockStatus `json:"status,omitempty"`
BlockHeader
TxnHashes []*felt.Felt `json:"transactions"`
}
type BlockWithTxs ¶ added in v0.15.13
type BlockWithTxs struct {
Status BlockStatus `json:"status,omitempty"`
BlockHeader
Transactions []*Transaction `json:"transactions"`
}
type BroadcastedTransaction ¶ added in v0.15.20
type BroadcastedTransaction struct {
Transaction
ContractClass *ContractClass `json:"contract_class,omitempty" validate:"required_if=Transaction.Type DECLARE"`
Proof core.Base64 `json:"proof,omitempty" validate:"excluded_unless=Type INVOKE,omitempty,base64"`
}
BroadcastedTransaction represents a transaction submitted via the RPC API.
type BroadcastedTransactionInputs ¶
type BroadcastedTransactionInputs = rpccore.LimitSlice[ BroadcastedTransaction, rpccore.SimulationLimit, ]
type CalldataInputs ¶ added in v0.15.20
type CalldataInputs = rpccore.LimitSlice[felt.Felt, rpccore.FunctionCalldataLimit]
type Class ¶ added in v0.16.0
type ClassEntryPoint ¶ added in v0.16.0
type ClassEntryPointsByType ¶ added in v0.16.0
type ClassEntryPointsByType struct {
Constructor []ClassEntryPoint `json:"CONSTRUCTOR"`
External []ClassEntryPoint `json:"EXTERNAL"`
L1Handler []ClassEntryPoint `json:"L1_HANDLER"`
}
type ClassHashEntry ¶ added in v0.15.20
type CompiledCasmResponse ¶ added in v0.16.0
type CompiledCasmResponse struct {
EntryPointsByType EntryPointsByType `json:"entry_points_by_type"`
// can't use felt.Felt here because prime is larger than felt
Prime string `json:"prime"`
CompilerVersion string `json:"compiler_version"`
Bytecode []*felt.Felt `json:"bytecode"`
Hints json.RawMessage `json:"hints"`
BytecodeSegmentLengths []int `json:"bytecode_segment_lengths,omitempty"`
}
CompiledCasmResponse represents a compiled Cairo class. It follows this specification: https://github.com/starkware-libs/starknet-specs/blob/release/v0.10.2/api/starknet_executables.json#L45
type ComputationResources ¶ added in v0.15.20
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 ContractClass ¶ added in v0.16.5
type ContractClass struct {
SierraProgram []felt.Felt `json:"sierra_program" validate:"required"`
ContractClassVersion string `json:"contract_class_version" validate:"required"`
EntryPoints ContractClassEntryPoints `json:"entry_points_by_type" validate:"required"`
ABI string `json:"abi,omitempty"`
}
ContractClass represents a contract class to be declared in the DECLARE broadcast transaction. https://github.com/starkware-libs/starknet-specs/blob/release/v0.10.2/api/starknet_api_openrpc.json#L3373
type ContractClassEntryPoint ¶ added in v0.16.5
type ContractClassEntryPoints ¶ added in v0.16.5
type ContractClassEntryPoints struct {
Constructor []ContractClassEntryPoint `json:"CONSTRUCTOR" validate:"required"`
External []ContractClassEntryPoint `json:"EXTERNAL" validate:"required"`
L1Handler []ContractClassEntryPoint `json:"L1_HANDLER" validate:"required"`
}
type ContractErrorData ¶ added in v0.15.20
type ContractErrorData struct {
RevertError json.RawMessage `json:"revert_error"`
}
type ContractProof ¶ added in v0.16.0
type ContractProof struct {
Nodes []*HashToNode `json:"nodes"`
LeavesData []*LeafData `json:"contract_leaves_data"`
}
type DataAvailabilityMode ¶ added in v0.15.20
type DataAvailabilityMode uint32
const ( DAModeL1 DataAvailabilityMode = iota DAModeL2 )
func (DataAvailabilityMode) MarshalText ¶ added in v0.15.20
func (m DataAvailabilityMode) MarshalText() ([]byte, error)
func (*DataAvailabilityMode) UnmarshalJSON ¶ added in v0.15.20
func (m *DataAvailabilityMode) UnmarshalJSON(data []byte) error
type DeclaredClass ¶ added in v0.15.20
type DeclaredContractEntry ¶ added in v0.15.20
type DeployedContract ¶ added in v0.15.20
type EdgeNode ¶ added in v0.16.0
type EdgeNode struct {
Path string `json:"path"`
Length int `json:"length"`
Child *felt.Felt `json:"child"`
}
func (*EdgeNode) AsProofNode ¶ added in v0.16.0
type EmittedEvent ¶
type EntryPoint ¶ added in v0.16.0
type EntryPointsByType ¶ added in v0.16.0
type EntryPointsByType struct {
Constructor []EntryPoint `json:"CONSTRUCTOR"`
External []EntryPoint `json:"EXTERNAL"`
L1Handler []EntryPoint `json:"L1_HANDLER"`
}
type EstimateFlag ¶ added in v0.15.20
type EstimateFlag int
const (
EstimateSkipValidateFlag EstimateFlag = iota + 1
)
func (EstimateFlag) ToSimulationFlag ¶ added in v0.15.20
func (e EstimateFlag) ToSimulationFlag() (SimulationFlag, error)
ToSimulationFlag converts an EstimateFlag to the corresponding SimulationFlag.
func (*EstimateFlag) UnmarshalJSON ¶ added in v0.15.20
func (e *EstimateFlag) UnmarshalJSON(bytes []byte) (err error)
type EventArgs ¶
type EventArgs struct {
EventFilter
ResultPageRequest
}
type EventFilter ¶
type EventFilter struct {
FromBlock *BlockID `json:"from_block"`
ToBlock *BlockID `json:"to_block"`
Address AddressList `json:"address"`
Keys [][]felt.Felt `json:"keys"`
}
type EventsChunk ¶
type EventsChunk struct {
Events []EmittedEvent `json:"events"`
ContinuationToken string `json:"continuation_token,omitempty"`
}
type ExecuteInvocation ¶ added in v0.15.20
type ExecuteInvocation struct {
RevertReason string `json:"revert_reason"`
*FunctionInvocation `json:",omitempty"`
}
func AdaptVMExecuteInvocation ¶ added in v0.15.20
func AdaptVMExecuteInvocation(vmFnInvocation *vm.ExecuteInvocation) ExecuteInvocation
func (ExecuteInvocation) MarshalJSON ¶ added in v0.15.20
func (e ExecuteInvocation) MarshalJSON() ([]byte, error)
type ExecutionResources ¶ added in v0.15.20
type ExecutionResources struct {
InnerExecutionResources
L1DataGas uint64 `json:"l1_data_gas"`
}
func AdaptVMExecutionResources ¶ added in v0.15.20
func AdaptVMExecutionResources(r *vm.ExecutionResources) ExecutionResources
type FeeEstimate ¶ added in v0.15.20
type FeeEstimate struct {
L1GasConsumed *felt.Felt `json:"l1_gas_consumed,omitempty"`
L1GasPrice *felt.Felt `json:"l1_gas_price,omitempty"`
L2GasConsumed *felt.Felt `json:"l2_gas_consumed,omitempty"`
L2GasPrice *felt.Felt `json:"l2_gas_price,omitempty"`
L1DataGasConsumed *felt.Felt `json:"l1_data_gas_consumed,omitempty"`
L1DataGasPrice *felt.Felt `json:"l1_data_gas_price,omitempty"`
OverallFee *felt.Felt `json:"overall_fee"`
Unit *FeeUnit `json:"unit,omitempty"`
}
type FeePayment ¶ added in v0.15.20
type FeeUnit ¶ added in v0.15.20
type FeeUnit byte
func (FeeUnit) MarshalText ¶ added in v0.15.20
func (*FeeUnit) UnmarshalText ¶ added in v0.15.20
type FunctionCall ¶ added in v0.15.20
type FunctionCall struct {
ContractAddress felt.Felt `json:"contract_address"`
EntryPointSelector felt.Felt `json:"entry_point_selector"`
Calldata CalldataInputs `json:"calldata"`
}
https://github.com/starkware-libs/starknet-specs/blob/v0.3.0/api/starknet_api_openrpc.json#L2344
type FunctionInvocation ¶ added in v0.15.20
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 *InnerExecutionResources `json:"execution_resources"`
IsReverted bool `json:"is_reverted"`
}
func AdaptFeederFunctionInvocation ¶ added in v0.15.20
func AdaptFeederFunctionInvocation(snFnInvocation *starknet.FunctionInvocation) FunctionInvocation
func AdaptVMFunctionInvocation ¶ added in v0.15.20
func AdaptVMFunctionInvocation(vmFnInvocation *vm.FunctionInvocation) FunctionInvocation
type GlobalRoots ¶ added in v0.16.0
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) AddTransaction ¶ added in v0.15.20
func (h *Handler) AddTransaction( ctx context.Context, tx *BroadcastedTransaction, ) (AddTxResponse, *jsonrpc.Error)
AddTransaction adds a transaction to the mempool or forwards it to the feeder gateway.
func (*Handler) BlockHashAndNumber ¶ added in v0.16.0
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/release/v0.10.2/api/starknet_api_openrpc.json#L827
func (*Handler) BlockNumber ¶ added in v0.16.0
BlockNumber returns the latest synced block number.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/release/v0.10.2/api/starknet_api_openrpc.json#L809
func (*Handler) BlockTransactionCount ¶ added in v0.16.0
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/release/v0.10.2/api/starknet_api_openrpc.json#L622
func (*Handler) BlockWithReceipts ¶ added in v0.15.13
func (h *Handler) BlockWithReceipts( id *BlockID, responseFlags ResponseFlags, ) (*BlockWithReceipts, *jsonrpc.Error)
BlockWithReceipts returns the block information with transaction receipts given a block ID.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/cce1563eff702c87590bad3a48382d2febf1f7d9/api/starknet_api_openrpc.json#L99
func (*Handler) BlockWithTxHashes ¶ added in v0.15.13
func (h *Handler) BlockWithTxHashes(id *BlockID) (*BlockWithTxHashes, *jsonrpc.Error)
BlockWithTxHashes returns the block information with transaction hashes given a block ID.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/cce1563eff702c87590bad3a48382d2febf1f7d9/api/starknet_api_openrpc.json#L25
func (*Handler) BlockWithTxs ¶ added in v0.15.13
func (h *Handler) BlockWithTxs( blockID *BlockID, responseFlags ResponseFlags, ) (*BlockWithTxs, *jsonrpc.Error)
BlockWithTxs returns the block information with full transactions given a block ID.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/cce1563eff702c87590bad3a48382d2febf1f7d9/api/starknet_api_openrpc.json#L62
func (*Handler) ChainID ¶ added in v0.16.0
ChainID returns the chain ID of the currently configured network.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/release/v0.10.2/api/starknet_api_openrpc.json#L856
func (*Handler) Class ¶ added in v0.16.0
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/release/v0.10.2/api/starknet_api_openrpc.json#L484
func (*Handler) ClassAt ¶ added in v0.16.0
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/release/v0.10.2/api/starknet_api_openrpc.json#L573
func (*Handler) ClassHashAt ¶ added in v0.16.0
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/release/v0.10.2/api/starknet_api_openrpc.json#L533
func (*Handler) CompiledCasm ¶ added in v0.16.0
CompiledCasm receives a class hash and returns the compiled cairo assembly (CASM)
func (*Handler) EstimateFee ¶ added in v0.15.15
func (h *Handler) EstimateFee( ctx context.Context, broadcastedTxns BroadcastedTransactionInputs, estimateFlags []EstimateFlag, id *BlockID, ) ([]FeeEstimate, http.Header, *jsonrpc.Error)
***************************************************
Estimate Fee Handlers
****************************************************
func (*Handler) EstimateMessageFee ¶ added in v0.15.15
func (*Handler) Events ¶
func (h *Handler) Events(args *EventArgs) (EventsChunk, *jsonrpc.Error)
Events gets the events matching a filter
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/785257f27cdc4ea0ca3b62a21b0f7bf51000f9b1/api/starknet_api_openrpc.json#L810
func (*Handler) GetMessageStatus ¶ added in v0.16.0
func (*Handler) Nonce ¶ added in v0.16.0
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/release/v0.10.2/api/starknet_api_openrpc.json#L940
func (*Handler) SimulateTransactions ¶
func (h *Handler) SimulateTransactions( ctx context.Context, id *BlockID, transactions BroadcastedTransactionInputs, simulationFlags []SimulationFlag, ) (SimulateTransactionsResponse, http.Header, *jsonrpc.Error)
func (*Handler) StateUpdate ¶
func (h *Handler) StateUpdate(id *BlockID, contractAddresses AddressList) (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/9377851884da5c81f757b6ae0ed47e84f9e7c058/api/starknet_api_openrpc.json#L136
func (*Handler) StorageAt ¶ added in v0.15.20
func (h *Handler) StorageAt( address *felt.Address, key *felt.Felt, id *BlockID, flags StorageAtResponseFlags, ) (*StorageAtResponse, *jsonrpc.Error)
StorageAt gets the value of the storage at the given address and key.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/d6dc6ad31a1bb61c287d862ca4bdef4eb66a59a2/api/starknet_api_openrpc.json#L197
func (*Handler) StorageProof ¶ added in v0.16.0
func (h *Handler) StorageProof( id *BlockID, classes, contracts []felt.Felt, storageKeys []StorageKeys, ) (*StorageProofResult, *jsonrpc.Error)
StorageAt get merkle paths in one of the state tries: global state, classes, individual contract. A single request can query for any mix of the three types of storage proofs (classes, contracts, and storage).
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/release/v0.10.2/api/starknet_api_openrpc.json#L980
func (*Handler) SubscribeEvents ¶
func (h *Handler) SubscribeEvents( ctx context.Context, fromAddrs AddressList, keys [][]felt.Felt, blockID *SubscriptionBlockID, finalityStatus *TxnFinalityStatusWithoutL1, ) (SubscriptionID, *jsonrpc.Error)
SubscribeEvents creates a WebSocket stream which will fire events for new Starknet events with applied filters
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/785257f27cdc4ea0ca3b62a21b0f7bf51000f9b1/api/starknet_ws_api.json#L59
func (*Handler) SubscribeNewHeads ¶
func (h *Handler) SubscribeNewHeads( ctx context.Context, blockID *SubscriptionBlockID, ) (SubscriptionID, *jsonrpc.Error)
SubscribeNewHeads creates a WebSocket stream which will fire events when a new block header is added.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/785257f27cdc4ea0ca3b62a21b0f7bf51000f9b1/api/starknet_ws_api.json#L10
func (*Handler) SubscribeNewTransactionReceipts ¶
func (h *Handler) SubscribeNewTransactionReceipts( ctx context.Context, senderAddress []felt.Address, finalityStatuses []TxnFinalityStatusWithoutL1, ) (SubscriptionID, *jsonrpc.Error)
SubscribeNewTransactionReceipts creates a WebSocket stream which will fire events when new transaction receipts are created.
The endpoint receives a vector of finality statuses. An event is fired for each finality status update. It is possible for receipts for pre-confirmed transactions to be received multiple times, or not at all.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/785257f27cdc4ea0ca3b62a21b0f7bf51000f9b1/api/starknet_ws_api.json#L193
func (*Handler) SubscribeNewTransactions ¶
func (h *Handler) SubscribeNewTransactions( ctx context.Context, finalityStatus []TxnStatusWithoutL1, senderAddr []felt.Address, tags SubscriptionTags, ) (SubscriptionID, *jsonrpc.Error)
SubscribeNewTransactions Creates a WebSocket stream which will fire events when new transaction are created.
The endpoint receives a vector of finality statuses. An event is fired for each finality status update. It is possible for events for pre-confirmed transactions to be received multiple times, or not at all.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/785257f27cdc4ea0ca3b62a21b0f7bf51000f9b1/api/starknet_ws_api.json#L264
func (*Handler) SubscribeTransactionStatus ¶
func (h *Handler) SubscribeTransactionStatus( ctx context.Context, txHash *felt.Felt, ) (SubscriptionID, *jsonrpc.Error)
SubscribeTransactionStatus subscribes to status changes of a transaction. It checks for updates each time a new block is added. Later updates are sent only when the transaction status changes.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/785257f27cdc4ea0ca3b62a21b0f7bf51000f9b1/api/starknet_ws_api.json#L151
func (*Handler) Syncing ¶ added in v0.16.0
Syncing returns the syncing status of the node.
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/release/v0.10.2/api/starknet_api_openrpc.json#L869
func (*Handler) TraceBlockTransactions ¶
func (h *Handler) TraceBlockTransactions( ctx context.Context, id *BlockID, traceFlags []TraceFlag, ) (TraceBlockTransactionsResponse, http.Header, *jsonrpc.Error)
TraceBlockTransactions returns the trace for a given blockID
It follows the specification defined here: https://github.com/starkware-libs/starknet-specs/blob/9377851884da5c81f757b6ae0ed47e84f9e7c058/api/starknet_trace_api_openrpc.json#L108
func (*Handler) TraceTransaction ¶
func (h *Handler) TraceTransaction( ctx context.Context, hash *felt.Felt, ) (TransactionTrace, http.Header, *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/9377851884da5c81f757b6ae0ed47e84f9e7c058/api/starknet_trace_api_openrpc.json#L11
func (*Handler) TransactionByBlockIDAndIndex ¶ added in v0.15.20
func (h *Handler) TransactionByBlockIDAndIndex( blockID *BlockID, txIndex int, responseFlags ResponseFlags, ) (*Transaction, *jsonrpc.Error)
func (*Handler) TransactionByHash ¶ added in v0.15.20
func (h *Handler) TransactionByHash( hash *felt.Felt, responseFlags ResponseFlags, ) (*Transaction, *jsonrpc.Error)
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/0bf403bfafbfbe0eaa52103a9c7df545bec8f73b/api/starknet_api_openrpc.json#L315
func (*Handler) TransactionReceiptByHash ¶
func (h *Handler) TransactionReceiptByHash( hash *felt.Felt, ) (*TransactionReceipt, *jsonrpc.Error)
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) WithCallMaxGas ¶
func (*Handler) WithCallMaxSteps ¶
func (*Handler) WithCompiler ¶ added in v0.15.20
func (*Handler) WithFilterLimit ¶
WithFilterLimit sets the maximum number of blocks to scan in a single call for event filtering.
func (*Handler) WithReceivedTransactionFeed ¶ added in v0.16.0
func (*Handler) WithSubmittedTransactionsCache ¶
func (h *Handler) WithSubmittedTransactionsCache(cache *rpccore.TransactionCache) *Handler
type HashToNode ¶ added in v0.16.0
type InitialReads ¶ added in v0.15.20
type InitialReads struct {
Storage []StorageEntry `json:"storage"`
Nonces []NonceEntry `json:"nonces"`
ClassHashes []ClassHashEntry `json:"class_hashes"`
DeclaredContracts []DeclaredContractEntry `json:"declared_contracts"`
}
type InnerExecutionResources ¶ added in v0.15.20
type L1DAMode ¶ added in v0.15.20
type L1DAMode uint8
func (L1DAMode) MarshalText ¶ added in v0.15.20
type MigratedCompiledClass ¶
type MigratedCompiledClass struct {
ClassHash felt.SierraClassHash `json:"class_hash"`
CompiledClassHash felt.CasmClassHash `json:"compiled_class_hash"`
}
type MsgFromL1 ¶ added in v0.15.20
type MsgFromL1 struct {
// The address of the L1 contract sending the message.
From eth.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"`
}
MsgFromL1 represents a message sent from L1 to L2.
type MsgStatus ¶ added in v0.16.0
type MsgStatus struct {
L1HandlerHash *felt.Felt `json:"transaction_hash"`
FinalityStatus TxnStatus `json:"finality_status"`
ExecutionStatus TxnExecutionStatus `json:"execution_status"`
FailureReason string `json:"failure_reason,omitempty"`
}
type NonceEntry ¶ added in v0.15.20
type OrderedEvent ¶ added in v0.15.20
type OrderedL2toL1Message ¶ added in v0.15.20
type ReorgEvent ¶ added in v0.15.20
type ReplacedClass ¶ added in v0.15.20
type Resource ¶ added in v0.15.20
type Resource uint32
func (Resource) MarshalText ¶ added in v0.15.20
func (*Resource) UnmarshalJSON ¶ added in v0.15.20
func (*Resource) UnmarshalText ¶ added in v0.15.20
type ResourceBounds ¶ added in v0.15.20
type ResourceBoundsMap ¶ added in v0.15.20
type ResourceBoundsMap struct {
L1Gas ResourceBounds `json:"l1_gas" validate:"required"`
L2Gas ResourceBounds `json:"l2_gas" validate:"required"`
L1DataGas ResourceBounds `json:"l1_data_gas" validate:"required"`
}
func (*ResourceBoundsMap) MarshalJSON ¶ added in v0.15.20
func (r *ResourceBoundsMap) MarshalJSON() ([]byte, error)
type ResourcePrice ¶ added in v0.15.20
type ResponseFlags ¶ added in v0.15.20
type ResponseFlags struct {
IncludeProofFacts bool
}
func (*ResponseFlags) UnmarshalJSON ¶ added in v0.15.20
func (r *ResponseFlags) UnmarshalJSON(data []byte) error
type ResultPageRequest ¶ added in v0.15.20
type SimulateTransactionsResponse ¶ added in v0.15.20
type SimulateTransactionsResponse struct {
SimulatedTransactions []SimulatedTransaction `json:"simulated_transactions"`
InitialReads *InitialReads `json:"initial_reads"`
}
SimulateTransactionsResponse represents the response for simulateTransactions. When RETURN_INITIAL_READS flag is not set, it marshals as an array. When RETURN_INITIAL_READS flag is set, it marshals as an object with simulated_transactions and initial_reads.
func (SimulateTransactionsResponse) MarshalJSON ¶ added in v0.15.20
func (r SimulateTransactionsResponse) MarshalJSON() ([]byte, error)
type SimulatedTransaction ¶
type SimulatedTransaction struct {
TransactionTrace *TransactionTrace `json:"transaction_trace,omitempty"`
FeeEstimation FeeEstimate `json:"fee_estimation,omitzero"`
}
type SimulationFlag ¶ added in v0.15.20
type SimulationFlag int
const ( SkipValidateFlag SimulationFlag = iota + 1 SkipFeeChargeFlag ReturnInitialReadsFlag )
func (*SimulationFlag) UnmarshalJSON ¶ added in v0.15.20
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"`
MigratedCompiledClasses []MigratedCompiledClass `json:"migrated_compiled_classes"`
}
func AdaptVMStateDiff ¶
type StateUpdate ¶
type StorageAtResponse ¶ added in v0.15.20
type StorageAtResponse struct {
Value felt.Felt `json:"value"`
LastUpdateBlock uint64 `json:"last_update_block"`
// contains filtered or unexported fields
}
StorageAtResponse represents the result of a `starknet_getStorageAt` operation.
func (*StorageAtResponse) MarshalJSON ¶ added in v0.15.20
func (st *StorageAtResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for StorageAtResponse.
func (*StorageAtResponse) UnmarshalJSON ¶ added in v0.15.20
func (st *StorageAtResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for StorageAtResponse.
type StorageAtResponseFlags ¶ added in v0.15.20
type StorageAtResponseFlags struct {
IncludeLastUpdateBlock bool
}
StorageAtResponseFlags represents the flags for the `starknet_getStorageAt` operation.
func (*StorageAtResponseFlags) UnmarshalJSON ¶ added in v0.15.20
func (f *StorageAtResponseFlags) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for StorageAtResponseFlags.
type StorageDiff ¶ added in v0.15.20
type StorageEntry ¶ added in v0.15.20
type StorageKeys ¶ added in v0.16.0
type StorageProofResult ¶ added in v0.16.0
type StorageProofResult struct {
ClassesProof []*HashToNode `json:"classes_proof"`
ContractsProof *ContractProof `json:"contracts_proof"`
ContractsStorageProofs [][]*HashToNode `json:"contracts_storage_proofs"`
GlobalRoots *GlobalRoots `json:"global_roots"`
}
type SubscriptionBlockID ¶ added in v0.15.20
type SubscriptionBlockID BlockID
As per the spec, this is the same as BlockID, but without `pre_confirmed` and `l1_accepted`
func (*SubscriptionBlockID) Hash ¶ added in v0.15.20
func (b *SubscriptionBlockID) Hash() *felt.Felt
func (*SubscriptionBlockID) IsHash ¶ added in v0.15.20
func (b *SubscriptionBlockID) IsHash() bool
func (*SubscriptionBlockID) IsLatest ¶ added in v0.15.20
func (b *SubscriptionBlockID) IsLatest() bool
func (*SubscriptionBlockID) IsNumber ¶ added in v0.15.20
func (b *SubscriptionBlockID) IsNumber() bool
func (*SubscriptionBlockID) Number ¶ added in v0.15.20
func (b *SubscriptionBlockID) Number() uint64
func (*SubscriptionBlockID) Type ¶ added in v0.15.20
func (b *SubscriptionBlockID) Type() blockIDType
func (*SubscriptionBlockID) UnmarshalJSON ¶ added in v0.15.20
func (b *SubscriptionBlockID) UnmarshalJSON(data []byte) error
type SubscriptionEmittedEvent ¶
type SubscriptionEmittedEvent struct {
EmittedEvent
FinalityStatus TxnFinalityStatus `json:"finality_status"`
}
type SubscriptionID ¶
type SubscriptionID string
type SubscriptionNewTransaction ¶ added in v0.15.20
type SubscriptionNewTransaction struct {
Transaction
FinalityStatus TxnStatusWithoutL1 `json:"finality_status"`
}
type SubscriptionResponse ¶ added in v0.15.20
type SubscriptionTags ¶ added in v0.15.20
type SubscriptionTags struct {
IncludeProofFacts bool
}
func (*SubscriptionTags) UnmarshalJSON ¶ added in v0.15.20
func (r *SubscriptionTags) UnmarshalJSON(data []byte) error
type SubscriptionTransactionStatus ¶ added in v0.15.20
type SubscriptionTransactionStatus struct {
TransactionHash *felt.Felt `json:"transaction_hash"`
Status TransactionStatus `json:"status"`
}
type Sync ¶ added in v0.16.0
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 ¶ added in v0.16.0
type TraceBlockTransactionsResponse ¶ added in v0.15.20
type TraceBlockTransactionsResponse struct {
Traces []TracedBlockTransaction `json:"traces"`
InitialReads *InitialReads `json:"initial_reads"`
}
TraceBlockTransactionsResponse represents the response for traceBlockTransactions. When RETURN_INITIAL_READS flag is not set, it marshals as an array. When RETURN_INITIAL_READS flag is set, it marshals as an object with traces and initial_reads.
func (TraceBlockTransactionsResponse) MarshalJSON ¶ added in v0.15.20
func (r TraceBlockTransactionsResponse) MarshalJSON() ([]byte, error)
type TraceFlag ¶ added in v0.15.20
type TraceFlag int
func (*TraceFlag) UnmarshalJSON ¶ added in v0.15.20
type TracedBlockTransaction ¶
type TracedBlockTransaction struct {
TraceRoot *TransactionTrace `json:"trace_root,omitempty"`
TransactionHash *felt.Felt `json:"transaction_hash,omitempty"`
}
func AdaptFeederBlockTrace ¶
func AdaptFeederBlockTrace( block *core.Block, blockTrace *starknet.BlockTrace, ) ([]TracedBlockTransaction, error)
type Transaction ¶ added in v0.15.20
type Transaction struct {
Hash *felt.Felt `json:"transaction_hash,omitempty"`
Type TransactionType `json:"type" validate:"required"`
Version *felt.Felt `json:"version,omitempty" validate:"required,version_0x3"`
Nonce *felt.Felt `json:"nonce,omitempty" validate:"required"`
MaxFee *felt.Felt `json:"max_fee,omitempty"`
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 `json:"sender_address,omitempty" validate:"required_if=Type DECLARE,required_if=Type INVOKE"`
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"`
CompiledClassHash *felt.Felt `json:"compiled_class_hash,omitempty"`
ResourceBounds *ResourceBoundsMap `json:"resource_bounds,omitempty" validate:"required"`
Tip *felt.Felt `json:"tip,omitempty" validate:"required"`
PaymasterData *[]*felt.Felt `json:"paymaster_data,omitempty" validate:"required"`
AccountDeploymentData *[]*felt.Felt `json:"account_deployment_data,omitempty" validate:"required_if=Type INVOKE,required_if=Type DECLARE"`
NonceDAMode *DataAvailabilityMode `json:"nonce_data_availability_mode,omitempty" validate:"required"`
FeeDAMode *DataAvailabilityMode `json:"fee_data_availability_mode,omitempty" validate:"required"`
ProofFacts *[]felt.Felt `json:"proof_facts,omitempty" validate:"excluded_unless=Type INVOKE"`
}
Transaction represents a Starknet transaction in the RPC API.
func AdaptCoreTransaction ¶ added in v0.15.20
func AdaptCoreTransaction(t core.Transaction) *Transaction
AdaptCoreTransaction adapts a core.Transaction to a local *Transaction.
func AdaptTransaction ¶ added in v0.15.20
func AdaptTransaction(coreTx core.Transaction, includeProofFacts bool) Transaction
AdaptTransaction adapts a core.Transaction to a local *Transaction. It's a wrapper around AdaptCoreTransaction that allows to exclude proof facts from the transaction. If includeProofFacts is false, the proof facts are set to nil, otherwise they're returned as is.
type TransactionExecutionErrorData ¶ added in v0.15.20
type TransactionExecutionErrorData struct {
TransactionIndex uint64 `json:"transaction_index"`
ExecutionError json.RawMessage `json:"execution_error"`
}
type TransactionReceipt ¶ added in v0.15.20
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 ¶ added in v0.15.20
func AdaptReceipt( receipt *core.TransactionReceipt, txn core.Transaction, finalityStatus TxnFinalityStatus, ) *TransactionReceipt
AdaptReceipt adapts a receipt and transaction into a local *TransactionReceipt. todo(rdr): TransactionReceipt should be returned by value
func AdaptReceiptWithBlockInfo ¶ added in v0.15.20
func AdaptReceiptWithBlockInfo( receipt *core.TransactionReceipt, txn core.Transaction, finalityStatus TxnFinalityStatus, blockHash *felt.Felt, blockNumber uint64, ) *TransactionReceipt
AdaptReceiptWithBlockInfo returns JSON-RPC TXN_RECEIPT_WITH_BLOCK_INFO.
type TransactionStatus ¶ added in v0.15.20
type TransactionStatus struct {
Finality TxnStatus `json:"finality_status"`
Execution TxnExecutionStatus `json:"execution_status,omitempty"`
FailureReason string `json:"failure_reason,omitempty"`
}
func AdaptTransactionStatus ¶ added in v0.15.20
func AdaptTransactionStatus( txStatus *starknet.TransactionStatus, ) (TransactionStatus, error)
type TransactionTrace ¶
type TransactionTrace struct {
Type TransactionType `json:"type"`
ValidateInvocation *FunctionInvocation `json:"validate_invocation,omitempty"`
ExecuteInvocation *ExecuteInvocation `json:"execute_invocation,omitempty" validate:"required_if=Type INVOKE"` //nolint:lll // validate tag
FeeTransferInvocation *FunctionInvocation `json:"fee_transfer_invocation,omitempty"`
ConstructorInvocation *FunctionInvocation `json:"constructor_invocation,omitempty" validate:"required_if=Type DEPLOY_ACCOUNT"` //nolint:lll // validate tag
FunctionInvocation *ExecuteInvocation `json:"function_invocation,omitempty" validate:"required_if=Type L1_HANDLER"` //nolint:lll // validate tag
StateDiff *StateDiff `json:"state_diff,omitempty"`
ExecutionResources *ExecutionResources `json:"execution_resources"`
}
func AdaptVMTransactionTrace ¶
func AdaptVMTransactionTrace(trace *vm.TransactionTrace) TransactionTrace
type TransactionType ¶ added in v0.15.20
type TransactionType uint8
const ( Invalid TransactionType = iota TxnDeclare TxnDeploy TxnDeployAccount TxnInvoke TxnL1Handler )
func (TransactionType) MarshalText ¶ added in v0.15.20
func (t TransactionType) MarshalText() ([]byte, error)
func (TransactionType) String ¶ added in v0.15.20
func (t TransactionType) String() string
func (*TransactionType) UnmarshalJSON ¶ added in v0.15.20
func (t *TransactionType) UnmarshalJSON(data []byte) error
type TransactionWithReceipt ¶ added in v0.15.20
type TransactionWithReceipt struct {
Transaction *Transaction `json:"transaction"`
Receipt *TransactionReceipt `json:"receipt"`
}
TransactionWithReceipt represents a transaction with its receipt
type TxnExecutionStatus ¶ added in v0.15.20
type TxnExecutionStatus uint8
const ( UnknownExecution TxnExecutionStatus = iota TxnSuccess TxnFailure )
func (TxnExecutionStatus) MarshalText ¶ added in v0.15.20
func (es TxnExecutionStatus) MarshalText() ([]byte, error)
func (*TxnExecutionStatus) UnmarshalText ¶ added in v0.15.20
func (es *TxnExecutionStatus) UnmarshalText(text []byte) error
type TxnFinalityStatus ¶ added in v0.15.20
type TxnFinalityStatus uint8
TxnFinalityStatus represents the finality status of a transaction.
const ( // Starts from 3 for TxnFinalityStatuses to match same numbers on TxnStatus TxnPreConfirmed TxnFinalityStatus = iota + 3 TxnAcceptedOnL2 TxnAcceptedOnL1 )
func (TxnFinalityStatus) MarshalText ¶ added in v0.15.20
func (fs TxnFinalityStatus) MarshalText() ([]byte, error)
func (*TxnFinalityStatus) UnmarshalText ¶ added in v0.15.20
func (fs *TxnFinalityStatus) UnmarshalText(text []byte) error
type TxnFinalityStatusWithoutL1 ¶ added in v0.15.20
type TxnFinalityStatusWithoutL1 TxnFinalityStatus
func (TxnFinalityStatusWithoutL1) MarshalText ¶ added in v0.15.20
func (s TxnFinalityStatusWithoutL1) MarshalText() ([]byte, error)
func (*TxnFinalityStatusWithoutL1) UnmarshalText ¶ added in v0.15.20
func (s *TxnFinalityStatusWithoutL1) UnmarshalText(text []byte) error
type TxnStatus ¶ added in v0.15.20
type TxnStatus uint8
func (TxnStatus) MarshalText ¶ added in v0.15.20
type TxnStatusWithoutL1 ¶ added in v0.15.20
type TxnStatusWithoutL1 TxnStatus
func (TxnStatusWithoutL1) MarshalText ¶ added in v0.15.20
func (s TxnStatusWithoutL1) MarshalText() ([]byte, error)
func (*TxnStatusWithoutL1) UnmarshalText ¶ added in v0.15.20
func (s *TxnStatusWithoutL1) UnmarshalText(text []byte) error
Source Files
¶
- adapt_trace.go
- adapt_transaction.go
- block.go
- block_id.go
- chain.go
- class.go
- compiled_casm.go
- estimate_fee.go
- events.go
- handlers.go
- helpers.go
- l1.go
- nonce.go
- response_flags.go
- simulation.go
- state_update.go
- storage.go
- subscription_events.go
- subscription_heads.go
- subscription_receipts.go
- subscription_status.go
- subscription_transactions.go
- subscription_types.go
- subscriptions.go
- sync.go
- trace.go
- trace_invocation.go
- transaction.go
- transaction_types.go
- validator.go