r/siacoin • u/SiaFoundation • 1d ago
Sia Storage SDK (Dart) v0.4.0 release
Sia Storage SDK (Dart) v0.4.0 gives applications more control over access and storage workflows. Create read-only sharing keys for selected objects, let recipients connect through Sia.sharedSdk without an account or approval flow, and revoke keys or remove individual objects later. Programs can also connect noninteractively with Builder.connectPreAuthorized, upload native files through Sdk.uploadPath or PackedUpload.addPath, overwrite ranges with UploadOptions.startOffset, and shorten objects with PinnedObject.truncate. Path uploads throw on web, and modified or truncated objects must be re-pinned. Use Sdk.pruneSlabs(before:) to set a cutoff, or pass before: null to let the indexer protect recently pinned slabs.
Transfers can finish with greater WebTransport parallelism and less repeated connection setup. Active RPCs are no longer stopped by fixed deadlines while they continue making progress, and slabs rejected as too old are reuploaded automatically. Recovery flows can check Builder.matchesExistingAppKey and Builder.reconnecting; registration with a different recovery phrase now creates a new app key instead of failing.
Existing integrations require migration. Add the required version field when constructing Slab or containing SealedObject values, and remove uses of Sdk.slab and PinnedSlab. Replace AppKey.export_() with AppKey.save(). For share URLs, replace Sdk.shareObject with Sdk.objectShareUrl and Sdk.sharedObject with Sdk.objectFromShareUrl; Sdk.shareObject now attaches an object to a sharing key.
Read the developer documentation at https://devs.sia.storage.