@stellar/stellar-sdk 12.3.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 +35 -0
  2. package/README.md +29 -7
  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 +28203 -27336
  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 +158 -127
  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 +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/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 +13 -2
  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 +30 -10
  501. package/lib/rpc/parsers.js +11 -11
  502. package/lib/rpc/server.d.ts +169 -99
  503. package/lib/rpc/server.js +92 -6
  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 +59 -7
  511. package/lib/errors.d.ts +0 -59
package/lib/rpc/axios.js CHANGED
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = exports.default = exports.AxiosClient = void 0;
7
- var _axios = _interopRequireDefault(require("axios"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- var version = exports.version = require('../../package.json').version;
10
- var AxiosClient = exports.AxiosClient = _axios.default.create({
7
+ var _httpClient = require("../http-client");
8
+ var version = exports.version = "13.0.0-beta.1";
9
+ var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
11
10
  headers: {
12
11
  'X-Client-Name': 'js-soroban-client',
13
12
  'X-Client-Version': version
@@ -1,6 +1,4 @@
1
- import axios from 'axios';
2
1
  export * from './index';
3
2
  export * as StellarBase from '@stellar/stellar-base';
4
- export { axios };
5
3
  declare const _default: any;
6
4
  export default _default;
@@ -5,18 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  var _exportNames = {
8
- axios: true,
9
8
  StellarBase: true
10
9
  };
11
- exports.StellarBase = void 0;
12
- Object.defineProperty(exports, "axios", {
13
- enumerable: true,
14
- get: function get() {
15
- return _axios.default;
16
- }
17
- });
18
- exports.default = void 0;
19
- var _axios = _interopRequireDefault(require("axios"));
10
+ exports.default = exports.StellarBase = void 0;
20
11
  var _index = require("./index");
21
12
  Object.keys(_index).forEach(function (key) {
22
13
  if (key === "default" || key === "__esModule") return;
@@ -33,5 +24,4 @@ var _StellarBase = _interopRequireWildcard(require("@stellar/stellar-base"));
33
24
  exports.StellarBase = _StellarBase;
34
25
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
35
26
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
36
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
37
27
  var _default = exports.default = module.exports;
@@ -1,5 +1,6 @@
1
+ /** @module rpc */
1
2
  export * from "./api";
2
- export { Server, Durability } from "./server";
3
+ export { RpcServer as Server, Durability } from "./server";
3
4
  export { default as AxiosClient } from "./axios";
4
5
  export { parseRawSimulation, parseRawEvents } from "./parsers";
5
6
  export * from "./transaction";
package/lib/rpc/index.js CHANGED
@@ -25,7 +25,7 @@ Object.defineProperty(exports, "Durability", {
25
25
  Object.defineProperty(exports, "Server", {
26
26
  enumerable: true,
27
27
  get: function get() {
28
- return _server.Server;
28
+ return _server.RpcServer;
29
29
  }
30
30
  });
31
31
  exports.default = void 0;
@@ -23,5 +23,13 @@ export interface Error<E = any> {
23
23
  message?: string;
24
24
  data?: E;
25
25
  }
26
- /** Sends the jsonrpc 'params' as a single 'param' object (no array support). */
26
+ /**
27
+ * Sends the jsonrpc 'params' as a single 'param' object (no array support).
28
+ *
29
+ * @param {string} url URL to the RPC instance
30
+ * @param {string} method RPC method name that should be called
31
+ * @param {(any | null)} [param=null] params that should be supplied to the method
32
+ * @returns {Promise<T>}
33
+ * @private
34
+ */
27
35
  export declare function postObject<T>(url: string, method: string, param?: any): Promise<T>;
@@ -1,19 +1,39 @@
1
1
  import { Api } from './api';
2
- export declare function parseRawSendTransaction(r: Api.RawSendTransactionResponse): Api.SendTransactionResponse;
2
+ /**
3
+ * Parse the response from invoking the `submitTransaction` method of a Soroban RPC server.
4
+ * @memberof module:rpc
5
+ * @private
6
+ *
7
+ * @param {Api.RawSendTransactionResponse} raw the raw `submitTransaction` response from the Soroban RPC server to parse
8
+ * @returns {Api.SendTransactionResponse} transaction response parsed from the Soroban RPC server's response
9
+ */
10
+ export declare function parseRawSendTransaction(raw: Api.RawSendTransactionResponse): Api.SendTransactionResponse;
3
11
  export declare function parseTransactionInfo(raw: Api.RawTransactionInfo | Api.RawGetTransactionResponse): Omit<Api.TransactionInfo, 'status'>;
4
12
  export declare function parseRawTransactions(r: Api.RawTransactionInfo): Api.TransactionInfo;
5
- export declare function parseRawEvents(r: Api.RawGetEventsResponse): Api.GetEventsResponse;
6
- export declare function parseRawLedgerEntries(raw: Api.RawGetLedgerEntriesResponse): Api.GetLedgerEntriesResponse;
7
13
  /**
8
- * Converts a raw response schema into one with parsed XDR fields and a
9
- * simplified interface.
10
- * Warning: This API is only exported for testing purposes and should not be
11
- * relied on or considered "stable".
14
+ * Parse and return the retrieved events, if any, from a raw response from a Soroban RPC server.
15
+ * @memberof module:rpc
12
16
  *
13
- * @param {Api.SimulateTransactionResponse|Api.RawSimulateTransactionResponse} sim the raw response schema (parsed ones are allowed, best-effort
14
- * detected, and returned untouched)
17
+ * @param {Api.RawGetEventsResponse} raw the raw `getEvents` response from the Soroban RPC server to parse
18
+ * @returns {Api.GetEventsResponse} events parsed from the Soroban RPC server's response
19
+ */
20
+ export declare function parseRawEvents(raw: Api.RawGetEventsResponse): Api.GetEventsResponse;
21
+ /**
22
+ * Parse and return the retrieved ledger entries, if any, from a raw response from a Soroban RPC server.
23
+ * @memberof module:rpc
24
+ * @private
15
25
  *
16
- * @returns the original parameter (if already parsed), parsed otherwise
26
+ * @param {Api.RawGetLedgerEntriesResponse} raw he raw `getLedgerEntries` response from the Soroban RPC server to parse
27
+ * @returns {Api.GetLedgerEntriesResponse} ledger entries parsed from the Soroban RPC server's response
28
+ */
29
+ export declare function parseRawLedgerEntries(raw: Api.RawGetLedgerEntriesResponse): Api.GetLedgerEntriesResponse;
30
+ /**
31
+ * Converts a raw response schema into one with parsed XDR fields and a simplified interface.
32
+ * @warning This API is only exported for testing purposes and should not be relied on or considered "stable".
33
+ * @memberof module:rpc
17
34
  *
35
+ * @param {Api.SimulateTransactionResponse | Api.RawSimulateTransactionResponse} sim the raw response schema (parsed ones are allowed, best-effort
36
+ * detected, and returned untouched)
37
+ * @returns {Api.SimulateTransactionResponse} the original parameter (if already parsed), parsed otherwise
18
38
  */
19
39
  export declare function parseRawSimulation(sim: Api.SimulateTransactionResponse | Api.RawSimulateTransactionResponse): Api.SimulateTransactionResponse;
@@ -17,13 +17,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
17
17
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
18
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
19
  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); }
20
- function parseRawSendTransaction(r) {
21
- var errorResultXdr = r.errorResultXdr,
22
- diagnosticEventsXdr = r.diagnosticEventsXdr;
23
- delete r.errorResultXdr;
24
- delete r.diagnosticEventsXdr;
20
+ function parseRawSendTransaction(raw) {
21
+ var errorResultXdr = raw.errorResultXdr,
22
+ diagnosticEventsXdr = raw.diagnosticEventsXdr;
23
+ delete raw.errorResultXdr;
24
+ delete raw.diagnosticEventsXdr;
25
25
  if (errorResultXdr) {
26
- return _objectSpread(_objectSpread(_objectSpread({}, r), diagnosticEventsXdr !== undefined && diagnosticEventsXdr.length > 0 && {
26
+ return _objectSpread(_objectSpread(_objectSpread({}, raw), diagnosticEventsXdr !== undefined && diagnosticEventsXdr.length > 0 && {
27
27
  diagnosticEvents: diagnosticEventsXdr.map(function (evt) {
28
28
  return _stellarBase.xdr.DiagnosticEvent.fromXDR(evt, 'base64');
29
29
  })
@@ -31,7 +31,7 @@ function parseRawSendTransaction(r) {
31
31
  errorResult: _stellarBase.xdr.TransactionResult.fromXDR(errorResultXdr, 'base64')
32
32
  });
33
33
  }
34
- return _objectSpread({}, r);
34
+ return _objectSpread({}, raw);
35
35
  }
36
36
  function parseTransactionInfo(raw) {
37
37
  var meta = _stellarBase.xdr.TransactionMeta.fromXDR(raw.resultMetaXdr, 'base64');
@@ -60,11 +60,11 @@ function parseRawTransactions(r) {
60
60
  status: r.status
61
61
  }, parseTransactionInfo(r));
62
62
  }
63
- function parseRawEvents(r) {
64
- var _r$events;
63
+ function parseRawEvents(raw) {
64
+ var _raw$events;
65
65
  return {
66
- latestLedger: r.latestLedger,
67
- events: ((_r$events = r.events) !== null && _r$events !== void 0 ? _r$events : []).map(function (evt) {
66
+ latestLedger: raw.latestLedger,
67
+ events: ((_raw$events = raw.events) !== null && _raw$events !== void 0 ? _raw$events : []).map(function (evt) {
68
68
  var clone = _objectSpread({}, evt);
69
69
  delete clone.contractId;
70
70
  return _objectSpread(_objectSpread(_objectSpread({}, clone), evt.contractId !== '' && {
@@ -1,21 +1,53 @@
1
1
  import URI from 'urijs';
2
- import { Account, Address, Contract, FeeBumpTransaction, Transaction, xdr } from '@stellar/stellar-base';
2
+ import { Account, Address, Asset, Contract, FeeBumpTransaction, Transaction, xdr } from '@stellar/stellar-base';
3
3
  import { Api } from './api';
4
+ /**
5
+ * Default transaction submission timeout for RPC requests, in milliseconds
6
+ * @constant {number}
7
+ * @default 60000
8
+ * @memberof module:rpc.Server
9
+ */
4
10
  export declare const SUBMIT_TRANSACTION_TIMEOUT: number;
5
- /** Specifies the durability namespace of contract-related ledger entries. */
11
+ /**
12
+ * Specifies the durability namespace of contract-related ledger entries.
13
+ * @enum {('temporary' | 'persistent')}
14
+ * @memberof module:rpc
15
+ *
16
+ * @see {@link https://developers.stellar.org/docs/learn/smart-contract-internals/state-archival | State Archival docs}
17
+ * @see {@link https://docs.rs/soroban-sdk/latest/soroban_sdk/storage/struct.Storage.html | Rust SDK Storage docs}
18
+ */
6
19
  export declare enum Durability {
7
20
  Temporary = "temporary",
8
21
  Persistent = "persistent"
9
22
  }
10
- export declare namespace Server {
11
- /** Describes the complex filter combinations available for event queries. */
23
+ /**
24
+ * @typedef {object} GetEventsRequest Describes the complex filter combinations available for event queries.
25
+ * @property {Array.<module:rpc.Api.EventFilter>} filters Filters to use when querying events from the RPC server.
26
+ * @property {number} [startLedger] Ledger number (inclusive) to begin querying events.
27
+ * @property {string} [cursor] Page cursor (exclusive) to begin querying events.
28
+ * @property {number} [limit=100] The maximum number of events that should be returned in the RPC response.
29
+ * @memberof module:rpc.Server
30
+ */
31
+ /**
32
+ * @typedef {object} ResourceLeeway Describes additional resource leeways for transaction simulation.
33
+ * @property {number} cpuInstructions Simulate the transaction with more CPU instructions available.
34
+ * @memberof module:rpc.Server
35
+ */
36
+ /**
37
+ * @typedef {object} Options Options for configuring connections to RPC servers.
38
+ * @property {boolean} [allowHttp=false] Allow connecting to http servers, default: `false`. This must be set to false in production deployments!
39
+ * @property {number} [timeout=0] Allow a timeout, default: 0. Allows user to avoid nasty lag. You can also use {@link Config} class to set this globally.
40
+ * @property {Record<string, string>} [headers] Additional headers that should be added to any requests to the RPC server.
41
+ * @memberof module:rpc.Server
42
+ */
43
+ export declare namespace RpcServer {
12
44
  interface GetEventsRequest {
13
45
  filters: Api.EventFilter[];
14
46
  startLedger?: number;
47
+ endLedger?: number;
15
48
  cursor?: string;
16
49
  limit?: number;
17
50
  }
18
- /** Describes additional resource leeways for transaction simulation. */
19
51
  interface ResourceLeeway {
20
52
  cpuInstructions: number;
21
53
  }
@@ -29,34 +61,33 @@ export declare namespace Server {
29
61
  * Handles the network connection to a Soroban RPC instance, exposing an
30
62
  * interface for requests to that instance.
31
63
  *
32
- * @class
64
+ * @alias module:rpc.Server
65
+ * @memberof module:rpc
33
66
  *
34
- * @param {string} serverURL Soroban-RPC Server URL (ex.
35
- * `http://localhost:8000/soroban/rpc`).
36
- * @param {object} [opts] Options object
37
- * @param {boolean} [opts.allowHttp] allows connecting to insecure http servers
67
+ * @param {string} serverURL Soroban-RPC Server URL (ex. `http://localhost:8000/soroban/rpc`).
68
+ * @param {module:rpc.Server.Options} [opts] Options object
69
+ * @param {boolean} [opts.allowHttp] Allows connecting to insecure http servers
38
70
  * (default: `false`). This must be set to false in production deployments!
39
71
  * You can also use {@link Config} class to set this globally.
40
- * @param {Record<string, string>} [opts.headers] allows setting custom headers
72
+ * @param {Record<string, string>} [opts.headers] Allows setting custom headers
41
73
  *
42
- * @see https://soroban.stellar.org/api/methods
74
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods | API reference docs}
43
75
  */
44
- export declare class Server {
45
- /** Soroban RPC Server URL (ex. `http://localhost:8000/soroban/rpc`). */
76
+ export declare class RpcServer {
46
77
  readonly serverURL: URI;
47
- constructor(serverURL: string, opts?: Server.Options);
78
+ constructor(serverURL: string, opts?: RpcServer.Options);
48
79
  /**
49
80
  * Fetch a minimal set of current info about a Stellar account.
50
81
  *
51
82
  * Needed to get the current sequence number for the account so you can build
52
83
  * a successful transaction with {@link TransactionBuilder}.
53
84
  *
54
- * @param {string} address - The public address of the account to load.
85
+ * @param {string} address The public address of the account to load.
86
+ * @returns {Promise<Account>} A promise which resolves to the {@link Account}
87
+ * object with a populated sequence number
55
88
  *
56
- * @returns {Promise<Account>} a promise to the {@link Account} object with
57
- * a populated sequence number
89
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
58
90
  *
59
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
60
91
  * @example
61
92
  * const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";
62
93
  * server.getAccount(accountId).then((account) => {
@@ -67,11 +98,12 @@ export declare class Server {
67
98
  /**
68
99
  * General node health check.
69
100
  *
70
- * @returns {Promise<Api.GetHealthResponse>} a promise to the
71
- * {@link Api.GetHealthResponse} object with the status of the
72
- * server (e.g. "healthy").
101
+ * @returns {Promise<Api.GetHealthResponse>} A promise which resolves to the
102
+ * {@link Api.GetHealthResponse} object with the status of the
103
+ * server (e.g. "healthy").
104
+ *
105
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getHealth | getLedgerEntries docs}
73
106
  *
74
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getHealth
75
107
  * @example
76
108
  * server.getHealth().then((health) => {
77
109
  * console.log("status:", health.status);
@@ -83,21 +115,22 @@ export declare class Server {
83
115
  *
84
116
  * Allows you to directly inspect the current state of a contract. This is a
85
117
  * backup way to access your contract data which may not be available via
86
- * events or {@link Server.simulateTransaction}.
87
- * Warning: If the data entry in question is a 'temporary' entry, it's
88
- * entirely possible that it has expired out of existence.
118
+ * events or {@link module:rpc.Server#simulateTransaction}.
89
119
  *
90
- * @param {string|Address|Contract} contract the contract ID containing the
120
+ * @param {string|Address|Contract} contract The contract ID containing the
91
121
  * data to load as a strkey (`C...` form), a {@link Contract}, or an
92
122
  * {@link Address} instance
93
- * @param {xdr.ScVal} key the key of the contract data to load
94
- * @param {Durability} [durability=Durability.Persistent] the "durability
123
+ * @param {xdr.ScVal} key The key of the contract data to load
124
+ * @param {module:rpc.Durability} [durability=Durability.Persistent] The "durability
95
125
  * keyspace" that this ledger key belongs to, which is either 'temporary'
96
- * or 'persistent' (the default), see {@link Durability}.
126
+ * or 'persistent' (the default), see {@link module:rpc.Durability}.
127
+ * @returns {Promise<Api.LedgerEntryResult>} The current data value
97
128
  *
98
- * @returns {Promise<Api.LedgerEntryResult>} the current data value
129
+ * @warning If the data entry in question is a 'temporary' entry, it's
130
+ * entirely possible that it has expired out of existence.
131
+ *
132
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
99
133
  *
100
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
101
134
  * @example
102
135
  * const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
103
136
  * const key = xdr.ScVal.scvSymbol("counter");
@@ -116,13 +149,10 @@ export declare class Server {
116
149
  * deployed on the Soroban network. The WASM bytecode represents the executable
117
150
  * code of the contract.
118
151
  *
119
- * @param {string} contractId the contract ID containing the
120
- * WASM bytecode to retrieve
121
- *
122
- * @returns {Promise<Buffer>} a Buffer containing the WASM bytecode
123
- *
152
+ * @param {string} contractId The contract ID containing the WASM bytecode to retrieve
153
+ * @returns {Promise<Buffer>} A Buffer containing the WASM bytecode
124
154
  * @throws {Error} If the contract or its associated WASM bytecode cannot be
125
- * found on the network.
155
+ * found on the network.
126
156
  *
127
157
  * @example
128
158
  * const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
@@ -141,12 +171,10 @@ export declare class Server {
141
171
  * deployed on the Soroban network using the contract's WASM hash. The WASM bytecode
142
172
  * represents the executable code of the contract.
143
173
  *
144
- * @param {Buffer} wasmHash the WASM hash of the contract
145
- *
146
- * @returns {Promise<Buffer>} a Buffer containing the WASM bytecode
147
- *
174
+ * @param {Buffer} wasmHash The WASM hash of the contract
175
+ * @returns {Promise<Buffer>} A Buffer containing the WASM bytecode
148
176
  * @throws {Error} If the contract or its associated WASM bytecode cannot be
149
- * found on the network.
177
+ * found on the network.
150
178
  *
151
179
  * @example
152
180
  * const wasmHash = Buffer.from("...");
@@ -168,13 +196,12 @@ export declare class Server {
168
196
  * {@link xdr.LedgerKeyContractCode} ledger entry key (or see
169
197
  * {@link Contract.getFootprint}).
170
198
  *
171
- * @param {xdr.ScVal[]} keys one or more ledger entry keys to load
199
+ * @param {xdr.ScVal[]} keys One or more ledger entry keys to load
200
+ * @returns {Promise<Api.GetLedgerEntriesResponse>} The current on-chain
201
+ * values for the given ledger keys
172
202
  *
173
- * @returns {Promise<Api.GetLedgerEntriesResponse>} the current
174
- * on-chain values for the given ledger keys
175
- *
176
- * @see Server._getLedgerEntries
177
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
203
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
204
+ * @see RpcServer._getLedgerEntries
178
205
  * @example
179
206
  * const contractId = "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM";
180
207
  * const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({
@@ -199,12 +226,12 @@ export declare class Server {
199
226
  * After submitting a transaction, clients should poll this to tell when the
200
227
  * transaction has completed.
201
228
  *
202
- * @param {string} hash hex-encoded hash of the transaction to check
203
- *
204
- * @returns {Promise<Api.GetTransactionResponse>} the status,
229
+ * @param {string} hash Hex-encoded hash of the transaction to check
230
+ * @returns {Promise<Api.GetTransactionResponse>} The status,
205
231
  * result, and other details about the transaction
206
232
  *
207
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction
233
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction | getTransaction docs}
234
+ *
208
235
  * @example
209
236
  * const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";
210
237
  * server.getTransaction(transactionHash).then((tx) => {
@@ -239,21 +266,23 @@ export declare class Server {
239
266
  /**
240
267
  * Fetch all events that match a given set of filters.
241
268
  *
242
- * The given filters (see {@link Api.EventFilter} for detailed fields)
243
- * are combined only in a logical OR fashion, and all of the fields in each
244
- * filter are optional.
269
+ * The given filters (see {@link module:rpc.Api.EventFilter | Api.EventFilter}
270
+ * for detailed fields) are combined only in a logical OR fashion, and all of
271
+ * the fields in each filter are optional.
245
272
  *
246
273
  * To page through events, use the `pagingToken` field on the relevant
247
274
  * {@link Api.EventResponse} object to set the `cursor` parameter.
248
275
  *
249
- * @param {Server.GetEventsRequest} request event filters
250
- * @returns {Promise<Api.GetEventsResponse>} a paginatable set of the
251
- * events matching the given event filters
276
+ * @param {module:rpc.Server.GetEventsRequest} request Event filters
277
+ * @returns {Promise<Api.GetEventsResponse>} A paginatable set of the events
278
+ * matching the given event filters
279
+ *
280
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getEvents | getEvents docs}
252
281
  *
253
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getEvents
254
282
  * @example
255
283
  * server.getEvents({
256
284
  * startLedger: 1000,
285
+ * endLedger: 2000,
257
286
  * filters: [
258
287
  * {
259
288
  * type: "contract",
@@ -274,15 +303,16 @@ export declare class Server {
274
303
  * limit: 10,
275
304
  * });
276
305
  */
277
- getEvents(request: Server.GetEventsRequest): Promise<Api.GetEventsResponse>;
278
- _getEvents(request: Server.GetEventsRequest): Promise<Api.RawGetEventsResponse>;
306
+ getEvents(request: RpcServer.GetEventsRequest): Promise<Api.GetEventsResponse>;
307
+ _getEvents(request: RpcServer.GetEventsRequest): Promise<Api.RawGetEventsResponse>;
279
308
  /**
280
309
  * Fetch metadata about the network this Soroban RPC server is connected to.
281
310
  *
282
- * @returns {Promise<Api.GetNetworkResponse>} metadata about the
283
- * current network this RPC server is connected to
311
+ * @returns {Promise<Api.GetNetworkResponse>} Metadata about the current
312
+ * network this RPC server is connected to
313
+ *
314
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork | getNetwork docs}
284
315
  *
285
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork
286
316
  * @example
287
317
  * server.getNetwork().then((network) => {
288
318
  * console.log("friendbotUrl:", network.friendbotUrl);
@@ -298,7 +328,8 @@ export declare class Server {
298
328
  * @returns {Promise<Api.GetLatestLedgerResponse>} metadata about the
299
329
  * latest ledger on the network that this RPC server is connected to
300
330
  *
301
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger
331
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger | getLatestLedger docs}
332
+ *
302
333
  * @example
303
334
  * server.getLatestLedger().then((response) => {
304
335
  * console.log("hash:", response.id);
@@ -316,15 +347,14 @@ export declare class Server {
316
347
  * {@link xdr.InvokeHostFunctionOp}, {@link xdr.ExtendFootprintTTLOp}, or
317
348
  * {@link xdr.RestoreFootprintOp}). Any provided footprint or auth
318
349
  * information will be ignored.
319
- *
320
- * @returns {Promise<Api.SimulateTransactionResponse>} an object with the
350
+ * @returns {Promise<Api.SimulateTransactionResponse>} An object with the
321
351
  * cost, footprint, result/auth requirements (if applicable), and error of
322
352
  * the transaction
323
353
  *
324
- * @see https://developers.stellar.org/docs/glossary/transactions/
325
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
326
- * @see Server.prepareTransaction
327
- * @see assembleTransaction
354
+ * @see {@link https://developers.stellar.org/docs/learn/fundamentals/stellar-data-structures/operations-and-transactions | transaction docs}
355
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction | simulateTransaction docs}
356
+ * @see module:rpc.Server#prepareTransaction
357
+ * @see module:rpc.assembleTransaction
328
358
  *
329
359
  * @example
330
360
  * const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
@@ -349,8 +379,8 @@ export declare class Server {
349
379
  * console.log("latestLedger:", sim.latestLedger);
350
380
  * });
351
381
  */
352
- simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: Server.ResourceLeeway): Promise<Api.SimulateTransactionResponse>;
353
- _simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: Server.ResourceLeeway): Promise<Api.RawSimulateTransactionResponse>;
382
+ simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: RpcServer.ResourceLeeway): Promise<Api.SimulateTransactionResponse>;
383
+ _simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: RpcServer.ResourceLeeway): Promise<Api.RawSimulateTransactionResponse>;
354
384
  /**
355
385
  * Submit a trial contract invocation, first run a simulation of the contract
356
386
  * invocation as defined on the incoming transaction, and apply the results to
@@ -360,13 +390,14 @@ export declare class Server {
360
390
  *
361
391
  * The returned transaction will also have an updated fee that is the sum of
362
392
  * fee set on incoming transaction with the contract resource fees estimated
363
- * from simulation. It is adviseable to check the fee on returned transaction
393
+ * from simulation. It is advisable to check the fee on returned transaction
364
394
  * and validate or take appropriate measures for interaction with user to
365
395
  * confirm it is acceptable.
366
396
  *
367
- * You can call the {@link Server.simulateTransaction} method directly first
368
- * if you want to inspect estimated fees for a given transaction in detail
369
- * first, then re-assemble it manually or via {@link assembleTransaction}.
397
+ * You can call the {@link module:rpc.Server#simulateTransaction} method
398
+ * directly first if you want to inspect estimated fees for a given
399
+ * transaction in detail first, then re-assemble it manually or via
400
+ * {@link module:rpc.assembleTransaction}.
370
401
  *
371
402
  * @param {Transaction | FeeBumpTransaction} tx the transaction to
372
403
  * prepare. It should include exactly one operation, which must be one of
@@ -378,17 +409,17 @@ export declare class Server {
378
409
  * from the simulation. In other words, if you include auth entries, you
379
410
  * don't care about the auth returned from the simulation. Other fields
380
411
  * (footprint, etc.) will be filled as normal.
381
- *
382
- * @returns {Promise<Transaction | FeeBumpTransaction>} a copy of the
412
+ * @returns {Promise<Transaction | FeeBumpTransaction>} A copy of the
383
413
  * transaction with the expected authorizations (in the case of
384
414
  * invocation), resources, and ledger footprints added. The transaction fee
385
415
  * will also automatically be padded with the contract's minimum resource
386
416
  * fees discovered from the simulation.
387
- *
388
- * @see assembleTransaction
389
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
390
417
  * @throws {jsonrpc.Error<any>|Error|Api.SimulateTransactionErrorResponse}
391
- * if simulation fails
418
+ * If simulation fails
419
+ *
420
+ * @see module:rpc.assembleTransaction
421
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction | simulateTransaction docs}
422
+ *
392
423
  * @example
393
424
  * const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
394
425
  * const contract = new StellarSdk.Contract(contractId);
@@ -426,15 +457,16 @@ export declare class Server {
426
457
  *
427
458
  * Unlike Horizon, Soroban RPC does not wait for transaction completion. It
428
459
  * simply validates the transaction and enqueues it. Clients should call
429
- * {@link Server.getTransactionStatus} to learn about transaction
460
+ * {@link module:rpc.Server#getTransaction} to learn about transaction
430
461
  * success/failure.
431
462
  *
432
463
  * @param {Transaction | FeeBumpTransaction} transaction to submit
433
464
  * @returns {Promise<Api.SendTransactionResponse>} the
434
465
  * transaction id, status, and any error if available
435
466
  *
436
- * @see https://developers.stellar.org/docs/glossary/transactions/
437
- * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/sendTransaction
467
+ * @see {@link https://developers.stellar.org/docs/learn/fundamentals/stellar-data-structures/operations-and-transactions | transaction docs}
468
+ * @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/sendTransaction | sendTransaction docs}
469
+ *
438
470
  * @example
439
471
  * const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
440
472
  * const contract = new StellarSdk.Contract(contractId);
@@ -467,25 +499,23 @@ export declare class Server {
467
499
  sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<Api.SendTransactionResponse>;
468
500
  _sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<Api.RawSendTransactionResponse>;
469
501
  /**
470
- * Fund a new account using the network's friendbot faucet, if any.
502
+ * Fund a new account using the network's Friendbot faucet, if any.
471
503
  *
472
- * @param {string | Account} address the address or account instance that we
473
- * want to create and fund with friendbot
474
- * @param {string} [friendbotUrl] optionally, an explicit address for
504
+ * @param {string | Account} address The address or account instance that we
505
+ * want to create and fund with Friendbot
506
+ * @param {string} [friendbotUrl] Optionally, an explicit address for
475
507
  * friendbot (by default: this calls the Soroban RPC
476
- * {@link Server.getNetwork} method to try to discover this network's
477
- * Friendbot url).
478
- *
479
- * @returns {Promise<Account>} an {@link Account} object for the created
508
+ * {@link module:rpc.Server#getNetwork | getNetwork} method to try to
509
+ * discover this network's Friendbot url).
510
+ * @returns {Promise<Account>} An {@link Account} object for the created
480
511
  * account, or the existing account if it's already funded with the
481
512
  * populated sequence number (note that the account will not be "topped
482
513
  * off" if it already exists)
514
+ * @throws If Friendbot is not configured on this network or request failure
483
515
  *
484
- * @throws if Friendbot is not configured on this network or request failure
516
+ * @see {@link https://developers.stellar.org/docs/learn/networks#friendbot | Friendbot docs}
517
+ * @see {@link module:Friendbot.Api.Response}
485
518
  *
486
- * @see
487
- * https://developers.stellar.org/docs/fundamentals-and-concepts/testnet-and-pubnet#friendbot
488
- * @see Friendbot.Response
489
519
  * @example
490
520
  * server
491
521
  * .requestAirdrop("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4")
@@ -511,4 +541,44 @@ export declare class Server {
511
541
  * @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getVersionInfo
512
542
  */
513
543
  getVersionInfo(): Promise<Api.GetVersionInfoResponse>;
544
+ /**
545
+ * Returns a contract's balance of a particular SAC asset, if any.
546
+ *
547
+ * This is a convenience wrapper around {@link Server.getLedgerEntries}.
548
+ *
549
+ * @param {string} contractId the contract ID (string `C...`) whose
550
+ * balance of `sac` you want to know
551
+ * @param {Asset} sac the built-in SAC token (e.g. `USDC:GABC...`) that
552
+ * you are querying from the given `contract`.
553
+ * @param {string} [networkPassphrase] optionally, the network passphrase to
554
+ * which this token applies. If omitted, a request about network
555
+ * information will be made (see {@link getNetwork}), since contract IDs
556
+ * for assets are specific to a network. You can refer to {@link Networks}
557
+ * for a list of built-in passphrases, e.g., `Networks.TESTNET`.
558
+ *
559
+ * @returns {Promise<Api.BalanceResponse>}, which will contain the balance
560
+ * entry details if and only if the request returned a valid balance ledger
561
+ * entry. If it doesn't, the `balanceEntry` field will not exist.
562
+ *
563
+ * @throws {TypeError} If `contractId` is not a valid contract strkey (C...).
564
+ *
565
+ * @see getLedgerEntries
566
+ * @see https://developers.stellar.org/docs/tokens/stellar-asset-contract
567
+ *
568
+ * @example
569
+ * // assume `contractId` is some contract with an XLM balance
570
+ * // assume server is an instantiated `Server` instance.
571
+ * const entry = (await server.getSACBalance(
572
+ * new Address(contractId),
573
+ * Asset.native(),
574
+ * Networks.PUBLIC
575
+ * ));
576
+ *
577
+ * // assumes BigInt support:
578
+ * console.log(
579
+ * entry.balanceEntry ?
580
+ * BigInt(entry.balanceEntry.amount) :
581
+ * "Contract has no XLM");
582
+ */
583
+ getSACBalance(contractId: string, sac: Asset, networkPassphrase?: string): Promise<Api.BalanceResponse>;
514
584
  }