Releases: stellar/js-stellar-sdk
v5.0.0-alpha.1
Breaking changes
- Bump
stellar-base
tov3.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 [email protected] release (#524). - Make
networkPassphrase
a required argument inUtils.buildChallengeTx
andUtils.readChallengeTx
(#524). - Remove
Server.paths
(#525).
v4.1.0 (#519)
Add
-
Add SEP0029 (memo required) support. (#516)
Extends
server.submitTransaction
to 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 anAccountRequiresMemoError
will 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:
payment
pathPaymentStrictReceive
pathPaymentStrictSend
mergeAccount
If the transaction includes a memo, then memo required checking is skipped.
See SEP0029 for more information about memo required check.
v4.0.2
v4.0.1
v4.0.0 - Horizon 1.0 support
Added
-
Add support for top-level offers endpoint with
seller
,selling
, andbuying
filter. (#485)
Horizon 1.0 includes a new/offers
end-point, which allows you to list all offers, supporting filtering byseller
,selling
, orbuying
asset.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().accountId(accountId)
You can do now things that were not possible before, like finding
all offers for an account filtering by the selling or buying assetserver.offers().accountId(accountId).selling(assetA).buying(assetB)
-
Add support for filtering accounts by
signer
orasset
(#474)
Horizon 1.0 includes a new/accounts
end-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 whereaccountId
is a signer.forAsset
:server.accounts().forAsset(asset)
, returns accounts which hold theasset
.
-
Add TypeScript typings for new fields in
fee_stats
. (#462)
Changed
- Changed TypeScript typing for multiple operations "type", it will match the new value on Horizon. (#477)
Fixed
- Fix fetchTimebounds() (#487)
- Clone the passed URI in CallBuilder constructor, to not mutate the outside ref (#473)
- Use axios CancelToken to ensure timeout (#482)
Breaking
-
Remove
fee_paid
field from transaction response. (#476) -
Remove all
*_accepted_fee
from 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)
v3.3.0 (#458)
Deprecated ⚠️
-
Horizon 0.25.0 will change the data type for multiple attributes from
Int64
to
string
. When the JSON payload includes anInt64
, there are
scenarios where large number data can be incorrectly parsed, since JavaScript doesn't support
Int64
values. You can read more about it in #1363.This release extends the data types for the following attributes to be of type
string
ornumber
:EffectRecord#offer_id
EffectRecord#new_seq
OfferRecord#id
TradeAggregationRecord#timestamp
TradeAggregationRecord#trade_count
ManageOfferOperationResponse#offer_id
PassiveOfferOperationResponse#offer_id
We recommend you update your code to handle both
string
ornumber
in
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.
v3.2.0
v3.1.2
v3.1.1
v3.1.0
Add ➕
-
Add
server.strictReceivePaths
which 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,destinationAccount,destinationAsset, destinationAmount)
Or a by passing a Stellar source account address:
server.strictReceivePaths(sourceAccount,destinationAccount,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.strictSendPaths
which 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.
Deprecated ⚠️
- Server#paths is deprecated in favor of Server#strictReceivePaths. (444)