Skip to content

Commit

Permalink
Merge branch 'master' of github.com:stellar/js-stellar-sdk into 920-d…
Browse files Browse the repository at this point in the history
…ocumentation-rendering
  • Loading branch information
ElliotFriend committed Sep 17, 2024
2 parents ceaf127 + 99cf4cc commit 59ba38e
Show file tree
Hide file tree
Showing 63 changed files with 3,325 additions and 2,490 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-rc.1 --root ./target soroban-cli --debug"
install_soroban = "install --version 21.4.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 }],
},
};
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
- package-ecosystem: "npm"
directories:
- "/"
- "/website"
schedule:
interval: "weekly"
day: "sunday"
time: "02:00"
open-pull-requests-limit: 2
groups:
minor-and-patch:
applies-to: version-updates
update-types:
- "patch"
- "minor"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "02:00"
open-pull-requests-limit: 2
groups:
all-actions:
applies-to: version-updates
patterns: [ "*" ]
4 changes: 2 additions & 2 deletions .github/workflows/bundle_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Node.js 18
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: .github/codeql-config.yml

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
5 changes: 3 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ jobs:
--health-timeout 5s
--health-retries 50
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

# Workaround for some `yarn` nonsense, see:
# https://github.com/yarnpkg/yarn/issues/6312#issuecomment-429685210
- run: rustup target add wasm32-unknown-unknown
- run: yarn install --network-concurrency 1
- run: yarn build:prod
- run: yarn test:e2e
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout SDK
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout Base
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: stellar/js-stellar-base
path: js-stellar-base

- name: Install Node (20.x)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x'

Expand All @@ -30,7 +30,7 @@ jobs:
run: yarn build:prod

- name: Checkout GH pages
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: stellar/js-stellar-sdk
ref: gh-pages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -40,3 +40,6 @@ jobs:

- name: Browser Tests
run: yarn test:browser

- name: Linter Tests
run: yarn _prettier && (git diff-index --quiet HEAD; git diff)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_ID }}
private_key: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_PEM }}
Expand Down
74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,80 @@ A breaking change will get clearly marked in this log.
## Unreleased


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

### Added
- `rpc.Server` now has a `getTransactions`, which has the same response schema as `getTransactions` except with bundles of transactions ([#1037](https://github.com/stellar/js-stellar-sdk/pull/1037)).
- `rpc.Server` now has a `getVersionInfo` method which reports version information of the RPC instance it is connected to ([#1028](https://github.com/stellar/js-stellar-sdk/issues/1028)):

```typescript
export interface GetVersionInfoResponse {
version: string;
commit_hash: string;
build_time_stamp: string;
captive_core_version: string;
protocol_version: number;
}
```

### Fixed
- Lower authorization entry's default signature expiration to ~8min for security reasons ([#1023](https://github.com/stellar/js-stellar-sdk/pull/1023)).
- Remove `statusText` error check to broaden compatibility ([#1001](https://github.com/stellar/js-stellar-sdk/pull/1001)).
- Upgraded `stellar-base` which includes various fixes ([release notes](https://github.com/stellar/js-stellar-base/releases/tag/v12.1.1), [#1045](https://github.com/stellar/js-stellar-sdk/pull/1045)).


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

### Fixed
- `@stellar/stellar-base` and its underlying dependency `@stellar/js-xdr` have been upgraded to their latest versions; reference their release notes ([v12.1.0](https://github.com/stellar/js-stellar-base/releases/tag/v12.1.0) and [v3.1.2](https://github.com/stellar/js-xdr/releases/tag/v3.1.2), respectively) for details ([#1013](https://github.com/stellar/js-stellar-sdk/pull/1013)).

### Added
- You can now pass custom headers to both `rpc.Server` and `Horizon.Server` ([#1013](https://github.com/stellar/js-stellar-sdk/pull/1013)):
```typescript
import { Server } from "@stellar/stellar-sdk/rpc";

const s = new Server("<some URL>", { headers: { "X-Custom-Header": "hello" }})
```
- `Horizon.Server` now supports the new `POST /transactions_async` endpoint via the `submitAsyncTransaction` method ([#989](https://github.com/stellar/js-stellar-sdk/pull/989)). Its purpose is to provide an immediate response to the submission rather than waiting for Horizon to determine its status. The response schema is as follows:
```typescript
interface SubmitAsyncTransactionResponse {
// the submitted transaction hash
hash: string;
// one of "PENDING", "DUPLICATE", "TRY_AGAIN_LATER", or "ERROR"
tx_status: string;
// a base64-encoded xdr.TransactionResult iff `tx_status` is "ERROR"
error_result_xdr: string;
}
```
- `rpc.Server` now has a `getFeeStats` method which retrieves fee statistics for a previous chunk of ledgers to provide users with a way to provide informed decisions about getting their transactions included in the following ledgers ([#998](https://github.com/stellar/js-stellar-sdk/issues/998)):
```typescript
export interface GetFeeStatsResponse {
sorobanInclusionFee: FeeDistribution;
inclusionFee: FeeDistribution;
latestLedger: number; // uint32
}

interface FeeDistribution {
max: string; // uint64
min: string; // uint64
mode: string; // uint64
p10: string; // uint64
p20: string; // uint64
p30: string; // uint64
p40: string; // uint64
p50: string; // uint64
p60: string; // uint64
p70: string; // uint64
p80: string; // uint64
p90: string; // uint64
p95: string; // uint64
p99: string; // uint64
transactionCount: string; // uint32
ledgerCount: number; // uint32
}
```


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

### Added
Expand Down
Loading

0 comments on commit 59ba38e

Please sign in to comment.