@stellar/stellar-base 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +1262 -0
  2. package/LICENSE +202 -0
  3. package/README.md +198 -0
  4. package/dist/stellar-base.js +30777 -0
  5. package/dist/stellar-base.min.js +2 -0
  6. package/lib/account.js +80 -0
  7. package/lib/address.js +169 -0
  8. package/lib/asset.js +323 -0
  9. package/lib/auth.js +253 -0
  10. package/lib/claimant.js +193 -0
  11. package/lib/contract.js +113 -0
  12. package/lib/events.js +42 -0
  13. package/lib/fee_bump_transaction.js +134 -0
  14. package/lib/generated/curr_generated.js +8315 -0
  15. package/lib/generated/next_generated.js +8315 -0
  16. package/lib/get_liquidity_pool_id.js +57 -0
  17. package/lib/hashing.js +12 -0
  18. package/lib/index.js +385 -0
  19. package/lib/invocation.js +195 -0
  20. package/lib/keypair.js +308 -0
  21. package/lib/liquidity_pool_asset.js +126 -0
  22. package/lib/liquidity_pool_id.js +101 -0
  23. package/lib/memo.js +270 -0
  24. package/lib/muxed_account.js +159 -0
  25. package/lib/network.js +22 -0
  26. package/lib/numbers/index.js +85 -0
  27. package/lib/numbers/int128.js +50 -0
  28. package/lib/numbers/int256.js +50 -0
  29. package/lib/numbers/sc_int.js +134 -0
  30. package/lib/numbers/uint128.js +50 -0
  31. package/lib/numbers/uint256.js +50 -0
  32. package/lib/numbers/xdr_large_int.js +267 -0
  33. package/lib/operation.js +715 -0
  34. package/lib/operations/account_merge.js +32 -0
  35. package/lib/operations/allow_trust.js +57 -0
  36. package/lib/operations/begin_sponsoring_future_reserves.js +38 -0
  37. package/lib/operations/bump_sequence.js +37 -0
  38. package/lib/operations/change_trust.js +52 -0
  39. package/lib/operations/claim_claimable_balance.js +40 -0
  40. package/lib/operations/clawback.js +46 -0
  41. package/lib/operations/clawback_claimable_balance.js +39 -0
  42. package/lib/operations/create_account.js +37 -0
  43. package/lib/operations/create_claimable_balance.js +65 -0
  44. package/lib/operations/create_passive_sell_offer.js +44 -0
  45. package/lib/operations/end_sponsoring_future_reserves.js +27 -0
  46. package/lib/operations/extend_footprint_ttl.js +45 -0
  47. package/lib/operations/index.js +254 -0
  48. package/lib/operations/inflation.js +23 -0
  49. package/lib/operations/invoke_host_function.js +219 -0
  50. package/lib/operations/liquidity_pool_deposit.js +64 -0
  51. package/lib/operations/liquidity_pool_withdraw.js +50 -0
  52. package/lib/operations/manage_buy_offer.js +50 -0
  53. package/lib/operations/manage_data.js +41 -0
  54. package/lib/operations/manage_sell_offer.js +50 -0
  55. package/lib/operations/path_payment_strict_receive.js +68 -0
  56. package/lib/operations/path_payment_strict_send.js +68 -0
  57. package/lib/operations/payment.js +47 -0
  58. package/lib/operations/restore_footprint.js +38 -0
  59. package/lib/operations/revoke_sponsorship.js +301 -0
  60. package/lib/operations/set_options.js +135 -0
  61. package/lib/operations/set_trustline_flags.js +84 -0
  62. package/lib/scval.js +369 -0
  63. package/lib/signerkey.js +103 -0
  64. package/lib/signing.js +96 -0
  65. package/lib/soroban.js +96 -0
  66. package/lib/sorobandata_builder.js +218 -0
  67. package/lib/strkey.js +400 -0
  68. package/lib/transaction.js +369 -0
  69. package/lib/transaction_base.js +248 -0
  70. package/lib/transaction_builder.js +753 -0
  71. package/lib/util/checksum.js +20 -0
  72. package/lib/util/continued_fraction.js +58 -0
  73. package/lib/util/decode_encode_muxed_account.js +116 -0
  74. package/lib/util/util.js +14 -0
  75. package/lib/xdr.js +9 -0
  76. package/package.json +133 -0
  77. package/types/curr.d.ts +14078 -0
  78. package/types/index.d.ts +1270 -0
  79. package/types/next.d.ts +14078 -0
  80. package/types/xdr.d.ts +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,1262 @@
1
+ # Changelog
2
+
3
+
4
+ ## [`v10.0.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0): Protocol 20 Stable Release
5
+
6
+ ### Breaking Changes
7
+ * The new minimum supported Node version is Node 18.
8
+ * XDR has been upgraded to the latest stable version ([stellar-xdr@`6a620d1`](https://github.com/stellar/stellar-xdr/tree/6a620d160aab22609c982d54578ff6a63bfcdc01)). This is mostly renames, but it includes the following relevant breaking changes ([#704](https://github.com/stellar/js-stellar-base/pull/704)):
9
+ - `Operation.bumpFootprintExpiration` is now `extendFootprintTtl` and its `ledgersToExpire` field is now named `extendTo`, but it serves the same purpose.
10
+ - In TypeScript, the `Operation.BumpFootprintExpiration` is now `Operation.ExtendFootprintTTL`
11
+ - `xdr.ContractExecutable.contractExecutableToken` is now `contractExecutableStellarAsset`
12
+ - `xdr.SorobanTransactionData.refundableFee` is now `resourceFee`
13
+ - In turn, `SorobanDataBuilder.setRefundableFee` is now `setResourceFee`
14
+ - This new fee encompasses the entirety of the Soroban-related resource fees. Note that this is distinct from the "network-inclusion" fee that you would set on your transaction (i.e. `TransactionBuilder(..., { fee: ... })`).
15
+ - `Contract.getFootprint()` now only returns a single result: the ledger key of the deployed instance for the given ID, because the key for the code entry was incorrect (it should not be the ID but rather the WASM hash, which is not calculatable w/o network access) ([#709](https://github.com/stellar/js-stellar-base/pull/709)).
16
+
17
+
18
+ ## [`v10.0.0-beta.4`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.3...v10.0.0-beta.4)
19
+
20
+ ### Fixed
21
+ - You can now correctly clone transactions (`TransactionBuilder.cloneFrom`) with large sequence numbers ([#711](https://github.com/stellar/js-stellar-base/pull/711)).
22
+
23
+
24
+ ## [`v10.0.0-beta.3`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.2...v10.0.0-beta.3)
25
+
26
+ ### Fixed
27
+ * Fixes a bug where `authorizeEntry` might perform a no-op when it shouldn't ([#701](https://github.com/stellar/js-stellar-base/pull/701)).
28
+ * Fixes a TypeScript bug where `Memo.hash` did not accept a `Buffer` ([#698](https://github.com/stellar/js-stellar-base/pull/698)).
29
+ * Upgrades a transient dependency for security ([#296](https://github.com/stellar/js-stellar-base/pull/696)).
30
+
31
+
32
+ ## [`v10.0.0-beta.2`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.1...v10.0.0-beta.2)
33
+
34
+ ### Breaking Changes
35
+ * The wrappers around multi-party authorization have changed ([#678](https://github.com/stellar/js-stellar-base/pull/678)):
36
+ - `authorizeEntry` has been added to help sign auth entries in-place
37
+ - the signature for `authorizeInvocation` has changed: it now offers a callback approach by default and requires slightly different parameters
38
+ - `buildAuthEntry`, `buildAuthEnvelope`, and `authorizeInvocationCallback` have been removed
39
+
40
+ ### Fixed
41
+ * The TypeScript definitions for XDR schemas now point to the current protocol rather than vNext ([#694](https://github.com/stellar/js-stellar-base/pull/694)).
42
+ * Misc. dependencies have been updated to their latest versions ([#694](https://github.com/stellar/js-stellar-base/pull/694)).
43
+
44
+
45
+ ## [`v10.0.0-beta.1`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.0...v10.0.0-beta.1)
46
+
47
+ ### Fixed
48
+ * `nativeToScVal` now allows anything to be passed to the `opts.type` specifier. Previously, it was only integer types ([#691](https://github.com/stellar/js-stellar-base/pull/691)).
49
+ * `Contract.call()` now produces valid `Operation` XDR ([#692](https://github.com/stellar/js-stellar-base/pull/692)).
50
+
51
+
52
+ ## [`v10.0.0-beta.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0-beta.0): Protocol 20
53
+
54
+ ### Breaking Changes
55
+ * **Node 16 is the new minimum version** to use the SDKs.
56
+ * The XDR has been massively overhauled to support [Soroban in Protocol 20](https://soroban.stellar.org/docs/category/fundamentals-and-concepts), which means new operations, data structures, and a transaction format as well as new overlay features ([#538](https://github.com/stellar/js-stellar-base/pull/538)).
57
+
58
+ The core data structure of Soroban is a generic type called an `ScVal` (**s**mart **c**ontract **val**ue, 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:
59
+ - `nativeToScVal` helps convert native types to their closest Soroban equivalent
60
+ - `scValToNative` helps find the closest native JavaScript type(s) corresponding to a smart contract value
61
+ - `scValToBigInt` helps convert numeric `ScVal`s into native `bigint`s
62
+ - `ScInt` and `XdrLargeInt` help convert to and from `bigint`s to other types and form sized integer types for smart contract usage
63
+
64
+ ### Added
65
+ The following are new APIs to deal with new Soroban constructs:
66
+ - **`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.
67
+ - **`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.
68
+ - **Three new operations** have been added related to Soroban transactions:
69
+ * `invokeHostFunction` for calling contract code
70
+ * `bumpFootprintExpiration` for extending the state lifetime of Soroban data
71
+ * `restoreFootprint` for restoring expired, off-chain state back onto the ledger
72
+ - 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.LedgerKey`s] it plans to read and write as part of the transaction).
73
+ * To facilitate building this out, there's a new `SorobanDataBuilder` factory to set fields individually
74
+ - The `TransactionBuilder` now has a `cloneFrom(tx, opts)` constructor method to create an instance from an existing transaction, also allowing parameter overrides via `opts`.
75
+ - The following are convenience methods for building out certain types of smart contract-related structures:
76
+ * `buildInvocationTree` and `walkInvocationTree` are both ways to visualize invocation calling trees better
77
+ * `authorizeInvocation` helps multiple parties sign invocation calling trees
78
+ * `humanizeEvents` helps make diagnostic events more readable
79
+ - 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.
80
+
81
+ ### Fixes
82
+ * Improves the error messages when passing invalid amounts to deposit and withdraw operations ([#679](https://github.com/stellar/js-stellar-base/pull/679)).
83
+
84
+
85
+ ## [v9.0.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0)
86
+
87
+ This is a large update and the following changelog incorporates ALL changes across the `beta.N` versions of this upgrade.
88
+
89
+ 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.
90
+
91
+ The browser bundle size has decreased **significantly**:
92
+
93
+ * `stellar-base.min.js` is **340 KiB**, down from **1.2 MiB** previously.
94
+ * the new, unminified `stellar-base.js` is **895 KiB**.
95
+
96
+ ### Breaking Changes
97
+
98
+ - The build system has been completely overhauled to support Webpack 5 ([#584](https://github.com/stellar/js-stellar-base/pull/584), [#585](https://github.com/stellar/js-stellar-base/pull/585)).
99
+
100
+ 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.
101
+
102
+ ### Fixes
103
+
104
+ - Fixes a bug when sorting mixed-case assets for liquidity pools ([#606](https://github.com/stellar/js-stellar-base/pull/606)).
105
+ - Documentation is fixed and should generate correctly on https://stellar.github.io/js-stellar-base/ ([#609](https://github.com/stellar/js-stellar-base/pull/609)).
106
+
107
+ ### Updates
108
+
109
+ - XDR has been updated to its latest version (both `curr` and `next` versions, [#587](https://github.com/stellar/js-stellar-base/pull/587)).
110
+ - Drop the `lodash` dependency entirely ([#624](https://github.com/stellar/js-stellar-base/issues/624)).
111
+ - Drop the `crc` dependency and inline it to lower bundle size ([#621](https://github.com/stellar/js-stellar-base/pull/621)).
112
+ - Upgrade all dependencies to their latest versions ([#608](https://github.com/stellar/js-stellar-base/pull/608)).
113
+
114
+
115
+ ## [v9.0.0-beta.3](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.1..v9.0.0-beta.2)
116
+
117
+ ### Fix
118
+
119
+ - Fixes a bug when sorting mixed-case assets for liquidity pools ([#606](https://github.com/stellar/js-stellar-base/pull/606)).
120
+
121
+ ### Update
122
+ - Upgrade all dependencies to their latest versions ([#608](https://github.com/stellar/js-stellar-base/pull/608)).
123
+ - Drop the `crc` dependency and inline it to lower bundle size ([#621](https://github.com/stellar/js-stellar-base/pull/621)).
124
+
125
+
126
+ ## [v9.0.0-beta.2](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.1..v9.0.0-beta.2)
127
+
128
+ ### Update
129
+
130
+ - Upgrades the `js-xdr` dependency (major performance improvements, see [`js-xdr@v2.0.0`](https://github.com/stellar/js-xdr/releases/tag/v2.0.0)) and other dependencies to their latest versions ([#592](https://github.com/stellar/js-stellar-base/pull/592)).
131
+
132
+
133
+ ## [v9.0.0-beta.1](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.0..v9.0.0-beta.1)
134
+
135
+ ### Fix
136
+
137
+ - Correct XDR type definition for raw `xdr.Operation`s ([#591](https://github.com/stellar/js-stellar-base/pull/591)).
138
+
139
+
140
+ ## [v9.0.0-beta.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0-beta.0)
141
+
142
+ 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.
143
+
144
+ ### Fix
145
+
146
+ - Build system has been overhauled to support Webpack 5 ([#585](https://github.com/stellar/js-stellar-base/pull/585)).
147
+
148
+ - Current and vNext XDR updated to latest versions ([#587](https://github.com/stellar/js-stellar-base/pull/587)).
149
+
150
+
151
+ ## [v8.2.2](https://github.com/stellar/js-stellar-base/compare/v8.2.1..v8.2.2)
152
+
153
+ ### Fix
154
+
155
+ - Enable signing in service workers using FastSigning ([#567](https://github.com/stellar/js-stellar-base/pull/567)).
156
+
157
+ ## [v8.2.1](https://github.com/stellar/js-stellar-base/compare/v8.2.0..v8.2.1)
158
+
159
+ ### Fix
160
+
161
+ * Turn all XLM-like (i.e. casing agnostic) asset codes into the native asset with code `XLM` ([#546](https://github.com/stellar/js-stellar-base/pull/546)).
162
+
163
+
164
+ ## [v8.2.0](https://github.com/stellar/js-stellar-base/compare/v8.1.0..v8.2.0)
165
+
166
+ ### Add
167
+
168
+ * `Operation.setOptions` now supports the new [CAP-40](https://stellar.org/protocol/cap-40) signed payload signer (`ed25519SignedPayload`) thanks to @orbitlens ([#542](https://github.com/stellar/js-stellar-base/pull/542)).
169
+
170
+
171
+ ## [v8.1.0](https://github.com/stellar/js-stellar-base/compare/v8.0.1..v8.1.0)
172
+
173
+ ### Add
174
+
175
+ * `TransactionBase.addDecoratedSignature` is a clearer way to add signatures directly to a built transaction without fiddling with the underlying `signatures` array ([#535](https://github.com/stellar/js-stellar-base/pull/535)).
176
+
177
+ * Update the XDR definitions (and the way in which they're generated) to contain both the latest current XDR (which introduces [CAP-42](https://stellar.org/protocol/cap-42)) and the "v-next" XDR (which contains XDR related to Soroban and should be considered unstable) ([#537](https://github.com/stellar/js-stellar-base/pull/537)).
178
+
179
+ ### Fix
180
+
181
+ * Correctly set `minAccountSequence` in `TransactionBuilder` for large values ([#539](https://github.com/stellar/js-stellar-base/pull/539), thank you @overcat!).
182
+
183
+
184
+ ## [v8.0.1](https://github.com/stellar/js-stellar-base/compare/v8.0.0..v8.0.1)
185
+
186
+ ### Fix
187
+
188
+ - Correctly predict claimable balance IDs with large sequence numbers ([#530](https://github.com/stellar/js-stellar-base/pull/530), thank you @overcat!).
189
+
190
+
191
+ ## [v8.0.0](https://github.com/stellar/js-stellar-base/compare/v7.0.0..v8.0.0)
192
+
193
+ This is a promotion from the beta version without changes, now that the CAP-21 and CAP-40 implementations have made it into [stellar/stellar-core#master](https://github.com/stellar/stellar-core/tree/master/).
194
+
195
+
196
+ ## [v8.0.0-beta.0](https://github.com/stellar/js-stellar-base/compare/v7.0.0..v8.0.0-beta.0)
197
+
198
+ **This release adds support for Protocol 19**, which includes [CAP-21](https://stellar.org/protocol/cap-21) (new transaction preconditions) and [CAP-40](https://stellar.org/protocol/cap-40) (signed payload signers).
199
+
200
+ This is considered a beta release until the XDR for the Stellar protocol stabilizes and is officially released.
201
+
202
+ ### Breaking
203
+
204
+ As of this release, the minimum supported version of NodeJS is **14.x**.
205
+
206
+ - Two XDR types have been renamed:
207
+ * `xdr.OperationId` is now `xdr.HashIdPreimage`
208
+ * `xdr.OperationIdId` is now `xdr.HashIdPreimageOperationId`
209
+
210
+ ### Add
211
+
212
+ - Support for converting signed payloads ([CAP-40](https://stellar.org/protocol/cap-40)) to and from their StrKey (`P...`) representation ([#511](https://github.com/stellar/js-stellar-base/pull/511)):
213
+ * `Keypair.signPayloadDecorated(data)`
214
+ * `StrKey.encodeSignedPayload(buf)`
215
+ * `StrKey.decodeSignedPayload(str)`
216
+ * `StrKey.isValidSignedPayload(str)`
217
+
218
+ - Support for creating transactions with the new preconditions ([CAP-21](https://stellar.org/protocol/cap-21)) via `TransactionBuilder` ([#513](https://github.com/stellar/js-stellar-base/pull/513)).
219
+
220
+ - A way to convert between addresses (like `G...` and `P...`, i.e. the `StrKey` class) and their respective signer keys (i.e. `xdr.SignerKey`s), particularly for use in the new transaction preconditions ([#520](https://github.com/stellar/js-stellar-base/pull/520)):
221
+ * `SignerKey.decodeAddress(address)`
222
+ * `SignerKey.encodeSignerKey(address)`
223
+ * `TransactionBuilder.setTimebounds(min, max)`
224
+ * `TransactionBuilder.setLedgerbounds(min, max)`
225
+ * `TransactionBuilder.setMinAccountSequence(seq)`
226
+ * `TransactionBuilder.setMinAccountSequenceAge(age)`
227
+ * `TransactionBuilder.setMinAccountSequenceLedgerGap(gap)`
228
+ * `TransactionBuilder.setExtraSigners([signers])`
229
+
230
+ ### Fix
231
+
232
+ - Correct a TypeScript definition on the `RevokeLiquidityPoolSponsorship` operation ([#522](https://github.com/stellar/js-stellar-base/pull/522)).
233
+
234
+ - Resolves a bug that incorrectly sorted `Asset`s with mixed-case asset codes (it preferred lowercase codes incorrectly) ([#516](https://github.com/stellar/js-stellar-base/pull/516)).
235
+
236
+ - Update developer dependencies:
237
+ * `isparta`, `jsdoc`, and `underscore` ([#500](https://github.com/stellar/js-stellar-base/pull/500))
238
+ * `ajv` ([#503](https://github.com/stellar/js-stellar-base/pull/503))
239
+ * `karma` ([#505](https://github.com/stellar/js-stellar-base/pull/505))
240
+ * `minimist` ([#514](https://github.com/stellar/js-stellar-base/pull/514))
241
+
242
+
243
+ ## [v7.0.0](https://github.com/stellar/js-stellar-base/compare/v6.0.6..v7.0.0)
244
+
245
+ This release introduces **unconditional support for muxed accounts** ([#485](https://github.com/stellar/js-stellar-base/pull/485)).
246
+
247
+ ### Breaking Changes
248
+
249
+ In [v5.2.0](https://github.com/stellar/js-stellar-base/releases/tag/v5.2.0), we introduced _opt-in_ support for muxed accounts, where you would need to explicitly pass a `true` flag if you wanted to interpret muxed account objects as muxed addresses (in the form `M...`, see [SEP-23](https://stellar.org/protocol/sep-23)). We stated that this would become the default in the future. That is now the case.
250
+
251
+ The following fields will now always support muxed properties:
252
+
253
+ * `FeeBumpTransaction.feeSource`
254
+ * `Transaction.sourceAccount`
255
+ * `Operation.sourceAccount`
256
+ * `Payment.destination`
257
+ * `PathPaymentStrictReceive.destination`
258
+ * `PathPaymentStrictSend.destination`
259
+ * `AccountMerge.destination`
260
+ * `Clawback.from`
261
+
262
+ The following functions had a `withMuxing` parameter removed:
263
+
264
+ - `Operation.fromXDRObject`
265
+ - `Transaction.constructor`
266
+ - `FeeBumpTransaction.constructor`
267
+ - `TransactionBuilder.fromXDR`
268
+ - `TransactionBuilder.buildFeeBumpTransaction`
269
+
270
+ The following functions will no longer check the `opts` object for a `withMuxing` field:
271
+
272
+ - `TransactionBuilder.constructor`
273
+ - `Operation.setSourceAccount`
274
+
275
+ There are several other breaking changes:
276
+
277
+ - `TransactionBuilder.enableMuxedAccounts()` is removed
278
+ - `decodeAddressToMuxedAccount()` and `encodeMuxedAccountToAddress()` no longer accept a second boolean parameter
279
+ - `Account.createSubaccount()` and `MuxedAccount.createSubaccount()` are removed ([#487](https://github.com/stellar/js-stellar-base/pull/487)). You should prefer to create them manually:
280
+
281
+ ```js
282
+ let mux1 = new MuxedAccount(someAccount, '1');
283
+
284
+ // before:
285
+ let mux2 = mux1.createSubaccount('2');
286
+
287
+ // now:
288
+ let mux2 = new MuxedAccount(mux1.baseAccount(), '2');
289
+ ```
290
+
291
+
292
+ - Introduced a new helper method to help convert from muxed account addresses to their underlying Stellar addresses ([#485](https://github.com/stellar/js-stellar-base/pull/485)):
293
+
294
+ ```ts
295
+ function extractBaseAddess(address: string): string;
296
+ ```
297
+
298
+ - The following muxed account validation functions are now available from Typescript ([#483](https://github.com/stellar/js-stellar-base/pull/483/files)):
299
+
300
+ ```typescript
301
+ namespace StrKey {
302
+ function encodeMed25519PublicKey(data: Buffer): string;
303
+ function decodeMed25519PublicKey(data: string): Buffer;
304
+ function isValidMed25519PublicKey(publicKey: string): boolean;
305
+ }
306
+
307
+ function decodeAddressToMuxedAccount(address: string, supportMuxing: boolean): xdr.MuxedAccount;
308
+ function encodeMuxedAccountToAddress(account: xdr.MuxedAccount, supportMuxing: boolean): string;
309
+ function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount;
310
+ ```
311
+
312
+ - Added a helper function `Transaction.getClaimableBalanceId(int)` which lets you pre-determine the hex claimable balance ID of a `createClaimableBalance` operation prior to submission to the network ([#482](https://github.com/stellar/js-stellar-base/pull/482)).
313
+
314
+ ### Fix
315
+
316
+ - Add `Buffer` as a parameter type option for the `Keypair` constructor in Typescript ([#484](https://github.com/stellar/js-stellar-base/pull/484)).
317
+
318
+
319
+ ## [v6.0.6](https://github.com/stellar/js-stellar-base/compare/v6.0.5..v6.0.6)
320
+
321
+ ### Fix
322
+
323
+ - Upgrades dependencies: `path-parse` (1.0.6 --> 1.0.7) and `jszip` (3.4.0 to 3.7.1) ([#450](https://github.com/stellar/js-stellar-base/pull/450), [#458](https://github.com/stellar/js-stellar-base/pull/458)).
324
+
325
+
326
+ ## [v6.0.5](https://github.com/stellar/js-stellar-base/compare/v6.0.4..v6.0.5)
327
+
328
+ This version bump fixes a security vulnerability in a _developer_ dependency; **please upgrade as soon as possible!** You may be affected if you are working on this package in a developer capacity (i.e. you've cloned this repository) and have run `yarn` or `yarn install` any time on Oct 22nd, 2021.
329
+
330
+ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-rvh2-c87w) for details.
331
+
332
+
333
+ ### Security Fix
334
+ - Pin `ua-parser-js` to a known safe version ([#477](https://github.com/stellar/js-stellar-base/pull/477)).
335
+
336
+
337
+ ## [v6.0.4](https://github.com/stellar/js-stellar-base/compare/v6.0.3..v6.0.4)
338
+
339
+ ### Fix
340
+ - Allow muxed accounts when decoding transactions via `TransactionBuilder.fromXDR()` ([#470](https://github.com/stellar/js-stellar-base/pull/470)).
341
+
342
+
343
+ ## [v6.0.3](https://github.com/stellar/js-stellar-base/compare/v6.0.2..v6.0.3)
344
+
345
+ ### Fix
346
+ - When creating a `Transaction`, forward the optional `withMuxing` flag along to its operations so that their properties are also decoded with the appropriate muxing state ([#469](https://github.com/stellar/js-stellar-base/pull/469)).
347
+
348
+
349
+ ## [v6.0.2](https://github.com/stellar/js-stellar-base/compare/v6.0.1..v6.0.2)
350
+
351
+ ### Fix
352
+ - Fix Typescript signatures for operations to universally allow setting the `withMuxing` flag ([#466](https://github.com/stellar/js-stellar-base/pull/466)).
353
+
354
+
355
+ ## [v6.0.1](https://github.com/stellar/js-stellar-base/compare/v5.3.2..v6.0.1)
356
+
357
+ ### Add
358
+
359
+ - Introduced new CAP-38 operations `LiquidityPoolDepositOp` and `LiquidityPoolWithdrawOp`.
360
+ - Introduced two new types of assets, `LiquidityPoolId` and `LiquidityPoolAsset`.
361
+
362
+ ### Update
363
+
364
+ - The XDR definitions have been updated to support CAP-38.
365
+ - Extended `Operation` class with the `Operation.revokeLiquidityPoolSponsorship` helper that allows revoking a liquidity pool sponsorship.
366
+ - Asset types now include `AssetType.liquidityPoolShares`.
367
+ - `Operation.changeTrust` and `ChangeTrustOp` can now use `LiquidityPoolAsset` in addition to `Asset`.
368
+ - `Operation.revokeTrustlineSponsorship` can now use `LiquidityPoolId` in addition to `Asset`.
369
+
370
+ ## [v5.3.2](https://github.com/stellar/js-stellar-base/compare/v5.3.1..v5.3.2)
371
+
372
+ ### Fix
373
+ - Update various dependencies to secure versions. Most are developer dependencies which means no or minimal downstream effects ([#446](https://github.com/stellar/js-stellar-base/pull/446), [#447](https://github.com/stellar/js-stellar-base/pull/447), [#392](https://github.com/stellar/js-stellar-base/pull/392), [#428](https://github.com/stellar/js-stellar-base/pull/428)); the only non-developer dependency upgrade is a patch version bump to `lodash` ([#449](https://github.com/stellar/js-stellar-base/pull/449)).
374
+
375
+
376
+ ## [v5.3.1](https://github.com/stellar/js-stellar-base/compare/v5.3.0..v5.3.1)
377
+
378
+ ### Fix
379
+ - Creating operations with both muxed and unmuxed properties resulted in unintuitive XDR. Specifically, the unmuxed property would be transformed into the equivalent property with an ID of 0 ([#441](https://github.com/stellar/js-stellar-base/pull/441)).
380
+
381
+
382
+ ## [v5.3.0](https://github.com/stellar/js-stellar-base/compare/v5.2.1..v5.3.0)
383
+
384
+ ### Add
385
+ - **Opt-in support for muxed accounts.** In addition to the support introduced in [v5.2.0](https://github.com/stellar/js-stellar-base/releases/v5.2.0), this completes support for muxed accounts by enabling them for fee-bump transactions. Pass a muxed account address (in the `M...` form) as the first parameter (and explicitly opt-in to muxing by passing `true` as the last parameter) to `TransactionBuilder.buildFeeBumpTransaction` to make the `feeSource` a fully-muxed account instance ([#434](https://github.com/stellar/js-stellar-base/pull/434)).
386
+
387
+
388
+ ## [v5.2.1](https://github.com/stellar/js-stellar-base/compare/v5.2.0..v5.2.1)
389
+
390
+ ### Fix
391
+ - Fix regression where raw public keys were [sometimes](https://github.com/stellar/js-stellar-sdk/issues/645) being parsed incorrectly ([#429](https://github.com/stellar/js-stellar-base/pull/429)).
392
+
393
+
394
+ ## [v5.2.0](https://github.com/stellar/js-stellar-base/compare/v5.1.0..v5.2.0)
395
+
396
+ ### Add
397
+ - **Opt-in support for muxed accounts.** This introduces `M...` addresses from [SEP-23](https://stellar.org/protocol/sep-23), which multiplex a Stellar `G...` address across IDs to eliminate the need for ad-hoc multiplexing via the Transaction.memo field (see the relevant [SEP-29](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md) and [blog post](https://www.stellar.org/developers-blog/fixing-memo-less-payments) on the topic). The following operations now support muxed accounts ([#416](https://github.com/stellar/js-stellar-base/pull/416)):
398
+ * `Payment.destination`
399
+ * `PathPaymentStrictReceive.destination`
400
+ * `PathPaymentStrictSend.destination`
401
+ * `Operation.sourceAccount`
402
+ * `AccountMerge.destination`
403
+ * `Transaction.sourceAccount`
404
+
405
+ - The above changeset also introduces a new high-level object, `MuxedAccount` (not to be confused with `xdr.MuxedAccount`, which is the underlying raw representation) to make working with muxed accounts easier. You can use it to easily create and manage muxed accounts and their underlying shared `Account`, passing them along to the supported operations and `TransactionBuilder` ([#416](https://github.com/stellar/js-stellar-base/pull/416)):
406
+
407
+ ```js
408
+ const PUBKEY = 'GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ';
409
+ const ACC = new StellarBase.Account(PUBKEY, '1');
410
+
411
+ const mux1 = new StellarBase.MuxedAccount(ACC, '1000');
412
+ console.log(mux1.accountId(), mux1.id());
413
+ // MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAD5DTGC 1000
414
+
415
+ const mux2 = ACC.createSubaccount('2000');
416
+ console.log("Parent relationship preserved:",
417
+ mux2.baseAccount().accountId() === mux1.baseAccount().accountId());
418
+ console.log(mux2.accountId(), mux2.id());
419
+ // MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAH2B4RU 2000
420
+
421
+ mux1.setID('3000');
422
+ console.log("Underlying account unchanged:",
423
+ ACC.accountId() === mux1.baseAccount().accountId());
424
+ console.log(mux1.accountId(), mux1.id());
425
+ // MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAALXC5LE 3000
426
+ ```
427
+
428
+ - You can refer to the [documentation](https://stellar.github.io/js-stellar-sdk/MuxedAccount.html) or the [test suite](../test/unit/muxed_account_test.js) for more uses of the API.
429
+
430
+ ### Update
431
+ - Modernize the minimum-supported browser versions for the library ([#419](https://github.com/stellar/js-stellar-base/pull/419)).
432
+
433
+ ### Fix
434
+ - Update Typescript test for `SetOptions` to use authorization flags (e.g. `AuthRequiredFlag`) correctly ([#418](https://github.com/stellar/js-stellar-base/pull/418)).
435
+
436
+
437
+ ## [v5.1.0](https://github.com/stellar/js-stellar-base/compare/v5.0.0..v5.1.0)
438
+
439
+ ### Update
440
+
441
+ - The Typescript definitions have been updated to support CAP-35 ([#407](https://github.com/stellar/js-stellar-base/pull/407)).
442
+
443
+ ## [v5.0.0](https://github.com/stellar/js-stellar-base/compare/v4.0.3..v5.0.0)
444
+
445
+ ### Add
446
+
447
+ - Introduced new CAP-35 operations, `ClawbackOp`, `ClawbackClaimableBalanceOp`, and `SetTrustLineFlagsOp` ([#397](https://github.com/stellar/js-stellar-base/pull/397/)).
448
+
449
+ ### Update
450
+
451
+ - Add an additional parameter check to `claimClaimableBalance` to fail faster ([#390](https://github.com/stellar/js-stellar-base/pull/390)).
452
+
453
+ - The XDR definitions have been updated to support CAP-35 ([#394](https://github.com/stellar/js-stellar-base/pull/394)).
454
+
455
+ ### Breaking
456
+
457
+ - `AllowTrustOpAsset` has been renamed to `AssetCode` ([#394](https://github.com/stellar/js-stellar-base/pull/394))
458
+
459
+
460
+ ### Deprecated
461
+
462
+ - `AllowTrustOp` is now a deprecated operation.
463
+
464
+ ## [v4.0.3](https://github.com/stellar/js-stellar-base/compare/v4.0.2..v4.0.3)
465
+
466
+ ## Update
467
+
468
+ - Update TS definitions for XDRs ([#381](https://github.com/stellar/js-stellar-base/pull/381))
469
+ - Fix typing for ManageData.value ([#379](https://github.com/stellar/js-stellar-base/pull/379))
470
+
471
+
472
+ ## [v4.0.2](https://github.com/stellar/js-stellar-base/compare/v4.0.1..v4.0.2)
473
+
474
+ ## Update
475
+
476
+ - Fix deployment script.
477
+
478
+
479
+ ## [v4.0.1](https://github.com/stellar/js-stellar-base/compare/v4.0.0..v4.0.1)
480
+
481
+ ## Update
482
+
483
+ - Update `createAccount` operation to accept `0` as the starting balance ([#375](https://github.com/stellar/js-stellar-base/pull/375)).
484
+
485
+ ## [v4.0.0](https://github.com/stellar/js-stellar-base/compare/v3.0.4..v4.0.0)
486
+
487
+ ## Add
488
+ - Add the `Claimant` class which helps the creation of claimable balances. ([#367](https://github.com/stellar/js-stellar-base/pull/367)).
489
+ The default behavior of this class it to create claimants with an unconditional predicate if none is passed:
490
+
491
+ ```
492
+ const claimant = new StellarBase.Claimant(
493
+ 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'
494
+ );
495
+ ```
496
+
497
+ However, you can use any of the following helpers to create a predicate:
498
+
499
+ ```
500
+ StellarBase.Claimant.predicateUnconditional();
501
+ StellarBase.Claimant.predicateAnd(left, right);
502
+ StellarBase.Claimant.predicateOr(left, right);
503
+ StellarBase.Claimant.predicateNot(predicate);
504
+ StellarBase.Claimant.predicateBeforeAbsoluteTime(unixEpoch);
505
+ StellarBase.Claimant.predicateBeforeRelativeTime(seconds);
506
+ ```
507
+
508
+ And then pass the predicate in the constructor:
509
+
510
+ ```
511
+ const left = StellarBase.Claimant.predicateBeforeRelativeTime('800');
512
+ const right = StellarBase.Claimant.predicateBeforeRelativeTime(
513
+ '1200'
514
+ );
515
+ const predicate = StellarBase.Claimant.predicateOr(left, right);
516
+ const claimant = new StellarBase.Claimant(
517
+ 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ',
518
+ predicate
519
+ );
520
+ ```
521
+
522
+ - Add `Operation.createClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368))
523
+ Extend the operation class with a new helper to create claimable balance operations.
524
+
525
+ ```js
526
+ const asset = new Asset(
527
+ 'USD',
528
+ 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
529
+ );
530
+ const amount = '100.0000000';
531
+ const claimants = [
532
+ new Claimant(
533
+ 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ',
534
+ Claimant.predicateBeforeAbsoluteTime("4102444800000")
535
+ )
536
+ ];
537
+
538
+ const op = Operation.createClaimableBalance({
539
+ asset,
540
+ amount,
541
+ claimants
542
+ });
543
+ ```
544
+
545
+ - Add `Operation.claimClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368))
546
+ 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.
547
+
548
+ ```js
549
+ const op = Operation.createClaimableBalance({
550
+ balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',
551
+ });
552
+ ```
553
+ - Add support for Sponsored Reserves (CAP33)([#369](https://github.com/stellar/js-stellar-base/pull/369/))
554
+
555
+ Extend the operation class with helpers that allow sponsoring reserves and also revoke sponsorships.
556
+
557
+ To start sponsoring reserves for an account use:
558
+ - `Operation.beginSponsoringFutureReserves`
559
+ - `Operation.endSponsoringFutureReserves`
560
+
561
+ To revoke a sponsorship after it has been created use any of the following helpers:
562
+
563
+ - `Operation.revokeAccountSponsorship`
564
+ - `Operation.revokeTrustlineSponsorship`
565
+ - `Operation.revokeOfferSponsorship`
566
+ - `Operation.revokeDataSponsorship`
567
+ - `Operation.revokeClaimableBalanceSponsorship`
568
+ - `Operation.revokeSignerSponsorship`
569
+
570
+ The following example contains a transaction which sponsors operations for an account and then revoke some sponsorships.
571
+
572
+ ```
573
+ const transaction = new StellarSdk.TransactionBuilder(account, {
574
+ fee: "100",
575
+ networkPassphrase: StellarSdk.Networks.TESTNET
576
+ })
577
+ .addOperation(
578
+ StellarSdk.Operation.beginSponsoringFutureReserves({
579
+ sponsoredId: account.accountId(),
580
+ source: masterKey.publicKey()
581
+ })
582
+ )
583
+ .addOperation(
584
+ StellarSdk.Operation.accountMerge({ destination: destKey.publicKey() }),
585
+ ).addOperation(
586
+ StellarSdk.Operation.createClaimableBalance({
587
+ amount: "10",
588
+ asset: StellarSdk.Asset.native(),
589
+ claimants: [
590
+ new StellarSdk.Claimant(account.accountId())
591
+ ]
592
+ }),
593
+ ).addOperation(
594
+ StellarSdk.Operation.claimClaimableBalance({
595
+ balanceId: "00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be",
596
+ }),
597
+ ).addOperation(
598
+ StellarSdk.Operation.endSponsoringFutureReserves({
599
+ })
600
+ ).addOperation(
601
+ StellarSdk.Operation.revokeAccountSponsorship({
602
+ account: account.accountId(),
603
+ })
604
+ ).addOperation(
605
+ StellarSdk.Operation.revokeTrustlineSponsorship({
606
+ account: account.accountId(),
607
+ asset: usd,
608
+ })
609
+ ).addOperation(
610
+ StellarSdk.Operation.revokeOfferSponsorship({
611
+ seller: account.accountId(),
612
+ offerId: '12345'
613
+ })
614
+ ).addOperation(
615
+ StellarSdk.Operation.revokeDataSponsorship({
616
+ account: account.accountId(),
617
+ name: 'foo'
618
+ })
619
+ ).addOperation(
620
+ StellarSdk.Operation.revokeClaimableBalanceSponsorship({
621
+ balanceId: "00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be",
622
+ })
623
+ ).addOperation(
624
+ StellarSdk.Operation.revokeSignerSponsorship({
625
+ account: account.accountId(),
626
+ signer: {
627
+ ed25519PublicKey: sourceKey.publicKey()
628
+ }
629
+ })
630
+ ).addOperation(
631
+ StellarSdk.Operation.revokeSignerSponsorship({
632
+ account: account.accountId(),
633
+ signer: {
634
+ sha256Hash: "da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be"
635
+ }
636
+ })
637
+ ).addOperation(
638
+ StellarSdk.Operation.revokeSignerSponsorship({
639
+ account: account.accountId(),
640
+ signer: {
641
+ preAuthTx: "da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be"
642
+ }
643
+ })
644
+ ).build();
645
+ ```
646
+
647
+ ### Breaking
648
+
649
+ - 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).
650
+
651
+ The following functions were renamed:
652
+
653
+ - `xdr.OperationBody.setOption()` -> `xdr.OperationBody.setOptions()`
654
+ - `xdr.OperationBody.manageDatum()` -> `xdr.OperationBody.manageData()`
655
+ - `xdr.OperationType.setOption()` -> `xdr.OperationType.setOptions()`
656
+ - `xdr.OperationType.manageDatum()` -> `xdr.OperationType.manageData()`
657
+
658
+ The following enum values were rename in `OperationType`:
659
+
660
+ - `setOption` -> `setOptions`
661
+ - `manageDatum` -> `manageData`
662
+
663
+ ## [v3.0.4](https://github.com/stellar/js-stellar-base/compare/v3.0.3..v3.0.4)
664
+
665
+ ### Update
666
+
667
+ - Generate V1 transactions by default and allow V0 transactions to be fee bumped ([#355](https://github.com/stellar/js-stellar-base/pull/355)).
668
+
669
+ ## [v3.0.3](https://github.com/stellar/js-stellar-base/compare/v3.0.2..v3.0.3)
670
+
671
+ ### Remove
672
+
673
+ - Rollback support for SEP23 (Muxed Account StrKey) ([#349](https://github.com/stellar/js-stellar-base/pull/349)).
674
+
675
+ ## [v3.0.2](https://github.com/stellar/js-stellar-base/compare/v3.0.1..v3.0.2)
676
+
677
+ ### Fix
678
+ - Extend `files` in npm package to include XDR type definitions ([#345](https://github.com/stellar/js-stellar-base/pull/345)).
679
+
680
+ ## [v3.0.1](https://github.com/stellar/js-stellar-base/compare/v3.0.0..v3.0.1)
681
+
682
+ ### Add
683
+ - Add TypeScript definitions for auto-generated XDR code ([#342](https://github.com/stellar/js-stellar-base/pull/342)).
684
+
685
+ ## [v3.0.0](https://github.com/stellar/js-stellar-base/compare/v2.1.9..v3.0.0)
686
+
687
+ This version brings protocol 13 support with backwards compatibility support for protocol 12.
688
+
689
+ ### Add
690
+ - Add `TransactionBuilder.buildFeeBumpTransaction` which makes it easy to create `FeeBumpTransaction` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
691
+ - Adds a feature flag which allow consumers of this library to create V1 (protocol 13) transactions using the `TransactionBuilder` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
692
+ - Add support for [CAP0027](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md): First-class multiplexed accounts ([#325](https://github.com/stellar/js-stellar-base/pull/325)).
693
+ - ~Add `Keypair.xdrMuxedAccount` which creates a new `xdr.MuxedAccount`([#325](https://github.com/stellar/js-stellar-base/pull/325)).~
694
+ - Add `FeeBumpTransaction` which makes it easy to work with fee bump transactions ([#328](https://github.com/stellar/js-stellar-base/pull/328)).
695
+ - Add `TransactionBuilder.fromXDR` which receives an xdr envelope and return a `Transaction` or `FeeBumpTransaction` ([#328](https://github.com/stellar/js-stellar-base/pull/328)).
696
+
697
+ ### Update
698
+ - Update XDR definitions with protocol 13 ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
699
+ - Extend `Transaction` to work with `TransactionV1Envelope` and `TransactionV0Envelope` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
700
+ - Add backward compatibility support for [CAP0018](https://github.com/stellar/stellar-protocol/blob/f01c9354aaab1e8ca97a25cf888829749cadf36a/core/cap-0018.md) ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
701
+ CAP0018 provides issuers with a new level of authorization between unauthorized and fully authorized, called "authorized to maintain liabilities". The changes in this release allow you to use the new authorization level and provides backward compatible support for Protocol 12.
702
+
703
+ Before Protocol 13, the argument `authorize` in the `AllowTrust` operation was of type `boolean` where `true` was authorize and `false` deauthorize. Starting in Protocol 13, this value is now a `number` where `0` is deauthorize, `1` is authorize, and `2` is authorize to maintain liabilities.
704
+
705
+ The syntax for authorizing a trustline is still the same, but the authorize parameter is now a `number`.
706
+
707
+ ```js
708
+ Operation.allowTrust({
709
+ trustor: trustor.publicKey(),
710
+ assetCode: "COP",
711
+ authorize: 1
712
+ });
713
+ ```
714
+
715
+ You can use still use a `boolean`; however, we recommend you update your code to pass a `number` instead. Finally, using the value `2` for authorize to maintain liabilities will only be valid if Stellar Core is running on Protocol 13; otherwise, you'll get an error.
716
+
717
+ - ~Update operations builder to support multiplexed accounts ([#337](https://github.com/stellar/js-stellar-base/pull/337)).~
718
+
719
+ ### Breaking changes
720
+
721
+ - `Transaction.toEnvelope()` returns a protocol 13 `xdr.TransactionEnvelope` which is an `xdr.Union` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
722
+ If you have code that looks like this - `transaction.toEnvelope().tx` - you have two options:
723
+ - You can grab the value wrapped by the union, calling `value()` like `transaction.toEnvelope().value().tx`.
724
+ - You can check which is the discriminant by using `switch()` and then call `v0()`, `v1()`, or `feeBump()`.
725
+ - The return value from `Transaction.fee` changed from `number` to `string`. This brings support for `Int64` values ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
726
+ - The const `BASE_FEE` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
727
+ - The option `fee` passed to `new TransactionBuilder({fee: ..})` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
728
+ - The following fields, which were previously an `xdr.AccountID` are now a `xdr.MuxedAccount` ([#325](https://github.com/stellar/js-stellar-base/pull/325)):
729
+ - `PaymentOp.destination`
730
+ - `PathPaymentStrictReceiveOp.destination`
731
+ - `PathPaymentStrictSendOp.destination`
732
+ - `Operation.sourceAccount`
733
+ - `Operation.destination` (for `ACCOUNT_MERGE`)
734
+ - `Transaction.sourceAccount`
735
+ - `FeeBumpTransaction.feeSource`
736
+
737
+ You can get the string representation by calling `StrKey.encodeMuxedAccount` which will return a `G..` or `M..` account.
738
+ - Remove the following deprecated functions ([#331](https://github.com/stellar/js-stellar-base/pull/331)):
739
+ - `Operation.manageOffer`
740
+ - `Operation.createPassiveOffer`
741
+ - `Operation.pathPayment`
742
+ - `Keypair.fromBase58Seed`
743
+ - Remove the `Network` class ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
744
+ - Remove `vendor/base58.js` ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
745
+
746
+ ## [v3.0.0-alpha.1](https://github.com/stellar/js-stellar-base/compare/v3.0.0-alpha.0..v3.0.0-alpha.1)
747
+
748
+ ### Update
749
+
750
+ - Update operations builder to support multiplexed accounts ([#337](https://github.com/stellar/js-stellar-base/pull/337)).
751
+
752
+ This allows you to specify an `M` account as the destination or source:
753
+ ```
754
+ var destination = 'MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6';
755
+ var amount = '1000.0000000';
756
+ var asset = new StellarBase.Asset(
757
+ 'USDUSD',
758
+ 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
759
+ );
760
+ var source =
761
+ 'MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6';
762
+ StellarBase.Operation.payment({
763
+ destination,
764
+ asset,
765
+ amount,
766
+ source
767
+ });
768
+ ```
769
+
770
+ **To use multiplexed accounts you need an instance of Stellar running on Protocol 13 or higher**
771
+
772
+ ## [v3.0.0-alpha.0](https://github.com/stellar/js-stellar-base/compare/v2.1.9..v3.0.0-alpha.0)
773
+
774
+ This version brings protocol 13 support with backwards compatibility support for protocol 12.
775
+
776
+ ### Add
777
+ - Add `TransactionBuilder.buildFeeBumpTransaction` which makes it easy to create `FeeBumpTransaction` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
778
+ - Adds a feature flag which allow consumers of this library to create V1 (protocol 13) transactions using the `TransactionBuilder` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
779
+ - Add support for [CAP0027](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md): First-class multiplexed accounts ([#325](https://github.com/stellar/js-stellar-base/pull/325)).
780
+ - Add `Keypair.xdrMuxedAccount` which creates a new `xdr.MuxedAccount`([#325](https://github.com/stellar/js-stellar-base/pull/325)).
781
+ - Add `FeeBumpTransaction` which makes it easy to work with fee bump transactions ([#328](https://github.com/stellar/js-stellar-base/pull/328)).
782
+ - Add `TransactionBuilder.fromXDR` which receives an xdr envelope and return a `Transaction` or `FeeBumpTransaction` ([#328](https://github.com/stellar/js-stellar-base/pull/328)).
783
+
784
+ ### Update
785
+ - Update XDR definitions with protocol 13 ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
786
+ - Extend `Transaction` to work with `TransactionV1Envelope` and `TransactionV0Envelope` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
787
+ - Add backward compatibility support for [CAP0018](https://github.com/stellar/stellar-protocol/blob/f01c9354aaab1e8ca97a25cf888829749cadf36a/core/cap-0018.md) ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
788
+
789
+ ### Breaking changes
790
+
791
+ - `Transaction.toEnvelope()` returns a protocol 13 `xdr.TransactionEnvelope` which is an `xdr.Union` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
792
+ If you have code that looks like this `transaction.toEnvelope().tx` you have two options:
793
+ - You can grab the value wrapped by the union, calling `value()` like `transaction.toEnvelope().value().tx`.
794
+ - You can check which is the discriminant by using `switch()` and then call `v0()`, `v1()`, or `feeBump()`.
795
+ - The return value from `Transaction.fee` changed from `number` to `string`. This brings support for `Int64` values ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
796
+ - The const `BASE_FEE` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
797
+ - The option `fee` passed to `new TransactionBuilder({fee: ..})` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
798
+ - The following fields, which were previously an `xdr.AccountID` are now a `xdr.MuxedAccount` ([#325](https://github.com/stellar/js-stellar-base/pull/325)):
799
+ - `PaymentOp.destination`
800
+ - `PathPaymentStrictReceiveOp.destination`
801
+ - `PathPaymentStrictSendOp.destination`
802
+ - `Operation.sourceAccount`
803
+ - `Operation.destination` (for `ACCOUNT_MERGE`)
804
+ - `Transaction.sourceAccount`
805
+ - `FeeBumpTransaction.feeSource`
806
+
807
+ You can get the string representation by calling `StrKey.encodeMuxedAccount` which will return a `G..` or `M..` account.
808
+ - Remove the following deprecated functions ([#331](https://github.com/stellar/js-stellar-base/pull/331)):
809
+ - `Operation.manageOffer`
810
+ - `Operation.createPassiveOffer`
811
+ - `Operation.pathPayment`
812
+ - `Keypair.fromBase58Seed`
813
+ - Remove the `Network` class ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
814
+ - Remove `vendor/base58.js` ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
815
+
816
+
817
+ ## [v2.1.9](https://github.com/stellar/js-stellar-base/compare/v2.1.8..v2.1.9)
818
+
819
+ ### Fix
820
+ - Update dependencies which depend on minimist. ([#332](https://github.com/stellar/js-stellar-base/pull/332))
821
+
822
+ ## [v2.1.8](https://github.com/stellar/js-stellar-base/compare/v2.1.7..v2.1.8)
823
+
824
+ ### Fix
825
+ - Fix `setTimeout(0)` and partially defined timebounds ([#315](https://github.com/stellar/js-stellar-base/pull/315)).
826
+
827
+ ## [v2.1.7](https://github.com/stellar/js-stellar-base/compare/v2.1.6..v2.1.7)
828
+
829
+ ### Fix
830
+ - Fix TypeScript options for `ManageData` operation to allow setting value to `null` ([#310](https://github.com/stellar/js-stellar-base/issues/310))
831
+ - Fix crash on partially defined time bounds ([#303](https://github.com/stellar/js-stellar-base/issues/303))
832
+
833
+ ## [v2.1.6](https://github.com/stellar/js-stellar-base/compare/v2.1.5..v2.1.6)
834
+
835
+ ### Fix
836
+ - Fix npm deployment.
837
+
838
+ ## [v2.1.5](https://github.com/stellar/js-stellar-base/compare/v2.1.4..v2.1.5)
839
+
840
+ ### Add
841
+ - Add `toXDR` type to Transaction class ([#296](https://github.com/stellar/js-stellar-base/issues/296))
842
+
843
+ ### Fix
844
+ - Fix doc link ([#298](https://github.com/stellar/js-stellar-base/issues/298))
845
+
846
+ ### Remove
847
+ - Remove node engine restriction ([#294](https://github.com/stellar/js-stellar-base/issues/294))
848
+
849
+ ### Update
850
+ - Update creating an account example ([#299](https://github.com/stellar/js-stellar-base/issues/299))
851
+ - Use `console.trace` to get line num in `Networks.use` ([#300](https://github.com/stellar/js-stellar-base/issues/300))
852
+
853
+ ## [v2.1.4](https://github.com/stellar/js-stellar-base/compare/v2.1.3..v2.1.4)
854
+
855
+ ## Update
856
+ - Regenerate the XDR definitions to include MetaV2 ([#288](https://github.com/stellar/js-stellar-base/issues/288))
857
+
858
+ ## [v2.1.3](https://github.com/stellar/js-stellar-base/compare/v2.1.2...v2.1.3)
859
+
860
+ ## Update 📣
861
+
862
+ - Throw errors when obviously invalid network passphrases are used in
863
+ `new Transaction()`.
864
+ ([284](https://github.com/stellar/js-stellar-base/pull/284))
865
+
866
+ ## [v2.1.2](https://github.com/stellar/js-stellar-base/compare/v2.1.1...v2.1.2)
867
+
868
+ ## Update 📣
869
+
870
+ - Update documentation for `Operation` to show `pathPaymentStrictSend` and `pathPaymentStrictReceive`. ([279](https://github.com/stellar/js-stellar-base/pull/279))
871
+
872
+ ## [v2.1.1](https://github.com/stellar/js-stellar-base/compare/v2.1.0...v2.1.1)
873
+
874
+ ## Update 📣
875
+
876
+ - Update `asset.toString()` to return canonical representation for asset. ([277](https://github.com/stellar/js-stellar-base/pull/277)).
877
+
878
+ Calling `asset.toString()` will return `native` for `XLM` or `AssetCode:AssetIssuer` for issued assets. See [this PR](https://github.com/stellar/stellar-protocol/pull/313) for more information.
879
+
880
+ ## [v2.1.0](https://github.com/stellar/js-stellar-base/compare/v2.0.2...v2.1.0)
881
+
882
+ This release adds support for [stellar-core protocol 12 release](https://github.com/stellar/stellar-core/projects/11) and [CAP 24](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0024.md) ("Make PathPayment Symmetrical").
883
+
884
+ ### Add ➕
885
+
886
+ - `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](https://github.com/stellar/js-stellar-base/pull/274)).
887
+
888
+ The following operation will debit exactly 10 USD from the source account, crediting at least 9.2 EUR in the destination account 💸:
889
+ ```js
890
+ var sendAsset = new StellarBase.Asset(
891
+ 'USD',
892
+ 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
893
+ );
894
+ var sendAmount = '10';
895
+ var destination =
896
+ 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ';
897
+ var destAsset = new StellarBase.Asset(
898
+ 'USD',
899
+ 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
900
+ );
901
+ var destMin = '9.2';
902
+ var path = [
903
+ new StellarBase.Asset(
904
+ 'USD',
905
+ 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'
906
+ ),
907
+ new StellarBase.Asset(
908
+ 'EUR',
909
+ 'GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL'
910
+ )
911
+ ];
912
+ let op = StellarBase.Operation.pathPaymentStrictSend({
913
+ sendAsset,
914
+ sendAmount,
915
+ destination,
916
+ destAsset,
917
+ destMin,
918
+ path
919
+ });
920
+ ```
921
+ - `Operation.pathPaymentStrictReceive`: This behaves the same as the former `pathPayments` operation. ([#274](https://github.com/stellar/js-stellar-base/pull/274)).
922
+
923
+ The following operation will debit maximum 10 USD from the source account, crediting exactly 9.2 EUR in the destination account 💸:
924
+ ```js
925
+ var sendAsset = new StellarBase.Asset(
926
+ 'USD',
927
+ 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
928
+ );
929
+ var sendMax = '10';
930
+ var destination =
931
+ 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ';
932
+ var destAsset = new StellarBase.Asset(
933
+ 'USD',
934
+ 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
935
+ );
936
+ var destAmount = '9.2';
937
+ var path = [
938
+ new StellarBase.Asset(
939
+ 'USD',
940
+ 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'
941
+ ),
942
+ new StellarBase.Asset(
943
+ 'EUR',
944
+ 'GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL'
945
+ )
946
+ ];
947
+ let op = StellarBase.Operation.pathPaymentStrictReceive({
948
+ sendAsset,
949
+ sendMax,
950
+ destination,
951
+ destAsset,
952
+ destAmount,
953
+ path
954
+ });
955
+ ```
956
+
957
+ ## Deprecated ❗️
958
+
959
+ - `Operation.pathPayment` is being deprecated in favor of `Operation.pathPaymentStrictReceive`. Both functions take the same arguments and behave the same. ([#274](https://github.com/stellar/js-stellar-base/pull/274)).
960
+
961
+ ## [v2.0.2](https://github.com/stellar/js-stellar-base/compare/v2.0.1...v2.0.2)
962
+
963
+ ### Fix
964
+ - Fix issue [#269](https://github.com/stellar/js-stellar-base/issues/269). ManageBuyOffer should extend BaseOptions and inherited property "source". ([#270](https://github.com/stellar/js-stellar-base/pull/270)).
965
+
966
+ ## [v2.0.1](https://github.com/stellar/js-stellar-base/compare/v2.0.0...v2.0.1)
967
+
968
+ No changes. Fixes deploy script and includes changes from [v2.0.0](https://github.com/stellar/js-stellar-base/compare/v1.1.2...v2.0.0).
969
+
970
+ ## [v2.0.0](https://github.com/stellar/js-stellar-base/compare/v1.1.2...v2.0.0)
971
+
972
+ ### BREAKING CHANGES
973
+
974
+ - Drop Support for Node 6 since it has been end-of-lifed and no longer in LTS. We now require Node 10 which is the current LTS until April 1st, 2021. ([#255](https://github.com/stellar/js-stellar-base/pull/255))
975
+
976
+ ## [v1.1.2](https://github.com/stellar/js-stellar-base/compare/v1.1.1...v1.1.2)
977
+
978
+ ### Fix
979
+ - Fix no-network warnings ([#248](https://github.com/stellar/js-stellar-base/issues/248))
980
+
981
+ ## [v1.1.1](https://github.com/stellar/js-stellar-base/compare/v1.1.0...v1.1.1)
982
+
983
+ ### Fix
984
+ - Add types for new networkPassphrase argument. Fix [#237](https://github.com/stellar/js-stellar-base/issues/237). ([#238](https://github.com/stellar/js-stellar-base/issues/238))
985
+
986
+ ## [v1.1.0](https://github.com/stellar/js-stellar-base/compare/v1.0.3...v1.1.0)
987
+
988
+ ### Deprecated
989
+
990
+ Deprecate global singleton for `Network`. The following classes and
991
+ methods take an optional network passphrase, and issue a warning if it
992
+ is not passed:
993
+
994
+ #### `Keypair.master`
995
+
996
+ ```js
997
+ Keypair.master(Networks.TESTNET)
998
+ ```
999
+
1000
+ #### constructor for `Transaction`
1001
+
1002
+ ```js
1003
+ const xenv = new xdr.TransactionEnvelope({ tx: xtx });
1004
+ new Transaction(xenv, Networks.TESTNET);
1005
+ ```
1006
+
1007
+ #### constructor for `TransactionBuilder` and method `TransactionBuilder.setNetworkPassphrase`
1008
+
1009
+ ```js
1010
+ const transaction = new StellarSdk.TransactionBuilder(account, {
1011
+ fee: StellarSdk.BASE_FEE,
1012
+ networkPassphrase: Networks.TESTNET
1013
+ })
1014
+ ```
1015
+
1016
+ See [#207](https://github.com/stellar/js-stellar-base/issues/207) and [#112](https://github.com/stellar/js-stellar-base/issues/112) for more information.
1017
+
1018
+ The `Network` class will be removed on the `2.0` release.
1019
+
1020
+ ### Add
1021
+ - Add docs for BASE_FEE const. ([#211](https://github.com/stellar/js-stellar-base/issues/211))
1022
+
1023
+ ### Fix
1024
+ - Fix typo. ([#213](https://github.com/stellar/js-stellar-base/issues/213))
1025
+
1026
+ ## [v1.0.3](https://github.com/stellar/js-stellar-base/compare/v1.0.2...v1.0.3)
1027
+
1028
+ ### Add
1029
+
1030
+ - Add `toString()` to Asset ([#172](https://github.com/stellar/js-stellar-base/issues/172))
1031
+ - Add types for missing Network functions ([#208](https://github.com/stellar/js-stellar-base/issues/208))
1032
+ - Add BASE_FEE to TS types ([#209](https://github.com/stellar/js-stellar-base/issues/209))
1033
+
1034
+ ### Fix
1035
+ - Fix typo in types ([#194](https://github.com/stellar/js-stellar-base/issues/194))
1036
+ - Fix types: Fee is no longer optional ([#195](https://github.com/stellar/js-stellar-base/issues/195))
1037
+ - Fix typings for Account Sequence Number ([#203](https://github.com/stellar/js-stellar-base/issues/203))
1038
+ - Fix typings for Transaction Sequence Number ([#205](https://github.com/stellar/js-stellar-base/issues/205))
1039
+
1040
+ ## [v1.0.2](https://github.com/stellar/js-stellar-base/compare/v1.0.1...v1.0.2)
1041
+
1042
+ - Fix a bug where `sodium-native` was making it into the browser bundle, which
1043
+ is supposed to use `tweetnacl`.
1044
+
1045
+ ## [v1.0.1](https://github.com/stellar/js-stellar-base/compare/v1.0.0...v1.0.1)
1046
+
1047
+ - Restore `Operation.manageOffer` and `Operation.createPassiveOffer`, and issue
1048
+ a warning if they're called.
1049
+ - Add type definitions for the timeBounds property of transactions.
1050
+
1051
+ ## [v1.0.0](https://github.com/stellar/js-stellar-base/compare/v0.13.2...v1.0.0)
1052
+
1053
+ - **Breaking change** Stellar Protocol 11 compatibility
1054
+ - Rename `Operation.manageOffer` to `Operation.manageSellOffer`.
1055
+ - Rename `Operation.createPassiveOffer` to `Operation.createPassiveSellOffer`.
1056
+ - Add `Operation.manageBuyOffer`.
1057
+ - **Breaking change** The `fee` parameter to `TransactionBuilder` is now
1058
+ required. Failing to provide a fee will throw an error.
1059
+
1060
+ ## [v0.13.2](https://github.com/stellar/js-stellar-base/compare/v0.13.1...v0.13.2)
1061
+
1062
+ - Bring DefinitelyTyped definitions into the repo for faster updating.
1063
+ - Add missing Typescript type definitions.
1064
+ - Add code to verify signatures when added to transactions.
1065
+ - Replace ed25519 with sodium-native.
1066
+ - Fix the xdr for SCP_MESSAGE.
1067
+ - Update the README for the latest info.
1068
+
1069
+ ## [v0.13.1](https://github.com/stellar/js-stellar-base/compare/v0.13.0...v0.13.1)
1070
+
1071
+ - Travis: Deploy NPM with an environment variable instead of an encrypted API
1072
+ key.
1073
+ - Instruct Travis to cache node_modules
1074
+
1075
+ ## [v0.13.0](https://github.com/stellar/js-stellar-base/compare/v0.12.0...v0.13.0)
1076
+
1077
+ - Remove the `crypto` library. This reduces the number of Node built-ins we have
1078
+ to shim into the production bundle, and incidentally fixes a bug with
1079
+ Angular 6.
1080
+
1081
+ ## [v0.12.0](https://github.com/stellar/js-stellar-base/compare/v0.11.0...v0.12.0)
1082
+
1083
+ - _Warning_ Calling TransactionBuilder without a `fee` param is now deprecated
1084
+ and will issue a warning. In a later release, it will throw an error. Please
1085
+ update your transaction builders as soon as you can!
1086
+ - Add a `toXDR` function for transactions that lets you get the transaction as a
1087
+ base64-encoded string (so you may enter it into the Stellar Laboratory XDR
1088
+ viewer, for one)
1089
+ - Fix TransactionBuilder example syntax errors
1090
+ - Use more thorough "create account" documentation
1091
+ - Add `Date` support for `TransactionBuilder` `timebounds`
1092
+ - Add two functions to `Transaction` that support pre-generated transactions:
1093
+ - `getKeypairSignature` helps users sign pre-generated transaction XDRs
1094
+ - `addSignature` lets you add pre-generated signatures to a built transaction
1095
+
1096
+ ## 0.11.0
1097
+
1098
+ - Added ESLint and Prettier to enforce code style
1099
+ - Upgraded dependencies, including Babel to 6
1100
+ - Bump local node version to 6.14.0
1101
+ - Change Operations.\_fromXDRAmount to not use scientific notation (1e-7) for
1102
+ small amounts like 0.0000001.
1103
+
1104
+ ## 0.10.0
1105
+
1106
+ - **Breaking change** Added
1107
+ [`TransactionBuilder.setTimeout`](https://stellar.github.io/js-stellar-base/TransactionBuilder.html#setTimeout)
1108
+ method that sets `timebounds.max_time` on a transaction. Because of the
1109
+ distributed nature of the Stellar network it is possible that the status of
1110
+ your transaction will be determined after a long time if the network is highly
1111
+ congested. If you want to be sure to receive the status of the transaction
1112
+ within a given period you should set the TimeBounds with `maxTime` on the
1113
+ transaction (this is what `setTimeout` does internally; if there's `minTime`
1114
+ set but no `maxTime` it will be added). Call to
1115
+ `TransactionBuilder.setTimeout` is required if Transaction does not have
1116
+ `max_time` set. If you don't want to set timeout, use `TimeoutInfinite`. In
1117
+ general you should set `TimeoutInfinite` only in smart contracts. Please check
1118
+ [`TransactionBuilder.setTimeout`](https://stellar.github.io/js-stellar-base/TransactionBuilder.html#setTimeout)
1119
+ docs for more information.
1120
+ - Fixed decoding empty `homeDomain`.
1121
+
1122
+ ## 0.9.0
1123
+
1124
+ - Update `js-xdr` to support unmarshaling non-utf8 strings.
1125
+ - String fields returned by `Operation.fromXDRObject()` are of type `Buffer` now
1126
+ (except `SetOptions.home_domain` and `ManageData.name` - both required to be
1127
+ ASCII by stellar-core).
1128
+
1129
+ ## 0.8.3
1130
+
1131
+ - Update `xdr` files to V10.
1132
+
1133
+ ## 0.8.2
1134
+
1135
+ - Upgrade `js-xdr`.
1136
+
1137
+ ## 0.8.1
1138
+
1139
+ - Removed `src` from `.npmignore`.
1140
+
1141
+ ## 0.8.0
1142
+
1143
+ - Added support for `bump_sequence` operation.
1144
+ - Fixed many code style issues.
1145
+ - Updated docs.
1146
+
1147
+ ## 0.7.8
1148
+
1149
+ - Updated dependencies.
1150
+
1151
+ ## 0.7.7
1152
+
1153
+ - Updated docs.
1154
+
1155
+ ## 0.7.6
1156
+
1157
+ - Updated docs.
1158
+
1159
+ ## 0.7.5
1160
+
1161
+ - `Keypair.constructor` now requires `type` field to define public-key signature
1162
+ system used in this instance (so `Keypair` can support other systems in a
1163
+ future). It also checks if public key and secret key match if both are passed
1164
+ (to prevent nasty bugs).
1165
+ - `Keypair.fromRawSeed` has been renamed to `Keypair.fromRawEd25519Seed` to make
1166
+ it clear that the seed must be Ed25519 seed.
1167
+ - It's now possible to instantiate `Memo` class so it's easier to check it's
1168
+ type and value (without dealing with low level `xdr.Memo` objects).
1169
+ - Changed `Asset.toXdrObject` to `Asset.toXDRObject` and
1170
+ `Operation.operationToObject` to `Operation.toXDRObject` for consistency.
1171
+ - Time bounds support for numeric input values.
1172
+ - Added `browser` prop to package.json.
1173
+
1174
+ ## 0.7.4
1175
+
1176
+ - Update dependencies.
1177
+ - Remove unused methods.
1178
+
1179
+ ## 0.7.3
1180
+
1181
+ - Allow hex string in setOptions signers
1182
+
1183
+ ## 0.7.2
1184
+
1185
+ - Updated XDR files
1186
+
1187
+ ## 0.7.1
1188
+
1189
+ - Checking hash preimage length
1190
+
1191
+ ## 0.7.0
1192
+
1193
+ - Support for new signer types: `sha256Hash`, `preAuthTx`.
1194
+ - `StrKey` helper class with `strkey` encoding related methods.
1195
+ - Removed deprecated methods: `Keypair.isValidPublicKey` (use `StrKey`),
1196
+ `Keypair.isValidSecretKey` (use `StrKey`), `Keypair.fromSeed`, `Keypair.seed`,
1197
+ `Keypair.rawSeed`.
1198
+ - **Breaking changes**:
1199
+ - `Network` must be explicitly selected. Previously testnet was a default
1200
+ network.
1201
+ - `Operation.setOptions()` method `signer` param changed.
1202
+ - `Keypair.fromAccountId()` renamed to `Keypair.fromPublicKey()`.
1203
+ - `Keypair.accountId()` renamed to `Keypair.publicKey()`.
1204
+ - Dropping support for `End-of-Life` node versions.
1205
+
1206
+ ## 0.6.0
1207
+
1208
+ - **Breaking change** `ed25519` package is now optional dependency.
1209
+ - Export account flags constants.
1210
+
1211
+ ## 0.5.7
1212
+
1213
+ - Fixes XDR decoding issue when using firefox
1214
+
1215
+ ## 0.5.6
1216
+
1217
+ - UTF-8 support in `Memo.text()`.
1218
+
1219
+ ## 0.5.5
1220
+
1221
+ - Make 0 a valid number for transaction fee,
1222
+ - Fix signer in Operation.operationToObject() - close #82
1223
+
1224
+ ## 0.5.4
1225
+
1226
+ - Fixed Lodash registering itself to global scope.
1227
+
1228
+ ## 0.5.3
1229
+
1230
+ - Add support for ManageData operation.
1231
+
1232
+ ## 0.5.2
1233
+
1234
+ - Moved `Account.isValidAccountId` to `Keypair.isValidPublicKey`. It's still
1235
+ possible to use `Account.isValidAccountId` but it will be removed in the next
1236
+ minor release (breaking change). (af10f2a)
1237
+ - `signer.address` option in `Operation.setOptions` was changed to
1238
+ `signer.pubKey`. It's still possible to use `signer.address` but it will be
1239
+ removed in the next minor release (breaking change). (07f43fb)
1240
+ - `Operation.setOptions` now accepts strings for `clearFlags`, `setFlags`,
1241
+ `masterWeight`, `lowThreshold`, `medThreshold`, `highThreshold`,
1242
+ `signer.weight` options. (665e018)
1243
+ - Fixed TransactionBuilder timebounds option. (854f275)
1244
+ - Added `CHANGELOG.md` file.
1245
+
1246
+ ## 0.5.1
1247
+
1248
+ - Now it's possible to pass `price` params as `{n: numerator, d: denominator}`
1249
+ object. Thanks @FredericHeem. (#73)
1250
+
1251
+ ## 0.5.0
1252
+
1253
+ - **Breaking change** `sequence` in `Account` constructor must be a string.
1254
+ (4da5dfc)
1255
+ - **Breaking change** Removed deprecated methods (180a5b8):
1256
+ - `Account.isValidAddress` (replaced by `Account.isValidAccountId`)
1257
+ - `Account.getSequenceNumber` (replaced by `Account.sequenceNumber`)
1258
+ - `Keypair.address` (replaced by `Keypair.accountId`)
1259
+ - `Network.usePublicNet` (replaced by `Network.usePublicNetwork`)
1260
+ - `Network.useTestNet` (replaced by `Network.useTestNetwork`)
1261
+ - `TransactionBuilder.addSigner` (call `Transaction.sign` on build
1262
+ `Transaction` object)