SDK Types & Enums
This page documents all types, interfaces, and enums exported by the DogeOS SDK. For hooks and components, see Hooks & Components.
Table of Contents
- Configuration Types
- Hook Return Types
- Connection Types
- Chain Types
- Wallet Types
- Function Parameter Types
- Enums
- Type Relationships
- Quick Reference
Configuration Types
WalletConnectKitConfig
Main configuration interface for initializing the SDK.
interface WalletConnectKitConfig { clientId?: string connectors?: WalletConfig[] chains?: Partial<Record<ChainType, EvmChain[] | any[]>> walletConnectConfig?: WalletConnectConfig}Fields:
| Field | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | SDK identifier from sdk.dogeos.com/register |
connectors | WalletConfig[] | No | Custom wallet configurations |
chains | Record<ChainType, Chain[]> | No | Supported chains by type |
walletConnectConfig | WalletConnectConfig | No | WalletConnect v2 settings |
Used in: WalletConnectProvider
Example:
import { type WalletConnectKitConfig } from "@dogeos/dogeos-sdk"import { mainnet, base } from "viem/chains"
const config: WalletConnectKitConfig = { clientId: "YOUR_CLIENT_ID", chains: { evm: [mainnet, base], },}WalletConnectConfig
WalletConnect v2 protocol configuration.
type WalletConnectConfig = { projectId: string metadata: { name: string description: string url: string icons: string[] } relayUrl?: string}Used in: WalletConnectKitConfig.walletConnectConfig
See also: WalletConnect v2 docs
Hook Return Types
These interfaces describe the return values from SDK hooks. Use them for TypeScript type annotations when needed.
UseWalletConnectReturn
Return type for useWalletConnect() hook.
interface UseWalletConnectReturn { isOpenModal: boolean isConnected: boolean isConnecting: boolean error: string connect: (variables: ConnectVariables) => Promise<ConnectData> disconnect: () => Promise<void> openModal: () => void closeModal: () => void}Fields:
| Field | Type | Description |
|---|---|---|
isOpenModal | boolean | Whether the connection modal is visible |
isConnected | boolean | Whether a wallet is currently connected |
isConnecting | boolean | Whether a connection attempt is in progress |
error | string | Error message from last failed connection |
connect | function | Programmatically connect to a wallet |
disconnect | function | Disconnect the current wallet |
openModal | function | Open the connection modal |
closeModal | function | Close the connection modal |
Used in: useWalletConnect()
UseAccountReturn
Return type for useAccount() hook.
interface UseAccountReturn { address: string balance?: string chainType?: ChainType chainId?: string currentWallet?: Connector | null currentProvider?: any switchChain: (options: SwitchChainOptions) => Promise<boolean> signMessage?: (params: SignMessageParams) => Promise<string | Uint8Array> signInWithWallet: (params?: SignInParams) => Promise<string | Uint8Array>}Fields:
| Field | Type | Description |
|---|---|---|
address | string | Connected wallet address |
balance | string | undefined | Current balance (if available) |
chainType | ChainType | undefined | Active chain type (e.g., "evm") |
chainId | string | undefined | Active chain ID (hex string for EVM) |
currentWallet | Connector | null | Connected wallet metadata |
currentProvider | any | EIP-1193 compatible provider for EVM RPC calls |
switchChain | function | Switch to a different chain. Returns true on success |
signMessage | function | undefined | Sign a message. Returns signature as string or Uint8Array |
signInWithWallet | function | Sign-in with wallet (SIWE). Returns token/signature |
Used in: useAccount()
Note: Functions like signMessage may be undefined when no wallet is connected. Always check availability before calling.
UseEmbeddedWalletReturn
Return type for useEmbeddedWallet() hook.
interface UseEmbeddedWalletReturn { wallet: any | undefined isAvailable: boolean message: string | null connectedInfo: ConnectData | undefined isLoading: boolean}Fields:
| Field | Type | Description |
|---|---|---|
wallet | any | undefined | Embedded wallet instance |
isAvailable | boolean | Whether embedded wallet is available |
message | string | null | Status or error message |
connectedInfo | ConnectData | undefined | Connection data when connected |
isLoading | boolean | Whether wallet is loading |
Used in: useEmbeddedWallet()
Connection Types
ConnectVariables
Parameters for the connect() function from useWalletConnect.
interface ConnectVariables { wallet: Connector chainType: ChainType chainId?: string}Fields:
| Field | Type | Required | Description |
|---|---|---|---|
wallet | Connector | Yes | Wallet connector instance |
chainType | ChainType | Yes | Chain type (e.g., "evm") |
chainId | string | No | Target chain ID (hex string for EVM) |
Used in: useWalletConnect().connect()
See also: Connector, ChainType
ConnectData
Return value from connect() and available in useEmbeddedWallet().connectedInfo.
interface ConnectData { address: string chainId: string chainType: ChainType}Fields:
| Field | Type | Description |
|---|---|---|
address | string | Connected wallet address |
chainId | string | Chain ID the wallet connected to |
chainType | ChainType | Type of chain connected |
Used in:
useWalletConnect().connect()- return valueuseEmbeddedWallet().connectedInfo
ConnectErrorType
Type alias for connection errors.
type ConnectErrorType = ErrorUsed in: Error handling for connection failures.
SwitchChainOptions
Parameters for the switchChain() function from useAccount.
type SwitchChainOptions = { chainType: ChainType chainInfo: Chain}Fields:
| Field | Type | Description |
|---|---|---|
chainType | ChainType | Target chain type (e.g., "evm") |
chainInfo | Chain | Chain configuration object |
Used in: useAccount().switchChain()
Note: switchChain() returns Promise<boolean> - true on success, false on failure.
Example:
import { useAccount } from "@dogeos/dogeos-sdk"import { base } from "viem/chains"
const { switchChain } = useAccount()
const success = await switchChain({ chainType: "evm", chainInfo: base,})Chain Types
Chain
Chain configuration object, compatible with viem’s Chain type.
type Chain = { id: number name: string nativeCurrency: { name: string symbol: string decimals: number } rpcUrls: { default: { http: string[] } } blockExplorers?: { default: { name: string url: string } } testnet?: boolean chainInfo?: ChainInfo}Used in:
Note: For EVM chains, import pre-configured chains from viem/chains:
import { mainnet, base, sepolia } from "viem/chains"See also: viem chains documentation
ChainInfo
Additional metadata for chain display in the SDK UI.
type ChainInfo = { icon: any name: string}Used in: Chain.chainInfo
ChainType
String literal type for supported chain families.
type ChainType = "evm" | "solana" | "aptos" | "dogecoin"Use string literals directly in your code:
// Correctconnect({ wallet, chainType: "evm" })
// Also works but unnecessaryconnect({ wallet, chainType: ChainTypeEnum.EVM })Wallet Types
Connector
Wallet connector instance containing provider information. From @tomo-inc/wallet-adaptor-base.
interface Connector { info: WalletInfo isInstalled?: boolean recommoned?: boolean providers: { evm?: ConnectorProvider solana?: ConnectorProvider aptos?: ConnectorProvider dogecoin?: ConnectorProvider }}
interface ConnectorProvider { provider: any protocol: ProviderProtocol}Fields:
| Field | Type | Description |
|---|---|---|
info | WalletInfo | Wallet metadata (name, icon, links) |
isInstalled | boolean | undefined | Whether wallet is installed |
recommoned | boolean | undefined | Whether wallet is recommended |
providers | object | Chain-specific provider instances |
Used in:
WalletInfo
Wallet metadata interface. Part of the Connector.
interface WalletInfo { uuid: string name: string sameNames?: string[] namespace?: string icon: string iconBackground?: string rdns?: string isWalletConnect?: boolean deeplink?: string mobile?: { getUri?: (uri: string) => string getDeeplink?: (dappUrl?: string, chainId?: number) => string | Promise<string> } links: { homepage?: string ios_install?: string android_install?: string chrome_install?: string mobile?: string qrCode?: string edge?: string firefox?: string opera?: string safari?: string macos?: string windows?: string linux?: string desktop?: string }}Used in: Connector.info
WalletConfig
Configuration type for custom wallet connectors. From @tomo-inc/wallet-adaptor-base.
type WalletConfig = { id: string name: string rdns?: string namespace?: string flag?: string solana?: { namespace?: string; flag?: string } aptos?: { namespace?: string; flag?: string } dogecoin?: { namespace?: string; flag?: string } icon: string iconAccent?: string iconBackground: string installed?: boolean mobileUserAgent?: string deeplink?: string downloadUrls?: { android?: string ios?: string mobile?: string qrCode?: string chrome?: string edge?: string firefox?: string opera?: string safari?: string browserExtension?: string macos?: string windows?: string linux?: string desktop?: string } mobile?: { getUri?: (uri: string) => string getDeeplink?: (dappUrl?: string, chainId?: number) => string | Promise<string> }}Used in: WalletConnectKitConfig.connectors
Note: WalletConfig is for SDK configuration, while WalletProvider (below) is runtime wallet info from useAccount().currentWallet.
WalletProvider
Runtime wallet information returned by the SDK.
interface WalletProvider { uuid: string name: string namespace?: string icon: string iconBackground?: string rdns?: string links: { homepage?: string ios_install?: string android_install?: string chrome_install?: string mobile?: string qrCode?: string edge?: string firefox?: string opera?: string safari?: string macos?: string windows?: string linux?: string desktop?: string }}Used in: Runtime wallet metadata
Function Parameter Types
SignMessageParams
Parameters for the signMessage() function from useAccount.
type SignMessageParams = { message: string nonce?: string}Fields:
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message to sign |
nonce | string | No | Optional nonce for replay protection |
Used in: useAccount().signMessage()
Example:
const { signMessage } = useAccount()
const signature = await signMessage?.({ message: "Welcome to DogeOS!", nonce: Math.random().toString(36).slice(2),})SignInParams
Parameters for the signInWithWallet() function. Follows the Sign-In with Ethereum (SIWE) format. From @tomo-inc/wallet-adaptor-base.
interface SignInParams { scheme?: "https" | "http" domain: string uri?: string chainId?: string address?: string statement: string version?: string nonce: string issuedAt?: string resources?: `https://${string}`[]}Fields:
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | App domain (e.g., window.location.host) |
statement | string | Yes | Human-readable statement |
nonce | string | Yes | Unique nonce for this request |
scheme | "https" | "http" | No | URI scheme |
uri | string | No | URI for the sign-in request |
chainId | string | No | Chain ID for the request |
address | string | No | Address to sign with |
version | string | No | SIWE version |
issuedAt | string | No | ISO timestamp |
resources | string[] | No | Resources the user is signing into |
Used in: useAccount().signInWithWallet()
See also: EIP-4361: Sign-In with Ethereum
Example:
const { signInWithWallet } = useAccount()
const token = await signInWithWallet({ domain: window.location.host, statement: "Sign in to DogeOS", nonce: Math.random().toString(36).slice(2), issuedAt: new Date().toISOString(),})Enums
ChainTypeEnum
Enum of supported chain types.
enum ChainTypeEnum { All = "all", EVM = "evm", Solana = "solana", Aptos = "aptos",}Note: Use string literals ("evm") instead of the enum in most cases. The ChainType alias excludes "all".
ModalView
Enum of modal/embedded wallet view states.
enum ModalView { Loading = "LOADING", Logged = "LOGGED", WalletList = "WALLET_LIST", WalletSearch = "WALLET_SEARCH", WalletSelectProviders = "WALLET_SELECT_PROVIDERS", WalletInstallGuide = "WALLET_INSTALL_GUIDE", Connecting = "CONNECTING", Error = "ERROR", Account = "ACCOUNT", SelectChains = "SELECT_CHAINS", ChangeNetwork = "CHANGE_NETWORK", SignInWallet = "SIGN_IN_WALLET", WalletConnect = "WALLET_CONNECT", UnsupportChain = "UNSUPPORT_CHAIN", SocialLogin = "SOCIAL_LOGIN", MyDogeSocialLogin = "MYDOGE_SOCIAL_LOGIN",}Used in: WalletConnectEmbed view prop
| View | Purpose |
|---|---|
Loading | Initial loading state |
Logged | Post-login landing |
WalletList | Wallet selection list |
WalletSearch | Wallet search UI |
WalletSelectProviders | Provider selection for a wallet |
WalletInstallGuide | Install instructions |
Connecting | Connection in progress |
Error | Error state |
Account | Connected account view |
SelectChains | Chain selection list |
ChangeNetwork | Network switch prompt |
SignInWallet | Sign-in with wallet flow |
WalletConnect | WalletConnect QR/session view |
UnsupportChain | Unsupported network state |
SocialLogin | Generic social login |
MyDogeSocialLogin | MyDoge social login |
ProdTypeEnum
Internal product variant identifier for the DogeOS ecosystem.
enum ProdTypeEnum { Tomo = "tomo", MyDoge = "mydoge", WLFI = "wlfi",}Note: This is an internal type. Most applications will not need to use this directly.
Type Relationships
Understanding how types connect helps you use the SDK effectively.
Hook Return Flow
useWalletConnect() └─ UseWalletConnectReturn ├─ connect(ConnectVariables) → Promise<ConnectData> │ └─ ConnectVariables { wallet: Connector, chainType, chainId? } ├─ disconnect() → Promise<void> ├─ openModal() / closeModal() └─ isOpenModal, isConnected, isConnecting, error
useAccount() └─ UseAccountReturn ├─ address, balance, chainType, chainId ├─ currentWallet: Connector ├─ currentProvider: EIP-1193 Provider ├─ switchChain(SwitchChainOptions) → Promise<boolean> │ └─ SwitchChainOptions { chainType, chainInfo: Chain } ├─ signMessage(SignMessageParams) → Promise<string | Uint8Array> └─ signInWithWallet(SignInParams) → Promise<string | Uint8Array>
useEmbeddedWallet() └─ UseEmbeddedWalletReturn ├─ wallet, isAvailable, isLoading ├─ message: string | null └─ connectedInfo: ConnectDataConfiguration to Runtime
WalletConnectKitConfig (configuration) ├─ clientId → SDK authentication ├─ connectors: WalletConfig[] → Available wallets ├─ chains: Record<ChainType, Chain[]> → Supported networks └─ walletConnectConfig → WalletConnect protocol
↓ (at runtime)
useAccount() returns: ├─ currentWallet: Connector (from connectors) └─ chainId, chainType (from chains)Quick Reference
Import Cheat Sheet
| What you need | Import statement |
|---|---|
| Configuration type | import type { WalletConnectKitConfig } from "@dogeos/dogeos-sdk" |
| Chain type | import type { Chain } from "@dogeos/dogeos-sdk" |
| Pre-defined chains | import { mainnet, base } from "viem/chains" |
| Modal view enum | import { ModalView } from "@dogeos/dogeos-sdk" |
| Connection types | import type { ConnectVariables, ConnectData } from "@dogeos/dogeos-sdk" |
Common Patterns
Basic configuration:
import type { WalletConnectKitConfig } from "@dogeos/dogeos-sdk"import { mainnet, base } from "viem/chains"
const config: WalletConnectKitConfig = { clientId: "YOUR_CLIENT_ID", chains: { evm: [mainnet, base] },}Programmatic connection:
const { connect } = useWalletConnect()
const data = await connect({ wallet: myConnector, chainType: "evm", chainId: "0x1",})console.log("Connected:", data.address)Sign a message:
const { signMessage } = useAccount()
const signature = await signMessage?.({ message: "Hello, DogeOS!", nonce: crypto.randomUUID(),})Switch chains:
import { base } from "viem/chains"
const { switchChain } = useAccount()
const success = await switchChain({ chainType: "evm", chainInfo: base,})EVM provider calls:
const { currentProvider, address } = useAccount()
if (currentProvider) { const balance = await currentProvider.request({ method: "eth_getBalance", params: [address, "latest"], })}