Skip to content

Releases: stellar/js-stellar-base

v2.1.3

26 Dec 22:03
Compare
Choose a tag to compare

Update 📣

  • Throw errors when obviously invalid network passphrases are used in
    new Transaction().
    (284)

v2.1.2

16 Oct 16:48
1d87fba
Compare
Choose a tag to compare

Update 📣

  • Update documentation for Operation to show pathPaymentStrictSend and pathPaymentStrictReceive. (279)

v2.1.1

15 Oct 20:10
02a74f0
Compare
Choose a tag to compare

Update 📣

  • Update asset.toString() to return canonical representation for asset. (277).

    Calling asset.toString() will return native for XLM or AssetCode:AssetIssuer for issued assets. See this PR for more information.

v2.1.0

09 Oct 16:37
d9cfb92
Compare
Choose a tag to compare

This release adds support for stellar-core protocol 12 release and CAP 24 ("Make PathPayment Symmetrical").

Deprecated ❗️

  • Operation.pathPayment is being deprecated in favor of Operation.pathPaymentStrictReceive. Both functions take the same arguments and behave the same. (#274).

Add ➕

  • Operation.pathPaymentStrictSend: Sends a path payments, debiting from the source account exactly a specified amount of one asset, crediting at least a given amount of another asset. (#274).

    The following operation will debit exactly 10 USD from the source account, crediting at least 9.2 EUR in the destination account 💸:

    var sendAsset = new StellarBase.Asset(
      'USD',
      'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
    );
    var sendAmount = '10';
    var destination =
      'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ';
    var destAsset = new StellarBase.Asset(
      'USD',
      'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
    );
    var destMin = '9.2';
    var path = [
      new StellarBase.Asset(
        'USD',
        'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'
      ),
      new StellarBase.Asset(
        'EUR',
        'GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL'
      )
    ];
    let op = StellarBase.Operation.pathPaymentStrictSend({
      sendAsset,
      sendAmount,
      destination,
      destAsset,
      destMin,
      path
    });
  • Operation.pathPaymentStrictReceive: This behaves the same as the former pathPayments operation. (#274).

    The following operation will debit maximum 10 USD from the source account, crediting exactly 9.2 EUR in the destination account 💸:

    var sendAsset = new StellarBase.Asset(
      'USD',
      'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
    );
    var sendMax = '10';
    var destination =
      'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ';
    var destAsset = new StellarBase.Asset(
      'USD',
      'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
    );
    var destAmount = '9.2';
    var path = [
      new StellarBase.Asset(
        'USD',
        'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'
      ),
      new StellarBase.Asset(
        'EUR',
        'GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL'
      )
    ];
    let op = StellarBase.Operation.pathPaymentStrictReceive({
      sendAsset,
      sendMax,
      destination,
      destAsset,
      destAmount,
      path
    });

v2.0.2

09 Sep 18:41
f9d03ce
Compare
Choose a tag to compare

Fix

  • Fix issue #269. ManageBuyOffer should extend BaseOptions and inherited property "source". (#270).

v2.0.1

28 Aug 21:40
62884cc
Compare
Choose a tag to compare

No changes. Fixes deploy script and includes changes from v2.0.0.

v1.1.2

15 Aug 19:10
19de0ed
Compare
Choose a tag to compare

Fix

  • Fix no-network warnings (#248)

v1.1.1

05 Aug 15:28
2e7fae4
Compare
Choose a tag to compare

Fix

  • Add types for new networkPassphrase argument. Fix #237. (#238)

v1.1.0

01 Aug 21:27
d440d39
Compare
Choose a tag to compare

Deprecated

Deprecate global singleton for Network. The following classes and methods take an optional network passphrase, and issue a warning if it is not passed:

Keypair.master

Keypair.master(Networks.TESTNET)

constructor for Transaction

const xenv = new xdr.TransactionEnvelope({ tx: xtx });
new Transaction(xenv, Networks.TESTNET);

constructor for TransactionBuilder and method TransactionBuilder.setNetworkPassphrase

const transaction = new StellarSdk.TransactionBuilder(account, {
  fee: StellarSdk.BASE_FEE,
  networkPassphrase: Networks.TESTNET
})

See #207 and #112 for more information.

The Network class will be removed on the 2.0 release.

Add

  • Add docs for BASE_FEE const. (#211)

Fix

v1.0.3

22 Jul 23:01
1b73896
Compare
Choose a tag to compare

Add

  • Add toString() to Asset (#172)
  • Add types for missing Network functions (#208)
  • Add BASE_FEE to TS types (#209)

Fix

  • Fix typo in types (#194)
  • Fix types: Fee is no longer optional (#195)
  • Fix typings for Account Sequence Number (#203)
  • Fix typings for Transaction Sequence Number (#205)