UNPKG

@etherna/sdk-js

Version:

Etherna SDKs for operations on the network

80 lines 2.61 kB
import type { RequestOptions } from ".."; import type { EthernaGatewayClient } from "./index"; import type { GatewayPin } from "./types"; export declare class ResourcesClient { private instance; constructor(instance: EthernaGatewayClient); /** * Check if a resource is offered * * @param reference Hash of the resource * @param opts Request options * @returns True if has offers */ fetchIsOffered(reference: string, opts?: RequestOptions): Promise<boolean>; /** * Check if multiple resources are offered * * @param references Hashes of the resources * @param opts Request options * @returns Addresses of users that are offering the resource */ fetchAreOffered(references: string[], opts?: RequestOptions): Promise<Record<string, boolean>>; /** * Get all resource offers * * @param reference Hash of the resource * @param opts Request options * @returns Addresses of users that are offering the resource */ fetchOffers(reference: string, opts?: RequestOptions): Promise<string[]>; /** * Offer a resource * * @param reference Hash of the resource * @param opts Request options * @returns True if successfull */ offer(reference: string, opts?: RequestOptions): Promise<boolean>; /** * Cancel a resource offer * * @param reference Hash of the resource * @param opts Request options * @returns True if successfull */ cancelOffer(reference: string, opts?: RequestOptions): Promise<boolean>; /** * Get a resource pinning status * * @param reference Hash of the resource * @param opts Request options * @returns Pin status object */ fetchIsPinned(reference: string, opts?: RequestOptions): Promise<GatewayPin>; /** * Fetch the users pinning a resource * * @param reference Hash of the resource * @param opts Request options * @returns List of addresses */ fetchPinUsers(reference: string, opts?: RequestOptions): Promise<string[]>; /** * Pin a resource * * @param reference Hash of the resource * @param opts Request options * @returns True if successfull */ pin(reference: string, opts?: RequestOptions): Promise<boolean>; /** * Unpin resource offer * * @param reference Hash of the resource * @param opts Request options * @returns True if successfull */ unpin(reference: string, opts?: RequestOptions): Promise<boolean>; } //# sourceMappingURL=resources.d.ts.map