File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed
Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change 1- import { CharacterOperatorPermission } from "crossbell"
1+ import { CharacterOperatorPermission , createContract } from "crossbell"
22import type { Address } from "viem"
33
44import type { useContract } from "@crossbell/contract"
@@ -502,20 +502,9 @@ export async function checkDomain(domain: string, handle: string) {
502502 return check . data
503503}
504504
505+ const contract = createContract ( )
506+
505507export async function getBlockNumber ( ) {
506- const result = await (
507- await fetch ( "https://scan.crossbell.io/api/eth-rpc" , {
508- method : "POST" ,
509- headers : {
510- "Content-Type" : "application/json" ,
511- } ,
512- body : JSON . stringify ( {
513- jsonrpc : "2.0" ,
514- method : "eth_blockNumber" ,
515- params : [ ] ,
516- id : 0 ,
517- } ) ,
518- } )
519- ) . json ( )
520- return Number ( BigInt ( result . result ) )
508+ const result = await contract . publicClient . getBlockNumber ( )
509+ return Number ( result )
521510}
You can’t perform that action at this time.
0 commit comments