From 15bfa67f74b5df1b0d663484f5c80423696fcc4d Mon Sep 17 00:00:00 2001 From: Adolfo Builes Date: Wed, 23 Sep 2020 15:39:09 -0500 Subject: [PATCH] Update Changelog. --- CHANGELOG.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddae4666f..87fac5127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Unreleased ## Add -- Add the `Claimant` class which helps the creation of claimable balances. ((#367)[https://github.com/stellar/js-stellar-base/pull/367]). +- Add the `Claimant` class which helps the creation of claimable balances. ([#367](https://github.com/stellar/js-stellar-base/pull/367)). The default behavior of this class it to create claimants with an unconditional predicate if none is passed: ``` @@ -37,6 +37,38 @@ const claimant = new StellarBase.Claimant( ); ``` +- Add `Operation.createClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368)) +Extend the operation class with a new helper to create claimable balance operations. + +```js +const asset = new Asset( + 'USD', + 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' +); +const amount = '100.0000000'; +const claimants = [ + new Claimant( + 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', + Claimant.predicateBeforeAbsoluteTime("4102444800000") + ) +]; + +const op = Operation.createClaimableBalance({ + asset, + amount, + claimants +}); +``` + +- Add `Operation.claimClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368)) +Extend the operation class with a new helper to create claim claimable balance operations. It receives the `balanceId` as exposed by Horizon in the `/claimable_balances` end-point. + +```js +const op = Operation.createClaimableBalance({ + balanceId: '0da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be', +}); +``` + ### Breaking - The XDR generated in this code includes breaking changes on the internal XDR library since a bug was fixed which was causing incorrect code to be generated (see https://github.com/stellar/xdrgen/pull/52).