Class Client

The main client for interacting with the xLog API.

Example

import { Client } from 'sakuin'
const client = new Client()

Hierarchy (view full)

Constructors

Properties

comment: CommentClient = ...
page: NoteClient<"page", PostInput, Post> = ...
portfolio: PortfolioClient = ...
post: NoteClient<"post", PostInput, Post> = ...
short: NoteClient<"short", ShortInput, Short> = ...
site: SiteClient = ...
uploadFile: ((file) => Promise<IpfsResponse>) = ipfsUploadFile

Upload a file to IPFS. equivalent to ipfsUploadFile from crossbell/ipfs

Type declaration

    • (file): Promise<IpfsResponse>
    • Parameters

      • file: File | Blob

      Returns Promise<IpfsResponse>

Methods

  • Get the character ID from a handle or character ID. If the input is a number, it will be treated as a character ID and returned directly. Otherwise, it will be treated as a handle and the character ID will be looked up.

    Parameters

    Returns Promise<number>

  • Upload files to IPFS.

    Parameters

    • urls: string[]

      remote file urls

    Returns Promise<IpfsResponse[]>