Skip to content

Releases: stellar/js-stellar-base

v10.0.2

23 Jan 01:23
29875cb
Compare
Choose a tag to compare

Fixed

  • The contractId field is correctly omitted from humanized events when it wasn't present in the structure (#721).
  • Misc. outdated or incorrect documentation has been updated (#723, #720).
  • Dependencies have been updated (#724).

Full Changelog: v10.0.1...v10.0.2

v10.0.1

15 Dec 22:02
8e85dac
Compare
Choose a tag to compare

Fixed

  • The TypeScript definition for Asset.contractId() now includes a missing parameter (the networkPassphrase changes the ID for a contract; #718).

New Contributors

Full Changelog: v10.0.0...v10.0.1

v10.0.0

07 Dec 20:03
cf370f4
Compare
Choose a tag to compare

This is the stable Protocol 20 release.

v10.0.0: Protocol 20, Soroban!

Breaking Changes

  • The package has been renamed to @stellar/stellar-base!
  • Node 18 is the new minimum version to use the SDKs.
  • The XDR has been massively overhauled to support Soroban, the new smart contract platform on Stellar, and Protocol 20. This means new operations, data structures, and a transaction format as well as new overlay features (#538).

The core data structure of Soroban is a generic type called an ScVal (smart contract value, which is a union of types that can basically represent anything [numbers, strings, arrays, maps, contract bytecode, etc.]). You can refer to the XDR for details, and you can utilize new APIs to make dealing with these complex values easier:

  • nativeToScVal helps convert native types to their closest Soroban equivalent
  • scValToNative helps find the closest native JavaScript type(s) corresponding to a smart contract value
  • scValToBigInt helps convert numeric ScVals into native bigints
  • ScInt and XdrLargeInt help convert to and from bigints to other types and form sized integer types for smart contract usage

There are other XDR structures that have abstractions included for building out or certain types of smart contract-related structures:

  • buildInvocationTree and walkInvocationTree are both ways to visualize invocation calling trees better
  • authorizeEntry and authorizeInvocation help multiple parties sign invocation calling trees
  • humanizeEvents helps make diagnostic events more readable

Added

The following are new APIs to deal with new Soroban constructs:

  • Address, which helps manage "smart" addresses in the Soroban context. Addresses there (used for auth and identity purposes) can either be contracts (strkey C...) or accounts (strkey G...). This abstraction helps manage them and distinguish between them easily.
  • Contract, which helps manage contract identifiers. The primary purpose is to build invocations of its methods via the generic call(...), but it also provides utilities for converting to an Address or calculating its minimum footprint for state expiration.
  • Three new operations have been added related to Soroban transactions:
    • invokeHostFunction for calling contract code
    • bumpFootprintExpiration for extending the state lifetime of Soroban data
    • restoreFootprint for restoring expired, off-chain state back onto the ledger
  • The TransactionBuilder now takes a sorobanData parameter (and has a corresponding .setSorobanData() builder method) which primarily describes the storage footprint of a Soroban (that is, which parts of the ledger state [in the form of xdr.LedgerKeys] it plans to read and write as part of the transaction).
    • To facilitate building this out, there's a new SorobanDataBuilder factory to set fields individually
    • It also now has a cloneFrom(tx, opts) constructor method to create an instance from an existing transaction, also allowing parameter overrides via opts.
  • We've added a GHA to track bundle size changes as PRs are made.

Fixes

  • Improves the error messages when passing invalid amounts to deposit and withdraw operations (#679).
  • Fixes a TypeScript bug where Memo.hash did not accept a Buffer (#698).
  • Dependencies have been updated to their latest versions.

New Contributors

Full Changelog: v9.0.0...v10.0.0

v10.0.0-beta.4

03 Nov 19:22
65cc860
Compare
Choose a tag to compare
v10.0.0-beta.4 Pre-release
Pre-release

Fixed

  • You can now correctly clone transactions (TransactionBuilder.cloneFrom) with large sequence numbers (#711).
  • Utility functions are now added to the exported TypeScript (#706).

Full Changelog: v9.0.0...v10.0.0-beta.4

v10.0.0-beta.3

09 Oct 22:33
c70ea24
Compare
Choose a tag to compare
v10.0.0-beta.3 Pre-release
Pre-release

THIS IS A PRE-RELEASE. It is NOT compatible with the current mainnet, but it IS compatible with the current testnet (which is running Preview 11, the final futurenet version with XDR at stellar/stellar-xdr@9ac0264).


Fixed

  • Fixes a bug where authorizeEntry might perform a no-op when it shouldn't (#701).
  • Fixes a TypeScript bug where Memo.hash did not accept a Buffer (#698).
  • Upgrades a transient dependency for security (#296).

Full Changelog: v9.0.0...v10.0.0-beta.3

v10.0.0-beta.2

22 Sep 20:25
e3d6fc3
Compare
Choose a tag to compare
v10.0.0-beta.2 Pre-release
Pre-release

THIS IS A PRE-RELEASE. It is NOT compatible with the current mainnet, but it IS compatible with the current testnet (which is running Preview 11, the final futurenet version with XDR at stellar/stellar-xdr@9ac0264).


Breaking Changes

  • The wrappers around multi-party authorization have changed (#678):
    • authorizeEntry has been added to help sign auth entries in-place
    • the signature for authorizeInvocation has changed: it now offers a callback approach by default and requires slightly different parameters
    • buildAuthEntry, buildAuthEnvelope, and authorizeInvocationCallback have been removed

Fixed

  • The TypeScript definitions for XDR schemas now point to the current protocol rather than vNext (#694).
  • Misc. dependencies have been updated to their latest versions (#694).

Full Changelog: v9.0.0...v10.0.0-beta.2

v10.0.0-beta.1

13 Sep 23:15
b8a6f61
Compare
Choose a tag to compare
v10.0.0-beta.1 Pre-release
Pre-release

THIS IS A PRE-RELEASE. It is NOT compatible with the current mainnet, but it IS compatible with the current testnet (which is running Preview 11, the final futurenet version with XDR at stellar/stellar-xdr@9ac0264).

Please refer to the v10.0.0-beta.0 release notes for a complete changelog since the last major version.


Fixed

  • nativeToScVal now allows anything to be passed to the opts.type specifier. Previously, it was only integer types (#691).
  • Contract.call() now produces valid Operation XDR (#692).

Full Changelog: v9.0.0...v10.0.0-beta.1

v10.0.0-beta.0

12 Sep 16:57
4182cca
Compare
Choose a tag to compare
v10.0.0-beta.0 Pre-release
Pre-release

THIS IS A PRE-RELEASE. It is NOT compatible with the current mainnet, but it IS compatible with the current testnet (which is running Preview 11, the final futurenet version with XDR at stellar/stellar-xdr@9ac0264).


v10.0.0-beta.0: Protocol 20, Soroban!

Breaking Changes

  • Node 16 is the new minimum version to use the SDKs.
  • The XDR has been massively overhauled to support Soroban, the new smart contract platform on Stellar, and Protocol 20. This means new operations, data structures, and a transaction format as well as new overlay features (#538).

The core data structure of Soroban is a generic type called an ScVal (smart contract value, which is a union of types that can basically represent anything [numbers, strings, arrays, maps, contract bytecode, etc.]). You can refer to the XDR for details, and you can utilize new APIs to make dealing with these complex values easier:

  • nativeToScVal helps convert native types to their closest Soroban equivalent
  • scValToNative helps find the closest native JavaScript type(s) corresponding to a smart contract value
  • scValToBigInt helps convert numeric ScVals into native bigints
  • ScInt and XdrLargeInt help convert to and from bigints to other types and form sized integer types for smart contract usage

There are other XDR structures that have abstractions included for building out or certain types of smart contract-related structures:

  • buildInvocationTree and walkInvocationTree are both ways to visualize invocation calling trees better
  • authorizeInvocation helps multiple parties sign invocation calling trees
  • humanizeEvents helps make diagnostic events more readable

Added

The following are new APIs to deal with new Soroban constructs:

  • Address, which helps manage "smart" addresses in the Soroban context. Addresses there (used for auth and identity purposes) can either be contracts (strkey C...) or accounts (strkey G...). This abstraction helps manage them and distinguish between them easily.
  • Contract, which helps manage contract identifiers. The primary purpose is to build invocations of its methods via the generic call(...), but it also provides utilities for converting to an Address or calculating its minimum footprint for state expiration.
  • Three new operations have been added related to Soroban transactions:
    • invokeHostFunction for calling contract code
    • bumpFootprintExpiration for extending the state lifetime of Soroban data
    • restoreFootprint for restoring expired, off-chain state back onto the ledger
  • The TransactionBuilder now takes a sorobanData parameter (and has a corresponding .setSorobanData() builder method) which primarily describes the storage footprint of a Soroban (that is, which parts of the ledger state [in the form of xdr.LedgerKeys] it plans to read and write as part of the transaction).
    • To facilitate building this out, there's a new SorobanDataBuilder factory to set fields individually
    • It also now has a cloneFrom(tx, opts) constructor method to create an instance from an existing transaction, also allowing parameter overrides via opts.
  • We've added a GHA to track bundle size changes as PRs are made. This protocol upgrade adds +18% to the final, minified bundle size which is significant but acceptable given the size of the upgrade.

Fixes

  • Improves the error messages when passing invalid amounts to deposit and withdraw operations (#679).

New Contributors

Full Changelog: v9.0.0...v10.0.0-beta.0

v9.0.0

13 Jun 21:56
40644e3
Compare
Choose a tag to compare

This is a large update and the following CHANGELOG incorporates ALL changes across the beta.N versions of this upgrade (i.e. since v8.2.2).


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.

Breaking Changes

  • The build system has been completely overhauled to support Webpack 5 (#584, #585).
    Though we have tried to maintain compatibility with older JavaScript implementations, this still means you may need to update your build pipeline to transpile to certain targets.

Updates

  • XDR has been updated to its latest version (both curr and next versions, #587).
  • Drop the lodash dependency entirely (#624).
  • Drop the crc dependency and inline it to lower bundle size (#621).
  • Upgrade all dependencies to their latest versions (#608).
  • The browser bundle size has decreased significantly:
    • stellar-base.min.js is 340 KiB, down from 1.2 MiB previously.
    • the new, unminified stellar-base.js is 895 KiB.

Fixes


Contributors: @silence48 @paulbellamy @Shaptic

Full Changelog: v8.2.2...v9.0.0

v9.0.0-beta.3

13 Jun 00:03
c11e1a8
Compare
Choose a tag to compare
v9.0.0-beta.3 Pre-release
Pre-release

Fix

  • Fixes a bug when sorting mixed-case assets for liquidity pools (#606).

Update

  • Upgrade all dependencies to their latest versions (#608).
  • Drop the crc dependency and inline it to lower bundle size (#621).