@stellar/stellar-sdk 12.1.0 → 12.3.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +1 -1
  3. package/dist/stellar-sdk.js +1336 -1101
  4. package/dist/stellar-sdk.min.js +1 -1
  5. package/lib/browser.d.ts +1 -1
  6. package/lib/browser.js +4 -4
  7. package/lib/config.js +5 -2
  8. package/lib/contract/assembled_transaction.d.ts +26 -30
  9. package/lib/contract/assembled_transaction.js +28 -36
  10. package/lib/contract/client.d.ts +0 -1
  11. package/lib/contract/client.js +2 -2
  12. package/lib/contract/index.d.ts +0 -1
  13. package/lib/contract/index.js +1 -18
  14. package/lib/contract/sent_transaction.d.ts +9 -10
  15. package/lib/contract/sent_transaction.js +2 -1
  16. package/lib/contract/spec.d.ts +1 -1
  17. package/lib/contract/spec.js +921 -956
  18. package/lib/contract/types.d.ts +5 -0
  19. package/lib/contract/types.js +4 -1
  20. package/lib/contract/utils.d.ts +0 -5
  21. package/lib/contract/utils.js +4 -18
  22. package/lib/errors.d.ts +4 -4
  23. package/lib/federation/server.d.ts +1 -1
  24. package/lib/horizon/account_call_builder.d.ts +2 -3
  25. package/lib/horizon/account_response.d.ts +1 -1
  26. package/lib/horizon/assets_call_builder.d.ts +2 -3
  27. package/lib/horizon/call_builder.d.ts +8 -8
  28. package/lib/horizon/call_builder.js +10 -13
  29. package/lib/horizon/claimable_balances_call_builder.d.ts +3 -4
  30. package/lib/horizon/effect_call_builder.d.ts +2 -3
  31. package/lib/horizon/friendbot_builder.d.ts +0 -1
  32. package/lib/horizon/horizon_api.d.ts +5 -1
  33. package/lib/horizon/horizon_axios_client.js +6 -6
  34. package/lib/horizon/ledger_call_builder.d.ts +2 -3
  35. package/lib/horizon/liquidity_pool_call_builder.d.ts +2 -4
  36. package/lib/horizon/offer_call_builder.d.ts +2 -3
  37. package/lib/horizon/operation_call_builder.d.ts +3 -4
  38. package/lib/horizon/orderbook_call_builder.d.ts +0 -1
  39. package/lib/horizon/path_call_builder.d.ts +1 -2
  40. package/lib/horizon/payment_call_builder.d.ts +2 -3
  41. package/lib/horizon/server.d.ts +29 -10
  42. package/lib/horizon/server.js +98 -55
  43. package/lib/horizon/strict_receive_path_call_builder.d.ts +1 -2
  44. package/lib/horizon/strict_send_path_call_builder.d.ts +1 -2
  45. package/lib/horizon/trade_aggregation_call_builder.d.ts +9 -10
  46. package/lib/horizon/trade_aggregation_call_builder.js +3 -7
  47. package/lib/horizon/trades_call_builder.d.ts +2 -3
  48. package/lib/horizon/transaction_call_builder.d.ts +3 -4
  49. package/lib/horizon/types/assets.d.ts +1 -1
  50. package/lib/horizon/types/effects.d.ts +1 -1
  51. package/lib/horizon/types/offer.d.ts +1 -1
  52. package/lib/index.d.ts +0 -1
  53. package/lib/rpc/api.d.ts +89 -11
  54. package/lib/rpc/browser.d.ts +1 -1
  55. package/lib/rpc/browser.js +4 -4
  56. package/lib/rpc/index.d.ts +0 -1
  57. package/lib/rpc/jsonrpc.js +3 -3
  58. package/lib/rpc/parsers.d.ts +5 -3
  59. package/lib/rpc/parsers.js +52 -23
  60. package/lib/rpc/server.d.ts +51 -18
  61. package/lib/rpc/server.js +200 -153
  62. package/lib/rpc/transaction.d.ts +3 -4
  63. package/lib/rpc/transaction.js +23 -25
  64. package/lib/webauth/utils.js +3 -3
  65. package/package.json +24 -24
package/CHANGELOG.md CHANGED
@@ -7,6 +7,80 @@ A breaking change will get clearly marked in this log.
7
7
  ## Unreleased
8
8
 
9
9
 
10
+ ## [v12.3.0](https://github.com/stellar/js-stellar-sdk/compare/v12.2.0...v12.3.0)
11
+
12
+ ### Added
13
+ - `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)).
14
+ - `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)):
15
+
16
+ ```typescript
17
+ export interface GetVersionInfoResponse {
18
+ version: string;
19
+ commit_hash: string;
20
+ build_time_stamp: string;
21
+ captive_core_version: string;
22
+ protocol_version: number;
23
+ }
24
+ ```
25
+
26
+ ### Fixed
27
+ - Lower authorization entry's default signature expiration to ~8min for security reasons ([#1023](https://github.com/stellar/js-stellar-sdk/pull/1023)).
28
+ - Remove `statusText` error check to broaden compatibility ([#1001](https://github.com/stellar/js-stellar-sdk/pull/1001)).
29
+ - 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)).
30
+
31
+
32
+ ## [v12.2.0](https://github.com/stellar/js-stellar-sdk/compare/v12.1.0...v12.2.0)
33
+
34
+ ### Fixed
35
+ - `@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)).
36
+
37
+ ### Added
38
+ - You can now pass custom headers to both `rpc.Server` and `Horizon.Server` ([#1013](https://github.com/stellar/js-stellar-sdk/pull/1013)):
39
+ ```typescript
40
+ import { Server } from "@stellar/stellar-sdk/rpc";
41
+
42
+ const s = new Server("<some URL>", { headers: { "X-Custom-Header": "hello" }})
43
+ ```
44
+ - `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:
45
+ ```typescript
46
+ interface SubmitAsyncTransactionResponse {
47
+ // the submitted transaction hash
48
+ hash: string;
49
+ // one of "PENDING", "DUPLICATE", "TRY_AGAIN_LATER", or "ERROR"
50
+ tx_status: string;
51
+ // a base64-encoded xdr.TransactionResult iff `tx_status` is "ERROR"
52
+ error_result_xdr: string;
53
+ }
54
+ ```
55
+ - `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)):
56
+ ```typescript
57
+ export interface GetFeeStatsResponse {
58
+ sorobanInclusionFee: FeeDistribution;
59
+ inclusionFee: FeeDistribution;
60
+ latestLedger: number; // uint32
61
+ }
62
+
63
+ interface FeeDistribution {
64
+ max: string; // uint64
65
+ min: string; // uint64
66
+ mode: string; // uint64
67
+ p10: string; // uint64
68
+ p20: string; // uint64
69
+ p30: string; // uint64
70
+ p40: string; // uint64
71
+ p50: string; // uint64
72
+ p60: string; // uint64
73
+ p70: string; // uint64
74
+ p80: string; // uint64
75
+ p90: string; // uint64
76
+ p95: string; // uint64
77
+ p99: string; // uint64
78
+ transactionCount: string; // uint32
79
+ ledgerCount: number; // uint32
80
+ }
81
+ ```
82
+
83
+
10
84
  ## [v12.1.0](https://github.com/stellar/js-stellar-sdk/compare/v12.0.1...v12.1.0)
11
85
 
12
86
  ### Added
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://badge.fury.io/js/stellar-sdk"><img src="https://badge.fury.io/js/stellar-sdk.svg" alt="npm version" height="18"></a>
11
- <a href="https://www.npmjs.com/package/stellar-sdk">
11
+ <a href="https://www.npmjs.com/package/@stellar/stellar-sdk">
12
12
  <img alt="Weekly Downloads" src="https://img.shields.io/npm/dw/stellar-sdk" />
13
13
  </a>
14
14
  <a href="https://github.com/stellar/js-stellar-sdk/actions/workflows/tests.yml"><img alt="Test Status" src="https://github.com/stellar/js-stellar-sdk/actions/workflows/tests.yml/badge.svg" /></a>