Documentation
¶
Index ¶
- func ExponentialBackoff(wait time.Duration) time.Duration
- func NopBackoff(d time.Duration) time.Duration
- type Backoff
- type Block
- type BuiltinInstanceCounter
- type Cairo0Definition
- type ClassDefinition
- type Client
- func (c *Client) Block(ctx context.Context, blockID string) (*Block, error)
- func (c *Client) ClassDefinition(ctx context.Context, classHash *felt.Felt) (*ClassDefinition, error)
- func (c *Client) CompiledClassDefinition(ctx context.Context, classHash *felt.Felt) (json.RawMessage, error)
- func (c *Client) PublickKey(ctx context.Context) (*felt.Felt, error)
- func (c *Client) Signature(ctx context.Context, blockID string) (*Signature, error)
- func (c *Client) StateUpdate(ctx context.Context, blockID string) (*StateUpdate, error)
- func (c *Client) StateUpdateWithBlock(ctx context.Context, blockID string) (*StateUpdateWithBlock, error)
- func (c *Client) Transaction(ctx context.Context, transactionHash *felt.Felt) (*TransactionStatus, error)
- func (c *Client) WithBackoff(b Backoff) *Client
- func (c *Client) WithLogger(log utils.SimpleLogger) *Client
- func (c *Client) WithMaxRetries(num int) *Client
- func (c *Client) WithMaxWait(d time.Duration) *Client
- func (c *Client) WithMinWait(d time.Duration) *Client
- func (c *Client) WithTimeout(t time.Duration) *Client
- func (c *Client) WithUserAgent(ua string) *Client
- type EntryPoint
- type EntryPoints
- type Event
- type ExecutionResources
- type ExecutionStatus
- type FinalityStatus
- type L1ToL2Message
- type L2ToL1Message
- type SierraDefinition
- type SierraEntryPoint
- type SierraEntryPoints
- type Signature
- type StateUpdate
- type StateUpdateWithBlock
- type Transaction
- type TransactionReceipt
- type TransactionStatus
- type TransactionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct {
Hash *felt.Felt `json:"block_hash"`
ParentHash *felt.Felt `json:"parent_block_hash"`
Number uint64 `json:"block_number"`
StateRoot *felt.Felt `json:"state_root"`
Status string `json:"status"`
GasPrice *felt.Felt `json:"gas_price"`
Transactions []*Transaction `json:"transactions"`
Timestamp uint64 `json:"timestamp"`
Version string `json:"starknet_version"`
Receipts []*TransactionReceipt `json:"transaction_receipts"`
SequencerAddress *felt.Felt `json:"sequencer_address"`
}
Block object returned by the feeder in JSON format for "get_block" endpoint
type BuiltinInstanceCounter ¶
type Cairo0Definition ¶
type Cairo0Definition struct {
Abi json.RawMessage `json:"abi"`
EntryPoints EntryPoints `json:"entry_points_by_type"`
Program json.RawMessage `json:"program"`
}
type ClassDefinition ¶
type ClassDefinition struct {
V0 *Cairo0Definition
V1 *SierraDefinition
}
func (*ClassDefinition) UnmarshalJSON ¶
func (c *ClassDefinition) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewTestClient ¶
NewTestClient returns a client and a function to close a test server.
func (*Client) ClassDefinition ¶
func (*Client) CompiledClassDefinition ¶ added in v0.3.1
func (*Client) PublickKey ¶ added in v0.6.0
func (*Client) StateUpdate ¶
func (*Client) StateUpdateWithBlock ¶ added in v0.6.0
func (*Client) Transaction ¶
func (*Client) WithBackoff ¶
func (*Client) WithLogger ¶
func (c *Client) WithLogger(log utils.SimpleLogger) *Client
func (*Client) WithMaxRetries ¶
func (*Client) WithUserAgent ¶ added in v0.6.0
type EntryPoint ¶
type EntryPoints ¶ added in v0.4.0
type EntryPoints struct {
Constructor []EntryPoint `json:"CONSTRUCTOR"`
External []EntryPoint `json:"EXTERNAL"`
L1Handler []EntryPoint `json:"L1_HANDLER"`
}
type ExecutionResources ¶
type ExecutionResources struct {
Steps uint64 `json:"n_steps"`
BuiltinInstanceCounter BuiltinInstanceCounter `json:"builtin_instance_counter"`
MemoryHoles uint64 `json:"n_memory_holes"`
}
type ExecutionStatus ¶ added in v0.4.1
type ExecutionStatus uint8
const ( Succeeded ExecutionStatus = iota + 1 Reverted )
func (*ExecutionStatus) UnmarshalJSON ¶ added in v0.4.1
func (es *ExecutionStatus) UnmarshalJSON(data []byte) error
type FinalityStatus ¶ added in v0.4.1
type FinalityStatus uint8
const ( AcceptedOnL2 FinalityStatus = iota + 1 AcceptedOnL1 NotReceived )
func (*FinalityStatus) UnmarshalJSON ¶ added in v0.4.1
func (fs *FinalityStatus) UnmarshalJSON(data []byte) error
type L1ToL2Message ¶
type L2ToL1Message ¶
type SierraDefinition ¶
type SierraDefinition struct {
Abi string `json:"abi,omitempty"`
EntryPoints SierraEntryPoints `json:"entry_points_by_type"`
Program []*felt.Felt `json:"sierra_program"`
Version string `json:"contract_class_version"`
}
type SierraEntryPoint ¶
type SierraEntryPoints ¶ added in v0.4.0
type SierraEntryPoints struct {
Constructor []SierraEntryPoint `json:"CONSTRUCTOR"`
External []SierraEntryPoint `json:"EXTERNAL"`
L1Handler []SierraEntryPoint `json:"L1_HANDLER"`
}
type Signature ¶ added in v0.6.0
type Signature struct {
BlockNumber uint64 `json:"block_number"`
Signature []*felt.Felt `json:"signature"`
SignatureInput struct {
BlockHash *felt.Felt `json:"block_hash"`
StateDiffCommitment *felt.Felt `json:"state_diff_commitment"`
} `json:"signature_input"`
}
Signature object returned by the feeder in JSON format for "get_signature" endpoint
type StateUpdate ¶
type StateUpdate struct {
BlockHash *felt.Felt `json:"block_hash"`
NewRoot *felt.Felt `json:"new_root"`
OldRoot *felt.Felt `json:"old_root"`
StateDiff struct {
StorageDiffs map[string][]struct {
Key *felt.Felt `json:"key"`
Value *felt.Felt `json:"value"`
} `json:"storage_diffs"`
Nonces map[string]*felt.Felt `json:"nonces"`
DeployedContracts []struct {
Address *felt.Felt `json:"address"`
ClassHash *felt.Felt `json:"class_hash"`
} `json:"deployed_contracts"`
// v0.11.0
OldDeclaredContracts []*felt.Felt `json:"old_declared_contracts"`
DeclaredClasses []struct {
ClassHash *felt.Felt `json:"class_hash"`
CompiledClassHash *felt.Felt `json:"compiled_class_hash"`
} `json:"declared_classes"`
ReplacedClasses []struct {
Address *felt.Felt `json:"address"`
ClassHash *felt.Felt `json:"class_hash"`
} `json:"replaced_classes"`
} `json:"state_diff"`
}
StateUpdate object returned by the feeder in JSON format for "get_state_update" endpoint
type StateUpdateWithBlock ¶ added in v0.6.0
type StateUpdateWithBlock struct {
Block *Block `json:"block"`
StateUpdate *StateUpdate `json:"state_update"`
}
StateUpdateWithBlock object returned by the feeder in JSON format for "get_state_update" endpoint with includingBlock arg
type Transaction ¶
type Transaction struct {
Hash *felt.Felt `json:"transaction_hash,omitempty" copier:"must,nopanic"`
Version *felt.Felt `json:"version,omitempty"`
ContractAddress *felt.Felt `json:"contract_address,omitempty"`
ContractAddressSalt *felt.Felt `json:"contract_address_salt,omitempty"`
ClassHash *felt.Felt `json:"class_hash,omitempty"`
ConstructorCallData *[]*felt.Felt `json:"constructor_calldata,omitempty"`
Type TransactionType `json:"type,omitempty"`
SenderAddress *felt.Felt `json:"sender_address,omitempty"`
MaxFee *felt.Felt `json:"max_fee,omitempty"`
Signature *[]*felt.Felt `json:"signature,omitempty"`
CallData *[]*felt.Felt `json:"calldata,omitempty"`
EntryPointSelector *felt.Felt `json:"entry_point_selector,omitempty"`
Nonce *felt.Felt `json:"nonce,omitempty"`
CompiledClassHash *felt.Felt `json:"compiled_class_hash,omitempty"`
}
Transaction object returned by the feeder in JSON format for multiple endpoints
type TransactionReceipt ¶
type TransactionReceipt struct {
ActualFee *felt.Felt `json:"actual_fee"`
Events []*Event `json:"events"`
ExecutionStatus ExecutionStatus `json:"execution_status"`
ExecutionResources *ExecutionResources `json:"execution_resources"`
L1ToL2Message *L1ToL2Message `json:"l1_to_l2_consumed_message"`
L2ToL1Message []*L2ToL1Message `json:"l2_to_l1_messages"`
TransactionHash *felt.Felt `json:"transaction_hash"`
TransactionIndex uint64 `json:"transaction_index"`
RevertError string `json:"revert_error"`
}
type TransactionStatus ¶
type TransactionStatus struct {
Status string `json:"status"`
FinalityStatus FinalityStatus `json:"finality_status"`
ExecutionStatus ExecutionStatus `json:"execution_status"`
BlockHash *felt.Felt `json:"block_hash"`
BlockNumber uint64 `json:"block_number"`
TransactionIndex uint64 `json:"transaction_index"`
Transaction *Transaction `json:"transaction"`
RevertError string `json:"revert_error"`
}
type TransactionType ¶ added in v0.5.0
type TransactionType uint8
const ( Invalid TransactionType = iota TxnDeclare TxnDeploy TxnDeployAccount TxnInvoke TxnL1Handler )
func (TransactionType) MarshalJSON ¶ added in v0.5.0
func (t TransactionType) MarshalJSON() ([]byte, error)
func (TransactionType) String ¶ added in v0.5.0
func (t TransactionType) String() string
func (*TransactionType) UnmarshalJSON ¶ added in v0.5.0
func (t *TransactionType) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.