A breaking change will get clearly marked in this log.
RpcServer.pollTransactionoff-by-one: the polling loop used<instead of<=, causing one fewer attempt than configured(#1373).requestAirdroperror path: fixed incorrect property access (error.response.detailinstead oferror.response.data.detail) when checking forcreateAccountAlreadyExist(#1373).- Operator precedence bug in
parseSuccessful:sim.results?.length ?? 0 > 0was parsed as?? (0 > 0), causing simulation results and state changes to never be included in the parsed response (#1373). Spec.typeRefnow properly handlesscSpecTypeResultby returning the JSON schema for theokType, instead of silently breaking out of the switch (#1373).structToJsonSchemanow placesadditionalProperties: falseon the schema object itself rather than incorrectly nesting it insideproperties(#1373).- Fixed bigint-to-U32/I32 conversion in
SpecusingNumber(val)instead ofval as number(a no-op for bigints) (#1373). - Fixed missing template literal
$in twoSpecerror messages that were not interpolated (#1373). - WASM custom section parser: when a section was skipped (invalid name length), the offset was not advanced, causing an infinite loop or incorrect parsing of subsequent sections (#1373).
FederationServer.createForDomainand theFederationServerconstructor now validate domains per RFC 1035, rejecting malformed domains; port numbers are also accepted. This may be breaking for callers that previously omitteddomainor passed an invalid domain (#1373).FederationServerURL mutation:resolveAddress,resolveAccountId, andresolveTransactionIdmutated the sharedserverURLby appending query params on each call. Fixed by cloning the URL before modifying (#1373).CallBuilder.stream()URL mutation:stream()mutated the sharedthis.urlby adding query params, corrupting the builder for subsequent calls. Fixed by cloning the URL (#1373).AssembledTransactionrestore path: whenbuildWithOpwas used and automatic state restoration was needed, the rebuild incorrectly reconstructed the operation viacontract.call()instead of reusing the original operation (#1373).SERVER_TIME_MAPport collision: the Horizon time-sync cache keyed entries by hostname only, so two servers on different ports of the same host shared a cache entry. Fixed by including the port in the key (#1373).Spec.funcResToNativenow correctly returns anErrinstance when a contract function with aResultreturn type returns an error, instead of throwing while decoding it as theOktype (#1373).- SEP-10:
verifyChallengeTxSignersnow rejects challenges signed only by the server andclient_domainkey with no actual client signer, instead of returning an empty signers list (#1372). getAssetBalanceused incorrect flag bitmask constants (AuthRequiredFlag,AuthRevocableFlag,AuthClawbackEnabledFlag) which are account-level flags, not trustline-level flags. Replaced with the correct trustline flag bitmasks (0x1,0x2,0x4) (#1372).AssembledTransaction.simulatedid not clearthis.builtbefore re-simulating after a state restoration rebuild, causing it to assemble stale transaction data (#1372).AssembledTransaction.signAndSendmutated the sharedthis.options.submitflag to prevent double submission. Replaced with a wrapper aroundsignTransactionthat injectssubmit: falsewithout mutating shared state (#1372).- Fetch HTTP client: async request interceptors were not awaited — the synchronous
try/catchloop passed unresolved promise objects as the config. Replaced with a proper.then()chain matching Axios interceptor semantics (#1372). - Fetch HTTP client:
maxRedirectsandmaxContentLengthwere silently ignored on the no-axios / minimal builds, turning SDK-set SSRF and DoS guards (StellarToml.Resolver.resolve,FederationServer) into no-ops. A new bounded adapter activates when either option is set, refusing redirects pastmaxRedirectsand streaming the response body with a running-total check so oversized responses abort mid-stream (#1390). src/bindings/config.tsimported../../package.jsonwith a relative path that resolved incorrectly for thelib/no-axios/andlib/minimal/build outputs, making those libs unloadable. Replaced with the__PACKAGE_VERSION__compile-time define (#1390).
AccountResponseconstructor now uses explicit field-by-field assignment instead ofObject.entriesdynamic assignment for type safety (#1373).- Added
transactionscollection toApi.AccountRecordandAccountResponse(#1373). - Added range checks for U32/I32 values in
Spec: bigint values are now validated against min/max bounds before conversion, throwing aRangeErrorinstead of silently truncating (#1373). rpc.Server.getLatestLedger()now includescloseTime,headerXdr, andmetadataXdrin the typed response, withheaderXdr/metadataXdrparsed into XDR objects instead of raw base64 strings (#1389 ).
BalanceResponse.revocableis deprecated in favor ofauthorizedToMaintainLiabilities, which correctly reflects the trustline flag semantics (#1372).
- Pin axios to a specific version.
- XDR has been upgraded to support Protocol 26, please refer to the
@stellar/stellar-baserelease notes for details and other breaking changes.
- Sanitize identifiers and escape string literals in generated TypeScript bindings to prevent code injection via malicious contract spec names.
sanitizeIdentifiernow strips non-identifier characters, and a newescapeStringLiteralhelper escapes quotes and newlines in string contexts (#1345). AssembledTransaction.fromXDR()andfromJSON()now validate that the deserialized transaction targets the expected contract, rejecting mismatched contract IDs and non-invokeContract operations. (#1349).
- Fix
assembleTransactiondouble-counting the resource fee when the input transaction already has Soroban data attached (e.g. when re-assembling a previously simulated transaction) (#1343). - Removed adding
resourceFeeinassembleTransactionas it's now handled byTransactionBuilder.build()(#1343).
- Upgraded underlying
@stellar/stellar-baselibrary to include its new features and fixes (release notes).
- Introduced CLI functionality for generating smart contract bindings (#1287).
- Added
BindingGenerationclass for parsing contract specs into fully typed TypeScript libraries for calling contract methods (#1287). - Introduced
rpc.Server.fundAddressthat supports funding contract and account addresses via Friendbot (#1314). - Updated the
StellarTomlinterface with SEP 45 fieldsWEB_AUTH_FOR_CONTRACTS_ENDPOINTandWEB_AUTH_CONTRACT_ID(#1326).
- X-App-Name and X-App-Version headers are now included when using
CallBuilder.stream()(#1317). CallBuildernow correctly uses the configured server URL for all requests, including pagination and linked resources. Previously, URLs returned by Horizon in_linkswould bypass reverse proxies (#1318).
rpc.Server.requestAirdropis deprecated in favor ofrpc.Server.fundAddress(#1314).
- Upgraded underlying
@stellar/stellar-baselibrary to include its fixes (release notes).
- Fixed package installation for Windows environments (#1306)
- Set
Api.GetEventsRequest.endLedgerto be optional to align with RPC behavior (#1304) - Added back
Typepointand marked it deprecated in favor ofTimepoint(#1303)
- Introduced an
rpc.Server.getAssetBalance()helper to fetch asset balances both for contracts and accounts (#1286). rpc.Api.BalanceResponsenow can include arevocablefield in itsbalanceEntryfor when trustlines are fetched (#1286).- Added Timepoint and Duration support to
Spec(#1288) Api.GetHealthResponseinterface now includeslatestLedger,ledgerRetentionWindow, andoldestLedgerfields (#1297).- Added
publicKey,signTransaction, andsignAuthEntryas optional fields tocontract.MethodOptions(#1293).
Api.RawEventResponse.topicsis now optional to reflect topicless events (#1292).parseRawEventscorrectly checks ifApi.RawEventResponse.topicsis undefined (#1292).- Remove
WebAssemblyusage in favor of manual wasm parsing (#1300). - Fixed URL contamination in
Horizon.Servermethods (#1296).
Spec.nativeToScValsupports parsing Muxed Address(#1274),
AssembledTransaction.sign()throws an error ifpublicKeywas not provided when instantiated (#1269).
- Added optional
server: rpc.Serverfield toClientOptionfor HttpClient reuse. (#1234).
- Replaced global
HttpClientwith per-instance clients inhorizon.Serverandrpc.Serverto prevent cross-instance header contamination (#1234).
Spec.scValToNativenow supports parsingOptions (#1228).- Added
getLedgersmethod torpc.Serverfor retreiving ledger data. (#1231).
Spec.scValToNativereturnsnullforvoids orOptionals instead of the ambiguousundefined(#1228).- The
getEventsAPI now requires either a start and end ledger or a cursor to be provided (#1231).
GetEventsRequestinterface moved fromserver.tstoapi.ts(#1231).
rpc.Servernow includesgetAccountEntry,getTrustlineEntry, andgetClaimableBalancemethods to facilitate retrieving those entries without manually constructing the ledger keys (#1218, #1221).
- The
getTransactionsAPI no longer requiresstartLedgerwhen providingcursorbecause they are mutually exclusive (#1192). - Updated
@stellar/stellar-baseto latest patch (see its release notes, #1221).
- Added missing
transactionIndexandoperationIndextogetEventsreturn schema (#1206). - Remove previously-deprecated and now-removed
pagingTokenfromgetEvents(useidinstead or the top-levelcursor, depending on pagination needs) (#1207).
- Add support to
new contract.Spec(...)for constructing from a stream ofScSpecEntryXDR entries (base64, or binary) (#1198). - Add
contract.Spec.fromWasm(wasmFile)for extracting contract spec from contract Wasm files. (#1198).
- This package requires Node 20.
- XDR has been upgraded to support Protocol 23, please refer to the
@stellar/stellar-baserelease notes for details and other breaking changes. - Removes the defunct
destination_muxed_id_typefield for Horizon balance changes (#1187).
- The Horizon API's
BalanceChangeobject for operations now optionally has details about muxed information if the invocation involved a muxed destination address:
export type MuxedIdType = "uint64" | "string" | "bytes";
export interface BalanceChange {
// ...
destination_muxed_id_type?: MuxedIdType;
destination_muxed_id?: string;
}- The RPC server's
getTransactionandgetTransactionsresponses now include a top-leveleventsobject containing a disjoint breakdown of the events:
export interface TransactionEvents {
transactionEventsXdr: xdr.TransactionEvent[];
contractEventsXdr: xdr.ContractEvent[][];
}- The RPC server's
getEventsnow includes retention state information:
export interface GetEventsResponse {
// ...
oldestLedger: number;
latestLedgerCloseTime: string;
oldestLedgerCloseTime: string;
}- The RPC server's
simulateTransactionmethod now includes an optionalauthModeparameter to specify the type of authorization to simulate:
export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot";AssembledTransaction#signAndSendnow takes awatcherargument (#1174). Thiswatcheris an abstract class with two optional methods:onSubmitted: called with the return value from thesendTransactioncall that submits the transaction to the network for processingonProgress: called with each return value ofgetTransactionthat checks on the ongoing status of the transaction
For example, a watcher like this:
await tx.signAndSend({ watcher: {
onSubmitted: ({ status, hash, latestLedger }) => {
console.log({ status, hash, latestLedger });
},
onProgress: ({ status, txHash, latestLedger }) => {
console.log({ status, txHash, latestLedger });
}
}});...will result in output like:
{
status: 'PENDING',
hash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
latestLedger: 25076
}
{
status: 'NOT_FOUND',
txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
latestLedger: 25076
}
{
status: 'SUCCESS',
txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
latestLedger: 25077
}
- Fixed type for Horizon streaming endpoints, namely
EventSourceOptions.onmessagenow extendsCollectionPage(#1100). - Fix the issue of transaction submission failure in a no axios environment (#1176).
- Fixes a bug in
Rpc.Server.getTransactionwhere eithertransactionEventsXdrand/orcontractEventsXdrmay not be present in the neweventsfield.
- The RPC server's
getTransactionandgetTransactionsresponses have dropped theevents.diagnosticEventsXdrfield (#1183):
export interface TransactionEvents {
- diagnosticEventsXdr: xdr.DiagnosticEvent[];
transactionEventsXdr: xdr.TransactionEvent[];
}- Fixed type for Horizon streaming endpoints, namely
EventSourceOptions.onmessagenow extendsCollectionPage(#1100).
- This package requires Node 20.
- XDR has been upgraded to support Protocol 23, please refer to the
@stellar/stellar-baserelease notes for details and other breaking changes. - Deprecated:
getTransactionandgetTransactionstop-leveldiagnosticEventsXdrfield.
- The Horizon API's
BalanceChangeobject for operations now optionally has details about muxed information if the invocation involved a muxed destination address:
export type MuxedIdType = "uint64" | "string" | "bytes";
export interface BalanceChange {
// ...
destination_muxed_id_type?: MuxedIdType;
destination_muxed_id?: string;
}- The RPC server's
getTransactionandgetTransactionsresponses now include a top-leveleventsobject containing a disjoint breakdown of the events:
export interface TransactionEvents {
diagnosticEventsXdr: xdr.DiagnosticEvent[];
transactionEventsXdr: xdr.TransactionEvent[];
contractEventsXdr: xdr.ContractEvent[][];
}- The RPC server's
getEventsnow includes retention state information:
export interface GetEventsResponse {
// ...
oldestLedger: number;
latestLedgerCloseTime: string;
oldestLedgerCloseTime: string;
}- The RPC server's
simulateTransactionmethod now includes an optionalauthModeparameter to specify the type of authorization to simulate:
export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot";-
AssembledTransaction#signAndSendnow takes awatcherargument (#1174). Thiswatcheris an abstract class with two optional methods:onSubmitted: called with the return value from thesendTransactioncall that submits the transaction to the network for processingonProgress: called with each return value ofgetTransactionthat checks on the ongoing status of the transaction
For example, a
watcherlike this:await tx.signAndSend({ watcher: { onSubmitted: ({ status, hash, latestLedger }) => { console.log({ status, hash, latestLedger }); }, onProgress: ({ status, txHash, latestLedger }) => { console.log({ status, txHash, latestLedger }); } }});
...will result in output like:
{ status: 'PENDING', hash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25076 } { status: 'NOT_FOUND', txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25076 } { status: 'SUCCESS', txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25077 }
- Fix the issue of transaction submission failure in a no axios environment (#1176).
- Add
includeFailedtoPaymentCallBuilderfor including failed transactions in calls (#1168).
- Ensure that
rpc.Api.GetTransactionsResponse.transactionsis always a valid array (#1162).
- Support passing in an optional
options.addressto thecontract.Client.deploymethod (#1158).
- Extend support for parsing contract specifications in environments that don't have WebAssembly compilers (#1157).
- Upgraded
@stellar/stellar-basedependency to latest version (#1159).
- Added
Horizon.Server.rootto obtain information from the Horizon root endpoint (#1122).
- When using a friendbot that points to a Horizon instance that has ledger metadata disabled, you can no longer extract the account sequence from the response. Instead, we hit RPC directly (#1107).
rpc.Server.getEvents()now correctly returns thecursorfield at the top-level response (#1124).
This is a direct re-tag of rc.2 with the only change being an upgrade to the stellar-base library to incorporate a patch release. Nonetheless, the entire changelog from the prior major version here is replicated for a comprehensive view on what's broken, added, and fixed.
- We stopped supporting Node 18 explicitly a while ago, but now the Babelification of the codebase will transform to Node 18 instead of 16.
contract.AssembledTransaction#signAuthEntriesnow takes anaddressinstead of apublicKey. This brings the API more inline with its actual functionality: It can be used to sign all the auth entries for a particular address, whether that is the address of an account (public key) or a contract. (#1044).- The
ClientOptions.signTransactiontype has been updated to reflect the latest SEP-43 protocol, which matches the latest major version of Freighter and other wallets. It now acceptsaddress,submit, andsubmitUrloptions, and it returns a promise containing thesignedTxXdrand thesignerAddress. It now also returns anErrortype if an error occurs during signing.basicNodeSignerhas been updated to reflect this new type.
ClientOptions.signAuthEntrytype has been updated to reflect the SEP-43 protocol, which returns a promise containing thesignerAddressin addition to thesignAuthEntrythat was returned previously. It also can return anErrortype.SentTransaction.initandnew SentTransactionnow take one (1) argument instead of two (2). The first argument had previously been deprecated and ignored. To update:
-SentTransaction(nonsense, realStuff)
+SentTransaction(realStuff)
-new SentTransaction(nonsense, realStuff)
+new SentTransaction(realStuff)- Deprecated RPC APIs have been removed (#1084):
simulateTransaction'scostfield is removedrpc.Server.getEvents'spagingTokenfield is deprecated, usecursorinstead
- Deprecated Horizon APIs have been removed (deprecated since v10.0.1, ):
- removed fields
transaction_count,base_fee, andbase_reserve - removed fields
num_accountsandamountfrom assets
- removed fields
- The
SorobanRpcimport, previously deprecated, has been removed. You can importrpcinstead:
-import { SorobanRpc } from '@stellar/stellar-sdk'
+import { rpc } from '@stellar/stellar-sdk'
// alternatively, you can also import from the `rpc` entrypoint:
import { Server } from '@stellar/stellar-sdk/rpc'contract.Clientnow has a staticdeploymethod that can be used to deploy a contract instance from an existing uploaded/"installed" Wasm hash. The first arguments to this method are the arguments for the contract's__constructormethod in accordance with CAP-42 (#1086). For example, using theincrementtest contract as modified in https://github.com/stellar/soroban-test-examples/pull/2/files#diff-8734809100be3803c3ce38064730b4578074d7c2dc5fb7c05ca802b2248b18afR10-R45:
const tx = await contract.Client.deploy(
{ counter: 42 },
{
networkPassphrase,
rpcUrl,
wasmHash: uploadedWasmHash,
publicKey: someKeypair.publicKey(),
...basicNodeSigner(someKeypair, networkPassphrase),
},
);
const { result: client } = await tx.signAndSend();
const t = await client.get();
expect(t.result, 42);contract.AssembledTransaction#signAuthEntriesnow allows you to overrideauthorizeEntry. This can be used to streamline novel workflows using cross-contract auth. (#1044).
Horizon.ServerApinow has anEffectTypeexported so that you can compare and infer effect types directly (#1099).Horizon.ServerApi.Tradetype now has atype_ifield for type inference (#1099).- All effects now expose their type as an exact string (#947).
stellartoml.Resolver.resolvenow has aallowedRedirectsoption to configure the number of allowed redirects to follow when resolving a stellar toml file.rpc.Server.getEventsnow returns acursorfield that matchespagingTokenandidrpc.Server.getTransactionsnow returns atxHashfieldrpc.Serverhas two new methods:
export interface BalanceResponse {
latestLedger: number;
/** present only on success, otherwise request malformed or no balance */
balanceEntry?: {
/** a 64-bit integer */
amount: string;
authorized: boolean;
clawback: boolean;
lastModifiedLedgerSeq?: number;
liveUntilLedgerSeq?: number;
};
}- You can now build the browser bundle without various dependencies:
- Set
USE_AXIOS=falseto build without theaxiosdependency: this will buildstellar-sdk-no-axios.jsandstellar-sdk-no-axios.min.jsin thedist/directory, or just runyarn build:browser:no-axiosto generate these files. - You can import Node packages without the
axiosdependency via@stellar/stellar-sdk/no-axios. For Node environments that don't support modern imports, use@stellar/stellar-sdk/lib/no-axios/index. - Set
USE_EVENTSOURCE=falseto build without theeventsourcedependency: this will buildstellar-sdk-no-eventsource.jsandstellar-sdk-no-eventsource.min.jsin thedist/directory, or just runyarn build:browser:no-eventsourceto generate these files. - You can import Node packages without the
eventsourcedependency via@stellar/stellar-sdk/no-eventsource. For Node.js environments that don't support modern imports, use@stellar/stellar-sdk/lib/no-eventsource/index. - To use a minimal build without both Axios and EventSource, use
stellar-sdk-minimal.jsfor the browser build and import from@stellar/stellar-sdk/minimalfor the Node package.
- Set
contract.AssembledTransaction#nonInvokerSigningBynow correctly returns contract addresses, in instances of cross-contract auth, rather than throwing an error.signwill ignore these contract addresses, since auth happens via cross-contract call (#1044).buildInvocationTreenow correctly handles V2 contract creation and displays constructor args (js-stellar-base#785).
- The
ClientOptions.signTransactiontype has been updated to reflect the latest SEP-43 protocol, which matches the latest major version of Freighter and other wallets. It now acceptsaddress,submit, andsubmitUrloptions, and it returns a promise containing thesignedTxXdrand thesignerAddress. It now also returns anErrortype if an error occurs during signing.basicNodeSignerhas been updated to reflect the new type.
ClientOptions.signAuthEntrytype has also been updated to reflect the SEP-43 protocol, which also returns a promise containing thesignerAddressin addition to thesignAuthEntrythat was returned previously. It also can return anErrortype.
contract.Clientnow has a staticdeploymethod that can be used to deploy a contract instance from an existing uploaded/"installed" Wasm hash. The first arguments to this method are the arguments for the contract's__constructormethod in accordance with CAP-42 (#1086).
For example, using the increment test contract as modified in https://github.com/stellar/soroban-test-examples/pull/2/files#diff-8734809100be3803c3ce38064730b4578074d7c2dc5fb7c05ca802b2248b18afR10-R45:
const tx = await contract.Client.deploy(
{ counter: 42 },
{
networkPassphrase,
rpcUrl,
wasmHash: uploadedWasmHash,
publicKey: someKeypair.publicKey(),
...basicNodeSigner(someKeypair, networkPassphrase),
},
);
const { result: client } = await tx.signAndSend();
const t = await client.get();
expect(t.result, 42);Horizon.ServerApinow has anEffectTypeexported so that you can compare and infer effect types directly (#1099).Horizon.ServerApi.Tradetype now has atype_ifield for type inference.- All effects now expose their type as an exact string (#947).
stellartoml-Resolver.resolvenow has aallowedRedirectsoption to configure the number of allowed redirects to follow when resolving a stellar toml file.
-
Deprecated RPC APIs have been removed (#1084):
simulateTransaction'scostfield is removedgetEventsreturns acursorfield that matchespagingTokenandidgetTransactionsreturns atxHashfield
-
Horizon Server API types: removed fields
transaction_count,base_fee, andbase_reserve(deprecated since v10.0.1) -
SentTransaction.initandnew SentTransactionnow take one (1) argument instead of two (2). The first argument had previously been deprecated and ignored. To update:-SentTransaction(nonsense, realStuff) +SentTransaction(realStuff) -new SentTransaction(nonsense, realStuff) +new SentTransaction(realStuff)
-
SorobanRpcimport, previously deprecated, has been removed. You can importrpcinstead:-import { SorobanRpc } from '@stellar/stellar-sdk' +import { rpc } from '@stellar/stellar-sdk'
As an alternative, you can also import from the
rpcentrypoint:import { Server } from '@stellar/stellar-sdk/rpc'
rpc.Servernow has apollTransactionmethod to retry transaction retrieval ([#1092]#1092).
contract.AssembledTransaction#signAuthEntriesnow takes anaddressinstead of apublicKey. This brings the API more inline with its actual functionality: It can be used to sign all the auth entries for a particular address, whether that is the address of an account (public key) or a contract. (#1044).- The Node.js code will now Babelify to Node 18 instead of Node 16, but we stopped supporting Node 16 long ago so this shouldn't be a breaking change.
- You can now build the browser bundle without various dependencies:
- Set
USE_AXIOS=falseto build without theaxiosdependency: this will buildstellar-sdk-no-axios.jsandstellar-sdk-no-axios.min.jsin thedist/directory, or just runyarn build:browser:no-axiosto generate these files. - You can import Node packages without the
axiosdependency via@stellar/stellar-sdk/no-axios. For Node environments that don't support modern imports, use@stellar/stellar-sdk/lib/no-axios/index. - Set
USE_EVENTSOURCE=falseto build without theeventsourcedependency: this will buildstellar-sdk-no-eventsource.jsandstellar-sdk-no-eventsource.min.jsin thedist/directory, or just runyarn build:browser:no-eventsourceto generate these files. - You can import Node packages without the
eventsourcedependency via@stellar/stellar-sdk/no-eventsource. For Node.js environments that don't support modern imports, use@stellar/stellar-sdk/lib/no-eventsource/index. - To use a minimal build without both Axios and EventSource, use
stellar-sdk-minimal.jsfor the browser build and import from@stellar/stellar-sdk/minimalfor the Node package.
- Set
contract.AssembledTransaction#signAuthEntriesnow allows you to overrideauthorizeEntry. This can be used to streamline novel workflows using cross-contract auth. (#1044)rpc.Servernow has agetSACBalancehelper which lets you fetch the balance of a built-in Stellar Asset Contract token held by a contract (#1046):
export interface BalanceResponse {
latestLedger: number;
/** present only on success, otherwise request malformed or no balance */
balanceEntry?: {
/** a 64-bit integer */
amount: string;
authorized: boolean;
clawback: boolean;
lastModifiedLedgerSeq?: number;
liveUntilLedgerSeq?: number;
};
}contract.AssembledTransaction#nonInvokerSigningBynow correctly returns contract addresses, in instances of cross-contract auth, rather than throwing an error.signwill ignore these contract addresses, since auth happens via cross-contract call (#1044).
rpc.Servernow has agetTransactions, which has the same response schema asgetTransactionsexcept with bundles of transactions (#1037).rpc.Servernow has agetVersionInfomethod which reports version information of the RPC instance it is connected to (#1028):
export interface GetVersionInfoResponse {
version: string;
commit_hash: string;
build_time_stamp: string;
captive_core_version: string;
protocol_version: number;
}- Lower authorization entry's default signature expiration to ~8min for security reasons (#1023).
- Remove
statusTexterror check to broaden compatibility (#1001). - Upgraded
stellar-basewhich includes various fixes (release notes, #1045).
@stellar/stellar-baseand its underlying dependency@stellar/js-xdrhave been upgraded to their latest versions; reference their release notes (v12.1.0 and v3.1.2, respectively) for details (#1013).
- You can now pass custom headers to both
rpc.ServerandHorizon.Server(#1013):
import { Server } from "@stellar/stellar-sdk/rpc";
const s = new Server("<some URL>", { headers: { "X-Custom-Header": "hello" }})Horizon.Servernow supports the newPOST /transactions_asyncendpoint via thesubmitAsyncTransactionmethod (#989). Its purpose is to provide an immediate response to the submission rather than waiting for Horizon to determine its status. The response schema is as follows:
interface SubmitAsyncTransactionResponse {
// the submitted transaction hash
hash: string;
// one of "PENDING", "DUPLICATE", "TRY_AGAIN_LATER", or "ERROR"
tx_status: string;
// a base64-encoded xdr.TransactionResult iff `tx_status` is "ERROR"
error_result_xdr: string;
}rpc.Servernow has agetFeeStatsmethod which retrieves fee statistics for a previous chunk of ledgers to provide users with a way to provide informed decisions about getting their transactions included in the following ledgers (#998):
export interface GetFeeStatsResponse {
sorobanInclusionFee: FeeDistribution;
inclusionFee: FeeDistribution;
latestLedger: number; // uint32
}
interface FeeDistribution {
max: string; // uint64
min: string; // uint64
mode: string; // uint64
p10: string; // uint64
p20: string; // uint64
p30: string; // uint64
p40: string; // uint64
p50: string; // uint64
p60: string; // uint64
p70: string; // uint64
p80: string; // uint64
p90: string; // uint64
p95: string; // uint64
p99: string; // uint64
transactionCount: string; // uint32
ledgerCount: number; // uint32
}contractnow exports theDEFAULT_TIMEOUT(#984).contract.AssembledTransactionnow has:toXDRandfromXDRmethods for serializing the transaction to and from XDR. These methods should be used in place ofAssembledTransaction.toJSONandAssembledTransaction.fromJSONfor multi-auth signing. The JSON methods are now deprecated. Note: you must now callsimulateon the transaction before the finalsignAndSendcall after all required signatures are gathered when using the XDR methods (#977).- a
restoreFootprintmethod which accepts therestorePreamblereturned when a simulation call fails due to some contract state that has expired. When invoking a contract function, one can now setrestoretotruein theMethodOptions. When enabled, arestoreFootprinttransaction will be created and await signing when required (#991). - separate
signandsendmethods so that you can sign a transaction without sending it (signAndSendstill works as before; #922).
contract.Clientnow has atxFromXDRmethod which should be used in place oftxFromJSONfor multi-auth signing (#977).
- In
contract.AssembledTransaction,toJSONandfromJSONshould be replaced withtoXDRandfromXDR. - In
contract.Client,txFromJSONshould be replaced withtxFromXDR.
- If you edit an
AssembledTransactionwithtx.raw = cloneFrom(tx.build), thetx.simulationDatawill now be updated correctly (#985).
- This is a re-tag of
v12.0.0-rc.3with dependency updates and a single new feature.
rpc.server.simulateTransactionnow supports an optionalstateChanges?: LedgerEntryChange[]field (#963):- If
Beforeis omitted, it constitutes a creation, ifAfteris omitted, it constitutes a deletions, note thatBeforeandAftercannot be omitted at the same time. Each item follows this schema:
- If
interface LedgerEntryChange {
type: number;
key: xdr.LedgerKey;
before: xdr.LedgerEntry | null;
after: xdr.LedgerEntry | null;
}ContractClientfunctionality previously added in v11.3.0 was exported in a non-standard way. You can now import it as any otherstellar-sdkmodule (#962):
-import { ContractClient } from '@stellar/stellar-sdk/lib/contract_client'
+import { contract } from '@stellar/stellar-sdk'
+const { Client } = contractNote that this top-level contract export is a container for ContractClient and related functionality. The ContractClient class is now available at contract.Client, as shown. Further note that there is a capitalized Contract export as well, which comes from stellar-base. You can remember which is which because capital-C Contract is a class, whereas lowercase-c contract is a container/module with a bunch of classes, functions, and types.
Additionally, this is available from the /contract entrypoint, if your version of Node and TypeScript support the exports declaration. Finally, some of its exports have been renamed:
import {
- ContractClient,
+ Client,
AssembledTransaction,
- ContractClientOptions,
+ ClientOptions,
SentTransaction,
-} from '@stellar/stellar-sdk/lib/contract_client'
+} from '@stellar/stellar-sdk/contract'- The
ContractSpecclass is now nested under thecontractmodule, and has been renamed toSpec(#962). Alternatively, you can import this from thecontractentrypoint, if your version of Node and TypeScript support theexportsdeclaration:
-import { ContractSpec } from '@stellar/stellar-sdk'
+import { contract } from '@stellar/stellar-sdk'
+const { Spec } = contract
// OR
+import { Spec } from '@stellar/stellar-sdk/contract'- Previously,
AssembledTransaction.signAndSend()would return aSentTransactioneven if the transaction was never finalized. That is, if it successfully sent the transaction to the network, but the transaction was stillstatus: 'PENDING', then it wouldconsole.erroran error message, but return the indeterminate transaction anyhow. It now throws aSentTransaction.Errors.TransactionStillPendingerror with that error message instead (#962).
SorobanRpcmodule is now also exported asrpc(#962). You can import it with either name for now, butSorobanRpcwill be removed in a future release:
-import { SorobanRpc } from '@stellar/stellar-sdk'
+import { rpc } from '@stellar/stellar-sdk'You can also now import it at the /rpc entrypoint, if your version of Node and TypeScript support the exports declaration.
-import { SorobanRpc } from '@stellar/stellar-sdk'
-const { Api } = SorobanRpc
+import { Api } from '@stellar/stellar-sdk/rpc'- New methods on
contract.Client(#960):from(opts: ContractClientOptions)instantiatescontract.Clientby fetching thecontractId's WASM from the network to fill out the client'sContractSpec.fromWasmandfromWasmHashmethods to instantiate acontract.Clientwhen you already have the WASM bytes or hash alongside thecontract.ClientOptions.
- New methods on
rpc.Server(#960):getContractWasmByContractIdandgetContractWasmByHashto retrieve a contract's WASM bytecode via itscontractIdorwasmHash, respectively.
- The breaking changes above (strictly speaking, they are not breaking changes because importing from the inner guts of the SDK is not supported) enable the
contractmodule to be used in non-Node environments.
This update supports Protocol 21. It is an additive change to the protocol so there are no true backwards incompatibilities, but your software may break if you encounter new unexpected fields from this Protocol (#949).
- The default timeout for transaction calls is now set to 300 seconds (5 minutes) from the previous default of 10 seconds. 10 seconds is often not enough time to review transactions before signing, especially in Freighter or using a hardware wallet like a Ledger, which would cause a
txTooLateerror response from the server. Five minutes is also the value used by the CLI, so this brings the two into alignment (#956).
- Dependencies have been properly updated to pull in Protocol 21 XDR (#959).
- This update supports Protocol 21. It is an additive change to the protocol so there are no true backwards incompatibilities, but your software may break if you encounter new unexpected fields from this Protocol (#949).
- Each item in the
GetEventsResponse.eventslist will now have atxHashitem corresponding to the transaction hash that triggered a particular event (#939). ContractClientnow properly handles methods that take no arguments by makingMethodOptionsthe only parameter, bringing it inline with the types generated by Soroban CLI'ssoroban contract bindings typescript(#940).ContractClientnow allowspublicKeyto be undefined (#941).SentTransactionwill only passallowHttpif (and only if) its correspondingAssembledTransaction#optionsconfig allowed it (#952).SentTransactionwill now modify the time bounds of the transaction to betimeoutInSecondsseconds after the transaction has been simulated. Previously this was set when the transaction is built, before the simulation. This makes the time bounds line up with the timeout retry logic inSentTransaction.
- Introduces an entire suite of helpers to assist with interacting with smart contracts (#929):
ContractClient: generate a class from the contract specification where each Rust contract method gets a matching method in this class. Each method returns anAssembledTransactionthat can be used to modify, simulate, decode results, and possibly sign, & submit the transaction.AssembledTransaction: used to wrap a transaction-under-construction and provide high-level interfaces to the most common workflows, while still providing access to low-level transaction manipulation.SentTransaction: transaction sent to the Soroban network, in two steps - initial submission and waiting for it to finalize to get the result (retried with exponential backoff)
- Upgrade underlying dependencies, including
@stellar/js-xdrwhich should broaden compatibility to pre-ES2016 environments (#932, #930).
SorobanRpc: remove all instances of array-based parsing to conform to future breaking changes in Soroban RPC (#924).
- Event streaming tests now pass on Node 20, which seems to have tighter conformance to the spec (#917).
@stellar/stellar-basehas been upgraded to its latest major version (#918, see v11.0.0 for release notes).
- An unnecessary dependency has been removed which was causing a TypeScript error in certain environments (#912).
- Dependencies have been upgraded (see
stellar-base@v10.0.2for release notes, #913).
- Support for the new, optional
diagnosticEventsXdrfield on theSorobanRpc.Server.sendTransactionmethod. The raw field will be present when using the_sendTransactionmethod, while the normal method will have an already-parseddiagnosticEvents: xdr.DiagnosticEvent[]field, instead (#905). - A new exported interface
SorobanRpc.Api.EventResponseso that developers can type-check individual events (#904).
SorobanRpc.Server.simulateTransactionnow supports an optionaladdlResourcesparameter to allow users to specify additional resources that they want to include in a simulation (#896).ContractSpecnow has ajsonSchema()method to generate a JSON Schema for a particular contract specification (#889).
- All dependencies have been updated to their latest versions, including
stellar-baseto v10.0.1 which included a small patch (#897).
SorobanRpc.Server.getEventsuses the correct type for the start ledger.
- The package has been renamed to
@stellar/stellar-sdk. - The new minimum supported version is Node 18.
- The
PaymentCallBuilderwas incorrectly indicating that it would return a collection ofPaymentrecords, while in reality it can return a handful of "payment-like" records (#885).
- The
SorobanRpc.Server.getEventsmethod now correctly parses responses without acontractIdfield set. Theevents[i].contractIdfield on an event is now optional, omitted if there was no ID for the event (e.g. system events; (#883)).
- The
stellar-baselibrary has been upgraded tobeta.4which contains a bugfix for large sequence numbers (#877). - The
SorobanRpc.Server.getTransaction()method will now return the full response when encountering aFAILEDtransaction result (#872). - The
SorobanRpc.Server.getEvents()method will correctly parse the event value (which is anxdr.ScValrather than anxdr.DiagnosticEvent, see the modifiedSorobanRpc.Api.EventResponse.value; #876).
- The
soroban-clientlibrary (stellar/js-soroban-client) has been merged into this package, causing significant breaking changes in the module structure (#860):- The namespaces have changed to move each server-dependent component into its own module. Shared components (e.g.
TransactionBuilder) are still in the top level, Horizon-specific interactions are in theHorizonnamespace (i.e.Serveris nowHorizon.Server), and new Soroban RPC interactions are in theSorobanRpcnamespace. - There is a detailed migration guide available to outline both the literal (i.e. necessary code changes) and philosophical (i.e. how to find certain functionality) changes needed to adapt to this merge.
- The namespaces have changed to move each server-dependent component into its own module. Shared components (e.g.
- The
SorobanRpc.Server.prepareTransactionandSorobanRpc.assembleTransactionmethods no longer need an optionalnetworkPassphraseparameter, because it is implicitly part of the transaction already (#870).
- The
stellar-basedependency has been pinned to a specific version to avoid incorrect semver resolution (#867).
- Fix a webpack error preventing correct exports of the SDK for browsers (#862).
- Certain effects have been renamed to align better with the "tense" that other structures have (#844):
DepositLiquidityEffect->LiquidityPoolDepositedWithdrawLiquidityEffect->LiquidityPoolWithdrewLiquidityPoolTradeEffect->LiquidityPoolTradeLiquidityPoolCreatedEffect->LiquidityPoolCreatedLiquidityPoolRevokedEffect->LiquidityPoolRevokedLiquidityPoolRemovedEffect->LiquidityPoolRemoved
- New effects have been added to support Protocol 20 (Soroban) (#842):
ContractCreditedoccurs when a Stellar asset moves into its corresponding Stellar Asset Contract instanceContractDebitedoccurs when a Stellar asset moves out of its corresponding Stellar Asset Contract instance
- Asset stat records (
ServerApi.AssetRecord) contain two new fields to support the Protocol 20 (Soroban) release (#841):num_contracts- the integer quantity of contracts that hold this assetcontracts_amount- the total units of that asset held by contracts
- New operation responses (#845):
invokeHostFunction: seeHorizon.InvokeHostFunctionOperationResponsebumpFootprintExpiration: seeHorizon.BumpFootprintExpirationOperationResponserestoreFootprint: seeHorizon.RestoreFootprintOperationResponse- You can refer to the actual definitions for details, but the gist of the schemas is below:
interface InvokeHostFunctionOperationResponse {
function: string;
parameters: {
value: string;
type: string;
}[];
address: string;
salt: string;
asset_balance_changes: {
type: string;
from: string;
to: string;
amount: string;
}[];
}
interface BumpFootprintExpirationOperationResponse {
ledgersToExpire: string;
}
interface RestoreFootprintOperationResponse {};- Some effect definitions that were missing have been added (#842):
ClaimableBalanceClawedBackis now definedtype EffectRecordnow has all of the effect types
- The
stellar-baselibrary has been upgraded to support the latest Protocol 20 XDR schema and all Soroban functionality ().
- Bundle size has decreased by dropping unnecessary dependencies (
lodash: #822,es6-promise: #823, polyfills: #825,detect-node: #831). - Dependencies (including
stellar-base) have been updated to their latest versions (#825, #827).
This version is marked by a major version bump because of the significant upgrades to underlying dependencies. While there should be no noticeable API changes from a downstream perspective, there may be breaking changes in the way that this library is bundled.
- Build system has been overhauled to support Webpack 5 (#814).
stellar-basehas been updated to its corresponding overhaul (#818).
- Bumps
stellar-baseversion to v8.2.2 to include latest fix: enabling fast signing in service workers (#806).
- Add SEP-1 fields to
StellarTomlResolverfor type checks (#794). - Add support for passing
X-Auth-Tokenas a custom header (#795).
- Bumps
stellar-baseversion to v8.2.1 to include latest fixes.
- Adds
successfulfield to transaction submission response (#790).
- Bumps
stellar-baseversion to v8.2.0 to include CAP-40 support inOperation.setOptions.
- Adds the missing
successfulfield to transaction responses (#790).
- Bumps
stellar-baseversion to v8.1.0 to include bug fixes and latest XDR changes.
- Upgrades the
eventsourcedependency to fix a critical security vulnerability (#783).
- Reverts a change from v10.1.0 which caused streams to die prematurely (#780).
- Bumps
stellar-baseversion to v8.0.1 to include latest bugfixes.
This is a promotion from the beta version without changes, besides upgrading the underlying stellar-base@v8.0.0 to its stable release.
- Add a way to filter offers by seller:
OfferCallBuilder.seller(string), corresponding toGET /offers?seller=<string>(#773).
- Support for Protocol 19 (#775):
- new precondition fields on a
TransactionResponse - new account fields on
AccountResponseandAccountRecord - bumping
stellar-baseto the latest beta version
- new precondition fields on a
- Add missing field to account responses:
last_modified_timewhich is the time equivalent of the existinglast_modified_ledger(#770). - Stop opening extra connections when SSE streams receive
event: closeevents (#772). - Fix SSE streams not loading under React Native (thank you, @hunterpetersen!) (#761).
- Add missing fields to the
LedgerRecord:successful_transaction_countandfailed_transaction_count(#740). Note that this also marks several fields as deprecated because they don't actually exist in the Horizon API response:transaction_count: superceded by the sum of the aforementioned fieldsbase_fee: superceded by thebase_fee_in_stroopsfieldbase_reserve: superceded by thebase_reserve_in_stroopsfield
These deprecated fields will be removed in the next major version. It's unlikely that this breaking change should affect anyone, as these fields have likely been missing/invalid for some time.
- Update a number of dependencies that needed various security updates:
All of the dependencies in question besides axios were developer dependencies, so there never was downstream security impact nor will there be downstream upgrade impact.
This release introduces breaking changes from stellar-base. It adds unconditional support for muxed accounts. Please refer to the corresponding release notes for details on the breaking changes there.
-
Upgrades the stellar-base library to v7.0.0 (#735).
-
Removes the
AccountResponse.createSubaccountmethod since this is also gone from the underlyingAccountinterface. Thestellar-baserelease notes describe alternative construction methods (#735).
- Use the right string for liquidity pool trades (#734).
- Adds a way to filter liquidity pools by participating account:
server.liquidityPools.forAccount(id)(#727).
-
Updates the following SEP-10 utility functions to include client domain verification functionality (#720):
Utils.buildChallengeTx()accepts theclientDomainandclientSigningKeyoptional parametersUtils.readChallengeTx()parses challenge transactions containing aclient_domainManageData operationUtils.verifyChallengeTxSigners()verifies an additional signature from theclientSigningKeykeypair if aclient_domainManage Data operation is included in the challenge
-
Bumps
stellar-baseversion to v6.0.6.
-
Fixes the
type_ienumeration field to accurately reflect liquidity pool effects (#723). -
Upgrades axios dependency to v0.21.4 to alleviate security concern (GHSA-cph5-m8f7-6c5x, #724).
-
Publish Bower package to stellar/bower-js-stellar-sdk (#725).
This stable release adds support for Protocol 18. For details, you can refer to CAP-38 for XDR changes and this document for changes to the Horizon API.
Refer to the release notes for the betas (e.g. v9.0.0-beta.0) for a comprehensive list of changes to this library.
- Corrects the
reservesfield onLiquidityPoolRecords to be an array (#715). - Bumps the
stellar-basedependency to v6.0.4 (#715).
- Add
/liquidity_pools/:id/tradesendpoint (#710)
- Updates the following SEP-10 utility functions to be compliant with the protocols (#709, stellar-protocol/#1036)
- Updated
utils.buildChallengeTx()to accept muxed accounts (M...) for client account IDs - Updated
utils.buildChallengeTx()to accept amemoparameter to attach to the challenge transaction - Updated
utils.readChallengeTx()to provide amemoproperty in the returned object - Updated
utils.readChallengeTx()to validate challenge transactions with muxed accounts (M...) as the client account ID
- Updated
- Drops the
chai-httpdependency to be only for developers (#707).
This beta release adds support for Automated Market Makers. For details, you can refer to CAP-38 for XDR changes and this document for detailed changes to the Horizon API.
-
Introduced a
LiquidityPoolCallBuilderto make calls to a new endpoint: -
Expanded the
TransactionCallBuilder,OperationCallBuilder, andEffectsCallBuilders to apply to specific liquidity pools (#689). This corresponds to the following new endpoints:/liquidity_pools/:id/transactions/liquidity_pools/:id/operations/liquidity_pools/:id/effects
-
Expanded the
TradesCallBuilderto support fetching liquidity pool trades and accepts a newtrade_typefilter (#685):/trades?trade_type={orderbook,liquidity_pools,all}. By default, the filter isall, including both liquidity pool and orderbook records.- A liquidity pool trade contains the following fields:
liquidity_pool_fee_bp: LP fee expressed in basis points, and eitherbase_liquidity_pool_idorcounter_liquidity_pool_id
-
Added new effects related to liquidity pools (#690):
DepositLiquidityEffectWithdrawLiquidityEffectLiquidityPoolTradeEffectLiquidityPoolCreatedEffectLiquidityPoolRemovedEffectLiquidityPoolRevokedEffect
-
Added new responses related to liquidity pool operations (#692):
DepositLiquidityOperationResponseWithdrawLiquidityOperationResponse
-
Updated the underlying
stellar-baselibrary to v6.0.1 to include CAP-38 changes (#681). -
Updated various developer dependencies to secure versions (#671).
-
Updated
AccountResponseto include liquidity pool shares in itsbalancesfield (#688). -
Updated
AccountCallBuilderto allow filtering based on participation in a certain liquidity pool (#688), corresponding to the following new filter:/accounts?reserves=[...list of assets...]
-
Updated
RevokeSponsorshipOperationResponseto contain an optional attributetrustline_liquidity_pool_id, for when a liquidity pool trustline is revoked (#690).
-
A
TradeRecordcan now correspond to two different types of trades and has changed (#685):Orderbook(the existing structure)counter_offer_idandbase_offer_idonly show up in these records- the redundant
offer_idfield was removed; it matchesbase_offer_id
LiquidityPool(new)base_accountxorcounter_accountwill appear in these records
pricefields changed fromnumbers tostrings- The links to
baseandcountercan now point to either an account or a liquidity pool
-
An account's
balancesarray can now include a new type (#688):asset_typecan now beliquidity_pool_shares- The following fields are not included in pool share balances:
buying_liabilitiesselling_liabilitiesasset_codeasset_issue
-
The
ChangeTrustOperationResponsehas changed (#688, #692):asset_typecan now beliquidity_pool_sharesasset_code,asset_issuer, andtrusteeare now optionalliquidity_pool_idis a new optional field
-
The trustline effects (
TrustlineCreated,TrustlineUpdated,TrustlineRevoked) have changed (#690):- the asset type can now be
liquidity_pool_shares - they can optionally include a
liquidity_pool_id
- the asset type can now be
-
Trustline sponsorship effects (
TrustlineSponsorshipCreated,TrustlineSponsorshipUpdated,TrustlineSponsorshipRemoved) have been updated (#690):- the
assetfield is now optional, and is replaced by - the
liquidity_pool_idfield for liquidity pools
- the
- The
js-stellar-baselibrary has been updated to v5.3.2, which fixes a muxed account bug and updates vulnerable dependencies (#670).
- Utils.readTransactionTx now checks timebounds with a 5-minute grace period to account for clock drift.
- Fix server signature verification in
Utils.readChallengeTx. The function was not verifying the server account had signed the challenge transaction.
- Fixes a breaking bug introduced in v8.2.0 in which
AccountResponseno longer conformed to theStellarBase.Accountinterface, which was updated in stellar-base@v5.2.0 (#655).
- A defunct query paramater (
?c=[...]) has been removed now that Horizon properly sends Cache-Control headers (#652).
-
Added support for querying the relevant transactions and operations for a claimable balance (#628):
TransactionCallBuilder.forClaimableBalance(): builds a query to/claimable_balances/:id/transactions/OperationCallBuilder.forClaimableBalance(): builds a query to/claimable_balances/:id/operations/
-
Added support for new stat fields on the
/assetsendpoint (#628):accounts- a breakdown of accounts using this asset by authorization typebalances- a breakdown of balances by account authorization typenum_claimable_balances- the number of pending claimable balancesclaimable_balances_amount- the total balance of pending claimable balances
-
Added types for all Effects supported as an enum, and moved
Trade,Asset,Offer, andAccounttypes to separate files (#635).
-
Upgraded
js-stellar-basepackage to version^5.2.1from^5.1.0, refer to its release notes for more (#639):- opt-in support for muxed accounts (SEP-23)
- exposing the
AuthClawbackEnabledflag to Typescript to complete Protocol 17 support - fixing a public key parsing regression
-
Exposed more Protocol 17 (CAP-35) operations (#633):
- The
/accountsendpoint now resolves theflags.auth_clawback_enabledfield. - The operation responses for
clawback,clawbackClaimableBalance, andsetTrustLineFlagsare now defined. - The operation response for
setOptionshas been updated to showauth_clawback_enabled.
- The
- Upgraded
js-stellar-basepackage to version^5.1.0from^5.0.0to expose the Typescript hints for CAP-35 operations (#629).
- Upgraded
js-stellar-basepackage to version^5.0.0from^4.0.3to support new CAP-35 operations (#624)
- Updates the SEP-10 utility function parameters to support SEP-10 v3.1 (#607)
- A new required
webAuthDomainparameter was added to the following functionsutils.buildChallengeTx()utils.readChallengeTx()utils.verifyChallengeTxThreshold()utils.verifyChallengeTxSigners()
- The
webAuthDomainparameter is expected to match the value of the Manage Data operation with the 'web_auth_domain' key, if present
- A new required
- Fixes bug where the first Manage Data operation in a challenge transaction could have a null value (#591)
-
Upgraded
axiospackage to version^0.21.1from^0.19.0to fix security vulnerabilities (#608) -
Upgraded
js-stellar-basepackage to version^4.0.3from^4.0.0to allow accounts with a balance of zero (#616)
This release includes a major-version increase due to breaking changes included.
- Updates the SEP-10 utility function parameters and return values to support SEP-10 v3.0
- The following functions replaced the
homeDomainparameter withhomeDomains(note: plural):utils.readChallengeTx()utils.verifyChallengeTxThreshold()utils.verifyChallengeTxSigners()
utils.readChallengeTx()now returns an additional object attribute,matchedHomeDomain
- The following functions replaced the
- Update challenge transaction helpers for SEP0010 v3.0.0. (#596)
- Restore
homeDomainvalidation inreadChallengeTx().
- Restore
- Update challenge transaction helpers for SEP0010 v2.1.0. (#581)
- Remove verification of home domain.
- Allow additional manage data operations that have the source account set as the server key.
- Update claim predicate fields to match Horizon 1.9.1 (#575).
- Add support for claimable balances (#572). Extend server class to allow loading claimable balances from Horizon. The following functions are available:
server.claimableBalances();
server.claimableBalances().claimant(claimant);
server.claimableBalances().sponsor(sponsorID);
server.claimableBalances().asset(asset);
server.claimableBalances().claimableBalance(balanceID);
-
Add the following attributes to
AccountResponse(#572):sponsor?: stringnum_sponsoring: numbernum_sponsored: number
-
Add the optional attribute
sponsortoAccountSigner,BalanceLineAsset,ClaimableBalanceRecord, andOfferRecord(#572). -
Add
sponsorfiltering support foroffersandaccounts(#572).server.offers().sponsor(accountID)server.accounts().sponsor(accountID)
-
Extend operation responses to support new operations (#572).
create_claimable_balancewith the following fields:asset- asset available to be claimed (in canonical form),amount- amount available to be claimed,claimants- list of claimants with predicates (see below):destination- destination account ID,predicate- predicate required to claim a balance (see below).
claim_claimable_balancewith the following fields:balance_id- unique ID of balance to be claimed,claimant- account ID of a claimant.
begin_sponsoring_future_reserveswith the following fields:sponsored_id- account ID for which future reserves will be sponsored.
end_sponsoring_future_reserveswith the following fields:begin_sponsor- account sponsoring reserves.
revoke_sponsorshipwith the following fields:account_id- if account sponsorship was revoked,claimable_balance_id- if claimable balance sponsorship was revoked,data_account_id- if account data sponsorship was revoked,data_name- if account data sponsorship was revoked,offer_id- if offer sponsorship was revoked,trustline_account_id- if trustline sponsorship was revoked,trustline_asset- if trustline sponsorship was revoked,signer_account_id- if signer sponsorship was revoked,signer_key- if signer sponsorship was revoked.
-
Extend effect responses to support new effects (#572).
claimable_balance_createdwith the following fields:balance_id- unique ID of claimable balance,asset- asset available to be claimed (in canonical form),amount- amount available to be claimed.
claimable_balance_claimant_createdwith the following fields:balance_id- unique ID of a claimable balance,asset- asset available to be claimed (in canonical form),amount- amount available to be claimed,predicate- predicate required to claim a balance (see below).
claimable_balance_claimedwith the following fields:balance_id- unique ID of a claimable balance,asset- asset available to be claimed (in canonical form),amount- amount available to be claimed,
account_sponsorship_createdwith the following fields:sponsor- sponsor of an account.
account_sponsorship_updatedwith the following fields:new_sponsor- new sponsor of an account,former_sponsor- former sponsor of an account.
account_sponsorship_removedwith the following fields:former_sponsor- former sponsor of an account.
trustline_sponsorship_createdwith the following fields:sponsor- sponsor of a trustline.
trustline_sponsorship_updatedwith the following fields:new_sponsor- new sponsor of a trustline,former_sponsor- former sponsor of a trustline.
trustline_sponsorship_removedwith the following fields:former_sponsor- former sponsor of a trustline.
claimable_balance_sponsorship_createdwith the following fields:sponsor- sponsor of a claimable balance.
claimable_balance_sponsorship_updatedwith the following fields:new_sponsor- new sponsor of a claimable balance,former_sponsor- former sponsor of a claimable balance.
claimable_balance_sponsorship_removedwith the following fields:former_sponsor- former sponsor of a claimable balance.
signer_sponsorship_createdwith the following fields:signer- signer being sponsored.sponsor- signer sponsor.
signer_sponsorship_updatedwith the following fields:signer- signer being sponsored.former_sponsor- the former sponsor of the signer.new_sponsor- the new sponsor of the signer.
signer_sponsorship_removedwith the following fields:former_sponsor- former sponsor of a signer.
- Update
stellar-basetov4.0.0which introduces a breaking change in the internal XDR library.
The following functions were renamed:
xdr.OperationBody.setOption()->xdr.OperationBody.setOptions()xdr.OperationBody.manageDatum()->xdr.OperationBody.manageData()xdr.OperationType.setOption()->xdr.OperationType.setOptions()xdr.OperationType.manageDatum()->xdr.OperationType.manageData()
The following enum values were renamed in OperationType:
setOption->setOptionsmanageDatum->manageData
- Add
tx_set_operation_counttoledgerresource (#559).
- Fix regression on
server.offer().forAccount()which wasn't allowing streaming (#533).
- Allow submitTransaction to receive a FeeBumpTransaction (#548).
- Skip SEP0029 (memo required check) for multiplexed accounts (#538).
- Fix missing documentation for
stellar-base(#544). - Move dom-monkeypatch to root types and publish to npm (#543).
- Add fee bump related attributes to
TransactionResponse(#532):fee_account: string.fee_bump_transaction: FeeBumpTransactionResponse:interface FeeBumpTransactionResponse { hash: string; signatures: string[]; }
inner_transaction: InnerTransactionResponse:interface InnerTransactionResponse { hash: string; signatures: string[]; max_fee: string; }
- Add
memo_bytes: stringtoTransactionResponse(#532). - Add
authorize_to_maintain_liabilities: booleantoAllowTrustOperation(#532). - Add
is_authorized_to_maintain_liabilities: booleantoBalanceLineNative(#532). - Add new result codes to
TransactionFailedResultCodes(#531).TX_FEE_BUMP_INNER_SUCCESS = "tx_fee_bump_inner_success", TX_FEE_BUMP_INNER_FAILED = "tx_fee_bump_inner_failed", TX_NOT_SUPPORTED = "tx_not_supported", TX_SUCCESS = "tx_success", TX_TOO_EARLY = "tx_too_early", TX_TOO_LATE = "tx_too_late", TX_MISSING_OPERATION = "tx_missing_operation", TX_INSUFFICIENT_BALANCE = "tx_insufficient_balance", TX_NO_SOURCE_ACCOUNT = "tx_no_source_account", TX_INSUFFICIENT_FEE = "tx_insufficient_fee", TX_INTERNAL_ERROR = "tx_internal_error",
- The attributes
max_feeandfee_chargedinTransactionResponsecan be now anumberor astring. Update your code to handle both types since Horizon will start sendingstringin version1.3.0(#528). - Bump
stellar-basetov3.0.0: This new version of stellar-base brings support for protocol 13, including multiple breaking changes which might affect your code, please review the list of breaking changes in stellar-base@3.0.0 release (#524). - Make
networkPassphrasea required argument inUtils.buildChallengeTxandUtils.readChallengeTx(#524). - Remove
Server.paths(#525).
- Update
stellar-basetov3.0.0-alpha-1.
- Bump
stellar-basetov3.0.0-alpha-0: This new version of stellar-base brings support for protocol 13, including multiple breaking changes which might affect your code, please review the list of breaking changes in stellar-base@3.0.0-alpha.0 release (#524). - Make
networkPassphrasea required argument inUtils.buildChallengeTxandUtils.readChallengeTx(#524). - Remove
Server.paths(#525).
-
Add SEP0029 (memo required) support. (#516)
Extends
server.submitTransactionto always run a memo required check before sending the transaction. If any of the destinations require a memo and the transaction doesn't include one, then anAccountRequiresMemoErrorwill be thrown.You can skip this check by passing
{skipMemoRequiredCheck: true}toserver.submitTransaction:server.submitTransaction(tx, {skipMemoRequiredCheck: true})The check runs for each operation of type:
paymentpathPaymentStrictReceivepathPaymentStrictSendmergeAccount
If the transaction includes a memo, then memo required checking is skipped.
See SEP0029 for more information about memo required check.
- Fix URI TypeScript reference. (#509)
- Fix docs build. (#503)
- Fix documentation for method to filter offers by account. (#507)
- Fix types and add missing attribute to
account_response. (#504)
- Add
.offermethod toOfferCallBuilderwhich allows fetching a single offer by ID. (#499)
- Fix broken link to Stellar logo+wordmark. (#496)
- Fix
_linkomition for AccountResponse class. (#495)
- Update challenge transaction helpers for SEP0010. (#497)
-
Add support for top-level offers endpoint with
seller,selling, andbuyingfilter. (#485) Horizon 1.0 includes a new/offersend-point, which allows you to list all offers, supporting filtering byseller,selling, orbuyingasset.You can fetch data from this endpoint by doing
server.offers()and use any of the following filters:seller:server.offers().forAccount(accountId)buying:server.offers().buying(asset)selling:server.offers().selling(asset)
This introduced a breaking change since it modified the signature for the function
server.offers().Before, if you wanted to list all the offers for a given account, you'd do:
server.offers('accounts', accountID)Starting on this version you'll need to do:
server.offers().forAccount(accountId)You can do now things that were not possible before, like finding all offers for an account filtering by the selling or buying asset
server.offers().forAccount(accountId).selling(assetA).buying(assetB) -
Add support for filtering accounts by
signerorasset(#474) Horizon 1.0 includes a new/accountsend-point, which allows you to list all accounts who have another account as a signer or hold a given asset.You can fetch data from this endpoint by doing
server.accounts()and use any of the following filters:accountID:server.accounts().accountId(accountId), returns a single account.forSigner:server.accounts().forSigner(accountId), returns accounts whereaccountIdis a signer.forAsset:server.accounts().forAsset(asset), returns accounts which hold theasset.
-
Add TypeScript typings for new fields in
fee_stats. (#462)
- Changed TypeScript typing for multiple operations "type", it will match the new value on Horizon. (#477)
- Fix fetchTimebounds() (#487)
- Clone the passed URI in CallBuilder constructor, to not mutate the outside ref (#473)
- Use axios CancelToken to ensure timeout (#482)
-
Remove
fee_paidfield from transaction response. (#476) -
Remove all
*_accepted_feefrom FeeStatsResponse. (#463) -
Change function signature for
server.offers. (#485) The signature for the functionserver.offers()was changed to bring suppport for other filters.Before, if you wanted to list all the offers for a given account, you'd do:
server.offers('accounts', accountID)Starting on this version you'll need to do:
server.offers().accountId(accountId)
-
Horizon 0.25.0 will change the data type for multiple attributes from
Int64tostring. When the JSON payload includes anInt64, there are scenarios where large number data can be incorrectly parsed, since JavaScript doesn't supportInt64values. You can read more about it in #1363.This release extends the data types for the following attributes to be of type
stringornumber:EffectRecord#offer_idEffectRecord#new_seqOfferRecord#idTradeAggregationRecord#timestampTradeAggregationRecord#trade_countManageOfferOperationResponse#offer_idPassiveOfferOperationResponse#offer_id
We recommend you update your code to handle both
stringornumberin the fields listed above, so that once Horizon 0.25.0 is released, your application will be able to handle the new type without breaking.
- Add
fee_chargedanmax_feetoTransactionResponseinterface. (455)
- Horizon 0.25 will stop sending the property
fee_paidin the transaction response. Usefee_chargedandmax_fee, read more about it in 450.
- Upgrade
stellar-basetov2.1.2. (452)
- Change arguments on server.strictReceivePaths since we included
destinationAccountas an argument, but it is not longer required by Horizon. (477)
-
Add
server.strictReceivePathswhich adds support for/paths/strict-receive. (444) This function takes a list of source assets or a source address, a destination address, a destination asset and a destination amount.You can call it passing a list of source assets:
server.strictReceivePaths(sourceAssets,destinationAsset, destinationAmount)Or a by passing a Stellar source account address:
server.strictReceivePaths(sourceAccount,destinationAsset, destinationAmount)When you call this function with a Stellar account address, it will look at the account’s trustlines and use them to determine all payment paths that can satisfy the desired amount.
-
Add
server.strictSendPathswhich adds support for/paths/strict-send. (444) This function takes the asset you want to send, and the amount of that asset, along with either a list of destination assets or a destination address.You can call it passing a list of destination assets:
server.strictSendPaths(sourceAsset, sourceAmount, [destinationAsset]).call()Or a by passing a Stellar account address:
server.strictSendPaths(sourceAsset, sourceAmount, "GDRREYWHQWJDICNH4SAH4TT2JRBYRPTDYIMLK4UWBDT3X3ZVVYT6I4UQ").call()When you call this function with a Stellar account address, it will look at the account’s trustlines and use them to determine all payment paths that can satisfy the desired amount.
- Server#paths is deprecated in favor of Server#strictReceivePaths. (444)
- Add join method to call builder. (#436)
- Drop Support for Node 6 since it has been end-of-lifed and no longer in LTS. We now require Node 10 which is the current LTS until April 1st, 2021. (#424
- Add feeStats support. (#409)
- Fix Util.verifyChallengeTx documentation (#405)
- Fix: listen to stream events with addEventListener (#408)
- Fix ServerApi's OrderbookRecord type (#401)
- Set
namein custom errors (#403)
- Fix manage data value in SEP0010 challenge builder. (#396)
- Add support for networkPassphrase in SEP0010 challenge builder. (#397)
- Add helper
Utils.verifyChallengeTxto verify SEP0010 "Challenge" Transaction. (#388) - Add helper
Utils.verifyTxSignedByto verify that a transaction has been signed by a given account. (#388)
- Check for a global EventSource before deciding what to use. This allows you to inject polyfills in other environments like react-native. (#389)
- Fix CallBuilder onmessage type (#385)
- Add single script to build docs and call it when combined with jsdoc. (#380)
- Add SEP0010 transaction challenge builder. (#375)
- Add
home_domainto ServerApi.AccountRecord (#376)
- Fix jsdoc's build in after_deploy (#373)
- Create new URI instead of passing serverUrl (Fix #379). (#382)
- Breaking change Port stellar-sdk to Typescript. Because we use a slightly
different build process, there could be some unanticipated bugs. Additionally,
some type definitions have changed:
- Types that were once in the
Servernamespace but didn't actually deal with theServerclass have been broken out into a new namespace,ServerApi. So, for example,Server.AccountRecord->ServerApi.AccountRecord. Server.AccountResponseis out of theServernamespace ->AccountResponseServer.*CallBuilderis out of theServernamespace ->*CallBuilderHorizonResponseAccountis nowHorizon.AccountResponse
- Types that were once in the
- Upgrade Webpack to v4.
- Add support for providing app name and version to request headers.
- (NPM wouldn't accept the 2.0.0 version, so we're publishing to 2.0.1.)
Many thanks to @Ffloriel and @Akuukis for their help with this release!
- Make CallCollectionFunction return a CollectionPage.
- Update Horizon.AccountSigner[] types.
- Automatically tag alpha / beta releases as "next" in NPM.
- Upgrade axios to 0.19.0 to close a security vulnerability.
- Some type fixes.
- Upgrade stellar-base to v1.0.2 to fix a bug with the browser bundle.
- Upgrade stellar-base to v1.0.1, which makes available again the deprecated
operation functions
Operation.manageOfferandOperation.createPassiveOffer(with a warning). - Fix the documentation around timebounds.
- Upgrade stellar-base to v1.0.0, which introduces two breaking changes.
- Switch stellar-sdk's versioning to true semver! 🎉
- Add types for LedgerCallBuilder.ledger.
- Add types for Server.operationFeeStats.
- Add types for the HorizonAxiosClient export.
- Move @types/* from devDependencies to dependencies.
- Pass and use a stream response type to CallBuilders if it's different from the normal call response.
- Upgrade stellar-base to a version that includes types, and remove @types/stellar-base as a result.
- In .travis.yml, try to switch from the encrypted API key to an environment var.
- Fix Server.transactions and Server.payments definitions to properly return collections
- Renew the npm publish key
- Add Typescript type definitions (imported from DefinitelyTyped).
- Make these changes to those definitions:
- Add definitions for Server.fetchBaseFee and Server.fetchTimebounds
- CallBuilder: No long always returns CollectionPaged results. Interfaces that extend CallBuilder should specify whether their response is a collection or not
- CallBuilder: Add inflation_destination and last_modified_ledger property
- OfferRecord: Fix the returned properties
- TradeRecord: Fix the returned properties
- TradesCallBuilder: Add forAccount method
- TransactionCallBuilder: Add includeFailed method
- Horizon.BalanceLineNative/Asset: Add buying_liabilities / selling_liabilities properties
- Fix documentation links.
- Breaking change:
stellar-sdkno longer ships with anEventSourcepolyfill. If you plan to support IE11 / Edge, please useevent-source-polyfillto setwindow.EventSource. - Upgrade
stellar-baseto a version that doesn't use thecryptolibrary, fixing a bug with Angular 6 - Add
Server.prototype.fetchTimebounds, a helper function that helps you set thetimeboundsproperty when inittingTransactionBuilder. It bases the timebounds on server time rather than local time.
- Updated some out-of-date dependencies
- Update documentation to explicitly set fees
- Add
Server.prototype.fetchBaseFee, which devs can use to fetch the current base fee; we plan to add more functions to help suggest fees in future releases - Add
includeFailedtoOperationCallBuilderfor including failed transactions in calls - Add
operationFeeStatstoServerfor the new fee stats endpoint - After submitting a transaction with a
manageOfferoperation, return a new propertyofferResults, which explains what happened to the offer. SeeServer.prototype.submitTransactionfor documentation.
- Update
stellar-baseto0.11.0 - Added ESLint and Prettier to enforce code style
- Upgraded dependencies, including Babel to 6
- Bump local node version to 6.14.0
- Update
stellar-baseto0.10.0:- Breaking change Added
TransactionBuilder.setTimeoutmethod that setstimebounds.max_timeon a transaction. Because of the distributed nature of the Stellar network it is possible that the status of your transaction will be determined after a long time if the network is highly congested. If you want to be sure to receive the status of the transaction within a given period you should set the TimeBounds withmaxTimeon the transaction (this is whatsetTimeoutdoes internally; if there'sminTimeset but nomaxTimeit will be added). Call toTransactionBuilder.setTimeoutis required if Transaction does not havemax_timeset. If you don't want to set timeout, useTimeoutInfinite. In general you should setTimeoutInfiniteonly in smart contracts. Please checkTransactionBuilder.setTimeoutdocs for more information. - Fixed decoding empty
homeDomain.
- Breaking change Added
- Add
offsetparameter to TradeAggregationCallBuilder to reflect new changes to the endpoint in horizon-0.15.0
- Update
js-xdr(by updatingstellar-base) to support unmarshaling non-utf8 strings. - String fields returned by
Operation.fromXDRObject()are of typeBuffernow (exceptSetOptions.home_domainandManageData.name- both required to be ASCII by stellar-core).
- Update
stellar-baseand xdr files.
- Update
stellar-base(andjs-xdr).
- Update
stellar-baseto0.8.1.
- Update
stellar-baseto0.8.0withbump_sequencesupport.
- Removed
.babelrcfile from the NPM package.
-
stellar-sdkis now using nativePromiseinstead ofbluebird. Thecatchfunction is different. Instead of:.catch(StellarSdk.NotFoundError, function (err) { /* ... */ })
please use the following snippet:
.catch(function (err) { if (err instanceof StellarSdk.NotFoundError) { /* ... */ } })
-
We no longer support IE 11, Firefox < 42, Chrome < 49.
- Fixed
_ is undefinedbug. - Browser build is around 130 KB smaller!
- Added
timeoutoption toStellarTomlResolverandFederationServercalls (#158). - Fixed adding random value to URLs multiple times (#169).
- Fixed jsdoc for classes that extend
CallBuilder. - Updated dependencies.
- Added
yarn.lockfile to repository.
- Add an allowed trade aggregation resolution of one minute
- Various bug fixes
- Improved documentation
- Modify
/tradesendpoint to reflect changes in horizon. - Add
/trade_aggregationssupport. - Add
/assetssupport.
- Upgrade
stellar-base.
- Allow hex string in setOptions signers.
- Upgrade
stellar-base.
- Support for new signer types:
sha256Hash,preAuthTx. StrKeyhelper class withstrkeyencoding related methods.- Removed deprecated methods:
Keypair.isValidPublicKey(useStrKey),Keypair.isValidSecretKey(useStrKey),Keypair.fromSeed,Keypair.seed,Keypair.rawSeed. - Breaking changes:
Networkmust be explicitly selected. Previously testnet was a default network.Operation.setOptions()methodsignerparam changed.Keypair.fromAccountId()renamed toKeypair.fromPublicKey().Keypair.accountId()renamed toKeypair.publicKey().- Dropping support for
End-of-Lifenode versions.
- Updated
stellar.tomllocation
forUpdatemethods of call builders now accept strings and numbers.- Create a copy of attribute in a response if there is a link with the same name
(ex.
transaction.ledger,transaction._links.ledger).
- Breaking change
CallBuilder.streamnow reconnects when no data was received for a long time. This is to prevent permanent disconnects (more in: #76). Also, this method now returnsclosecallback instead ofEventSourceobject. - Breaking change
Server.loadAccountnow returns theAccountResponseobject. - Breaking change Upgraded
stellar-baseto0.6.0.ed25519package is now an optional dependency. CheckStellarSdk.FastSigningvariable to check ifed25519package is available. More in README file. - New
StellarTomlResolverclass that allows gettingstellar.tomlfile for a domain. - New
Configclass to set global config values.
- Fixed XDR decoding issue when using firefox
- Breaking change
ServerandFederationServerconstructors no longer accept object inserverUrlparameter. - Breaking change Removed
AccountCallBuilder.addressmethod. UseAccountCallBuilder.accountIdinstead. - Breaking change It's no longer possible to connect to insecure server in
ServerorFederationServerunlessallowHttpflag inoptsis set. - Updated dependencies.
- Updated dependency (
stellar-base).
- Updated dependencies.
- Added tests.
- Added
CHANGELOG.mdfile.
stellar-basebump. (c90c68f)
- Breaking change Bumped
stellar-baseto 0.5.0. (b810aef)