Skip to content

v0.11.0

Compare
Choose a tag to compare
@Shaptic Shaptic released this 21 Aug 18:42
· 27 commits to main since this release
377e3fe

v0.11.0

Fixed

  • The SimulateTransactionResponse's error field now has the correct type (that is, string: #123).
  • Many irrelevant or unused dependencies have been eliminated (such as eventsource, lodash, and others), lowering overall bundle size (#126).

Added

  • A new ContractSpec class to facilitate building native JavaScript structures from custom contract types. Given a specification for the data structure (i.e. xdr.ScSpecEntry[]), it will interpret the values via the specified type (#115).

Breaking Changes

  • The minimum supported NodeJS version is now Node 16.
  • Server.prepareTransaction now returns a TransactionBuilder instance rather than an immutable Transaction, in order to facilitate modifying your transaction after assembling it alongside the simulation response (#127).
    • The intent is to avoid cloning the transaction again (via TransactionBuilder.cloneFrom) if you need to modify parameters such as the storage access footprint.
    • To migrate your code, just call .build() on the return value.
  • The RPC response schemas for simulation (see Server.simulateTransaction()) have been upgraded to parse the base64-encoded XDR automatically. The full interface changes are in the pull request (#127), but succinctly:
    • SimulateTransactionResponse -> RawSimulateTransactionResponse
    • SimulateHostFunctionResult -> RawSimulateHostFunctionResult
    • Now, SimulateTransactionResponse and SimulateHostFunctionResult include the full, decoded XDR structures instead of raw, base64-encoded strings for the relevant fields (e.g. SimulateTransactionResponse.transactionData is now an instance of SorobanDataBuilder, events is now an xdr.DiagnosticEvent[] [try out humanizeEvents for a friendlier representation of this field]).
    • The SimulateTransactionResponse.results[] field has been moved to SimulateTransactionResponse.result?, since there will always be exactly zero or one result.
  • The GetTransactionStatus is now an enum with actual values rather than a type (#129).
  • The RPC response schemas for retrieving transaction details (Server.getTransaction()) have been upgraded to parse the base64-encoded XDR automatically. The full interface changes are in the pull request (#129), but succinctly:
    • GetTransactionResponse -> RawGetTransactionResponse
    • GetTransactionResponse is now one of GetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponse, which gives proper typing to the interface depending on the response's status field.
    • All of the *Xdr properties are now full, decoded XDR structures.
    • There is a new returnValue field which is a decoded xdr.ScVal, present iff the transaction was a successful Soroban function invocation.

Not all schemas have been broken in this manner in order to facilitate user feedback on this approach. Please add your 👍 or 👎 to #128 to vote on whether or not we should do this for the other response schemas.

Full Changelog: v0.10.1...v0.11.0