@@ -3,7 +3,7 @@ import { FC, ReactNode } from 'react'
3
3
import { Trans , useTranslation } from 'react-i18next'
4
4
import { Link } from 'react-router-dom'
5
5
import classNames from 'classnames'
6
- import { useCKBNode } from '../../hooks/useCKBNode '
6
+ import { explorerService } from '../../services/ExplorerService '
7
7
import { matchTxHash } from '../../utils/util'
8
8
import Loading from '../AwesomeLoadings/Spinner'
9
9
import HashTag from '../HashTag'
@@ -48,9 +48,8 @@ const Field = ({
48
48
49
49
const TransactionParameters : FC < { hash : string } > = ( { hash } ) => {
50
50
const [ t ] = useTranslation ( )
51
- const { nodeService } = useCKBNode ( )
52
51
53
- const { data, isLoading } = useQuery ( [ 'tx' , hash ] , ( ) => nodeService . getTx ( hash ) )
52
+ const { data, isLoading } = useQuery ( [ 'explorer- tx' , hash ] , ( ) => explorerService . api . fetchTransactionByHash ( hash ) )
54
53
if ( isLoading ) {
55
54
return (
56
55
< div className = { styles . loading } >
@@ -59,9 +58,9 @@ const TransactionParameters: FC<{ hash: string }> = ({ hash }) => {
59
58
)
60
59
}
61
60
62
- if ( ! data ?. result ?. transaction ) return < div > { `Transaction ${ hash } not loaded` } </ div >
61
+ if ( ! data ) return < div > { `Transaction ${ hash } not loaded` } </ div >
63
62
64
- const { header_deps : headerDeps , cell_deps : cellDeps , witnesses } = data . result . transaction
63
+ const { headerDeps, cellDeps, witnesses } = data
65
64
66
65
const parameters = [
67
66
{
@@ -84,8 +83,8 @@ const TransactionParameters: FC<{ hash: string }> = ({ hash }) => {
84
83
content : cellDeps . length ? (
85
84
cellDeps . map ( cellDep => {
86
85
const {
87
- out_point : { tx_hash : txHash , index } ,
88
- dep_type : depType ,
86
+ outPoint : { txHash, index } ,
87
+ depType,
89
88
} = cellDep
90
89
const hashTag = matchTxHash ( txHash , Number ( index ) )
91
90
return (
0 commit comments