@ember-finance/sdk 2.0.0 → 2.0.2

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 (356) hide show
  1. package/README.md +64 -60
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +1 -1
  4. package/dist/src/abis/EmberETHVault.json +343 -2
  5. package/dist/src/abis/EmberProtocolConfig.json +61 -2
  6. package/dist/src/abis/EmberVault.json +343 -2
  7. package/dist/src/abis/EmberVaultMintBurnOFTAdapter.json +1382 -0
  8. package/dist/src/abis/index.d.ts +3 -1
  9. package/dist/src/abis/index.js +12 -22
  10. package/dist/src/api/api.d.ts +2 -2
  11. package/dist/src/api/api.js +2 -18
  12. package/dist/src/api/apis/accounts-api.d.ts +9 -9
  13. package/dist/src/api/apis/accounts-api.js +63 -73
  14. package/dist/src/api/apis/vaults-api.d.ts +20 -20
  15. package/dist/src/api/apis/vaults-api.js +130 -140
  16. package/dist/src/api/base.d.ts +1 -1
  17. package/dist/src/api/base.js +7 -15
  18. package/dist/src/api/common.d.ts +2 -2
  19. package/dist/src/api/common.js +13 -25
  20. package/dist/src/api/configuration.js +2 -6
  21. package/dist/src/api/index.d.ts +3 -3
  22. package/dist/src/api/index.js +3 -19
  23. package/dist/src/api/models/account-transaction-transaction-data.d.ts +5 -5
  24. package/dist/src/api/models/account-transaction-transaction-data.js +1 -2
  25. package/dist/src/api/models/account-transaction.d.ts +1 -1
  26. package/dist/src/api/models/account-transaction.js +1 -4
  27. package/dist/src/api/models/account-withdrawal-request.d.ts +2 -2
  28. package/dist/src/api/models/account-withdrawal-request.js +1 -4
  29. package/dist/src/api/models/apy-history-v2.d.ts +1 -1
  30. package/dist/src/api/models/apy-history-v2.js +1 -2
  31. package/dist/src/api/models/apy-history.js +1 -2
  32. package/dist/src/api/models/asset.js +1 -2
  33. package/dist/src/api/models/borrowed.d.ts +1 -1
  34. package/dist/src/api/models/borrowed.js +1 -2
  35. package/dist/src/api/models/chain.js +1 -4
  36. package/dist/src/api/models/coin-price.js +1 -2
  37. package/dist/src/api/models/deposit-transaction.d.ts +2 -2
  38. package/dist/src/api/models/deposit-transaction.js +1 -2
  39. package/dist/src/api/models/ember-position.d.ts +1 -1
  40. package/dist/src/api/models/ember-position.js +1 -2
  41. package/dist/src/api/models/exposure-coin.d.ts +1 -1
  42. package/dist/src/api/models/exposure-coin.js +1 -2
  43. package/dist/src/api/models/exposure-protocol.d.ts +6 -6
  44. package/dist/src/api/models/exposure-protocol.js +1 -2
  45. package/dist/src/api/models/exposure.d.ts +2 -2
  46. package/dist/src/api/models/exposure.js +1 -2
  47. package/dist/src/api/models/fee.d.ts +1 -1
  48. package/dist/src/api/models/fee.js +1 -2
  49. package/dist/src/api/models/fees.js +1 -2
  50. package/dist/src/api/models/history-interval.js +1 -4
  51. package/dist/src/api/models/index.d.ts +78 -78
  52. package/dist/src/api/models/index.js +78 -94
  53. package/dist/src/api/models/lp.d.ts +3 -3
  54. package/dist/src/api/models/lp.js +1 -2
  55. package/dist/src/api/models/manager.js +1 -2
  56. package/dist/src/api/models/min-withdrawal-shares-updated-event.js +1 -2
  57. package/dist/src/api/models/perps.d.ts +1 -1
  58. package/dist/src/api/models/perps.js +1 -2
  59. package/dist/src/api/models/pnl-history-interval.js +1 -4
  60. package/dist/src/api/models/pnl-history.js +1 -2
  61. package/dist/src/api/models/poc-report-asset.js +1 -2
  62. package/dist/src/api/models/poc-report-assets.d.ts +1 -1
  63. package/dist/src/api/models/poc-report-assets.js +1 -2
  64. package/dist/src/api/models/poc-report-exchange.d.ts +1 -1
  65. package/dist/src/api/models/poc-report-exchange.js +1 -2
  66. package/dist/src/api/models/poc-report-exchanges.d.ts +1 -1
  67. package/dist/src/api/models/poc-report-exchanges.js +1 -2
  68. package/dist/src/api/models/poc-report-protocol.js +1 -2
  69. package/dist/src/api/models/poc-report-token.js +1 -2
  70. package/dist/src/api/models/poc-report-wallet.d.ts +2 -2
  71. package/dist/src/api/models/poc-report-wallet.js +1 -2
  72. package/dist/src/api/models/poc-report-wallets.d.ts +1 -1
  73. package/dist/src/api/models/poc-report-wallets.js +1 -2
  74. package/dist/src/api/models/position-history-interval.js +1 -4
  75. package/dist/src/api/models/position-history.js +1 -4
  76. package/dist/src/api/models/position-value.js +1 -4
  77. package/dist/src/api/models/position.js +1 -2
  78. package/dist/src/api/models/process-requests-summary-event.js +1 -2
  79. package/dist/src/api/models/proof-of-capital-report.d.ts +3 -3
  80. package/dist/src/api/models/proof-of-capital-report.js +1 -2
  81. package/dist/src/api/models/protocol-fee-collected-event.js +1 -2
  82. package/dist/src/api/models/protocol-info.d.ts +3 -3
  83. package/dist/src/api/models/protocol-info.js +1 -2
  84. package/dist/src/api/models/protocol.js +1 -2
  85. package/dist/src/api/models/raw-event-event-data.d.ts +17 -17
  86. package/dist/src/api/models/raw-event-event-data.js +1 -2
  87. package/dist/src/api/models/raw-event.d.ts +1 -1
  88. package/dist/src/api/models/raw-event.js +1 -4
  89. package/dist/src/api/models/redeem-request-cancelled-transaction.d.ts +2 -2
  90. package/dist/src/api/models/redeem-request-cancelled-transaction.js +1 -2
  91. package/dist/src/api/models/redeem-request-processed-transaction.d.ts +2 -2
  92. package/dist/src/api/models/redeem-request-processed-transaction.js +1 -2
  93. package/dist/src/api/models/redeem-request-skipped-transaction.d.ts +2 -2
  94. package/dist/src/api/models/redeem-request-skipped-transaction.js +1 -2
  95. package/dist/src/api/models/redeem-request-transaction.d.ts +2 -2
  96. package/dist/src/api/models/redeem-request-transaction.js +1 -2
  97. package/dist/src/api/models/reported-apy.js +1 -2
  98. package/dist/src/api/models/request-processed-event.js +1 -2
  99. package/dist/src/api/models/request-redeemed-event.js +1 -2
  100. package/dist/src/api/models/reward-token.js +1 -2
  101. package/dist/src/api/models/reward.d.ts +1 -1
  102. package/dist/src/api/models/reward.js +1 -2
  103. package/dist/src/api/models/share-price-history.js +1 -2
  104. package/dist/src/api/models/strategy-account.d.ts +1 -1
  105. package/dist/src/api/models/strategy-account.js +1 -2
  106. package/dist/src/api/models/strategy.js +1 -2
  107. package/dist/src/api/models/sub-account.d.ts +1 -1
  108. package/dist/src/api/models/sub-account.js +1 -2
  109. package/dist/src/api/models/supplied.d.ts +1 -1
  110. package/dist/src/api/models/supplied.js +1 -2
  111. package/dist/src/api/models/tag.js +1 -2
  112. package/dist/src/api/models/tvl-history.js +1 -2
  113. package/dist/src/api/models/ultra-coin-info.js +1 -2
  114. package/dist/src/api/models/update-vault-strategies.d.ts +1 -1
  115. package/dist/src/api/models/update-vault-strategies.js +1 -2
  116. package/dist/src/api/models/vault-admin-changed-event.js +1 -2
  117. package/dist/src/api/models/vault-created-event.js +1 -2
  118. package/dist/src/api/models/vault-deposit-event.js +1 -2
  119. package/dist/src/api/models/vault-deposit-without-minting-shares-event.js +1 -2
  120. package/dist/src/api/models/vault-detail.d.ts +7 -7
  121. package/dist/src/api/models/vault-detail.js +1 -4
  122. package/dist/src/api/models/vault-fee-percentage-updated-event.js +1 -2
  123. package/dist/src/api/models/vault-info.js +1 -2
  124. package/dist/src/api/models/vault-max-tvl-updated-event.js +1 -2
  125. package/dist/src/api/models/vault-operator-changed-event.js +1 -2
  126. package/dist/src/api/models/vault-paused-status-updated-event.js +1 -2
  127. package/dist/src/api/models/vault-platform-fee-charged-event.js +1 -2
  128. package/dist/src/api/models/vault-protocol.js +1 -2
  129. package/dist/src/api/models/vault-rate-updated-event.js +1 -2
  130. package/dist/src/api/models/vault-slice.js +1 -2
  131. package/dist/src/api/models/vault-sub-account-updated-event.js +1 -2
  132. package/dist/src/api/models/vault-withdrawal-without-redeeming-shares-event.js +1 -2
  133. package/dist/src/api/models/vaults-stats.js +1 -2
  134. package/dist/src/api/models/yield-aggregate-value.js +1 -2
  135. package/dist/src/api/v2/api.d.ts +2 -2
  136. package/dist/src/api/v2/api.js +2 -18
  137. package/dist/src/api/v2/apis/accounts-api.d.ts +9 -9
  138. package/dist/src/api/v2/apis/accounts-api.js +56 -66
  139. package/dist/src/api/v2/apis/vaults-api.d.ts +20 -20
  140. package/dist/src/api/v2/apis/vaults-api.js +114 -124
  141. package/dist/src/api/v2/base.d.ts +1 -1
  142. package/dist/src/api/v2/base.js +7 -15
  143. package/dist/src/api/v2/common.d.ts +2 -2
  144. package/dist/src/api/v2/common.js +13 -25
  145. package/dist/src/api/v2/configuration.js +2 -6
  146. package/dist/src/api/v2/index.d.ts +3 -3
  147. package/dist/src/api/v2/index.js +3 -19
  148. package/dist/src/api/v2/models/account-transaction-transaction-data.d.ts +5 -5
  149. package/dist/src/api/v2/models/account-transaction-transaction-data.js +1 -2
  150. package/dist/src/api/v2/models/account-transaction.d.ts +1 -1
  151. package/dist/src/api/v2/models/account-transaction.js +1 -4
  152. package/dist/src/api/v2/models/account-vault-position-history.js +1 -4
  153. package/dist/src/api/v2/models/account-withdrawal-request.d.ts +2 -2
  154. package/dist/src/api/v2/models/account-withdrawal-request.js +1 -4
  155. package/dist/src/api/v2/models/aggregated-account-position-history.js +1 -4
  156. package/dist/src/api/v2/models/aggregated-proof-of-capital-report.d.ts +2 -2
  157. package/dist/src/api/v2/models/aggregated-proof-of-capital-report.js +1 -2
  158. package/dist/src/api/v2/models/apy-averages.d.ts +1 -1
  159. package/dist/src/api/v2/models/apy-averages.js +1 -2
  160. package/dist/src/api/v2/models/apy-history-response.d.ts +1 -1
  161. package/dist/src/api/v2/models/apy-history-response.js +1 -2
  162. package/dist/src/api/v2/models/apy-history.js +1 -2
  163. package/dist/src/api/v2/models/apy-period-average.js +1 -2
  164. package/dist/src/api/v2/models/asset.js +1 -2
  165. package/dist/src/api/v2/models/borrowed.d.ts +1 -1
  166. package/dist/src/api/v2/models/borrowed.js +1 -2
  167. package/dist/src/api/v2/models/chain-vault-details.d.ts +2 -2
  168. package/dist/src/api/v2/models/chain-vault-details.js +1 -2
  169. package/dist/src/api/v2/models/chain.d.ts +6 -0
  170. package/dist/src/api/v2/models/chain.js +1 -4
  171. package/dist/src/api/v2/models/coin-price.js +1 -2
  172. package/dist/src/api/v2/models/deposit-transaction.d.ts +2 -2
  173. package/dist/src/api/v2/models/deposit-transaction.js +1 -2
  174. package/dist/src/api/v2/models/ember-position.d.ts +1 -1
  175. package/dist/src/api/v2/models/ember-position.js +1 -2
  176. package/dist/src/api/v2/models/evm-contracts.d.ts +14 -5
  177. package/dist/src/api/v2/models/evm-contracts.js +1 -2
  178. package/dist/src/api/v2/models/evm-deposit-token.js +1 -2
  179. package/dist/src/api/v2/models/evm-oftadapter.d.ts +93 -0
  180. package/dist/src/api/v2/models/evm-oftadapter.js +14 -0
  181. package/dist/src/api/v2/models/evm-oftpeer.d.ts +48 -0
  182. package/dist/src/api/v2/models/evm-oftpeer.js +14 -0
  183. package/dist/src/api/v2/models/evm-price-feed.js +1 -2
  184. package/dist/src/api/v2/models/evm-protocol-config.d.ts +6 -0
  185. package/dist/src/api/v2/models/evm-protocol-config.js +1 -2
  186. package/dist/src/api/v2/models/evm-protocol-info.d.ts +1 -1
  187. package/dist/src/api/v2/models/evm-protocol-info.js +1 -2
  188. package/dist/src/api/v2/models/evm-receipt-token.js +1 -2
  189. package/dist/src/api/v2/models/evm-vault.d.ts +24 -0
  190. package/dist/src/api/v2/models/evm-vault.js +1 -2
  191. package/dist/src/api/v2/models/exposure-coin.d.ts +1 -1
  192. package/dist/src/api/v2/models/exposure-coin.js +1 -2
  193. package/dist/src/api/v2/models/exposure-protocol.d.ts +6 -6
  194. package/dist/src/api/v2/models/exposure-protocol.js +1 -2
  195. package/dist/src/api/v2/models/exposure.d.ts +2 -2
  196. package/dist/src/api/v2/models/exposure.js +1 -2
  197. package/dist/src/api/v2/models/fee.d.ts +1 -1
  198. package/dist/src/api/v2/models/fee.js +1 -2
  199. package/dist/src/api/v2/models/fees.js +1 -2
  200. package/dist/src/api/v2/models/history-interval.js +1 -4
  201. package/dist/src/api/v2/models/index.d.ts +102 -100
  202. package/dist/src/api/v2/models/index.js +102 -116
  203. package/dist/src/api/v2/models/lp.d.ts +3 -3
  204. package/dist/src/api/v2/models/lp.js +1 -2
  205. package/dist/src/api/v2/models/manager.js +1 -2
  206. package/dist/src/api/v2/models/min-withdrawal-shares-updated-event.js +1 -2
  207. package/dist/src/api/v2/models/perps.d.ts +1 -1
  208. package/dist/src/api/v2/models/perps.js +1 -2
  209. package/dist/src/api/v2/models/pnl-by-chain.js +1 -2
  210. package/dist/src/api/v2/models/pnl-history-interval.js +1 -4
  211. package/dist/src/api/v2/models/pnl-history.js +1 -2
  212. package/dist/src/api/v2/models/poc-report-asset.js +1 -2
  213. package/dist/src/api/v2/models/poc-report-assets.d.ts +1 -1
  214. package/dist/src/api/v2/models/poc-report-assets.js +1 -2
  215. package/dist/src/api/v2/models/poc-report-exchange.d.ts +1 -1
  216. package/dist/src/api/v2/models/poc-report-exchange.js +1 -2
  217. package/dist/src/api/v2/models/poc-report-exchanges.d.ts +1 -1
  218. package/dist/src/api/v2/models/poc-report-exchanges.js +1 -2
  219. package/dist/src/api/v2/models/poc-report-protocol.js +1 -2
  220. package/dist/src/api/v2/models/poc-report-token.js +1 -2
  221. package/dist/src/api/v2/models/poc-report-wallet.d.ts +2 -2
  222. package/dist/src/api/v2/models/poc-report-wallet.js +1 -2
  223. package/dist/src/api/v2/models/poc-report-wallets.d.ts +1 -1
  224. package/dist/src/api/v2/models/poc-report-wallets.js +1 -2
  225. package/dist/src/api/v2/models/position-history-interval.js +1 -4
  226. package/dist/src/api/v2/models/position-value.js +1 -4
  227. package/dist/src/api/v2/models/position.js +1 -2
  228. package/dist/src/api/v2/models/process-requests-summary-event.js +1 -2
  229. package/dist/src/api/v2/models/proof-of-capital-report-status.js +1 -4
  230. package/dist/src/api/v2/models/proof-of-capital-report.d.ts +4 -4
  231. package/dist/src/api/v2/models/proof-of-capital-report.js +1 -2
  232. package/dist/src/api/v2/models/protocol-fee-collected-event.js +1 -2
  233. package/dist/src/api/v2/models/protocol-pnl-history.js +1 -2
  234. package/dist/src/api/v2/models/protocol-tvl-history.js +1 -2
  235. package/dist/src/api/v2/models/protocol.js +1 -2
  236. package/dist/src/api/v2/models/raw-event-event-data.d.ts +17 -17
  237. package/dist/src/api/v2/models/raw-event-event-data.js +1 -2
  238. package/dist/src/api/v2/models/raw-event.d.ts +1 -1
  239. package/dist/src/api/v2/models/raw-event.js +1 -4
  240. package/dist/src/api/v2/models/redeem-request-cancelled-transaction.d.ts +2 -2
  241. package/dist/src/api/v2/models/redeem-request-cancelled-transaction.js +1 -2
  242. package/dist/src/api/v2/models/redeem-request-processed-transaction.d.ts +2 -2
  243. package/dist/src/api/v2/models/redeem-request-processed-transaction.js +1 -2
  244. package/dist/src/api/v2/models/redeem-request-skipped-transaction.d.ts +2 -2
  245. package/dist/src/api/v2/models/redeem-request-skipped-transaction.js +1 -2
  246. package/dist/src/api/v2/models/redeem-request-transaction.d.ts +2 -2
  247. package/dist/src/api/v2/models/redeem-request-transaction.js +1 -2
  248. package/dist/src/api/v2/models/reported-apy.js +1 -2
  249. package/dist/src/api/v2/models/request-processed-event.js +1 -2
  250. package/dist/src/api/v2/models/request-redeemed-event.js +1 -2
  251. package/dist/src/api/v2/models/reward-token.js +1 -2
  252. package/dist/src/api/v2/models/reward.d.ts +1 -1
  253. package/dist/src/api/v2/models/reward.js +1 -2
  254. package/dist/src/api/v2/models/share-price-history.js +1 -2
  255. package/dist/src/api/v2/models/strategy-account.d.ts +1 -1
  256. package/dist/src/api/v2/models/strategy-account.js +1 -2
  257. package/dist/src/api/v2/models/strategy.js +1 -2
  258. package/dist/src/api/v2/models/sub-account.d.ts +1 -1
  259. package/dist/src/api/v2/models/sub-account.js +1 -2
  260. package/dist/src/api/v2/models/sui-protocol-info.d.ts +3 -3
  261. package/dist/src/api/v2/models/sui-protocol-info.js +1 -2
  262. package/dist/src/api/v2/models/supplied.d.ts +1 -1
  263. package/dist/src/api/v2/models/supplied.js +1 -2
  264. package/dist/src/api/v2/models/tag.js +1 -2
  265. package/dist/src/api/v2/models/tvl-by-chain.js +1 -2
  266. package/dist/src/api/v2/models/tvl-history.d.ts +1 -1
  267. package/dist/src/api/v2/models/tvl-history.js +1 -2
  268. package/dist/src/api/v2/models/ultra-coin-info.js +1 -2
  269. package/dist/src/api/v2/models/update-vault-strategies.d.ts +1 -1
  270. package/dist/src/api/v2/models/update-vault-strategies.js +1 -2
  271. package/dist/src/api/v2/models/vault-admin-changed-event.js +1 -2
  272. package/dist/src/api/v2/models/vault-created-event.js +1 -2
  273. package/dist/src/api/v2/models/vault-deposit-eligibility.js +1 -2
  274. package/dist/src/api/v2/models/vault-deposit-event.js +1 -2
  275. package/dist/src/api/v2/models/vault-deposit-without-minting-shares-event.js +1 -2
  276. package/dist/src/api/v2/models/vault-detail.d.ts +8 -8
  277. package/dist/src/api/v2/models/vault-detail.js +1 -4
  278. package/dist/src/api/v2/models/vault-fee-percentage-updated-event.js +1 -2
  279. package/dist/src/api/v2/models/vault-info.js +1 -2
  280. package/dist/src/api/v2/models/vault-max-tvl-updated-event.js +1 -2
  281. package/dist/src/api/v2/models/vault-operator-changed-event.js +1 -2
  282. package/dist/src/api/v2/models/vault-paused-status-updated-event.js +1 -2
  283. package/dist/src/api/v2/models/vault-platform-fee-charged-event.js +1 -2
  284. package/dist/src/api/v2/models/vault-proof-of-capital-summary.d.ts +2 -2
  285. package/dist/src/api/v2/models/vault-proof-of-capital-summary.js +1 -2
  286. package/dist/src/api/v2/models/vault-protocol.js +1 -2
  287. package/dist/src/api/v2/models/vault-rate-updated-event.js +1 -2
  288. package/dist/src/api/v2/models/vault-slice.js +1 -2
  289. package/dist/src/api/v2/models/vault-sub-account-updated-event.js +1 -2
  290. package/dist/src/api/v2/models/vault-tag.js +1 -2
  291. package/dist/src/api/v2/models/vault-withdrawal-without-redeeming-shares-event.js +1 -2
  292. package/dist/src/api/v2/models/vaults-deployment-config-config.d.ts +2 -2
  293. package/dist/src/api/v2/models/vaults-deployment-config-config.js +1 -2
  294. package/dist/src/api/v2/models/vaults-deployment-config.d.ts +1 -1
  295. package/dist/src/api/v2/models/vaults-deployment-config.js +1 -4
  296. package/dist/src/api/v2/models/vaults-stats.js +1 -2
  297. package/dist/src/api/v2/models/yield-aggregate-value.js +1 -2
  298. package/dist/src/common/constants.d.ts +8 -0
  299. package/dist/src/common/constants.js +11 -0
  300. package/dist/src/common/types.js +1 -2
  301. package/dist/src/ember-vaults.d.ts +23 -24
  302. package/dist/src/ember-vaults.js +35 -49
  303. package/dist/src/evm-vaults/index.d.ts +15 -3
  304. package/dist/src/evm-vaults/index.js +21 -19
  305. package/dist/src/evm-vaults/interfaces/index.d.ts +92 -47
  306. package/dist/src/evm-vaults/interfaces/index.js +1 -2
  307. package/dist/src/evm-vaults/on-chain-calls/admin.d.ts +4 -4
  308. package/dist/src/evm-vaults/on-chain-calls/admin.js +2 -6
  309. package/dist/src/evm-vaults/on-chain-calls/index.d.ts +7 -7
  310. package/dist/src/evm-vaults/on-chain-calls/index.js +7 -23
  311. package/dist/src/evm-vaults/on-chain-calls/onchain-calls.d.ts +5 -5
  312. package/dist/src/evm-vaults/on-chain-calls/onchain-calls.js +9 -13
  313. package/dist/src/evm-vaults/on-chain-calls/operator.d.ts +4 -4
  314. package/dist/src/evm-vaults/on-chain-calls/operator.js +2 -6
  315. package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +24 -5
  316. package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +83 -41
  317. package/dist/src/evm-vaults/on-chain-calls/user.d.ts +20 -4
  318. package/dist/src/evm-vaults/on-chain-calls/user.js +61 -15
  319. package/dist/src/evm-vaults/on-chain-calls/vault-admin.d.ts +4 -4
  320. package/dist/src/evm-vaults/on-chain-calls/vault-admin.js +2 -6
  321. package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +39 -5
  322. package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +119 -20
  323. package/dist/src/evm-vaults/utils/deployment-parser.d.ts +14 -8
  324. package/dist/src/evm-vaults/utils/deployment-parser.js +22 -15
  325. package/dist/src/evm-vaults/utils/index.d.ts +2 -2
  326. package/dist/src/evm-vaults/utils/index.js +2 -18
  327. package/dist/src/evm-vaults/utils/permit-utils.d.ts +2 -2
  328. package/dist/src/evm-vaults/utils/permit-utils.js +12 -53
  329. package/dist/src/index.d.ts +3 -3
  330. package/dist/src/index.js +3 -19
  331. package/dist/src/sui-vaults/index.d.ts +4 -4
  332. package/dist/src/sui-vaults/index.js +4 -20
  333. package/dist/src/sui-vaults/interfaces/bcs.js +15 -18
  334. package/dist/src/sui-vaults/interfaces/index.js +1 -2
  335. package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +2 -2
  336. package/dist/src/sui-vaults/on-chain-calls/admin.js +13 -17
  337. package/dist/src/sui-vaults/on-chain-calls/index.d.ts +6 -6
  338. package/dist/src/sui-vaults/on-chain-calls/index.js +6 -22
  339. package/dist/src/sui-vaults/on-chain-calls/onchain-calls.d.ts +3 -3
  340. package/dist/src/sui-vaults/on-chain-calls/onchain-calls.js +8 -12
  341. package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +2 -2
  342. package/dist/src/sui-vaults/on-chain-calls/operator.js +15 -19
  343. package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +2 -2
  344. package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +46 -50
  345. package/dist/src/sui-vaults/on-chain-calls/user.d.ts +2 -2
  346. package/dist/src/sui-vaults/on-chain-calls/user.js +18 -22
  347. package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +2 -2
  348. package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +10 -14
  349. package/dist/src/sui-vaults/on-chain-calls/vault.d.ts +1 -1
  350. package/dist/src/sui-vaults/on-chain-calls/vault.js +41 -30
  351. package/dist/src/sui-vaults/utils/common.js +3 -7
  352. package/dist/src/sui-vaults/utils/deployment-parser.d.ts +1 -1
  353. package/dist/src/sui-vaults/utils/deployment-parser.js +1 -5
  354. package/dist/src/sui-vaults/utils/index.d.ts +2 -2
  355. package/dist/src/sui-vaults/utils/index.js +2 -18
  356. package/package.json +28 -14
@@ -1,15 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EVMVaultReader = void 0;
7
- const ethers_1 = require("ethers");
8
- const deployment_parser_1 = require("../utils/deployment-parser");
9
- const EmberVault_json_1 = __importDefault(require("../../abis/EmberVault.json"));
10
- const EmberETHVault_json_1 = __importDefault(require("../../abis/EmberETHVault.json"));
11
- const EmberProtocolConfig_json_1 = __importDefault(require("../../abis/EmberProtocolConfig.json"));
12
- const ERC20Token_json_1 = __importDefault(require("../../abis/ERC20Token.json"));
1
+ import { Contract, isAddress } from "ethers";
2
+ import { EVMDeploymentParser } from "../utils/deployment-parser.js";
3
+ import EmberVaultABI from "../../abis/EmberVault.json" with { type: "json" };
4
+ import EmberETHVaultABI from "../../abis/EmberETHVault.json" with { type: "json" };
5
+ import EmberProtocolConfigABI from "../../abis/EmberProtocolConfig.json" with { type: "json" };
6
+ import ERC20TokenABI from "../../abis/ERC20Token.json" with { type: "json" };
7
+ import EmberVaultOFTAdapterABI from "../../abis/EmberVaultMintBurnOFTAdapter.json" with { type: "json" };
8
+ import { Configuration, VaultsApi } from "../../api/v2/index.js";
9
+ import { environmentConfig } from "../../common/constants.js";
13
10
  /**
14
11
  * EVM Vault Reader - Read-only operations for Ember Vaults
15
12
  *
@@ -33,10 +30,12 @@ const ERC20Token_json_1 = __importDefault(require("../../abis/ERC20Token.json"))
33
30
  * console.log("Share Balance:", position.shareBalance);
34
31
  * ```
35
32
  */
36
- class EVMVaultReader {
37
- constructor(_deployment, _provider) {
38
- this.parser = new deployment_parser_1.EVMDeploymentParser(_deployment);
33
+ export class EVMVaultReader {
34
+ constructor(_deployment, _provider, options) {
35
+ this.parser = new EVMDeploymentParser(_deployment);
39
36
  this.provider = _provider;
37
+ const baseUrl = options?.apiBaseUrl || environmentConfig.prod.apiHost;
38
+ this.vaultsApi = new VaultsApi(new Configuration({ basePath: baseUrl }));
40
39
  }
41
40
  /**
42
41
  * Updates the deployment configuration
@@ -51,21 +50,21 @@ class EVMVaultReader {
51
50
  * @param isETHVault If true, uses EmberETHVault ABI (defaults to EmberVault ABI)
52
51
  */
53
52
  getVaultContract(vaultAddress, isETHVault) {
54
- const abi = isETHVault ? EmberETHVault_json_1.default.abi : EmberVault_json_1.default.abi;
55
- return new ethers_1.Contract(vaultAddress, abi, this.provider);
53
+ const abi = isETHVault ? EmberETHVaultABI.abi : EmberVaultABI.abi;
54
+ return new Contract(vaultAddress, abi, this.provider);
56
55
  }
57
56
  /**
58
57
  * Creates an ethers Contract instance for protocol config
59
58
  */
60
59
  getProtocolConfigContract() {
61
60
  const configAddress = this.parser.getProtocolConfigAddress();
62
- return new ethers_1.Contract(configAddress, EmberProtocolConfig_json_1.default.abi, this.provider);
61
+ return new Contract(configAddress, EmberProtocolConfigABI.abi, this.provider);
63
62
  }
64
63
  /**
65
64
  * Creates an ethers Contract instance for an ERC20 token
66
65
  */
67
66
  getERC20Contract(tokenAddress) {
68
- return new ethers_1.Contract(tokenAddress, ERC20Token_json_1.default.abi, this.provider);
67
+ return new Contract(tokenAddress, ERC20TokenABI.abi, this.provider);
69
68
  }
70
69
  // ========== Vault State Methods ==========
71
70
  /**
@@ -572,5 +571,105 @@ class EVMVaultReader {
572
571
  const addresses = this.getAllVaultAddresses();
573
572
  return this.getMultipleVaultsInfo(addresses);
574
573
  }
574
+ // ========== Bridge / OFT Methods ==========
575
+ getOFTAdapterAddressByVaultId(vaultId) {
576
+ const adapter = this.parser.getOFTAdapterObjectByVaultId(vaultId);
577
+ if (!adapter?.address) {
578
+ return null;
579
+ }
580
+ // Adapter address in generated models is optional, so validate before use.
581
+ if (!isAddress(adapter.address)) {
582
+ return null;
583
+ }
584
+ return adapter.address;
585
+ }
586
+ /**
587
+ * Creates an ethers Contract instance for an OFT adapter
588
+ */
589
+ getOFTAdapterContract(adapterAddress) {
590
+ return new Contract(adapterAddress, EmberVaultOFTAdapterABI.abi, this.provider);
591
+ }
592
+ /**
593
+ * Resolves and instantiates the OFT adapter contract for a vault identifier.
594
+ *
595
+ * @param vaultId Vault identifier (receipt token address on EVM)
596
+ * @returns OFT adapter contract instance, or null if no adapter is configured
597
+ */
598
+ getOFTAdapterByVaultId(vaultId) {
599
+ const adapterAddress = this.getOFTAdapterAddressByVaultId(vaultId);
600
+ if (!adapterAddress) {
601
+ return null;
602
+ }
603
+ return this.getOFTAdapterContract(adapterAddress);
604
+ }
605
+ /**
606
+ * Returns the list of destination chains that an OFT adapter has peers configured for.
607
+ *
608
+ * @param vaultId The vault identifier (receipt token address on EVM)
609
+ * @returns Destination chains enriched with OFT adapter and peer metadata
610
+ */
611
+ async getOFTSupportedChains(vaultId, supportedChains) {
612
+ const adapter = this.parser.getOFTAdapterObjectByVaultId(vaultId);
613
+ const adapterAddress = this.getOFTAdapterAddressByVaultId(vaultId);
614
+ if (!adapter || !adapterAddress) {
615
+ return [];
616
+ }
617
+ supportedChains =
618
+ supportedChains ?? (await this.vaultsApi.getSupportedChains()).data;
619
+ const chains = [];
620
+ Object.keys(adapter.peers ?? {}).forEach(key => {
621
+ const peer = adapter.peers?.[key];
622
+ const lzChainId = Number(key);
623
+ const chain = supportedChains.find(chain => chain.lzChainId === lzChainId);
624
+ if (!chain) {
625
+ return;
626
+ }
627
+ chains.push({
628
+ ...chain,
629
+ adapterAddress,
630
+ vaultId,
631
+ lzEndpointId: lzChainId,
632
+ chainIdentifier: chain.identifier,
633
+ peerAddress: peer.decodedAddress
634
+ });
635
+ });
636
+ return chains;
637
+ }
638
+ /**
639
+ * Gets a fee quote for bridging tokens to another chain via LayerZero OFT.
640
+ * Combines both the messaging fee (quoteSend) and the OFT transfer details
641
+ * (quoteOFT) into a single result.
642
+ *
643
+ * @param vaultId The vault identifier used to resolve the OFT adapter
644
+ * @param sendParam The bridge send parameters
645
+ * @param payInLzToken Whether to pay the fee in the LZ token (default false = pay in native)
646
+ * @returns Combined fee quote including native fee and expected amounts
647
+ */
648
+ async getOFTFeeQuote(vaultId, sendParam, payInLzToken = false) {
649
+ const adapter = this.getOFTAdapterByVaultId(vaultId);
650
+ if (!adapter) {
651
+ throw new Error(`OFT adapter not found for vault: ${vaultId}`);
652
+ }
653
+ const param = {
654
+ dstEid: sendParam.dstEid,
655
+ to: sendParam.to,
656
+ amountLD: sendParam.amountLD,
657
+ minAmountLD: sendParam.minAmountLD,
658
+ extraOptions: sendParam.extraOptions ?? "0x",
659
+ composeMsg: sendParam.composeMsg ?? "0x",
660
+ oftCmd: sendParam.oftCmd ?? "0x"
661
+ };
662
+ const [msgFee, oftQuote] = await Promise.all([
663
+ adapter.quoteSend(param, payInLzToken),
664
+ adapter.quoteOFT(param)
665
+ ]);
666
+ return {
667
+ nativeFee: msgFee.nativeFee,
668
+ lzTokenFee: msgFee.lzTokenFee,
669
+ amountSentLD: oftQuote.oftReceipt.amountSentLD,
670
+ amountReceivedLD: oftQuote.oftReceipt.amountReceivedLD,
671
+ minAmountLD: oftQuote.oftLimit.minAmountLD,
672
+ maxAmountLD: oftQuote.oftLimit.maxAmountLD
673
+ };
674
+ }
575
675
  }
576
- exports.EVMVaultReader = EVMVaultReader;
@@ -1,12 +1,13 @@
1
- import { IEvmDeployment } from "../interfaces";
1
+ import { EvmOFTAdapter } from "../../api/v2/index.js";
2
+ import { EvmProtocolInfo } from "../interfaces/index.js";
2
3
  export declare class EVMDeploymentParser {
3
- deployment: IEvmDeployment;
4
- constructor(_deployment: IEvmDeployment);
4
+ deployment: EvmProtocolInfo;
5
+ constructor(_deployment: EvmProtocolInfo);
5
6
  /**
6
7
  * Updates the deployment configuration
7
8
  * @param newDeployment The new deployment configuration
8
9
  */
9
- updateDeployment(newDeployment: IEvmDeployment): void;
10
+ updateDeployment(newDeployment: EvmProtocolInfo): void;
10
11
  /**
11
12
  * Gets the network name (e.g., "sepolia", "mainnet")
12
13
  */
@@ -18,15 +19,15 @@ export declare class EVMDeploymentParser {
18
19
  /**
19
20
  * Gets the protocol config proxy address
20
21
  */
21
- getProtocolConfigAddress(): string;
22
+ getProtocolConfigAddress(): string | undefined;
22
23
  /**
23
24
  * Gets the protocol config implementation address
24
25
  */
25
- getProtocolConfigImplementationAddress(): string;
26
+ getProtocolConfigImplementationAddress(): string | undefined;
26
27
  /**
27
28
  * Gets the protocol config owner address
28
29
  */
29
- getProtocolConfigOwner(): string;
30
+ getProtocolConfigOwner(): string | undefined;
30
31
  /**
31
32
  * Gets a receipt token address by its symbol
32
33
  * @param symbol The receipt token symbol (e.g., "eUSDC")
@@ -46,7 +47,7 @@ export declare class EVMDeploymentParser {
46
47
  * Gets vault info by its proxy address
47
48
  * @param vaultAddress The vault's proxy address
48
49
  */
49
- getVaultByAddress(vaultAddress: string): IEvmDeployment["contracts"]["vaults"][string];
50
+ getVaultByAddress(vaultAddress: string): EvmProtocolInfo["contracts"]["vaults"][string];
50
51
  /**
51
52
  * Gets the base token address for a vault
52
53
  * @param vaultAddress The vault's proxy address
@@ -94,4 +95,9 @@ export declare class EVMDeploymentParser {
94
95
  * Gets all receipt token symbols
95
96
  */
96
97
  getReceiptTokenSymbols(): string[];
98
+ /**
99
+ * Finds the OFT adapter entry for a given vault address.
100
+ * @param vaultAddress The vault address (receipt token address in EVM deployment data)
101
+ */
102
+ getOFTAdapterObjectByVaultId(vaultAddress: string): EvmOFTAdapter | undefined;
97
103
  }
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EVMDeploymentParser = void 0;
4
- class EVMDeploymentParser {
1
+ export class EVMDeploymentParser {
5
2
  constructor(_deployment) {
6
3
  this.deployment = _deployment;
7
4
  }
@@ -28,26 +25,26 @@ class EVMDeploymentParser {
28
25
  * Gets the protocol config proxy address
29
26
  */
30
27
  getProtocolConfigAddress() {
31
- return this.deployment.contracts.protocolConfig.proxyAddress;
28
+ return this.deployment.contracts?.protocolConfig.proxyAddress;
32
29
  }
33
30
  /**
34
31
  * Gets the protocol config implementation address
35
32
  */
36
33
  getProtocolConfigImplementationAddress() {
37
- return this.deployment.contracts.protocolConfig.implementationAddress;
34
+ return this.deployment.contracts?.protocolConfig.implementationAddress;
38
35
  }
39
36
  /**
40
37
  * Gets the protocol config owner address
41
38
  */
42
39
  getProtocolConfigOwner() {
43
- return this.deployment.contracts.protocolConfig.ownerAddress;
40
+ return this.deployment.contracts?.protocolConfig.ownerAddress;
44
41
  }
45
42
  /**
46
43
  * Gets a receipt token address by its symbol
47
44
  * @param symbol The receipt token symbol (e.g., "eUSDC")
48
45
  */
49
46
  getReceiptTokenAddress(symbol) {
50
- const receiptToken = this.deployment.contracts.receiptTokens[symbol];
47
+ const receiptToken = this.deployment.contracts?.receiptTokens[symbol];
51
48
  if (!receiptToken) {
52
49
  throw new Error(`Receipt token not found for symbol: ${symbol}`);
53
50
  }
@@ -58,7 +55,7 @@ class EVMDeploymentParser {
58
55
  * @param symbol The receipt token symbol (e.g., "eUSDC")
59
56
  */
60
57
  getReceiptTokenDecimals(symbol) {
61
- const receiptToken = this.deployment.contracts.receiptTokens[symbol];
58
+ const receiptToken = this.deployment.contracts?.receiptTokens[symbol];
62
59
  if (!receiptToken) {
63
60
  throw new Error(`Receipt token not found for symbol: ${symbol}`);
64
61
  }
@@ -69,7 +66,7 @@ class EVMDeploymentParser {
69
66
  * @param vaultKey The vault key (e.g., "emberUsdcVault")
70
67
  */
71
68
  getVaultAddress(vaultKey) {
72
- const vault = this.deployment.contracts.vaults[vaultKey];
69
+ const vault = this.deployment.contracts?.vaults[vaultKey];
73
70
  if (!vault) {
74
71
  throw new Error(`Vault not found for key: ${vaultKey}`);
75
72
  }
@@ -80,7 +77,7 @@ class EVMDeploymentParser {
80
77
  * @param vaultAddress The vault's proxy address
81
78
  */
82
79
  getVaultByAddress(vaultAddress) {
83
- const vault = Object.values(this.deployment.contracts.vaults).find(v => v.proxyAddress.toLowerCase() === vaultAddress.toLowerCase());
80
+ const vault = Object.values(this.deployment.contracts?.vaults ?? {}).find(v => v.proxyAddress.toLowerCase() === vaultAddress.toLowerCase());
84
81
  if (!vault) {
85
82
  throw new Error(`Vault not found for address: ${vaultAddress}`);
86
83
  }
@@ -146,19 +143,29 @@ class EVMDeploymentParser {
146
143
  * Gets all vault keys
147
144
  */
148
145
  getVaultKeys() {
149
- return Object.keys(this.deployment.contracts.vaults);
146
+ return Object.keys(this.deployment.contracts?.vaults ?? {});
150
147
  }
151
148
  /**
152
149
  * Gets all vault addresses
153
150
  */
154
151
  getVaultAddresses() {
155
- return Object.values(this.deployment.contracts.vaults).map(v => v.proxyAddress);
152
+ return Object.values(this.deployment.contracts?.vaults ?? {}).map(v => v.proxyAddress);
156
153
  }
157
154
  /**
158
155
  * Gets all receipt token symbols
159
156
  */
160
157
  getReceiptTokenSymbols() {
161
- return Object.keys(this.deployment.contracts.receiptTokens);
158
+ return Object.keys(this.deployment.contracts?.receiptTokens ?? {});
159
+ }
160
+ /**
161
+ * Finds the OFT adapter entry for a given vault address.
162
+ * @param vaultAddress The vault address (receipt token address in EVM deployment data)
163
+ */
164
+ getOFTAdapterObjectByVaultId(vaultAddress) {
165
+ const entry = Object.values(this.deployment.contracts?.oftAdapters ?? {}).find(adapter => adapter.vaultAddress?.toLowerCase() === vaultAddress.toLowerCase());
166
+ if (!entry) {
167
+ return undefined;
168
+ }
169
+ return entry;
162
170
  }
163
171
  }
164
- exports.EVMDeploymentParser = EVMDeploymentParser;
@@ -1,2 +1,2 @@
1
- export * from "./deployment-parser";
2
- export * from "./permit-utils";
1
+ export * from "./deployment-parser.js";
2
+ export * from "./permit-utils.js";
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./deployment-parser"), exports);
18
- __exportStar(require("./permit-utils"), exports);
1
+ export * from "./deployment-parser.js";
2
+ export * from "./permit-utils.js";
@@ -1,6 +1,6 @@
1
1
  import { Provider, Signer } from "ethers";
2
- import { IPermitSignature } from "../interfaces";
3
- import { NumStr } from "../../common/types";
2
+ import { IPermitSignature } from "../interfaces/index.js";
3
+ import { NumStr } from "../../common/types.js";
4
4
  /**
5
5
  * Signs an EIP-2612 permit message
6
6
  *
@@ -1,45 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.signPermit = signPermit;
37
- exports.getPermitVersion = getPermitVersion;
38
- exports.supportsEIP5267 = supportsEIP5267;
39
- exports.supportsERC2612 = supportsERC2612;
40
- exports.getPermitNonce = getPermitNonce;
41
- exports.signPermitSimple = signPermitSimple;
42
- const ethers_1 = require("ethers");
1
+ import { Contract, ZeroAddress } from "ethers";
43
2
  /**
44
3
  * Signs an EIP-2612 permit message
45
4
  *
@@ -80,7 +39,7 @@ const ethers_1 = require("ethers");
80
39
  * await userCalls.depositWithPermit(vaultAddress, amount, permitSig);
81
40
  * ```
82
41
  */
83
- async function signPermit(signer, tokenAddress, tokenName, spender, value, deadline, nonce, chainId, version) {
42
+ export async function signPermit(signer, tokenAddress, tokenName, spender, value, deadline, nonce, chainId, version) {
84
43
  const owner = await signer.getAddress();
85
44
  // If version not provided, fetch it from the token contract
86
45
  let permitVersion = version;
@@ -143,9 +102,9 @@ async function signPermit(signer, tokenAddress, tokenName, spender, value, deadl
143
102
  * const version = await getPermitVersion(tokenAddress, provider);
144
103
  * ```
145
104
  */
146
- async function getPermitVersion(tokenAddress, provider) {
105
+ export async function getPermitVersion(tokenAddress, provider) {
147
106
  try {
148
- const { Contract } = await Promise.resolve().then(() => __importStar(require("ethers")));
107
+ const { Contract } = await import("ethers");
149
108
  const tokenContract = new Contract(tokenAddress, ["function version() view returns (string)"], provider);
150
109
  return await tokenContract.version();
151
110
  }
@@ -177,9 +136,9 @@ async function getPermitVersion(tokenAddress, provider) {
177
136
  * }
178
137
  * ```
179
138
  */
180
- async function supportsEIP5267(tokenAddress, provider) {
139
+ export async function supportsEIP5267(tokenAddress, provider) {
181
140
  try {
182
- const { Contract } = await Promise.resolve().then(() => __importStar(require("ethers")));
141
+ const { Contract } = await import("ethers");
183
142
  const tokenContract = new Contract(tokenAddress, [
184
143
  "function eip712Domain() view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)"
185
144
  ], provider);
@@ -213,14 +172,14 @@ async function supportsEIP5267(tokenAddress, provider) {
213
172
  * }
214
173
  * ```
215
174
  */
216
- async function supportsERC2612(tokenAddress, provider) {
175
+ export async function supportsERC2612(tokenAddress, provider) {
217
176
  const abi = [
218
177
  "function nonces(address) view returns (uint256)",
219
178
  "function DOMAIN_SEPARATOR() view returns (bytes32)"
220
179
  ];
221
180
  try {
222
- const token = new ethers_1.Contract(tokenAddress, abi, provider);
223
- await token.nonces(ethers_1.ZeroAddress);
181
+ const token = new Contract(tokenAddress, abi, provider);
182
+ await token.nonces(ZeroAddress);
224
183
  await token.DOMAIN_SEPARATOR();
225
184
  return true;
226
185
  }
@@ -247,8 +206,8 @@ async function supportsERC2612(tokenAddress, provider) {
247
206
  * );
248
207
  * ```
249
208
  */
250
- async function getPermitNonce(tokenAddress, ownerAddress, provider) {
251
- const { Contract } = await Promise.resolve().then(() => __importStar(require("ethers")));
209
+ export async function getPermitNonce(tokenAddress, ownerAddress, provider) {
210
+ const { Contract } = await import("ethers");
252
211
  const tokenContract = new Contract(tokenAddress, ["function nonces(address owner) view returns (uint256)"], provider);
253
212
  return await tokenContract.nonces(ownerAddress);
254
213
  }
@@ -284,7 +243,7 @@ async function getPermitNonce(tokenAddress, ownerAddress, provider) {
284
243
  * await userCalls.depositWithPermit(vaultAddress, amount, permitSig);
285
244
  * ```
286
245
  */
287
- async function signPermitSimple(signer, tokenAddress, tokenName, spender, value) {
246
+ export async function signPermitSimple(signer, tokenAddress, tokenName, spender, value) {
288
247
  const provider = signer.provider;
289
248
  if (!provider) {
290
249
  throw new Error("Signer must be connected to a provider");
@@ -1,3 +1,3 @@
1
- export * from "./api";
2
- export * from "./sui-vaults";
3
- export * from "./ember-vaults";
1
+ export * from "./api/index.js";
2
+ export * from "./sui-vaults/index.js";
3
+ export * from "./ember-vaults.js";
package/dist/src/index.js CHANGED
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api"), exports);
18
- __exportStar(require("./sui-vaults"), exports);
19
- __exportStar(require("./ember-vaults"), exports);
1
+ export * from "./api/index.js";
2
+ export * from "./sui-vaults/index.js";
3
+ export * from "./ember-vaults.js";
@@ -1,4 +1,4 @@
1
- export * from "../ember-vaults";
2
- export * from "./interfaces";
3
- export * from "./on-chain-calls";
4
- export * from "./utils";
1
+ export * from "../ember-vaults.js";
2
+ export * from "./interfaces/index.js";
3
+ export * from "./on-chain-calls/index.js";
4
+ export * from "./utils/index.js";
@@ -1,20 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("../ember-vaults"), exports);
18
- __exportStar(require("./interfaces"), exports);
19
- __exportStar(require("./on-chain-calls"), exports);
20
- __exportStar(require("./utils"), exports);
1
+ export * from "../ember-vaults.js";
2
+ export * from "./interfaces/index.js";
3
+ export * from "./on-chain-calls/index.js";
4
+ export * from "./utils/index.js";
@@ -1,20 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BcsUpdateVaultStrategyRequest = void 0;
4
- const bcs_1 = require("@mysten/bcs");
5
- exports.BcsUpdateVaultStrategyRequest = bcs_1.bcs.struct("UpdateVaultStrategyRequest", {
6
- vaultId: bcs_1.bcs.string(),
7
- strategies: bcs_1.bcs.vector(bcs_1.bcs.struct("Strategy", {
8
- platformName: bcs_1.bcs.string(),
9
- strategistAddress: bcs_1.bcs.string(),
10
- strategyType: bcs_1.bcs.string(),
11
- allocationE9: bcs_1.bcs.string(),
12
- apyE9: bcs_1.bcs.string(),
13
- pointsApyE9: bcs_1.bcs.string(),
14
- snapshotAt: bcs_1.bcs.u64()
1
+ import { bcs } from "@mysten/bcs";
2
+ export const BcsUpdateVaultStrategyRequest = bcs.struct("UpdateVaultStrategyRequest", {
3
+ vaultId: bcs.string(),
4
+ strategies: bcs.vector(bcs.struct("Strategy", {
5
+ platformName: bcs.string(),
6
+ strategistAddress: bcs.string(),
7
+ strategyType: bcs.string(),
8
+ allocationE9: bcs.string(),
9
+ apyE9: bcs.string(),
10
+ pointsApyE9: bcs.string(),
11
+ snapshotAt: bcs.u64()
15
12
  })),
16
- targetApyE9: bcs_1.bcs.string(),
17
- supplyApyE9: bcs_1.bcs.string(),
18
- reportedApyE9: bcs_1.bcs.string(),
19
- signedAt: bcs_1.bcs.u64()
13
+ targetApyE9: bcs.string(),
14
+ supplyApyE9: bcs.string(),
15
+ reportedApyE9: bcs.string(),
16
+ signedAt: bcs.u64()
20
17
  });
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { OnChainCalls } from "./onchain-calls";
2
- import { ISuiDeployment, IVaultOptionalParams } from "../interfaces";
1
+ import { OnChainCalls } from "./onchain-calls.js";
2
+ import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
3
3
  import { OnChainCallResponse, Signer, SuiAddress, SuiClient, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
4
4
  import { NumStr } from "@firefly-exchange/library-sui";
5
5
  export declare class AdminCalls extends OnChainCalls {