@stellar/stellar-sdk 12.0.1 → 12.2.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 (62) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/stellar-sdk.js +1415 -1114
  3. package/dist/stellar-sdk.min.js +1 -1
  4. package/lib/browser.d.ts +1 -1
  5. package/lib/browser.js +4 -4
  6. package/lib/config.js +5 -2
  7. package/lib/contract/assembled_transaction.d.ts +102 -29
  8. package/lib/contract/assembled_transaction.js +361 -127
  9. package/lib/contract/client.d.ts +1 -1
  10. package/lib/contract/client.js +5 -2
  11. package/lib/contract/sent_transaction.d.ts +14 -18
  12. package/lib/contract/sent_transaction.js +17 -33
  13. package/lib/contract/spec.d.ts +1 -1
  14. package/lib/contract/spec.js +921 -956
  15. package/lib/contract/types.d.ts +10 -0
  16. package/lib/contract/types.js +4 -1
  17. package/lib/contract/utils.d.ts +4 -6
  18. package/lib/contract/utils.js +20 -2
  19. package/lib/errors.d.ts +4 -4
  20. package/lib/federation/server.d.ts +1 -1
  21. package/lib/horizon/account_call_builder.d.ts +2 -3
  22. package/lib/horizon/account_response.d.ts +1 -1
  23. package/lib/horizon/assets_call_builder.d.ts +2 -3
  24. package/lib/horizon/call_builder.d.ts +8 -8
  25. package/lib/horizon/call_builder.js +2 -6
  26. package/lib/horizon/claimable_balances_call_builder.d.ts +3 -4
  27. package/lib/horizon/effect_call_builder.d.ts +2 -3
  28. package/lib/horizon/friendbot_builder.d.ts +0 -1
  29. package/lib/horizon/horizon_api.d.ts +5 -1
  30. package/lib/horizon/horizon_axios_client.js +6 -6
  31. package/lib/horizon/ledger_call_builder.d.ts +2 -3
  32. package/lib/horizon/liquidity_pool_call_builder.d.ts +2 -4
  33. package/lib/horizon/offer_call_builder.d.ts +2 -3
  34. package/lib/horizon/operation_call_builder.d.ts +3 -4
  35. package/lib/horizon/orderbook_call_builder.d.ts +0 -1
  36. package/lib/horizon/path_call_builder.d.ts +1 -2
  37. package/lib/horizon/payment_call_builder.d.ts +2 -3
  38. package/lib/horizon/server.d.ts +29 -10
  39. package/lib/horizon/server.js +98 -55
  40. package/lib/horizon/strict_receive_path_call_builder.d.ts +1 -2
  41. package/lib/horizon/strict_send_path_call_builder.d.ts +1 -2
  42. package/lib/horizon/trade_aggregation_call_builder.d.ts +9 -10
  43. package/lib/horizon/trade_aggregation_call_builder.js +3 -7
  44. package/lib/horizon/trades_call_builder.d.ts +2 -3
  45. package/lib/horizon/transaction_call_builder.d.ts +3 -4
  46. package/lib/horizon/types/assets.d.ts +1 -1
  47. package/lib/horizon/types/effects.d.ts +1 -1
  48. package/lib/horizon/types/offer.d.ts +1 -1
  49. package/lib/index.d.ts +0 -1
  50. package/lib/rpc/api.d.ts +29 -5
  51. package/lib/rpc/browser.d.ts +1 -1
  52. package/lib/rpc/browser.js +4 -4
  53. package/lib/rpc/index.d.ts +0 -1
  54. package/lib/rpc/jsonrpc.js +3 -3
  55. package/lib/rpc/parsers.d.ts +3 -3
  56. package/lib/rpc/parsers.js +23 -23
  57. package/lib/rpc/server.d.ts +13 -7
  58. package/lib/rpc/server.js +48 -56
  59. package/lib/rpc/transaction.d.ts +3 -4
  60. package/lib/rpc/transaction.js +23 -25
  61. package/lib/webauth/utils.js +3 -3
  62. package/package.json +24 -33
package/CHANGELOG.md CHANGED
@@ -7,6 +7,76 @@ A breaking change will get clearly marked in this log.
7
7
  ## Unreleased
8
8
 
9
9
 
10
+ ## [v12.2.0](https://github.com/stellar/js-stellar-sdk/compare/v12.1.0...v12.2.0)
11
+
12
+ ### Fixed
13
+ - `@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)).
14
+
15
+ ### Added
16
+ - You can now pass custom headers to both `rpc.Server` and `Horizon.Server` ([#1013](https://github.com/stellar/js-stellar-sdk/pull/1013)):
17
+ ```typescript
18
+ import { Server } from "@stellar/stellar-sdk/rpc";
19
+
20
+ const s = new Server("<some URL>", { headers: { "X-Custom-Header": "hello" }})
21
+ ```
22
+ - `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:
23
+ ```typescript
24
+ interface SubmitAsyncTransactionResponse {
25
+ // the submitted transaction hash
26
+ hash: string;
27
+ // one of "PENDING", "DUPLICATE", "TRY_AGAIN_LATER", or "ERROR"
28
+ tx_status: string;
29
+ // a base64-encoded xdr.TransactionResult iff `tx_status` is "ERROR"
30
+ error_result_xdr: string;
31
+ }
32
+ ```
33
+ - `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)):
34
+ ```typescript
35
+ export interface GetFeeStatsResponse {
36
+ sorobanInclusionFee: FeeDistribution;
37
+ inclusionFee: FeeDistribution;
38
+ latestLedger: number; // uint32
39
+ }
40
+
41
+ interface FeeDistribution {
42
+ max: string; // uint64
43
+ min: string; // uint64
44
+ mode: string; // uint64
45
+ p10: string; // uint64
46
+ p20: string; // uint64
47
+ p30: string; // uint64
48
+ p40: string; // uint64
49
+ p50: string; // uint64
50
+ p60: string; // uint64
51
+ p70: string; // uint64
52
+ p80: string; // uint64
53
+ p90: string; // uint64
54
+ p95: string; // uint64
55
+ p99: string; // uint64
56
+ transactionCount: string; // uint32
57
+ ledgerCount: number; // uint32
58
+ }
59
+ ```
60
+
61
+
62
+ ## [v12.1.0](https://github.com/stellar/js-stellar-sdk/compare/v12.0.1...v12.1.0)
63
+
64
+ ### Added
65
+ - `contract` now exports the `DEFAULT_TIMEOUT` ([#984](https://github.com/stellar/js-stellar-sdk/pull/984)).
66
+ - `contract.AssembledTransaction` now has:
67
+ - `toXDR` and `fromXDR` methods for serializing the transaction to and from XDR. These methods should be used in place of `AssembledTransaction.toJSON` and `AssembledTransaction.fromJSON`for multi-auth signing. The JSON methods are now deprecated. **Note:** you must now call `simulate` on the transaction before the final `signAndSend` call after all required signatures are gathered when using the XDR methods ([#977](https://github.com/stellar/js-stellar-sdk/pull/977)).
68
+ - a `restoreFootprint` method which accepts the `restorePreamble` returned when a simulation call fails due to some contract state that has expired. When invoking a contract function, one can now set `restore` to `true` in the `MethodOptions`. When enabled, a `restoreFootprint` transaction will be created and await signing when required ([#991](https://github.com/stellar/js-stellar-sdk/pull/991)).
69
+ - separate `sign` and `send` methods so that you can sign a transaction without sending it (`signAndSend` still works as before; [#922](https://github.com/stellar/js-stellar-sdk/pull/992)).
70
+ - `contract.Client` now has a `txFromXDR` method which should be used in place of `txFromJSON` for multi-auth signing ([#977](https://github.com/stellar/js-stellar-sdk/pull/977)).
71
+
72
+ ### Deprecated
73
+ - In `contract.AssembledTransaction`, `toJSON` and `fromJSON` should be replaced with `toXDR` and `fromXDR`.
74
+ - In `contract.Client`, `txFromJSON` should be replaced with `txFromXDR`.
75
+
76
+ ### Fixed
77
+ - If you edit an `AssembledTransaction` with `tx.raw = cloneFrom(tx.build)`, the `tx.simulationData` will now be updated correctly ([#985](https://github.com/stellar/js-stellar-sdk/pull/985)).
78
+
79
+
10
80
  ## [v12.0.1](https://github.com/stellar/js-stellar-sdk/compare/v11.3.0...v12.0.1)
11
81
 
12
82
  - This is a re-tag of `v12.0.0-rc.3` with dependency updates and a single new feature.