@stellar/stellar-sdk 14.1.1 → 14.3.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 (171) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +14 -20
  3. package/dist/stellar-sdk-minimal.js +532 -375
  4. package/dist/stellar-sdk-minimal.min.js +1 -1
  5. package/dist/stellar-sdk-no-axios.js +532 -375
  6. package/dist/stellar-sdk-no-axios.min.js +1 -1
  7. package/dist/stellar-sdk-no-eventsource.js +781 -551
  8. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  9. package/dist/stellar-sdk.js +781 -551
  10. package/dist/stellar-sdk.min.js +1 -1
  11. package/lib/contract/client.js +2 -2
  12. package/lib/contract/spec.js +10 -2
  13. package/lib/contract/utils.js +7 -7
  14. package/lib/errors/account_requires_memo.d.ts +0 -1
  15. package/lib/errors/account_requires_memo.js +0 -4
  16. package/lib/errors/bad_request.d.ts +0 -1
  17. package/lib/errors/bad_request.js +2 -8
  18. package/lib/errors/bad_response.d.ts +0 -1
  19. package/lib/errors/bad_response.js +2 -8
  20. package/lib/errors/network.d.ts +0 -1
  21. package/lib/errors/network.js +0 -3
  22. package/lib/errors/not_found.d.ts +0 -1
  23. package/lib/errors/not_found.js +2 -8
  24. package/lib/federation/index.d.ts +2 -2
  25. package/lib/horizon/call_builder.js +1 -1
  26. package/lib/horizon/horizon_api.js +0 -1
  27. package/lib/horizon/horizon_axios_client.js +4 -4
  28. package/lib/horizon/index.d.ts +1 -1
  29. package/lib/horizon/types/effects.d.ts +41 -41
  30. package/lib/horizon/types/trade.d.ts +1 -1
  31. package/lib/http-client/fetch-client.d.ts +2 -2
  32. package/lib/http-client/fetch-client.js +16 -16
  33. package/lib/http-client/index.js +2 -2
  34. package/lib/http-client/types.d.ts +2 -2
  35. package/lib/index.d.ts +11 -11
  36. package/lib/index.js +2 -2
  37. package/lib/minimal/contract/client.js +2 -2
  38. package/lib/minimal/contract/spec.js +10 -2
  39. package/lib/minimal/contract/utils.js +7 -7
  40. package/lib/minimal/errors/account_requires_memo.d.ts +0 -1
  41. package/lib/minimal/errors/account_requires_memo.js +0 -4
  42. package/lib/minimal/errors/bad_request.d.ts +0 -1
  43. package/lib/minimal/errors/bad_request.js +2 -8
  44. package/lib/minimal/errors/bad_response.d.ts +0 -1
  45. package/lib/minimal/errors/bad_response.js +2 -8
  46. package/lib/minimal/errors/network.d.ts +0 -1
  47. package/lib/minimal/errors/network.js +0 -3
  48. package/lib/minimal/errors/not_found.d.ts +0 -1
  49. package/lib/minimal/errors/not_found.js +2 -8
  50. package/lib/minimal/federation/index.d.ts +2 -2
  51. package/lib/minimal/horizon/call_builder.js +1 -1
  52. package/lib/minimal/horizon/horizon_api.js +0 -1
  53. package/lib/minimal/horizon/horizon_axios_client.js +4 -4
  54. package/lib/minimal/horizon/index.d.ts +1 -1
  55. package/lib/minimal/horizon/types/effects.d.ts +41 -41
  56. package/lib/minimal/horizon/types/trade.d.ts +1 -1
  57. package/lib/minimal/http-client/fetch-client.d.ts +2 -2
  58. package/lib/minimal/http-client/fetch-client.js +16 -16
  59. package/lib/minimal/http-client/index.js +2 -2
  60. package/lib/minimal/http-client/types.d.ts +2 -2
  61. package/lib/minimal/index.d.ts +11 -11
  62. package/lib/minimal/index.js +2 -2
  63. package/lib/minimal/rpc/api.d.ts +148 -8
  64. package/lib/minimal/rpc/api.js +3 -3
  65. package/lib/minimal/rpc/axios.js +3 -3
  66. package/lib/minimal/rpc/browser.d.ts +2 -2
  67. package/lib/minimal/rpc/index.d.ts +1 -1
  68. package/lib/minimal/rpc/parsers.d.ts +3 -2
  69. package/lib/minimal/rpc/parsers.js +42 -19
  70. package/lib/minimal/rpc/server.d.ts +123 -31
  71. package/lib/minimal/rpc/server.js +425 -267
  72. package/lib/minimal/rpc/transaction.d.ts +2 -2
  73. package/lib/minimal/rpc/transaction.js +6 -6
  74. package/lib/minimal/webauth/errors.d.ts +0 -2
  75. package/lib/minimal/webauth/errors.js +2 -8
  76. package/lib/minimal/webauth/index.d.ts +2 -2
  77. package/lib/no-axios/contract/client.js +2 -2
  78. package/lib/no-axios/contract/spec.js +10 -2
  79. package/lib/no-axios/contract/utils.js +7 -7
  80. package/lib/no-axios/errors/account_requires_memo.d.ts +0 -1
  81. package/lib/no-axios/errors/account_requires_memo.js +0 -4
  82. package/lib/no-axios/errors/bad_request.d.ts +0 -1
  83. package/lib/no-axios/errors/bad_request.js +2 -8
  84. package/lib/no-axios/errors/bad_response.d.ts +0 -1
  85. package/lib/no-axios/errors/bad_response.js +2 -8
  86. package/lib/no-axios/errors/network.d.ts +0 -1
  87. package/lib/no-axios/errors/network.js +0 -3
  88. package/lib/no-axios/errors/not_found.d.ts +0 -1
  89. package/lib/no-axios/errors/not_found.js +2 -8
  90. package/lib/no-axios/federation/index.d.ts +2 -2
  91. package/lib/no-axios/horizon/call_builder.js +1 -1
  92. package/lib/no-axios/horizon/horizon_api.js +0 -1
  93. package/lib/no-axios/horizon/horizon_axios_client.js +4 -4
  94. package/lib/no-axios/horizon/index.d.ts +1 -1
  95. package/lib/no-axios/horizon/types/effects.d.ts +41 -41
  96. package/lib/no-axios/horizon/types/trade.d.ts +1 -1
  97. package/lib/no-axios/http-client/fetch-client.d.ts +2 -2
  98. package/lib/no-axios/http-client/fetch-client.js +16 -16
  99. package/lib/no-axios/http-client/index.js +2 -2
  100. package/lib/no-axios/http-client/types.d.ts +2 -2
  101. package/lib/no-axios/index.d.ts +11 -11
  102. package/lib/no-axios/index.js +2 -2
  103. package/lib/no-axios/rpc/api.d.ts +148 -8
  104. package/lib/no-axios/rpc/api.js +3 -3
  105. package/lib/no-axios/rpc/axios.js +3 -3
  106. package/lib/no-axios/rpc/browser.d.ts +2 -2
  107. package/lib/no-axios/rpc/index.d.ts +1 -1
  108. package/lib/no-axios/rpc/parsers.d.ts +3 -2
  109. package/lib/no-axios/rpc/parsers.js +42 -19
  110. package/lib/no-axios/rpc/server.d.ts +123 -31
  111. package/lib/no-axios/rpc/server.js +425 -267
  112. package/lib/no-axios/rpc/transaction.d.ts +2 -2
  113. package/lib/no-axios/rpc/transaction.js +6 -6
  114. package/lib/no-axios/webauth/errors.d.ts +0 -2
  115. package/lib/no-axios/webauth/errors.js +2 -8
  116. package/lib/no-axios/webauth/index.d.ts +2 -2
  117. package/lib/no-eventsource/contract/client.js +2 -2
  118. package/lib/no-eventsource/contract/spec.js +10 -2
  119. package/lib/no-eventsource/contract/utils.js +7 -7
  120. package/lib/no-eventsource/errors/account_requires_memo.d.ts +0 -1
  121. package/lib/no-eventsource/errors/account_requires_memo.js +0 -4
  122. package/lib/no-eventsource/errors/bad_request.d.ts +0 -1
  123. package/lib/no-eventsource/errors/bad_request.js +2 -8
  124. package/lib/no-eventsource/errors/bad_response.d.ts +0 -1
  125. package/lib/no-eventsource/errors/bad_response.js +2 -8
  126. package/lib/no-eventsource/errors/network.d.ts +0 -1
  127. package/lib/no-eventsource/errors/network.js +0 -3
  128. package/lib/no-eventsource/errors/not_found.d.ts +0 -1
  129. package/lib/no-eventsource/errors/not_found.js +2 -8
  130. package/lib/no-eventsource/federation/index.d.ts +2 -2
  131. package/lib/no-eventsource/horizon/call_builder.js +1 -1
  132. package/lib/no-eventsource/horizon/horizon_api.js +0 -1
  133. package/lib/no-eventsource/horizon/horizon_axios_client.js +4 -4
  134. package/lib/no-eventsource/horizon/index.d.ts +1 -1
  135. package/lib/no-eventsource/horizon/types/effects.d.ts +41 -41
  136. package/lib/no-eventsource/horizon/types/trade.d.ts +1 -1
  137. package/lib/no-eventsource/http-client/fetch-client.d.ts +2 -2
  138. package/lib/no-eventsource/http-client/fetch-client.js +16 -16
  139. package/lib/no-eventsource/http-client/index.js +2 -2
  140. package/lib/no-eventsource/http-client/types.d.ts +2 -2
  141. package/lib/no-eventsource/index.d.ts +11 -11
  142. package/lib/no-eventsource/index.js +2 -2
  143. package/lib/no-eventsource/rpc/api.d.ts +148 -8
  144. package/lib/no-eventsource/rpc/api.js +3 -3
  145. package/lib/no-eventsource/rpc/axios.js +3 -3
  146. package/lib/no-eventsource/rpc/browser.d.ts +2 -2
  147. package/lib/no-eventsource/rpc/index.d.ts +1 -1
  148. package/lib/no-eventsource/rpc/parsers.d.ts +3 -2
  149. package/lib/no-eventsource/rpc/parsers.js +42 -19
  150. package/lib/no-eventsource/rpc/server.d.ts +123 -31
  151. package/lib/no-eventsource/rpc/server.js +425 -267
  152. package/lib/no-eventsource/rpc/transaction.d.ts +2 -2
  153. package/lib/no-eventsource/rpc/transaction.js +6 -6
  154. package/lib/no-eventsource/webauth/errors.d.ts +0 -2
  155. package/lib/no-eventsource/webauth/errors.js +2 -8
  156. package/lib/no-eventsource/webauth/index.d.ts +2 -2
  157. package/lib/rpc/api.d.ts +148 -8
  158. package/lib/rpc/api.js +3 -3
  159. package/lib/rpc/axios.js +3 -3
  160. package/lib/rpc/browser.d.ts +2 -2
  161. package/lib/rpc/index.d.ts +1 -1
  162. package/lib/rpc/parsers.d.ts +3 -2
  163. package/lib/rpc/parsers.js +42 -19
  164. package/lib/rpc/server.d.ts +123 -31
  165. package/lib/rpc/server.js +425 -267
  166. package/lib/rpc/transaction.d.ts +2 -2
  167. package/lib/rpc/transaction.js +6 -6
  168. package/lib/webauth/errors.d.ts +0 -2
  169. package/lib/webauth/errors.js +2 -8
  170. package/lib/webauth/index.d.ts +2 -2
  171. package/package.json +17 -9
package/CHANGELOG.md CHANGED
@@ -7,6 +7,29 @@ A breaking change will get clearly marked in this log.
7
7
  ## Unreleased
8
8
 
9
9
 
10
+ ## [v14.3.0](https://github.com/stellar/js-stellar-sdk/compare/v14.2.0...v14.3.0)
11
+
12
+ ### Added
13
+ * `Spec.scValToNative` now supports parsing `Option`s ([#1228](https://github.com/stellar/js-stellar-sdk/pull/1228)).
14
+ * Added `getLedgers` method to `rpc.Server` for retreiving ledger data. ([#1231](https://github.com/stellar/js-stellar-sdk/pull/1231)).
15
+
16
+ ### Fixed
17
+ * `Spec.scValToNative` returns `null` for `void`s or `Option`als instead of the ambiguous `undefined` ([#1228](https://github.com/stellar/js-stellar-sdk/pull/1228)).
18
+ * The `getEvents` API now requires either a start and end ledger or a cursor to be provided ([#1231](https://github.com/stellar/js-stellar-sdk/pull/1231)).
19
+
20
+ ### Deprecated
21
+ * `GetEventsRequest` interface moved from `server.ts` to `api.ts` ([#1231](https://github.com/stellar/js-stellar-sdk/pull/1231)).
22
+
23
+ ## [v14.2.0](https://github.com/stellar/js-stellar-sdk/compare/v14.1.1...v14.2.0)
24
+
25
+ ### Added
26
+ * `rpc.Server` now includes `getAccountEntry`, `getTrustlineEntry`, and `getClaimableBalance` methods to facilitate retrieving those entries without manually constructing the ledger keys ([#1218](https://github.com/stellar/js-stellar-sdk/pull/1218), [#1221](https://github.com/stellar/js-stellar-sdk/pull/1221)).
27
+
28
+ ### Fixed
29
+ * The `getTransactions` API no longer requires `startLedger` when providing `cursor` because they are mutually exclusive ([#1192](https://github.com/stellar/js-stellar-sdk/pull/1192)).
30
+ * Updated `@stellar/stellar-base` to latest patch (see its [release notes](https://github.com/stellar/js-stellar-base/releases/tag/v14.0.1), [#1221](https://github.com/stellar/js-stellar-sdk/pull/1221)).
31
+
32
+
10
33
  ## [v14.1.1](https://github.com/stellar/js-stellar-sdk/compare/v14.1.0...v14.1.1)
11
34
 
12
35
  ### Fixed
package/README.md CHANGED
@@ -1,24 +1,18 @@
1
+ # Stellar JS SDK (js-stellar-sdk)
1
2
 
2
- <div align="center">
3
- <img alt="Stellar" src="https://github.com/stellar/.github/raw/master/stellar-logo.png" width="558" />
4
- <br/>
5
- <strong>Creating equitable access to the global financial system</strong>
6
- <h1>js-stellar-sdk</h1>
7
- </div>
8
-
9
- <p align="center">
10
- <a href="https://badge.fury.io/js/@stellar%2Fstellar-sdk"><img src="https://badge.fury.io/js/@stellar%2Fstellar-sdk.svg" alt="npm version" height="18"></a>
11
- <a href="https://www.npmjs.com/package/@stellar/stellar-sdk">
12
- <img alt="Weekly Downloads" src="https://img.shields.io/npm/dw/@stellar/stellar-sdk" />
13
- </a>
14
- <a href="https://github.com/stellar/js-stellar-sdk/actions/workflows/tests.yml"><img alt="Test Status" src="https://github.com/stellar/js-stellar-sdk/actions/workflows/tests.yml/badge.svg" /></a>
15
- </p>
16
-
17
- js-stellar-sdk is a JavaScript library for communicating with a
18
- [Stellar Horizon server](https://github.com/stellar/go/tree/master/services/horizon) and [Soroban RPC](https://developers.stellar.org/docs/data/rpc).
19
- It is used for building Stellar apps either on Node.js or in the browser, though it can be used in other environments with some tinkering.
20
-
21
- It provides:
3
+
4
+ <a href="https://badge.fury.io/js/@stellar%2Fstellar-sdk"><img src="https://badge.fury.io/js/@stellar%2Fstellar-sdk.svg" alt="npm version" height="18"></a>
5
+ <a href="https://www.npmjs.com/package/@stellar/stellar-sdk">
6
+ <img alt="Weekly Downloads" src="https://img.shields.io/npm/dw/@stellar/stellar-sdk" />
7
+ </a>
8
+ <a href="https://github.com/stellar/js-stellar-sdk/actions/workflows/tests.yml"><img alt="Test Status" src="https://github.com/stellar/js-stellar-sdk/actions/workflows/tests.yml/badge.svg" /></a>
9
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/stellar/js-stellar-sdk)
10
+
11
+ `js-stellar-sdk` is a JavaScript library for communicating with a
12
+ [Stellar Horizon server](https://developers.stellar.org/docs/data/apis/horizon) and [Stellar RPC](https://developers.stellar.org/docs/data/apis/rpc).
13
+ While primarily intended for applications built on Node.js or in the browser, it can be adapted for use in other environments with some tinkering.
14
+
15
+ The library provides:
22
16
 
23
17
  - a networking layer API for Horizon endpoints (REST-based),
24
18
  - a networking layer for Soroban RPC (JSONRPC-based).