@stellar/stellar-sdk 12.3.0 → 13.0.0-rc.1

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 (514) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +29 -7
  3. package/dist/stellar-sdk-minimal.js +46009 -0
  4. package/dist/stellar-sdk-minimal.min.js +2 -0
  5. package/dist/stellar-sdk-minimal.min.js.LICENSE.txt +69 -0
  6. package/dist/stellar-sdk-no-axios.js +56648 -0
  7. package/dist/stellar-sdk-no-axios.min.js +2 -0
  8. package/dist/stellar-sdk-no-axios.min.js.LICENSE.txt +71 -0
  9. package/dist/stellar-sdk-no-eventsource.js +49822 -0
  10. package/dist/stellar-sdk-no-eventsource.min.js +2 -0
  11. package/dist/stellar-sdk-no-eventsource.min.js.LICENSE.txt +69 -0
  12. package/dist/stellar-sdk.js +28279 -27350
  13. package/dist/stellar-sdk.min.js +1 -1
  14. package/lib/browser.d.ts +2 -2
  15. package/lib/browser.js +5 -7
  16. package/lib/config.d.ts +31 -19
  17. package/lib/contract/assembled_transaction.d.ts +22 -14
  18. package/lib/contract/assembled_transaction.js +159 -128
  19. package/lib/contract/basic_node_signer.d.ts +6 -1
  20. package/lib/contract/client.d.ts +24 -24
  21. package/lib/contract/rust_result.d.ts +22 -12
  22. package/lib/contract/sent_transaction.d.ts +9 -4
  23. package/lib/contract/sent_transaction.js +6 -6
  24. package/lib/contract/spec.d.ts +8 -14
  25. package/lib/contract/types.d.ts +81 -13
  26. package/lib/contract/utils.d.ts +8 -1
  27. package/lib/errors/account_requires_memo.d.ts +24 -0
  28. package/lib/errors/account_requires_memo.js +38 -0
  29. package/lib/errors/bad_request.d.ts +14 -0
  30. package/lib/errors/bad_request.js +34 -0
  31. package/lib/errors/bad_response.d.ts +17 -0
  32. package/lib/errors/bad_response.js +34 -0
  33. package/lib/errors/index.d.ts +5 -0
  34. package/lib/errors/index.js +60 -0
  35. package/lib/errors/network.d.ts +33 -0
  36. package/lib/{errors.js → errors/network.js} +1 -59
  37. package/lib/errors/not_found.d.ts +14 -0
  38. package/lib/errors/not_found.js +34 -0
  39. package/lib/federation/api.d.ts +21 -0
  40. package/lib/federation/index.d.ts +1 -1
  41. package/lib/federation/index.js +16 -6
  42. package/lib/federation/server.d.ts +36 -38
  43. package/lib/federation/server.js +2 -2
  44. package/lib/horizon/account_call_builder.d.ts +10 -8
  45. package/lib/horizon/account_response.d.ts +5 -2
  46. package/lib/horizon/assets_call_builder.d.ts +3 -2
  47. package/lib/horizon/call_builder.js +9 -3
  48. package/lib/horizon/claimable_balances_call_builder.d.ts +10 -8
  49. package/lib/horizon/effect_call_builder.d.ts +8 -7
  50. package/lib/horizon/horizon_axios_client.d.ts +13 -6
  51. package/lib/horizon/horizon_axios_client.js +16 -4
  52. package/lib/horizon/index.d.ts +2 -1
  53. package/lib/horizon/index.js +1 -1
  54. package/lib/horizon/ledger_call_builder.d.ts +6 -4
  55. package/lib/horizon/liquidity_pool_call_builder.d.ts +3 -2
  56. package/lib/horizon/offer_call_builder.d.ts +12 -10
  57. package/lib/horizon/operation_call_builder.d.ts +11 -9
  58. package/lib/horizon/orderbook_call_builder.d.ts +7 -2
  59. package/lib/horizon/path_call_builder.d.ts +7 -2
  60. package/lib/horizon/payment_call_builder.d.ts +10 -6
  61. package/lib/horizon/server.d.ts +64 -55
  62. package/lib/horizon/server.js +6 -5
  63. package/lib/horizon/server_api.d.ts +0 -15
  64. package/lib/horizon/strict_receive_path_call_builder.d.ts +7 -2
  65. package/lib/horizon/strict_send_path_call_builder.d.ts +7 -2
  66. package/lib/horizon/trade_aggregation_call_builder.d.ts +4 -2
  67. package/lib/horizon/trades_call_builder.d.ts +8 -5
  68. package/lib/horizon/transaction_call_builder.d.ts +10 -7
  69. package/lib/horizon/types/assets.d.ts +0 -2
  70. package/lib/http-client/axios-client.d.ts +2 -0
  71. package/lib/http-client/axios-client.js +10 -0
  72. package/lib/http-client/fetch-client.d.ts +11 -0
  73. package/lib/http-client/fetch-client.js +229 -0
  74. package/lib/http-client/index.d.ts +5 -0
  75. package/lib/http-client/index.js +33 -0
  76. package/lib/http-client/types.d.ts +69 -0
  77. package/lib/http-client/types.js +34 -0
  78. package/lib/index.d.ts +3 -8
  79. package/lib/index.js +8 -5
  80. package/lib/minimal/browser.d.ts +6 -0
  81. package/lib/minimal/browser.js +35 -0
  82. package/lib/minimal/config.d.ts +64 -0
  83. package/lib/minimal/config.js +51 -0
  84. package/lib/minimal/contract/assembled_transaction.d.ts +555 -0
  85. package/lib/minimal/contract/assembled_transaction.js +752 -0
  86. package/lib/minimal/contract/basic_node_signer.d.ts +17 -0
  87. package/lib/minimal/contract/basic_node_signer.js +52 -0
  88. package/lib/minimal/contract/client.d.ts +52 -0
  89. package/lib/minimal/contract/client.js +180 -0
  90. package/lib/minimal/contract/index.d.ts +7 -0
  91. package/lib/minimal/contract/index.js +82 -0
  92. package/lib/minimal/contract/rust_result.d.ts +81 -0
  93. package/lib/minimal/contract/rust_result.js +66 -0
  94. package/lib/minimal/contract/sent_transaction.d.ts +84 -0
  95. package/lib/minimal/contract/sent_transaction.js +151 -0
  96. package/lib/minimal/contract/spec.d.ts +152 -0
  97. package/lib/minimal/contract/spec.js +1020 -0
  98. package/lib/minimal/contract/types.d.ts +180 -0
  99. package/lib/minimal/contract/types.js +8 -0
  100. package/lib/minimal/contract/utils.d.ts +46 -0
  101. package/lib/minimal/contract/utils.js +123 -0
  102. package/lib/minimal/errors/account_requires_memo.d.ts +24 -0
  103. package/lib/minimal/errors/account_requires_memo.js +38 -0
  104. package/lib/minimal/errors/bad_request.d.ts +14 -0
  105. package/lib/minimal/errors/bad_request.js +34 -0
  106. package/lib/minimal/errors/bad_response.d.ts +17 -0
  107. package/lib/minimal/errors/bad_response.js +34 -0
  108. package/lib/minimal/errors/index.d.ts +5 -0
  109. package/lib/minimal/errors/index.js +60 -0
  110. package/lib/minimal/errors/network.d.ts +33 -0
  111. package/lib/minimal/errors/network.js +41 -0
  112. package/lib/minimal/errors/not_found.d.ts +14 -0
  113. package/lib/minimal/errors/not_found.js +34 -0
  114. package/lib/minimal/federation/api.d.ts +32 -0
  115. package/lib/minimal/federation/api.js +7 -0
  116. package/lib/minimal/federation/index.d.ts +2 -0
  117. package/lib/minimal/federation/index.js +34 -0
  118. package/lib/minimal/federation/server.d.ts +116 -0
  119. package/lib/minimal/federation/server.js +252 -0
  120. package/lib/minimal/friendbot/index.d.ts +5 -0
  121. package/lib/minimal/friendbot/index.js +7 -0
  122. package/lib/minimal/horizon/account_call_builder.d.ts +56 -0
  123. package/lib/minimal/horizon/account_call_builder.js +62 -0
  124. package/lib/minimal/horizon/account_response.d.ts +61 -0
  125. package/lib/minimal/horizon/account_response.js +49 -0
  126. package/lib/minimal/horizon/assets_call_builder.d.ts +27 -0
  127. package/lib/minimal/horizon/assets_call_builder.js +43 -0
  128. package/lib/minimal/horizon/call_builder.d.ts +128 -0
  129. package/lib/minimal/horizon/call_builder.js +362 -0
  130. package/lib/minimal/horizon/claimable_balances_call_builder.d.ts +50 -0
  131. package/lib/minimal/horizon/claimable_balances_call_builder.js +56 -0
  132. package/lib/minimal/horizon/effect_call_builder.d.ts +53 -0
  133. package/lib/minimal/horizon/effect_call_builder.js +56 -0
  134. package/lib/minimal/horizon/friendbot_builder.d.ts +4 -0
  135. package/lib/minimal/horizon/friendbot_builder.js +32 -0
  136. package/lib/minimal/horizon/horizon_api.d.ts +527 -0
  137. package/lib/minimal/horizon/horizon_api.js +96 -0
  138. package/lib/minimal/horizon/horizon_axios_client.d.ts +37 -0
  139. package/lib/minimal/horizon/horizon_axios_client.js +60 -0
  140. package/lib/minimal/horizon/index.d.ts +8 -0
  141. package/lib/minimal/horizon/index.js +78 -0
  142. package/lib/minimal/horizon/ledger_call_builder.d.ts +23 -0
  143. package/lib/minimal/horizon/ledger_call_builder.js +37 -0
  144. package/lib/minimal/horizon/liquidity_pool_call_builder.d.ts +37 -0
  145. package/lib/minimal/horizon/liquidity_pool_call_builder.js +59 -0
  146. package/lib/minimal/horizon/offer_call_builder.d.ts +65 -0
  147. package/lib/minimal/horizon/offer_call_builder.js +79 -0
  148. package/lib/minimal/horizon/operation_call_builder.d.ts +69 -0
  149. package/lib/minimal/horizon/operation_call_builder.js +69 -0
  150. package/lib/minimal/horizon/orderbook_call_builder.d.ts +20 -0
  151. package/lib/minimal/horizon/orderbook_call_builder.js +45 -0
  152. package/lib/minimal/horizon/path_call_builder.d.ts +35 -0
  153. package/lib/minimal/horizon/path_call_builder.js +41 -0
  154. package/lib/minimal/horizon/payment_call_builder.d.ts +39 -0
  155. package/lib/minimal/horizon/payment_call_builder.js +46 -0
  156. package/lib/minimal/horizon/server.d.ts +389 -0
  157. package/lib/minimal/horizon/server.js +550 -0
  158. package/lib/minimal/horizon/server_api.d.ts +263 -0
  159. package/lib/minimal/horizon/server_api.js +19 -0
  160. package/lib/minimal/horizon/strict_receive_path_call_builder.d.ts +38 -0
  161. package/lib/minimal/horizon/strict_receive_path_call_builder.js +50 -0
  162. package/lib/minimal/horizon/strict_send_path_call_builder.d.ts +38 -0
  163. package/lib/minimal/horizon/strict_send_path_call_builder.js +50 -0
  164. package/lib/minimal/horizon/trade_aggregation_call_builder.d.ts +49 -0
  165. package/lib/minimal/horizon/trade_aggregation_call_builder.js +76 -0
  166. package/lib/minimal/horizon/trades_call_builder.d.ts +52 -0
  167. package/lib/minimal/horizon/trades_call_builder.js +72 -0
  168. package/lib/minimal/horizon/transaction_call_builder.d.ts +60 -0
  169. package/lib/minimal/horizon/transaction_call_builder.js +64 -0
  170. package/lib/minimal/horizon/types/account.d.ts +5 -0
  171. package/lib/minimal/horizon/types/account.js +5 -0
  172. package/lib/minimal/horizon/types/assets.d.ts +17 -0
  173. package/lib/minimal/horizon/types/assets.js +5 -0
  174. package/lib/minimal/horizon/types/effects.d.ts +285 -0
  175. package/lib/minimal/horizon/types/effects.js +62 -0
  176. package/lib/minimal/horizon/types/offer.d.ts +20 -0
  177. package/lib/minimal/horizon/types/offer.js +5 -0
  178. package/lib/minimal/horizon/types/trade.d.ts +13 -0
  179. package/lib/minimal/horizon/types/trade.js +5 -0
  180. package/lib/minimal/http-client/axios-client.d.ts +2 -0
  181. package/lib/minimal/http-client/axios-client.js +10 -0
  182. package/lib/minimal/http-client/fetch-client.d.ts +11 -0
  183. package/lib/minimal/http-client/fetch-client.js +229 -0
  184. package/lib/minimal/http-client/index.d.ts +5 -0
  185. package/lib/minimal/http-client/index.js +33 -0
  186. package/lib/minimal/http-client/types.d.ts +69 -0
  187. package/lib/minimal/http-client/types.js +34 -0
  188. package/lib/minimal/index.d.ts +32 -0
  189. package/lib/minimal/index.js +80 -0
  190. package/lib/minimal/rpc/api.d.ts +362 -0
  191. package/lib/minimal/rpc/api.js +32 -0
  192. package/lib/minimal/rpc/axios.d.ts +4 -0
  193. package/lib/minimal/rpc/axios.js +15 -0
  194. package/lib/minimal/rpc/browser.d.ts +4 -0
  195. package/lib/minimal/rpc/browser.js +27 -0
  196. package/lib/minimal/rpc/index.d.ts +8 -0
  197. package/lib/minimal/rpc/index.js +86 -0
  198. package/lib/minimal/rpc/jsonrpc.d.ts +35 -0
  199. package/lib/minimal/rpc/jsonrpc.js +52 -0
  200. package/lib/minimal/rpc/parsers.d.ts +39 -0
  201. package/lib/minimal/rpc/parsers.js +155 -0
  202. package/lib/minimal/rpc/server.d.ts +622 -0
  203. package/lib/minimal/rpc/server.js +877 -0
  204. package/lib/minimal/rpc/transaction.d.ts +21 -0
  205. package/lib/minimal/rpc/transaction.js +53 -0
  206. package/lib/minimal/rpc/utils.d.ts +1 -0
  207. package/lib/minimal/rpc/utils.js +9 -0
  208. package/lib/minimal/stellartoml/index.d.ts +131 -0
  209. package/lib/minimal/stellartoml/index.js +77 -0
  210. package/lib/minimal/utils.d.ts +20 -0
  211. package/lib/minimal/utils.js +38 -0
  212. package/lib/minimal/webauth/errors.d.ts +13 -0
  213. package/lib/minimal/webauth/errors.js +36 -0
  214. package/lib/minimal/webauth/index.d.ts +2 -0
  215. package/lib/minimal/webauth/index.js +27 -0
  216. package/lib/minimal/webauth/utils.d.ts +307 -0
  217. package/lib/minimal/webauth/utils.js +332 -0
  218. package/lib/no-axios/browser.d.ts +6 -0
  219. package/lib/no-axios/browser.js +35 -0
  220. package/lib/no-axios/config.d.ts +64 -0
  221. package/lib/no-axios/config.js +51 -0
  222. package/lib/no-axios/contract/assembled_transaction.d.ts +555 -0
  223. package/lib/no-axios/contract/assembled_transaction.js +752 -0
  224. package/lib/no-axios/contract/basic_node_signer.d.ts +17 -0
  225. package/lib/no-axios/contract/basic_node_signer.js +52 -0
  226. package/lib/no-axios/contract/client.d.ts +52 -0
  227. package/lib/no-axios/contract/client.js +180 -0
  228. package/lib/no-axios/contract/index.d.ts +7 -0
  229. package/lib/no-axios/contract/index.js +82 -0
  230. package/lib/no-axios/contract/rust_result.d.ts +81 -0
  231. package/lib/no-axios/contract/rust_result.js +66 -0
  232. package/lib/no-axios/contract/sent_transaction.d.ts +84 -0
  233. package/lib/no-axios/contract/sent_transaction.js +151 -0
  234. package/lib/no-axios/contract/spec.d.ts +152 -0
  235. package/lib/no-axios/contract/spec.js +1020 -0
  236. package/lib/no-axios/contract/types.d.ts +180 -0
  237. package/lib/no-axios/contract/types.js +8 -0
  238. package/lib/no-axios/contract/utils.d.ts +46 -0
  239. package/lib/no-axios/contract/utils.js +123 -0
  240. package/lib/no-axios/errors/account_requires_memo.d.ts +24 -0
  241. package/lib/no-axios/errors/account_requires_memo.js +38 -0
  242. package/lib/no-axios/errors/bad_request.d.ts +14 -0
  243. package/lib/no-axios/errors/bad_request.js +34 -0
  244. package/lib/no-axios/errors/bad_response.d.ts +17 -0
  245. package/lib/no-axios/errors/bad_response.js +34 -0
  246. package/lib/no-axios/errors/index.d.ts +5 -0
  247. package/lib/no-axios/errors/index.js +60 -0
  248. package/lib/no-axios/errors/network.d.ts +33 -0
  249. package/lib/no-axios/errors/network.js +41 -0
  250. package/lib/no-axios/errors/not_found.d.ts +14 -0
  251. package/lib/no-axios/errors/not_found.js +34 -0
  252. package/lib/no-axios/federation/api.d.ts +32 -0
  253. package/lib/no-axios/federation/api.js +7 -0
  254. package/lib/no-axios/federation/index.d.ts +2 -0
  255. package/lib/no-axios/federation/index.js +34 -0
  256. package/lib/no-axios/federation/server.d.ts +116 -0
  257. package/lib/no-axios/federation/server.js +252 -0
  258. package/lib/no-axios/friendbot/index.d.ts +5 -0
  259. package/lib/no-axios/friendbot/index.js +7 -0
  260. package/lib/no-axios/horizon/account_call_builder.d.ts +56 -0
  261. package/lib/no-axios/horizon/account_call_builder.js +62 -0
  262. package/lib/no-axios/horizon/account_response.d.ts +61 -0
  263. package/lib/no-axios/horizon/account_response.js +49 -0
  264. package/lib/no-axios/horizon/assets_call_builder.d.ts +27 -0
  265. package/lib/no-axios/horizon/assets_call_builder.js +43 -0
  266. package/lib/no-axios/horizon/call_builder.d.ts +128 -0
  267. package/lib/no-axios/horizon/call_builder.js +362 -0
  268. package/lib/no-axios/horizon/claimable_balances_call_builder.d.ts +50 -0
  269. package/lib/no-axios/horizon/claimable_balances_call_builder.js +56 -0
  270. package/lib/no-axios/horizon/effect_call_builder.d.ts +53 -0
  271. package/lib/no-axios/horizon/effect_call_builder.js +56 -0
  272. package/lib/no-axios/horizon/friendbot_builder.d.ts +4 -0
  273. package/lib/no-axios/horizon/friendbot_builder.js +32 -0
  274. package/lib/no-axios/horizon/horizon_api.d.ts +527 -0
  275. package/lib/no-axios/horizon/horizon_api.js +96 -0
  276. package/lib/no-axios/horizon/horizon_axios_client.d.ts +37 -0
  277. package/lib/no-axios/horizon/horizon_axios_client.js +60 -0
  278. package/lib/no-axios/horizon/index.d.ts +8 -0
  279. package/lib/no-axios/horizon/index.js +78 -0
  280. package/lib/no-axios/horizon/ledger_call_builder.d.ts +23 -0
  281. package/lib/no-axios/horizon/ledger_call_builder.js +37 -0
  282. package/lib/no-axios/horizon/liquidity_pool_call_builder.d.ts +37 -0
  283. package/lib/no-axios/horizon/liquidity_pool_call_builder.js +59 -0
  284. package/lib/no-axios/horizon/offer_call_builder.d.ts +65 -0
  285. package/lib/no-axios/horizon/offer_call_builder.js +79 -0
  286. package/lib/no-axios/horizon/operation_call_builder.d.ts +69 -0
  287. package/lib/no-axios/horizon/operation_call_builder.js +69 -0
  288. package/lib/no-axios/horizon/orderbook_call_builder.d.ts +20 -0
  289. package/lib/no-axios/horizon/orderbook_call_builder.js +45 -0
  290. package/lib/no-axios/horizon/path_call_builder.d.ts +35 -0
  291. package/lib/no-axios/horizon/path_call_builder.js +41 -0
  292. package/lib/no-axios/horizon/payment_call_builder.d.ts +39 -0
  293. package/lib/no-axios/horizon/payment_call_builder.js +46 -0
  294. package/lib/no-axios/horizon/server.d.ts +389 -0
  295. package/lib/no-axios/horizon/server.js +550 -0
  296. package/lib/no-axios/horizon/server_api.d.ts +263 -0
  297. package/lib/no-axios/horizon/server_api.js +19 -0
  298. package/lib/no-axios/horizon/strict_receive_path_call_builder.d.ts +38 -0
  299. package/lib/no-axios/horizon/strict_receive_path_call_builder.js +50 -0
  300. package/lib/no-axios/horizon/strict_send_path_call_builder.d.ts +38 -0
  301. package/lib/no-axios/horizon/strict_send_path_call_builder.js +50 -0
  302. package/lib/no-axios/horizon/trade_aggregation_call_builder.d.ts +49 -0
  303. package/lib/no-axios/horizon/trade_aggregation_call_builder.js +76 -0
  304. package/lib/no-axios/horizon/trades_call_builder.d.ts +52 -0
  305. package/lib/no-axios/horizon/trades_call_builder.js +72 -0
  306. package/lib/no-axios/horizon/transaction_call_builder.d.ts +60 -0
  307. package/lib/no-axios/horizon/transaction_call_builder.js +64 -0
  308. package/lib/no-axios/horizon/types/account.d.ts +5 -0
  309. package/lib/no-axios/horizon/types/account.js +5 -0
  310. package/lib/no-axios/horizon/types/assets.d.ts +17 -0
  311. package/lib/no-axios/horizon/types/assets.js +5 -0
  312. package/lib/no-axios/horizon/types/effects.d.ts +285 -0
  313. package/lib/no-axios/horizon/types/effects.js +62 -0
  314. package/lib/no-axios/horizon/types/offer.d.ts +20 -0
  315. package/lib/no-axios/horizon/types/offer.js +5 -0
  316. package/lib/no-axios/horizon/types/trade.d.ts +13 -0
  317. package/lib/no-axios/horizon/types/trade.js +5 -0
  318. package/lib/no-axios/http-client/axios-client.d.ts +2 -0
  319. package/lib/no-axios/http-client/axios-client.js +10 -0
  320. package/lib/no-axios/http-client/fetch-client.d.ts +11 -0
  321. package/lib/no-axios/http-client/fetch-client.js +229 -0
  322. package/lib/no-axios/http-client/index.d.ts +5 -0
  323. package/lib/no-axios/http-client/index.js +33 -0
  324. package/lib/no-axios/http-client/types.d.ts +69 -0
  325. package/lib/no-axios/http-client/types.js +34 -0
  326. package/lib/no-axios/index.d.ts +32 -0
  327. package/lib/no-axios/index.js +80 -0
  328. package/lib/no-axios/rpc/api.d.ts +362 -0
  329. package/lib/no-axios/rpc/api.js +32 -0
  330. package/lib/no-axios/rpc/axios.d.ts +4 -0
  331. package/lib/no-axios/rpc/axios.js +15 -0
  332. package/lib/no-axios/rpc/browser.d.ts +4 -0
  333. package/lib/no-axios/rpc/browser.js +27 -0
  334. package/lib/no-axios/rpc/index.d.ts +8 -0
  335. package/lib/no-axios/rpc/index.js +86 -0
  336. package/lib/no-axios/rpc/jsonrpc.d.ts +35 -0
  337. package/lib/no-axios/rpc/jsonrpc.js +52 -0
  338. package/lib/no-axios/rpc/parsers.d.ts +39 -0
  339. package/lib/no-axios/rpc/parsers.js +155 -0
  340. package/lib/no-axios/rpc/server.d.ts +622 -0
  341. package/lib/no-axios/rpc/server.js +877 -0
  342. package/lib/no-axios/rpc/transaction.d.ts +21 -0
  343. package/lib/no-axios/rpc/transaction.js +53 -0
  344. package/lib/no-axios/rpc/utils.d.ts +1 -0
  345. package/lib/no-axios/rpc/utils.js +9 -0
  346. package/lib/no-axios/stellartoml/index.d.ts +131 -0
  347. package/lib/no-axios/stellartoml/index.js +77 -0
  348. package/lib/no-axios/utils.d.ts +20 -0
  349. package/lib/no-axios/utils.js +38 -0
  350. package/lib/no-axios/webauth/errors.d.ts +13 -0
  351. package/lib/no-axios/webauth/errors.js +36 -0
  352. package/lib/no-axios/webauth/index.d.ts +2 -0
  353. package/lib/no-axios/webauth/index.js +27 -0
  354. package/lib/no-axios/webauth/utils.d.ts +307 -0
  355. package/lib/no-axios/webauth/utils.js +332 -0
  356. package/lib/no-eventsource/browser.d.ts +6 -0
  357. package/lib/no-eventsource/browser.js +35 -0
  358. package/lib/no-eventsource/config.d.ts +64 -0
  359. package/lib/no-eventsource/config.js +51 -0
  360. package/lib/no-eventsource/contract/assembled_transaction.d.ts +555 -0
  361. package/lib/no-eventsource/contract/assembled_transaction.js +752 -0
  362. package/lib/no-eventsource/contract/basic_node_signer.d.ts +17 -0
  363. package/lib/no-eventsource/contract/basic_node_signer.js +52 -0
  364. package/lib/no-eventsource/contract/client.d.ts +52 -0
  365. package/lib/no-eventsource/contract/client.js +180 -0
  366. package/lib/no-eventsource/contract/index.d.ts +7 -0
  367. package/lib/no-eventsource/contract/index.js +82 -0
  368. package/lib/no-eventsource/contract/rust_result.d.ts +81 -0
  369. package/lib/no-eventsource/contract/rust_result.js +66 -0
  370. package/lib/no-eventsource/contract/sent_transaction.d.ts +84 -0
  371. package/lib/no-eventsource/contract/sent_transaction.js +151 -0
  372. package/lib/no-eventsource/contract/spec.d.ts +152 -0
  373. package/lib/no-eventsource/contract/spec.js +1020 -0
  374. package/lib/no-eventsource/contract/types.d.ts +180 -0
  375. package/lib/no-eventsource/contract/types.js +8 -0
  376. package/lib/no-eventsource/contract/utils.d.ts +46 -0
  377. package/lib/no-eventsource/contract/utils.js +123 -0
  378. package/lib/no-eventsource/errors/account_requires_memo.d.ts +24 -0
  379. package/lib/no-eventsource/errors/account_requires_memo.js +38 -0
  380. package/lib/no-eventsource/errors/bad_request.d.ts +14 -0
  381. package/lib/no-eventsource/errors/bad_request.js +34 -0
  382. package/lib/no-eventsource/errors/bad_response.d.ts +17 -0
  383. package/lib/no-eventsource/errors/bad_response.js +34 -0
  384. package/lib/no-eventsource/errors/index.d.ts +5 -0
  385. package/lib/no-eventsource/errors/index.js +60 -0
  386. package/lib/no-eventsource/errors/network.d.ts +33 -0
  387. package/lib/no-eventsource/errors/network.js +41 -0
  388. package/lib/no-eventsource/errors/not_found.d.ts +14 -0
  389. package/lib/no-eventsource/errors/not_found.js +34 -0
  390. package/lib/no-eventsource/federation/api.d.ts +32 -0
  391. package/lib/no-eventsource/federation/api.js +7 -0
  392. package/lib/no-eventsource/federation/index.d.ts +2 -0
  393. package/lib/no-eventsource/federation/index.js +34 -0
  394. package/lib/no-eventsource/federation/server.d.ts +116 -0
  395. package/lib/no-eventsource/federation/server.js +252 -0
  396. package/lib/no-eventsource/friendbot/index.d.ts +5 -0
  397. package/lib/no-eventsource/friendbot/index.js +7 -0
  398. package/lib/no-eventsource/horizon/account_call_builder.d.ts +56 -0
  399. package/lib/no-eventsource/horizon/account_call_builder.js +62 -0
  400. package/lib/no-eventsource/horizon/account_response.d.ts +61 -0
  401. package/lib/no-eventsource/horizon/account_response.js +49 -0
  402. package/lib/no-eventsource/horizon/assets_call_builder.d.ts +27 -0
  403. package/lib/no-eventsource/horizon/assets_call_builder.js +43 -0
  404. package/lib/no-eventsource/horizon/call_builder.d.ts +128 -0
  405. package/lib/no-eventsource/horizon/call_builder.js +362 -0
  406. package/lib/no-eventsource/horizon/claimable_balances_call_builder.d.ts +50 -0
  407. package/lib/no-eventsource/horizon/claimable_balances_call_builder.js +56 -0
  408. package/lib/no-eventsource/horizon/effect_call_builder.d.ts +53 -0
  409. package/lib/no-eventsource/horizon/effect_call_builder.js +56 -0
  410. package/lib/no-eventsource/horizon/friendbot_builder.d.ts +4 -0
  411. package/lib/no-eventsource/horizon/friendbot_builder.js +32 -0
  412. package/lib/no-eventsource/horizon/horizon_api.d.ts +527 -0
  413. package/lib/no-eventsource/horizon/horizon_api.js +96 -0
  414. package/lib/no-eventsource/horizon/horizon_axios_client.d.ts +37 -0
  415. package/lib/no-eventsource/horizon/horizon_axios_client.js +60 -0
  416. package/lib/no-eventsource/horizon/index.d.ts +8 -0
  417. package/lib/no-eventsource/horizon/index.js +78 -0
  418. package/lib/no-eventsource/horizon/ledger_call_builder.d.ts +23 -0
  419. package/lib/no-eventsource/horizon/ledger_call_builder.js +37 -0
  420. package/lib/no-eventsource/horizon/liquidity_pool_call_builder.d.ts +37 -0
  421. package/lib/no-eventsource/horizon/liquidity_pool_call_builder.js +59 -0
  422. package/lib/no-eventsource/horizon/offer_call_builder.d.ts +65 -0
  423. package/lib/no-eventsource/horizon/offer_call_builder.js +79 -0
  424. package/lib/no-eventsource/horizon/operation_call_builder.d.ts +69 -0
  425. package/lib/no-eventsource/horizon/operation_call_builder.js +69 -0
  426. package/lib/no-eventsource/horizon/orderbook_call_builder.d.ts +20 -0
  427. package/lib/no-eventsource/horizon/orderbook_call_builder.js +45 -0
  428. package/lib/no-eventsource/horizon/path_call_builder.d.ts +35 -0
  429. package/lib/no-eventsource/horizon/path_call_builder.js +41 -0
  430. package/lib/no-eventsource/horizon/payment_call_builder.d.ts +39 -0
  431. package/lib/no-eventsource/horizon/payment_call_builder.js +46 -0
  432. package/lib/no-eventsource/horizon/server.d.ts +389 -0
  433. package/lib/no-eventsource/horizon/server.js +550 -0
  434. package/lib/no-eventsource/horizon/server_api.d.ts +263 -0
  435. package/lib/no-eventsource/horizon/server_api.js +19 -0
  436. package/lib/no-eventsource/horizon/strict_receive_path_call_builder.d.ts +38 -0
  437. package/lib/no-eventsource/horizon/strict_receive_path_call_builder.js +50 -0
  438. package/lib/no-eventsource/horizon/strict_send_path_call_builder.d.ts +38 -0
  439. package/lib/no-eventsource/horizon/strict_send_path_call_builder.js +50 -0
  440. package/lib/no-eventsource/horizon/trade_aggregation_call_builder.d.ts +49 -0
  441. package/lib/no-eventsource/horizon/trade_aggregation_call_builder.js +76 -0
  442. package/lib/no-eventsource/horizon/trades_call_builder.d.ts +52 -0
  443. package/lib/no-eventsource/horizon/trades_call_builder.js +72 -0
  444. package/lib/no-eventsource/horizon/transaction_call_builder.d.ts +60 -0
  445. package/lib/no-eventsource/horizon/transaction_call_builder.js +64 -0
  446. package/lib/no-eventsource/horizon/types/account.d.ts +5 -0
  447. package/lib/no-eventsource/horizon/types/account.js +5 -0
  448. package/lib/no-eventsource/horizon/types/assets.d.ts +17 -0
  449. package/lib/no-eventsource/horizon/types/assets.js +5 -0
  450. package/lib/no-eventsource/horizon/types/effects.d.ts +285 -0
  451. package/lib/no-eventsource/horizon/types/effects.js +62 -0
  452. package/lib/no-eventsource/horizon/types/offer.d.ts +20 -0
  453. package/lib/no-eventsource/horizon/types/offer.js +5 -0
  454. package/lib/no-eventsource/horizon/types/trade.d.ts +13 -0
  455. package/lib/no-eventsource/horizon/types/trade.js +5 -0
  456. package/lib/no-eventsource/http-client/axios-client.d.ts +2 -0
  457. package/lib/no-eventsource/http-client/axios-client.js +10 -0
  458. package/lib/no-eventsource/http-client/fetch-client.d.ts +11 -0
  459. package/lib/no-eventsource/http-client/fetch-client.js +229 -0
  460. package/lib/no-eventsource/http-client/index.d.ts +5 -0
  461. package/lib/no-eventsource/http-client/index.js +33 -0
  462. package/lib/no-eventsource/http-client/types.d.ts +69 -0
  463. package/lib/no-eventsource/http-client/types.js +34 -0
  464. package/lib/no-eventsource/index.d.ts +32 -0
  465. package/lib/no-eventsource/index.js +80 -0
  466. package/lib/no-eventsource/rpc/api.d.ts +362 -0
  467. package/lib/no-eventsource/rpc/api.js +32 -0
  468. package/lib/no-eventsource/rpc/axios.d.ts +4 -0
  469. package/lib/no-eventsource/rpc/axios.js +15 -0
  470. package/lib/no-eventsource/rpc/browser.d.ts +4 -0
  471. package/lib/no-eventsource/rpc/browser.js +27 -0
  472. package/lib/no-eventsource/rpc/index.d.ts +8 -0
  473. package/lib/no-eventsource/rpc/index.js +86 -0
  474. package/lib/no-eventsource/rpc/jsonrpc.d.ts +35 -0
  475. package/lib/no-eventsource/rpc/jsonrpc.js +52 -0
  476. package/lib/no-eventsource/rpc/parsers.d.ts +39 -0
  477. package/lib/no-eventsource/rpc/parsers.js +155 -0
  478. package/lib/no-eventsource/rpc/server.d.ts +622 -0
  479. package/lib/no-eventsource/rpc/server.js +877 -0
  480. package/lib/no-eventsource/rpc/transaction.d.ts +21 -0
  481. package/lib/no-eventsource/rpc/transaction.js +53 -0
  482. package/lib/no-eventsource/rpc/utils.d.ts +1 -0
  483. package/lib/no-eventsource/rpc/utils.js +9 -0
  484. package/lib/no-eventsource/stellartoml/index.d.ts +131 -0
  485. package/lib/no-eventsource/stellartoml/index.js +77 -0
  486. package/lib/no-eventsource/utils.d.ts +20 -0
  487. package/lib/no-eventsource/utils.js +38 -0
  488. package/lib/no-eventsource/webauth/errors.d.ts +13 -0
  489. package/lib/no-eventsource/webauth/errors.js +36 -0
  490. package/lib/no-eventsource/webauth/index.d.ts +2 -0
  491. package/lib/no-eventsource/webauth/index.js +27 -0
  492. package/lib/no-eventsource/webauth/utils.d.ts +307 -0
  493. package/lib/no-eventsource/webauth/utils.js +332 -0
  494. package/lib/rpc/api.d.ts +25 -11
  495. package/lib/rpc/axios.d.ts +3 -2
  496. package/lib/rpc/axios.js +3 -4
  497. package/lib/rpc/browser.d.ts +0 -2
  498. package/lib/rpc/browser.js +1 -11
  499. package/lib/rpc/index.d.ts +2 -1
  500. package/lib/rpc/index.js +15 -1
  501. package/lib/rpc/jsonrpc.d.ts +9 -1
  502. package/lib/rpc/parsers.d.ts +31 -11
  503. package/lib/rpc/parsers.js +14 -14
  504. package/lib/rpc/server.d.ts +207 -99
  505. package/lib/rpc/server.js +273 -133
  506. package/lib/rpc/transaction.d.ts +11 -9
  507. package/lib/stellartoml/index.d.ts +21 -11
  508. package/lib/stellartoml/index.js +3 -3
  509. package/lib/utils.d.ts +12 -4
  510. package/lib/utils.js +7 -0
  511. package/lib/webauth/errors.d.ts +9 -0
  512. package/lib/webauth/utils.d.ts +67 -54
  513. package/package.json +73 -21
  514. package/lib/errors.d.ts +0 -59
@@ -1,4 +1,4 @@
1
- export declare const version: any;
1
+ export declare const version: string;
2
2
  export interface ServerTime {
3
3
  serverTime: number;
4
4
  localTimeRecorded: number;
@@ -10,18 +10,25 @@ export interface ServerTime {
10
10
  * each entry will map the server domain to the last-known time and the local
11
11
  * time it was recorded, ex:
12
12
  *
13
- * "horizon-testnet.stellar.org": {
14
- * serverTime: 1552513039,
15
- * localTimeRecorded: 1552513052
16
- * }
13
+ * @example
14
+ * "horizon-testnet.stellar.org": {
15
+ * serverTime: 1552513039,
16
+ * localTimeRecorded: 1552513052
17
+ * }
18
+ *
19
+ * @constant {Record.<string, ServerTime>}
20
+ * @default {}
21
+ * @memberof module:Horizon
17
22
  */
18
23
  export declare const SERVER_TIME_MAP: Record<string, ServerTime>;
19
- export declare const AxiosClient: import("axios").AxiosInstance;
24
+ export declare const AxiosClient: import("../http-client").HttpClient;
20
25
  export default AxiosClient;
21
26
  /**
22
27
  * Given a hostname, get the current time of that server (i.e., use the last-
23
28
  * recorded server time and offset it by the time since then.) If there IS no
24
29
  * recorded server time, or it's been 5 minutes since the last, return null.
30
+ * @memberof module:Horizon
31
+ *
25
32
  * @param {string} hostname Hostname of a Horizon server.
26
33
  * @returns {number} The UNIX timestamp (in seconds, not milliseconds)
27
34
  * representing the current time on that server, or `null` if we don't have
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = exports.SERVER_TIME_MAP = exports.AxiosClient = void 0;
7
7
  exports.getCurrentServerTime = getCurrentServerTime;
8
8
  exports.version = void 0;
9
- var _axios = _interopRequireDefault(require("axios"));
10
9
  var _urijs = _interopRequireDefault(require("urijs"));
10
+ var _httpClient = require("../http-client");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- var version = exports.version = require("../../package.json").version;
12
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
+ var version = exports.version = "13.0.0-rc.1";
13
14
  var SERVER_TIME_MAP = exports.SERVER_TIME_MAP = {};
14
- var AxiosClient = exports.AxiosClient = _axios.default.create({
15
+ var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
15
16
  headers: {
16
17
  "X-Client-Name": "js-stellar-sdk",
17
18
  "X-Client-Version": version
@@ -22,7 +23,18 @@ function toSeconds(ms) {
22
23
  }
23
24
  AxiosClient.interceptors.response.use(function (response) {
24
25
  var hostname = (0, _urijs.default)(response.config.url).hostname();
25
- var serverTime = toSeconds(Date.parse(response.headers.date));
26
+ var serverTime = 0;
27
+ if (response.headers instanceof Headers) {
28
+ var dateHeader = response.headers.get('date');
29
+ if (dateHeader) {
30
+ serverTime = toSeconds(Date.parse(dateHeader));
31
+ }
32
+ } else if (_typeof(response.headers) === 'object' && 'date' in response.headers) {
33
+ var headers = response.headers;
34
+ if (typeof headers.date === 'string') {
35
+ serverTime = toSeconds(Date.parse(headers.date));
36
+ }
37
+ }
26
38
  var localTimeRecorded = toSeconds(new Date().getTime());
27
39
  if (!Number.isNaN(serverTime)) {
28
40
  SERVER_TIME_MAP[hostname] = {
@@ -1,7 +1,8 @@
1
+ /** @module Horizon */
1
2
  export * from "./horizon_api";
2
3
  export * from "./server_api";
3
4
  export * from "./account_response";
4
- export { Server } from "./server";
5
+ export { HorizonServer as Server } from "./server";
5
6
  export { default as AxiosClient, SERVER_TIME_MAP, getCurrentServerTime } from "./horizon_axios_client";
6
7
  declare const _default: any;
7
8
  export default _default;
@@ -25,7 +25,7 @@ Object.defineProperty(exports, "SERVER_TIME_MAP", {
25
25
  Object.defineProperty(exports, "Server", {
26
26
  enumerable: true,
27
27
  get: function get() {
28
- return _server.Server;
28
+ return _server.HorizonServer;
29
29
  }
30
30
  });
31
31
  exports.default = void 0;
@@ -2,12 +2,14 @@ import { CallBuilder } from "./call_builder";
2
2
  import { ServerApi } from "./server_api";
3
3
  /**
4
4
  * Creates a new {@link LedgerCallBuilder} pointed to server defined by serverUrl.
5
- * Do not create this object directly, use {@link Server#ledgers}.
6
5
  *
7
- * @see [All Ledgers](https://developers.stellar.org/api/resources/ledgers/list/)
8
- * @class
9
- * @class LedgerCallBuilder
6
+ * Do not create this object directly, use {@link Horizon.Server#ledgers}.
7
+ *
8
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/list-all-ledgers|All Ledgers}
9
+ *
10
10
  * @augments CallBuilder
11
+ * @private
12
+ * @class
11
13
  * @param {string} serverUrl Horizon server URL.
12
14
  */
13
15
  export declare class LedgerCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.LedgerRecord>> {
@@ -3,10 +3,11 @@ import { CallBuilder } from "./call_builder";
3
3
  import { ServerApi } from "./server_api";
4
4
  /**
5
5
  * Creates a new {@link LiquidityPoolCallBuilder} pointed to server defined by serverUrl.
6
- * Do not create this object directly, use {@link Server#liquidityPools}.
7
6
  *
8
- * @class LiquidityPoolCallBuilder
7
+ * Do not create this object directly, use {@link Horizon.Server#liquidityPools}.
8
+ *
9
9
  * @augments CallBuilder
10
+ * @private
10
11
  * @class
11
12
  * @param {string} serverUrl Horizon server URL.
12
13
  */
@@ -3,12 +3,14 @@ import { CallBuilder } from "./call_builder";
3
3
  import { ServerApi } from "./server_api";
4
4
  /**
5
5
  * Creates a new {@link OfferCallBuilder} pointed to server defined by serverUrl.
6
- * Do not create this object directly, use {@link Server#offers}.
7
6
  *
8
- * @see [Offers](https://developers.stellar.org/api/resources/offers/)
9
- * @class OfferCallBuilder
10
- * @class
7
+ * Do not create this object directly, use {@link Horizon.Server#offers}.
8
+ *
9
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/|Offers}
10
+ *
11
11
  * @augments CallBuilder
12
+ * @private
13
+ * @class
12
14
  * @param {string} serverUrl Horizon server URL.
13
15
  */
14
16
  export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.OfferRecord>> {
@@ -16,7 +18,7 @@ export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPa
16
18
  /**
17
19
  * The offer details endpoint provides information on a single offer. The offer ID provided in the id
18
20
  * argument specifies which offer to load.
19
- * @see [Offer Details](https://developers.stellar.org/api/resources/offers/single/)
21
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/single/|Offer Details}
20
22
  * @param {string} offerId Offer ID
21
23
  * @returns {CallBuilder<ServerApi.OfferRecord>} CallBuilder<ServerApi.OfferRecord> OperationCallBuilder instance
22
24
  */
@@ -24,14 +26,14 @@ export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPa
24
26
  /**
25
27
  * Returns all offers where the given account is involved.
26
28
  *
27
- * @see [Offers](https://developers.stellar.org/api/resources/accounts/offers/)
29
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/accounts/offers/|Offers}
28
30
  * @param {string} id For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
29
31
  * @returns {OfferCallBuilder} current OfferCallBuilder instance
30
32
  */
31
33
  forAccount(id: string): this;
32
34
  /**
33
35
  * Returns all offers buying an asset.
34
- * @see [Offers](https://developers.stellar.org/api/resources/offers/list/)
36
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/list/|Offers}
35
37
  * @see Asset
36
38
  * @param {Asset} asset For example: `new Asset('USD','GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD')`
37
39
  * @returns {OfferCallBuilder} current OfferCallBuilder instance
@@ -39,7 +41,7 @@ export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPa
39
41
  buying(asset: Asset): this;
40
42
  /**
41
43
  * Returns all offers selling an asset.
42
- * @see [Offers](https://developers.stellar.org/api/resources/offers/list/)
44
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/list/|Offers}
43
45
  * @see Asset
44
46
  * @param {Asset} asset For example: `new Asset('EUR','GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD')`
45
47
  * @returns {OfferCallBuilder} current OfferCallBuilder instance
@@ -47,7 +49,7 @@ export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPa
47
49
  selling(asset: Asset): this;
48
50
  /**
49
51
  * This endpoint filters offers where the given account is sponsoring the offer entry.
50
- * @see [Offers](https://developers.stellar.org/api/resources/offers/list/)
52
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-all-offers|Offers}
51
53
  * @param {string} id For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
52
54
  * @returns {OfferCallBuilder} current OfferCallBuilder instance
53
55
  */
@@ -55,7 +57,7 @@ export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPa
55
57
  /**
56
58
  * This endpoint filters offers where the given account is the seller.
57
59
  *
58
- * @see [Offers](https://developers.stellar.org/api/resources/offers/list/)
60
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-all-offers|Offers}
59
61
  * @param {string} seller For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
60
62
  * @returns {OfferCallBuilder} current OfferCallBuilder instance
61
63
  */
@@ -2,12 +2,14 @@ import { CallBuilder } from "./call_builder";
2
2
  import { ServerApi } from "./server_api";
3
3
  /**
4
4
  * Creates a new {@link OperationCallBuilder} pointed to server defined by serverUrl.
5
- * Do not create this object directly, use {@link Server#operations}.
6
5
  *
7
- * @see [All Operations](https://developers.stellar.org/api/resources/operations/)
8
- * @class OperationCallBuilder
9
- * @class
6
+ * Do not create this object directly, use {@link Horizon.Server#operations}.
7
+ *
8
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/operations|All Operations}
9
+ *
10
10
  * @augments CallBuilder
11
+ * @private
12
+ * @class
11
13
  * @param {string} serverUrl Horizon server URL.
12
14
  */
13
15
  export declare class OperationCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.OperationRecord>> {
@@ -15,21 +17,21 @@ export declare class OperationCallBuilder extends CallBuilder<ServerApi.Collecti
15
17
  /**
16
18
  * The operation details endpoint provides information on a single operation. The operation ID provided in the id
17
19
  * argument specifies which operation to load.
18
- * @see [Operation Details](https://developers.stellar.org/api/resources/operations/single/)
20
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-an-operation|Operation Details}
19
21
  * @param {number} operationId Operation ID
20
22
  * @returns {CallBuilder} this OperationCallBuilder instance
21
23
  */
22
24
  operation(operationId: string): CallBuilder<ServerApi.OperationRecord>;
23
25
  /**
24
26
  * This endpoint represents all operations that were included in valid transactions that affected a particular account.
25
- * @see [Operations for Account](https://developers.stellar.org/api/resources/accounts/operations/)
27
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-operations-by-account-id|Operations for Account}
26
28
  * @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
27
29
  * @returns {OperationCallBuilder} this OperationCallBuilder instance
28
30
  */
29
31
  forAccount(accountId: string): this;
30
32
  /**
31
33
  * This endpoint represents all operations that reference a given claimable_balance.
32
- * @see [Operations for Claimable Balance](https://developers.stellar.org/api/resources/claimablebalances/operations/)
34
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/cb-retrieve-related-operations|Operations for Claimable Balance}
33
35
  * @param {string} claimableBalanceId Claimable Balance ID
34
36
  * @returns {OperationCallBuilder} this OperationCallBuilder instance
35
37
  */
@@ -37,14 +39,14 @@ export declare class OperationCallBuilder extends CallBuilder<ServerApi.Collecti
37
39
  /**
38
40
  * This endpoint returns all operations that occurred in a given ledger.
39
41
  *
40
- * @see [Operations for Ledger](https://developers.stellar.org/api/resources/ledgers/operations/)
42
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-ledgers-operations|Operations for Ledger}
41
43
  * @param {number|string} sequence Ledger sequence
42
44
  * @returns {OperationCallBuilder} this OperationCallBuilder instance
43
45
  */
44
46
  forLedger(sequence: number | string): this;
45
47
  /**
46
48
  * This endpoint represents all operations that are part of a given transaction.
47
- * @see [Operations for Transaction](https://developers.stellar.org/api/resources/transactions/operations/)
49
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-transactions-operations|Operations for Transaction}
48
50
  * @param {string} transactionId Transaction ID
49
51
  * @returns {OperationCallBuilder} this OperationCallBuilder instance
50
52
  */
@@ -4,8 +4,13 @@ import { ServerApi } from "./server_api";
4
4
  /**
5
5
  * Creates a new {@link OrderbookCallBuilder} pointed to server defined by serverUrl.
6
6
  *
7
- * Do not create this object directly, use {@link Server#orderbook}.
8
- * @see [Orderbook Details](https://developers.stellar.org/api/aggregations/order-books/)
7
+ * Do not create this object directly, use {@link Horizon.Server#orderbook}.
8
+ *
9
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/aggregations/order-books|Orderbook Details}
10
+ *
11
+ * @augments CallBuilder
12
+ * @private
13
+ * @class
9
14
  * @param {string} serverUrl serverUrl Horizon server URL.
10
15
  * @param {Asset} selling Asset being sold
11
16
  * @param {Asset} buying Asset being bought
@@ -16,9 +16,14 @@ import { ServerApi } from "./server_api";
16
16
  * payment paths from those source assets to the desired destination asset. The search's amount parameter will be
17
17
  * used to determine if there a given path can satisfy a payment of the desired amount.
18
18
  *
19
- * Do not create this object directly, use {@link Server#paths}.
20
- * @see [Find Payment Paths](https://developers.stellar.org/api/aggregations/paths/)
19
+ * Do not create this object directly, use {@link Horizon.Server#paths}.
20
+ *
21
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/aggregations/paths|Find Payment Paths}
22
+ *
21
23
  * @augments CallBuilder
24
+ * @private
25
+ * @class
26
+ *
22
27
  * @param {string} serverUrl Horizon server URL.
23
28
  * @param {string} source The sender's account ID. Any returned path must use a source that the sender can hold.
24
29
  * @param {string} destination The destination account ID that any returned path should use.
@@ -3,31 +3,35 @@ import { ServerApi } from "./server_api";
3
3
  /**
4
4
  * Creates a new {@link PaymentCallBuilder} pointed to server defined by serverUrl.
5
5
  *
6
- * Do not create this object directly, use {@link Server#payments}.
7
- * @see [All Payments](https://developers.stellar.org/api/horizon/resources/list-all-payments/)
8
- * @class
6
+ * Do not create this object directly, use {@link Horizon.Server#payments}.
7
+ *
8
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/horizon/resources/list-all-payments/|All Payments}
9
+ *
9
10
  * @augments CallBuilder
11
+ * @private
12
+ * @class
13
+ *
10
14
  * @param {string} serverUrl Horizon server URL.
11
15
  */
12
16
  export declare class PaymentCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.PaymentOperationRecord | ServerApi.CreateAccountOperationRecord | ServerApi.AccountMergeOperationRecord | ServerApi.PathPaymentOperationRecord | ServerApi.PathPaymentStrictSendOperationRecord | ServerApi.InvokeHostFunctionOperationRecord>> {
13
17
  constructor(serverUrl: URI);
14
18
  /**
15
19
  * This endpoint responds with a collection of Payment operations where the given account was either the sender or receiver.
16
- * @see [Payments for Account](https://developers.stellar.org/api/horizon/resources/get-payments-by-account-id)
20
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/horizon/resources/get-payments-by-account-id|Payments for Account}
17
21
  * @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
18
22
  * @returns {PaymentCallBuilder} this PaymentCallBuilder instance
19
23
  */
20
24
  forAccount(accountId: string): this;
21
25
  /**
22
26
  * This endpoint represents all payment operations that are part of a valid transactions in a given ledger.
23
- * @see [Payments for Ledger](https://developers.stellar.org/api/horizon/resources/retrieve-a-ledgers-payments)
27
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/horizon/resources/retrieve-a-ledgers-payments|Payments for Ledger}
24
28
  * @param {number|string} sequence Ledger sequence
25
29
  * @returns {PaymentCallBuilder} this PaymentCallBuilder instance
26
30
  */
27
31
  forLedger(sequence: number | string): this;
28
32
  /**
29
33
  * This endpoint represents all payment operations that are part of a given transaction.
30
- * @see [Payments for Transaction](https://developers.stellar.org/api/resources/transactions/payments/)
34
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/transactions/payments/|Payments for Transaction}
31
35
  * @param {string} transactionId Transaction ID
32
36
  * @returns {PaymentCallBuilder} this PaymentCallBuilder instance
33
37
  */
@@ -17,26 +17,31 @@ import { PaymentCallBuilder } from "./payment_call_builder";
17
17
  import { TradeAggregationCallBuilder } from "./trade_aggregation_call_builder";
18
18
  import { TradesCallBuilder } from "./trades_call_builder";
19
19
  import { TransactionCallBuilder } from "./transaction_call_builder";
20
+ /**
21
+ * Default transaction submission timeout for Horizon requests, in milliseconds
22
+ * @constant {number}
23
+ * @default 60000
24
+ * @memberof module:Horizon.Server
25
+ */
20
26
  export declare const SUBMIT_TRANSACTION_TIMEOUT: number;
21
27
  /**
22
- * Server handles the network connection to a [Horizon](https://developers.stellar.org/api/introduction/)
28
+ * Server handles the network connection to a [Horizon](https://developers.stellar.org/docs/data/horizon)
23
29
  * instance and exposes an interface for requests to that instance.
24
30
  * @class
31
+ * @alias module:Horizon.Server
32
+ * @memberof module:Horizon
33
+ *
25
34
  * @param {string} serverURL Horizon Server URL (ex. `https://horizon-testnet.stellar.org`).
26
- * @param {object} [opts] Options object
27
- * @param {boolean} [opts.allowHttp] - Allow connecting to http servers, default: `false`. This must be set to false in production deployments! You can also use {@link Config} class to set this globally.
28
- * @param {string} [opts.appName] - Allow set custom header `X-App-Name`, default: `undefined`.
29
- * @param {string} [opts.appVersion] - Allow set custom header `X-App-Version`, default: `undefined`.
30
- * @param {string} [opts.authToken] - Allow set custom header `X-Auth-Token`, default: `undefined`.
35
+ * @param {module:Horizon.Server.Options} [opts] Options object
31
36
  */
32
- export declare class Server {
37
+ export declare class HorizonServer {
33
38
  /**
34
- * serverURL Horizon Server URL (ex. `https://horizon-testnet.stellar.org`).
39
+ * Horizon Server URL (ex. `https://horizon-testnet.stellar.org`)
35
40
  *
36
- * TODO: Solve `URI(this.serverURL as any)`.
41
+ * @todo Solve `URI(this.serverURL as any)`.
37
42
  */
38
43
  readonly serverURL: URI;
39
- constructor(serverURL: string, opts?: Server.Options);
44
+ constructor(serverURL: string, opts?: HorizonServer.Options);
40
45
  /**
41
46
  * Get timebounds for N seconds from now, when you're creating a transaction
42
47
  * with {@link TransactionBuilder}.
@@ -49,25 +54,23 @@ export declare class Server {
49
54
  * not when you build or submit the transaction! So give yourself enough time to get
50
55
  * the transaction built and signed before submitting.
51
56
  *
52
- * Example:
53
- *
54
- * ```javascript
57
+ * @example
55
58
  * const transaction = new StellarSdk.TransactionBuilder(accountId, {
56
- * fee: await StellarSdk.Server.fetchBaseFee(),
57
- * timebounds: await StellarSdk.Server.fetchTimebounds(100)
59
+ * fee: await StellarSdk.Server.fetchBaseFee(),
60
+ * timebounds: await StellarSdk.Server.fetchTimebounds(100)
58
61
  * })
59
- * .addOperation(operation)
60
- * // normally we would need to call setTimeout here, but setting timebounds
61
- * // earlier does the trick!
62
- * .build();
63
- * ```
62
+ * .addOperation(operation)
63
+ * // normally we would need to call setTimeout here, but setting timebounds
64
+ * // earlier does the trick!
65
+ * .build();
66
+ *
64
67
  * @param {number} seconds Number of seconds past the current time to wait.
65
68
  * @param {boolean} [_isRetry] True if this is a retry. Only set this internally!
66
69
  * This is to avoid a scenario where Horizon is horking up the wrong date.
67
- * @returns {Promise<Server.Timebounds>} Promise that resolves a `timebounds` object
70
+ * @returns {Promise<Timebounds>} Promise that resolves a `timebounds` object
68
71
  * (with the shape `{ minTime: 0, maxTime: N }`) that you can set the `timebounds` option to.
69
72
  */
70
- fetchTimebounds(seconds: number, _isRetry?: boolean): Promise<Server.Timebounds>;
73
+ fetchTimebounds(seconds: number, _isRetry?: boolean): Promise<HorizonServer.Timebounds>;
71
74
  /**
72
75
  * Fetch the base fee. Since this hits the server, if the server call fails,
73
76
  * you might get an error. You should be prepared to use a default value if
@@ -77,22 +80,34 @@ export declare class Server {
77
80
  fetchBaseFee(): Promise<number>;
78
81
  /**
79
82
  * Fetch the fee stats endpoint.
80
- * @see [Fee Stats](https://developers.stellar.org/api/aggregations/fee-stats/)
83
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/aggregations/fee-stats|Fee Stats}
81
84
  * @returns {Promise<HorizonApi.FeeStatsResponse>} Promise that resolves to the fee stats returned by Horizon.
82
85
  */
83
86
  feeStats(): Promise<HorizonApi.FeeStatsResponse>;
84
87
  /**
85
88
  * Submits a transaction to the network.
86
89
  *
87
- * By default this function calls {@link Server#checkMemoRequired}, you can
90
+ * By default this function calls {@link Horizon.Server#checkMemoRequired}, you can
88
91
  * skip this check by setting the option `skipMemoRequiredCheck` to `true`.
89
92
  *
90
93
  * If you submit any number of `manageOffer` operations, this will add an
91
94
  * attribute to the response that will help you analyze what happened with
92
95
  * your offers.
93
96
  *
94
- * Ex:
95
- * ```javascript
97
+ * For example, you'll want to examine `offerResults` to add affordances like
98
+ * these to your app:
99
+ * - If `wasImmediatelyFilled` is true, then no offer was created. So if you
100
+ * normally watch the `Server.offers` endpoint for offer updates, you
101
+ * instead need to check `Server.trades` to find the result of this filled
102
+ * offer.
103
+ * - If `wasImmediatelyDeleted` is true, then the offer you submitted was
104
+ * deleted without reaching the orderbook or being matched (possibly because
105
+ * your amounts were rounded down to zero). So treat the just-submitted
106
+ * offer request as if it never happened.
107
+ * - If `wasPartiallyFilled` is true, you can tell the user that
108
+ * `amountBought` or `amountSold` have already been transferred.
109
+ *
110
+ * @example
96
111
  * const res = {
97
112
  * ...response,
98
113
  * offerResults: [
@@ -160,22 +175,8 @@ export declare class Server {
160
175
  * }
161
176
  * ]
162
177
  * }
163
- * ```
164
178
  *
165
- * For example, you'll want to examine `offerResults` to add affordances like
166
- * these to your app:
167
- * * If `wasImmediatelyFilled` is true, then no offer was created. So if you
168
- * normally watch the `Server.offers` endpoint for offer updates, you
169
- * instead need to check `Server.trades` to find the result of this filled
170
- * offer.
171
- * * If `wasImmediatelyDeleted` is true, then the offer you submitted was
172
- * deleted without reaching the orderbook or being matched (possibly because
173
- * your amounts were rounded down to zero). So treat the just-submitted
174
- * offer request as if it never happened.
175
- * * If `wasPartiallyFilled` is true, you can tell the user that
176
- * `amountBought` or `amountSold` have already been transferred.
177
- *
178
- * @see [PostTransaction](https://developers.stellar.org/api/resources/transactions/post/)
179
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/submit-a-transaction|Submit a Transaction}
179
180
  * @param {Transaction|FeeBumpTransaction} transaction - The transaction to submit.
180
181
  * @param {object} [opts] Options object
181
182
  * @param {boolean} [opts.skipMemoRequiredCheck] - Allow skipping memo
@@ -184,17 +185,16 @@ export declare class Server {
184
185
  * @returns {Promise} Promise that resolves or rejects with response from
185
186
  * horizon.
186
187
  */
187
- submitTransaction(transaction: Transaction | FeeBumpTransaction, opts?: Server.SubmitTransactionOptions): Promise<HorizonApi.SubmitTransactionResponse>;
188
+ submitTransaction(transaction: Transaction | FeeBumpTransaction, opts?: HorizonServer.SubmitTransactionOptions): Promise<HorizonApi.SubmitTransactionResponse>;
188
189
  /**
189
190
  * Submits an asynchronous transaction to the network. Unlike the synchronous version, which blocks
190
191
  * and waits for the transaction to be ingested in Horizon, this endpoint relays the response from
191
192
  * core directly back to the user.
192
193
  *
193
- * By default, this function calls {@link Server#checkMemoRequired}, you can
194
+ * By default, this function calls {@link HorizonServer#checkMemoRequired}, you can
194
195
  * skip this check by setting the option `skipMemoRequiredCheck` to `true`.
195
196
  *
196
- * @see [Submit
197
- * Async Transaction](https://developers.stellar.org/docs/data/horizon/api-reference/resources/submit-async-transaction)
197
+ * @see [Submit-Async-Transaction](https://developers.stellar.org/docs/data/horizon/api-reference/resources/submit-async-transaction)
198
198
  * @param {Transaction|FeeBumpTransaction} transaction - The transaction to submit.
199
199
  * @param {object} [opts] Options object
200
200
  * @param {boolean} [opts.skipMemoRequiredCheck] - Allow skipping memo
@@ -203,7 +203,7 @@ export declare class Server {
203
203
  * @returns {Promise} Promise that resolves or rejects with response from
204
204
  * horizon.
205
205
  */
206
- submitAsyncTransaction(transaction: Transaction | FeeBumpTransaction, opts?: Server.SubmitTransactionOptions): Promise<HorizonApi.SubmitAsyncTransactionResponse>;
206
+ submitAsyncTransaction(transaction: Transaction | FeeBumpTransaction, opts?: HorizonServer.SubmitTransactionOptions): Promise<HorizonApi.SubmitAsyncTransactionResponse>;
207
207
  /**
208
208
  * @returns {AccountCallBuilder} New {@link AccountCallBuilder} object configured by a current Horizon server configuration.
209
209
  */
@@ -223,15 +223,15 @@ export declare class Server {
223
223
  /**
224
224
  * People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the offers on the DEX.
225
225
  *
226
- * You can query all offers for account using the function `.accountId`:
226
+ * You can query all offers for account using the function `.accountId`.
227
227
  *
228
- * ```
228
+ * @example
229
229
  * server.offers()
230
- * .forAccount(accountId).call()
231
- * .then(function(offers) {
232
- * console.log(offers);
233
- * });
234
- * ```
230
+ * .forAccount(accountId).call()
231
+ * .then(function(offers) {
232
+ * console.log(offers);
233
+ * });
234
+ *
235
235
  * @returns {OfferCallBuilder} New {@link OfferCallBuilder} object
236
236
  */
237
237
  offers(): OfferCallBuilder;
@@ -354,7 +354,7 @@ export declare class Server {
354
354
  * Each account is checked sequentially instead of loading multiple accounts
355
355
  * at the same time from Horizon.
356
356
  *
357
- * @see https://stellar.org/protocol/sep-29
357
+ * @see {@link https://stellar.org/protocol/sep-29|SEP-29: Account Memo Requirements}
358
358
  * @param {Transaction} transaction - The transaction to check.
359
359
  * @returns {Promise<void, Error>} - If any of the destination account
360
360
  * requires a memo, the promise will throw {@link AccountRequiresMemoError}.
@@ -362,7 +362,16 @@ export declare class Server {
362
362
  */
363
363
  checkMemoRequired(transaction: Transaction | FeeBumpTransaction): Promise<void>;
364
364
  }
365
- export declare namespace Server {
365
+ /**
366
+ * Options for configuring connections to Horizon servers.
367
+ * @typedef {object} Options
368
+ * @memberof module:Horizon.Server
369
+ * @property {boolean} [allowHttp] Allow connecting to http servers, default: `false`. This must be set to false in production deployments! You can also use {@link Config} class to set this globally.
370
+ * @property {string} [appName] Allow set custom header `X-App-Name`, default: `undefined`.
371
+ * @property {string} [appVersion] Allow set custom header `X-App-Version`, default: `undefined`.
372
+ * @property {string} [authToken] Allow set custom header `X-Auth-Token`, default: `undefined`.
373
+ */
374
+ export declare namespace HorizonServer {
366
375
  interface Options {
367
376
  allowHttp?: boolean;
368
377
  appName?: string;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Server = exports.SUBMIT_TRANSACTION_TIMEOUT = void 0;
6
+ exports.SUBMIT_TRANSACTION_TIMEOUT = exports.HorizonServer = void 0;
7
7
  var _bignumber = _interopRequireDefault(require("bignumber.js"));
8
8
  var _stellarBase = require("@stellar/stellar-base");
9
9
  var _urijs = _interopRequireDefault(require("urijs"));
@@ -49,10 +49,10 @@ var ACCOUNT_REQUIRES_MEMO = "MQ==";
49
49
  function getAmountInLumens(amt) {
50
50
  return new _bignumber.default(amt).div(STROOPS_IN_LUMEN).toString();
51
51
  }
52
- var Server = exports.Server = function () {
53
- function Server(serverURL) {
52
+ var HorizonServer = exports.HorizonServer = function () {
53
+ function HorizonServer(serverURL) {
54
54
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
55
- _classCallCheck(this, Server);
55
+ _classCallCheck(this, HorizonServer);
56
56
  this.serverURL = (0, _urijs.default)(serverURL);
57
57
  var allowHttp = typeof opts.allowHttp === "undefined" ? _config.Config.isAllowHttp() : opts.allowHttp;
58
58
  var customHeaders = {};
@@ -70,6 +70,7 @@ var Server = exports.Server = function () {
70
70
  }
71
71
  if (Object.keys(customHeaders).length > 0) {
72
72
  _horizon_axios_client.default.interceptors.request.use(function (config) {
73
+ config.headers = config.headers || {};
73
74
  config.headers = Object.assign(config.headers, customHeaders);
74
75
  return config;
75
76
  });
@@ -78,7 +79,7 @@ var Server = exports.Server = function () {
78
79
  throw new Error("Cannot connect to insecure horizon server");
79
80
  }
80
81
  }
81
- return _createClass(Server, [{
82
+ return _createClass(HorizonServer, [{
82
83
  key: "fetchTimebounds",
83
84
  value: (function () {
84
85
  var _fetchTimebounds = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(seconds) {
@@ -102,21 +102,6 @@ export declare namespace ServerApi {
102
102
  header_xdr: string;
103
103
  base_fee_in_stroops: number;
104
104
  base_reserve_in_stroops: number;
105
- /**
106
- * @deprecated This will be removed in the next major version: the property
107
- * no longer exists on the Horizon API
108
- */
109
- transaction_count: number;
110
- /**
111
- * @deprecated This will be removed in the next major version: the property
112
- * no longer exists on the Horizon API
113
- */
114
- base_fee: number;
115
- /**
116
- * @deprecated This will be removed in the next major version: the property
117
- * no longer exists on the Horizon API
118
- */
119
- base_reserve: string;
120
105
  effects: CallCollectionFunction<EffectRecord>;
121
106
  operations: CallCollectionFunction<OperationRecord>;
122
107
  self: CallFunction<LedgerRecord>;
@@ -20,9 +20,14 @@ import { ServerApi } from "./server_api";
20
20
  * If a list of assets is passed as the source, horizon will find any payment
21
21
  * paths from those source assets to the desired destination asset.
22
22
  *
23
- * Do not create this object directly, use {@link Server#strictReceivePaths}.
24
- * @see [Find Payment Paths](https://developers.stellar.org/api/aggregations/paths/)
23
+ * Do not create this object directly, use {@link Horizon.Server#strictReceivePaths}.
24
+ *
25
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/aggregations/paths|Find Payment Paths}
26
+ *
25
27
  * @augments CallBuilder
28
+ * @private
29
+ * @class
30
+ *
26
31
  * @param {string} serverUrl Horizon server URL.
27
32
  * @param {string|Asset[]} source The sender's account ID or a list of Assets. Any returned path must use a source that the sender can hold.
28
33
  * @param {Asset} destinationAsset The destination asset.