11import { useProjectAccessKey } from '@0xsequence/connect'
2- import { compareAddress , waitForTransactionReceipt , TRANSACTION_CONFIRMATIONS_DEFAULT } from '@0xsequence/connect'
3- import { useIndexerClient , useConfig } from '@0xsequence/hooks'
4- import { TransactionStatus } from '@0xsequence/indexer'
2+ import { compareAddress } from '@0xsequence/connect'
3+ import { useConfig } from '@0xsequence/hooks'
54import { ContractInfo , TokenMetadata } from '@0xsequence/metadata'
65import { findSupportedNetwork } from '@0xsequence/network'
76import pako from 'pako'
87import React , { useEffect , useRef } from 'react'
98import { Hex , formatUnits , zeroAddress } from 'viem'
10- import { usePublicClient } from 'wagmi'
119
1210import { fetchSardineOrderStatus } from '../../api'
1311import { useEnvironmentContext } from '../../contexts'
@@ -212,14 +210,7 @@ export const useCreditCardPayment = ({
212210 </ div >
213211 ) ,
214212 EventListener : ( ) => (
215- < TransakEventListener
216- transactionConfirmations = { transactionConfirmations }
217- chainId = { network ?. chainId || 137 }
218- onSuccess = { onSuccess }
219- onError = { onError }
220- isLoading = { isLoading }
221- iframeRef = { iframeRef }
222- />
213+ < TransakEventListener onSuccess = { onSuccess } onError = { onError } isLoading = { isLoading } iframeRef = { iframeRef } />
223214 )
224215 } ,
225216 isLoading : false
@@ -251,15 +242,7 @@ export const useCreditCardPayment = ({
251242 />
252243 </ div >
253244 ) ,
254- EventListener : ( ) => (
255- < SardineEventListener
256- transactionConfirmations = { transactionConfirmations }
257- chainId = { network ?. chainId || 137 }
258- onSuccess = { onSuccess }
259- onError = { onError }
260- orderId = { dataClientToken ?. orderId || '' }
261- />
262- )
245+ EventListener : ( ) => < SardineEventListener onSuccess = { onSuccess } onError = { onError } orderId = { dataClientToken ?. orderId || '' } />
263246 }
264247
265248 return {
@@ -272,20 +255,11 @@ export const useCreditCardPayment = ({
272255interface TransakEventListenerProps {
273256 onSuccess ?: ( txHash : string ) => void
274257 onError ?: ( error : Error ) => void
275- chainId : number
276- transactionConfirmations ?: number
277258 isLoading : boolean
278259 iframeRef : React . RefObject < HTMLIFrameElement | null >
279260}
280261
281- const TransakEventListener = ( {
282- onSuccess,
283- onError,
284- chainId,
285- transactionConfirmations = TRANSACTION_CONFIRMATIONS_DEFAULT ,
286- isLoading,
287- iframeRef
288- } : TransakEventListenerProps ) => {
262+ const TransakEventListener = ( { onSuccess, onError, isLoading, iframeRef } : TransakEventListenerProps ) => {
289263 useEffect ( ( ) => {
290264 const transakIframe = iframeRef . current ?. contentWindow
291265 if ( ! transakIframe ) {
@@ -320,12 +294,10 @@ const TransakEventListener = ({
320294interface SardineEventListenerProps {
321295 onSuccess ?: ( txHash : string ) => void
322296 onError ?: ( error : Error ) => void
323- chainId : number
324- transactionConfirmations ?: number
325297 orderId : string
326298}
327299
328- const SardineEventListener = ( { onSuccess, onError, chainId , orderId, transactionConfirmations } : SardineEventListenerProps ) => {
300+ const SardineEventListener = ( { onSuccess, onError, orderId } : SardineEventListenerProps ) => {
329301 const { env } = useConfig ( )
330302 const projectAccessKey = useProjectAccessKey ( )
331303
0 commit comments