@stellar/stellar-sdk 12.2.0 → 13.0.0-beta.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 (511) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +30 -8
  3. package/dist/stellar-sdk-minimal.js +45947 -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 +56586 -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 +49760 -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 +28423 -27354
  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 +23 -17
  18. package/lib/contract/assembled_transaction.js +177 -154
  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 +7 -1
  23. package/lib/contract/sent_transaction.js +2 -2
  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 +17 -10
  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/strict_receive_path_call_builder.d.ts +7 -2
  64. package/lib/horizon/strict_send_path_call_builder.d.ts +7 -2
  65. package/lib/horizon/trade_aggregation_call_builder.d.ts +4 -2
  66. package/lib/horizon/trades_call_builder.d.ts +8 -5
  67. package/lib/horizon/transaction_call_builder.d.ts +10 -7
  68. package/lib/http-client/axios-client.d.ts +2 -0
  69. package/lib/http-client/axios-client.js +10 -0
  70. package/lib/http-client/fetch-client.d.ts +11 -0
  71. package/lib/http-client/fetch-client.js +229 -0
  72. package/lib/http-client/index.d.ts +5 -0
  73. package/lib/http-client/index.js +33 -0
  74. package/lib/http-client/types.d.ts +69 -0
  75. package/lib/http-client/types.js +34 -0
  76. package/lib/index.d.ts +3 -4
  77. package/lib/index.js +7 -1
  78. package/lib/minimal/browser.d.ts +6 -0
  79. package/lib/minimal/browser.js +35 -0
  80. package/lib/minimal/config.d.ts +64 -0
  81. package/lib/minimal/config.js +51 -0
  82. package/lib/minimal/contract/assembled_transaction.d.ts +555 -0
  83. package/lib/minimal/contract/assembled_transaction.js +752 -0
  84. package/lib/minimal/contract/basic_node_signer.d.ts +17 -0
  85. package/lib/minimal/contract/basic_node_signer.js +52 -0
  86. package/lib/minimal/contract/client.d.ts +52 -0
  87. package/lib/minimal/contract/client.js +180 -0
  88. package/lib/minimal/contract/index.d.ts +7 -0
  89. package/lib/minimal/contract/index.js +82 -0
  90. package/lib/minimal/contract/rust_result.d.ts +81 -0
  91. package/lib/minimal/contract/rust_result.js +66 -0
  92. package/lib/minimal/contract/sent_transaction.d.ts +85 -0
  93. package/lib/minimal/contract/sent_transaction.js +151 -0
  94. package/lib/minimal/contract/spec.d.ts +152 -0
  95. package/lib/minimal/contract/spec.js +1020 -0
  96. package/lib/minimal/contract/types.d.ts +180 -0
  97. package/lib/minimal/contract/types.js +8 -0
  98. package/lib/minimal/contract/utils.d.ts +46 -0
  99. package/lib/minimal/contract/utils.js +123 -0
  100. package/lib/minimal/errors/account_requires_memo.d.ts +24 -0
  101. package/lib/minimal/errors/account_requires_memo.js +38 -0
  102. package/lib/minimal/errors/bad_request.d.ts +14 -0
  103. package/lib/minimal/errors/bad_request.js +34 -0
  104. package/lib/minimal/errors/bad_response.d.ts +17 -0
  105. package/lib/minimal/errors/bad_response.js +34 -0
  106. package/lib/minimal/errors/index.d.ts +5 -0
  107. package/lib/minimal/errors/index.js +60 -0
  108. package/lib/minimal/errors/network.d.ts +33 -0
  109. package/lib/minimal/errors/network.js +41 -0
  110. package/lib/minimal/errors/not_found.d.ts +14 -0
  111. package/lib/minimal/errors/not_found.js +34 -0
  112. package/lib/minimal/federation/api.d.ts +32 -0
  113. package/lib/minimal/federation/api.js +7 -0
  114. package/lib/minimal/federation/index.d.ts +2 -0
  115. package/lib/minimal/federation/index.js +34 -0
  116. package/lib/minimal/federation/server.d.ts +116 -0
  117. package/lib/minimal/federation/server.js +252 -0
  118. package/lib/minimal/friendbot/index.d.ts +5 -0
  119. package/lib/minimal/friendbot/index.js +7 -0
  120. package/lib/minimal/horizon/account_call_builder.d.ts +56 -0
  121. package/lib/minimal/horizon/account_call_builder.js +62 -0
  122. package/lib/minimal/horizon/account_response.d.ts +61 -0
  123. package/lib/minimal/horizon/account_response.js +49 -0
  124. package/lib/minimal/horizon/assets_call_builder.d.ts +27 -0
  125. package/lib/minimal/horizon/assets_call_builder.js +43 -0
  126. package/lib/minimal/horizon/call_builder.d.ts +128 -0
  127. package/lib/minimal/horizon/call_builder.js +362 -0
  128. package/lib/minimal/horizon/claimable_balances_call_builder.d.ts +50 -0
  129. package/lib/minimal/horizon/claimable_balances_call_builder.js +56 -0
  130. package/lib/minimal/horizon/effect_call_builder.d.ts +53 -0
  131. package/lib/minimal/horizon/effect_call_builder.js +56 -0
  132. package/lib/minimal/horizon/friendbot_builder.d.ts +4 -0
  133. package/lib/minimal/horizon/friendbot_builder.js +32 -0
  134. package/lib/minimal/horizon/horizon_api.d.ts +527 -0
  135. package/lib/minimal/horizon/horizon_api.js +96 -0
  136. package/lib/minimal/horizon/horizon_axios_client.d.ts +37 -0
  137. package/lib/minimal/horizon/horizon_axios_client.js +60 -0
  138. package/lib/minimal/horizon/index.d.ts +8 -0
  139. package/lib/minimal/horizon/index.js +78 -0
  140. package/lib/minimal/horizon/ledger_call_builder.d.ts +23 -0
  141. package/lib/minimal/horizon/ledger_call_builder.js +37 -0
  142. package/lib/minimal/horizon/liquidity_pool_call_builder.d.ts +37 -0
  143. package/lib/minimal/horizon/liquidity_pool_call_builder.js +59 -0
  144. package/lib/minimal/horizon/offer_call_builder.d.ts +65 -0
  145. package/lib/minimal/horizon/offer_call_builder.js +79 -0
  146. package/lib/minimal/horizon/operation_call_builder.d.ts +69 -0
  147. package/lib/minimal/horizon/operation_call_builder.js +69 -0
  148. package/lib/minimal/horizon/orderbook_call_builder.d.ts +20 -0
  149. package/lib/minimal/horizon/orderbook_call_builder.js +45 -0
  150. package/lib/minimal/horizon/path_call_builder.d.ts +35 -0
  151. package/lib/minimal/horizon/path_call_builder.js +41 -0
  152. package/lib/minimal/horizon/payment_call_builder.d.ts +39 -0
  153. package/lib/minimal/horizon/payment_call_builder.js +46 -0
  154. package/lib/minimal/horizon/server.d.ts +389 -0
  155. package/lib/minimal/horizon/server.js +550 -0
  156. package/lib/minimal/horizon/server_api.d.ts +278 -0
  157. package/lib/minimal/horizon/server_api.js +19 -0
  158. package/lib/minimal/horizon/strict_receive_path_call_builder.d.ts +38 -0
  159. package/lib/minimal/horizon/strict_receive_path_call_builder.js +50 -0
  160. package/lib/minimal/horizon/strict_send_path_call_builder.d.ts +38 -0
  161. package/lib/minimal/horizon/strict_send_path_call_builder.js +50 -0
  162. package/lib/minimal/horizon/trade_aggregation_call_builder.d.ts +49 -0
  163. package/lib/minimal/horizon/trade_aggregation_call_builder.js +76 -0
  164. package/lib/minimal/horizon/trades_call_builder.d.ts +52 -0
  165. package/lib/minimal/horizon/trades_call_builder.js +72 -0
  166. package/lib/minimal/horizon/transaction_call_builder.d.ts +60 -0
  167. package/lib/minimal/horizon/transaction_call_builder.js +64 -0
  168. package/lib/minimal/horizon/types/account.d.ts +5 -0
  169. package/lib/minimal/horizon/types/account.js +5 -0
  170. package/lib/minimal/horizon/types/assets.d.ts +19 -0
  171. package/lib/minimal/horizon/types/assets.js +5 -0
  172. package/lib/minimal/horizon/types/effects.d.ts +285 -0
  173. package/lib/minimal/horizon/types/effects.js +62 -0
  174. package/lib/minimal/horizon/types/offer.d.ts +20 -0
  175. package/lib/minimal/horizon/types/offer.js +5 -0
  176. package/lib/minimal/horizon/types/trade.d.ts +13 -0
  177. package/lib/minimal/horizon/types/trade.js +5 -0
  178. package/lib/minimal/http-client/axios-client.d.ts +2 -0
  179. package/lib/minimal/http-client/axios-client.js +10 -0
  180. package/lib/minimal/http-client/fetch-client.d.ts +11 -0
  181. package/lib/minimal/http-client/fetch-client.js +229 -0
  182. package/lib/minimal/http-client/index.d.ts +5 -0
  183. package/lib/minimal/http-client/index.js +33 -0
  184. package/lib/minimal/http-client/types.d.ts +69 -0
  185. package/lib/minimal/http-client/types.js +34 -0
  186. package/lib/minimal/index.d.ts +36 -0
  187. package/lib/minimal/index.js +83 -0
  188. package/lib/minimal/rpc/api.d.ts +359 -0
  189. package/lib/minimal/rpc/api.js +32 -0
  190. package/lib/minimal/rpc/axios.d.ts +4 -0
  191. package/lib/minimal/rpc/axios.js +15 -0
  192. package/lib/minimal/rpc/browser.d.ts +4 -0
  193. package/lib/minimal/rpc/browser.js +27 -0
  194. package/lib/minimal/rpc/index.d.ts +8 -0
  195. package/lib/minimal/rpc/index.js +72 -0
  196. package/lib/minimal/rpc/jsonrpc.d.ts +35 -0
  197. package/lib/minimal/rpc/jsonrpc.js +52 -0
  198. package/lib/minimal/rpc/parsers.d.ts +39 -0
  199. package/lib/minimal/rpc/parsers.js +155 -0
  200. package/lib/minimal/rpc/server.d.ts +584 -0
  201. package/lib/minimal/rpc/server.js +823 -0
  202. package/lib/minimal/rpc/transaction.d.ts +21 -0
  203. package/lib/minimal/rpc/transaction.js +53 -0
  204. package/lib/minimal/rpc/utils.d.ts +1 -0
  205. package/lib/minimal/rpc/utils.js +9 -0
  206. package/lib/minimal/stellartoml/index.d.ts +131 -0
  207. package/lib/minimal/stellartoml/index.js +77 -0
  208. package/lib/minimal/utils.d.ts +19 -0
  209. package/lib/minimal/utils.js +31 -0
  210. package/lib/minimal/webauth/errors.d.ts +13 -0
  211. package/lib/minimal/webauth/errors.js +36 -0
  212. package/lib/minimal/webauth/index.d.ts +2 -0
  213. package/lib/minimal/webauth/index.js +27 -0
  214. package/lib/minimal/webauth/utils.d.ts +307 -0
  215. package/lib/minimal/webauth/utils.js +332 -0
  216. package/lib/no-axios/browser.d.ts +6 -0
  217. package/lib/no-axios/browser.js +35 -0
  218. package/lib/no-axios/config.d.ts +64 -0
  219. package/lib/no-axios/config.js +51 -0
  220. package/lib/no-axios/contract/assembled_transaction.d.ts +555 -0
  221. package/lib/no-axios/contract/assembled_transaction.js +752 -0
  222. package/lib/no-axios/contract/basic_node_signer.d.ts +17 -0
  223. package/lib/no-axios/contract/basic_node_signer.js +52 -0
  224. package/lib/no-axios/contract/client.d.ts +52 -0
  225. package/lib/no-axios/contract/client.js +180 -0
  226. package/lib/no-axios/contract/index.d.ts +7 -0
  227. package/lib/no-axios/contract/index.js +82 -0
  228. package/lib/no-axios/contract/rust_result.d.ts +81 -0
  229. package/lib/no-axios/contract/rust_result.js +66 -0
  230. package/lib/no-axios/contract/sent_transaction.d.ts +85 -0
  231. package/lib/no-axios/contract/sent_transaction.js +151 -0
  232. package/lib/no-axios/contract/spec.d.ts +152 -0
  233. package/lib/no-axios/contract/spec.js +1020 -0
  234. package/lib/no-axios/contract/types.d.ts +180 -0
  235. package/lib/no-axios/contract/types.js +8 -0
  236. package/lib/no-axios/contract/utils.d.ts +46 -0
  237. package/lib/no-axios/contract/utils.js +123 -0
  238. package/lib/no-axios/errors/account_requires_memo.d.ts +24 -0
  239. package/lib/no-axios/errors/account_requires_memo.js +38 -0
  240. package/lib/no-axios/errors/bad_request.d.ts +14 -0
  241. package/lib/no-axios/errors/bad_request.js +34 -0
  242. package/lib/no-axios/errors/bad_response.d.ts +17 -0
  243. package/lib/no-axios/errors/bad_response.js +34 -0
  244. package/lib/no-axios/errors/index.d.ts +5 -0
  245. package/lib/no-axios/errors/index.js +60 -0
  246. package/lib/no-axios/errors/network.d.ts +33 -0
  247. package/lib/no-axios/errors/network.js +41 -0
  248. package/lib/no-axios/errors/not_found.d.ts +14 -0
  249. package/lib/no-axios/errors/not_found.js +34 -0
  250. package/lib/no-axios/federation/api.d.ts +32 -0
  251. package/lib/no-axios/federation/api.js +7 -0
  252. package/lib/no-axios/federation/index.d.ts +2 -0
  253. package/lib/no-axios/federation/index.js +34 -0
  254. package/lib/no-axios/federation/server.d.ts +116 -0
  255. package/lib/no-axios/federation/server.js +252 -0
  256. package/lib/no-axios/friendbot/index.d.ts +5 -0
  257. package/lib/no-axios/friendbot/index.js +7 -0
  258. package/lib/no-axios/horizon/account_call_builder.d.ts +56 -0
  259. package/lib/no-axios/horizon/account_call_builder.js +62 -0
  260. package/lib/no-axios/horizon/account_response.d.ts +61 -0
  261. package/lib/no-axios/horizon/account_response.js +49 -0
  262. package/lib/no-axios/horizon/assets_call_builder.d.ts +27 -0
  263. package/lib/no-axios/horizon/assets_call_builder.js +43 -0
  264. package/lib/no-axios/horizon/call_builder.d.ts +128 -0
  265. package/lib/no-axios/horizon/call_builder.js +362 -0
  266. package/lib/no-axios/horizon/claimable_balances_call_builder.d.ts +50 -0
  267. package/lib/no-axios/horizon/claimable_balances_call_builder.js +56 -0
  268. package/lib/no-axios/horizon/effect_call_builder.d.ts +53 -0
  269. package/lib/no-axios/horizon/effect_call_builder.js +56 -0
  270. package/lib/no-axios/horizon/friendbot_builder.d.ts +4 -0
  271. package/lib/no-axios/horizon/friendbot_builder.js +32 -0
  272. package/lib/no-axios/horizon/horizon_api.d.ts +527 -0
  273. package/lib/no-axios/horizon/horizon_api.js +96 -0
  274. package/lib/no-axios/horizon/horizon_axios_client.d.ts +37 -0
  275. package/lib/no-axios/horizon/horizon_axios_client.js +60 -0
  276. package/lib/no-axios/horizon/index.d.ts +8 -0
  277. package/lib/no-axios/horizon/index.js +78 -0
  278. package/lib/no-axios/horizon/ledger_call_builder.d.ts +23 -0
  279. package/lib/no-axios/horizon/ledger_call_builder.js +37 -0
  280. package/lib/no-axios/horizon/liquidity_pool_call_builder.d.ts +37 -0
  281. package/lib/no-axios/horizon/liquidity_pool_call_builder.js +59 -0
  282. package/lib/no-axios/horizon/offer_call_builder.d.ts +65 -0
  283. package/lib/no-axios/horizon/offer_call_builder.js +79 -0
  284. package/lib/no-axios/horizon/operation_call_builder.d.ts +69 -0
  285. package/lib/no-axios/horizon/operation_call_builder.js +69 -0
  286. package/lib/no-axios/horizon/orderbook_call_builder.d.ts +20 -0
  287. package/lib/no-axios/horizon/orderbook_call_builder.js +45 -0
  288. package/lib/no-axios/horizon/path_call_builder.d.ts +35 -0
  289. package/lib/no-axios/horizon/path_call_builder.js +41 -0
  290. package/lib/no-axios/horizon/payment_call_builder.d.ts +39 -0
  291. package/lib/no-axios/horizon/payment_call_builder.js +46 -0
  292. package/lib/no-axios/horizon/server.d.ts +389 -0
  293. package/lib/no-axios/horizon/server.js +550 -0
  294. package/lib/no-axios/horizon/server_api.d.ts +278 -0
  295. package/lib/no-axios/horizon/server_api.js +19 -0
  296. package/lib/no-axios/horizon/strict_receive_path_call_builder.d.ts +38 -0
  297. package/lib/no-axios/horizon/strict_receive_path_call_builder.js +50 -0
  298. package/lib/no-axios/horizon/strict_send_path_call_builder.d.ts +38 -0
  299. package/lib/no-axios/horizon/strict_send_path_call_builder.js +50 -0
  300. package/lib/no-axios/horizon/trade_aggregation_call_builder.d.ts +49 -0
  301. package/lib/no-axios/horizon/trade_aggregation_call_builder.js +76 -0
  302. package/lib/no-axios/horizon/trades_call_builder.d.ts +52 -0
  303. package/lib/no-axios/horizon/trades_call_builder.js +72 -0
  304. package/lib/no-axios/horizon/transaction_call_builder.d.ts +60 -0
  305. package/lib/no-axios/horizon/transaction_call_builder.js +64 -0
  306. package/lib/no-axios/horizon/types/account.d.ts +5 -0
  307. package/lib/no-axios/horizon/types/account.js +5 -0
  308. package/lib/no-axios/horizon/types/assets.d.ts +19 -0
  309. package/lib/no-axios/horizon/types/assets.js +5 -0
  310. package/lib/no-axios/horizon/types/effects.d.ts +285 -0
  311. package/lib/no-axios/horizon/types/effects.js +62 -0
  312. package/lib/no-axios/horizon/types/offer.d.ts +20 -0
  313. package/lib/no-axios/horizon/types/offer.js +5 -0
  314. package/lib/no-axios/horizon/types/trade.d.ts +13 -0
  315. package/lib/no-axios/horizon/types/trade.js +5 -0
  316. package/lib/no-axios/http-client/axios-client.d.ts +2 -0
  317. package/lib/no-axios/http-client/axios-client.js +10 -0
  318. package/lib/no-axios/http-client/fetch-client.d.ts +11 -0
  319. package/lib/no-axios/http-client/fetch-client.js +229 -0
  320. package/lib/no-axios/http-client/index.d.ts +5 -0
  321. package/lib/no-axios/http-client/index.js +33 -0
  322. package/lib/no-axios/http-client/types.d.ts +69 -0
  323. package/lib/no-axios/http-client/types.js +34 -0
  324. package/lib/no-axios/index.d.ts +36 -0
  325. package/lib/no-axios/index.js +83 -0
  326. package/lib/no-axios/rpc/api.d.ts +359 -0
  327. package/lib/no-axios/rpc/api.js +32 -0
  328. package/lib/no-axios/rpc/axios.d.ts +4 -0
  329. package/lib/no-axios/rpc/axios.js +15 -0
  330. package/lib/no-axios/rpc/browser.d.ts +4 -0
  331. package/lib/no-axios/rpc/browser.js +27 -0
  332. package/lib/no-axios/rpc/index.d.ts +8 -0
  333. package/lib/no-axios/rpc/index.js +72 -0
  334. package/lib/no-axios/rpc/jsonrpc.d.ts +35 -0
  335. package/lib/no-axios/rpc/jsonrpc.js +52 -0
  336. package/lib/no-axios/rpc/parsers.d.ts +39 -0
  337. package/lib/no-axios/rpc/parsers.js +155 -0
  338. package/lib/no-axios/rpc/server.d.ts +584 -0
  339. package/lib/no-axios/rpc/server.js +823 -0
  340. package/lib/no-axios/rpc/transaction.d.ts +21 -0
  341. package/lib/no-axios/rpc/transaction.js +53 -0
  342. package/lib/no-axios/rpc/utils.d.ts +1 -0
  343. package/lib/no-axios/rpc/utils.js +9 -0
  344. package/lib/no-axios/stellartoml/index.d.ts +131 -0
  345. package/lib/no-axios/stellartoml/index.js +77 -0
  346. package/lib/no-axios/utils.d.ts +19 -0
  347. package/lib/no-axios/utils.js +31 -0
  348. package/lib/no-axios/webauth/errors.d.ts +13 -0
  349. package/lib/no-axios/webauth/errors.js +36 -0
  350. package/lib/no-axios/webauth/index.d.ts +2 -0
  351. package/lib/no-axios/webauth/index.js +27 -0
  352. package/lib/no-axios/webauth/utils.d.ts +307 -0
  353. package/lib/no-axios/webauth/utils.js +332 -0
  354. package/lib/no-eventsource/browser.d.ts +6 -0
  355. package/lib/no-eventsource/browser.js +35 -0
  356. package/lib/no-eventsource/config.d.ts +64 -0
  357. package/lib/no-eventsource/config.js +51 -0
  358. package/lib/no-eventsource/contract/assembled_transaction.d.ts +555 -0
  359. package/lib/no-eventsource/contract/assembled_transaction.js +752 -0
  360. package/lib/no-eventsource/contract/basic_node_signer.d.ts +17 -0
  361. package/lib/no-eventsource/contract/basic_node_signer.js +52 -0
  362. package/lib/no-eventsource/contract/client.d.ts +52 -0
  363. package/lib/no-eventsource/contract/client.js +180 -0
  364. package/lib/no-eventsource/contract/index.d.ts +7 -0
  365. package/lib/no-eventsource/contract/index.js +82 -0
  366. package/lib/no-eventsource/contract/rust_result.d.ts +81 -0
  367. package/lib/no-eventsource/contract/rust_result.js +66 -0
  368. package/lib/no-eventsource/contract/sent_transaction.d.ts +85 -0
  369. package/lib/no-eventsource/contract/sent_transaction.js +151 -0
  370. package/lib/no-eventsource/contract/spec.d.ts +152 -0
  371. package/lib/no-eventsource/contract/spec.js +1020 -0
  372. package/lib/no-eventsource/contract/types.d.ts +180 -0
  373. package/lib/no-eventsource/contract/types.js +8 -0
  374. package/lib/no-eventsource/contract/utils.d.ts +46 -0
  375. package/lib/no-eventsource/contract/utils.js +123 -0
  376. package/lib/no-eventsource/errors/account_requires_memo.d.ts +24 -0
  377. package/lib/no-eventsource/errors/account_requires_memo.js +38 -0
  378. package/lib/no-eventsource/errors/bad_request.d.ts +14 -0
  379. package/lib/no-eventsource/errors/bad_request.js +34 -0
  380. package/lib/no-eventsource/errors/bad_response.d.ts +17 -0
  381. package/lib/no-eventsource/errors/bad_response.js +34 -0
  382. package/lib/no-eventsource/errors/index.d.ts +5 -0
  383. package/lib/no-eventsource/errors/index.js +60 -0
  384. package/lib/no-eventsource/errors/network.d.ts +33 -0
  385. package/lib/no-eventsource/errors/network.js +41 -0
  386. package/lib/no-eventsource/errors/not_found.d.ts +14 -0
  387. package/lib/no-eventsource/errors/not_found.js +34 -0
  388. package/lib/no-eventsource/federation/api.d.ts +32 -0
  389. package/lib/no-eventsource/federation/api.js +7 -0
  390. package/lib/no-eventsource/federation/index.d.ts +2 -0
  391. package/lib/no-eventsource/federation/index.js +34 -0
  392. package/lib/no-eventsource/federation/server.d.ts +116 -0
  393. package/lib/no-eventsource/federation/server.js +252 -0
  394. package/lib/no-eventsource/friendbot/index.d.ts +5 -0
  395. package/lib/no-eventsource/friendbot/index.js +7 -0
  396. package/lib/no-eventsource/horizon/account_call_builder.d.ts +56 -0
  397. package/lib/no-eventsource/horizon/account_call_builder.js +62 -0
  398. package/lib/no-eventsource/horizon/account_response.d.ts +61 -0
  399. package/lib/no-eventsource/horizon/account_response.js +49 -0
  400. package/lib/no-eventsource/horizon/assets_call_builder.d.ts +27 -0
  401. package/lib/no-eventsource/horizon/assets_call_builder.js +43 -0
  402. package/lib/no-eventsource/horizon/call_builder.d.ts +128 -0
  403. package/lib/no-eventsource/horizon/call_builder.js +362 -0
  404. package/lib/no-eventsource/horizon/claimable_balances_call_builder.d.ts +50 -0
  405. package/lib/no-eventsource/horizon/claimable_balances_call_builder.js +56 -0
  406. package/lib/no-eventsource/horizon/effect_call_builder.d.ts +53 -0
  407. package/lib/no-eventsource/horizon/effect_call_builder.js +56 -0
  408. package/lib/no-eventsource/horizon/friendbot_builder.d.ts +4 -0
  409. package/lib/no-eventsource/horizon/friendbot_builder.js +32 -0
  410. package/lib/no-eventsource/horizon/horizon_api.d.ts +527 -0
  411. package/lib/no-eventsource/horizon/horizon_api.js +96 -0
  412. package/lib/no-eventsource/horizon/horizon_axios_client.d.ts +37 -0
  413. package/lib/no-eventsource/horizon/horizon_axios_client.js +60 -0
  414. package/lib/no-eventsource/horizon/index.d.ts +8 -0
  415. package/lib/no-eventsource/horizon/index.js +78 -0
  416. package/lib/no-eventsource/horizon/ledger_call_builder.d.ts +23 -0
  417. package/lib/no-eventsource/horizon/ledger_call_builder.js +37 -0
  418. package/lib/no-eventsource/horizon/liquidity_pool_call_builder.d.ts +37 -0
  419. package/lib/no-eventsource/horizon/liquidity_pool_call_builder.js +59 -0
  420. package/lib/no-eventsource/horizon/offer_call_builder.d.ts +65 -0
  421. package/lib/no-eventsource/horizon/offer_call_builder.js +79 -0
  422. package/lib/no-eventsource/horizon/operation_call_builder.d.ts +69 -0
  423. package/lib/no-eventsource/horizon/operation_call_builder.js +69 -0
  424. package/lib/no-eventsource/horizon/orderbook_call_builder.d.ts +20 -0
  425. package/lib/no-eventsource/horizon/orderbook_call_builder.js +45 -0
  426. package/lib/no-eventsource/horizon/path_call_builder.d.ts +35 -0
  427. package/lib/no-eventsource/horizon/path_call_builder.js +41 -0
  428. package/lib/no-eventsource/horizon/payment_call_builder.d.ts +39 -0
  429. package/lib/no-eventsource/horizon/payment_call_builder.js +46 -0
  430. package/lib/no-eventsource/horizon/server.d.ts +389 -0
  431. package/lib/no-eventsource/horizon/server.js +550 -0
  432. package/lib/no-eventsource/horizon/server_api.d.ts +278 -0
  433. package/lib/no-eventsource/horizon/server_api.js +19 -0
  434. package/lib/no-eventsource/horizon/strict_receive_path_call_builder.d.ts +38 -0
  435. package/lib/no-eventsource/horizon/strict_receive_path_call_builder.js +50 -0
  436. package/lib/no-eventsource/horizon/strict_send_path_call_builder.d.ts +38 -0
  437. package/lib/no-eventsource/horizon/strict_send_path_call_builder.js +50 -0
  438. package/lib/no-eventsource/horizon/trade_aggregation_call_builder.d.ts +49 -0
  439. package/lib/no-eventsource/horizon/trade_aggregation_call_builder.js +76 -0
  440. package/lib/no-eventsource/horizon/trades_call_builder.d.ts +52 -0
  441. package/lib/no-eventsource/horizon/trades_call_builder.js +72 -0
  442. package/lib/no-eventsource/horizon/transaction_call_builder.d.ts +60 -0
  443. package/lib/no-eventsource/horizon/transaction_call_builder.js +64 -0
  444. package/lib/no-eventsource/horizon/types/account.d.ts +5 -0
  445. package/lib/no-eventsource/horizon/types/account.js +5 -0
  446. package/lib/no-eventsource/horizon/types/assets.d.ts +19 -0
  447. package/lib/no-eventsource/horizon/types/assets.js +5 -0
  448. package/lib/no-eventsource/horizon/types/effects.d.ts +285 -0
  449. package/lib/no-eventsource/horizon/types/effects.js +62 -0
  450. package/lib/no-eventsource/horizon/types/offer.d.ts +20 -0
  451. package/lib/no-eventsource/horizon/types/offer.js +5 -0
  452. package/lib/no-eventsource/horizon/types/trade.d.ts +13 -0
  453. package/lib/no-eventsource/horizon/types/trade.js +5 -0
  454. package/lib/no-eventsource/http-client/axios-client.d.ts +2 -0
  455. package/lib/no-eventsource/http-client/axios-client.js +10 -0
  456. package/lib/no-eventsource/http-client/fetch-client.d.ts +11 -0
  457. package/lib/no-eventsource/http-client/fetch-client.js +229 -0
  458. package/lib/no-eventsource/http-client/index.d.ts +5 -0
  459. package/lib/no-eventsource/http-client/index.js +33 -0
  460. package/lib/no-eventsource/http-client/types.d.ts +69 -0
  461. package/lib/no-eventsource/http-client/types.js +34 -0
  462. package/lib/no-eventsource/index.d.ts +36 -0
  463. package/lib/no-eventsource/index.js +83 -0
  464. package/lib/no-eventsource/rpc/api.d.ts +359 -0
  465. package/lib/no-eventsource/rpc/api.js +32 -0
  466. package/lib/no-eventsource/rpc/axios.d.ts +4 -0
  467. package/lib/no-eventsource/rpc/axios.js +15 -0
  468. package/lib/no-eventsource/rpc/browser.d.ts +4 -0
  469. package/lib/no-eventsource/rpc/browser.js +27 -0
  470. package/lib/no-eventsource/rpc/index.d.ts +8 -0
  471. package/lib/no-eventsource/rpc/index.js +72 -0
  472. package/lib/no-eventsource/rpc/jsonrpc.d.ts +35 -0
  473. package/lib/no-eventsource/rpc/jsonrpc.js +52 -0
  474. package/lib/no-eventsource/rpc/parsers.d.ts +39 -0
  475. package/lib/no-eventsource/rpc/parsers.js +155 -0
  476. package/lib/no-eventsource/rpc/server.d.ts +584 -0
  477. package/lib/no-eventsource/rpc/server.js +823 -0
  478. package/lib/no-eventsource/rpc/transaction.d.ts +21 -0
  479. package/lib/no-eventsource/rpc/transaction.js +53 -0
  480. package/lib/no-eventsource/rpc/utils.d.ts +1 -0
  481. package/lib/no-eventsource/rpc/utils.js +9 -0
  482. package/lib/no-eventsource/stellartoml/index.d.ts +131 -0
  483. package/lib/no-eventsource/stellartoml/index.js +77 -0
  484. package/lib/no-eventsource/utils.d.ts +19 -0
  485. package/lib/no-eventsource/utils.js +31 -0
  486. package/lib/no-eventsource/webauth/errors.d.ts +13 -0
  487. package/lib/no-eventsource/webauth/errors.js +36 -0
  488. package/lib/no-eventsource/webauth/index.d.ts +2 -0
  489. package/lib/no-eventsource/webauth/index.js +27 -0
  490. package/lib/no-eventsource/webauth/utils.d.ts +307 -0
  491. package/lib/no-eventsource/webauth/utils.js +332 -0
  492. package/lib/rpc/api.d.ts +73 -8
  493. package/lib/rpc/axios.d.ts +3 -2
  494. package/lib/rpc/axios.js +3 -4
  495. package/lib/rpc/browser.d.ts +0 -2
  496. package/lib/rpc/browser.js +1 -11
  497. package/lib/rpc/index.d.ts +2 -1
  498. package/lib/rpc/index.js +1 -1
  499. package/lib/rpc/jsonrpc.d.ts +9 -1
  500. package/lib/rpc/parsers.d.ts +32 -10
  501. package/lib/rpc/parsers.js +40 -11
  502. package/lib/rpc/server.d.ts +197 -100
  503. package/lib/rpc/server.js +251 -110
  504. package/lib/rpc/transaction.d.ts +11 -9
  505. package/lib/stellartoml/index.d.ts +21 -11
  506. package/lib/stellartoml/index.js +3 -3
  507. package/lib/utils.d.ts +11 -4
  508. package/lib/webauth/errors.d.ts +9 -0
  509. package/lib/webauth/utils.d.ts +67 -54
  510. package/package.json +73 -21
  511. package/lib/errors.d.ts +0 -59
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CallBuilder = void 0;
7
+ var _urijs = _interopRequireDefault(require("urijs"));
8
+ var _URITemplate = _interopRequireDefault(require("urijs/src/URITemplate"));
9
+ var _errors = require("../errors");
10
+ var _horizon_axios_client = require("./horizon_axios_client");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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
+ function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
14
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
15
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
16
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
17
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
18
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
21
+ var JOINABLE = ["transaction"];
22
+ var anyGlobal = global;
23
+ var EventSource;
24
+ if (typeof false !== 'undefined' && false) {
25
+ var _ref, _anyGlobal$EventSourc, _anyGlobal$window;
26
+ EventSource = (_ref = (_anyGlobal$EventSourc = anyGlobal.EventSource) !== null && _anyGlobal$EventSourc !== void 0 ? _anyGlobal$EventSourc : (_anyGlobal$window = anyGlobal.window) === null || _anyGlobal$window === void 0 ? void 0 : _anyGlobal$window.EventSource) !== null && _ref !== void 0 ? _ref : require("eventsource");
27
+ }
28
+ var CallBuilder = exports.CallBuilder = function () {
29
+ function CallBuilder(serverUrl) {
30
+ var neighborRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
31
+ _classCallCheck(this, CallBuilder);
32
+ this.url = serverUrl.clone();
33
+ this.filter = [];
34
+ this.originalSegments = this.url.segment() || [];
35
+ this.neighborRoot = neighborRoot;
36
+ }
37
+ return _createClass(CallBuilder, [{
38
+ key: "call",
39
+ value: function call() {
40
+ var _this = this;
41
+ this.checkFilter();
42
+ return this._sendNormalRequest(this.url).then(function (r) {
43
+ return _this._parseResponse(r);
44
+ });
45
+ }
46
+ }, {
47
+ key: "stream",
48
+ value: function stream() {
49
+ var _this2 = this;
50
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
51
+ if (EventSource === undefined) {
52
+ throw new Error("Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.");
53
+ }
54
+ this.checkFilter();
55
+ this.url.setQuery("X-Client-Name", "js-stellar-sdk");
56
+ this.url.setQuery("X-Client-Version", _horizon_axios_client.version);
57
+ var es;
58
+ var timeout;
59
+ var createTimeout = function createTimeout() {
60
+ timeout = setTimeout(function () {
61
+ var _es;
62
+ (_es = es) === null || _es === void 0 || _es.close();
63
+ es = _createEventSource();
64
+ }, options.reconnectTimeout || 15 * 1000);
65
+ };
66
+ var _createEventSource = function createEventSource() {
67
+ try {
68
+ es = new EventSource(_this2.url.toString());
69
+ } catch (err) {
70
+ if (options.onerror) {
71
+ options.onerror(err);
72
+ }
73
+ }
74
+ createTimeout();
75
+ if (!es) {
76
+ return es;
77
+ }
78
+ var closed = false;
79
+ var onClose = function onClose() {
80
+ if (closed) {
81
+ return;
82
+ }
83
+ clearTimeout(timeout);
84
+ es.close();
85
+ _createEventSource();
86
+ closed = true;
87
+ };
88
+ var onMessage = function onMessage(message) {
89
+ if (message.type === "close") {
90
+ onClose();
91
+ return;
92
+ }
93
+ var result = message.data ? _this2._parseRecord(JSON.parse(message.data)) : message;
94
+ if (result.paging_token) {
95
+ _this2.url.setQuery("cursor", result.paging_token);
96
+ }
97
+ clearTimeout(timeout);
98
+ createTimeout();
99
+ if (typeof options.onmessage !== "undefined") {
100
+ options.onmessage(result);
101
+ }
102
+ };
103
+ var onError = function onError(error) {
104
+ if (options.onerror) {
105
+ options.onerror(error);
106
+ }
107
+ };
108
+ if (es.addEventListener) {
109
+ es.addEventListener("message", onMessage.bind(_this2));
110
+ es.addEventListener("error", onError.bind(_this2));
111
+ es.addEventListener("close", onClose.bind(_this2));
112
+ } else {
113
+ es.onmessage = onMessage.bind(_this2);
114
+ es.onerror = onError.bind(_this2);
115
+ }
116
+ return es;
117
+ };
118
+ _createEventSource();
119
+ return function () {
120
+ var _es2;
121
+ clearTimeout(timeout);
122
+ (_es2 = es) === null || _es2 === void 0 || _es2.close();
123
+ };
124
+ }
125
+ }, {
126
+ key: "cursor",
127
+ value: function cursor(_cursor) {
128
+ this.url.setQuery("cursor", _cursor);
129
+ return this;
130
+ }
131
+ }, {
132
+ key: "limit",
133
+ value: function limit(recordsNumber) {
134
+ this.url.setQuery("limit", recordsNumber.toString());
135
+ return this;
136
+ }
137
+ }, {
138
+ key: "order",
139
+ value: function order(direction) {
140
+ this.url.setQuery("order", direction);
141
+ return this;
142
+ }
143
+ }, {
144
+ key: "join",
145
+ value: function join(include) {
146
+ this.url.setQuery("join", include);
147
+ return this;
148
+ }
149
+ }, {
150
+ key: "forEndpoint",
151
+ value: function forEndpoint(endpoint, param) {
152
+ if (this.neighborRoot === "") {
153
+ throw new Error("Invalid usage: neighborRoot not set in constructor");
154
+ }
155
+ this.filter.push([endpoint, param, this.neighborRoot]);
156
+ return this;
157
+ }
158
+ }, {
159
+ key: "checkFilter",
160
+ value: function checkFilter() {
161
+ if (this.filter.length >= 2) {
162
+ throw new _errors.BadRequestError("Too many filters specified", this.filter);
163
+ }
164
+ if (this.filter.length === 1) {
165
+ var newSegment = this.originalSegments.concat(this.filter[0]);
166
+ this.url.segment(newSegment);
167
+ }
168
+ }
169
+ }, {
170
+ key: "_requestFnForLink",
171
+ value: function _requestFnForLink(link) {
172
+ var _this3 = this;
173
+ return _asyncToGenerator(_regeneratorRuntime().mark(function _callee() {
174
+ var opts,
175
+ uri,
176
+ template,
177
+ r,
178
+ _args = arguments;
179
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
180
+ while (1) switch (_context.prev = _context.next) {
181
+ case 0:
182
+ opts = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
183
+ if (link.templated) {
184
+ template = (0, _URITemplate.default)(link.href);
185
+ uri = (0, _urijs.default)(template.expand(opts));
186
+ } else {
187
+ uri = (0, _urijs.default)(link.href);
188
+ }
189
+ _context.next = 4;
190
+ return _this3._sendNormalRequest(uri);
191
+ case 4:
192
+ r = _context.sent;
193
+ return _context.abrupt("return", _this3._parseResponse(r));
194
+ case 6:
195
+ case "end":
196
+ return _context.stop();
197
+ }
198
+ }, _callee);
199
+ }));
200
+ }
201
+ }, {
202
+ key: "_parseRecord",
203
+ value: function _parseRecord(json) {
204
+ var _this4 = this;
205
+ if (!json._links) {
206
+ return json;
207
+ }
208
+ Object.keys(json._links).forEach(function (key) {
209
+ var n = json._links[key];
210
+ var included = false;
211
+ if (typeof json[key] !== "undefined") {
212
+ json["".concat(key, "_attr")] = json[key];
213
+ included = true;
214
+ }
215
+ if (included && JOINABLE.indexOf(key) >= 0) {
216
+ var record = _this4._parseRecord(json[key]);
217
+ json[key] = _asyncToGenerator(_regeneratorRuntime().mark(function _callee2() {
218
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
219
+ while (1) switch (_context2.prev = _context2.next) {
220
+ case 0:
221
+ return _context2.abrupt("return", record);
222
+ case 1:
223
+ case "end":
224
+ return _context2.stop();
225
+ }
226
+ }, _callee2);
227
+ }));
228
+ } else {
229
+ json[key] = _this4._requestFnForLink(n);
230
+ }
231
+ });
232
+ return json;
233
+ }
234
+ }, {
235
+ key: "_sendNormalRequest",
236
+ value: function () {
237
+ var _sendNormalRequest2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee3(initialUrl) {
238
+ var url;
239
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
240
+ while (1) switch (_context3.prev = _context3.next) {
241
+ case 0:
242
+ url = initialUrl;
243
+ if (url.authority() === "") {
244
+ url = url.authority(this.url.authority());
245
+ }
246
+ if (url.protocol() === "") {
247
+ url = url.protocol(this.url.protocol());
248
+ }
249
+ return _context3.abrupt("return", _horizon_axios_client.AxiosClient.get(url.toString()).then(function (response) {
250
+ return response.data;
251
+ }).catch(this._handleNetworkError));
252
+ case 4:
253
+ case "end":
254
+ return _context3.stop();
255
+ }
256
+ }, _callee3, this);
257
+ }));
258
+ function _sendNormalRequest(_x) {
259
+ return _sendNormalRequest2.apply(this, arguments);
260
+ }
261
+ return _sendNormalRequest;
262
+ }()
263
+ }, {
264
+ key: "_parseResponse",
265
+ value: function _parseResponse(json) {
266
+ if (json._embedded && json._embedded.records) {
267
+ return this._toCollectionPage(json);
268
+ }
269
+ return this._parseRecord(json);
270
+ }
271
+ }, {
272
+ key: "_toCollectionPage",
273
+ value: function _toCollectionPage(json) {
274
+ var _this5 = this;
275
+ for (var i = 0; i < json._embedded.records.length; i += 1) {
276
+ json._embedded.records[i] = this._parseRecord(json._embedded.records[i]);
277
+ }
278
+ return {
279
+ records: json._embedded.records,
280
+ next: function () {
281
+ var _next2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee4() {
282
+ var r;
283
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
284
+ while (1) switch (_context4.prev = _context4.next) {
285
+ case 0:
286
+ _context4.next = 2;
287
+ return _this5._sendNormalRequest((0, _urijs.default)(json._links.next.href));
288
+ case 2:
289
+ r = _context4.sent;
290
+ return _context4.abrupt("return", _this5._toCollectionPage(r));
291
+ case 4:
292
+ case "end":
293
+ return _context4.stop();
294
+ }
295
+ }, _callee4);
296
+ }));
297
+ function next() {
298
+ return _next2.apply(this, arguments);
299
+ }
300
+ return next;
301
+ }(),
302
+ prev: function () {
303
+ var _prev = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5() {
304
+ var r;
305
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
306
+ while (1) switch (_context5.prev = _context5.next) {
307
+ case 0:
308
+ _context5.next = 2;
309
+ return _this5._sendNormalRequest((0, _urijs.default)(json._links.prev.href));
310
+ case 2:
311
+ r = _context5.sent;
312
+ return _context5.abrupt("return", _this5._toCollectionPage(r));
313
+ case 4:
314
+ case "end":
315
+ return _context5.stop();
316
+ }
317
+ }, _callee5);
318
+ }));
319
+ function prev() {
320
+ return _prev.apply(this, arguments);
321
+ }
322
+ return prev;
323
+ }()
324
+ };
325
+ }
326
+ }, {
327
+ key: "_handleNetworkError",
328
+ value: (function () {
329
+ var _handleNetworkError2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee6(error) {
330
+ var _error$response$statu, _error$response$statu2;
331
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
332
+ while (1) switch (_context6.prev = _context6.next) {
333
+ case 0:
334
+ if (!(error.response && error.response.status)) {
335
+ _context6.next = 8;
336
+ break;
337
+ }
338
+ _context6.t0 = error.response.status;
339
+ _context6.next = _context6.t0 === 404 ? 4 : 5;
340
+ break;
341
+ case 4:
342
+ return _context6.abrupt("return", Promise.reject(new _errors.NotFoundError((_error$response$statu = error.response.statusText) !== null && _error$response$statu !== void 0 ? _error$response$statu : "Not Found", error.response.data)));
343
+ case 5:
344
+ return _context6.abrupt("return", Promise.reject(new _errors.NetworkError((_error$response$statu2 = error.response.statusText) !== null && _error$response$statu2 !== void 0 ? _error$response$statu2 : "Unknown", error.response.data)));
345
+ case 6:
346
+ _context6.next = 9;
347
+ break;
348
+ case 8:
349
+ return _context6.abrupt("return", Promise.reject(new Error(error.message)));
350
+ case 9:
351
+ case "end":
352
+ return _context6.stop();
353
+ }
354
+ }, _callee6);
355
+ }));
356
+ function _handleNetworkError(_x2) {
357
+ return _handleNetworkError2.apply(this, arguments);
358
+ }
359
+ return _handleNetworkError;
360
+ }())
361
+ }]);
362
+ }();
@@ -0,0 +1,50 @@
1
+ import { Asset } from "@stellar/stellar-base";
2
+ import { CallBuilder } from "./call_builder";
3
+ import { ServerApi } from "./server_api";
4
+ /**
5
+ * Creates a new {@link ClaimableBalanceCallBuilder} pointed to server defined by serverUrl.
6
+ *
7
+ * Do not create this object directly, use {@link Horizon.Server#claimableBalances}.
8
+ *
9
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/claimablebalances|Claimable Balances}
10
+ *
11
+ * @augments CallBuilder
12
+ * @private
13
+ * @class
14
+ * @param {string} serverUrl Horizon server URL.
15
+ */
16
+ export declare class ClaimableBalanceCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.ClaimableBalanceRecord>> {
17
+ constructor(serverUrl: URI);
18
+ /**
19
+ * The claimable balance details endpoint provides information on a single claimable balance.
20
+ *
21
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-claimable-balance|Claimable Balance Details}
22
+ * @param {string} claimableBalanceId Claimable balance ID
23
+ * @returns {CallBuilder<ServerApi.ClaimableBalanceRecord>} CallBuilder<ServerApi.ClaimableBalanceRecord> OperationCallBuilder instance
24
+ */
25
+ claimableBalance(claimableBalanceId: string): CallBuilder<ServerApi.ClaimableBalanceRecord>;
26
+ /**
27
+ * Returns all claimable balances which are sponsored by the given account ID.
28
+ *
29
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/list-all-claimable-balances|Claimable Balances}
30
+ * @param {string} sponsor For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
31
+ * @returns {ClaimableBalanceCallBuilder} current ClaimableBalanceCallBuilder instance
32
+ */
33
+ sponsor(sponsor: string): this;
34
+ /**
35
+ * Returns all claimable balances which can be claimed by the given account ID.
36
+ *
37
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/list-all-claimable-balances|Claimable Balances}
38
+ * @param {string} claimant For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
39
+ * @returns {ClaimableBalanceCallBuilder} current ClaimableBalanceCallBuilder instance
40
+ */
41
+ claimant(claimant: string): this;
42
+ /**
43
+ * Returns all claimable balances which provide a balance for the given asset.
44
+ *
45
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/list-all-claimable-balances|Claimable Balances}
46
+ * @param {Asset} asset The Asset held by the claimable balance
47
+ * @returns {ClaimableBalanceCallBuilder} current ClaimableBalanceCallBuilder instance
48
+ */
49
+ asset(asset: Asset): this;
50
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ClaimableBalanceCallBuilder = void 0;
8
+ var _call_builder = require("./call_builder");
9
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
10
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
11
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
21
+ var ClaimableBalanceCallBuilder = exports.ClaimableBalanceCallBuilder = function (_CallBuilder) {
22
+ function ClaimableBalanceCallBuilder(serverUrl) {
23
+ var _this;
24
+ _classCallCheck(this, ClaimableBalanceCallBuilder);
25
+ _this = _callSuper(this, ClaimableBalanceCallBuilder, [serverUrl]);
26
+ _this.url.segment("claimable_balances");
27
+ return _this;
28
+ }
29
+ _inherits(ClaimableBalanceCallBuilder, _CallBuilder);
30
+ return _createClass(ClaimableBalanceCallBuilder, [{
31
+ key: "claimableBalance",
32
+ value: function claimableBalance(claimableBalanceId) {
33
+ var builder = new _call_builder.CallBuilder(this.url.clone());
34
+ builder.filter.push([claimableBalanceId]);
35
+ return builder;
36
+ }
37
+ }, {
38
+ key: "sponsor",
39
+ value: function sponsor(_sponsor) {
40
+ this.url.setQuery("sponsor", _sponsor);
41
+ return this;
42
+ }
43
+ }, {
44
+ key: "claimant",
45
+ value: function claimant(_claimant) {
46
+ this.url.setQuery("claimant", _claimant);
47
+ return this;
48
+ }
49
+ }, {
50
+ key: "asset",
51
+ value: function asset(_asset) {
52
+ this.url.setQuery("asset", _asset.toString());
53
+ return this;
54
+ }
55
+ }]);
56
+ }(_call_builder.CallBuilder);
@@ -0,0 +1,53 @@
1
+ import { CallBuilder } from "./call_builder";
2
+ import { ServerApi } from "./server_api";
3
+ /**
4
+ * Creates a new {@link EffectCallBuilder} pointed to server defined by serverUrl.
5
+ * Do not create this object directly, use {@link Horizon.Server#effects}.
6
+ *
7
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/effects|All Effects}
8
+ *
9
+ * @augments CallBuilder
10
+ * @private
11
+ * @class
12
+ * @param {string} serverUrl Horizon server URL.
13
+ */
14
+ export declare class EffectCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.EffectRecord>> {
15
+ constructor(serverUrl: URI);
16
+ /**
17
+ * This endpoint represents all effects that changed a given account. It will return relevant effects from the creation of the account to the current ledger.
18
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-effects-by-account-id|Effects for Account}
19
+ * @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
20
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
21
+ */
22
+ forAccount(accountId: string): this;
23
+ /**
24
+ * Effects are the specific ways that the ledger was changed by any operation.
25
+ *
26
+ * This endpoint represents all effects that occurred in the given ledger.
27
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-ledgers-effects|Effects for Ledger}
28
+ * @param {number|string} sequence Ledger sequence
29
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
30
+ */
31
+ forLedger(sequence: number | string): this;
32
+ /**
33
+ * This endpoint represents all effects that occurred as a result of a given transaction.
34
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-transactions-effects|Effects for Transaction}
35
+ * @param {string} transactionId Transaction ID
36
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
37
+ */
38
+ forTransaction(transactionId: string): this;
39
+ /**
40
+ * This endpoint represents all effects that occurred as a result of a given operation.
41
+ * @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-an-operations-effects|Effects for Operation}
42
+ * @param {number} operationId Operation ID
43
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
44
+ */
45
+ forOperation(operationId: string): this;
46
+ /**
47
+ * This endpoint represents all effects involving a particular liquidity pool.
48
+ *
49
+ * @param {string} poolId liquidity pool ID
50
+ * @returns {EffectCallBuilder} this EffectCallBuilder instance
51
+ */
52
+ forLiquidityPool(poolId: string): this;
53
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EffectCallBuilder = void 0;
8
+ var _call_builder = require("./call_builder");
9
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
10
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
11
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
21
+ var EffectCallBuilder = exports.EffectCallBuilder = function (_CallBuilder) {
22
+ function EffectCallBuilder(serverUrl) {
23
+ var _this;
24
+ _classCallCheck(this, EffectCallBuilder);
25
+ _this = _callSuper(this, EffectCallBuilder, [serverUrl, "effects"]);
26
+ _this.url.segment("effects");
27
+ return _this;
28
+ }
29
+ _inherits(EffectCallBuilder, _CallBuilder);
30
+ return _createClass(EffectCallBuilder, [{
31
+ key: "forAccount",
32
+ value: function forAccount(accountId) {
33
+ return this.forEndpoint("accounts", accountId);
34
+ }
35
+ }, {
36
+ key: "forLedger",
37
+ value: function forLedger(sequence) {
38
+ return this.forEndpoint("ledgers", sequence.toString());
39
+ }
40
+ }, {
41
+ key: "forTransaction",
42
+ value: function forTransaction(transactionId) {
43
+ return this.forEndpoint("transactions", transactionId);
44
+ }
45
+ }, {
46
+ key: "forOperation",
47
+ value: function forOperation(operationId) {
48
+ return this.forEndpoint("operations", operationId);
49
+ }
50
+ }, {
51
+ key: "forLiquidityPool",
52
+ value: function forLiquidityPool(poolId) {
53
+ return this.forEndpoint("liquidity_pools", poolId);
54
+ }
55
+ }]);
56
+ }(_call_builder.CallBuilder);
@@ -0,0 +1,4 @@
1
+ import { CallBuilder } from "./call_builder";
2
+ export declare class FriendbotBuilder extends CallBuilder<any> {
3
+ constructor(serverUrl: URI, address: string);
4
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.FriendbotBuilder = void 0;
8
+ var _call_builder = require("./call_builder");
9
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
10
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
21
+ var FriendbotBuilder = exports.FriendbotBuilder = function (_CallBuilder) {
22
+ function FriendbotBuilder(serverUrl, address) {
23
+ var _this;
24
+ _classCallCheck(this, FriendbotBuilder);
25
+ _this = _callSuper(this, FriendbotBuilder, [serverUrl]);
26
+ _this.url.segment("friendbot");
27
+ _this.url.setQuery("addr", address);
28
+ return _this;
29
+ }
30
+ _inherits(FriendbotBuilder, _CallBuilder);
31
+ return _createClass(FriendbotBuilder);
32
+ }(_call_builder.CallBuilder);