From aa0988ae16b8f01d7c4ef83ee1ea177ad9847aff Mon Sep 17 00:00:00 2001 From: ogous Date: Fri, 13 Dec 2024 10:30:43 +0300 Subject: [PATCH] customize wallets --- web/src/components/buttons/connectButton.tsx | 1 + web/src/components/buttons/donateButton.tsx | 1 + web/src/config.ts | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/web/src/components/buttons/connectButton.tsx b/web/src/components/buttons/connectButton.tsx index 15b908e..d3d5b29 100644 --- a/web/src/components/buttons/connectButton.tsx +++ b/web/src/components/buttons/connectButton.tsx @@ -6,6 +6,7 @@ export default function ConnectButton() { diff --git a/web/src/components/buttons/donateButton.tsx b/web/src/components/buttons/donateButton.tsx index 7e43ef6..9d88083 100644 --- a/web/src/components/buttons/donateButton.tsx +++ b/web/src/components/buttons/donateButton.tsx @@ -42,6 +42,7 @@ export default function DonateButton() { connect({ client: config.thirdweb.client, chain: config.thirdweb.chain, + wallets: config.thirdweb.wallets, appMetadata: config.thirdweb.appMetadata, accountAbstraction: config.thirdweb.accountAbstraction, }); diff --git a/web/src/config.ts b/web/src/config.ts index 7d1ed81..e6ef158 100644 --- a/web/src/config.ts +++ b/web/src/config.ts @@ -1,6 +1,7 @@ import { abi } from "#/abis/donation"; import { createThirdwebClient } from "thirdweb"; import { getContract } from "thirdweb"; +import { createWallet, inAppWallet } from "thirdweb/wallets"; const net = (process.env.NEXT_PUBLIC_NET ?? "testnet") as "mainnet" | "testnet"; const clientId = process.env.NEXT_PUBLIC_THIRDWEB_ID; @@ -41,6 +42,16 @@ const metadata = { "blockchain", ], }; +const wallets = [ + inAppWallet({ + smartAccount: { + chain: chains.superposition[net], + sponsorGas: true, + }, + }), + createWallet("io.metamask"), + createWallet("io.rabby"), +]; const thirdwebClient = createThirdwebClient({ clientId, }); @@ -83,6 +94,7 @@ export const config = { chain: chains.superposition[net], sponsorGas: true, }, + wallets, appMetadata: { name: metadata.title as string, url: metadata.metadataBase?.href,