Skip to content

Glyph Types Documentation

This document provides a comprehensive overview of all types defined in the Glyph library package.

Core Types

StrategyType

typescript
export enum StrategyType {
	PRIVY = "privy",
	EIP1193 = "eip1193",
}

An enum defining the available authentication strategies:

  • PRIVY: Uses Privy for authentication
  • EIP1193: Uses EIP-1193 compatible wallets for authentication

GlyphView

typescript
export enum GlyphView {
	CLOSED = "closed",
	OPEN = "open",
	MAIN = "main",
	FUND = "fund",
	SEND = "send",
	RECEIVE = "receive",
	PROFILE = "profile",
	HOME = "home",
	ACTIVITY = "activity",
	TOKENS = "tokens",
	NFTS = "nfts",
	LINKED_ACCOUNTS = "linked-accounts",
}

An enum defining the available views of the Glyph widget.

Learn more about the views in the useGlyphView section.

WalletClientType

typescript
export enum WalletClientType {
	RAINBOWKIT = "rainbowkit",
	CONNECTKIT = "connectkit",
	THIRDWEB = "thirdweb",
	WAGMI = "wagmi",
	DYNAMIC = "dynamic",
}

An enum defining the available wallet client types.

Learn more about the usage of the wallet client types in the GlyphProvider section.

GlyphInterface

typescript
export interface GlyphInterface {
	ready: boolean;
	authenticated: boolean;
	hideWidget?: boolean;
	user: GlyphWidgetUser | null;
	balances: GlyphWidgetBalances | null;
	nativeSymbol: string;
	signMessage: (params: { message: string }) => Promise<unknown>;
	sendTransaction: (params: {
		transaction: UnsignedTransactionRequest & { chainId: number };
	}) => Promise<string | { hash: Hex }>;
	login: () => void;
	logout: () => void;
	glyphUrl?: string;
}

The core interface for Glyph functionality, providing access to:

  • Authentication state
  • User data
  • Wallet balances
  • Transaction and message signing capabilities
  • Login/logout functionality

Data Types

GlyphWidgetUser

typescript
export type GlyphWidgetUser = {
	hasProfile: boolean;
	id: string;
	name: string;
	picture: string;
	evmWallet: string;
	smartWallet?: string;
	solanaWallet?: string;
	linkedWallets?: {
		address: string;
		walletClientType?: string;
	}[];
	currency: string;
	minFundingAmount: number;
	maxFundingAmount: number;
	country: string;
	subdivision?: string;
	cb_chain: string;
	cb_token: string;
	hasGoogle?: boolean;
	hasApple?: boolean;
	hasEmail?: boolean;
	hasTwitter?: boolean;
	isOnrampEnabled?: boolean;
	blockExplorerUrl?: string;
} | null;

Type representing a Glyph user's data.

GlyphWidgetTokenBalancesItem

typescript
export type GlyphWidgetTokenBalancesItem = {
	name: string;
	symbol: string;
	value: string;
	valueInWei: string;
	amount: string;
	currency: string;
	native: boolean;
	hide?: boolean;
	address: Hex;
	rateInCurrency: string;
	decimals: number;
	displayDecimals: number;
	priceChangePct: number;
};

Type representing a token balance item.

FundQuoteDTO

typescript
export type FundQuoteDTO = {
	id: string;
	in_amount: number;
	estimated_fees_amount: number;
	currency: string;
	out_tokens_amount: number;
	ape_to_currency: number;
	deposit_address: string;
	refresh_in_seconds: number;
	error?: string;
};

Type representing a funding quote from the Glyph API.

FundQuoteStatus

typescript
export type FundQuoteStatus = FundQuoteStatusOk | FundQuoteStatusError;

type FundQuoteStatusOk = {
	ok: true;
	status: FUND_STATUS_API;
	details: string;
};

type FundQuoteStatusError = {
	ok: false;
	status: null;
	details?: string;
};

Type representing the status of a funding quote.