CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 328
Releases: stellar/js-stellar-sdk
v14.0.0-rc.3
232994d
Compare
v14.0.0-rc.3
Please refer to the first and second release candidates for a comprehensive changelog in this major version. The following only covers the differences since the second release candidate.
- Fixes a bug in
Rpc.Server.getTransaction
where eithertransactionEventsXdr
and/orcontractEventsXdr
may not be present in the newevents
field (#1186).
Full Changelog: v13.1.0...v14.0.0-rc.2
Assets 2
v14.0.0-rc.2: Protocol 23 Release Candidate 2
19ccb64
Compare
v14.0.0-rc.2
Please refer to the first release candidate for a comprehensive changelog in this major version. The following only covers the differences since the first release candidate.
Breaking Changes
- The RPC server's
getTransaction
andgetTransactions
responses have dropped theevents.diagnosticEventsXdr
field (#1183):
export interface TransactionEvents {
- diagnosticEventsXdr: xdr.DiagnosticEvent[];
transactionEventsXdr: xdr.TransactionEvent[];
}
Fixed
- Fixed type for Horizon streaming endpoints, namely
EventSourceOptions.onmessage
now extendsCollectionPage
(#1100).
Full Changelog: v14.0.0-rc.1...v14.0.0-rc.2
Assets 2
v14.0.0-rc.1: Protocol 23 Release Candidate
0ee38d1
Compare
v14.0.0-rc.1
Breaking Changes
- This package requires Node 20.
- XDR has been upgraded to support Protocol 23, please refer to the
@stellar/stellar-base
release notes for details and other breaking changes. - Deprecated:
getTransaction
andgetTransactions
top-leveldiagnosticEventsXdr
field.
Added
- The Horizon API's
BalanceChange
object 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
getTransaction
andgetTransactions
responses now include a top-levelevents
object containing a disjoint breakdown of the events:
export interface TransactionEvents {
diagnosticEventsXdr: xdr.DiagnosticEvent[];
transactionEventsXdr: xdr.TransactionEvent[];
contractEventsXdr: xdr.ContractEvent[][];
}
- The RPC server's
getEvents
now includes retention state information:
export interface GetEventsResponse {
// ...
oldestLedger: number;
latestLedgerCloseTime: string;
oldestLedgerCloseTime: string;
}
- The RPC server's
simulateTransaction
method now includes an optionalauthMode
parameter to specify the type of authorization to simulate:
export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot";
Fixed
- Add muxed payments support for
PaymentOperationResponse
type (#1149).
New Contributors
- @luchenhan made their first contribution in #1129
Full Changelog: v13.1.0...v14.0.0-rc.1
Assets 2
v13.3.0
b18004c
Compare
v13.3.0
Added
- Add
includeFailed
toPaymentCallBuilder
for including failed transactions in calls (#1168).
Fixed
- Ensure that
rpc.Api.GetTransactionsResponse.transactions
is always a valid array (#1162).
Contributors
Full Changelog: v13.2.0...v13.3.1
Assets 2
v13.2.0
df4d572
Compare
v13.2.0
Added
- Support passing in an optional
options.address
to thecontract.Client.deploy
method (#1158).
Fixed
- Extend support for parsing contract specifications in environments that don't have WebAssembly compilers (#1157).
- Add missing
to_muxed
andto_muxed_id
to Horizon’sPaymentOperationResponse
(#1149). - Upgrade
@stellar/stellar-base
dependency to latest version (#1159).
Contributors
@chadoh @kknownymouss @jeesunikim @kalepail @Shaptic
Full Changelog: v13.1.0...v13.2.0
Assets 2
v13.1.0
d147768
Compare
v13.1.0
Added
- Added
Horizon.Server.root
to obtain information from the Horizon root endpoint (#1122).
Fixed
- 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 thecursor
field at the top-level response (#1124).
Contributors
Full Changelog: v13.0.0...v13.1.0
Assets 2
v13.0.0
bbd258f
Compare
v13.0.0: Protocol 22
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.
Breaking Changes
- We stopped supporting Node 18 explicitly a while ago, but now the Babelification of the codebase will transform to Node 18 instead of 16.
TypeScript Bindings: the contract
module.
contract.AssembledTransaction#signAuthEntries
now takes anaddress
instead 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.signTransaction
type 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
, andsubmitUrl
options, and it returns a promise containing thesignedTxXdr
and thesignerAddress
. It now also returns anError
type if an error occurs during signing.basicNodeSigner
has been updated to reflect this new type.
ClientOptions.signAuthEntry
type has been updated to reflect the SEP-43 protocol, which returns a promise containing thesignerAddress
in addition to thesignAuthEntry
that was returned previously. It also can return anError
type.SentTransaction.init
andnew SentTransaction
now 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)
Server APIs: the rpc
and Horizon
modules.
- Deprecated RPC APIs have been removed (#1084):
simulateTransaction
'scost
field is removedrpc.Server.getEvents
'spagingToken
field is deprecated, usecursor
instead
- Deprecated Horizon APIs have been removed (deprecated since v10.0.1, ):
- removed fields
transaction_count
,base_fee
, andbase_reserve
- removed fields
num_accounts
andamount
from assets
- removed fields
- The
SorobanRpc
import, previously deprecated, has been removed. You can importrpc
instead:
-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'
Added
TypeScript Bindings: the contract
module.
contract.Client
now has a staticdeploy
method 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__constructor
method in accordance with CAP-42 (#1086). For example, using theincrement
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);
contract.AssembledTransaction#signAuthEntries
now allows you to overrideauthorizeEntry
. This can be used to streamline novel workflows using cross-contract auth. (#1044).
Server modules: the rpc
, Horizon
, and stellartoml
modules.
Horizon.ServerApi
now has anEffectType
exported so that you can compare and infer effect types directly (#1099).Horizon.ServerApi.Trade
type now has atype_i
field for type inference (#1099).- All effects now expose their type as an exact string (#947).
stellartoml.Resolver.resolve
now has aallowedRedirects
option to configure the number of allowed redirects to follow when resolving a stellar toml file.rpc.Server.getEvents
now returns acursor
field that matchespagingToken
andid
rpc.Server.getTransactions
now returns atxHash
fieldrpc.Server
has 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;
};
}
New bundles without dependencies
- You can now build the browser bundle without various dependencies:
- Set
USE_AXIOS=false
to build without theaxios
dependency: this will buildstellar-sdk-no-axios.js
andstellar-sdk-no-axios.min.js
in thedist/
directory, or just runyarn build:browser:no-axios
to generate these files. - You can import Node packages without the
axios
dependency 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=false
to build without theeventsource
dependency: this will buildstellar-sdk-no-eventsource.js
andstellar-sdk-no-eventsource.min.js
in thedist/
directory, or just runyarn build:browser:no-eventsource
to generate these files. - You can import Node packages without the
eventsource
dependency 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.js
for the browser build and import from@stellar/stellar-sdk/minimal
for the Node package.
- Set
Fixed
contract.AssembledTransaction#nonInvokerSigningBy
now correctly returns contract addresses, in instances of cross-contract auth, rather than throwing an error.sign
will ignore these contract addresses, since auth happens via cross-contract call (#1044).buildInvocationTree
now correctly handles V2 contract creation and displays constructor args (js-stellar-base#785).
Assets 2
v13.0.0-rc.2
3c9a4c4
Compare
v13.0.0-rc.2
Breaking Changes
- The
ClientOptions.signTransaction
type 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
, andsubmitUrl
options, and it returns a promise containing thesignedTxXdr
and thesignerAddress
. It now also returns anError
type if an error occurs during signing.basicNodeSigner
has been updated to reflect the new type.
ClientOptions.signAuthEntry
type has also been updated to reflect the SEP-43 protocol, which also returns a promise containing thesignerAddress
in addition to thesignAuthEntry
that was returned previously. It also can return anError
type.
Added
contract.Client
now has a staticdeploy
method 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__constructor
method 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.ServerApi
now has anEffectType
exported so that you can compare and infer effect types directly (#1099).Horizon.ServerApi.Trade
type now has atype_i
field for type inference.- All effects now expose their type as an exact string (#947).
stellartoml-Resolver.resolve
now has aallowedRedirects
option to configure the number of allowed redirects to follow when resolving a stellar toml file.
Assets 2
v13.0.0-rc.1
cfea8de
Compare
v13.0.0-rc.1
: Protocol 22
Breaking Changes
-
Deprecated RPC APIs have been removed (#1084):
simulateTransaction
'scost
field is removedgetEvents
returns acursor
field that matchespagingToken
andid
getTransactions
returns atxHash
field
-
Horizon Server API types: removed fields
transaction_count
,base_fee
, andbase_reserve
(deprecated since v10.0.1) -
SentTransaction.init
andnew SentTransaction
now 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)
-
SorobanRpc
import, previously deprecated, has been removed. You can importrpc
instead:-import { SorobanRpc } from '@stellar/stellar-sdk' +import { rpc } from '@stellar/stellar-sdk'
As an alternative, you can also import from the
rpc
entrypoint:import { Server } from '@stellar/stellar-sdk/rpc'
Added
rpc.Server
now has apollTransaction
method to retry transaction retrieval (#1092).
Full Changelog: v13.0.0-beta.1...v13.0.0-rc.1
Assets 2
v13.0.0-beta.1: Protocol 22
8fde646
Compare
v13.0.0-beta.1
This is the first release that supports Protocol 22. While the network has not upgraded yet, you can start integrating the new features into your codebase if you want a head start. Keep in mind that while the binary XDR is backwards-compatible, the naming and layout of structures is not. In other words, this build will continue to work on Protocol 21, but you may have to update code that references XDR directly.
Breaking Changes
contract.AssembledTransaction#signAuthEntries
now takes anaddress
instead 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.
Added
- You can now build the browser bundle without various dependencies:
- Set
USE_AXIOS=false
to build without theaxios
dependency: this will buildstellar-sdk-no-axios.js
andstellar-sdk-no-axios.min.js
in thedist/
directory, or just runyarn build:browser:no-axios
to generate these files. - You can import Node packages without the
axios
dependency 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=false
to build without theeventsource
dependency: this will buildstellar-sdk-no-eventsource.js
andstellar-sdk-no-eventsource.min.js
in thedist/
directory, or just runyarn build:browser:no-eventsource
to generate these files. - You can import Node packages without the
eventsource
dependency 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.js
for the browser build and import from@stellar/stellar-sdk/minimal
for the Node package.
- Set
contract.AssembledTransaction#signAuthEntries
now allows you to overrideauthorizeEntry
. This can be used to streamline novel workflows using cross-contract auth. (#1044)rpc.Server
now has agetSACBalance
helper 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;
};
}
Fixed
contract.AssembledTransaction#nonInvokerSigningBy
now correctly returns contract addresses, in instances of cross-contract auth, rather than throwing an error.sign
will ignore these contract addresses, since auth happens via cross-contract call (#1044).
Contributors
@Shaptic @psheth9 @BlaineHeffron @chadoh
New Contributors
- @ElliotFriend made their first contribution in #965
- @omahs made their first contribution in #1069
Full Changelog: v12.3.0...v13.0.0-beta.1