diff --git a/.changeset/young-terms-agree.md b/.changeset/young-terms-agree.md
new file mode 100644
index 000000000..868ae1c8c
--- /dev/null
+++ b/.changeset/young-terms-agree.md
@@ -0,0 +1,5 @@
+---
+"@onflow/react-sdk": minor
+---
+
+Enhanced the Connect component to enable visualizing different tokens like USDC and other stablecoins within the Connect modal.
diff --git a/packages/demo/src/components/component-cards/connect-card.tsx b/packages/demo/src/components/component-cards/connect-card.tsx
index ba5cbc122..e210b3a8c 100644
--- a/packages/demo/src/components/component-cards/connect-card.tsx
+++ b/packages/demo/src/components/component-cards/connect-card.tsx
@@ -1,11 +1,32 @@
+import {useState} from "react"
import {Connect, useFlowChainId} from "@onflow/react-sdk"
import {useDarkMode} from "../flow-provider-wrapper"
import {DemoCard, type PropDefinition} from "../ui/demo-card"
import {PlusGridIcon} from "../ui/plus-grid"
+import {CONTRACT_ADDRESSES} from "../../constants"
const IMPLEMENTATION_CODE = `import { Connect } from "@onflow/react-sdk"
-`
+// Basic usage - shows FLOW by default
+
+
+// With multiple tokens - dropdown selector, first token is default
+// Note: Provide only ONE identifier per token (the bridge derives the other)
+`
const PROPS: PropDefinition[] = [
{
@@ -29,11 +50,19 @@ const PROPS: PropDefinition[] = [
},
{
name: "balanceType",
- type: '"cadence" | "evm" | "vault"',
+ type: '"cadence" | "evm" | "combined"',
required: false,
- description: "Type of balance to display (from cross-VM token balance)",
+ description:
+ "Type of balance to display: cadence (Cadence VM only), evm (EVM only), or combined (sum of both)",
defaultValue: '"cadence"',
},
+ {
+ name: "balanceTokens",
+ type: "TokenConfig[]",
+ required: false,
+ description:
+ "Array of tokens with dropdown selector (first token is default). Each token needs symbol, name, and EXACTLY ONE of: vaultIdentifier OR erc20Address (the bridge derives the other automatically)",
+ },
{
name: "modalConfig",
type: "ConnectModalConfig",
@@ -47,6 +76,41 @@ export function ConnectCard() {
const {darkMode} = useDarkMode()
const {data: chainId, isLoading} = useFlowChainId()
const isEmulator = chainId === "emulator" || chainId === "local"
+ const [showMultiToken, setShowMultiToken] = useState(false)
+ const [balanceType, setBalanceType] = useState<
+ "cadence" | "evm" | "combined"
+ >("cadence")
+
+ const getFlowTokenAddress = () => {
+ if (chainId === "emulator" || chainId === "local") {
+ return CONTRACT_ADDRESSES.FlowToken.emulator
+ }
+ return chainId === "testnet"
+ ? CONTRACT_ADDRESSES.FlowToken.testnet
+ : CONTRACT_ADDRESSES.FlowToken.mainnet
+ }
+
+ const multiTokens = [
+ {
+ symbol: "FLOW",
+ name: "Flow Token",
+ vaultIdentifier: `A.${getFlowTokenAddress().replace("0x", "")}.FlowToken.Vault`,
+ },
+ // Only show USDF (PYUSD) on testnet and mainnet
+ // Note: Only vaultIdentifier provided - EVM address is derived by the bridge
+ ...(!isEmulator
+ ? [
+ {
+ symbol: "USDF",
+ name: "USDF (PYUSD)",
+ vaultIdentifier:
+ chainId === "testnet"
+ ? "A.dfc20aee650fcbdf.EVMVMBridgedToken_f2e5a325f7d678da511e66b1c0ad7d5ba4df93d3.Vault"
+ : "A.1e4aa0b87d10b141.EVMVMBridgedToken_2aabea2058b5ac2d339b163c6ab6f2b6d53aabed.Vault",
+ },
+ ]
+ : []),
+ ]
return (
-
+
- Customizable
+ Multi-Token Cross-VM
-
- Style variants
+
+ Multi-token support with cross-VM bridge integration. Provide only
+ a vaultIdentifier or an erc20Address and the bridge derives the
+ other automatically.