@stellar/stellar-sdk 13.0.0-rc.1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -2
- package/dist/stellar-sdk-minimal.js +385 -99
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +402 -102
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +385 -99
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +402 -102
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.d.ts +75 -3
- package/lib/contract/assembled_transaction.js +123 -34
- package/lib/contract/basic_node_signer.d.ts +3 -2
- package/lib/contract/basic_node_signer.js +16 -8
- package/lib/contract/client.d.ts +13 -1
- package/lib/contract/client.js +159 -48
- package/lib/contract/types.d.ts +72 -8
- package/lib/contract/types.js +1 -0
- package/lib/horizon/call_builder.d.ts +1 -1
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server_api.d.ts +1 -0
- package/lib/horizon/server_api.js +5 -0
- package/lib/horizon/types/effects.d.ts +51 -51
- package/lib/horizon/types/trade.d.ts +3 -2
- package/lib/http-client/types.d.ts +1 -0
- package/lib/minimal/contract/assembled_transaction.d.ts +75 -3
- package/lib/minimal/contract/assembled_transaction.js +123 -34
- package/lib/minimal/contract/basic_node_signer.d.ts +3 -2
- package/lib/minimal/contract/basic_node_signer.js +16 -8
- package/lib/minimal/contract/client.d.ts +13 -1
- package/lib/minimal/contract/client.js +159 -48
- package/lib/minimal/contract/types.d.ts +72 -8
- package/lib/minimal/contract/types.js +1 -0
- package/lib/minimal/horizon/call_builder.d.ts +1 -1
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server_api.d.ts +1 -0
- package/lib/minimal/horizon/server_api.js +5 -0
- package/lib/minimal/horizon/types/effects.d.ts +51 -51
- package/lib/minimal/horizon/types/trade.d.ts +3 -2
- package/lib/minimal/http-client/types.d.ts +1 -0
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/stellartoml/index.d.ts +1 -0
- package/lib/minimal/stellartoml/index.js +2 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-axios/contract/assembled_transaction.js +123 -34
- package/lib/no-axios/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-axios/contract/basic_node_signer.js +16 -8
- package/lib/no-axios/contract/client.d.ts +13 -1
- package/lib/no-axios/contract/client.js +159 -48
- package/lib/no-axios/contract/types.d.ts +72 -8
- package/lib/no-axios/contract/types.js +1 -0
- package/lib/no-axios/horizon/call_builder.d.ts +1 -1
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server_api.d.ts +1 -0
- package/lib/no-axios/horizon/server_api.js +5 -0
- package/lib/no-axios/horizon/types/effects.d.ts +51 -51
- package/lib/no-axios/horizon/types/trade.d.ts +3 -2
- package/lib/no-axios/http-client/types.d.ts +1 -0
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/stellartoml/index.d.ts +1 -0
- package/lib/no-axios/stellartoml/index.js +2 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-eventsource/contract/assembled_transaction.js +123 -34
- package/lib/no-eventsource/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-eventsource/contract/basic_node_signer.js +16 -8
- package/lib/no-eventsource/contract/client.d.ts +13 -1
- package/lib/no-eventsource/contract/client.js +159 -48
- package/lib/no-eventsource/contract/types.d.ts +72 -8
- package/lib/no-eventsource/contract/types.js +1 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +1 -1
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server_api.d.ts +1 -0
- package/lib/no-eventsource/horizon/server_api.js +5 -0
- package/lib/no-eventsource/horizon/types/effects.d.ts +51 -51
- package/lib/no-eventsource/horizon/types/trade.d.ts +3 -2
- package/lib/no-eventsource/http-client/types.d.ts +1 -0
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/stellartoml/index.d.ts +1 -0
- package/lib/no-eventsource/stellartoml/index.js +2 -0
- package/lib/rpc/axios.js +1 -1
- package/lib/stellartoml/index.d.ts +1 -0
- package/lib/stellartoml/index.js +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,133 @@ A breaking change will get clearly marked in this log.
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
## [v13.0.0
|
|
10
|
+
## [v13.0.0](https://github.com/stellar/js-stellar-sdk/compare/v12.3.0...v13.0.0)
|
|
11
|
+
This is a direct re-tag of rc.2 with the only change being an upgrade to the `stellar-base` library to incorporate a patch release. Nonetheless, the entire changelog from the prior major version here is replicated for a comprehensive view on what's broken, added, and fixed.
|
|
12
|
+
|
|
13
|
+
### Breaking Changes
|
|
14
|
+
- We stopped supporting Node 18 explicitly a while ago, but now the Babelification of the codebase will transform to Node 18 instead of 16.
|
|
15
|
+
|
|
16
|
+
#### TypeScript Bindings: the `contract` module.
|
|
17
|
+
- `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)).
|
|
18
|
+
- The `ClientOptions.signTransaction` type has been updated to reflect the latest [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which matches the latest major version of Freighter and other wallets. It now accepts `address`, `submit`, and `submitUrl` options, and it returns a promise containing the `signedTxXdr` and the `signerAddress`. It now also returns an `Error` type if an error occurs during signing.
|
|
19
|
+
* `basicNodeSigner` has been updated to reflect this new type.
|
|
20
|
+
- `ClientOptions.signAuthEntry` type has been updated to reflect the [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which returns a promise containing the `signerAddress` in addition to the `signAuthEntry` that was returned previously. It also can return an `Error` type.
|
|
21
|
+
- `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:
|
|
22
|
+
```diff
|
|
23
|
+
-SentTransaction(nonsense, realStuff)
|
|
24
|
+
+SentTransaction(realStuff)
|
|
25
|
+
-new SentTransaction(nonsense, realStuff)
|
|
26
|
+
+new SentTransaction(realStuff)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### Server APIs: the `rpc` and `Horizon` modules.
|
|
30
|
+
- Deprecated RPC APIs have been removed ([#1084](https://github.com/stellar/js-stellar-sdk/pull/1084)):
|
|
31
|
+
* `simulateTransaction`'s `cost` field is removed
|
|
32
|
+
* `rpc.Server.getEvents`'s `pagingToken` field is deprecated, use `cursor` instead
|
|
33
|
+
- Deprecated Horizon APIs have been removed (deprecated since [v10.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v10.0.1), []()):
|
|
34
|
+
* removed fields `transaction_count`, `base_fee`, and `base_reserve`
|
|
35
|
+
* removed fields `num_accounts` and `amount` from assets
|
|
36
|
+
- The `SorobanRpc` import, previously deprecated, has been removed. You can import `rpc` instead:
|
|
37
|
+
```diff
|
|
38
|
+
-import { SorobanRpc } from '@stellar/stellar-sdk'
|
|
39
|
+
+import { rpc } from '@stellar/stellar-sdk'
|
|
40
|
+
// alternatively, you can also import from the `rpc` entrypoint:
|
|
41
|
+
import { Server } from '@stellar/stellar-sdk/rpc'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
#### TypeScript Bindings: the `contract` module.
|
|
47
|
+
* `contract.Client` now has a static `deploy` method that can be used to deploy a contract instance from an existing uploaded/"installed" Wasm hash. The first arguments to this method are the arguments for the contract's `__constructor` method in accordance with [CAP-42](https://stellar.org/protocol/cap-42) ([#1086](https://github.com/stellar/js-stellar-sdk/pull/1086/)). For example, using the `increment` test contract as modified in https://github.com/stellar/soroban-test-examples/pull/2/files#diff-8734809100be3803c3ce38064730b4578074d7c2dc5fb7c05ca802b2248b18afR10-R45:
|
|
48
|
+
```typescript
|
|
49
|
+
const tx = await contract.Client.deploy(
|
|
50
|
+
{ counter: 42 },
|
|
51
|
+
{
|
|
52
|
+
networkPassphrase,
|
|
53
|
+
rpcUrl,
|
|
54
|
+
wasmHash: uploadedWasmHash,
|
|
55
|
+
publicKey: someKeypair.publicKey(),
|
|
56
|
+
...basicNodeSigner(someKeypair, networkPassphrase),
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
const { result: client } = await tx.signAndSend();
|
|
60
|
+
const t = await client.get();
|
|
61
|
+
expect(t.result, 42);
|
|
62
|
+
```
|
|
63
|
+
* `contract.AssembledTransaction#signAuthEntries` now allows you to override `authorizeEntry`. This can be used to streamline novel workflows using cross-contract auth. ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)).
|
|
64
|
+
|
|
65
|
+
#### Server modules: the `rpc`, `Horizon`, and `stellartoml` modules.
|
|
66
|
+
* `Horizon.ServerApi` now has an `EffectType` exported so that you can compare and infer effect types directly ([#1099](https://github.com/stellar/js-stellar-sdk/pull/1099)).
|
|
67
|
+
* `Horizon.ServerApi.Trade` type now has a `type_i` field for type inference ([#1099](https://github.com/stellar/js-stellar-sdk/pull/1099)).
|
|
68
|
+
* All effects now expose their type as an exact string ([#947](https://github.com/stellar/js-stellar-sdk/pull/947)).
|
|
69
|
+
* `stellartoml.Resolver.resolve` now has a `allowedRedirects` option to configure the number of allowed redirects to follow when resolving a stellar toml file.
|
|
70
|
+
* `rpc.Server.getEvents` now returns a `cursor` field that matches `pagingToken` and `id`
|
|
71
|
+
* `rpc.Server.getTransactions` now returns a `txHash` field
|
|
72
|
+
* `rpc.Server` has two new methods:
|
|
73
|
+
- `pollTransaction` to retry transaction retrieval ([#1092]https://github.com/stellar/js-stellar-sdk/pull/1092), and
|
|
74
|
+
- `getSACBalance` to fetch the balance of a built-in Stellar Asset Contract token held by a contract ([#1046](https://github.com/stellar/js-stellar-sdk/pull/1046)), returning this schema:
|
|
75
|
+
```typescript
|
|
76
|
+
export interface BalanceResponse {
|
|
77
|
+
latestLedger: number;
|
|
78
|
+
/** present only on success, otherwise request malformed or no balance */
|
|
79
|
+
balanceEntry?: {
|
|
80
|
+
/** a 64-bit integer */
|
|
81
|
+
amount: string;
|
|
82
|
+
authorized: boolean;
|
|
83
|
+
clawback: boolean;
|
|
84
|
+
|
|
85
|
+
lastModifiedLedgerSeq?: number;
|
|
86
|
+
liveUntilLedgerSeq?: number;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### New bundles without dependencies
|
|
92
|
+
- You can now build the browser bundle without various dependencies:
|
|
93
|
+
* 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.
|
|
94
|
+
* You can import Node packages without the `axios` dependency via `@stellar/stellar-sdk/no-axios`. For Node environments that don't support modern imports, use `@stellar/stellar-sdk/lib/no-axios/index`.
|
|
95
|
+
* Set `USE_EVENTSOURCE=false` to build without the `eventsource` dependency: this will build `stellar-sdk-no-eventsource.js` and `stellar-sdk-no-eventsource.min.js` in the `dist/` directory, or just run `yarn build:browser:no-eventsource` to generate these files.
|
|
96
|
+
* You can import Node packages without the `eventsource` dependency via `@stellar/stellar-sdk/no-eventsource`. For Node.js environments that don't support modern imports, use `@stellar/stellar-sdk/lib/no-eventsource/index`.
|
|
97
|
+
* To use a minimal build without both Axios and EventSource, use `stellar-sdk-minimal.js` for the browser build and import from `@stellar/stellar-sdk/minimal` for the Node package.
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
- `contract.AssembledTransaction#nonInvokerSigningBy` now correctly returns contract addresses, in instances of cross-contract auth, rather than throwing an error. `sign` will ignore these contract addresses, since auth happens via cross-contract call ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)).
|
|
101
|
+
- `buildInvocationTree` now correctly handles V2 contract creation and displays constructor args ([js-stellar-base#785](https://github.com/stellar/js-stellar-base/pull/785)).
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## [v13.0.0-rc.2](https://github.com/stellar/js-stellar-sdk/compare/v13.0.0-rc.1...v13.0.0-rc.2)
|
|
105
|
+
|
|
106
|
+
### Breaking Changes
|
|
107
|
+
- The `ClientOptions.signTransaction` type has been updated to reflect the latest [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which matches the latest major version of Freighter and other wallets. It now accepts `address`, `submit`, and `submitUrl` options, and it returns a promise containing the `signedTxXdr` and the `signerAddress`. It now also returns an `Error` type if an error occurs during signing.
|
|
108
|
+
* `basicNodeSigner` has been updated to reflect the new type.
|
|
109
|
+
- `ClientOptions.signAuthEntry` type has also been updated to reflect the [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which also returns a promise containing the `signerAddress` in addition to the `signAuthEntry` that was returned previously. It also can return an `Error` type.
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
* `contract.Client` now has a static `deploy` method that can be used to deploy a contract instance from an existing uploaded/"installed" Wasm hash. The first arguments to this method are the arguments for the contract's `__constructor` method in accordance with CAP-42 ([#1086](https://github.com/stellar/js-stellar-sdk/pull/1086/)).
|
|
113
|
+
|
|
114
|
+
For example, using the `increment` test contract as modified in https://github.com/stellar/soroban-test-examples/pull/2/files#diff-8734809100be3803c3ce38064730b4578074d7c2dc5fb7c05ca802b2248b18afR10-R45:
|
|
115
|
+
```typescript
|
|
116
|
+
const tx = await contract.Client.deploy(
|
|
117
|
+
{ counter: 42 },
|
|
118
|
+
{
|
|
119
|
+
networkPassphrase,
|
|
120
|
+
rpcUrl,
|
|
121
|
+
wasmHash: uploadedWasmHash,
|
|
122
|
+
publicKey: someKeypair.publicKey(),
|
|
123
|
+
...basicNodeSigner(someKeypair, networkPassphrase),
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
const { result: client } = await tx.signAndSend();
|
|
127
|
+
const t = await client.get();
|
|
128
|
+
expect(t.result, 42);
|
|
129
|
+
```
|
|
130
|
+
* `Horizon.ServerApi` now has an `EffectType` exported so that you can compare and infer effect types directly ([#1099](https://github.com/stellar/js-stellar-sdk/pull/1099)).
|
|
131
|
+
* `Horizon.ServerApi.Trade` type now has a `type_i` field for type inference.
|
|
132
|
+
* All effects now expose their type as an exact string ([#947](https://github.com/stellar/js-stellar-sdk/pull/947)).
|
|
133
|
+
* `stellartoml-Resolver.resolve` now has a `allowedRedirects` option to configure the number of allowed redirects to follow when resolving a stellar toml file.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## [v13.0.0-rc.1](https://github.com/stellar/js-stellar-sdk/compare/v13.0.0-beta.1...v13.0.0-rc.1)
|
|
11
137
|
|
|
12
138
|
### Breaking Changes
|
|
13
139
|
- Deprecated RPC APIs have been removed ([#1084](https://github.com/stellar/js-stellar-sdk/pull/1084)):
|
|
@@ -43,7 +169,6 @@ A breaking change will get clearly marked in this log.
|
|
|
43
169
|
|
|
44
170
|
### Breaking Changes
|
|
45
171
|
- `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)).
|
|
46
|
-
|
|
47
172
|
- 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.
|
|
48
173
|
|
|
49
174
|
### Added
|