aftermath-ts-sdk 1.3.29 → 2.0.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 (410) hide show
  1. package/dist/index.d.ts +16828 -5
  2. package/dist/index.js +22695 -19
  3. package/dist/index.js.map +1 -0
  4. package/package.json +69 -60
  5. package/dist/general/apiHelpers/dynamicFieldsApiHelpers.d.ts +0 -41
  6. package/dist/general/apiHelpers/dynamicFieldsApiHelpers.d.ts.map +0 -1
  7. package/dist/general/apiHelpers/dynamicFieldsApiHelpers.js +0 -110
  8. package/dist/general/apiHelpers/eventsApiHelpers.d.ts +0 -43
  9. package/dist/general/apiHelpers/eventsApiHelpers.d.ts.map +0 -1
  10. package/dist/general/apiHelpers/eventsApiHelpers.js +0 -170
  11. package/dist/general/apiHelpers/inspectionsApiHelpers.d.ts +0 -28
  12. package/dist/general/apiHelpers/inspectionsApiHelpers.d.ts.map +0 -1
  13. package/dist/general/apiHelpers/inspectionsApiHelpers.js +0 -58
  14. package/dist/general/apiHelpers/objectsApiHelpers.d.ts +0 -77
  15. package/dist/general/apiHelpers/objectsApiHelpers.d.ts.map +0 -1
  16. package/dist/general/apiHelpers/objectsApiHelpers.js +0 -197
  17. package/dist/general/apiHelpers/transactionsApiHelpers.d.ts +0 -50
  18. package/dist/general/apiHelpers/transactionsApiHelpers.d.ts.map +0 -1
  19. package/dist/general/apiHelpers/transactionsApiHelpers.js +0 -256
  20. package/dist/general/dynamicGas/dynamicGas.d.ts +0 -48
  21. package/dist/general/dynamicGas/dynamicGas.d.ts.map +0 -1
  22. package/dist/general/dynamicGas/dynamicGas.js +0 -69
  23. package/dist/general/dynamicGas/dynamicGasTypes.d.ts +0 -37
  24. package/dist/general/dynamicGas/dynamicGasTypes.d.ts.map +0 -1
  25. package/dist/general/dynamicGas/dynamicGasTypes.js +0 -2
  26. package/dist/general/nfts/nftsApi.d.ts +0 -35
  27. package/dist/general/nfts/nftsApi.d.ts.map +0 -1
  28. package/dist/general/nfts/nftsApi.js +0 -124
  29. package/dist/general/nfts/nftsApiCasting.d.ts +0 -11
  30. package/dist/general/nfts/nftsApiCasting.d.ts.map +0 -1
  31. package/dist/general/nfts/nftsApiCasting.js +0 -115
  32. package/dist/general/nfts/nftsTypes.d.ts +0 -31
  33. package/dist/general/nfts/nftsTypes.d.ts.map +0 -1
  34. package/dist/general/nfts/nftsTypes.js +0 -2
  35. package/dist/general/priceFeeds/priceFeeds.d.ts +0 -3
  36. package/dist/general/priceFeeds/priceFeeds.d.ts.map +0 -1
  37. package/dist/general/priceFeeds/priceFeeds.js +0 -26
  38. package/dist/general/priceFeeds/priceFeedsApi.d.ts +0 -3
  39. package/dist/general/priceFeeds/priceFeedsApi.d.ts.map +0 -1
  40. package/dist/general/priceFeeds/priceFeedsApi.js +0 -33
  41. package/dist/general/priceFeeds/priceFeedsTypes.d.ts +0 -3
  42. package/dist/general/priceFeeds/priceFeedsTypes.d.ts.map +0 -1
  43. package/dist/general/priceFeeds/priceFeedsTypes.js +0 -7
  44. package/dist/general/prices/coinGeckoTypes.d.ts +0 -16
  45. package/dist/general/prices/coinGeckoTypes.d.ts.map +0 -1
  46. package/dist/general/prices/coinGeckoTypes.js +0 -2
  47. package/dist/general/prices/prices.d.ts +0 -92
  48. package/dist/general/prices/prices.d.ts.map +0 -1
  49. package/dist/general/prices/prices.js +0 -124
  50. package/dist/general/providers/aftermath.d.ts +0 -200
  51. package/dist/general/providers/aftermath.d.ts.map +0 -1
  52. package/dist/general/providers/aftermath.js +0 -258
  53. package/dist/general/providers/aftermathApi.d.ts +0 -197
  54. package/dist/general/providers/aftermathApi.d.ts.map +0 -1
  55. package/dist/general/providers/aftermathApi.js +0 -255
  56. package/dist/general/providers/index.d.ts +0 -3
  57. package/dist/general/providers/index.d.ts.map +0 -1
  58. package/dist/general/providers/index.js +0 -18
  59. package/dist/general/types/castingTypes.d.ts +0 -51
  60. package/dist/general/types/castingTypes.d.ts.map +0 -1
  61. package/dist/general/types/castingTypes.js +0 -8
  62. package/dist/general/types/configTypes.d.ts +0 -187
  63. package/dist/general/types/configTypes.d.ts.map +0 -1
  64. package/dist/general/types/configTypes.js +0 -2
  65. package/dist/general/types/generalTypes.d.ts +0 -349
  66. package/dist/general/types/generalTypes.d.ts.map +0 -1
  67. package/dist/general/types/generalTypes.js +0 -2
  68. package/dist/general/types/index.d.ts +0 -7
  69. package/dist/general/types/index.d.ts.map +0 -1
  70. package/dist/general/types/index.js +0 -22
  71. package/dist/general/types/moveErrorsInterface.d.ts +0 -6
  72. package/dist/general/types/moveErrorsInterface.d.ts.map +0 -1
  73. package/dist/general/types/moveErrorsInterface.js +0 -2
  74. package/dist/general/types/suiTypes.d.ts +0 -2
  75. package/dist/general/types/suiTypes.d.ts.map +0 -1
  76. package/dist/general/types/suiTypes.js +0 -5
  77. package/dist/general/utils/caller.d.ts +0 -58
  78. package/dist/general/utils/caller.d.ts.map +0 -1
  79. package/dist/general/utils/caller.js +0 -231
  80. package/dist/general/utils/casting.d.ts +0 -212
  81. package/dist/general/utils/casting.d.ts.map +0 -1
  82. package/dist/general/utils/casting.js +0 -273
  83. package/dist/general/utils/fixedUtils.d.ts +0 -109
  84. package/dist/general/utils/fixedUtils.d.ts.map +0 -1
  85. package/dist/general/utils/fixedUtils.js +0 -100
  86. package/dist/general/utils/helpers.d.ts +0 -408
  87. package/dist/general/utils/helpers.d.ts.map +0 -1
  88. package/dist/general/utils/helpers.js +0 -725
  89. package/dist/general/utils/iFixedUtils.d.ts +0 -78
  90. package/dist/general/utils/iFixedUtils.d.ts.map +0 -1
  91. package/dist/general/utils/iFixedUtils.js +0 -109
  92. package/dist/general/utils/index.d.ts +0 -3
  93. package/dist/general/utils/index.d.ts.map +0 -1
  94. package/dist/general/utils/index.js +0 -18
  95. package/dist/general/wallet/wallet.d.ts +0 -89
  96. package/dist/general/wallet/wallet.d.ts.map +0 -1
  97. package/dist/general/wallet/wallet.js +0 -120
  98. package/dist/general/wallet/walletApi.d.ts +0 -20
  99. package/dist/general/wallet/walletApi.d.ts.map +0 -1
  100. package/dist/general/wallet/walletApi.js +0 -66
  101. package/dist/index.d.ts.map +0 -1
  102. package/dist/packages/auth/auth.d.ts +0 -135
  103. package/dist/packages/auth/auth.d.ts.map +0 -1
  104. package/dist/packages/auth/auth.js +0 -289
  105. package/dist/packages/auth/authTypes.d.ts +0 -102
  106. package/dist/packages/auth/authTypes.d.ts.map +0 -1
  107. package/dist/packages/auth/authTypes.js +0 -2
  108. package/dist/packages/auth/index.d.ts +0 -2
  109. package/dist/packages/auth/index.d.ts.map +0 -1
  110. package/dist/packages/auth/index.js +0 -17
  111. package/dist/packages/coin/api/coinApi.d.ts +0 -33
  112. package/dist/packages/coin/api/coinApi.d.ts.map +0 -1
  113. package/dist/packages/coin/api/coinApi.js +0 -167
  114. package/dist/packages/coin/coin.d.ts +0 -320
  115. package/dist/packages/coin/coin.d.ts.map +0 -1
  116. package/dist/packages/coin/coin.js +0 -467
  117. package/dist/packages/coin/coinTypes.d.ts +0 -139
  118. package/dist/packages/coin/coinTypes.d.ts.map +0 -1
  119. package/dist/packages/coin/coinTypes.js +0 -2
  120. package/dist/packages/coin/index.d.ts +0 -2
  121. package/dist/packages/coin/index.d.ts.map +0 -1
  122. package/dist/packages/coin/index.js +0 -17
  123. package/dist/packages/dca/api/dcaApi.d.ts +0 -26
  124. package/dist/packages/dca/api/dcaApi.d.ts.map +0 -1
  125. package/dist/packages/dca/api/dcaApi.js +0 -60
  126. package/dist/packages/dca/dca.d.ts +0 -174
  127. package/dist/packages/dca/dca.d.ts.map +0 -1
  128. package/dist/packages/dca/dca.js +0 -230
  129. package/dist/packages/dca/dcaTypes.d.ts +0 -319
  130. package/dist/packages/dca/dcaTypes.d.ts.map +0 -1
  131. package/dist/packages/dca/dcaTypes.js +0 -2
  132. package/dist/packages/dca/index.d.ts +0 -2
  133. package/dist/packages/dca/index.d.ts.map +0 -1
  134. package/dist/packages/dca/index.js +0 -17
  135. package/dist/packages/farms/api/farmsApi.d.ts +0 -996
  136. package/dist/packages/farms/api/farmsApi.d.ts.map +0 -1
  137. package/dist/packages/farms/api/farmsApi.js +0 -1826
  138. package/dist/packages/farms/api/farmsApiCasting.d.ts +0 -39
  139. package/dist/packages/farms/api/farmsApiCasting.d.ts.map +0 -1
  140. package/dist/packages/farms/api/farmsApiCasting.js +0 -427
  141. package/dist/packages/farms/api/farmsApiCastingTypes.d.ts +0 -235
  142. package/dist/packages/farms/api/farmsApiCastingTypes.d.ts.map +0 -1
  143. package/dist/packages/farms/api/farmsApiCastingTypes.js +0 -2
  144. package/dist/packages/farms/farms.d.ts +0 -221
  145. package/dist/packages/farms/farms.d.ts.map +0 -1
  146. package/dist/packages/farms/farms.js +0 -302
  147. package/dist/packages/farms/farmsStakedPosition.d.ts +0 -229
  148. package/dist/packages/farms/farmsStakedPosition.d.ts.map +0 -1
  149. package/dist/packages/farms/farmsStakedPosition.js +0 -473
  150. package/dist/packages/farms/farmsStakingPool.d.ts +0 -285
  151. package/dist/packages/farms/farmsStakingPool.d.ts.map +0 -1
  152. package/dist/packages/farms/farmsStakingPool.js +0 -488
  153. package/dist/packages/farms/farmsTypes.d.ts +0 -571
  154. package/dist/packages/farms/farmsTypes.d.ts.map +0 -1
  155. package/dist/packages/farms/farmsTypes.js +0 -49
  156. package/dist/packages/farms/index.d.ts +0 -4
  157. package/dist/packages/farms/index.d.ts.map +0 -1
  158. package/dist/packages/farms/index.js +0 -19
  159. package/dist/packages/faucet/api/faucetApi.d.ts +0 -37
  160. package/dist/packages/faucet/api/faucetApi.d.ts.map +0 -1
  161. package/dist/packages/faucet/api/faucetApi.js +0 -145
  162. package/dist/packages/faucet/api/faucetApiCasting.d.ts +0 -7
  163. package/dist/packages/faucet/api/faucetApiCasting.d.ts.map +0 -1
  164. package/dist/packages/faucet/api/faucetApiCasting.js +0 -33
  165. package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts +0 -10
  166. package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts.map +0 -1
  167. package/dist/packages/faucet/api/faucetApiCastingTypes.js +0 -2
  168. package/dist/packages/faucet/faucet.d.ts +0 -16
  169. package/dist/packages/faucet/faucet.d.ts.map +0 -1
  170. package/dist/packages/faucet/faucet.js +0 -64
  171. package/dist/packages/faucet/faucetTypes.d.ts +0 -20
  172. package/dist/packages/faucet/faucetTypes.d.ts.map +0 -1
  173. package/dist/packages/faucet/faucetTypes.js +0 -2
  174. package/dist/packages/faucet/index.d.ts +0 -2
  175. package/dist/packages/faucet/index.d.ts.map +0 -1
  176. package/dist/packages/faucet/index.js +0 -17
  177. package/dist/packages/index.d.ts +0 -14
  178. package/dist/packages/index.d.ts.map +0 -1
  179. package/dist/packages/index.js +0 -29
  180. package/dist/packages/leveragedStaking/api/leveragedStakingApi.d.ts +0 -202
  181. package/dist/packages/leveragedStaking/api/leveragedStakingApi.d.ts.map +0 -1
  182. package/dist/packages/leveragedStaking/api/leveragedStakingApi.js +0 -1104
  183. package/dist/packages/leveragedStaking/api/leveragedStakingApiCasting.d.ts +0 -12
  184. package/dist/packages/leveragedStaking/api/leveragedStakingApiCasting.d.ts.map +0 -1
  185. package/dist/packages/leveragedStaking/api/leveragedStakingApiCasting.js +0 -69
  186. package/dist/packages/leveragedStaking/api/leveragedStakingApiCastingTypes.d.ts +0 -39
  187. package/dist/packages/leveragedStaking/api/leveragedStakingApiCastingTypes.d.ts.map +0 -1
  188. package/dist/packages/leveragedStaking/api/leveragedStakingApiCastingTypes.js +0 -2
  189. package/dist/packages/leveragedStaking/index.d.ts +0 -2
  190. package/dist/packages/leveragedStaking/index.d.ts.map +0 -1
  191. package/dist/packages/leveragedStaking/index.js +0 -17
  192. package/dist/packages/leveragedStaking/leveragedStaking.d.ts +0 -68
  193. package/dist/packages/leveragedStaking/leveragedStaking.d.ts.map +0 -1
  194. package/dist/packages/leveragedStaking/leveragedStaking.js +0 -154
  195. package/dist/packages/leveragedStaking/leveragedStakingTypes.d.ts +0 -48
  196. package/dist/packages/leveragedStaking/leveragedStakingTypes.d.ts.map +0 -1
  197. package/dist/packages/leveragedStaking/leveragedStakingTypes.js +0 -16
  198. package/dist/packages/limitOrders/api/limitOrdersApi.d.ts +0 -12
  199. package/dist/packages/limitOrders/api/limitOrdersApi.d.ts.map +0 -1
  200. package/dist/packages/limitOrders/api/limitOrdersApi.js +0 -25
  201. package/dist/packages/limitOrders/index.d.ts +0 -2
  202. package/dist/packages/limitOrders/index.d.ts.map +0 -1
  203. package/dist/packages/limitOrders/index.js +0 -17
  204. package/dist/packages/limitOrders/limitOrders.d.ts +0 -143
  205. package/dist/packages/limitOrders/limitOrders.d.ts.map +0 -1
  206. package/dist/packages/limitOrders/limitOrders.js +0 -190
  207. package/dist/packages/limitOrders/limitOrdersTypes.d.ts +0 -211
  208. package/dist/packages/limitOrders/limitOrdersTypes.d.ts.map +0 -1
  209. package/dist/packages/limitOrders/limitOrdersTypes.js +0 -2
  210. package/dist/packages/multisig/api/multisigApi.d.ts +0 -10
  211. package/dist/packages/multisig/api/multisigApi.d.ts.map +0 -1
  212. package/dist/packages/multisig/api/multisigApi.js +0 -39
  213. package/dist/packages/multisig/index.d.ts +0 -2
  214. package/dist/packages/multisig/index.d.ts.map +0 -1
  215. package/dist/packages/multisig/index.js +0 -17
  216. package/dist/packages/multisig/multisig.d.ts +0 -46
  217. package/dist/packages/multisig/multisig.d.ts.map +0 -1
  218. package/dist/packages/multisig/multisig.js +0 -65
  219. package/dist/packages/multisig/multisigTypes.d.ts +0 -26
  220. package/dist/packages/multisig/multisigTypes.d.ts.map +0 -1
  221. package/dist/packages/multisig/multisigTypes.js +0 -2
  222. package/dist/packages/nftAmm/api/nftAmmApi.d.ts +0 -93
  223. package/dist/packages/nftAmm/api/nftAmmApi.d.ts.map +0 -1
  224. package/dist/packages/nftAmm/api/nftAmmApi.js +0 -250
  225. package/dist/packages/nftAmm/api/nftAmmApiCasting.d.ts +0 -6
  226. package/dist/packages/nftAmm/api/nftAmmApiCasting.d.ts.map +0 -1
  227. package/dist/packages/nftAmm/api/nftAmmApiCasting.js +0 -43
  228. package/dist/packages/nftAmm/api/nftAmmApiCastingTypes.d.ts +0 -10
  229. package/dist/packages/nftAmm/api/nftAmmApiCastingTypes.d.ts.map +0 -1
  230. package/dist/packages/nftAmm/api/nftAmmApiCastingTypes.js +0 -2
  231. package/dist/packages/nftAmm/index.d.ts +0 -2
  232. package/dist/packages/nftAmm/index.d.ts.map +0 -1
  233. package/dist/packages/nftAmm/index.js +0 -17
  234. package/dist/packages/nftAmm/nftAmm.d.ts +0 -18
  235. package/dist/packages/nftAmm/nftAmm.d.ts.map +0 -1
  236. package/dist/packages/nftAmm/nftAmm.js +0 -73
  237. package/dist/packages/nftAmm/nftAmmMarket.d.ts +0 -54
  238. package/dist/packages/nftAmm/nftAmmMarket.d.ts.map +0 -1
  239. package/dist/packages/nftAmm/nftAmmMarket.js +0 -154
  240. package/dist/packages/nftAmm/nftAmmTypes.d.ts +0 -51
  241. package/dist/packages/nftAmm/nftAmmTypes.d.ts.map +0 -1
  242. package/dist/packages/nftAmm/nftAmmTypes.js +0 -2
  243. package/dist/packages/perpetuals/api/perpetualsApi.d.ts +0 -44
  244. package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +0 -1
  245. package/dist/packages/perpetuals/api/perpetualsApi.js +0 -1420
  246. package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts +0 -27
  247. package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts.map +0 -1
  248. package/dist/packages/perpetuals/api/perpetualsApiCasting.js +0 -463
  249. package/dist/packages/perpetuals/index.d.ts +0 -5
  250. package/dist/packages/perpetuals/index.d.ts.map +0 -1
  251. package/dist/packages/perpetuals/index.js +0 -20
  252. package/dist/packages/perpetuals/perpetuals.d.ts +0 -860
  253. package/dist/packages/perpetuals/perpetuals.d.ts.map +0 -1
  254. package/dist/packages/perpetuals/perpetuals.js +0 -1102
  255. package/dist/packages/perpetuals/perpetualsAccount.d.ts +0 -780
  256. package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +0 -1
  257. package/dist/packages/perpetuals/perpetualsAccount.js +0 -1406
  258. package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts +0 -170
  259. package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts.map +0 -1
  260. package/dist/packages/perpetuals/perpetualsCastingTypes.js +0 -2
  261. package/dist/packages/perpetuals/perpetualsMarket.d.ts +0 -360
  262. package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +0 -1
  263. package/dist/packages/perpetuals/perpetualsMarket.js +0 -475
  264. package/dist/packages/perpetuals/perpetualsTypes.d.ts +0 -2976
  265. package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +0 -1
  266. package/dist/packages/perpetuals/perpetualsTypes.js +0 -165
  267. package/dist/packages/perpetuals/perpetualsVault.d.ts +0 -438
  268. package/dist/packages/perpetuals/perpetualsVault.d.ts.map +0 -1
  269. package/dist/packages/perpetuals/perpetualsVault.js +0 -601
  270. package/dist/packages/perpetuals/utils/index.d.ts +0 -2
  271. package/dist/packages/perpetuals/utils/index.d.ts.map +0 -1
  272. package/dist/packages/perpetuals/utils/index.js +0 -17
  273. package/dist/packages/perpetuals/utils/perpetualsOrderUtils.d.ts +0 -12
  274. package/dist/packages/perpetuals/utils/perpetualsOrderUtils.d.ts.map +0 -1
  275. package/dist/packages/perpetuals/utils/perpetualsOrderUtils.js +0 -60
  276. package/dist/packages/pools/api/poolsApi.d.ts +0 -342
  277. package/dist/packages/pools/api/poolsApi.d.ts.map +0 -1
  278. package/dist/packages/pools/api/poolsApi.js +0 -857
  279. package/dist/packages/pools/api/poolsApiCasting.d.ts +0 -13
  280. package/dist/packages/pools/api/poolsApiCasting.d.ts.map +0 -1
  281. package/dist/packages/pools/api/poolsApiCasting.js +0 -91
  282. package/dist/packages/pools/api/poolsApiCastingTypes.d.ts +0 -64
  283. package/dist/packages/pools/api/poolsApiCastingTypes.d.ts.map +0 -1
  284. package/dist/packages/pools/api/poolsApiCastingTypes.js +0 -2
  285. package/dist/packages/pools/index.d.ts +0 -3
  286. package/dist/packages/pools/index.d.ts.map +0 -1
  287. package/dist/packages/pools/index.js +0 -18
  288. package/dist/packages/pools/pool.d.ts +0 -459
  289. package/dist/packages/pools/pool.d.ts.map +0 -1
  290. package/dist/packages/pools/pool.js +0 -647
  291. package/dist/packages/pools/pools.d.ts +0 -405
  292. package/dist/packages/pools/pools.d.ts.map +0 -1
  293. package/dist/packages/pools/pools.js +0 -533
  294. package/dist/packages/pools/poolsTypes.d.ts +0 -469
  295. package/dist/packages/pools/poolsTypes.d.ts.map +0 -1
  296. package/dist/packages/pools/poolsTypes.js +0 -2
  297. package/dist/packages/pools/utils/cmmmCalculations.d.ts +0 -42
  298. package/dist/packages/pools/utils/cmmmCalculations.d.ts.map +0 -1
  299. package/dist/packages/pools/utils/cmmmCalculations.js +0 -1380
  300. package/dist/packages/referralVault/api/referralVaultApi.d.ts +0 -39
  301. package/dist/packages/referralVault/api/referralVaultApi.d.ts.map +0 -1
  302. package/dist/packages/referralVault/api/referralVaultApi.js +0 -125
  303. package/dist/packages/referralVault/index.d.ts +0 -2
  304. package/dist/packages/referralVault/index.d.ts.map +0 -1
  305. package/dist/packages/referralVault/index.js +0 -17
  306. package/dist/packages/referralVault/referralVault.d.ts +0 -47
  307. package/dist/packages/referralVault/referralVault.d.ts.map +0 -1
  308. package/dist/packages/referralVault/referralVault.js +0 -71
  309. package/dist/packages/referralVault/referralVaultTypes.d.ts +0 -2
  310. package/dist/packages/referralVault/referralVaultTypes.d.ts.map +0 -1
  311. package/dist/packages/referralVault/referralVaultTypes.js +0 -2
  312. package/dist/packages/referrals/index.d.ts +0 -2
  313. package/dist/packages/referrals/index.d.ts.map +0 -1
  314. package/dist/packages/referrals/index.js +0 -17
  315. package/dist/packages/referrals/referrals.d.ts +0 -27
  316. package/dist/packages/referrals/referrals.d.ts.map +0 -1
  317. package/dist/packages/referrals/referrals.js +0 -95
  318. package/dist/packages/referrals/referralsTypes.d.ts +0 -166
  319. package/dist/packages/referrals/referralsTypes.d.ts.map +0 -1
  320. package/dist/packages/referrals/referralsTypes.js +0 -2
  321. package/dist/packages/rewards/index.d.ts +0 -2
  322. package/dist/packages/rewards/index.d.ts.map +0 -1
  323. package/dist/packages/rewards/index.js +0 -17
  324. package/dist/packages/rewards/rewards.d.ts +0 -21
  325. package/dist/packages/rewards/rewards.d.ts.map +0 -1
  326. package/dist/packages/rewards/rewards.js +0 -65
  327. package/dist/packages/rewards/rewardsTypes.d.ts +0 -169
  328. package/dist/packages/rewards/rewardsTypes.d.ts.map +0 -1
  329. package/dist/packages/rewards/rewardsTypes.js +0 -2
  330. package/dist/packages/router/api/routerApi.d.ts +0 -35
  331. package/dist/packages/router/api/routerApi.d.ts.map +0 -1
  332. package/dist/packages/router/api/routerApi.js +0 -88
  333. package/dist/packages/router/api/routerApiCasting.d.ts +0 -6
  334. package/dist/packages/router/api/routerApiCasting.d.ts.map +0 -1
  335. package/dist/packages/router/api/routerApiCasting.js +0 -22
  336. package/dist/packages/router/api/routerApiCastingTypes.d.ts +0 -12
  337. package/dist/packages/router/api/routerApiCastingTypes.d.ts.map +0 -1
  338. package/dist/packages/router/api/routerApiCastingTypes.js +0 -2
  339. package/dist/packages/router/index.d.ts +0 -2
  340. package/dist/packages/router/index.d.ts.map +0 -1
  341. package/dist/packages/router/index.js +0 -17
  342. package/dist/packages/router/router.d.ts +0 -224
  343. package/dist/packages/router/router.d.ts.map +0 -1
  344. package/dist/packages/router/router.js +0 -283
  345. package/dist/packages/router/routerTypes.d.ts +0 -300
  346. package/dist/packages/router/routerTypes.d.ts.map +0 -1
  347. package/dist/packages/router/routerTypes.js +0 -2
  348. package/dist/packages/staking/api/stakingApi.d.ts +0 -129
  349. package/dist/packages/staking/api/stakingApi.d.ts.map +0 -1
  350. package/dist/packages/staking/api/stakingApi.js +0 -487
  351. package/dist/packages/staking/api/stakingApiCasting.d.ts +0 -11
  352. package/dist/packages/staking/api/stakingApiCasting.d.ts.map +0 -1
  353. package/dist/packages/staking/api/stakingApiCasting.js +0 -87
  354. package/dist/packages/staking/api/stakingApiCastingTypes.d.ts +0 -97
  355. package/dist/packages/staking/api/stakingApiCastingTypes.d.ts.map +0 -1
  356. package/dist/packages/staking/api/stakingApiCastingTypes.js +0 -2
  357. package/dist/packages/staking/index.d.ts +0 -2
  358. package/dist/packages/staking/index.d.ts.map +0 -1
  359. package/dist/packages/staking/index.js +0 -17
  360. package/dist/packages/staking/staking.d.ts +0 -385
  361. package/dist/packages/staking/staking.d.ts.map +0 -1
  362. package/dist/packages/staking/staking.js +0 -501
  363. package/dist/packages/staking/stakingTypes.d.ts +0 -575
  364. package/dist/packages/staking/stakingTypes.d.ts.map +0 -1
  365. package/dist/packages/staking/stakingTypes.js +0 -45
  366. package/dist/packages/sui/api/suiApi.d.ts +0 -21
  367. package/dist/packages/sui/api/suiApi.d.ts.map +0 -1
  368. package/dist/packages/sui/api/suiApi.js +0 -46
  369. package/dist/packages/sui/index.d.ts +0 -2
  370. package/dist/packages/sui/index.d.ts.map +0 -1
  371. package/dist/packages/sui/index.js +0 -17
  372. package/dist/packages/sui/sui.d.ts +0 -53
  373. package/dist/packages/sui/sui.d.ts.map +0 -1
  374. package/dist/packages/sui/sui.js +0 -77
  375. package/dist/packages/suiFrens/api/suiFrensApi.d.ts +0 -204
  376. package/dist/packages/suiFrens/api/suiFrensApi.d.ts.map +0 -1
  377. package/dist/packages/suiFrens/api/suiFrensApi.js +0 -756
  378. package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts +0 -21
  379. package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts.map +0 -1
  380. package/dist/packages/suiFrens/api/suiFrensApiCasting.js +0 -181
  381. package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts +0 -77
  382. package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts.map +0 -1
  383. package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.js +0 -2
  384. package/dist/packages/suiFrens/index.d.ts +0 -4
  385. package/dist/packages/suiFrens/index.d.ts.map +0 -1
  386. package/dist/packages/suiFrens/index.js +0 -19
  387. package/dist/packages/suiFrens/stakedSuiFren.d.ts +0 -31
  388. package/dist/packages/suiFrens/stakedSuiFren.d.ts.map +0 -1
  389. package/dist/packages/suiFrens/stakedSuiFren.js +0 -90
  390. package/dist/packages/suiFrens/suiFren.d.ts +0 -32
  391. package/dist/packages/suiFrens/suiFren.d.ts.map +0 -1
  392. package/dist/packages/suiFrens/suiFren.js +0 -150
  393. package/dist/packages/suiFrens/suiFrens.d.ts +0 -56
  394. package/dist/packages/suiFrens/suiFrens.d.ts.map +0 -1
  395. package/dist/packages/suiFrens/suiFrens.js +0 -218
  396. package/dist/packages/suiFrens/suiFrensTypes.d.ts +0 -148
  397. package/dist/packages/suiFrens/suiFrensTypes.d.ts.map +0 -1
  398. package/dist/packages/suiFrens/suiFrensTypes.js +0 -8
  399. package/dist/packages/userData/index.d.ts +0 -2
  400. package/dist/packages/userData/index.d.ts.map +0 -1
  401. package/dist/packages/userData/index.js +0 -17
  402. package/dist/packages/userData/userData.d.ts +0 -89
  403. package/dist/packages/userData/userData.d.ts.map +0 -1
  404. package/dist/packages/userData/userData.js +0 -119
  405. package/dist/packages/userData/userDataTypes.d.ts +0 -29
  406. package/dist/packages/userData/userDataTypes.d.ts.map +0 -1
  407. package/dist/packages/userData/userDataTypes.js +0 -2
  408. package/dist/types.d.ts +0 -15
  409. package/dist/types.d.ts.map +0 -1
  410. package/dist/types.js +0 -31
@@ -1,78 +0,0 @@
1
- import { Byte, IFixed } from "../types";
2
- /**
3
- * The `IFixedUtils` class provides support for signed 18-decimal fixed math,
4
- * referred to as "IFixed" in the Aftermath codebase. An `IFixed` value
5
- * is a bigint that includes sign bit manipulation.
6
- */
7
- export declare class IFixedUtils {
8
- /**
9
- * The representation of 1.0 in the IFixed format, i.e. 1e18.
10
- */
11
- static readonly ONE: IFixed;
12
- /**
13
- * The greatest bit in a 256-bit representation. This is used to indicate negative values in some approaches.
14
- */
15
- static readonly GREATEST_BIT: IFixed;
16
- /**
17
- * A mask that can be used to flip or remove the greatest bit in a 256-bit number.
18
- */
19
- static readonly NOT_GREATEST_BIT: IFixed;
20
- /**
21
- * Converts an IFixed bigint into a floating-point number, extracting both the integer
22
- * and decimal portions. For negative values, the sign bit is checked and value is negated.
23
- *
24
- * @param value - The IFixed value (signed 18-decimal) as a bigint.
25
- * @returns A standard JavaScript number with fractional parts intact.
26
- */
27
- static numberFromIFixed: (value: IFixed) => number;
28
- /**
29
- * Converts a floating-point number into an IFixed bigint with 18 decimals of precision.
30
- * Negative numbers have the sign bit set.
31
- *
32
- * @param value - The JavaScript number to convert.
33
- * @returns The resulting IFixed bigint in on-chain-compatible format.
34
- */
35
- static iFixedFromNumber: (value: number) => IFixed;
36
- /**
37
- * Returns the absolute value of an IFixed number. If the value is negative,
38
- * it's converted to its positive counterpart by flipping bits.
39
- *
40
- * @param value - The signed IFixed number as a bigint.
41
- * @returns The absolute value in IFixed.
42
- */
43
- static abs: (value: IFixed) => IFixed;
44
- /**
45
- * Determines the sign of an IFixed number.
46
- * - If >= GREATEST_BIT, it's negative (-1).
47
- * - If exactly 0, sign is 0.
48
- * - Otherwise, sign is +1.
49
- *
50
- * @param value - The IFixed number to check.
51
- * @returns `-1`, `0`, or `1` based on the sign.
52
- */
53
- static sign: (value: IFixed) => number;
54
- /**
55
- * Negates an IFixed number by flipping bits. This effectively does `-value` for the signed 18-dec representation.
56
- *
57
- * @param value - The IFixed number to negate.
58
- * @returns The negated IFixed number as a bigint.
59
- */
60
- static neg: (value: IFixed) => IFixed;
61
- /**
62
- * Constructs an IFixed number from an array of bytes in little-endian format.
63
- * The sign bit might be set if the top bit is `1`.
64
- *
65
- * @param bytes - The byte array representing the IFixed number.
66
- * @returns The IFixed bigint.
67
- */
68
- static iFixedFromBytes: (bytes: Byte[]) => IFixed;
69
- /**
70
- * Constructs an IFixed number from an array of stringified bytes,
71
- * each representing a decimal numeric value (e.g., `"255"`, `"0"`).
72
- *
73
- * @param bytes - An array of string bytes.
74
- * @returns The IFixed bigint.
75
- */
76
- static iFixedFromStringBytes: (bytes: string[]) => IFixed;
77
- }
78
- //# sourceMappingURL=iFixedUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iFixedUtils.d.ts","sourceRoot":"","sources":["../../../src/general/utils/iFixedUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGxC;;;;GAIG;AACH,qBAAa,WAAW;IACvB;;OAEG;IACH,gBAAuB,GAAG,EAAE,MAAM,CAAqC;IAEvE;;OAEG;IACH,gBAAuB,YAAY,EAAE,MAAM,CAA4B;IAEvE;;OAEG;IACH,gBAAuB,gBAAgB,EAAE,MAAM,CACP;IAExC;;;;;;OAMG;IACH,OAAc,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAAM,CAKtD;IAEF;;;;;;OAMG;IACH,OAAc,gBAAgB,GAAI,OAAO,MAAM,KAAG,MAAM,CAItD;IAEF;;;;;;OAMG;IACH,OAAc,GAAG,GAAI,OAAO,MAAM,KAAG,MAAM,CAGzC;IAEF;;;;;;;;OAQG;IACH,OAAc,IAAI,GAAI,OAAO,MAAM,KAAG,MAAM,CAI1C;IAEF;;;;;OAKG;IACH,OAAc,GAAG,GAAI,OAAO,MAAM,KAAG,MAAM,CAIzC;IAEF;;;;;;OAMG;IACH,OAAc,eAAe,GAAI,OAAO,IAAI,EAAE,KAAG,MAAM,CAErD;IAEF;;;;;;OAMG;IACH,OAAc,qBAAqB,GAAI,OAAO,MAAM,EAAE,KAAG,MAAM,CAE7D;CACF"}
@@ -1,109 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.IFixedUtils = void 0;
5
- const casting_1 = require("./casting");
6
- /**
7
- * The `IFixedUtils` class provides support for signed 18-decimal fixed math,
8
- * referred to as "IFixed" in the Aftermath codebase. An `IFixed` value
9
- * is a bigint that includes sign bit manipulation.
10
- */
11
- class IFixedUtils {
12
- }
13
- exports.IFixedUtils = IFixedUtils;
14
- _a = IFixedUtils;
15
- /**
16
- * The representation of 1.0 in the IFixed format, i.e. 1e18.
17
- */
18
- IFixedUtils.ONE = BigInt(1000000000000000000);
19
- /**
20
- * The greatest bit in a 256-bit representation. This is used to indicate negative values in some approaches.
21
- */
22
- IFixedUtils.GREATEST_BIT = BigInt(1) << BigInt(255);
23
- /**
24
- * A mask that can be used to flip or remove the greatest bit in a 256-bit number.
25
- */
26
- IFixedUtils.NOT_GREATEST_BIT = (BigInt(1) << BigInt(255)) - BigInt(1);
27
- /**
28
- * Converts an IFixed bigint into a floating-point number, extracting both the integer
29
- * and decimal portions. For negative values, the sign bit is checked and value is negated.
30
- *
31
- * @param value - The IFixed value (signed 18-decimal) as a bigint.
32
- * @returns A standard JavaScript number with fractional parts intact.
33
- */
34
- IFixedUtils.numberFromIFixed = (value) => {
35
- const absVal = _a.abs(value);
36
- const integerPart = Number(absVal / _a.ONE);
37
- const decimalPart = Number(absVal % _a.ONE) / Number(_a.ONE);
38
- return _a.sign(value) * (integerPart + decimalPart);
39
- };
40
- /**
41
- * Converts a floating-point number into an IFixed bigint with 18 decimals of precision.
42
- * Negative numbers have the sign bit set.
43
- *
44
- * @param value - The JavaScript number to convert.
45
- * @returns The resulting IFixed bigint in on-chain-compatible format.
46
- */
47
- IFixedUtils.iFixedFromNumber = (value) => {
48
- const newValue = BigInt(Math.floor(Math.abs(value) * Number(_a.ONE)));
49
- if (value < 0)
50
- return _a.neg(newValue);
51
- return newValue;
52
- };
53
- /**
54
- * Returns the absolute value of an IFixed number. If the value is negative,
55
- * it's converted to its positive counterpart by flipping bits.
56
- *
57
- * @param value - The signed IFixed number as a bigint.
58
- * @returns The absolute value in IFixed.
59
- */
60
- IFixedUtils.abs = (value) => {
61
- if (value >= _a.GREATEST_BIT)
62
- return _a.neg(value);
63
- return value;
64
- };
65
- /**
66
- * Determines the sign of an IFixed number.
67
- * - If >= GREATEST_BIT, it's negative (-1).
68
- * - If exactly 0, sign is 0.
69
- * - Otherwise, sign is +1.
70
- *
71
- * @param value - The IFixed number to check.
72
- * @returns `-1`, `0`, or `1` based on the sign.
73
- */
74
- IFixedUtils.sign = (value) => {
75
- if (value >= _a.GREATEST_BIT)
76
- return -1;
77
- if (value === BigInt(0))
78
- return 0;
79
- return 1;
80
- };
81
- /**
82
- * Negates an IFixed number by flipping bits. This effectively does `-value` for the signed 18-dec representation.
83
- *
84
- * @param value - The IFixed number to negate.
85
- * @returns The negated IFixed number as a bigint.
86
- */
87
- IFixedUtils.neg = (value) => {
88
- return (((value ^ _a.NOT_GREATEST_BIT) + BigInt(1)) ^ _a.GREATEST_BIT);
89
- };
90
- /**
91
- * Constructs an IFixed number from an array of bytes in little-endian format.
92
- * The sign bit might be set if the top bit is `1`.
93
- *
94
- * @param bytes - The byte array representing the IFixed number.
95
- * @returns The IFixed bigint.
96
- */
97
- IFixedUtils.iFixedFromBytes = (bytes) => {
98
- return casting_1.Casting.bigIntFromBytes(bytes);
99
- };
100
- /**
101
- * Constructs an IFixed number from an array of stringified bytes,
102
- * each representing a decimal numeric value (e.g., `"255"`, `"0"`).
103
- *
104
- * @param bytes - An array of string bytes.
105
- * @returns The IFixed bigint.
106
- */
107
- IFixedUtils.iFixedFromStringBytes = (bytes) => {
108
- return _a.iFixedFromBytes(casting_1.Casting.bytesFromStringBytes(bytes));
109
- };
@@ -1,3 +0,0 @@
1
- export * from "./casting";
2
- export * from "./helpers";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/general/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -1,18 +0,0 @@
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("./casting"), exports);
18
- __exportStar(require("./helpers"), exports);
@@ -1,89 +0,0 @@
1
- import { ApiTransactionsBody, Balance, CallerConfig, SuiAddress, TransactionsWithCursor } from "../types/generalTypes";
2
- import { CoinType, CoinsToBalance } from "../../packages/coin/coinTypes";
3
- import { Caller } from "../utils/caller";
4
- import { AftermathApi } from "../providers";
5
- /**
6
- * The `Wallet` class allows querying a user's balances and transactions.
7
- * It handles fetching coin balances, transactions, and more by leveraging
8
- * an `AftermathApi.Wallet` provider.
9
- */
10
- export declare class Wallet extends Caller {
11
- readonly address: SuiAddress;
12
- readonly Provider?: AftermathApi | undefined;
13
- /**
14
- * Creates a new `Wallet` instance for a specific address.
15
- *
16
- * @param address - The Sui address for this wallet (e.g., "0x<address>").
17
- * @param config - An optional caller configuration including network and authentication.
18
- * @param Provider - An optional `AftermathApi` instance for wallet-specific methods.
19
- */
20
- constructor(address: SuiAddress, config?: CallerConfig, Provider?: AftermathApi | undefined);
21
- /**
22
- * Fetches the balance for a single coin type in this wallet.
23
- *
24
- * @param inputs - An object containing the `coin` type to look up (e.g., "0x2::sui::SUI").
25
- * @returns A promise that resolves to the coin balance as a bigint.
26
- *
27
- * @example
28
- * ```typescript
29
- *
30
- * const afSdk = new Aftermath("MAINNET");
31
- * await afSdk.init(); // initialize provider
32
- *
33
- * const wallet = afSdk.Wallet("0x<address>");
34
- *
35
- * const suiBalance = await wallet.getBalance({ coin: "0x2::sui::SUI" });
36
- * console.log("SUI Balance:", suiBalance.toString());
37
- * ```
38
- */
39
- getBalance(inputs: {
40
- coin: CoinType;
41
- }): Promise<Balance>;
42
- /**
43
- * Fetches the balances for multiple specified coin types in this wallet.
44
- * This method currently returns an array of balances in the same order
45
- * as the requested coins.
46
- *
47
- * @param inputs - An object containing an array of `coins` (coin types).
48
- * @returns A promise resolving to an array of `Balance`s, each matching the corresponding coin in `inputs.coins`.
49
- *
50
- * @example
51
- * ```typescript
52
- * const wallet = new Wallet("0x<address>");
53
- * const balances = await wallet.getBalances({ coins: ["0x2::sui::SUI", "0x<...>"] });
54
- * console.log(balances); // e.g. [1000000000n, 50000000000n]
55
- * ```
56
- */
57
- getBalances(inputs: {
58
- coins: CoinType[];
59
- }): Promise<Balance[]>;
60
- /**
61
- * Fetches all coin balances held by this wallet address, returning a record
62
- * keyed by coin type.
63
- *
64
- * @returns A promise resolving to an object mapping coin types to balances (bigints).
65
- *
66
- * @example
67
- * ```typescript
68
- * const wallet = new Wallet("0x<address>");
69
- * const allBalances = await wallet.getAllBalances();
70
- * console.log(allBalances); // { "0x2::sui::SUI": 1000000000n, "0x<other_coin>": 5000000000n, ... }
71
- * ```
72
- */
73
- getAllBalances(): Promise<CoinsToBalance>;
74
- /**
75
- * Fetches a paginated list of past transactions for this wallet address.
76
- *
77
- * @param inputs - An object implementing `ApiTransactionsBody`, which includes pagination parameters (`cursor`, `limit`) and an optional `order` or other fields.
78
- * @returns A promise that resolves to transaction details, including a cursor if more results exist.
79
- *
80
- * @example
81
- * ```typescript
82
- * const wallet = new Wallet("0x<address>");
83
- * const txHistory = await wallet.getPastTransactions({ cursor: "abc123", limit: 10 });
84
- * console.log(txHistory.transactions, txHistory.nextCursor);
85
- * ```
86
- */
87
- getPastTransactions(inputs: ApiTransactionsBody): Promise<TransactionsWithCursor>;
88
- }
89
- //# sourceMappingURL=wallet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/general/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,MAAM;aAShB,OAAO,EAAE,UAAU;aAEnB,QAAQ,CAAC,EAAE,YAAY;IAVxC;;;;;;OAMG;gBAEc,OAAO,EAAE,UAAU,EACnC,MAAM,CAAC,EAAE,YAAY,EACL,QAAQ,CAAC,EAAE,YAAY,YAAA;IASxC;;;;;;;;;;;;;;;;;OAiBG;IACU,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrE;;;;;;;;;;;;;;OAcG;IACU,WAAW,CAAC,MAAM,EAAE;QAChC,KAAK,EAAE,QAAQ,EAAE,CAAC;KAClB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAOtB;;;;;;;;;;;;OAYG;IACU,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC;IAUtD;;;;;;;;;;;;OAYG;IACU,mBAAmB,CAC/B,MAAM,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC;CAMlC"}
@@ -1,120 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Wallet = void 0;
13
- const caller_1 = require("../utils/caller");
14
- /**
15
- * The `Wallet` class allows querying a user's balances and transactions.
16
- * It handles fetching coin balances, transactions, and more by leveraging
17
- * an `AftermathApi.Wallet` provider.
18
- */
19
- class Wallet extends caller_1.Caller {
20
- /**
21
- * Creates a new `Wallet` instance for a specific address.
22
- *
23
- * @param address - The Sui address for this wallet (e.g., "0x<address>").
24
- * @param config - An optional caller configuration including network and authentication.
25
- * @param Provider - An optional `AftermathApi` instance for wallet-specific methods.
26
- */
27
- constructor(address, config, Provider) {
28
- super(config, `wallet`);
29
- this.address = address;
30
- this.Provider = Provider;
31
- }
32
- // =========================================================================
33
- // Balances
34
- // =========================================================================
35
- /**
36
- * Fetches the balance for a single coin type in this wallet.
37
- *
38
- * @param inputs - An object containing the `coin` type to look up (e.g., "0x2::sui::SUI").
39
- * @returns A promise that resolves to the coin balance as a bigint.
40
- *
41
- * @example
42
- * ```typescript
43
- *
44
- * const afSdk = new Aftermath("MAINNET");
45
- * await afSdk.init(); // initialize provider
46
- *
47
- * const wallet = afSdk.Wallet("0x<address>");
48
- *
49
- * const suiBalance = await wallet.getBalance({ coin: "0x2::sui::SUI" });
50
- * console.log("SUI Balance:", suiBalance.toString());
51
- * ```
52
- */
53
- getBalance(inputs) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- return (yield this.getBalances({ coins: [inputs.coin] }))[0];
56
- });
57
- }
58
- /**
59
- * Fetches the balances for multiple specified coin types in this wallet.
60
- * This method currently returns an array of balances in the same order
61
- * as the requested coins.
62
- *
63
- * @param inputs - An object containing an array of `coins` (coin types).
64
- * @returns A promise resolving to an array of `Balance`s, each matching the corresponding coin in `inputs.coins`.
65
- *
66
- * @example
67
- * ```typescript
68
- * const wallet = new Wallet("0x<address>");
69
- * const balances = await wallet.getBalances({ coins: ["0x2::sui::SUI", "0x<...>"] });
70
- * console.log(balances); // e.g. [1000000000n, 50000000000n]
71
- * ```
72
- */
73
- getBalances(inputs) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- return this.fetchApi(`coin-balances`, Object.assign(Object.assign({}, inputs), { walletAddress: this.address }));
76
- });
77
- }
78
- /**
79
- * Fetches all coin balances held by this wallet address, returning a record
80
- * keyed by coin type.
81
- *
82
- * @returns A promise resolving to an object mapping coin types to balances (bigints).
83
- *
84
- * @example
85
- * ```typescript
86
- * const wallet = new Wallet("0x<address>");
87
- * const allBalances = await wallet.getAllBalances();
88
- * console.log(allBalances); // { "0x2::sui::SUI": 1000000000n, "0x<other_coin>": 5000000000n, ... }
89
- * ```
90
- */
91
- getAllBalances() {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- return this.fetchApi(`all-coin-balances`, {
94
- walletAddress: this.address,
95
- });
96
- });
97
- }
98
- // =========================================================================
99
- // Transactions
100
- // =========================================================================
101
- /**
102
- * Fetches a paginated list of past transactions for this wallet address.
103
- *
104
- * @param inputs - An object implementing `ApiTransactionsBody`, which includes pagination parameters (`cursor`, `limit`) and an optional `order` or other fields.
105
- * @returns A promise that resolves to transaction details, including a cursor if more results exist.
106
- *
107
- * @example
108
- * ```typescript
109
- * const wallet = new Wallet("0x<address>");
110
- * const txHistory = await wallet.getPastTransactions({ cursor: "abc123", limit: 10 });
111
- * console.log(txHistory.transactions, txHistory.nextCursor);
112
- * ```
113
- */
114
- getPastTransactions(inputs) {
115
- return __awaiter(this, void 0, void 0, function* () {
116
- return this.fetchApi(`past-transactions`, Object.assign(Object.assign({}, inputs), { walletAddress: this.address }));
117
- });
118
- }
119
- }
120
- exports.Wallet = Wallet;
@@ -1,20 +0,0 @@
1
- import { AftermathApi } from "../providers/aftermathApi";
2
- import { CoinType, CoinsToBalance } from "../../packages/coin/coinTypes";
3
- import { SuiAddress, TransactionDigest } from "../types";
4
- export declare class WalletApi {
5
- private readonly Provider;
6
- constructor(Provider: AftermathApi);
7
- fetchCoinBalance: (inputs: {
8
- walletAddress: SuiAddress;
9
- coin: CoinType;
10
- }) => Promise<bigint>;
11
- fetchAllCoinBalances: (inputs: {
12
- walletAddress: SuiAddress;
13
- }) => Promise<CoinsToBalance>;
14
- fetchPastTransactions: (inputs: {
15
- walletAddress: SuiAddress;
16
- cursor?: TransactionDigest;
17
- limit?: number;
18
- }) => Promise<import("../types").TransactionsWithCursor>;
19
- }
20
- //# sourceMappingURL=walletApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"walletApi.d.ts","sourceRoot":"","sources":["../../../src/general/wallet/walletApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEzD,qBAAa,SAAS;IAKT,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAU5C,gBAAgB,GAAU,QAAQ;QACxC,aAAa,EAAE,UAAU,CAAC;QAC1B,IAAI,EAAE,QAAQ,CAAC;KACf,qBAOC;IAIK,oBAAoB,GAAU,QAAQ;QAC5C,aAAa,EAAE,UAAU,CAAC;KAC1B,KAAG,OAAO,CAAC,cAAc,CAAC,CAoBzB;IAQK,qBAAqB,GAAU,QAAQ;QAC7C,aAAa,EAAE,UAAU,CAAC;QAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;KACf,wDAeC;CACF"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.WalletApi = void 0;
13
- const helpers_1 = require("../utils/helpers");
14
- class WalletApi {
15
- // =========================================================================
16
- // Constructor
17
- // =========================================================================
18
- constructor(Provider) {
19
- this.Provider = Provider;
20
- // =========================================================================
21
- // Fetching
22
- // =========================================================================
23
- // =========================================================================
24
- // Coins
25
- // =========================================================================
26
- this.fetchCoinBalance = (inputs) => __awaiter(this, void 0, void 0, function* () {
27
- const { walletAddress, coin } = inputs;
28
- const coinBalance = yield this.Provider.provider.getBalance({
29
- owner: walletAddress,
30
- coinType: helpers_1.Helpers.stripLeadingZeroesFromType(coin),
31
- });
32
- return BigInt(coinBalance.totalBalance);
33
- });
34
- // TODO: make toBigIntSafe function ?
35
- // TODO: return prices here as well and sort ?
36
- this.fetchAllCoinBalances = (inputs) => __awaiter(this, void 0, void 0, function* () {
37
- const { walletAddress } = inputs;
38
- const allBalances = yield this.Provider.provider.getAllBalances({
39
- owner: walletAddress,
40
- });
41
- const coinsToBalance = allBalances.reduce((acc, balance) => {
42
- return Object.assign(Object.assign({}, acc), { [helpers_1.Helpers.addLeadingZeroesToType(balance.coinType)]: BigInt(balance.totalBalance) });
43
- }, {});
44
- return coinsToBalance;
45
- });
46
- // =========================================================================
47
- // Transactions
48
- // =========================================================================
49
- // TODO: make this only look at aftermath relevant addresses in to address
50
- // TODO: restrict all filtering for events, etc. similarly using updated sdk filters
51
- this.fetchPastTransactions = (inputs) => __awaiter(this, void 0, void 0, function* () {
52
- const { walletAddress, cursor, limit } = inputs;
53
- const transactionsWithCursor = yield this.Provider.Transactions().fetchTransactionsWithCursor({
54
- query: {
55
- filter: {
56
- FromAddress: walletAddress,
57
- },
58
- },
59
- cursor,
60
- limit,
61
- });
62
- return transactionsWithCursor;
63
- });
64
- }
65
- }
66
- exports.WalletApi = WalletApi;
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
@@ -1,135 +0,0 @@
1
- import { CallerConfig, SignMessageCallback, SuiAddress } from "../../types";
2
- import { Caller } from "../../general/utils/caller";
3
- import { RateLimit } from "./authTypes";
4
- /**
5
- * The `Auth` class manages creation and refreshing of access tokens
6
- * to obtain higher rate limits on the Aftermath API. It includes methods
7
- * to initialize authorization either by a direct callback-based approach
8
- * or by importing a local Sui keystore. Optionally, administrative functions
9
- * are provided for creating specialized auth accounts.
10
- *
11
- * @example
12
- * ```typescript
13
- * const auth = new Auth();
14
- * const stopAuth = await auth.init({
15
- * walletAddress: "0x<address>",
16
- * signMessageCallback: async ({ message }) => {
17
- * // sign message
18
- * },
19
- * });
20
- * // ... make authenticated requests ...
21
- * stopAuth(); // stop auto refresh
22
- * ```
23
- */
24
- export declare class Auth extends Caller {
25
- /**
26
- * Holds the timer reference for scheduled token refreshes.
27
- */
28
- private refreshTimer;
29
- /**
30
- * Indicates whether the user has canceled auto token refresh.
31
- */
32
- private isCanceled;
33
- /**
34
- * Creates a new `Auth` instance for token-based rate limit increases.
35
- *
36
- * @param config - Optional caller configuration, including network and access token.
37
- */
38
- constructor(config?: CallerConfig);
39
- /**
40
- * Initializes the auth system by fetching an access token for the provided wallet address.
41
- * After obtaining the token, it automatically schedules periodic refresh calls until stopped.
42
- *
43
- * @param inputs - An object containing the user's `walletAddress` and a `signMessageCallback` function
44
- * for cryptographically signing messages.
45
- *
46
- * @returns A function that, when called, cancels further token refresh attempts.
47
- *
48
- * @example
49
- * ```typescript
50
- * const auth = new Auth();
51
- * const stopAuth = await auth.init({
52
- * walletAddress: "0x<address>",
53
- * signMessageCallback: async ({ message }) => {
54
- * // sign the message with your private key / keypair
55
- * },
56
- * });
57
- *
58
- * // ... make authorized calls ...
59
- *
60
- * stopAuth(); // Cancel further token refreshes
61
- * ```
62
- */
63
- init(inputs: {
64
- walletAddress: SuiAddress;
65
- signMessageCallback: SignMessageCallback;
66
- }): Promise<() => void>;
67
- /**
68
- * Initializes the auth system by reading a local Sui keystore file (on the server side),
69
- * using the private keys matching a provided address to sign messages for token creation.
70
- * After the token is obtained, it automatically schedules periodic refresh calls until stopped.
71
- *
72
- * @param inputs - An object containing the target `walletAddress` and an optional path to the `.keystore`.
73
- * If `path` is not provided, it defaults to `~/.sui/sui_config/sui.keystore`.
74
- * @returns A function that, when called, cancels further token refresh attempts.
75
- *
76
- * @throws If this method is called in a browser environment (client-side).
77
- *
78
- * @example
79
- * ```typescript
80
- * // On server:
81
- * const stopAuth = await auth.initFromSuiKeystore({
82
- * walletAddress: "0x<address>",
83
- * path: "/custom/path/to/keystore.json",
84
- * });
85
- * // authorized calls...
86
- * stopAuth();
87
- * ```
88
- */
89
- /**
90
- * **Admin-only**: Creates a new auth account with specific rate limits for a given
91
- * `accountWalletAddress`. The `walletAddress` performing this action must have
92
- * admin privileges, or the call will fail. Use this to create custom sub-accounts
93
- * with limited scope or usage rates.
94
- *
95
- * @param inputs - Contains:
96
- * - `walletAddress`: The admin's wallet address
97
- * - `signMessageCallback`: The admin's signing callback
98
- * - `accountName`: A short name or identifier for the account
99
- * - `accountWalletAddress`: The Sui address representing this sub-account
100
- * - `rateLimits`: An array specifying the rate limits (method-based) for the sub-account
101
- * @returns A promise resolving to `true` if successful, otherwise throws or returns `false`.
102
- */
103
- adminCreateAuthAccount(inputs: {
104
- walletAddress: SuiAddress;
105
- signMessageCallback: SignMessageCallback;
106
- accountName: string;
107
- accountWalletAddress: SuiAddress;
108
- rateLimits: RateLimit[];
109
- }): Promise<boolean>;
110
- /**
111
- * Requests a new access token from the API by sending a signed message
112
- * indicating the user wants a token.
113
- *
114
- * @param inputs - Contains the user's `walletAddress` and `signMessageCallback`.
115
- * @returns A response object that includes the `accessToken` and an `expirationTimestamp`.
116
- */
117
- private getAccessToken;
118
- /**
119
- * Creates a JSON string with a standard format:
120
- * ```json
121
- * {
122
- * "date": <epoch-seconds>,
123
- * "nonce": <random_number>,
124
- * "method": <method_string>,
125
- * "value": <passed_value>
126
- * }
127
- * ```
128
- *
129
- * @param method - A short method name describing the action ("GetAccessToken", "AccountCreate", etc.).
130
- * @param value - The data object to embed under the `value` field.
131
- * @returns A JSON-serialized string for signing.
132
- */
133
- private static createSerializedJson;
134
- }
135
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/packages/auth/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,UAAU,EAEV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAIN,SAAS,EACT,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,IAAK,SAAQ,MAAM;IAK/B;;OAEG;IACH,OAAO,CAAC,YAAY,CAA8C;IAClE;;OAEG;IACH,OAAO,CAAC,UAAU,CAAS;IAM3B;;;;OAIG;gBACS,MAAM,CAAC,EAAE,YAAY;IAQjC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACU,IAAI,CAAC,MAAM,EAAE;QACzB,aAAa,EAAE,UAAU,CAAC;QAC1B,mBAAmB,EAAE,mBAAmB,CAAC;KACzC,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC;IAiCvB;;;;;;;;;;;;;;;;;;;;;OAqBG;IA+EH;;;;;;;;;;;;;OAaG;IACU,sBAAsB,CAAC,MAAM,EAAE;QAC3C,aAAa,EAAE,UAAU,CAAC;QAC1B,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,WAAW,EAAE,MAAM,CAAC;QACpB,oBAAoB,EAAE,UAAU,CAAC;QACjC,UAAU,EAAE,SAAS,EAAE,CAAC;KACxB,GAAG,OAAO,CAAC,OAAO,CAAC;IAsCpB;;;;;;OAMG;YACW,cAAc;IA0B5B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAcnC"}