Interface Provider

  • All Implemented Interfaces:

    
    public interface Provider
    
                        

    Provider for interacting with Starknet.

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

    • Constructor Detail

    • Method Detail

      • getTransaction

         abstract Request<Transaction> getTransaction(Felt transactionHash)

        Get a transaction.

        Get the details of a submitted transaction.

        Parameters:
        transactionHash - a hash of sent transaction
      • getClass

         abstract Request<ContractClassBase> getClass(Felt classHash)

        Get the contract class definition.

        Get the contract class definition associated with the given hash.

        Parameters:
        classHash - The hash of the requested contract class.
      • getClass

         abstract Request<ContractClassBase> getClass(Felt classHash, Felt blockHash)

        Get the contract class definition.

        Get the contract class definition associated with the given hash.

        Parameters:
        classHash - The hash of the requested contract class.
        blockHash - The hash of requested block.
      • getClass

         abstract Request<ContractClassBase> getClass(Felt classHash, Integer blockNumber)

        Get the contract class definition.

        Get the contract class definition associated with the given block number.

        Parameters:
        classHash - The hash of the requested contract class.
        blockNumber - The number of requested block.
      • getClass

         abstract Request<ContractClassBase> getClass(Felt classHash, BlockTag blockTag)

        Get the contract class definition.

        Get the contract class definition associated with the given block tag.

        Parameters:
        classHash - The hash of the requested contract class.
        blockTag - The tag of requested block.
      • callContract

         abstract Request<FeltArray> callContract(Call call, Felt blockHash)

        Calls a contract deployed on Starknet.

        Parameters:
        call - a call to be made
        blockHash - a hash of the block in respect to what the call will be made
      • callContract

         abstract Request<FeltArray> callContract(Call call, Integer blockNumber)

        Calls a contract deployed on Starknet.

        Parameters:
        call - a call to be made
        blockNumber - a number of the block in respect to what the call will be made
      • callContract

         abstract Request<FeltArray> callContract(Call call)

        Calls a contract deployed on Starknet.

        Calls a contract deployed on Starknet in the latest block.

        Parameters:
        call - a call to be made
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, Felt key, BlockTag blockTag)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
        blockTag - The tag of the requested block.
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, Felt key, Felt blockHash)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
        blockHash - a hash of the block in respect to what the query will be made
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, Felt key, Integer blockNumber)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
        blockNumber - a number of the block in respect to what the query will be made
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, Felt key)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address and in the latest block.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, String key, BlockTag blockTag)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
        blockTag - The tag of the requested block.
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, String key, Felt blockHash)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
        blockHash - a hash of the block in respect to what the query will be made
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, String key, Integer blockNumber)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
        blockNumber - a number of the block in respect to what the query will be made
      • getStorageAt

         abstract Request<Felt> getStorageAt(Felt contractAddress, String key)

        Get a value of storage var.

        Get a value of a storage variable of contract at the provided address and in the latest block.

        Parameters:
        contractAddress - an address of the contract
        key - an address of the storage variable inside contract
      • getClassAt

         abstract Request<ContractClassBase> getClassAt(Felt contractAddress, Felt blockHash)

        Get the contract class definition.

        Get the contract class definition at the given address in the given block.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
        blockHash - The hash of the requested block.
      • getClassAt

         abstract Request<ContractClassBase> getClassAt(Felt contractAddress, Integer blockNumber)

        Get the contract class definition.

        Get the contract class definition at the given address in the given block.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
        blockNumber - The number of the requested block.
      • getClassAt

         abstract Request<ContractClassBase> getClassAt(Felt contractAddress, BlockTag blockTag)

        Get the contract class definition.

        Get the contract class definition at the given address in the given block.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
        blockTag - The tag of the requested block.
      • getClassAt

         abstract Request<ContractClassBase> getClassAt(Felt contractAddress)

        Get the contract class definition.

        Get the contract class definition in the at the given address in the latest block.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
      • getClassHashAt

         abstract Request<Felt> getClassHashAt(Felt contractAddress, Felt blockHash)

        Get the contract class hash.

        Get the contract class hash in the given block for the contract deployed at the given address.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
        blockHash - The hash of the requested block.
      • getClassHashAt

         abstract Request<Felt> getClassHashAt(Felt contractAddress, Integer blockNumber)

        Get the contract class hash.

        Get the contract class hash in the given block for the contract deployed at the given address.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
        blockNumber - The number of the requested block.
      • getClassHashAt

         abstract Request<Felt> getClassHashAt(Felt contractAddress, BlockTag blockTag)

        Get the contract class hash.

        Get the contract class hash in the given block for the contract deployed at the given address.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
        blockTag - The tag of the requested block.
      • getClassHashAt

         abstract Request<Felt> getClassHashAt(Felt contractAddress)

        Get the contract class hash.

        Get the contract class hash in the given block for the contract deployed at the given address and in the latest block.

        Parameters:
        contractAddress - The address of the contract whose class definition will be returned.
      • getEstimateMessageFee

         abstract Request<EstimateFeeResponse> getEstimateMessageFee(MessageL1ToL2 message, Felt blockHash)

        Estimate a message fee.

        Estimate the L2 fee of a provided message sent on L1.

        Parameters:
        message - message, for which the fee is to be estimated.
        blockHash - a hash of the block in respect to what the query will be made
      • getEstimateMessageFee

         abstract Request<EstimateFeeResponse> getEstimateMessageFee(MessageL1ToL2 message, Integer blockNumber)

        Estimate a message fee.

        Estimate the L2 fee of a provided message sent on L1.

        Parameters:
        message - message, for which the fee is to be estimated.
        blockNumber - a number of the block in respect to what the query will be made
      • getEstimateMessageFee

         abstract Request<EstimateFeeResponse> getEstimateMessageFee(MessageL1ToL2 message, BlockTag blockTag)

        Estimate a message fee.

        Estimate the L2 fee of a provided message sent on L1.

        Parameters:
        message - message, for which the fee is to be estimated.
        blockTag - a tag of the block in respect to what the query will be made
      • getNonce

         abstract Request<Felt> getNonce(Felt contractAddress)

        Get a nonce.

        Get a nonce of an account contract of a given address for pending block.

        Parameters:
        contractAddress - address of account contract
      • getNonce

         abstract Request<Felt> getNonce(Felt contractAddress, BlockTag blockTag)

        Get a nonce.

        Get a nonce of an account contract of a given address for specified block tag.

        Parameters:
        contractAddress - address of account contract
        blockTag - block tag used for returning this value
      • getNonce

         abstract Request<Felt> getNonce(Felt contractAddress, Integer blockNumber)

        Get a nonce.

        Get a nonce of an account contract of a given address for specified block number.

        Parameters:
        contractAddress - address of account contract
        blockNumber - block number used for returning this value
      • getNonce

         abstract Request<Felt> getNonce(Felt contractAddress, Felt blockHash)

        Get a nonce.

        Get a nonce of an account contract of a given address for specified block hash.

        Parameters:
        contractAddress - address of account contract
        blockHash - block hash used for returning this value
      • getSyncing

         abstract Request<Syncing> getSyncing()

        Get the block synchronization status.

        Get the starting, current and highest block info or boolean indicating syncing is not in progress.

      • getBlockWithTxs

         abstract Request<BlockWithTransactions> getBlockWithTxs(Felt blockHash)

        Get a block with transactions.

        Get block information with full transactions given the block id.

        Parameters:
        blockHash - a hash of the requested block
      • getBlockWithReceipts

         abstract Request<BlockWithReceipts> getBlockWithReceipts(Felt blockHash)

        Get a block with transaction receipts.

        Get block information with transaction receipts given the block id.

        Parameters:
        blockHash - a hash of the requested block
      • getBlockWithReceipts

         abstract Request<BlockWithReceipts> getBlockWithReceipts(Integer blockNumber)

        Get a block with transaction receipts.

        Get block information with transaction receipts given the block id.

        Parameters:
        blockNumber - a number of the requested block
      • getStateUpdate

         abstract Request<StateUpdate> getStateUpdate(BlockTag blockTag)

        Get block state information.

        Get the information about the result of executing the requested block.

        Parameters:
        blockTag - a tag of the requested block
      • getStateUpdate

         abstract Request<StateUpdate> getStateUpdate(Felt blockHash)

        Get block state information.

        Get the information about the result of executing the requested block.

        Parameters:
        blockHash - a hash of the requested block
      • getStateUpdate

         abstract Request<StateUpdate> getStateUpdate(Integer blockNumber)

        Get block state information.

        Get the information about the result of executing the requested block.

        Parameters:
        blockNumber - a number of the requested block