11import { useQueries } from "@tanstack/react-query" ;
2- import type { ThirdwebClient } from "../../../client/client.js" ;
32import { COINBASE } from "../../../wallets/constants.js" ;
43import { isEcosystemWallet } from "../../../wallets/ecosystem/is-ecosystem-wallet.js" ;
54import type { Wallet } from "../../../wallets/interfaces/wallet.js" ;
65import type { CreateWalletArgs } from "../../../wallets/wallet-types.js" ;
7- import type { EcosystemWalletId } from "../../../wallets/wallet-types.js" ;
86
9- export function usePreloadWalletProviders ( {
10- client,
11- wallets,
12- } : { client : ThirdwebClient ; wallets : Wallet [ ] } ) {
7+ export function usePreloadWalletProviders ( { wallets } : { wallets : Wallet [ ] } ) {
138 useQueries ( {
149 queries : wallets
1510 . filter (
@@ -29,49 +24,6 @@ export function usePreloadWalletProviders({
2924 // return _something_
3025 return true ;
3126 }
32- case "inApp" === w . id : {
33- const [
34- { InAppWebConnector } ,
35- { getOrCreateInAppWalletConnector } ,
36- ] = await Promise . all ( [
37- import ( "../../../wallets/in-app/web/lib/web-connector.js" ) ,
38- import ( "../../../wallets/in-app/core/wallet/in-app-core.js" ) ,
39- ] ) ;
40- await getOrCreateInAppWalletConnector ( client , async ( client ) => {
41- return new InAppWebConnector ( {
42- client,
43- } ) ;
44- } ) ;
45- // return _something_
46- return true ;
47- }
48- case isEcosystemWallet ( w . id ) : {
49- const [
50- { InAppWebConnector } ,
51- { getOrCreateInAppWalletConnector } ,
52- ] = await Promise . all ( [
53- import ( "../../../wallets/in-app/web/lib/web-connector.js" ) ,
54- import ( "../../../wallets/in-app/core/wallet/in-app-core.js" ) ,
55- ] ) ;
56- const ecosystemWallet = w as Wallet < EcosystemWalletId > ; // we know this is an ecosystem wallet
57- await getOrCreateInAppWalletConnector (
58- client ,
59- async ( client ) => {
60- return new InAppWebConnector ( {
61- client,
62- ecosystem : {
63- id : ecosystemWallet . id ,
64- partnerId : ecosystemWallet . getConfig ( ) ?. partnerId ,
65- } ,
66- } ) ;
67- } ,
68- {
69- id : ecosystemWallet . id ,
70- partnerId : ecosystemWallet . getConfig ( ) ?. partnerId ,
71- } ,
72- ) ;
73- return true ;
74- }
7527 // potentially add more wallets here
7628 default : {
7729 return false ;
0 commit comments