@stellar/stellar-sdk 14.0.0-rc.3 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +140 -1
  2. package/dist/stellar-sdk-minimal.js +293 -177
  3. package/dist/stellar-sdk-minimal.min.js +1 -1
  4. package/dist/stellar-sdk-no-axios.js +293 -177
  5. package/dist/stellar-sdk-no-axios.min.js +1 -1
  6. package/dist/stellar-sdk-no-eventsource.js +338 -185
  7. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  8. package/dist/stellar-sdk.js +338 -185
  9. package/dist/stellar-sdk.min.js +1 -1
  10. package/lib/contract/assembled_transaction.d.ts +15 -5
  11. package/lib/contract/assembled_transaction.js +25 -26
  12. package/lib/contract/basic_node_signer.js +1 -1
  13. package/lib/contract/client.d.ts +2 -0
  14. package/lib/contract/client.js +18 -48
  15. package/lib/contract/sent_transaction.d.ts +16 -3
  16. package/lib/contract/sent_transaction.js +70 -50
  17. package/lib/contract/spec.d.ts +20 -1
  18. package/lib/contract/spec.js +42 -13
  19. package/lib/contract/utils.d.ts +1 -0
  20. package/lib/contract/utils.js +99 -15
  21. package/lib/federation/server.js +1 -1
  22. package/lib/horizon/account_response.d.ts +3 -0
  23. package/lib/horizon/call_builder.js +1 -1
  24. package/lib/horizon/horizon_api.d.ts +0 -2
  25. package/lib/horizon/horizon_axios_client.js +1 -1
  26. package/lib/horizon/payment_call_builder.d.ts +8 -0
  27. package/lib/horizon/payment_call_builder.js +6 -0
  28. package/lib/horizon/server.js +10 -3
  29. package/lib/minimal/contract/assembled_transaction.d.ts +15 -5
  30. package/lib/minimal/contract/assembled_transaction.js +25 -26
  31. package/lib/minimal/contract/basic_node_signer.js +1 -1
  32. package/lib/minimal/contract/client.d.ts +2 -0
  33. package/lib/minimal/contract/client.js +18 -48
  34. package/lib/minimal/contract/sent_transaction.d.ts +16 -3
  35. package/lib/minimal/contract/sent_transaction.js +70 -50
  36. package/lib/minimal/contract/spec.d.ts +20 -1
  37. package/lib/minimal/contract/spec.js +42 -13
  38. package/lib/minimal/contract/utils.d.ts +1 -0
  39. package/lib/minimal/contract/utils.js +99 -15
  40. package/lib/minimal/federation/server.js +1 -1
  41. package/lib/minimal/horizon/account_response.d.ts +3 -0
  42. package/lib/minimal/horizon/call_builder.js +1 -1
  43. package/lib/minimal/horizon/horizon_api.d.ts +0 -2
  44. package/lib/minimal/horizon/horizon_axios_client.js +1 -1
  45. package/lib/minimal/horizon/payment_call_builder.d.ts +8 -0
  46. package/lib/minimal/horizon/payment_call_builder.js +6 -0
  47. package/lib/minimal/horizon/server.js +10 -3
  48. package/lib/minimal/rpc/api.d.ts +1 -1
  49. package/lib/minimal/rpc/axios.js +1 -1
  50. package/lib/minimal/rpc/jsonrpc.js +1 -1
  51. package/lib/minimal/rpc/server.js +2 -2
  52. package/lib/minimal/stellartoml/index.js +1 -1
  53. package/lib/no-axios/contract/assembled_transaction.d.ts +15 -5
  54. package/lib/no-axios/contract/assembled_transaction.js +25 -26
  55. package/lib/no-axios/contract/basic_node_signer.js +1 -1
  56. package/lib/no-axios/contract/client.d.ts +2 -0
  57. package/lib/no-axios/contract/client.js +18 -48
  58. package/lib/no-axios/contract/sent_transaction.d.ts +16 -3
  59. package/lib/no-axios/contract/sent_transaction.js +70 -50
  60. package/lib/no-axios/contract/spec.d.ts +20 -1
  61. package/lib/no-axios/contract/spec.js +42 -13
  62. package/lib/no-axios/contract/utils.d.ts +1 -0
  63. package/lib/no-axios/contract/utils.js +99 -15
  64. package/lib/no-axios/federation/server.js +1 -1
  65. package/lib/no-axios/horizon/account_response.d.ts +3 -0
  66. package/lib/no-axios/horizon/call_builder.js +1 -1
  67. package/lib/no-axios/horizon/horizon_api.d.ts +0 -2
  68. package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
  69. package/lib/no-axios/horizon/payment_call_builder.d.ts +8 -0
  70. package/lib/no-axios/horizon/payment_call_builder.js +6 -0
  71. package/lib/no-axios/horizon/server.js +10 -3
  72. package/lib/no-axios/rpc/api.d.ts +1 -1
  73. package/lib/no-axios/rpc/axios.js +1 -1
  74. package/lib/no-axios/rpc/jsonrpc.js +1 -1
  75. package/lib/no-axios/rpc/server.js +2 -2
  76. package/lib/no-axios/stellartoml/index.js +1 -1
  77. package/lib/no-eventsource/contract/assembled_transaction.d.ts +15 -5
  78. package/lib/no-eventsource/contract/assembled_transaction.js +25 -26
  79. package/lib/no-eventsource/contract/basic_node_signer.js +1 -1
  80. package/lib/no-eventsource/contract/client.d.ts +2 -0
  81. package/lib/no-eventsource/contract/client.js +18 -48
  82. package/lib/no-eventsource/contract/sent_transaction.d.ts +16 -3
  83. package/lib/no-eventsource/contract/sent_transaction.js +70 -50
  84. package/lib/no-eventsource/contract/spec.d.ts +20 -1
  85. package/lib/no-eventsource/contract/spec.js +42 -13
  86. package/lib/no-eventsource/contract/utils.d.ts +1 -0
  87. package/lib/no-eventsource/contract/utils.js +99 -15
  88. package/lib/no-eventsource/federation/server.js +1 -1
  89. package/lib/no-eventsource/horizon/account_response.d.ts +3 -0
  90. package/lib/no-eventsource/horizon/call_builder.js +1 -1
  91. package/lib/no-eventsource/horizon/horizon_api.d.ts +0 -2
  92. package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
  93. package/lib/no-eventsource/horizon/payment_call_builder.d.ts +8 -0
  94. package/lib/no-eventsource/horizon/payment_call_builder.js +6 -0
  95. package/lib/no-eventsource/horizon/server.js +10 -3
  96. package/lib/no-eventsource/rpc/api.d.ts +1 -1
  97. package/lib/no-eventsource/rpc/axios.js +1 -1
  98. package/lib/no-eventsource/rpc/jsonrpc.js +1 -1
  99. package/lib/no-eventsource/rpc/server.js +2 -2
  100. package/lib/no-eventsource/stellartoml/index.js +1 -1
  101. package/lib/rpc/api.d.ts +1 -1
  102. package/lib/rpc/axios.js +1 -1
  103. package/lib/rpc/jsonrpc.js +1 -1
  104. package/lib/rpc/server.js +2 -2
  105. package/lib/stellartoml/index.js +1 -1
  106. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -3,8 +3,88 @@
3
3
 
4
4
  A breaking change will get clearly marked in this log.
5
5
 
6
+ ## [v14.1.0](https://github.com/stellar/js-stellar-sdk/compare/v14.0.0...v14.1.0)
6
7
 
7
- ## Unreleased
8
+ ### Added
9
+ * Add support to `new contract.Spec(...)` for constructing from a stream of `ScSpecEntry` XDR entries (base64, or binary) ([#1198](https://github.com/stellar/js-stellar-sdk/pull/1198)).
10
+ * Add `contract.Spec.fromWasm(wasmFile)` for extracting contract spec from contract Wasm files. ([#1198](https://github.com/stellar/js-stellar-sdk/pull/1198)).
11
+
12
+ ## [v14.0.0](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v14.0.0)
13
+
14
+ ### Breaking Changes
15
+ * **This package requires Node 20.**
16
+ * XDR has been upgraded to support **Protocol 23**, please refer to the [`@stellar/stellar-base`](https://github.com/stellar/js-stellar-base/releases/tag/v14.0.0-rc.1) release notes for details and other breaking changes.
17
+ * Removes the defunct `destination_muxed_id_type` field for Horizon balance changes ([#1187](https://github.com/stellar/js-stellar-sdk/pull/1187)).
18
+
19
+ ### Added
20
+ * The Horizon API's `BalanceChange` object for operations now optionally has details about muxed information if the invocation involved a muxed destination address:
21
+ ```typescript
22
+ export type MuxedIdType = "uint64" | "string" | "bytes";
23
+ export interface BalanceChange {
24
+ // ...
25
+ destination_muxed_id_type?: MuxedIdType;
26
+ destination_muxed_id?: string;
27
+ }
28
+ ```
29
+ * The RPC server's `getTransaction` and `getTransactions` responses now include a top-level `events` object containing a disjoint breakdown of the events:
30
+ ```typescript
31
+ export interface TransactionEvents {
32
+ transactionEventsXdr: xdr.TransactionEvent[];
33
+ contractEventsXdr: xdr.ContractEvent[][];
34
+ }
35
+ ```
36
+ * The RPC server's `getEvents` now includes retention state information:
37
+ ```typescript
38
+ export interface GetEventsResponse {
39
+ // ...
40
+ oldestLedger: number;
41
+ latestLedgerCloseTime: string;
42
+ oldestLedgerCloseTime: string;
43
+ }
44
+ ```
45
+ * The RPC server's `simulateTransaction` method now includes an optional `authMode` parameter to specify the type of authorization to simulate:
46
+ ```typescript
47
+ export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot";
48
+ ```
49
+ * `AssembledTransaction#signAndSend` now takes a `watcher` argument ([#1174](https://github.com/stellar/js-stellar-sdk/pull/1174)). This `watcher` is an abstract class with two optional methods:
50
+ - `onSubmitted`: called with the return value from the `sendTransaction` call that submits the transaction to the network for processing
51
+ - `onProgress`: called with each return value of `getTransaction` that checks on the ongoing status of the transaction
52
+
53
+ For example, a `watcher` like this:
54
+ ```typescript
55
+ await tx.signAndSend({ watcher: {
56
+ onSubmitted: ({ status, hash, latestLedger }) => {
57
+ console.log({ status, hash, latestLedger });
58
+ },
59
+ onProgress: ({ status, txHash, latestLedger }) => {
60
+ console.log({ status, txHash, latestLedger });
61
+ }
62
+ }});
63
+ ```
64
+
65
+ ...will result in output like:
66
+
67
+ ```
68
+ {
69
+ status: 'PENDING',
70
+ hash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
71
+ latestLedger: 25076
72
+ }
73
+ {
74
+ status: 'NOT_FOUND',
75
+ txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
76
+ latestLedger: 25076
77
+ }
78
+ {
79
+ status: 'SUCCESS',
80
+ txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
81
+ latestLedger: 25077
82
+ }
83
+ ```
84
+
85
+ ### Fixed
86
+ * Fixed type for Horizon streaming endpoints, namely `EventSourceOptions.onmessage` now extends `CollectionPage` ([#1100](https://github.com/stellar/js-stellar-sdk/pull/1100)).
87
+ * Fix the issue of transaction submission failure in a no axios environment ([#1176](https://github.com/stellar/js-stellar-sdk/pull/1176)).
8
88
 
9
89
 
10
90
  ## [v14.0.0-rc.3](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v14.0.0-rc.3)
@@ -66,6 +146,65 @@ export interface GetEventsResponse {
66
146
  ```typescript
67
147
  export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot";
68
148
  ```
149
+ * `AssembledTransaction#signAndSend` now takes a `watcher` argument ([#1174](https://github.com/stellar/js-stellar-sdk/pull/1174)). This `watcher` is an abstract class with two optional methods:
150
+
151
+ - `onSubmitted`: called with the return value from the `sendTransaction` call that submits the transaction to the network for processing
152
+ - `onProgress`: called with each return value of `getTransaction` that checks on the ongoing status of the transaction
153
+
154
+ For example, a `watcher` like this:
155
+
156
+ ```ts
157
+ await tx.signAndSend({ watcher: {
158
+ onSubmitted: ({ status, hash, latestLedger }) => {
159
+ console.log({ status, hash, latestLedger });
160
+ },
161
+ onProgress: ({ status, txHash, latestLedger }) => {
162
+ console.log({ status, txHash, latestLedger });
163
+ }
164
+ }});
165
+ ```
166
+
167
+ ...will result in output like:
168
+
169
+ ```
170
+ {
171
+ status: 'PENDING',
172
+ hash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
173
+ latestLedger: 25076
174
+ }
175
+ {
176
+ status: 'NOT_FOUND',
177
+ txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
178
+ latestLedger: 25076
179
+ }
180
+ {
181
+ status: 'SUCCESS',
182
+ txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021',
183
+ latestLedger: 25077
184
+ }
185
+ ```
186
+
187
+ ### Fixed
188
+ * Fix the issue of transaction submission failure in a no axios environment ([#1176](https://github.com/stellar/js-stellar-sdk/pull/1176)).
189
+
190
+
191
+ ## [v13.3.0](https://github.com/stellar/js-stellar-sdk/compare/v13.2.0...v13.3.0)
192
+
193
+ ### Added
194
+ * Add `includeFailed` to `PaymentCallBuilder` for including failed transactions in calls ([#1168](https://github.com/stellar/js-stellar-sdk/pull/1168)).
195
+
196
+ ### Fixed
197
+ * Ensure that `rpc.Api.GetTransactionsResponse.transactions` is always a valid array ([#1162](https://github.com/stellar/js-stellar-sdk/pull/1162)).
198
+
199
+
200
+ ## [v13.2.0](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v13.2.0)
201
+
202
+ ### Added
203
+ * Support passing in an optional `options.address` to the `contract.Client.deploy` method ([#1158](https://github.com/stellar/js-stellar-sdk/pull/1158)).
204
+
205
+ ### Fixed
206
+ * Extend support for parsing contract specifications in environments that don't have WebAssembly compilers ([#1157](https://github.com/stellar/js-stellar-sdk/pull/1157)).
207
+ * Upgraded `@stellar/stellar-base` dependency to latest version ([#1159](https://github.com/stellar/js-stellar-sdk/pull/1159)).
69
208
 
70
209
 
71
210
  ## [v13.1.0](https://github.com/stellar/js-stellar-sdk/compare/v13.0.0...v13.1.0)