2019-04-23 19:22:14 +02:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
declare type ClaimWithPossibleCertificate = {
|
|
|
|
certificate?: ChannelClaim,
|
|
|
|
claim: StreamClaim,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type ChannelClaim = GenericClaim & {
|
|
|
|
value: ChannelMetadata,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type StreamClaim = GenericClaim & {
|
|
|
|
is_channel_signature_valid?: boolean,
|
|
|
|
signing_channel?: {
|
|
|
|
claim_id: string,
|
|
|
|
name: string,
|
|
|
|
value: {
|
|
|
|
public_key: string,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
value: StreamMetadata,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type GenericClaim = {
|
|
|
|
address: string, // address associated with tx
|
|
|
|
amount: number, // bid amount at time of tx
|
|
|
|
claim_id: string, // unique claim identifier
|
|
|
|
claim_sequence: number,
|
|
|
|
claim_op: 'create' | 'update',
|
|
|
|
confirmations: number, // This isn't the most stable atm: https://github.com/lbryio/lbry/issues/2000
|
|
|
|
decoded_claim: boolean, // claim made in accordance with sdk protobuf types
|
|
|
|
effective_amount: number, // bid amount + supports
|
2019-05-06 04:00:45 +02:00
|
|
|
timestamp?: number, // date of transaction
|
2019-04-23 19:22:14 +02:00
|
|
|
has_signature: boolean,
|
|
|
|
height: number, // block height the tx was confirmed
|
|
|
|
hex: string, // `value` hex encoded
|
|
|
|
name: string,
|
|
|
|
channel_name?: string,
|
|
|
|
normalized_name: string, // `name` normalized via unicode NFD spec,
|
|
|
|
nout: number, // index number for an output of a tx
|
|
|
|
permanent_url: string, // name + claim_id
|
|
|
|
supports: Array<{}>, // TODO: add support type once we start using it
|
|
|
|
txid: string, // unique tx id
|
|
|
|
type: 'claim' | 'update' | 'support',
|
|
|
|
valid_at_height?: number, // BUG: this should always exist https://github.com/lbryio/lbry/issues/1728
|
|
|
|
value_type: 'stream' | 'channel',
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type GenericMetadata = {
|
|
|
|
title?: string,
|
|
|
|
description?: string,
|
|
|
|
thumbnail?: {
|
|
|
|
url?: string,
|
|
|
|
},
|
|
|
|
languages?: Array<string>,
|
|
|
|
tags?: Array<string>,
|
|
|
|
locations?: Array<Location>,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type ChannelMetadata = GenericMetadata & {
|
|
|
|
public_key: string,
|
|
|
|
cover_url?: string,
|
2019-05-06 07:21:24 +02:00
|
|
|
email?: string,
|
|
|
|
website_url?: string,
|
2019-05-09 15:57:58 +02:00
|
|
|
featured?: Array<string>,
|
2019-04-23 19:22:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
declare type StreamMetadata = GenericMetadata & {
|
|
|
|
license?: string, // License "title" ex: Creative Commons, Custom copyright
|
|
|
|
license_url?: string, // Link to full license
|
|
|
|
release_time?: number, // linux timestamp
|
|
|
|
author?: string,
|
|
|
|
|
|
|
|
source: {
|
|
|
|
sd_hash: string,
|
|
|
|
media_type?: string,
|
|
|
|
hash?: string,
|
|
|
|
name?: string, // file name
|
|
|
|
size?: number, // size of file in bytes
|
|
|
|
},
|
|
|
|
|
|
|
|
// Only exists if a stream has a fee
|
2019-04-23 21:54:39 +02:00
|
|
|
fee?: Fee,
|
2019-04-23 19:22:14 +02:00
|
|
|
|
|
|
|
stream_type: 'video' | 'audio' | 'image' | 'software',
|
|
|
|
// Below correspond to `stream_type`
|
|
|
|
video?: {
|
|
|
|
duration: number,
|
|
|
|
height: number,
|
|
|
|
width: number,
|
|
|
|
},
|
|
|
|
audio?: {
|
|
|
|
duration: number,
|
|
|
|
},
|
|
|
|
image?: {
|
|
|
|
height: number,
|
|
|
|
width: number,
|
|
|
|
},
|
|
|
|
software?: {
|
|
|
|
os: string,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type Location = {
|
|
|
|
latitude?: number,
|
|
|
|
longitude?: number,
|
|
|
|
country?: string,
|
|
|
|
state?: string,
|
2019-05-09 15:57:58 +02:00
|
|
|
city?: string,
|
2019-04-23 19:22:14 +02:00
|
|
|
code?: string,
|
|
|
|
};
|
2019-04-23 21:54:39 +02:00
|
|
|
|
|
|
|
declare type Fee = {
|
2019-05-09 20:13:55 +02:00
|
|
|
amount: string,
|
2019-04-23 21:54:39 +02:00
|
|
|
currency: string,
|
|
|
|
address: string,
|
|
|
|
};
|