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<FeltArray>
abstract fun callContract(call: Call, blockTag: BlockTag): Request<FeltArray>
abstract fun callContract(call: Call, blockHash: Felt): Request<FeltArray>
abstract fun callContract(call: Call, blockNumber: Int): Request<FeltArray>

Calls a contract deployed on Starknet.

Link copied to clipboard

Declare contract using version 3 transaction.

Link copied to clipboard

Deploy an account contract using version 3 transaction.

Link copied to clipboard

Get the hash and number of the block.

Link copied to clipboard

Get the block number.

Link copied to clipboard
abstract fun getBlockTransactionCount(blockNumber: Int): Request<IntResponse>

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 getMessagesStatus(l1TransactionHash: NumAsHex): Request<MessageStatusList>

Get L1 handler transaction data.

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

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: String): 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>
abstract fun getStorageAt(contractAddress: Felt, key: String, blockTag: BlockTag): Request<Felt>
abstract fun getStorageAt(contractAddress: Felt, key: String, blockHash: Felt): Request<Felt>
abstract fun getStorageAt(contractAddress: Felt, key: String, blockNumber: Int): Request<Felt>

Get a value of storage var.

Link copied to clipboard
abstract fun getStorageProof(blockId: BlockId, classHashes: List<Felt>? = null, contractAddresses: List<Felt>? = null, contractsStorageKeys: List<ContractsStorageKeys>? = null): Request<StorageProof>

Get merkle paths in one of the state tries.

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 3 transaction.

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

Simulate executing a list of transactions