@stellar/stellar-base 14.0.0 → 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 +344 -296
- 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/types/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,71 +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)).
|
|
10
|
+
|
|
11
|
+
## [`v14.0.1`](https://github.com/stellar/js-stellar-base/compare/v14.0.0...v14.0.1):
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Added missing `Asset.toString()` TypeScript definition ([#1218](https://github.com/stellar/js-stellar-sdk/pull/1218)).
|
|
16
|
+
|
|
5
17
|
## [`v14.0.0`](https://github.com/stellar/js-stellar-base/compare/v13.1.0...v14.0.0): Protocol 23
|
|
6
18
|
|
|
7
19
|
### Breaking Changes
|
|
8
|
-
|
|
9
|
-
|
|
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)).
|
|
10
23
|
|
|
11
24
|
### Added
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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)).
|
|
16
30
|
|
|
17
31
|
### Fixed
|
|
18
|
-
* 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)).
|
|
19
|
-
* Fix browser compatibility with proper module resolution and UMD configuration ([#798](https://github.com/stellar/js-stellar-base/pull/798)).
|
|
20
|
-
* Remove `MuxedAccount.parseBaseAddress` from TypeScript definitions ([#797](https://github.com/stellar/js-stellar-base/pull/797)).
|
|
21
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)).
|
|
22
36
|
|
|
23
37
|
## [`v14.0.0-rc.2`](https://github.com/stellar/js-stellar-base/compare/v13.1.0...v14.0.0-rc.2)
|
|
24
38
|
|
|
25
39
|
### Fixed
|
|
26
|
-
* Fixes a bug in `Address.toScAddress()` that would prevent claimable balances and muxed accounts from being encoded correctly.
|
|
27
40
|
|
|
41
|
+
- Fixes a bug in `Address.toScAddress()` that would prevent claimable balances and muxed accounts from being encoded correctly.
|
|
28
42
|
|
|
29
43
|
## [`v14.0.0-rc.1`](https://github.com/stellar/js-stellar-base/compare/v13.1.0...v14.0.0-rc.1): Protocol 23
|
|
30
44
|
|
|
31
45
|
### Breaking Changes
|
|
32
|
-
|
|
33
|
-
|
|
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)).
|
|
34
49
|
|
|
35
50
|
### Added
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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)).
|
|
40
56
|
|
|
41
57
|
### Fixed
|
|
42
|
-
* 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)).
|
|
43
|
-
* Fix browser compatibility with proper module resolution and UMD configuration ([#798](https://github.com/stellar/js-stellar-base/pull/798)).
|
|
44
|
-
* Remove `MuxedAccount.parseBaseAddress` from TypeScript definitions ([#797](https://github.com/stellar/js-stellar-base/pull/797)).
|
|
45
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)).
|
|
46
62
|
|
|
47
63
|
## [`v13.1.0`](https://github.com/stellar/js-stellar-base/compare/v13.0.1...v13.1.0)
|
|
48
64
|
|
|
49
65
|
### Added
|
|
50
|
-
|
|
51
|
-
|
|
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
|
+
|
|
52
70
|
```typescript
|
|
53
71
|
export type SigningCallback = (
|
|
54
72
|
preimage: xdr.HashIdPreimage
|
|
55
|
-
) => Promise<
|
|
56
|
-
BufferLike |
|
|
57
|
-
{ signature: BufferLike, publicKey: string }
|
|
58
|
-
>;
|
|
73
|
+
) => Promise<BufferLike | { signature: BufferLike; publicKey: string }>;
|
|
59
74
|
```
|
|
60
75
|
|
|
61
76
|
### Fixed
|
|
62
|
-
* `scValToNative` will decode addresses more efficiently and reliably ([#794](https://github.com/stellar/js-stellar-base/pull/794)).
|
|
63
77
|
|
|
78
|
+
- `scValToNative` will decode addresses more efficiently and reliably ([#794](https://github.com/stellar/js-stellar-base/pull/794)).
|
|
64
79
|
|
|
65
80
|
## [`v13.0.1`](https://github.com/stellar/js-stellar-base/compare/v13.0.0...v13.0.1)
|
|
66
81
|
|
|
67
82
|
### Fixed
|
|
68
|
-
* `buildInvocationTree` will now successfully walk creation invocations with constructor arguments ([#784](https://github.com/stellar/js-stellar-base/pull/784)).
|
|
69
83
|
|
|
84
|
+
- `buildInvocationTree` will now successfully walk creation invocations with constructor arguments ([#784](https://github.com/stellar/js-stellar-base/pull/784)).
|
|
70
85
|
|
|
71
86
|
## [`v13.0.0`](https://github.com/stellar/js-stellar-base/compare/v12.1.1...v13.0.0)
|
|
72
87
|
|
|
@@ -74,44 +89,46 @@ export type SigningCallback = (
|
|
|
74
89
|
|
|
75
90
|
This version is unchanged from [`beta.1`](#v13.0.0-beta.1).
|
|
76
91
|
|
|
77
|
-
|
|
78
92
|
## [`v13.0.0-beta.1`](https://github.com/stellar/js-stellar-base/compare/v12.1.1...v13.0.0-beta.1)
|
|
79
93
|
|
|
80
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.
|
|
81
95
|
|
|
82
96
|
### Breaking Changes
|
|
83
|
-
|
|
97
|
+
|
|
98
|
+
- XDR definitions have been upgraded to Protocol 22 ([#777](https://github.com/stellar/js-stellar-base/pull/777)).
|
|
84
99
|
|
|
85
100
|
### Added
|
|
86
|
-
* 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)).
|
|
87
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)).
|
|
88
103
|
|
|
89
104
|
## [`v12.1.1`](https://github.com/stellar/js-stellar-base/compare/v12.1.0...v12.1.1)
|
|
90
105
|
|
|
91
106
|
### Fixed
|
|
92
|
-
* Add missing methods to TypeScript definitions ([#766](https://github.com/stellar/js-stellar-base/pull/766)).
|
|
93
|
-
* 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)).
|
|
94
|
-
* Fix `authorizeEntry` to use the correct public key when passing `Keypair`s ([#772](https://github.com/stellar/js-stellar-base/pull/772)).
|
|
95
|
-
* Upgrade misc. dependencies ([#771](https://github.com/stellar/js-stellar-base/pull/771), [#773](https://github.com/stellar/js-stellar-base/pull/773)).
|
|
96
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)).
|
|
97
112
|
|
|
98
113
|
## [`v12.1.0`](https://github.com/stellar/js-stellar-base/compare/v12.0.1...v12.1.0)
|
|
99
114
|
|
|
100
115
|
### Added
|
|
101
|
-
|
|
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)).
|
|
102
118
|
|
|
103
119
|
### Fixed
|
|
104
|
-
* Improve the efficiency and portability of asset type retrieval ([#758](https://github.com/stellar/js-stellar-base/pull/758)).
|
|
105
|
-
* `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)).
|
|
106
|
-
* `nativeToScVal` now allows all integer types to come from strings ([#763](https://github.com/stellar/js-stellar-base/pull/763)).
|
|
107
|
-
* `humanizeEvents` now handles events without a `contractId` set more reliably ([#764](https://github.com/stellar/js-stellar-base/pull/764)).
|
|
108
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)).
|
|
109
125
|
|
|
110
126
|
## [`v12.0.1`](https://github.com/stellar/js-stellar-base/compare/v12.0.0...v12.0.1)
|
|
111
127
|
|
|
112
128
|
### Fixed
|
|
113
|
-
|
|
114
|
-
|
|
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)):
|
|
115
132
|
|
|
116
133
|
```typescript
|
|
117
134
|
interface Error {
|
|
@@ -123,137 +140,145 @@ interface Error {
|
|
|
123
140
|
|
|
124
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.
|
|
125
142
|
|
|
126
|
-
|
|
127
143
|
## [`v12.0.0`](https://github.com/stellar/js-stellar-base/compare/v11.0.1...v12.0.0)
|
|
128
144
|
|
|
129
145
|
This is a re-tag of v12.0.0-rc.1 with only developer dependency updates in-between.
|
|
130
146
|
|
|
131
|
-
|
|
132
147
|
## [`v12.0.0-rc.1`](https://github.com/stellar/js-stellar-base/compare/v11.0.1...v12.0.0-rc.1)
|
|
133
148
|
|
|
134
149
|
### Breaking Changes
|
|
135
|
-
|
|
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)).
|
|
136
152
|
|
|
137
153
|
### Added
|
|
138
|
-
|
|
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)).
|
|
139
156
|
|
|
140
157
|
### Fixed
|
|
141
|
-
* Updated various dependencies ([#737](https://github.com/stellar/js-stellar-base/pull/737), [#739](https://github.com/stellar/js-stellar-base/pull/739)).
|
|
142
|
-
* `Buffer` and `Uint8Array` compatibility has improved in `StrKey` ([#746](https://github.com/stellar/js-stellar-base/pull/746)).
|
|
143
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)).
|
|
144
161
|
|
|
145
162
|
## [`v11.0.1`](https://github.com/stellar/js-stellar-base/compare/v11.0.0...v11.0.1)
|
|
146
163
|
|
|
147
164
|
### Fixed
|
|
148
|
-
* 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)).
|
|
149
|
-
* 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)).
|
|
150
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)).
|
|
151
168
|
|
|
152
169
|
## [`v11.0.0`](https://github.com/stellar/js-stellar-base/compare/v10.0.2...v11.0.0)
|
|
153
170
|
|
|
154
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.
|
|
155
172
|
|
|
156
173
|
### Breaking Changes
|
|
157
|
-
|
|
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)).
|
|
158
176
|
|
|
159
177
|
### Fixed
|
|
160
|
-
* 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)).
|
|
161
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)).
|
|
162
180
|
|
|
163
181
|
## [`v10.0.2`](https://github.com/stellar/js-stellar-base/compare/v10.0.1...v10.0.2)
|
|
164
182
|
|
|
165
183
|
### Fixed
|
|
166
|
-
* 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)).
|
|
167
|
-
* 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)).
|
|
168
|
-
* Dependencies have been updated ([#724](https://github.com/stellar/js-stellar-base/pull/724)).
|
|
169
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)).
|
|
170
188
|
|
|
171
189
|
## [`v10.0.1`](https://github.com/stellar/js-stellar-base/compare/v10.0.0...v10.0.1)
|
|
172
190
|
|
|
173
191
|
### Fixed
|
|
174
|
-
* 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)).
|
|
175
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)).
|
|
176
194
|
|
|
177
195
|
## [`v10.0.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0): Protocol 20 Stable Release
|
|
178
196
|
|
|
179
197
|
### Breaking Changes
|
|
180
|
-
|
|
181
|
-
|
|
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)):
|
|
182
201
|
- `Operation.bumpFootprintExpiration` is now `extendFootprintTtl` and its `ledgersToExpire` field is now named `extendTo`, but it serves the same purpose.
|
|
183
202
|
- In TypeScript, the `Operation.BumpFootprintExpiration` is now `Operation.ExtendFootprintTTL`
|
|
184
203
|
- `xdr.ContractExecutable.contractExecutableToken` is now `contractExecutableStellarAsset`
|
|
185
204
|
- `xdr.SorobanTransactionData.refundableFee` is now `resourceFee`
|
|
186
205
|
- In turn, `SorobanDataBuilder.setRefundableFee` is now `setResourceFee`
|
|
187
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: ... })`).
|
|
188
|
-
- `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)).
|
|
189
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)).
|
|
190
209
|
|
|
191
210
|
## [`v10.0.0-beta.4`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.3...v10.0.0-beta.4)
|
|
192
211
|
|
|
193
212
|
### Fixed
|
|
194
|
-
- You can now correctly clone transactions (`TransactionBuilder.cloneFrom`) with large sequence numbers ([#711](https://github.com/stellar/js-stellar-base/pull/711)).
|
|
195
213
|
|
|
214
|
+
- You can now correctly clone transactions (`TransactionBuilder.cloneFrom`) with large sequence numbers ([#711](https://github.com/stellar/js-stellar-base/pull/711)).
|
|
196
215
|
|
|
197
216
|
## [`v10.0.0-beta.3`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.2...v10.0.0-beta.3)
|
|
198
217
|
|
|
199
218
|
### Fixed
|
|
200
|
-
* Fixes a bug where `authorizeEntry` might perform a no-op when it shouldn't ([#701](https://github.com/stellar/js-stellar-base/pull/701)).
|
|
201
|
-
* Fixes a TypeScript bug where `Memo.hash` did not accept a `Buffer` ([#698](https://github.com/stellar/js-stellar-base/pull/698)).
|
|
202
|
-
* Upgrades a transient dependency for security ([#296](https://github.com/stellar/js-stellar-base/pull/696)).
|
|
203
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)).
|
|
204
223
|
|
|
205
224
|
## [`v10.0.0-beta.2`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.1...v10.0.0-beta.2)
|
|
206
225
|
|
|
207
226
|
### Breaking Changes
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
|
212
233
|
|
|
213
234
|
### Fixed
|
|
214
|
-
* 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)).
|
|
215
|
-
* Misc. dependencies have been updated to their latest versions ([#694](https://github.com/stellar/js-stellar-base/pull/694)).
|
|
216
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)).
|
|
217
238
|
|
|
218
239
|
## [`v10.0.0-beta.1`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.0...v10.0.0-beta.1)
|
|
219
240
|
|
|
220
241
|
### Fixed
|
|
221
|
-
* `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)).
|
|
222
|
-
* `Contract.call()` now produces valid `Operation` XDR ([#692](https://github.com/stellar/js-stellar-base/pull/692)).
|
|
223
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)).
|
|
224
245
|
|
|
225
246
|
## [`v10.0.0-beta.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0-beta.0): Protocol 20
|
|
226
247
|
|
|
227
248
|
### Breaking Changes
|
|
228
|
-
|
|
229
|
-
|
|
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)).
|
|
230
252
|
|
|
231
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:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
|
236
259
|
|
|
237
260
|
### Added
|
|
261
|
+
|
|
238
262
|
The following are new APIs to deal with new Soroban constructs:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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.
|
|
253
278
|
|
|
254
279
|
### Fixes
|
|
255
|
-
* Improves the error messages when passing invalid amounts to deposit and withdraw operations ([#679](https://github.com/stellar/js-stellar-base/pull/679)).
|
|
256
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)).
|
|
257
282
|
|
|
258
283
|
## [v9.0.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0)
|
|
259
284
|
|
|
@@ -263,8 +288,8 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
263
288
|
|
|
264
289
|
The browser bundle size has decreased **significantly**:
|
|
265
290
|
|
|
266
|
-
|
|
267
|
-
|
|
291
|
+
- `stellar-base.min.js` is **340 KiB**, down from **1.2 MiB** previously.
|
|
292
|
+
- the new, unminified `stellar-base.js` is **895 KiB**.
|
|
268
293
|
|
|
269
294
|
### Breaking Changes
|
|
270
295
|
|
|
@@ -284,7 +309,6 @@ Though we have tried to maintain compatibility with older JavaScript implementat
|
|
|
284
309
|
- Drop the `crc` dependency and inline it to lower bundle size ([#621](https://github.com/stellar/js-stellar-base/pull/621)).
|
|
285
310
|
- Upgrade all dependencies to their latest versions ([#608](https://github.com/stellar/js-stellar-base/pull/608)).
|
|
286
311
|
|
|
287
|
-
|
|
288
312
|
## [v9.0.0-beta.3](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.1..v9.0.0-beta.2)
|
|
289
313
|
|
|
290
314
|
### Fix
|
|
@@ -292,24 +316,22 @@ Though we have tried to maintain compatibility with older JavaScript implementat
|
|
|
292
316
|
- Fixes a bug when sorting mixed-case assets for liquidity pools ([#606](https://github.com/stellar/js-stellar-base/pull/606)).
|
|
293
317
|
|
|
294
318
|
### Update
|
|
319
|
+
|
|
295
320
|
- Upgrade all dependencies to their latest versions ([#608](https://github.com/stellar/js-stellar-base/pull/608)).
|
|
296
321
|
- Drop the `crc` dependency and inline it to lower bundle size ([#621](https://github.com/stellar/js-stellar-base/pull/621)).
|
|
297
322
|
|
|
298
|
-
|
|
299
323
|
## [v9.0.0-beta.2](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.1..v9.0.0-beta.2)
|
|
300
324
|
|
|
301
325
|
### Update
|
|
302
326
|
|
|
303
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)).
|
|
304
328
|
|
|
305
|
-
|
|
306
329
|
## [v9.0.0-beta.1](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.0..v9.0.0-beta.1)
|
|
307
330
|
|
|
308
331
|
### Fix
|
|
309
332
|
|
|
310
333
|
- Correct XDR type definition for raw `xdr.Operation`s ([#591](https://github.com/stellar/js-stellar-base/pull/591)).
|
|
311
334
|
|
|
312
|
-
|
|
313
335
|
## [v9.0.0-beta.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0-beta.0)
|
|
314
336
|
|
|
315
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.
|
|
@@ -320,7 +342,6 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
320
342
|
|
|
321
343
|
- Current and vNext XDR updated to latest versions ([#587](https://github.com/stellar/js-stellar-base/pull/587)).
|
|
322
344
|
|
|
323
|
-
|
|
324
345
|
## [v8.2.2](https://github.com/stellar/js-stellar-base/compare/v8.2.1..v8.2.2)
|
|
325
346
|
|
|
326
347
|
### Fix
|
|
@@ -331,28 +352,25 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
331
352
|
|
|
332
353
|
### Fix
|
|
333
354
|
|
|
334
|
-
|
|
335
|
-
|
|
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)).
|
|
336
356
|
|
|
337
357
|
## [v8.2.0](https://github.com/stellar/js-stellar-base/compare/v8.1.0..v8.2.0)
|
|
338
358
|
|
|
339
359
|
### Add
|
|
340
360
|
|
|
341
|
-
|
|
342
|
-
|
|
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)).
|
|
343
362
|
|
|
344
363
|
## [v8.1.0](https://github.com/stellar/js-stellar-base/compare/v8.0.1..v8.1.0)
|
|
345
364
|
|
|
346
365
|
### Add
|
|
347
366
|
|
|
348
|
-
|
|
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)).
|
|
349
368
|
|
|
350
|
-
|
|
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)).
|
|
351
370
|
|
|
352
371
|
### Fix
|
|
353
372
|
|
|
354
|
-
|
|
355
|
-
|
|
373
|
+
- Correctly set `minAccountSequence` in `TransactionBuilder` for large values ([#539](https://github.com/stellar/js-stellar-base/pull/539), thank you @overcat!).
|
|
356
374
|
|
|
357
375
|
## [v8.0.1](https://github.com/stellar/js-stellar-base/compare/v8.0.0..v8.0.1)
|
|
358
376
|
|
|
@@ -360,12 +378,10 @@ This version is marked by a major version bump because of the significant upgrad
|
|
|
360
378
|
|
|
361
379
|
- Correctly predict claimable balance IDs with large sequence numbers ([#530](https://github.com/stellar/js-stellar-base/pull/530), thank you @overcat!).
|
|
362
380
|
|
|
363
|
-
|
|
364
381
|
## [v8.0.0](https://github.com/stellar/js-stellar-base/compare/v7.0.0..v8.0.0)
|
|
365
382
|
|
|
366
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/).
|
|
367
384
|
|
|
368
|
-
|
|
369
385
|
## [v8.0.0-beta.0](https://github.com/stellar/js-stellar-base/compare/v7.0.0..v8.0.0-beta.0)
|
|
370
386
|
|
|
371
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).
|
|
@@ -377,28 +393,28 @@ This is considered a beta release until the XDR for the Stellar protocol stabili
|
|
|
377
393
|
As of this release, the minimum supported version of NodeJS is **14.x**.
|
|
378
394
|
|
|
379
395
|
- Two XDR types have been renamed:
|
|
380
|
-
|
|
381
|
-
|
|
396
|
+
- `xdr.OperationId` is now `xdr.HashIdPreimage`
|
|
397
|
+
- `xdr.OperationIdId` is now `xdr.HashIdPreimageOperationId`
|
|
382
398
|
|
|
383
399
|
### Add
|
|
384
400
|
|
|
385
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)):
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
402
|
+
- `Keypair.signPayloadDecorated(data)`
|
|
403
|
+
- `StrKey.encodeSignedPayload(buf)`
|
|
404
|
+
- `StrKey.decodeSignedPayload(str)`
|
|
405
|
+
- `StrKey.isValidSignedPayload(str)`
|
|
390
406
|
|
|
391
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)).
|
|
392
408
|
|
|
393
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)):
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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])`
|
|
402
418
|
|
|
403
419
|
### Fix
|
|
404
420
|
|
|
@@ -407,11 +423,10 @@ As of this release, the minimum supported version of NodeJS is **14.x**.
|
|
|
407
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)).
|
|
408
424
|
|
|
409
425
|
- Update developer dependencies:
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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))
|
|
415
430
|
|
|
416
431
|
## [v7.0.0](https://github.com/stellar/js-stellar-base/compare/v6.0.6..v7.0.0)
|
|
417
432
|
|
|
@@ -423,52 +438,51 @@ In [v5.2.0](https://github.com/stellar/js-stellar-base/releases/tag/v5.2.0), we
|
|
|
423
438
|
|
|
424
439
|
The following fields will now always support muxed properties:
|
|
425
440
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
441
|
+
- `FeeBumpTransaction.feeSource`
|
|
442
|
+
- `Transaction.sourceAccount`
|
|
443
|
+
- `Operation.sourceAccount`
|
|
444
|
+
- `Payment.destination`
|
|
445
|
+
- `PathPaymentStrictReceive.destination`
|
|
446
|
+
- `PathPaymentStrictSend.destination`
|
|
447
|
+
- `AccountMerge.destination`
|
|
448
|
+
- `Clawback.from`
|
|
434
449
|
|
|
435
450
|
The following functions had a `withMuxing` parameter removed:
|
|
436
451
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
452
|
+
- `Operation.fromXDRObject`
|
|
453
|
+
- `Transaction.constructor`
|
|
454
|
+
- `FeeBumpTransaction.constructor`
|
|
455
|
+
- `TransactionBuilder.fromXDR`
|
|
456
|
+
- `TransactionBuilder.buildFeeBumpTransaction`
|
|
442
457
|
|
|
443
458
|
The following functions will no longer check the `opts` object for a `withMuxing` field:
|
|
444
459
|
|
|
445
|
-
|
|
446
|
-
|
|
460
|
+
- `TransactionBuilder.constructor`
|
|
461
|
+
- `Operation.setSourceAccount`
|
|
447
462
|
|
|
448
463
|
There are several other breaking changes:
|
|
449
464
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
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:
|
|
453
468
|
|
|
454
469
|
```js
|
|
455
|
-
|
|
470
|
+
let mux1 = new MuxedAccount(someAccount, "1");
|
|
456
471
|
|
|
457
|
-
|
|
458
|
-
|
|
472
|
+
// before:
|
|
473
|
+
let mux2 = mux1.createSubaccount("2");
|
|
459
474
|
|
|
460
|
-
|
|
461
|
-
|
|
475
|
+
// now:
|
|
476
|
+
let mux2 = new MuxedAccount(mux1.baseAccount(), "2");
|
|
462
477
|
```
|
|
463
478
|
|
|
464
|
-
|
|
465
|
-
- 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)):
|
|
466
480
|
|
|
467
481
|
```ts
|
|
468
482
|
function extractBaseAddess(address: string): string;
|
|
469
483
|
```
|
|
470
484
|
|
|
471
|
-
|
|
485
|
+
- The following muxed account validation functions are now available from Typescript ([#483](https://github.com/stellar/js-stellar-base/pull/483/files)):
|
|
472
486
|
|
|
473
487
|
```typescript
|
|
474
488
|
namespace StrKey {
|
|
@@ -477,8 +491,14 @@ namespace StrKey {
|
|
|
477
491
|
function isValidMed25519PublicKey(publicKey: string): boolean;
|
|
478
492
|
}
|
|
479
493
|
|
|
480
|
-
function decodeAddressToMuxedAccount(
|
|
481
|
-
|
|
494
|
+
function decodeAddressToMuxedAccount(
|
|
495
|
+
address: string,
|
|
496
|
+
supportMuxing: boolean
|
|
497
|
+
): xdr.MuxedAccount;
|
|
498
|
+
function encodeMuxedAccountToAddress(
|
|
499
|
+
account: xdr.MuxedAccount,
|
|
500
|
+
supportMuxing: boolean
|
|
501
|
+
): string;
|
|
482
502
|
function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount;
|
|
483
503
|
```
|
|
484
504
|
|
|
@@ -488,42 +508,39 @@ function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount;
|
|
|
488
508
|
|
|
489
509
|
- Add `Buffer` as a parameter type option for the `Keypair` constructor in Typescript ([#484](https://github.com/stellar/js-stellar-base/pull/484)).
|
|
490
510
|
|
|
491
|
-
|
|
492
511
|
## [v6.0.6](https://github.com/stellar/js-stellar-base/compare/v6.0.5..v6.0.6)
|
|
493
512
|
|
|
494
513
|
### Fix
|
|
495
514
|
|
|
496
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)).
|
|
497
516
|
|
|
498
|
-
|
|
499
517
|
## [v6.0.5](https://github.com/stellar/js-stellar-base/compare/v6.0.4..v6.0.5)
|
|
500
518
|
|
|
501
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.
|
|
502
520
|
|
|
503
521
|
Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-rvh2-c87w) for details.
|
|
504
522
|
|
|
505
|
-
|
|
506
523
|
### Security Fix
|
|
507
|
-
- Pin `ua-parser-js` to a known safe version ([#477](https://github.com/stellar/js-stellar-base/pull/477)).
|
|
508
524
|
|
|
525
|
+
- Pin `ua-parser-js` to a known safe version ([#477](https://github.com/stellar/js-stellar-base/pull/477)).
|
|
509
526
|
|
|
510
527
|
## [v6.0.4](https://github.com/stellar/js-stellar-base/compare/v6.0.3..v6.0.4)
|
|
511
528
|
|
|
512
529
|
### Fix
|
|
513
|
-
- Allow muxed accounts when decoding transactions via `TransactionBuilder.fromXDR()` ([#470](https://github.com/stellar/js-stellar-base/pull/470)).
|
|
514
530
|
|
|
531
|
+
- Allow muxed accounts when decoding transactions via `TransactionBuilder.fromXDR()` ([#470](https://github.com/stellar/js-stellar-base/pull/470)).
|
|
515
532
|
|
|
516
533
|
## [v6.0.3](https://github.com/stellar/js-stellar-base/compare/v6.0.2..v6.0.3)
|
|
517
534
|
|
|
518
535
|
### Fix
|
|
519
|
-
- 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)).
|
|
520
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)).
|
|
521
538
|
|
|
522
539
|
## [v6.0.2](https://github.com/stellar/js-stellar-base/compare/v6.0.1..v6.0.2)
|
|
523
540
|
|
|
524
541
|
### Fix
|
|
525
|
-
- Fix Typescript signatures for operations to universally allow setting the `withMuxing` flag ([#466](https://github.com/stellar/js-stellar-base/pull/466)).
|
|
526
542
|
|
|
543
|
+
- Fix Typescript signatures for operations to universally allow setting the `withMuxing` flag ([#466](https://github.com/stellar/js-stellar-base/pull/466)).
|
|
527
544
|
|
|
528
545
|
## [v6.0.1](https://github.com/stellar/js-stellar-base/compare/v5.3.2..v6.0.1)
|
|
529
546
|
|
|
@@ -543,69 +560,75 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
543
560
|
## [v5.3.2](https://github.com/stellar/js-stellar-base/compare/v5.3.1..v5.3.2)
|
|
544
561
|
|
|
545
562
|
### Fix
|
|
546
|
-
- 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)).
|
|
547
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)).
|
|
548
565
|
|
|
549
566
|
## [v5.3.1](https://github.com/stellar/js-stellar-base/compare/v5.3.0..v5.3.1)
|
|
550
567
|
|
|
551
568
|
### Fix
|
|
552
|
-
- 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)).
|
|
553
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)).
|
|
554
571
|
|
|
555
572
|
## [v5.3.0](https://github.com/stellar/js-stellar-base/compare/v5.2.1..v5.3.0)
|
|
556
573
|
|
|
557
574
|
### Add
|
|
558
|
-
- **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)).
|
|
559
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)).
|
|
560
577
|
|
|
561
578
|
## [v5.2.1](https://github.com/stellar/js-stellar-base/compare/v5.2.0..v5.2.1)
|
|
562
579
|
|
|
563
580
|
### Fix
|
|
564
|
-
- 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)).
|
|
565
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)).
|
|
566
583
|
|
|
567
584
|
## [v5.2.0](https://github.com/stellar/js-stellar-base/compare/v5.1.0..v5.2.0)
|
|
568
585
|
|
|
569
586
|
### Add
|
|
587
|
+
|
|
570
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)):
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
589
|
+
- `Payment.destination`
|
|
590
|
+
- `PathPaymentStrictReceive.destination`
|
|
591
|
+
- `PathPaymentStrictSend.destination`
|
|
592
|
+
- `Operation.sourceAccount`
|
|
593
|
+
- `AccountMerge.destination`
|
|
594
|
+
- `Transaction.sourceAccount`
|
|
577
595
|
|
|
578
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)):
|
|
579
597
|
|
|
580
598
|
```js
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
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
|
|
599
621
|
```
|
|
600
622
|
|
|
601
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.
|
|
602
624
|
|
|
603
625
|
### Update
|
|
626
|
+
|
|
604
627
|
- Modernize the minimum-supported browser versions for the library ([#419](https://github.com/stellar/js-stellar-base/pull/419)).
|
|
605
628
|
|
|
606
629
|
### Fix
|
|
607
|
-
- Update Typescript test for `SetOptions` to use authorization flags (e.g. `AuthRequiredFlag`) correctly ([#418](https://github.com/stellar/js-stellar-base/pull/418)).
|
|
608
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)).
|
|
609
632
|
|
|
610
633
|
## [v5.1.0](https://github.com/stellar/js-stellar-base/compare/v5.0.0..v5.1.0)
|
|
611
634
|
|
|
@@ -629,7 +652,6 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
629
652
|
|
|
630
653
|
- `AllowTrustOpAsset` has been renamed to `AssetCode` ([#394](https://github.com/stellar/js-stellar-base/pull/394))
|
|
631
654
|
|
|
632
|
-
|
|
633
655
|
### Deprecated
|
|
634
656
|
|
|
635
657
|
- `AllowTrustOp` is now a deprecated operation.
|
|
@@ -641,14 +663,12 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
641
663
|
- Update TS definitions for XDRs ([#381](https://github.com/stellar/js-stellar-base/pull/381))
|
|
642
664
|
- Fix typing for ManageData.value ([#379](https://github.com/stellar/js-stellar-base/pull/379))
|
|
643
665
|
|
|
644
|
-
|
|
645
666
|
## [v4.0.2](https://github.com/stellar/js-stellar-base/compare/v4.0.1..v4.0.2)
|
|
646
667
|
|
|
647
668
|
## Update
|
|
648
669
|
|
|
649
670
|
- Fix deployment script.
|
|
650
671
|
|
|
651
|
-
|
|
652
672
|
## [v4.0.1](https://github.com/stellar/js-stellar-base/compare/v4.0.0..v4.0.1)
|
|
653
673
|
|
|
654
674
|
## Update
|
|
@@ -658,8 +678,9 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
|
|
|
658
678
|
## [v4.0.0](https://github.com/stellar/js-stellar-base/compare/v3.0.4..v4.0.0)
|
|
659
679
|
|
|
660
680
|
## Add
|
|
681
|
+
|
|
661
682
|
- Add the `Claimant` class which helps the creation of claimable balances. ([#367](https://github.com/stellar/js-stellar-base/pull/367)).
|
|
662
|
-
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:
|
|
663
684
|
|
|
664
685
|
```
|
|
665
686
|
const claimant = new StellarBase.Claimant(
|
|
@@ -693,41 +714,44 @@ const claimant = new StellarBase.Claimant(
|
|
|
693
714
|
```
|
|
694
715
|
|
|
695
716
|
- Add `Operation.createClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368))
|
|
696
|
-
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.
|
|
697
718
|
|
|
698
719
|
```js
|
|
699
720
|
const asset = new Asset(
|
|
700
|
-
|
|
701
|
-
|
|
721
|
+
"USD",
|
|
722
|
+
"GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7"
|
|
702
723
|
);
|
|
703
|
-
const amount =
|
|
724
|
+
const amount = "100.0000000";
|
|
704
725
|
const claimants = [
|
|
705
726
|
new Claimant(
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
)
|
|
727
|
+
"GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ",
|
|
728
|
+
Claimant.predicateBeforeAbsoluteTime("4102444800000")
|
|
729
|
+
),
|
|
709
730
|
];
|
|
710
731
|
|
|
711
732
|
const op = Operation.createClaimableBalance({
|
|
712
733
|
asset,
|
|
713
734
|
amount,
|
|
714
|
-
claimants
|
|
735
|
+
claimants,
|
|
715
736
|
});
|
|
716
737
|
```
|
|
717
738
|
|
|
718
739
|
- Add `Operation.claimClaimableBalance` ([#368](https://github.com/stellar/js-stellar-base/pull/368))
|
|
719
|
-
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.
|
|
720
741
|
|
|
721
742
|
```js
|
|
722
743
|
const op = Operation.createClaimableBalance({
|
|
723
|
-
balanceId:
|
|
744
|
+
balanceId:
|
|
745
|
+
"00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be",
|
|
724
746
|
});
|
|
725
747
|
```
|
|
748
|
+
|
|
726
749
|
- Add support for Sponsored Reserves (CAP33)([#369](https://github.com/stellar/js-stellar-base/pull/369/))
|
|
727
750
|
|
|
728
751
|
Extend the operation class with helpers that allow sponsoring reserves and also revoke sponsorships.
|
|
729
752
|
|
|
730
753
|
To start sponsoring reserves for an account use:
|
|
754
|
+
|
|
731
755
|
- `Operation.beginSponsoringFutureReserves`
|
|
732
756
|
- `Operation.endSponsoringFutureReserves`
|
|
733
757
|
|
|
@@ -848,11 +872,13 @@ The following enum values were rename in `OperationType`:
|
|
|
848
872
|
## [v3.0.2](https://github.com/stellar/js-stellar-base/compare/v3.0.1..v3.0.2)
|
|
849
873
|
|
|
850
874
|
### Fix
|
|
875
|
+
|
|
851
876
|
- Extend `files` in npm package to include XDR type definitions ([#345](https://github.com/stellar/js-stellar-base/pull/345)).
|
|
852
877
|
|
|
853
878
|
## [v3.0.1](https://github.com/stellar/js-stellar-base/compare/v3.0.0..v3.0.1)
|
|
854
879
|
|
|
855
880
|
### Add
|
|
881
|
+
|
|
856
882
|
- Add TypeScript definitions for auto-generated XDR code ([#342](https://github.com/stellar/js-stellar-base/pull/342)).
|
|
857
883
|
|
|
858
884
|
## [v3.0.0](https://github.com/stellar/js-stellar-base/compare/v2.1.9..v3.0.0)
|
|
@@ -860,6 +886,7 @@ The following enum values were rename in `OperationType`:
|
|
|
860
886
|
This version brings protocol 13 support with backwards compatibility support for protocol 12.
|
|
861
887
|
|
|
862
888
|
### Add
|
|
889
|
+
|
|
863
890
|
- Add `TransactionBuilder.buildFeeBumpTransaction` which makes it easy to create `FeeBumpTransaction` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
864
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)).
|
|
865
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)).
|
|
@@ -868,6 +895,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
868
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)).
|
|
869
896
|
|
|
870
897
|
### Update
|
|
898
|
+
|
|
871
899
|
- Update XDR definitions with protocol 13 ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
872
900
|
- Extend `Transaction` to work with `TransactionV1Envelope` and `TransactionV0Envelope` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
873
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)).
|
|
@@ -877,15 +905,15 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
877
905
|
|
|
878
906
|
The syntax for authorizing a trustline is still the same, but the authorize parameter is now a `number`.
|
|
879
907
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
908
|
+
```js
|
|
909
|
+
Operation.allowTrust({
|
|
910
|
+
trustor: trustor.publicKey(),
|
|
911
|
+
assetCode: "COP",
|
|
912
|
+
authorize: 1,
|
|
913
|
+
});
|
|
914
|
+
```
|
|
887
915
|
|
|
888
|
-
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.
|
|
889
917
|
|
|
890
918
|
- ~Update operations builder to support multiplexed accounts ([#337](https://github.com/stellar/js-stellar-base/pull/337)).~
|
|
891
919
|
|
|
@@ -893,12 +921,12 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
893
921
|
|
|
894
922
|
- `Transaction.toEnvelope()` returns a protocol 13 `xdr.TransactionEnvelope` which is an `xdr.Union` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
895
923
|
If you have code that looks like this - `transaction.toEnvelope().tx` - you have two options:
|
|
896
|
-
|
|
897
|
-
|
|
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()`.
|
|
898
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)).
|
|
899
927
|
- The const `BASE_FEE` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
900
|
-
- The option `fee` passed to
|
|
901
|
-
- 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)):
|
|
902
930
|
- `PaymentOp.destination`
|
|
903
931
|
- `PathPaymentStrictReceiveOp.destination`
|
|
904
932
|
- `PathPaymentStrictSendOp.destination`
|
|
@@ -908,6 +936,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
908
936
|
- `FeeBumpTransaction.feeSource`
|
|
909
937
|
|
|
910
938
|
You can get the string representation by calling `StrKey.encodeMuxedAccount` which will return a `G..` or `M..` account.
|
|
939
|
+
|
|
911
940
|
- Remove the following deprecated functions ([#331](https://github.com/stellar/js-stellar-base/pull/331)):
|
|
912
941
|
- `Operation.manageOffer`
|
|
913
942
|
- `Operation.createPassiveOffer`
|
|
@@ -923,6 +952,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
923
952
|
- Update operations builder to support multiplexed accounts ([#337](https://github.com/stellar/js-stellar-base/pull/337)).
|
|
924
953
|
|
|
925
954
|
This allows you to specify an `M` account as the destination or source:
|
|
955
|
+
|
|
926
956
|
```
|
|
927
957
|
var destination = 'MAAAAAAAAAAAAAB7BQ2L7E5NBWMXDUCMZSIPOBKRDSBYVLMXGSSKF6YNPIB7Y77ITLVL6';
|
|
928
958
|
var amount = '1000.0000000';
|
|
@@ -947,6 +977,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
947
977
|
This version brings protocol 13 support with backwards compatibility support for protocol 12.
|
|
948
978
|
|
|
949
979
|
### Add
|
|
980
|
+
|
|
950
981
|
- Add `TransactionBuilder.buildFeeBumpTransaction` which makes it easy to create `FeeBumpTransaction` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
951
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)).
|
|
952
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)).
|
|
@@ -955,6 +986,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
955
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)).
|
|
956
987
|
|
|
957
988
|
### Update
|
|
989
|
+
|
|
958
990
|
- Update XDR definitions with protocol 13 ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
959
991
|
- Extend `Transaction` to work with `TransactionV1Envelope` and `TransactionV0Envelope` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
960
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)).
|
|
@@ -963,12 +995,12 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
963
995
|
|
|
964
996
|
- `Transaction.toEnvelope()` returns a protocol 13 `xdr.TransactionEnvelope` which is an `xdr.Union` ([#317](https://github.com/stellar/js-stellar-base/pull/317)).
|
|
965
997
|
If you have code that looks like this `transaction.toEnvelope().tx` you have two options:
|
|
966
|
-
|
|
967
|
-
|
|
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()`.
|
|
968
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)).
|
|
969
1001
|
- The const `BASE_FEE` changed from `number` to `string` ([#321](https://github.com/stellar/js-stellar-base/pull/321)).
|
|
970
|
-
- The option `fee` passed to
|
|
971
|
-
- 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)):
|
|
972
1004
|
- `PaymentOp.destination`
|
|
973
1005
|
- `PathPaymentStrictReceiveOp.destination`
|
|
974
1006
|
- `PathPaymentStrictSendOp.destination`
|
|
@@ -978,6 +1010,7 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
978
1010
|
- `FeeBumpTransaction.feeSource`
|
|
979
1011
|
|
|
980
1012
|
You can get the string representation by calling `StrKey.encodeMuxedAccount` which will return a `G..` or `M..` account.
|
|
1013
|
+
|
|
981
1014
|
- Remove the following deprecated functions ([#331](https://github.com/stellar/js-stellar-base/pull/331)):
|
|
982
1015
|
- `Operation.manageOffer`
|
|
983
1016
|
- `Operation.createPassiveOffer`
|
|
@@ -986,46 +1019,54 @@ This version brings protocol 13 support with backwards compatibility support for
|
|
|
986
1019
|
- Remove the `Network` class ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
|
|
987
1020
|
- Remove `vendor/base58.js` ([#331](https://github.com/stellar/js-stellar-base/pull/331)).
|
|
988
1021
|
|
|
989
|
-
|
|
990
1022
|
## [v2.1.9](https://github.com/stellar/js-stellar-base/compare/v2.1.8..v2.1.9)
|
|
991
1023
|
|
|
992
1024
|
### Fix
|
|
1025
|
+
|
|
993
1026
|
- Update dependencies which depend on minimist. ([#332](https://github.com/stellar/js-stellar-base/pull/332))
|
|
994
1027
|
|
|
995
1028
|
## [v2.1.8](https://github.com/stellar/js-stellar-base/compare/v2.1.7..v2.1.8)
|
|
996
1029
|
|
|
997
1030
|
### Fix
|
|
1031
|
+
|
|
998
1032
|
- Fix `setTimeout(0)` and partially defined timebounds ([#315](https://github.com/stellar/js-stellar-base/pull/315)).
|
|
999
1033
|
|
|
1000
1034
|
## [v2.1.7](https://github.com/stellar/js-stellar-base/compare/v2.1.6..v2.1.7)
|
|
1001
1035
|
|
|
1002
1036
|
### Fix
|
|
1037
|
+
|
|
1003
1038
|
- Fix TypeScript options for `ManageData` operation to allow setting value to `null` ([#310](https://github.com/stellar/js-stellar-base/issues/310))
|
|
1004
1039
|
- Fix crash on partially defined time bounds ([#303](https://github.com/stellar/js-stellar-base/issues/303))
|
|
1005
1040
|
|
|
1006
1041
|
## [v2.1.6](https://github.com/stellar/js-stellar-base/compare/v2.1.5..v2.1.6)
|
|
1007
1042
|
|
|
1008
1043
|
### Fix
|
|
1044
|
+
|
|
1009
1045
|
- Fix npm deployment.
|
|
1010
1046
|
|
|
1011
1047
|
## [v2.1.5](https://github.com/stellar/js-stellar-base/compare/v2.1.4..v2.1.5)
|
|
1012
1048
|
|
|
1013
1049
|
### Add
|
|
1050
|
+
|
|
1014
1051
|
- Add `toXDR` type to Transaction class ([#296](https://github.com/stellar/js-stellar-base/issues/296))
|
|
1015
1052
|
|
|
1016
1053
|
### Fix
|
|
1054
|
+
|
|
1017
1055
|
- Fix doc link ([#298](https://github.com/stellar/js-stellar-base/issues/298))
|
|
1018
1056
|
|
|
1019
1057
|
### Remove
|
|
1058
|
+
|
|
1020
1059
|
- Remove node engine restriction ([#294](https://github.com/stellar/js-stellar-base/issues/294))
|
|
1021
1060
|
|
|
1022
1061
|
### Update
|
|
1062
|
+
|
|
1023
1063
|
- Update creating an account example ([#299](https://github.com/stellar/js-stellar-base/issues/299))
|
|
1024
1064
|
- Use `console.trace` to get line num in `Networks.use` ([#300](https://github.com/stellar/js-stellar-base/issues/300))
|
|
1025
1065
|
|
|
1026
1066
|
## [v2.1.4](https://github.com/stellar/js-stellar-base/compare/v2.1.3..v2.1.4)
|
|
1027
1067
|
|
|
1028
1068
|
## Update
|
|
1069
|
+
|
|
1029
1070
|
- Regenerate the XDR definitions to include MetaV2 ([#288](https://github.com/stellar/js-stellar-base/issues/288))
|
|
1030
1071
|
|
|
1031
1072
|
## [v2.1.3](https://github.com/stellar/js-stellar-base/compare/v2.1.2...v2.1.3)
|
|
@@ -1056,76 +1097,77 @@ This release adds support for [stellar-core protocol 12 release](https://github.
|
|
|
1056
1097
|
|
|
1057
1098
|
### Add ➕
|
|
1058
1099
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
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
|
-
|
|
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
|
+
```
|
|
1129
1171
|
|
|
1130
1172
|
## Deprecated ❗️
|
|
1131
1173
|
|
|
@@ -1134,6 +1176,7 @@ This release adds support for [stellar-core protocol 12 release](https://github.
|
|
|
1134
1176
|
## [v2.0.2](https://github.com/stellar/js-stellar-base/compare/v2.0.1...v2.0.2)
|
|
1135
1177
|
|
|
1136
1178
|
### Fix
|
|
1179
|
+
|
|
1137
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)).
|
|
1138
1181
|
|
|
1139
1182
|
## [v2.0.1](https://github.com/stellar/js-stellar-base/compare/v2.0.0...v2.0.1)
|
|
@@ -1149,11 +1192,13 @@ No changes. Fixes deploy script and includes changes from [v2.0.0](https://githu
|
|
|
1149
1192
|
## [v1.1.2](https://github.com/stellar/js-stellar-base/compare/v1.1.1...v1.1.2)
|
|
1150
1193
|
|
|
1151
1194
|
### Fix
|
|
1195
|
+
|
|
1152
1196
|
- Fix no-network warnings ([#248](https://github.com/stellar/js-stellar-base/issues/248))
|
|
1153
1197
|
|
|
1154
1198
|
## [v1.1.1](https://github.com/stellar/js-stellar-base/compare/v1.1.0...v1.1.1)
|
|
1155
1199
|
|
|
1156
1200
|
### Fix
|
|
1201
|
+
|
|
1157
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))
|
|
1158
1203
|
|
|
1159
1204
|
## [v1.1.0](https://github.com/stellar/js-stellar-base/compare/v1.0.3...v1.1.0)
|
|
@@ -1167,7 +1212,7 @@ is not passed:
|
|
|
1167
1212
|
#### `Keypair.master`
|
|
1168
1213
|
|
|
1169
1214
|
```js
|
|
1170
|
-
Keypair.master(Networks.TESTNET)
|
|
1215
|
+
Keypair.master(Networks.TESTNET);
|
|
1171
1216
|
```
|
|
1172
1217
|
|
|
1173
1218
|
#### constructor for `Transaction`
|
|
@@ -1177,13 +1222,13 @@ const xenv = new xdr.TransactionEnvelope({ tx: xtx });
|
|
|
1177
1222
|
new Transaction(xenv, Networks.TESTNET);
|
|
1178
1223
|
```
|
|
1179
1224
|
|
|
1180
|
-
#### constructor for
|
|
1225
|
+
#### constructor for `TransactionBuilder` and method `TransactionBuilder.setNetworkPassphrase`
|
|
1181
1226
|
|
|
1182
1227
|
```js
|
|
1183
1228
|
const transaction = new StellarSdk.TransactionBuilder(account, {
|
|
1184
1229
|
fee: StellarSdk.BASE_FEE,
|
|
1185
|
-
networkPassphrase: Networks.TESTNET
|
|
1186
|
-
})
|
|
1230
|
+
networkPassphrase: Networks.TESTNET,
|
|
1231
|
+
});
|
|
1187
1232
|
```
|
|
1188
1233
|
|
|
1189
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.
|
|
@@ -1191,9 +1236,11 @@ See [#207](https://github.com/stellar/js-stellar-base/issues/207) and [#112](htt
|
|
|
1191
1236
|
The `Network` class will be removed on the `2.0` release.
|
|
1192
1237
|
|
|
1193
1238
|
### Add
|
|
1239
|
+
|
|
1194
1240
|
- Add docs for BASE_FEE const. ([#211](https://github.com/stellar/js-stellar-base/issues/211))
|
|
1195
1241
|
|
|
1196
1242
|
### Fix
|
|
1243
|
+
|
|
1197
1244
|
- Fix typo. ([#213](https://github.com/stellar/js-stellar-base/issues/213))
|
|
1198
1245
|
|
|
1199
1246
|
## [v1.0.3](https://github.com/stellar/js-stellar-base/compare/v1.0.2...v1.0.3)
|
|
@@ -1205,6 +1252,7 @@ The `Network` class will be removed on the `2.0` release.
|
|
|
1205
1252
|
- Add BASE_FEE to TS types ([#209](https://github.com/stellar/js-stellar-base/issues/209))
|
|
1206
1253
|
|
|
1207
1254
|
### Fix
|
|
1255
|
+
|
|
1208
1256
|
- Fix typo in types ([#194](https://github.com/stellar/js-stellar-base/issues/194))
|
|
1209
1257
|
- Fix types: Fee is no longer optional ([#195](https://github.com/stellar/js-stellar-base/issues/195))
|
|
1210
1258
|
- Fix typings for Account Sequence Number ([#203](https://github.com/stellar/js-stellar-base/issues/203))
|