@macalinao/zod-solana
Version:
Zod schemas for Solana types with @solana/kit integration
87 lines (86 loc) • 2.53 kB
TypeScript
import * as z from "zod";
//#region src/token-metadata-schema.d.ts
/**
* Interface for token metadata attributes/traits
*/
interface TokenMetadataAttribute {
/** The trait type/category */
trait_type: string;
/** The trait value (string or number) */
value: string | number;
/** Optional display type for UI formatting */
display_type?: string;
}
/**
* Interface for token metadata file references
*/
interface TokenMetadataFile {
/** File URI */
uri: string;
/** File MIME type */
type: string;
/** Whether the file is CDN cached */
cdn?: boolean;
}
/**
* Interface for token creator information with royalty shares
*/
interface TokenMetadataCreator {
/** Creator's wallet address */
address: string;
/** Creator's royalty share percentage (0-100) */
share: number;
}
/**
* Interface for token metadata properties
*/
interface TokenMetadataProperties {
/** Optional array of file references */
files?: TokenMetadataFile[];
/** Optional category classification */
category?: string;
/** Optional array of creators with royalty shares */
creators?: TokenMetadataCreator[];
}
/**
* Interface for token collection information
*/
interface TokenMetadataCollection {
/** Collection name */
name: string;
/** Optional collection family */
family?: string;
}
/**
* Interface for Solana token metadata following the Metaplex Token Metadata Standard
*/
interface TokenMetadata {
/** The name of the token */
name: string;
/** The symbol of the token */
symbol: string;
/** Optional description of the token */
description?: string;
/** Optional image URI */
image?: string;
/** Optional animation URL for multimedia content */
animation_url?: string;
/** Optional external URL for additional information */
external_url?: string;
/** Optional array of attributes/traits */
attributes?: TokenMetadataAttribute[];
/** Optional properties object */
properties?: TokenMetadataProperties;
/** Optional seller fee basis points (royalty percentage * 100) */
seller_fee_basis_points?: number;
/** Optional collection information */
collection?: TokenMetadataCollection;
}
/**
* Schema for Solana token metadata JSON
* Based on Metaplex Token Metadata Standard
*/
declare const tokenMetadataSchema: z.ZodType<TokenMetadata>;
//#endregion
export { TokenMetadata, TokenMetadataAttribute, TokenMetadataCollection, TokenMetadataCreator, TokenMetadataFile, TokenMetadataProperties, tokenMetadataSchema };
//# sourceMappingURL=token-metadata-schema.d.ts.map