Skip to main content

TypeAlias.Account

type Account = {
address: string;
application: string;
createdAt: string;
dpp: {
isActive: boolean;
lastActivityAt?: Date | null;
passportCount: number;
};
explorerUrl?: string;
id: string;
loyalty: {
fixedRewardTier: string | null;
optimisticBalance: string;
rewardTier?: | {
application: string;
bgImageUrl?: string | null;
createdAt: string;
currencyToPointRatio: number;
id: string;
name: string;
requiredVisits: number;
updatedAt: string;
}
| null;
visits: number;
zelty: {
customerId?: number | null;
};
};
network: | "EthereumAnvil"
| "BaseSepolia"
| "StarknetDevnet"
| "StarknetSepolia"
| "StarknetMainnet"
| "StellarQuickstart"
| "StellarTestnet"
| "StellarMainnet";
updatedAt: string;
user: {
birthDate?: string | null;
createdAt: string;
email: string;
emailVerified: boolean;
id: string;
image?: string | null;
name: string;
phoneNumber?: string | null;
phoneNumberVerified?: boolean | null;
preferredLocale?: "en-US" | "fr-FR" | "es-ES" | "it-IT" | null;
updatedAt: string;
};
};

Complete on-chain account information returned by the Keyban API.

Represents a customer account with blockchain address, loyalty program data, and user profile information. Each account is tied to a specific application and deployed on a blockchain network.

Type Declaration

NameTypeDefault value
addressstring-
applicationstring-
createdAtstring-
dpp{ isActive: boolean; lastActivityAt?: Datenull; passportCount: number; }
dpp.isActiveboolean-
dpp.lastActivityAt?Datenull
dpp.passportCountnumber-
explorerUrl?string-
idstring-
loyalty{ fixedRewardTier: stringnull; optimisticBalance: string; rewardTier?:
loyalty.fixedRewardTierstringnull
loyalty.optimisticBalancestring-
loyalty.rewardTier?{ application: string; bgImageUrl?: string
loyalty.visitsnumber-
loyalty.zelty{ customerId?: numbernull; }
loyalty.zelty.customerId?numbernull
network"EthereumAnvil"
updatedAtstring-
user{ birthDate?: stringnull; createdAt: string; email: string; emailVerified: boolean; id: string; image?: string
user.birthDate?stringnull
user.createdAtstring-
user.emailstring-
user.emailVerifiedboolean-
user.idstring-
user.image?stringnull
user.namestring-
user.phoneNumber?stringnull
user.phoneNumberVerified?booleannull
user.preferredLocale?"en-US""fr-FR"
user.updatedAtstring-

Example

const account: Account = {
id: "550e8400-e29b-41d4-a716-446655440000",
application: "app_123",
network: Network.BaseSepolia,
address: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
user: { email: "user@example.com", name: "John Doe", ... },
loyalty: { optimisticBalance: "1000", visits: 5, ... },
createdAt: "2024-01-01T00:00:00Z",
updatedAt: "2024-01-01T00:00:00Z"
};