wowok
Version:
Wowok Blockchain TypeScript API
141 lines (140 loc) • 4.97 kB
TypeScript
import type { ConversationInfo, ConversationsFilter, Message, MessageFilter, SendMessageResult, WtsFileResult, WtsGenerationParams, WtsToHtmlOptions, WtsVerificationResult, ListOperationResponse, GetSettingsResponse } from "./types.js";
import { MessengerManager } from "./messenger-manager.js";
import type { ENTRYPOINT } from "../../client/network.js";
import type { AccountOrMark_Address, ManyAccountOrMark_Address } from "../local/index.js";
export declare function getMessengerManager(): MessengerManager;
export declare function watch_conversations(filter?: ConversationsFilter): Promise<ConversationInfo[]>;
export declare function mark_messages_as_viewed(messageIds: string[], account?: string): Promise<number>;
export declare function mark_conversation_as_viewed(peerAddress: string | AccountOrMark_Address, account?: string): Promise<number>;
export declare function send_message(from: string | undefined | null, to: AccountOrMark_Address, content: string, options?: {
guardAddress?: string;
passportAddress?: string;
force?: boolean;
new_messenger_name?: string;
}): Promise<SendMessageResult>;
export declare function send_file(from: string | undefined | null, to: AccountOrMark_Address, filePath: string, options?: {
fileName?: string;
contentType?: "wts" | "wip" | "zip";
guardAddress?: string;
passportAddress?: string;
force?: boolean;
new_messenger_name?: string;
}): Promise<SendMessageResult>;
export declare function watch_messages(filter?: MessageFilter): Promise<Message[]>;
export declare function pull_messages(account?: string | undefined | null, limit?: number): Promise<Message[]>;
export declare function extract_zip_messages(account: string | undefined | null, messages: (Message | string)[], outputDir: string): Promise<string[]>;
export declare function generate_wts(params: WtsGenerationParams): Promise<WtsFileResult>;
export declare function verify_wts(wtsFilePath: string): Promise<WtsVerificationResult>;
export declare function sign_wts(wtsFilePath: string, account: string | undefined | null, outputPath?: string): Promise<string>;
export declare function wts2html(wtsPath: string, options?: WtsToHtmlOptions): Promise<string | string[]>;
export declare function proof_message(account: string | undefined | null, messageId: string, network: ENTRYPOINT): Promise<{
proofAddress: string;
}>;
export type BlacklistRequest = {
op: "add" | "remove";
account: string | undefined | null;
users: ManyAccountOrMark_Address;
} | {
op: "clear";
account: string | undefined | null;
} | {
op: "get";
account: string | undefined | null;
} | {
op: "exist";
account: string | undefined | null;
users: ManyAccountOrMark_Address;
};
export type BlacklistResponse = {
op: "add";
result: ListOperationResponse;
} | {
op: "remove";
result: ListOperationResponse;
} | {
op: "clear";
result: ListOperationResponse;
} | {
op: "get";
result: string[];
} | {
op: "exist";
result: ListOperationResponse;
};
export declare function blacklist(request: BlacklistRequest): Promise<BlacklistResponse>;
export type FriendslistRequest = {
op: "add" | "remove";
account: string | undefined | null;
users: ManyAccountOrMark_Address;
} | {
op: "clear";
account: string | undefined | null;
} | {
op: "get";
account: string | undefined | null;
} | {
op: "exist";
account: string | undefined | null;
users: ManyAccountOrMark_Address;
};
export type FriendslistResponse = {
op: "add";
result: ListOperationResponse;
} | {
op: "remove";
result: ListOperationResponse;
} | {
op: "clear";
result: ListOperationResponse;
} | {
op: "get";
result: string[];
} | {
op: "exist";
result: ListOperationResponse;
};
export declare function friendslist(request: FriendslistRequest): Promise<FriendslistResponse>;
export interface GuardParam {
guard: string;
passportValiditySeconds: number;
}
export type GuardlistRequest = {
op: "add";
account: string | undefined | null;
guards: GuardParam[];
} | {
op: "remove";
account: string | undefined | null;
guards: string[];
} | {
op: "get";
account: string | undefined | null;
};
export type GuardlistResponse = {
op: "add";
result: ListOperationResponse;
} | {
op: "remove";
result: ListOperationResponse;
} | {
op: "get";
result: ListOperationResponse;
};
export declare function guardlist(request: GuardlistRequest): Promise<GuardlistResponse>;
export type SettingsRequest = {
op: "get";
account: string | undefined | null;
} | {
op: "set";
account: string | undefined | null;
allowStrangerMessages?: boolean;
maxInboxSize?: number;
};
export type SettingsResponse = {
op: "get";
result: GetSettingsResponse;
} | {
op: "set";
result: boolean;
};
export declare function settings(request: SettingsRequest): Promise<SettingsResponse>;