@aptos-labs/ts-sdk 1.15.0-win.0 → 1.15.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 (170) hide show
  1. package/dist/common/cli/index.js +1 -1
  2. package/dist/common/cli/index.js.map +1 -1
  3. package/dist/esm/account/Account.mjs +1 -1
  4. package/dist/esm/account/Ed25519Account.mjs +1 -1
  5. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  6. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  7. package/dist/esm/account/index.mjs +1 -1
  8. package/dist/esm/api/account.mjs +1 -1
  9. package/dist/esm/api/ans.mjs +1 -1
  10. package/dist/esm/api/aptos.mjs +1 -1
  11. package/dist/esm/api/coin.mjs +1 -1
  12. package/dist/esm/api/digitalAsset.mjs +1 -1
  13. package/dist/esm/api/event.mjs +1 -1
  14. package/dist/esm/api/faucet.mjs +1 -1
  15. package/dist/esm/api/fungibleAsset.mjs +1 -1
  16. package/dist/esm/api/general.mjs +1 -1
  17. package/dist/esm/api/index.mjs +1 -1
  18. package/dist/esm/api/staking.mjs +1 -1
  19. package/dist/esm/api/table.mjs +1 -1
  20. package/dist/esm/api/transaction.mjs +1 -1
  21. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  22. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  23. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  24. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  25. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  26. package/dist/esm/api/utils.mjs +1 -1
  27. package/dist/esm/bcs/index.mjs +1 -1
  28. package/dist/esm/{chunk-GIAABV7R.mjs → chunk-3Y46WJUR.mjs} +2 -2
  29. package/dist/esm/{chunk-UPSCPEEE.mjs → chunk-4GWNWSZP.mjs} +2 -2
  30. package/dist/esm/{chunk-BO2TLWNT.mjs → chunk-53INTTOI.mjs} +2 -2
  31. package/dist/esm/{chunk-5YLAWRI2.mjs → chunk-A4JUQZXI.mjs} +2 -2
  32. package/dist/esm/{chunk-7VRZLDIJ.mjs → chunk-AF5WNJOP.mjs} +2 -2
  33. package/dist/esm/{chunk-BHLICYAI.mjs → chunk-AHW3SKT7.mjs} +2 -2
  34. package/dist/esm/{chunk-DLAIJ2UM.mjs → chunk-BBKE2QJU.mjs} +2 -2
  35. package/dist/esm/{chunk-RYD6HRW7.mjs → chunk-BN22EYXR.mjs} +2 -2
  36. package/dist/esm/{chunk-ACG4ZGRQ.mjs → chunk-CHWE77CR.mjs} +2 -2
  37. package/dist/esm/{chunk-CWUH4PNH.mjs → chunk-CYTRYBWN.mjs} +2 -2
  38. package/dist/esm/{chunk-477G7LHJ.mjs → chunk-DZSDCUP2.mjs} +2 -2
  39. package/dist/esm/{chunk-6XWDDCQD.mjs → chunk-E56MTU2U.mjs} +2 -2
  40. package/dist/esm/{chunk-UKSRF2Q3.mjs → chunk-EA2DKJPX.mjs} +2 -2
  41. package/dist/esm/{chunk-E2NVC2VR.mjs → chunk-ERIPXWXJ.mjs} +2 -2
  42. package/dist/esm/{chunk-5VIESFOC.mjs → chunk-EZPUVLME.mjs} +2 -2
  43. package/dist/esm/{chunk-RVWYURXG.mjs → chunk-F4GDEXZ6.mjs} +2 -2
  44. package/dist/esm/{chunk-J6OFSYUA.mjs → chunk-F7NLNWHN.mjs} +2 -2
  45. package/dist/esm/{chunk-3HSXKDOC.mjs → chunk-FFGY7Z4B.mjs} +2 -2
  46. package/dist/esm/{chunk-HMARHACL.mjs → chunk-GP6Z47HM.mjs} +2 -2
  47. package/dist/esm/{chunk-HNEAPYNI.mjs → chunk-GPEM3JVU.mjs} +2 -2
  48. package/dist/esm/{chunk-XBHFMNYB.mjs → chunk-GUALXVFI.mjs} +2 -2
  49. package/dist/esm/{chunk-GKJ2NJG5.mjs → chunk-H6FEXRTK.mjs} +2 -2
  50. package/dist/esm/{chunk-ZBXOX3S7.mjs → chunk-I5T6PHDV.mjs} +2 -2
  51. package/dist/esm/{chunk-PPO4IXE4.mjs → chunk-JGSOTNJ5.mjs} +2 -2
  52. package/dist/esm/{chunk-P6GWG2CY.mjs → chunk-JX75UKJX.mjs} +2 -2
  53. package/dist/esm/{chunk-QSHLNSUP.mjs → chunk-LDQ6JFEF.mjs} +2 -2
  54. package/dist/esm/{chunk-QSHLNSUP.mjs.map → chunk-LDQ6JFEF.mjs.map} +1 -1
  55. package/dist/esm/{chunk-WXWWYH73.mjs → chunk-LQNPI3IR.mjs} +2 -2
  56. package/dist/esm/{chunk-TT2XR5ZI.mjs → chunk-NGQR5UQ3.mjs} +2 -2
  57. package/dist/esm/{chunk-K7HX7JQH.mjs → chunk-O2K7RZWM.mjs} +2 -2
  58. package/dist/esm/{chunk-AQAH67IV.mjs → chunk-O4WVPLUX.mjs} +2 -2
  59. package/dist/esm/{chunk-XD46HTI2.mjs → chunk-P46OPJB4.mjs} +2 -2
  60. package/dist/esm/{chunk-3N6N3KOS.mjs → chunk-P5TZBE3L.mjs} +2 -2
  61. package/dist/esm/{chunk-JFIAWBCK.mjs → chunk-PZ4SAXY7.mjs} +2 -2
  62. package/dist/esm/{chunk-6JLYD5Q2.mjs → chunk-R5ST36VJ.mjs} +2 -2
  63. package/dist/esm/{chunk-TGQARO3F.mjs → chunk-RFZ5LTGP.mjs} +2 -2
  64. package/dist/esm/{chunk-QIHR7HD6.mjs → chunk-RT6LEYHZ.mjs} +2 -2
  65. package/dist/esm/{chunk-JB5H65CE.mjs → chunk-UR3JTLIT.mjs} +2 -2
  66. package/dist/esm/{chunk-IZQV2SU6.mjs → chunk-UW2FPXYA.mjs} +2 -2
  67. package/dist/esm/{chunk-2YZSEM2G.mjs → chunk-WN3JL7ZT.mjs} +2 -2
  68. package/dist/esm/{chunk-PLXGSUZA.mjs → chunk-WNPL4SEJ.mjs} +2 -2
  69. package/dist/esm/{chunk-7NEETXEA.mjs → chunk-YCC6HN74.mjs} +2 -2
  70. package/dist/esm/{chunk-QQ5PHEJF.mjs → chunk-YK63A5T6.mjs} +2 -2
  71. package/dist/esm/{chunk-NZETF6Z4.mjs → chunk-ZCG6WBLE.mjs} +2 -2
  72. package/dist/esm/{chunk-MQI2IE6Y.mjs → chunk-ZM33M6QO.mjs} +2 -2
  73. package/dist/esm/cli/index.mjs +1 -1
  74. package/dist/esm/cli/move.mjs +1 -1
  75. package/dist/esm/client/core.mjs +1 -1
  76. package/dist/esm/client/get.mjs +1 -1
  77. package/dist/esm/client/index.mjs +1 -1
  78. package/dist/esm/client/post.mjs +1 -1
  79. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  80. package/dist/esm/core/crypto/index.mjs +1 -1
  81. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  82. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  83. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  84. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  85. package/dist/esm/core/crypto/signature.mjs +1 -1
  86. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  87. package/dist/esm/core/index.mjs +1 -1
  88. package/dist/esm/index.mjs +1 -1
  89. package/dist/esm/internal/account.mjs +1 -1
  90. package/dist/esm/internal/ans.mjs +1 -1
  91. package/dist/esm/internal/coin.mjs +1 -1
  92. package/dist/esm/internal/digitalAsset.mjs +1 -1
  93. package/dist/esm/internal/event.mjs +1 -1
  94. package/dist/esm/internal/faucet.mjs +1 -1
  95. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  96. package/dist/esm/internal/general.mjs +1 -1
  97. package/dist/esm/internal/staking.mjs +1 -1
  98. package/dist/esm/internal/table.mjs +1 -1
  99. package/dist/esm/internal/transaction.mjs +1 -1
  100. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  101. package/dist/esm/internal/view.mjs +1 -1
  102. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  103. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  104. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  105. package/dist/esm/transactions/index.mjs +1 -1
  106. package/dist/esm/transactions/instances/index.mjs +1 -1
  107. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  108. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  109. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  110. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  111. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  112. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  113. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  114. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  115. package/dist/esm/transactions/management/index.mjs +1 -1
  116. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  117. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  118. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  119. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  120. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  121. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  122. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  123. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  124. package/dist/esm/utils/index.mjs +1 -1
  125. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  126. package/package.json +1 -1
  127. package/src/cli/move.ts +1 -1
  128. /package/dist/esm/{chunk-GIAABV7R.mjs.map → chunk-3Y46WJUR.mjs.map} +0 -0
  129. /package/dist/esm/{chunk-UPSCPEEE.mjs.map → chunk-4GWNWSZP.mjs.map} +0 -0
  130. /package/dist/esm/{chunk-BO2TLWNT.mjs.map → chunk-53INTTOI.mjs.map} +0 -0
  131. /package/dist/esm/{chunk-5YLAWRI2.mjs.map → chunk-A4JUQZXI.mjs.map} +0 -0
  132. /package/dist/esm/{chunk-7VRZLDIJ.mjs.map → chunk-AF5WNJOP.mjs.map} +0 -0
  133. /package/dist/esm/{chunk-BHLICYAI.mjs.map → chunk-AHW3SKT7.mjs.map} +0 -0
  134. /package/dist/esm/{chunk-DLAIJ2UM.mjs.map → chunk-BBKE2QJU.mjs.map} +0 -0
  135. /package/dist/esm/{chunk-RYD6HRW7.mjs.map → chunk-BN22EYXR.mjs.map} +0 -0
  136. /package/dist/esm/{chunk-ACG4ZGRQ.mjs.map → chunk-CHWE77CR.mjs.map} +0 -0
  137. /package/dist/esm/{chunk-CWUH4PNH.mjs.map → chunk-CYTRYBWN.mjs.map} +0 -0
  138. /package/dist/esm/{chunk-477G7LHJ.mjs.map → chunk-DZSDCUP2.mjs.map} +0 -0
  139. /package/dist/esm/{chunk-6XWDDCQD.mjs.map → chunk-E56MTU2U.mjs.map} +0 -0
  140. /package/dist/esm/{chunk-UKSRF2Q3.mjs.map → chunk-EA2DKJPX.mjs.map} +0 -0
  141. /package/dist/esm/{chunk-E2NVC2VR.mjs.map → chunk-ERIPXWXJ.mjs.map} +0 -0
  142. /package/dist/esm/{chunk-5VIESFOC.mjs.map → chunk-EZPUVLME.mjs.map} +0 -0
  143. /package/dist/esm/{chunk-RVWYURXG.mjs.map → chunk-F4GDEXZ6.mjs.map} +0 -0
  144. /package/dist/esm/{chunk-J6OFSYUA.mjs.map → chunk-F7NLNWHN.mjs.map} +0 -0
  145. /package/dist/esm/{chunk-3HSXKDOC.mjs.map → chunk-FFGY7Z4B.mjs.map} +0 -0
  146. /package/dist/esm/{chunk-HMARHACL.mjs.map → chunk-GP6Z47HM.mjs.map} +0 -0
  147. /package/dist/esm/{chunk-HNEAPYNI.mjs.map → chunk-GPEM3JVU.mjs.map} +0 -0
  148. /package/dist/esm/{chunk-XBHFMNYB.mjs.map → chunk-GUALXVFI.mjs.map} +0 -0
  149. /package/dist/esm/{chunk-GKJ2NJG5.mjs.map → chunk-H6FEXRTK.mjs.map} +0 -0
  150. /package/dist/esm/{chunk-ZBXOX3S7.mjs.map → chunk-I5T6PHDV.mjs.map} +0 -0
  151. /package/dist/esm/{chunk-PPO4IXE4.mjs.map → chunk-JGSOTNJ5.mjs.map} +0 -0
  152. /package/dist/esm/{chunk-P6GWG2CY.mjs.map → chunk-JX75UKJX.mjs.map} +0 -0
  153. /package/dist/esm/{chunk-WXWWYH73.mjs.map → chunk-LQNPI3IR.mjs.map} +0 -0
  154. /package/dist/esm/{chunk-TT2XR5ZI.mjs.map → chunk-NGQR5UQ3.mjs.map} +0 -0
  155. /package/dist/esm/{chunk-K7HX7JQH.mjs.map → chunk-O2K7RZWM.mjs.map} +0 -0
  156. /package/dist/esm/{chunk-AQAH67IV.mjs.map → chunk-O4WVPLUX.mjs.map} +0 -0
  157. /package/dist/esm/{chunk-XD46HTI2.mjs.map → chunk-P46OPJB4.mjs.map} +0 -0
  158. /package/dist/esm/{chunk-3N6N3KOS.mjs.map → chunk-P5TZBE3L.mjs.map} +0 -0
  159. /package/dist/esm/{chunk-JFIAWBCK.mjs.map → chunk-PZ4SAXY7.mjs.map} +0 -0
  160. /package/dist/esm/{chunk-6JLYD5Q2.mjs.map → chunk-R5ST36VJ.mjs.map} +0 -0
  161. /package/dist/esm/{chunk-TGQARO3F.mjs.map → chunk-RFZ5LTGP.mjs.map} +0 -0
  162. /package/dist/esm/{chunk-QIHR7HD6.mjs.map → chunk-RT6LEYHZ.mjs.map} +0 -0
  163. /package/dist/esm/{chunk-JB5H65CE.mjs.map → chunk-UR3JTLIT.mjs.map} +0 -0
  164. /package/dist/esm/{chunk-IZQV2SU6.mjs.map → chunk-UW2FPXYA.mjs.map} +0 -0
  165. /package/dist/esm/{chunk-2YZSEM2G.mjs.map → chunk-WN3JL7ZT.mjs.map} +0 -0
  166. /package/dist/esm/{chunk-PLXGSUZA.mjs.map → chunk-WNPL4SEJ.mjs.map} +0 -0
  167. /package/dist/esm/{chunk-7NEETXEA.mjs.map → chunk-YCC6HN74.mjs.map} +0 -0
  168. /package/dist/esm/{chunk-QQ5PHEJF.mjs.map → chunk-YK63A5T6.mjs.map} +0 -0
  169. /package/dist/esm/{chunk-NZETF6Z4.mjs.map → chunk-ZCG6WBLE.mjs.map} +0 -0
  170. /package/dist/esm/{chunk-MQI2IE6Y.mjs.map → chunk-ZM33M6QO.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-5YLAWRI2.mjs";import"../chunk-5VIESFOC.mjs";import"../chunk-3JPVQHOR.mjs";import"../chunk-AH44UPM4.mjs";import"../chunk-JQIGQMNZ.mjs";import"../chunk-S3EDNXZE.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-S2VSJJRJ.mjs";import"../chunk-YMB2XW2O.mjs";import"../chunk-2XK53QFA.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-ROXFCLDT.mjs";import"../chunk-GHYE26Q5.mjs";import"../chunk-HYCGMFC2.mjs";import"../chunk-CJDEPZ4J.mjs";import"../chunk-CYNQRMO5.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-G56GPLTB.mjs";import"../chunk-SRDIYE3M.mjs";import"../chunk-N3U47Y6Y.mjs";import"../chunk-CEHCDA3G.mjs";import"../chunk-OWW6SIDP.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-6IFMQ5AS.mjs";import"../chunk-36QXVFR5.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as waitForIndexerOnVersion};
1
+ import{a}from"../chunk-A4JUQZXI.mjs";import"../chunk-EZPUVLME.mjs";import"../chunk-AH44UPM4.mjs";import"../chunk-JQIGQMNZ.mjs";import"../chunk-S3EDNXZE.mjs";import"../chunk-N2FKVZ4D.mjs";import"../chunk-S2VSJJRJ.mjs";import"../chunk-YMB2XW2O.mjs";import"../chunk-3JPVQHOR.mjs";import"../chunk-2XK53QFA.mjs";import"../chunk-GED6IT3S.mjs";import"../chunk-ROXFCLDT.mjs";import"../chunk-HYCGMFC2.mjs";import"../chunk-GHYE26Q5.mjs";import"../chunk-CJDEPZ4J.mjs";import"../chunk-CYNQRMO5.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-N3U47Y6Y.mjs";import"../chunk-CEHCDA3G.mjs";import"../chunk-G56GPLTB.mjs";import"../chunk-SRDIYE3M.mjs";import"../chunk-OWW6SIDP.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-36QXVFR5.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-6IFMQ5AS.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{a as waitForIndexerOnVersion};
2
2
  //# sourceMappingURL=utils.mjs.map
@@ -1,2 +1,2 @@
1
- import"../chunk-FZY4PMEE.mjs";import{a as p,b as q,c as r}from"../chunk-G56GPLTB.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o}from"../chunk-SRDIYE3M.mjs";import{a as h}from"../chunk-N3U47Y6Y.mjs";import{a as g}from"../chunk-CEHCDA3G.mjs";import"../chunk-OWW6SIDP.mjs";import"../chunk-4WPQQPUF.mjs";import{a}from"../chunk-6IFMQ5AS.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-36QXVFR5.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,r as MoveOption,q as MoveString,p as MoveVector,b as Serializable,c as Serializer,n as U128,k as U16,o as U256,l as U32,m as U64,j as U8,d as ensureBoolean,e as outOfRangeErrorMessage,f as validateNumberInRange};
1
+ import"../chunk-FZY4PMEE.mjs";import{a as h}from"../chunk-N3U47Y6Y.mjs";import{a as g}from"../chunk-CEHCDA3G.mjs";import{a as p,b as q,c as r}from"../chunk-G56GPLTB.mjs";import{a as i,b as j,c as k,d as l,e as m,f as n,g as o}from"../chunk-SRDIYE3M.mjs";import"../chunk-OWW6SIDP.mjs";import"../chunk-4WPQQPUF.mjs";import{a as b,b as c,c as d,d as e,e as f}from"../chunk-36QXVFR5.mjs";import"../chunk-BCUSI3N6.mjs";import"../chunk-LG7RJQ57.mjs";import{a}from"../chunk-6IFMQ5AS.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-FVA2OPG4.mjs";export{i as Bool,a as Deserializer,h as EntryFunctionBytes,g as FixedBytes,r as MoveOption,q as MoveString,p as MoveVector,b as Serializable,c as Serializer,n as U128,k as U16,o as U256,l as U32,m as U64,j as U8,d as ensureBoolean,e as outOfRangeErrorMessage,f as validateNumberInRange};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i,b as t,c as n,d as o}from"./chunk-HMARHACL.mjs";import{a as s}from"./chunk-5YLAWRI2.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
2
- //# sourceMappingURL=chunk-GIAABV7R.mjs.map
1
+ import{a as i,b as t,c as n,d as o}from"./chunk-GP6Z47HM.mjs";import{a as s}from"./chunk-A4JUQZXI.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
2
+ //# sourceMappingURL=chunk-3Y46WJUR.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as f}from"./chunk-QRS4DGP3.mjs";import{a as m,b as a,c as g}from"./chunk-G56GPLTB.mjs";import{a as i,b as o,c as u,d as s,e as c,f as p,g as y}from"./chunk-SRDIYE3M.mjs";import{a as r}from"./chunk-CEHCDA3G.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof m||n instanceof g}function A(n){return n instanceof i}function T(n){return n instanceof f}function E(n){return n instanceof a}function d(n){return n instanceof r}function x(n){return n instanceof o}function S(n){return n instanceof u}function B(n){return n instanceof s}function U(n){return n instanceof c}function I(n){return n instanceof p}function b(n){return n instanceof y}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
2
- //# sourceMappingURL=chunk-UPSCPEEE.mjs.map
1
+ import{b as f}from"./chunk-QRS4DGP3.mjs";import{a as r}from"./chunk-CEHCDA3G.mjs";import{a as m,b as a,c as g}from"./chunk-G56GPLTB.mjs";import{a as i,b as o,c as u,d as s,e as c,f as p,g as y}from"./chunk-SRDIYE3M.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof m||n instanceof g}function A(n){return n instanceof i}function T(n){return n instanceof f}function E(n){return n instanceof a}function d(n){return n instanceof r}function x(n){return n instanceof o}function S(n){return n instanceof u}function B(n){return n instanceof s}function U(n){return n instanceof c}function I(n){return n instanceof p}function b(n){return n instanceof y}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
2
+ //# sourceMappingURL=chunk-4GWNWSZP.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as h}from"./chunk-7VRZLDIJ.mjs";import{a as y}from"./chunk-PF57EOJY.mjs";import{b as n}from"./chunk-QRS4DGP3.mjs";import{a as _}from"./chunk-36QXVFR5.mjs";var t=class i extends _{constructor(e,s,a,r,c,d,l){super(),this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=r,this.gas_unit_price=c,this.expiration_timestamp_secs=d,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=n.deserialize(e),a=e.deserializeU64(),r=h.deserialize(e),c=e.deserializeU64(),d=e.deserializeU64(),l=e.deserializeU64(),m=y.deserialize(e);return new i(s,a,r,c,d,l,m)}},o=class extends _{static deserialize(e){let s=e.deserializeUleb128AsU32();switch(s){case 0:return u.load(e);case 1:return p.load(e);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${s}`)}}},u=class i extends o{constructor(e,s){super(),this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n);return new i(s,a)}},p=class i extends o{constructor(e,s,a){super(),this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n),r=n.deserialize(e);return new i(s,a,r)}};export{t as a,o as b,u as c,p as d};
2
- //# sourceMappingURL=chunk-BO2TLWNT.mjs.map
1
+ import{b as h}from"./chunk-AF5WNJOP.mjs";import{a as y}from"./chunk-PF57EOJY.mjs";import{b as n}from"./chunk-QRS4DGP3.mjs";import{a as _}from"./chunk-36QXVFR5.mjs";var t=class i extends _{constructor(e,s,a,r,c,d,l){super(),this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=r,this.gas_unit_price=c,this.expiration_timestamp_secs=d,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let s=n.deserialize(e),a=e.deserializeU64(),r=h.deserialize(e),c=e.deserializeU64(),d=e.deserializeU64(),l=e.deserializeU64(),m=y.deserialize(e);return new i(s,a,r,c,d,l,m)}},o=class extends _{static deserialize(e){let s=e.deserializeUleb128AsU32();switch(s){case 0:return u.load(e);case 1:return p.load(e);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${s}`)}}},u=class i extends o{constructor(e,s){super(),this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n);return new i(s,a)}},p=class i extends o{constructor(e,s,a){super(),this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let s=t.deserialize(e),a=e.deserializeVector(n),r=n.deserialize(e);return new i(s,a,r)}};export{t as a,o as b,u as c,p as d};
2
+ //# sourceMappingURL=chunk-53INTTOI.mjs.map
@@ -1,2 +1,2 @@
1
- import{h as e}from"./chunk-5VIESFOC.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
2
- //# sourceMappingURL=chunk-5YLAWRI2.mjs.map
1
+ import{h as e}from"./chunk-EZPUVLME.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
2
+ //# sourceMappingURL=chunk-A4JUQZXI.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-U3YYSIIT.mjs";import{a as g}from"./chunk-35EWRSDK.mjs";import{a as p}from"./chunk-B7X6PSE7.mjs";import{b as y}from"./chunk-QRS4DGP3.mjs";import{a as v}from"./chunk-G56GPLTB.mjs";import{a as F,b as d,c as T,d as x,e as E,f as _,g as w}from"./chunk-SRDIYE3M.mjs";import{a as S}from"./chunk-N3U47Y6Y.mjs";import{a as u}from"./chunk-36QXVFR5.mjs";function D(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return d.deserialize(t);case 1:return E.deserialize(t);case 2:return _.deserialize(t);case 3:return y.deserialize(t);case 4:return v.deserialize(t,d);case 5:return F.deserialize(t);case 6:return T.deserialize(t);case 7:return x.deserialize(t);case 8:return w.deserialize(t);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends u{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return A.load(e);case 2:return z.load(e);case 3:return h.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${r}`)}}},A=class t extends a{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let r=U.deserialize(e);return new t(r)}},z=class t extends a{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let r=l.deserialize(e);return new t(r)}},h=class t extends a{constructor(e){super(),this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let r=f.deserialize(e);return new t(r)}},l=class t{constructor(e,r,i,n){this.module_name=e,this.function_name=r,this.type_args=i,this.args=n}static build(e,r,i,n){return new t(g.fromStr(e),new p(r),i,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(r=>{r.serializeForEntryFunction(e)})}static deserialize(e){let r=g.deserialize(e),i=p.deserialize(e),n=e.deserializeVector(m),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let M=e.deserializeUleb128AsU32(),B=S.deserialize(e,M);s.push(B)}return new t(r,i,n,s)}},U=class t{constructor(e,r,i){this.bytecode=e,this.type_args=r,this.args=i}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(r=>{r.serializeForScriptFunction(e)})}static deserialize(e){let r=e.deserializeBytes(),i=e.deserializeVector(m),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=D(e);o.push(c)}return new t(r,i,o)}},f=class t{constructor(e,r){this.multisig_address=e,this.transaction_payload=r}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let r=y.deserialize(e),i=e.deserializeBool(),n;return i&&(n=b.deserialize(e)),new t(r,n)}},b=class t extends u{constructor(e){super(),this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new t(l.deserialize(e))}};export{D as a,a as b,A as c,z as d,h as e,l as f,U as g,f as h,b as i};
2
- //# sourceMappingURL=chunk-7VRZLDIJ.mjs.map
1
+ import{a as m}from"./chunk-U3YYSIIT.mjs";import{a as g}from"./chunk-35EWRSDK.mjs";import{a as p}from"./chunk-B7X6PSE7.mjs";import{b as y}from"./chunk-QRS4DGP3.mjs";import{a as S}from"./chunk-N3U47Y6Y.mjs";import{a as v}from"./chunk-G56GPLTB.mjs";import{a as F,b as d,c as T,d as x,e as E,f as _,g as w}from"./chunk-SRDIYE3M.mjs";import{a as u}from"./chunk-36QXVFR5.mjs";function D(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return d.deserialize(t);case 1:return E.deserialize(t);case 2:return _.deserialize(t);case 3:return y.deserialize(t);case 4:return v.deserialize(t,d);case 5:return F.deserialize(t);case 6:return T.deserialize(t);case 7:return x.deserialize(t);case 8:return w.deserialize(t);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends u{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return A.load(e);case 2:return z.load(e);case 3:return h.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${r}`)}}},A=class t extends a{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let r=U.deserialize(e);return new t(r)}},z=class t extends a{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let r=l.deserialize(e);return new t(r)}},h=class t extends a{constructor(e){super(),this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let r=f.deserialize(e);return new t(r)}},l=class t{constructor(e,r,i,n){this.module_name=e,this.function_name=r,this.type_args=i,this.args=n}static build(e,r,i,n){return new t(g.fromStr(e),new p(r),i,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(r=>{r.serializeForEntryFunction(e)})}static deserialize(e){let r=g.deserialize(e),i=p.deserialize(e),n=e.deserializeVector(m),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let M=e.deserializeUleb128AsU32(),B=S.deserialize(e,M);s.push(B)}return new t(r,i,n,s)}},U=class t{constructor(e,r,i){this.bytecode=e,this.type_args=r,this.args=i}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(r=>{r.serializeForScriptFunction(e)})}static deserialize(e){let r=e.deserializeBytes(),i=e.deserializeVector(m),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=D(e);o.push(c)}return new t(r,i,o)}},f=class t{constructor(e,r){this.multisig_address=e,this.transaction_payload=r}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let r=y.deserialize(e),i=e.deserializeBool(),n;return i&&(n=b.deserialize(e)),new t(r,n)}},b=class t extends u{constructor(e){super(),this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new t(l.deserialize(e))}};export{D as a,a as b,A as c,z as d,h as e,l as f,U as g,f as h,b as i};
2
+ //# sourceMappingURL=chunk-AF5WNJOP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-BO2TLWNT.mjs";import{b as i}from"./chunk-QRS4DGP3.mjs";import{a as d}from"./chunk-36QXVFR5.mjs";var o=class t extends d{constructor(e,s,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
- //# sourceMappingURL=chunk-BHLICYAI.mjs.map
1
+ import{a as n}from"./chunk-53INTTOI.mjs";import{b as i}from"./chunk-QRS4DGP3.mjs";import{a as d}from"./chunk-36QXVFR5.mjs";var o=class t extends d{constructor(e,s,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=s}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let s=n.deserialize(e),r=e.deserializeVector(i),c=e.deserializeBool(),a;return c&&(a=i.deserialize(e)),new t(s,r,a)}};export{o as a};
2
+ //# sourceMappingURL=chunk-AHW3SKT7.mjs.map
@@ -1,2 +1,2 @@
1
- import{e as o}from"./chunk-3N6N3KOS.mjs";import{a as g,b as c}from"./chunk-PIVZMT5D.mjs";var y=class a{constructor(i){let{multiKey:n,signers:s}=i;this.publicKey=n,this.signingScheme=3,this.accountAddress=this.publicKey.authKey().derivedAddress();let r=[];for(let e of s)r.push(this.publicKey.getIndex(e.publicKey));let t=s.map((e,u)=>[e,r[u]]);t.sort((e,u)=>e[1]-u[1]),this.signers=t.map(e=>e[0]),this.signerIndicies=t.map(e=>e[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:r})}static fromPublicKeysAndSigners(i){let{publicKeys:n,signaturesRequired:s,signers:r}=i,t=new g({publicKeys:n,signaturesRequired:s});return new a({multiKey:t,signers:r})}static isMultiKeySigner(i){return i instanceof a}signWithAuthenticator(i){return new o(this.publicKey,this.sign(i))}signTransactionWithAuthenticator(i){return new o(this.publicKey,this.signTransaction(i))}sign(i){let n=[];for(let s of this.signers)n.push(s.sign(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}signTransaction(i){let n=[];for(let s of this.signers)n.push(s.signTransaction(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}verifySignature(i){let{message:n,signature:s}=i;if(!this.signerIndicies.every((t,e)=>e===0||t>=this.signerIndicies[e-1]))return!1;for(let t=0;t<s.signatures.length;t+=1){let e=s.signatures[t];if(!this.publicKey.publicKeys[this.signerIndicies[t]].verifySignature({message:n,signature:e}))return!1}return!0}};export{y as a};
2
- //# sourceMappingURL=chunk-DLAIJ2UM.mjs.map
1
+ import{e as o}from"./chunk-P5TZBE3L.mjs";import{a as g,b as c}from"./chunk-PIVZMT5D.mjs";var y=class a{constructor(i){let{multiKey:n,signers:s}=i;this.publicKey=n,this.signingScheme=3,this.accountAddress=this.publicKey.authKey().derivedAddress();let r=[];for(let e of s)r.push(this.publicKey.getIndex(e.publicKey));let t=s.map((e,u)=>[e,r[u]]);t.sort((e,u)=>e[1]-u[1]),this.signers=t.map(e=>e[0]),this.signerIndicies=t.map(e=>e[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:r})}static fromPublicKeysAndSigners(i){let{publicKeys:n,signaturesRequired:s,signers:r}=i,t=new g({publicKeys:n,signaturesRequired:s});return new a({multiKey:t,signers:r})}static isMultiKeySigner(i){return i instanceof a}signWithAuthenticator(i){return new o(this.publicKey,this.sign(i))}signTransactionWithAuthenticator(i){return new o(this.publicKey,this.signTransaction(i))}sign(i){let n=[];for(let s of this.signers)n.push(s.sign(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}signTransaction(i){let n=[];for(let s of this.signers)n.push(s.signTransaction(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}verifySignature(i){let{message:n,signature:s}=i;if(!this.signerIndicies.every((t,e)=>e===0||t>=this.signerIndicies[e-1]))return!1;for(let t=0;t<s.signatures.length;t+=1){let e=s.signatures[t];if(!this.publicKey.publicKeys[this.signerIndicies[t]].verifySignature({message:n,signature:e}))return!1}return!0}};export{y as a};
2
+ //# sourceMappingURL=chunk-BBKE2QJU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-E2NVC2VR.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-K7HX7JQH.mjs";import{g as u}from"./chunk-5VIESFOC.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
- //# sourceMappingURL=chunk-RYD6HRW7.mjs.map
1
+ import{a as l}from"./chunk-ERIPXWXJ.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-O2K7RZWM.mjs";import{g as u}from"./chunk-EZPUVLME.mjs";import g from"eventemitter3";var m="fulfilled",f=(n=>(n.TransactionSent="transactionSent",n.TransactionSendFailed="transactionSendFailed",n.TransactionExecuted="transactionExecuted",n.TransactionExecutionFailed="transactionExecutionFailed",n.ExecutionFinish="executionFinish",n))(f||{}),p=class extends g{constructor(t,e,a=30,n=100,i=10){super();this.taskQueue=new o;this.transactionsQueue=new o;this.outstandingTransactions=new o;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=e,this.started=!1,this.accountSequnceNumber=new l(t,e,a,n,i)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let e=await this.generateNextTransaction(this.account,t);if(!e)return;let a=d({aptosConfig:this.aptosConfig,transaction:e,signer:this.account});await this.outstandingTransactions.enqueue([a,t])}}catch(t){if(t instanceof c)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],e=[],[a,n]=await this.outstandingTransactions.dequeue();for(t.push(a),e.push(n);!this.outstandingTransactions.isEmpty();)[a,n]=await this.outstandingTransactions.dequeue(),t.push(a),e.push(n);let i=await Promise.allSettled(t);for(let s=0;s<i.length&&s<e.length;s+=1){let r=i[s];n=e[s],r.status===m?(this.sentTransactions.push([r.value.hash,n,null]),this.emit("transactionSent",{message:`transaction hash ${r.value.hash} has been committed to chain`,transactionHash:r.value.hash}),await this.checkTransaction(r,n)):(this.sentTransactions.push([r.status,n,r.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${r.reason}`,error:r.reason}))}this.emit("executionFinish",{message:`execute ${i.length} transactions finished`})}}catch(t){if(t instanceof c)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,e){try{let a=[];a.push(u({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let n=await Promise.allSettled(a);for(let i=0;i<n.length;i+=1){let s=n[i];s.status===m?(this.executedTransactions.push([s.value.hash,e,null]),this.emit("transactionExecuted",{message:`transaction hash ${s.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([s.status,e,s.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${s.reason}`,error:s.reason}))}}catch(a){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${a}`)}}async push(t,e){this.transactionsQueue.enqueue([t,e])}async generateNextTransaction(t,e){if(this.transactionsQueue.isEmpty())return;let[a,n]=await this.transactionsQueue.dequeue();return h({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:a,options:{...n,accountSequenceNumber:e}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};export{m as a,f as b,p as c};
2
+ //# sourceMappingURL=chunk-BN22EYXR.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-5YLAWRI2.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-3HSXKDOC.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
- //# sourceMappingURL=chunk-ACG4ZGRQ.mjs.map
1
+ import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-FFGY7Z4B.mjs";import{a as n}from"./chunk-A4JUQZXI.mjs";import{e as o}from"./chunk-CYNQRMO5.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
2
+ //# sourceMappingURL=chunk-CHWE77CR.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-K7HX7JQH.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
- //# sourceMappingURL=chunk-CWUH4PNH.mjs.map
1
+ import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-O2K7RZWM.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
2
+ //# sourceMappingURL=chunk-CYTRYBWN.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-K7HX7JQH.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
- //# sourceMappingURL=chunk-477G7LHJ.mjs.map
1
+ import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-O2K7RZWM.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
2
+ //# sourceMappingURL=chunk-DZSDCUP2.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as o}from"./chunk-JFIAWBCK.mjs";import{b as i}from"./chunk-3N6N3KOS.mjs";import{b as n}from"./chunk-T2AGN5YT.mjs";import{b as s}from"./chunk-QRS4DGP3.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?s.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(o(t))}};export{c as a};
2
- //# sourceMappingURL=chunk-6XWDDCQD.mjs.map
1
+ import{d as o}from"./chunk-PZ4SAXY7.mjs";import{b as i}from"./chunk-P5TZBE3L.mjs";import{b as n}from"./chunk-T2AGN5YT.mjs";import{b as s}from"./chunk-QRS4DGP3.mjs";var c=class a{constructor(t){this.signingScheme=0;let{privateKey:e,address:r}=t;this.privateKey=e,this.publicKey=e.publicKey(),this.accountAddress=r?s.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let t=n.generate();return new a({privateKey:t})}static fromDerivationPath(t){let{path:e,mnemonic:r}=t,u=n.fromDerivationPath(e,r);return new a({privateKey:u})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new i(this.publicKey,this.privateKey.sign(t))}signTransactionWithAuthenticator(t){return new i(this.publicKey,this.signTransaction(t))}sign(t){return this.privateKey.sign(t)}signTransaction(t){return this.sign(o(t))}};export{c as a};
2
+ //# sourceMappingURL=chunk-E56MTU2U.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-ZBXOX3S7.mjs";import{h as t}from"./chunk-5VIESFOC.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
2
- //# sourceMappingURL=chunk-UKSRF2Q3.mjs.map
1
+ import{a as i}from"./chunk-I5T6PHDV.mjs";import{h as t}from"./chunk-EZPUVLME.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
2
+ //# sourceMappingURL=chunk-EA2DKJPX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-3HSXKDOC.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
- //# sourceMappingURL=chunk-E2NVC2VR.mjs.map
1
+ import{a as s}from"./chunk-FFGY7Z4B.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
2
+ //# sourceMappingURL=chunk-ERIPXWXJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-3JPVQHOR.mjs";import{a as R}from"./chunk-AH44UPM4.mjs";import{g as x,h as P}from"./chunk-JQIGQMNZ.mjs";import{b as c,c as A}from"./chunk-S2VSJJRJ.mjs";import{a as C}from"./chunk-GHYE26Q5.mjs";import{d as w}from"./chunk-CYNQRMO5.mjs";async function v(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(o){let{aptosConfig:n}=o;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function T(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function G(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function b(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function W(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=s)break;await h(200)}}var f=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},y=class extends Error{constructor(n,t){super(n),this.transaction=t}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
- //# sourceMappingURL=chunk-5VIESFOC.mjs.map
1
+ import{a as R}from"./chunk-AH44UPM4.mjs";import{g as x,h as P}from"./chunk-JQIGQMNZ.mjs";import{b as c,c as A}from"./chunk-S2VSJJRJ.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";import{a as C}from"./chunk-GHYE26Q5.mjs";import{d as w}from"./chunk-CYNQRMO5.mjs";async function v(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(o){let{aptosConfig:n}=o;return R(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function N(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function T(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function G(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function b(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function W(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,a=!0,p=0,e,g,m=200,E=1.5;function d(i){if(!(i instanceof C)||(g=i,i.status!==404&&i.status>=400&&i.status<500))throw i}try{e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(i){d(i)}if(a){let i=Date.now();try{e=await b({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction"}catch(l){d(l)}p=(Date.now()-i)/1e3}for(;a&&!(p>=r);){try{if(e=await T({aptosConfig:n,transactionHash:t}),a=e.type==="pending_transaction",!a)break}catch(i){d(i)}await h(m),p+=m/1e3,m*=E}if(e===void 0)throw g||new f(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new f(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!u)return e;if(!e.success)throw new y(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function O(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?a=await x({aptosConfig:n}):a=(await P({aptosConfig:n,processorType:t})).last_success_version,a>=s)break;await h(200)}}var f=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},y=class extends Error{constructor(n,t){super(n),this.transaction=t}};export{v as a,D as b,N as c,T as d,G as e,b as f,W as g,O as h,f as i,y as j};
2
+ //# sourceMappingURL=chunk-EZPUVLME.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as p}from"./chunk-JFIAWBCK.mjs";import{d as s}from"./chunk-3N6N3KOS.mjs";import{a as u,b as y}from"./chunk-IENCDVPF.mjs";import{b as a}from"./chunk-2X7A4HUS.mjs";import{b as i}from"./chunk-T2AGN5YT.mjs";import{b as g}from"./chunk-QRS4DGP3.mjs";var h=class c{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new u(r.publicKey()),this.accountAddress=t?g.from(t):this.publicKey.authKey().derivedAddress()}static generate(e={}){let{scheme:r=0}=e,t;switch(r){case 0:t=i.generate();break;case 2:t=a.generate();break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:o}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,o);break;case 2:n=a.fromDerivationPath(t,o);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){return new s(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new s(this.publicKey,this.signTransaction(e))}sign(e){return new y(this.privateKey.sign(e))}signTransaction(e){return this.sign(p(e))}};export{h as a};
2
- //# sourceMappingURL=chunk-RVWYURXG.mjs.map
1
+ import{d as p}from"./chunk-PZ4SAXY7.mjs";import{d as s}from"./chunk-P5TZBE3L.mjs";import{a as u,b as y}from"./chunk-IENCDVPF.mjs";import{b as a}from"./chunk-2X7A4HUS.mjs";import{b as i}from"./chunk-T2AGN5YT.mjs";import{b as g}from"./chunk-QRS4DGP3.mjs";var h=class c{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new u(r.publicKey()),this.accountAddress=t?g.from(t):this.publicKey.authKey().derivedAddress()}static generate(e={}){let{scheme:r=0}=e,t;switch(r){case 0:t=i.generate();break;case 2:t=a.generate();break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:o}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,o);break;case 2:n=a.fromDerivationPath(t,o);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new c({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){return new s(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new s(this.publicKey,this.signTransaction(e))}sign(e){return new y(this.privateKey.sign(e))}signTransaction(e){return this.sign(p(e))}};export{h as a};
2
+ //# sourceMappingURL=chunk-F4GDEXZ6.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-IZQV2SU6.mjs";import{a as e,b as s,c as r,d as n,e as t,g as i,h as a}from"./chunk-JQIGQMNZ.mjs";var g=class{constructor(o){this.config=o}async getLedgerInfo(){return e({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return s({aptosConfig:this.config,...o})}async getBlockByHeight(o){return r({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return n({aptosConfig:this.config,...o})}async queryIndexer(o){return t({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return i({aptosConfig:this.config})}async getProcessorStatus(o){return a({aptosConfig:this.config,processorType:o})}};export{g as a};
2
- //# sourceMappingURL=chunk-J6OFSYUA.mjs.map
1
+ import{a as c}from"./chunk-UW2FPXYA.mjs";import{a as e,b as s,c as r,d as n,e as t,g as i,h as a}from"./chunk-JQIGQMNZ.mjs";var g=class{constructor(o){this.config=o}async getLedgerInfo(){return e({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(o){return s({aptosConfig:this.config,...o})}async getBlockByHeight(o){return r({aptosConfig:this.config,...o})}async view(o){return c({aptosConfig:this.config,...o})}async getChainTopUserTransactions(o){return n({aptosConfig:this.config,...o})}async queryIndexer(o){return t({aptosConfig:this.config,...o})}async getIndexerLastSuccessVersion(){return i({aptosConfig:this.config})}async getProcessorStatus(o){return a({aptosConfig:this.config,processorType:o})}};export{g as a};
2
+ //# sourceMappingURL=chunk-F7NLNWHN.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as P}from"./chunk-TM7NDDT3.mjs";import{a as v}from"./chunk-AH44UPM4.mjs";import{e as d}from"./chunk-JQIGQMNZ.mjs";import{d as C,e as w,f as h,g as k,h as T,j as b,k as O,l as q}from"./chunk-S3EDNXZE.mjs";import{b as p,c as f}from"./chunk-S2VSJJRJ.mjs";import{a as _}from"./chunk-GHYE26Q5.mjs";import{a as A}from"./chunk-2YZSEM2G.mjs";import{a as m}from"./chunk-IENCDVPF.mjs";import{b as y}from"./chunk-2X7A4HUS.mjs";import{b as l}from"./chunk-T2AGN5YT.mjs";import{a as g}from"./chunk-5EN52MUT.mjs";import{b as c}from"./chunk-QRS4DGP3.mjs";async function S(t){let{aptosConfig:n,accountAddress:e}=t,{data:o}=await p({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(e).toString()}`});return o}async function H(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(e).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function J(t){return t.options?.ledgerVersion!==void 0?G(t):v(async()=>G(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function G(t){let{aptosConfig:n,accountAddress:e,moduleName:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(e).toString()}/module/${o}`,params:{ledger_version:s?.ledgerVersion}});return r}async function U(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(e).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function X(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(e).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(t){let{aptosConfig:n,accountAddress:e,resourceType:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(e).toString()}/resource/${o}`,params:{ledger_version:s?.ledgerVersion}});return r.data}async function Q(t){let{aptosConfig:n,authenticationKey:e,options:o}=t,s=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:r}}=s,a=c.from(e);try{let i=await P({aptosConfig:n,handle:r,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof _&&i.data.error_code==="table_item_not_found")return a;throw i}}async function Y(t){let{aptosConfig:n,accountAddress:e}=t,s={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:O,variables:{where_condition:s}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function Z(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.token_standard={_eq:o?.tokenStandard});let a={query:T,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function oo(t){let{aptosConfig:n,accountAddress:e,collectionAddress:o,options:s}=t,r=c.from(e).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:r},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};s?.tokenStandard&&(i.token_standard={_eq:s?.tokenStandard});let u={query:b,variables:{where_condition:i,offset:s?.offset,limit:s?.limit,order_by:s?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function to(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:h,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function eo(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:q,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return r.account_transactions_aggregate.aggregate?r.account_transactions_aggregate.aggregate.count:0}async function no(t){let{aptosConfig:n,accountAddress:e,coinType:o}=t,s=c.from(e).toStringLong(),r=await I({aptosConfig:n,accountAddress:s,options:{where:{asset_type:{_eq:o}}}});return r[0]?r[0].amount:0}async function I(t){let{aptosConfig:n,accountAddress:e,options:o}=t,s=c.from(e).toStringLong(),r={...o?.where,owner_address:{_eq:s}},a={query:w,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function ro(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:C,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!r.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return r.current_fungible_asset_balances_aggregate.aggregate.count}async function so(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()}},a={query:k,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function co(t){let{aptosConfig:n,privateKey:e}=t,o=new m(e.publicKey());if(e instanceof y){let r=g.fromPublicKey({publicKey:o}).derivedAddress();return A.fromPrivateKey({privateKey:e,address:r})}if(e instanceof l){let s=g.fromPublicKey({publicKey:o});if(await M({authKey:s,aptosConfig:n})){let u=s.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!1})}let a=g.fromPublicKey({publicKey:o.publicKey});if(await M({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function M(t){let{aptosConfig:n,authKey:e}=t,o=await Q({aptosConfig:n,authenticationKey:e.derivedAddress()});try{return await S({aptosConfig:n,accountAddress:o}),!0}catch(s){if(s.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{S as a,H as b,J as c,U as d,X as e,K as f,Q as g,Y as h,Z as i,oo as j,to as k,eo as l,no as m,I as n,ro as o,so as p,co as q,M as r};
2
- //# sourceMappingURL=chunk-3HSXKDOC.mjs.map
1
+ import{a as P}from"./chunk-TM7NDDT3.mjs";import{a as v}from"./chunk-AH44UPM4.mjs";import{e as d}from"./chunk-JQIGQMNZ.mjs";import{d as C,e as w,f as h,g as k,h as T,j as b,k as O,l as q}from"./chunk-S3EDNXZE.mjs";import{b as p,c as f}from"./chunk-S2VSJJRJ.mjs";import{a as A}from"./chunk-WN3JL7ZT.mjs";import{a as m}from"./chunk-IENCDVPF.mjs";import{b as y}from"./chunk-2X7A4HUS.mjs";import{b as l}from"./chunk-T2AGN5YT.mjs";import{a as g}from"./chunk-5EN52MUT.mjs";import{b as c}from"./chunk-QRS4DGP3.mjs";import{a as _}from"./chunk-GHYE26Q5.mjs";async function S(t){let{aptosConfig:n,accountAddress:e}=t,{data:o}=await p({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(e).toString()}`});return o}async function H(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(e).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function J(t){return t.options?.ledgerVersion!==void 0?G(t):v(async()=>G(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function G(t){let{aptosConfig:n,accountAddress:e,moduleName:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(e).toString()}/module/${o}`,params:{ledger_version:s?.ledgerVersion}});return r}async function U(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(e).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function X(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return f({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(e).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(t){let{aptosConfig:n,accountAddress:e,resourceType:o,options:s}=t,{data:r}=await p({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(e).toString()}/resource/${o}`,params:{ledger_version:s?.ledgerVersion}});return r.data}async function Q(t){let{aptosConfig:n,authenticationKey:e,options:o}=t,s=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:r}}=s,a=c.from(e);try{let i=await P({aptosConfig:n,handle:r,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof _&&i.data.error_code==="table_item_not_found")return a;throw i}}async function Y(t){let{aptosConfig:n,accountAddress:e}=t,s={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:O,variables:{where_condition:s}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function Z(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.token_standard={_eq:o?.tokenStandard});let a={query:T,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function oo(t){let{aptosConfig:n,accountAddress:e,collectionAddress:o,options:s}=t,r=c.from(e).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:r},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};s?.tokenStandard&&(i.token_standard={_eq:s?.tokenStandard});let u={query:b,variables:{where_condition:i,offset:s?.offset,limit:s?.limit,order_by:s?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function to(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:h,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function eo(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:q,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return r.account_transactions_aggregate.aggregate?r.account_transactions_aggregate.aggregate.count:0}async function no(t){let{aptosConfig:n,accountAddress:e,coinType:o}=t,s=c.from(e).toStringLong(),r=await I({aptosConfig:n,accountAddress:s,options:{where:{asset_type:{_eq:o}}}});return r[0]?r[0].amount:0}async function I(t){let{aptosConfig:n,accountAddress:e,options:o}=t,s=c.from(e).toStringLong(),r={...o?.where,owner_address:{_eq:s}},a={query:w,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function ro(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:C,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!r.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return r.current_fungible_asset_balances_aggregate.aggregate.count}async function so(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()}},a={query:k,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function co(t){let{aptosConfig:n,privateKey:e}=t,o=new m(e.publicKey());if(e instanceof y){let r=g.fromPublicKey({publicKey:o}).derivedAddress();return A.fromPrivateKey({privateKey:e,address:r})}if(e instanceof l){let s=g.fromPublicKey({publicKey:o});if(await M({authKey:s,aptosConfig:n})){let u=s.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!1})}let a=g.fromPublicKey({publicKey:o.publicKey});if(await M({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return A.fromPrivateKey({privateKey:e,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function M(t){let{aptosConfig:n,authKey:e}=t,o=await Q({aptosConfig:n,authenticationKey:e.derivedAddress()});try{return await S({aptosConfig:n,accountAddress:o}),!0}catch(s){if(s.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{S as a,H as b,J as c,U as d,X as e,K as f,Q as g,Y as h,Z as i,oo as j,to as k,eo as l,no as m,I as n,ro as o,so as p,co as q,M as r};
2
+ //# sourceMappingURL=chunk-FFGY7Z4B.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-K7HX7JQH.mjs";import{c as p}from"./chunk-MJPUASSD.mjs";import{e as o}from"./chunk-JQIGQMNZ.mjs";import{o as u,r as g,s as A}from"./chunk-S3EDNXZE.mjs";import{f as a,i as r}from"./chunk-U3YYSIIT.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
2
- //# sourceMappingURL=chunk-HMARHACL.mjs.map
1
+ import{a as c}from"./chunk-O2K7RZWM.mjs";import{c as p}from"./chunk-MJPUASSD.mjs";import{e as o}from"./chunk-JQIGQMNZ.mjs";import{o as u,r as g,s as A}from"./chunk-S3EDNXZE.mjs";import{f as a,i as r}from"./chunk-U3YYSIIT.mjs";async function G(t){let{aptosConfig:s,options:e}=t,n={query:A,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function h(t){let{aptosConfig:s,options:e}=t,n={query:g,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function M(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var b={typeParameters:[{constraints:[]}],parameters:[p("0x1::object::Object"),new r,new a]};async function x(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:l,options:f}=t;return c({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,l],abi:b},options:f})}export{G as a,h as b,M as c,x as d};
2
+ //# sourceMappingURL=chunk-GP6Z47HM.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-BO2TLWNT.mjs";import{a as e}from"./chunk-AQAH67IV.mjs";import{a as r}from"./chunk-36QXVFR5.mjs";var n=class o extends r{constructor(t,a){super(),this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
2
- //# sourceMappingURL=chunk-HNEAPYNI.mjs.map
1
+ import{a as i}from"./chunk-53INTTOI.mjs";import{a as e}from"./chunk-O4WVPLUX.mjs";import{a as r}from"./chunk-36QXVFR5.mjs";var n=class o extends r{constructor(t,a){super(),this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=i.deserialize(t),s=e.deserialize(t);return new o(a,s)}};export{n as a};
2
+ //# sourceMappingURL=chunk-GPEM3JVU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-6JLYD5Q2.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
- //# sourceMappingURL=chunk-XBHFMNYB.mjs.map
1
+ import{a as o}from"./chunk-R5ST36VJ.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
2
+ //# sourceMappingURL=chunk-GUALXVFI.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-PPO4IXE4.mjs";import{a as A}from"./chunk-CWUH4PNH.mjs";import{a as T}from"./chunk-477G7LHJ.mjs";import{a as y}from"./chunk-NZETF6Z4.mjs";import{d as g,e as a,h as m,i as p,j as f}from"./chunk-K7HX7JQH.mjs";import{a as i,b as s,c as r,d as e,e as c,g as u}from"./chunk-5VIESFOC.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return a({...n})}signAsFeePayer(n){let{signer:t,transaction:o}=n;if(!o.feePayerAddress)throw new Error(`Transaction ${o} is not a Fee Payer transaction`);return o.feePayerAddress=t.accountAddress,a({signer:t,transaction:o})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:o,options:P}=n;this.batch.forSingleAccount({sender:t,data:o,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:o}=n;return m({aptosConfig:this.config,signer:t,transaction:o})}};export{h as a};
2
- //# sourceMappingURL=chunk-GKJ2NJG5.mjs.map
1
+ import{a as d}from"./chunk-JGSOTNJ5.mjs";import{a as A}from"./chunk-CYTRYBWN.mjs";import{a as T}from"./chunk-DZSDCUP2.mjs";import{a as y}from"./chunk-ZCG6WBLE.mjs";import{d as g,e as a,h as m,i as p,j as f}from"./chunk-O2K7RZWM.mjs";import{a as i,b as s,c as r,d as e,e as c,g as u}from"./chunk-EZPUVLME.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return a({...n})}signAsFeePayer(n){let{signer:t,transaction:o}=n;if(!o.feePayerAddress)throw new Error(`Transaction ${o} is not a Fee Payer transaction`);return o.feePayerAddress=t.accountAddress,a({signer:t,transaction:o})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:o,options:P}=n;this.batch.forSingleAccount({sender:t,data:o,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:o}=n;return m({aptosConfig:this.config,signer:t,transaction:o})}};export{h as a};
2
+ //# sourceMappingURL=chunk-H6FEXRTK.mjs.map
@@ -1,2 +1,2 @@
1
- import{g as e}from"./chunk-5VIESFOC.mjs";import{d as c}from"./chunk-YMB2XW2O.mjs";import{d as r}from"./chunk-CYNQRMO5.mjs";import{b as s}from"./chunk-QRS4DGP3.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
2
- //# sourceMappingURL=chunk-ZBXOX3S7.mjs.map
1
+ import{g as e}from"./chunk-EZPUVLME.mjs";import{d as c}from"./chunk-YMB2XW2O.mjs";import{b as s}from"./chunk-QRS4DGP3.mjs";import{d as r}from"./chunk-CYNQRMO5.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
2
+ //# sourceMappingURL=chunk-I5T6PHDV.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-RYD6HRW7.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super(),this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
- //# sourceMappingURL=chunk-PPO4IXE4.mjs.map
1
+ import{c as a}from"./chunk-BN22EYXR.mjs";import e from"eventemitter3";var i=class extends e{constructor(t){super(),this.config=t}start(t){let{sender:n}=t;this.account=n,this.transactionWorker=new a(this.config,n),this.transactionWorker.start(),this.registerToEvents()}push(t){let{data:n,options:o}=t;for(let r of n)this.transactionWorker.push(r,o)}registerToEvents(){this.transactionWorker.on("transactionSent",async t=>{this.emit("transactionSent",t)}),this.transactionWorker.on("transactionSendFailed",async t=>{this.emit("transactionSendFailed",t)}),this.transactionWorker.on("transactionExecuted",async t=>{this.emit("transactionExecuted",t)}),this.transactionWorker.on("transactionExecutionFailed",async t=>{this.emit("transactionExecutionFailed",t)}),this.transactionWorker.on("executionFinish",async t=>{this.emit("executionFinish",t)})}forSingleAccount(t){try{let{sender:n,data:o,options:r}=t;this.start({sender:n}),this.push({data:o,options:r})}catch(n){throw new Error(`failed to submit transactions with error: ${n}`)}}};export{i as a};
2
+ //# sourceMappingURL=chunk-JGSOTNJ5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-BO2TLWNT.mjs";import{b as a}from"./chunk-QRS4DGP3.mjs";import{a as i}from"./chunk-36QXVFR5.mjs";var o=class t extends i{constructor(e,r){super(),this.rawTransaction=e,this.feePayerAddress=r}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let r=n.deserialize(e),d=e.deserializeBool(),s;return d&&(s=a.deserialize(e)),new t(r,s)}};export{o as a};
2
- //# sourceMappingURL=chunk-P6GWG2CY.mjs.map
1
+ import{a as n}from"./chunk-53INTTOI.mjs";import{b as a}from"./chunk-QRS4DGP3.mjs";import{a as i}from"./chunk-36QXVFR5.mjs";var o=class t extends i{constructor(e,r){super(),this.rawTransaction=e,this.feePayerAddress=r}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let r=n.deserialize(e),d=e.deserializeBool(),s;return d&&(s=a.deserialize(e)),new t(r,s)}};export{o as a};
2
+ //# sourceMappingURL=chunk-JX75UKJX.mjs.map
@@ -1,2 +1,2 @@
1
- import{spawn as i}from"child_process";var n=class{async init(r){let{network:t,profile:e}=r,s=["aptos","init",`--network=${t??"local"}`,`--profile=${e??"default"}`];return this.runCommand(s)}async compile(r){let{packageDirectoryPath:t,namedAddresses:e}=r,s=["aptos","move","compile","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(o)),this.runCommand(s)}async test(r){let{packageDirectoryPath:t,namedAddresses:e}=r,s=["aptos","move","test","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(o)),this.runCommand(s)}async publish(r){let{packageDirectoryPath:t,namedAddresses:e,profile:s}=r,o=["aptos","move","publish","--package-dir",t,"--skip-fetch-latest-git-deps",`--profile=${s??"default"}`],a=this.parseNamedAddresses(e);return o.push(...this.prepareNamedAddresses(a)),this.runCommand(o)}async runCommand(r){return new Promise((t,e)=>{let s=i("npx",r,{shell:!0});s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr),process.stdin.pipe(s.stdin),s.on("close",o=>{o===0?t(!0):e(new Error(`Child process exited with code ${o}`))})})}prepareNamedAddresses(r){let t=r.size,e=[];if(t===0)return e;e.push("--named-addresses");let s=0;return r.forEach((o,a)=>{s+=1;let d=`${a}=${o.toString()}`;s<t-1&&(d+=","),e.push(d)}),e}parseNamedAddresses(r){let t=new Map;return Object.keys(r).forEach(e=>{let s=r[e];t.set(e,s)}),t}};export{n as a};
2
- //# sourceMappingURL=chunk-QSHLNSUP.mjs.map
1
+ import{spawn as i}from"child_process";var n=class{async init(r){let{network:t,profile:e}=r,s=["aptos","init",`--network=${t??"local"}`,`--profile=${e??"default"}`];return this.runCommand(s)}async compile(r){let{packageDirectoryPath:t,namedAddresses:e}=r,s=["aptos","move","compile","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(o)),this.runCommand(s)}async test(r){let{packageDirectoryPath:t,namedAddresses:e}=r,s=["aptos","move","test","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return s.push(...this.prepareNamedAddresses(o)),this.runCommand(s)}async publish(r){let{packageDirectoryPath:t,namedAddresses:e,profile:s}=r,o=["aptos","move","publish","--package-dir",t,"--skip-fetch-latest-git-deps",`--profile=${s??"default"}`],a=this.parseNamedAddresses(e);return o.push(...this.prepareNamedAddresses(a)),this.runCommand(o)}async runCommand(r){return new Promise((t,e)=>{let s=i("npx",r);s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr),process.stdin.pipe(s.stdin),s.on("close",o=>{o===0?t(!0):e(new Error(`Child process exited with code ${o}`))})})}prepareNamedAddresses(r){let t=r.size,e=[];if(t===0)return e;e.push("--named-addresses");let s=0;return r.forEach((o,a)=>{s+=1;let d=`${a}=${o.toString()}`;s<t-1&&(d+=","),e.push(d)}),e}parseNamedAddresses(r){let t=new Map;return Object.keys(r).forEach(e=>{let s=r[e];t.set(e,s)}),t}};export{n as a};
2
+ //# sourceMappingURL=chunk-LDQ6JFEF.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/move.ts"],"sourcesContent":["import { spawn } from \"child_process\";\nimport { AccountAddress } from \"../core\";\nimport { Network } from \"../utils\";\n\nexport class Move {\n /**\n * Function to initialize current directory for Aptos\n *\n * Configuration will be pushed into .aptos/config.yaml\n * @param args.network optional Netowrk type argument to use for default settings, default is local\n * @param args.profile optional Profile to use from the config file, default is 'default'\n * This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.\n *\n * @returns\n */\n async init(args: { network?: Network; profile?: string }): Promise<boolean> {\n const { network, profile } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to compile a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to run Move unit tests for a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async test(args: { packageDirectoryPath: string; namedAddresses: Record<string, AccountAddress> }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to publishe the modules in a Move package to the Aptos blockchain\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n *\n * @returns\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses, profile } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--skip-fetch-latest-git-deps\",\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const childProcess = spawn(\"npx\", args, { shell: true });\n\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n resolve(true); // Resolve with true if the child process exits successfully\n } else {\n reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code\n }\n });\n });\n }\n\n /**\n * Convert named addresses from a Map into an array seperated by a comma\n *\n * @example\n * input: {'alice' => '0x123', 'bob' => '0x456'}\n * output: \"alice=0x123,bob=0x456\"\n *\n * @param namedAddresses\n * @returns An array of names addresses seperated by a comma\n */\n // eslint-disable-next-line class-methods-use-this\n private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {\n const totalNames = namedAddresses.size;\n const newArgs: Array<string> = [];\n\n if (totalNames === 0) {\n return newArgs;\n }\n\n newArgs.push(\"--named-addresses\");\n\n let idx = 0;\n namedAddresses.forEach((value, key) => {\n idx += 1;\n let toAppend = `${key}=${value.toString()}`;\n if (idx < totalNames - 1) {\n toAppend += \",\";\n }\n newArgs.push(toAppend);\n });\n return newArgs;\n }\n\n /**\n * Parse named addresses from a Record type into a Map\n *\n * @param namedAddresses\n * @returns Map<name,address>\n */\n // eslint-disable-next-line class-methods-use-this\n private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {\n const addressesMap = new Map();\n\n Object.keys(namedAddresses).forEach((key) => {\n const address = namedAddresses[key];\n addressesMap.set(key, address);\n });\n\n return addressesMap;\n }\n}\n"],"mappings":"AAAA,OAAS,SAAAA,MAAa,gBAIf,IAAMC,EAAN,KAAW,CAWhB,MAAM,KAAKC,EAAiE,CAC1E,GAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAIF,EACvBG,EAAU,CAAC,QAAS,OAAQ,aAAaF,GAAW,OAAO,GAAI,aAAaC,GAAW,SAAS,EAAE,EAExG,OAAO,KAAK,WAAWC,CAAO,CAChC,CAcA,MAAM,QAAQH,EAGO,CACnB,GAAM,CAAE,qBAAAI,EAAsB,eAAAC,CAAe,EAAIL,EAC3CG,EAAU,CAAC,QAAS,OAAQ,UAAW,gBAAiBC,EAAsB,8BAA8B,EAE5GE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEjD,KAAK,WAAWH,CAAO,CAChC,CAcA,MAAM,KAAKH,EAA0G,CACnH,GAAM,CAAE,qBAAAI,EAAsB,eAAAC,CAAe,EAAIL,EAC3CG,EAAU,CAAC,QAAS,OAAQ,OAAQ,gBAAiBC,EAAsB,8BAA8B,EAEzGE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEjD,KAAK,WAAWH,CAAO,CAChC,CAeA,MAAM,QAAQH,EAIO,CACnB,GAAM,CAAE,qBAAAI,EAAsB,eAAAC,EAAgB,QAAAH,CAAQ,EAAIF,EACpDG,EAAU,CACd,QACA,OACA,UACA,gBACAC,EACA,+BACA,aAAaF,GAAW,SAAS,EACnC,EAEMI,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEjD,KAAK,WAAWH,CAAO,CAChC,CASA,MAAc,WAAWH,EAAuC,CAC9D,OAAO,IAAI,QAAQ,CAACO,EAASC,IAAW,CACtC,IAAMC,EAAeX,EAAM,MAAOE,EAAM,CAAE,MAAO,EAAK,CAAC,EAEvDS,EAAa,OAAO,KAAK,QAAQ,MAAM,EACvCA,EAAa,OAAO,KAAK,QAAQ,MAAM,EACvC,QAAQ,MAAM,KAAKA,EAAa,KAAK,EAErCA,EAAa,GAAG,QAAUC,GAAS,CAC7BA,IAAS,EACXH,EAAQ,EAAI,EAEZC,EAAO,IAAI,MAAM,kCAAkCE,CAAI,EAAE,CAAC,CAE9D,CAAC,CACH,CAAC,CACH,CAaQ,sBAAsBL,EAA4D,CACxF,IAAMM,EAAaN,EAAe,KAC5BO,EAAyB,CAAC,EAEhC,GAAID,IAAe,EACjB,OAAOC,EAGTA,EAAQ,KAAK,mBAAmB,EAEhC,IAAIC,EAAM,EACV,OAAAR,EAAe,QAAQ,CAACS,EAAOC,IAAQ,CACrCF,GAAO,EACP,IAAIG,EAAW,GAAGD,CAAG,IAAID,EAAM,SAAS,CAAC,GACrCD,EAAMF,EAAa,IACrBK,GAAY,KAEdJ,EAAQ,KAAKI,CAAQ,CACvB,CAAC,EACMJ,CACT,CASQ,oBAAoBP,EAA6E,CACvG,IAAMC,EAAe,IAAI,IAEzB,cAAO,KAAKD,CAAc,EAAE,QAASU,GAAQ,CAC3C,IAAME,EAAUZ,EAAeU,CAAG,EAClCT,EAAa,IAAIS,EAAKE,CAAO,CAC/B,CAAC,EAEMX,CACT,CACF","names":["spawn","Move","args","network","profile","cliArgs","packageDirectoryPath","namedAddresses","addressesMap","resolve","reject","childProcess","code","totalNames","newArgs","idx","value","key","toAppend","address"]}
1
+ {"version":3,"sources":["../../src/cli/move.ts"],"sourcesContent":["import { spawn } from \"child_process\";\nimport { AccountAddress } from \"../core\";\nimport { Network } from \"../utils\";\n\nexport class Move {\n /**\n * Function to initialize current directory for Aptos\n *\n * Configuration will be pushed into .aptos/config.yaml\n * @param args.network optional Netowrk type argument to use for default settings, default is local\n * @param args.profile optional Profile to use from the config file, default is 'default'\n * This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.\n *\n * @returns\n */\n async init(args: { network?: Network; profile?: string }): Promise<boolean> {\n const { network, profile } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to compile a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to run Move unit tests for a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async test(args: { packageDirectoryPath: string; namedAddresses: Record<string, AccountAddress> }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to publishe the modules in a Move package to the Aptos blockchain\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n *\n * @returns\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses, profile } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--skip-fetch-latest-git-deps\",\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const childProcess = spawn(\"npx\", args);\n\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n resolve(true); // Resolve with true if the child process exits successfully\n } else {\n reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code\n }\n });\n });\n }\n\n /**\n * Convert named addresses from a Map into an array seperated by a comma\n *\n * @example\n * input: {'alice' => '0x123', 'bob' => '0x456'}\n * output: \"alice=0x123,bob=0x456\"\n *\n * @param namedAddresses\n * @returns An array of names addresses seperated by a comma\n */\n // eslint-disable-next-line class-methods-use-this\n private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {\n const totalNames = namedAddresses.size;\n const newArgs: Array<string> = [];\n\n if (totalNames === 0) {\n return newArgs;\n }\n\n newArgs.push(\"--named-addresses\");\n\n let idx = 0;\n namedAddresses.forEach((value, key) => {\n idx += 1;\n let toAppend = `${key}=${value.toString()}`;\n if (idx < totalNames - 1) {\n toAppend += \",\";\n }\n newArgs.push(toAppend);\n });\n return newArgs;\n }\n\n /**\n * Parse named addresses from a Record type into a Map\n *\n * @param namedAddresses\n * @returns Map<name,address>\n */\n // eslint-disable-next-line class-methods-use-this\n private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {\n const addressesMap = new Map();\n\n Object.keys(namedAddresses).forEach((key) => {\n const address = namedAddresses[key];\n addressesMap.set(key, address);\n });\n\n return addressesMap;\n }\n}\n"],"mappings":"AAAA,OAAS,SAAAA,MAAa,gBAIf,IAAMC,EAAN,KAAW,CAWhB,MAAM,KAAKC,EAAiE,CAC1E,GAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAIF,EACvBG,EAAU,CAAC,QAAS,OAAQ,aAAaF,GAAW,OAAO,GAAI,aAAaC,GAAW,SAAS,EAAE,EAExG,OAAO,KAAK,WAAWC,CAAO,CAChC,CAcA,MAAM,QAAQH,EAGO,CACnB,GAAM,CAAE,qBAAAI,EAAsB,eAAAC,CAAe,EAAIL,EAC3CG,EAAU,CAAC,QAAS,OAAQ,UAAW,gBAAiBC,EAAsB,8BAA8B,EAE5GE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEjD,KAAK,WAAWH,CAAO,CAChC,CAcA,MAAM,KAAKH,EAA0G,CACnH,GAAM,CAAE,qBAAAI,EAAsB,eAAAC,CAAe,EAAIL,EAC3CG,EAAU,CAAC,QAAS,OAAQ,OAAQ,gBAAiBC,EAAsB,8BAA8B,EAEzGE,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEjD,KAAK,WAAWH,CAAO,CAChC,CAeA,MAAM,QAAQH,EAIO,CACnB,GAAM,CAAE,qBAAAI,EAAsB,eAAAC,EAAgB,QAAAH,CAAQ,EAAIF,EACpDG,EAAU,CACd,QACA,OACA,UACA,gBACAC,EACA,+BACA,aAAaF,GAAW,SAAS,EACnC,EAEMI,EAAe,KAAK,oBAAoBD,CAAc,EAE5D,OAAAF,EAAQ,KAAK,GAAG,KAAK,sBAAsBG,CAAY,CAAC,EAEjD,KAAK,WAAWH,CAAO,CAChC,CASA,MAAc,WAAWH,EAAuC,CAC9D,OAAO,IAAI,QAAQ,CAACO,EAASC,IAAW,CACtC,IAAMC,EAAeX,EAAM,MAAOE,CAAI,EAEtCS,EAAa,OAAO,KAAK,QAAQ,MAAM,EACvCA,EAAa,OAAO,KAAK,QAAQ,MAAM,EACvC,QAAQ,MAAM,KAAKA,EAAa,KAAK,EAErCA,EAAa,GAAG,QAAUC,GAAS,CAC7BA,IAAS,EACXH,EAAQ,EAAI,EAEZC,EAAO,IAAI,MAAM,kCAAkCE,CAAI,EAAE,CAAC,CAE9D,CAAC,CACH,CAAC,CACH,CAaQ,sBAAsBL,EAA4D,CACxF,IAAMM,EAAaN,EAAe,KAC5BO,EAAyB,CAAC,EAEhC,GAAID,IAAe,EACjB,OAAOC,EAGTA,EAAQ,KAAK,mBAAmB,EAEhC,IAAIC,EAAM,EACV,OAAAR,EAAe,QAAQ,CAACS,EAAOC,IAAQ,CACrCF,GAAO,EACP,IAAIG,EAAW,GAAGD,CAAG,IAAID,EAAM,SAAS,CAAC,GACrCD,EAAMF,EAAa,IACrBK,GAAY,KAEdJ,EAAQ,KAAKI,CAAQ,CACvB,CAAC,EACMJ,CACT,CASQ,oBAAoBP,EAA6E,CACvG,IAAMC,EAAe,IAAI,IAEzB,cAAO,KAAKD,CAAc,EAAE,QAASU,GAAQ,CAC3C,IAAME,EAAUZ,EAAeU,CAAG,EAClCT,EAAa,IAAIS,EAAKE,CAAO,CAC/B,CAAC,EAEMX,CACT,CACF","names":["spawn","Move","args","network","profile","cliArgs","packageDirectoryPath","namedAddresses","addressesMap","resolve","reject","childProcess","code","totalNames","newArgs","idx","value","key","toAppend","address"]}
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-GKJ2NJG5.mjs";import{a}from"./chunk-PLXGSUZA.mjs";import{a as c}from"./chunk-TT2XR5ZI.mjs";import{a as f}from"./chunk-UKSRF2Q3.mjs";import{a as g}from"./chunk-GIAABV7R.mjs";import{a as l}from"./chunk-J6OFSYUA.mjs";import{a as u}from"./chunk-QIHR7HD6.mjs";import{a as m}from"./chunk-JB5H65CE.mjs";import{a as s}from"./chunk-ACG4ZGRQ.mjs";import{a as p}from"./chunk-QQ5PHEJF.mjs";import{a as A}from"./chunk-RTSWVT2Q.mjs";import{a as r}from"./chunk-XBHFMNYB.mjs";var t=class{constructor(i){this.config=new A(i),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new u(this.config),this.transaction=new h(this.config),this.table=new m(this.config)}};function n(y,i,d){Object.getOwnPropertyNames(i.prototype).forEach(e=>{let o=Object.getOwnPropertyDescriptor(i.prototype,e);o&&(o.value=function(...b){return this[d][e](...b)},Object.defineProperty(y.prototype,e,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,u,"staking");n(t,h,"transaction");n(t,m,"table");export{t as a};
2
- //# sourceMappingURL=chunk-WXWWYH73.mjs.map
1
+ import{a as l}from"./chunk-F7NLNWHN.mjs";import{a as u}from"./chunk-RT6LEYHZ.mjs";import{a as m}from"./chunk-UR3JTLIT.mjs";import{a as h}from"./chunk-H6FEXRTK.mjs";import{a as p}from"./chunk-YK63A5T6.mjs";import{a as A}from"./chunk-RTSWVT2Q.mjs";import{a as r}from"./chunk-GUALXVFI.mjs";import{a}from"./chunk-WNPL4SEJ.mjs";import{a as c}from"./chunk-NGQR5UQ3.mjs";import{a as f}from"./chunk-EA2DKJPX.mjs";import{a as g}from"./chunk-3Y46WJUR.mjs";import{a as s}from"./chunk-CHWE77CR.mjs";var t=class{constructor(i){this.config=new A(i),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new u(this.config),this.transaction=new h(this.config),this.table=new m(this.config)}};function n(y,i,d){Object.getOwnPropertyNames(i.prototype).forEach(e=>{let o=Object.getOwnPropertyDescriptor(i.prototype,e);o&&(o.value=function(...b){return this[d][e](...b)},Object.defineProperty(y.prototype,e,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,u,"staking");n(t,h,"transaction");n(t,m,"table");export{t as a};
2
+ //# sourceMappingURL=chunk-LQNPI3IR.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o,b as r,c as t,d as s}from"./chunk-XFSDV3ND.mjs";import{a as n}from"./chunk-5YLAWRI2.mjs";var i=class{constructor(e){this.config=e}async getModuleEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),o({aptosConfig:this.config,...e})}async getAccountEventsByCreationNumber(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),r({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),t({aptosConfig:this.config,...e})}async getEvents(e){return await n({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"events_processor"}),s({aptosConfig:this.config,...e})}};export{i as a};
2
- //# sourceMappingURL=chunk-TT2XR5ZI.mjs.map
1
+ import{a as o,b as r,c as t,d as s}from"./chunk-XFSDV3ND.mjs";import{a as n}from"./chunk-A4JUQZXI.mjs";var i=class{constructor(e){this.config=e}async getModuleEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),o({aptosConfig:this.config,...e})}async getAccountEventsByCreationNumber(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),r({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),t({aptosConfig:this.config,...e})}async getEvents(e){return await n({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"events_processor"}),s({aptosConfig:this.config,...e})}};export{i as a};
2
+ //# sourceMappingURL=chunk-NGQR5UQ3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g,f as d,g as C,i as w}from"./chunk-TGQARO3F.mjs";import{a as I}from"./chunk-3HSXKDOC.mjs";import{b as f}from"./chunk-YMB2XW2O.mjs";import{a as P}from"./chunk-2YZSEM2G.mjs";import{d as l}from"./chunk-JFIAWBCK.mjs";import{a as T}from"./chunk-GM56MMNJ.mjs";import{c as A,m as s}from"./chunk-U3YYSIIT.mjs";import{b as p}from"./chunk-QRS4DGP3.mjs";import{a as r}from"./chunk-G56GPLTB.mjs";import{b as y}from"./chunk-SRDIYE3M.mjs";async function b(t){let a=await h(t);return x(t,a)}async function h(t){let{aptosConfig:a,data:n}=t,e,o;return"bytecode"in n?o=await g(n):"multisigAddress"in n?(e={aptosConfig:a,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)):(e={aptosConfig:a,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)),o}async function x(t,a){let{aptosConfig:n,sender:e,options:o}=t,i;if(D(t)&&(i=p.ZERO.toString()),G(t)){let{secondarySignerAddresses:c}=t;return d({aptosConfig:n,sender:e,payload:a,options:o,secondarySignerAddresses:c,feePayerAddress:i})}return d({aptosConfig:n,sender:e,payload:a,options:o,feePayerAddress:i})}function D(t){return t.withFeePayer===!0}function G(t){return"secondarySignerAddresses"in t}function Q(t){let{transaction:a}=t;return l(a)}function U(t){let{signer:a,transaction:n}=t;return a.signTransactionWithAuthenticator(n)}async function X(t){let{aptosConfig:a,transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}=t,u=C({transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}),{data:m}=await f({aptosConfig:a,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return m}async function _(t){let{aptosConfig:a}=t,n=w({...t}),{data:e}=await f({aptosConfig:a,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return e}async function K(t){let{aptosConfig:a,signer:n,transaction:e}=t,o=U({signer:n,transaction:e});return _({aptosConfig:a,transaction:e,senderAuthenticator:o})}var B={typeParameters:[],parameters:[s.u8(),new s(s.u8())]};async function Y(t){let{aptosConfig:a,account:n,metadataBytes:e,moduleBytecode:o,options:i}=t,c=o.map(u=>r.U8(u));return b({aptosConfig:a,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[r.U8(e),new r(c)],abi:B},options:i})}var M={typeParameters:[],parameters:[new A,s.u8(),new A,s.u8(),s.u8(),s.u8()]};async function $(t){let{aptosConfig:a,fromAccount:n,toNewPrivateKey:e}=t,o=await I({aptosConfig:a,accountAddress:n.accountAddress}),i=P.fromPrivateKey({privateKey:e,legacy:!0}),u=new T({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),m=n.sign(u),S=i.sign(u),R=await b({aptosConfig:a,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new y(n.signingScheme),r.U8(n.publicKey.toUint8Array()),new y(i.signingScheme),r.U8(i.publicKey.toUint8Array()),r.U8(m.toUint8Array()),r.U8(S.toUint8Array())],abi:M}});return K({aptosConfig:a,signer:n,transaction:R})}export{b as a,h as b,x as c,Q as d,U as e,X as f,_ as g,K as h,Y as i,$ as j};
2
- //# sourceMappingURL=chunk-K7HX7JQH.mjs.map
1
+ import{a as g,f as d,g as C,i as w}from"./chunk-RFZ5LTGP.mjs";import{a as I}from"./chunk-FFGY7Z4B.mjs";import{b as f}from"./chunk-YMB2XW2O.mjs";import{a as P}from"./chunk-WN3JL7ZT.mjs";import{d as l}from"./chunk-PZ4SAXY7.mjs";import{a as T}from"./chunk-GM56MMNJ.mjs";import{c as A,m as s}from"./chunk-U3YYSIIT.mjs";import{b as p}from"./chunk-QRS4DGP3.mjs";import{a as r}from"./chunk-G56GPLTB.mjs";import{b as y}from"./chunk-SRDIYE3M.mjs";async function b(t){let a=await h(t);return x(t,a)}async function h(t){let{aptosConfig:a,data:n}=t,e,o;return"bytecode"in n?o=await g(n):"multisigAddress"in n?(e={aptosConfig:a,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)):(e={aptosConfig:a,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},o=await g(e)),o}async function x(t,a){let{aptosConfig:n,sender:e,options:o}=t,i;if(D(t)&&(i=p.ZERO.toString()),G(t)){let{secondarySignerAddresses:c}=t;return d({aptosConfig:n,sender:e,payload:a,options:o,secondarySignerAddresses:c,feePayerAddress:i})}return d({aptosConfig:n,sender:e,payload:a,options:o,feePayerAddress:i})}function D(t){return t.withFeePayer===!0}function G(t){return"secondarySignerAddresses"in t}function Q(t){let{transaction:a}=t;return l(a)}function U(t){let{signer:a,transaction:n}=t;return a.signTransactionWithAuthenticator(n)}async function X(t){let{aptosConfig:a,transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}=t,u=C({transaction:n,signerPublicKey:e,secondarySignersPublicKeys:o,feePayerPublicKey:i,options:c}),{data:m}=await f({aptosConfig:a,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return m}async function _(t){let{aptosConfig:a}=t,n=w({...t}),{data:e}=await f({aptosConfig:a,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return e}async function K(t){let{aptosConfig:a,signer:n,transaction:e}=t,o=U({signer:n,transaction:e});return _({aptosConfig:a,transaction:e,senderAuthenticator:o})}var B={typeParameters:[],parameters:[s.u8(),new s(s.u8())]};async function Y(t){let{aptosConfig:a,account:n,metadataBytes:e,moduleBytecode:o,options:i}=t,c=o.map(u=>r.U8(u));return b({aptosConfig:a,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[r.U8(e),new r(c)],abi:B},options:i})}var M={typeParameters:[],parameters:[new A,s.u8(),new A,s.u8(),s.u8(),s.u8()]};async function $(t){let{aptosConfig:a,fromAccount:n,toNewPrivateKey:e}=t,o=await I({aptosConfig:a,accountAddress:n.accountAddress}),i=P.fromPrivateKey({privateKey:e,legacy:!0}),u=new T({sequenceNumber:BigInt(o.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(o.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),m=n.sign(u),S=i.sign(u),R=await b({aptosConfig:a,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new y(n.signingScheme),r.U8(n.publicKey.toUint8Array()),new y(i.signingScheme),r.U8(i.publicKey.toUint8Array()),r.U8(m.toUint8Array()),r.U8(S.toUint8Array())],abi:M}});return K({aptosConfig:a,signer:n,transaction:R})}export{b as a,h as b,x as c,Q as d,U as e,X as f,_ as g,K as h,Y as i,$ as j};
2
+ //# sourceMappingURL=chunk-O2K7RZWM.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-3N6N3KOS.mjs";import{a as b,b as g}from"./chunk-MCRRHBFQ.mjs";import{a as h,c as p}from"./chunk-T2AGN5YT.mjs";import{b as a}from"./chunk-QRS4DGP3.mjs";import{a as y}from"./chunk-36QXVFR5.mjs";var n=class extends y{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${r}`)}}},o=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=h.deserialize(e),t=p.deserialize(e);return new s(r,t)}},d=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=b.deserialize(e),t=g.deserialize(e);return new s(r,t)}},u=class s extends n{constructor(e,r,t){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i);return new s(r,t,c)}},l=class s extends n{constructor(e,r,t,c){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t,this.fee_payer=c}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i),_=a.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new s(r,t,c,S)}},A=class s extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=i.deserialize(e);return new s(r)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
2
- //# sourceMappingURL=chunk-AQAH67IV.mjs.map
1
+ import{a as i}from"./chunk-P5TZBE3L.mjs";import{a as b,b as g}from"./chunk-MCRRHBFQ.mjs";import{a as h,c as p}from"./chunk-T2AGN5YT.mjs";import{b as a}from"./chunk-QRS4DGP3.mjs";import{a as y}from"./chunk-36QXVFR5.mjs";var n=class extends y{static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${r}`)}}},o=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=h.deserialize(e),t=p.deserialize(e);return new s(r,t)}},d=class s extends n{constructor(e,r){super(),this.public_key=e,this.signature=r}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let r=b.deserialize(e),t=g.deserialize(e);return new s(r,t)}},u=class s extends n{constructor(e,r,t){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i);return new s(r,t,c)}},l=class s extends n{constructor(e,r,t,c){super(),this.sender=e,this.secondary_signer_addresses=r,this.secondary_signers=t,this.fee_payer=c}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let r=i.deserialize(e),t=e.deserializeVector(a),c=e.deserializeVector(i),_=a.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new s(r,t,c,S)}},A=class s extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let r=i.deserialize(e);return new s(r)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
2
+ //# sourceMappingURL=chunk-O4WVPLUX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-IZQV2SU6.mjs";import{a as m}from"./chunk-K7HX7JQH.mjs";import{e as A}from"./chunk-JQIGQMNZ.mjs";import{t as f}from"./chunk-S3EDNXZE.mjs";import{b as w}from"./chunk-QRS4DGP3.mjs";var T=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function E(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[n,t,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!E(n))throw new Error(`${n} is not valid. ${T}`);if(t&&!E(t))throw new Error(`${t} is not valid. ${T}`);return{domainName:t||n,subdomainName:t?n:void 0}}var z="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",G="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",P={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:G,custom:null,devnet:null};function d(e){let n=P[e.network];if(!n)throw new Error(`The ANS contract is not deployed to ${e.network}`);return n}var b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function V(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function j(e){let{aptosConfig:n,expiration:t,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:u}=e,p=d(n),{domainName:N,subdomainName:l}=c(o),S=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(l&&!S)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(S&&!l)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let h=t.years??1;if(h!==1)throw new Error("For now, names can only be registered for 1 year at a time");let D=h*31536e3;return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[N,D,s,i]},options:a})}if(!l)throw new Error(`${t.policy} requires a subdomain to be provided.`);let _=await I({aptosConfig:n,name:N});if(!_)throw new Error("The domain does not exist");let x=t.policy==="subdomain:independent"?t.expirationDate:_;if(x>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[N,l,Math.round(x/1e3),t.policy==="subdomain:follow-domain"?1:0,!!u,s,i]},options:a})}async function I(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t);try{let i=await g({aptosConfig:n,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,s]}});return Number(i[0])*1e3}catch{return}}async function Y(e){let{aptosConfig:n,address:t}=e,o=d(n),r=await g({aptosConfig:n,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(t).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function K(e){let{aptosConfig:n,sender:t,name:o,options:r}=e,s=d(n);if(!o)return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function W(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function F(e){let{aptosConfig:n,sender:t,name:o,address:r,options:s}=e,i=d(n),{domainName:a,subdomainName:u}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,u,r]},options:s})}async function H(e){let{aptosConfig:n,name:t}=e,{domainName:o,subdomainName:r=""}=c(t),a=(await A({aptosConfig:n,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r},is_active:{_eq:!0}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=y(a)),a}async function J(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountNames",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(y)}async function X(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountDomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(y)}async function Z(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(y)}async function ee(e){let{aptosConfig:n,options:t,domain:o}=e;return(await A({aptosConfig:n,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""},is_active:{_eq:!0}}}}})).current_aptos_names.map(y)}async function C(e){let{aptosConfig:n}=e,t=d(n),[o]=await g({aptosConfig:n,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function ne(e){let{aptosConfig:n,sender:t,name:o,years:r=1,options:s}=e,i=d(n),a=r*31536e3,{domainName:u,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[u,a]},options:s})}function y(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).getTime()}}export{T as a,E as b,c,z as d,G as e,V as f,j as g,I as h,Y as i,K as j,W as k,F as l,H as m,J as n,X as o,Z as p,ee as q,ne as r};
2
- //# sourceMappingURL=chunk-XD46HTI2.mjs.map
1
+ import{a as g}from"./chunk-UW2FPXYA.mjs";import{a as m}from"./chunk-O2K7RZWM.mjs";import{e as A}from"./chunk-JQIGQMNZ.mjs";import{t as f}from"./chunk-S3EDNXZE.mjs";import{b as w}from"./chunk-QRS4DGP3.mjs";var T=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function E(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[n,t,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!E(n))throw new Error(`${n} is not valid. ${T}`);if(t&&!E(t))throw new Error(`${t} is not valid. ${T}`);return{domainName:t||n,subdomainName:t?n:void 0}}var z="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",G="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",P={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:G,custom:null,devnet:null};function d(e){let n=P[e.network];if(!n)throw new Error(`The ANS contract is not deployed to ${e.network}`);return n}var b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function V(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function j(e){let{aptosConfig:n,expiration:t,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:u}=e,p=d(n),{domainName:N,subdomainName:l}=c(o),S=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(l&&!S)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(S&&!l)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let h=t.years??1;if(h!==1)throw new Error("For now, names can only be registered for 1 year at a time");let D=h*31536e3;return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[N,D,s,i]},options:a})}if(!l)throw new Error(`${t.policy} requires a subdomain to be provided.`);let _=await I({aptosConfig:n,name:N});if(!_)throw new Error("The domain does not exist");let x=t.policy==="subdomain:independent"?t.expirationDate:_;if(x>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await m({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[N,l,Math.round(x/1e3),t.policy==="subdomain:follow-domain"?1:0,!!u,s,i]},options:a})}async function I(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t);try{let i=await g({aptosConfig:n,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,s]}});return Number(i[0])*1e3}catch{return}}async function Y(e){let{aptosConfig:n,address:t}=e,o=d(n),r=await g({aptosConfig:n,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(t).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function K(e){let{aptosConfig:n,sender:t,name:o,options:r}=e,s=d(n);if(!o)return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function W(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await g({aptosConfig:n,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,s]}}),a=b(i[0]);return a?w.from(a):void 0}async function F(e){let{aptosConfig:n,sender:t,name:o,address:r,options:s}=e,i=d(n),{domainName:a,subdomainName:u}=c(o);return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,u,r]},options:s})}async function H(e){let{aptosConfig:n,name:t}=e,{domainName:o,subdomainName:r=""}=c(t),a=(await A({aptosConfig:n,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r},is_active:{_eq:!0}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=y(a)),a}async function J(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountNames",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(y)}async function X(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountDomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(y)}async function Z(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await A({aptosConfig:n,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(y)}async function ee(e){let{aptosConfig:n,options:t,domain:o}=e;return(await A({aptosConfig:n,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""},is_active:{_eq:!0}}}}})).current_aptos_names.map(y)}async function C(e){let{aptosConfig:n}=e,t=d(n),[o]=await g({aptosConfig:n,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function ne(e){let{aptosConfig:n,sender:t,name:o,years:r=1,options:s}=e,i=d(n),a=r*31536e3,{domainName:u,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await m({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[u,a]},options:s})}function y(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).getTime()}}export{T as a,E as b,c,z as d,G as e,V as f,j as g,I as h,Y as i,K as j,W as k,F as l,H as m,J as n,X as o,Z as p,ee as q,ne as r};
2
+ //# sourceMappingURL=chunk-P46OPJB4.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d,b}from"./chunk-MCRRHBFQ.mjs";import{a as h,b as z}from"./chunk-PIVZMT5D.mjs";import{a as p,b as g}from"./chunk-IENCDVPF.mjs";import{a as o,c as y}from"./chunk-T2AGN5YT.mjs";import{a as c}from"./chunk-36QXVFR5.mjs";var r=class extends c{static deserialize(i){let e=i.deserializeUleb128AsU32();switch(e){case 0:return u.load(i);case 1:return l.load(i);case 2:return n.load(i);case 3:return a.load(i);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}isEd25519(){return this instanceof u}isMultiEd25519(){return this instanceof l}isSingleKey(){return this instanceof n}isMultiKey(){return this instanceof a}},u=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=o.deserialize(i),s=y.deserialize(i);return new t(e,s)}},l=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),s=b.deserialize(i);return new t(e,s)}},n=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),s=g.deserialize(i);return new t(e,s)}},a=class t extends r{constructor(i,e){super(),this.public_keys=i,this.signatures=e}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),this.signatures.serialize(i)}static load(i){let e=h.deserialize(i),s=z.deserialize(i);return new t(e,s)}};export{r as a,u as b,l as c,n as d,a as e};
2
- //# sourceMappingURL=chunk-3N6N3KOS.mjs.map
1
+ import{a as h,b as z}from"./chunk-PIVZMT5D.mjs";import{a as p,b as g}from"./chunk-IENCDVPF.mjs";import{a as d,b}from"./chunk-MCRRHBFQ.mjs";import{a as o,c as y}from"./chunk-T2AGN5YT.mjs";import{a as c}from"./chunk-36QXVFR5.mjs";var r=class extends c{static deserialize(i){let e=i.deserializeUleb128AsU32();switch(e){case 0:return u.load(i);case 1:return l.load(i);case 2:return n.load(i);case 3:return a.load(i);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}isEd25519(){return this instanceof u}isMultiEd25519(){return this instanceof l}isSingleKey(){return this instanceof n}isMultiKey(){return this instanceof a}},u=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=o.deserialize(i),s=y.deserialize(i);return new t(e,s)}},l=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),s=b.deserialize(i);return new t(e,s)}},n=class t extends r{constructor(i,e){super(),this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),s=g.deserialize(i);return new t(e,s)}},a=class t extends r{constructor(i,e){super(),this.public_keys=i,this.signatures=e}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),this.signatures.serialize(i)}static load(i){let e=h.deserialize(i),s=z.deserialize(i);return new t(e,s)}};export{r as a,u as b,l as c,n as d,a as e};
2
+ //# sourceMappingURL=chunk-P5TZBE3L.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as T,d as c}from"./chunk-BO2TLWNT.mjs";import{f as A,g as a}from"./chunk-CYNQRMO5.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new T(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){let i=y.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);i.update(r);let s=i.digest(),o=e,t=new Uint8Array(s.length+o.length);return t.set(s),t.set(o,s.length),t}function u(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function S(e){let r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),a):e.secondarySignerAddresses?n(r.bcsToBytes(),a):n(r.bcsToBytes(),A)}export{d as a,n as b,u as c,S as d};
2
- //# sourceMappingURL=chunk-JFIAWBCK.mjs.map
1
+ import{c as T,d as c}from"./chunk-53INTTOI.mjs";import{f as A,g as a}from"./chunk-CYNQRMO5.mjs";import{sha3_256 as y}from"@noble/hashes/sha3";function d(e){return e.feePayerAddress?new c(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress):e.secondarySignerAddresses?new T(e.rawTransaction,e.secondarySignerAddresses):e.rawTransaction}function n(e,r){let i=y.create();if(!r.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${r}`);i.update(r);let s=i.digest(),o=e,t=new Uint8Array(s.length+o.length);return t.set(s),t.set(o,s.length),t}function u(e){return n(e.bcsToBytes(),`APTOS::${e.constructor.name}`)}function S(e){let r=d(e);return e.feePayerAddress?n(r.bcsToBytes(),a):e.secondarySignerAddresses?n(r.bcsToBytes(),a):n(r.bcsToBytes(),A)}export{d as a,n as b,u as c,S as d};
2
+ //# sourceMappingURL=chunk-PZ4SAXY7.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-K7HX7JQH.mjs";import{f as t,i as o}from"./chunk-U3YYSIIT.mjs";import{e as n}from"./chunk-CYNQRMO5.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
- //# sourceMappingURL=chunk-6JLYD5Q2.mjs.map
1
+ import{a as r}from"./chunk-O2K7RZWM.mjs";import{f as t,i as o}from"./chunk-U3YYSIIT.mjs";import{e as n}from"./chunk-CYNQRMO5.mjs";var u={typeParameters:[{constraints:[]}],parameters:[new o,new t]};async function y(e){let{aptosConfig:i,sender:s,recipient:c,amount:p,coinType:a,options:m}=e;return r({aptosConfig:i,sender:s,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[a??n],functionArguments:[c,p],abi:u},options:m})}export{y as a};
2
+ //# sourceMappingURL=chunk-R5ST36VJ.mjs.map