Documentation
¶
Index ¶
- type API
- func (api API) CallContract(ctx context.Context, block data.BlockID, ...) (response Response[[]data.Felt], err error)
- func (api API) Declare(ctx context.Context, tx data.Declare) (string, error)
- func (api API) DeployAccount(ctx context.Context, tx data.DeployAccount) (string, error)
- func (api API) GetBlock(ctx context.Context, block data.BlockID) (response Block, err error)
- func (api API) GetClassAt(ctx context.Context, block data.BlockID, contractAddress string) (response data.Class, err error)
- func (api API) GetClassByHash(ctx context.Context, block data.BlockID, classHash string) (response data.Class, err error)
- func (api API) GetClassHashAt(ctx context.Context, block data.BlockID, contractAddress string) (response string, err error)
- func (api API) GetCode(ctx context.Context, block data.BlockID, contractAddress string) (response Code, err error)
- func (api API) GetContractAddresses(ctx context.Context) (response ContractAddresses, err error)
- func (api API) GetNonce(ctx context.Context, block data.BlockID, contractAddress string) (response string, err error)
- func (api API) GetStateUpdate(ctx context.Context, block data.BlockID) (response data.StateUpdate, err error)
- func (api API) GetStorageAt(ctx context.Context, block data.BlockID, contractAddress, key string) (response string, err error)
- func (api API) GetTransaction(ctx context.Context, hash string) (response Trace, err error)
- func (api API) GetTransactionStatus(ctx context.Context, txHash string) (response TransactionStatus, err error)
- func (api API) Invoke(ctx context.Context, tx data.Invoke) (string, error)
- func (api API) TraceBlock(ctx context.Context, block data.BlockID) (response TraceResponse, err error)
- func (api API) TraceTransaction(ctx context.Context, hash string) (response Trace, err error)
- type ApiOption
- type Block
- type BuiltinInstanceCounter
- type Code
- type ContractAddresses
- type ExecutionResources
- type GetTransactionResponse
- type Invocation
- type Receipt
- type Response
- type Trace
- type TraceResponse
- type TransactionStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API - wrapper of starknet node API.
func (API) CallContract ¶
func (api API) CallContract(ctx context.Context, block data.BlockID, contractAddress, entrypointSelector string, calldata []string) (response Response[[]data.Felt], err error)
CallContract -
func (API) DeployAccount ¶
DeployAccount -
func (API) GetClassAt ¶
func (api API) GetClassAt(ctx context.Context, block data.BlockID, contractAddress string) (response data.Class, err error)
GetClassAt -
func (API) GetClassByHash ¶
func (api API) GetClassByHash(ctx context.Context, block data.BlockID, classHash string) (response data.Class, err error)
GetClassByHash -
func (API) GetClassHashAt ¶
func (api API) GetClassHashAt(ctx context.Context, block data.BlockID, contractAddress string) (response string, err error)
GetClassHashAt -
func (API) GetCode ¶
func (api API) GetCode(ctx context.Context, block data.BlockID, contractAddress string) (response Code, err error)
GetBlock - Gets code of contract
func (API) GetContractAddresses ¶
func (api API) GetContractAddresses(ctx context.Context) (response ContractAddresses, err error)
GetContractAddresses -
func (API) GetNonce ¶
func (api API) GetNonce(ctx context.Context, block data.BlockID, contractAddress string) (response string, err error)
GetNonce - Gets nonce for address
func (API) GetStateUpdate ¶
func (api API) GetStateUpdate(ctx context.Context, block data.BlockID) (response data.StateUpdate, err error)
GetStateUpdate -
func (API) GetStorageAt ¶
func (api API) GetStorageAt(ctx context.Context, block data.BlockID, contractAddress, key string) (response string, err error)
GetStorageAt - 'key' is decimal string
func (API) GetTransaction ¶
GetTransaction - Gets the transaction by hash
func (API) GetTransactionStatus ¶
func (api API) GetTransactionStatus(ctx context.Context, txHash string) (response TransactionStatus, err error)
GetTransactionStatus - Gets nonce for address
func (API) TraceBlock ¶
func (api API) TraceBlock(ctx context.Context, block data.BlockID) (response TraceResponse, err error)
TraceBlock -
type Block ¶
type Block struct { Timestamp int64 `json:"timestamp"` BlockNumber uint64 `json:"block_number"` Status string `json:"status"` BlockHash string `json:"block_hash"` ParentHash string `json:"parent_block_hash"` NewRoot string `json:"state_root"` GasPrice string `json:"gas_price"` SequencerAddress string `json:"sequencer_address"` StarknetVersion *string `json:"starknet_version,omitempty"` Transactions []data.Transaction `json:"transactions"` Receipts []Receipt `json:"transaction_receipts"` }
Block -
type BuiltinInstanceCounter ¶
type BuiltinInstanceCounter struct { RangeCheckBuiltin int `json:"range_check_builtin"` EcdsaBuiltin int `json:"ecdsa_builtin"` PedersenBuiltin int `json:"pedersen_builtin"` BitwiseBuiltin int `json:"bitwise_builtin"` }
BuiltinInstanceCounter -
type ContractAddresses ¶
type ContractAddresses struct { Starknet string `json:"Starknet"` GpsStatementVerifier string `json:"GpsStatementVerifier"` }
ContractAddresses -
type ExecutionResources ¶
type ExecutionResources struct { NSteps int `json:"n_steps"` BuiltinInstanceCounter BuiltinInstanceCounter `json:"builtin_instance_counter"` NMemoryHoles int `json:"n_memory_holes"` }
ExecutionResources -
type GetTransactionResponse ¶
type GetTransactionResponse struct { Status string `json:"status"` BlockHash string `json:"block_hash"` BlockNumber uint64 `json:"block_number"` TransactionIndex uint64 `json:"transaction_index"` Transaction data.Transaction `json:"transaction"` }
GetTransactionResponse -
type Invocation ¶
type Invocation struct { CallerAddress data.Felt `json:"caller_address"` ContractAddress data.Felt `json:"contract_address"` Calldata []string `json:"calldata"` CallType string `json:"call_type"` ClassHash data.Felt `json:"class_hash"` Selector data.Felt `json:"selector"` EntrypointType string `json:"entry_point_type"` Result []string `json:"result"` ExecutionResources ExecutionResources `json:"execution_resources"` InternalCalls []Invocation `json:"internal_calls"` Events []data.Event `json:"events"` Messages []data.Message `json:"messages"` }
Invocation -
type Receipt ¶
type Receipt struct { TransactionIndex uint64 `json:"transaction_index"` TransactionHash string `json:"transaction_hash"` L2ToL1Messages []data.Message `json:"l2_to_l1_messages"` L1ToL2Message data.Message `json:"l1_to_l2_consumed_message"` Events []data.Event `json:"events"` ExecutionResources ExecutionResources `json:"execution_resources"` ActualFee data.Felt `json:"actual_fee"` }
Receipt -
type Trace ¶
type Trace struct { ValidateInvocation *Invocation `json:"validate_invocation,omitempty"` FunctionInvocation *Invocation `json:"function_invocation,omitempty"` FeeTransferInvocation *Invocation `json:"fee_transfer_invocation,omitempty"` Signature []string `json:"signature"` TransactionHash data.Felt `json:"transaction_hash"` }
Trace -
type TransactionStatus ¶
type TransactionStatus struct { Status string `json:"tx_status"` BlockHash string `json:"block_hash"` }
TransactionStatus -
Source Files
¶
- add_transaction.go
- api.go
- cache.go
- call_contract.go
- get_block.go
- get_class_at.go
- get_class_by_hash.go
- get_class_hash_at.go
- get_code.go
- get_contract_addresses.go
- get_nonce.go
- get_state_update.go
- get_storage_at.go
- get_transaction.go
- get_transaction_status.go
- options.go
- response.go
- trace_block.go
- trace_transaction.go
Click to show internal directories.
Click to hide internal directories.