WriteFilesFlow class

Multi-step write files flow for wallet integration.

Similar to WriteBlobFlow but encodes multiple files into a quilt and returns per-file patch IDs at the end.

Usage:

final flow = await directClient.writeFilesFlow(files: myFiles);

// Step 1: Encode files into quilt
await flow.encode();

// Step 2: Get register transaction → sign externally
final registerTx = await flow.register(WriteFilesFlowRegisterOptions(
  epochs: 3,
  owner: myAddress,
  deletable: true,
));
final registerResult = await wallet.signAndExecute(registerTx);

// Step 3: Upload quilt blob
await flow.upload(WriteBlobFlowUploadOptions(
  digest: registerResult.digest,
));

// Step 4: Get certify transaction → sign externally
final certifyTx = flow.certify();
await wallet.signAndExecute(certifyTx);

// Step 5: Get file results
final files = await flow.listFiles();
for (final file in files) {
  print('File ID: ${file.id}');
}

Constructors

WriteFilesFlow({required List<WalrusFile> files, required WalrusTransactionBuilder txBuilder, UploadRelayClient? relayClient, UploadRelayTipConfig? tipConfig, BlobEncoder? encoder, CommitteeInfo? committee, dynamic directClient, SystemStateReader? stateReader, dynamic suiClient})

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

certify() → Transaction
Step 4: Build the certify transaction.
encode() Future<void>
Step 1: Encode files into a quilt and compute metadata.
listFiles() Future<List<WriteFileResult>>
Step 5: Get the final file results with patch IDs.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(WriteFilesFlowRegisterOptions options) Future<Transaction>
Step 2: Build the register transaction.
toString() String
A string representation of this object.
inherited
upload(WriteBlobFlowUploadOptions options) Future<void>
Step 3: Upload the quilt blob data.

Operators

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