set Resource Fee
Sets the resource fee portion of the Soroban data.
The resource fee is charged in addition to the base transaction fee to cover the cost of contract execution resources (CPU, memory, storage).
This fee is typically calculated from simulation results:
builder.setResourceFee(simulation.minResourceFee!! + buffer)Content copied to clipboard
Fee Calculation
Total transaction fee = Base fee + Resource fee
Base fee: 100 stroops × number of operations
Resource fee: Depends on contract execution (from simulation)
Return
This builder instance for chaining
Parameters
fee
The resource fee in stroops (must be non-negative)
Throws
If fee is negative