This page documents the public runtime exports from @dogeos/dogeos-sdk.
Components
WalletConnectProvider
Initializes SDK context, embedded wallet state, wallet connector loading, WalletConnect configuration, the SDK modal, and optional Wagmi synchronization.
import { WalletConnectProvider } from "@dogeos/dogeos-sdk"
import "@dogeos/dogeos-sdk/style.css"
export function Providers({ children }: { children: React.ReactNode }) {
return <WalletConnectProvider config={{ clientId: "YOUR_DOGEOS_CLIENT_ID" }}>{children}</WalletConnectProvider>
}| Prop | Type | Required | Description |
|---|---|---|---|
config | WalletConnectKitConfig | Yes | SDK configuration |
children | React.ReactNode | Yes | React subtree to wrap |
The provider is browser-only. Use a client component in SSR frameworks.
WalletConnectEmbed
Renders the SDK wallet UI inline instead of as a modal overlay.
import { WalletConnectEmbed } from "@dogeos/dogeos-sdk"
export function WalletPanel() {
return <WalletConnectEmbed className="wallet-embed" style={{ maxWidth: 448 }} />
}| Prop | Type | Required | Description |
|---|---|---|---|
className | string | No | CSS class for the wrapper |
style | React.CSSProperties | No | Inline wrapper styles |
WalletConnectEmbed must render inside WalletConnectProvider. When connected, it renders the account view. Otherwise, it renders the current wallet modal view inline.
Hooks
useWalletConnect
Controls modal state, connection state, embedded-wallet readiness, connect, and disconnect.
import { useWalletConnect } from "@dogeos/dogeos-sdk"
const {
isOpenModal,
connectionStatus,
isConnected,
isConnecting,
isDisconnected,
error,
walletStatus,
isWalletReady,
isWalletLoading,
connect,
disconnect,
openModal,
closeModal,
} = useWalletConnect()| Field | Type | Description |
|---|---|---|
isOpenModal | boolean | Whether the SDK modal is open |
connectionStatus | ConnectionStatus | "disconnected", "connecting", or "connected" |
isConnected | boolean | Whether a wallet is connected |
isConnecting | boolean | Whether a connection attempt is active |
isDisconnected | boolean | Whether no wallet is connected |
error | string | Last connection/action error message |
walletStatus | WalletStatus | Embedded wallet lifecycle state |
isWalletReady | boolean | walletStatus === "ready" |
isWalletLoading | boolean | walletStatus === "initializing" |
connect | (variables: ConnectVariables) => Promise<ConnectData> | Advanced runtime connector flow |
disconnect | () => Promise<void> | Disconnect active wallet |
openModal | () => void | Open the SDK modal |
closeModal | () => void | Close the SDK modal |
import { useWalletConnect } from "@dogeos/dogeos-sdk"
export function ConnectButton() {
const { isConnected, isConnecting, openModal, disconnect } = useWalletConnect()
return (
<button disabled={isConnecting} onClick={isConnected ? disconnect : openModal}>
{isConnected ? "Disconnect" : "Connect wallet"}
</button>
)
}connect() expects a live WalletConnector. Do not pass WalletConfig objects returned from getConnectors().
useAccount
Returns active account state and account actions.
import { useAccount } from "@dogeos/dogeos-sdk"
const {
address,
balance,
chainType,
chainId,
currentWallet,
currentProvider,
switchChain,
signMessage,
signInWithWallet,
} = useAccount()| Field | Type | Description |
|---|---|---|
address | string | Connected account address |
balance | string | undefined | Placeholder balance field |
chainType | ChainType | undefined | Active chain family |
chainId | string | undefined | Active chain ID |
currentWallet | Connector | null | Connected wallet object |
currentProvider | WalletProvider | null | Provider for the active chain type |
switchChain | (options: SwitchChainOptions) => Promise<boolean> | Switch or add a chain |
signMessage | (params: { message: string; nonce?: string }) => Promise<string | Uint8Array> | Sign a message |
signInWithWallet | (params?: SignInParams) => Promise<string | Uint8Array> | Sign a wallet-auth payload |
import { useAccount } from "@dogeos/dogeos-sdk"
export function AccountAddress() {
const { address, chainType, chainId } = useAccount()
if (!address) return <span>Not connected</span>
return (
<span>
{address.slice(0, 6)}...{address.slice(-4)} on {chainType}:{chainId}
</span>
)
}signMessage() and signInWithWallet() throw if no wallet is connected.
useConnectors
Returns connector providers from the current wallet.
import { useConnectors } from "@dogeos/dogeos-sdk"
const { connectors, currentProvider } = useConnectors()| Field | Type | Description |
|---|---|---|
connectors | ConnectorProviders | null | Current wallet provider map |
currentProvider | WalletProvider | null | Active provider from useAccount() |
export function ConnectorFamilies() {
const { connectors } = useConnectors()
return (
<pre>
{JSON.stringify(
{
evm: Boolean(connectors?.evm),
dogecoin: Boolean(connectors?.dogecoin),
},
null,
2
)}
</pre>
)
}useEmbeddedWallet
Deprecated. This hook is still exported for backward compatibility, but embedded wallet state is now treated as internal. Use useWalletConnect() for readiness fields.
const { walletStatus, isWalletReady, isWalletLoading } = useWalletConnect()Helpers
getChains
Loads supported chains from the SDK chain API and falls back to built-in recommended chains.
import { getChains } from "@dogeos/dogeos-sdk"
const chains = await getChains()Signature:
function getChains(): Promise<Partial<Record<ChainType, EvmChain[] | Chain[]>>>The returned object can be passed to WalletConnectKitConfig.chains.
getConnectors
Loads wallet connector configuration through the SDK adapter layer.
import { getConnectors } from "@dogeos/dogeos-sdk"
const connectors = await getConnectors()Signature:
function getConnectors(): Promise<WalletConfig[]>The returned array can be passed to WalletConnectKitConfig.connectors. If loading fails, the function logs the error and returns [].
Constants and Types
ChainTypeEnum
Enum exported from the underlying wallet utilities.
import { ChainTypeEnum } from "@dogeos/dogeos-sdk"
connect({ wallet, chainType: ChainTypeEnum.EVM })String literals such as "evm" and "dogecoin" are usually simpler in app code.
WalletProvider
Type export from @tomo-inc/inject-providers. It describes runtime provider objects returned by the wallet adapter layer.
import type { WalletProvider } from "@dogeos/dogeos-sdk"Export Summary
import {
ChainTypeEnum,
WalletConnectEmbed,
WalletConnectProvider,
getChains,
getConnectors,
useAccount,
useConnectors,
useWalletConnect,
} from "@dogeos/dogeos-sdk"
import type {
Chain,
ChainType,
ConnectData,
ConnectVariables,
SignInParams,
WalletConnectKitConfig,
WalletProvider,
} from "@dogeos/dogeos-sdk"