@symmio/trading-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (545) hide show
  1. package/LICENSE +21 -0
  2. package/dist/account-layer/index.d.ts +29 -0
  3. package/dist/account-layer/index.d.ts.map +1 -0
  4. package/dist/account-layer/use-account-balance-info.d.ts +22 -0
  5. package/dist/account-layer/use-account-balance-info.d.ts.map +1 -0
  6. package/dist/account-layer/use-account-balance-info.js +23 -0
  7. package/dist/account-layer/use-account-balance-info.js.map +1 -0
  8. package/dist/account-layer/use-account-balance-of.d.ts +22 -0
  9. package/dist/account-layer/use-account-balance-of.d.ts.map +1 -0
  10. package/dist/account-layer/use-account-balance-of.js +23 -0
  11. package/dist/account-layer/use-account-balance-of.js.map +1 -0
  12. package/dist/account-layer/use-add-margin.d.ts +26 -0
  13. package/dist/account-layer/use-add-margin.d.ts.map +1 -0
  14. package/dist/account-layer/use-add-margin.js +40 -0
  15. package/dist/account-layer/use-add-margin.js.map +1 -0
  16. package/dist/account-layer/use-allocate.d.ts +25 -0
  17. package/dist/account-layer/use-allocate.d.ts.map +1 -0
  18. package/dist/account-layer/use-allocate.js +40 -0
  19. package/dist/account-layer/use-allocate.js.map +1 -0
  20. package/dist/account-layer/use-create-sub-accounts.d.ts +36 -0
  21. package/dist/account-layer/use-create-sub-accounts.d.ts.map +1 -0
  22. package/dist/account-layer/use-create-sub-accounts.js +41 -0
  23. package/dist/account-layer/use-create-sub-accounts.js.map +1 -0
  24. package/dist/account-layer/use-deallocate.d.ts +44 -0
  25. package/dist/account-layer/use-deallocate.d.ts.map +1 -0
  26. package/dist/account-layer/use-deallocate.js +44 -0
  27. package/dist/account-layer/use-deallocate.js.map +1 -0
  28. package/dist/account-layer/use-delete-sub-account.d.ts +30 -0
  29. package/dist/account-layer/use-delete-sub-account.d.ts.map +1 -0
  30. package/dist/account-layer/use-delete-sub-account.js +40 -0
  31. package/dist/account-layer/use-delete-sub-account.js.map +1 -0
  32. package/dist/account-layer/use-deposit-and-allocate.d.ts +27 -0
  33. package/dist/account-layer/use-deposit-and-allocate.d.ts.map +1 -0
  34. package/dist/account-layer/use-deposit-and-allocate.js +41 -0
  35. package/dist/account-layer/use-deposit-and-allocate.js.map +1 -0
  36. package/dist/account-layer/use-deposit.d.ts +27 -0
  37. package/dist/account-layer/use-deposit.d.ts.map +1 -0
  38. package/dist/account-layer/use-deposit.js +41 -0
  39. package/dist/account-layer/use-deposit.js.map +1 -0
  40. package/dist/account-layer/use-edit-account-name.d.ts +27 -0
  41. package/dist/account-layer/use-edit-account-name.d.ts.map +1 -0
  42. package/dist/account-layer/use-edit-account-name.js +40 -0
  43. package/dist/account-layer/use-edit-account-name.js.map +1 -0
  44. package/dist/account-layer/use-predicted-next-virtual-account.d.ts +38 -0
  45. package/dist/account-layer/use-predicted-next-virtual-account.d.ts.map +1 -0
  46. package/dist/account-layer/use-predicted-next-virtual-account.js +27 -0
  47. package/dist/account-layer/use-predicted-next-virtual-account.js.map +1 -0
  48. package/dist/account-layer/use-remove-margin.d.ts +43 -0
  49. package/dist/account-layer/use-remove-margin.d.ts.map +1 -0
  50. package/dist/account-layer/use-remove-margin.js +44 -0
  51. package/dist/account-layer/use-remove-margin.js.map +1 -0
  52. package/dist/account-layer/use-simulate-add-margin.d.ts +24 -0
  53. package/dist/account-layer/use-simulate-add-margin.d.ts.map +1 -0
  54. package/dist/account-layer/use-simulate-add-margin.js +29 -0
  55. package/dist/account-layer/use-simulate-add-margin.js.map +1 -0
  56. package/dist/account-layer/use-simulate-allocate.d.ts +25 -0
  57. package/dist/account-layer/use-simulate-allocate.d.ts.map +1 -0
  58. package/dist/account-layer/use-simulate-allocate.js +29 -0
  59. package/dist/account-layer/use-simulate-allocate.js.map +1 -0
  60. package/dist/account-layer/use-simulate-create-sub-accounts.d.ts +25 -0
  61. package/dist/account-layer/use-simulate-create-sub-accounts.d.ts.map +1 -0
  62. package/dist/account-layer/use-simulate-create-sub-accounts.js +29 -0
  63. package/dist/account-layer/use-simulate-create-sub-accounts.js.map +1 -0
  64. package/dist/account-layer/use-simulate-deallocate.d.ts +29 -0
  65. package/dist/account-layer/use-simulate-deallocate.d.ts.map +1 -0
  66. package/dist/account-layer/use-simulate-deallocate.js +29 -0
  67. package/dist/account-layer/use-simulate-deallocate.js.map +1 -0
  68. package/dist/account-layer/use-simulate-delete-sub-account.d.ts +25 -0
  69. package/dist/account-layer/use-simulate-delete-sub-account.d.ts.map +1 -0
  70. package/dist/account-layer/use-simulate-delete-sub-account.js +29 -0
  71. package/dist/account-layer/use-simulate-delete-sub-account.js.map +1 -0
  72. package/dist/account-layer/use-simulate-deposit-and-allocate.d.ts +25 -0
  73. package/dist/account-layer/use-simulate-deposit-and-allocate.d.ts.map +1 -0
  74. package/dist/account-layer/use-simulate-deposit-and-allocate.js +29 -0
  75. package/dist/account-layer/use-simulate-deposit-and-allocate.js.map +1 -0
  76. package/dist/account-layer/use-simulate-deposit.d.ts +25 -0
  77. package/dist/account-layer/use-simulate-deposit.d.ts.map +1 -0
  78. package/dist/account-layer/use-simulate-deposit.js +29 -0
  79. package/dist/account-layer/use-simulate-deposit.js.map +1 -0
  80. package/dist/account-layer/use-simulate-edit-account-name.d.ts +25 -0
  81. package/dist/account-layer/use-simulate-edit-account-name.d.ts.map +1 -0
  82. package/dist/account-layer/use-simulate-edit-account-name.js +29 -0
  83. package/dist/account-layer/use-simulate-edit-account-name.js.map +1 -0
  84. package/dist/account-layer/use-simulate-remove-margin.d.ts +30 -0
  85. package/dist/account-layer/use-simulate-remove-margin.d.ts.map +1 -0
  86. package/dist/account-layer/use-simulate-remove-margin.js +29 -0
  87. package/dist/account-layer/use-simulate-remove-margin.js.map +1 -0
  88. package/dist/account-layer/use-sub-account-virtual-nonce.d.ts +23 -0
  89. package/dist/account-layer/use-sub-account-virtual-nonce.d.ts.map +1 -0
  90. package/dist/account-layer/use-sub-account-virtual-nonce.js +27 -0
  91. package/dist/account-layer/use-sub-account-virtual-nonce.js.map +1 -0
  92. package/dist/account-layer/use-sub-account.d.ts +22 -0
  93. package/dist/account-layer/use-sub-account.d.ts.map +1 -0
  94. package/dist/account-layer/use-sub-account.js +27 -0
  95. package/dist/account-layer/use-sub-account.js.map +1 -0
  96. package/dist/account-layer/use-sub-accounts-count-of-user.d.ts +22 -0
  97. package/dist/account-layer/use-sub-accounts-count-of-user.d.ts.map +1 -0
  98. package/dist/account-layer/use-sub-accounts-count-of-user.js +27 -0
  99. package/dist/account-layer/use-sub-accounts-count-of-user.js.map +1 -0
  100. package/dist/account-layer/use-user-sub-accounts-addresses.d.ts +24 -0
  101. package/dist/account-layer/use-user-sub-accounts-addresses.d.ts.map +1 -0
  102. package/dist/account-layer/use-user-sub-accounts-addresses.js +27 -0
  103. package/dist/account-layer/use-user-sub-accounts-addresses.js.map +1 -0
  104. package/dist/account-layer/use-user-sub-accounts.d.ts +28 -0
  105. package/dist/account-layer/use-user-sub-accounts.d.ts.map +1 -0
  106. package/dist/account-layer/use-user-sub-accounts.js +27 -0
  107. package/dist/account-layer/use-user-sub-accounts.js.map +1 -0
  108. package/dist/account-layer/use-virtual-account.d.ts +35 -0
  109. package/dist/account-layer/use-virtual-account.d.ts.map +1 -0
  110. package/dist/account-layer/use-virtual-account.js +32 -0
  111. package/dist/account-layer/use-virtual-account.js.map +1 -0
  112. package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts +25 -0
  113. package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts.map +1 -0
  114. package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.js +27 -0
  115. package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.js.map +1 -0
  116. package/dist/balance-history/index.d.ts +4 -0
  117. package/dist/balance-history/index.d.ts.map +1 -0
  118. package/dist/balance-history/use-balance-history.d.ts +26 -0
  119. package/dist/balance-history/use-balance-history.d.ts.map +1 -0
  120. package/dist/balance-history/use-balance-history.js +27 -0
  121. package/dist/balance-history/use-balance-history.js.map +1 -0
  122. package/dist/balance-history/use-deposit-history.d.ts +19 -0
  123. package/dist/balance-history/use-deposit-history.d.ts.map +1 -0
  124. package/dist/balance-history/use-deposit-history.js +14 -0
  125. package/dist/balance-history/use-deposit-history.js.map +1 -0
  126. package/dist/balance-history/use-withdraw-history.d.ts +20 -0
  127. package/dist/balance-history/use-withdraw-history.d.ts.map +1 -0
  128. package/dist/balance-history/use-withdraw-history.js +14 -0
  129. package/dist/balance-history/use-withdraw-history.js.map +1 -0
  130. package/dist/collateral/index.d.ts +5 -0
  131. package/dist/collateral/index.d.ts.map +1 -0
  132. package/dist/collateral/use-approve-collateral.d.ts +27 -0
  133. package/dist/collateral/use-approve-collateral.d.ts.map +1 -0
  134. package/dist/collateral/use-approve-collateral.js +40 -0
  135. package/dist/collateral/use-approve-collateral.js.map +1 -0
  136. package/dist/collateral/use-collateral-allowance.d.ts +24 -0
  137. package/dist/collateral/use-collateral-allowance.d.ts.map +1 -0
  138. package/dist/collateral/use-collateral-allowance.js +27 -0
  139. package/dist/collateral/use-collateral-allowance.js.map +1 -0
  140. package/dist/collateral/use-collateral-balance.d.ts +22 -0
  141. package/dist/collateral/use-collateral-balance.d.ts.map +1 -0
  142. package/dist/collateral/use-collateral-balance.js +27 -0
  143. package/dist/collateral/use-collateral-balance.js.map +1 -0
  144. package/dist/collateral/use-simulate-approve-collateral.d.ts +26 -0
  145. package/dist/collateral/use-simulate-approve-collateral.d.ts.map +1 -0
  146. package/dist/collateral/use-simulate-approve-collateral.js +29 -0
  147. package/dist/collateral/use-simulate-approve-collateral.js.map +1 -0
  148. package/dist/error-codes/index.d.ts +3 -0
  149. package/dist/error-codes/index.d.ts.map +1 -0
  150. package/dist/error-codes/use-solver-error-codes.d.ts +27 -0
  151. package/dist/error-codes/use-solver-error-codes.d.ts.map +1 -0
  152. package/dist/error-codes/use-solver-error-codes.js +27 -0
  153. package/dist/error-codes/use-solver-error-codes.js.map +1 -0
  154. package/dist/error-codes/use-solver-error-message.d.ts +23 -0
  155. package/dist/error-codes/use-solver-error-message.d.ts.map +1 -0
  156. package/dist/error-codes/use-solver-error-message.js +11 -0
  157. package/dist/error-codes/use-solver-error-message.js.map +1 -0
  158. package/dist/errors/index.d.ts +4 -0
  159. package/dist/errors/index.d.ts.map +1 -0
  160. package/dist/errors/normalize-symm-error.d.ts +14 -0
  161. package/dist/errors/normalize-symm-error.d.ts.map +1 -0
  162. package/dist/errors/normalize-symm-error.js +86 -0
  163. package/dist/errors/normalize-symm-error.js.map +1 -0
  164. package/dist/errors/symmio-request-error.d.ts +54 -0
  165. package/dist/errors/symmio-request-error.d.ts.map +1 -0
  166. package/dist/errors/symmio-request-error.js +17 -0
  167. package/dist/errors/symmio-request-error.js.map +1 -0
  168. package/dist/errors/types.d.ts +21 -0
  169. package/dist/errors/types.d.ts.map +1 -0
  170. package/dist/fees/index.d.ts +2 -0
  171. package/dist/fees/index.d.ts.map +1 -0
  172. package/dist/fees/use-fee-for-user.d.ts +25 -0
  173. package/dist/fees/use-fee-for-user.d.ts.map +1 -0
  174. package/dist/fees/use-fee-for-user.js +27 -0
  175. package/dist/fees/use-fee-for-user.js.map +1 -0
  176. package/dist/index.d.ts +184 -0
  177. package/dist/index.d.ts.map +1 -0
  178. package/dist/index.js +122 -0
  179. package/dist/instant-layer/index.d.ts +14 -0
  180. package/dist/instant-layer/index.d.ts.map +1 -0
  181. package/dist/instant-layer/use-delegation-expiry.d.ts +22 -0
  182. package/dist/instant-layer/use-delegation-expiry.d.ts.map +1 -0
  183. package/dist/instant-layer/use-delegation-expiry.js +23 -0
  184. package/dist/instant-layer/use-delegation-expiry.js.map +1 -0
  185. package/dist/instant-layer/use-grant-delegation.d.ts +26 -0
  186. package/dist/instant-layer/use-grant-delegation.d.ts.map +1 -0
  187. package/dist/instant-layer/use-grant-delegation.js +38 -0
  188. package/dist/instant-layer/use-grant-delegation.js.map +1 -0
  189. package/dist/instant-layer/use-instant-close-auto.d.ts +29 -0
  190. package/dist/instant-layer/use-instant-close-auto.d.ts.map +1 -0
  191. package/dist/instant-layer/use-instant-close-auto.js +32 -0
  192. package/dist/instant-layer/use-instant-close-auto.js.map +1 -0
  193. package/dist/instant-layer/use-instant-close-bulk-auto.d.ts +26 -0
  194. package/dist/instant-layer/use-instant-close-bulk-auto.d.ts.map +1 -0
  195. package/dist/instant-layer/use-instant-close-bulk-auto.js +32 -0
  196. package/dist/instant-layer/use-instant-close-bulk-auto.js.map +1 -0
  197. package/dist/instant-layer/use-instant-close-bulk.d.ts +24 -0
  198. package/dist/instant-layer/use-instant-close-bulk.d.ts.map +1 -0
  199. package/dist/instant-layer/use-instant-close-bulk.js +32 -0
  200. package/dist/instant-layer/use-instant-close-bulk.js.map +1 -0
  201. package/dist/instant-layer/use-instant-close.d.ts +29 -0
  202. package/dist/instant-layer/use-instant-close.d.ts.map +1 -0
  203. package/dist/instant-layer/use-instant-close.js +32 -0
  204. package/dist/instant-layer/use-instant-close.js.map +1 -0
  205. package/dist/instant-layer/use-instant-closes.d.ts +25 -0
  206. package/dist/instant-layer/use-instant-closes.d.ts.map +1 -0
  207. package/dist/instant-layer/use-instant-closes.js +27 -0
  208. package/dist/instant-layer/use-instant-closes.js.map +1 -0
  209. package/dist/instant-layer/use-instant-open-auto.d.ts +31 -0
  210. package/dist/instant-layer/use-instant-open-auto.d.ts.map +1 -0
  211. package/dist/instant-layer/use-instant-open-auto.js +32 -0
  212. package/dist/instant-layer/use-instant-open-auto.js.map +1 -0
  213. package/dist/instant-layer/use-instant-open-quote-id.d.ts +28 -0
  214. package/dist/instant-layer/use-instant-open-quote-id.d.ts.map +1 -0
  215. package/dist/instant-layer/use-instant-open-quote-id.js +27 -0
  216. package/dist/instant-layer/use-instant-open-quote-id.js.map +1 -0
  217. package/dist/instant-layer/use-instant-open.d.ts +33 -0
  218. package/dist/instant-layer/use-instant-open.d.ts.map +1 -0
  219. package/dist/instant-layer/use-instant-open.js +32 -0
  220. package/dist/instant-layer/use-instant-open.js.map +1 -0
  221. package/dist/instant-layer/use-instant-opens.d.ts +25 -0
  222. package/dist/instant-layer/use-instant-opens.d.ts.map +1 -0
  223. package/dist/instant-layer/use-instant-opens.js +27 -0
  224. package/dist/instant-layer/use-instant-opens.js.map +1 -0
  225. package/dist/instant-layer/use-is-delegation-active.d.ts +22 -0
  226. package/dist/instant-layer/use-is-delegation-active.d.ts.map +1 -0
  227. package/dist/instant-layer/use-is-delegation-active.js +23 -0
  228. package/dist/instant-layer/use-is-delegation-active.js.map +1 -0
  229. package/dist/instant-layer/use-simulate-grant-delegation.d.ts +25 -0
  230. package/dist/instant-layer/use-simulate-grant-delegation.d.ts.map +1 -0
  231. package/dist/instant-layer/use-simulate-grant-delegation.js +29 -0
  232. package/dist/instant-layer/use-simulate-grant-delegation.js.map +1 -0
  233. package/dist/locked-params/index.d.ts +2 -0
  234. package/dist/locked-params/index.d.ts.map +1 -0
  235. package/dist/locked-params/use-locked-params.d.ts +23 -0
  236. package/dist/locked-params/use-locked-params.d.ts.map +1 -0
  237. package/dist/locked-params/use-locked-params.js +27 -0
  238. package/dist/locked-params/use-locked-params.js.map +1 -0
  239. package/dist/markets/index.d.ts +3 -0
  240. package/dist/markets/index.d.ts.map +1 -0
  241. package/dist/markets/use-markets.d.ts +26 -0
  242. package/dist/markets/use-markets.d.ts.map +1 -0
  243. package/dist/markets/use-markets.js +27 -0
  244. package/dist/markets/use-markets.js.map +1 -0
  245. package/dist/markets/use-onchain-contract-markets.d.ts +24 -0
  246. package/dist/markets/use-onchain-contract-markets.d.ts.map +1 -0
  247. package/dist/markets/use-onchain-contract-markets.js +27 -0
  248. package/dist/markets/use-onchain-contract-markets.js.map +1 -0
  249. package/dist/muon/index.d.ts +11 -0
  250. package/dist/muon/index.d.ts.map +1 -0
  251. package/dist/muon/use-deallocate-upnl-sig.d.ts +28 -0
  252. package/dist/muon/use-deallocate-upnl-sig.d.ts.map +1 -0
  253. package/dist/muon/use-deallocate-upnl-sig.js +27 -0
  254. package/dist/muon/use-deallocate-upnl-sig.js.map +1 -0
  255. package/dist/muon/use-muon-party-a-overview.d.ts +29 -0
  256. package/dist/muon/use-muon-party-a-overview.d.ts.map +1 -0
  257. package/dist/muon/use-muon-party-a-overview.js +27 -0
  258. package/dist/muon/use-muon-party-a-overview.js.map +1 -0
  259. package/dist/muon/use-muon-price-range.d.ts +35 -0
  260. package/dist/muon/use-muon-price-range.d.ts.map +1 -0
  261. package/dist/muon/use-muon-price-range.js +31 -0
  262. package/dist/muon/use-muon-price-range.js.map +1 -0
  263. package/dist/muon/use-muon-price.d.ts +28 -0
  264. package/dist/muon/use-muon-price.d.ts.map +1 -0
  265. package/dist/muon/use-muon-price.js +27 -0
  266. package/dist/muon/use-muon-price.js.map +1 -0
  267. package/dist/muon/use-muon-settle-upnl.d.ts +29 -0
  268. package/dist/muon/use-muon-settle-upnl.d.ts.map +1 -0
  269. package/dist/muon/use-muon-settle-upnl.js +28 -0
  270. package/dist/muon/use-muon-settle-upnl.js.map +1 -0
  271. package/dist/muon/use-muon-upnl-a-with-symbol-price.d.ts +29 -0
  272. package/dist/muon/use-muon-upnl-a-with-symbol-price.d.ts.map +1 -0
  273. package/dist/muon/use-muon-upnl-a-with-symbol-price.js +28 -0
  274. package/dist/muon/use-muon-upnl-a-with-symbol-price.js.map +1 -0
  275. package/dist/muon/use-muon-upnl-a.d.ts +28 -0
  276. package/dist/muon/use-muon-upnl-a.d.ts.map +1 -0
  277. package/dist/muon/use-muon-upnl-a.js +27 -0
  278. package/dist/muon/use-muon-upnl-a.js.map +1 -0
  279. package/dist/muon/use-muon-upnl-b.d.ts +29 -0
  280. package/dist/muon/use-muon-upnl-b.d.ts.map +1 -0
  281. package/dist/muon/use-muon-upnl-b.js +28 -0
  282. package/dist/muon/use-muon-upnl-b.js.map +1 -0
  283. package/dist/muon/use-muon-upnl-with-symbol-price.d.ts +28 -0
  284. package/dist/muon/use-muon-upnl-with-symbol-price.d.ts.map +1 -0
  285. package/dist/muon/use-muon-upnl-with-symbol-price.js +29 -0
  286. package/dist/muon/use-muon-upnl-with-symbol-price.js.map +1 -0
  287. package/dist/muon/use-muon-upnl.d.ts +28 -0
  288. package/dist/muon/use-muon-upnl.d.ts.map +1 -0
  289. package/dist/muon/use-muon-upnl.js +28 -0
  290. package/dist/muon/use-muon-upnl.js.map +1 -0
  291. package/dist/notifications/index.d.ts +2 -0
  292. package/dist/notifications/index.d.ts.map +1 -0
  293. package/dist/notifications/use-search-notifications.d.ts +29 -0
  294. package/dist/notifications/use-search-notifications.d.ts.map +1 -0
  295. package/dist/notifications/use-search-notifications.js +27 -0
  296. package/dist/notifications/use-search-notifications.js.map +1 -0
  297. package/dist/notional-cap/index.d.ts +4 -0
  298. package/dist/notional-cap/index.d.ts.map +1 -0
  299. package/dist/notional-cap/use-notional-cap-all.d.ts +32 -0
  300. package/dist/notional-cap/use-notional-cap-all.d.ts.map +1 -0
  301. package/dist/notional-cap/use-notional-cap-all.js +32 -0
  302. package/dist/notional-cap/use-notional-cap-all.js.map +1 -0
  303. package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts +36 -0
  304. package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts.map +1 -0
  305. package/dist/notional-cap/use-notional-cap-by-symbol-id.js +32 -0
  306. package/dist/notional-cap/use-notional-cap-by-symbol-id.js.map +1 -0
  307. package/dist/notional-cap/use-open-interest-by-symbol-id.d.ts +34 -0
  308. package/dist/notional-cap/use-open-interest-by-symbol-id.d.ts.map +1 -0
  309. package/dist/notional-cap/use-open-interest-by-symbol-id.js +32 -0
  310. package/dist/notional-cap/use-open-interest-by-symbol-id.js.map +1 -0
  311. package/dist/price-service/index.d.ts +9 -0
  312. package/dist/price-service/index.d.ts.map +1 -0
  313. package/dist/price-service/use-enigma-price-by-market-id.d.ts +42 -0
  314. package/dist/price-service/use-enigma-price-by-market-id.d.ts.map +1 -0
  315. package/dist/price-service/use-enigma-price-by-market-id.js +30 -0
  316. package/dist/price-service/use-enigma-price-by-market-id.js.map +1 -0
  317. package/dist/price-service/use-enigma-price-by-name.d.ts +41 -0
  318. package/dist/price-service/use-enigma-price-by-name.d.ts.map +1 -0
  319. package/dist/price-service/use-enigma-price-by-name.js +45 -0
  320. package/dist/price-service/use-enigma-price-by-name.js.map +1 -0
  321. package/dist/price-service/use-enigma-price-service-health.d.ts +20 -0
  322. package/dist/price-service/use-enigma-price-service-health.d.ts.map +1 -0
  323. package/dist/price-service/use-enigma-price-service-health.js +27 -0
  324. package/dist/price-service/use-enigma-price-service-health.js.map +1 -0
  325. package/dist/price-service/use-enigma-price-service-metadata.d.ts +20 -0
  326. package/dist/price-service/use-enigma-price-service-metadata.d.ts.map +1 -0
  327. package/dist/price-service/use-enigma-price-service-metadata.js +27 -0
  328. package/dist/price-service/use-enigma-price-service-metadata.js.map +1 -0
  329. package/dist/price-service/use-enigma-price-service-prices-by-addresses.d.ts +20 -0
  330. package/dist/price-service/use-enigma-price-service-prices-by-addresses.d.ts.map +1 -0
  331. package/dist/price-service/use-enigma-price-service-prices-by-addresses.js +27 -0
  332. package/dist/price-service/use-enigma-price-service-prices-by-addresses.js.map +1 -0
  333. package/dist/price-service/use-enigma-price-service-prices-by-names.d.ts +20 -0
  334. package/dist/price-service/use-enigma-price-service-prices-by-names.d.ts.map +1 -0
  335. package/dist/price-service/use-enigma-price-service-prices-by-names.js +27 -0
  336. package/dist/price-service/use-enigma-price-service-prices-by-names.js.map +1 -0
  337. package/dist/price-service/use-enigma-price-service-symbols-info.d.ts +20 -0
  338. package/dist/price-service/use-enigma-price-service-symbols-info.d.ts.map +1 -0
  339. package/dist/price-service/use-enigma-price-service-symbols-info.js +27 -0
  340. package/dist/price-service/use-enigma-price-service-symbols-info.js.map +1 -0
  341. package/dist/price-service/use-enigma-prices.d.ts +40 -0
  342. package/dist/price-service/use-enigma-prices.d.ts.map +1 -0
  343. package/dist/price-service/use-enigma-prices.js +47 -0
  344. package/dist/price-service/use-enigma-prices.js.map +1 -0
  345. package/dist/provider/index.d.ts +4 -0
  346. package/dist/provider/index.d.ts.map +1 -0
  347. package/dist/provider/symmio-config-context.d.ts +9 -0
  348. package/dist/provider/symmio-config-context.d.ts.map +1 -0
  349. package/dist/provider/symmio-config-context.js +8 -0
  350. package/dist/provider/symmio-config-context.js.map +1 -0
  351. package/dist/provider/symmio-provider.d.ts +49 -0
  352. package/dist/provider/symmio-provider.d.ts.map +1 -0
  353. package/dist/provider/symmio-provider.js +39 -0
  354. package/dist/provider/symmio-provider.js.map +1 -0
  355. package/dist/provider/use-symmio-chain-id.d.ts +14 -0
  356. package/dist/provider/use-symmio-chain-id.d.ts.map +1 -0
  357. package/dist/provider/use-symmio-chain-id.js +10 -0
  358. package/dist/provider/use-symmio-chain-id.js.map +1 -0
  359. package/dist/provider/use-symmio-config.d.ts +24 -0
  360. package/dist/provider/use-symmio-config.d.ts.map +1 -0
  361. package/dist/provider/use-symmio-config.js +13 -0
  362. package/dist/provider/use-symmio-config.js.map +1 -0
  363. package/dist/quotes/index.d.ts +16 -0
  364. package/dist/quotes/index.d.ts.map +1 -0
  365. package/dist/quotes/optimistic-quotes-store.d.ts +47 -0
  366. package/dist/quotes/optimistic-quotes-store.d.ts.map +1 -0
  367. package/dist/quotes/optimistic-quotes-store.js +27 -0
  368. package/dist/quotes/optimistic-quotes-store.js.map +1 -0
  369. package/dist/quotes/use-account-liquidation-price.d.ts +39 -0
  370. package/dist/quotes/use-account-liquidation-price.d.ts.map +1 -0
  371. package/dist/quotes/use-account-liquidation-price.js +57 -0
  372. package/dist/quotes/use-account-liquidation-price.js.map +1 -0
  373. package/dist/quotes/use-grouped-quotes.d.ts +55 -0
  374. package/dist/quotes/use-grouped-quotes.d.ts.map +1 -0
  375. package/dist/quotes/use-grouped-quotes.js +21 -0
  376. package/dist/quotes/use-grouped-quotes.js.map +1 -0
  377. package/dist/quotes/use-managed-quotes.d.ts +108 -0
  378. package/dist/quotes/use-managed-quotes.d.ts.map +1 -0
  379. package/dist/quotes/use-managed-quotes.js +314 -0
  380. package/dist/quotes/use-managed-quotes.js.map +1 -0
  381. package/dist/quotes/use-party-a-open-positions.d.ts +23 -0
  382. package/dist/quotes/use-party-a-open-positions.d.ts.map +1 -0
  383. package/dist/quotes/use-party-a-open-positions.js +27 -0
  384. package/dist/quotes/use-party-a-open-positions.js.map +1 -0
  385. package/dist/quotes/use-party-a-pending-quotes.d.ts +23 -0
  386. package/dist/quotes/use-party-a-pending-quotes.d.ts.map +1 -0
  387. package/dist/quotes/use-party-a-pending-quotes.js +27 -0
  388. package/dist/quotes/use-party-a-pending-quotes.js.map +1 -0
  389. package/dist/quotes/use-quote-events-by-type.d.ts +26 -0
  390. package/dist/quotes/use-quote-events-by-type.d.ts.map +1 -0
  391. package/dist/quotes/use-quote-events-by-type.js +27 -0
  392. package/dist/quotes/use-quote-events-by-type.js.map +1 -0
  393. package/dist/quotes/use-quote-funding.d.ts +35 -0
  394. package/dist/quotes/use-quote-funding.d.ts.map +1 -0
  395. package/dist/quotes/use-quote-funding.js +21 -0
  396. package/dist/quotes/use-quote-funding.js.map +1 -0
  397. package/dist/quotes/use-quote-history.d.ts +26 -0
  398. package/dist/quotes/use-quote-history.d.ts.map +1 -0
  399. package/dist/quotes/use-quote-history.js +27 -0
  400. package/dist/quotes/use-quote-history.js.map +1 -0
  401. package/dist/quotes/use-quote-platform-fee.d.ts +31 -0
  402. package/dist/quotes/use-quote-platform-fee.d.ts.map +1 -0
  403. package/dist/quotes/use-quote-platform-fee.js +31 -0
  404. package/dist/quotes/use-quote-platform-fee.js.map +1 -0
  405. package/dist/quotes/use-quote-price-history.d.ts +24 -0
  406. package/dist/quotes/use-quote-price-history.d.ts.map +1 -0
  407. package/dist/quotes/use-quote-price-history.js +14 -0
  408. package/dist/quotes/use-quote-price-history.js.map +1 -0
  409. package/dist/quotes/use-quote-upnl-and-pnl.d.ts +34 -0
  410. package/dist/quotes/use-quote-upnl-and-pnl.d.ts.map +1 -0
  411. package/dist/quotes/use-quote-upnl-and-pnl.js +61 -0
  412. package/dist/quotes/use-quote-upnl-and-pnl.js.map +1 -0
  413. package/dist/quotes/use-quote.d.ts +23 -0
  414. package/dist/quotes/use-quote.d.ts.map +1 -0
  415. package/dist/quotes/use-quote.js +27 -0
  416. package/dist/quotes/use-quote.js.map +1 -0
  417. package/dist/quotes/use-quotes-funding.d.ts +52 -0
  418. package/dist/quotes/use-quotes-funding.d.ts.map +1 -0
  419. package/dist/quotes/use-quotes-funding.js +80 -0
  420. package/dist/quotes/use-quotes-funding.js.map +1 -0
  421. package/dist/quotes/use-subgraph-query.d.ts +25 -0
  422. package/dist/quotes/use-subgraph-query.d.ts.map +1 -0
  423. package/dist/quotes/use-subgraph-query.js +27 -0
  424. package/dist/quotes/use-subgraph-query.js.map +1 -0
  425. package/dist/tpsl/index.d.ts +8 -0
  426. package/dist/tpsl/index.d.ts.map +1 -0
  427. package/dist/tpsl/to-quote-tpsl.d.ts +19 -0
  428. package/dist/tpsl/to-quote-tpsl.d.ts.map +1 -0
  429. package/dist/tpsl/to-quote-tpsl.js +46 -0
  430. package/dist/tpsl/to-quote-tpsl.js.map +1 -0
  431. package/dist/tpsl/tpsl-confirming.d.ts +36 -0
  432. package/dist/tpsl/tpsl-confirming.d.ts.map +1 -0
  433. package/dist/tpsl/tpsl-confirming.js +28 -0
  434. package/dist/tpsl/tpsl-confirming.js.map +1 -0
  435. package/dist/tpsl/use-quote-tpsl.d.ts +34 -0
  436. package/dist/tpsl/use-quote-tpsl.d.ts.map +1 -0
  437. package/dist/tpsl/use-quote-tpsl.js +73 -0
  438. package/dist/tpsl/use-quote-tpsl.js.map +1 -0
  439. package/dist/tpsl/use-set-quote-tpsl.d.ts +22 -0
  440. package/dist/tpsl/use-set-quote-tpsl.d.ts.map +1 -0
  441. package/dist/tpsl/use-set-quote-tpsl.js +43 -0
  442. package/dist/tpsl/use-set-quote-tpsl.js.map +1 -0
  443. package/dist/tpsl/use-tpsl-config.d.ts +14 -0
  444. package/dist/tpsl/use-tpsl-config.d.ts.map +1 -0
  445. package/dist/tpsl/use-tpsl-config.js +31 -0
  446. package/dist/tpsl/use-tpsl-config.js.map +1 -0
  447. package/dist/tpsl/use-tpsl-signing-spec.d.ts +13 -0
  448. package/dist/tpsl/use-tpsl-signing-spec.d.ts.map +1 -0
  449. package/dist/tpsl/use-tpsl-signing-spec.js +31 -0
  450. package/dist/tpsl/use-tpsl-signing-spec.js.map +1 -0
  451. package/dist/tpsl/use-watch-tpsl-notifications.d.ts +30 -0
  452. package/dist/tpsl/use-watch-tpsl-notifications.d.ts.map +1 -0
  453. package/dist/tpsl/use-watch-tpsl-notifications.js +44 -0
  454. package/dist/tpsl/use-watch-tpsl-notifications.js.map +1 -0
  455. package/dist/transactions/index.d.ts +4 -0
  456. package/dist/transactions/index.d.ts.map +1 -0
  457. package/dist/transactions/resolve-write-result.d.ts +40 -0
  458. package/dist/transactions/resolve-write-result.d.ts.map +1 -0
  459. package/dist/transactions/resolve-write-result.js +15 -0
  460. package/dist/transactions/resolve-write-result.js.map +1 -0
  461. package/dist/transactions/use-transactions-store.d.ts +52 -0
  462. package/dist/transactions/use-transactions-store.d.ts.map +1 -0
  463. package/dist/transactions/use-transactions-store.js +24 -0
  464. package/dist/transactions/use-transactions-store.js.map +1 -0
  465. package/dist/transactions/write-types.d.ts +28 -0
  466. package/dist/transactions/write-types.d.ts.map +1 -0
  467. package/dist/transfers/index.d.ts +2 -0
  468. package/dist/transfers/index.d.ts.map +1 -0
  469. package/dist/transfers/use-transfer-history.d.ts +26 -0
  470. package/dist/transfers/use-transfer-history.d.ts.map +1 -0
  471. package/dist/transfers/use-transfer-history.js +27 -0
  472. package/dist/transfers/use-transfer-history.js.map +1 -0
  473. package/dist/utils/index.d.ts +2 -0
  474. package/dist/utils/index.d.ts.map +1 -0
  475. package/dist/utils/predicate-match.d.ts +27 -0
  476. package/dist/utils/predicate-match.d.ts.map +1 -0
  477. package/dist/utils/predicate-match.js +18 -0
  478. package/dist/utils/predicate-match.js.map +1 -0
  479. package/dist/wallet/index.d.ts +5 -0
  480. package/dist/wallet/index.d.ts.map +1 -0
  481. package/dist/wallet/use-connect-wallet.d.ts +34 -0
  482. package/dist/wallet/use-connect-wallet.d.ts.map +1 -0
  483. package/dist/wallet/use-connect-wallet.js +24 -0
  484. package/dist/wallet/use-connect-wallet.js.map +1 -0
  485. package/dist/wallet/use-disconnect-wallet.d.ts +20 -0
  486. package/dist/wallet/use-disconnect-wallet.d.ts.map +1 -0
  487. package/dist/wallet/use-disconnect-wallet.js +21 -0
  488. package/dist/wallet/use-disconnect-wallet.js.map +1 -0
  489. package/dist/wallet/use-switch-to-symmio-chain.d.ts +29 -0
  490. package/dist/wallet/use-switch-to-symmio-chain.d.ts.map +1 -0
  491. package/dist/wallet/use-switch-to-symmio-chain.js +24 -0
  492. package/dist/wallet/use-switch-to-symmio-chain.js.map +1 -0
  493. package/dist/wallet/use-wallet-account.d.ts +32 -0
  494. package/dist/wallet/use-wallet-account.d.ts.map +1 -0
  495. package/dist/wallet/use-wallet-account.js +18 -0
  496. package/dist/wallet/use-wallet-account.js.map +1 -0
  497. package/dist/websocket/index.d.ts +2 -0
  498. package/dist/websocket/index.d.ts.map +1 -0
  499. package/dist/websocket/use-notifications.d.ts +48 -0
  500. package/dist/websocket/use-notifications.d.ts.map +1 -0
  501. package/dist/websocket/use-notifications.js +51 -0
  502. package/dist/websocket/use-notifications.js.map +1 -0
  503. package/dist/withdraw/index.d.ts +11 -0
  504. package/dist/withdraw/index.d.ts.map +1 -0
  505. package/dist/withdraw/use-finalize-withdraw-request.d.ts +26 -0
  506. package/dist/withdraw/use-finalize-withdraw-request.d.ts.map +1 -0
  507. package/dist/withdraw/use-finalize-withdraw-request.js +40 -0
  508. package/dist/withdraw/use-finalize-withdraw-request.js.map +1 -0
  509. package/dist/withdraw/use-initiate-withdraw.d.ts +28 -0
  510. package/dist/withdraw/use-initiate-withdraw.d.ts.map +1 -0
  511. package/dist/withdraw/use-initiate-withdraw.js +42 -0
  512. package/dist/withdraw/use-initiate-withdraw.js.map +1 -0
  513. package/dist/withdraw/use-last-withdraw-request-id.d.ts +22 -0
  514. package/dist/withdraw/use-last-withdraw-request-id.d.ts.map +1 -0
  515. package/dist/withdraw/use-last-withdraw-request-id.js +27 -0
  516. package/dist/withdraw/use-last-withdraw-request-id.js.map +1 -0
  517. package/dist/withdraw/use-pending-withdraw-requests.d.ts +21 -0
  518. package/dist/withdraw/use-pending-withdraw-requests.d.ts.map +1 -0
  519. package/dist/withdraw/use-pending-withdraw-requests.js +27 -0
  520. package/dist/withdraw/use-pending-withdraw-requests.js.map +1 -0
  521. package/dist/withdraw/use-request-cancel-withdraw.d.ts +25 -0
  522. package/dist/withdraw/use-request-cancel-withdraw.d.ts.map +1 -0
  523. package/dist/withdraw/use-request-cancel-withdraw.js +40 -0
  524. package/dist/withdraw/use-request-cancel-withdraw.js.map +1 -0
  525. package/dist/withdraw/use-simulate-finalize-withdraw-request.d.ts +25 -0
  526. package/dist/withdraw/use-simulate-finalize-withdraw-request.d.ts.map +1 -0
  527. package/dist/withdraw/use-simulate-finalize-withdraw-request.js +29 -0
  528. package/dist/withdraw/use-simulate-finalize-withdraw-request.js.map +1 -0
  529. package/dist/withdraw/use-simulate-initiate-withdraw.d.ts +26 -0
  530. package/dist/withdraw/use-simulate-initiate-withdraw.d.ts.map +1 -0
  531. package/dist/withdraw/use-simulate-initiate-withdraw.js +29 -0
  532. package/dist/withdraw/use-simulate-initiate-withdraw.js.map +1 -0
  533. package/dist/withdraw/use-simulate-request-cancel-withdraw.d.ts +25 -0
  534. package/dist/withdraw/use-simulate-request-cancel-withdraw.d.ts.map +1 -0
  535. package/dist/withdraw/use-simulate-request-cancel-withdraw.js +29 -0
  536. package/dist/withdraw/use-simulate-request-cancel-withdraw.js.map +1 -0
  537. package/dist/withdraw/use-withdraw-requests.d.ts +21 -0
  538. package/dist/withdraw/use-withdraw-requests.d.ts.map +1 -0
  539. package/dist/withdraw/use-withdraw-requests.js +27 -0
  540. package/dist/withdraw/use-withdraw-requests.js.map +1 -0
  541. package/dist/withdraw/use-withdrawable-time.d.ts +22 -0
  542. package/dist/withdraw/use-withdrawable-time.d.ts.map +1 -0
  543. package/dist/withdraw/use-withdrawable-time.js +27 -0
  544. package/dist/withdraw/use-withdrawable-time.js.map +1 -0
  545. package/package.json +112 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-delete-sub-account.js","names":[],"sources":["../../src/account-layer/use-delete-sub-account.ts"],"sourcesContent":["\"use client\";\n\nimport {\n deleteSubAccountMutationOptions,\n getSubAccountsCountOfUserQueryKey,\n getUserSubAccountsAddressesQueryKey,\n getUserSubAccountsQueryKey,\n type DeleteSubAccountParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { resolveWriteResult, type WriteParameters, type WriteResult } from \"../transactions\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useDeleteSubAccount}.\n */\nexport type UseDeleteSubAccountParameters = WriteParameters;\n\n/**\n * Result returned by the {@link useDeleteSubAccount} mutation.\n */\nexport type DeleteSubAccountResult = WriteResult;\n\n/** Return type of {@link useDeleteSubAccount}. */\nexport type UseDeleteSubAccountReturnType = UseMutationResult<\n DeleteSubAccountResult,\n SymmioRequestError,\n DeleteSubAccountParameters\n>;\n\n/**\n * Submit a `deleteSubAccount` transaction. Deletion is irreversible and only\n * succeeds once the subaccount has no virtual accounts, zero balance, no open\n * positions, and no pending quotes (the call reverts otherwise). On success, the\n * connected user's `getUserSubAccounts`, `getUserSubAccountsAddresses`, and\n * `getSubAccountsCountOfUser` queries are invalidated so mounted lists refetch\n * without the removed subaccount.\n *\n * @example\n * ```tsx\n * const { mutate, status, error } = useDeleteSubAccount();\n * <button onClick={() => mutate({ subAccount: \"0xsub…\" })}>Delete</button>\n * ```\n */\nexport function useDeleteSubAccount(parameters: UseDeleteSubAccountParameters = {}): UseDeleteSubAccountReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const queryClient = useQueryClient();\n\n const base = deleteSubAccountMutationOptions(config);\n\n return useMutation<DeleteSubAccountResult, SymmioRequestError, DeleteSubAccountParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n const hash = await base.mutationFn({\n subAccount: variables.subAccount,\n simulateBeforeWrite: variables.simulateBeforeWrite,\n chainId: resolvedChainId,\n });\n return resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n const partial = address ? { user: address } : undefined;\n void queryClient.invalidateQueries({ predicate: predicateMatch(getUserSubAccountsQueryKey, partial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getUserSubAccountsAddressesQueryKey, partial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getSubAccountsCountOfUserQueryKey, partial) });\n },\n });\n}\n"],"mappings":";;;;;;;;;;AAiDA,SAAgB,EAAoB,IAA4C,CAAC,GAAkC;CACjH,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAc,EAAe,GAE7B,IAAO,EAAgC,CAAM;CAEnD,OAAO,EAAoF;EACzF,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,IAAM,IAAkB,EAAU,WAAW;IAM7C,OAAO,EAAmB,GAAQ,MALf,EAAK,WAAW;KACjC,YAAY,EAAU;KACtB,qBAAqB,EAAU;KAC/B,SAAS;IACX,CAAC,GACuC;KACtC,SAAS;KACT,gBAAgB,EAAW;KAC3B,eAAe,EAAW;IAC5B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GACf,IAAM,IAAU,IAAU,EAAE,MAAM,EAAQ,IAAI,KAAA;GAG9C,AAFA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA4B,CAAO,EAAE,CAAC,GACrG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAqC,CAAO,EAAE,CAAC,GAC9G,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAmC,CAAO,EAAE,CAAC;EAC9G;CACF,CAAC;AACH"}
@@ -0,0 +1,27 @@
1
+ import { DepositAndAllocateForAccountParameters } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ import { WriteParameters, WriteResult } from '../transactions';
5
+ /**
6
+ * Parameters for {@link useDepositAndAllocate}.
7
+ */
8
+ export type UseDepositAndAllocateParameters = WriteParameters;
9
+ /** Result returned by the {@link useDepositAndAllocate} mutation. */
10
+ export type DepositAndAllocateResult = WriteResult;
11
+ /** Return type of {@link useDepositAndAllocate}. */
12
+ export type UseDepositAndAllocateReturnType = UseMutationResult<DepositAndAllocateResult, SymmioRequestError, DepositAndAllocateForAccountParameters>;
13
+ /**
14
+ * Submit a `depositAndAllocateForAccount` transaction, crediting collateral to a
15
+ * subaccount **and allocating it into trading margin** in one transaction. The
16
+ * connected wallet must own the subaccount, and must have approved the collateral
17
+ * to the SYMMIO core first (see `useApproveCollateral`). On success, the connected
18
+ * wallet's collateral allowance and balance queries are invalidated.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const { mutate, status, error } = useDepositAndAllocate();
23
+ * mutate({ account: "0xsub…", amount: 1_000000n });
24
+ * ```
25
+ */
26
+ export declare function useDepositAndAllocate(parameters?: UseDepositAndAllocateParameters): UseDepositAndAllocateReturnType;
27
+ //# sourceMappingURL=use-deposit-and-allocate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-deposit-and-allocate.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-deposit-and-allocate.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,sCAAsC,EAC5C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG7F;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,eAAe,CAAC;AAE9D,qEAAqE;AACrE,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAEnD,oDAAoD;AACpD,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,CAC7D,wBAAwB,EACxB,kBAAkB,EAClB,sCAAsC,CACvC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,GAAE,+BAAoC,GAC/C,+BAA+B,CAkCjC"}
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { resolveWriteResult as r } from "../transactions/resolve-write-result.js";
6
+ import { predicateMatch as i } from "../utils/predicate-match.js";
7
+ import { depositAndAllocateForAccountMutationOptions as a, getCollateralAllowanceQueryKey as o, getCollateralBalanceQueryKey as s } from "@symmio/trading-core";
8
+ import { useConnection as c } from "wagmi";
9
+ import { useMutation as l, useQueryClient as u } from "@tanstack/react-query";
10
+ //#region src/account-layer/use-deposit-and-allocate.ts
11
+ function d(d = {}) {
12
+ let f = t(d), p = e(), { address: m } = c(), h = u(), g = a(f);
13
+ return l({
14
+ mutationKey: g.mutationKey,
15
+ mutationFn: async (e) => {
16
+ try {
17
+ let t = e.chainId ?? p;
18
+ return r(f, await g.mutationFn({
19
+ account: e.account,
20
+ amount: e.amount,
21
+ simulateBeforeWrite: e.simulateBeforeWrite,
22
+ chainId: t
23
+ }), {
24
+ chainId: t,
25
+ waitForReceipt: d.waitForReceipt,
26
+ confirmations: d.confirmations
27
+ });
28
+ } catch (e) {
29
+ throw n(e);
30
+ }
31
+ },
32
+ onSuccess: () => {
33
+ let e = m ? { owner: m } : void 0;
34
+ h.invalidateQueries({ predicate: i(o, e) }), h.invalidateQueries({ predicate: i(s, e) });
35
+ }
36
+ });
37
+ }
38
+ //#endregion
39
+ export { d as useDepositAndAllocate };
40
+
41
+ //# sourceMappingURL=use-deposit-and-allocate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-deposit-and-allocate.js","names":[],"sources":["../../src/account-layer/use-deposit-and-allocate.ts"],"sourcesContent":["\"use client\";\n\nimport {\n depositAndAllocateForAccountMutationOptions,\n getCollateralAllowanceQueryKey,\n getCollateralBalanceQueryKey,\n type DepositAndAllocateForAccountParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { resolveWriteResult, type WriteParameters, type WriteResult } from \"../transactions\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useDepositAndAllocate}.\n */\nexport type UseDepositAndAllocateParameters = WriteParameters;\n\n/** Result returned by the {@link useDepositAndAllocate} mutation. */\nexport type DepositAndAllocateResult = WriteResult;\n\n/** Return type of {@link useDepositAndAllocate}. */\nexport type UseDepositAndAllocateReturnType = UseMutationResult<\n DepositAndAllocateResult,\n SymmioRequestError,\n DepositAndAllocateForAccountParameters\n>;\n\n/**\n * Submit a `depositAndAllocateForAccount` transaction, crediting collateral to a\n * subaccount **and allocating it into trading margin** in one transaction. The\n * connected wallet must own the subaccount, and must have approved the collateral\n * to the SYMMIO core first (see `useApproveCollateral`). On success, the connected\n * wallet's collateral allowance and balance queries are invalidated.\n *\n * @example\n * ```tsx\n * const { mutate, status, error } = useDepositAndAllocate();\n * mutate({ account: \"0xsub…\", amount: 1_000000n });\n * ```\n */\nexport function useDepositAndAllocate(\n parameters: UseDepositAndAllocateParameters = {},\n): UseDepositAndAllocateReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const queryClient = useQueryClient();\n\n const base = depositAndAllocateForAccountMutationOptions(config);\n\n return useMutation<DepositAndAllocateResult, SymmioRequestError, DepositAndAllocateForAccountParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n const hash = await base.mutationFn({\n account: variables.account,\n amount: variables.amount,\n simulateBeforeWrite: variables.simulateBeforeWrite,\n chainId: resolvedChainId,\n });\n return resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n const partial = address ? { owner: address } : undefined;\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralAllowanceQueryKey, partial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, partial) });\n },\n });\n}\n"],"mappings":";;;;;;;;;;AA6CA,SAAgB,EACd,IAA8C,CAAC,GACd;CACjC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAc,EAAe,GAE7B,IAAO,EAA4C,CAAM;CAE/D,OAAO,EAAkG;EACvG,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,IAAM,IAAkB,EAAU,WAAW;IAO7C,OAAO,EAAmB,GAAQ,MANf,EAAK,WAAW;KACjC,SAAS,EAAU;KACnB,QAAQ,EAAU;KAClB,qBAAqB,EAAU;KAC/B,SAAS;IACX,CAAC,GACuC;KACtC,SAAS;KACT,gBAAgB,EAAW;KAC3B,eAAe,EAAW;IAC5B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GACf,IAAM,IAAU,IAAU,EAAE,OAAO,EAAQ,IAAI,KAAA;GAE/C,AADA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAgC,CAAO,EAAE,CAAC,GACzG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA8B,CAAO,EAAE,CAAC;EACzG;CACF,CAAC;AACH"}
@@ -0,0 +1,27 @@
1
+ import { DepositForAccountParameters } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ import { WriteParameters, WriteResult } from '../transactions';
5
+ /**
6
+ * Parameters for {@link useDeposit}.
7
+ */
8
+ export type UseDepositParameters = WriteParameters;
9
+ /** Result returned by the {@link useDeposit} mutation. */
10
+ export type DepositResult = WriteResult;
11
+ /** Return type of {@link useDeposit}. */
12
+ export type UseDepositReturnType = UseMutationResult<DepositResult, SymmioRequestError, DepositForAccountParameters>;
13
+ /**
14
+ * Submit a `depositForAccount` transaction, crediting collateral to a
15
+ * subaccount's available balance. The connected wallet must own the subaccount,
16
+ * and must have approved the collateral to the SYMMIO core first (see
17
+ * `useApproveCollateral`). On success, the connected wallet's collateral
18
+ * allowance and balance queries are invalidated so mounted reads refetch.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const { mutate, status, error } = useDeposit();
23
+ * mutate({ account: "0xsub…", amount: 1_000000n });
24
+ * ```
25
+ */
26
+ export declare function useDeposit(parameters?: UseDepositParameters): UseDepositReturnType;
27
+ //# sourceMappingURL=use-deposit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-deposit.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-deposit.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,2BAA2B,EACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG7F;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AAExC,yCAAyC;AACzC,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,aAAa,EAAE,kBAAkB,EAAE,2BAA2B,CAAC,CAAC;AAErH;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,UAAU,GAAE,oBAAyB,GAAG,oBAAoB,CAkCtF"}
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { resolveWriteResult as r } from "../transactions/resolve-write-result.js";
6
+ import { predicateMatch as i } from "../utils/predicate-match.js";
7
+ import { depositForAccountMutationOptions as a, getCollateralAllowanceQueryKey as o, getCollateralBalanceQueryKey as s } from "@symmio/trading-core";
8
+ import { useConnection as c } from "wagmi";
9
+ import { useMutation as l, useQueryClient as u } from "@tanstack/react-query";
10
+ //#region src/account-layer/use-deposit.ts
11
+ function d(d = {}) {
12
+ let f = t(d), p = e(), { address: m } = c(), h = u(), g = a(f);
13
+ return l({
14
+ mutationKey: g.mutationKey,
15
+ mutationFn: async (e) => {
16
+ try {
17
+ let t = e.chainId ?? p;
18
+ return r(f, await g.mutationFn({
19
+ account: e.account,
20
+ amount: e.amount,
21
+ simulateBeforeWrite: e.simulateBeforeWrite,
22
+ chainId: t
23
+ }), {
24
+ chainId: t,
25
+ waitForReceipt: d.waitForReceipt,
26
+ confirmations: d.confirmations
27
+ });
28
+ } catch (e) {
29
+ throw n(e);
30
+ }
31
+ },
32
+ onSuccess: () => {
33
+ let e = m ? { owner: m } : void 0;
34
+ h.invalidateQueries({ predicate: i(o, e) }), h.invalidateQueries({ predicate: i(s, e) });
35
+ }
36
+ });
37
+ }
38
+ //#endregion
39
+ export { d as useDeposit };
40
+
41
+ //# sourceMappingURL=use-deposit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-deposit.js","names":[],"sources":["../../src/account-layer/use-deposit.ts"],"sourcesContent":["\"use client\";\n\nimport {\n depositForAccountMutationOptions,\n getCollateralAllowanceQueryKey,\n getCollateralBalanceQueryKey,\n type DepositForAccountParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { resolveWriteResult, type WriteParameters, type WriteResult } from \"../transactions\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useDeposit}.\n */\nexport type UseDepositParameters = WriteParameters;\n\n/** Result returned by the {@link useDeposit} mutation. */\nexport type DepositResult = WriteResult;\n\n/** Return type of {@link useDeposit}. */\nexport type UseDepositReturnType = UseMutationResult<DepositResult, SymmioRequestError, DepositForAccountParameters>;\n\n/**\n * Submit a `depositForAccount` transaction, crediting collateral to a\n * subaccount's available balance. The connected wallet must own the subaccount,\n * and must have approved the collateral to the SYMMIO core first (see\n * `useApproveCollateral`). On success, the connected wallet's collateral\n * allowance and balance queries are invalidated so mounted reads refetch.\n *\n * @example\n * ```tsx\n * const { mutate, status, error } = useDeposit();\n * mutate({ account: \"0xsub…\", amount: 1_000000n });\n * ```\n */\nexport function useDeposit(parameters: UseDepositParameters = {}): UseDepositReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const queryClient = useQueryClient();\n\n const base = depositForAccountMutationOptions(config);\n\n return useMutation<DepositResult, SymmioRequestError, DepositForAccountParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n const hash = await base.mutationFn({\n account: variables.account,\n amount: variables.amount,\n simulateBeforeWrite: variables.simulateBeforeWrite,\n chainId: resolvedChainId,\n });\n return resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n const partial = address ? { owner: address } : undefined;\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralAllowanceQueryKey, partial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, partial) });\n },\n });\n}\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,EAAW,IAAmC,CAAC,GAAyB;CACtF,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAc,EAAe,GAE7B,IAAO,EAAiC,CAAM;CAEpD,OAAO,EAA4E;EACjF,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,IAAM,IAAkB,EAAU,WAAW;IAO7C,OAAO,EAAmB,GAAQ,MANf,EAAK,WAAW;KACjC,SAAS,EAAU;KACnB,QAAQ,EAAU;KAClB,qBAAqB,EAAU;KAC/B,SAAS;IACX,CAAC,GACuC;KACtC,SAAS;KACT,gBAAgB,EAAW;KAC3B,eAAe,EAAW;IAC5B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GACf,IAAM,IAAU,IAAU,EAAE,OAAO,EAAQ,IAAI,KAAA;GAE/C,AADA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAgC,CAAO,EAAE,CAAC,GACzG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA8B,CAAO,EAAE,CAAC;EACzG;CACF,CAAC;AACH"}
@@ -0,0 +1,27 @@
1
+ import { EditAccountNameParameters } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ import { WriteParameters, WriteResult } from '../transactions';
5
+ /**
6
+ * Parameters for {@link useEditAccountName}.
7
+ */
8
+ export type UseEditAccountNameParameters = WriteParameters;
9
+ /**
10
+ * Result returned by the {@link useEditAccountName} mutation.
11
+ */
12
+ export type EditAccountNameResult = WriteResult;
13
+ /** Return type of {@link useEditAccountName}. */
14
+ export type UseEditAccountNameReturnType = UseMutationResult<EditAccountNameResult, SymmioRequestError, EditAccountNameParameters>;
15
+ /**
16
+ * Submit an `editAccountName` transaction for a subaccount. On success, every
17
+ * `getUserSubAccounts` query for the connected wallet is invalidated so mounted
18
+ * lists refetch with the new name.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const { mutate, status, error } = useEditAccountName();
23
+ * <button onClick={() => mutate({ account: "0xsub…", name: "Trading Bot" })}>Rename</button>
24
+ * ```
25
+ */
26
+ export declare function useEditAccountName(parameters?: UseEditAccountNameParameters): UseEditAccountNameReturnType;
27
+ //# sourceMappingURL=use-edit-account-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-edit-account-name.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-edit-account-name.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG7F;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAEhD,iDAAiD;AACjD,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAC1D,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,CAC1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,4BAAiC,GAAG,4BAA4B,CAkC9G"}
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { resolveWriteResult as r } from "../transactions/resolve-write-result.js";
6
+ import { predicateMatch as i } from "../utils/predicate-match.js";
7
+ import { editAccountNameMutationOptions as a, getUserSubAccountsQueryKey as o } from "@symmio/trading-core";
8
+ import { useConnection as s } from "wagmi";
9
+ import { useMutation as c, useQueryClient as l } from "@tanstack/react-query";
10
+ //#region src/account-layer/use-edit-account-name.ts
11
+ function u(u = {}) {
12
+ let d = t(u), f = e(), { address: p } = s(), m = l(), h = a(d);
13
+ return c({
14
+ mutationKey: h.mutationKey,
15
+ mutationFn: async (e) => {
16
+ try {
17
+ let t = e.chainId ?? f;
18
+ return r(d, await h.mutationFn({
19
+ account: e.account,
20
+ name: e.name,
21
+ simulateBeforeWrite: e.simulateBeforeWrite,
22
+ chainId: t
23
+ }), {
24
+ chainId: t,
25
+ waitForReceipt: u.waitForReceipt,
26
+ confirmations: u.confirmations
27
+ });
28
+ } catch (e) {
29
+ throw n(e);
30
+ }
31
+ },
32
+ onSuccess: () => {
33
+ m.invalidateQueries({ predicate: i(o, p ? { user: p } : void 0) });
34
+ }
35
+ });
36
+ }
37
+ //#endregion
38
+ export { u as useEditAccountName };
39
+
40
+ //# sourceMappingURL=use-edit-account-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-edit-account-name.js","names":[],"sources":["../../src/account-layer/use-edit-account-name.ts"],"sourcesContent":["\"use client\";\n\nimport {\n editAccountNameMutationOptions,\n getUserSubAccountsQueryKey,\n type EditAccountNameParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { resolveWriteResult, type WriteParameters, type WriteResult } from \"../transactions\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useEditAccountName}.\n */\nexport type UseEditAccountNameParameters = WriteParameters;\n\n/**\n * Result returned by the {@link useEditAccountName} mutation.\n */\nexport type EditAccountNameResult = WriteResult;\n\n/** Return type of {@link useEditAccountName}. */\nexport type UseEditAccountNameReturnType = UseMutationResult<\n EditAccountNameResult,\n SymmioRequestError,\n EditAccountNameParameters\n>;\n\n/**\n * Submit an `editAccountName` transaction for a subaccount. On success, every\n * `getUserSubAccounts` query for the connected wallet is invalidated so mounted\n * lists refetch with the new name.\n *\n * @example\n * ```tsx\n * const { mutate, status, error } = useEditAccountName();\n * <button onClick={() => mutate({ account: \"0xsub…\", name: \"Trading Bot\" })}>Rename</button>\n * ```\n */\nexport function useEditAccountName(parameters: UseEditAccountNameParameters = {}): UseEditAccountNameReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const queryClient = useQueryClient();\n\n const base = editAccountNameMutationOptions(config);\n\n return useMutation<EditAccountNameResult, SymmioRequestError, EditAccountNameParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n const hash = await base.mutationFn({\n account: variables.account,\n name: variables.name,\n simulateBeforeWrite: variables.simulateBeforeWrite,\n chainId: resolvedChainId,\n });\n return resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getUserSubAccountsQueryKey, address ? { user: address } : undefined),\n });\n },\n });\n}\n"],"mappings":";;;;;;;;;;AA4CA,SAAgB,EAAmB,IAA2C,CAAC,GAAiC;CAC9G,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAc,EAAe,GAE7B,IAAO,EAA+B,CAAM;CAElD,OAAO,EAAkF;EACvF,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,IAAM,IAAkB,EAAU,WAAW;IAO7C,OAAO,EAAmB,GAAQ,MANf,EAAK,WAAW;KACjC,SAAS,EAAU;KACnB,MAAM,EAAU;KAChB,qBAAqB,EAAU;KAC/B,SAAS;IACX,CAAC,GACuC;KACtC,SAAS;KACT,gBAAgB,EAAW;KAC3B,eAAe,EAAW;IAC5B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GACf,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAA4B,IAAU,EAAE,MAAM,EAAQ,IAAI,KAAA,CAAS,EAC/F,CAAC;EACH;CACF,CAAC;AACH"}
@@ -0,0 +1,38 @@
1
+ import { ConfigParameter, GetPredictedNextVirtualAccountOptions, GetPredictedNextVirtualAccountReturnType } from '@symmio/trading-core';
2
+ import { UseQueryResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ /**
5
+ * Parameters for {@link usePredictedNextVirtualAccount}: the core query options
6
+ * (`subAccount`, `isolationType`, `symbolId`, chain id, TanStack `query`
7
+ * overrides) plus an optional `config`.
8
+ */
9
+ export type UsePredictedNextVirtualAccountParameters = GetPredictedNextVirtualAccountOptions & ConfigParameter;
10
+ /** Return type of {@link usePredictedNextVirtualAccount}. */
11
+ export type UsePredictedNextVirtualAccountReturnType = UseQueryResult<GetPredictedNextVirtualAccountReturnType, SymmioRequestError>;
12
+ /**
13
+ * Predict the deterministic address of the next Virtual Account (VA) a
14
+ * subaccount would create for a given `(isolationType, symbolId)`.
15
+ *
16
+ * In lowcap, an instant-open isolates its position into a VA that does not exist
17
+ * on-chain until the trade lands; the AccountLayer computes that VA's address up
18
+ * front. Use this to surface a brand-new position's VA — e.g. as the `partyA`
19
+ * for quote reads — before it is created. The prediction is stable per
20
+ * `(subAccount, isolationType, symbolId)` only until the subaccount's virtual
21
+ * nonce advances, so a short default `staleTime` applies (override via
22
+ * `query.staleTime`).
23
+ *
24
+ * The query is disabled until `subAccount`, `isolationType`, and `symbolId` are
25
+ * all set. `chainId` defaults to the connected chain. Errors are normalized to
26
+ * {@link SymmioRequestError}.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * const { data: va } = usePredictedNextVirtualAccount({
31
+ * subAccount: "0xsub…",
32
+ * isolationType: VIRTUAL_ACCOUNT_ISOLATION_TYPE.MARKET_LONG,
33
+ * symbolId: 1n,
34
+ * });
35
+ * ```
36
+ */
37
+ export declare function usePredictedNextVirtualAccount(parameters?: UsePredictedNextVirtualAccountParameters): UsePredictedNextVirtualAccountReturnType;
38
+ //# sourceMappingURL=use-predicted-next-virtual-account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-predicted-next-virtual-account.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-predicted-next-virtual-account.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,qCAAqC,EAC1C,KAAK,wCAAwC,EAC9C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;;GAIG;AACH,MAAM,MAAM,wCAAwC,GAAG,qCAAqC,GAAG,eAAe,CAAC;AAE/G,6DAA6D;AAC7D,MAAM,MAAM,wCAAwC,GAAG,cAAc,CACnE,wCAAwC,EACxC,kBAAkB,CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,GAAE,wCAA6C,GACxD,wCAAwC,CAkB1C"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { getPredictedNextVirtualAccountQueryOptions as r } from "@symmio/trading-core";
6
+ import { useQuery as i } from "@tanstack/react-query";
7
+ //#region src/account-layer/use-predicted-next-virtual-account.ts
8
+ function a(a = {}) {
9
+ let o = t(a), s = e(), c = r(o, {
10
+ ...a,
11
+ chainId: a.chainId ?? s
12
+ });
13
+ return i({
14
+ ...c,
15
+ queryFn: async () => {
16
+ try {
17
+ return await c.queryFn();
18
+ } catch (e) {
19
+ throw n(e);
20
+ }
21
+ }
22
+ });
23
+ }
24
+ //#endregion
25
+ export { a as usePredictedNextVirtualAccount };
26
+
27
+ //# sourceMappingURL=use-predicted-next-virtual-account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-predicted-next-virtual-account.js","names":[],"sources":["../../src/account-layer/use-predicted-next-virtual-account.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getPredictedNextVirtualAccountQueryOptions,\n type ConfigParameter,\n type GetPredictedNextVirtualAccountOptions,\n type GetPredictedNextVirtualAccountReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link usePredictedNextVirtualAccount}: the core query options\n * (`subAccount`, `isolationType`, `symbolId`, chain id, TanStack `query`\n * overrides) plus an optional `config`.\n */\nexport type UsePredictedNextVirtualAccountParameters = GetPredictedNextVirtualAccountOptions & ConfigParameter;\n\n/** Return type of {@link usePredictedNextVirtualAccount}. */\nexport type UsePredictedNextVirtualAccountReturnType = UseQueryResult<\n GetPredictedNextVirtualAccountReturnType,\n SymmioRequestError\n>;\n\n/**\n * Predict the deterministic address of the next Virtual Account (VA) a\n * subaccount would create for a given `(isolationType, symbolId)`.\n *\n * In lowcap, an instant-open isolates its position into a VA that does not exist\n * on-chain until the trade lands; the AccountLayer computes that VA's address up\n * front. Use this to surface a brand-new position's VA — e.g. as the `partyA`\n * for quote reads — before it is created. The prediction is stable per\n * `(subAccount, isolationType, symbolId)` only until the subaccount's virtual\n * nonce advances, so a short default `staleTime` applies (override via\n * `query.staleTime`).\n *\n * The query is disabled until `subAccount`, `isolationType`, and `symbolId` are\n * all set. `chainId` defaults to the connected chain. Errors are normalized to\n * {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { data: va } = usePredictedNextVirtualAccount({\n * subAccount: \"0xsub…\",\n * isolationType: VIRTUAL_ACCOUNT_ISOLATION_TYPE.MARKET_LONG,\n * symbolId: 1n,\n * });\n * ```\n */\nexport function usePredictedNextVirtualAccount(\n parameters: UsePredictedNextVirtualAccountParameters = {},\n): UsePredictedNextVirtualAccountReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getPredictedNextVirtualAccountQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UsePredictedNextVirtualAccountReturnType;\n}\n"],"mappings":";;;;;;;AAoDA,SAAgB,EACd,IAAuD,CAAC,GACd;CAC1C,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAA2C,GAAQ;EACjE,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,43 @@
1
+ import { RemoveMarginParameters, SingleUpnlSig } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ import { WriteParameters, WriteResult } from '../transactions';
5
+ /**
6
+ * Parameters for {@link useRemoveMargin}.
7
+ */
8
+ export type UseRemoveMarginParameters = WriteParameters;
9
+ /**
10
+ * Variables for the {@link useRemoveMargin} mutation: the core action's inputs
11
+ * except `upnlSig` is **optional**. When omitted, the hook fetches a fresh Muon
12
+ * uPnL signature itself before submitting; pass one only to reuse a signature you
13
+ * already fetched.
14
+ */
15
+ export type RemoveMarginVariables = Omit<RemoveMarginParameters, "upnlSig"> & {
16
+ /** A pre-fetched Muon uPnL signature. Omit to let the hook fetch a fresh one. */
17
+ upnlSig?: SingleUpnlSig;
18
+ };
19
+ /** Result returned by the {@link useRemoveMargin} mutation. */
20
+ export type RemoveMarginResult = WriteResult;
21
+ /** Return type of {@link useRemoveMargin}. */
22
+ export type UseRemoveMarginReturnType = UseMutationResult<RemoveMarginResult, SymmioRequestError, RemoveMarginVariables>;
23
+ /**
24
+ * Remove margin from a virtual account (VA) — a deallocate via
25
+ * `AccountLayer.removeMargin`. The hook **fetches a fresh Muon uPnL signature**
26
+ * (the contract requires it to prove the VA stays solvent) immediately before
27
+ * submitting, unless you pass one as `upnlSig`. The connected wallet must own the
28
+ * VA. On success, the VA's balance reads are invalidated.
29
+ *
30
+ * @remarks
31
+ * Subject to the on-chain deallocate debounce — submitting too soon after a prior
32
+ * deallocate reverts. That (and an insolvent result, or a stale signature) is
33
+ * surfaced as a normalized {@link SymmioRequestError}; enabling `simulateBeforeWrite`
34
+ * catches it as a dry-run before anything is signed.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * const { mutate } = useRemoveMargin();
39
+ * mutate({ virtualAccount: "0xva…", amount: 50_000000000000000000n });
40
+ * ```
41
+ */
42
+ export declare function useRemoveMargin(parameters?: UseRemoveMarginParameters): UseRemoveMarginReturnType;
43
+ //# sourceMappingURL=use-remove-margin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-remove-margin.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-remove-margin.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG7F;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,eAAe,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG;IAC5E,iFAAiF;IACjF,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,+DAA+D;AAC/D,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE7C,8CAA8C;AAC9C,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CACvD,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAE,yBAA8B,GAAG,yBAAyB,CAwCrG"}
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { resolveWriteResult as r } from "../transactions/resolve-write-result.js";
6
+ import { predicateMatch as i } from "../utils/predicate-match.js";
7
+ import { getAccountBalanceInfoQueryKey as a, getAccountBalanceOfQueryKey as o, getDeallocateUpnlSig as s, removeMarginMutationOptions as c } from "@symmio/trading-core";
8
+ import { useMutation as l, useQueryClient as u } from "@tanstack/react-query";
9
+ //#region src/account-layer/use-remove-margin.ts
10
+ function d(d = {}) {
11
+ let f = t(d), p = e(), m = u(), h = c(f);
12
+ return l({
13
+ mutationKey: h.mutationKey,
14
+ mutationFn: async (e) => {
15
+ try {
16
+ let t = e.chainId ?? p, n = e.upnlSig ?? await s(f, {
17
+ virtualAccount: e.virtualAccount,
18
+ chainId: t
19
+ });
20
+ return r(f, await h.mutationFn({
21
+ virtualAccount: e.virtualAccount,
22
+ amount: e.amount,
23
+ upnlSig: n,
24
+ simulateBeforeWrite: e.simulateBeforeWrite,
25
+ chainId: t
26
+ }), {
27
+ chainId: t,
28
+ waitForReceipt: d.waitForReceipt,
29
+ confirmations: d.confirmations
30
+ });
31
+ } catch (e) {
32
+ throw n(e);
33
+ }
34
+ },
35
+ onSuccess: (e, t) => {
36
+ let n = { account: t.virtualAccount };
37
+ m.invalidateQueries({ predicate: i(a, n) }), m.invalidateQueries({ predicate: i(o, n) });
38
+ }
39
+ });
40
+ }
41
+ //#endregion
42
+ export { d as useRemoveMargin };
43
+
44
+ //# sourceMappingURL=use-remove-margin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-remove-margin.js","names":[],"sources":["../../src/account-layer/use-remove-margin.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getAccountBalanceInfoQueryKey,\n getAccountBalanceOfQueryKey,\n getDeallocateUpnlSig,\n removeMarginMutationOptions,\n type RemoveMarginParameters,\n type SingleUpnlSig,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { resolveWriteResult, type WriteParameters, type WriteResult } from \"../transactions\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useRemoveMargin}.\n */\nexport type UseRemoveMarginParameters = WriteParameters;\n\n/**\n * Variables for the {@link useRemoveMargin} mutation: the core action's inputs\n * except `upnlSig` is **optional**. When omitted, the hook fetches a fresh Muon\n * uPnL signature itself before submitting; pass one only to reuse a signature you\n * already fetched.\n */\nexport type RemoveMarginVariables = Omit<RemoveMarginParameters, \"upnlSig\"> & {\n /** A pre-fetched Muon uPnL signature. Omit to let the hook fetch a fresh one. */\n upnlSig?: SingleUpnlSig;\n};\n\n/** Result returned by the {@link useRemoveMargin} mutation. */\nexport type RemoveMarginResult = WriteResult;\n\n/** Return type of {@link useRemoveMargin}. */\nexport type UseRemoveMarginReturnType = UseMutationResult<\n RemoveMarginResult,\n SymmioRequestError,\n RemoveMarginVariables\n>;\n\n/**\n * Remove margin from a virtual account (VA) — a deallocate via\n * `AccountLayer.removeMargin`. The hook **fetches a fresh Muon uPnL signature**\n * (the contract requires it to prove the VA stays solvent) immediately before\n * submitting, unless you pass one as `upnlSig`. The connected wallet must own the\n * VA. On success, the VA's balance reads are invalidated.\n *\n * @remarks\n * Subject to the on-chain deallocate debounce — submitting too soon after a prior\n * deallocate reverts. That (and an insolvent result, or a stale signature) is\n * surfaced as a normalized {@link SymmioRequestError}; enabling `simulateBeforeWrite`\n * catches it as a dry-run before anything is signed.\n *\n * @example\n * ```tsx\n * const { mutate } = useRemoveMargin();\n * mutate({ virtualAccount: \"0xva…\", amount: 50_000000000000000000n });\n * ```\n */\nexport function useRemoveMargin(parameters: UseRemoveMarginParameters = {}): UseRemoveMarginReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n\n const base = removeMarginMutationOptions(config);\n\n return useMutation<RemoveMarginResult, SymmioRequestError, RemoveMarginVariables>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n const upnlSig =\n variables.upnlSig ??\n (await getDeallocateUpnlSig(config, {\n virtualAccount: variables.virtualAccount,\n chainId: resolvedChainId,\n }));\n const hash = await base.mutationFn({\n virtualAccount: variables.virtualAccount,\n amount: variables.amount,\n upnlSig,\n simulateBeforeWrite: variables.simulateBeforeWrite,\n chainId: resolvedChainId,\n });\n return resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: (_result, variables) => {\n const partial = { account: variables.virtualAccount };\n void queryClient.invalidateQueries({ predicate: predicateMatch(getAccountBalanceInfoQueryKey, partial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getAccountBalanceOfQueryKey, partial) });\n },\n });\n}\n"],"mappings":";;;;;;;;;AA+DA,SAAgB,EAAgB,IAAwC,CAAC,GAA8B;CACrG,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAE7B,IAAO,EAA4B,CAAM;CAE/C,OAAO,EAA2E;EAChF,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,IAAM,IAAkB,EAAU,WAAW,GACvC,IACJ,EAAU,WACT,MAAM,EAAqB,GAAQ;KAClC,gBAAgB,EAAU;KAC1B,SAAS;IACX,CAAC;IAQH,OAAO,EAAmB,GAAQ,MAPf,EAAK,WAAW;KACjC,gBAAgB,EAAU;KAC1B,QAAQ,EAAU;KAClB;KACA,qBAAqB,EAAU;KAC/B,SAAS;IACX,CAAC,GACuC;KACtC,SAAS;KACT,gBAAgB,EAAW;KAC3B,eAAe,EAAW;IAC5B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,YAAY,GAAS,MAAc;GACjC,IAAM,IAAU,EAAE,SAAS,EAAU,eAAe;GAEpD,AADA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA+B,CAAO,EAAE,CAAC,GACxG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA6B,CAAO,EAAE,CAAC;EACxG;CACF,CAAC;AACH"}
@@ -0,0 +1,24 @@
1
+ import { ConfigParameter, SimulateAddMarginParameters, SimulateAddMarginReturnType } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ /**
5
+ * Parameters for {@link useSimulateAddMargin}: an optional `config` override. The
6
+ * dry-run's inputs are passed as the mutation `variables`.
7
+ */
8
+ export type UseSimulateAddMarginParameters = ConfigParameter;
9
+ /** Return type of {@link useSimulateAddMargin}. */
10
+ export type UseSimulateAddMarginReturnType = UseMutationResult<SimulateAddMarginReturnType, SymmioRequestError, SimulateAddMarginParameters>;
11
+ /**
12
+ * On-demand dry-run (`simulateContract`) of `addMargin`. Call `mutate(args)` to
13
+ * run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces
14
+ * as a normalized {@link SymmioRequestError}). `from` defaults to the connected
15
+ * wallet and `chainId` to the connected chain.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * const sim = useSimulateAddMargin();
20
+ * sim.mutate({ virtualAccount: "0xva…", amount: 50_000000000000000000n });
21
+ * ```
22
+ */
23
+ export declare function useSimulateAddMargin(parameters?: UseSimulateAddMarginParameters): UseSimulateAddMarginReturnType;
24
+ //# sourceMappingURL=use-simulate-add-margin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-simulate-add-margin.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-add-margin.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,eAAe,CAAC;AAE7D,mDAAmD;AACnD,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAC5D,2BAA2B,EAC3B,kBAAkB,EAClB,2BAA2B,CAC5B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,GAAE,8BAAmC,GAAG,8BAA8B,CAoBpH"}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { simulateAddMarginMutationOptions as r } from "@symmio/trading-core";
6
+ import { useConnection as i } from "wagmi";
7
+ import { useMutation as a } from "@tanstack/react-query";
8
+ //#region src/account-layer/use-simulate-add-margin.ts
9
+ function o(o = {}) {
10
+ let s = t(o), c = e(), { address: l } = i(), u = r(s);
11
+ return a({
12
+ mutationKey: u.mutationKey,
13
+ mutationFn: async (e) => {
14
+ try {
15
+ return await u.mutationFn({
16
+ ...e,
17
+ chainId: e.chainId ?? c,
18
+ from: e.from ?? l
19
+ });
20
+ } catch (e) {
21
+ throw n(e);
22
+ }
23
+ }
24
+ });
25
+ }
26
+ //#endregion
27
+ export { o as useSimulateAddMargin };
28
+
29
+ //# sourceMappingURL=use-simulate-add-margin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-simulate-add-margin.js","names":[],"sources":["../../src/account-layer/use-simulate-add-margin.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateAddMarginMutationOptions,\n type ConfigParameter,\n type SimulateAddMarginParameters,\n type SimulateAddMarginReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateAddMargin}: an optional `config` override. The\n * dry-run's inputs are passed as the mutation `variables`.\n */\nexport type UseSimulateAddMarginParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateAddMargin}. */\nexport type UseSimulateAddMarginReturnType = UseMutationResult<\n SimulateAddMarginReturnType,\n SymmioRequestError,\n SimulateAddMarginParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `addMargin`. Call `mutate(args)` to\n * run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces\n * as a normalized {@link SymmioRequestError}). `from` defaults to the connected\n * wallet and `chainId` to the connected chain.\n *\n * @example\n * ```tsx\n * const sim = useSimulateAddMargin();\n * sim.mutate({ virtualAccount: \"0xva…\", amount: 50_000000000000000000n });\n * ```\n */\nexport function useSimulateAddMargin(parameters: UseSimulateAddMarginParameters = {}): UseSimulateAddMarginReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateAddMarginMutationOptions(config);\n\n return useMutation<SimulateAddMarginReturnType, SymmioRequestError, SimulateAddMarginParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AAwCA,SAAgB,EAAqB,IAA6C,CAAC,GAAmC;CACpH,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAiC,CAAM;CAEpD,OAAO,EAA0F;EAC/F,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,25 @@
1
+ import { ConfigParameter, SimulateAllocateParameters, SimulateAllocateReturnType } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ /**
5
+ * Parameters for {@link useSimulateAllocate}: an optional `config` override. The
6
+ * dry-run's inputs are passed as the mutation `variables`.
7
+ */
8
+ export type UseSimulateAllocateParameters = ConfigParameter;
9
+ /** Return type of {@link useSimulateAllocate}. */
10
+ export type UseSimulateAllocateReturnType = UseMutationResult<SimulateAllocateReturnType, SymmioRequestError, SimulateAllocateParameters>;
11
+ /**
12
+ * On-demand dry-run (`simulateContract`) of `allocate`. Call `mutate(args)` to
13
+ * run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces
14
+ * as a normalized {@link SymmioRequestError}). `from` defaults to the connected
15
+ * wallet and `chainId` to the connected chain.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * const sim = useSimulateAllocate();
20
+ * sim.mutate({ ...args });
21
+ * // sim.data?.result, sim.isPending, sim.error
22
+ * ```
23
+ */
24
+ export declare function useSimulateAllocate(parameters?: UseSimulateAllocateParameters): UseSimulateAllocateReturnType;
25
+ //# sourceMappingURL=use-simulate-allocate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-simulate-allocate.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-allocate.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,eAAe,CAAC;AAE5D,kDAAkD;AAClD,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,CAC3D,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,CAC3B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,6BAAkC,GAAG,6BAA6B,CAoBjH"}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { simulateAllocateMutationOptions as r } from "@symmio/trading-core";
6
+ import { useConnection as i } from "wagmi";
7
+ import { useMutation as a } from "@tanstack/react-query";
8
+ //#region src/account-layer/use-simulate-allocate.ts
9
+ function o(o = {}) {
10
+ let s = t(o), c = e(), { address: l } = i(), u = r(s);
11
+ return a({
12
+ mutationKey: u.mutationKey,
13
+ mutationFn: async (e) => {
14
+ try {
15
+ return await u.mutationFn({
16
+ ...e,
17
+ chainId: e.chainId ?? c,
18
+ from: e.from ?? l
19
+ });
20
+ } catch (e) {
21
+ throw n(e);
22
+ }
23
+ }
24
+ });
25
+ }
26
+ //#endregion
27
+ export { o as useSimulateAllocate };
28
+
29
+ //# sourceMappingURL=use-simulate-allocate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-simulate-allocate.js","names":[],"sources":["../../src/account-layer/use-simulate-allocate.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateAllocateMutationOptions,\n type ConfigParameter,\n type SimulateAllocateParameters,\n type SimulateAllocateReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateAllocate}: an optional `config` override. The\n * dry-run's inputs are passed as the mutation `variables`.\n */\nexport type UseSimulateAllocateParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateAllocate}. */\nexport type UseSimulateAllocateReturnType = UseMutationResult<\n SimulateAllocateReturnType,\n SymmioRequestError,\n SimulateAllocateParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `allocate`. Call `mutate(args)` to\n * run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces\n * as a normalized {@link SymmioRequestError}). `from` defaults to the connected\n * wallet and `chainId` to the connected chain.\n *\n * @example\n * ```tsx\n * const sim = useSimulateAllocate();\n * sim.mutate({ ...args });\n * // sim.data?.result, sim.isPending, sim.error\n * ```\n */\nexport function useSimulateAllocate(parameters: UseSimulateAllocateParameters = {}): UseSimulateAllocateReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateAllocateMutationOptions(config);\n\n return useMutation<SimulateAllocateReturnType, SymmioRequestError, SimulateAllocateParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AAyCA,SAAgB,EAAoB,IAA4C,CAAC,GAAkC;CACjH,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAgC,CAAM;CAEnD,OAAO,EAAwF;EAC7F,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,25 @@
1
+ import { ConfigParameter, SimulateCreateSubAccountsParameters, SimulateCreateSubAccountsReturnType } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error';
4
+ /**
5
+ * Parameters for {@link useSimulateCreateSubAccounts}: an optional `config` override. The dry-run's
6
+ * inputs are passed as the mutation `variables`.
7
+ */
8
+ export type UseSimulateCreateSubAccountsParameters = ConfigParameter;
9
+ /** Return type of {@link useSimulateCreateSubAccounts}. */
10
+ export type UseSimulateCreateSubAccountsReturnType = UseMutationResult<SimulateCreateSubAccountsReturnType, SymmioRequestError, SimulateCreateSubAccountsParameters>;
11
+ /**
12
+ * On-demand dry-run (`simulateContract`) of `createSubAccounts`. Call `mutate(args)`
13
+ * to run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces
14
+ * as a normalized {@link SymmioRequestError}). `from` defaults to the connected
15
+ * wallet and `chainId` to the connected chain.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * const sim = useSimulateCreateSubAccounts();
20
+ * sim.mutate({ ...args });
21
+ * // sim.data?.result, sim.isPending, sim.error
22
+ * ```
23
+ */
24
+ export declare function useSimulateCreateSubAccounts(parameters?: UseSimulateCreateSubAccountsParameters): UseSimulateCreateSubAccountsReturnType;
25
+ //# sourceMappingURL=use-simulate-create-sub-accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-simulate-create-sub-accounts.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-create-sub-accounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,EACzC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,sCAAsC,GAAG,eAAe,CAAC;AAErE,2DAA2D;AAC3D,MAAM,MAAM,sCAAsC,GAAG,iBAAiB,CACpE,mCAAmC,EACnC,kBAAkB,EAClB,mCAAmC,CACpC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,GAAE,sCAA2C,GACtD,sCAAsC,CAoBxC"}