// @flow declare type StatusResponse = { blob_manager: { finished_blobs: number, }, blockchain_headers: { download_progress: number, downloading_headers: boolean, }, dht: { node_id: string, peers_in_routing_table: number, }, hash_announcer: { announce_queue_size: number, }, installation_id: string, is_running: boolean, skipped_components: Array, startup_status: { blob_manager: boolean, blockchain_headers: boolean, database: boolean, dht: boolean, exchange_rate_manager: boolean, hash_announcer: boolean, peer_protocol_server: boolean, stream_manager: boolean, upnp: boolean, wallet: boolean, }, stream_manager: { managed_files: number, }, upnp: { aioupnp_version: string, dht_redirect_set: boolean, external_ip: string, gateway: string, peer_redirect_set: boolean, redirects: {}, }, wallet: ?{ connected: string, best_blockhash: string, blocks: number, blocks_behind: number, is_encrypted: boolean, is_locked: boolean, headers_synchronization_progress: number, available_servers: number, }, }; declare type VersionResponse = { build: string, lbrynet_version: string, os_release: string, os_system: string, platform: string, processor: string, python_version: string, }; declare type BalanceResponse = { available: string, reserved: string, reserved_subtotals: ?{ claims: string, supports: string, tips: string, }, total: string, }; declare type ResolveResponse = { // Keys are the url(s) passed to resolve [string]: { error?: {}, stream?: StreamClaim, channel?: ChannelClaim, collection?: CollectionClaim, claimsInChannel?: number }, }; declare type GetResponse = FileListItem & { error?: string }; declare type GenericTxResponse = { height: number, hex: string, inputs: Array<{}>, outputs: Array<{}>, total_fee: string, total_input: string, total_output: string, txid: string, }; declare type PublishResponse = GenericTxResponse & { // Only first value in outputs is a claim // That's the only value we care about outputs: Array, }; declare type ClaimSearchResponse = { items: Array, page: number, page_size: number, total_items?: number, total_pages?: number, }; declare type ClaimListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type ChannelCreateResponse = GenericTxResponse & { outputs: Array, }; declare type ChannelUpdateResponse = GenericTxResponse & { outputs: Array, }; declare type CommentCreateResponse = Comment; declare type CommentUpdateResponse = Comment; declare type MyReactions = { // Keys are the commentId [string]: Array, }; declare type OthersReactions = { // Keys are the commentId [string]: { // Keys are the reaction_type, e.g. 'like' [string]: number, }, }; declare type CommentReactListResponse = { my_reactions: Array, others_reactions: Array, }; declare type CommentHideResponse = { // keyed by the CommentIds entered [string]: { hidden: boolean }, }; declare type CommentPinResponse = { // keyed by the CommentIds entered items: Comment, }; declare type CommentAbandonResponse = { // keyed by the CommentId given abandoned: boolean, claim_id: string, }; declare type ChannelListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type ChannelSignResponse = { signature: string, signing_ts: string, }; declare type CollectionCreateResponse = { outputs: Array, page: number, page_size: number, total_items: number, total_pages: number, } declare type CollectionListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type CollectionResolveResponse = { items: Array, total_items: number, }; declare type CollectionResolveOptions = { claim_id: string, }; declare type CollectionListOptions = { page: number, page_size: number, resolve?: boolean, }; declare type FileListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type TxListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type SupportListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type BlobListResponse = { items: Array }; declare type WalletListResponse = Array<{ id: string, name: string, }>; declare type WalletStatusResponse = { is_encrypted: boolean, is_locked: boolean, is_syncing: boolean, }; declare type SyncApplyResponse = { hash: string, data: string, }; declare type SupportAbandonResponse = GenericTxResponse; declare type StreamListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type StreamRepostOptions = { name: string, bid: string, claim_id: string, channel_id?: string, }; declare type StreamRepostResponse = GenericTxResponse; declare type PurchaseListResponse = { items: Array, page: number, page_size: number, total_items: number, total_pages: number, }; declare type PurchaseListOptions = { page: number, page_size: number, resolve: boolean, claim_id?: string, channel_id?: string, }; // // Types used in the generic Lbry object that is exported // declare type LbryTypes = { isConnected: boolean, connectPromise: any, // null | connect: () => any, // void | Promise ? daemonConnectionString: string, alternateConnectionString: string, methodsUsingAlternateConnectionString: Array, apiRequestHeaders: { [key: string]: string }, setDaemonConnectionString: string => void, setApiHeader: (string, string) => void, unsetApiHeader: string => void, overrides: { [string]: ?Function }, setOverride: (string, Function) => void, // getMediaType: (?string, ?string) => string, // Lbry Methods stop: () => Promise, status: () => Promise, version: () => Promise, resolve: (params: {}) => Promise, get: (params: {}) => Promise, publish: (params: {}) => Promise, claim_search: (params: {}) => Promise, claim_list: (params: {}) => Promise, channel_create: (params: {}) => Promise, channel_update: (params: {}) => Promise, channel_import: (params: {}) => Promise, channel_list: (params: {}) => Promise, channel_sign: (params: {}) => Promise, stream_abandon: (params: {}) => Promise, stream_list: (params: {}) => Promise, channel_abandon: (params: {}) => Promise, support_create: (params: {}) => Promise, support_list: (params: {}) => Promise, support_abandon: (params: {}) => Promise, stream_repost: (params: StreamRepostOptions) => Promise, purchase_list: (params: PurchaseListOptions) => Promise, collection_resolve: (params: CollectionResolveOptions) => Promise, collection_list: (params: CollectionListOptions) => Promise, collection_create: (params: {}) => Promise, collection_update: (params: {}) => Promise, // File fetching and manipulation file_list: (params: {}) => Promise, file_delete: (params: {}) => Promise, blob_delete: (params: {}) => Promise, blob_list: (params: {}) => Promise, file_set_status: (params: {}) => Promise, file_reflect: (params: {}) => Promise, // Preferences preference_get: (params?: {}) => Promise, preference_set: (params: {}) => Promise, // Commenting comment_update: (params: {}) => Promise, comment_hide: (params: {}) => Promise, comment_abandon: (params: {}) => Promise, comment_list: (params: {}) => Promise, comment_create: (params: {}) => Promise, // Wallet utilities wallet_balance: (params: {}) => Promise, wallet_decrypt: (prams: {}) => Promise, wallet_encrypt: (params: {}) => Promise, wallet_unlock: (params: {}) => Promise, wallet_list: (params: {}) => Promise, wallet_send: (params: {}) => Promise, wallet_status: (params?: {}) => Promise, address_is_mine: (params: {}) => Promise, address_unused: (params: {}) => Promise, // New address address_list: (params: {}) => Promise, transaction_list: (params: {}) => Promise, txo_list: (params: {}) => Promise, account_set: (params: {}) => Promise, account_list: (params?: {}) => Promise, // Sync sync_hash: (params?: {}) => Promise, sync_apply: (params: {}) => Promise, // syncGet // The app shouldn't need to do this utxo_release: () => Promise, };