Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v12.2.0 #1013

Merged
merged 7 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,31 @@ A breaking change will get clearly marked in this log.

## Unreleased


## [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
- `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)):
- 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;
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stellar/stellar-sdk",
"version": "12.1.0",
"version": "12.2.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 @@ -93,26 +93,26 @@
]
},
"devDependencies": {
"@babel/cli": "^7.24.7",
"@babel/core": "^7.24.7",
"@babel/cli": "^7.24.8",
"@babel/core": "^7.24.9",
"@babel/eslint-plugin": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-env": "^7.24.8",
"@babel/preset-typescript": "^7.24.7",
"@babel/register": "^7.24.6",
"@definitelytyped/dtslint": "^0.2.20",
"@definitelytyped/dtslint": "^0.2.22",
"@istanbuljs/nyc-config-babel": "3.0.0",
"@stellar/tsconfig": "^1.0.2",
"@types/chai": "^4.3.14",
"@types/detect-node": "^2.0.0",
"@types/eventsource": "^1.1.12",
"@types/json-schema": "^7.0.15",
"@types/lodash": "^4.17.5",
"@types/mocha": "^10.0.2",
"@types/node": "^20.14.2",
"@types/lodash": "^4.17.7",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.11",
"@types/randombytes": "^2.0.1",
"@types/sinon": "^17.0.2",
"@types/urijs": "^1.19.20",
"@typescript-eslint/parser": "^7.13.0",
"@typescript-eslint/parser": "^7.16.1",
"axios-mock-adapter": "^1.22.0",
"babel-loader": "^9.1.3",
"babel-plugin-istanbul": "^6.1.1",
Expand All @@ -127,13 +127,13 @@
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.2.12",
"eslint-plugin-jsdoc": "^48.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-import": "^0.0.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-webpack-plugin": "^4.2.0",
"ghooks": "^2.0.4",
"husky": "^9.0.11",
"husky": "^9.1.1",
"jsdoc": "^4.0.2",
"json-schema-faker": "^0.5.6",
"karma": "^6.4.3",
Expand All @@ -147,22 +147,22 @@
"lint-staged": "^15.2.7",
"lodash": "^4.17.21",
"minami": "^1.1.1",
"mocha": "^10.3.0",
"mocha": "^10.6.0",
"node-polyfill-webpack-plugin": "^3.0.0",
"nyc": "^15.1.0",
"prettier": "^3.3.2",
"prettier": "^3.3.3",
"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.92.0",
"typescript": "^5.5.3",
"webpack": "^5.93.0",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"@stellar/stellar-base": "^12.0.1",
"@stellar/stellar-base": "^12.1.0",
"axios": "^1.7.2",
"bignumber.js": "^9.1.2",
"eventsource": "^2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/src/test-contract-client-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("Client", function () {
this.context = { client, publicKey, addr, contractId, keypair };
});

it("can be constructed with `new Client`", async function() {
it("can be constructed with `new Client`", async function () {
const { result } = await this.context.client.hello({ to: "tests" });
expect(result).to.deep.equal(["Hello", "tests"]);
});
Expand Down
22 changes: 14 additions & 8 deletions test/e2e/src/test-custom-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ describe("Custom Types Tests", function () {
).to.equal("tests");
});

it("view method with empty keypair", async function() {
it("view method with empty keypair", async function () {
const { client: client2 } = await clientFor("customTypes", {
keypair: undefined,
contractId: this.context.contractId
contractId: this.context.contractId,
});
expect((await client2.i32_({ i32_: 1 })).result).to.equal(1);
});

it("should increment the counter correctly", async function() {
it("should increment the counter correctly", async function () {
const { result: startingBalance } = await this.context.client.get_count();
const inc = await this.context.client.inc();
const incrementResponse = await inc.signAndSend();
Expand All @@ -34,7 +34,7 @@ describe("Custom Types Tests", function () {
expect(newBalance).to.equal(startingBalance + 1);
});

it("should accept only options object for methods with no arguments", async function() {
it("should accept only options object for methods with no arguments", async function () {
const inc = await this.context.client.inc({ simulate: false });
expect(inc.simulation).to.be.undefined;
});
Expand All @@ -43,13 +43,19 @@ describe("Custom Types Tests", function () {
expect((await this.context.client.woid()).result).to.be.null;
});

it("should authenticate the user correctly", async function() {
const { result } = await this.context.client.auth({ addr: this.context.publicKey, world: "lol" });
it("should authenticate the user correctly", async function () {
const { result } = await this.context.client.auth({
addr: this.context.publicKey,
world: "lol",
});
expect(result).to.equal(this.context.publicKey);
});

it("should authenticate the user correctly", async function() {
const { result } = await this.context.client.auth({ addr: this.context.publicKey, world: "lol" });
it("should authenticate the user correctly", async function () {
const { result } = await this.context.client.auth({
addr: this.context.publicKey,
world: "lol",
});
expect(result).to.equal(this.context.publicKey);
});

Expand Down
13 changes: 6 additions & 7 deletions test/e2e/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ const contracts = {
helloWorld: {
hash: spawnSync(
"./target/bin/soroban",
[
"contract",
"install",
"--wasm",
`${basePath}/hello_world.wasm`,
],
["contract", "install", "--wasm", `${basePath}/hello_world.wasm`],
{ shell: true, encoding: "utf8" },
).stdout.trim(),
path: `${basePath}/hello_world.wasm`,
Expand Down Expand Up @@ -84,7 +79,11 @@ module.exports.friendbotUrl = friendbotUrl;

async function generateFundedKeypair() {
const keypair = Keypair.random();
await fetch(friendbotUrl === 'https://friendbot.stellar.org' ? `${friendbotUrl}/?addr=${keypair.publicKey()}` : `${friendbotUrl}/friendbot?addr=${keypair.publicKey()}`);
await fetch(
friendbotUrl === "https://friendbot.stellar.org"
? `${friendbotUrl}/?addr=${keypair.publicKey()}`
: `${friendbotUrl}/friendbot?addr=${keypair.publicKey()}`,
);
return keypair;
}
module.exports.generateFundedKeypair = generateFundedKeypair;
Expand Down
Loading
Loading