Skip to Content
SDKAPI ReferenceHooks, Components, and Helpers

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> }
PropTypeRequiredDescription
configWalletConnectKitConfigYesSDK configuration
childrenReact.ReactNodeYesReact 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 }} /> }
PropTypeRequiredDescription
classNamestringNoCSS class for the wrapper
styleReact.CSSPropertiesNoInline 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()
FieldTypeDescription
isOpenModalbooleanWhether the SDK modal is open
connectionStatusConnectionStatus"disconnected", "connecting", or "connected"
isConnectedbooleanWhether a wallet is connected
isConnectingbooleanWhether a connection attempt is active
isDisconnectedbooleanWhether no wallet is connected
errorstringLast connection/action error message
walletStatusWalletStatusEmbedded wallet lifecycle state
isWalletReadybooleanwalletStatus === "ready"
isWalletLoadingbooleanwalletStatus === "initializing"
connect(variables: ConnectVariables) => Promise<ConnectData>Advanced runtime connector flow
disconnect() => Promise<void>Disconnect active wallet
openModal() => voidOpen the SDK modal
closeModal() => voidClose 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()
FieldTypeDescription
addressstringConnected account address
balancestring | undefinedPlaceholder balance field
chainTypeChainType | undefinedActive chain family
chainIdstring | undefinedActive chain ID
currentWalletConnector | nullConnected wallet object
currentProviderWalletProvider | nullProvider 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()
FieldTypeDescription
connectorsConnectorProviders | nullCurrent wallet provider map
currentProviderWalletProvider | nullActive 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"