diff --git a/packages/payload/packages/xns/plugins/record/src/Hash/Payload.ts b/packages/payload/packages/xns/plugins/record/src/Hash/Payload.ts new file mode 100644 index 000000000..4e64f9959 --- /dev/null +++ b/packages/payload/packages/xns/plugins/record/src/Hash/Payload.ts @@ -0,0 +1,23 @@ +import type { Hash } from '@xylabs/hex' +import type { Payload, WithMeta } from '@xyo-network/payload-model' +import { isPayloadOfSchemaType } from '@xyo-network/payload-model' + +import type { DomainFields } from '../Domain/index.ts' + +export type HashRecordSchema = 'network.xyo.ns.record.hash' +export const HashRecordSchema: HashRecordSchema = 'network.xyo.ns.record.hash' + +export interface HashRecordFields extends DomainFields { + /** + * The hash the record points to + */ + hash: Hash[] +} + +/** + * An hash record points a domain to an hash + */ +export type HashRecord = Payload + +export const isHashRecord = isPayloadOfSchemaType(HashRecordSchema) +export const isHashRecordWithMeta = isPayloadOfSchemaType>(HashRecordSchema) diff --git a/packages/payload/packages/xns/plugins/record/src/Hash/index.ts b/packages/payload/packages/xns/plugins/record/src/Hash/index.ts new file mode 100644 index 000000000..de1113db1 --- /dev/null +++ b/packages/payload/packages/xns/plugins/record/src/Hash/index.ts @@ -0,0 +1 @@ +export * from './Payload.ts' diff --git a/packages/payload/packages/xns/plugins/record/src/index.ts b/packages/payload/packages/xns/plugins/record/src/index.ts index 64b286c29..b7bc834dc 100644 --- a/packages/payload/packages/xns/plugins/record/src/index.ts +++ b/packages/payload/packages/xns/plugins/record/src/index.ts @@ -4,3 +4,4 @@ export * from './DNS/index.ts' export * from './Domain/index.ts' export * from './DomainRegistration/index.ts' export * from './Duration/index.ts' +export * from './Hash/index.ts'