@wallet-ui/react 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -1
- package/dist/index.browser.cjs +38 -45
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +38 -45
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +38 -45
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +38 -45
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +38 -45
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/wallet-ui-account-context-provider.d.ts +6 -5
- package/dist/types/wallet-ui-account-context-provider.d.ts.map +1 -1
- package/dist/types/wallet-ui-cluster-context-provider.d.ts +1 -1
- package/dist/types/wallet-ui-cluster-context-provider.d.ts.map +1 -1
- package/dist/types/wallet-ui-context-provider.d.ts.map +1 -1
- package/dist/types/wallet-ui.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/base-button.tsx","../src/wallet-ui-context.tsx","../src/use-wallet-ui.tsx","../src/wallet-ui-account-context.tsx","../src/use-wallet-ui-account.tsx","../src/use-wallet-ui-wallet.tsx","../src/wallet-ui-icon.tsx","../src/base-dropdown.tsx","../src/base-svg.tsx","../src/wallet-ui-icon-close.tsx","../src/base-modal.tsx","../src/use-base-dropdown.tsx","../src/use-base-modal.tsx","../src/wallet-ui-cluster-context.tsx","../src/use-wallet-ui-cluster.tsx","../src/use-wallet-ui-dropdown.tsx","../src/use-wallet-ui-signer.tsx","../src/use-wallet-ui-wallets.tsx","../src/wallet-ui-account-context-provider.tsx","../src/wallet-ui-cluster-context-provider.tsx","../src/wallet-ui-context-provider.tsx","../src/wallet-ui.tsx","../src/wallet-ui-dropdown.tsx","../src/wallet-ui-account-guard.tsx","../src/wallet-ui-cluster-dropdown.tsx","../src/wallet-ui-icon-no-wallet.tsx","../src/wallet-ui-label.tsx","../src/wallet-ui-list-button.tsx","../src/wallet-ui-list.tsx","../src/wallet-ui-modal.tsx","../src/wallet-ui-modal-trigger.tsx"],"names":["React","connect","BaseDropdownItemType","useMachine","useId","normalizeProps","createContext","useContext","useMemo","useWallets","useEffect","useStore","clusterId","account","cluster"],"mappings":";;;;;;;;;;;;;;;AAWO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,KAAA,EAAO,aAAa,OAAA,EAAS,YAAA,EAAc,GAAG,KAAA,EAAM,EAAoB;AAC5G,EAAA,uBACIA,OAAA,CAAA,aAAA,CAAC,QAAA,EAAA,EAAO,SAAA,EAAQ,aAAA,EAAc,SAAA,EAAW,CAAA,EAAG,SAAA,IAAa,EAAE,CAAA,CAAA,EAAI,OAAA,EAAmB,GAAG,KAAA,EAAA,EAChF,WAAA,mBAAcA,OAAA,CAAA,aAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAQ,0BAAA,EAAA,EAA4B,WAAY,CAAA,GAAU,IAAA,EAC9E,KAAA,EACA,YAAA,mBAAeA,OAAA,CAAA,aAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAQ,2BAAA,EAAA,EAA6B,YAAa,CAAA,GAAU,IACtF,CAAA;AAER;ACKO,IAAM,eAAA,GAAkBA,OAAAA,CAAM,aAAA,CAAoC,EAA0B;;;ACpB5F,SAAS,WAAA,GAAc;AAC1B,EAAA,OAAOA,OAAAA,CAAM,WAAW,eAAe,CAAA;AAC3C;ACUO,IAAM,sBAAA,GAAyB,aAAA,CAAoC,EAA0B;;;ACZ7F,SAAS,kBAAA,GAAqB;AACjC,EAAA,OAAO,WAAW,sBAAsB,CAAA;AAC5C;;;ACAO,SAAS,iBAAA,CAAkB,EAAE,MAAA,EAAO,EAAyB;AAChE,EAAA,MAAM,EAAE,OAAA,EAAS,cAAA,EAAe,GAAI,WAAA,EAAY;AAChD,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,kBAAA,EAAmB;AAC1C,EAAA,MAAM,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/wallet-ui-button';\n\nexport interface BaseButtonProps extends Omit<WalletUiButton, 'children'> {\n label: React.ReactNode;\n leftSection?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n rightSection?: React.ReactNode;\n}\n\nexport function BaseButton({ className, label, leftSection, onClick, rightSection, ...props }: BaseButtonProps) {\n return (\n <button data-wu=\"base-button\" className={`${className ?? ''}`} onClick={onClick} {...props}>\n {leftSection ? <span data-wu=\"base-button-left-section\">{leftSection}</span> : null}\n {label}\n {rightSection ? <span data-wu=\"base-button-right-section\">{rightSection}</span> : null}\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport { SolanaCluster } from '@wallet-ui/core';\nimport React, { ReactNode } from 'react';\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n}\n\nexport interface WalletUiContextValue {\n account?: UiWalletAccount;\n accountKeys: string[];\n cluster: SolanaCluster;\n connect: (wallet: UiWalletAccount) => void;\n connected: boolean;\n copy: () => void;\n disconnect: () => void;\n wallet?: UiWallet;\n wallets: UiWallet[];\n}\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n}\n\nexport const WalletUiContext = React.createContext<WalletUiContextValue>({} as WalletUiContextValue);\n","import React from 'react';\n\nimport { WalletUiContext } from './wallet-ui-context';\n\nexport function useWalletUi() {\n return React.useContext(WalletUiContext);\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport { SolanaCluster } from '@wallet-ui/core';\nimport React, { createContext } from 'react';\n\nexport interface WalletUiAccountInfo {\n account: UiWalletAccount;\n accountKeys: string[];\n cluster: SolanaCluster;\n wallet: UiWallet | undefined;\n}\n\nexport interface WalletUiAccountState extends Omit<WalletUiAccountInfo, 'account'> {\n account: UiWalletAccount | undefined;\n setAccount: React.Dispatch<React.SetStateAction<UiWalletAccount | undefined>>;\n}\n\nexport const WalletUiAccountContext = createContext<WalletUiAccountState>({} as WalletUiAccountState);\n","import { useContext } from 'react';\n\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nexport function useWalletUiAccount() {\n return useContext(WalletUiAccountContext);\n}\n","import { UiWallet, useConnect, useDisconnect } from '@wallet-standard/react';\nimport { useEffect } from 'react';\n\nimport { useWalletUi } from './use-wallet-ui';\nimport { useWalletUiAccount } from './use-wallet-ui-account';\n\nexport function useWalletUiWallet({ wallet }: { wallet: UiWallet }) {\n const { connect: connectAccount } = useWalletUi();\n const { setAccount } = useWalletUiAccount();\n const [isConnecting, connect] = useConnect(wallet);\n const [isDisconnecting, disconnect] = useDisconnect(wallet);\n useEffect(() => {}, [isDisconnecting]);\n\n return {\n connect: async () => {\n const connectedAccount = await connect();\n if (!connectedAccount.length) {\n console.warn(`Connect to ${wallet.name} but there are no accounts.`);\n return connectedAccount;\n }\n // TODO: Support wallets with multiple accounts\n const first = connectedAccount[0];\n setAccount(first);\n connectAccount(first);\n return connectedAccount;\n },\n disconnect,\n isConnecting,\n isDisconnecting,\n };\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiImg } from './types/wallet-ui-img';\n\nexport interface WalletUiIconProps extends WalletUiImg {\n wallet?: Pick<UiWallet, 'icon' | 'name'>;\n}\n\nexport function WalletUiIcon({ className, wallet, ...props }: WalletUiIconProps) {\n if (!wallet) {\n return null;\n }\n\n return <img data-wu=\"wallet-ui-icon\" src={wallet.icon} alt={wallet.name} className={className ?? ''} {...props} />;\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React, { HTMLAttributes } from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseDropdownControl } from './use-base-dropdown';\nimport { useWalletUiWallet } from './use-wallet-ui-wallet';\nimport { WalletUiIcon } from './wallet-ui-icon';\n\nexport enum BaseDropdownItemType {\n Item = 'Item',\n WalletConnect = 'WalletConnect',\n WalletCopy = 'WalletCopy',\n WalletDisconnect = 'WalletDisconnect',\n WalletNeeded = 'WalletNeeded',\n}\n\nexport interface BaseDropdownItem {\n closeMenu?: boolean;\n disabled?: boolean;\n handler: () => Promise<void>;\n label: string;\n leftSection?: React.ReactNode;\n rightSection?: React.ReactNode;\n type: BaseDropdownItemType;\n value: string;\n wallet?: UiWallet;\n}\n\nexport interface BaseDropdownProps {\n buttonProps: BaseButtonProps;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n showIndicator?: boolean;\n}\n\nexport function BaseDropdown({ buttonProps, dropdown, items, showIndicator }: BaseDropdownProps) {\n const api = dropdown.api;\n const trigger = (\n <BaseButton\n {...api.getTriggerProps()}\n rightSection={\n showIndicator ? (\n <span {...api.getIndicatorProps()}>\n <BaseDropdownChevronDown />\n </span>\n ) : null\n }\n {...buttonProps}\n />\n );\n\n return (\n <div data-wu=\"base-dropdown\">\n {trigger}\n <div {...api.getPositionerProps()} data-wu=\"base-dropdown-wrapper\">\n <div {...api.getContentProps()} data-wu=\"base-dropdown-list\" data-part=\"content\">\n {items.map(item => {\n return (\n <BaseDropdownItem\n {...api.getItemProps({ value: item.value })}\n key={item.value}\n item={item}\n afterClick={() => {\n if (item.disabled) {\n return;\n }\n if (item.closeMenu !== false) {\n dropdown.close();\n }\n }}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nfunction BaseDropdownItem({ afterClick, item }: BaseDropdownItemRenderProps) {\n if (!item.wallet) {\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n }\n switch (item.type) {\n case BaseDropdownItemType.Item:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletConnect:\n return <BaseDropdownItemWalletConnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n case BaseDropdownItemType.WalletCopy:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletDisconnect:\n return <BaseDropdownItemWalletDisconnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n }\n}\n\nfunction BaseDropdownItemWalletConnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { connect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await connect();\n return await item.handler();\n },\n leftSection: wallet ? <WalletUiIcon wallet={wallet} /> : undefined,\n }}\n />\n );\n}\n\nfunction BaseDropdownItemWalletDisconnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { disconnect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await disconnect();\n return await item.handler();\n },\n }}\n />\n );\n}\n\ninterface BaseDropdownItemRenderProps {\n afterClick: () => void;\n item: BaseDropdownItem;\n}\n\nfunction BaseDropdownItemRender({ afterClick, item }: BaseDropdownItemRenderProps) {\n function onClick() {\n if (item.disabled) {\n return;\n }\n void item.handler().then(() => {\n afterClick();\n });\n }\n\n return (\n <button type=\"button\" data-wu=\"base-dropdown-item\" data-part=\"item\" onClick={onClick}>\n {item.leftSection ? <span data-wu=\"base-dropdown-item-left-section\">{item.leftSection}</span> : null}\n {item.label}\n {item.rightSection ? <span data-wu=\"base-dropdown-item-right-section\">{item.rightSection}</span> : null}\n </button>\n );\n}\n\nexport function BaseDropdownChevronDown(props: HTMLAttributes<SVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={12}\n height={12}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n","import React from 'react';\n\nexport interface BaseSvgProps extends React.DetailedHTMLProps<React.SVGProps<SVGSVGElement>, SVGSVGElement> {\n viewBox: string;\n}\n\nexport function BaseSvg({ ...props }: BaseSvgProps) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n {props.children}\n </svg>\n );\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconClose({ ...props }: Omit<BaseSvgProps, 'viewBox'>) {\n return (\n <BaseSvg\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n width={12}\n height={12}\n viewBox=\"0 0 14 14\"\n {...props}\n >\n <path d=\"M14 12.461 8.3 6.772l5.234-5.233L12.006 0 6.772 5.234 1.54 0 0 1.539l5.234 5.233L0 12.006l1.539 1.528L6.772 8.3l5.69 5.7L14 12.461z\"></path>\n </BaseSvg>\n );\n}\n","import { Portal } from '@zag-js/react';\nimport React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseModalControl } from './use-base-modal';\nimport { WalletUiIconClose } from './wallet-ui-icon-close';\n\nexport interface BaseModalProps {\n buttonLabel?: React.ReactNode;\n buttonProps?: Partial<BaseButtonProps>;\n children: React.ReactNode;\n description?: React.ReactNode;\n modal: BaseModalControl;\n title?: React.ReactNode;\n}\n\nexport function BaseModal({ modal, buttonLabel, buttonProps = {}, ...props }: BaseModalProps) {\n const api = modal.api;\n return (\n <>\n {buttonLabel ? <BaseButton label={buttonLabel} {...buttonProps} {...api.getTriggerProps()} /> : null}\n {api.open && (\n <Portal>\n <div {...api.getBackdropProps()} />\n <div {...api.getPositionerProps()}>\n <div {...api.getContentProps()}>\n <header>\n <button {...api.getCloseTriggerProps()}>\n <WalletUiIconClose />\n </button>\n </header>\n {props.description ? <p {...api.getDescriptionProps()}>{props.description}</p> : null}\n <main>{props.children}</main>\n </div>\n </div>\n </Portal>\n )}\n </>\n );\n}\n","import * as menu from '@zag-js/menu';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseDropdownApi = ReturnType<typeof menu.connect>;\n\nexport interface BaseDropdownControl {\n api: BaseDropdownApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseDropdown(): BaseDropdownControl {\n const service = useMachine(menu.machine, { id: useId() });\n const api = menu.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import * as dialog from '@zag-js/dialog';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseModalApi = ReturnType<typeof dialog.connect>;\n\nexport interface BaseModalControl {\n api: BaseModalApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseModal(): BaseModalControl {\n const service = useMachine(dialog.machine, { id: useId(), modal: true });\n const api = dialog.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import { SolanaCluster, SolanaClusterId, StorageCluster } from '@wallet-ui/core';\nimport { createContext, ReactNode } from 'react';\n\nexport interface WalletUiClusterContextProviderProps {\n clusters: SolanaCluster[];\n render: (props: WalletUiClusterContextValue) => ReactNode;\n storage?: StorageCluster;\n}\n\nexport interface WalletUiClusterContextValue {\n cluster: SolanaCluster;\n clusters: SolanaCluster[];\n\n setCluster(cluster: SolanaClusterId): void;\n}\n\nexport const WalletUiClusterContext = createContext<WalletUiClusterContextValue>({} as WalletUiClusterContextValue);\n","import { useContext } from 'react';\n\nimport { WalletUiClusterContext } from './wallet-ui-cluster-context';\n\nexport function useWalletUiCluster() {\n return useContext(WalletUiClusterContext);\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React, { useMemo } from 'react';\n\nimport { BaseButtonProps } from './base-button';\nimport { BaseDropdownItem, BaseDropdownItemType } from './base-dropdown';\nimport { BaseDropdownControl, useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUi } from './use-wallet-ui';\nimport { WalletUiIcon } from './wallet-ui-icon';\n\nfunction getDropdownItemsWallets({\n wallets,\n connect,\n}: {\n connect: (wallet: UiWalletAccount) => void;\n wallets: UiWallet[];\n}): BaseDropdownItem[] {\n return wallets.length\n ? wallets.map(wallet => ({\n handler: async () => {\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n connect(account);\n await Promise.resolve();\n },\n label: wallet.name,\n\n type: BaseDropdownItemType.WalletConnect,\n value: wallet.name,\n wallet,\n }))\n : [\n {\n handler: async () => {\n window.open('https://solana.com/solana-wallets', '_blank');\n await Promise.resolve();\n },\n label: \"You'll need a wallet on Solana to continue\",\n type: BaseDropdownItemType.WalletNeeded,\n value: 'no-wallets',\n },\n ];\n}\n\nexport function useWalletUiDropdown(): {\n buttonProps: BaseButtonProps;\n connected: boolean;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n} {\n const dropdown = useBaseDropdown();\n\n const { account, connect, copy, disconnect, connected, wallet, wallets } = useWalletUi();\n\n const itemsWallets = useMemo(() => getDropdownItemsWallets({ connect, wallets }), [wallets, connect]);\n\n const itemsConnected: BaseDropdownItem[] = useMemo(\n () => [\n {\n handler: async () => {\n copy();\n void (await Promise.resolve());\n },\n label: 'Copy Address',\n type: BaseDropdownItemType.WalletCopy,\n value: 'copy',\n },\n {\n handler: async () => {\n disconnect();\n dropdown.close();\n await Promise.resolve();\n },\n label: 'Disconnect',\n type: BaseDropdownItemType.WalletDisconnect,\n value: 'disconnect',\n wallet,\n },\n ...itemsWallets,\n ],\n [copy, disconnect, dropdown, wallet, itemsWallets],\n );\n const items = useMemo(() => {\n return connected ? itemsConnected : itemsWallets;\n }, [connected, itemsConnected, itemsWallets]);\n\n const buttonProps: BaseButtonProps = useMemo(() => {\n return {\n label: connected ? ((account ? ellipsify(account.address) : wallet?.name) ?? 'Connected') : 'Select Wallet',\n leftSection: connected ? <WalletUiIcon wallet={wallet} /> : undefined,\n };\n }, [account, connected, wallet]);\n\n return {\n buttonProps,\n connected,\n dropdown,\n items,\n };\n}\n\nexport function ellipsify(str = '', len = 4, delimiter = '..') {\n const strLen = str.length;\n const limit = len * 2 + delimiter.length;\n\n return strLen >= limit ? str.substring(0, len) + delimiter + str.substring(strLen - len, strLen) : str;\n}\n","import { useWalletAccountTransactionSendingSigner } from '@solana/react';\nimport { TransactionSendingSigner } from '@solana/signers';\nimport { UiWalletAccount } from '@wallet-standard/react';\n\nimport { useWalletUi } from './use-wallet-ui';\n\nexport function useWalletUiSigner({\n account,\n}: {\n account: UiWalletAccount;\n}): TransactionSendingSigner<UiWalletAccount['address']> {\n const { cluster } = useWalletUi();\n\n return useWalletAccountTransactionSendingSigner(account, cluster.id);\n}\n","import { useWallets } from '@wallet-standard/react';\nimport { useMemo } from 'react';\n\nexport function useWalletUiWallets() {\n const readonlyWallets = useWallets();\n return useMemo(\n () =>\n readonlyWallets\n .filter(wallet => wallet.chains.some(i => i.startsWith('solana:')))\n .sort((a, b) => a.name.localeCompare(b.name)),\n [readonlyWallets],\n );\n}\n","import { useStore } from '@nanostores/react';\nimport {\n getUiWalletAccountStorageKey,\n UiWallet,\n UiWalletAccount,\n uiWalletAccountBelongsToUiWallet,\n uiWalletAccountsAreSame,\n useWallets,\n} from '@wallet-standard/react';\nimport { createStorageAccount, SolanaCluster, StorageAccount } from '@wallet-ui/core';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nlet wasSetterInvoked = false;\n\nfunction getSavedWalletAccount(\n wallets: readonly UiWallet[],\n savedWalletNameAndAddress?: string,\n): UiWalletAccount | undefined {\n if (wasSetterInvoked) {\n // After the user makes an explicit choice of wallet, stop trying to auto-select the\n // saved wallet, if and when it appears.\n return;\n }\n if (!savedWalletNameAndAddress || typeof savedWalletNameAndAddress !== 'string') {\n return;\n }\n const [savedWalletName, savedAccountAddress] = savedWalletNameAndAddress.split(':');\n if (!savedWalletName || !savedAccountAddress) {\n return;\n }\n const wallet = wallets.find(w => w.name === savedWalletName);\n if (!wallet) {\n return;\n }\n return wallet.accounts.find(a => a.address === savedAccountAddress);\n}\n\n/**\n * Saves the selected wallet account's storage key to the browser's local storage. In future\n * sessions it will try to return that same wallet account, or at least one from the same brand of\n * wallet if the wallet from which it came is still in the Wallet Standard registry.\n */\nexport function WalletUiAccountContextProvider({\n children,\n cluster,\n storage = createStorageAccount(),\n}: {\n children: React.ReactNode;\n cluster: SolanaCluster;\n storage?: StorageAccount;\n}) {\n const wallets = useWallets();\n const accountId = useStore(storage.value);\n const [account, setAccountInternal] = useState<UiWalletAccount | undefined>(() =>\n getSavedWalletAccount(wallets, accountId),\n );\n\n const setAccount = useCallback(\n (setStateAction: React.SetStateAction<UiWalletAccount | undefined>) => {\n setAccountInternal(prevAccount => {\n wasSetterInvoked = true;\n const nextWalletAccount =\n typeof setStateAction === 'function' ? setStateAction(prevAccount) : setStateAction;\n const accountKey = nextWalletAccount ? getUiWalletAccountStorageKey(nextWalletAccount) : undefined;\n storage.set(accountKey ? accountKey : undefined);\n return nextWalletAccount;\n });\n },\n [storage],\n );\n\n useEffect(() => {\n const savedWalletAccount = getSavedWalletAccount(wallets, accountId);\n if (savedWalletAccount) {\n setAccountInternal(savedWalletAccount);\n }\n }, [accountId, wallets]);\n const walletAccount = useMemo(() => {\n if (account) {\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(account, uiWalletAccount)) {\n return uiWalletAccount;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(account, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet.accounts[0];\n }\n }\n }\n }, [account, wallets]);\n useEffect(() => {\n // If there is a selected wallet account but the wallet to which it belongs has since\n // disconnected, clear the selected wallet.\n if (account && !walletAccount) {\n setAccountInternal(undefined);\n }\n }, [account, walletAccount]);\n\n const wallet = useMemo(() => {\n if (!walletAccount) {\n return undefined;\n }\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(walletAccount, uiWalletAccount)) {\n return uiWallet;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(walletAccount, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet;\n }\n }\n }, [walletAccount, wallets]);\n\n // Expose the error boundary reset keys to the context\n const accountKeys = useMemo(() => {\n if (!walletAccount) {\n return [];\n }\n return [cluster.id, getUiWalletAccountStorageKey(walletAccount)].filter(Boolean);\n }, [walletAccount, cluster.id]);\n\n return (\n <WalletUiAccountContext.Provider\n value={useMemo(\n () => ({\n account: walletAccount,\n accountKeys,\n cluster,\n setAccount,\n wallet,\n }),\n [accountKeys, cluster, setAccount, wallet, walletAccount],\n )}\n >\n {children}\n </WalletUiAccountContext.Provider>\n );\n}\n","import { useStore } from '@nanostores/react';\nimport { createStorageCluster, SolanaClusterId } from '@wallet-ui/core';\nimport React from 'react';\n\nimport {\n WalletUiClusterContext,\n WalletUiClusterContextProviderProps,\n WalletUiClusterContextValue,\n} from './wallet-ui-cluster-context';\n\nexport function WalletUiClusterContextProvider({\n clusters,\n render,\n storage = createStorageCluster(),\n}: WalletUiClusterContextProviderProps) {\n const clusterId = useStore(storage.value);\n\n if (!clusters.length) {\n throw new Error('No clusters provided');\n }\n\n const found = clusters.find(c => c.id === clusterId);\n const first = clusters[0];\n\n const value: WalletUiClusterContextValue = {\n cluster: found ?? first,\n clusters,\n setCluster: (clusterId: SolanaClusterId) => {\n const cluster = clusters.find(c => c.id === clusterId);\n if (!cluster) {\n throw new Error(`Cluster ${clusterId} not found`);\n }\n storage.set(clusterId);\n },\n };\n\n return <WalletUiClusterContext.Provider value={value}>{render(value)}</WalletUiClusterContext.Provider>;\n}\n","import { UiWalletAccount } from '@wallet-standard/react';\nimport { handleCopyText } from '@wallet-ui/core';\nimport React from 'react';\n\nimport { useWalletUiAccount } from './use-wallet-ui-account';\nimport { useWalletUiWallets } from './use-wallet-ui-wallets';\nimport { WalletUiContext, WalletUiContextProviderProps, WalletUiContextValue } from './wallet-ui-context';\n\nexport function WalletUiContextProvider({ children }: WalletUiContextProviderProps) {\n const { account, accountKeys, cluster, setAccount, wallet } = useWalletUiAccount();\n const wallets = useWalletUiWallets();\n const connected = Boolean(wallet && wallet?.accounts.length > 0);\n\n function connect(account: UiWalletAccount) {\n setAccount(account);\n }\n\n function disconnect() {\n setAccount(undefined);\n }\n\n function copy() {\n if (!account) {\n return;\n }\n handleCopyText(account.address);\n }\n\n const value: WalletUiContextValue = {\n account,\n accountKeys,\n cluster,\n connect,\n connected,\n copy,\n disconnect,\n wallet,\n wallets,\n };\n\n return <WalletUiContext.Provider value={value}>{children}</WalletUiContext.Provider>;\n}\n","import { SolanaCluster, StorageAccount, StorageCluster } from '@wallet-ui/core';\nimport React from 'react';\n\nimport { WalletUiAccountContextProvider } from './wallet-ui-account-context-provider';\nimport { WalletUiClusterContextProvider } from './wallet-ui-cluster-context-provider';\nimport { WalletUiContextProviderProps } from './wallet-ui-context';\nimport { WalletUiContextProvider } from './wallet-ui-context-provider';\n\nexport interface WalletUiConfig extends Omit<WalletUiContextProviderProps, 'children'> {\n accountStorage?: StorageAccount;\n clusterStorage?: StorageCluster;\n clusters: SolanaCluster[];\n}\n\nexport function createWalletUiConfig(props: WalletUiConfig): WalletUiConfig {\n return { ...props };\n}\n\nexport interface WalletUiProps {\n children: React.ReactNode;\n config: WalletUiConfig;\n}\n\nexport function WalletUi({ children, config: { accountStorage, clusters, clusterStorage, ...config } }: WalletUiProps) {\n return (\n <React.Fragment>\n <WalletUiClusterContextProvider\n clusters={clusters}\n storage={clusterStorage}\n render={({ cluster }) => {\n return (\n <WalletUiAccountContextProvider cluster={cluster} storage={accountStorage}>\n <WalletUiContextProvider {...config}>{children}</WalletUiContextProvider>\n </WalletUiAccountContextProvider>\n );\n }}\n />\n </React.Fragment>\n );\n}\n","import React from 'react';\n\nimport { BaseDropdown } from './base-dropdown';\nimport { useWalletUiDropdown } from './use-wallet-ui-dropdown';\n\nexport interface WalletUiDropdownProps {\n label?: string;\n}\n\nexport function WalletUiDropdown({ ...props }: WalletUiDropdownProps) {\n const { buttonProps, items, dropdown } = useWalletUiDropdown();\n return <BaseDropdown {...props} buttonProps={{ ...buttonProps }} dropdown={dropdown} items={items} />;\n}\n","import React from 'react';\n\nimport { useWalletUiAccount } from './use-wallet-ui-account';\nimport { WalletUiAccountInfo } from './wallet-ui-account-context';\nimport { WalletUiDropdown } from './wallet-ui-dropdown';\n\nexport interface WalletUiAccountGuardProps {\n fallback?: React.ReactNode;\n render: (info: WalletUiAccountInfo) => React.ReactNode;\n}\n\nexport function WalletUiAccountGuard({ fallback = <WalletUiDropdown />, render }: WalletUiAccountGuardProps) {\n const { account, accountKeys, cluster, wallet } = useWalletUiAccount();\n\n return account ? render({ account, accountKeys, cluster, wallet }) : fallback;\n}\n","import React from 'react';\n\nimport { BaseDropdown, BaseDropdownItemType, BaseDropdownProps } from './base-dropdown';\nimport { useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUiCluster } from './use-wallet-ui-cluster';\n\nexport interface WalletUiClusterDropdownProps\n extends Omit<BaseDropdownProps, 'buttonProps' | 'dropdown' | 'items' | 'label'> {\n buttonProps?: Partial<BaseDropdownProps['buttonProps']>;\n}\n\nexport function WalletUiClusterDropdown({ buttonProps, ...props }: WalletUiClusterDropdownProps) {\n const dropdown = useBaseDropdown();\n const { cluster, clusters, setCluster } = useWalletUiCluster();\n return (\n <BaseDropdown\n buttonProps={{ ...buttonProps, label: cluster.label }}\n items={clusters.map(cluster => ({\n handler: async () => {\n setCluster(cluster.id);\n await Promise.resolve();\n },\n label: cluster.label,\n type: BaseDropdownItemType.Item,\n value: cluster.id,\n }))}\n dropdown={dropdown}\n {...props}\n />\n );\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconNoWallet({ ...props }: Omit<BaseSvgProps, 'viewBox'>) {\n return (\n <BaseSvg fill=\"none\" height={100} width={100} viewBox=\"0 0 97 96\" {...props}>\n <circle cx=\"48.5\" cy=\"48\" r=\"48\" fill=\"url(#paint0_linear_880_5115)\" fillOpacity=\"0.1\"></circle>\n <circle\n cx=\"48.5\"\n cy=\"48\"\n r=\"47\"\n stroke=\"url(#paint1_linear_880_5115)\"\n strokeOpacity=\"0.4\"\n strokeWidth=\"2\"\n ></circle>\n <g clipPath=\"url(#clip0_880_5115)\">\n <path\n d=\"M65.5769 28.1523H31.4231C27.6057 28.1523 24.5 31.258 24.5 35.0754V60.9215C24.5 64.7389 27.6057 67.8446 31.4231 67.8446H65.5769C69.3943 67.8446 72.5 64.7389 72.5 60.9215V35.0754C72.5 31.258 69.3943 28.1523 65.5769 28.1523ZM69.7308 52.1523H59.5769C57.2865 52.1523 55.4231 50.289 55.4231 47.9985C55.4231 45.708 57.2864 43.8446 59.5769 43.8446H69.7308V52.1523ZM69.7308 41.0754H59.5769C55.7595 41.0754 52.6539 44.1811 52.6539 47.9985C52.6539 51.8159 55.7595 54.9215 59.5769 54.9215H69.7308V60.9215C69.7308 63.2119 67.8674 65.0754 65.5769 65.0754H31.4231C29.1327 65.0754 27.2692 63.212 27.2692 60.9215V35.0754C27.2692 32.785 29.1326 30.9215 31.4231 30.9215H65.5769C67.8673 30.9215 69.7308 32.7849 69.7308 35.0754V41.0754Z\"\n fill=\"url(#paint2_linear_880_5115)\"\n ></path>\n <path\n d=\"M61.4231 46.6172H59.577C58.8123 46.6172 58.1924 47.2371 58.1924 48.0018C58.1924 48.7665 58.8123 49.3863 59.577 49.3863H61.4231C62.1878 49.3863 62.8077 48.7664 62.8077 48.0018C62.8077 47.2371 62.1878 46.6172 61.4231 46.6172Z\"\n fill=\"url(#paint3_linear_880_5115)\"\n ></path>\n </g>\n <defs>\n <linearGradient\n id=\"paint0_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint1_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint2_linear_880_5115\"\n x1=\"25.9583\"\n y1=\"68.7101\"\n x2=\"67.2337\"\n y2=\"23.7879\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint3_linear_880_5115\"\n x1=\"58.3326\"\n y1=\"49.4467\"\n x2=\"61.0002\"\n y2=\"45.4453\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <clipPath id=\"clip0_880_5115\">\n <rect width=\"48\" height=\"48\" fill=\"white\" transform=\"translate(24.5 24)\"></rect>\n </clipPath>\n </defs>\n </BaseSvg>\n );\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nexport interface WalletUiLabelProps\n extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {\n wallet?: Pick<UiWallet, 'name'>;\n}\n\nexport function WalletUiLabel({ className, wallet, ...props }: WalletUiLabelProps) {\n if (!wallet) {\n return null;\n }\n\n return (\n <span data-wu=\"wallet-ui-label\" className={`${className ?? ''}`} {...props}>\n {wallet.name}\n </span>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiButton } from './types/wallet-ui-button';\nimport { WalletUiIcon } from './wallet-ui-icon';\nimport { WalletUiLabel } from './wallet-ui-label';\n\nexport interface WalletUiListButtonProps extends Omit<WalletUiButton, 'onClick'> {\n select?: (wallet: UiWalletAccount) => Promise<void>;\n wallet: UiWallet;\n}\n\nexport function WalletUiListButton({ className, select, wallet, ...props }: WalletUiListButtonProps) {\n const [pending, setPending] = React.useState(false);\n\n function handleSelect() {\n if (!select) {\n return;\n }\n setPending(true);\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n void select(account).finally(() => setPending(false));\n }\n\n return (\n <button\n disabled={pending}\n data-wu=\"wallet-ui-list-button\"\n className={`${pending ? 'pending' : ''} ${className ?? ''}`}\n onClick={handleSelect}\n {...props}\n >\n <WalletUiIcon wallet={wallet} />\n <WalletUiLabel wallet={wallet} />\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiDiv } from './types/wallet-ui-div';\nimport { WalletUiListButton } from './wallet-ui-list-button';\n\nexport interface WalletUiListProps extends WalletUiDiv {\n select?: (account: UiWalletAccount) => Promise<void>;\n wallets: UiWallet[];\n}\n\nexport function WalletUiList({ className, select, wallets, ...props }: WalletUiListProps) {\n return (\n <div data-wu=\"wallet-ui-list\" className={`${className ?? ''}`} {...props}>\n {wallets.map(wallet => (\n <WalletUiListButton key={wallet.name} select={select} wallet={wallet} />\n ))}\n </div>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { BaseModal, BaseModalProps } from './base-modal';\nimport { WalletUiList } from './wallet-ui-list';\n\nexport interface WalletUiModalProps extends Omit<BaseModalProps, 'children'> {\n select: (account: UiWalletAccount) => Promise<void>;\n wallets: UiWallet[];\n}\n\nexport function WalletUiModal({ wallets, select, ...props }: WalletUiModalProps) {\n return (\n <BaseModal description=\"Connect a wallet on Solana to continue\" {...props}>\n <WalletUiList wallets={wallets} select={select} />\n </BaseModal>\n );\n}\n","import React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseModalControl } from './use-base-modal';\n\nexport interface WalletUiModalTriggerProps extends Omit<BaseButtonProps, 'label'> {\n label?: string;\n modal: BaseModalControl;\n}\n\nexport function WalletUiModalTrigger({ label = 'Select Wallet', modal, ...props }: WalletUiModalTriggerProps) {\n return <BaseButton label={label} onClick={() => void modal.open()} {...props} />;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/base-button.tsx","../src/wallet-ui-context.tsx","../src/use-wallet-ui.tsx","../src/wallet-ui-account-context.tsx","../src/use-wallet-ui-account.tsx","../src/use-wallet-ui-wallet.tsx","../src/wallet-ui-icon.tsx","../src/base-dropdown.tsx","../src/base-svg.tsx","../src/wallet-ui-icon-close.tsx","../src/base-modal.tsx","../src/use-base-dropdown.tsx","../src/use-base-modal.tsx","../src/wallet-ui-cluster-context.tsx","../src/use-wallet-ui-cluster.tsx","../src/use-wallet-ui-dropdown.tsx","../src/use-wallet-ui-signer.tsx","../src/use-wallet-ui-wallets.tsx","../src/wallet-ui-account-context-provider.tsx","../src/wallet-ui-cluster-context-provider.tsx","../src/wallet-ui-context-provider.tsx","../src/wallet-ui.tsx","../src/wallet-ui-dropdown.tsx","../src/wallet-ui-account-guard.tsx","../src/wallet-ui-cluster-dropdown.tsx","../src/wallet-ui-icon-no-wallet.tsx","../src/wallet-ui-label.tsx","../src/wallet-ui-list-button.tsx","../src/wallet-ui-list.tsx","../src/wallet-ui-modal.tsx","../src/wallet-ui-modal-trigger.tsx"],"names":["React","connect","BaseDropdownItemType","useMachine","useId","normalizeProps","createContext","useContext","useMemo","useWallets","useEffect","useStore","clusterId","account","cluster"],"mappings":";;;;;;;;;;;;;;;AAWO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,KAAA,EAAO,aAAa,OAAA,EAAS,YAAA,EAAc,GAAG,KAAA,EAAM,EAAoB;AAC5G,EAAA,uBACIA,OAAA,CAAA,aAAA,CAAC,QAAA,EAAA,EAAO,SAAA,EAAQ,aAAA,EAAc,SAAA,EAAW,CAAA,EAAG,SAAA,IAAa,EAAE,CAAA,CAAA,EAAI,OAAA,EAAmB,GAAG,KAAA,EAAA,EAChF,WAAA,mBAAcA,OAAA,CAAA,aAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAQ,0BAAA,EAAA,EAA4B,WAAY,CAAA,GAAU,IAAA,EAC9E,KAAA,EACA,YAAA,mBAAeA,OAAA,CAAA,aAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAQ,2BAAA,EAAA,EAA6B,YAAa,CAAA,GAAU,IACtF,CAAA;AAER;ACKO,IAAM,eAAA,GAAkBA,OAAAA,CAAM,aAAA,CAAoC,EAA0B;;;ACpB5F,SAAS,WAAA,GAAc;AAC1B,EAAA,OAAOA,OAAAA,CAAM,WAAW,eAAe,CAAA;AAC3C;ACUO,IAAM,sBAAA,GAAyB,aAAA,CAAoC,EAA0B;;;ACZ7F,SAAS,kBAAA,GAAqB;AACjC,EAAA,OAAO,WAAW,sBAAsB,CAAA;AAC5C;;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qBAAqB,EAAE,KAAA,GAAQ,iBAAiB,KAAA,EAAO,GAAG,OAAM,EAA8B;AAC1G,EAAA,uBAAOA,OAAAA,CAAA,aAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAc,OAAA,EAAS,MAAM,KAAK,KAAA,CAAM,IAAA,EAAK,EAAI,GAAG,KAAA,EAAO,CAAA;AAClF","file":"index.browser.mjs","sourcesContent":["import React from 'react';\n\nimport { WalletUiButton } from './types/wallet-ui-button';\n\nexport interface BaseButtonProps extends Omit<WalletUiButton, 'children'> {\n label: React.ReactNode;\n leftSection?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n rightSection?: React.ReactNode;\n}\n\nexport function BaseButton({ className, label, leftSection, onClick, rightSection, ...props }: BaseButtonProps) {\n return (\n <button data-wu=\"base-button\" className={`${className ?? ''}`} onClick={onClick} {...props}>\n {leftSection ? <span data-wu=\"base-button-left-section\">{leftSection}</span> : null}\n {label}\n {rightSection ? <span data-wu=\"base-button-right-section\">{rightSection}</span> : null}\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport { SolanaCluster } from '@wallet-ui/core';\nimport React, { ReactNode } from 'react';\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n}\n\nexport interface WalletUiContextValue {\n account?: UiWalletAccount;\n accountKeys: string[];\n cluster: SolanaCluster;\n connect: (wallet: UiWalletAccount) => void;\n connected: boolean;\n copy: () => void;\n disconnect: () => void;\n wallet?: UiWallet;\n wallets: UiWallet[];\n}\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n}\n\nexport const WalletUiContext = React.createContext<WalletUiContextValue>({} as WalletUiContextValue);\n","import React from 'react';\n\nimport { WalletUiContext } from './wallet-ui-context';\n\nexport function useWalletUi() {\n return React.useContext(WalletUiContext);\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport { SolanaCluster } from '@wallet-ui/core';\nimport React, { createContext } from 'react';\n\nexport interface WalletUiAccountInfo {\n account: UiWalletAccount;\n accountKeys: string[];\n cluster: SolanaCluster;\n wallet: UiWallet | undefined;\n}\n\nexport interface WalletUiAccountState extends Omit<WalletUiAccountInfo, 'account'> {\n account: UiWalletAccount | undefined;\n setAccount: React.Dispatch<React.SetStateAction<UiWalletAccount | undefined>>;\n}\n\nexport const WalletUiAccountContext = createContext<WalletUiAccountState>({} as WalletUiAccountState);\n","import { useContext } from 'react';\n\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nexport function useWalletUiAccount() {\n return useContext(WalletUiAccountContext);\n}\n","import { UiWallet, useConnect, useDisconnect } from '@wallet-standard/react';\nimport { useEffect } from 'react';\n\nimport { useWalletUi } from './use-wallet-ui';\nimport { useWalletUiAccount } from './use-wallet-ui-account';\n\nexport function useWalletUiWallet({ wallet }: { wallet: UiWallet }) {\n const { connect: connectAccount } = useWalletUi();\n const { setAccount } = useWalletUiAccount();\n const [isConnecting, connect] = useConnect(wallet);\n const [isDisconnecting, disconnect] = useDisconnect(wallet);\n useEffect(() => {}, [isDisconnecting]);\n\n return {\n connect: async () => {\n const connectedAccount = await connect();\n if (!connectedAccount.length) {\n console.warn(`Connect to ${wallet.name} but there are no accounts.`);\n return connectedAccount;\n }\n // TODO: Support wallets with multiple accounts\n const first = connectedAccount[0];\n setAccount(first);\n connectAccount(first);\n return connectedAccount;\n },\n disconnect,\n isConnecting,\n isDisconnecting,\n };\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiImg } from './types/wallet-ui-img';\n\nexport interface WalletUiIconProps extends WalletUiImg {\n wallet?: Pick<UiWallet, 'icon' | 'name'>;\n}\n\nexport function WalletUiIcon({ className, wallet, ...props }: WalletUiIconProps) {\n if (!wallet) {\n return null;\n }\n\n return <img data-wu=\"wallet-ui-icon\" src={wallet.icon} alt={wallet.name} className={className ?? ''} {...props} />;\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React, { HTMLAttributes } from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseDropdownControl } from './use-base-dropdown';\nimport { useWalletUiWallet } from './use-wallet-ui-wallet';\nimport { WalletUiIcon } from './wallet-ui-icon';\n\nexport enum BaseDropdownItemType {\n Item = 'Item',\n WalletConnect = 'WalletConnect',\n WalletCopy = 'WalletCopy',\n WalletDisconnect = 'WalletDisconnect',\n WalletNeeded = 'WalletNeeded',\n}\n\nexport interface BaseDropdownItem {\n closeMenu?: boolean;\n disabled?: boolean;\n handler: () => Promise<void>;\n label: string;\n leftSection?: React.ReactNode;\n rightSection?: React.ReactNode;\n type: BaseDropdownItemType;\n value: string;\n wallet?: UiWallet;\n}\n\nexport interface BaseDropdownProps {\n buttonProps: BaseButtonProps;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n showIndicator?: boolean;\n}\n\nexport function BaseDropdown({ buttonProps, dropdown, items, showIndicator }: BaseDropdownProps) {\n const api = dropdown.api;\n const trigger = (\n <BaseButton\n {...api.getTriggerProps()}\n rightSection={\n showIndicator ? (\n <span {...api.getIndicatorProps()}>\n <BaseDropdownChevronDown />\n </span>\n ) : null\n }\n {...buttonProps}\n />\n );\n\n return (\n <div data-wu=\"base-dropdown\">\n {trigger}\n <div {...api.getPositionerProps()} data-wu=\"base-dropdown-wrapper\">\n <div {...api.getContentProps()} data-wu=\"base-dropdown-list\" data-part=\"content\">\n {items.map(item => {\n return (\n <BaseDropdownItem\n {...api.getItemProps({ value: item.value })}\n key={item.value}\n item={item}\n afterClick={() => {\n if (item.disabled) {\n return;\n }\n if (item.closeMenu !== false) {\n dropdown.close();\n }\n }}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nfunction BaseDropdownItem({ afterClick, item }: BaseDropdownItemRenderProps) {\n if (!item.wallet) {\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n }\n switch (item.type) {\n case BaseDropdownItemType.Item:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletConnect:\n return <BaseDropdownItemWalletConnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n case BaseDropdownItemType.WalletCopy:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletDisconnect:\n return <BaseDropdownItemWalletDisconnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n }\n}\n\nfunction BaseDropdownItemWalletConnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { connect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await connect();\n return await item.handler();\n },\n leftSection: wallet ? <WalletUiIcon wallet={wallet} /> : undefined,\n }}\n />\n );\n}\n\nfunction BaseDropdownItemWalletDisconnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { disconnect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await disconnect();\n return await item.handler();\n },\n }}\n />\n );\n}\n\ninterface BaseDropdownItemRenderProps {\n afterClick: () => void;\n item: BaseDropdownItem;\n}\n\nfunction BaseDropdownItemRender({ afterClick, item }: BaseDropdownItemRenderProps) {\n function onClick() {\n if (item.disabled) {\n return;\n }\n void item.handler().then(() => {\n afterClick();\n });\n }\n\n return (\n <button type=\"button\" data-wu=\"base-dropdown-item\" data-part=\"item\" onClick={onClick}>\n {item.leftSection ? <span data-wu=\"base-dropdown-item-left-section\">{item.leftSection}</span> : null}\n {item.label}\n {item.rightSection ? <span data-wu=\"base-dropdown-item-right-section\">{item.rightSection}</span> : null}\n </button>\n );\n}\n\nexport function BaseDropdownChevronDown(props: HTMLAttributes<SVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={12}\n height={12}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n","import React from 'react';\n\nexport interface BaseSvgProps extends React.DetailedHTMLProps<React.SVGProps<SVGSVGElement>, SVGSVGElement> {\n viewBox: string;\n}\n\nexport function BaseSvg({ ...props }: BaseSvgProps) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n {props.children}\n </svg>\n );\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconClose({ ...props }: Omit<BaseSvgProps, 'viewBox'>) {\n return (\n <BaseSvg\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n width={12}\n height={12}\n viewBox=\"0 0 14 14\"\n {...props}\n >\n <path d=\"M14 12.461 8.3 6.772l5.234-5.233L12.006 0 6.772 5.234 1.54 0 0 1.539l5.234 5.233L0 12.006l1.539 1.528L6.772 8.3l5.69 5.7L14 12.461z\"></path>\n </BaseSvg>\n );\n}\n","import { Portal } from '@zag-js/react';\nimport React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseModalControl } from './use-base-modal';\nimport { WalletUiIconClose } from './wallet-ui-icon-close';\n\nexport interface BaseModalProps {\n buttonLabel?: React.ReactNode;\n buttonProps?: Partial<BaseButtonProps>;\n children: React.ReactNode;\n description?: React.ReactNode;\n modal: BaseModalControl;\n title?: React.ReactNode;\n}\n\nexport function BaseModal({ modal, buttonLabel, buttonProps = {}, ...props }: BaseModalProps) {\n const api = modal.api;\n return (\n <>\n {buttonLabel ? <BaseButton label={buttonLabel} {...buttonProps} {...api.getTriggerProps()} /> : null}\n {api.open && (\n <Portal>\n <div {...api.getBackdropProps()} />\n <div {...api.getPositionerProps()}>\n <div {...api.getContentProps()}>\n <header>\n <button {...api.getCloseTriggerProps()}>\n <WalletUiIconClose />\n </button>\n </header>\n {props.description ? <p {...api.getDescriptionProps()}>{props.description}</p> : null}\n <main>{props.children}</main>\n </div>\n </div>\n </Portal>\n )}\n </>\n );\n}\n","import * as menu from '@zag-js/menu';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseDropdownApi = ReturnType<typeof menu.connect>;\n\nexport interface BaseDropdownControl {\n api: BaseDropdownApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseDropdown(): BaseDropdownControl {\n const service = useMachine(menu.machine, { id: useId() });\n const api = menu.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import * as dialog from '@zag-js/dialog';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseModalApi = ReturnType<typeof dialog.connect>;\n\nexport interface BaseModalControl {\n api: BaseModalApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseModal(): BaseModalControl {\n const service = useMachine(dialog.machine, { id: useId(), modal: true });\n const api = dialog.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import { SolanaCluster, SolanaClusterId, StorageCluster } from '@wallet-ui/core';\nimport { createContext, ReactNode } from 'react';\n\nexport interface WalletUiClusterContextProviderProps {\n clusters: SolanaCluster[];\n render: (props: WalletUiClusterContextValue) => ReactNode;\n storage?: StorageCluster;\n}\n\nexport interface WalletUiClusterContextValue {\n cluster: SolanaCluster;\n clusters: SolanaCluster[];\n\n setCluster(cluster: SolanaClusterId): void;\n}\n\nexport const WalletUiClusterContext = createContext<WalletUiClusterContextValue>({} as WalletUiClusterContextValue);\n","import { useContext } from 'react';\n\nimport { WalletUiClusterContext } from './wallet-ui-cluster-context';\n\nexport function useWalletUiCluster() {\n return useContext(WalletUiClusterContext);\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React, { useMemo } from 'react';\n\nimport { BaseButtonProps } from './base-button';\nimport { BaseDropdownItem, BaseDropdownItemType } from './base-dropdown';\nimport { BaseDropdownControl, useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUi } from './use-wallet-ui';\nimport { WalletUiIcon } from './wallet-ui-icon';\n\nfunction getDropdownItemsWallets({\n wallets,\n connect,\n}: {\n connect: (wallet: UiWalletAccount) => void;\n wallets: UiWallet[];\n}): BaseDropdownItem[] {\n return wallets.length\n ? wallets.map(wallet => ({\n handler: async () => {\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n connect(account);\n await Promise.resolve();\n },\n label: wallet.name,\n\n type: BaseDropdownItemType.WalletConnect,\n value: wallet.name,\n wallet,\n }))\n : [\n {\n handler: async () => {\n window.open('https://solana.com/solana-wallets', '_blank');\n await Promise.resolve();\n },\n label: \"You'll need a wallet on Solana to continue\",\n type: BaseDropdownItemType.WalletNeeded,\n value: 'no-wallets',\n },\n ];\n}\n\nexport function useWalletUiDropdown(): {\n buttonProps: BaseButtonProps;\n connected: boolean;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n} {\n const dropdown = useBaseDropdown();\n\n const { account, connect, copy, disconnect, connected, wallet, wallets } = useWalletUi();\n\n const itemsWallets = useMemo(() => getDropdownItemsWallets({ connect, wallets }), [wallets, connect]);\n\n const itemsConnected: BaseDropdownItem[] = useMemo(\n () => [\n {\n handler: async () => {\n copy();\n void (await Promise.resolve());\n },\n label: 'Copy Address',\n type: BaseDropdownItemType.WalletCopy,\n value: 'copy',\n },\n {\n handler: async () => {\n disconnect();\n dropdown.close();\n await Promise.resolve();\n },\n label: 'Disconnect',\n type: BaseDropdownItemType.WalletDisconnect,\n value: 'disconnect',\n wallet,\n },\n ...itemsWallets,\n ],\n [copy, disconnect, dropdown, wallet, itemsWallets],\n );\n const items = useMemo(() => {\n return connected ? itemsConnected : itemsWallets;\n }, [connected, itemsConnected, itemsWallets]);\n\n const buttonProps: BaseButtonProps = useMemo(() => {\n return {\n label: connected ? ((account ? ellipsify(account.address) : wallet?.name) ?? 'Connected') : 'Select Wallet',\n leftSection: connected ? <WalletUiIcon wallet={wallet} /> : undefined,\n };\n }, [account, connected, wallet]);\n\n return {\n buttonProps,\n connected,\n dropdown,\n items,\n };\n}\n\nexport function ellipsify(str = '', len = 4, delimiter = '..') {\n const strLen = str.length;\n const limit = len * 2 + delimiter.length;\n\n return strLen >= limit ? str.substring(0, len) + delimiter + str.substring(strLen - len, strLen) : str;\n}\n","import { useWalletAccountTransactionSendingSigner } from '@solana/react';\nimport { TransactionSendingSigner } from '@solana/signers';\nimport { UiWalletAccount } from '@wallet-standard/react';\n\nimport { useWalletUi } from './use-wallet-ui';\n\nexport function useWalletUiSigner({\n account,\n}: {\n account: UiWalletAccount;\n}): TransactionSendingSigner<UiWalletAccount['address']> {\n const { cluster } = useWalletUi();\n\n return useWalletAccountTransactionSendingSigner(account, cluster.id);\n}\n","import { useWallets } from '@wallet-standard/react';\nimport { useMemo } from 'react';\n\nexport function useWalletUiWallets() {\n const readonlyWallets = useWallets();\n return useMemo(\n () =>\n readonlyWallets\n .filter(wallet => wallet.chains.some(i => i.startsWith('solana:')))\n .sort((a, b) => a.name.localeCompare(b.name)),\n [readonlyWallets],\n );\n}\n","import { useStore } from '@nanostores/react';\nimport {\n getUiWalletAccountStorageKey,\n UiWallet,\n UiWalletAccount,\n uiWalletAccountBelongsToUiWallet,\n uiWalletAccountsAreSame,\n useWallets,\n} from '@wallet-standard/react';\nimport { createStorageAccount, SolanaCluster, StorageAccount } from '@wallet-ui/core';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nlet wasSetterInvoked = false;\n\nfunction getSavedWalletAccount(\n wallets: readonly UiWallet[],\n savedWalletNameAndAddress?: string,\n): UiWalletAccount | undefined {\n if (wasSetterInvoked) {\n // After the user makes an explicit choice of wallet, stop trying to auto-select the\n // saved wallet, if and when it appears.\n return;\n }\n if (!savedWalletNameAndAddress || typeof savedWalletNameAndAddress !== 'string') {\n return;\n }\n const [savedWalletName, savedAccountAddress] = savedWalletNameAndAddress.split(':');\n if (!savedWalletName || !savedAccountAddress) {\n return;\n }\n const wallet = wallets.find(w => w.name === savedWalletName);\n if (!wallet) {\n return;\n }\n return wallet.accounts.find(a => a.address === savedAccountAddress);\n}\n\nexport interface WalletUiAccountContextProviderProps {\n children: React.ReactNode;\n cluster: SolanaCluster;\n storage?: StorageAccount;\n}\n\n/**\n * Saves the selected wallet account's storage key to the browser's local storage. In future\n * sessions it will try to return that same wallet account, or at least one from the same brand of\n * wallet if the wallet from which it came is still in the Wallet Standard registry.\n */\nexport function WalletUiAccountContextProvider({ children, cluster, storage }: WalletUiAccountContextProviderProps) {\n storage = storage ?? createStorageAccount();\n const wallets = useWallets();\n const accountId = useStore(storage.value);\n const [account, setAccountInternal] = useState<UiWalletAccount | undefined>(() =>\n getSavedWalletAccount(wallets, accountId),\n );\n\n const setAccount = useCallback(\n (setStateAction: React.SetStateAction<UiWalletAccount | undefined>) => {\n setAccountInternal(prevAccount => {\n wasSetterInvoked = true;\n const nextWalletAccount =\n typeof setStateAction === 'function' ? setStateAction(prevAccount) : setStateAction;\n const accountKey = nextWalletAccount ? getUiWalletAccountStorageKey(nextWalletAccount) : undefined;\n storage.set(accountKey ? accountKey : undefined);\n return nextWalletAccount;\n });\n },\n [storage],\n );\n\n useEffect(() => {\n const savedWalletAccount = getSavedWalletAccount(wallets, accountId);\n if (savedWalletAccount) {\n setAccountInternal(savedWalletAccount);\n }\n }, [accountId, wallets]);\n const walletAccount = useMemo(() => {\n if (account) {\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(account, uiWalletAccount)) {\n return uiWalletAccount;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(account, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet.accounts[0];\n }\n }\n }\n }, [account, wallets]);\n useEffect(() => {\n // If there is a selected wallet account but the wallet to which it belongs has since\n // disconnected, clear the selected wallet.\n if (account && !walletAccount) {\n setAccountInternal(undefined);\n }\n }, [account, walletAccount]);\n\n const wallet = useMemo(() => {\n if (!walletAccount) {\n return undefined;\n }\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(walletAccount, uiWalletAccount)) {\n return uiWallet;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(walletAccount, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet;\n }\n }\n }, [walletAccount, wallets]);\n\n // Expose the error boundary reset keys to the context\n const accountKeys = useMemo(() => {\n if (!walletAccount) {\n return [];\n }\n return [cluster.id, getUiWalletAccountStorageKey(walletAccount)].filter(Boolean);\n }, [walletAccount, cluster.id]);\n\n return (\n <WalletUiAccountContext.Provider\n value={useMemo(\n () => ({\n account: walletAccount,\n accountKeys,\n cluster,\n setAccount,\n wallet,\n }),\n [accountKeys, cluster, setAccount, wallet, walletAccount],\n )}\n >\n {children}\n </WalletUiAccountContext.Provider>\n );\n}\n","import { useStore } from '@nanostores/react';\nimport { createStorageCluster, SolanaClusterId } from '@wallet-ui/core';\nimport React, { useMemo } from 'react';\n\nimport {\n WalletUiClusterContext,\n WalletUiClusterContextProviderProps,\n WalletUiClusterContextValue,\n} from './wallet-ui-cluster-context';\n\nexport function WalletUiClusterContextProvider({ clusters, render, storage }: WalletUiClusterContextProviderProps) {\n storage = storage ?? createStorageCluster();\n const clusterId = useStore(storage.value);\n\n if (!clusters.length) {\n throw new Error('No clusters provided');\n }\n\n const found = clusters.find(c => c.id === clusterId);\n const first = clusters[0];\n\n const value: WalletUiClusterContextValue = useMemo(\n () => ({\n cluster: found ?? first,\n clusters,\n setCluster: (clusterId: SolanaClusterId) => {\n const cluster = clusters.find(c => c.id === clusterId);\n if (!cluster) {\n throw new Error(`Cluster ${clusterId} not found`);\n }\n storage.set(clusterId);\n },\n }),\n [clusters, first, found, storage],\n );\n\n return <WalletUiClusterContext.Provider value={value}>{render(value)}</WalletUiClusterContext.Provider>;\n}\n","import { UiWalletAccount } from '@wallet-standard/react';\nimport { handleCopyText } from '@wallet-ui/core';\nimport React, { useMemo } from 'react';\n\nimport { useWalletUiAccount } from './use-wallet-ui-account';\nimport { useWalletUiWallets } from './use-wallet-ui-wallets';\nimport { WalletUiContext, WalletUiContextProviderProps, WalletUiContextValue } from './wallet-ui-context';\n\nexport function WalletUiContextProvider({ children }: WalletUiContextProviderProps) {\n const { account, accountKeys, cluster, setAccount, wallet } = useWalletUiAccount();\n const wallets = useWalletUiWallets();\n const connected = Boolean(wallet && wallet?.accounts.length > 0);\n\n const value: WalletUiContextValue = useMemo(\n () => ({\n account,\n accountKeys,\n cluster,\n connect: (account: UiWalletAccount) => setAccount(account),\n connected,\n copy: () => {\n if (!account) {\n return;\n }\n handleCopyText(account.address);\n },\n disconnect: () => setAccount(undefined),\n wallet,\n wallets,\n }),\n [account, accountKeys, cluster, setAccount, connected, wallet, wallets],\n );\n\n return <WalletUiContext.Provider value={value}>{children}</WalletUiContext.Provider>;\n}\n","import { SolanaCluster, StorageAccount, StorageCluster } from '@wallet-ui/core';\nimport React from 'react';\n\nimport { WalletUiAccountContextProvider } from './wallet-ui-account-context-provider';\nimport { WalletUiClusterContextProvider } from './wallet-ui-cluster-context-provider';\nimport { WalletUiContextProviderProps } from './wallet-ui-context';\nimport { WalletUiContextProvider } from './wallet-ui-context-provider';\n\nexport interface WalletUiConfig extends Omit<WalletUiContextProviderProps, 'children'> {\n accountStorage?: StorageAccount;\n clusterStorage?: StorageCluster;\n clusters: SolanaCluster[];\n}\n\nexport function createWalletUiConfig(props: WalletUiConfig): WalletUiConfig {\n return { ...props };\n}\n\nexport interface WalletUiProps {\n children: React.ReactNode;\n config: WalletUiConfig;\n}\n\nexport function WalletUi({ children, config: { accountStorage, clusters, clusterStorage, ...config } }: WalletUiProps) {\n return (\n <WalletUiClusterContextProvider\n clusters={clusters}\n storage={clusterStorage}\n render={({ cluster }) => {\n return (\n <WalletUiAccountContextProvider cluster={cluster} storage={accountStorage}>\n <WalletUiContextProvider {...config}>{children}</WalletUiContextProvider>\n </WalletUiAccountContextProvider>\n );\n }}\n />\n );\n}\n","import React from 'react';\n\nimport { BaseDropdown } from './base-dropdown';\nimport { useWalletUiDropdown } from './use-wallet-ui-dropdown';\n\nexport interface WalletUiDropdownProps {\n label?: string;\n}\n\nexport function WalletUiDropdown({ ...props }: WalletUiDropdownProps) {\n const { buttonProps, items, dropdown } = useWalletUiDropdown();\n return <BaseDropdown {...props} buttonProps={{ ...buttonProps }} dropdown={dropdown} items={items} />;\n}\n","import React from 'react';\n\nimport { useWalletUiAccount } from './use-wallet-ui-account';\nimport { WalletUiAccountInfo } from './wallet-ui-account-context';\nimport { WalletUiDropdown } from './wallet-ui-dropdown';\n\nexport interface WalletUiAccountGuardProps {\n fallback?: React.ReactNode;\n render: (info: WalletUiAccountInfo) => React.ReactNode;\n}\n\nexport function WalletUiAccountGuard({ fallback = <WalletUiDropdown />, render }: WalletUiAccountGuardProps) {\n const { account, accountKeys, cluster, wallet } = useWalletUiAccount();\n\n return account ? render({ account, accountKeys, cluster, wallet }) : fallback;\n}\n","import React from 'react';\n\nimport { BaseDropdown, BaseDropdownItemType, BaseDropdownProps } from './base-dropdown';\nimport { useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUiCluster } from './use-wallet-ui-cluster';\n\nexport interface WalletUiClusterDropdownProps\n extends Omit<BaseDropdownProps, 'buttonProps' | 'dropdown' | 'items' | 'label'> {\n buttonProps?: Partial<BaseDropdownProps['buttonProps']>;\n}\n\nexport function WalletUiClusterDropdown({ buttonProps, ...props }: WalletUiClusterDropdownProps) {\n const dropdown = useBaseDropdown();\n const { cluster, clusters, setCluster } = useWalletUiCluster();\n return (\n <BaseDropdown\n buttonProps={{ ...buttonProps, label: cluster.label }}\n items={clusters.map(cluster => ({\n handler: async () => {\n setCluster(cluster.id);\n await Promise.resolve();\n },\n label: cluster.label,\n type: BaseDropdownItemType.Item,\n value: cluster.id,\n }))}\n dropdown={dropdown}\n {...props}\n />\n );\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconNoWallet({ ...props }: Omit<BaseSvgProps, 'viewBox'>) {\n return (\n <BaseSvg fill=\"none\" height={100} width={100} viewBox=\"0 0 97 96\" {...props}>\n <circle cx=\"48.5\" cy=\"48\" r=\"48\" fill=\"url(#paint0_linear_880_5115)\" fillOpacity=\"0.1\"></circle>\n <circle\n cx=\"48.5\"\n cy=\"48\"\n r=\"47\"\n stroke=\"url(#paint1_linear_880_5115)\"\n strokeOpacity=\"0.4\"\n strokeWidth=\"2\"\n ></circle>\n <g clipPath=\"url(#clip0_880_5115)\">\n <path\n d=\"M65.5769 28.1523H31.4231C27.6057 28.1523 24.5 31.258 24.5 35.0754V60.9215C24.5 64.7389 27.6057 67.8446 31.4231 67.8446H65.5769C69.3943 67.8446 72.5 64.7389 72.5 60.9215V35.0754C72.5 31.258 69.3943 28.1523 65.5769 28.1523ZM69.7308 52.1523H59.5769C57.2865 52.1523 55.4231 50.289 55.4231 47.9985C55.4231 45.708 57.2864 43.8446 59.5769 43.8446H69.7308V52.1523ZM69.7308 41.0754H59.5769C55.7595 41.0754 52.6539 44.1811 52.6539 47.9985C52.6539 51.8159 55.7595 54.9215 59.5769 54.9215H69.7308V60.9215C69.7308 63.2119 67.8674 65.0754 65.5769 65.0754H31.4231C29.1327 65.0754 27.2692 63.212 27.2692 60.9215V35.0754C27.2692 32.785 29.1326 30.9215 31.4231 30.9215H65.5769C67.8673 30.9215 69.7308 32.7849 69.7308 35.0754V41.0754Z\"\n fill=\"url(#paint2_linear_880_5115)\"\n ></path>\n <path\n d=\"M61.4231 46.6172H59.577C58.8123 46.6172 58.1924 47.2371 58.1924 48.0018C58.1924 48.7665 58.8123 49.3863 59.577 49.3863H61.4231C62.1878 49.3863 62.8077 48.7664 62.8077 48.0018C62.8077 47.2371 62.1878 46.6172 61.4231 46.6172Z\"\n fill=\"url(#paint3_linear_880_5115)\"\n ></path>\n </g>\n <defs>\n <linearGradient\n id=\"paint0_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint1_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint2_linear_880_5115\"\n x1=\"25.9583\"\n y1=\"68.7101\"\n x2=\"67.2337\"\n y2=\"23.7879\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint3_linear_880_5115\"\n x1=\"58.3326\"\n y1=\"49.4467\"\n x2=\"61.0002\"\n y2=\"45.4453\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <clipPath id=\"clip0_880_5115\">\n <rect width=\"48\" height=\"48\" fill=\"white\" transform=\"translate(24.5 24)\"></rect>\n </clipPath>\n </defs>\n </BaseSvg>\n );\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nexport interface WalletUiLabelProps\n extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {\n wallet?: Pick<UiWallet, 'name'>;\n}\n\nexport function WalletUiLabel({ className, wallet, ...props }: WalletUiLabelProps) {\n if (!wallet) {\n return null;\n }\n\n return (\n <span data-wu=\"wallet-ui-label\" className={`${className ?? ''}`} {...props}>\n {wallet.name}\n </span>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiButton } from './types/wallet-ui-button';\nimport { WalletUiIcon } from './wallet-ui-icon';\nimport { WalletUiLabel } from './wallet-ui-label';\n\nexport interface WalletUiListButtonProps extends Omit<WalletUiButton, 'onClick'> {\n select?: (wallet: UiWalletAccount) => Promise<void>;\n wallet: UiWallet;\n}\n\nexport function WalletUiListButton({ className, select, wallet, ...props }: WalletUiListButtonProps) {\n const [pending, setPending] = React.useState(false);\n\n function handleSelect() {\n if (!select) {\n return;\n }\n setPending(true);\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n void select(account).finally(() => setPending(false));\n }\n\n return (\n <button\n disabled={pending}\n data-wu=\"wallet-ui-list-button\"\n className={`${pending ? 'pending' : ''} ${className ?? ''}`}\n onClick={handleSelect}\n {...props}\n >\n <WalletUiIcon wallet={wallet} />\n <WalletUiLabel wallet={wallet} />\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiDiv } from './types/wallet-ui-div';\nimport { WalletUiListButton } from './wallet-ui-list-button';\n\nexport interface WalletUiListProps extends WalletUiDiv {\n select?: (account: UiWalletAccount) => Promise<void>;\n wallets: UiWallet[];\n}\n\nexport function WalletUiList({ className, select, wallets, ...props }: WalletUiListProps) {\n return (\n <div data-wu=\"wallet-ui-list\" className={`${className ?? ''}`} {...props}>\n {wallets.map(wallet => (\n <WalletUiListButton key={wallet.name} select={select} wallet={wallet} />\n ))}\n </div>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { BaseModal, BaseModalProps } from './base-modal';\nimport { WalletUiList } from './wallet-ui-list';\n\nexport interface WalletUiModalProps extends Omit<BaseModalProps, 'children'> {\n select: (account: UiWalletAccount) => Promise<void>;\n wallets: UiWallet[];\n}\n\nexport function WalletUiModal({ wallets, select, ...props }: WalletUiModalProps) {\n return (\n <BaseModal description=\"Connect a wallet on Solana to continue\" {...props}>\n <WalletUiList wallets={wallets} select={select} />\n </BaseModal>\n );\n}\n","import React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseModalControl } from './use-base-modal';\n\nexport interface WalletUiModalTriggerProps extends Omit<BaseButtonProps, 'label'> {\n label?: string;\n modal: BaseModalControl;\n}\n\nexport function WalletUiModalTrigger({ label = 'Select Wallet', modal, ...props }: WalletUiModalTriggerProps) {\n return <BaseButton label={label} onClick={() => void modal.open()} {...props} />;\n}\n"]}
|
package/dist/index.native.mjs
CHANGED
|
@@ -345,11 +345,8 @@ function getSavedWalletAccount(wallets, savedWalletNameAndAddress) {
|
|
|
345
345
|
}
|
|
346
346
|
return wallet.accounts.find((a) => a.address === savedAccountAddress);
|
|
347
347
|
}
|
|
348
|
-
function WalletUiAccountContextProvider({
|
|
349
|
-
|
|
350
|
-
cluster,
|
|
351
|
-
storage = createStorageAccount()
|
|
352
|
-
}) {
|
|
348
|
+
function WalletUiAccountContextProvider({ children, cluster, storage }) {
|
|
349
|
+
storage = storage ?? createStorageAccount();
|
|
353
350
|
const wallets = useWallets();
|
|
354
351
|
const accountId = useStore(storage.value);
|
|
355
352
|
const [account, setAccountInternal] = useState(
|
|
@@ -430,57 +427,53 @@ function WalletUiAccountContextProvider({
|
|
|
430
427
|
children
|
|
431
428
|
);
|
|
432
429
|
}
|
|
433
|
-
function WalletUiClusterContextProvider({
|
|
434
|
-
|
|
435
|
-
render,
|
|
436
|
-
storage = createStorageCluster()
|
|
437
|
-
}) {
|
|
430
|
+
function WalletUiClusterContextProvider({ clusters, render, storage }) {
|
|
431
|
+
storage = storage ?? createStorageCluster();
|
|
438
432
|
const clusterId = useStore(storage.value);
|
|
439
433
|
if (!clusters.length) {
|
|
440
434
|
throw new Error("No clusters provided");
|
|
441
435
|
}
|
|
442
436
|
const found = clusters.find((c) => c.id === clusterId);
|
|
443
437
|
const first = clusters[0];
|
|
444
|
-
const value =
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
438
|
+
const value = useMemo(
|
|
439
|
+
() => ({
|
|
440
|
+
cluster: found ?? first,
|
|
441
|
+
clusters,
|
|
442
|
+
setCluster: (clusterId2) => {
|
|
443
|
+
const cluster = clusters.find((c) => c.id === clusterId2);
|
|
444
|
+
if (!cluster) {
|
|
445
|
+
throw new Error(`Cluster ${clusterId2} not found`);
|
|
446
|
+
}
|
|
447
|
+
storage.set(clusterId2);
|
|
451
448
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
449
|
+
}),
|
|
450
|
+
[clusters, first, found, storage]
|
|
451
|
+
);
|
|
455
452
|
return /* @__PURE__ */ React18.createElement(WalletUiClusterContext.Provider, { value }, render(value));
|
|
456
453
|
}
|
|
457
454
|
function WalletUiContextProvider({ children }) {
|
|
458
455
|
const { account, accountKeys, cluster, setAccount, wallet } = useWalletUiAccount();
|
|
459
456
|
const wallets = useWalletUiWallets();
|
|
460
457
|
const connected = Boolean(wallet && wallet?.accounts.length > 0);
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
connected,
|
|
479
|
-
|
|
480
|
-
disconnect,
|
|
481
|
-
wallet,
|
|
482
|
-
wallets
|
|
483
|
-
};
|
|
458
|
+
const value = useMemo(
|
|
459
|
+
() => ({
|
|
460
|
+
account,
|
|
461
|
+
accountKeys,
|
|
462
|
+
cluster,
|
|
463
|
+
connect: (account2) => setAccount(account2),
|
|
464
|
+
connected,
|
|
465
|
+
copy: () => {
|
|
466
|
+
if (!account) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
handleCopyText(account.address);
|
|
470
|
+
},
|
|
471
|
+
disconnect: () => setAccount(void 0),
|
|
472
|
+
wallet,
|
|
473
|
+
wallets
|
|
474
|
+
}),
|
|
475
|
+
[account, accountKeys, cluster, setAccount, connected, wallet, wallets]
|
|
476
|
+
);
|
|
484
477
|
return /* @__PURE__ */ React18.createElement(WalletUiContext.Provider, { value }, children);
|
|
485
478
|
}
|
|
486
479
|
|
|
@@ -489,7 +482,7 @@ function createWalletUiConfig(props) {
|
|
|
489
482
|
return { ...props };
|
|
490
483
|
}
|
|
491
484
|
function WalletUi({ children, config: { accountStorage, clusters, clusterStorage, ...config } }) {
|
|
492
|
-
return /* @__PURE__ */ React18.createElement(
|
|
485
|
+
return /* @__PURE__ */ React18.createElement(
|
|
493
486
|
WalletUiClusterContextProvider,
|
|
494
487
|
{
|
|
495
488
|
clusters,
|
|
@@ -498,7 +491,7 @@ function WalletUi({ children, config: { accountStorage, clusters, clusterStorage
|
|
|
498
491
|
return /* @__PURE__ */ React18.createElement(WalletUiAccountContextProvider, { cluster, storage: accountStorage }, /* @__PURE__ */ React18.createElement(WalletUiContextProvider, { ...config }, children));
|
|
499
492
|
}
|
|
500
493
|
}
|
|
501
|
-
)
|
|
494
|
+
);
|
|
502
495
|
}
|
|
503
496
|
function WalletUiDropdown({ ...props }) {
|
|
504
497
|
const { buttonProps, items, dropdown } = useWalletUiDropdown();
|