@particle-network/connectkit
Version:
8 lines (7 loc) • 32.3 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/components/connectButton/index.tsx", "../../src/components/connectedWidget/index.tsx", "../../src/components/horizontalResizeAnimation/index.tsx", "../../src/components/connectButton/styles.ts", "../../src/index.ts", "../../src/hooks/useModal.ts", "../../src/createConfig.ts"],
"sourcesContent": ["import { useEffect, useState } from 'react';\nimport { useAccount } from '../../hooks/useAccount';\nimport { useAppearance } from '../../hooks/useAppearance';\nimport useLocales from '../../hooks/useLocales';\nimport { useRouter } from '../../hooks/useRouter';\nimport { RoutePath } from '../../pages';\nimport { ThemeContainer } from '../../styles';\nimport ConnectedWidget from '../connectedWidget';\nimport { ButtonContainer } from './styles';\n\ntype ConnectButtonProps = {\n label?: string;\n};\n\nconst ConnectButton = (props: ConnectButtonProps) => {\n const { label } = props;\n const { isConnected, status } = useAccount();\n const { navigate } = useRouter();\n const [loading, setLoading] = useState(true);\n const { appearance } = useAppearance();\n const locales = useLocales();\n\n useEffect(() => {\n setLoading(false);\n }, [status]);\n\n if (loading) {\n return null;\n }\n\n return (\n <ThemeContainer $useTheme={appearance?.theme} $useMode={appearance?.mode} suppressHydrationWarning>\n {isConnected ? (\n <ConnectedWidget />\n ) : (\n <ButtonContainer\n whileHover={{\n scale: 1.05,\n boxShadow: '0px 0px 8px rgba(255,255,255,0.2)',\n }}\n whileTap={{ scale: 0.95 }}\n initial={{ opacity: 0, y: 20 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{\n type: 'spring',\n stiffness: 260,\n damping: 20,\n }}\n onClick={() => {\n navigate(RoutePath.Signup);\n }}\n >\n {label ?? locales.connect}\n </ButtonContainer>\n )}\n </ThemeContainer>\n );\n};\n\nexport default ConnectButton;\n", "import { getChainIcon } from '@particle-network/connector-core';\nimport { useMemo, useRef, useState } from 'react';\nimport DownArrowIcon from '../../assets/icons/DownArrowIcon';\nimport ErrorIcon from '../../assets/icons/ErrorIcon';\nimport MoreOptionsIcon from '../../assets/icons/MoreOptionsIcon';\nimport { useAccount } from '../../hooks/useAccount';\nimport { useAddress } from '../../hooks/useAddress';\nimport { useChains } from '../../hooks/useChains';\nimport useLocales from '../../hooks/useLocales';\nimport { useRouter } from '../../hooks/useRouter';\nimport { useSmartAccount } from '../../hooks/useSmartAccount';\nimport { RoutePath } from '../../pages';\nimport { shortAddress } from '../../utils';\nimport { getChainDisplayName } from '../../utils/chains';\nimport ChainDropdown from '../chainDropdown';\nimport HorizontalResizeAnimation from '../horizontalResizeAnimation';\nimport WalletAAIcon from '../walletAAIcon';\nimport WalletIcon from '../walletIcon';\nimport {\n StyleAddressSection,\n StyleChainIcon,\n StyleChainName,\n StyleChainSection,\n StyleConnectedWidgetContainer,\n StyleDivider,\n StyleInfoBox,\n StyleSwitchNetwork,\n StyleWalletAddress,\n} from './styles';\n\nconst ConnectedWidget = () => {\n const locales = useLocales();\n const { chain } = useAccount();\n const walletAddress = useAddress();\n const { navigate } = useRouter();\n const chains = useChains();\n const smartAccount = useSmartAccount();\n\n // @ts-ignore\n const aaIconName = smartAccount?.smartAccountContract?.name?.toUpperCase();\n\n const [chainDropdownVisible, setChainDropdownVisible] = useState(false);\n const leftRef = useRef<HTMLDivElement>(null);\n\n /**\n * \u662F\u5426\u652F\u6301\u5F53\u524D\u94FE\n */\n const supportChain = useMemo(() => {\n return chains.some((item) => item.id === chain?.id);\n }, [chain, chains]);\n\n const chainName = useMemo(() => {\n const chainName = getChainDisplayName(chain);\n const maxChainNameLength = window.screen.width < 400 ? 9 : 18;\n return chainName?.length > maxChainNameLength ? `${chainName.slice(0, maxChainNameLength)}...` : chainName;\n }, [chain]);\n\n return (\n <StyleConnectedWidgetContainer>\n <StyleInfoBox>\n <StyleChainSection\n ref={leftRef}\n selected={chains?.length > 1 || !supportChain}\n onClick={() => {\n if (chains?.length > 1 || !supportChain) {\n setChainDropdownVisible(!chainDropdownVisible);\n }\n }}\n >\n <div className='wrap'>\n {supportChain ? (\n <>\n {chain && <StyleChainIcon src={getChainIcon(chain)} alt='' />}\n <HorizontalResizeAnimation>\n <StyleChainName>{chainName}</StyleChainName>\n </HorizontalResizeAnimation>\n </>\n ) : (\n <StyleSwitchNetwork>\n <ErrorIcon />\n <HorizontalResizeAnimation>{locales.switchNetwork}</HorizontalResizeAnimation>\n </StyleSwitchNetwork>\n )}\n {(chains?.length > 1 || !supportChain) && (\n <DownArrowIcon\n width={10}\n height={10}\n spin={!!chainDropdownVisible}\n color={supportChain ? 'var(--pcm-body-color-secondary)' : 'var(--pcm-error-color)'}\n />\n )}\n </div>\n </StyleChainSection>\n <StyleDivider />\n <StyleAddressSection\n style={{ cursor: 'pointer' }}\n onClick={() => {\n navigate(RoutePath.WalletInfo);\n }}\n >\n <div className='wrap'>\n {aaIconName ? <WalletAAIcon size={20} aaName={aaIconName} /> : <WalletIcon size={20} />}\n <HorizontalResizeAnimation>\n <StyleWalletAddress>{shortAddress(walletAddress || '')}</StyleWalletAddress>\n </HorizontalResizeAnimation>\n <MoreOptionsIcon />\n </div>\n </StyleAddressSection>\n </StyleInfoBox>\n <ChainDropdown\n visible={chainDropdownVisible}\n setVisible={setChainDropdownVisible}\n clickAwayElements={[leftRef as any]}\n supportChain={supportChain}\n />\n </StyleConnectedWidgetContainer>\n );\n};\n\nexport default ConnectedWidget;\n", "import { useEffect, useRef, useState } from 'react';\nimport { styled } from 'styled-components';\n\nconst AnimationContainer = styled.div`\n transition: width 0.3s ease;\n overflow: hidden;\n`;\n\nconst ContentWrapper = styled.div`\n display: inline-block;\n white-space: nowrap;\n`;\n\nconst HorizontalResizeAnimation = ({\n children,\n style,\n ...props\n}: {\n children: React.ReactNode;\n style?: React.CSSProperties;\n}) => {\n const containerRef = useRef(null);\n const contentRef = useRef(null);\n const [width, setWidth] = useState(0);\n\n useEffect(() => {\n if (containerRef.current && contentRef.current) {\n requestAnimationFrame(() => {\n // @ts-ignore\n const newWidth = contentRef.current?.offsetWidth || 0;\n setWidth(newWidth);\n });\n }\n }, [children]);\n\n return (\n <AnimationContainer ref={containerRef} style={{ width: `${width}px` }}>\n {/* @ts-ignore */}\n <ContentWrapper ref={contentRef} {...props} {...style}>\n {children as any}\n </ContentWrapper>\n </AnimationContainer>\n );\n};\n\nexport default HorizontalResizeAnimation;\n", "import { motion } from 'framer-motion';\nimport { styled } from 'styled-components';\n\nexport const ButtonContainer = styled(motion.div)`\n height: 48px;\n padding: 0 40px;\n position: relative;\n background-color: var(--pcm-primary-button-bankground);\n border-radius: var(--pcm-rounded-lg);\n color: var(--pcm-primary-button-color);\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: background-color 200ms ease;\n width: auto;\n max-width: 360px;\n width: 100%;\n`;\n", "// types\nexport type { EVMChain, SolanaChain } from '@particle-network/connector-core';\nexport * from './context/types';\nexport { type Theme } from './types';\n\n// assets\nexport { socialIcons } from './assets/social/index';\nexport * as walletIcons from './assets/wallets/index';\n\n// components\nexport { default as ConnectButton } from './components/connectButton';\nexport { ConnectKitProvider } from './context';\n\n// hooks\nexport { useAccount } from './hooks/useAccount';\nexport { useAddress } from './hooks/useAddress';\nexport { useAppearance } from './hooks/useAppearance';\nexport { useChains } from './hooks/useChains';\nexport { default as useConnect } from './hooks/useConnect';\nexport { useConnectors } from './hooks/useConnectors';\nexport { useDisconnect } from './hooks/useDisconnect';\nexport { useEmbeddedWallet } from './hooks/useEmbeddedWallet';\nexport { useModal } from './hooks/useModal';\nexport { useParticleAuth } from './hooks/useParticleAuth';\nexport { usePublicClient } from './hooks/usePublicClient';\nexport { useSmartAccount } from './hooks/useSmartAccount';\nexport { useSwitchAccount } from './hooks/useSwitchAccount';\nexport { useSwitchChain } from './hooks/useSwitchChain';\nexport { useWallets } from './hooks/useWallets';\n\n// TODO: export openbuy hooks\n\nexport { createConfig } from './createConfig';\n\nexport { version } from './version';\n", "import { RoutePath } from '../pages';\nimport { useAccount } from './useAccount';\nimport { useRouter } from './useRouter';\n\nexport type UseModalProps = {\n onConnect?: ({ address, connectorId }: { address?: string; connectorId?: string }) => void;\n onDisconnect?: () => void;\n};\n\n// TODO: callback\nexport const useModal = ({ onConnect, onDisconnect }: UseModalProps = {}) => {\n const { navigate, close, isOpen } = useRouter();\n const { isConnected } = useAccount();\n\n return {\n isOpen,\n setOpen: (open: boolean) => {\n if (open) {\n navigate(isConnected ? RoutePath.WalletInfo : RoutePath.Signup);\n } else {\n close();\n }\n },\n };\n};\n", "import {\n createStorage,\n uid as getUid,\n isEVMChain,\n isSolanaChain,\n noopStorage,\n type Connection,\n type Connector,\n type ConnectorEventMap,\n type CreateWalletConnectorFn,\n type EventData,\n type PartializedState,\n type State,\n type Storage,\n type WalletConnector,\n type WalletConnectorType,\n type WalletConnectorsOption,\n} from '@particle-network/connector-core';\nimport type { CreatePluginFn, Plugin } from '@particle-network/plugin-core';\nimport type { Chain } from 'viem/chains';\nimport { persist, subscribeWithSelector } from 'zustand/middleware';\nimport { createStore, type StoreApi } from 'zustand/vanilla';\nimport type { Appearance, ConnectKitOptions } from './context/types';\nimport { version } from './version';\n\nexport const createConfig = (options: ConnectKitOptions): Config => {\n const { walletConnectors: createWalletConnectorFns, chains, projectId, clientKey, appId, plugins } = options;\n if (!createWalletConnectorFns.length) {\n throw new Error('Please set at least one connector.');\n }\n\n if (!chains.length) {\n throw new Error('Please set at least one chain.');\n }\n\n if (\n options.initialChainId?.evm &&\n chains.some(isEVMChain) &&\n !chains.find((chain) => chain.id === options.initialChainId?.evm)\n ) {\n throw new Error('`chains` not includes `initialChainId.evm`');\n }\n\n if (\n options.initialChainId?.solana &&\n chains.some(isSolanaChain) &&\n !chains.find((chain) => chain.id === options.initialChainId?.solana)\n ) {\n throw new Error('`chains` not includes `initialChainId.solana`');\n }\n\n const storage = createStorage({\n storage: typeof window !== 'undefined' && window.localStorage ? window.localStorage : noopStorage,\n });\n\n function getInitialState(): State {\n return {\n chainId: chains[0].id,\n connections: new Map<string, Connection>(),\n current: null,\n status: 'disconnected',\n };\n }\n\n const currentVersion = Number(version.replaceAll('.', ''));\n const store = createStore(\n subscribeWithSelector(\n // only use persist middleware if storage exists\n storage\n ? persist(getInitialState, {\n migrate(persistedState, version) {\n // Now there is only one version.\n return persistedState as State;\n },\n name: 'store',\n partialize(state) {\n // Only persist \"critical\" store properties to preserve storage size.\n return {\n connections: {\n __type: 'Map',\n value: Array.from(state.connections.entries()).map(([key, connection]) => {\n const { id, name, type, uid, chainType } = connection.connector;\n const connector = { id, name, type, uid, chainType };\n return [key, { ...connection, connector }];\n }),\n } as unknown as PartializedState['connections'],\n chainId: state.chainId,\n current: state.current,\n } satisfies PartializedState;\n },\n storage: storage as Storage<Record<string, unknown>>,\n version: currentVersion,\n })\n : getInitialState\n )\n );\n\n /////////////////////////////////////////////////////////////////////////////////////////////////\n // Emitter listeners\n /////////////////////////////////////////////////////////////////////////////////////////////////\n\n function change(data: EventData<ConnectorEventMap, 'change'>) {\n store.setState((x) => {\n const connection = x.connections.get(data.uid);\n if (!connection) return x;\n return {\n ...x,\n connections: new Map(x.connections).set(data.uid, {\n accounts: (data.accounts as readonly [string, ...string[]]) ?? connection.accounts,\n chainId: data.chainId ?? connection.chainId,\n connector: connection.connector,\n }),\n };\n });\n }\n async function connect(data: EventData<ConnectorEventMap, 'connect'>) {\n const status = store.getState().status;\n // Disable handling if reconnecting/connecting\n if (status === 'connecting' || status === 'reconnecting') {\n console.log('Disable handling connect event because the status: ', status);\n return;\n }\n\n const connector = connectors.getState().find((x) => x.uid === data.uid);\n if (!connector) return;\n const isAuthorized = await connector.isAuthorized();\n if (!isAuthorized) {\n return;\n }\n\n console.log(`wallet auto connect, current status: ${status}, connectorId: ${connector.id}`);\n\n store.setState((x) => {\n const connector = connectors.getState().find((x) => x.uid === data.uid);\n if (!connector) return x;\n\n // unsupport auto connect\n // if (connector.emitter.listenerCount('connect')) connector.emitter.off('connect', connect);\n if (!connector.emitter.listenerCount('change')) connector.emitter.on('change', change);\n if (!connector.emitter.listenerCount('disconnect')) connector.emitter.on('disconnect', disconnect);\n\n storage.setItem('recentConnectorId', connector.id);\n\n console.log(`connector [${connector.id}] onConnect`);\n return {\n ...x,\n connections: new Map(x.connections).set(data.uid, {\n accounts: data.accounts as readonly [string, ...string[]],\n chainId: data.chainId,\n connector: connector,\n }),\n current: data.uid,\n status: 'connected',\n };\n });\n }\n function disconnect(data: EventData<ConnectorEventMap, 'disconnect'>) {\n store.setState((x) => {\n const connection = x.connections.get(data.uid);\n if (connection) {\n const connector = connection.connector;\n if (connector.emitter.listenerCount('change')) connection.connector.emitter.off('change', change);\n if (connector.emitter.listenerCount('disconnect')) connection.connector.emitter.off('disconnect', disconnect);\n // unsupport auto connect\n // if (!connector.emitter.listenerCount('connect')) connection.connector.emitter.on('connect', connect);\n }\n\n x.connections.delete(data.uid);\n\n if (x.connections.size === 0)\n return {\n ...x,\n connections: new Map(),\n current: null,\n status: 'disconnected',\n };\n\n const nextConnection = x.connections.values().next().value as Connection;\n return {\n ...x,\n connections: new Map(x.connections),\n current: nextConnection.connector.uid,\n };\n });\n }\n\n const connectors = createStore<Connector[]>(() => []);\n\n const connectorSetup = (connector: Connector) => {\n if (!connector.emitter.listenerCount('connect')) {\n // unsupport auto connect\n // connector.emitter.on('connect', connect);\n }\n return connector;\n };\n\n const setup = (createFn: CreateWalletConnectorFn) => {\n const walletConnector = createFn({\n chains,\n storage,\n projectId,\n clientKey,\n appId,\n } as WalletConnectorsOption);\n\n const subConnectors = walletConnector.connectors.map(connectorSetup);\n\n connectors.setState((x) => [...x, ...subConnectors], true);\n\n walletConnector.store.subscribe((state: Connector[]) => {\n const currentConnectorIds = new Map();\n for (const connector of connectors.getState()) {\n currentConnectorIds.set(connector.id, true);\n }\n\n const newConnectors: Connector[] = [];\n for (const connector of state) {\n if (currentConnectorIds.has(connector.id)) continue;\n newConnectors.push(connector);\n }\n if (newConnectors.length) {\n connectors.setState((x) => [...x, ...newConnectors], true);\n }\n });\n\n return walletConnector;\n };\n\n const walletConnectors = createWalletConnectorFns.map(setup);\n\n const getWalletConnector = <properties extends Record<string, unknown> = Record<string, unknown>>(\n type: WalletConnectorType\n ) => {\n const walletConnector = walletConnectors.find((item) => item.type === type);\n if (walletConnector) {\n return walletConnector as WalletConnector<properties>;\n }\n return undefined;\n };\n\n // Update default chain when connector chain changes\n store.subscribe(\n ({ connections, current }) => (current ? connections.get(current)?.chainId : undefined),\n (chainId) => {\n // If chain is not configured, then don't switch over to it.\n const isChainConfigured = chains.some((x) => x.id === chainId);\n if (!isChainConfigured) return;\n\n return store.setState((x) => ({\n ...x,\n chainId: chainId ?? x.chainId,\n }));\n }\n );\n\n function setupPlugin(createPluginFn: CreatePluginFn): Plugin {\n return createPluginFn({\n projectConfig: {\n projectId,\n clientKey,\n appId,\n },\n chains,\n });\n }\n\n const _plugins = plugins?.map(setupPlugin);\n\n const uid = getUid();\n\n const _appearance = options.appearance || {};\n\n const appearanceStore = createStore(() => _appearance);\n\n return {\n get uid() {\n return uid;\n },\n get plugins() {\n return _plugins || [];\n },\n get options() {\n return options;\n },\n get chains() {\n return chains;\n },\n get connectors() {\n return connectors.getState();\n },\n get appearanceStore() {\n return appearanceStore;\n },\n storage,\n get walletConnectors() {\n return walletConnectors;\n },\n getWalletConnector,\n get state() {\n return store.getState() as unknown as State;\n },\n setState(value) {\n let newState: State;\n if (typeof value === 'function') newState = value(store.getState() as any);\n else newState = value;\n\n // Reset state if it got set to something not matching the base state\n const initialState = getInitialState();\n if (typeof newState !== 'object') newState = initialState;\n const isCorrupt = Object.keys(initialState).some((x) => !(x in newState));\n if (isCorrupt) newState = initialState;\n\n store.setState(newState, true);\n },\n subscribe(selector, listener, options) {\n return store.subscribe(\n selector as unknown as (state: State) => any,\n listener,\n options ? { ...options, fireImmediately: options.emitImmediately } : undefined\n );\n },\n _internal: {\n connectors: {\n setup: connectorSetup,\n subscribe(listener) {\n return connectors.subscribe(listener);\n },\n },\n events: { change, connect, disconnect },\n },\n };\n};\n\nexport type Config = {\n readonly uid: string;\n readonly options: ConnectKitOptions;\n readonly plugins: Plugin[];\n readonly chains: readonly [Chain, ...Chain[]];\n readonly connectors: readonly Connector[];\n readonly storage: Storage | null;\n readonly walletConnectors: readonly WalletConnector[];\n readonly state: State;\n readonly appearanceStore: StoreApi<Appearance>;\n setState(value: State | ((state: State) => State)): void;\n subscribe<state>(\n selector: (state: State) => state,\n listener: (state: state, previousState: state) => void,\n options?:\n | {\n emitImmediately?: boolean | undefined;\n equalityFn?: ((a: state, b: state) => boolean) | undefined;\n }\n | undefined\n ): () => void;\n getWalletConnector: <properties extends Record<string, unknown> = Record<string, unknown>>(\n type: WalletConnectorType\n ) => WalletConnector<properties> | undefined;\n _internal: {\n connectors: {\n setup(connector: Connector): Connector;\n subscribe(listener: (state: Connector[], prevState: Connector[]) => void): () => void;\n };\n events: {\n change(data: EventData<ConnectorEventMap, 'change'>): void;\n connect(data: EventData<ConnectorEventMap, 'connect'>): void;\n disconnect(data: EventData<ConnectorEventMap, 'disconnect'>): void;\n };\n };\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AACA;AAJA,SAAS,aAAAA,YAAW,YAAAC,iBAAgB;AAMpC;;;ACJA;AACA;AAHA,SAAS,oBAAoB;AAC7B,SAAS,SAAS,UAAAC,SAAQ,YAAAC,iBAAgB;AAI1C;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;;ACdA,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,cAAc;AAqCjB;AAnCN,IAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAKlC,IAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAK9B,IAAM,4BAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,KACG;AACL,MAGM;AACJ,QAAM,eAAe,OAAO,IAAI;AA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T;AAAA,IACA;AAAA,IACA,IAAI,mBAAmB;AACrB,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA,IAAI,QAAQ;AACV,aAAO,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,SAAS,OAAO;AACd,UAAI;AACJ,UAAI,OAAO,UAAU;AAAY,mBAAW,MAAM,MAAM,SAAS,CAAQ;AAAA;AACpE,mBAAW;AAGhB,YAAM,eAAe,gBAAgB;AACrC,UAAI,OAAO,aAAa;AAAU,mBAAW;AAC7C,YAAM,YAAY,OAAO,KAAK,YAAY,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,SAAS;AACxE,UAAI;AAAW,mBAAW;AAE1B,YAAM,SAAS,UAAU,IAAI;AAAA,IAC/B;AAAA,IACA,UAAU,UAAU,UAAUE,UAAS;AACrC,aAAO,MAAM;AAAA,QACX;AAAA,QACA;AAAA,QACAA,WAAU,EAAE,GAAGA,UAAS,iBAAiBA,SAAQ,gBAAgB,IAAI;AAAA,MACvE;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,YAAY;AAAA,QACV,OAAO;AAAA,QACP,UAAU,UAAU;AAClB,iBAAO,WAAW,UAAU,QAAQ;AAAA,QACtC;AAAA,MACF;AAAA,MACA,QAAQ,EAAE,QAAQ,SAAS,WAAW;AAAA,IACxC;AAAA,EACF;AACF;;;AFzSA;",
"names": ["useEffect", "useState", "useRef", "useState", "init_styles", "jsx", "useState", "useRef", "chainName", "styled", "jsx", "useState", "useEffect", "version", "uid", "connector", "x", "options"]
}