stellar-base
Advanced tools
Changelog
Note: This version is (still) compatible with Protocol 20. Most people should be unaffected by the technically-breaking changes below and can treat this more like a v10.0.3 patch release.
BigNumber.DEBUG
in bignumber.js
to true
internally, which affects all code using BigNumber
. This behavior has been fixed and only affects this library: globally, BigNumber.DEBUG
now remains at its default setting (i.e. disabled). This is technically a breaking behavior change and is released as such (#729).Changelog
v10.0.0
: Protocol 20 Stable Release
6a620d1
). This is mostly renames, but it includes the following relevant breaking changes (#704):
Operation.bumpFootprintExpiration
is now extendFootprintTtl
and its ledgersToExpire
field is now named extendTo
, but it serves the same purpose.Operation.BumpFootprintExpiration
is now Operation.ExtendFootprintTTL
xdr.ContractExecutable.contractExecutableToken
is now contractExecutableStellarAsset
xdr.SorobanTransactionData.refundableFee
is now resourceFee
SorobanDataBuilder.setRefundableFee
is now setResourceFee
TransactionBuilder(..., { fee: ... })
).Contract.getFootprint()
now only returns a single result: the ledger key of the deployed instance for the given ID, because the key for the code entry was incorrect (it should not be the ID but rather the WASM hash, which is not calculatable w/o network access) (#709).Changelog
authorizeEntry
has been added to help sign auth entries in-placeauthorizeInvocation
has changed: it now offers a callback approach by default and requires slightly different parametersbuildAuthEntry
, buildAuthEnvelope
, and authorizeInvocationCallback
have been removedChangelog
v10.0.0-beta.0
: Protocol 20
The core data structure of Soroban is a generic type called an ScVal
(smart contract value, which is a union of types that can basically represent anything [numbers, strings, arrays, maps, contract bytecode, etc.]). You can refer to the XDR for details, and you can utilize new APIs to make dealing with these complex values easier:
nativeToScVal
helps convert native types to their closest Soroban equivalentscValToNative
helps find the closest native JavaScript type(s) corresponding to a smart contract valuescValToBigInt
helps convert numeric ScVal
s into native bigint
sScInt
and XdrLargeInt
help convert to and from bigint
s to other types and form sized integer types for smart contract usageThe following are new APIs to deal with new Soroban constructs:
Address
, which helps manage "smart" addresses in the Soroban context. Addresses there (used for auth and identity purposes) can either be contracts (strkey C...
) or accounts (strkey G...
). This abstraction helps manage them and distinguish between them easily.Contract
, which helps manage contract identifiers. The primary purpose is to build invocations of its methods via the generic call(...)
, but it also provides utilities for converting to an Address
or calculating its minimum footprint for state expiration.invokeHostFunction
for calling contract codebumpFootprintExpiration
for extending the state lifetime of Soroban datarestoreFootprint
for restoring expired, off-chain state back onto the ledgerTransactionBuilder
now takes a sorobanData
parameter (and has a corresponding .setSorobanData()
builder method) which primarily describes the storage footprint of a Soroban (that is, which parts of the ledger state [in the form of xdr.LedgerKey
s] it plans to read and write as part of the transaction).
SorobanDataBuilder
factory to set fields individuallyTransactionBuilder
now has a cloneFrom(tx, opts)
constructor method to create an instance from an existing transaction, also allowing parameter overrides via opts
.buildInvocationTree
and walkInvocationTree
are both ways to visualize invocation calling trees betterauthorizeInvocation
helps multiple parties sign invocation calling treeshumanizeEvents
helps make diagnostic events more readable