JsonRpcProvider

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

httpService

service used for making http requests

Constructors

Link copied to clipboard
constructor(url: String, ignoreUnknownJsonKeys: Boolean)
constructor(url: String, httpService: HttpService)
constructor(url: String)
constructor(url: String, httpService: HttpService, ignoreUnknownJsonKeys: Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val url: String

Functions

Link copied to clipboard

Batch multiple calls into a single RPC request

Link copied to clipboard

Batch multiple various calls into a single RPC request

Link copied to clipboard
open override fun callContract(call: Call): HttpRequest<FeltArray>

Calls a contract deployed on Starknet.

open override fun callContract(call: Call, blockTag: BlockTag): HttpRequest<FeltArray>
open override fun callContract(call: Call, blockHash: Felt): HttpRequest<FeltArray>
open override fun callContract(call: Call, blockNumber: Int): HttpRequest<FeltArray>
Link copied to clipboard

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
open override fun getBlockNumber(): HttpRequest<IntResponse>
Link copied to clipboard
open override fun getBlockTransactionCount(blockHash: Felt): HttpRequest<IntResponse>
open override fun getBlockTransactionCount(blockNumber: Int): HttpRequest<IntResponse>
Link copied to clipboard
open override fun getBlockWithReceipts(blockHash: Felt): HttpRequest<BlockWithReceipts>
open override fun getBlockWithReceipts(blockNumber: Int): HttpRequest<BlockWithReceipts>
Link copied to clipboard
open override fun getBlockWithTxs(blockHash: Felt): HttpRequest<BlockWithTransactions>
open override fun getBlockWithTxs(blockNumber: Int): HttpRequest<BlockWithTransactions>
Link copied to clipboard
open override fun getChainId(): HttpRequest<StarknetChainId>
Link copied to clipboard
open override fun getClass(classHash: Felt): HttpRequest<ContractClassBase>
open override fun getClass(classHash: Felt, blockTag: BlockTag): HttpRequest<ContractClassBase>
open override fun getClass(classHash: Felt, blockHash: Felt): HttpRequest<ContractClassBase>
open override fun getClass(classHash: Felt, blockNumber: Int): HttpRequest<ContractClassBase>
Link copied to clipboard
open override fun getClassAt(contractAddress: Felt): HttpRequest<ContractClassBase>
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
open override fun getClassHashAt(contractAddress: Felt): HttpRequest<Felt>
open override fun getClassHashAt(contractAddress: Felt, blockTag: BlockTag): HttpRequest<Felt>

open override fun getClassHashAt(contractAddress: Felt, blockHash: Felt): HttpRequest<Felt>
open override fun getClassHashAt(contractAddress: Felt, blockNumber: Int): HttpRequest<Felt>

Get the contract class hash.

Link copied to clipboard

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
open override fun getNonce(contractAddress: Felt): HttpRequest<Felt>

Get a nonce.

open override fun getNonce(contractAddress: Felt, blockTag: BlockTag): HttpRequest<Felt>
open override fun getNonce(contractAddress: Felt, blockHash: Felt): HttpRequest<Felt>
open override fun getNonce(contractAddress: Felt, blockNumber: Int): HttpRequest<Felt>
Link copied to clipboard
Link copied to clipboard
open override fun getStateUpdate(blockTag: BlockTag): HttpRequest<StateUpdate>
open override fun getStateUpdate(blockHash: Felt): HttpRequest<StateUpdate>
open override fun getStateUpdate(blockNumber: Int): HttpRequest<StateUpdate>
Link copied to clipboard
open override fun getStorageAt(contractAddress: Felt, key: Felt): HttpRequest<Felt>
open override fun getStorageAt(contractAddress: Felt, key: String): Request<Felt>
open override fun getStorageAt(contractAddress: Felt, key: Felt, blockHash: Felt): HttpRequest<Felt>
open override fun getStorageAt(contractAddress: Felt, key: Felt, blockNumber: Int): HttpRequest<Felt>
open override fun getStorageAt(contractAddress: Felt, key: String, blockHash: Felt): Request<Felt>
open override fun getStorageAt(contractAddress: Felt, key: String, blockNumber: Int): Request<Felt>

Get a value of storage var.

open override fun getStorageAt(contractAddress: Felt, key: Felt, blockTag: BlockTag): HttpRequest<Felt>
open override fun getStorageAt(contractAddress: Felt, key: String, blockTag: BlockTag): Request<Felt>
Link copied to clipboard
open override fun getSyncing(): HttpRequest<Syncing>
Link copied to clipboard
open override fun getTransaction(transactionHash: Felt): HttpRequest<Transaction>
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
open override fun getTransactionReceipt(transactionHash: Felt): HttpRequest<out TransactionReceipt>
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