Json Rpc Provider
class JsonRpcProvider(val url: String, httpService: HttpService, ignoreUnknownJsonKeys: Boolean) : Provider
A provider for interacting with Starknet using JSON-RPC. You should reuse it in your application to share the httpService or provide it with your own httpService.
Parameters
url
url of the service providing a rpc interface
http Service
service used for making http requests
Functions
Link copied to clipboard
Batch multiple calls into a single RPC request
Link copied to clipboard
fun batchRequestsAny(vararg requests: HttpRequest<out StarknetResponse>): HttpBatchRequest<StarknetResponse>
fun batchRequestsAny(requests: List<HttpRequest<out StarknetResponse>>): HttpBatchRequest<StarknetResponse>
Batch multiple various calls into a single RPC request
Link copied to clipboard
Calls a contract deployed on Starknet.
Link copied to clipboard
Declare contract using version 2 transaction.
Declare contract using version 3 transaction.
Link copied to clipboard
open override fun deployAccount(payload: DeployAccountTransactionV1): HttpRequest<DeployAccountResponse>
Deploy an account contract using version 1 transaction.
open override fun deployAccount(payload: DeployAccountTransactionV3): HttpRequest<DeployAccountResponse>
Deploy an account contract using version 3 transaction.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getClassAt(contractAddress: Felt, blockTag: BlockTag): HttpRequest<ContractClassBase>
open override fun getClassAt(contractAddress: Felt, blockHash: Felt): HttpRequest<ContractClassBase>
open override fun getClassAt(contractAddress: Felt, blockNumber: Int): HttpRequest<ContractClassBase>
Link copied to clipboard
Get the contract class hash.
Link copied to clipboard
open override fun getEstimateFee(payload: List<ExecutableTransaction>): HttpRequest<EstimateFeeResponseList>
open override fun getEstimateFee(payload: List<ExecutableTransaction>, simulationFlags: Set<SimulationFlagForEstimateFee>): HttpRequest<EstimateFeeResponseList>
open override fun getEstimateFee(payload: List<ExecutableTransaction>, blockTag: BlockTag, simulationFlags: Set<SimulationFlagForEstimateFee>): HttpRequest<EstimateFeeResponseList>
open override fun getEstimateFee(payload: List<ExecutableTransaction>, blockTag: BlockTag): HttpRequest<EstimateFeeResponseList>
open override fun getEstimateFee(payload: List<ExecutableTransaction>, blockHash: Felt): HttpRequest<EstimateFeeResponseList>
open override fun getEstimateFee(payload: List<ExecutableTransaction>, blockNumber: Int): HttpRequest<EstimateFeeResponseList>
open override fun getEstimateFee(payload: List<ExecutableTransaction>, blockHash: Felt, simulationFlags: Set<SimulationFlagForEstimateFee>): HttpRequest<EstimateFeeResponseList>
open override fun getEstimateFee(payload: List<ExecutableTransaction>, blockNumber: Int, simulationFlags: Set<SimulationFlagForEstimateFee>): HttpRequest<EstimateFeeResponseList>
Estimate a fee.
Link copied to clipboard
open override fun getEstimateMessageFee(message: MessageL1ToL2, blockTag: BlockTag): HttpRequest<EstimateFeeResponse>
open override fun getEstimateMessageFee(message: MessageL1ToL2, blockHash: Felt): HttpRequest<EstimateFeeResponse>
open override fun getEstimateMessageFee(message: MessageL1ToL2, blockNumber: Int): HttpRequest<EstimateFeeResponse>
Estimate a message fee.
Link copied to clipboard
Link copied to clipboard
Get a nonce.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getStorageAt(contractAddress: Felt, key: Felt, blockHash: Felt): HttpRequest<Felt>
open override fun getStorageAt(contractAddress: Felt, key: Felt, blockNumber: Int): HttpRequest<Felt>
Get a value of storage var.
open override fun getStorageAt(contractAddress: Felt, key: Felt, blockTag: BlockTag): HttpRequest<Felt>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getTransactionByBlockIdAndIndex(blockTag: BlockTag, index: Int): HttpRequest<Transaction>
open override fun getTransactionByBlockIdAndIndex(blockHash: Felt, index: Int): HttpRequest<Transaction>
open override fun getTransactionByBlockIdAndIndex(blockNumber: Int, index: Int): HttpRequest<Transaction>
Link copied to clipboard
Link copied to clipboard
open override fun getTransactionStatus(transactionHash: Felt): HttpRequest<GetTransactionStatusResponse>
Link copied to clipboard
Link copied to clipboard
open override fun simulateTransactions(transactions: List<ExecutableTransaction>, blockTag: BlockTag, simulationFlags: Set<SimulationFlag>): HttpRequest<SimulatedTransactionList>
open override fun simulateTransactions(transactions: List<ExecutableTransaction>, blockHash: Felt, simulationFlags: Set<SimulationFlag>): HttpRequest<SimulatedTransactionList>
open override fun simulateTransactions(transactions: List<ExecutableTransaction>, blockNumber: Int, simulationFlags: Set<SimulationFlag>): HttpRequest<SimulatedTransactionList>
Simulate executing a list of transactions