@aptos-labs/ts-sdk 1.18.1 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/common/{accountAddress-Lv-GSihU.d.ts → accountAddress-NYtf3uZq.d.ts} +31 -20
  2. package/dist/common/cli/index.d.ts +1 -1
  3. package/dist/common/cli/index.js +1 -1
  4. package/dist/common/cli/index.js.map +1 -1
  5. package/dist/common/index.d.ts +138 -9
  6. package/dist/common/index.js +62 -51
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/account/Account.mjs +1 -1
  9. package/dist/esm/account/Ed25519Account.mjs +1 -1
  10. package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
  11. package/dist/esm/account/KeylessAccount.mjs +1 -1
  12. package/dist/esm/account/MultiKeyAccount.mjs +1 -1
  13. package/dist/esm/account/SingleKeyAccount.mjs +1 -1
  14. package/dist/esm/account/index.mjs +1 -1
  15. package/dist/esm/api/account.d.mts +3 -3
  16. package/dist/esm/api/account.mjs +1 -1
  17. package/dist/esm/api/ans.mjs +1 -1
  18. package/dist/esm/api/aptos.d.mts +3 -1
  19. package/dist/esm/api/aptos.mjs +1 -1
  20. package/dist/esm/api/aptosConfig.mjs +1 -1
  21. package/dist/esm/api/coin.mjs +1 -1
  22. package/dist/esm/api/digitalAsset.d.mts +49 -1
  23. package/dist/esm/api/digitalAsset.mjs +1 -1
  24. package/dist/esm/api/event.mjs +1 -1
  25. package/dist/esm/api/faucet.mjs +1 -1
  26. package/dist/esm/api/fungibleAsset.d.mts +18 -1
  27. package/dist/esm/api/fungibleAsset.mjs +1 -1
  28. package/dist/esm/api/general.d.mts +21 -1
  29. package/dist/esm/api/general.mjs +1 -1
  30. package/dist/esm/api/index.d.mts +1 -0
  31. package/dist/esm/api/index.mjs +1 -1
  32. package/dist/esm/api/keyless.mjs +1 -1
  33. package/dist/esm/api/object.d.mts +39 -0
  34. package/dist/esm/api/object.mjs +2 -0
  35. package/dist/esm/api/object.mjs.map +1 -0
  36. package/dist/esm/api/staking.mjs +1 -1
  37. package/dist/esm/api/table.mjs +1 -1
  38. package/dist/esm/api/transaction.mjs +1 -1
  39. package/dist/esm/api/transactionSubmission/build.mjs +1 -1
  40. package/dist/esm/api/transactionSubmission/management.mjs +1 -1
  41. package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
  42. package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
  43. package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
  44. package/dist/esm/api/utils.mjs +1 -1
  45. package/dist/esm/bcs/index.mjs +1 -1
  46. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  47. package/dist/esm/{chunk-CZ6TC4GO.mjs → chunk-32BE76A3.mjs} +2 -2
  48. package/dist/esm/{chunk-DPO352QL.mjs → chunk-3CEN6LXR.mjs} +2 -2
  49. package/dist/esm/{chunk-FM6ALU5B.mjs → chunk-3DCHEXE3.mjs} +2 -2
  50. package/dist/esm/chunk-463B3NF7.mjs +2 -0
  51. package/dist/esm/chunk-463B3NF7.mjs.map +1 -0
  52. package/dist/esm/{chunk-L22R3OIW.mjs → chunk-4ARX2MGY.mjs} +2 -2
  53. package/dist/esm/{chunk-S32JHML7.mjs → chunk-4KAXCXAK.mjs} +2 -2
  54. package/dist/esm/chunk-4KYQ7N3N.mjs +2 -0
  55. package/dist/esm/{chunk-Z4YHE4A5.mjs.map → chunk-4KYQ7N3N.mjs.map} +1 -1
  56. package/dist/esm/chunk-5MFDTDK2.mjs +2 -0
  57. package/dist/esm/chunk-5MFDTDK2.mjs.map +1 -0
  58. package/dist/esm/{chunk-XWVU4G57.mjs → chunk-5ZBDXUER.mjs} +2 -2
  59. package/dist/esm/{chunk-U6X2FYNI.mjs → chunk-67BD7B6N.mjs} +2 -2
  60. package/dist/esm/chunk-6DDSU7HN.mjs +2 -0
  61. package/dist/esm/{chunk-LVSOUCFD.mjs.map → chunk-6DDSU7HN.mjs.map} +1 -1
  62. package/dist/esm/chunk-6QTWWNRH.mjs +2 -0
  63. package/dist/esm/chunk-6QTWWNRH.mjs.map +1 -0
  64. package/dist/esm/{chunk-5YHI7WOB.mjs → chunk-7CMCN6LB.mjs} +2 -2
  65. package/dist/esm/{chunk-UAZUO75M.mjs → chunk-7DDRPSWU.mjs} +2 -2
  66. package/dist/esm/chunk-7DDRPSWU.mjs.map +1 -0
  67. package/dist/esm/{chunk-AVH5SYTL.mjs → chunk-7HS4UJGE.mjs} +2 -2
  68. package/dist/esm/{chunk-4EPLOSKY.mjs → chunk-7WFKAS7T.mjs} +2 -2
  69. package/dist/esm/{chunk-WQHW4WQN.mjs → chunk-7X6HZUXX.mjs} +2 -2
  70. package/dist/esm/{chunk-NCUBVHUW.mjs → chunk-ARMY5A3J.mjs} +2 -2
  71. package/dist/esm/{chunk-5X2BJDOB.mjs → chunk-BLAIJHMU.mjs} +2 -2
  72. package/dist/esm/{chunk-BVB3QII3.mjs → chunk-C2IJG37E.mjs} +2 -2
  73. package/dist/esm/{chunk-7Y45UTRL.mjs → chunk-CCUUYI4Z.mjs} +2 -2
  74. package/dist/esm/{chunk-EAW6AWYD.mjs → chunk-COJZFWV3.mjs} +2 -2
  75. package/dist/esm/{chunk-M3JHXCGV.mjs → chunk-CPCS5KIA.mjs} +2 -2
  76. package/dist/esm/{chunk-A2Z7I2EY.mjs → chunk-F6REP536.mjs} +2 -2
  77. package/dist/esm/{chunk-DW2KZREM.mjs → chunk-GCPWPGCS.mjs} +2 -2
  78. package/dist/esm/{chunk-SLFAROVZ.mjs → chunk-GQ6Q7KK5.mjs} +2 -2
  79. package/dist/esm/{chunk-QL2QFRKV.mjs → chunk-H6CS3BD7.mjs} +2 -2
  80. package/dist/esm/{chunk-K7DBDI2I.mjs → chunk-H6QWMF3Q.mjs} +2 -2
  81. package/dist/esm/chunk-HNTKL7NS.mjs +2 -0
  82. package/dist/esm/chunk-HNTKL7NS.mjs.map +1 -0
  83. package/dist/esm/{chunk-NSQLZBCA.mjs → chunk-I2T6BJOA.mjs} +2 -2
  84. package/dist/esm/{chunk-42SZQH5Z.mjs → chunk-J5KAD2RM.mjs} +2 -2
  85. package/dist/esm/{chunk-MHZ64FIW.mjs → chunk-J5YHMYHB.mjs} +2 -2
  86. package/dist/esm/chunk-KMJ6TF6Y.mjs +2 -0
  87. package/dist/esm/chunk-KMJ6TF6Y.mjs.map +1 -0
  88. package/dist/esm/chunk-L36ZHC7J.mjs +2 -0
  89. package/dist/esm/{chunk-YE5B2S5L.mjs.map → chunk-L36ZHC7J.mjs.map} +1 -1
  90. package/dist/esm/{chunk-K4CTCBLY.mjs → chunk-L6RINMT6.mjs} +2 -2
  91. package/dist/esm/{chunk-HHE63GFW.mjs → chunk-LBKYNX5K.mjs} +2 -2
  92. package/dist/esm/{chunk-AYKZA676.mjs → chunk-LBU3LV7I.mjs} +2 -2
  93. package/dist/esm/{chunk-6DYDZSEW.mjs → chunk-M2J7QC7G.mjs} +2 -2
  94. package/dist/esm/chunk-MIEXKKJP.mjs +2 -0
  95. package/dist/esm/chunk-MIEXKKJP.mjs.map +1 -0
  96. package/dist/esm/{chunk-6UDHM6YZ.mjs → chunk-MTPARVMT.mjs} +2 -2
  97. package/dist/esm/{chunk-UGVNOSD3.mjs → chunk-NJYVAMTG.mjs} +2 -2
  98. package/dist/esm/{chunk-BS7EVBWX.mjs → chunk-NWAGENBX.mjs} +2 -2
  99. package/dist/esm/{chunk-6JL2U7JB.mjs → chunk-NZFKPV67.mjs} +2 -2
  100. package/dist/esm/{chunk-3ZCQQ3L2.mjs → chunk-O7XEE7QT.mjs} +2 -2
  101. package/dist/esm/{chunk-EYIJYUN7.mjs → chunk-PTK4OJ2U.mjs} +2 -2
  102. package/dist/esm/{chunk-F74FF323.mjs → chunk-PVEPP4HR.mjs} +2 -2
  103. package/dist/esm/chunk-PY23BQ2H.mjs +2 -0
  104. package/dist/esm/chunk-PY23BQ2H.mjs.map +1 -0
  105. package/dist/esm/{chunk-QAMV4L3K.mjs → chunk-PZAA2YYO.mjs} +2 -2
  106. package/dist/esm/{chunk-JSWBLHMX.mjs → chunk-Q7ZP25NJ.mjs} +2 -2
  107. package/dist/esm/{chunk-C5V4EBVP.mjs → chunk-RA56CRJB.mjs} +2 -2
  108. package/dist/esm/{chunk-FYB7C42X.mjs → chunk-RM2IVUJ2.mjs} +2 -2
  109. package/dist/esm/chunk-S6H5Q2IK.mjs +2 -0
  110. package/dist/esm/chunk-S6H5Q2IK.mjs.map +1 -0
  111. package/dist/esm/{chunk-QVWBJJRF.mjs → chunk-SQQ2424E.mjs} +2 -2
  112. package/dist/esm/chunk-SYV4KFI7.mjs +2 -0
  113. package/dist/esm/chunk-SYV4KFI7.mjs.map +1 -0
  114. package/dist/esm/{chunk-2QWQ6RX5.mjs → chunk-T4NXIMZL.mjs} +2 -2
  115. package/dist/esm/{chunk-4IBJW3PB.mjs → chunk-T7YRD4PM.mjs} +2 -2
  116. package/dist/esm/{chunk-XYLM277Z.mjs → chunk-TPMVNFS5.mjs} +2 -2
  117. package/dist/esm/{chunk-362JBD4O.mjs → chunk-TZOKV22Z.mjs} +2 -2
  118. package/dist/esm/{chunk-GFRNBBTY.mjs → chunk-UJYWEIQ2.mjs} +2 -2
  119. package/dist/esm/{chunk-VTKPSYKA.mjs → chunk-UYF7AQLE.mjs} +2 -2
  120. package/dist/esm/{chunk-TG2LLWVU.mjs → chunk-V2LIP26A.mjs} +2 -2
  121. package/dist/esm/chunk-V4SPDICR.mjs +2 -0
  122. package/dist/esm/chunk-V4SPDICR.mjs.map +1 -0
  123. package/dist/esm/{chunk-SFUTXSDK.mjs → chunk-VQPLSJEI.mjs} +2 -2
  124. package/dist/esm/chunk-WHQNLKFO.mjs +2 -0
  125. package/dist/esm/chunk-WHQNLKFO.mjs.map +1 -0
  126. package/dist/esm/{chunk-6ZQWPHLV.mjs → chunk-XWVMFCW3.mjs} +2 -2
  127. package/dist/esm/chunk-XZBGNMFN.mjs +2 -0
  128. package/dist/esm/chunk-XZBGNMFN.mjs.map +1 -0
  129. package/dist/esm/{chunk-FTIW5GGG.mjs → chunk-Y2H7FG2P.mjs} +2 -2
  130. package/dist/esm/{chunk-JPDT6E3B.mjs → chunk-YDXU6ALO.mjs} +2 -2
  131. package/dist/esm/{chunk-HIHKTLLM.mjs → chunk-YMFEA2TJ.mjs} +55 -44
  132. package/dist/esm/chunk-YMFEA2TJ.mjs.map +1 -0
  133. package/dist/esm/cli/index.mjs +1 -1
  134. package/dist/esm/cli/move.mjs +1 -1
  135. package/dist/esm/client/core.mjs +1 -1
  136. package/dist/esm/client/get.mjs +1 -1
  137. package/dist/esm/client/index.mjs +1 -1
  138. package/dist/esm/client/post.mjs +1 -1
  139. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  140. package/dist/esm/core/crypto/ephemeral.mjs +1 -1
  141. package/dist/esm/core/crypto/index.mjs +1 -1
  142. package/dist/esm/core/crypto/keyless.mjs +1 -1
  143. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  144. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  145. package/dist/esm/core/crypto/proof.mjs +1 -1
  146. package/dist/esm/core/crypto/publicKey.mjs +1 -1
  147. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  148. package/dist/esm/core/crypto/signature.mjs +1 -1
  149. package/dist/esm/core/crypto/singleKey.mjs +1 -1
  150. package/dist/esm/core/index.mjs +1 -1
  151. package/dist/esm/index.d.mts +4 -3
  152. package/dist/esm/index.mjs +1 -1
  153. package/dist/esm/internal/account.d.mts +3 -3
  154. package/dist/esm/internal/account.mjs +1 -1
  155. package/dist/esm/internal/ans.mjs +1 -1
  156. package/dist/esm/internal/coin.mjs +1 -1
  157. package/dist/esm/internal/digitalAsset.d.mts +14 -4
  158. package/dist/esm/internal/digitalAsset.mjs +1 -1
  159. package/dist/esm/internal/event.mjs +1 -1
  160. package/dist/esm/internal/faucet.mjs +1 -1
  161. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  162. package/dist/esm/internal/general.mjs +1 -1
  163. package/dist/esm/internal/keyless.mjs +1 -1
  164. package/dist/esm/internal/object.d.mts +25 -0
  165. package/dist/esm/internal/object.mjs +2 -0
  166. package/dist/esm/internal/object.mjs.map +1 -0
  167. package/dist/esm/internal/staking.mjs +1 -1
  168. package/dist/esm/internal/table.mjs +1 -1
  169. package/dist/esm/internal/transaction.mjs +1 -1
  170. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  171. package/dist/esm/internal/view.d.mts +7 -2
  172. package/dist/esm/internal/view.mjs +1 -1
  173. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  174. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  175. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  176. package/dist/esm/transactions/index.d.mts +2 -2
  177. package/dist/esm/transactions/index.mjs +1 -1
  178. package/dist/esm/transactions/instances/index.mjs +1 -1
  179. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  180. package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
  181. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  182. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  183. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  184. package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
  185. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  186. package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
  187. package/dist/esm/transactions/management/index.mjs +1 -1
  188. package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
  189. package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -2
  190. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  191. package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
  192. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  193. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -0
  194. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  195. package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
  196. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  197. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  198. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  199. package/dist/esm/transactions/types.d.mts +18 -2
  200. package/dist/esm/types/generated/operations.d.mts +37 -26
  201. package/dist/esm/types/generated/queries.d.mts +5 -5
  202. package/dist/esm/types/generated/queries.mjs +1 -1
  203. package/dist/esm/types/generated/types.d.mts +227 -15
  204. package/dist/esm/types/generated/types.mjs +1 -1
  205. package/dist/esm/types/generated/types.mjs.map +1 -1
  206. package/dist/esm/types/index.d.mts +1 -1
  207. package/dist/esm/types/indexer.d.mts +3 -3
  208. package/dist/esm/utils/const.d.mts +2 -1
  209. package/dist/esm/utils/const.mjs +1 -1
  210. package/dist/esm/utils/index.mjs +1 -1
  211. package/dist/esm/utils/normalizeBundle.mjs +1 -1
  212. package/dist/esm/version.d.mts +1 -1
  213. package/dist/esm/version.mjs +1 -1
  214. package/package.json +1 -1
  215. package/src/api/account.ts +3 -3
  216. package/src/api/aptos.ts +6 -0
  217. package/src/api/digitalAsset.ts +81 -1
  218. package/src/api/fungibleAsset.ts +36 -2
  219. package/src/api/general.ts +25 -2
  220. package/src/api/object.ts +43 -0
  221. package/src/bcs/serializable/moveStructs.ts +5 -2
  222. package/src/cli/move.ts +2 -3
  223. package/src/internal/account.ts +7 -9
  224. package/src/internal/digitalAsset.ts +67 -24
  225. package/src/internal/object.ts +45 -0
  226. package/src/internal/queries/getCollectionData.graphql +19 -10
  227. package/src/internal/queries/{getAccountOwnedObjects.graphql → getObjectData.graphql} +1 -1
  228. package/src/internal/view.ts +27 -1
  229. package/src/transactions/transactionBuilder/helpers.ts +12 -1
  230. package/src/transactions/transactionBuilder/remoteAbi.ts +58 -24
  231. package/src/transactions/types.ts +19 -1
  232. package/src/types/generated/operations.ts +37 -26
  233. package/src/types/generated/queries.ts +51 -40
  234. package/src/types/generated/types.ts +252 -14
  235. package/src/types/indexer.ts +2 -2
  236. package/src/utils/const.ts +1 -0
  237. package/src/version.ts +1 -1
  238. package/dist/esm/chunk-2DSPX6BX.mjs +0 -2
  239. package/dist/esm/chunk-2DSPX6BX.mjs.map +0 -1
  240. package/dist/esm/chunk-BLVYB7Y3.mjs +0 -2
  241. package/dist/esm/chunk-BLVYB7Y3.mjs.map +0 -1
  242. package/dist/esm/chunk-DLDGUTFV.mjs +0 -2
  243. package/dist/esm/chunk-DLDGUTFV.mjs.map +0 -1
  244. package/dist/esm/chunk-HCN7YJGB.mjs +0 -2
  245. package/dist/esm/chunk-HCN7YJGB.mjs.map +0 -1
  246. package/dist/esm/chunk-HIHKTLLM.mjs.map +0 -1
  247. package/dist/esm/chunk-LVSOUCFD.mjs +0 -2
  248. package/dist/esm/chunk-NNQYSSLH.mjs +0 -2
  249. package/dist/esm/chunk-NNQYSSLH.mjs.map +0 -1
  250. package/dist/esm/chunk-PTA3VHTQ.mjs +0 -2
  251. package/dist/esm/chunk-PTA3VHTQ.mjs.map +0 -1
  252. package/dist/esm/chunk-RJ4RKVVQ.mjs +0 -2
  253. package/dist/esm/chunk-RJ4RKVVQ.mjs.map +0 -1
  254. package/dist/esm/chunk-U4A56FN2.mjs +0 -2
  255. package/dist/esm/chunk-U4A56FN2.mjs.map +0 -1
  256. package/dist/esm/chunk-UAZUO75M.mjs.map +0 -1
  257. package/dist/esm/chunk-VCMP3MXN.mjs +0 -2
  258. package/dist/esm/chunk-VCMP3MXN.mjs.map +0 -1
  259. package/dist/esm/chunk-YE5B2S5L.mjs +0 -2
  260. package/dist/esm/chunk-YMUCYX3B.mjs +0 -2
  261. package/dist/esm/chunk-YMUCYX3B.mjs.map +0 -1
  262. package/dist/esm/chunk-Z4YHE4A5.mjs +0 -2
  263. /package/dist/esm/{chunk-CZ6TC4GO.mjs.map → chunk-32BE76A3.mjs.map} +0 -0
  264. /package/dist/esm/{chunk-DPO352QL.mjs.map → chunk-3CEN6LXR.mjs.map} +0 -0
  265. /package/dist/esm/{chunk-FM6ALU5B.mjs.map → chunk-3DCHEXE3.mjs.map} +0 -0
  266. /package/dist/esm/{chunk-L22R3OIW.mjs.map → chunk-4ARX2MGY.mjs.map} +0 -0
  267. /package/dist/esm/{chunk-S32JHML7.mjs.map → chunk-4KAXCXAK.mjs.map} +0 -0
  268. /package/dist/esm/{chunk-XWVU4G57.mjs.map → chunk-5ZBDXUER.mjs.map} +0 -0
  269. /package/dist/esm/{chunk-U6X2FYNI.mjs.map → chunk-67BD7B6N.mjs.map} +0 -0
  270. /package/dist/esm/{chunk-5YHI7WOB.mjs.map → chunk-7CMCN6LB.mjs.map} +0 -0
  271. /package/dist/esm/{chunk-AVH5SYTL.mjs.map → chunk-7HS4UJGE.mjs.map} +0 -0
  272. /package/dist/esm/{chunk-4EPLOSKY.mjs.map → chunk-7WFKAS7T.mjs.map} +0 -0
  273. /package/dist/esm/{chunk-WQHW4WQN.mjs.map → chunk-7X6HZUXX.mjs.map} +0 -0
  274. /package/dist/esm/{chunk-NCUBVHUW.mjs.map → chunk-ARMY5A3J.mjs.map} +0 -0
  275. /package/dist/esm/{chunk-5X2BJDOB.mjs.map → chunk-BLAIJHMU.mjs.map} +0 -0
  276. /package/dist/esm/{chunk-BVB3QII3.mjs.map → chunk-C2IJG37E.mjs.map} +0 -0
  277. /package/dist/esm/{chunk-7Y45UTRL.mjs.map → chunk-CCUUYI4Z.mjs.map} +0 -0
  278. /package/dist/esm/{chunk-EAW6AWYD.mjs.map → chunk-COJZFWV3.mjs.map} +0 -0
  279. /package/dist/esm/{chunk-M3JHXCGV.mjs.map → chunk-CPCS5KIA.mjs.map} +0 -0
  280. /package/dist/esm/{chunk-A2Z7I2EY.mjs.map → chunk-F6REP536.mjs.map} +0 -0
  281. /package/dist/esm/{chunk-DW2KZREM.mjs.map → chunk-GCPWPGCS.mjs.map} +0 -0
  282. /package/dist/esm/{chunk-SLFAROVZ.mjs.map → chunk-GQ6Q7KK5.mjs.map} +0 -0
  283. /package/dist/esm/{chunk-QL2QFRKV.mjs.map → chunk-H6CS3BD7.mjs.map} +0 -0
  284. /package/dist/esm/{chunk-K7DBDI2I.mjs.map → chunk-H6QWMF3Q.mjs.map} +0 -0
  285. /package/dist/esm/{chunk-NSQLZBCA.mjs.map → chunk-I2T6BJOA.mjs.map} +0 -0
  286. /package/dist/esm/{chunk-42SZQH5Z.mjs.map → chunk-J5KAD2RM.mjs.map} +0 -0
  287. /package/dist/esm/{chunk-MHZ64FIW.mjs.map → chunk-J5YHMYHB.mjs.map} +0 -0
  288. /package/dist/esm/{chunk-K4CTCBLY.mjs.map → chunk-L6RINMT6.mjs.map} +0 -0
  289. /package/dist/esm/{chunk-HHE63GFW.mjs.map → chunk-LBKYNX5K.mjs.map} +0 -0
  290. /package/dist/esm/{chunk-AYKZA676.mjs.map → chunk-LBU3LV7I.mjs.map} +0 -0
  291. /package/dist/esm/{chunk-6DYDZSEW.mjs.map → chunk-M2J7QC7G.mjs.map} +0 -0
  292. /package/dist/esm/{chunk-6UDHM6YZ.mjs.map → chunk-MTPARVMT.mjs.map} +0 -0
  293. /package/dist/esm/{chunk-UGVNOSD3.mjs.map → chunk-NJYVAMTG.mjs.map} +0 -0
  294. /package/dist/esm/{chunk-BS7EVBWX.mjs.map → chunk-NWAGENBX.mjs.map} +0 -0
  295. /package/dist/esm/{chunk-6JL2U7JB.mjs.map → chunk-NZFKPV67.mjs.map} +0 -0
  296. /package/dist/esm/{chunk-3ZCQQ3L2.mjs.map → chunk-O7XEE7QT.mjs.map} +0 -0
  297. /package/dist/esm/{chunk-EYIJYUN7.mjs.map → chunk-PTK4OJ2U.mjs.map} +0 -0
  298. /package/dist/esm/{chunk-F74FF323.mjs.map → chunk-PVEPP4HR.mjs.map} +0 -0
  299. /package/dist/esm/{chunk-QAMV4L3K.mjs.map → chunk-PZAA2YYO.mjs.map} +0 -0
  300. /package/dist/esm/{chunk-JSWBLHMX.mjs.map → chunk-Q7ZP25NJ.mjs.map} +0 -0
  301. /package/dist/esm/{chunk-C5V4EBVP.mjs.map → chunk-RA56CRJB.mjs.map} +0 -0
  302. /package/dist/esm/{chunk-FYB7C42X.mjs.map → chunk-RM2IVUJ2.mjs.map} +0 -0
  303. /package/dist/esm/{chunk-QVWBJJRF.mjs.map → chunk-SQQ2424E.mjs.map} +0 -0
  304. /package/dist/esm/{chunk-2QWQ6RX5.mjs.map → chunk-T4NXIMZL.mjs.map} +0 -0
  305. /package/dist/esm/{chunk-4IBJW3PB.mjs.map → chunk-T7YRD4PM.mjs.map} +0 -0
  306. /package/dist/esm/{chunk-XYLM277Z.mjs.map → chunk-TPMVNFS5.mjs.map} +0 -0
  307. /package/dist/esm/{chunk-362JBD4O.mjs.map → chunk-TZOKV22Z.mjs.map} +0 -0
  308. /package/dist/esm/{chunk-GFRNBBTY.mjs.map → chunk-UJYWEIQ2.mjs.map} +0 -0
  309. /package/dist/esm/{chunk-VTKPSYKA.mjs.map → chunk-UYF7AQLE.mjs.map} +0 -0
  310. /package/dist/esm/{chunk-TG2LLWVU.mjs.map → chunk-V2LIP26A.mjs.map} +0 -0
  311. /package/dist/esm/{chunk-SFUTXSDK.mjs.map → chunk-VQPLSJEI.mjs.map} +0 -0
  312. /package/dist/esm/{chunk-6ZQWPHLV.mjs.map → chunk-XWVMFCW3.mjs.map} +0 -0
  313. /package/dist/esm/{chunk-FTIW5GGG.mjs.map → chunk-Y2H7FG2P.mjs.map} +0 -0
  314. /package/dist/esm/{chunk-JPDT6E3B.mjs.map → chunk-YDXU6ALO.mjs.map} +0 -0
@@ -4565,6 +4565,184 @@ export type CurrentTokenPendingClaimsStreamCursorValueInput = {
4565
4565
  token_data_id_hash?: InputMaybe<Scalars["String"]["input"]>;
4566
4566
  };
4567
4567
 
4568
+ /** columns and relationships of "current_unified_fungible_asset_balances_to_be_renamed" */
4569
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamed = {
4570
+ amount?: Maybe<Scalars["numeric"]["output"]>;
4571
+ asset_type?: Maybe<Scalars["String"]["output"]>;
4572
+ is_frozen: Scalars["Boolean"]["output"];
4573
+ is_primary?: Maybe<Scalars["Boolean"]["output"]>;
4574
+ last_transaction_timestamp?: Maybe<Scalars["timestamp"]["output"]>;
4575
+ last_transaction_version?: Maybe<Scalars["bigint"]["output"]>;
4576
+ /** An object relationship */
4577
+ metadata?: Maybe<FungibleAssetMetadata>;
4578
+ owner_address: Scalars["String"]["output"];
4579
+ storage_id: Scalars["String"]["output"];
4580
+ };
4581
+
4582
+ /** aggregated selection of "current_unified_fungible_asset_balances_to_be_renamed" */
4583
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedAggregate = {
4584
+ aggregate?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedAggregateFields>;
4585
+ nodes: Array<CurrentUnifiedFungibleAssetBalancesToBeRenamed>;
4586
+ };
4587
+
4588
+ /** aggregate fields of "current_unified_fungible_asset_balances_to_be_renamed" */
4589
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedAggregateFields = {
4590
+ avg?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedAvgFields>;
4591
+ count: Scalars["Int"]["output"];
4592
+ max?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedMaxFields>;
4593
+ min?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedMinFields>;
4594
+ stddev?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedStddevFields>;
4595
+ stddev_pop?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedStddevPopFields>;
4596
+ stddev_samp?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedStddevSampFields>;
4597
+ sum?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedSumFields>;
4598
+ var_pop?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedVarPopFields>;
4599
+ var_samp?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedVarSampFields>;
4600
+ variance?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedVarianceFields>;
4601
+ };
4602
+
4603
+ /** aggregate fields of "current_unified_fungible_asset_balances_to_be_renamed" */
4604
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedAggregateFieldsCountArgs = {
4605
+ columns?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedSelectColumn>>;
4606
+ distinct?: InputMaybe<Scalars["Boolean"]["input"]>;
4607
+ };
4608
+
4609
+ /** aggregate avg on columns */
4610
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedAvgFields = {
4611
+ amount?: Maybe<Scalars["Float"]["output"]>;
4612
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
4613
+ };
4614
+
4615
+ /** Boolean expression to filter rows from the table "current_unified_fungible_asset_balances_to_be_renamed". All fields are combined with a logical 'AND'. */
4616
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp = {
4617
+ _and?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>>;
4618
+ _not?: InputMaybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>;
4619
+ _or?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>>;
4620
+ amount?: InputMaybe<NumericComparisonExp>;
4621
+ asset_type?: InputMaybe<StringComparisonExp>;
4622
+ is_frozen?: InputMaybe<BooleanComparisonExp>;
4623
+ is_primary?: InputMaybe<BooleanComparisonExp>;
4624
+ last_transaction_timestamp?: InputMaybe<TimestampComparisonExp>;
4625
+ last_transaction_version?: InputMaybe<BigintComparisonExp>;
4626
+ metadata?: InputMaybe<FungibleAssetMetadataBoolExp>;
4627
+ owner_address?: InputMaybe<StringComparisonExp>;
4628
+ storage_id?: InputMaybe<StringComparisonExp>;
4629
+ };
4630
+
4631
+ /** aggregate max on columns */
4632
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedMaxFields = {
4633
+ amount?: Maybe<Scalars["numeric"]["output"]>;
4634
+ asset_type?: Maybe<Scalars["String"]["output"]>;
4635
+ last_transaction_timestamp?: Maybe<Scalars["timestamp"]["output"]>;
4636
+ last_transaction_version?: Maybe<Scalars["bigint"]["output"]>;
4637
+ owner_address?: Maybe<Scalars["String"]["output"]>;
4638
+ storage_id?: Maybe<Scalars["String"]["output"]>;
4639
+ };
4640
+
4641
+ /** aggregate min on columns */
4642
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedMinFields = {
4643
+ amount?: Maybe<Scalars["numeric"]["output"]>;
4644
+ asset_type?: Maybe<Scalars["String"]["output"]>;
4645
+ last_transaction_timestamp?: Maybe<Scalars["timestamp"]["output"]>;
4646
+ last_transaction_version?: Maybe<Scalars["bigint"]["output"]>;
4647
+ owner_address?: Maybe<Scalars["String"]["output"]>;
4648
+ storage_id?: Maybe<Scalars["String"]["output"]>;
4649
+ };
4650
+
4651
+ /** Ordering options when selecting data from "current_unified_fungible_asset_balances_to_be_renamed". */
4652
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedOrderBy = {
4653
+ amount?: InputMaybe<OrderBy>;
4654
+ asset_type?: InputMaybe<OrderBy>;
4655
+ is_frozen?: InputMaybe<OrderBy>;
4656
+ is_primary?: InputMaybe<OrderBy>;
4657
+ last_transaction_timestamp?: InputMaybe<OrderBy>;
4658
+ last_transaction_version?: InputMaybe<OrderBy>;
4659
+ metadata?: InputMaybe<FungibleAssetMetadataOrderBy>;
4660
+ owner_address?: InputMaybe<OrderBy>;
4661
+ storage_id?: InputMaybe<OrderBy>;
4662
+ };
4663
+
4664
+ /** select columns of table "current_unified_fungible_asset_balances_to_be_renamed" */
4665
+ export enum CurrentUnifiedFungibleAssetBalancesToBeRenamedSelectColumn {
4666
+ /** column name */
4667
+ Amount = "amount",
4668
+ /** column name */
4669
+ AssetType = "asset_type",
4670
+ /** column name */
4671
+ IsFrozen = "is_frozen",
4672
+ /** column name */
4673
+ IsPrimary = "is_primary",
4674
+ /** column name */
4675
+ LastTransactionTimestamp = "last_transaction_timestamp",
4676
+ /** column name */
4677
+ LastTransactionVersion = "last_transaction_version",
4678
+ /** column name */
4679
+ OwnerAddress = "owner_address",
4680
+ /** column name */
4681
+ StorageId = "storage_id",
4682
+ }
4683
+
4684
+ /** aggregate stddev on columns */
4685
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedStddevFields = {
4686
+ amount?: Maybe<Scalars["Float"]["output"]>;
4687
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
4688
+ };
4689
+
4690
+ /** aggregate stddev_pop on columns */
4691
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedStddevPopFields = {
4692
+ amount?: Maybe<Scalars["Float"]["output"]>;
4693
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
4694
+ };
4695
+
4696
+ /** aggregate stddev_samp on columns */
4697
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedStddevSampFields = {
4698
+ amount?: Maybe<Scalars["Float"]["output"]>;
4699
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
4700
+ };
4701
+
4702
+ /** Streaming cursor of the table "current_unified_fungible_asset_balances_to_be_renamed" */
4703
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedStreamCursorInput = {
4704
+ /** Stream column input with initial value */
4705
+ initial_value: CurrentUnifiedFungibleAssetBalancesToBeRenamedStreamCursorValueInput;
4706
+ /** cursor ordering */
4707
+ ordering?: InputMaybe<CursorOrdering>;
4708
+ };
4709
+
4710
+ /** Initial value of the column from where the streaming should start */
4711
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedStreamCursorValueInput = {
4712
+ amount?: InputMaybe<Scalars["numeric"]["input"]>;
4713
+ asset_type?: InputMaybe<Scalars["String"]["input"]>;
4714
+ is_frozen?: InputMaybe<Scalars["Boolean"]["input"]>;
4715
+ is_primary?: InputMaybe<Scalars["Boolean"]["input"]>;
4716
+ last_transaction_timestamp?: InputMaybe<Scalars["timestamp"]["input"]>;
4717
+ last_transaction_version?: InputMaybe<Scalars["bigint"]["input"]>;
4718
+ owner_address?: InputMaybe<Scalars["String"]["input"]>;
4719
+ storage_id?: InputMaybe<Scalars["String"]["input"]>;
4720
+ };
4721
+
4722
+ /** aggregate sum on columns */
4723
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedSumFields = {
4724
+ amount?: Maybe<Scalars["numeric"]["output"]>;
4725
+ last_transaction_version?: Maybe<Scalars["bigint"]["output"]>;
4726
+ };
4727
+
4728
+ /** aggregate var_pop on columns */
4729
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedVarPopFields = {
4730
+ amount?: Maybe<Scalars["Float"]["output"]>;
4731
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
4732
+ };
4733
+
4734
+ /** aggregate var_samp on columns */
4735
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedVarSampFields = {
4736
+ amount?: Maybe<Scalars["Float"]["output"]>;
4737
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
4738
+ };
4739
+
4740
+ /** aggregate variance on columns */
4741
+ export type CurrentUnifiedFungibleAssetBalancesToBeRenamedVarianceFields = {
4742
+ amount?: Maybe<Scalars["Float"]["output"]>;
4743
+ last_transaction_version?: Maybe<Scalars["Float"]["output"]>;
4744
+ };
4745
+
4568
4746
  /** ordering argument of a cursor */
4569
4747
  export enum CursorOrdering {
4570
4748
  /** ascending ordering of the cursor */
@@ -5636,19 +5814,19 @@ export type LedgerInfosStreamCursorValueInput = {
5636
5814
  chain_id?: InputMaybe<Scalars["bigint"]["input"]>;
5637
5815
  };
5638
5816
 
5639
- /** columns and relationships of "move_resources" */
5817
+ /** columns and relationships of "legacy_migration_v1.move_resources" */
5640
5818
  export type MoveResources = {
5641
- address: Scalars["String"]["output"];
5642
- transaction_version: Scalars["bigint"]["output"];
5819
+ address?: Maybe<Scalars["String"]["output"]>;
5820
+ transaction_version?: Maybe<Scalars["bigint"]["output"]>;
5643
5821
  };
5644
5822
 
5645
- /** aggregated selection of "move_resources" */
5823
+ /** aggregated selection of "legacy_migration_v1.move_resources" */
5646
5824
  export type MoveResourcesAggregate = {
5647
5825
  aggregate?: Maybe<MoveResourcesAggregateFields>;
5648
5826
  nodes: Array<MoveResources>;
5649
5827
  };
5650
5828
 
5651
- /** aggregate fields of "move_resources" */
5829
+ /** aggregate fields of "legacy_migration_v1.move_resources" */
5652
5830
  export type MoveResourcesAggregateFields = {
5653
5831
  avg?: Maybe<MoveResourcesAvgFields>;
5654
5832
  count: Scalars["Int"]["output"];
@@ -5663,7 +5841,7 @@ export type MoveResourcesAggregateFields = {
5663
5841
  variance?: Maybe<MoveResourcesVarianceFields>;
5664
5842
  };
5665
5843
 
5666
- /** aggregate fields of "move_resources" */
5844
+ /** aggregate fields of "legacy_migration_v1.move_resources" */
5667
5845
  export type MoveResourcesAggregateFieldsCountArgs = {
5668
5846
  columns?: InputMaybe<Array<MoveResourcesSelectColumn>>;
5669
5847
  distinct?: InputMaybe<Scalars["Boolean"]["input"]>;
@@ -5674,7 +5852,7 @@ export type MoveResourcesAvgFields = {
5674
5852
  transaction_version?: Maybe<Scalars["Float"]["output"]>;
5675
5853
  };
5676
5854
 
5677
- /** Boolean expression to filter rows from the table "move_resources". All fields are combined with a logical 'AND'. */
5855
+ /** Boolean expression to filter rows from the table "legacy_migration_v1.move_resources". All fields are combined with a logical 'AND'. */
5678
5856
  export type MoveResourcesBoolExp = {
5679
5857
  _and?: InputMaybe<Array<MoveResourcesBoolExp>>;
5680
5858
  _not?: InputMaybe<MoveResourcesBoolExp>;
@@ -5695,13 +5873,13 @@ export type MoveResourcesMinFields = {
5695
5873
  transaction_version?: Maybe<Scalars["bigint"]["output"]>;
5696
5874
  };
5697
5875
 
5698
- /** Ordering options when selecting data from "move_resources". */
5876
+ /** Ordering options when selecting data from "legacy_migration_v1.move_resources". */
5699
5877
  export type MoveResourcesOrderBy = {
5700
5878
  address?: InputMaybe<OrderBy>;
5701
5879
  transaction_version?: InputMaybe<OrderBy>;
5702
5880
  };
5703
5881
 
5704
- /** select columns of table "move_resources" */
5882
+ /** select columns of table "legacy_migration_v1.move_resources" */
5705
5883
  export enum MoveResourcesSelectColumn {
5706
5884
  /** column name */
5707
5885
  Address = "address",
@@ -7081,6 +7259,12 @@ export type QueryRoot = {
7081
7259
  current_token_pending_claims: Array<CurrentTokenPendingClaims>;
7082
7260
  /** fetch data from the table: "current_token_pending_claims" using primary key columns */
7083
7261
  current_token_pending_claims_by_pk?: Maybe<CurrentTokenPendingClaims>;
7262
+ /** fetch data from the table: "current_unified_fungible_asset_balances_to_be_renamed" */
7263
+ current_unified_fungible_asset_balances_to_be_renamed: Array<CurrentUnifiedFungibleAssetBalancesToBeRenamed>;
7264
+ /** fetch aggregated fields from the table: "current_unified_fungible_asset_balances_to_be_renamed" */
7265
+ current_unified_fungible_asset_balances_to_be_renamed_aggregate: CurrentUnifiedFungibleAssetBalancesToBeRenamedAggregate;
7266
+ /** fetch data from the table: "current_unified_fungible_asset_balances_to_be_renamed" using primary key columns */
7267
+ current_unified_fungible_asset_balances_to_be_renamed_by_pk?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamed>;
7084
7268
  /** An array relationship */
7085
7269
  delegated_staking_activities: Array<DelegatedStakingActivities>;
7086
7270
  /** fetch data from the table: "delegated_staking_activities" using primary key columns */
@@ -7119,9 +7303,9 @@ export type QueryRoot = {
7119
7303
  ledger_infos: Array<LedgerInfos>;
7120
7304
  /** fetch data from the table: "ledger_infos" using primary key columns */
7121
7305
  ledger_infos_by_pk?: Maybe<LedgerInfos>;
7122
- /** fetch data from the table: "move_resources" */
7306
+ /** fetch data from the table: "legacy_migration_v1.move_resources" */
7123
7307
  move_resources: Array<MoveResources>;
7124
- /** fetch aggregated fields from the table: "move_resources" */
7308
+ /** fetch aggregated fields from the table: "legacy_migration_v1.move_resources" */
7125
7309
  move_resources_aggregate: MoveResourcesAggregate;
7126
7310
  /** fetch data from the table: "nft_marketplace_v2.current_nft_marketplace_auctions" */
7127
7311
  nft_marketplace_v2_current_nft_marketplace_auctions: Array<NftMarketplaceV2CurrentNftMarketplaceAuctions>;
@@ -7628,6 +7812,26 @@ export type QueryRootCurrentTokenPendingClaimsByPkArgs = {
7628
7812
  token_data_id_hash: Scalars["String"]["input"];
7629
7813
  };
7630
7814
 
7815
+ export type QueryRootCurrentUnifiedFungibleAssetBalancesToBeRenamedArgs = {
7816
+ distinct_on?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedSelectColumn>>;
7817
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
7818
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
7819
+ order_by?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedOrderBy>>;
7820
+ where?: InputMaybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>;
7821
+ };
7822
+
7823
+ export type QueryRootCurrentUnifiedFungibleAssetBalancesToBeRenamedAggregateArgs = {
7824
+ distinct_on?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedSelectColumn>>;
7825
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
7826
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
7827
+ order_by?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedOrderBy>>;
7828
+ where?: InputMaybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>;
7829
+ };
7830
+
7831
+ export type QueryRootCurrentUnifiedFungibleAssetBalancesToBeRenamedByPkArgs = {
7832
+ storage_id: Scalars["String"]["input"];
7833
+ };
7834
+
7631
7835
  export type QueryRootDelegatedStakingActivitiesArgs = {
7632
7836
  distinct_on?: InputMaybe<Array<DelegatedStakingActivitiesSelectColumn>>;
7633
7837
  limit?: InputMaybe<Scalars["Int"]["input"]>;
@@ -8318,6 +8522,14 @@ export type SubscriptionRoot = {
8318
8522
  current_token_pending_claims_by_pk?: Maybe<CurrentTokenPendingClaims>;
8319
8523
  /** fetch data from the table in a streaming manner: "current_token_pending_claims" */
8320
8524
  current_token_pending_claims_stream: Array<CurrentTokenPendingClaims>;
8525
+ /** fetch data from the table: "current_unified_fungible_asset_balances_to_be_renamed" */
8526
+ current_unified_fungible_asset_balances_to_be_renamed: Array<CurrentUnifiedFungibleAssetBalancesToBeRenamed>;
8527
+ /** fetch aggregated fields from the table: "current_unified_fungible_asset_balances_to_be_renamed" */
8528
+ current_unified_fungible_asset_balances_to_be_renamed_aggregate: CurrentUnifiedFungibleAssetBalancesToBeRenamedAggregate;
8529
+ /** fetch data from the table: "current_unified_fungible_asset_balances_to_be_renamed" using primary key columns */
8530
+ current_unified_fungible_asset_balances_to_be_renamed_by_pk?: Maybe<CurrentUnifiedFungibleAssetBalancesToBeRenamed>;
8531
+ /** fetch data from the table in a streaming manner: "current_unified_fungible_asset_balances_to_be_renamed" */
8532
+ current_unified_fungible_asset_balances_to_be_renamed_stream: Array<CurrentUnifiedFungibleAssetBalancesToBeRenamed>;
8321
8533
  /** An array relationship */
8322
8534
  delegated_staking_activities: Array<DelegatedStakingActivities>;
8323
8535
  /** fetch data from the table: "delegated_staking_activities" using primary key columns */
@@ -8374,11 +8586,11 @@ export type SubscriptionRoot = {
8374
8586
  ledger_infos_by_pk?: Maybe<LedgerInfos>;
8375
8587
  /** fetch data from the table in a streaming manner: "ledger_infos" */
8376
8588
  ledger_infos_stream: Array<LedgerInfos>;
8377
- /** fetch data from the table: "move_resources" */
8589
+ /** fetch data from the table: "legacy_migration_v1.move_resources" */
8378
8590
  move_resources: Array<MoveResources>;
8379
- /** fetch aggregated fields from the table: "move_resources" */
8591
+ /** fetch aggregated fields from the table: "legacy_migration_v1.move_resources" */
8380
8592
  move_resources_aggregate: MoveResourcesAggregate;
8381
- /** fetch data from the table in a streaming manner: "move_resources" */
8593
+ /** fetch data from the table in a streaming manner: "legacy_migration_v1.move_resources" */
8382
8594
  move_resources_stream: Array<MoveResources>;
8383
8595
  /** fetch data from the table: "nft_marketplace_v2.current_nft_marketplace_auctions" */
8384
8596
  nft_marketplace_v2_current_nft_marketplace_auctions: Array<NftMarketplaceV2CurrentNftMarketplaceAuctions>;
@@ -9095,6 +9307,32 @@ export type SubscriptionRootCurrentTokenPendingClaimsStreamArgs = {
9095
9307
  where?: InputMaybe<CurrentTokenPendingClaimsBoolExp>;
9096
9308
  };
9097
9309
 
9310
+ export type SubscriptionRootCurrentUnifiedFungibleAssetBalancesToBeRenamedArgs = {
9311
+ distinct_on?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedSelectColumn>>;
9312
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
9313
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
9314
+ order_by?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedOrderBy>>;
9315
+ where?: InputMaybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>;
9316
+ };
9317
+
9318
+ export type SubscriptionRootCurrentUnifiedFungibleAssetBalancesToBeRenamedAggregateArgs = {
9319
+ distinct_on?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedSelectColumn>>;
9320
+ limit?: InputMaybe<Scalars["Int"]["input"]>;
9321
+ offset?: InputMaybe<Scalars["Int"]["input"]>;
9322
+ order_by?: InputMaybe<Array<CurrentUnifiedFungibleAssetBalancesToBeRenamedOrderBy>>;
9323
+ where?: InputMaybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>;
9324
+ };
9325
+
9326
+ export type SubscriptionRootCurrentUnifiedFungibleAssetBalancesToBeRenamedByPkArgs = {
9327
+ storage_id: Scalars["String"]["input"];
9328
+ };
9329
+
9330
+ export type SubscriptionRootCurrentUnifiedFungibleAssetBalancesToBeRenamedStreamArgs = {
9331
+ batch_size: Scalars["Int"]["input"];
9332
+ cursor: Array<InputMaybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedStreamCursorInput>>;
9333
+ where?: InputMaybe<CurrentUnifiedFungibleAssetBalancesToBeRenamedBoolExp>;
9334
+ };
9335
+
9098
9336
  export type SubscriptionRootDelegatedStakingActivitiesArgs = {
9099
9337
  distinct_on?: InputMaybe<Array<DelegatedStakingActivitiesSelectColumn>>;
9100
9338
  limit?: InputMaybe<Scalars["Int"]["input"]>;
@@ -13,7 +13,7 @@
13
13
 
14
14
  import {
15
15
  GetAccountCoinsDataQuery,
16
- GetAccountOwnedObjectsQuery,
16
+ GetObjectDataQuery,
17
17
  GetAccountOwnedTokensQuery,
18
18
  GetAccountOwnedTokensFromCollectionQuery,
19
19
  GetAccountCollectionsWithOwnedTokensQuery,
@@ -44,7 +44,7 @@ import {
44
44
  * These types are used as the return type when calling a sdk api function
45
45
  * that calls the function that queries the server (usually under the /api/ folder)
46
46
  */
47
- export type GetAccountOwnedObjectsResponse = GetAccountOwnedObjectsQuery["current_objects"];
47
+ export type GetObjectDataQueryResponse = GetObjectDataQuery["current_objects"];
48
48
 
49
49
  export type GetAccountOwnedTokensQueryResponse = GetAccountOwnedTokensQuery["current_token_ownerships_v2"];
50
50
 
@@ -64,4 +64,5 @@ export enum ProcessorType {
64
64
  // Token V2 processor replaces Token processor (not only for digital assets)
65
65
  TOKEN_V2_PROCESSOR = "token_v2_processor",
66
66
  USER_TRANSACTION_PROCESSOR = "user_transaction_processor",
67
+ OBJECT_PROCESSOR = "objects_processor",
67
68
  }
package/src/version.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * hardcoded for now, we would want to have it injected dynamically
8
8
  */
9
- export const VERSION = "1.18.1";
9
+ export const VERSION = "1.20.0";
@@ -1,2 +0,0 @@
1
- import{c as r}from"./chunk-QAMV4L3K.mjs";import{b as i}from"./chunk-FTIW5GGG.mjs";import{b as t}from"./chunk-A63SMUOU.mjs";async function v(a){let{aptosConfig:o,payload:n,options:s}=a,p=await r({...n,aptosConfig:o}),e=new t;p.serialize(e);let l=e.toUint8Array(),{data:d}=await i({aptosConfig:o,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:s?.ledgerVersion},body:l});return d}export{v as a};
2
- //# sourceMappingURL=chunk-2DSPX6BX.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/internal/view.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LedgerVersionArg, MimeType, MoveValue } from \"../types\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { generateViewFunctionPayload, InputViewFunctionData } from \"../transactions\";\nimport { Serializer } from \"../bcs\";\nimport { postAptosFullNode } from \"../client\";\n\nexport async function view<T extends Array<MoveValue> = Array<MoveValue>>(args: {\n aptosConfig: AptosConfig;\n payload: InputViewFunctionData;\n options?: LedgerVersionArg;\n}): Promise<T> {\n const { aptosConfig, payload, options } = args;\n const viewFunctionPayload = await generateViewFunctionPayload({\n ...payload,\n aptosConfig,\n });\n\n const serializer = new Serializer();\n viewFunctionPayload.serialize(serializer);\n const bytes = serializer.toUint8Array();\n\n const { data } = await postAptosFullNode<Uint8Array, MoveValue[]>({\n aptosConfig,\n path: \"view\",\n originMethod: \"view\",\n contentType: MimeType.BCS_VIEW_FUNCTION,\n params: { ledger_version: options?.ledgerVersion },\n body: bytes,\n });\n\n return data as T;\n}\n"],"mappings":"2HASA,eAAsBA,EAAoDC,EAI3D,CACb,GAAM,CAAE,YAAAC,EAAa,QAAAC,EAAS,QAAAC,CAAQ,EAAIH,EACpCI,EAAsB,MAAMC,EAA4B,CAC5D,GAAGH,EACH,YAAAD,CACF,CAAC,EAEKK,EAAa,IAAIC,EACvBH,EAAoB,UAAUE,CAAU,EACxC,IAAME,EAAQF,EAAW,aAAa,EAEhC,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAA2C,CAChE,YAAAT,EACA,KAAM,OACN,aAAc,OACd,oDACA,OAAQ,CAAE,eAAgBE,GAAS,aAAc,EACjD,KAAMK,CACR,CAAC,EAED,OAAOC,CACT","names":["view","args","aptosConfig","payload","options","viewFunctionPayload","generateViewFunctionPayload","serializer","Serializer","bytes","data","postAptosFullNode"]}
@@ -1,2 +0,0 @@
1
- import{a as u}from"./chunk-2QWQ6RX5.mjs";import{a as y}from"./chunk-6DYDZSEW.mjs";import{a as m}from"./chunk-XYLM277Z.mjs";import{a as h}from"./chunk-TG2LLWVU.mjs";import{a as d}from"./chunk-NMD45OTM.mjs";import{a as r}from"./chunk-7Y45UTRL.mjs";import{a}from"./chunk-VCMP3MXN.mjs";import{a as c}from"./chunk-SLFAROVZ.mjs";import{a as l}from"./chunk-6UDHM6YZ.mjs";import{a as f}from"./chunk-YMUCYX3B.mjs";import{a as g}from"./chunk-PTA3VHTQ.mjs";import{a as s}from"./chunk-UAZUO75M.mjs";import{a as p}from"./chunk-CZ6TC4GO.mjs";var t=class{constructor(e){this.config=new d(e),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new l(this.config),this.fungibleAsset=new f(this.config),this.general=new g(this.config),this.staking=new y(this.config),this.transaction=new h(this.config),this.table=new m(this.config),this.keyless=new u(this.config)}};function n(A,e,b){Object.getOwnPropertyNames(e.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&(o.value=function(...w){return this[b][i](...w)},Object.defineProperty(A.prototype,i,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,l,"faucet");n(t,f,"fungibleAsset");n(t,g,"general");n(t,y,"staking");n(t,h,"transaction");n(t,m,"table");n(t,u,"keyless");export{t as a};
2
- //# sourceMappingURL=chunk-BLVYB7Y3.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Table } from \"./table\";\nimport { Keyless } from \"./keyless\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n *\n * @example\n *\n * const aptos = new Aptos();\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly table: Table;\n\n readonly keyless: Keyless;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.table = new Table(this.config);\n this.keyless = new Keyless(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Keyless,\n Staking,\n Table,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Table, \"table\");\napplyMixin(Aptos, Keyless, \"keyless\");\n"],"mappings":"ghBA4BO,IAAMA,EAAN,KAAY,CA2BjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,CACxC,CACF,EA0BA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWf,EAAOG,EAAS,SAAS,EACpCY,EAAWf,EAAOI,EAAK,KAAK,EAC5BW,EAAWf,EAAOK,EAAM,MAAM,EAC9BU,EAAWf,EAAOM,EAAc,cAAc,EAC9CS,EAAWf,EAAOO,EAAO,OAAO,EAChCQ,EAAWf,EAAOQ,EAAQ,QAAQ,EAClCO,EAAWf,EAAOS,EAAe,eAAe,EAChDM,EAAWf,EAAOU,EAAS,SAAS,EACpCK,EAAWf,EAAOW,EAAS,SAAS,EACpCI,EAAWf,EAAOY,EAAa,aAAa,EAC5CG,EAAWf,EAAOa,EAAO,OAAO,EAChCE,EAAWf,EAAOc,EAAS,SAAS","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Table","Keyless","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
@@ -1,2 +0,0 @@
1
- import{a as P}from"./chunk-NSQLZBCA.mjs";import{c as d}from"./chunk-K4CTCBLY.mjs";import{d as w,e as h,f as k,g as T,h as b,j as O,k as q,l as v}from"./chunk-HIHKTLLM.mjs";import{a as f}from"./chunk-5YHI7WOB.mjs";import{a as C}from"./chunk-QVWBJJRF.mjs";import{b as y}from"./chunk-6ZQWPHLV.mjs";import{b as l}from"./chunk-A2Z7I2EY.mjs";import{a as g}from"./chunk-77NXCSLY.mjs";import{b as c}from"./chunk-BF46IXHH.mjs";import{a as _}from"./chunk-AH44UPM4.mjs";import{b as A,d as p}from"./chunk-HHE63GFW.mjs";import{a as m}from"./chunk-GHYE26Q5.mjs";async function S(t){let{aptosConfig:n,accountAddress:e}=t,{data:o}=await A({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(e).toString()}`});return o}async function H(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return p({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(e).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function J(t){return t.options?.ledgerVersion!==void 0?G(t):_(async()=>G(t),`module-${t.accountAddress}-${t.moduleName}`,1e3*60*5)()}async function G(t){let{aptosConfig:n,accountAddress:e,moduleName:o,options:s}=t,{data:r}=await A({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(e).toString()}/module/${o}`,params:{ledger_version:s?.ledgerVersion}});return r}async function U(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return p({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(e).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function X(t){let{aptosConfig:n,accountAddress:e,options:o}=t;return p({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(e).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(t){let{aptosConfig:n,accountAddress:e,resourceType:o,options:s}=t,{data:r}=await A({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(e).toString()}/resource/${o}`,params:{ledger_version:s?.ledgerVersion}});return r.data}async function Q(t){let{aptosConfig:n,authenticationKey:e,options:o}=t,s=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:r}}=s,a=c.from(e);try{let i=await P({aptosConfig:n,handle:r,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof m&&i.data.error_code==="table_item_not_found")return a;throw i}}async function Y(t){let{aptosConfig:n,accountAddress:e}=t,s={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:q,variables:{where_condition:s}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function Z(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.token_standard={_eq:o?.tokenStandard});let a={query:b,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function oo(t){let{aptosConfig:n,accountAddress:e,collectionAddress:o,options:s}=t,r=c.from(e).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:r},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};s?.tokenStandard&&(i.token_standard={_eq:s?.tokenStandard});let u={query:O,variables:{where_condition:i,offset:s?.offset,limit:s?.limit,order_by:s?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function to(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(r.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:k,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function eo(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:v,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return r.account_transactions_aggregate.aggregate?r.account_transactions_aggregate.aggregate.count:0}async function no(t){let{aptosConfig:n,accountAddress:e,coinType:o}=t,s=c.from(e).toStringLong(),r=await I({aptosConfig:n,accountAddress:s,options:{where:{asset_type:{_eq:o}}}});return r[0]?r[0].amount:0}async function I(t){let{aptosConfig:n,accountAddress:e,options:o}=t,s=c.from(e).toStringLong(),r={...o?.where,owner_address:{_eq:s}},a={query:h,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function ro(t){let{aptosConfig:n,accountAddress:e}=t,o=c.from(e).toStringLong(),r=await d({aptosConfig:n,query:{query:w,variables:{address:o}},originMethod:"getAccountCoinsCount"});if(!r.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return r.current_fungible_asset_balances_aggregate.aggregate.count}async function so(t){let{aptosConfig:n,accountAddress:e,options:o}=t,r={owner_address:{_eq:c.from(e).toStringLong()}},a={query:T,variables:{where_condition:r,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function co(t){let{aptosConfig:n,privateKey:e}=t,o=new C(e.publicKey());if(e instanceof y){let r=g.fromPublicKey({publicKey:o}).derivedAddress();return f.fromPrivateKey({privateKey:e,address:r})}if(e instanceof l){let s=g.fromPublicKey({publicKey:o});if(await M({authKey:s,aptosConfig:n})){let u=s.derivedAddress();return f.fromPrivateKey({privateKey:e,address:u,legacy:!1})}let a=g.fromPublicKey({publicKey:o.publicKey});if(await M({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return f.fromPrivateKey({privateKey:e,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function M(t){let{aptosConfig:n,authKey:e}=t,o=await Q({aptosConfig:n,authenticationKey:e.derivedAddress()});try{return await S({aptosConfig:n,accountAddress:o}),!0}catch(s){if(s.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{S as a,H as b,J as c,U as d,X as e,K as f,Q as g,Y as h,Z as i,oo as j,to as k,eo as l,no as m,I as n,ro as o,so as p,co as q,M as r};
2
- //# sourceMappingURL=chunk-DLDGUTFV.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/internal/account.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/account}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * account namespace and without having a dependency cycle error.\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AptosApiError, getAptosFullNode, paginateWithCursor } from \"../client\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { Account } from \"../account\";\nimport { AnyPublicKey, Ed25519PublicKey, PrivateKey } from \"../core/crypto\";\nimport { queryIndexer } from \"./general\";\nimport {\n AccountData,\n GetAccountCoinsDataResponse,\n GetAccountCollectionsWithOwnedTokenResponse,\n GetAccountOwnedObjectsResponse,\n GetAccountOwnedTokensFromCollectionResponse,\n GetAccountOwnedTokensQueryResponse,\n LedgerVersionArg,\n MoveModuleBytecode,\n MoveResource,\n MoveStructId,\n OrderByArg,\n PaginationArgs,\n TokenStandardArg,\n TransactionResponse,\n WhereArg,\n} from \"../types\";\nimport {\n GetAccountCoinsCountQuery,\n GetAccountCoinsDataQuery,\n GetAccountCollectionsWithOwnedTokensQuery,\n GetAccountOwnedObjectsQuery,\n GetAccountOwnedTokensFromCollectionQuery,\n GetAccountOwnedTokensQuery,\n GetAccountTokensCountQuery,\n GetAccountTransactionsCountQuery,\n} from \"../types/generated/operations\";\nimport {\n GetAccountCoinsCount,\n GetAccountCoinsData,\n GetAccountCollectionsWithOwnedTokens,\n GetAccountOwnedObjects,\n GetAccountOwnedTokens,\n GetAccountOwnedTokensFromCollection,\n GetAccountTokensCount,\n GetAccountTransactionsCount,\n} from \"../types/generated/queries\";\nimport { memoizeAsync } from \"../utils/memoize\";\nimport { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey } from \"../core\";\nimport { CurrentFungibleAssetBalancesBoolExp } from \"../types/generated/types\";\nimport { getTableItem } from \"./table\";\n\nexport async function getInfo(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<AccountData> {\n const { aptosConfig, accountAddress } = args;\n const { data } = await getAptosFullNode<{}, AccountData>({\n aptosConfig,\n originMethod: \"getInfo\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}`,\n });\n return data;\n}\n\nexport async function getModules(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n}): Promise<MoveModuleBytecode[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, MoveModuleBytecode[]>({\n aptosConfig,\n originMethod: \"getModules\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/modules`,\n params: {\n ledger_version: options?.ledgerVersion,\n start: options?.offset,\n limit: options?.limit ?? 1000,\n },\n });\n}\n\n/**\n * Queries for a move module given account address and module name\n *\n * @param args.accountAddress Hex-encoded 32 byte Aptos account address\n * @param args.moduleName The name of the module\n * @param args.query.ledgerVersion Specifies ledger version of transactions. By default, latest version will be used\n * @returns The move module.\n */\nexport async function getModule(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n}): Promise<MoveModuleBytecode> {\n // We don't memoize the account module by ledger version, as it's not a common use case, this would be handled\n // by the developer directly\n if (args.options?.ledgerVersion !== undefined) {\n return getModuleInner(args);\n }\n\n return memoizeAsync(\n async () => getModuleInner(args),\n `module-${args.accountAddress}-${args.moduleName}`,\n 1000 * 60 * 5, // 5 minutes\n )();\n}\n\nasync function getModuleInner(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n moduleName: string;\n options?: LedgerVersionArg;\n}): Promise<MoveModuleBytecode> {\n const { aptosConfig, accountAddress, moduleName, options } = args;\n\n const { data } = await getAptosFullNode<{}, MoveModuleBytecode>({\n aptosConfig,\n originMethod: \"getModule\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/module/${moduleName}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n return data;\n}\n\nexport async function getTransactions(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs;\n}): Promise<TransactionResponse[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, TransactionResponse[]>({\n aptosConfig,\n originMethod: \"getTransactions\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/transactions`,\n params: { start: options?.offset, limit: options?.limit },\n });\n}\n\nexport async function getResources(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & LedgerVersionArg;\n}): Promise<MoveResource[]> {\n const { aptosConfig, accountAddress, options } = args;\n return paginateWithCursor<{}, MoveResource[]>({\n aptosConfig,\n originMethod: \"getResources\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resources`,\n params: {\n ledger_version: options?.ledgerVersion,\n start: options?.offset,\n limit: options?.limit ?? 999,\n },\n });\n}\n\nexport async function getResource<T extends {}>(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n resourceType: MoveStructId;\n options?: LedgerVersionArg;\n}): Promise<T> {\n const { aptosConfig, accountAddress, resourceType, options } = args;\n const { data } = await getAptosFullNode<{}, MoveResource>({\n aptosConfig,\n originMethod: \"getResource\",\n path: `accounts/${AccountAddress.from(accountAddress).toString()}/resource/${resourceType}`,\n params: { ledger_version: options?.ledgerVersion },\n });\n return data.data as T;\n}\n\nexport async function lookupOriginalAccountAddress(args: {\n aptosConfig: AptosConfig;\n authenticationKey: AccountAddressInput;\n options?: LedgerVersionArg;\n}): Promise<AccountAddress> {\n const { aptosConfig, authenticationKey, options } = args;\n type OriginatingAddress = {\n address_map: { handle: string };\n };\n const resource = await getResource<OriginatingAddress>({\n aptosConfig,\n accountAddress: \"0x1\",\n resourceType: \"0x1::account::OriginatingAddress\",\n options,\n });\n\n const {\n address_map: { handle },\n } = resource;\n\n const authKeyAddress = AccountAddress.from(authenticationKey);\n\n // If the address is not found in the address map, which means its not rotated\n // then return the address as is\n try {\n const originalAddress = await getTableItem<string>({\n aptosConfig,\n handle,\n data: {\n key: authKeyAddress.toString(),\n key_type: \"address\",\n value_type: \"address\",\n },\n options,\n });\n\n return AccountAddress.from(originalAddress);\n } catch (err) {\n if (err instanceof AptosApiError && err.data.error_code === \"table_item_not_found\") {\n return authKeyAddress;\n }\n\n throw err;\n }\n}\n\nexport async function getAccountTokensCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number } } = {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n const graphqlQuery = {\n query: GetAccountTokensCount,\n variables: { where_condition: whereCondition },\n };\n\n const data = await queryIndexer<GetAccountTokensCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTokensCount\",\n });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.current_token_ownerships_v2_aggregate.aggregate\n ? data.current_token_ownerships_v2_aggregate.aggregate.count\n : 0;\n}\n\nexport async function getAccountOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensQueryResponse[0]>;\n}): Promise<GetAccountOwnedTokensQueryResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string }; amount: { _gt: number }; token_standard?: { _eq: string } } =\n {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokens\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\nexport async function getAccountOwnedTokensFromCollectionAddress(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n collectionAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountOwnedTokensFromCollectionResponse[0]>;\n}): Promise<GetAccountOwnedTokensFromCollectionResponse> {\n const { aptosConfig, accountAddress, collectionAddress, options } = args;\n const ownerAddress = AccountAddress.from(accountAddress).toStringLong();\n const collAddress = AccountAddress.from(collectionAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n current_token_data: { collection_id: { _eq: string } };\n amount: { _gt: number };\n token_standard?: { _eq: string };\n } = {\n owner_address: { _eq: ownerAddress },\n current_token_data: { collection_id: { _eq: collAddress } },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.token_standard = { _eq: options?.tokenStandard };\n }\n\n const graphqlQuery = {\n query: GetAccountOwnedTokensFromCollection,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountOwnedTokensFromCollectionQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedTokensFromCollectionAddress\",\n });\n\n return data.current_token_ownerships_v2;\n}\n\nexport async function getAccountCollectionsWithOwnedTokens(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: TokenStandardArg & PaginationArgs & OrderByArg<GetAccountCollectionsWithOwnedTokenResponse[0]>;\n}): Promise<GetAccountCollectionsWithOwnedTokenResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: {\n owner_address: { _eq: string };\n amount: { _gt: number };\n current_collection?: { token_standard: { _eq: string } };\n } = {\n owner_address: { _eq: address },\n amount: { _gt: 0 },\n };\n\n if (options?.tokenStandard) {\n whereCondition.current_collection = {\n token_standard: { _eq: options?.tokenStandard },\n };\n }\n\n const graphqlQuery = {\n query: GetAccountCollectionsWithOwnedTokens,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCollectionsWithOwnedTokensQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCollectionsWithOwnedTokens\",\n });\n\n return data.current_collection_ownership_v2_view;\n}\n\nexport async function getAccountTransactionsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountTransactionsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountTransactionsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountTransactionsCount\",\n });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data.account_transactions_aggregate.aggregate ? data.account_transactions_aggregate.aggregate.count : 0;\n}\n\nexport async function getAccountCoinAmount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n coinType: MoveStructId;\n}): Promise<number> {\n const { aptosConfig, accountAddress, coinType } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const data = await getAccountCoinsData({\n aptosConfig,\n accountAddress: address,\n options: {\n where: { asset_type: { _eq: coinType } },\n },\n });\n\n // commonjs (aka cjs) doesnt handle Nullish Coalescing for some reason\n // might be because of how ts infer the graphql generated scheme type\n return data[0] ? data[0].amount : 0;\n}\n\nexport async function getAccountCoinsData(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & OrderByArg<GetAccountCoinsDataResponse[0]> & WhereArg<CurrentFungibleAssetBalancesBoolExp>;\n}): Promise<GetAccountCoinsDataResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n ...options?.where,\n owner_address: { _eq: address },\n };\n\n const graphqlQuery = {\n query: GetAccountCoinsData,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n\n const data = await queryIndexer<GetAccountCoinsDataQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsData\",\n });\n\n return data.current_fungible_asset_balances;\n}\n\nexport async function getAccountCoinsCount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n}): Promise<number> {\n const { aptosConfig, accountAddress } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const graphqlQuery = {\n query: GetAccountCoinsCount,\n variables: { address },\n };\n\n const data = await queryIndexer<GetAccountCoinsCountQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountCoinsCount\",\n });\n\n if (!data.current_fungible_asset_balances_aggregate.aggregate) {\n throw Error(\"Failed to get the count of account coins\");\n }\n\n return data.current_fungible_asset_balances_aggregate.aggregate.count;\n}\n\nexport async function getAccountOwnedObjects(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n options?: PaginationArgs & OrderByArg<GetAccountOwnedObjectsResponse[0]>;\n}): Promise<GetAccountOwnedObjectsResponse> {\n const { aptosConfig, accountAddress, options } = args;\n const address = AccountAddress.from(accountAddress).toStringLong();\n\n const whereCondition: { owner_address: { _eq: string } } = {\n owner_address: { _eq: address },\n };\n const graphqlQuery = {\n query: GetAccountOwnedObjects,\n variables: {\n where_condition: whereCondition,\n offset: options?.offset,\n limit: options?.limit,\n order_by: options?.orderBy,\n },\n };\n const data = await queryIndexer<GetAccountOwnedObjectsQuery>({\n aptosConfig,\n query: graphqlQuery,\n originMethod: \"getAccountOwnedObjects\",\n });\n\n return data.current_objects;\n}\n\n/**\n * NOTE: There is a potential issue once unified single signer scheme will be adopted\n * by the community.\n *\n * Becuase on could create 2 accounts with the same private key with this new authenticator type,\n * we’ll need to determine the order in which we lookup the accounts. First unified\n * scheme and then legacy scheme vs first legacy scheme and then unified scheme.\n *\n */\nexport async function deriveAccountFromPrivateKey(args: {\n aptosConfig: AptosConfig;\n privateKey: PrivateKey;\n}): Promise<Account> {\n const { aptosConfig, privateKey } = args;\n const publicKey = new AnyPublicKey(privateKey.publicKey());\n\n if (privateKey instanceof Secp256k1PrivateKey) {\n // private key is secp256k1, therefore we know it for sure uses a single signer key\n const authKey = AuthenticationKey.fromPublicKey({ publicKey });\n const address = authKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address });\n }\n\n if (privateKey instanceof Ed25519PrivateKey) {\n // lookup single sender ed25519\n const singleSenderTransactionAuthenticatorAuthKey = AuthenticationKey.fromPublicKey({\n publicKey,\n });\n const isSingleSenderTransactionAuthenticator = await isAccountExist({\n authKey: singleSenderTransactionAuthenticatorAuthKey,\n aptosConfig,\n });\n if (isSingleSenderTransactionAuthenticator) {\n const address = singleSenderTransactionAuthenticatorAuthKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address, legacy: false });\n }\n // lookup legacy ed25519\n const legacyAuthKey = AuthenticationKey.fromPublicKey({\n publicKey: publicKey.publicKey as Ed25519PublicKey,\n });\n const isLegacyEd25519 = await isAccountExist({ authKey: legacyAuthKey, aptosConfig });\n if (isLegacyEd25519) {\n const address = legacyAuthKey.derivedAddress();\n return Account.fromPrivateKey({ privateKey, address, legacy: true });\n }\n }\n // if we are here, it means we couldn't find an address with an\n // auth key that matches the provided private key\n throw new Error(`Can't derive account from private key ${privateKey}`);\n}\n\nexport async function isAccountExist(args: { aptosConfig: AptosConfig; authKey: AuthenticationKey }): Promise<boolean> {\n const { aptosConfig, authKey } = args;\n const accountAddress = await lookupOriginalAccountAddress({\n aptosConfig,\n authenticationKey: authKey.derivedAddress(),\n });\n\n try {\n await getInfo({\n aptosConfig,\n accountAddress,\n });\n return true;\n } catch (error: any) {\n // account not found\n if (error.status === 404) {\n return false;\n }\n throw new Error(`Error while looking for an account info ${accountAddress.toString()}`);\n }\n}\n"],"mappings":"oiBA0DA,eAAsBA,EAAQC,EAGL,CACvB,GAAM,CAAE,YAAAC,EAAa,eAAAC,CAAe,EAAIF,EAClC,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAkC,CACvD,YAAAH,EACA,aAAc,UACd,KAAM,YAAYI,EAAe,KAAKH,CAAc,EAAE,SAAS,CAAC,EAClE,CAAC,EACD,OAAOC,CACT,CAEA,eAAsBG,EAAWN,EAIC,CAChC,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,QAAAK,CAAQ,EAAIP,EACjD,OAAOQ,EAA6C,CAClD,YAAAP,EACA,aAAc,aACd,KAAM,YAAYI,EAAe,KAAKH,CAAc,EAAE,SAAS,CAAC,WAChE,OAAQ,CACN,eAAgBK,GAAS,cACzB,MAAOA,GAAS,OAChB,MAAOA,GAAS,OAAS,GAC3B,CACF,CAAC,CACH,CAUA,eAAsBE,EAAUT,EAKA,CAG9B,OAAIA,EAAK,SAAS,gBAAkB,OAC3BU,EAAeV,CAAI,EAGrBW,EACL,SAAYD,EAAeV,CAAI,EAC/B,UAAUA,EAAK,cAAc,IAAIA,EAAK,UAAU,GAChD,IAAO,GAAK,CACd,EAAE,CACJ,CAEA,eAAeU,EAAeV,EAKE,CAC9B,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,WAAAU,EAAY,QAAAL,CAAQ,EAAIP,EAEvD,CAAE,KAAAG,CAAK,EAAI,MAAMC,EAAyC,CAC9D,YAAAH,EACA,aAAc,YACd,KAAM,YAAYI,EAAe,KAAKH,CAAc,EAAE,SAAS,CAAC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CAAC,EAED,GADwB,MAAMO,EAAe,CAAE,QAASC,EAAe,YAAA5D,CAAY,CAAC,EAC/D,CACnB,IAAMwC,EAAUoB,EAAc,eAAe,EAC7C,OAAOJ,EAAQ,eAAe,CAAE,WAAAL,EAAY,QAAAX,EAAS,OAAQ,EAAK,CAAC,CACrE,CACF,CAGA,MAAM,IAAI,MAAM,yCAAyCW,CAAU,EAAE,CACvE,CAEA,eAAsBQ,EAAe5D,EAAkF,CACrH,GAAM,CAAE,YAAAC,EAAa,QAAA6D,CAAQ,EAAI9D,EAC3BE,EAAiB,MAAMe,EAA6B,CACxD,YAAAhB,EACA,kBAAmB6D,EAAQ,eAAe,CAC5C,CAAC,EAED,GAAI,CACF,aAAM/D,EAAQ,CACZ,YAAAE,EACA,eAAAC,CACF,CAAC,EACM,EACT,OAAS6D,EAAY,CAEnB,GAAIA,EAAM,SAAW,IACnB,MAAO,GAET,MAAM,IAAI,MAAM,2CAA2C7D,EAAe,SAAS,CAAC,EAAE,CACxF,CACF","names":["getInfo","args","aptosConfig","accountAddress","data","getAptosFullNode","AccountAddress","getModules","options","paginateWithCursor","getModule","getModuleInner","memoizeAsync","moduleName","getTransactions","getResources","getResource","resourceType","lookupOriginalAccountAddress","authenticationKey","resource","handle","authKeyAddress","originalAddress","getTableItem","err","AptosApiError","getAccountTokensCount","whereCondition","queryIndexer","GetAccountTokensCount","getAccountOwnedTokens","graphqlQuery","GetAccountOwnedTokens","getAccountOwnedTokensFromCollectionAddress","collectionAddress","ownerAddress","collAddress","GetAccountOwnedTokensFromCollection","getAccountCollectionsWithOwnedTokens","GetAccountCollectionsWithOwnedTokens","getAccountTransactionsCount","address","GetAccountTransactionsCount","getAccountCoinAmount","coinType","getAccountCoinsData","GetAccountCoinsData","getAccountCoinsCount","GetAccountCoinsCount","getAccountOwnedObjects","GetAccountOwnedObjects","deriveAccountFromPrivateKey","privateKey","publicKey","AnyPublicKey","Secp256k1PrivateKey","AuthenticationKey","Account","Ed25519PrivateKey","singleSenderTransactionAuthenticatorAuthKey","isAccountExist","legacyAuthKey","authKey","error"]}
@@ -1,2 +0,0 @@
1
- import{c as A}from"./chunk-3VUSIKCF.mjs";import{a as x,b as f,c as l,d as U,e as M,f as C,g as O,h as B,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-LVSOUCFD.mjs";import{c as I}from"./chunk-DLDGUTFV.mjs";import{n as S}from"./chunk-RFA7BIDN.mjs";import{b as E}from"./chunk-BF46IXHH.mjs";import{a as c,b as F,c as T}from"./chunk-RJ4RKVVQ.mjs";import{a as w,b as g,c as h,d,e as p,f as v,g as $}from"./chunk-YPHH6CAO.mjs";var R=new TextEncoder;function Y(n){return n?.map(e=>f(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(o=>o.name===t)}async function Z(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 o=L(r),y=[];for(let s=o;s<r.params.length;s+=1)y.push(A(r.params[s],{allowGenerics:!0}));return{signers:o,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 o=[];for(let s=0;s<r.params.length;s+=1)o.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:o,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 o=e.parameters[u];return m(t,o,u,r)}function m(n,e,t,u){return C(n)?(b(e,n,t),n):X(n,e,t,u)}function X(n,e,t,u){if(e.isBool()){if(x(n))return new w(n);if(f(n)){if(n==="true")return new w(!0);if(n==="false")return new w(!1)}i("boolean",t)}if(e.isAddress()){if(f(n))return E.fromString(n);i("string | AccountAddress",t)}if(e.isU8()){if(l(n))return new g(n);if(f(n))return new g(Number.parseInt(n,10));i("number",t)}if(e.isU16()){if(l(n))return new h(n);if(f(n))return new h(Number.parseInt(n,10));i("number",t)}if(e.isU32()){if(l(n))return new d(n);if(f(n))return new d(Number.parseInt(n,10));i("number",t)}if(e.isU64()){if(U(n))return new p(BigInt(n));i("bigint | number | string",t)}if(e.isU128()){if(U(n))return new v(BigInt(n));i("bigint | number | string",t)}if(e.isU256()){if(U(n))return new $(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 m(n,u[r],t,u)}if(e.isVector()){if(e.value.isU8()){if(f(n))return c.U8(R.encode(n));if(n instanceof Uint8Array)return c.U8(n);if(n instanceof ArrayBuffer)return c.U8(new Uint8Array(n))}if(Array.isArray(n))return new c(n.map(r=>m(r,e.value,t,u)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(f(n))return new F(n);i("string",t)}if(e.isObject()){if(f(n))return E.fromString(n);i("string | AccountAddress",t)}if(e.isOption())return M(n)?new T(null):new T(m(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 b(n,e,t){if(n.isBool()){if(O(e))return;i("Bool",t)}if(n.isAddress()){if(B(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 c){e.values.length>0&&b(n.value,e.values[0],t);return}i("MoveVector",t)}if(n instanceof S){if(n.isString()){if(_(e))return;i("MoveString",t)}if(n.isObject()){if(B(e))return;i("AccountAddress",t)}if(n.isOption()){if(e instanceof T){e.value!==void 0&&b(n.value.typeArgs[0],e.value,t);return}i("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}export{Y as a,P as b,Z as c,a as d,nn as e,m as f};
2
- //# sourceMappingURL=chunk-HCN7YJGB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/transactions/transactionBuilder/remoteAbi.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseTypeTag } from \"../typeTag/parser\";\nimport { TypeTag, TypeTagStruct } from \"../typeTag\";\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport {\n EntryFunctionArgumentTypes,\n SimpleEntryFunctionArgumentTypes,\n EntryFunctionABI,\n ViewFunctionABI,\n FunctionABI,\n TypeArgument,\n} from \"../types\";\nimport { Bool, MoveOption, MoveString, MoveVector, U128, U16, U256, U32, U64, U8 } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { getModule } from \"../../internal/account\";\nimport {\n findFirstNonSignerArg,\n isBcsAddress,\n isBcsBool,\n isBcsString,\n isBcsU128,\n isBcsU16,\n isBcsU256,\n isBcsU32,\n isBcsU64,\n isBcsU8,\n isBool,\n isEncodedEntryFunctionArgument,\n isLargeNumber,\n isNull,\n isNumber,\n isString,\n throwTypeMismatch,\n} from \"./helpers\";\nimport { MoveFunction } from \"../../types\";\n\nconst TEXT_ENCODER = new TextEncoder();\n\n/**\n * Convert type arguments to only type tags, allowing for string representations of type tags\n */\nexport function standardizeTypeTags(typeArguments?: Array<TypeArgument>): Array<TypeTag> {\n return (\n typeArguments?.map((typeArg: TypeArgument): TypeTag => {\n // Convert to TypeTag if it's a string representation\n if (isString(typeArg)) {\n return parseTypeTag(typeArg);\n }\n return typeArg;\n }) ?? []\n );\n}\n\n/**\n * Fetches a function ABI from the on-chain module ABI. It doesn't validate whether it's a view or entry function.\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<MoveFunction | undefined> {\n // This fetch from the API is currently cached\n const module = await getModule({ aptosConfig, accountAddress: moduleAddress, moduleName });\n\n if (module.abi) {\n return module.abi.exposed_functions.find((func) => func.name === functionName);\n }\n\n return undefined;\n}\n\n/**\n * Fetches the ABI for an entry function from the module\n *\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchEntryFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<EntryFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find entry function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-entry functions also can't be used\n if (!functionAbi.is_entry) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an entry function`);\n }\n\n // Remove the signer arguments\n const numSigners = findFirstNonSignerArg(functionAbi);\n const params: TypeTag[] = [];\n for (let i = numSigners; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n return {\n signers: numSigners,\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n };\n}\n\n/**\n * Fetches the ABI for a view function from the module\n *\n * @param moduleAddress\n * @param moduleName\n * @param functionName\n * @param aptosConfig\n */\nexport async function fetchViewFunctionAbi(\n moduleAddress: string,\n moduleName: string,\n functionName: string,\n aptosConfig: AptosConfig,\n): Promise<ViewFunctionABI> {\n const functionAbi = await fetchFunctionAbi(moduleAddress, moduleName, functionName, aptosConfig);\n\n // If there's no ABI, then the function is invalid\n if (!functionAbi) {\n throw new Error(`Could not find view function ABI for '${moduleAddress}::${moduleName}::${functionName}'`);\n }\n\n // Non-view functions can't be used\n if (!functionAbi.is_view) {\n throw new Error(`'${moduleAddress}::${moduleName}::${functionName}' is not an view function`);\n }\n\n // Type tag parameters for the function\n const params: TypeTag[] = [];\n for (let i = 0; i < functionAbi.params.length; i += 1) {\n params.push(parseTypeTag(functionAbi.params[i], { allowGenerics: true }));\n }\n\n // The return types of the view function\n const returnTypes: TypeTag[] = [];\n for (let i = 0; i < functionAbi.return.length; i += 1) {\n returnTypes.push(parseTypeTag(functionAbi.return[i], { allowGenerics: true }));\n }\n\n return {\n typeParameters: functionAbi.generic_type_params,\n parameters: params,\n returnTypes,\n };\n}\n\n/**\n * Converts a non-BCS encoded argument into BCS encoded, if necessary\n * @param functionName\n * @param functionAbi\n * @param arg\n * @param position\n */\nexport function convertArgument(\n functionName: string,\n functionAbi: FunctionABI,\n arg: EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // Ensure not too many arguments\n if (position >= functionAbi.parameters.length) {\n throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.parameters.length}`);\n }\n\n const param = functionAbi.parameters[position];\n return checkOrConvertArgument(arg, param, position, genericTypeParams);\n}\n\nexport function checkOrConvertArgument(\n arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n) {\n // If the argument is bcs encoded, we can just use it directly\n if (isEncodedEntryFunctionArgument(arg)) {\n // Ensure the type matches the ABI\n checkType(param, arg, position);\n return arg;\n }\n\n // If it is not BCS encoded, we will need to convert it with the ABI\n return parseArg(arg, param, position, genericTypeParams);\n}\n\n/**\n * Parses a non-BCS encoded argument into a BCS encoded argument recursively\n * @param arg\n * @param param\n * @param position\n * @param genericTypeParams\n */\nfunction parseArg(\n arg: SimpleEntryFunctionArgumentTypes,\n param: TypeTag,\n position: number,\n genericTypeParams: Array<TypeTag>,\n): EntryFunctionArgumentTypes {\n if (param.isBool()) {\n if (isBool(arg)) {\n return new Bool(arg);\n }\n if (isString(arg)) {\n if (arg === \"true\") return new Bool(true);\n if (arg === \"false\") return new Bool(false);\n }\n throwTypeMismatch(\"boolean\", position);\n }\n // TODO: support uint8array?\n if (param.isAddress()) {\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isNumber(arg)) {\n return new U8(arg);\n }\n if (isString(arg)) {\n return new U8(Number.parseInt(arg, 10));\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU16()) {\n if (isNumber(arg)) {\n return new U16(arg);\n }\n if (isString(arg)) {\n return new U16(Number.parseInt(arg, 10));\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU32()) {\n if (isNumber(arg)) {\n return new U32(arg);\n }\n if (isString(arg)) {\n return new U32(Number.parseInt(arg, 10));\n }\n throwTypeMismatch(\"number\", position);\n }\n if (param.isU64()) {\n if (isLargeNumber(arg)) {\n return new U64(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU128()) {\n if (isLargeNumber(arg)) {\n return new U128(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n if (param.isU256()) {\n if (isLargeNumber(arg)) {\n return new U256(BigInt(arg));\n }\n throwTypeMismatch(\"bigint | number | string\", position);\n }\n\n // Generic needs to use the sub-type\n if (param.isGeneric()) {\n const genericIndex = param.value;\n if (genericIndex < 0 || genericIndex >= genericTypeParams.length) {\n throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);\n }\n\n return checkOrConvertArgument(arg, genericTypeParams[genericIndex], position, genericTypeParams);\n }\n\n // We have to special case some vectors for Vector<u8>\n if (param.isVector()) {\n // Check special case for Vector<u8>\n if (param.value.isU8()) {\n // We don't allow vector<u8>, but we convert strings to UTF8 uint8array\n // This is legacy behavior from the original SDK\n if (isString(arg)) {\n return MoveVector.U8(TEXT_ENCODER.encode(arg));\n }\n if (arg instanceof Uint8Array) {\n return MoveVector.U8(arg);\n }\n if (arg instanceof ArrayBuffer) {\n return MoveVector.U8(new Uint8Array(arg));\n }\n }\n\n // TODO: Support Uint16Array, Uint32Array, BigUint64Array?\n\n if (Array.isArray(arg)) {\n return new MoveVector(arg.map((item) => checkOrConvertArgument(item, param.value, position, genericTypeParams)));\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n }\n\n // Handle structs as they're more complex\n if (param.isStruct()) {\n if (param.isString()) {\n if (isString(arg)) {\n return new MoveString(arg);\n }\n throwTypeMismatch(\"string\", position);\n }\n if (param.isObject()) {\n // The inner type of Object doesn't matter, since it's just syntactic sugar\n if (isString(arg)) {\n return AccountAddress.fromString(arg);\n }\n throwTypeMismatch(\"string | AccountAddress\", position);\n }\n\n if (param.isOption()) {\n // Empty option must be handled specially\n if (isNull(arg)) {\n // Note: This is a placeholder U8 type, and does not match the actual type, as that can't be dynamically grabbed\n return new MoveOption<U8>(null);\n }\n\n return new MoveOption(checkOrConvertArgument(arg, param.value.typeArgs[0], position, genericTypeParams));\n }\n\n throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);\n }\n\n throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);\n}\n\n/**\n * Checks that the type of an already BCS encoded argument matches the ABI\n * @param param\n * @param arg\n * @param position\n */\nfunction checkType(param: TypeTag, arg: EntryFunctionArgumentTypes, position: number) {\n if (param.isBool()) {\n if (isBcsBool(arg)) {\n return;\n }\n throwTypeMismatch(\"Bool\", position);\n }\n if (param.isAddress()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isU8()) {\n if (isBcsU8(arg)) {\n return;\n }\n throwTypeMismatch(\"U8\", position);\n }\n if (param.isU16()) {\n if (isBcsU16(arg)) {\n return;\n }\n throwTypeMismatch(\"U16\", position);\n }\n if (param.isU32()) {\n if (isBcsU32(arg)) {\n return;\n }\n throwTypeMismatch(\"U32\", position);\n }\n if (param.isU64()) {\n if (isBcsU64(arg)) {\n return;\n }\n throwTypeMismatch(\"U64\", position);\n }\n if (param.isU128()) {\n if (isBcsU128(arg)) {\n return;\n }\n throwTypeMismatch(\"U128\", position);\n }\n if (param.isU256()) {\n if (isBcsU256(arg)) {\n return;\n }\n throwTypeMismatch(\"U256\", position);\n }\n if (param.isVector()) {\n if (arg instanceof MoveVector) {\n // If there's anything in it, check that the inner types match\n // Note that since it's typed, the first item should be the same as the rest\n if (arg.values.length > 0) {\n checkType(param.value, arg.values[0], position);\n }\n\n return;\n }\n throwTypeMismatch(\"MoveVector\", position);\n }\n\n // Handle structs as they're more complex\n if (param instanceof TypeTagStruct) {\n if (param.isString()) {\n if (isBcsString(arg)) {\n return;\n }\n throwTypeMismatch(\"MoveString\", position);\n }\n if (param.isObject()) {\n if (isBcsAddress(arg)) {\n return;\n }\n throwTypeMismatch(\"AccountAddress\", position);\n }\n if (param.isOption()) {\n if (arg instanceof MoveOption) {\n // If there's a value, we can check the inner type (otherwise it doesn't really matter)\n if (arg.value !== undefined) {\n checkType(param.value.typeArgs[0], arg.value, position);\n }\n return;\n }\n throwTypeMismatch(\"MoveOption\", position);\n }\n }\n\n throw new Error(`Type mismatch for argument ${position}, expected '${param.toString()}'`);\n}\n"],"mappings":"kcAsCA,IAAMA,EAAe,IAAI,YAKlB,SAASC,EAAoBC,EAAqD,CACvF,OACEA,GAAe,IAAKC,GAEdC,EAASD,CAAO,EACXE,EAAaF,CAAO,EAEtBA,CACR,GAAK,CAAC,CAEX,CASA,eAAsBG,EACpBC,EACAC,EACAC,EACAC,EACmC,CAEnC,IAAMC,EAAS,MAAMC,EAAU,CAAE,YAAAF,EAAa,eAAgBH,EAAe,WAAAC,CAAW,CAAC,EAEzF,GAAIG,EAAO,IACT,OAAOA,EAAO,IAAI,kBAAkB,KAAME,GAASA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g","isString","parseTypeTag","fetchFunctionAbi","moduleAddress","moduleName","functionName","aptosConfig","module","getModule","func","fetchEntryFunctionAbi","functionAbi","numSigners","findFirstNonSignerArg","params","i","fetchViewFunctionAbi","returnTypes","convertArgument","arg","position","genericTypeParams","param","checkOrConvertArgument","isEncodedEntryFunctionArgument","checkType","parseArg","isBool","Bool","throwTypeMismatch","AccountAddress","isNumber","U8","U16","U32","isLargeNumber","U64","U128","U256","genericIndex","MoveVector","item","MoveString","isNull","MoveOption","isBcsBool","isBcsAddress","isBcsU8","isBcsU16","isBcsU32","isBcsU64","isBcsU128","isBcsU256","TypeTagStruct","isBcsString"]}