@stellar/stellar-sdk 11.0.0 → 11.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 (36) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +21 -33
  3. package/dist/stellar-sdk.js +757 -255
  4. package/dist/stellar-sdk.min.js +1 -1
  5. package/lib/config.js +2 -2
  6. package/lib/contract_spec.d.ts +22 -1
  7. package/lib/contract_spec.js +684 -187
  8. package/lib/errors.js +2 -2
  9. package/lib/federation/server.js +2 -2
  10. package/lib/horizon/account_call_builder.js +2 -2
  11. package/lib/horizon/account_response.js +2 -2
  12. package/lib/horizon/assets_call_builder.js +2 -2
  13. package/lib/horizon/call_builder.js +2 -2
  14. package/lib/horizon/claimable_balances_call_builder.js +2 -2
  15. package/lib/horizon/effect_call_builder.js +2 -2
  16. package/lib/horizon/friendbot_builder.js +2 -2
  17. package/lib/horizon/ledger_call_builder.js +2 -2
  18. package/lib/horizon/liquidity_pool_call_builder.js +2 -2
  19. package/lib/horizon/offer_call_builder.js +2 -2
  20. package/lib/horizon/operation_call_builder.js +2 -2
  21. package/lib/horizon/orderbook_call_builder.js +2 -2
  22. package/lib/horizon/path_call_builder.js +2 -2
  23. package/lib/horizon/payment_call_builder.js +2 -2
  24. package/lib/horizon/server.js +2 -2
  25. package/lib/horizon/strict_receive_path_call_builder.js +2 -2
  26. package/lib/horizon/strict_send_path_call_builder.js +2 -2
  27. package/lib/horizon/trade_aggregation_call_builder.js +2 -2
  28. package/lib/horizon/trades_call_builder.js +2 -2
  29. package/lib/horizon/transaction_call_builder.js +2 -2
  30. package/lib/soroban/parsers.js +2 -2
  31. package/lib/soroban/server.d.ts +7 -3
  32. package/lib/soroban/server.js +19 -13
  33. package/lib/stellartoml/index.js +2 -2
  34. package/lib/utils.js +2 -2
  35. package/lib/webauth/errors.js +2 -2
  36. package/package.json +11 -9
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  A breaking change will get clearly marked in this log.
4
4
 
5
5
 
6
+ ## Unreleased
7
+
8
+
9
+ ## [v11.1.0](https://github.com/stellar/js-stellar-sdk/compare/v11.0.1...v11.1.0)
10
+
11
+ ### Added
12
+ * `SorobanRpc.Server.simulateTransaction` now supports an optional `addlResources` parameter to allow users to specify additional resources that they want to include in a simulation ([#896](https://github.com/stellar/js-stellar-sdk/pull/896)).
13
+ * `ContractSpec` now has a `jsonSchema()` method to generate a [JSON Schema](https://json-schema.org/) for a particular contract specification ([#889](https://github.com/stellar/js-stellar-sdk/pull/889)).
14
+
15
+ ### Fixed
16
+ * All dependencies have been updated to their latest versions, including `stellar-base` to [v10.0.1](https://github.com/stellar/js-stellar-base/releases/tag/v10.0.1) which included a small patch ([#897](https://github.com/stellar/js-stellar-sdk/pull/897)).
17
+
18
+
19
+ ## [v11.0.1](https://github.com/stellar/js-stellar-sdk/compare/v10.2.1...v11.0.0)
20
+
21
+ ### Fixed
22
+ * `SorobanRpc.Server.getEvents` uses the correct type for the start ledger.
23
+
24
+
6
25
  ## [v11.0.0](https://github.com/stellar/js-stellar-sdk/compare/v10.2.1...v11.0.0)
7
26
 
8
27
  ### Breaking Changes
package/README.md CHANGED
@@ -13,22 +13,20 @@
13
13
  <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>
14
14
  </p>
15
15
 
16
- js-stellar-sdk is a Javascript library for communicating with a
17
- [Stellar Horizon server](https://github.com/stellar/go/tree/master/services/horizon).
16
+ js-stellar-sdk is a JavaScript library for communicating with a
17
+ [Stellar Horizon server](https://github.com/stellar/go/tree/master/services/horizon) and [Soroban RPC](https://soroban.stellar.org/docs/reference/rpc).
18
18
  It is used for building Stellar apps either on Node.js or in the browser.
19
19
 
20
20
  It provides:
21
21
 
22
- - a networking layer API for Horizon endpoints.
22
+ - a networking layer API for Horizon endpoints (REST-based) and Soroban RPC (JSON-RPC-based).
23
23
  - facilities for building and signing transactions, for communicating with a
24
24
  Stellar Horizon instance, and for submitting transactions or querying network
25
25
  history.
26
26
 
27
27
  ### stellar-sdk vs stellar-base
28
28
 
29
- stellar-sdk is a high-level library that serves as client-side API for Horizon.
30
- [stellar-base](https://github.com/stellar/js-stellar-base) is lower-level
31
- library for creating Stellar primitive constructs via XDR helpers and wrappers.
29
+ `stellar-sdk` is a high-level library that serves as client-side API for Horizon and Soroban RPC, while [stellar-base](https://github.com/stellar/js-stellar-base) is lower-level library for creating Stellar primitive constructs via XDR helpers and wrappers.
32
30
 
33
31
  **Most people will want stellar-sdk instead of stellar-base.** You should only
34
32
  use stellar-base if you know what you're doing!
@@ -55,7 +53,7 @@ installs `stellar-base` and exposes all of its exports in case you need them.
55
53
  Using npm to include js-stellar-sdk in your own project:
56
54
 
57
55
  ```shell
58
- npm install --save stellar-sdk
56
+ npm install --save @stellar/stellar-sdk
59
57
  ```
60
58
 
61
59
  Alternatively, you can use cdnjs in a browser:
@@ -77,7 +75,9 @@ npm install --save stellar-sdk
77
75
  2. require/import it in your JavaScript:
78
76
 
79
77
  ```js
80
- var StellarSdk = require('stellar-sdk');
78
+ var StellarSdk = require('@stellar/stellar-sdk');
79
+ // or
80
+ import * as StellarSdk from '@stellar/stellar-sdk';
81
81
  ```
82
82
 
83
83
  ### To self host for use in the browser
@@ -85,7 +85,7 @@ var StellarSdk = require('stellar-sdk');
85
85
  1. Install it using [bower](http://bower.io):
86
86
 
87
87
  ```shell
88
- bower install stellar-sdk
88
+ bower install @stellar/stellar-sdk
89
89
  ```
90
90
 
91
91
  2. Include it in the browser:
@@ -131,12 +131,12 @@ git clone https://github.com/stellar/js-stellar-sdk.git
131
131
 
132
132
  ```shell
133
133
  cd js-stellar-sdk
134
- npm install
134
+ yarn
135
135
  ```
136
136
 
137
- 3. Install Node 16
137
+ 3. Install Node 18
138
138
 
139
- Because we support the oldest maintenance version of Node, please install and develop on Node 16 so you don't get surprised when your code works locally but breaks in CI.
139
+ Because we support the oldest maintenance version of Node, please install and develop on Node 18 so you don't get surprised when your code works locally but breaks in CI.
140
140
 
141
141
  Here's how to install `nvm` if you haven't: https://github.com/creationix/nvm
142
142
 
@@ -153,11 +153,11 @@ https://github.com/wbyoung/avn
153
153
 
154
154
  4. Observe the project's code style
155
155
 
156
- While you're making changes, make sure to run the linter-watcher to catch any
157
- linting errors (in addition to making sure your text editor supports ESLint)
156
+ While you're making changes, make sure to run the linter to catch any linting
157
+ errors (in addition to making sure your text editor supports ESLint)
158
158
 
159
159
  ```shell
160
- node_modules/.bin/gulp watch
160
+ yarn fmt
161
161
  ```
162
162
 
163
163
 
@@ -168,7 +168,7 @@ documentation](https://stellar.github.io/js-stellar-sdk/), or [the
168
168
  examples](https://github.com/stellar/js-stellar-sdk/tree/master/docs/reference).
169
169
 
170
170
  There is also Horizon REST API Documentation
171
- [here](https://developers.stellar.org/api/introduction/).
171
+ [here](https://developers.stellar.org/api/introduction/) and Soroban JSON-RPC documentation [here](https://soroban.stellar.org/docs/reference/rpc).
172
172
 
173
173
  ### Usage with React-Native
174
174
 
@@ -188,7 +188,7 @@ module.exports = {
188
188
  };
189
189
  ```
190
190
  6. Add `import "./shim";` to the top of `index.js`
191
- 7. `yarn add stellar-sdk`
191
+ 7. `yarn add @stellar/stellar-sdk`
192
192
 
193
193
  There is also a [sample](https://github.com/fnando/rn-stellar-sdk-sample) that you can follow.
194
194
 
@@ -200,14 +200,14 @@ There is also a [sample](https://github.com/fnando/rn-stellar-sdk-sample) that y
200
200
  yarn rn-nodeify --install process,url,events,https,http,util,stream,crypto,vm,buffer --hack --yarn
201
201
  ```
202
202
  3. Add `import "./shim";` to the your app's entry point (by default `./App.js`)
203
- 4. `yarn add stellar-sdk`
203
+ 4. `yarn add @stellar/stellar-sdk`
204
204
  5. `expo install expo-random`
205
205
 
206
206
  At this point, the Stellar SDK will work, except that `StellarSdk.Keypair.random()` will throw an error. To work around this, you can create your own method to generate a random keypair like this:
207
207
 
208
208
  ```javascript
209
209
  import * as Random from 'expo-random';
210
- import StellarSdk from 'stellar-sdk';
210
+ import StellarSdk from '@stellar/stellar-sdk';
211
211
 
212
212
  const generateRandomKeypair = () => {
213
213
  const randomBytes = Random.getRandomBytes(32);
@@ -251,21 +251,9 @@ cd jsdoc && serve .
251
251
  Documentation for this repo lives in
252
252
  [Developers site](https://github.com/stellar/js-stellar-sdk/blob/master/docs/reference/readme.md).
253
253
 
254
- ## Contributing
255
-
256
- For information on how to contribute, please refer to our
257
- [contribution guide](https://github.com/stellar/js-stellar-sdk/blob/master/CONTRIBUTING.md).
258
-
259
- ## Publishing to npm
260
-
261
- ```
262
- npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
263
- ```
264
-
265
- A new version will be published to npm **and** Bower by GitHub actions.
254
+ ## Contributing and Publishing
266
255
 
267
- npm >= 2.13.0 required. Read more about
268
- [npm version](https://docs.npmjs.com/cli/version).
256
+ For information on how to contribute or publish new versions of this software to `npm`, please refer to our [contribution guide](https://github.com/stellar/js-stellar-sdk/blob/master/CONTRIBUTING.md).
269
257
 
270
258
  ## License
271
259