@stellar/stellar-sdk 12.0.0-rc.2 → 12.0.0-rc.3
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 +68 -0
- package/README.md +1 -1
- package/dist/stellar-sdk.js +1643 -466
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/{contract_client → contract}/assembled_transaction.d.ts +59 -40
- package/lib/{contract_client → contract}/assembled_transaction.js +128 -146
- package/lib/{contract_client → contract}/basic_node_signer.d.ts +2 -2
- package/lib/{contract_client → contract}/basic_node_signer.js +3 -3
- package/lib/contract/client.d.ts +51 -0
- package/lib/contract/client.js +177 -0
- package/lib/contract/index.d.ts +7 -0
- package/lib/{contract_client → contract}/index.js +19 -8
- package/lib/{contract_client → contract}/sent_transaction.d.ts +21 -10
- package/lib/{contract_client → contract}/sent_transaction.js +27 -13
- package/lib/{contract_spec.d.ts → contract/spec.d.ts} +3 -3
- package/lib/{contract_spec.js → contract/spec.js} +160 -160
- package/lib/{contract_client → contract}/types.d.ts +10 -8
- package/lib/contract/utils.d.ts +40 -0
- package/lib/{contract_client → contract}/utils.js +12 -2
- package/lib/index.d.ts +26 -2
- package/lib/index.js +10 -16
- package/lib/rpc/index.d.ts +7 -0
- package/lib/{soroban → rpc}/server.d.ts +49 -0
- package/lib/{soroban → rpc}/server.js +199 -118
- package/package.json +20 -3
- package/lib/contract_client/client.d.ts +0 -17
- package/lib/contract_client/client.js +0 -57
- package/lib/contract_client/index.d.ts +0 -6
- package/lib/contract_client/utils.d.ts +0 -23
- package/lib/rust_types/index.d.ts +0 -1
- package/lib/rust_types/index.js +0 -16
- package/lib/soroban/index.d.ts +0 -7
- /package/lib/{rust_types/result.d.ts → contract/rust_result.d.ts} +0 -0
- /package/lib/{rust_types/result.js → contract/rust_result.js} +0 -0
- /package/lib/{contract_client → contract}/types.js +0 -0
- /package/lib/{soroban → rpc}/api.d.ts +0 -0
- /package/lib/{soroban → rpc}/api.js +0 -0
- /package/lib/{soroban → rpc}/axios.d.ts +0 -0
- /package/lib/{soroban → rpc}/axios.js +0 -0
- /package/lib/{soroban → rpc}/browser.d.ts +0 -0
- /package/lib/{soroban → rpc}/browser.js +0 -0
- /package/lib/{soroban → rpc}/index.js +0 -0
- /package/lib/{soroban → rpc}/jsonrpc.d.ts +0 -0
- /package/lib/{soroban → rpc}/jsonrpc.js +0 -0
- /package/lib/{soroban → rpc}/parsers.d.ts +0 -0
- /package/lib/{soroban → rpc}/parsers.js +0 -0
- /package/lib/{soroban → rpc}/transaction.d.ts +0 -0
- /package/lib/{soroban → rpc}/transaction.js +0 -0
- /package/lib/{soroban → rpc}/utils.d.ts +0 -0
- /package/lib/{soroban → rpc}/utils.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,74 @@ A breaking change will get clearly marked in this log.
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
## [v12.0.0-rc.3](https://github.com/stellar/js-stellar-sdk/compare/v11.3.0...v12.0.0-rc.3)
|
|
11
|
+
|
|
12
|
+
### Breaking Changes
|
|
13
|
+
|
|
14
|
+
- `ContractClient` functionality previously added in [v11.3.0](https://github.com/stellar/js-stellar-sdk/releases/tag/v11.3.0) was exported in a non-standard way. You can now import it as any other `stellar-sdk` module ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)):
|
|
15
|
+
|
|
16
|
+
```diff
|
|
17
|
+
-import { ContractClient } from '@stellar/stellar-sdk/lib/contract_client'
|
|
18
|
+
+import { contract } from '@stellar/stellar-sdk'
|
|
19
|
+
+const { Client } = contract
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Note that this top-level `contract` export is a container for ContractClient and related functionality. The `ContractClient` class is now available at `contract.Client`, as shown. Further note that there is a capitalized `Contract` export as well, which comes [from stellar-base](https://github.com/stellar/js-stellar-base/blob/b96281b9b3f94af23a913f93bdb62477f5434ccc/src/contract.js#L6-L19). You can remember which is which because capital-C `Contract` is a class, whereas lowercase-c `contract` is a container/module with a bunch of classes, functions, and types.
|
|
23
|
+
|
|
24
|
+
Additionally, this is available from the `/contract` entrypoint, if your version of Node [and TypeScript](https://stackoverflow.com/a/70020984/249801) support [the `exports` declaration](https://nodejs.org/api/packages.html#exports). Finally, some of its exports have been renamed:
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
import {
|
|
28
|
+
- ContractClient,
|
|
29
|
+
+ Client,
|
|
30
|
+
AssembledTransaction,
|
|
31
|
+
- ContractClientOptions,
|
|
32
|
+
+ ClientOptions,
|
|
33
|
+
SentTransaction,
|
|
34
|
+
-} from '@stellar/stellar-sdk/lib/contract_client'
|
|
35
|
+
+} from '@stellar/stellar-sdk/contract'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- The `ContractSpec` class is now nested under the `contract` module, and has been **renamed** to `Spec` ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)). Alternatively, you can import this from the `contract` entrypoint, if your version of Node [and TypeScript](https://stackoverflow.com/a/70020984/249801) support [the `exports` declaration](https://nodejs.org/api/packages.html#exports):
|
|
39
|
+
|
|
40
|
+
```diff
|
|
41
|
+
-import { ContractSpec } from '@stellar/stellar-sdk'
|
|
42
|
+
+import { contract } from '@stellar/stellar-sdk'
|
|
43
|
+
+const { Spec } = contract
|
|
44
|
+
// OR
|
|
45
|
+
+import { Spec } from '@stellar/stellar-sdk/contract'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- Previously, `AssembledTransaction.signAndSend()` would return a `SentTransaction` even if the transaction never finalized. That is, if it successfully sent the transaction to the network, but the transaction was still `status: 'PENDING'`, then it would `console.error` an error message, but return the indeterminate transaction anyhow. **It now throws** a `SentTransaction.Errors.TransactionStillPending` error with that error message instead ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)).
|
|
49
|
+
|
|
50
|
+
### Deprecated
|
|
51
|
+
|
|
52
|
+
- `SorobanRpc` module is now also exported as `rpc` ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)). You can import it with either name for now, but `SorobanRpc` will be removed in a future release:
|
|
53
|
+
|
|
54
|
+
```diff
|
|
55
|
+
-import { SorobanRpc } from '@stellar/stellar-sdk'
|
|
56
|
+
+import { rpc } from '@stellar/stellar-sdk'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
You can also now import it at the `/rpc` entrypoint, if your version of Node [and TypeScript](https://stackoverflow.com/a/70020984/249801) support [the `exports` declaration](https://nodejs.org/api/packages.html#exports).
|
|
60
|
+
|
|
61
|
+
```diff
|
|
62
|
+
-import { SorobanRpc } from '@stellar/stellar-sdk'
|
|
63
|
+
-const { Api } = SorobanRpc
|
|
64
|
+
+import { Api } from '@stellar/stellar-sdk/rpc'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
* New methods on `contract.Client` ([#960](https://github.com/stellar/js-stellar-sdk/pull/960)):
|
|
69
|
+
- `from(opts: ContractClientOptions)` instantiates `contract.Client` by fetching the `contractId`'s WASM from the network to fill out the client's `ContractSpec`.
|
|
70
|
+
- `fromWasm` and `fromWasmHash` methods to instantiate a `contract.Client` when you already have the WASM bytes or hash alongside the `contract.ClientOptions`.
|
|
71
|
+
* New methods on `rpc.Server` ([#960](https://github.com/stellar/js-stellar-sdk/pull/960)):
|
|
72
|
+
- `getContractWasmByContractId` and `getContractWasmByHash` to retrieve a contract's WASM bytecode via its `contractId` or `wasmHash`, respectively.
|
|
73
|
+
|
|
74
|
+
### Fixed
|
|
75
|
+
* The breaking changes above (strictly speaking, they are not breaking changes because importing from the inner guts of the SDK is not supported) enable the `contract` module to be used in non-Node environments.
|
|
76
|
+
|
|
77
|
+
|
|
10
78
|
## [v12.0.0-rc.2](https://github.com/stellar/js-stellar-sdk/compare/v11.3.0...v12.0.0-rc.2)
|
|
11
79
|
|
|
12
80
|
**This update supports Protocol 21**. It is an additive change to the protocol so there are no true backwards incompatibilities, but your software may break if you encounter new unexpected fields from this Protocol ([#949](https://github.com/stellar/js-stellar-sdk/pull/949)).
|
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ The usage documentation for this library lives in a handful of places:
|
|
|
96
96
|
You can also refer to:
|
|
97
97
|
|
|
98
98
|
* the [documentation](https://developers.stellar.org/network/horizon) for the Horizon REST API (if using the `Horizon` module) and
|
|
99
|
-
* the [documentation](https://soroban.stellar.org/docs/reference/rpc) for Soroban RPC's API (if using the `
|
|
99
|
+
* the [documentation](https://soroban.stellar.org/docs/reference/rpc) for Soroban RPC's API (if using the `rpc` module)
|
|
100
100
|
|
|
101
101
|
### Usage with React-Native
|
|
102
102
|
|