diff --git a/.changeset/famous-items-shop.md b/.changeset/famous-items-shop.md new file mode 100644 index 00000000..2fc7aa7f --- /dev/null +++ b/.changeset/famous-items-shop.md @@ -0,0 +1,5 @@ +--- +"@fuels/connectors": patch +--- + +Accept `ethWagmiConfig` for eth wallet wagmi configs diff --git a/.changeset/hungry-students-cheer.md b/.changeset/hungry-students-cheer.md new file mode 100644 index 00000000..3793e3ac --- /dev/null +++ b/.changeset/hungry-students-cheer.md @@ -0,0 +1,5 @@ +--- +"@fuel-connectors/solana-connector": patch +--- + +Include more solana wallets diff --git a/examples/react-app/src/main.tsx b/examples/react-app/src/main.tsx index b09c3a78..3f6aaf9c 100644 --- a/examples/react-app/src/main.tsx +++ b/examples/react-app/src/main.tsx @@ -8,15 +8,7 @@ import { coinbaseWallet, walletConnect } from '@wagmi/connectors'; import { http, createConfig, injected } from '@wagmi/core'; import { mainnet, sepolia } from '@wagmi/core/chains'; -import { - BakoSafeConnector, - BurnerWalletConnector, - FuelWalletConnector, - FuelWalletDevelopmentConnector, - FueletWalletConnector, - SolanaConnector, - WalletConnectConnector, -} from '@fuels/connectors'; +import { defaultConnectors } from '@fuels/connectors'; import { FuelProvider } from '@fuels/react'; import * as Toast from '@radix-ui/react-toast'; @@ -66,20 +58,11 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( diff --git a/packages/connectors/src/defaultConnectors.ts b/packages/connectors/src/defaultConnectors.ts index 69951fde..2596c01d 100644 --- a/packages/connectors/src/defaultConnectors.ts +++ b/packages/connectors/src/defaultConnectors.ts @@ -3,7 +3,9 @@ import { BurnerWalletConnector } from '@fuel-connectors/burner-wallet-connector' import { FuelWalletDevelopmentConnector } from '@fuel-connectors/fuel-development-wallet'; import { FuelWalletConnector } from '@fuel-connectors/fuel-wallet'; import { FueletWalletConnector } from '@fuel-connectors/fuelet-wallet'; +import { SolanaConnector } from '@fuel-connectors/solana-connector'; import { WalletConnectConnector } from '@fuel-connectors/walletconnect-connector'; +import type { Config } from '@wagmi/core'; import type { FuelConnector } from 'fuels'; import type { BurnerWalletConfig } from '../../burner-wallet-connector/src/types'; @@ -13,12 +15,14 @@ type DefaultConnectors = { devMode?: boolean; wcProjectId?: string; burnerWalletConfig?: BurnerWalletConfig; + ethWagmiConfig?: Config; }; export function defaultConnectors({ devMode, wcProjectId = DEFAULT_WC_PROJECT_ID, burnerWalletConfig, + ethWagmiConfig, }: DefaultConnectors = {}): Array { const connectors = [ new FuelWalletConnector(), @@ -26,6 +30,10 @@ export function defaultConnectors({ new FueletWalletConnector(), new WalletConnectConnector({ projectId: wcProjectId, + wagmiConfig: ethWagmiConfig, + }), + new SolanaConnector({ + projectId: wcProjectId, }), new BurnerWalletConnector(burnerWalletConfig), ]; diff --git a/packages/solana-connector/src/utils/solanaProvider.ts b/packages/solana-connector/src/utils/solanaProvider.ts index 8b2800f7..b51a6ad4 100644 --- a/packages/solana-connector/src/utils/solanaProvider.ts +++ b/packages/solana-connector/src/utils/solanaProvider.ts @@ -22,6 +22,7 @@ export function createSolanaProvider(config: SolanaConfig): ModalConfig { const solanaConfig = config.solanaConfig ?? defaultSolanaConfig({ + enableInjected: true, chains, projectId: config.projectId ?? DEFAULT_PROJECT_ID, metadata: {