Releases: stellar/js-stellar-base
v2.1.3
v2.1.2
v2.1.1
v2.1.0
This release adds support for stellar-core protocol 12 release and CAP 24 ("Make PathPayment Symmetrical").
Deprecated ❗️
Operation.pathPayment
is being deprecated in favor ofOperation.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 formerpathPayments
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
v2.0.1
v1.1.2
v1.1.1
v1.1.0
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
- Fix typo. (#213)