File tree Expand file tree Collapse file tree
packages/portal-client/src/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { useCallback , useState } from 'react'
21import { usePortalNetwork } from '@/contexts/PortalNetworkContext'
2+ import type { RPCResponse } from '@/utils/types'
33import { decodeExtensionPayloadToJson , formatBlockResponse } from 'portalnetwork'
4- import { RPCResponse } from '@/utils/types '
4+ import { useCallback , useState } from 'react '
55
66export const useJsonRpc = ( ) => {
77 const { client, historyNetwork, setIsLoading } = usePortalNetwork ( )
@@ -49,7 +49,7 @@ export const useJsonRpc = () => {
4949 result = await client . ETH . getBalance ( params [ 0 ] , params [ 1 ] )
5050 responseType = 'ether'
5151 break
52- case 'portal_historyPing' :
52+ case 'portal_historyPing' : {
5353 const res = await historyNetwork ?. sendPing ( params [ 0 ] )
5454 if ( ! res ) {
5555 throw new Error ( 'Pong not received' )
@@ -62,6 +62,7 @@ export const useJsonRpc = () => {
6262
6363 responseType = 'generic'
6464 break
65+ }
6566 case 'portal_historyFindContent' :
6667 result = await historyNetwork ?. sendFindNodes ( params [ 0 ] , params [ 1 ] )
6768 responseType = 'generic'
You can’t perform that action at this time.
0 commit comments