@stellar/stellar-base 14.0.1 → 14.0.2
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.
- package/CHANGELOG.md +338 -297
- package/dist/stellar-base.js +22 -5
- package/dist/stellar-base.min.js +1 -1
- package/lib/transaction_builder.js +22 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,78 +2,86 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## [`v14.0.2`](https://github.com/stellar/js-stellar-base/compare/v14.0.1...v14.0.2):
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Lowered the maximum bid for fee-bumped Soroban transactions by not doubling the resource fee ([#817](https://github.com/stellar/js-stellar-sdk/pull/817)).
|
|
5
10
|
|
|
6
11
|
## [`v14.0.1`](https://github.com/stellar/js-stellar-base/compare/v14.0.0...v14.0.1):
|
|
7
12
|
|
|
8
13
|
### Fixed
|
|
9
|
-
* Added missing `Asset.toString()` TypeScript definition ([#1218](https://github.com/stellar/js-stellar-sdk/pull/1218)).
|
|
10
14
|
|
|
15
|
+
- Added missing `Asset.toString()` TypeScript definition ([#1218](https://github.com/stellar/js-stellar-sdk/pull/1218)).
|
|
11
16
|
|
|
12
17
|
## [`v14.0.0`](https://github.com/stellar/js-stellar-base/compare/v13.1.0...v14.0.0): Protocol 23
|
|
13
18
|
|
|
14
19
|
### Breaking Changes
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
|
|
21
|
+
- This package now requires **>= Node 20**.
|
|
22
|
+
- XDR definitions have been updated to align with Protocol 23 ([#800](https://github.com/stellar/js-stellar-base/pull/800)).
|
|
17
23
|
|
|
18
24
|
### Added
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
|
|
26
|
+
- The `sodium-native` and `tweetnacl` dependencies have been replaced with `@noble/curves` ([#802](https://github.com/stellar/js-stellar-base/pull/802)).
|
|
27
|
+
- Support for claimable balances and liquidity pools in `StrKey` ([#799](https://github.com/stellar/js-stellar-base/pull/799)).
|
|
28
|
+
- Support for claimable balances, liquidity pools, and muxed accounts in `Address` ([#801](https://github.com/stellar/js-stellar-base/pull/801)).
|
|
29
|
+
- Added the ability for `nativeToScVal` to convert arrays with differing types to smart contract values, e.g., `nativeToScVal([1, "x", "y"], { type: [ "i128", "symbol" ]})` will give you a `Vec<i128, symbol, string>` ([#803](https://github.com/stellar/js-stellar-base/pull/803)).
|
|
23
30
|
|
|
24
31
|
### Fixed
|
|
25
|
-
* Removed the custom `Buffer.subarray` polyfill introduced in [#733](https://github.com/stellar/js-stellar-base/pull/733) in [v11.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v11.0.1) as a workaround for React Native's Hermes engine. Please use [`@exodus/patch-broken-hermes-typed-arrays`](https://github.com/ExodusMovement/patch-broken-hermes-typed-arrays) as an alternative, if needed ([#795](https://github.com/stellar/js-stellar-base/pull/795)).
|
|
26
|
-
* Fix browser compatibility with proper module resolution and UMD configuration ([#798](https://github.com/stellar/js-stellar-base/pull/798)).
|
|
27
|
-
* Remove `MuxedAccount.parseBaseAddress` from TypeScript definitions ([#797](https://github.com/stellar/js-stellar-base/pull/797)).
|
|
28
32
|
|
|
33
|
+
- Removed the custom `Buffer.subarray` polyfill introduced in [#733](https://github.com/stellar/js-stellar-base/pull/733) in [v11.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v11.0.1) as a workaround for React Native's Hermes engine. Please use [`@exodus/patch-broken-hermes-typed-arrays`](https://github.com/ExodusMovement/patch-broken-hermes-typed-arrays) as an alternative, if needed ([#795](https://github.com/stellar/js-stellar-base/pull/795)).
|
|
34
|
+
- Fix browser compatibility with proper module resolution and UMD configuration ([#798](https://github.com/stellar/js-stellar-base/pull/798)).
|
|
35
|
+
- Remove `MuxedAccount.parseBaseAddress` from TypeScript definitions ([#797](https://github.com/stellar/js-stellar-base/pull/797)).
|
|
29
36
|
|
|
30
37
|
## [`v14.0.0-rc.2`](https://github.com/stellar/js-stellar-base/compare/v13.1.0...v14.0.0-rc.2)
|
|
31
38
|
|
|
32
39
|
### Fixed
|
|
33
|
-
* Fixes a bug in `Address.toScAddress()` that would prevent claimable balances and muxed accounts from being encoded correctly.
|
|
34
40
|
|
|
41
|
+
- Fixes a bug in `Address.toScAddress()` that would prevent claimable balances and muxed accounts from being encoded correctly.
|
|
35
42
|
|
|
36
43
|
## [`v14.0.0-rc.1`](https://github.com/stellar/js-stellar-base/compare/v13.1.0...v14.0.0-rc.1): Protocol 23
|
|
37
44
|
|
|
38
45
|
### Breaking Changes
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
|
|
47
|
+
- This package now requires **>= Node 20**.
|
|
48
|
+
- XDR definitions have been updated to align with Protocol 23 ([#800](https://github.com/stellar/js-stellar-base/pull/800)).
|
|
41
49
|
|
|
42
50
|
### Added
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
|
|
52
|
+
- The `sodium-native` and `tweetnacl` dependencies have been replaced with `@noble/curves` ([#802](https://github.com/stellar/js-stellar-base/pull/802)).
|
|
53
|
+
- Support for claimable balances and liquidity pools in `StrKey` ([#799](https://github.com/stellar/js-stellar-base/pull/799)).
|
|
54
|
+
- Support for claimable balances, liquidity pools, and muxed accounts in `Address` ([#801](https://github.com/stellar/js-stellar-base/pull/801)).
|
|
55
|
+
- Added the ability for `nativeToScVal` to convert arrays with differing types to smart contract values, e.g., `nativeToScVal([1, "x", "y"], { type: [ "i128", "symbol" ]})` will give you a `Vec<i128, symbol, string>` ([#803](https://github.com/stellar/js-stellar-base/pull/803)).
|
|
47
56
|
|
|
48
57
|
### Fixed
|
|
49
|
-
* Removed the custom `Buffer.subarray` polyfill introduced in [#733](https://github.com/stellar/js-stellar-base/pull/733) in [v11.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v11.0.1) as a workaround for React Native's Hermes engine. Please use [`@exodus/patch-broken-hermes-typed-arrays`](https://github.com/ExodusMovement/patch-broken-hermes-typed-arrays) as an alternative, if needed ([#795](https://github.com/stellar/js-stellar-base/pull/795)).
|
|
50
|
-
* Fix browser compatibility with proper module resolution and UMD configuration ([#798](https://github.com/stellar/js-stellar-base/pull/798)).
|
|
51
|
-
* Remove `MuxedAccount.parseBaseAddress` from TypeScript definitions ([#797](https://github.com/stellar/js-stellar-base/pull/797)).
|
|
52
58
|
|
|
59
|
+
- Removed the custom `Buffer.subarray` polyfill introduced in [#733](https://github.com/stellar/js-stellar-base/pull/733) in [v11.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v11.0.1) as a workaround for React Native's Hermes engine. Please use [`@exodus/patch-broken-hermes-typed-arrays`](https://github.com/ExodusMovement/patch-broken-hermes-typed-arrays) as an alternative, if needed ([#795](https://github.com/stellar/js-stellar-base/pull/795)).
|
|
60
|
+
- Fix browser compatibility with proper module resolution and UMD configuration ([#798](https://github.com/stellar/js-stellar-base/pull/798)).
|
|
61
|
+
- Remove `MuxedAccount.parseBaseAddress` from TypeScript definitions ([#797](https://github.com/stellar/js-stellar-base/pull/797)).
|
|
53
62
|
|
|
54
63
|
## [`v13.1.0`](https://github.com/stellar/js-stellar-base/compare/v13.0.1...v13.1.0)
|
|
55
64
|
|
|
56
65
|
### Added
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
|
|
67
|
+
- `nativeToScVal` now supports encoding `Keypair`s as addresses ([#794](https://github.com/stellar/js-stellar-base/pull/794)).
|
|
68
|
+
- Within `authorizeEntry`, the `SigningCallback` callback function should now return an object containing both the signature and the identity of the signer. In multi-signature situations, it isn't necessarily the case that the address within the authorization entry is the one that actually signs that entry. Thus, the callback now takes the following form, where the original `Promise<BufferLike>` option is preserved for backwards compatibility and should be considered deprecated ([#783](https://github.com/stellar/js-stellar-base/pull/783)):
|
|
69
|
+
|
|
59
70
|
```typescript
|
|
60
71
|
export type SigningCallback = (
|
|
61
72
|
preimage: xdr.HashIdPreimage
|
|
62
|
-
) => Promise<
|
|
63
|
-
BufferLike |
|
|
64
|
-
{ signature: BufferLike, publicKey: string }
|
|
65
|
-
>;
|
|
73
|
+
) => Promise<BufferLike | { signature: BufferLike; publicKey: string }>;
|
|
66
74
|
```
|
|
67
75
|
|
|
68
76
|
### Fixed
|
|
69
|
-
* `scValToNative` will decode addresses more efficiently and reliably ([#794](https://github.com/stellar/js-stellar-base/pull/794)).
|
|
70
77
|
|
|
78
|
+
- `scValToNative` will decode addresses more efficiently and reliably ([#794](https://github.com/stellar/js-stellar-base/pull/794)).
|
|
71
79
|
|
|
72
80
|
## [`v13.0.1`](https://github.com/stellar/js-stellar-base/compare/v13.0.0...v13.0.1)
|
|
73
81
|
|
|
74
82
|
### Fixed
|
|
75
|
-
* `buildInvocationTree` will now successfully walk creation invocations with constructor arguments ([#784](https://github.com/stellar/js-stellar-base/pull/784)).
|
|
76
83
|
|
|
84
|
+
- `buildInvocationTree` will now successfully walk creation invocations with constructor arguments ([#784](https://github.com/stellar/js-stellar-base/pull/784)).
|
|
77
85
|
|
|
78
86
|
## [`v13.0.0`](https://github.com/stellar/js-stellar-base/compare/v12.1.1...v13.0.0)
|
|
79
87
|
|
|
@@ -81,44 +89,46 @@ export type SigningCallback = (
|
|
|
81
89
|
|
|
82
90
|
This version is unchanged from [`beta.1`](#v13.0.0-beta.1).
|
|
83
91
|
|
|
84
|
-
|
|
85
92
|
## [`v13.0.0-beta.1`](https://github.com/stellar/js-stellar-base/compare/v12.1.1...v13.0.0-beta.1)
|
|
86
93
|
|
|
87
94
|
**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.
|
|
88
95
|
|
|
89
96
|
### Breaking Changes
|
|
90
|
-
|
|
97
|
+
|
|
98
|
+
- XDR definitions have been upgraded to Protocol 22 ([#777](https://github.com/stellar/js-stellar-base/pull/777)).
|
|
91
99
|
|
|
92
100
|
### Added
|
|
93
|
-
* You can create contracts with constructors a new, optional parameter of `Operation.createCustomContract`, `constructorArgs: xdr.ScVal[]` ([#770](https://github.com/stellar/js-stellar-base/pull/770)).
|
|
94
101
|
|
|
102
|
+
- You can create contracts with constructors a new, optional parameter of `Operation.createCustomContract`, `constructorArgs: xdr.ScVal[]` ([#770](https://github.com/stellar/js-stellar-base/pull/770)).
|
|
95
103
|
|
|
96
104
|
## [`v12.1.1`](https://github.com/stellar/js-stellar-base/compare/v12.1.0...v12.1.1)
|
|
97
105
|
|
|
98
106
|
### Fixed
|
|
99
|
-
* Add missing methods to TypeScript definitions ([#766](https://github.com/stellar/js-stellar-base/pull/766)).
|
|
100
|
-
* Fix the TypeScript definition of `walkInvocationTree` to allow void returns on the callback function as intended rather than forcing a `return null` ([#765](https://github.com/stellar/js-stellar-base/pull/765)).
|
|
101
|
-
* Fix `authorizeEntry` to use the correct public key when passing `Keypair`s ([#772](https://github.com/stellar/js-stellar-base/pull/772)).
|
|
102
|
-
* Upgrade misc. dependencies ([#771](https://github.com/stellar/js-stellar-base/pull/771), [#773](https://github.com/stellar/js-stellar-base/pull/773)).
|
|
103
107
|
|
|
108
|
+
- Add missing methods to TypeScript definitions ([#766](https://github.com/stellar/js-stellar-base/pull/766)).
|
|
109
|
+
- Fix the TypeScript definition of `walkInvocationTree` to allow void returns on the callback function as intended rather than forcing a `return null` ([#765](https://github.com/stellar/js-stellar-base/pull/765)).
|
|
110
|
+
- Fix `authorizeEntry` to use the correct public key when passing `Keypair`s ([#772](https://github.com/stellar/js-stellar-base/pull/772)).
|
|
111
|
+
- Upgrade misc. dependencies ([#771](https://github.com/stellar/js-stellar-base/pull/771), [#773](https://github.com/stellar/js-stellar-base/pull/773)).
|
|
104
112
|
|
|
105
113
|
## [`v12.1.0`](https://github.com/stellar/js-stellar-base/compare/v12.0.1...v12.1.0)
|
|
106
114
|
|
|
107
115
|
### Added
|
|
108
|
-
|
|
116
|
+
|
|
117
|
+
- `TransactionBuilder` now has `addOperationAt` and `clearOperationAt` methods to allow manipulation of individual operations ([#757](https://github.com/stellar/js-stellar-base/pull/757)).
|
|
109
118
|
|
|
110
119
|
### Fixed
|
|
111
|
-
* Improve the efficiency and portability of asset type retrieval ([#758](https://github.com/stellar/js-stellar-base/pull/758)).
|
|
112
|
-
* `nativeToScVal` now correctly sorts maps lexicographically based on the keys to match what the Soroban environment expects ([#759](https://github.com/stellar/js-stellar-base/pull/759)).
|
|
113
|
-
* `nativeToScVal` now allows all integer types to come from strings ([#763](https://github.com/stellar/js-stellar-base/pull/763)).
|
|
114
|
-
* `humanizeEvents` now handles events without a `contractId` set more reliably ([#764](https://github.com/stellar/js-stellar-base/pull/764)).
|
|
115
120
|
|
|
121
|
+
- Improve the efficiency and portability of asset type retrieval ([#758](https://github.com/stellar/js-stellar-base/pull/758)).
|
|
122
|
+
- `nativeToScVal` now correctly sorts maps lexicographically based on the keys to match what the Soroban environment expects ([#759](https://github.com/stellar/js-stellar-base/pull/759)).
|
|
123
|
+
- `nativeToScVal` now allows all integer types to come from strings ([#763](https://github.com/stellar/js-stellar-base/pull/763)).
|
|
124
|
+
- `humanizeEvents` now handles events without a `contractId` set more reliably ([#764](https://github.com/stellar/js-stellar-base/pull/764)).
|
|
116
125
|
|
|
117
126
|
## [`v12.0.1`](https://github.com/stellar/js-stellar-base/compare/v12.0.0...v12.0.1)
|
|
118
127
|
|
|
119
128
|
### Fixed
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
|
|
130
|
+
- Export TypeScript definition for `StrKey.isValidContract` ([#751](https://github.com/stellar/js-stellar-base/pull/751)).
|
|
131
|
+
- `scValToNative` would fail when the values contained error codes because the parsing routine hadn't been updated to the new error schemas. Errors are now converted to the following format ([#753](https://github.com/stellar/js-stellar-base/pull/753)):
|
|
122
132
|
|
|
123
133
|
```typescript
|
|
124
134
|
interface Error {
|
|
@@ -130,137 +140,145 @@ interface Error {
|
|
|
130
140
|
|
|
131
141
|
You can refer to the [XDR documentation](https://github.com/stellar/stellar-xdr/blob/70180d5e8d9caee9e8645ed8a38c36a8cf403cd9/Stellar-contract.x#L76-L115) for additional explanations for each error code.
|
|
132
142
|
|
|
133
|
-
|
|
134
143
|
## [`v12.0.0`](https://github.com/stellar/js-stellar-base/compare/v11.0.1...v12.0.0)
|
|
135
144
|
|
|
136
145
|
This is a re-tag of v12.0.0-rc.1 with only developer dependency updates in-between.
|
|
137
146
|
|
|
138
|
-
|
|
139
147
|
## [`v12.0.0-rc.1`](https://github.com/stellar/js-stellar-base/compare/v11.0.1...v12.0.0-rc.1)
|
|
140
148
|
|
|
141
149
|
### Breaking Changes
|
|
142
|
-
|
|
150
|
+
|
|
151
|
+
- The generated XDR has been upgraded to match the upcoming Protocol 21, namely [stellar/stellar-xdr@`1a04392`](https://github.com/stellar/stellar-xdr/commit/1a04392432dacc0092caaeae22a600ea1af3c6a5) ([#738](https://github.com/stellar/js-stellar-base/pull/738)).
|
|
143
152
|
|
|
144
153
|
### Added
|
|
145
|
-
|
|
154
|
+
|
|
155
|
+
- To facilitate serialization and deserialization for downstream systems, this package now exports `cereal.XdrWriter` and `cereal.XdrReader` which come directly from `@stellar/js-xdr` ([#744](https://github.com/stellar/js-stellar-base/pull/744)).
|
|
146
156
|
|
|
147
157
|
### Fixed
|
|
148
|
-
* Updated various dependencies ([#737](https://github.com/stellar/js-stellar-base/pull/737), [#739](https://github.com/stellar/js-stellar-base/pull/739)).
|
|
149
|
-
* `Buffer` and `Uint8Array` compatibility has improved in `StrKey` ([#746](https://github.com/stellar/js-stellar-base/pull/746)).
|
|
150
158
|
|
|
159
|
+
- Updated various dependencies ([#737](https://github.com/stellar/js-stellar-base/pull/737), [#739](https://github.com/stellar/js-stellar-base/pull/739)).
|
|
160
|
+
- `Buffer` and `Uint8Array` compatibility has improved in `StrKey` ([#746](https://github.com/stellar/js-stellar-base/pull/746)).
|
|
151
161
|
|
|
152
162
|
## [`v11.0.1`](https://github.com/stellar/js-stellar-base/compare/v11.0.0...v11.0.1)
|
|
153
163
|
|
|
154
164
|
### Fixed
|
|
155
|
-
* Add compatibility with pre-ES2016 environments (like some React Native JS compilers) by adding a custom `Buffer.subarray` polyfill ([#733](https://github.com/stellar/js-stellar-base/pull/733)).
|
|
156
|
-
* Upgrade underlying dependencies, including `@stellar/js-xdr` which should broaden compatibility to pre-ES2016 environments ([#734](https://github.com/stellar/js-stellar-base/pull/734), [#735](https://github.com/stellar/js-stellar-base/pull/735)).
|
|
157
165
|
|
|
166
|
+
- Add compatibility with pre-ES2016 environments (like some React Native JS compilers) by adding a custom `Buffer.subarray` polyfill ([#733](https://github.com/stellar/js-stellar-base/pull/733)).
|
|
167
|
+
- Upgrade underlying dependencies, including `@stellar/js-xdr` which should broaden compatibility to pre-ES2016 environments ([#734](https://github.com/stellar/js-stellar-base/pull/734), [#735](https://github.com/stellar/js-stellar-base/pull/735)).
|
|
158
168
|
|
|
159
169
|
## [`v11.0.0`](https://github.com/stellar/js-stellar-base/compare/v10.0.2...v11.0.0)
|
|
160
170
|
|
|
161
171
|
**Note:** This version is (still) compatible with Protocol 20. Most people should be unaffected by the technically-breaking changes below and can treat this more like a v10.0.3 patch release.
|
|
162
172
|
|
|
163
173
|
### Breaking Changes
|
|
164
|
-
|
|
174
|
+
|
|
175
|
+
- Starting from **v10.0.0-beta.0**, we set [`BigNumber.DEBUG`](https://mikemcl.github.io/bignumber.js/#debug) in `bignumber.js` to `true` internally, which affects all code using `BigNumber`. This behavior has been fixed and only affects this library: globally, `BigNumber.DEBUG` now remains at its default setting (i.e. disabled). This is technically a breaking behavior change and is released as such ([#729](https://github.com/stellar/js-stellar-base/pull/729)).
|
|
165
176
|
|
|
166
177
|
### Fixed
|
|
167
|
-
* Dependencies have been updated to their latest compatible versions ([#726](https://github.com/stellar/js-stellar-base/pull/729), [#730](https://github.com/stellar/js-stellar-base/pull/730)).
|
|
168
178
|
|
|
179
|
+
- Dependencies have been updated to their latest compatible versions ([#726](https://github.com/stellar/js-stellar-base/pull/729), [#730](https://github.com/stellar/js-stellar-base/pull/730)).
|
|
169
180
|
|
|
170
181
|
## [`v10.0.2`](https://github.com/stellar/js-stellar-base/compare/v10.0.1...v10.0.2)
|
|
171
182
|
|
|
172
183
|
### Fixed
|
|
173
|
-
* The `contractId` field is correctly omitted from humanized events when it wasn't present in the structure ([#721](https://github.com/stellar/js-stellar-base/pull/721)).
|
|
174
|
-
* Misc. outdated or incorrect documentation has been updated ([#723](https://github.com/stellar/js-stellar-base/pull/723), [#720](https://github.com/stellar/js-stellar-base/pull/720)).
|
|
175
|
-
* Dependencies have been updated ([#724](https://github.com/stellar/js-stellar-base/pull/724)).
|
|
176
184
|
|
|
185
|
+
- The `contractId` field is correctly omitted from humanized events when it wasn't present in the structure ([#721](https://github.com/stellar/js-stellar-base/pull/721)).
|
|
186
|
+
- Misc. outdated or incorrect documentation has been updated ([#723](https://github.com/stellar/js-stellar-base/pull/723), [#720](https://github.com/stellar/js-stellar-base/pull/720)).
|
|
187
|
+
- Dependencies have been updated ([#724](https://github.com/stellar/js-stellar-base/pull/724)).
|
|
177
188
|
|
|
178
189
|
## [`v10.0.1`](https://github.com/stellar/js-stellar-base/compare/v10.0.0...v10.0.1)
|
|
179
190
|
|
|
180
191
|
### Fixed
|
|
181
|
-
* The TypeScript definition for `Asset.contractId()` now includes a missing parameter (the `networkPassphrase` changes the ID for a contract; [#718](https://github.com/stellar/js-stellar-base/pull/#718)).
|
|
182
192
|
|
|
193
|
+
- The TypeScript definition for `Asset.contractId()` now includes a missing parameter (the `networkPassphrase` changes the ID for a contract; [#718](https://github.com/stellar/js-stellar-base/pull/#718)).
|
|
183
194
|
|
|
184
195
|
## [`v10.0.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0): Protocol 20 Stable Release
|
|
185
196
|
|
|
186
197
|
### Breaking Changes
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
|
|
199
|
+
- The new minimum supported Node version is Node 18.
|
|
200
|
+
- 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)):
|
|
189
201
|
- `Operation.bumpFootprintExpiration` is now `extendFootprintTtl` and its `ledgersToExpire` field is now named `extendTo`, but it serves the same purpose.
|
|
190
202
|
- In TypeScript, the `Operation.BumpFootprintExpiration` is now `Operation.ExtendFootprintTTL`
|
|
191
203
|
- `xdr.ContractExecutable.contractExecutableToken` is now `contractExecutableStellarAsset`
|
|
192
204
|
- `xdr.SorobanTransactionData.refundableFee` is now `resourceFee`
|
|
193
205
|
- In turn, `SorobanDataBuilder.setRefundableFee` is now `setResourceFee`
|
|
194
206
|
- 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: ... })`).
|
|
195
|
-
- `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)).
|
|
196
207
|
|
|
208
|
+
* `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)).
|
|
197
209
|
|
|
198
210
|
## [`v10.0.0-beta.4`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.3...v10.0.0-beta.4)
|
|
199
211
|
|
|
200
212
|
### Fixed
|
|
201
|
-
- You can now correctly clone transactions (`TransactionBuilder.cloneFrom`) with large sequence numbers ([#711](https://github.com/stellar/js-stellar-base/pull/711)).
|
|
202
213
|
|
|
214
|
+
- You can now correctly clone transactions (`TransactionBuilder.cloneFrom`) with large sequence numbers ([#711](https://github.com/stellar/js-stellar-base/pull/711)).
|
|
203
215
|
|
|
204
216
|
## [`v10.0.0-beta.3`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.2...v10.0.0-beta.3)
|
|
205
217
|
|
|
206
218
|
### Fixed
|
|
207
|
-
* Fixes a bug where `authorizeEntry` might perform a no-op when it shouldn't ([#701](https://github.com/stellar/js-stellar-base/pull/701)).
|
|
208
|
-
* Fixes a TypeScript bug where `Memo.hash` did not accept a `Buffer` ([#698](https://github.com/stellar/js-stellar-base/pull/698)).
|
|
209
|
-
* Upgrades a transient dependency for security ([#296](https://github.com/stellar/js-stellar-base/pull/696)).
|
|
210
219
|
|
|
220
|
+
- Fixes a bug where `authorizeEntry` might perform a no-op when it shouldn't ([#701](https://github.com/stellar/js-stellar-base/pull/701)).
|
|
221
|
+
- Fixes a TypeScript bug where `Memo.hash` did not accept a `Buffer` ([#698](https://github.com/stellar/js-stellar-base/pull/698)).
|
|
222
|
+
- Upgrades a transient dependency for security ([#296](https://github.com/stellar/js-stellar-base/pull/696)).
|
|
211
223
|
|
|
212
224
|
## [`v10.0.0-beta.2`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.1...v10.0.0-beta.2)
|
|
213
225
|
|
|
214
226
|
### Breaking Changes
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
227
|
+
|
|
228
|
+
- The wrappers around multi-party authorization have changed ([#678](https://github.com/stellar/js-stellar-base/pull/678)):
|
|
229
|
+
|
|
230
|
+
* `authorizeEntry` has been added to help sign auth entries in-place
|
|
231
|
+
* the signature for `authorizeInvocation` has changed: it now offers a callback approach by default and requires slightly different parameters
|
|
232
|
+
* `buildAuthEntry`, `buildAuthEnvelope`, and `authorizeInvocationCallback` have been removed
|
|
219
233
|
|
|
220
234
|
### Fixed
|
|
221
|
-
* 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)).
|
|
222
|
-
* Misc. dependencies have been updated to their latest versions ([#694](https://github.com/stellar/js-stellar-base/pull/694)).
|
|
223
235
|
|
|
236
|
+
- 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)).
|
|
237
|
+
- Misc. dependencies have been updated to their latest versions ([#694](https://github.com/stellar/js-stellar-base/pull/694)).
|
|
224
238
|
|
|
225
239
|
## [`v10.0.0-beta.1`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.0...v10.0.0-beta.1)
|
|
226
240
|
|
|
227
241
|
### Fixed
|
|
228
|
-
* `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)).
|
|
229
|
-
* `Contract.call()` now produces valid `Operation` XDR ([#692](https://github.com/stellar/js-stellar-base/pull/692)).
|
|
230
242
|
|
|
243
|
+
- `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)).
|
|
244
|
+
- `Contract.call()` now produces valid `Operation` XDR ([#692](https://github.com/stellar/js-stellar-base/pull/692)).
|
|
231
245
|
|
|
232
246
|
## [`v10.0.0-beta.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0-beta.0): Protocol 20
|
|
233
247
|
|
|
234
248
|
### Breaking Changes
|
|
235
|
-
|
|
236
|
-
|
|
249
|
+
|
|
250
|
+
- **Node 16 is the new minimum version** to use the SDKs.
|
|
251
|
+
- 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)).
|
|
237
252
|
|
|
238
253
|
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:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
254
|
+
|
|
255
|
+
- `nativeToScVal` helps convert native types to their closest Soroban equivalent
|
|
256
|
+
- `scValToNative` helps find the closest native JavaScript type(s) corresponding to a smart contract value
|
|
257
|
+
- `scValToBigInt` helps convert numeric `ScVal`s into native `bigint`s
|
|
258
|
+
- `ScInt` and `XdrLargeInt` help convert to and from `bigint`s to other types and form sized integer types for smart contract usage
|
|
243
259
|
|
|
244
260
|
### Added
|
|
261
|
+
|
|
245
262
|
The following are new APIs to deal with new Soroban constructs:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
263
|
+
|
|
264
|
+
- **`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.
|
|
265
|
+
- **`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.
|
|
266
|
+
- **Three new operations** have been added related to Soroban transactions:
|
|
267
|
+
- `invokeHostFunction` for calling contract code
|
|
268
|
+
- `bumpFootprintExpiration` for extending the state lifetime of Soroban data
|
|
269
|
+
- `restoreFootprint` for restoring expired, off-chain state back onto the ledger
|
|
270
|
+
- 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).
|
|
271
|
+
- To facilitate building this out, there's a new `SorobanDataBuilder` factory to set fields individually
|
|
272
|
+
- The `TransactionBuilder` now has a `cloneFrom(tx, opts)` constructor method to create an instance from an existing transaction, also allowing parameter overrides via `opts`.
|
|
273
|
+
- The following are convenience methods for building out certain types of smart contract-related structures:
|
|
274
|
+
- `buildInvocationTree` and `walkInvocationTree` are both ways to visualize invocation calling trees better
|
|
275
|
+
- `authorizeInvocation` helps multiple parties sign invocation calling trees
|
|
276
|
+
- `humanizeEvents` helps make diagnostic events more readable
|
|
277
|
+
- 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.
|
|
260
278
|
|
|
261
279
|
### Fixes
|
|
262
|
-
* Improves the error messages when passing invalid amounts to deposit and withdraw operations ([#679](https://github.com/stellar/js-stellar-base/pull/679)).
|
|
263
280
|
|
|
281
|
+
- Improves the error messages when passing invalid amounts to deposit and withdraw operations ([#679](https://github.com/stellar/js-stellar-base/pull/679)).
|
|
264
282
|
|
|
265
283
|
## [v9.0.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0)
|
|
266
284
|
|
|
@@ -270,8 +288,8 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
270
288
|
|
|
271
289
|
The browser bundle size has decreased **significantly**:
|
|
272
290
|
|
|
273
|
-
|
|
274
|
-
|
|
291
|
+
- `stellar-base.min.js` is **340 KiB**, down from **1.2 MiB** previously.
|
|
292
|
+
- the new, unminified `stellar-base.js` is **895 KiB**.
|
|
275
293
|
|
|
276
294
|
### Breaking Changes
|
|
277
295
|
|
|
@@ -291,7 +309,6 @@ Though we have tried to maintain compatibility with older JavaScript implementat
|
|
|
291
309
|
- Drop the `crc` dependency and inline it to lower bundle size ([#621](https://github.com/stellar/js-stellar-base/pull/621)).
|
|
292
310
|
- Upgrade all dependencies to their latest versions ([#608](https://github.com/stellar/js-stellar-base/pull/608)).
|
|
293
311
|
|
|
294
|
-
|
|
295
312
|
## [v9.0.0-beta.3](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.1..v9.0.0-beta.2)
|
|
296
313
|
|
|
297
314
|
### Fix
|
|
@@ -299,24 +316,22 @@ Though we have tried to maintain compatibility with older JavaScript implementat
|
|
|
299
316
|
- Fixes a bug when sorting mixed-case assets for liquidity pools ([#606](https://github.com/stellar/js-stellar-base/pull/606)).
|
|
300
317
|
|
|
301
318
|
### Update
|
|
319
|
+
|
|
302
320
|
- Upgrade all dependencies to their latest versions ([#608](https://github.com/stellar/js-stellar-base/pull/608)).
|
|
303
321
|
- Drop the `crc` dependency and inline it to lower bundle size ([#621](https://github.com/stellar/js-stellar-base/pull/621)).
|
|
304
322
|
|
|
305
|
-
|
|
306
323
|
## [v9.0.0-beta.2](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.1..v9.0.0-beta.2)
|
|
307
324
|
|
|
308
325
|
### Update
|
|
309
326
|
|
|
310
327
|
- 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)).
|
|
311
328
|
|
|
312
|
-
|
|
313
329
|
## [v9.0.0-beta.1](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.0..v9.0.0-beta.1)
|
|
314
330
|
|
|
315
331
|
### Fix
|
|
316
332
|
|
|
317
333
|
- Correct XDR type definition for raw `xdr.Operation`s ([#591](https://github.com/stellar/js-stellar-base/pull/591)).
|
|
318
334
|
|
|
319
|
-
|
|
320
335
|
## [v9.0.0-beta.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0-beta.0)
|
|
321
336
|
|
|
322
337
|
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.
|
|
@@ -327,7 +342,6 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
327
342
|
|
|
328
343
|
- Current and vNext XDR updated to latest versions ([#587](https://github.com/stellar/js-stellar-base/pull/587)).
|
|
329
344
|
|
|
330
|
-
|
|
331
345
|
## [v8.2.2](https://github.com/stellar/js-stellar-base/compare/v8.2.1..v8.2.2)
|
|
332
346
|
|
|
333
347
|
### Fix
|
|
@@ -338,28 +352,25 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
338
352
|
|
|
339
353
|
### Fix
|
|
340
354
|
|
|
341
|
-
|
|
342
|
-
|
|
355
|
+
- 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)).
|
|
343
356
|
|
|
344
357
|
## [v8.2.0](https://github.com/stellar/js-stellar-base/compare/v8.1.0..v8.2.0)
|
|
345
358
|
|
|
346
359
|
### Add
|
|
347
360
|
|
|
348
|
-
|
|
349
|
-
|
|
361
|
+
- `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)).
|
|
350
362
|
|
|
351
363
|
## [v8.1.0](https://github.com/stellar/js-stellar-base/compare/v8.0.1..v8.1.0)
|
|
352
364
|
|
|
353
365
|
### Add
|
|
354
366
|
|
|
355
|
-
|
|
367
|
+
- `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)).
|
|
356
368
|
|
|
357
|
-
|
|
369
|
+
- 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)).
|
|
358
370
|
|
|
359
371
|
### Fix
|
|
360
372
|
|
|
361
|
-
|
|
362
|
-
|
|
373
|
+
- Correctly set `minAccountSequence` in `TransactionBuilder` for large values ([#539](https://github.com/stellar/js-stellar-base/pull/539), thank you @overcat!).
|
|
363
374
|
|
|
364
375
|
## [v8.0.1](https://github.com/stellar/js-stellar-base/compare/v8.0.0..v8.0.1)
|
|
365
376
|
|
|
@@ -367,12 +378,10 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
367
378
|
|
|
368
379
|
- Correctly predict claimable balance IDs with large sequence numbers ([#530](https://github.com/stellar/js-stellar-base/pull/530), thank you @overcat!).
|
|
369
380
|
|
|
370
|
-
|
|
371
381
|
## [v8.0.0](https://github.com/stellar/js-stellar-base/compare/v7.0.0..v8.0.0)
|
|
372
382
|
|
|
373
383
|
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/).
|
|
374
384
|
|
|
375
|
-
|
|
376
385
|
## [v8.0.0-beta.0](https://github.com/stellar/js-stellar-base/compare/v7.0.0..v8.0.0-beta.0)
|
|
377
386
|
|
|
378
387
|
**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).
|
|
@@ -384,28 +393,28 @@ This is considered a beta release until the XDR for the Stellar protocol stabili
|
|
|
384
393
|
As of this release, the minimum supported version of NodeJS is **14.x**.
|
|
385
394
|
|
|
386
395
|
- Two XDR types have been renamed:
|
|
387
|
-
|
|
388
|
-
|
|
396
|
+
- `xdr.OperationId` is now `xdr.HashIdPreimage`
|
|
397
|
+
- `xdr.OperationIdId` is now `xdr.HashIdPreimageOperationId`
|
|
389
398
|
|
|
390
399
|
### Add
|
|
391
400
|
|
|
392
401
|
- 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)):
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
402
|
+
- `Keypair.signPayloadDecorated(data)`
|
|
403
|
+
- `StrKey.encodeSignedPayload(buf)`
|
|
404
|
+
- `StrKey.decodeSignedPayload(str)`
|
|
405
|
+
- `StrKey.isValidSignedPayload(str)`
|
|
397
406
|
|
|
398
407
|
- 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)).
|
|
399
408
|
|
|
400
409
|
- 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)):
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
410
|
+
- `SignerKey.decodeAddress(address)`
|
|
411
|
+
- `SignerKey.encodeSignerKey(address)`
|
|
412
|
+
- `TransactionBuilder.setTimebounds(min, max)`
|
|
413
|
+
- `TransactionBuilder.setLedgerbounds(min, max)`
|
|
414
|
+
- `TransactionBuilder.setMinAccountSequence(seq)`
|
|
415
|
+
- `TransactionBuilder.setMinAccountSequenceAge(age)`
|
|
416
|
+
- `TransactionBuilder.setMinAccountSequenceLedgerGap(gap)`
|
|
417
|
+
- `TransactionBuilder.setExtraSigners([signers])`
|
|
409
418
|
|
|
410
419
|
### Fix
|
|
411
420
|
|
|
@@ -414,11 +423,10 @@ As of this release, the minimum supported version of NodeJS is **14.x**.
|
|
|
414
423
|
- 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)).
|
|
415
424
|
|
|
416
425
|
- Update developer dependencies:
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
426
|
+
- `isparta`, `jsdoc`, and `underscore` ([#500](https://github.com/stellar/js-stellar-base/pull/500))
|
|
427
|
+
- `ajv` ([#503](https://github.com/stellar/js-stellar-base/pull/503))
|
|
428
|
+
- `karma` ([#505](https://github.com/stellar/js-stellar-base/pull/505))
|
|
429
|
+
- `minimist` ([#514](https://github.com/stellar/js-stellar-base/pull/514))
|
|
422
430
|
|
|
423
431
|
## [v7.0.0](https://github.com/stellar/js-stellar-base/compare/v6.0.6..v7.0.0)
|
|
424
432
|
|
|
@@ -430,52 +438,51 @@ In [v5.2.0](https://github.com/stellar/js-stellar-base/releases/tag/v5.2.0), we
|
|
|
430
438
|
|
|
431
439
|
The following fields will now always support muxed properties:
|
|
432
440
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
+
- `FeeBumpTransaction.feeSource`
|
|
442
|
+
- `Transaction.sourceAccount`
|
|
443
|
+
- `Operation.sourceAccount`
|
|
444
|
+
- `Payment.destination`
|
|
445
|
+
- `PathPaymentStrictReceive.destination`
|
|
446
|
+
- `PathPaymentStrictSend.destination`
|
|
447
|
+
- `AccountMerge.destination`
|
|
448
|
+
- `Clawback.from`
|
|
441
449
|
|
|
442
450
|
The following functions had a `withMuxing` parameter removed:
|
|
443
451
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
452
|
+
- `Operation.fromXDRObject`
|
|
453
|
+
- `Transaction.constructor`
|
|
454
|
+
- `FeeBumpTransaction.constructor`
|
|
455
|
+
- `TransactionBuilder.fromXDR`
|
|
456
|
+
- `TransactionBuilder.buildFeeBumpTransaction`
|
|
449
457
|
|
|
450
458
|
The following functions will no longer check the `opts` object for a `withMuxing` field:
|
|
451
459
|
|
|
452
|
-
|
|
453
|
-
|
|
460
|
+
- `TransactionBuilder.constructor`
|
|
461
|
+
- `Operation.setSourceAccount`
|
|
454
462
|
|
|
455
463
|
There are several other breaking changes:
|
|
456
464
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
465
|
+
- `TransactionBuilder.enableMuxedAccounts()` is removed
|
|
466
|
+
- `decodeAddressToMuxedAccount()` and `encodeMuxedAccountToAddress()` no longer accept a second boolean parameter
|
|
467
|
+
- `Account.createSubaccount()` and `MuxedAccount.createSubaccount()` are removed ([#487](https://github.com/stellar/js-stellar-base/pull/487)). You should prefer to create them manually:
|
|
460
468
|
|
|
461
469
|
```js
|
|
462
|
-
|
|
470
|
+
let mux1 = new MuxedAccount(someAccount, "1");
|
|
463
471
|
|
|
464
|
-
|
|
465
|
-
|
|
472
|
+
// before:
|
|
473
|
+
let mux2 = mux1.createSubaccount("2");
|
|
466
474
|
|
|
467
|
-
|
|
468
|
-
|
|
475
|
+
// now:
|
|
476
|
+
let mux2 = new MuxedAccount(mux1.baseAccount(), "2");
|
|
469
477
|
```
|
|
470
478
|
|
|
471
|
-
|
|
472
|
-
- 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)):
|
|
479
|
+
- 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)):
|
|
473
480
|
|
|
474
481
|
```ts
|
|
475
482
|
function extractBaseAddess(address: string): string;
|
|
476
483
|
```
|
|
477
484
|
|
|
478
|
-
|
|
485
|
+
- The following muxed account validation functions are now available from Typescript ([#483](https://github.com/stellar/js-stellar-base/pull/483/files)):
|
|
479
486
|
|
|
480
487
|
```typescript
|
|
481
488
|
namespace StrKey {
|
|
@@ -484,8 +491,14 @@ namespace StrKey {
|
|
|
484
491
|
function isValidMed25519PublicKey(publicKey: string): boolean;
|
|
485
492
|
}
|
|
486
493
|
|
|
487
|
-
function decodeAddressToMuxedAccount(
|
|
488
|
-
|
|
494
|
+
function decodeAddressToMuxedAccount(
|
|
495
|
+
address: string,
|
|
496
|
+
supportMuxing: boolean
|
|
497
|
+
): xdr.MuxedAccount;
|
|
498
|
+
function encodeMuxedAccountToAddress(
|
|
499
|
+
account: xdr.MuxedAccount,
|
|
500
|
+
supportMuxing: boolean
|
|
501
|
+
): string;
|
|
489
502
|
function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount;
|
|
490
503
|
```
|
|
491
504
|
|
|
@@ -495,42 +508,39 @@ function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount;
|
|
|
495
508
|
|
|
496
509
|
- Add `Buffer` as a parameter type option for the `Keypair` constructor in Typescript ([#484](https://github.com/stellar/js-stellar-base/pull/484)).
|
|
497
510
|
|
|
498
|
-
|
|
499
511
|
## [v6.0.6](https://github.com/stellar/js-stellar-base/compare/v6.0.5..v6.0.6)
|
|
500
512
|
|
|
501
513
|
### Fix
|
|
502
514
|
|
|
503
515
|
- 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)).
|
|
504
516
|
|
|
505
|
-
|
|
506
517
|
## [v6.0.5](https://github.com/stellar/js-stellar-base/compare/v6.0.4..v6.0.5)
|
|
507
518
|
|
|
508
519
|
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.
|
|
509
520
|
|
|
510
521
|
Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-rvh2-c87w) for details.
|
|
511
522
|
|
|
512
|
-
|
|
513
523
|
### Security Fix
|
|
514
|
-
- Pin `ua-parser-js` to a known safe version ([#477](https://github.com/stellar/js-stellar-base/pull/477)).
|
|
515
524
|
|
|
525
|
+
- Pin `ua-parser-js` to a known safe version ([#477](https://github.com/stellar/js-stellar-base/pull/477)).
|
|
516
526
|
|
|
517
527
|
## [v6.0.4](https://github.com/stellar/js-stellar-base/compare/v6.0.3..v6.0.4)
|
|
518
528
|
|
|
519
529
|
### Fix
|
|
520
|
-
- Allow muxed accounts when decoding transactions via `TransactionBuilder.fromXDR()` ([#470](https://github.com/stellar/js-stellar-base/pull/470)).
|
|
521
530
|
|
|
531
|
+
- Allow muxed accounts when decoding transactions via `TransactionBuilder.fromXDR()` ([#470](https://github.com/stellar/js-stellar-base/pull/470)).
|
|
522
532
|
|
|
523
533
|
## [v6.0.3](https://github.com/stellar/js-stellar-base/compare/v6.0.2..v6.0.3)
|
|
524
534
|
|
|
525
535
|
### Fix
|
|
526
|
-
- 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)).
|
|
527
536
|
|
|
537
|
+
- 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)).
|
|
528
538
|
|
|
529
539
|
## [v6.0.2](https://github.com/stellar/js-stellar-base/compare/v6.0.1..v6.0.2)
|
|
530
540
|
|
|
531
541
|
### Fix
|
|
532
|
-
- Fix Typescript signatures for operations to universally allow setting the `withMuxing` flag ([#466](https://github.com/stellar/js-stellar-base/pull/466)).
|
|
533
542
|
|
|
543
|
+
- Fix Typescript signatures for operations to universally allow setting the `withMuxing` flag ([#466](https://github.com/stellar/js-stellar-base/pull/466)).
|
|
534
544
|
|
|
535
545
|
## [v6.0.1](https://github.com/stellar/js-stellar-base/compare/v5.3.2..v6.0.1)
|
|
536
546
|
|
|
@@ -550,69 +560,75 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
550
560
|
## [v5.3.2](https://github.com/stellar/js-stellar-base/compare/v5.3.1..v5.3.2)
|
|
551
561
|
|
|
552
562
|
### Fix
|
|
553
|
-
- 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)).
|
|
554
563
|
|
|
564
|
+
- 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)).
|
|
555
565
|
|
|
556
566
|
## [v5.3.1](https://github.com/stellar/js-stellar-base/compare/v5.3.0..v5.3.1)
|
|
557
567
|
|
|
558
568
|
### Fix
|
|
559
|
-
- 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)).
|
|
560
569
|
|
|
570
|
+
- 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)).
|
|
561
571
|
|
|
562
572
|
## [v5.3.0](https://github.com/stellar/js-stellar-base/compare/v5.2.1..v5.3.0)
|
|
563
573
|
|
|
564
574
|
### Add
|
|
565
|
-
- **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)).
|
|
566
575
|
|
|
576
|
+
- **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)).
|
|
567
577
|
|
|
568
578
|
## [v5.2.1](https://github.com/stellar/js-stellar-base/compare/v5.2.0..v5.2.1)
|
|
569
579
|
|
|
570
580
|
### Fix
|
|
571
|
-
- 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)).
|
|
572
581
|
|
|
582
|
+
- 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)).
|
|
573
583
|
|
|
574
584
|
## [v5.2.0](https://github.com/stellar/js-stellar-base/compare/v5.1.0..v5.2.0)
|
|
575
585
|
|
|
576
586
|
### Add
|
|
587
|
+
|
|
577
588
|
- **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)):
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
589
|
+
- `Payment.destination`
|
|
590
|
+
- `PathPaymentStrictReceive.destination`
|
|
591
|
+
- `PathPaymentStrictSend.destination`
|
|
592
|
+
- `Operation.sourceAccount`
|
|
593
|
+
- `AccountMerge.destination`
|
|
594
|
+
- `Transaction.sourceAccount`
|
|
584
595
|
|
|
585
596
|
- 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)):
|
|
586
597
|
|
|
587
598
|
```js
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
599
|
+
const PUBKEY = "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ";
|
|
600
|
+
const ACC = new StellarBase.Account(PUBKEY, "1");
|
|
601
|
+
|
|
602
|
+
const mux1 = new StellarBase.MuxedAccount(ACC, "1000");
|
|
603
|
+
console.log(mux1.accountId(), mux1.id());
|
|
604
|
+
// MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAD5DTGC 1000
|
|
605
|
+
|
|
606
|
+
const mux2 = ACC.createSubaccount("2000");
|
|
607
|
+
console.log(
|
|
608
|
+
"Parent relationship preserved:",
|
|
609
|
+
mux2.baseAccount().accountId() === mux1.baseAccount().accountId()
|
|
610
|
+
);
|
|
611
|
+
console.log(mux2.accountId(), mux2.id());
|
|
612
|
+
// MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAH2B4RU 2000
|
|
613
|
+
|
|
614
|
+
mux1.setID("3000");
|
|
615
|
+
console.log(
|
|
616
|
+
"Underlying account unchanged:",
|
|
617
|
+
ACC.accountId() === mux1.baseAccount().accountId()
|
|
618
|
+
);
|
|
619
|
+
console.log(mux1.accountId(), mux1.id());
|
|
620
|
+
// MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAALXC5LE 3000
|
|
606
621
|
```
|
|
607
622
|
|
|
608
623
|
- 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.
|
|
609
624
|
|
|
610
625
|
### Update
|
|
626
|
+
|
|
611
627
|
- Modernize the minimum-supported browser versions for the library ([#419](https://github.com/stellar/js-stellar-base/pull/419)).
|
|
612
628
|
|
|
613
629
|
### Fix
|
|
614
|
-
- Update Typescript test for `SetOptions` to use authorization flags (e.g. `AuthRequiredFlag`) correctly ([#418](https://github.com/stellar/js-stellar-base/pull/418)).
|
|
615
630
|
|
|
631
|
+
- Update Typescript test for `SetOptions` to use authorization flags (e.g. `AuthRequiredFlag`) correctly ([#418](https://github.com/stellar/js-stellar-base/pull/418)).
|
|
616
632
|
|
|
617
633
|
## [v5.1.0](https://github.com/stellar/js-stellar-base/compare/v5.0.0..v5.1.0)
|
|
618
634
|
|
|
@@ -636,7 +652,6 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
636
652
|
|
|
637
653
|
- `AllowTrustOpAsset` has been renamed to `AssetCode` ([#394](https://github.com/stellar/js-stellar-base/pull/394))
|
|
638
654
|
|
|
639
|
-
|
|
640
655
|
### Deprecated
|
|
641
656
|
|
|
642
657
|
- `AllowTrustOp` is now a deprecated operation.
|
|
@@ -648,14 +663,12 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
648
663
|
- Update TS definitions for XDRs ([#381](https://github.com/stellar/js-stellar-base/pull/381))
|
|
649
664
|
- Fix typing for ManageData.value ([#379](https://github.com/stellar/js-stellar-base/pull/379))
|
|
650
665
|
|
|
651
|
-
|
|
652
666
|
## [v4.0.2](https://github.com/stellar/js-stellar-base/compare/v4.0.1..v4.0.2)
|
|
653
667
|
|
|
654
668
|
## Update
|
|
655
669
|
|
|
656
670
|
- Fix deployment script.
|
|
657
671
|
|
|
658
|
-
|
|
659
672
|
## [v4.0.1](https://github.com/stellar/js-stellar-base/compare/v4.0.0..v4.0.1)
|
|
660
673
|
|
|
661
674
|
## Update
|
|
@@ -665,8 +678,9 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
665
678
|
## [v4.0.0](https://github.com/stellar/js-stellar-base/compare/v3.0.4..v4.0.0)
|
|
666
679
|
|
|
667
680
|
## Add
|
|
681
|
+
|
|
668
682
|
- Add the `Claimant` class which helps the creation of claimable balances. ([#367](https://github.com/stellar/js-stellar-base/pull/367)).
|
|
669
|
-
The default behavior of this class it to create claimants with an unconditional predicate if none is passed:
|
|
683
|
+
The default behavior of this class it to create claimants with an unconditional predicate if none is passed:
|
|
670
684
|
|
|
671
685
|
```
|
|
672
686
|
const claimant = new StellarBase.Claimant(
|
|
@@ -700,41 +714,44 @@ const claimant = new StellarBase.Claimant(
|
|
|
700
714
|
```
|
|
701
715
|
|
|
702
716
|
- Add `Operation.createClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368))
|
|
703
|
-
Extend the operation class with a new helper to create claimable balance operations.
|
|
717
|
+
Extend the operation class with a new helper to create claimable balance operations.
|
|
704
718
|
|
|
705
719
|
```js
|
|
706
720
|
const asset = new Asset(
|
|
707
|
-
|
|
708
|
-
|
|
721
|
+
"USD",
|
|
722
|
+
"GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7"
|
|
709
723
|
);
|
|
710
|
-
const amount =
|
|
724
|
+
const amount = "100.0000000";
|
|
711
725
|
const claimants = [
|
|
712
726
|
new Claimant(
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
)
|
|
727
|
+
"GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ",
|
|
728
|
+
Claimant.predicateBeforeAbsoluteTime("4102444800000")
|
|
729
|
+
),
|
|
716
730
|
];
|
|
717
731
|
|
|
718
732
|
const op = Operation.createClaimableBalance({
|
|
719
733
|
asset,
|
|
720
734
|
amount,
|
|
721
|
-
claimants
|
|
735
|
+
claimants,
|
|
722
736
|
});
|
|
723
737
|
```
|
|
724
738
|
|
|
725
739
|
- Add `Operation.claimClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368))
|
|
726
|
-
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.
|
|
740
|
+
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.
|
|
727
741
|
|
|
728
742
|
```js
|
|
729
743
|
const op = Operation.createClaimableBalance({
|
|
730
|
-
balanceId:
|
|
744
|
+
balanceId:
|
|
745
|
+
"00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be",
|
|
731
746
|
});
|
|
732
747
|
```
|
|
748
|
+
|
|
733
749
|
- Add support for Sponsored Reserves (CAP33)([#369](https://github.com/stellar/js-stellar-base/pull/369/))
|
|
734
750
|
|
|
735
751
|
Extend the operation class with helpers that allow sponsoring reserves and also revoke sponsorships.
|
|
736
752
|
|
|
737
753
|
To start sponsoring reserves for an account use:
|
|
754
|
+
|
|
738
755
|
- `Operation.beginSponsoringFutureReserves`
|
|
739
756
|
- `Operation.endSponsoringFutureReserves`
|
|
740
757
|
|
|
@@ -855,11 +872,13 @@ The following enum values were rename in `OperationType`:
|
|
|
855
872
|
## [v3.0.2](https://github.com/stellar/js-stellar-base/compare/v3.0.1..v3.0.2)
|
|
856
873
|
|
|
857
874
|
### Fix
|
|
875
|
+
|
|
858
876
|
- Extend `files` in npm package to include XDR type definitions ([#345](https://github.com/stellar/js-stellar-base/pull/345)).
|
|
859
877
|
|
|
860
878
|
## [v3.0.1](https://github.com/stellar/js-stellar-base/compare/v3.0.0..v3.0.1)
|
|
861
879
|
|
|
862
880
|
### Add
|
|
881
|
+
|
|
863
882
|
- Add TypeScript definitions for auto-generated XDR code ([#342](https://github.com/stellar/js-stellar-base/pull/342)).
|
|
864
883
|
|
|
865
884
|
## [v3.0.0](https://github.com/stellar/js-stellar-base/compare/v2.1.9..v3.0.0)
|
|
@@ -867,6 +886,7 @@ The following enum values were rename in `OperationType`:
|
|
|
867
886
|
This version brings protocol 13 support with backwards compatibility support for protocol 12.
|
|
868
887
|
|
|
869
888
|
### Add
|
|
889
|
+
|
|
870
890
|
- Add `TransactionBuilder.buildFeeBumpTransaction` which makes it easy to create `FeeBumpTransaction` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
871
891
|
- 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)).
|
|
872
892
|
- 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)).
|
|
@@ -875,6 +895,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
875
895
|
- Add `TransactionBuilder.fromXDR` which receives an xdr envelope and return a `Transaction` or `FeeBumpTransaction` ([#328](https://github.com/stellar/js-stellar-base/pull/328)).
|
|
876
896
|
|
|
877
897
|
### Update
|
|
898
|
+
|
|
878
899
|
- Update XDR definitions with protocol 13 ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
879
900
|
- Extend `Transaction` to work with `TransactionV1Envelope` and `TransactionV0Envelope` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
880
901
|
- 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)).
|
|
@@ -884,15 +905,15 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
884
905
|
|
|
885
906
|
The syntax for authorizing a trustline is still the same, but the authorize parameter is now a `number`.
|
|
886
907
|
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
908
|
+
```js
|
|
909
|
+
Operation.allowTrust({
|
|
910
|
+
trustor: trustor.publicKey(),
|
|
911
|
+
assetCode: "COP",
|
|
912
|
+
authorize: 1,
|
|
913
|
+
});
|
|
914
|
+
```
|
|
894
915
|
|
|
895
|
-
You can use still use a `boolean`; however, we recommend you update your code to pass a `number` instead. Finally,
|
|
916
|
+
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.
|
|
896
917
|
|
|
897
918
|
- ~Update operations builder to support multiplexed accounts ([#337](https://github.com/stellar/js-stellar-base/pull/337)).~
|
|
898
919
|
|
|
@@ -900,12 +921,12 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
900
921
|
|
|
901
922
|
- `Transaction.toEnvelope()` returns a protocol 13 `xdr.TransactionEnvelope` which is an `xdr.Union` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
902
923
|
If you have code that looks like this - `transaction.toEnvelope().tx` - you have two options:
|
|
903
|
-
|
|
904
|
-
|
|
924
|
+
- You can grab the value wrapped by the union, calling `value()` like `transaction.toEnvelope().value().tx`.
|
|
925
|
+
- You can check which is the discriminant by using `switch()` and then call `v0()`, `v1()`, or `feeBump()`.
|
|
905
926
|
- 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)).
|
|
906
927
|
- The const `BASE_FEE` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
907
|
-
- The option `fee` passed to
|
|
908
|
-
- The following fields, which were previously an `xdr.AccountID` are now a
|
|
928
|
+
- The option `fee` passed to `new TransactionBuilder({fee: ..})` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
929
|
+
- The following fields, which were previously an `xdr.AccountID` are now a `xdr.MuxedAccount` ([#325](https://github.com/stellar/js-stellar-base/pull/325)):
|
|
909
930
|
- `PaymentOp.destination`
|
|
910
931
|
- `PathPaymentStrictReceiveOp.destination`
|
|
911
932
|
- `PathPaymentStrictSendOp.destination`
|
|
@@ -915,6 +936,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
915
936
|
- `FeeBumpTransaction.feeSource`
|
|
916
937
|
|
|
917
938
|
You can get the string representation by calling `StrKey.encodeMuxedAccount` which will return a `G..` or `M..` account.
|
|
939
|
+
|
|
918
940
|
- Remove the following deprecated functions ([#331](https://github.com/stellar/js-stellar-base/pull/331)):
|
|
919
941
|
- `Operation.manageOffer`
|
|
920
942
|
- `Operation.createPassiveOffer`
|
|
@@ -930,6 +952,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
930
952
|
- Update operations builder to support multiplexed accounts ([#337](https://github.com/stellar/js-stellar-base/pull/337)).
|
|
931
953
|
|
|
932
954
|
This allows you to specify an `M` account as the destination or source:
|
|
955
|
+
|
|
933
956
|
```
|
|
934
957
|
var destination = 'MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6';
|
|
935
958
|
var amount = '1000.0000000';
|
|
@@ -954,6 +977,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
954
977
|
This version brings protocol 13 support with backwards compatibility support for protocol 12.
|
|
955
978
|
|
|
956
979
|
### Add
|
|
980
|
+
|
|
957
981
|
- Add `TransactionBuilder.buildFeeBumpTransaction` which makes it easy to create `FeeBumpTransaction` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
958
982
|
- 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)).
|
|
959
983
|
- 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)).
|
|
@@ -962,6 +986,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
962
986
|
- Add `TransactionBuilder.fromXDR` which receives an xdr envelope and return a `Transaction` or `FeeBumpTransaction` ([#328](https://github.com/stellar/js-stellar-base/pull/328)).
|
|
963
987
|
|
|
964
988
|
### Update
|
|
989
|
+
|
|
965
990
|
- Update XDR definitions with protocol 13 ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
966
991
|
- Extend `Transaction` to work with `TransactionV1Envelope` and `TransactionV0Envelope` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
967
992
|
- 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)).
|
|
@@ -970,12 +995,12 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
970
995
|
|
|
971
996
|
- `Transaction.toEnvelope()` returns a protocol 13 `xdr.TransactionEnvelope` which is an `xdr.Union` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
972
997
|
If you have code that looks like this `transaction.toEnvelope().tx` you have two options:
|
|
973
|
-
|
|
974
|
-
|
|
998
|
+
- You can grab the value wrapped by the union, calling `value()` like `transaction.toEnvelope().value().tx`.
|
|
999
|
+
- You can check which is the discriminant by using `switch()` and then call `v0()`, `v1()`, or `feeBump()`.
|
|
975
1000
|
- 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)).
|
|
976
1001
|
- The const `BASE_FEE` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
977
|
-
- The option `fee` passed to
|
|
978
|
-
- The following fields, which were previously an `xdr.AccountID` are now a
|
|
1002
|
+
- The option `fee` passed to `new TransactionBuilder({fee: ..})` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
1003
|
+
- The following fields, which were previously an `xdr.AccountID` are now a `xdr.MuxedAccount` ([#325](https://github.com/stellar/js-stellar-base/pull/325)):
|
|
979
1004
|
- `PaymentOp.destination`
|
|
980
1005
|
- `PathPaymentStrictReceiveOp.destination`
|
|
981
1006
|
- `PathPaymentStrictSendOp.destination`
|
|
@@ -985,6 +1010,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
985
1010
|
- `FeeBumpTransaction.feeSource`
|
|
986
1011
|
|
|
987
1012
|
You can get the string representation by calling `StrKey.encodeMuxedAccount` which will return a `G..` or `M..` account.
|
|
1013
|
+
|
|
988
1014
|
- Remove the following deprecated functions ([#331](https://github.com/stellar/js-stellar-base/pull/331)):
|
|
989
1015
|
- `Operation.manageOffer`
|
|
990
1016
|
- `Operation.createPassiveOffer`
|
|
@@ -993,46 +1019,54 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
993
1019
|
- Remove the `Network` class ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
|
|
994
1020
|
- Remove `vendor/base58.js` ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
|
|
995
1021
|
|
|
996
|
-
|
|
997
1022
|
## [v2.1.9](https://github.com/stellar/js-stellar-base/compare/v2.1.8..v2.1.9)
|
|
998
1023
|
|
|
999
1024
|
### Fix
|
|
1025
|
+
|
|
1000
1026
|
- Update dependencies which depend on minimist. ([#332](https://github.com/stellar/js-stellar-base/pull/332))
|
|
1001
1027
|
|
|
1002
1028
|
## [v2.1.8](https://github.com/stellar/js-stellar-base/compare/v2.1.7..v2.1.8)
|
|
1003
1029
|
|
|
1004
1030
|
### Fix
|
|
1031
|
+
|
|
1005
1032
|
- Fix `setTimeout(0)` and partially defined timebounds ([#315](https://github.com/stellar/js-stellar-base/pull/315)).
|
|
1006
1033
|
|
|
1007
1034
|
## [v2.1.7](https://github.com/stellar/js-stellar-base/compare/v2.1.6..v2.1.7)
|
|
1008
1035
|
|
|
1009
1036
|
### Fix
|
|
1037
|
+
|
|
1010
1038
|
- Fix TypeScript options for `ManageData` operation to allow setting value to `null` ([#310](https://github.com/stellar/js-stellar-base/issues/310))
|
|
1011
1039
|
- Fix crash on partially defined time bounds ([#303](https://github.com/stellar/js-stellar-base/issues/303))
|
|
1012
1040
|
|
|
1013
1041
|
## [v2.1.6](https://github.com/stellar/js-stellar-base/compare/v2.1.5..v2.1.6)
|
|
1014
1042
|
|
|
1015
1043
|
### Fix
|
|
1044
|
+
|
|
1016
1045
|
- Fix npm deployment.
|
|
1017
1046
|
|
|
1018
1047
|
## [v2.1.5](https://github.com/stellar/js-stellar-base/compare/v2.1.4..v2.1.5)
|
|
1019
1048
|
|
|
1020
1049
|
### Add
|
|
1050
|
+
|
|
1021
1051
|
- Add `toXDR` type to Transaction class ([#296](https://github.com/stellar/js-stellar-base/issues/296))
|
|
1022
1052
|
|
|
1023
1053
|
### Fix
|
|
1054
|
+
|
|
1024
1055
|
- Fix doc link ([#298](https://github.com/stellar/js-stellar-base/issues/298))
|
|
1025
1056
|
|
|
1026
1057
|
### Remove
|
|
1058
|
+
|
|
1027
1059
|
- Remove node engine restriction ([#294](https://github.com/stellar/js-stellar-base/issues/294))
|
|
1028
1060
|
|
|
1029
1061
|
### Update
|
|
1062
|
+
|
|
1030
1063
|
- Update creating an account example ([#299](https://github.com/stellar/js-stellar-base/issues/299))
|
|
1031
1064
|
- Use `console.trace` to get line num in `Networks.use` ([#300](https://github.com/stellar/js-stellar-base/issues/300))
|
|
1032
1065
|
|
|
1033
1066
|
## [v2.1.4](https://github.com/stellar/js-stellar-base/compare/v2.1.3..v2.1.4)
|
|
1034
1067
|
|
|
1035
1068
|
## Update
|
|
1069
|
+
|
|
1036
1070
|
- Regenerate the XDR definitions to include MetaV2 ([#288](https://github.com/stellar/js-stellar-base/issues/288))
|
|
1037
1071
|
|
|
1038
1072
|
## [v2.1.3](https://github.com/stellar/js-stellar-base/compare/v2.1.2...v2.1.3)
|
|
@@ -1063,76 +1097,77 @@ This release adds support for [stellar-core protocol 12 release](https://github.
|
|
|
1063
1097
|
|
|
1064
1098
|
### Add ➕
|
|
1065
1099
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1100
|
+
- `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)).
|
|
1101
|
+
|
|
1102
|
+
The following operation will debit exactly 10 USD from the source account, crediting at least 9.2 EUR in the destination account 💸:
|
|
1103
|
+
|
|
1104
|
+
```js
|
|
1105
|
+
var sendAsset = new StellarBase.Asset(
|
|
1106
|
+
"USD",
|
|
1107
|
+
"GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7"
|
|
1108
|
+
);
|
|
1109
|
+
var sendAmount = "10";
|
|
1110
|
+
var destination = "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ";
|
|
1111
|
+
var destAsset = new StellarBase.Asset(
|
|
1112
|
+
"USD",
|
|
1113
|
+
"GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7"
|
|
1114
|
+
);
|
|
1115
|
+
var destMin = "9.2";
|
|
1116
|
+
var path = [
|
|
1117
|
+
new StellarBase.Asset(
|
|
1118
|
+
"USD",
|
|
1119
|
+
"GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB"
|
|
1120
|
+
),
|
|
1121
|
+
new StellarBase.Asset(
|
|
1122
|
+
"EUR",
|
|
1123
|
+
"GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL"
|
|
1124
|
+
),
|
|
1125
|
+
];
|
|
1126
|
+
let op = StellarBase.Operation.pathPaymentStrictSend({
|
|
1127
|
+
sendAsset,
|
|
1128
|
+
sendAmount,
|
|
1129
|
+
destination,
|
|
1130
|
+
destAsset,
|
|
1131
|
+
destMin,
|
|
1132
|
+
path,
|
|
1133
|
+
});
|
|
1134
|
+
```
|
|
1135
|
+
|
|
1136
|
+
- `Operation.pathPaymentStrictReceive`: This behaves the same as the former `pathPayments` operation. ([#274](https://github.com/stellar/js-stellar-base/pull/274)).
|
|
1137
|
+
|
|
1138
|
+
The following operation will debit maximum 10 USD from the source account, crediting exactly 9.2 EUR in the destination account 💸:
|
|
1139
|
+
|
|
1140
|
+
```js
|
|
1141
|
+
var sendAsset = new StellarBase.Asset(
|
|
1142
|
+
"USD",
|
|
1143
|
+
"GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7"
|
|
1144
|
+
);
|
|
1145
|
+
var sendMax = "10";
|
|
1146
|
+
var destination = "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ";
|
|
1147
|
+
var destAsset = new StellarBase.Asset(
|
|
1148
|
+
"USD",
|
|
1149
|
+
"GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7"
|
|
1150
|
+
);
|
|
1151
|
+
var destAmount = "9.2";
|
|
1152
|
+
var path = [
|
|
1153
|
+
new StellarBase.Asset(
|
|
1154
|
+
"USD",
|
|
1155
|
+
"GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB"
|
|
1156
|
+
),
|
|
1157
|
+
new StellarBase.Asset(
|
|
1158
|
+
"EUR",
|
|
1159
|
+
"GDTNXRLOJD2YEBPKK7KCMR7J33AAG5VZXHAJTHIG736D6LVEFLLLKPDL"
|
|
1160
|
+
),
|
|
1161
|
+
];
|
|
1162
|
+
let op = StellarBase.Operation.pathPaymentStrictReceive({
|
|
1163
|
+
sendAsset,
|
|
1164
|
+
sendMax,
|
|
1165
|
+
destination,
|
|
1166
|
+
destAsset,
|
|
1167
|
+
destAmount,
|
|
1168
|
+
path,
|
|
1169
|
+
});
|
|
1170
|
+
```
|
|
1136
1171
|
|
|
1137
1172
|
## Deprecated ❗️
|
|
1138
1173
|
|
|
@@ -1141,6 +1176,7 @@ This release adds support for [stellar-core protocol 12 release](https://github.
|
|
|
1141
1176
|
## [v2.0.2](https://github.com/stellar/js-stellar-base/compare/v2.0.1...v2.0.2)
|
|
1142
1177
|
|
|
1143
1178
|
### Fix
|
|
1179
|
+
|
|
1144
1180
|
- 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)).
|
|
1145
1181
|
|
|
1146
1182
|
## [v2.0.1](https://github.com/stellar/js-stellar-base/compare/v2.0.0...v2.0.1)
|
|
@@ -1156,11 +1192,13 @@ No changes. Fixes deploy script and includes changes from [v2.0.0](https://githu
|
|
|
1156
1192
|
## [v1.1.2](https://github.com/stellar/js-stellar-base/compare/v1.1.1...v1.1.2)
|
|
1157
1193
|
|
|
1158
1194
|
### Fix
|
|
1195
|
+
|
|
1159
1196
|
- Fix no-network warnings ([#248](https://github.com/stellar/js-stellar-base/issues/248))
|
|
1160
1197
|
|
|
1161
1198
|
## [v1.1.1](https://github.com/stellar/js-stellar-base/compare/v1.1.0...v1.1.1)
|
|
1162
1199
|
|
|
1163
1200
|
### Fix
|
|
1201
|
+
|
|
1164
1202
|
- 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))
|
|
1165
1203
|
|
|
1166
1204
|
## [v1.1.0](https://github.com/stellar/js-stellar-base/compare/v1.0.3...v1.1.0)
|
|
@@ -1174,7 +1212,7 @@ is not passed:
|
|
|
1174
1212
|
#### `Keypair.master`
|
|
1175
1213
|
|
|
1176
1214
|
```js
|
|
1177
|
-
Keypair.master(Networks.TESTNET)
|
|
1215
|
+
Keypair.master(Networks.TESTNET);
|
|
1178
1216
|
```
|
|
1179
1217
|
|
|
1180
1218
|
#### constructor for `Transaction`
|
|
@@ -1184,13 +1222,13 @@ const xenv = new xdr.TransactionEnvelope({ tx: xtx });
|
|
|
1184
1222
|
new Transaction(xenv, Networks.TESTNET);
|
|
1185
1223
|
```
|
|
1186
1224
|
|
|
1187
|
-
#### constructor for
|
|
1225
|
+
#### constructor for `TransactionBuilder` and method `TransactionBuilder.setNetworkPassphrase`
|
|
1188
1226
|
|
|
1189
1227
|
```js
|
|
1190
1228
|
const transaction = new StellarSdk.TransactionBuilder(account, {
|
|
1191
1229
|
fee: StellarSdk.BASE_FEE,
|
|
1192
|
-
networkPassphrase: Networks.TESTNET
|
|
1193
|
-
})
|
|
1230
|
+
networkPassphrase: Networks.TESTNET,
|
|
1231
|
+
});
|
|
1194
1232
|
```
|
|
1195
1233
|
|
|
1196
1234
|
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.
|
|
@@ -1198,9 +1236,11 @@ See [#207](https://github.com/stellar/js-stellar-base/issues/207) and [#112](htt
|
|
|
1198
1236
|
The `Network` class will be removed on the `2.0` release.
|
|
1199
1237
|
|
|
1200
1238
|
### Add
|
|
1239
|
+
|
|
1201
1240
|
- Add docs for BASE_FEE const. ([#211](https://github.com/stellar/js-stellar-base/issues/211))
|
|
1202
1241
|
|
|
1203
1242
|
### Fix
|
|
1243
|
+
|
|
1204
1244
|
- Fix typo. ([#213](https://github.com/stellar/js-stellar-base/issues/213))
|
|
1205
1245
|
|
|
1206
1246
|
## [v1.0.3](https://github.com/stellar/js-stellar-base/compare/v1.0.2...v1.0.3)
|
|
@@ -1212,6 +1252,7 @@ The `Network` class will be removed on the `2.0` release.
|
|
|
1212
1252
|
- Add BASE_FEE to TS types ([#209](https://github.com/stellar/js-stellar-base/issues/209))
|
|
1213
1253
|
|
|
1214
1254
|
### Fix
|
|
1255
|
+
|
|
1215
1256
|
- Fix typo in types ([#194](https://github.com/stellar/js-stellar-base/issues/194))
|
|
1216
1257
|
- Fix types: Fee is no longer optional ([#195](https://github.com/stellar/js-stellar-base/issues/195))
|
|
1217
1258
|
- Fix typings for Account Sequence Number ([#203](https://github.com/stellar/js-stellar-base/issues/203))
|