Skip to content

Commit 71cce58

Browse files
authored
Remove deprecated functionality (#1087)
And use `--locked` when installing pinned version of CLI (and update to latest, for good measure) Note that these breaking changes have been known for some time and shouldn't come as a surprise to downstream.
1 parent b13c291 commit 71cce58

File tree

8 files changed

+30
-28
lines changed

8 files changed

+30
-28
lines changed

.cargo/config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# paths = ["/path/to/override"] # path dependency overrides
22

33
[alias] # command aliases
4-
install_stellar = "install --version 21.5.0 --root ./target stellar-cli --debug --force"
4+
install_stellar = "install --locked --version 21.5.3 --root ./target stellar-cli --debug --force"
55
# b = "build --target wasm32-unknown-unknown --release"
66
# c = "check"
77
# t = "test"

CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,33 @@ A breaking change will get clearly marked in this log.
1111

1212
### Breaking Changes
1313
- `contract.AssembledTransaction#signAuthEntries` now takes an `address` instead of a `publicKey`. This brings the API more inline with its actual functionality: It can be used to sign all the auth entries for a particular _address_, whether that is the address of an account (public key) or a contract. ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)).
14+
1415
- The Node.js code will now Babelify to Node 18 instead of Node 16, but we stopped supporting Node 16 long ago so this shouldn't be a breaking change.
1516

17+
- `SentTransaction.init` and `new SentTransaction` now take _one_ (1) argument instead of _two_ (2). The first argument had previously been deprecated and ignored. To update:
18+
19+
```diff
20+
-SentTransaction(nonsense, realStuff)
21+
+SentTransaction(realStuff)
22+
-new SentTransaction(nonsense, realStuff)
23+
+new SentTransaction(realStuff)
24+
```
25+
26+
- `SorobanRpc` import, previously deprecated, has been removed. You can import `rpc` instead:
27+
28+
```diff
29+
-import { SorobanRpc } from '@stellar/stellar-sdk'
30+
+import { rpc } from '@stellar/stellar-sdk'
31+
```
32+
33+
As an alternative, you can also import from the `rpc` entrypoint:
34+
35+
```ts
36+
import { Server } from '@stellar/stellar-sdk/rpc'
37+
```
38+
39+
- Horizon Server API types: removed fields `transaction_count`, `base_fee`, and `base_reserve` (deprecated since [v10.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v10.0.1))
40+
1641
### Added
1742
- You can now build the browser bundle without various dependencies:
1843
* Set `USE_AXIOS=false` to build without the `axios` dependency: this will build `stellar-sdk-no-axios.js` and `stellar-sdk-no-axios.min.js` in the `dist/` directory, or just run `yarn build:browser:no-axios` to generate these files.

src/contract/assembled_transaction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ export class AssembledTransaction<T> {
676676
if(!this.signed){
677677
throw new Error("The transaction has not yet been signed. Run `sign` first, or use `signAndSend` instead.");
678678
}
679-
const sent = await SentTransaction.init(undefined, this);
679+
const sent = await SentTransaction.init(this);
680680
return sent;
681681
}
682682

src/contract/sent_transaction.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export class SentTransaction<T> {
5757
};
5858

5959
constructor(
60-
_: any, // deprecated: used to take sentTransaction, need to wait for major release for breaking change
6160
public assembled: AssembledTransaction<T>,
6261
) {
6362
this.server = new Server(this.assembled.options.rpcUrl, {
@@ -70,12 +69,10 @@ export class SentTransaction<T> {
7069
* AssembledTransaction. This will also send the transaction to the network.
7170
*/
7271
static init = async <U>(
73-
/** @deprecated variable is ignored. Now handled by AssembledTransaction. */
74-
_: any, // eslint-disable-line @typescript-eslint/no-unused-vars
7572
/** {@link AssembledTransaction} from which this SentTransaction was initialized */
7673
assembled: AssembledTransaction<U>,
7774
): Promise<SentTransaction<U>> => {
78-
const tx = new SentTransaction(undefined, assembled);
75+
const tx = new SentTransaction(assembled);
7976
const sent = await tx.send();
8077
return sent;
8178
};

src/horizon/server_api.ts

-15
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,6 @@ export namespace ServerApi {
158158
header_xdr: string;
159159
base_fee_in_stroops: number;
160160
base_reserve_in_stroops: number;
161-
/**
162-
* @deprecated This will be removed in the next major version: the property
163-
* no longer exists on the Horizon API
164-
*/
165-
transaction_count: number;
166-
/**
167-
* @deprecated This will be removed in the next major version: the property
168-
* no longer exists on the Horizon API
169-
*/
170-
base_fee: number;
171-
/**
172-
* @deprecated This will be removed in the next major version: the property
173-
* no longer exists on the Horizon API
174-
*/
175-
base_reserve: string;
176161

177162
effects: CallCollectionFunction<EffectRecord>;
178163
operations: CallCollectionFunction<OperationRecord>;

src/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ export * as Horizon from './horizon';
2727
*/
2828
export * as rpc from './rpc';
2929

30-
/**
31-
* @deprecated Use `rpc` instead
32-
*/
33-
export * as SorobanRpc from './rpc';
34-
3530
/**
3631
* Tools for interacting with smart contracts, such as `Client`, `Spec`, and
3732
* `AssembledTransaction`. You can import these from the `/contract`

test/unit/server/soroban/constructor_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { Server, AxiosClient } = StellarSdk.SorobanRpc;
1+
const { Server, AxiosClient } = StellarSdk.rpc;
22

33
describe("Server.constructor", function () {
44
beforeEach(function () {

test/unit/server/soroban/get_contract_wasm_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { Address, xdr, hash, Contract } = StellarSdk;
2-
const { Server, AxiosClient } = StellarSdk.SorobanRpc;
2+
const { Server, AxiosClient } = StellarSdk.rpc;
33

44
describe("Server#getContractWasm", () => {
55
beforeEach(function () {

0 commit comments

Comments
 (0)