- Forked from stellar/js-stellar-sdk.
A breaking change should be clearly marked in this log.
- This adds sensible defaults
Server.simulateTransaction
's response when the RPC server omits certain fields in an unexpected way (#131).
- 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).
- 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).
- The minimum supported NodeJS version is now Node 16.
Server.prepareTransaction
now returns aTransactionBuilder
instance rather than an immutableTransaction
, 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 intent is to avoid cloning the transaction again (via
- 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
andSimulateHostFunctionResult
include the full, decoded XDR structures instead of raw, base64-encoded strings for the relevant fields (e.g.SimulateTransactionResponse.transactionData
is now an instance ofSorobanDataBuilder
,events
is now anxdr.DiagnosticEvent[]
[try outhumanizeEvents
for a friendlier representation of this field]). - The
SimulateTransactionResponse.results[]
field has been moved toSimulateTransactionResponse.result?
, since there will always be exactly zero or one result.
- The
GetTransactionStatus
is now anenum
with actual values rather than atype
(#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 ofGetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponse
, which gives proper typing to the interface depending on the response'sstatus
field.- All of the
*Xdr
properties are now full, decoded XDR structures. - There is a new
returnValue
field which is a decodedxdr.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.
- The
stellar-base
dependency has been upgraded to fix a TypeScript bug (js-stellar-base#665). - Decreased bundle size by refactoring
assembleTransaction
to use new abstractions fromstellar-base
(#120).
- We have dropped all support for the deprecated hex-encoded contract ID format (#117, js-stellar-base#658).
You should use the well-supported C...
strkey format, instead. To migrate, you can do something like
let contractId = StrKey.encodeContract(Buffer.from(hexContractId, 'hex'));
- Updated
stellar-base
dependency to v10.0.0-soroban.5 which introduces many helpful Soroban abstractions (see full release notes):- Use an existing, immutable
Transaction
as a template for a new one viaTransactionBuilder.cloneFrom(tx, opts = {})
and useopts
to override fields (#656). - Use the new
SorobanDataBuilder
class to easily prepare Soroban transaction footprints #660. - Use
humanizeEvents
to create human-readable versions ofxdr.ContractEvent
s andxdr.DiagnosticEvent
s that come out of transaction meta (#659). - Use several helpers to reliably build Soroban authorization entries for complex, multi-party signing scenarios (#663). These are each at various levels of granularity/complexity:
authorizeInvocation
authorizeInvocationCallback
buildAuthEnvelope
buildAuthEntry
- Use an existing, immutable
assembleTransaction()
(andServer.prepareTransaction()
by proxy) will now override the authorization portion of simulation if you provide a transaction with existing authorization entries. This is because, in complex auth scenarios, you may have signed entries that would be overwritten by simulation, so this just uses your existing entries (#114).- Added a missing
type
field to theEventResponse
interface (#118).
- Updated
stellar-base
dependency to fix the wayscValToNative
converts string and symbol values: they will always decode strings when possible (#112 for #645).
- Updated
stellar-base
dependency to fix an issue when building & invoking contract transactions.
Server.getContractData
has an additional, optional parameter:expirationType?: string
which should be set to either'temporary'
or'persistent'
depending on the type of ledger key. By default, it will attempt to fetch both, returning whichever one it finds (#103).assembleTransaction
now accepts simulation results for the newBumpFootprintExpirationOp
s andRestoreFootprintOp
s (#108).- The XDR library (
stellar-base
) has been upgraded to Preview 10's protocol format. This includes the following changes:
- Many XDR structures have changed, please refer to the
types/next.d.ts
diff for details (#633). - We have returned to the world in which one transaction contains one operation which contains one host function invocation. This means
Operation.invokeHostFunctions
is gone andOperation.invokeHostFunction
has changed to accept{ func, auth }
, wherefunc
is the correctxdr.HostFunction
andauth
is a list ofxdr.SorobanAuthorizationEntry
items that outline the authorization tree for the call stack (#633). Better abstractions for creating anxdr.HostFunction
are forthcoming, though you can still refer toContract.call()
for help.
- A new abstraction for dealing with large integers and
ScVal
s: seeScInt
,XdrLargeInt
, andscValToBigInt
(#620). - A new abstraction for converting between native JavaScript types and complex
ScVal
s: seenativeToScVal
andscValToNative
(#630). - We have added two new operations related to state expiration in Soroban:
BumpFootprintExpiration
andRestoreFootprint
. Please refer to their docstrings for details (#633).
- The
stellar-base
library is pinned to a specific version so that a fresh installation (via e.g.npm i soroban-client
) does not pull the latest major version (without Soroban support) (#100).
Server.getContractId()
now accepts a contract strkey (#97).
-
The XDR library (
stellar-base
) has been upgraded to handle contract strkeys (C...
addresses) better (see #612 and #614 ofstellar-base
) (#98). -
Misc. dependencies have been upgraded and the
buffer
polyfill is now a primary dependency (#98).
- Downstream dependencies are transpiled to target the same older JS environments as the main library (#96).
- The module was not being exported correctly in browser environments; the following should now work in your project (#95):
import * as SorobanClient from 'soroban-client';
- The browser bundles compatibility has increased, supporting older JS environments and undoing #90 from v0.7.0 (#95).
- Replaced the deprecated
getLedgerEntry
withgetLedgerEntries
(#66).
- Transaction simulation parses correctly when there is no auth (#89).
- TypeScript types are packaged correctly (#86).
- Documentation is packaged correctly (#87, #88).
- Published bundles support modern JS features (ES6ish) (#90).
This version was tagged solely to trigger a documentation build.
- Removed extraneous reference to
gulp
in docs building step (#80).
- Updated
Server.prepareTransaction()
for new Soroban simulation results and fees. Note the change in behavior now, where transaction fee will be increased by the resource fee estimates received from simulation (#76).
- SDK Modernization, refreshing the build system to use the latest in JS build pipelines (#69).