@@ -5,10 +5,10 @@ import { useAccount, usePublicClient } from "wagmi";
5
5
import { WalletConnect } from "@/components/WalletConnect" ;
6
6
import { AccountsDashboard } from "@/components/AccountsDashboard" ;
7
7
import { FundingGuide } from "@/components/FundingGuide" ;
8
- import { ERC20FundingGuide } from "@/components/ERC20FundingGuide" ;
9
8
import { CreateOmniAccount } from "@/components/CreateOmniAccount" ;
10
9
import { AuthorizedSigners } from "@/components/AuthorizedSigners" ;
11
10
import { AuthorizeTEEWorker } from "@/components/AuthorizeTEEWorker" ;
11
+ import { TEETokenTransfer } from "@/components/TEETokenTransfer" ;
12
12
import { ClientOnly } from "@/components/ClientOnly" ;
13
13
import { ChevronRight , Check } from "lucide-react" ;
14
14
@@ -22,20 +22,9 @@ function HomeContent() {
22
22
const [ hasContract , setHasContract ] = useState ( false ) ;
23
23
const [ authorizedSigners , setAuthorizedSigners ] = useState < string [ ] > ( [ ] ) ;
24
24
const [ isLoadingSigners , setIsLoadingSigners ] = useState ( false ) ;
25
- const [ hasERC20Tokens , setHasERC20Tokens ] = useState ( false ) ;
26
25
const [ teeWorkerAddress , setTeeWorkerAddress ] = useState < string | null > ( null ) ;
27
26
const [ isTeeWorkerAuthorized , setIsTeeWorkerAuthorized ] = useState ( false ) ;
28
27
29
- // Memoized callback for balance updates
30
- const handleBalancesUpdate = useCallback ( ( balances : any [ ] ) => {
31
- // Check if any ERC20 tokens are present
32
- const hasTokens = balances . some (
33
- ( tb ) => tb . symbol !== "ETH" && tb . balance > BigInt ( 0 )
34
- ) ;
35
- if ( hasTokens ) {
36
- setHasERC20Tokens ( true ) ;
37
- }
38
- } , [ ] ) ;
39
28
40
29
// Debug logging
41
30
useEffect ( ( ) => {
@@ -229,12 +218,10 @@ function HomeContent() {
229
218
setCurrentStep ( 3 ) ;
230
219
} else if ( ! isTeeWorkerAuthorized ) {
231
220
setCurrentStep ( 4 ) ;
232
- } else if ( ! hasERC20Tokens ) {
233
- setCurrentStep ( 5 ) ;
234
221
} else {
235
- setCurrentStep ( 6 ) ;
222
+ setCurrentStep ( 5 ) ;
236
223
}
237
- } , [ evmAddress , omniAccountAddress , isFunded , isAuthorized , authorizedSigners , isTeeWorkerAuthorized , hasERC20Tokens ] ) ;
224
+ } , [ evmAddress , omniAccountAddress , isFunded , isAuthorized , authorizedSigners , isTeeWorkerAuthorized ] ) ;
238
225
239
226
const steps = [
240
227
{
@@ -263,14 +250,8 @@ function HomeContent() {
263
250
} ,
264
251
{
265
252
id : 5 ,
266
- title : "Transfer ERC20 Tokens" ,
267
- description : "Transfer test tokens to your Omni Account" ,
268
- completed : hasERC20Tokens ,
269
- } ,
270
- {
271
- id : 6 ,
272
- title : "Ready to Swap" ,
273
- description : "Send swap requests to the worker" ,
253
+ title : "Send Token Transfer" ,
254
+ description : "Transfer tokens through the TEE worker" ,
274
255
completed : false ,
275
256
} ,
276
257
] ;
@@ -394,7 +375,6 @@ function HomeContent() {
394
375
onAddressCalculated = { setOmniAccountAddress }
395
376
onOmniAccountCalculated = { setOmniAccountHash }
396
377
ethBalance = { ethBalance }
397
- onBalancesUpdate = { handleBalancesUpdate }
398
378
isAccountCreated = { isAuthorized }
399
379
/>
400
380
</ div >
@@ -479,34 +459,20 @@ function HomeContent() {
479
459
{ currentStep >= 5 && currentStep <= 5 && (
480
460
< div >
481
461
< h2 className = "text-xl font-semibold mb-4" >
482
- Step 5: Transfer ERC20 Tokens
462
+ Step 5: Send Token Transfer
483
463
</ h2 >
484
464
< p className = "text-gray-600 mb-6" >
485
- Mint and transfer test USDC or USDT to your Omni Account for token swaps .
465
+ Transfer USDC or USDT through the TEE worker using UserOperations .
486
466
</ p >
487
- < ERC20FundingGuide
467
+ < TEETokenTransfer
488
468
omniAccountAddress = { omniAccountAddress }
489
- hasERC20Tokens = { hasERC20Tokens }
490
- onTokensAdded = { ( ) => {
491
- console . log ( "ERC20 tokens added" ) ;
492
- setHasERC20Tokens ( true ) ;
493
- } }
469
+ omniAccountHash = { omniAccountHash }
470
+ isDeployed = { hasContract }
471
+ teeWorkerAddress = { teeWorkerAddress }
494
472
/>
495
473
</ div >
496
474
) }
497
475
498
- { currentStep >= 6 && (
499
- < div >
500
- < h2 className = "text-xl font-semibold mb-4" >
501
- Step 6: Start Swapping
502
- </ h2 >
503
- < p className = "text-gray-600 mb-6" >
504
- Your Omni Account is ready! Send swap requests to the TEE
505
- worker service.
506
- </ p >
507
- { /* TODO */ }
508
- </ div >
509
- ) }
510
476
511
477
{ /* Always show completed steps in collapsed form */ }
512
478
< div className = "space-y-4" >
@@ -583,23 +549,6 @@ function HomeContent() {
583
549
</ div >
584
550
) }
585
551
586
- { hasERC20Tokens && (
587
- < div className = "bg-white rounded-lg shadow p-4" >
588
- < div className = "flex items-center justify-between" >
589
- < div className = "flex items-center space-x-3" >
590
- < div className = "w-6 h-6 bg-green-500 rounded-full flex items-center justify-center" >
591
- < Check className = "w-4 h-4 text-white" />
592
- </ div >
593
- < span className = "font-medium text-green-700" >
594
- ERC20 Tokens Added
595
- </ span >
596
- </ div >
597
- < span className = "text-sm text-gray-500" >
598
- Ready for swaps
599
- </ span >
600
- </ div >
601
- </ div >
602
- ) }
603
552
</ div >
604
553
</ div >
605
554
</ div >
0 commit comments