Initialize
- async user coordinates?
- logging (service?)
- asset tests?
testAssetDownload
- state for all the
assets storage objects, fields:
- url?
- blob?
- status (pending, failed?)
- two library modes?
- SDK fetches necessary data itself - plug’n’play usage
- Lib consumer fetches data on its own - this can be useful for apps that already have data fetching integrated, like Atlas
Functionalities
- resolve a storage object (get URL given ID)
- upload a storage object (given ID and the file)
- manage mapping of distribution/storage nodes to storage bags (with some caching to fix long cold starts)
- be smart about nodes selection - take geographical distance into account, keep track of failing nodes, etc.
Resolve asset
Input: asset ID, list of operators that serve the asset
Upload asset
Input:
export type AssetUpload = {
id: string
ipfsHash?: string
parentObject: {
type: AssetParent
id: ChannelId | VideoId
title?: string | null
}
owner: ChannelId
type: AssetType
// size in bytes
size: string
dimensions?: AssetDimensions
imageCropData?: ImageCropData
subtitlesLanguageIso?: string
metadata?: string
name?: string
hasNft?: boolean
}