/** * @module Clients / Anchors * @category Entities */ import { AxiosResponse } from 'axios'; import { JwtConfig, LedgerAnchor, LedgerIdentifier, LedgerPagedList, LedgerRecord } from "../../../types/src"; import { AccessClient } from '../common/clients/access-client'; import { BaseChangeClient } from '../common/clients/base-change-client'; import { BaseClient, BaseClientOptions } from '../common/clients/base-client'; import { CreateRecordBuilder } from '../common/services/create-record-builder'; import { DropRecordBuilder } from '../common/services/drop-record-builder'; import { UpdateRecordBuilder } from '../common/services/update-record-builder'; import { BaseRecordResponse } from '../common/types/base-record-response'; import { BaseListResponse } from '../common/types/list-response'; import { AnchorListParams } from './anchor-list-params'; /** * Single anchor API response. */ export declare class AnchorResponse extends BaseRecordResponse { /** * Record data extracted from the `data` property of the response body. */ anchor: LedgerAnchor; constructor(response: AxiosResponse, LedgerRecord>); } /** * Anchors list API response. */ export declare class AnchorsResponse extends BaseListResponse { /** * A flattened list of records, extracted from the `data` property of * each record returned. */ anchors: LedgerAnchor[]; constructor(response: AxiosResponse, void>); } /** * Allows querying and managing anchors. * * @see {LedgerAnchor} */ export declare class AnchorClient extends BaseClient { /** * Allows querying changes. * */ change: BaseChangeClient; /** * Allows checking access. * */ access: AccessClient; constructor(options: BaseClientOptions); /** * Initializes a builder instance that supports chaining to make it * easier to work with ledger records. You can pass the record * payload to this method to use as initial content, this is useful * when you already have an object ready, for example when validating * API responses or modifying an existing record. An empty record is * going to be created if no initial data is provided. * * @see {LedgerAnchor} * @see {CreateRecordBuilder} * @param options.record initial record payload (optional) * @param options.handle specify handle to be updated, if any (optional) * @returns a builder instance */ init(record?: Partial>): CreateRecordBuilder; /** * Initializes a builder instance for updating existing records. * The builder supports chaining to make it easier to work with * ledger records. You can pass the existing record payload to * this method to use as initial content. * * @see {LedgerAnchor} * @see {UpdateRecordBuilder} * @param record initial record payload * @returns a builder instance */ from(record: LedgerRecord): UpdateRecordBuilder; /** * Initializes a builder instance that supports chaining to make it * easier to work with ledger records. You can pass the record * payload to this method to use as initial content, this is useful * when you already have an object ready, for example when validating * API responses or modifying an existing record. An empty record is * going to be created if no initial data is provided. * * @see {LedgerAnchor} * @see {DropRecordBuilder} * @param id anchor identifier (optional) * @returns a builder instance */ drop(id?: LedgerIdentifier): DropRecordBuilder; /** * Gets a ledger anchor by identifier (luid or handle). * * @see {LedgerAnchor} * @throws {Error} if the anchor doesn't exist or the * current user doesn't have access to this anchor * @param id a unique anchor handle * @returns a single anchor response with the requested anchor */ read(id: LedgerIdentifier, authParams?: Partial): Promise; /** * Queries anchors from a ledger. * * @see {LedgerAnchor} * @returns anchors list response with all found anchors */ list(params?: AnchorListParams): Promise; }