Overview

MirrorEthereumPolygonBinance Smart ChainArbitrumFantomGnosisPOAPGitcoinCrossbellRSS3

Notes are the actions or events generated by accounts, such as writing a blog post, getting a NFT dynamic, donation to others, etc.

You can initialize with ipfsGateway to potentially get a faster response or higher stability.

API

Get

const notes: Notes = await unidata.notes.get(options: {
    source: string;
    identity?: string;
    platform?: string;
    limit?: number;
    cursor?: any;
    filter?: any;
});
  • identity: Ethereum address, Solana address, Flow address, etc.
  • platform: Platfrom of the identity. Ethereum, Solana, Flow, Crossbell, etc. Default to Ethereum.
  • limit: The number of assets to return. Since providers use different pagination schemes, there is no guarantee that the quantities are always accurate.
  • cursor: The pagination cursor returned from the previous page's results. Since providers use different pagination schemes, the type is uncertain.
  • filter: Varies depending on the source.

Set

Add, update or remove your notes.

const result: {
    code: number;
    message: string;
    data?: any;
} = await unidata.profiles.set(
    options: {
        source: string;
        identity: string;
        platform?: string;
        action?: string;
    },
    input: {
        related_urls?: string[];

        tags?: string[];
        authors: AccountInstanceURI[];
        title?: string;
        content_warning?: string;

        summary?: {
            content?: string;
            address?: URI;
            mime_type?: string;
            size_in_bytes?: number;
        };

        body?: {
            content?: string;
            address?: URI;
            mime_type?: string;
            size_in_bytes?: number;
        };

        attachments?: {
            name?: string;
            content?: string;
            address?: URI;
            mime_type?: string;
            size_in_bytes?: number;
            alt?: string;
            width?: number;
            height?: number;
        }[];

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

Specification

All returned data conform to the following specification.

type Notes = {
    total: number;
    cursor?: any;

    list: {
        id?: string;

        date_created: string;
        date_updated: string;
        date_published: string;

        related_urls?: string[];

        applications?: string[];
        tags?: string[];
        authors: AccountInstanceURI[];
        title?: string;
        content_warning?: string;

        summary?: {
            content?: string;
            address?: URI;
            mime_type?: string;
            size_in_bytes?: number;
        };

        body?: {
            content?: string;
            address?: URI;
            mime_type?: string;
            size_in_bytes?: number;
        };

        attachments?: {
            name?: string;
            content?: string;
            address?: URI;
            mime_type?: string;
            size_in_bytes?: number;
            alt?: string;
            width?: number;
            height?: number;
        }[];

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

        source: NoteSource;

        metadata?: {
            network: Network;
            proof: string;

            [key: string]: any;
        };
    }[];
};