Skip to content

Commit

Permalink
Prepare v11.1.0 for release (#897)
Browse files Browse the repository at this point in the history
* Update basic README documentation to latest changes
* Add changelog entries (incl. ContractSpec work)
* Upgrade all dependencies, incl. stellar-base
* Run linter
  • Loading branch information
Shaptic committed Dec 15, 2023
1 parent 828e355 commit f1358a5
Show file tree
Hide file tree
Showing 6 changed files with 1,302 additions and 1,393 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,8 +5,15 @@ A breaking change will get clearly marked in this log.

## Unreleased


## [v11.1.0](https://github.com/stellar/js-stellar-sdk/compare/v11.0.1...v11.1.0)

### Added
* `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)).
* `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)).

### Fixed
* 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)).


## [v11.0.1](https://github.com/stellar/js-stellar-sdk/compare/v10.2.1...v11.0.0)
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -21,3 +21,5 @@ In fact, you should follow [the steps there](https://github.com/stellar/js-stell
```

- [ ] Finally, run `yarn` so that the dependency is pulled (ensuring its a valid version) and the lockfile is updated with the latest integrity details. You can now commit the change and PR accordingly.

Note that new versions will be published to npm **and** Bower by GitHub Actions.
54 changes: 21 additions & 33 deletions README.md
Expand Up @@ -13,22 +13,20 @@
<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>
</p>

js-stellar-sdk is a Javascript library for communicating with a
[Stellar Horizon server](https://github.com/stellar/go/tree/master/services/horizon).
js-stellar-sdk is a JavaScript library for communicating with a
[Stellar Horizon server](https://github.com/stellar/go/tree/master/services/horizon) and [Soroban RPC](https://soroban.stellar.org/docs/reference/rpc).
It is used for building Stellar apps either on Node.js or in the browser.

It provides:

- a networking layer API for Horizon endpoints.
- a networking layer API for Horizon endpoints (REST-based) and Soroban RPC (JSON-RPC-based).
- facilities for building and signing transactions, for communicating with a
Stellar Horizon instance, and for submitting transactions or querying network
history.

### stellar-sdk vs stellar-base

stellar-sdk is a high-level library that serves as client-side API for Horizon.
[stellar-base](https://github.com/stellar/js-stellar-base) is lower-level
library for creating Stellar primitive constructs via XDR helpers and wrappers.
`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.

**Most people will want stellar-sdk instead of stellar-base.** You should only
use stellar-base if you know what you're doing!
Expand All @@ -55,7 +53,7 @@ installs `stellar-base` and exposes all of its exports in case you need them.
Using npm to include js-stellar-sdk in your own project:

```shell
npm install --save stellar-sdk
npm install --save @stellar/stellar-sdk
```

Alternatively, you can use cdnjs in a browser:
Expand All @@ -77,15 +75,17 @@ npm install --save stellar-sdk
2. require/import it in your JavaScript:

```js
var StellarSdk = require('stellar-sdk');
var StellarSdk = require('@stellar/stellar-sdk');
// or
import * as StellarSdk from '@stellar/stellar-sdk';
```

### To self host for use in the browser

1. Install it using [bower](http://bower.io):

```shell
bower install stellar-sdk
bower install @stellar/stellar-sdk
```

2. Include it in the browser:
Expand Down Expand Up @@ -131,12 +131,12 @@ git clone https://github.com/stellar/js-stellar-sdk.git

```shell
cd js-stellar-sdk
npm install
yarn
```

3. Install Node 16
3. Install Node 18

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.
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.

Here's how to install `nvm` if you haven't: https://github.com/creationix/nvm

Expand All @@ -153,11 +153,11 @@ https://github.com/wbyoung/avn

4. Observe the project's code style

While you're making changes, make sure to run the linter-watcher to catch any
linting errors (in addition to making sure your text editor supports ESLint)
While you're making changes, make sure to run the linter to catch any linting
errors (in addition to making sure your text editor supports ESLint)

```shell
node_modules/.bin/gulp watch
yarn fmt
```


Expand All @@ -168,7 +168,7 @@ documentation](https://stellar.github.io/js-stellar-sdk/), or [the
examples](https://github.com/stellar/js-stellar-sdk/tree/master/docs/reference).

There is also Horizon REST API Documentation
[here](https://developers.stellar.org/api/introduction/).
[here](https://developers.stellar.org/api/introduction/) and Soroban JSON-RPC documentation [here](https://soroban.stellar.org/docs/reference/rpc).

### Usage with React-Native

Expand All @@ -188,7 +188,7 @@ module.exports = {
};
```
6. Add `import "./shim";` to the top of `index.js`
7. `yarn add stellar-sdk`
7. `yarn add @stellar/stellar-sdk`

There is also a [sample](https://github.com/fnando/rn-stellar-sdk-sample) that you can follow.

Expand All @@ -200,14 +200,14 @@ There is also a [sample](https://github.com/fnando/rn-stellar-sdk-sample) that y
yarn rn-nodeify --install process,url,events,https,http,util,stream,crypto,vm,buffer --hack --yarn
```
3. Add `import "./shim";` to the your app's entry point (by default `./App.js`)
4. `yarn add stellar-sdk`
4. `yarn add @stellar/stellar-sdk`
5. `expo install expo-random`

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:

```javascript
import * as Random from 'expo-random';
import StellarSdk from 'stellar-sdk';
import StellarSdk from '@stellar/stellar-sdk';

const generateRandomKeypair = () => {
const randomBytes = Random.getRandomBytes(32);
Expand Down Expand Up @@ -251,21 +251,9 @@ cd jsdoc && serve .
Documentation for this repo lives in
[Developers site](https://github.com/stellar/js-stellar-sdk/blob/master/docs/reference/readme.md).

## Contributing

For information on how to contribute, please refer to our
[contribution guide](https://github.com/stellar/js-stellar-sdk/blob/master/CONTRIBUTING.md).

## Publishing to npm

```
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
```

A new version will be published to npm **and** Bower by GitHub actions.
## Contributing and Publishing

npm >= 2.13.0 required. Read more about
[npm version](https://docs.npmjs.com/cli/version).
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).

## License

Expand Down
20 changes: 10 additions & 10 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@stellar/stellar-sdk",
"version": "11.0.1",
"version": "11.1.0",
"description": "A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.",
"keywords": [
"stellar"
Expand Down Expand Up @@ -77,13 +77,13 @@
},
"devDependencies": {
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.0",
"@babel/core": "^7.23.6",
"@babel/eslint-parser": "^7.22.15",
"@babel/eslint-plugin": "^7.22.10",
"@babel/preset-env": "^7.22.20",
"@babel/preset-env": "^7.23.6",
"@babel/preset-typescript": "^7.23.0",
"@babel/register": "^7.22.15",
"@definitelytyped/dtslint": "^0.0.197",
"@definitelytyped/dtslint": "^0.1.1",
"@istanbuljs/nyc-config-babel": "3.0.0",
"@stellar/tsconfig": "^1.0.2",
"@types/chai": "^4.3.6",
Expand All @@ -96,7 +96,7 @@
"@types/randombytes": "^2.0.1",
"@types/sinon": "^17.0.2",
"@types/urijs": "^1.19.20",
"@typescript-eslint/parser": "^6.9.1",
"@typescript-eslint/parser": "^6.14.0",
"axios-mock-adapter": "^1.22.0",
"babel-loader": "^9.1.3",
"babel-plugin-istanbul": "^6.1.1",
Expand All @@ -108,14 +108,15 @@
"eslint": "^8.50.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-import": "^0.0.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-webpack-plugin": "^4.0.1",
"ghooks": "^2.0.4",
"husky": "^8.0.3",
"jsdoc": "^4.0.2",
"json-schema-faker": "^0.5.4",
"karma": "^6.4.1",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
Expand All @@ -130,21 +131,20 @@
"mocha": "^10.2.0",
"node-polyfill-webpack-plugin": "^3.0.0",
"nyc": "^15.1.0",
"prettier": "^3.0.3",
"prettier": "^3.1.1",
"randombytes": "^2.1.0",
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"taffydb": "^2.7.3",
"terser-webpack-plugin": "^5.3.9",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"utility-types": "^3.7.0",
"webpack": "^5.88.2",
"json-schema-faker": "^0.5.4",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"@stellar/stellar-base": "10.0.0",
"@stellar/stellar-base": "10.0.1",
"axios": "^1.6.0",
"bignumber.js": "^9.1.2",
"eventsource": "^2.0.2",
Expand Down
8 changes: 4 additions & 4 deletions test/unit/server/soroban/simulate_transaction_test.js
Expand Up @@ -82,8 +82,8 @@ describe("Server#simulateTransaction", async function (done) {
id: 1,
method: "simulateTransaction",
params: {
transaction: this.blob
}
transaction: this.blob,
},
})
.returns(
Promise.resolve({ data: { id: 1, result: simulationResponse } }),
Expand All @@ -109,8 +109,8 @@ describe("Server#simulateTransaction", async function (done) {
method: "simulateTransaction",
params: {
transaction: this.blob,
resourceConfig: { instructionLeeway: 100 }
}
resourceConfig: { instructionLeeway: 100 },
},
})
.returns(
Promise.resolve({ data: { id: 1, result: simulationResponse } }),
Expand Down

0 comments on commit f1358a5

Please sign in to comment.