Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into add-async-endpoint
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/horizon/server.ts
  • Loading branch information
aditya1702 committed Jun 26, 2024
2 parents 73afed0 + b8430dd commit b0aa9b6
Show file tree
Hide file tree
Showing 58 changed files with 3,114 additions and 3,047 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# paths = ["/path/to/override"] # path dependency overrides

[alias] # command aliases
install_soroban = "install --version 21.0.0-preview.1 --root ./target soroban-cli --debug"
install_soroban = "install --version 21.0.0-rc.1 --root ./target soroban-cli --debug"
# b = "build --target wasm32-unknown-unknown --release"
# c = "check"
# t = "test"
Expand Down
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,54 @@ module.exports = {
},
extends: [
"airbnb-base",
"airbnb-typescript/base",
"prettier",
"plugin:jsdoc/recommended",
],
parserOptions: {
parser: "@typescript-eslint/parser",
project: "./config/tsconfig.json",
},
plugins: ["@babel", "prettier", "prefer-import"],
rules: {
// OFF
"node/no-unpublished-require": 0,
"import/prefer-default-export": 0,
"node/no-unsupported-features/es-syntax": 0,
"node/no-unsupported-features/es-builtins": 0,
camelcase: 0,
"class-methods-use-this": 0,
"linebreak-style": 0,
"jsdoc/require-returns": 0,
"jsdoc/require-param": 0,
"jsdoc/require-param-type": 0,
"jsdoc/require-returns-type": 0,
"jsdoc/no-blank-blocks": 0,
"jsdoc/no-multi-asterisks": 0,
"jsdoc/tag-lines": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/no-defaults": "off",
"valid-jsdoc": "off",
"import/extensions": 0,
"new-cap": 0,
"no-param-reassign": 0,
"no-underscore-dangle": 0,
"no-use-before-define": 0,
"prefer-destructuring": 0,
"lines-between-class-members": 0,
"@typescript-eslint/lines-between-class-members": "off",
"spaced-comment": 0,

// WARN
"arrow-body-style": 1,
"no-console": ["warn", { allow: ["assert"] }],
"no-debugger": 1,
"object-shorthand": 1,
"prefer-const": 1,
"prefer-import/prefer-import-over-require": [1],
"require-await": 1,

// ERROR
"no-unused-expressions": [2, { allowTaggedTemplates: true }],
},
};
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ A breaking change will get clearly marked in this log.
## Unreleased


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

### Added
- `contract` now exports the `DEFAULT_TIMEOUT` ([#984](https://github.com/stellar/js-stellar-sdk/pull/984)).
- `contract.AssembledTransaction` now has:
- `toXDR` and `fromXDR` methods for serializing the transaction to and from XDR. These methods should be used in place of `AssembledTransaction.toJSON` and `AssembledTransaction.fromJSON`for multi-auth signing. The JSON methods are now deprecated. **Note:** you must now call `simulate` on the transaction before the final `signAndSend` call after all required signatures are gathered when using the XDR methods ([#977](https://github.com/stellar/js-stellar-sdk/pull/977)).
- a `restoreFootprint` method which accepts the `restorePreamble` returned when a simulation call fails due to some contract state that has expired. When invoking a contract function, one can now set `restore` to `true` in the `MethodOptions`. When enabled, a `restoreFootprint` transaction will be created and await signing when required ([#991](https://github.com/stellar/js-stellar-sdk/pull/991)).
- separate `sign` and `send` methods so that you can sign a transaction without sending it (`signAndSend` still works as before; [#922](https://github.com/stellar/js-stellar-sdk/pull/992)).
- `contract.Client` now has a `txFromXDR` method which should be used in place of `txFromJSON` for multi-auth signing ([#977](https://github.com/stellar/js-stellar-sdk/pull/977)).

### Deprecated
- In `contract.AssembledTransaction`, `toJSON` and `fromJSON` should be replaced with `toXDR` and `fromXDR`.
- In `contract.Client`, `txFromJSON` should be replaced with `txFromXDR`.

### Fixed
- If you edit an `AssembledTransaction` with `tx.raw = cloneFrom(tx.build)`, the `tx.simulationData` will now be updated correctly ([#985](https://github.com/stellar/js-stellar-sdk/pull/985)).


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

- This is a re-tag of `v12.0.0-rc.3` with dependency updates and a single new feature.
Expand Down
45 changes: 18 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stellar/stellar-sdk",
"version": "12.0.1",
"version": "12.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 @@ -49,7 +49,7 @@
"clean": "rm -rf lib/ dist/ coverage/ .nyc_output/ jsdoc/ test/e2e/.soroban",
"docs": "yarn build:docs && jsdoc -c ./config/.jsdoc.json --verbose",
"test": "yarn build:test && yarn test:node && yarn test:integration && yarn test:browser",
"test:e2e": "./test/e2e/initialize.sh && ava",
"test:e2e": "./test/e2e/initialize.sh && yarn _nyc mocha --recursive 'test/e2e/src/test-*.js'",
"test:node": "yarn _nyc mocha --recursive 'test/unit/**/*.js'",
"test:integration": "yarn _nyc mocha --recursive 'test/integration/**/*.js'",
"test:browser": "karma start config/karma.conf.js",
Expand All @@ -75,14 +75,15 @@
"reporter": "spec",
"require": [
"@babel/register",
"test/test-nodejs.js"
"test/test-nodejs.js",
"dotenv/config"
],
"exclude": [
"test/test-browser.js"
],
"sort": true,
"recursive": true,
"timeout": 30000
"timeout": 120000
},
"nyc": {
"instrument": false,
Expand All @@ -92,11 +93,11 @@
]
},
"devDependencies": {
"@babel/cli": "^7.24.6",
"@babel/core": "^7.24.6",
"@babel/eslint-plugin": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"@babel/preset-typescript": "^7.24.6",
"@babel/cli": "^7.24.7",
"@babel/core": "^7.24.7",
"@babel/eslint-plugin": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/register": "^7.24.6",
"@definitelytyped/dtslint": "^0.2.20",
"@istanbuljs/nyc-config-babel": "3.0.0",
Expand All @@ -105,14 +106,13 @@
"@types/detect-node": "^2.0.0",
"@types/eventsource": "^1.1.12",
"@types/json-schema": "^7.0.15",
"@types/lodash": "^4.17.4",
"@types/lodash": "^4.17.5",
"@types/mocha": "^10.0.2",
"@types/node": "^20.12.13",
"@types/node": "^20.14.2",
"@types/randombytes": "^2.0.1",
"@types/sinon": "^17.0.2",
"@types/urijs": "^1.19.20",
"@typescript-eslint/parser": "^7.11.0",
"ava": "^5.3.1",
"@typescript-eslint/parser": "^7.13.0",
"axios-mock-adapter": "^1.22.0",
"babel-loader": "^9.1.3",
"babel-plugin-istanbul": "^6.1.1",
Expand All @@ -127,7 +127,7 @@
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.2.7",
"eslint-plugin-jsdoc": "^48.2.12",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-import": "^0.0.1",
"eslint-plugin-prettier": "^5.1.2",
Expand All @@ -144,39 +144,30 @@
"karma-mocha": "^2.0.0",
"karma-sinon-chai": "^2.0.2",
"karma-webpack": "^5.0.1",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.7",
"lodash": "^4.17.21",
"minami": "^1.1.1",
"mocha": "^10.3.0",
"node-polyfill-webpack-plugin": "^3.0.0",
"nyc": "^15.1.0",
"prettier": "^3.2.5",
"prettier": "^3.3.2",
"randombytes": "^2.1.0",
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"taffydb": "^2.7.3",
"terser-webpack-plugin": "^5.3.10",
"ts-node": "^10.9.2",
"typescript": "^5.4.3",
"webpack": "^5.91.0",
"webpack": "^5.92.0",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"@stellar/stellar-base": "^12.0.0",
"@stellar/stellar-base": "^12.0.1",
"axios": "^1.7.2",
"bignumber.js": "^9.1.2",
"eventsource": "^2.0.2",
"randombytes": "^2.1.0",
"toml": "^3.0.0",
"urijs": "^1.19.1"
},
"ava": {
"files": [
"./test/e2e/src/test-*"
],
"require": [
"dotenv/config"
],
"timeout": "2m"
}
}
41 changes: 0 additions & 41 deletions src/.eslintrc.js

This file was deleted.

5 changes: 3 additions & 2 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* tslint:disable:no-var-requires */
/* eslint import/no-import-module-exports: 0 */

import axios from "axios"; // idk why axios is weird

export * from "./index";
export * as StellarBase from "@stellar/stellar-base";

import axios from "axios"; // idk why axios is weird
export { axios };

export default module.exports;
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const defaultConfig: Configuration = {
timeout: 0,
};

let config = Object.assign({}, defaultConfig);
let config = { ...defaultConfig};

/**
* Global config class.
Expand Down Expand Up @@ -82,7 +82,7 @@ class Config {
* @returns {void}
*/
public static setDefault(): void {
config = Object.assign({}, defaultConfig);
config = { ...defaultConfig};
}
}

Expand Down
Loading

0 comments on commit b0aa9b6

Please sign in to comment.