File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
app/src/main/kotlin/io/github/hosseinkarami_dev/near/rpc/client_app Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import io.github.hosseinkarami_dev.near.rpc.client.Utils.getResultOrNull
99import io.github.hosseinkarami_dev.near.rpc.models.BlockId
1010import io.github.hosseinkarami_dev.near.rpc.models.RpcBlockRequest
1111import io.github.hosseinkarami_dev.near.rpc.models.RpcBlockResponse
12- import io.github.hosseinkarami_dev.near.rpc.models.RpcStatusResponse
1312import io.github.hosseinkarami_dev.near.rpc.models.RpcTransactionStatusRequest
1413import io.github.hosseinkarami_dev.near.rpc.models.SignedTransaction
1514import io.github.hosseinkarami_dev.near.rpc.models.TxExecutionStatus
@@ -34,20 +33,24 @@ class MainActivity : ComponentActivity() {
3433 baseUrl = " https://rpc.mainnet.near.org" // or testnet: https://rpc.testnet.near.org
3534 )
3635
36+ lifecycleScope.launch {
3737 lifecycleScope.launch {
38- val response = nearClient.status()
38+ val response = nearClient.block(
39+ RpcBlockRequest .BlockId (BlockId .BlockHeight (167440515 .toULong()))
40+ )
3941
4042 when (response) {
4143 is RpcResponse .Failure -> {
4244 println (" Error: ${response.error} " )
4345 }
4446
4547 is RpcResponse .Success -> {
46- val result = response.getResultOrNull<RpcStatusResponse >()
48+ val result = response.getResultOrNull<RpcBlockResponse >()
4749 println (" Result: $result " )
4850
4951 }
5052 }
53+ }
5154
5255//
5356// lifecycleScope.launch {
You can’t perform that action at this time.
0 commit comments