v16.0.0-rc.1
Pre-releasev16.0.0-rc.1: Protocol 27
There are a few major updates in this release detailed in the migration guide:
- JS Stellar Base (
@stellar/stellar-base) was rewritten
in TypeScript, which provides proper type definitions and fixes
inconsistencies caused by manual type declarations. (#1399) - JS Stellar Base is now merged into the JS Stellar SDK. Everything lives in one
place now. (#1399) - The JS SDK now has better tree-shaking, which should result in a lighter
bundle size. (#1397) - Protocol 27 support: the XDR was regenerated for CAP-71, and the Soroban
authorization helpers now build and sign the new address-bound
(SOROBAN_CREDENTIALS_ADDRESS_V2) and delegated
(SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES) credential types. (#1429)
1. Breaking Changes
These break code, builds, or installs until you change something.
Install & runtime
-
Drop
@stellar/stellar-basefrom your dependencies if you were importing
it manually. It is now bundled into@stellar/stellar-sdk. Remove the package
and switch all imports from@stellar/stellar-baseto@stellar/stellar-sdk.
(#1399) -
Upgrade to Node 22 or later.
engines.nodeis now>=22.0.0; CI tests
against[22, 24]. (#1408) -
Stop using the default import.
import StellarBase from '@stellar/stellar-sdk'no longer works. Useimport * as StellarBaseor named imports. (#1396) -
Adjust deep
lib/imports. Library output paths moved:- ESM at
lib/esm/, - CJS at
lib/cjs/, - axios variants at
lib/axios/esm/andlib/axios/cjs/, - type declarations alongside the ESM output at
lib/esm/(e.g.lib/esm/index.d.ts).
The
dist/UMD bundle filenames are unchanged. (#1397) - ESM at
-
The package.json
browserfield and browser export conditions were
removed. Bundlers no longer auto-substitute the prebuilt UMD bundle for the
package entry — they bundle the ESM/CJS source directly. Load the UMD build
from its explicitdist/path if you need it. (#1396, #1397)
HTTP client
- Default HTTP client switched from axios to fetch. If you rely on axios
behavior (interceptors, adapters, regression fallback), import from the
alternative entry point@stellar/stellar-sdk/axiosinstead. (#1394) - The
no-eventsourcebuild variant is gone.eventsourcewas upgraded to
v4, which usesfetchinternally and works in every supported runtime (Node
22+, browsers, Deno, Bun,workerd). Remove anyno-eventsource
build/import; the default build covers all environments. (#1395) - The
/no-axiosand/minimalsubpath exports are removed, along with
their/contractand/rpcvariants. Axios is now opt-in through the@stellar/stellar-sdk/axiosfamily (/axios,/axios/contract,/axios/rpc, and@stellar/stellar-sdk/http-client/axios); the minimal build
no longer exists. (#1394) Horizon.Server.serverURLandrpc.Server.serverURLare now nativeURL
objects (andreadonly) instead ofurijsURIinstances. Code that called
urijs methods on them (server.serverURL.protocol(),.clone(),.segment(),.query()) must move to the WHATWGURLAPI (e.g.serverURL.protocol === "https:",serverURL.hostname). (#1402)
Transaction & TransactionBuilder
-
Transaction.minAccountSequenceAgeis nowbigint. The underlying XDR
type is 64-bit; consuming code must switch fromnumberto nativebigint
(the runtime value is no longer anxdr.UnsignedHyperobject either). (#1399) -
TransactionBuilder.setMinAccountSequenceAgerequiresbigint. Pass60ninstead of60.TransactionBuilderOptions.minAccountSequenceAgeis
alsobigint. (#1399) -
Transaction.extraSignersis nowxdr.SignerKey[]. It always was at
runtime — only the type was wrong. UseSignerKey.encodeSignerKey()to get
StrKey strings. (#1399) -
Transactionis no longer generic. Remove<TMemo, TOps>parameters
(e.g.,Transaction<Memo<MemoType.Text>>no longer compiles). (#1399) -
Operation.isValidAmount(),Operation.constructAmountRequirementsError(),
andOperation.setSourceAccount()are no longer on the runtimeOperation
class. JavaScript callers that reached for these need to drop them — they
remain only as internal helpers insrc/base/util/operations.ts. (#1399) -
Revoke-sponsorship operation
typeis split into seven strings."revokeSponsorship"is replaced by"revokeAccountSponsorship","revokeTrustlineSponsorship","revokeOfferSponsorship","revokeDataSponsorship","revokeClaimableBalanceSponsorship","revokeLiquidityPoolSponsorship","revokeSignerSponsorship". The runtime
always returned the specific strings; consumers that switched ontypeshould
update their cases. (#1399)
Asset, Keypair, signing helpers
Asset.codeandAsset.issuerare nowreadonly. Stop mutating them in
place — construct a newAssetinstead. (#1399)Asset.issueris typed asstring | undefined. Native assets have no
issuer; add nullish checks. (#1399)FastSigningconstant removed. Signing now goes through@noble/ed25519exclusively — drop the import. (#1401)TransactionIremoved. UseTransactionBaseinstead. (#1399)authorizeInvocation()takes a single object parameter. Switch fromauthorizeInvocation(signer, validUntilLedgerSeq, invocation, publicKey, networkPassphrase)
toauthorizeInvocation({ signer, validUntilLedgerSeq, invocation, networkPassphrase, publicKey }).
(#1399)authorizeEntry()no longer defaultsnetworkPassphrasetoNetworks.FUTURENET. Pass the network passphrase explicitly at every call
site. (#1399)
2. Should know (type-only or behavior changes that may surface)
Won't fail at install. May fail at compile time, or change behavior at runtime,
depending on how you use the API.
TypeScript-only
CreateInvocation.tokenrenamed toCreateInvocation.assetin the type
declarations — runtime was already.asset. (#1399)ScIntTypeadds'timepoint'and'duration'. Exhaustive switches onScIntTypeneed new cases. (#1399)XdrLargeInt.getType()returnsScIntType | undefinedinstead of a raw
lowercased string; non-integer types yieldundefined. (#1399)SorobanDataBuilder.fromXDRreturn type corrected toxdr.SorobanTransactionData. Runtime always returned this — only the type was
wrong. (#1399)SetOptions.clearFlags/setFlagsaccept arbitrary numeric bitmasks.
The type was widened fromAuthFlagtoAuthFlags(AuthFlag | (number & {})),
so you can now pass combined flag values without a cast. This is a widening —
existing code keeps compiling. (#1399)supportMuxingparameter removed fromdecodeAddressToMuxedAccount/encodeMuxedAccountToAddresstype declarations. It was silently ignored at
runtime. (#1399)
Runtime behavior
Keypair.rawSecretKey()throws on public-key-only instances withError("no secret seed available")instead of returningundefined. (#1399)TransactionBase.txreturns a defensive copy. External mutation no longer
affects the transaction that will be signed or serialized. If you were
intentionally mutatingtx, you'll need a different approach. (#1399)TransactionBuilderconstructor preserves0nforminAccountSequenceAgeinstead of coercing falsy values tonull. This may
fliphasV2Preconditions()totruewhen the field is set to0n. (#1399)toXDRPricerejects more bad input earlier. Zero/negative/NaN/Infinitynumeric prices now throw"price must be positive"before reachingbest_r(). Zero denominators also rejected (d <= 0). (#1399)- Constructor and input validation now throw where the SDK was previously
lenient.MuxedAccountvalidates uint64 IDs;Claimantrejects falsy
destinations;AccountrejectsNaNsequences;Memois fully immutable and
throws on invalid types instead of returningnull;Memo.id()rejects
non-plain-digit strings;allow_trustthrows whenauthorizeis missing;setTrustLineFlagsrejects non-boolean flag values;Asset.getAssetType()
throws for unknown types instead of returning"unknown". (set_optionsalso
no longer mutates the caller's signer fields.) (#1399) TransactionBuildernow validates and throws.build()throws on
total-fee overflow pastuint32max;cloneFrom()throws on zero-operation
inputs; the constructor rejects negative or invertedtimebounds/ledgerbounds. (#1399)Operation.setOptions()rejects malformed numeric strings. Flag, weight,
and threshold fields (setFlags,clearFlags,masterWeight, the signer
weight, and the*Thresholdoptions) now reject values like"123abc"thatparseFloat()previously accepted by reading only the leading digits. (#1399)XdrLargeInt/ScIntbuilt from an array of limbs now decode correctly.
Passing multiple big-endian integer parts (fori128/u128/i256/u256)
previously wrapped them in a nested array and produced wrong values; the limbs
are now passed through correctly. (#1399)- Large-integer conversions reject out-of-range / malformed input.
nativeToScValbounds-checksu32/i32values and rejects non-numeric
strings like"123abc";XdrLargeInt.toI128()/toI256()reject unsigned
values exceeding the signed range instead of silently flipping the sign bit.
(#1399) bignumber.jsupgraded to v11; v9'sDEBUGguard replaced bySTRICT
mode. Invalid values (non-numeric strings, unsupported types) still throw, as
before. The behavior that changed: v11 dropped v9's "more than 15 significant
digits" check, so a high-precision JSnumberpassed as an amount or price no
longer throws — it is silently rounded to floating-point precision instead.
Pass such values as strings orbigintto avoid quiet precision loss.
(#1401)eventsourcev4 no longer swallows exceptions thrown inside stream
callbacks. A throw inside aCallBuilder.stream()onmessage/onerror
handler now surfaces as an uncaught exception (v4's spec-compliantEventTargetno longer discards it); make those callbacks handle their own
errors. (#1395)authorizeInvocation()now buildsSOROBAN_CREDENTIALS_ADDRESS_V2
credentials instead of legacySOROBAN_CREDENTIALS_ADDRESS(CAP-71-02), so
the signature payload is now address-bound
(ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS). This is transparent if
you sign and submit through the SDK, but the entries it produces are only
valid on protocol 27+; code that asserts on the credential type, or targets a
pre-protocol-27 network, must account for the new type. (#1429)
Internal-detail shifts (low likelihood of impact)
uri.jsreplaced with nativeURL/URLSearchParamsfor internal request
building (the consumer-visible part is theserverURLtype change noted under
Breaking Changes → HTTP client). (#1402)- Root
tsconfig.jsonmoved fromconfig/tsconfig.jsonto project root —
matters if your tooling references the old path. (#1401)
3. Quietly improved (no caller action needed)
These are robustness and correctness gains rolled up by theme.
nativeToScValrobustness. Plain-object detection, per-key type lookups,
prefixed numeric inputs, and map-key sorting are more predictable.
(Caller-visible new throws are listed under Should know → Runtime behavior.)
(#1399)TransactionBuilder.addSacTransferOperationaccepts muxed addresses. Both
the destination and source may now be muxed (M...) addresses. (#1399)ScIntauto-type classification fixed for negative boundary values.-(2^63)is now classified asi64, noti128. (The relatedtoI128()/toI256()range rejections are listed under Should know → Runtime behavior.)
(#1399)- Round-trip fidelity with
Operation.fromXDRObject.changeTrustacceptslineas a fallback forasset;manageDataacceptsundefinedforopts.valueas a delete;ed25519SignedPayloadsigner keys are now decoded
instead of throwing in the default case. (#1399) - Soroban-specific fixes. Token amount formatting, custom-contract errors,
claimable-balance addresses, sorted-map comparisons, andbest_redge cases
are more reliable. (#1399) - Horizon call builders. Asset-filtered queries (offers, order book, paths,
trade aggregations) no longer emit*_asset_code/*_asset_issuerparameters
for issuerless assets, avoidingundefinedvalues in the outgoing request.
(#1402) - Misc.
Transactionconstruction avoids unnecessary copy overhead,authorizeInvocationhas a clearer missing-publicKeyerror, and asignHashX
error-message typo was fixed. (#1399)
Newly typed / newly available (the Added section, summarized)
Address, hash, sign, verify, Keypair.xdrMuxedAccount(id),SorobanDataBuilder, Memo.return(), revokeSignerSponsorship, andOperation.fromXDRObject have more complete types or signer support.scvSortedMap is now exported. New type exports: NativeToScValOpts,WasmCreateDetails, and OperationRecord. Contract-create/upload operations now
accept an auth array. (#1399)
For protocol 27 / CAP-71 Soroban authorization, authorizeEntry() now signs the
new address-bound and delegated credential types, accepts forAddress, and
exports buildAuthorizationEntryPreimage(), buildWithDelegatesEntry(),DelegateSignature, and BuildWithDelegatesParams. (#1429)
4. Internal / FYI (no consumer-visible effect)
Toolchain modernization that consumers won't notice but is worth knowing if you
build the SDK from source or maintain forks.
- Build switched from Webpack + Babel to Rollup. One
rollup.config.mjs
now produces library + UMD output, with a singletsctypes pass. (#1397) - Dual ESM + CJS package layout.
package.jsondeclares"type": "module";
CJS output lives underlib/cjs/, and internal relative imports now use
explicit.jsextensions. (#1396) - Dependency swaps for smaller footprint.
randombytesremoved (randomness
now comes fromcrypto.getRandomValues/@noble/ed25519);sha.js→@noble/hashes;@noble/curvesEd25519 →@noble/ed25519;toml→smol-toml. (#1401) eventsourcev2 → v4. Nativefetchtransport under the hood; the
dependency contributes well under 2 KB to bundles. (#1395)