Soroban Data Builder
constructor()
Creates a new builder with empty SorobanTransactionData.
Initializes with:
Resource fee: 0
CPU instructions: 0
Disk read bytes: 0
Write bytes: 0
Empty read-only footprint
Empty read-write footprint
Creates a new builder from base64-encoded XDR string.
Parses the XDR and uses it as the starting point for building. Useful when working with simulation results or existing transactions.
Example
val simulation = server.simulateTransaction(tx)
val builder = SorobanDataBuilder(simulation.transactionData!!)Content copied to clipboard
Parameters
soroban Data
Base64-encoded SorobanTransactionData XDR
Throws
If the XDR is invalid
Creates a new builder from existing SorobanTransactionData.
Creates a deep copy of the provided data to ensure immutability. Any modifications through builder methods create a new instance.
Example
val existing = transaction.sorobanData!!
val modified = SorobanDataBuilder(existing)
.setResourceFee(existing.resourceFee + 5000)
.build()Content copied to clipboard
Parameters
soroban Data
The SorobanTransactionData to copy