@aptos-labs/ts-sdk 1.13.1-zeta.1 → 1.13.1-zeta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/common/index.d.ts +0 -1
  2. package/dist/common/index.js +1 -1
  3. package/dist/common/index.js.map +1 -1
  4. package/dist/esm/account/Account.mjs +1 -1
  5. package/dist/esm/account/Ed25519Account.mjs +1 -1
  6. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  7. package/dist/esm/account/KeylessAccount.mjs +1 -1
  8. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  9. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  10. package/dist/esm/account/index.mjs +1 -1
  11. package/dist/esm/api/account.mjs +1 -1
  12. package/dist/esm/api/ans.mjs +1 -1
  13. package/dist/esm/api/aptos.mjs +1 -1
  14. package/dist/esm/api/coin.mjs +1 -1
  15. package/dist/esm/api/digitalAsset.mjs +1 -1
  16. package/dist/esm/api/event.mjs +1 -1
  17. package/dist/esm/api/faucet.mjs +1 -1
  18. package/dist/esm/api/fungibleAsset.mjs +1 -1
  19. package/dist/esm/api/general.mjs +1 -1
  20. package/dist/esm/api/index.mjs +1 -1
  21. package/dist/esm/api/keyless.d.mts +0 -1
  22. package/dist/esm/api/keyless.mjs +1 -1
  23. package/dist/esm/api/staking.mjs +1 -1
  24. package/dist/esm/api/transaction.d.mts +1 -1
  25. package/dist/esm/api/transaction.mjs +1 -1
  26. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  27. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  28. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  29. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  30. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  31. package/dist/esm/api/utils.mjs +1 -1
  32. package/dist/esm/{chunk-IO2NZ5PR.mjs → chunk-42ZSGMQO.mjs} +2 -2
  33. package/dist/esm/{chunk-VG2J3UTS.mjs → chunk-4VKZBIH7.mjs} +2 -2
  34. package/dist/esm/{chunk-2OTMSEHI.mjs → chunk-55BHW3A6.mjs} +2 -2
  35. package/dist/esm/{chunk-GVZZTEYV.mjs → chunk-55W7VV7Z.mjs} +2 -2
  36. package/dist/esm/{chunk-7YMBWSKN.mjs → chunk-5NKRMZEX.mjs} +2 -2
  37. package/dist/esm/{chunk-P2JP6PSD.mjs → chunk-6FEGU4XJ.mjs} +2 -2
  38. package/dist/esm/{chunk-VSWIMQAB.mjs → chunk-7BT2KH4T.mjs} +2 -2
  39. package/dist/esm/{chunk-QBWI223M.mjs → chunk-7CVJJZBP.mjs} +2 -2
  40. package/dist/esm/{chunk-LB4KMZNQ.mjs → chunk-7GO6HWMQ.mjs} +2 -2
  41. package/dist/esm/{chunk-AE7X4LVG.mjs → chunk-7URCUZPH.mjs} +2 -2
  42. package/dist/esm/{chunk-PSTPEDI3.mjs → chunk-AKW2HAKU.mjs} +2 -2
  43. package/dist/esm/{chunk-JP6UNRLO.mjs → chunk-AULJLLO5.mjs} +2 -2
  44. package/dist/esm/{chunk-COLCWAPL.mjs → chunk-BIRZ55IO.mjs} +2 -2
  45. package/dist/esm/{chunk-NKSAU5OX.mjs → chunk-BM43VTGD.mjs} +2 -2
  46. package/dist/esm/{chunk-N35ARFH3.mjs → chunk-BTEW6JF2.mjs} +2 -2
  47. package/dist/esm/{chunk-ASRAJ24P.mjs → chunk-CFGG43FJ.mjs} +2 -2
  48. package/dist/esm/{chunk-OQKD5SSG.mjs → chunk-CKMU5DQN.mjs} +2 -2
  49. package/dist/esm/{chunk-YIIDPNGQ.mjs → chunk-EESTYBZ5.mjs} +2 -2
  50. package/dist/esm/{chunk-WR5L4STD.mjs → chunk-EGFL5FCU.mjs} +2 -2
  51. package/dist/esm/{chunk-EGTGR3R4.mjs → chunk-F2OCQQAA.mjs} +2 -2
  52. package/dist/esm/{chunk-WAWBXQ6B.mjs → chunk-GSOKKQQ7.mjs} +2 -2
  53. package/dist/esm/chunk-IMGPWY3W.mjs +2 -0
  54. package/dist/esm/{chunk-CFJEOZMV.mjs.map → chunk-IMGPWY3W.mjs.map} +1 -1
  55. package/dist/esm/{chunk-YMVFNEBO.mjs → chunk-IXA3IGQT.mjs} +2 -2
  56. package/dist/esm/{chunk-HZFOKUQZ.mjs → chunk-JIX5F3BC.mjs} +2 -2
  57. package/dist/esm/{chunk-CW7JVCSV.mjs → chunk-JTFH6ACV.mjs} +2 -2
  58. package/dist/esm/{chunk-UMFYNNCG.mjs → chunk-JZ7UTFTR.mjs} +2 -2
  59. package/dist/esm/{chunk-NMYQ2LMC.mjs → chunk-K7ESGXR3.mjs} +2 -2
  60. package/dist/esm/{chunk-QEKSGA7S.mjs → chunk-KMPAYC5Z.mjs} +2 -2
  61. package/dist/esm/{chunk-6YDD6LGX.mjs → chunk-LODRH4QJ.mjs} +2 -2
  62. package/dist/esm/{chunk-ORMDVSRG.mjs → chunk-LXDHLUP4.mjs} +2 -2
  63. package/dist/esm/{chunk-YGWIVUJP.mjs → chunk-M3PUC5JD.mjs} +2 -2
  64. package/dist/esm/{chunk-SQNDWIVJ.mjs → chunk-MCSLNNV3.mjs} +2 -2
  65. package/dist/esm/{chunk-Y5DMKMLF.mjs → chunk-MUZPVCQF.mjs} +2 -2
  66. package/dist/esm/{chunk-B645DPPF.mjs → chunk-N37BFHNS.mjs} +2 -2
  67. package/dist/esm/{chunk-KFKE46CF.mjs → chunk-NG3IWN2V.mjs} +2 -2
  68. package/dist/esm/{chunk-QFK75K2K.mjs → chunk-NVN6BTXK.mjs} +2 -2
  69. package/dist/esm/{chunk-FB6T6ZQP.mjs → chunk-O63GDJY4.mjs} +2 -2
  70. package/dist/esm/{chunk-UAFAZSOH.mjs → chunk-P6EM7SA6.mjs} +2 -2
  71. package/dist/esm/{chunk-VSPQRNEG.mjs → chunk-PLB5ERQA.mjs} +2 -2
  72. package/dist/esm/{chunk-PCLBZIT4.mjs → chunk-PWPUAWER.mjs} +2 -2
  73. package/dist/esm/{chunk-MUEDPI2Z.mjs → chunk-PYFNAWZ5.mjs} +2 -2
  74. package/dist/esm/{chunk-BIU5KNPT.mjs → chunk-Q2Y6S77E.mjs} +2 -2
  75. package/dist/esm/{chunk-534GCQ37.mjs → chunk-QUJQWJB7.mjs} +2 -2
  76. package/dist/esm/{chunk-G4QU37E6.mjs → chunk-SI3UTR5R.mjs} +2 -2
  77. package/dist/esm/{chunk-W2MKEIHI.mjs → chunk-U24GVATE.mjs} +2 -2
  78. package/dist/esm/{chunk-6DA64TSG.mjs → chunk-UPVELRIE.mjs} +2 -2
  79. package/dist/esm/{chunk-D2DIZHP3.mjs → chunk-V76TXXWZ.mjs} +2 -2
  80. package/dist/esm/{chunk-M3VGAYMW.mjs → chunk-V7CRIOJF.mjs} +2 -2
  81. package/dist/esm/{chunk-I657KZIO.mjs → chunk-V7E4HC3Y.mjs} +2 -2
  82. package/dist/esm/{chunk-OF256KD5.mjs → chunk-VMR46ALO.mjs} +2 -2
  83. package/dist/esm/{chunk-SC7NXRMV.mjs → chunk-XFI6MEYQ.mjs} +2 -2
  84. package/dist/esm/{chunk-3OA7CG6N.mjs → chunk-XLTRVMUO.mjs} +2 -2
  85. package/dist/esm/{chunk-3OA7CG6N.mjs.map → chunk-XLTRVMUO.mjs.map} +1 -1
  86. package/dist/esm/{chunk-C2HDZYYQ.mjs → chunk-Z5GI2A3I.mjs} +2 -2
  87. package/dist/esm/{chunk-TCMSBGBS.mjs → chunk-ZSZCPOHE.mjs} +2 -2
  88. package/dist/esm/client/core.mjs +1 -1
  89. package/dist/esm/client/get.mjs +1 -1
  90. package/dist/esm/client/index.mjs +1 -1
  91. package/dist/esm/client/post.mjs +1 -1
  92. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  93. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  94. package/dist/esm/core/crypto/index.mjs +1 -1
  95. package/dist/esm/core/crypto/keyless.mjs +1 -1
  96. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  97. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  98. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  99. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  100. package/dist/esm/core/index.mjs +1 -1
  101. package/dist/esm/index.mjs +1 -1
  102. package/dist/esm/internal/account.mjs +1 -1
  103. package/dist/esm/internal/ans.mjs +1 -1
  104. package/dist/esm/internal/coin.mjs +1 -1
  105. package/dist/esm/internal/digitalAsset.mjs +1 -1
  106. package/dist/esm/internal/event.mjs +1 -1
  107. package/dist/esm/internal/faucet.mjs +1 -1
  108. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  109. package/dist/esm/internal/general.mjs +1 -1
  110. package/dist/esm/internal/keyless.mjs +1 -1
  111. package/dist/esm/internal/staking.mjs +1 -1
  112. package/dist/esm/internal/transaction.mjs +1 -1
  113. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  114. package/dist/esm/internal/view.mjs +1 -1
  115. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  116. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  117. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  118. package/dist/esm/transactions/index.mjs +1 -1
  119. package/dist/esm/transactions/instances/index.mjs +1 -1
  120. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  121. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  122. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  123. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  124. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  125. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  126. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  127. package/dist/esm/transactions/management/index.mjs +1 -1
  128. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  129. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  130. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  131. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  132. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  133. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  134. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  135. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  136. package/dist/esm/version.d.mts +1 -1
  137. package/dist/esm/version.mjs +1 -1
  138. package/package.json +1 -1
  139. package/src/api/keyless.ts +0 -1
  140. package/src/version.ts +1 -1
  141. package/dist/esm/chunk-CFJEOZMV.mjs +0 -2
  142. /package/dist/esm/{chunk-IO2NZ5PR.mjs.map → chunk-42ZSGMQO.mjs.map} +0 -0
  143. /package/dist/esm/{chunk-VG2J3UTS.mjs.map → chunk-4VKZBIH7.mjs.map} +0 -0
  144. /package/dist/esm/{chunk-2OTMSEHI.mjs.map → chunk-55BHW3A6.mjs.map} +0 -0
  145. /package/dist/esm/{chunk-GVZZTEYV.mjs.map → chunk-55W7VV7Z.mjs.map} +0 -0
  146. /package/dist/esm/{chunk-7YMBWSKN.mjs.map → chunk-5NKRMZEX.mjs.map} +0 -0
  147. /package/dist/esm/{chunk-P2JP6PSD.mjs.map → chunk-6FEGU4XJ.mjs.map} +0 -0
  148. /package/dist/esm/{chunk-VSWIMQAB.mjs.map → chunk-7BT2KH4T.mjs.map} +0 -0
  149. /package/dist/esm/{chunk-QBWI223M.mjs.map → chunk-7CVJJZBP.mjs.map} +0 -0
  150. /package/dist/esm/{chunk-LB4KMZNQ.mjs.map → chunk-7GO6HWMQ.mjs.map} +0 -0
  151. /package/dist/esm/{chunk-AE7X4LVG.mjs.map → chunk-7URCUZPH.mjs.map} +0 -0
  152. /package/dist/esm/{chunk-PSTPEDI3.mjs.map → chunk-AKW2HAKU.mjs.map} +0 -0
  153. /package/dist/esm/{chunk-JP6UNRLO.mjs.map → chunk-AULJLLO5.mjs.map} +0 -0
  154. /package/dist/esm/{chunk-COLCWAPL.mjs.map → chunk-BIRZ55IO.mjs.map} +0 -0
  155. /package/dist/esm/{chunk-NKSAU5OX.mjs.map → chunk-BM43VTGD.mjs.map} +0 -0
  156. /package/dist/esm/{chunk-N35ARFH3.mjs.map → chunk-BTEW6JF2.mjs.map} +0 -0
  157. /package/dist/esm/{chunk-ASRAJ24P.mjs.map → chunk-CFGG43FJ.mjs.map} +0 -0
  158. /package/dist/esm/{chunk-OQKD5SSG.mjs.map → chunk-CKMU5DQN.mjs.map} +0 -0
  159. /package/dist/esm/{chunk-YIIDPNGQ.mjs.map → chunk-EESTYBZ5.mjs.map} +0 -0
  160. /package/dist/esm/{chunk-WR5L4STD.mjs.map → chunk-EGFL5FCU.mjs.map} +0 -0
  161. /package/dist/esm/{chunk-EGTGR3R4.mjs.map → chunk-F2OCQQAA.mjs.map} +0 -0
  162. /package/dist/esm/{chunk-WAWBXQ6B.mjs.map → chunk-GSOKKQQ7.mjs.map} +0 -0
  163. /package/dist/esm/{chunk-YMVFNEBO.mjs.map → chunk-IXA3IGQT.mjs.map} +0 -0
  164. /package/dist/esm/{chunk-HZFOKUQZ.mjs.map → chunk-JIX5F3BC.mjs.map} +0 -0
  165. /package/dist/esm/{chunk-CW7JVCSV.mjs.map → chunk-JTFH6ACV.mjs.map} +0 -0
  166. /package/dist/esm/{chunk-UMFYNNCG.mjs.map → chunk-JZ7UTFTR.mjs.map} +0 -0
  167. /package/dist/esm/{chunk-NMYQ2LMC.mjs.map → chunk-K7ESGXR3.mjs.map} +0 -0
  168. /package/dist/esm/{chunk-QEKSGA7S.mjs.map → chunk-KMPAYC5Z.mjs.map} +0 -0
  169. /package/dist/esm/{chunk-6YDD6LGX.mjs.map → chunk-LODRH4QJ.mjs.map} +0 -0
  170. /package/dist/esm/{chunk-ORMDVSRG.mjs.map → chunk-LXDHLUP4.mjs.map} +0 -0
  171. /package/dist/esm/{chunk-YGWIVUJP.mjs.map → chunk-M3PUC5JD.mjs.map} +0 -0
  172. /package/dist/esm/{chunk-SQNDWIVJ.mjs.map → chunk-MCSLNNV3.mjs.map} +0 -0
  173. /package/dist/esm/{chunk-Y5DMKMLF.mjs.map → chunk-MUZPVCQF.mjs.map} +0 -0
  174. /package/dist/esm/{chunk-B645DPPF.mjs.map → chunk-N37BFHNS.mjs.map} +0 -0
  175. /package/dist/esm/{chunk-KFKE46CF.mjs.map → chunk-NG3IWN2V.mjs.map} +0 -0
  176. /package/dist/esm/{chunk-QFK75K2K.mjs.map → chunk-NVN6BTXK.mjs.map} +0 -0
  177. /package/dist/esm/{chunk-FB6T6ZQP.mjs.map → chunk-O63GDJY4.mjs.map} +0 -0
  178. /package/dist/esm/{chunk-UAFAZSOH.mjs.map → chunk-P6EM7SA6.mjs.map} +0 -0
  179. /package/dist/esm/{chunk-VSPQRNEG.mjs.map → chunk-PLB5ERQA.mjs.map} +0 -0
  180. /package/dist/esm/{chunk-PCLBZIT4.mjs.map → chunk-PWPUAWER.mjs.map} +0 -0
  181. /package/dist/esm/{chunk-MUEDPI2Z.mjs.map → chunk-PYFNAWZ5.mjs.map} +0 -0
  182. /package/dist/esm/{chunk-BIU5KNPT.mjs.map → chunk-Q2Y6S77E.mjs.map} +0 -0
  183. /package/dist/esm/{chunk-534GCQ37.mjs.map → chunk-QUJQWJB7.mjs.map} +0 -0
  184. /package/dist/esm/{chunk-G4QU37E6.mjs.map → chunk-SI3UTR5R.mjs.map} +0 -0
  185. /package/dist/esm/{chunk-W2MKEIHI.mjs.map → chunk-U24GVATE.mjs.map} +0 -0
  186. /package/dist/esm/{chunk-6DA64TSG.mjs.map → chunk-UPVELRIE.mjs.map} +0 -0
  187. /package/dist/esm/{chunk-D2DIZHP3.mjs.map → chunk-V76TXXWZ.mjs.map} +0 -0
  188. /package/dist/esm/{chunk-M3VGAYMW.mjs.map → chunk-V7CRIOJF.mjs.map} +0 -0
  189. /package/dist/esm/{chunk-I657KZIO.mjs.map → chunk-V7E4HC3Y.mjs.map} +0 -0
  190. /package/dist/esm/{chunk-OF256KD5.mjs.map → chunk-VMR46ALO.mjs.map} +0 -0
  191. /package/dist/esm/{chunk-SC7NXRMV.mjs.map → chunk-XFI6MEYQ.mjs.map} +0 -0
  192. /package/dist/esm/{chunk-C2HDZYYQ.mjs.map → chunk-Z5GI2A3I.mjs.map} +0 -0
  193. /package/dist/esm/{chunk-TCMSBGBS.mjs.map → chunk-ZSZCPOHE.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{f as n}from"./chunk-WAWBXQ6B.mjs";import{p as g,u as d}from"./chunk-S4SEFF4K.mjs";import{b as s}from"./chunk-U7EZI5D5.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
- //# sourceMappingURL=chunk-2OTMSEHI.mjs.map
1
+ import{f as n}from"./chunk-GSOKKQQ7.mjs";import{p as g,u as d}from"./chunk-S4SEFF4K.mjs";import{b as s}from"./chunk-U7EZI5D5.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
2
+ //# sourceMappingURL=chunk-55BHW3A6.mjs.map
@@ -1,2 +1,2 @@
1
- import{h as e}from"./chunk-OQKD5SSG.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-GVZZTEYV.mjs.map
1
+ import{h as e}from"./chunk-CKMU5DQN.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-55W7VV7Z.mjs.map
@@ -1,2 +1,2 @@
1
- import{i as o,o as l}from"./chunk-AE7X4LVG.mjs";import{a,c}from"./chunk-B645DPPF.mjs";import{a as n,c as s}from"./chunk-TCMSBGBS.mjs";import{a as p}from"./chunk-KX5ESZO7.mjs";import{b}from"./chunk-HZC6A3QL.mjs";import{a as y}from"./chunk-JYFKKB34.mjs";var f=class t extends b{constructor(e){super();if(this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:r,signature:i}=e;return i instanceof u?this.publicKey.verifySignature({message:r,signature:i.signature}):!1}authKey(){return y.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${r}`)}return new t(i)}static isPublicKey(e){return e instanceof t}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}},u=class t extends p{constructor(e){super();if(this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${r}`)}return new t(i)}};export{f as a,u as b};
2
- //# sourceMappingURL=chunk-7YMBWSKN.mjs.map
1
+ import{a,c}from"./chunk-N37BFHNS.mjs";import{i as o,o as l}from"./chunk-7URCUZPH.mjs";import{a as n,c as s}from"./chunk-ZSZCPOHE.mjs";import{b}from"./chunk-HZC6A3QL.mjs";import{a as p}from"./chunk-KX5ESZO7.mjs";import{a as y}from"./chunk-JYFKKB34.mjs";var f=class t extends b{constructor(e){super();if(this.publicKey=e,e instanceof n)this.variant=0;else if(e instanceof a)this.variant=1;else if(e instanceof o)this.variant=3;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:r,signature:i}=e;return i instanceof u?this.publicKey.verifySignature({message:r,signature:i.signature}):!1}authKey(){return y.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=n.deserialize(e);break;case 1:i=a.deserialize(e);break;case 3:i=o.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${r}`)}return new t(i)}static isPublicKey(e){return e instanceof t}isEd25519(){return this.publicKey instanceof n}isSecp256k1PublicKey(){return this.publicKey instanceof a}},u=class t extends p{constructor(e){super();if(this.signature=e,e instanceof s)this.variant=0;else if(e instanceof c)this.variant=1;else if(e instanceof l)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let r=e.deserializeUleb128AsU32(),i;switch(r){case 0:i=s.deserialize(e);break;case 1:i=c.deserialize(e);break;case 3:i=l.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${r}`)}return new t(i)}};export{f as a,u as b};
2
+ //# sourceMappingURL=chunk-5NKRMZEX.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-ASRAJ24P.mjs";import{h as t}from"./chunk-OQKD5SSG.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-P2JP6PSD.mjs.map
1
+ import{a as i}from"./chunk-CFGG43FJ.mjs";import{h as t}from"./chunk-CKMU5DQN.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-6FEGU4XJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-D2DIZHP3.mjs";import{f as M}from"./chunk-QFK75K2K.mjs";import{c as V}from"./chunk-IVBYTTN7.mjs";import{f as b}from"./chunk-WAWBXQ6B.mjs";import{n as x,w as E,x as G,y as q}from"./chunk-S4SEFF4K.mjs";import{b as w,f as v,i as h,l as A,m as f,n as s,q as p,s as g}from"./chunk-Q225PZMV.mjs";import{a as I,b as c}from"./chunk-35ZI4WOQ.mjs";import{a as T,e as S}from"./chunk-VVJEWB26.mjs";import{b as u}from"./chunk-U7EZI5D5.mjs";import{d as O}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},m="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:q,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function _t(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()},amount:{_gt:0}};return(await b({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function Pt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:u.from(n).toStringLong()},amount:{_gt:0}},i={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function kt(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:u.from(n).toStringLong()}},i={query:E,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var Q={typeParameters:[],parameters:[new s(p()),new v,new s(p()),new s(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new v,new v]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new c(t.description),new S(t.maxSupply??O),new c(t.name),new c(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new S(t.royaltyNumerator??0),new S(t.royaltyDenominator??1)],abi:Q},options:n})}async function U(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,i=u.from(n),a={collection_name:{_eq:e},creator_address:{_eq:i.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),(await b({aptosConfig:o,query:{query:x,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function St(t){let{aptosConfig:o,collectionId:n}=t,r={collection_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:x,variables:{where_condition:r}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function vt(t){return(await U(t)).collection_id}var F={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8())]};async function ht(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:i,name:a,uri:l,propertyKeys:y,propertyTypes:P,propertyValues:_}=t,k=P?.map(D=>C[D]);return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new c(r),new c(i),new c(a),new c(l),I.MoveString(y??[]),I.MoveString(k??[]),R(_??[],k??[])],abi:F},options:n})}var N={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new h]};async function xt(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[i??m],functionArguments:[u.from(e),u.from(r)],abi:N},options:a})}var Y={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8()),new h]};async function Gt(t){let{aptosConfig:o,account:n,collection:e,description:r,name:i,uri:a,recipient:l,propertyKeys:y,propertyTypes:P,propertyValues:_,options:k}=t;if(y?.length!==_?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==_?.length)throw new Error("Property types and property values counts do not match");let D=P?.map(K=>C[K]);return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,i,a,I.MoveString(y??[]),I.MoveString(D??[]),R(_??[],D??[]),l],abi:Y},options:k})}var z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Bt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??m],functionArguments:[u.from(e)],abi:z},options:i})}var L={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Ot(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:L},options:i})}var j={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Et(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:j},options:i})}var X={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function qt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Vt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Mt(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:J},options:a})}var W={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Rt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),I.U8(B(i,C[r]))],abi:W},options:y})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Kt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),B(i,C[r])],abi:$},options:y})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ut(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:tt},options:y})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:et},options:y})}function R(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=V(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,_t as b,Pt as c,kt as d,Dt as e,U as f,St as g,vt as h,ht as i,xt as j,Gt as k,Bt as l,Ot as m,Et as n,qt as o,Vt as p,Mt as q,Rt as r,Kt as s,Qt as t,Ut as u,Ft as v};
2
- //# sourceMappingURL=chunk-VSWIMQAB.mjs.map
1
+ import{a as d}from"./chunk-V76TXXWZ.mjs";import{f as M}from"./chunk-NVN6BTXK.mjs";import{c as V}from"./chunk-IVBYTTN7.mjs";import{f as b}from"./chunk-GSOKKQQ7.mjs";import{n as x,w as E,x as G,y as q}from"./chunk-S4SEFF4K.mjs";import{b as w,f as v,i as h,l as A,m as f,n as s,q as p,s as g}from"./chunk-Q225PZMV.mjs";import{a as I,b as c}from"./chunk-35ZI4WOQ.mjs";import{a as T,e as S}from"./chunk-VVJEWB26.mjs";import{b as u}from"./chunk-U7EZI5D5.mjs";import{d as O}from"./chunk-56CNRT2K.mjs";var C={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},m="0x4::token::Token";async function It(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:q,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function _t(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:u.from(n).toStringLong()},amount:{_gt:0}};return(await b({aptosConfig:o,query:{query:G,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function Pt(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:u.from(n).toStringLong()},amount:{_gt:0}},i={query:G,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function kt(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:u.from(n).toStringLong()}},i={query:E,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await b({aptosConfig:o,query:i,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var Q={typeParameters:[],parameters:[new s(p()),new v,new s(p()),new s(p()),new w,new w,new w,new w,new w,new w,new w,new w,new w,new v,new v]};async function Dt(t){let{aptosConfig:o,options:n,creator:e}=t;return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new c(t.description),new S(t.maxSupply??O),new c(t.name),new c(t.uri),new T(t.mutableDescription??!0),new T(t.mutableRoyalty??!0),new T(t.mutableURI??!0),new T(t.mutableTokenDescription??!0),new T(t.mutableTokenName??!0),new T(t.mutableTokenProperties??!0),new T(t.mutableTokenURI??!0),new T(t.tokensBurnableByCreator??!0),new T(t.tokensFreezableByCreator??!0),new S(t.royaltyNumerator??0),new S(t.royaltyDenominator??1)],abi:Q},options:n})}async function U(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,i=u.from(n),a={collection_name:{_eq:e},creator_address:{_eq:i.toStringLong()}};return r?.tokenStandard&&(a.token_standard={_eq:r?.tokenStandard??"v2"}),(await b({aptosConfig:o,query:{query:x,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function St(t){let{aptosConfig:o,collectionId:n}=t,r={collection_id:{_eq:u.from(n).toStringLong()}};return(await b({aptosConfig:o,query:{query:x,variables:{where_condition:r}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function vt(t){return(await U(t)).collection_id}var F={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8())]};async function ht(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:i,name:a,uri:l,propertyKeys:y,propertyTypes:P,propertyValues:_}=t,k=P?.map(D=>C[D]);return d({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new c(r),new c(i),new c(a),new c(l),I.MoveString(y??[]),I.MoveString(k??[]),R(_??[],k??[])],abi:F},options:n})}var N={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new h]};async function xt(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[i??m],functionArguments:[u.from(e),u.from(r)],abi:N},options:a})}var Y={typeParameters:[],parameters:[new s(p()),new s(p()),new s(p()),new s(p()),new f(new s(p())),new f(new s(p())),new f(f.u8()),new h]};async function Gt(t){let{aptosConfig:o,account:n,collection:e,description:r,name:i,uri:a,recipient:l,propertyKeys:y,propertyTypes:P,propertyValues:_,options:k}=t;if(y?.length!==_?.length)throw new Error("Property keys and property values counts do not match");if(P?.length!==_?.length)throw new Error("Property types and property values counts do not match");let D=P?.map(K=>C[K]);return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,i,a,I.MoveString(y??[]),I.MoveString(D??[]),R(_??[],D??[]),l],abi:Y},options:k})}var z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Bt(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??m],functionArguments:[u.from(e)],abi:z},options:i})}var L={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Ot(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:L},options:i})}var j={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0)))]};async function Et(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:i}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??m],functionArguments:[e],abi:j},options:i})}var X={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function qt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:X},options:a})}var H={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Vt(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:H},options:a})}var J={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Mt(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:J},options:a})}var W={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Rt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),I.U8(B(i,C[r]))],abi:W},options:y})}var Z={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p())]};async function Kt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:i,options:a}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[i??m],functionArguments:[u.from(r),new c(e)],abi:Z},options:a})}var $={typeParameters:[{constraints:["key"]}],parameters:[new s(g(new A(0))),new s(p()),new s(p()),f.u8()]};async function Qt(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[l??m],functionArguments:[u.from(a),new c(e),new c(C[r]),B(i,C[r])],abi:$},options:y})}var tt={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ut(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:tt},options:y})}var et={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new s(g(new A(0))),new s(p()),new A(1)]};async function Ft(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:i,digitalAssetAddress:a,digitalAssetType:l,options:y}=t;return d({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[l??m,C[r]],functionArguments:[u.from(a),new c(e),i],abi:et},options:y})}function R(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(B(t[r],e))}),n}function B(t,o){let n=V(o);return M(t,n,0,[]).bcsToBytes()}export{It as a,_t as b,Pt as c,kt as d,Dt as e,U as f,St as g,vt as h,ht as i,xt as j,Gt as k,Bt as l,Ot as m,Et as n,qt as o,Vt as p,Mt as q,Rt as r,Kt as s,Qt as t,Ut as u,Ft as v};
2
+ //# sourceMappingURL=chunk-7BT2KH4T.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as r,b as i,c as s}from"./chunk-2OTMSEHI.mjs";import{a as o}from"./chunk-GVZZTEYV.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
- //# sourceMappingURL=chunk-QBWI223M.mjs.map
1
+ import{a as r,b as i,c as s}from"./chunk-55BHW3A6.mjs";import{a as o}from"./chunk-55W7VV7Z.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
2
+ //# sourceMappingURL=chunk-7CVJJZBP.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as i,b as t,c as n,d as o}from"./chunk-NMYQ2LMC.mjs";import{a as s}from"./chunk-GVZZTEYV.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-LB4KMZNQ.mjs.map
1
+ import{a as i,b as t,c as n,d as o}from"./chunk-K7ESGXR3.mjs";import{a as s}from"./chunk-55W7VV7Z.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-7GO6HWMQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g,c as w,d as K,e as B}from"./chunk-FLYEALDB.mjs";import{a as z,b as S}from"./chunk-OF256KD5.mjs";import{a as p}from"./chunk-KX5ESZO7.mjs";import{b as E}from"./chunk-HZC6A3QL.mjs";import{a as b}from"./chunk-JYFKKB34.mjs";import{a as f,b as y}from"./chunk-52DBSOFA.mjs";import{b as c}from"./chunk-AOCNYMMX.mjs";var P=1e7,H=120,v=30,O=330,R=120,N=350,C=300,$=93,o=class o extends E{constructor(e,t){super();let r=c.fromHexInput(t).toUint8Array();if(r.length!==o.ADDRESS_SEED_LENGTH)throw new Error(`Address seed length in bytes should be ${o.ADDRESS_SEED_LENGTH}`);this.iss=e,this.addressSeed=r}authKey(){let e=new y;return e.serializeU32AsUleb128(3),e.serializeFixedBytes(this.bcsToBytes()),b.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}toString(){return c.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){return!0}serialize(e){e.serializeStr(this.iss),e.serializeBytes(this.addressSeed)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static load(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static isPublicKey(e){return e instanceof o}static create(e){return I(e),new o(e.iss,I(e))}};o.ADDRESS_SEED_LENGTH=32;var m=o;function I(n){let{uidKey:d,uidVal:e,aud:t,pepper:r}=n,i=[w(c.fromHexInput(r).toUint8Array()),g(t,H),g(e,O),g(d,v)];return K(B(i),m.ADDRESS_SEED_LENGTH)}var h=class n extends p{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof U)e.serializeU32AsUleb128(1),this.signature.serialize(e);else if(this.signature instanceof x)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Not a valid OIDB signature")}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(x.load(e));case 1:return new n(U.load(e));default:throw new Error(`Unknown variant index for EphemeralCertificate: ${t}`)}}},A=class n extends f{constructor(e){super();let{a:t,b:r,c:i}=e;this.a=c.fromHexInput(t).toUint8Array(),this.b=c.fromHexInput(r).toUint8Array(),this.c=c.fromHexInput(i).toUint8Array()}toUint8Array(){let e=new y;return this.serialize(e),e.toUint8Array()}serialize(e){e.serializeU32AsUleb128(0),e.serializeFixedBytes(this.a),e.serializeFixedBytes(this.b),e.serializeFixedBytes(this.c)}static deserialize(e){e.deserializeUleb128AsU32();let t=e.deserializeFixedBytes(32),r=e.deserializeFixedBytes(64),i=e.deserializeFixedBytes(32);return new n({a:t,b:r,c:i})}},x=class n extends p{constructor(e){super();let{proof:t,expHorizonSecs:r=BigInt(P),trainingWheelsSignature:i,extraField:s,overrideAudVal:a}=e;this.proof=t,this.expHorizonSecs=r,this.trainingWheelsSignature=i,this.extraField=s,this.overrideAudVal=a}toUint8Array(){let e=new y;return this.serialize(e),e.toUint8Array()}toString(){return this.toString()}serialize(e){this.proof.serialize(e),e.serializeU64(this.expHorizonSecs),e.serializeOptionStr(this.extraField),e.serializeOptionStr(this.overrideAudVal),e.serializeOption(this.trainingWheelsSignature)}static deserialize(e){let t=A.deserialize(e),r=e.deserializeU64(),s=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,l=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,[u]=e.deserializeVector(S);return new n({proof:t,expHorizonSecs:r,trainingWheelsSignature:u,extraField:s,overrideAudVal:l})}static load(e){let t=A.deserialize(e),r=e.deserializeU64(),s=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,l=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,[u]=e.deserializeVector(S);return new n({proof:t,expHorizonSecs:r,trainingWheelsSignature:u,extraField:s,overrideAudVal:l})}},U=class n extends p{constructor(e){super();let{jwtSignature:t,uidKey:r,jwtPayloadJson:i,epkBlinder:s,pepper:a,overrideAudValue:l}=e;this.jwtSignature=t,this.jwtPayloadJson=i,this.uidKey=r??"sub",this.epkBlinder=s,this.pepper=a,this.overrideAudValue=l}toUint8Array(){return this.epkBlinder}toString(){return this.toString()}serialize(e){e.serializeStr(this.jwtSignature),e.serializeStr(this.jwtPayloadJson),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.epkBlinder),e.serializeFixedBytes(this.pepper),e.serializeOptionStr(this.overrideAudValue)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeStr(),i=e.deserializeStr(),s=e.deserializeFixedBytes(31),a=e.deserializeFixedBytes(31),u=e.deserializeUleb128AsU32()?e.deserializeStr():void 0;return new n({jwtSignature:t,jwtPayloadJson:r,uidKey:i,epkBlinder:s,pepper:a,overrideAudValue:u})}static load(e){let t=e.deserializeStr(),r=e.deserializeStr(),i=e.deserializeStr(),s=e.deserializeFixedBytes(31),a=e.deserializeFixedBytes(31),u=e.deserializeUleb128AsU32()?e.deserializeStr():void 0;return new n({jwtSignature:t,jwtPayloadJson:r,uidKey:i,epkBlinder:s,pepper:a,overrideAudValue:u})}static isSignature(e){return e instanceof n}},D=class n extends p{constructor(e){super();let{jwtHeader:t,openIdSignatureOrZkProof:r,expiryDateSecs:i,ephemeralPublicKey:s,ephemeralSignature:a}=e;this.jwtHeader=t,this.openIdSignatureOrZkProof=r,this.expiryDateSecs=i,this.ephemeralPublicKey=s,this.ephemeralSignature=a}toUint8Array(){return this.ephemeralSignature.toUint8Array()}toString(){return this.toString()}serialize(e){this.openIdSignatureOrZkProof.serialize(e),e.serializeStr(this.jwtHeader),e.serializeU64(this.expiryDateSecs),this.ephemeralPublicKey.serialize(e),this.ephemeralSignature.serialize(e)}static deserialize(e){let t=h.deserialize(e),r=e.deserializeStr(),i=e.deserializeU64(),s=z.deserialize(e),a=S.deserialize(e);return new n({jwtHeader:r,expiryDateSecs:i,openIdSignatureOrZkProof:t,ephemeralPublicKey:s,ephemeralSignature:a})}static load(e){let t=e.deserializeStr(),r=e.deserializeU64(),i=h.deserialize(e),s=z.deserialize(e),a=S.deserialize(e);return new n({jwtHeader:t,expiryDateSecs:r,openIdSignatureOrZkProof:i,ephemeralPublicKey:s,ephemeralSignature:a})}static isSignature(e){return e instanceof n}};export{P as a,H as b,v as c,O as d,R as e,N as f,C as g,$ as h,m as i,I as j,h as k,A as l,x as m,U as n,D as o};
2
- //# sourceMappingURL=chunk-AE7X4LVG.mjs.map
1
+ import{a as z,b as S}from"./chunk-VMR46ALO.mjs";import{b as E}from"./chunk-HZC6A3QL.mjs";import{a as p}from"./chunk-KX5ESZO7.mjs";import{a as g,c as w,d as K,e as B}from"./chunk-FLYEALDB.mjs";import{a as b}from"./chunk-JYFKKB34.mjs";import{a as f,b as y}from"./chunk-52DBSOFA.mjs";import{b as c}from"./chunk-AOCNYMMX.mjs";var P=1e7,H=120,v=30,O=330,R=120,N=350,C=300,$=93,o=class o extends E{constructor(e,t){super();let r=c.fromHexInput(t).toUint8Array();if(r.length!==o.ADDRESS_SEED_LENGTH)throw new Error(`Address seed length in bytes should be ${o.ADDRESS_SEED_LENGTH}`);this.iss=e,this.addressSeed=r}authKey(){let e=new y;return e.serializeU32AsUleb128(3),e.serializeFixedBytes(this.bcsToBytes()),b.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}toString(){return c.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){return!0}serialize(e){e.serializeStr(this.iss),e.serializeBytes(this.addressSeed)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static load(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new o(t,r)}static isPublicKey(e){return e instanceof o}static create(e){return I(e),new o(e.iss,I(e))}};o.ADDRESS_SEED_LENGTH=32;var m=o;function I(n){let{uidKey:d,uidVal:e,aud:t,pepper:r}=n,i=[w(c.fromHexInput(r).toUint8Array()),g(t,H),g(e,O),g(d,v)];return K(B(i),m.ADDRESS_SEED_LENGTH)}var h=class n extends p{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof U)e.serializeU32AsUleb128(1),this.signature.serialize(e);else if(this.signature instanceof x)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Not a valid OIDB signature")}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(x.load(e));case 1:return new n(U.load(e));default:throw new Error(`Unknown variant index for EphemeralCertificate: ${t}`)}}},A=class n extends f{constructor(e){super();let{a:t,b:r,c:i}=e;this.a=c.fromHexInput(t).toUint8Array(),this.b=c.fromHexInput(r).toUint8Array(),this.c=c.fromHexInput(i).toUint8Array()}toUint8Array(){let e=new y;return this.serialize(e),e.toUint8Array()}serialize(e){e.serializeU32AsUleb128(0),e.serializeFixedBytes(this.a),e.serializeFixedBytes(this.b),e.serializeFixedBytes(this.c)}static deserialize(e){e.deserializeUleb128AsU32();let t=e.deserializeFixedBytes(32),r=e.deserializeFixedBytes(64),i=e.deserializeFixedBytes(32);return new n({a:t,b:r,c:i})}},x=class n extends p{constructor(e){super();let{proof:t,expHorizonSecs:r=BigInt(P),trainingWheelsSignature:i,extraField:s,overrideAudVal:a}=e;this.proof=t,this.expHorizonSecs=r,this.trainingWheelsSignature=i,this.extraField=s,this.overrideAudVal=a}toUint8Array(){let e=new y;return this.serialize(e),e.toUint8Array()}toString(){return this.toString()}serialize(e){this.proof.serialize(e),e.serializeU64(this.expHorizonSecs),e.serializeOptionStr(this.extraField),e.serializeOptionStr(this.overrideAudVal),e.serializeOption(this.trainingWheelsSignature)}static deserialize(e){let t=A.deserialize(e),r=e.deserializeU64(),s=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,l=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,[u]=e.deserializeVector(S);return new n({proof:t,expHorizonSecs:r,trainingWheelsSignature:u,extraField:s,overrideAudVal:l})}static load(e){let t=A.deserialize(e),r=e.deserializeU64(),s=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,l=e.deserializeUleb128AsU32()?e.deserializeStr():void 0,[u]=e.deserializeVector(S);return new n({proof:t,expHorizonSecs:r,trainingWheelsSignature:u,extraField:s,overrideAudVal:l})}},U=class n extends p{constructor(e){super();let{jwtSignature:t,uidKey:r,jwtPayloadJson:i,epkBlinder:s,pepper:a,overrideAudValue:l}=e;this.jwtSignature=t,this.jwtPayloadJson=i,this.uidKey=r??"sub",this.epkBlinder=s,this.pepper=a,this.overrideAudValue=l}toUint8Array(){return this.epkBlinder}toString(){return this.toString()}serialize(e){e.serializeStr(this.jwtSignature),e.serializeStr(this.jwtPayloadJson),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.epkBlinder),e.serializeFixedBytes(this.pepper),e.serializeOptionStr(this.overrideAudValue)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeStr(),i=e.deserializeStr(),s=e.deserializeFixedBytes(31),a=e.deserializeFixedBytes(31),u=e.deserializeUleb128AsU32()?e.deserializeStr():void 0;return new n({jwtSignature:t,jwtPayloadJson:r,uidKey:i,epkBlinder:s,pepper:a,overrideAudValue:u})}static load(e){let t=e.deserializeStr(),r=e.deserializeStr(),i=e.deserializeStr(),s=e.deserializeFixedBytes(31),a=e.deserializeFixedBytes(31),u=e.deserializeUleb128AsU32()?e.deserializeStr():void 0;return new n({jwtSignature:t,jwtPayloadJson:r,uidKey:i,epkBlinder:s,pepper:a,overrideAudValue:u})}static isSignature(e){return e instanceof n}},D=class n extends p{constructor(e){super();let{jwtHeader:t,openIdSignatureOrZkProof:r,expiryDateSecs:i,ephemeralPublicKey:s,ephemeralSignature:a}=e;this.jwtHeader=t,this.openIdSignatureOrZkProof=r,this.expiryDateSecs=i,this.ephemeralPublicKey=s,this.ephemeralSignature=a}toUint8Array(){return this.ephemeralSignature.toUint8Array()}toString(){return this.toString()}serialize(e){this.openIdSignatureOrZkProof.serialize(e),e.serializeStr(this.jwtHeader),e.serializeU64(this.expiryDateSecs),this.ephemeralPublicKey.serialize(e),this.ephemeralSignature.serialize(e)}static deserialize(e){let t=h.deserialize(e),r=e.deserializeStr(),i=e.deserializeU64(),s=z.deserialize(e),a=S.deserialize(e);return new n({jwtHeader:r,expiryDateSecs:i,openIdSignatureOrZkProof:t,ephemeralPublicKey:s,ephemeralSignature:a})}static load(e){let t=e.deserializeStr(),r=e.deserializeU64(),i=h.deserialize(e),s=z.deserialize(e),a=S.deserialize(e);return new n({jwtHeader:t,expiryDateSecs:r,openIdSignatureOrZkProof:i,ephemeralPublicKey:s,ephemeralSignature:a})}static isSignature(e){return e instanceof n}};export{P as a,H as b,v as c,O as d,R as e,N as f,C as g,$ as h,m as i,I as j,h as k,A as l,x as m,U as n,D as o};
2
+ //# sourceMappingURL=chunk-7URCUZPH.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as s}from"./chunk-S5YUB2BI.mjs";import{d as p}from"./chunk-C2HDZYYQ.mjs";import{a as y,b as u}from"./chunk-7YMBWSKN.mjs";import{b as a}from"./chunk-B645DPPF.mjs";import{b as i}from"./chunk-TCMSBGBS.mjs";import{b as g}from"./chunk-U7EZI5D5.mjs";var m=class o{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new y(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 o({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:c}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,c);break;case 2:n=a.fromDerivationPath(t,c);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new o({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let r=this.sign(s(e));return new p(this.publicKey,r)}sign(e){return new u(this.privateKey.sign(e))}signTransaction(e){return this.sign(s(e))}};export{m as a};
2
- //# sourceMappingURL=chunk-PSTPEDI3.mjs.map
1
+ import{d as s}from"./chunk-S5YUB2BI.mjs";import{d as p}from"./chunk-Z5GI2A3I.mjs";import{a as y,b as u}from"./chunk-5NKRMZEX.mjs";import{b as a}from"./chunk-N37BFHNS.mjs";import{b as i}from"./chunk-ZSZCPOHE.mjs";import{b as g}from"./chunk-U7EZI5D5.mjs";var m=class o{constructor(e){this.signingScheme=2;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=new y(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 o({privateKey:t})}static fromDerivationPath(e){let{scheme:r=0,path:t,mnemonic:c}=e,n;switch(r){case 0:n=i.fromDerivationPath(t,c);break;case 2:n=a.fromDerivationPath(t,c);break;default:throw new Error(`Unsupported signature scheme ${r}`)}return new o({privateKey:n})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let r=this.sign(s(e));return new p(this.publicKey,r)}sign(e){return new u(this.privateKey.sign(e))}signTransaction(e){return this.sign(s(e))}};export{m as a};
2
+ //# sourceMappingURL=chunk-AKW2HAKU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-CFJEOZMV.mjs";var c={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function l(s,i){let{url:u,method:n,body:d,contentType:p,params:t,overrides:e,originMethod:o}=s,r={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":p??"application/json","x-aptos-typescript-sdk-origin-method":o};return e?.AUTH_TOKEN&&(r.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(r.Authorization=`Bearer ${e?.API_KEY}`),i.provider({url:u,method:n,body:d,params:t,headers:r,overrides:e})}async function N(s,i,u){let{url:n,path:d}=s,p=d?`${n}/${d}`:n,t=await l({...s,url:p},i.client),e={status:t.status,statusText:t.statusText,data:t.data,headers:t.headers,config:t.config,request:t.request,url:p};if(e.status===401)throw new a(s,e,`Error: ${e.data}`);if(u==="Indexer"){let r=e.data;if(r.errors)throw new a(s,e,`Indexer error: ${r.errors[0].message}`??`Indexer unhandled Error ${t.status} : ${t.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;if(e.status>=500)throw new a(s,e,`${t.data}`);if(i.isPepperServiceRequest(n))throw new a(s,e,`${t.data}`);let o;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?o=JSON.stringify(e.data):e.status in c?o=c[e.status]:o=`Unhandled Error ${e.status} : ${e.statusText}`,new a(s,e,`${u} error: ${o}`)}export{l as a,N as b};
2
- //# sourceMappingURL=chunk-JP6UNRLO.mjs.map
1
+ import{a}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-IMGPWY3W.mjs";var c={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function l(s,i){let{url:u,method:n,body:d,contentType:p,params:t,overrides:e,originMethod:o}=s,r={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":p??"application/json","x-aptos-typescript-sdk-origin-method":o};return e?.AUTH_TOKEN&&(r.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(r.Authorization=`Bearer ${e?.API_KEY}`),i.provider({url:u,method:n,body:d,params:t,headers:r,overrides:e})}async function N(s,i,u){let{url:n,path:d}=s,p=d?`${n}/${d}`:n,t=await l({...s,url:p},i.client),e={status:t.status,statusText:t.statusText,data:t.data,headers:t.headers,config:t.config,request:t.request,url:p};if(e.status===401)throw new a(s,e,`Error: ${e.data}`);if(u==="Indexer"){let r=e.data;if(r.errors)throw new a(s,e,`Indexer error: ${r.errors[0].message}`??`Indexer unhandled Error ${t.status} : ${t.statusText}`);e.data=r.data}if(e.status>=200&&e.status<300)return e;if(e.status>=500)throw new a(s,e,`${t.data}`);if(i.isPepperServiceRequest(n))throw new a(s,e,`${t.data}`);let o;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?o=JSON.stringify(e.data):e.status in c?o=c[e.status]:o=`Unhandled Error ${e.status} : ${e.statusText}`,new a(s,e,`${u} error: ${o}`)}export{l as a,N as b};
2
+ //# sourceMappingURL=chunk-AULJLLO5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as I}from"./chunk-UAFAZSOH.mjs";import{a as g,b as x}from"./chunk-S5YUB2BI.mjs";import{d as T}from"./chunk-C2HDZYYQ.mjs";import{a as b,b as E}from"./chunk-7YMBWSKN.mjs";import{i as S,j as w,k as y,m as K,n as A,o as l}from"./chunk-AE7X4LVG.mjs";import{k as P}from"./chunk-S5HG2QUD.mjs";import{b as f}from"./chunk-U7EZI5D5.mjs";import{b as d}from"./chunk-52DBSOFA.mjs";import{b as u}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as z}from"jwt-decode";import{decode as O}from"base-64";function F(H){let e=H.replace(/-/g,"+").replace(/_/g,"/"),r=e+"==".substring(0,(3-e.length%3)%3);return O(r)}var a=class a{constructor(e){let{address:r,ephemeralKeyPair:t,iss:n,uidKey:s,uidVal:i,aud:o,pepper:p,proofFetcherOrData:c,jwt:h}=e;this.ephemeralKeyPair=t;let D=w(e);this.publicKey=new S(n,D),this.accountAddress=r?f.from(r):this.publicKey.authKey().derivedAddress(),this.uidKey=s,this.uidVal=i,this.aud=o,this.jwt=h,c instanceof Promise?(this.proof=c,this.initialize(c)):this.proof=c,this.signingScheme=2;let m=u.fromHexInput(p).toUint8Array();if(m.length!==a.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${a.PEPPER_LENGTH}`);this.pepper=m}async serialize(e){e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),(await this.proof).serialize(e)}static deserialize(e){let r=e.deserializeStr(),t=e.deserializeStr(),n=e.deserializeFixedBytes(31),s=I.deserialize(e),i=K.deserialize(e);return a.fromJWTAndProof({proofFetcherOrData:i,pepper:n,uidKey:t,jwt:r,ephemeralKeyPair:s})}async bcsToBytes(){let e=new d;return await this.serialize(e),e.toUint8Array()}async bcsToHex(){let e=await this.bcsToBytes();return u.fromHexInput(e)}async initialize(e){try{this.proof=await e}catch{throw new Error("Failed to fetch proof")}}signWithAuthenticator(e){let r=g(e),t=new E(this.sign(r.bcsToBytes())),n=new b(this.publicKey);return new T(n,t)}async waitForProofFetch(){this.proof instanceof Promise&&await this.proof}sign(e){let{expiryDateSecs:r}=this.ephemeralKeyPair,t=Math.floor(new Date().getTime()/1e3);if(r<t)throw new Error("Ephemeral key pair is expired.");if(this.proof instanceof Promise)throw new Error("Failed to fetch proof.");let n=this.jwt.split(".")[0],s=this.ephemeralKeyPair.publicKey,i=new d;i.serializeFixedBytes(u.fromHexInput(e).toUint8Array()),i.serializeOption(this.proof.proof);let o=x(i.toUint8Array(),"APTOS::TransactionAndProof"),p=this.ephemeralKeyPair.sign(o);return new l({jwtHeader:F(n),openIdSignatureOrZkProof:new y(this.proof),expiryDateSecs:r,ephemeralPublicKey:s,ephemeralSignature:p})}signTransaction(e){let r=g(e);return this.sign(r.bcsToBytes())}signWithOpenIdSignature(e){let[r,t,n]=this.jwt.split("."),s=new A({jwtSignature:n,jwtPayloadJson:t,uidKey:this.uidKey,epkBlinder:this.ephemeralKeyPair.blinder,pepper:this.pepper}),{expiryDateSecs:i}=this.ephemeralKeyPair,o=this.ephemeralKeyPair.publicKey,p=this.ephemeralKeyPair.sign(e);return new l({jwtHeader:r,openIdSignatureOrZkProof:new y(s),expiryDateSecs:i,ephemeralPublicKey:o,ephemeralSignature:p})}verifySignature(e){return!0}static fromJWTAndProof(e){let{proofFetcherOrData:r,jwt:t,ephemeralKeyPair:n,pepper:s}=e,i=e.uidKey??"sub",o=z(t),p=o.iss;if(typeof o.aud!="string")throw new Error("aud was not found or an array of values");let c=o.aud,h=o[i];return new a({proofFetcherOrData:r,ephemeralKeyPair:n,iss:p,uidKey:i,uidVal:h,aud:c,pepper:s,jwt:t})}static fromDerivationPath(e,r){return P(e,a.SLIP_0010_SEED,r)}};a.PEPPER_LENGTH=31,a.SLIP_0010_SEED="32 bytes";var j=a;export{j as a};
2
- //# sourceMappingURL=chunk-COLCWAPL.mjs.map
1
+ import{a as I}from"./chunk-P6EM7SA6.mjs";import{a as g,b as x}from"./chunk-S5YUB2BI.mjs";import{d as T}from"./chunk-Z5GI2A3I.mjs";import{a as b,b as E}from"./chunk-5NKRMZEX.mjs";import{i as S,j as w,k as y,m as K,n as A,o as l}from"./chunk-7URCUZPH.mjs";import{k as P}from"./chunk-S5HG2QUD.mjs";import{b as f}from"./chunk-U7EZI5D5.mjs";import{b as d}from"./chunk-52DBSOFA.mjs";import{b as u}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as z}from"jwt-decode";import{decode as O}from"base-64";function F(H){let e=H.replace(/-/g,"+").replace(/_/g,"/"),r=e+"==".substring(0,(3-e.length%3)%3);return O(r)}var a=class a{constructor(e){let{address:r,ephemeralKeyPair:t,iss:n,uidKey:s,uidVal:i,aud:o,pepper:p,proofFetcherOrData:c,jwt:h}=e;this.ephemeralKeyPair=t;let D=w(e);this.publicKey=new S(n,D),this.accountAddress=r?f.from(r):this.publicKey.authKey().derivedAddress(),this.uidKey=s,this.uidVal=i,this.aud=o,this.jwt=h,c instanceof Promise?(this.proof=c,this.initialize(c)):this.proof=c,this.signingScheme=2;let m=u.fromHexInput(p).toUint8Array();if(m.length!==a.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${a.PEPPER_LENGTH}`);this.pepper=m}async serialize(e){e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),(await this.proof).serialize(e)}static deserialize(e){let r=e.deserializeStr(),t=e.deserializeStr(),n=e.deserializeFixedBytes(31),s=I.deserialize(e),i=K.deserialize(e);return a.fromJWTAndProof({proofFetcherOrData:i,pepper:n,uidKey:t,jwt:r,ephemeralKeyPair:s})}async bcsToBytes(){let e=new d;return await this.serialize(e),e.toUint8Array()}async bcsToHex(){let e=await this.bcsToBytes();return u.fromHexInput(e)}async initialize(e){try{this.proof=await e}catch{throw new Error("Failed to fetch proof")}}signWithAuthenticator(e){let r=g(e),t=new E(this.sign(r.bcsToBytes())),n=new b(this.publicKey);return new T(n,t)}async waitForProofFetch(){this.proof instanceof Promise&&await this.proof}sign(e){let{expiryDateSecs:r}=this.ephemeralKeyPair,t=Math.floor(new Date().getTime()/1e3);if(r<t)throw new Error("Ephemeral key pair is expired.");if(this.proof instanceof Promise)throw new Error("Failed to fetch proof.");let n=this.jwt.split(".")[0],s=this.ephemeralKeyPair.publicKey,i=new d;i.serializeFixedBytes(u.fromHexInput(e).toUint8Array()),i.serializeOption(this.proof.proof);let o=x(i.toUint8Array(),"APTOS::TransactionAndProof"),p=this.ephemeralKeyPair.sign(o);return new l({jwtHeader:F(n),openIdSignatureOrZkProof:new y(this.proof),expiryDateSecs:r,ephemeralPublicKey:s,ephemeralSignature:p})}signTransaction(e){let r=g(e);return this.sign(r.bcsToBytes())}signWithOpenIdSignature(e){let[r,t,n]=this.jwt.split("."),s=new A({jwtSignature:n,jwtPayloadJson:t,uidKey:this.uidKey,epkBlinder:this.ephemeralKeyPair.blinder,pepper:this.pepper}),{expiryDateSecs:i}=this.ephemeralKeyPair,o=this.ephemeralKeyPair.publicKey,p=this.ephemeralKeyPair.sign(e);return new l({jwtHeader:r,openIdSignatureOrZkProof:new y(s),expiryDateSecs:i,ephemeralPublicKey:o,ephemeralSignature:p})}verifySignature(e){return!0}static fromJWTAndProof(e){let{proofFetcherOrData:r,jwt:t,ephemeralKeyPair:n,pepper:s}=e,i=e.uidKey??"sub",o=z(t),p=o.iss;if(typeof o.aud!="string")throw new Error("aud was not found or an array of values");let c=o.aud,h=o[i];return new a({proofFetcherOrData:r,ephemeralKeyPair:n,iss:p,uidKey:i,uidVal:h,aud:c,pepper:s,jwt:t})}static fromDerivationPath(e,r){return P(e,a.SLIP_0010_SEED,r)}};a.PEPPER_LENGTH=31,a.SLIP_0010_SEED="32 bytes";var j=a;export{j as a};
2
+ //# sourceMappingURL=chunk-BIRZ55IO.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-N35ARFH3.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-D2DIZHP3.mjs";import{g as u}from"./chunk-OQKD5SSG.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,options:{timeoutSecs:3}}));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-NKSAU5OX.mjs.map
1
+ import{a as l}from"./chunk-BTEW6JF2.mjs";import{a as o,b as c}from"./chunk-U6Z4FNB7.mjs";import{a as h,h as d}from"./chunk-V76TXXWZ.mjs";import{g as u}from"./chunk-CKMU5DQN.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,options:{timeoutSecs:3}}));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-BM43VTGD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-SC7NXRMV.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-N35ARFH3.mjs.map
1
+ import{a as s}from"./chunk-XFI6MEYQ.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-BTEW6JF2.mjs.map
@@ -1,2 +1,2 @@
1
- import{g as e}from"./chunk-OQKD5SSG.mjs";import{d as c}from"./chunk-UMFYNNCG.mjs";import{d as r}from"./chunk-YE5B2S5L.mjs";import{b as s}from"./chunk-U7EZI5D5.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-ASRAJ24P.mjs.map
1
+ import{g as e}from"./chunk-CKMU5DQN.mjs";import{d as c}from"./chunk-JZ7UTFTR.mjs";import{d as r}from"./chunk-YE5B2S5L.mjs";import{b as s}from"./chunk-U7EZI5D5.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-CFGG43FJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-3JPVQHOR.mjs";import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-WAWBXQ6B.mjs";import{b as c,d as A}from"./chunk-IO2NZ5PR.mjs";import{a as C}from"./chunk-6FBKUTGF.mjs";import{d as w}from"./chunk-YE5B2S5L.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;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(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.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(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){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>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};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-OQKD5SSG.mjs.map
1
+ import{a as R}from"./chunk-AH44UPM4.mjs";import{h as x,i as P}from"./chunk-GSOKKQQ7.mjs";import{a as h}from"./chunk-3JPVQHOR.mjs";import{b as c,d as A}from"./chunk-42ZSGMQO.mjs";import{a as C}from"./chunk-6FBKUTGF.mjs";import{d as w}from"./chunk-YE5B2S5L.mjs";async function v(s){let{aptosConfig:n,options:t}=s;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function D(s){let{aptosConfig:n}=s;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(s){let{aptosConfig:n,ledgerVersion:t}=s,{data:o}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return o}async function T(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return o}async function G(s){let{aptosConfig:n,transactionHash:t}=s;try{return(await T({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(o){if(o?.status===404)return!0;throw o}}async function b(s){let{aptosConfig:n,transactionHash:t}=s,{data:o}=await c({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return o}async function W(s){let{aptosConfig:n,transactionHash:t,options:o}=s,r=o?.timeoutSecs??20,u=o?.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(s){let{aptosConfig:n,processorType:t}=s,o=BigInt(s.minimumLedgerVersion),r=3e3,u=new Date().getTime(),a=BigInt(-1);for(;a<o;){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>=o)break;await h(200)}}var f=class extends Error{constructor(t,o){super(t);this.lastSubmittedTransaction=o}},y=class extends Error{constructor(t,o){super(t);this.transaction=o}};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-CKMU5DQN.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-D2DIZHP3.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-YIIDPNGQ.mjs.map
1
+ import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-V76TXXWZ.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-EESTYBZ5.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as h,c as l}from"./chunk-TCMSBGBS.mjs";import{a as p}from"./chunk-KX5ESZO7.mjs";import{b as E}from"./chunk-HZC6A3QL.mjs";import{a as g}from"./chunk-JYFKKB34.mjs";var o=class o extends E{constructor(r){super();let{publicKeys:e,threshold:t}=r;if(e.length>o.MAX_KEYS||e.length<o.MIN_KEYS)throw new Error(`Must have between ${o.MIN_KEYS} and ${o.MAX_KEYS} public keys, inclusive`);if(t<o.MIN_THRESHOLD||t>e.length)throw new Error(`Threshold must be between ${o.MIN_THRESHOLD} and ${e.length}, inclusive`);this.publicKeys=e,this.threshold=t}verifySignature(r){let{message:e,signature:t}=r;if(!(t instanceof y))return!1;let s=[];for(let i=0;i<4;i+=1)for(let n=0;n<8;n+=1)if((t.bitmap[i]&1<<7-n)!==0){let u=i*8+n;s.push(u)}if(s.length!==t.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(s.length<this.threshold)throw new Error("Not enough signatures");for(let i=0;i<s.length;i+=1)if(!this.publicKeys[s[i]].verifySignature({message:e,signature:t.signatures[i]}))return!1;return!0}authKey(){return g.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let r=new Uint8Array(this.publicKeys.length*h.LENGTH+1);return this.publicKeys.forEach((e,t)=>{r.set(e.toUint8Array(),t*h.LENGTH)}),r[this.publicKeys.length*h.LENGTH]=this.threshold,r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e[e.length-1],s=[];for(let i=0;i<e.length-1;i+=h.LENGTH){let n=i;s.push(new h(e.subarray(n,n+h.LENGTH)))}return new o({publicKeys:s,threshold:t})}};o.MAX_KEYS=32,o.MIN_KEYS=2,o.MIN_THRESHOLD=1;var d=o,a=class a extends p{constructor(r){super();let{signatures:e,bitmap:t}=r;if(e.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=e,!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}}toUint8Array(){let r=new Uint8Array(this.signatures.length*l.LENGTH+a.BITMAP_LEN);return this.signatures.forEach((e,t)=>{r.set(e.toUint8Array(),t*l.LENGTH)}),r.set(this.bitmap,this.signatures.length*l.LENGTH),r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e.subarray(e.length-4),s=[];for(let i=0;i<e.length-t.length;i+=l.LENGTH){let n=i;s.push(new l(e.subarray(n,n+l.LENGTH)))}return new a({signatures:s,bitmap:t})}static createBitmap(r){let{bits:e}=r,t=128,s=new Uint8Array([0,0,0,0]),i=new Set;return e.forEach((n,c)=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(i.has(n))throw new Error("Duplicate bits detected.");if(c>0&&n<=e[c-1])throw new Error("The bits need to be sorted in ascending order.");i.add(n);let u=Math.floor(n/8),b=s[u];b|=t>>n%8,s[u]=b}),s}};a.MAX_SIGNATURES_SUPPORTED=32,a.BITMAP_LEN=4;var y=a;export{d as a,y as b};
2
- //# sourceMappingURL=chunk-WR5L4STD.mjs.map
1
+ import{a as h,c as l}from"./chunk-ZSZCPOHE.mjs";import{b as E}from"./chunk-HZC6A3QL.mjs";import{a as p}from"./chunk-KX5ESZO7.mjs";import{a as g}from"./chunk-JYFKKB34.mjs";var o=class o extends E{constructor(r){super();let{publicKeys:e,threshold:t}=r;if(e.length>o.MAX_KEYS||e.length<o.MIN_KEYS)throw new Error(`Must have between ${o.MIN_KEYS} and ${o.MAX_KEYS} public keys, inclusive`);if(t<o.MIN_THRESHOLD||t>e.length)throw new Error(`Threshold must be between ${o.MIN_THRESHOLD} and ${e.length}, inclusive`);this.publicKeys=e,this.threshold=t}verifySignature(r){let{message:e,signature:t}=r;if(!(t instanceof y))return!1;let s=[];for(let i=0;i<4;i+=1)for(let n=0;n<8;n+=1)if((t.bitmap[i]&1<<7-n)!==0){let u=i*8+n;s.push(u)}if(s.length!==t.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(s.length<this.threshold)throw new Error("Not enough signatures");for(let i=0;i<s.length;i+=1)if(!this.publicKeys[s[i]].verifySignature({message:e,signature:t.signatures[i]}))return!1;return!0}authKey(){return g.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let r=new Uint8Array(this.publicKeys.length*h.LENGTH+1);return this.publicKeys.forEach((e,t)=>{r.set(e.toUint8Array(),t*h.LENGTH)}),r[this.publicKeys.length*h.LENGTH]=this.threshold,r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e[e.length-1],s=[];for(let i=0;i<e.length-1;i+=h.LENGTH){let n=i;s.push(new h(e.subarray(n,n+h.LENGTH)))}return new o({publicKeys:s,threshold:t})}};o.MAX_KEYS=32,o.MIN_KEYS=2,o.MIN_THRESHOLD=1;var d=o,a=class a extends p{constructor(r){super();let{signatures:e,bitmap:t}=r;if(e.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=e,!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}}toUint8Array(){let r=new Uint8Array(this.signatures.length*l.LENGTH+a.BITMAP_LEN);return this.signatures.forEach((e,t)=>{r.set(e.toUint8Array(),t*l.LENGTH)}),r.set(this.bitmap,this.signatures.length*l.LENGTH),r}serialize(r){r.serializeBytes(this.toUint8Array())}static deserialize(r){let e=r.deserializeBytes(),t=e.subarray(e.length-4),s=[];for(let i=0;i<e.length-t.length;i+=l.LENGTH){let n=i;s.push(new l(e.subarray(n,n+l.LENGTH)))}return new a({signatures:s,bitmap:t})}static createBitmap(r){let{bits:e}=r,t=128,s=new Uint8Array([0,0,0,0]),i=new Set;return e.forEach((n,c)=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(i.has(n))throw new Error("Duplicate bits detected.");if(c>0&&n<=e[c-1])throw new Error("The bits need to be sorted in ascending order.");i.add(n);let u=Math.floor(n/8),b=s[u];b|=t>>n%8,s[u]=b}),s}};a.MAX_SIGNATURES_SUPPORTED=32,a.BITMAP_LEN=4;var y=a;export{d as a,y as b};
2
+ //# sourceMappingURL=chunk-EGFL5FCU.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-FB6T6ZQP.mjs";import{a as i}from"./chunk-ED6PYTNG.mjs";import{a as r}from"./chunk-52DBSOFA.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-EGTGR3R4.mjs.map
1
+ import{a as e}from"./chunk-O63GDJY4.mjs";import{a as i}from"./chunk-ED6PYTNG.mjs";import{a as r}from"./chunk-52DBSOFA.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-F2OCQQAA.mjs.map
@@ -1,2 +1,2 @@
1
- import{m as g,v as a}from"./chunk-S4SEFF4K.mjs";import{b as n}from"./chunk-IO2NZ5PR.mjs";import{b as p,c}from"./chunk-UMFYNNCG.mjs";async function h(o){let{aptosConfig:t}=o,{data:e}=await n({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function l(o){let{aptosConfig:t,ledgerVersion:e,options:s}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:s?.withTransactions}});return r}async function C(o){let{aptosConfig:t,blockHeight:e,options:s}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:s?.withTransactions}});return r}async function m(o){let{aptosConfig:t,handle:e,data:s,options:r}=o;return(await p({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:r?.ledgerVersion},body:s})).data}async function T(o){let{aptosConfig:t,limit:e}=o;return(await i({aptosConfig:t,query:{query:g,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function i(o){let{aptosConfig:t,query:e,originMethod:s}=o,{data:r}=await c({aptosConfig:t,originMethod:s??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return r}async function f(o){let{aptosConfig:t}=o;return(await i({aptosConfig:t,query:{query:a},originMethod:"getProcessorStatuses"})).processor_status}async function q(o){let t=await f({aptosConfig:o.aptosConfig});return BigInt(t[0].last_success_version)}async function b(o){let{aptosConfig:t,processorType:e}=o;return(await i({aptosConfig:t,query:{query:a,variables:{where_condition:{processor:{_eq:e}}}},originMethod:"getProcessorStatus"})).processor_status[0]}export{h as a,l as b,C as c,m as d,T as e,i as f,f as g,q as h,b as i};
2
- //# sourceMappingURL=chunk-WAWBXQ6B.mjs.map
1
+ import{m as g,v as a}from"./chunk-S4SEFF4K.mjs";import{b as n}from"./chunk-42ZSGMQO.mjs";import{b as p,c}from"./chunk-JZ7UTFTR.mjs";async function h(o){let{aptosConfig:t}=o,{data:e}=await n({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function l(o){let{aptosConfig:t,ledgerVersion:e,options:s}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:s?.withTransactions}});return r}async function C(o){let{aptosConfig:t,blockHeight:e,options:s}=o,{data:r}=await n({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:s?.withTransactions}});return r}async function m(o){let{aptosConfig:t,handle:e,data:s,options:r}=o;return(await p({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:r?.ledgerVersion},body:s})).data}async function T(o){let{aptosConfig:t,limit:e}=o;return(await i({aptosConfig:t,query:{query:g,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function i(o){let{aptosConfig:t,query:e,originMethod:s}=o,{data:r}=await c({aptosConfig:t,originMethod:s??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return r}async function f(o){let{aptosConfig:t}=o;return(await i({aptosConfig:t,query:{query:a},originMethod:"getProcessorStatuses"})).processor_status}async function q(o){let t=await f({aptosConfig:o.aptosConfig});return BigInt(t[0].last_success_version)}async function b(o){let{aptosConfig:t,processorType:e}=o;return(await i({aptosConfig:t,query:{query:a,variables:{where_condition:{processor:{_eq:e}}}},originMethod:"getProcessorStatus"})).processor_status[0]}export{h as a,l as b,C as c,m as d,T as e,i as f,f as g,q as h,b as i};
2
+ //# sourceMappingURL=chunk-GSOKKQQ7.mjs.map
@@ -0,0 +1,2 @@
1
+ var t="1.13.1-zeta.2";export{t as a};
2
+ //# sourceMappingURL=chunk-IMGPWY3W.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.13.1-zeta.0\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
1
+ {"version":3,"sources":["../../src/version.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The current version of the SDK\n *\n * hardcoded for now, we would want to have it injected dynamically\n */\nexport const VERSION = \"1.13.1-zeta.2\";\n"],"mappings":"AAQO,IAAMA,EAAU","names":["VERSION"]}
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-CW7JVCSV.mjs";import{a as c}from"./chunk-PSTPEDI3.mjs";import{b as i}from"./chunk-TCMSBGBS.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
- //# sourceMappingURL=chunk-YMVFNEBO.mjs.map
1
+ import{a as n}from"./chunk-JTFH6ACV.mjs";import{a as c}from"./chunk-AKW2HAKU.mjs";import{b as i}from"./chunk-ZSZCPOHE.mjs";var o=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?n.generate():c.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:a=!0}=e;return t instanceof i&&a?new n({privateKey:t,address:r}):new c({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:a,legacy:s=!0}=e;return t===0&&s?n.fromDerivationPath({mnemonic:r,path:a}):c.fromDerivationPath({scheme:t,mnemonic:r,path:a})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}};export{o as a};
2
+ //# sourceMappingURL=chunk-IXA3IGQT.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as n,b as s,c as r,d as i,e as o,f as a,g as c,h as p,i as d,j as g,k as u,l as A,m as y,n as l,o as m,p as T,q as f,r as I,s as C,t as O,u as P,v as D}from"./chunk-VSWIMQAB.mjs";import{a as e}from"./chunk-GVZZTEYV.mjs";var V=class{constructor(t){this.config=t}async getCollectionData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),p({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),n({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),s({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),r({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return o({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return d({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return g({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return u({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return A({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return y({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return l({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return m({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return T({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return f({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return I({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return C({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return O({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return P({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return D({aptosConfig:this.config,...t})}};export{V as a};
2
- //# sourceMappingURL=chunk-HZFOKUQZ.mjs.map
1
+ import{a as n,b as s,c as r,d as i,e as o,f as a,g as c,h as p,i as d,j as g,k as u,l as A,m as y,n as l,o as m,p as T,q as f,r as I,s as C,t as O,u as P,v as D}from"./chunk-7BT2KH4T.mjs";import{a as e}from"./chunk-55W7VV7Z.mjs";var V=class{constructor(t){this.config=t}async getCollectionData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...t})}async getCollectionDataByCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),c({aptosConfig:this.config,...t})}async getCollectionId(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),p({aptosConfig:this.config,...t})}async getDigitalAssetData(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),n({aptosConfig:this.config,...t})}async getCurrentDigitalAssetOwnership(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),s({aptosConfig:this.config,...t})}async getOwnedDigitalAssets(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),r({aptosConfig:this.config,...t})}async getDigitalAssetActivity(t){return await e({config:this.config,minimumLedgerVersion:t.minimumLedgerVersion,processorType:"token_v2_processor"}),i({aptosConfig:this.config,...t})}async createCollectionTransaction(t){return o({aptosConfig:this.config,...t})}async mintDigitalAssetTransaction(t){return d({aptosConfig:this.config,...t})}async transferDigitalAssetTransaction(t){return g({aptosConfig:this.config,...t})}async mintSoulBoundTransaction(t){return u({aptosConfig:this.config,...t})}async burnDigitalAssetTransaction(t){return A({aptosConfig:this.config,...t})}async freezeDigitalAssetTransaferTransaction(t){return y({aptosConfig:this.config,...t})}async unfreezeDigitalAssetTransaferTransaction(t){return l({aptosConfig:this.config,...t})}async setDigitalAssetDescriptionTransaction(t){return m({aptosConfig:this.config,...t})}async setDigitalAssetNameTransaction(t){return T({aptosConfig:this.config,...t})}async setDigitalAssetURITransaction(t){return f({aptosConfig:this.config,...t})}async addDigitalAssetPropertyTransaction(t){return I({aptosConfig:this.config,...t})}async removeDigitalAssetPropertyTransaction(t){return C({aptosConfig:this.config,...t})}async updateDigitalAssetPropertyTransaction(t){return O({aptosConfig:this.config,...t})}async addDigitalAssetTypedPropertyTransaction(t){return P({aptosConfig:this.config,...t})}async updateDigitalAssetTypedPropertyTransaction(t){return D({aptosConfig:this.config,...t})}};export{V as a};
2
+ //# sourceMappingURL=chunk-JIX5F3BC.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as i}from"./chunk-S5YUB2BI.mjs";import{b as o}from"./chunk-C2HDZYYQ.mjs";import{b as n}from"./chunk-TCMSBGBS.mjs";import{b as a}from"./chunk-U7EZI5D5.mjs";var c=class s{constructor(e){this.signingScheme=0;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=r.publicKey(),this.accountAddress=t?a.from(t):this.publicKey.authKey().derivedAddress()}static generate(){let e=n.generate();return new s({privateKey:e})}static fromDerivationPath(e){let{path:r,mnemonic:t}=e,u=n.fromDerivationPath(r,t);return new s({privateKey:u})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let r=this.privateKey.sign(i(e));return new o(this.publicKey,r)}sign(e){return this.privateKey.sign(e)}signTransaction(e){return this.sign(i(e))}};export{c as a};
2
- //# sourceMappingURL=chunk-CW7JVCSV.mjs.map
1
+ import{d as i}from"./chunk-S5YUB2BI.mjs";import{b as o}from"./chunk-Z5GI2A3I.mjs";import{b as n}from"./chunk-ZSZCPOHE.mjs";import{b as a}from"./chunk-U7EZI5D5.mjs";var c=class s{constructor(e){this.signingScheme=0;let{privateKey:r,address:t}=e;this.privateKey=r,this.publicKey=r.publicKey(),this.accountAddress=t?a.from(t):this.publicKey.authKey().derivedAddress()}static generate(){let e=n.generate();return new s({privateKey:e})}static fromDerivationPath(e){let{path:r,mnemonic:t}=e,u=n.fromDerivationPath(r,t);return new s({privateKey:u})}verifySignature(e){return this.publicKey.verifySignature(e)}signWithAuthenticator(e){let r=this.privateKey.sign(i(e));return new o(this.publicKey,r)}sign(e){return this.privateKey.sign(e)}signTransaction(e){return this.sign(i(e))}};export{c as a};
2
+ //# sourceMappingURL=chunk-JTFH6ACV.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-JP6UNRLO.mjs";async function o(e){let{type:t,originMethod:s,path:i,body:r,acceptType:R,contentType:f,params:c,aptosConfig:n,overrides:A}=e,d=n.getRequestUrl(t);return p({url:d,method:"POST",originMethod:s,path:i,body:r,contentType:f,acceptType:R,params:c,overrides:A},n,e.type)}async function q(e){let{aptosConfig:t}=e;return o({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function C(e){let{aptosConfig:t}=e;return o({...e,type:"Indexer",overrides:{...t.clientConfig,...t.indexerConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.indexerConfig?.HEADERS}}})}async function m(e){let{aptosConfig:t}=e,s={...t,clientConfig:{...t.clientConfig}};return delete s?.clientConfig?.API_KEY,o({...e,type:"Faucet",overrides:{...s.clientConfig,...s.faucetConfig,...e.overrides,HEADERS:{...s.clientConfig?.HEADERS,...s.faucetConfig?.HEADERS}}})}async function E(e){return o({...e,type:"Pepper"})}async function a(e){return o({...e,type:"Prover"})}export{o as a,q as b,C as c,m as d,E as e,a as f};
2
- //# sourceMappingURL=chunk-UMFYNNCG.mjs.map
1
+ import{b as p}from"./chunk-AULJLLO5.mjs";async function o(e){let{type:t,originMethod:s,path:i,body:r,acceptType:R,contentType:f,params:c,aptosConfig:n,overrides:A}=e,d=n.getRequestUrl(t);return p({url:d,method:"POST",originMethod:s,path:i,body:r,contentType:f,acceptType:R,params:c,overrides:A},n,e.type)}async function q(e){let{aptosConfig:t}=e;return o({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function C(e){let{aptosConfig:t}=e;return o({...e,type:"Indexer",overrides:{...t.clientConfig,...t.indexerConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.indexerConfig?.HEADERS}}})}async function m(e){let{aptosConfig:t}=e,s={...t,clientConfig:{...t.clientConfig}};return delete s?.clientConfig?.API_KEY,o({...e,type:"Faucet",overrides:{...s.clientConfig,...s.faucetConfig,...e.overrides,HEADERS:{...s.clientConfig?.HEADERS,...s.faucetConfig?.HEADERS}}})}async function E(e){return o({...e,type:"Pepper"})}async function a(e){return o({...e,type:"Prover"})}export{o as a,q as b,C as c,m as d,E as e,a as f};
2
+ //# sourceMappingURL=chunk-JZ7UTFTR.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-D2DIZHP3.mjs";import{c as p}from"./chunk-IVBYTTN7.mjs";import{f as o}from"./chunk-WAWBXQ6B.mjs";import{o as u,r as g,s as A}from"./chunk-S4SEFF4K.mjs";import{f as a,i as r}from"./chunk-Q225PZMV.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:[],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-NMYQ2LMC.mjs.map
1
+ import{a as c}from"./chunk-V76TXXWZ.mjs";import{c as p}from"./chunk-IVBYTTN7.mjs";import{f as o}from"./chunk-GSOKKQQ7.mjs";import{o as u,r as g,s as A}from"./chunk-S4SEFF4K.mjs";import{f as a,i as r}from"./chunk-Q225PZMV.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:[],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-K7ESGXR3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as u,b as l}from"./chunk-7YMBWSKN.mjs";import{a as f}from"./chunk-KX5ESZO7.mjs";import{b as g}from"./chunk-HZC6A3QL.mjs";import{a as m}from"./chunk-JYFKKB34.mjs";function p(y){let o=y;return o-=o>>1&1431655765,o=(o&858993459)+(o>>2&858993459),(o+(o>>4)&252645135)*16843009>>24}var d=class y extends g{constructor(e){super();let{publicKeys:i,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(i.length<t)throw new Error(`Provided ${i.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=i.map(r=>r instanceof u?r:new u(r)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let i=e.deserializeVector(u),t=e.deserializeU8();return new y({publicKeys:i,signaturesRequired:t})}createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.forEach((n,c)=>{if(c+1>this.publicKeys.length)throw new Error(`Signature index ${c+1} is out of public keys range, ${this.publicKeys.length}.`);if(s.has(n))throw new Error(`Duplicate bit ${n} detected.`);s.add(n);let h=Math.floor(n/8),b=r[h];b|=t>>n%8,r[h]=b}),r}getIndex(e){let i=e instanceof u?e:new u(e),t=this.publicKeys.findIndex(r=>r.toString()===i.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}},a=class a extends f{constructor(e){super();let{signatures:i,bitmap:t}=e;if(i.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=i.map(s=>s instanceof l?s:new l(s)),!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}let r=this.bitmap.reduce((s,n)=>s+p(n),0);if(r!==this.signatures.length)throw new Error(`Expecting ${r} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.forEach(n=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(s.has(n))throw new Error("Duplicate bits detected.");s.add(n);let c=Math.floor(n/8),h=r[c];h|=t>>n%8,r[c]=h}),r}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let i=e.deserializeBytes(),t=i.reduce((s,n)=>s+p(n),0),r=[];for(let s=0;s<t;s+=1){let n=l.deserialize(e);r.push(n)}return new a({signatures:r,bitmap:i})}};a.BITMAP_LEN=4,a.MAX_SIGNATURES_SUPPORTED=a.BITMAP_LEN*8;var A=a;export{d as a,A as b};
2
- //# sourceMappingURL=chunk-QEKSGA7S.mjs.map
1
+ import{a as u,b as l}from"./chunk-5NKRMZEX.mjs";import{b as g}from"./chunk-HZC6A3QL.mjs";import{a as f}from"./chunk-KX5ESZO7.mjs";import{a as m}from"./chunk-JYFKKB34.mjs";function p(y){let o=y;return o-=o>>1&1431655765,o=(o&858993459)+(o>>2&858993459),(o+(o>>4)&252645135)*16843009>>24}var d=class y extends g{constructor(e){super();let{publicKeys:i,signaturesRequired:t}=e;if(t<1)throw new Error("The number of required signatures needs to be greater than 0");if(i.length<t)throw new Error(`Provided ${i.length} public keys is smaller than the ${t} required signatures`);this.publicKeys=i.map(r=>r instanceof u?r:new u(r)),this.signaturesRequired=t}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let i=e.deserializeVector(u),t=e.deserializeU8();return new y({publicKeys:i,signaturesRequired:t})}createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.forEach((n,c)=>{if(c+1>this.publicKeys.length)throw new Error(`Signature index ${c+1} is out of public keys range, ${this.publicKeys.length}.`);if(s.has(n))throw new Error(`Duplicate bit ${n} detected.`);s.add(n);let h=Math.floor(n/8),b=r[h];b|=t>>n%8,r[h]=b}),r}getIndex(e){let i=e instanceof u?e:new u(e),t=this.publicKeys.findIndex(r=>r.toString()===i.toString());if(t!==-1)return t;throw new Error("Public key not found in MultiKey")}},a=class a extends f{constructor(e){super();let{signatures:i,bitmap:t}=e;if(i.length>a.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${a.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=i.map(s=>s instanceof l?s:new l(s)),!(t instanceof Uint8Array))this.bitmap=a.createBitmap({bits:t});else{if(t.length!==a.BITMAP_LEN)throw new Error(`"bitmap" length should be ${a.BITMAP_LEN}`);this.bitmap=t}let r=this.bitmap.reduce((s,n)=>s+p(n),0);if(r!==this.signatures.length)throw new Error(`Expecting ${r} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:i}=e,t=128,r=new Uint8Array([0,0,0,0]),s=new Set;return i.forEach(n=>{if(n>=a.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${a.MAX_SIGNATURES_SUPPORTED-1}.`);if(s.has(n))throw new Error("Duplicate bits detected.");s.add(n);let c=Math.floor(n/8),h=r[c];h|=t>>n%8,r[c]=h}),r}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let i=e.deserializeBytes(),t=i.reduce((s,n)=>s+p(n),0),r=[];for(let s=0;s<t;s+=1){let n=l.deserialize(e);r.push(n)}return new a({signatures:r,bitmap:i})}};a.BITMAP_LEN=4,a.MAX_SIGNATURES_SUPPORTED=a.BITMAP_LEN*8;var A=a;export{d as a,A as b};
2
+ //# sourceMappingURL=chunk-KMPAYC5Z.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-BIU5KNPT.mjs";import{a as m}from"./chunk-D2DIZHP3.mjs";import{f as A}from"./chunk-WAWBXQ6B.mjs";import{t as f}from"./chunk-S4SEFF4K.mjs";import{b as w}from"./chunk-U7EZI5D5.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,randomnet: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-6YDD6LGX.mjs.map
1
+ import{a as g}from"./chunk-Q2Y6S77E.mjs";import{a as m}from"./chunk-V76TXXWZ.mjs";import{f as A}from"./chunk-GSOKKQQ7.mjs";import{t as f}from"./chunk-S4SEFF4K.mjs";import{b as w}from"./chunk-U7EZI5D5.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,randomnet: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-LODRH4QJ.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as E}from"./chunk-IO2NZ5PR.mjs";import{e as x,f as K}from"./chunk-UMFYNNCG.mjs";import{a as g}from"./chunk-COLCWAPL.mjs";import{a as m,l as h,m as A}from"./chunk-AE7X4LVG.mjs";import{b as S}from"./chunk-OF256KD5.mjs";import{c as d}from"./chunk-S5HG2QUD.mjs";import{b as l}from"./chunk-52DBSOFA.mjs";import{b as a}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as b}from"jwt-decode";import{bls12_381 as p}from"@noble/curves/bls12-381";var v="APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST";function w(e){return new TextEncoder().encode(e)}var I=p.G2.hashToCurve(w("APTOS_KEYLESS_PEPPER_PINKAS_VUF_SECRET_KEY_BASE"),{DST:v}).toAffine();function j(e){let{jwt:i,uidKey:t}=e,r=b(i),o=new l;o.serializeStr(r.iss),o.serializeStr(r.aud),o.serializeStr(r[t||"sub"]),o.serializeStr(t||"sub");let s=o.toUint8Array(),n=p.G1.hashToCurve(s,{DST:"APTOS_PEPPER_SERVICE_BLS12381_VUF_DST"}).toAffine();return p.G1.ProjectivePoint.fromAffine(n)}async function C(e){let{aptosConfig:i,pepperInput:t,pepperBase:r}=e,{data:o}=await E({aptosConfig:i,path:"vrf-pub-key",originMethod:"getPepper"}),s=p.G2.ProjectivePoint.fromHex(o.vrf_public_key_hex_string);return p.verifyShortSignature(r,t,s)}async function F(e){let{aptosConfig:i,jwt:t,ephemeralKeyPair:r,uidKey:o,verify:s}=e,{derivationPath:n}=e,f={jwt_b64:t,epk:r.publicKey.bcsToHex().toStringWithoutPrefix(),exp_date_secs:Number(r.expiryDateSecs),epk_blinder:a.fromHexInput(r.blinder).toStringWithoutPrefix(),uid_key:o},{data:c}=await x({aptosConfig:i,path:"fetch",body:f,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}}),P=a.fromHexInput(c.signature).toUint8Array();if(s&&!C({aptosConfig:i,pepperBase:P,pepperInput:j(e)}))throw new Error("Unable to verify");let u=p.pairing(p.G1.ProjectivePoint.fromHex(P),p.G2.ProjectivePoint.fromAffine(I));return n===void 0&&(n=d),g.fromDerivationPath(n,p.fields.Fp12.toBytes(u)).slice(0,31)}async function H(e){let{aptosConfig:i,jwt:t,ephemeralKeyPair:r,pepper:o,uidKey:s,extraFieldKey:n}=e,f=b(t),c;if(n){let T=f[n];c=`"${n}":"${T}",`}let P={jwt_b64:t,epk:r.publicKey.bcsToHex().toStringWithoutPrefix(),epk_blinder:a.fromHexInput(r.blinder).toStringWithoutPrefix(),exp_date_secs:Number(r.expiryDateSecs),exp_horizon_secs:m,pepper:a.fromHexInput(o).toStringWithoutPrefix(),extra_field:n,uid_key:s||"sub"},{data:u}=await K({aptosConfig:i,path:"prove",body:P,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),y=u.proof,_=new h({a:y.a,b:y.b,c:y.c});return new A({proof:_,extraField:c,trainingWheelsSignature:S.fromHex(u.training_wheels_signature)})}async function O(e){let{fetchProofAsync:i}=e,{pepper:t}=e;if(t===void 0)t=await F(e);else if(a.fromHexInput(t).toUint8Array().length!==31)throw new Error("Pepper needs to be 31 bytes");let r=H({...e,pepper:t}),o=i?r:await r;return g.fromJWTAndProof({...e,proofFetcherOrData:o,pepper:t})}export{F as a,H as b,O as c};
2
- //# sourceMappingURL=chunk-ORMDVSRG.mjs.map
1
+ import{c as E}from"./chunk-42ZSGMQO.mjs";import{e as x,f as K}from"./chunk-JZ7UTFTR.mjs";import{a as g}from"./chunk-BIRZ55IO.mjs";import{a as m,l as h,m as A}from"./chunk-7URCUZPH.mjs";import{b as S}from"./chunk-VMR46ALO.mjs";import{c as d}from"./chunk-S5HG2QUD.mjs";import{b as l}from"./chunk-52DBSOFA.mjs";import{b as a}from"./chunk-AOCNYMMX.mjs";import{jwtDecode as b}from"jwt-decode";import{bls12_381 as p}from"@noble/curves/bls12-381";var v="APTOS_KEYLESS_PEPPER_PINKAS_VUF_DST";function w(e){return new TextEncoder().encode(e)}var I=p.G2.hashToCurve(w("APTOS_KEYLESS_PEPPER_PINKAS_VUF_SECRET_KEY_BASE"),{DST:v}).toAffine();function j(e){let{jwt:i,uidKey:t}=e,r=b(i),o=new l;o.serializeStr(r.iss),o.serializeStr(r.aud),o.serializeStr(r[t||"sub"]),o.serializeStr(t||"sub");let s=o.toUint8Array(),n=p.G1.hashToCurve(s,{DST:"APTOS_PEPPER_SERVICE_BLS12381_VUF_DST"}).toAffine();return p.G1.ProjectivePoint.fromAffine(n)}async function C(e){let{aptosConfig:i,pepperInput:t,pepperBase:r}=e,{data:o}=await E({aptosConfig:i,path:"vrf-pub-key",originMethod:"getPepper"}),s=p.G2.ProjectivePoint.fromHex(o.vrf_public_key_hex_string);return p.verifyShortSignature(r,t,s)}async function F(e){let{aptosConfig:i,jwt:t,ephemeralKeyPair:r,uidKey:o,verify:s}=e,{derivationPath:n}=e,f={jwt_b64:t,epk:r.publicKey.bcsToHex().toStringWithoutPrefix(),exp_date_secs:Number(r.expiryDateSecs),epk_blinder:a.fromHexInput(r.blinder).toStringWithoutPrefix(),uid_key:o},{data:c}=await x({aptosConfig:i,path:"fetch",body:f,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}}),P=a.fromHexInput(c.signature).toUint8Array();if(s&&!C({aptosConfig:i,pepperBase:P,pepperInput:j(e)}))throw new Error("Unable to verify");let u=p.pairing(p.G1.ProjectivePoint.fromHex(P),p.G2.ProjectivePoint.fromAffine(I));return n===void 0&&(n=d),g.fromDerivationPath(n,p.fields.Fp12.toBytes(u)).slice(0,31)}async function H(e){let{aptosConfig:i,jwt:t,ephemeralKeyPair:r,pepper:o,uidKey:s,extraFieldKey:n}=e,f=b(t),c;if(n){let T=f[n];c=`"${n}":"${T}",`}let P={jwt_b64:t,epk:r.publicKey.bcsToHex().toStringWithoutPrefix(),epk_blinder:a.fromHexInput(r.blinder).toStringWithoutPrefix(),exp_date_secs:Number(r.expiryDateSecs),exp_horizon_secs:m,pepper:a.fromHexInput(o).toStringWithoutPrefix(),extra_field:n,uid_key:s||"sub"},{data:u}=await K({aptosConfig:i,path:"prove",body:P,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),y=u.proof,_=new h({a:y.a,b:y.b,c:y.c});return new A({proof:_,extraField:c,trainingWheelsSignature:S.fromHex(u.training_wheels_signature)})}async function O(e){let{fetchProofAsync:i}=e,{pepper:t}=e;if(t===void 0)t=await F(e);else if(a.fromHexInput(t).toUint8Array().length!==31)throw new Error("Pepper needs to be 31 bytes");let r=H({...e,pepper:t}),o=i?r:await r;return g.fromJWTAndProof({...e,proofFetcherOrData:o,pepper:t})}export{F as a,H as b,O as c};
2
+ //# sourceMappingURL=chunk-LXDHLUP4.mjs.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-NKSAU5OX.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-YGWIVUJP.mjs.map
1
+ import{c as a}from"./chunk-BM43VTGD.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-M3PUC5JD.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as R,c as Q,d as Y,e as _}from"./chunk-QFK75K2K.mjs";import{q as J,t as y}from"./chunk-T7TIIAWK.mjs";import{a as nn}from"./chunk-5TNUDFLP.mjs";import{a as Z}from"./chunk-SC7NXRMV.mjs";import{b as j}from"./chunk-OQKD5SSG.mjs";import{a as z}from"./chunk-AH44UPM4.mjs";import{a as L}from"./chunk-WAWBXQ6B.mjs";import{g as D}from"./chunk-Y4VKIX2V.mjs";import{a as X}from"./chunk-S5YUB2BI.mjs";import{a as d}from"./chunk-EGTGR3R4.mjs";import{a as H}from"./chunk-3FL3NLZ6.mjs";import{b as x,d as B,e as E,f as F}from"./chunk-FB6T6ZQP.mjs";import{a as l,c as T,d as w}from"./chunk-ED6PYTNG.mjs";import{c as k,d as v,e as O,f as b,g as V,h as q,i as K}from"./chunk-RBDX3YWC.mjs";import{a as U}from"./chunk-MRCVSUJQ.mjs";import{b as p,d as g,e as W}from"./chunk-C2HDZYYQ.mjs";import{b as C,c as G}from"./chunk-YE5B2S5L.mjs";import{a as M,b as N}from"./chunk-7YMBWSKN.mjs";import{a as $,c as S}from"./chunk-TCMSBGBS.mjs";import{b as u}from"./chunk-U7EZI5D5.mjs";import{b as P}from"./chunk-AOCNYMMX.mjs";import{sha3_256 as sn}from"@noble/hashes/sha3";async function Un(n){if(J(n))return dn(n);let{moduleAddress:e,moduleName:t,functionName:o}=y(n.function),r=await en({key:"entry-function",moduleAddress:e,moduleName:t,functionName:o,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Q});return cn({...n,abi:r})}function cn(n){let e=n.abi,{moduleAddress:t,moduleName:o,functionName:r}=y(n.function),a=R(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n.functionArguments.map((s,m)=>_(n.function,e,s,m,a));if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);let c=b.build(`${t}::${o}`,r,a,i);if("multisigAddress"in n){let s=u.from(n.multisigAddress);return new O(new q(s,new K(c)))}return new v(c)}async function kn(n){let{moduleAddress:e,moduleName:t,functionName:o}=y(n.function),r=await en({key:"view-function",moduleAddress:e,moduleName:t,functionName:o,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Y});return un({abi:r,...n})}function un(n){let e=n.abi,{moduleAddress:t,moduleName:o,functionName:r}=y(n.function),a=R(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n?.functionArguments?.map((c,s)=>_(n.function,e,c,s,a))??[];if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);return b.build(`${t}::${o}`,r,a,i)}function dn(n){return new k(new V(P.fromHexInput(n.bytecode).toUint8Array(),n.typeArguments??[],n.functionArguments))}async function mn(n){let{aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a}=n,i=async()=>D[e.network]?{chainId:D[e.network]}:{chainId:(await L({aptosConfig:e})).chain_id},c=async()=>r?.gasUnitPrice?{gasEstimate:r.gasUnitPrice}:{gasEstimate:(await j({aptosConfig:e})).gas_estimate},s=async()=>{let f=async()=>r?.accountSequenceNumber!==void 0?r.accountSequenceNumber:(await Z({aptosConfig:e,accountAddress:t})).sequence_number;if(a&&u.from(a).equals(u.ZERO))try{return await f()}catch{return 0}else return f()},[{chainId:m},{gasEstimate:A},I]=await Promise.all([i(),c(),s()]),{maxGasAmount:an,gasUnitPrice:rn,expireTimestamp:on}={maxGasAmount:r?.maxGasAmount?BigInt(r.maxGasAmount):BigInt(2e5),gasUnitPrice:BigInt(A),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+20),...r};return new l(u.from(t),BigInt(I),o,BigInt(an),BigInt(rn),BigInt(on),new U(m))}async function vn(n){let{aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a}=n,i=await mn({aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a});if("secondarySignerAddresses"in n){let c=n.secondarySignerAddresses?.map(s=>u.from(s))??[];return new nn(i,c,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}return new H(i,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}function On(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:o,feePayerPublicKey:r}=n,a=h(e);if(t.feePayerAddress){let c=new w(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),s=[];o&&(s=o.map(I=>h(I)));let m=h(r),A=new E(a,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:m});return new d(c.raw_txn,A).bcsToBytes()}if(t.secondarySignerAddresses){let c=new T(t.rawTransaction,t.secondarySignerAddresses),s=[];s=o.map(A=>h(A));let m=new B(a,t.secondarySignerAddresses,s);return new d(c.raw_txn,m).bcsToBytes()}let i;if(a instanceof p)i=new x(a.public_key,a.signature);else if(a instanceof g)i=new F(a);else throw new Error("Invalid public key");return new d(t.rawTransaction,i).bcsToBytes()}function h(n){return n instanceof M?new g(n,new N(new S(new Uint8Array(64)))):new p(new $(n.toUint8Array()),new S(new Uint8Array(64)))}function An(n){let{transaction:e,senderAuthenticator:t,feePayerAuthenticator:o,additionalSignersAuthenticators:r}=n,a=X(e);if((o||r)&&(a instanceof T||a instanceof w))return fn(a,t,o,r);if(t instanceof p&&a instanceof l){let i=new x(t.public_key,t.signature);return new d(a,i).bcsToBytes()}if((t instanceof g||t instanceof W)&&a instanceof l){let i=new F(t);return new d(a,i).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${t} is not a supported account authentication scheme`)}function tn(n){let e=sn.create();for(let t of n)e.update(t);return e.digest()}var yn=tn(["APTOS::Transaction"]);function Vn(n){let e=An(n);return new P(tn([yn,new Uint8Array([0]),e])).toString()}function fn(n,e,t,o){if(n instanceof w){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let r=new E(e,n.secondary_signer_addresses,o??[],{address:n.fee_payer_address,authenticator:t});return new d(n.raw_txn,r).bcsToBytes()}if(n instanceof T){if(!o)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let r=new B(e,n.secondary_signer_addresses,o??[]);return new d(n.raw_txn,r).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof n} transaction is not supported`)}async function en({key:n,moduleAddress:e,moduleName:t,functionName:o,aptosConfig:r,abi:a,fetch:i}){return a!==void 0?a:z(async()=>i(e,t,o,r),`${n}-${r.network}-${e}-${t}-${o}`,1e3*60*5)()}export{Un as a,cn as b,kn as c,un as d,mn as e,vn as f,On as g,h,An as i,tn as j,Vn as k,fn as l};
2
- //# sourceMappingURL=chunk-SQNDWIVJ.mjs.map
1
+ import{a as R,c as Q,d as Y,e as _}from"./chunk-NVN6BTXK.mjs";import{q as J,t as y}from"./chunk-T7TIIAWK.mjs";import{a as nn}from"./chunk-5TNUDFLP.mjs";import{a as Z}from"./chunk-XFI6MEYQ.mjs";import{b as j}from"./chunk-CKMU5DQN.mjs";import{a as z}from"./chunk-AH44UPM4.mjs";import{a as L}from"./chunk-GSOKKQQ7.mjs";import{g as D}from"./chunk-Y4VKIX2V.mjs";import{a as X}from"./chunk-S5YUB2BI.mjs";import{a as d}from"./chunk-F2OCQQAA.mjs";import{a as H}from"./chunk-3FL3NLZ6.mjs";import{b as x,d as B,e as E,f as F}from"./chunk-O63GDJY4.mjs";import{b as p,d as g,e as W}from"./chunk-Z5GI2A3I.mjs";import{a as l,c as T,d as w}from"./chunk-ED6PYTNG.mjs";import{c as k,d as v,e as O,f as b,g as V,h as q,i as K}from"./chunk-RBDX3YWC.mjs";import{a as U}from"./chunk-MRCVSUJQ.mjs";import{b as C,c as G}from"./chunk-YE5B2S5L.mjs";import{a as M,b as N}from"./chunk-5NKRMZEX.mjs";import{a as $,c as S}from"./chunk-ZSZCPOHE.mjs";import{b as u}from"./chunk-U7EZI5D5.mjs";import{b as P}from"./chunk-AOCNYMMX.mjs";import{sha3_256 as sn}from"@noble/hashes/sha3";async function Un(n){if(J(n))return dn(n);let{moduleAddress:e,moduleName:t,functionName:o}=y(n.function),r=await en({key:"entry-function",moduleAddress:e,moduleName:t,functionName:o,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Q});return cn({...n,abi:r})}function cn(n){let e=n.abi,{moduleAddress:t,moduleName:o,functionName:r}=y(n.function),a=R(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n.functionArguments.map((s,m)=>_(n.function,e,s,m,a));if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);let c=b.build(`${t}::${o}`,r,a,i);if("multisigAddress"in n){let s=u.from(n.multisigAddress);return new O(new q(s,new K(c)))}return new v(c)}async function kn(n){let{moduleAddress:e,moduleName:t,functionName:o}=y(n.function),r=await en({key:"view-function",moduleAddress:e,moduleName:t,functionName:o,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Y});return un({abi:r,...n})}function un(n){let e=n.abi,{moduleAddress:t,moduleName:o,functionName:r}=y(n.function),a=R(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n?.functionArguments?.map((c,s)=>_(n.function,e,c,s,a))??[];if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);return b.build(`${t}::${o}`,r,a,i)}function dn(n){return new k(new V(P.fromHexInput(n.bytecode).toUint8Array(),n.typeArguments??[],n.functionArguments))}async function mn(n){let{aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a}=n,i=async()=>D[e.network]?{chainId:D[e.network]}:{chainId:(await L({aptosConfig:e})).chain_id},c=async()=>r?.gasUnitPrice?{gasEstimate:r.gasUnitPrice}:{gasEstimate:(await j({aptosConfig:e})).gas_estimate},s=async()=>{let f=async()=>r?.accountSequenceNumber!==void 0?r.accountSequenceNumber:(await Z({aptosConfig:e,accountAddress:t})).sequence_number;if(a&&u.from(a).equals(u.ZERO))try{return await f()}catch{return 0}else return f()},[{chainId:m},{gasEstimate:A},I]=await Promise.all([i(),c(),s()]),{maxGasAmount:an,gasUnitPrice:rn,expireTimestamp:on}={maxGasAmount:r?.maxGasAmount?BigInt(r.maxGasAmount):BigInt(2e5),gasUnitPrice:BigInt(A),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+20),...r};return new l(u.from(t),BigInt(I),o,BigInt(an),BigInt(rn),BigInt(on),new U(m))}async function vn(n){let{aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a}=n,i=await mn({aptosConfig:e,sender:t,payload:o,options:r,feePayerAddress:a});if("secondarySignerAddresses"in n){let c=n.secondarySignerAddresses?.map(s=>u.from(s))??[];return new nn(i,c,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}return new H(i,n.feePayerAddress?u.from(n.feePayerAddress):void 0)}function On(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:o,feePayerPublicKey:r}=n,a=h(e);if(t.feePayerAddress){let c=new w(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),s=[];o&&(s=o.map(I=>h(I)));let m=h(r),A=new E(a,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:m});return new d(c.raw_txn,A).bcsToBytes()}if(t.secondarySignerAddresses){let c=new T(t.rawTransaction,t.secondarySignerAddresses),s=[];s=o.map(A=>h(A));let m=new B(a,t.secondarySignerAddresses,s);return new d(c.raw_txn,m).bcsToBytes()}let i;if(a instanceof p)i=new x(a.public_key,a.signature);else if(a instanceof g)i=new F(a);else throw new Error("Invalid public key");return new d(t.rawTransaction,i).bcsToBytes()}function h(n){return n instanceof M?new g(n,new N(new S(new Uint8Array(64)))):new p(new $(n.toUint8Array()),new S(new Uint8Array(64)))}function An(n){let{transaction:e,senderAuthenticator:t,feePayerAuthenticator:o,additionalSignersAuthenticators:r}=n,a=X(e);if((o||r)&&(a instanceof T||a instanceof w))return fn(a,t,o,r);if(t instanceof p&&a instanceof l){let i=new x(t.public_key,t.signature);return new d(a,i).bcsToBytes()}if((t instanceof g||t instanceof W)&&a instanceof l){let i=new F(t);return new d(a,i).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${t} is not a supported account authentication scheme`)}function tn(n){let e=sn.create();for(let t of n)e.update(t);return e.digest()}var yn=tn(["APTOS::Transaction"]);function Vn(n){let e=An(n);return new P(tn([yn,new Uint8Array([0]),e])).toString()}function fn(n,e,t,o){if(n instanceof w){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let r=new E(e,n.secondary_signer_addresses,o??[],{address:n.fee_payer_address,authenticator:t});return new d(n.raw_txn,r).bcsToBytes()}if(n instanceof T){if(!o)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let r=new B(e,n.secondary_signer_addresses,o??[]);return new d(n.raw_txn,r).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof n} transaction is not supported`)}async function en({key:n,moduleAddress:e,moduleName:t,functionName:o,aptosConfig:r,abi:a,fetch:i}){return a!==void 0?a:z(async()=>i(e,t,o,r),`${n}-${r.network}-${e}-${t}-${o}`,1e3*60*5)()}export{Un as a,cn as b,kn as c,un as d,mn as e,vn as f,On as g,h,An as i,tn as j,Vn as k,fn as l};
2
+ //# sourceMappingURL=chunk-MCSLNNV3.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o}from"./chunk-534GCQ37.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-Y5DMKMLF.mjs.map
1
+ import{a as o}from"./chunk-QUJQWJB7.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-MUZPVCQF.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as v}from"./chunk-KX5ESZO7.mjs";import{a as u}from"./chunk-TJDC5PWD.mjs";import{a as d}from"./chunk-HZC6A3QL.mjs";import{f as h,l as f}from"./chunk-S5HG2QUD.mjs";import{a as g}from"./chunk-52DBSOFA.mjs";import{b as s}from"./chunk-AOCNYMMX.mjs";import{sha3_256 as A}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as U}from"@scure/bip32";var n=class n extends d{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=u(r),c=s.fromHexInput(l).toUint8Array(),x=A(c),S=i.toUint8Array();return o.verify(S,x,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var m=n,t=class t extends g{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!h(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,f(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=U.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=u(e),i=s.fromHexInput(r),l=A(i.toUint8Array()),c=o.sign(l,this.key.toUint8Array(),{lowS:!0});return new y(c.toCompactRawBytes())}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new m(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var H=t,a=class a extends v{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new a(r)}};a.LENGTH=64;var y=a;export{m as a,H as b,y as c};
2
- //# sourceMappingURL=chunk-B645DPPF.mjs.map
1
+ import{a as d}from"./chunk-HZC6A3QL.mjs";import{a as v}from"./chunk-KX5ESZO7.mjs";import{a as u}from"./chunk-TJDC5PWD.mjs";import{f as h,l as f}from"./chunk-S5HG2QUD.mjs";import{a as g}from"./chunk-52DBSOFA.mjs";import{b as s}from"./chunk-AOCNYMMX.mjs";import{sha3_256 as A}from"@noble/hashes/sha3";import{secp256k1 as o}from"@noble/curves/secp256k1";import{HDKey as U}from"@scure/bip32";var n=class n extends d{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=r}verifySignature(e){let{message:r,signature:i}=e;if(!(i instanceof y))return!1;let l=u(r),c=s.fromHexInput(l).toUint8Array(),x=A(c),S=i.toUint8Array();return o.verify(S,x,this.key.toUint8Array(),{lowS:!0})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new n(r)}static isPublicKey(e){return e instanceof n}};n.LENGTH=65;var m=n,t=class t extends g{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==t.LENGTH)throw new Error(`PrivateKey length should be ${t.LENGTH}`);this.key=r}static generate(){let e=o.utils.randomPrivateKey();return new t(e)}static fromDerivationPath(e,r){if(!h(e))throw new Error(`Invalid derivation path ${e}`);return t.fromDerivationPathInner(e,f(r))}static fromDerivationPathInner(e,r){let{privateKey:i}=U.fromMasterSeed(r).derive(e);if(i===null)throw new Error("Invalid key");return new t(i)}sign(e){let r=u(e),i=s.fromHexInput(r),l=A(i.toUint8Array()),c=o.sign(l,this.key.toUint8Array(),{lowS:!0});return new y(c.toCompactRawBytes())}publicKey(){let e=o.getPublicKey(this.key.toUint8Array(),!1);return new m(e)}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new t(r)}static isPrivateKey(e){return e instanceof t}};t.LENGTH=32;var H=t,a=class a extends v{constructor(e){super();let r=s.fromHexInput(e);if(r.toUint8Array().length!==a.LENGTH)throw new Error(`Signature length should be ${a.LENGTH}, received ${r.toUint8Array().length}`);this.data=r}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let r=e.deserializeBytes();return new a(r)}};a.LENGTH=64;var y=a;export{m as a,H as b,y as c};
2
+ //# sourceMappingURL=chunk-N37BFHNS.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as o,b as r,c as t,d as s}from"./chunk-6DA64TSG.mjs";import{a as n}from"./chunk-GVZZTEYV.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-KFKE46CF.mjs.map
1
+ import{a as o,b as r,c as t,d as s}from"./chunk-UPVELRIE.mjs";import{a as n}from"./chunk-55W7VV7Z.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-NG3IWN2V.mjs.map
@@ -1,2 +1,2 @@
1
- import{a as x,b as c,c as w,d as g,e as M,f as C,g as O,h,i as _,k as V,l as G,m as j,n as k,o as z,p as D,r as i,s as L}from"./chunk-T7TIIAWK.mjs";import{c as A}from"./chunk-IVBYTTN7.mjs";import{c as I}from"./chunk-SC7NXRMV.mjs";import{n as p}from"./chunk-Q225PZMV.mjs";import{a as o,b as S,c as T}from"./chunk-35ZI4WOQ.mjs";import{a as d,b as E,c as B,d as v,e as $,f as b,g as F}from"./chunk-VVJEWB26.mjs";import{b as U}from"./chunk-U7EZI5D5.mjs";var R=new TextEncoder;function Z(n){return n?.map(e=>c(e)?A(e):e)??[]}async function P(n,e,t,u){let r=await I({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(f=>f.name===t)}async function N(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let f=L(r),y=[];for(let s=f;s<r.params.length;s+=1)y.push(A(r.params[s],{allowGenerics:!0}));return{signers:f,typeParameters:r.generic_type_params,parameters:y}}async function a(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let f=[];for(let s=0;s<r.params.length;s+=1)f.push(A(r.params[s],{allowGenerics:!0}));let y=[];for(let s=0;s<r.return.length;s+=1)y.push(A(r.return[s],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:f,returnTypes:y}}function nn(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let f=e.parameters[u];return l(t,f,u,r)}function l(n,e,t,u){return C(n)?(m(e,n,t),n):X(n,e,t,u)}function X(n,e,t,u){if(e.isBool()){if(x(n))return new d(n);i("boolean",t)}if(e.isAddress()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){if(w(n))return new E(n);i("number",t)}if(e.isU16()){if(w(n))return new B(n);i("number",t)}if(e.isU32()){if(w(n))return new v(n);i("number",t)}if(e.isU64()){if(g(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(g(n))return new b(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(g(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return l(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(c(n))return o.U8(R.encode(n));if(n instanceof Uint8Array)return o.U8(n);if(n instanceof ArrayBuffer)return o.U8(new Uint8Array(n))}if(Array.isArray(n))return new o(n.map(r=>l(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(c(n))return new S(n);i("string",t)}if(e.isObject()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isOption())return M(n)?new T(null):new T(l(n,e.value.typeArgs[0],t,u));throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function m(n,e,t){if(n.isBool()){if(O(e))return;i("Bool",t)}if(n.isAddress()){if(h(e))return;i("AccountAddress",t)}if(n.isU8()){if(V(e))return;i("U8",t)}if(n.isU16()){if(G(e))return;i("U16",t)}if(n.isU32()){if(j(e))return;i("U32",t)}if(n.isU64()){if(k(e))return;i("U64",t)}if(n.isU128()){if(z(e))return;i("U128",t)}if(n.isU256()){if(D(e))return;i("U256",t)}if(n.isVector()){if(e instanceof o){e.values.length>0&&m(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof p){if(n.isString()){if(_(e))return;i("MoveString",t)}if(n.isObject()){if(h(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof T){e.value!==void 0&&m(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Z as a,P as b,N as c,a as d,nn as e,l as f};
2
- //# sourceMappingURL=chunk-QFK75K2K.mjs.map
1
+ import{c as A}from"./chunk-IVBYTTN7.mjs";import{a as x,b as c,c as w,d as g,e as M,f as C,g as O,h,i as _,k as V,l as G,m as j,n as k,o as z,p as D,r as i,s as L}from"./chunk-T7TIIAWK.mjs";import{c as I}from"./chunk-XFI6MEYQ.mjs";import{n as p}from"./chunk-Q225PZMV.mjs";import{a as o,b as S,c as T}from"./chunk-35ZI4WOQ.mjs";import{a as d,b as E,c as B,d as v,e as $,f as b,g as F}from"./chunk-VVJEWB26.mjs";import{b as U}from"./chunk-U7EZI5D5.mjs";var R=new TextEncoder;function Z(n){return n?.map(e=>c(e)?A(e):e)??[]}async function P(n,e,t,u){let r=await I({aptosConfig:u,accountAddress:n,moduleName:e});if(r.abi)return r.abi.exposed_functions.find(f=>f.name===t)}async function N(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!r.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let f=L(r),y=[];for(let s=f;s<r.params.length;s+=1)y.push(A(r.params[s],{allowGenerics:!0}));return{signers:f,typeParameters:r.generic_type_params,parameters:y}}async function a(n,e,t,u){let r=await P(n,e,t,u);if(!r)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!r.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let f=[];for(let s=0;s<r.params.length;s+=1)f.push(A(r.params[s],{allowGenerics:!0}));let y=[];for(let s=0;s<r.return.length;s+=1)y.push(A(r.return[s],{allowGenerics:!0}));return{typeParameters:r.generic_type_params,parameters:f,returnTypes:y}}function nn(n,e,t,u,r){if(u>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);let f=e.parameters[u];return l(t,f,u,r)}function l(n,e,t,u){return C(n)?(m(e,n,t),n):X(n,e,t,u)}function X(n,e,t,u){if(e.isBool()){if(x(n))return new d(n);i("boolean",t)}if(e.isAddress()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){if(w(n))return new E(n);i("number",t)}if(e.isU16()){if(w(n))return new B(n);i("number",t)}if(e.isU32()){if(w(n))return new v(n);i("number",t)}if(e.isU64()){if(g(n))return new $(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(g(n))return new b(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(g(n))return new F(BigInt(n));i("bigint | number | string",t)}if(e.isGeneric()){let r=e.value;if(r<0||r>=u.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return l(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(c(n))return o.U8(R.encode(n));if(n instanceof Uint8Array)return o.U8(n);if(n instanceof ArrayBuffer)return o.U8(new Uint8Array(n))}if(Array.isArray(n))return new o(n.map(r=>l(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(c(n))return new S(n);i("string",t)}if(e.isObject()){if(c(n))return U.fromString(n);i("string | AccountAddress",t)}if(e.isOption())return M(n)?new T(null):new T(l(n,e.value.typeArgs[0],t,u));throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function m(n,e,t){if(n.isBool()){if(O(e))return;i("Bool",t)}if(n.isAddress()){if(h(e))return;i("AccountAddress",t)}if(n.isU8()){if(V(e))return;i("U8",t)}if(n.isU16()){if(G(e))return;i("U16",t)}if(n.isU32()){if(j(e))return;i("U32",t)}if(n.isU64()){if(k(e))return;i("U64",t)}if(n.isU128()){if(z(e))return;i("U128",t)}if(n.isU256()){if(D(e))return;i("U256",t)}if(n.isVector()){if(e instanceof o){e.values.length>0&&m(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof p){if(n.isString()){if(_(e))return;i("MoveString",t)}if(n.isObject()){if(h(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof T){e.value!==void 0&&m(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Z as a,P as b,N as c,a as d,nn as e,l as f};
2
+ //# sourceMappingURL=chunk-NVN6BTXK.mjs.map