Interface NoteMetadata

interface NoteMetadata {
    attachments?: (NoteMetadataAttachmentBase<"address"> | NoteMetadataAttachmentBase<"content">)[];
    attributes?: {
        display_type?: "string" | "number" | "boolean" | "date";
        trait_type?: string;
        value: null | string | number | boolean;
    }[];
    content?: string;
    content_warning?: "nsfw" | "sensitive" | "spoiler";
    date_published?: string;
    external_urls?: string[];
    sources?: string[];
    tags?: string[];
    title?: string;
    type?: "character" | "note" | "linklist";
    variant?: "achievement";
}

Hierarchy (view full)

Properties

attachments?: (NoteMetadataAttachmentBase<"address"> | NoteMetadataAttachmentBase<"content">)[]

The attachments of this note.

attributes?: {
    display_type?: "string" | "number" | "boolean" | "date";
    trait_type?: string;
    value: null | string | number | boolean;
}[]

Custom attributes.

Type declaration

  • Optional display_type?: "string" | "number" | "boolean" | "date"
  • Optional trait_type?: string
  • value: null | string | number | boolean

Example

[{ value: "post", trait_type: "type" }, { value: "https://example.com", trait_type: "URL" }, { value: 1546360800, trait_type: 'Birthday', "display_type": "date" }]
content?: string

The (markdown) content of this note.

Example

'# Hello World\n\nThis is a markdown note.'
content_warning?: "nsfw" | "sensitive" | "spoiler"

A content warning for this note. On the client side, this will be displayed as a warning.

Example

'nsfw'
date_published?: string

The date this content was published, following the ISO 8601 format.

Example case: a blog post was originally published on a website at time A, then was synced to the blockchain at time B. The date_published of the note is time A. The date of the blockchain sync is time B (shown as the createdAt field in the indexer's response).

Example

'2022-01-01T00:00:00Z'
external_urls?: string[]

Where this note was created. User can view this note on this location.

Example

['https://twitter.com/_Crossbell/status/1555900801058488322']
sources?: string[]

The source of this note. I.e. where it was originally created. For example, it could be your app's name so that you could filtering the notes by the source in your app.

Example

['xlog']
tags?: string[]

The tags of this note.

Example

['article', 'dairy']
title?: string

The title of this note.

type?: "character" | "note" | "linklist"
variant?: "achievement"

The variant of this note.

  • undefined: the normal note.
  • "achievement": the achievement variant.

Example

'achievement'

Generated using TypeDoc