2019-04-23 19:22:14 +02:00
|
|
|
// @flow
|
|
|
|
|
2021-02-06 08:03:10 +01:00
|
|
|
declare type Claim = StreamClaim | ChannelClaim | CollectionClaim;
|
2019-04-23 19:22:14 +02:00
|
|
|
|
|
|
|
declare type ChannelClaim = GenericClaim & {
|
|
|
|
value: ChannelMetadata,
|
|
|
|
};
|
|
|
|
|
2021-02-06 08:03:10 +01:00
|
|
|
declare type CollectionClaim = GenericClaim & {
|
|
|
|
value: CollectionMetadata,
|
|
|
|
};
|
|
|
|
|
2019-04-23 19:22:14 +02:00
|
|
|
declare type StreamClaim = GenericClaim & {
|
|
|
|
value: StreamMetadata,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare type GenericClaim = {
|
|
|
|
address: string, // address associated with tx
|
2019-06-06 23:37:36 +02:00
|
|
|
amount: string, // bid amount at time of tx
|
|
|
|
canonical_url: string, // URL with short id, includes channel with short id
|
2019-04-23 19:22:14 +02:00
|
|
|
claim_id: string, // unique claim identifier
|
2019-06-06 23:37:36 +02:00
|
|
|
claim_sequence: number, // not being used currently
|
2019-04-23 19:22:14 +02:00
|
|
|
claim_op: 'create' | 'update',
|
2019-06-06 23:37:36 +02:00
|
|
|
confirmations: number,
|
|
|
|
decoded_claim: boolean, // Not available currently https://github.com/lbryio/lbry/issues/2044
|
|
|
|
timestamp?: number, // date of last transaction
|
2019-04-23 19:22:14 +02:00
|
|
|
height: number, // block height the tx was confirmed
|
2020-05-08 22:47:33 +02:00
|
|
|
is_channel_signature_valid?: boolean,
|
2020-06-17 03:56:51 +02:00
|
|
|
is_my_output: boolean,
|
2019-04-23 19:22:14 +02:00
|
|
|
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
|
2019-06-06 23:37:36 +02:00
|
|
|
short_url: string, // permanent_url with short id, no channel
|
2019-04-23 19:22:14 +02:00
|
|
|
txid: string, // unique tx id
|
|
|
|
type: 'claim' | 'update' | 'support',
|
2021-02-06 08:03:10 +01:00
|
|
|
value_type: 'stream' | 'channel' | 'collection',
|
2019-06-11 20:11:18 +02:00
|
|
|
signing_channel?: ChannelClaim,
|
2020-12-17 04:35:12 +01:00
|
|
|
reposted_claim?: GenericClaim,
|
2020-01-30 23:13:40 +01:00
|
|
|
repost_channel_url?: string,
|
2020-12-17 04:35:12 +01:00
|
|
|
repost_url?: string,
|
|
|
|
repost_bid_amount?: string,
|
2020-05-08 22:47:33 +02:00
|
|
|
purchase_receipt?: PurchaseReceipt,
|
2019-06-04 18:06:19 +02:00
|
|
|
meta: {
|
|
|
|
activation_height: number,
|
2019-06-06 23:37:36 +02:00
|
|
|
claims_in_channel?: number,
|
2019-06-04 18:06:19 +02:00
|
|
|
creation_height: number,
|
|
|
|
creation_timestamp: number,
|
|
|
|
effective_amount: string,
|
|
|
|
expiration_height: number,
|
|
|
|
is_controlling: boolean,
|
|
|
|
support_amount: string,
|
2020-03-19 18:20:58 +01:00
|
|
|
reposted: number,
|
2019-06-04 18:06:19 +02:00
|
|
|
trending_global: number,
|
|
|
|
trending_group: number,
|
|
|
|
trending_local: number,
|
|
|
|
trending_mixed: number,
|
|
|
|
},
|
2019-04-23 19:22:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
2019-06-06 23:37:36 +02:00
|
|
|
public_key_id: string,
|
2019-04-23 19:22:14 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2021-02-06 08:03:10 +01:00
|
|
|
declare type CollectionMetadata = GenericMetadata & {
|
|
|
|
claims: 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,
|
|
|
|
};
|
2020-05-08 22:47:33 +02:00
|
|
|
|
|
|
|
declare type PurchaseReceipt = {
|
|
|
|
address: string,
|
|
|
|
amount: string,
|
|
|
|
claim_id: string,
|
|
|
|
confirmations: number,
|
|
|
|
height: number,
|
|
|
|
nout: number,
|
|
|
|
timestamp: number,
|
|
|
|
txid: string,
|
|
|
|
type: 'purchase',
|
|
|
|
};
|
2021-02-06 08:03:10 +01:00
|
|
|
|
|
|
|
declare type ClaimActionResolveInfo = {
|
|
|
|
[string]: {
|
|
|
|
stream: ?StreamClaim,
|
|
|
|
channel: ?ChannelClaim,
|
|
|
|
claimsInChannel: ?number,
|
|
|
|
collection: ?CollectionClaim,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
declare type ChannelUpdateParams = {
|
|
|
|
claim_id: string,
|
|
|
|
bid?: string,
|
|
|
|
title?: string,
|
|
|
|
cover_url?: string,
|
|
|
|
thumbnail_url?: string,
|
|
|
|
description?: string,
|
|
|
|
website_url?: string,
|
|
|
|
email?: string,
|
|
|
|
tags?: Array<string>,
|
|
|
|
replace?: boolean,
|
|
|
|
languages?: Array<string>,
|
|
|
|
locations?: Array<string>,
|
|
|
|
blocking?: boolean,
|
|
|
|
}
|
|
|
|
|
|
|
|
declare type ChannelPublishParams = {
|
|
|
|
name: string,
|
|
|
|
bid: string,
|
|
|
|
blocking?: true,
|
|
|
|
title?: string,
|
|
|
|
cover_url?: string,
|
|
|
|
thumbnail_url?: string,
|
|
|
|
description?: string,
|
|
|
|
website_url?: string,
|
|
|
|
email?: string,
|
|
|
|
tags?: Array<string>,
|
|
|
|
languages?: Array<string>,
|
|
|
|
}
|
|
|
|
|
|
|
|
declare type CollectionUpdateParams = {
|
|
|
|
claim_id: string,
|
|
|
|
claim_ids?: Array<string>,
|
|
|
|
bid?: string,
|
|
|
|
title?: string,
|
|
|
|
cover_url?: string,
|
|
|
|
thumbnail_url?: string,
|
|
|
|
description?: string,
|
|
|
|
website_url?: string,
|
|
|
|
email?: string,
|
|
|
|
tags?: Array<string>,
|
|
|
|
replace?: boolean,
|
|
|
|
languages?: Array<string>,
|
|
|
|
locations?: Array<string>,
|
|
|
|
blocking?: boolean,
|
|
|
|
}
|
|
|
|
|
|
|
|
declare type CollectionPublishParams = {
|
|
|
|
name: string,
|
|
|
|
bid: string,
|
|
|
|
claim_ids: Array<string>,
|
|
|
|
blocking?: true,
|
|
|
|
title?: string,
|
|
|
|
thumbnail_url?: string,
|
|
|
|
description?: string,
|
|
|
|
tags?: Array<string>,
|
|
|
|
languages?: Array<string>,
|
|
|
|
}
|