getBlockTransactionCount

Samples

import com.swmansion.starknet.data.selectorFromName
import com.swmansion.starknet.data.types.*
import com.swmansion.starknet.provider.exceptions.RequestFailedException
import com.swmansion.starknet.provider.exceptions.RpcRequestFailedException
import com.swmansion.starknet.provider.rpc.JsonRpcProvider
import com.swmansion.starknet.service.http.HttpResponse
import com.swmansion.starknet.service.http.HttpService
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.mockito.kotlin.*
import starknet.utils.DevnetClient
import java.nio.file.Paths
fun main() { 
   //sampleStart 
   val request = provider.getBlockTransactionCount(BlockTag.LATEST)
val response = request.send()

assertNotEquals(0, response) 
   //sampleEnd
}

open override fun getBlockTransactionCount(blockHash: Felt): HttpRequest<IntResponse>

Samples

import com.swmansion.starknet.data.selectorFromName
import com.swmansion.starknet.data.types.*
import com.swmansion.starknet.provider.exceptions.RequestFailedException
import com.swmansion.starknet.provider.exceptions.RpcRequestFailedException
import com.swmansion.starknet.provider.rpc.JsonRpcProvider
import com.swmansion.starknet.service.http.HttpResponse
import com.swmansion.starknet.service.http.HttpService
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.mockito.kotlin.*
import starknet.utils.DevnetClient
import java.nio.file.Paths
fun main() { 
   //sampleStart 
   val blockHash = provider.getBlockHashAndNumber().send().blockHash

val request = provider.getBlockTransactionCount(blockHash)
val response = request.send()

assertNotEquals(0, response) 
   //sampleEnd
}

open override fun getBlockTransactionCount(blockNumber: Int): HttpRequest<IntResponse>

Samples

import com.swmansion.starknet.data.selectorFromName
import com.swmansion.starknet.data.types.*
import com.swmansion.starknet.provider.exceptions.RequestFailedException
import com.swmansion.starknet.provider.exceptions.RpcRequestFailedException
import com.swmansion.starknet.provider.rpc.JsonRpcProvider
import com.swmansion.starknet.service.http.HttpResponse
import com.swmansion.starknet.service.http.HttpService
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.mockito.kotlin.*
import starknet.utils.DevnetClient
import java.nio.file.Paths
fun main() { 
   //sampleStart 
   val request = provider.getBlockTransactionCount(1)
val response = request.send()

assertNotEquals(0, response) 
   //sampleEnd
}