@stellar/stellar-sdk 14.0.0-rc.2 → 14.0.0

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