Files
xo-stack/packages/stack/src/bcmr/bcmr-helpers.ts
T

24 lines
694 B
TypeScript

import { z } from 'zod/v4';
export const MetadataRegistrySchema = z
.object({
name: z.string(),
description: z.string().optional(),
uris: z
.object({
// 'icon' and 'web' are strongly recommended uri identifiers(https://github.com/bitjson/chip-bcmr?tab=readme-ov-file#recommended-uri-identifiers)
icon: z.url(),
web: z.url().optional(),
})
// Allows any other keys with any values.
.catchall(z.unknown()),
token: z.object({
symbol: z.string(),
category: z.string(),
decimals: z.number().optional(),
}),
})
.catchall(z.unknown());
export type MetadataRegistry = z.infer<typeof MetadataRegistrySchema>;