Skip to content

v13.0.0-beta.1: Protocol 22

Pre-release
Pre-release
Compare
Choose a tag to compare
@Shaptic Shaptic released this 04 Oct 00:18
· 3 commits to master since this release
8fde646

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 an address instead of a publicKey. 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 the axios dependency: this will build stellar-sdk-no-axios.js and stellar-sdk-no-axios.min.js in the dist/ directory, or just run yarn 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 the eventsource dependency: this will build stellar-sdk-no-eventsource.js and stellar-sdk-no-eventsource.min.js in the dist/ directory, or just run yarn 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.
  • contract.AssembledTransaction#signAuthEntries now allows you to override authorizeEntry. This can be used to streamline novel workflows using cross-contract auth. (#1044)
  • rpc.Server now has a getSACBalance 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

Full Changelog: v12.3.0...v13.0.0-beta.1