Blossom class

direct access usecase to blossom
use files usecase for a more convinent way to manage files

Constructors

Blossom.new({required BlossomUserServerList blossomUserServerList, required BlossomRepository blossomRepository, required Accounts accounts})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkBlob({required String sha256, bool useAuth = false, List<String>? serverUrls, String? pubkeyToFetchUserServerList}) Future<String>
checks if the blob exists on the server without downloading, useful to check before streaming a video via url
if serverUrls is null, the userServerList is fetched from nostr.
if the pukey has no UserServerList (kind: 10063), throws an error
deleteBlob({required String sha256, List<String>? serverUrls}) Future<List<BlobDeleteResult>>
delete a blob if serverUrls is null, the userServerList is fetched from nostr.
if the pukey has no UserServerList (kind: 10063), throws an error
the current signer is used to sign the request
directDownload({required Uri url}) Future<BlobResponse>
Directly downloads a blob from the url, without blossom
getBlob({required String sha256, bool useAuth = false, List<String>? serverUrls, String? pubkeyToFetchUserServerList}) Future<BlobResponse>
Gets a blob by trying servers sequentially until success (fallback)
if serverUrls is null, the userServerList is fetched from nostr.
if the pukey has no UserServerList (kind: 10063), throws an error
getBlobStream({required String sha256, bool useAuth = false, List<String>? serverUrls, String? pubkeyToFetchUserServerList, int chunkSize = 1024 * 1024}) Future<Stream<BlobResponse>>
downloads a blob as a stream, useful for large files like videos
if serverUrls is null, the userServerList is fetched from nostr.
if the pukey has no UserServerList (kind: 10063), throws an error
listBlobs({required String pubkey, List<String>? serverUrls, bool useAuth = true, DateTime? since, DateTime? until}) Future<List<BlobDescriptor>>
list the pubkey blobs
if serverUrls is null, the userServerList is fetched from nostr.
if the pukey has no UserServerList (kind: 10063), throws an error
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
report({required String sha256, required String eventId, required String reportType, required String reportMsg, required String serverUrl}) Future<int>
Reports a blob to the server sha256 is the hash of the blob eventId is the event id where the blob was mentioned reportType is the type of report, e.g. malware @see nip56 reportMsg is the message to send to the server serverUrl server url to report to
toString() String
A string representation of this object.
inherited
uploadBlob({required Uint8List data, List<String>? serverUrls, String? contentType, UploadStrategy strategy = UploadStrategy.mirrorAfterSuccess, bool serverMediaOptimisation = false}) Future<List<BlobUploadResult>>
upload a blob to the server if serverUrls is null, the userServerList is fetched from nostr.
if the pukey has no UserServerList (kind: 10063), throws an error
the current signer is used to sign the request
strategy is the upload strategy, default is mirrorAfterSuccess
serverMediaOptimisation is whether the server should optimise the media BUD-05, IMPORTANT: the server hash will be different \

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

kBlossom → const int
kind for all most of blossom
kBlossomUserServerList → const int
kind for blossom user server list
kReport → const int
kind for reports NIP56