View Source StarkNet.Provider (StarkNet v0.2.0)

The provider is used to build requests to the StarkNet gateways.

Link to this section Summary

Types

Represents a block identifier, either the block number, the block hash, :latest, or :pending.

Provider call options.

Functions

Returns a request to get the latest block.

Returns a request to fetch a specific block.

Returns a request to perform a call operation on the given contract.

Returns a request to fetch the code for the contract at contract_address.

Returns a request to get the smart contracts addresses on the settlement layer.

Returns a request to fetch the contracts' storage at the given key location.

Returns a request to get the given transaction.

Returns a request to get the given transaction receipt.

Returns a request to get the given transaction status.

Link to this section Types

Specs

block_id() :: pos_integer() | String.t() | :latest | :pending

Represents a block identifier, either the block number, the block hash, :latest, or :pending.

Specs

options() :: {:block, block_id()}

Provider call options.

Link to this section Functions

Specs

block() :: StarkNet.Request.t()

Returns a request to get the latest block.

Specs

Returns a request to fetch a specific block.

Link to this function

call(contract_address, entrypoint, calldata, opts \\ [])

View Source

Specs

Returns a request to perform a call operation on the given contract.

Link to this function

code(contract_address, opts \\ [])

View Source

Specs

code(String.t(), [options()]) :: StarkNet.Request.t()

Returns a request to fetch the code for the contract at contract_address.

Specs

contract_address() :: StarkNet.Request.t()

Returns a request to get the smart contracts addresses on the settlement layer.

Link to this function

storage_at(contract_address, key, opts \\ [])

View Source

Specs

storage_at(String.t(), String.t(), [options()]) :: StarkNet.Request.t()

Returns a request to fetch the contracts' storage at the given key location.

Specs

transaction(String.t()) :: StarkNet.Request.t()

Returns a request to get the given transaction.

Link to this function

transaction_receipt(hash)

View Source

Specs

transaction_receipt(String.t()) :: StarkNet.Request.t()

Returns a request to get the given transaction receipt.

Link to this function

transaction_status(hash)

View Source

Specs

transaction_status(String.t()) :: StarkNet.Request.t()

Returns a request to get the given transaction status.