Skip to content

Commit 2c628d5

Browse files
committed
fix linter errors
1 parent 3b1bd34 commit 2c628d5

File tree

2 files changed

+6
-35
lines changed

2 files changed

+6
-35
lines changed

packages/checkout/src/hooks/useCheckoutUI/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export const useCheckoutUI = ({
103103
recipientAddress,
104104
targetContractAddress,
105105
txData,
106-
transactionConfirmations,
107106
creditCardProvider,
108107
transakConfig,
109108
onSuccess,

packages/checkout/src/hooks/useCheckoutUI/useCreditCardPayment.tsx

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { 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'
54
import { ContractInfo, TokenMetadata } from '@0xsequence/metadata'
65
import { findSupportedNetwork } from '@0xsequence/network'
76
import pako from 'pako'
87
import React, { useEffect, useRef } from 'react'
98
import { Hex, formatUnits, zeroAddress } from 'viem'
10-
import { usePublicClient } from 'wagmi'
119

1210
import { fetchSardineOrderStatus } from '../../api'
1311
import { 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 = ({
272255
interface 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 = ({
320294
interface 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

Comments
 (0)