Provider

interface Provider

Provider for interacting with Starknet.

Implementers of this interface provide methods for interacting with Starknet, for example through Starknet JSON-RPC.

Inheritors

Functions

Link copied to clipboard
abstract fun callContract(call: Call): Request<List<Felt>>
abstract fun callContract(call: Call, blockTag: BlockTag): Request<List<Felt>>
abstract fun callContract(call: Call, blockHash: Felt): Request<List<Felt>>
abstract fun callContract(call: Call, blockNumber: Int): Request<List<Felt>>

Calls a contract deployed on Starknet.

Link copied to clipboard

Declare contract using version 1 transaction.

Declare contract using version 2 transaction.

Declare contract using version 3 transaction.

Link copied to clipboard

Deploy an account contract using version 1 transaction.

Deploy an account contract using version 3 transaction.

Link copied to clipboard

Get the hash and number of the block.

Link copied to clipboard
abstract fun getBlockNumber(): Request<Int>

Get the block number.

Link copied to clipboard
abstract fun getBlockTransactionCount(blockTag: BlockTag): Request<Int>
abstract fun getBlockTransactionCount(blockHash: Felt): Request<Int>
abstract fun getBlockTransactionCount(blockNumber: Int): Request<Int>

Get the block transaction count.

Link copied to clipboard
abstract fun getBlockWithReceipts(blockNumber: Int): Request<BlockWithReceipts>

Get a block with transaction receipts.

Link copied to clipboard

Get a block with transaction hashes.

Link copied to clipboard
abstract fun getBlockWithTxs(blockNumber: Int): Request<BlockWithTransactions>

Get a block with transactions.

Link copied to clipboard

Get the chain id.

Link copied to clipboard
abstract fun getClass(classHash: Felt): Request<ContractClassBase>
abstract fun getClass(classHash: Felt, blockTag: BlockTag): Request<ContractClassBase>
abstract fun getClass(classHash: Felt, blockHash: Felt): Request<ContractClassBase>
abstract fun getClass(classHash: Felt, blockNumber: Int): Request<ContractClassBase>

Get the contract class definition.

Link copied to clipboard
abstract fun getClassAt(contractAddress: Felt): Request<ContractClassBase>
abstract fun getClassAt(contractAddress: Felt, blockTag: BlockTag): Request<ContractClassBase>
abstract fun getClassAt(contractAddress: Felt, blockHash: Felt): Request<ContractClassBase>
abstract fun getClassAt(contractAddress: Felt, blockNumber: Int): Request<ContractClassBase>

Get the contract class definition.

Link copied to clipboard
abstract fun getClassHashAt(contractAddress: Felt): Request<Felt>
abstract fun getClassHashAt(contractAddress: Felt, blockTag: BlockTag): Request<Felt>
abstract fun getClassHashAt(contractAddress: Felt, blockHash: Felt): Request<Felt>
abstract fun getClassHashAt(contractAddress: Felt, blockNumber: Int): Request<Felt>

Get the contract class hash.

Link copied to clipboard
abstract fun getEstimateMessageFee(message: MessageL1ToL2, blockNumber: Int): Request<EstimateFeeResponse>

Estimate a message fee.

Link copied to clipboard

Get events

Link copied to clipboard
abstract fun getNonce(contractAddress: Felt): Request<Felt>
abstract fun getNonce(contractAddress: Felt, blockTag: BlockTag): Request<Felt>
abstract fun getNonce(contractAddress: Felt, blockHash: Felt): Request<Felt>
abstract fun getNonce(contractAddress: Felt, blockNumber: Int): Request<Felt>

Get a nonce.

Link copied to clipboard
abstract fun getSpecVersion(): Request<String>

Get the version of the spec.

Link copied to clipboard
abstract fun getStateUpdate(blockTag: BlockTag): Request<StateUpdate>
abstract fun getStateUpdate(blockHash: Felt): Request<StateUpdate>
abstract fun getStateUpdate(blockNumber: Int): Request<StateUpdate>

Get block state information.

Link copied to clipboard
abstract fun getStorageAt(contractAddress: Felt, key: Felt): Request<Felt>
abstract fun getStorageAt(contractAddress: Felt, key: Felt, blockTag: BlockTag): Request<Felt>
abstract fun getStorageAt(contractAddress: Felt, key: Felt, blockHash: Felt): Request<Felt>
abstract fun getStorageAt(contractAddress: Felt, key: Felt, blockNumber: Int): Request<Felt>

Get a value of storage var.

Link copied to clipboard
abstract fun getSyncing(): Request<Syncing>

Get the block synchronization status.

Link copied to clipboard
abstract fun getTransaction(transactionHash: Felt): Request<Transaction>

Get a transaction.

Link copied to clipboard
abstract fun getTransactionByBlockIdAndIndex(blockHash: Felt, index: Int): Request<Transaction>
abstract fun getTransactionByBlockIdAndIndex(blockNumber: Int, index: Int): Request<Transaction>

Get transaction by block id and index.

Link copied to clipboard
abstract fun getTransactionReceipt(transactionHash: Felt): Request<out TransactionReceipt>

Get transaction receipt

Link copied to clipboard

Get transaction status

Link copied to clipboard

Invoke a function using version 1 transaction.

Invoke a function using version 3 transaction.

Link copied to clipboard
abstract fun simulateTransactions(transactions: List<TransactionPayload>, blockTag: BlockTag, simulationFlags: Set<SimulationFlag>): Request<List<SimulatedTransaction>>
abstract fun simulateTransactions(transactions: List<TransactionPayload>, blockHash: Felt, simulationFlags: Set<SimulationFlag>): Request<List<SimulatedTransaction>>
abstract fun simulateTransactions(transactions: List<TransactionPayload>, blockNumber: Int, simulationFlags: Set<SimulationFlag>): Request<List<SimulatedTransaction>>

Simulate executing a list of transactions