-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54440d2
commit 6666973
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
packages/payload/packages/xns/plugins/record/src/Hash/Payload.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<HashRecordFields, HashRecordSchema> | ||
|
||
export const isHashRecord = isPayloadOfSchemaType<HashRecord>(HashRecordSchema) | ||
export const isHashRecordWithMeta = isPayloadOfSchemaType<WithMeta<HashRecord>>(HashRecordSchema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Payload.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters