@mysten/sui 1.42.0 → 1.43.1

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 (429) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/bcs/bcs.d.ts +47 -111
  3. package/dist/cjs/bcs/bcs.js +17 -17
  4. package/dist/cjs/bcs/bcs.js.map +2 -2
  5. package/dist/cjs/bcs/effects.d.ts +2 -6
  6. package/dist/cjs/bcs/effects.js +1 -1
  7. package/dist/cjs/bcs/effects.js.map +2 -2
  8. package/dist/cjs/bcs/index.d.ts +49 -117
  9. package/dist/cjs/bcs/type-tag-serializer.d.ts +1 -0
  10. package/dist/cjs/bcs/type-tag-serializer.js +5 -1
  11. package/dist/cjs/bcs/type-tag-serializer.js.map +2 -2
  12. package/dist/cjs/cryptography/intent.js +1 -1
  13. package/dist/cjs/cryptography/intent.js.map +2 -2
  14. package/dist/cjs/cryptography/keypair.js +1 -1
  15. package/dist/cjs/cryptography/keypair.js.map +2 -2
  16. package/dist/cjs/cryptography/publickey.js +1 -1
  17. package/dist/cjs/cryptography/publickey.js.map +2 -2
  18. package/dist/cjs/cryptography/signature.d.ts +2 -2
  19. package/dist/cjs/experimental/client.js +0 -4
  20. package/dist/cjs/experimental/client.js.map +2 -2
  21. package/dist/cjs/experimental/types.d.ts +1 -7
  22. package/dist/cjs/experimental/types.js.map +1 -1
  23. package/dist/cjs/graphql/generated/queries.d.ts +1 -1
  24. package/dist/cjs/graphql/generated/queries.js.map +1 -1
  25. package/dist/cjs/grpc/core.d.ts +3 -1
  26. package/dist/cjs/grpc/core.js +5 -3
  27. package/dist/cjs/grpc/core.js.map +2 -2
  28. package/dist/cjs/grpc/proto/google/protobuf/any.d.ts +6 -6
  29. package/dist/cjs/grpc/proto/google/protobuf/any.js +20 -20
  30. package/dist/cjs/grpc/proto/google/protobuf/any.js.map +2 -2
  31. package/dist/cjs/grpc/proto/google/protobuf/duration.d.ts +4 -4
  32. package/dist/cjs/grpc/proto/google/protobuf/duration.js +8 -12
  33. package/dist/cjs/grpc/proto/google/protobuf/duration.js.map +2 -2
  34. package/dist/cjs/grpc/proto/google/protobuf/empty.d.ts +1 -1
  35. package/dist/cjs/grpc/proto/google/protobuf/empty.js.map +2 -2
  36. package/dist/cjs/grpc/proto/google/protobuf/field_mask.d.ts +4 -4
  37. package/dist/cjs/grpc/proto/google/protobuf/field_mask.js +8 -7
  38. package/dist/cjs/grpc/proto/google/protobuf/field_mask.js.map +2 -2
  39. package/dist/cjs/grpc/proto/google/protobuf/struct.d.ts +10 -10
  40. package/dist/cjs/grpc/proto/google/protobuf/struct.js +29 -17
  41. package/dist/cjs/grpc/proto/google/protobuf/struct.js.map +2 -2
  42. package/dist/cjs/grpc/proto/google/protobuf/timestamp.d.ts +4 -4
  43. package/dist/cjs/grpc/proto/google/protobuf/timestamp.js +21 -18
  44. package/dist/cjs/grpc/proto/google/protobuf/timestamp.js.map +2 -2
  45. package/dist/cjs/grpc/proto/google/rpc/error_details.d.ts +2 -2
  46. package/dist/cjs/grpc/proto/google/rpc/error_details.js +40 -11
  47. package/dist/cjs/grpc/proto/google/rpc/error_details.js.map +2 -2
  48. package/dist/cjs/grpc/proto/google/rpc/status.d.ts +2 -2
  49. package/dist/cjs/grpc/proto/google/rpc/status.js +1 -1
  50. package/dist/cjs/grpc/proto/google/rpc/status.js.map +2 -2
  51. package/dist/cjs/grpc/proto/sui/rpc/v2/argument.d.ts +1 -1
  52. package/dist/cjs/grpc/proto/sui/rpc/v2/argument.js +7 -1
  53. package/dist/cjs/grpc/proto/sui/rpc/v2/argument.js.map +2 -2
  54. package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.d.ts +1 -1
  55. package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.js.map +2 -2
  56. package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.d.ts +1 -1
  57. package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.js.map +2 -2
  58. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.d.ts +6 -6
  59. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.js +12 -7
  60. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.js.map +2 -2
  61. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.d.ts +3 -3
  62. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.js +16 -4
  63. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.js.map +2 -2
  64. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.d.ts +5 -5
  65. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.js +35 -13
  66. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.js.map +2 -2
  67. package/dist/cjs/grpc/proto/sui/rpc/v2/effects.d.ts +6 -6
  68. package/dist/cjs/grpc/proto/sui/rpc/v2/effects.js +65 -19
  69. package/dist/cjs/grpc/proto/sui/rpc/v2/effects.js.map +2 -2
  70. package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.d.ts +5 -5
  71. package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.js +4 -8
  72. package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.js.map +2 -2
  73. package/dist/cjs/grpc/proto/sui/rpc/v2/error_reason.js.map +2 -2
  74. package/dist/cjs/grpc/proto/sui/rpc/v2/event.d.ts +3 -3
  75. package/dist/cjs/grpc/proto/sui/rpc/v2/event.js +2 -2
  76. package/dist/cjs/grpc/proto/sui/rpc/v2/event.js.map +2 -2
  77. package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.d.ts +8 -8
  78. package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.js +21 -10
  79. package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.js.map +2 -2
  80. package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.d.ts +12 -12
  81. package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.js +75 -17
  82. package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.js.map +2 -2
  83. package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.d.ts +1 -1
  84. package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.js +0 -4
  85. package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.js.map +2 -2
  86. package/dist/cjs/grpc/proto/sui/rpc/v2/input.d.ts +2 -2
  87. package/dist/cjs/grpc/proto/sui/rpc/v2/input.js +8 -3
  88. package/dist/cjs/grpc/proto/sui/rpc/v2/input.js.map +2 -2
  89. package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.d.ts +1 -1
  90. package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.js.map +2 -2
  91. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts +18 -18
  92. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.js +50 -8
  93. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.js.map +2 -2
  94. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.d.ts +15 -15
  95. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.js +41 -20
  96. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.js.map +2 -2
  97. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.d.ts +1 -1
  98. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.js +126 -20
  99. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.js.map +2 -2
  100. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.d.ts +12 -12
  101. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.js +29 -5
  102. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.js.map +2 -2
  103. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.d.ts +5 -5
  104. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.js +16 -6
  105. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.js.map +2 -2
  106. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.d.ts +8 -8
  107. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.js +15 -3
  108. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.js.map +2 -2
  109. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.d.ts +3 -3
  110. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.js +18 -7
  111. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.js.map +2 -2
  112. package/dist/cjs/grpc/proto/sui/rpc/v2/object.d.ts +5 -5
  113. package/dist/cjs/grpc/proto/sui/rpc/v2/object.js +4 -8
  114. package/dist/cjs/grpc/proto/sui/rpc/v2/object.js.map +2 -2
  115. package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.d.ts +1 -1
  116. package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.js +0 -1
  117. package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.js.map +2 -2
  118. package/dist/cjs/grpc/proto/sui/rpc/v2/owner.d.ts +1 -1
  119. package/dist/cjs/grpc/proto/sui/rpc/v2/owner.js +7 -2
  120. package/dist/cjs/grpc/proto/sui/rpc/v2/owner.js.map +2 -2
  121. package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.d.ts +1 -1
  122. package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.js +22 -11
  123. package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.js.map +2 -2
  124. package/dist/cjs/grpc/proto/sui/rpc/v2/signature.d.ts +8 -8
  125. package/dist/cjs/grpc/proto/sui/rpc/v2/signature.js +73 -17
  126. package/dist/cjs/grpc/proto/sui/rpc/v2/signature.js.map +2 -2
  127. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_scheme.js.map +2 -2
  128. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.ts +6 -6
  129. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.js +8 -2
  130. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.js.map +2 -2
  131. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.d.ts +5 -5
  132. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.js +7 -6
  133. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.js.map +2 -2
  134. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.d.ts +14 -14
  135. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.js +36 -6
  136. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.js.map +2 -2
  137. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.d.ts +5 -5
  138. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.js +60 -14
  139. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.js.map +2 -2
  140. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts +6 -6
  141. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.js +8 -2
  142. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.js.map +2 -2
  143. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.d.ts +4 -4
  144. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.js +9 -4
  145. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.js.map +2 -2
  146. package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.d.ts +1 -1
  147. package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.js +26 -59
  148. package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.js.map +2 -2
  149. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.d.ts +29 -29
  150. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.js +210 -71
  151. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.js.map +2 -2
  152. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts +8 -8
  153. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js +15 -3
  154. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js.map +2 -2
  155. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.d.ts +9 -9
  156. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.js +62 -16
  157. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.js.map +2 -2
  158. package/dist/cjs/jsonRpc/client.d.ts +2 -6
  159. package/dist/cjs/jsonRpc/client.js +0 -8
  160. package/dist/cjs/jsonRpc/client.js.map +2 -2
  161. package/dist/cjs/keypairs/passkey/publickey.d.ts +1 -1
  162. package/dist/cjs/multisig/publickey.d.ts +10 -10
  163. package/dist/cjs/multisig/publickey.js +2 -2
  164. package/dist/cjs/multisig/publickey.js.map +2 -2
  165. package/dist/cjs/transactions/Transaction.d.ts +2 -2
  166. package/dist/cjs/transactions/Transaction.js.map +2 -2
  167. package/dist/cjs/transactions/TransactionData.d.ts +1 -0
  168. package/dist/cjs/transactions/TransactionData.js +71 -0
  169. package/dist/cjs/transactions/TransactionData.js.map +3 -3
  170. package/dist/cjs/transactions/serializer.js +1 -1
  171. package/dist/cjs/transactions/serializer.js.map +2 -2
  172. package/dist/cjs/utils/index.d.ts +1 -0
  173. package/dist/cjs/utils/index.js +2 -0
  174. package/dist/cjs/utils/index.js.map +2 -2
  175. package/dist/cjs/version.d.ts +2 -2
  176. package/dist/cjs/version.js +2 -2
  177. package/dist/cjs/version.js.map +1 -1
  178. package/dist/cjs/zklogin/bcs.d.ts +1 -3
  179. package/dist/cjs/zklogin/bcs.js +1 -1
  180. package/dist/cjs/zklogin/bcs.js.map +2 -2
  181. package/dist/cjs/zklogin/publickey.d.ts +1 -1
  182. package/dist/cjs/zklogin/signature.d.ts +1 -1
  183. package/dist/esm/bcs/bcs.d.ts +47 -111
  184. package/dist/esm/bcs/bcs.js +17 -17
  185. package/dist/esm/bcs/bcs.js.map +2 -2
  186. package/dist/esm/bcs/effects.d.ts +2 -6
  187. package/dist/esm/bcs/effects.js +1 -1
  188. package/dist/esm/bcs/effects.js.map +2 -2
  189. package/dist/esm/bcs/index.d.ts +49 -117
  190. package/dist/esm/bcs/type-tag-serializer.d.ts +1 -0
  191. package/dist/esm/bcs/type-tag-serializer.js +5 -1
  192. package/dist/esm/bcs/type-tag-serializer.js.map +2 -2
  193. package/dist/esm/cryptography/intent.js +1 -1
  194. package/dist/esm/cryptography/intent.js.map +2 -2
  195. package/dist/esm/cryptography/keypair.js +1 -1
  196. package/dist/esm/cryptography/keypair.js.map +2 -2
  197. package/dist/esm/cryptography/publickey.js +1 -1
  198. package/dist/esm/cryptography/publickey.js.map +2 -2
  199. package/dist/esm/cryptography/signature.d.ts +2 -2
  200. package/dist/esm/experimental/client.js +0 -4
  201. package/dist/esm/experimental/client.js.map +2 -2
  202. package/dist/esm/experimental/types.d.ts +1 -7
  203. package/dist/esm/graphql/generated/queries.d.ts +1 -1
  204. package/dist/esm/graphql/generated/queries.js.map +1 -1
  205. package/dist/esm/grpc/core.d.ts +3 -1
  206. package/dist/esm/grpc/core.js +5 -3
  207. package/dist/esm/grpc/core.js.map +2 -2
  208. package/dist/esm/grpc/proto/google/protobuf/any.d.ts +6 -6
  209. package/dist/esm/grpc/proto/google/protobuf/any.js +20 -20
  210. package/dist/esm/grpc/proto/google/protobuf/any.js.map +2 -2
  211. package/dist/esm/grpc/proto/google/protobuf/duration.d.ts +4 -4
  212. package/dist/esm/grpc/proto/google/protobuf/duration.js +8 -12
  213. package/dist/esm/grpc/proto/google/protobuf/duration.js.map +2 -2
  214. package/dist/esm/grpc/proto/google/protobuf/empty.d.ts +1 -1
  215. package/dist/esm/grpc/proto/google/protobuf/empty.js.map +2 -2
  216. package/dist/esm/grpc/proto/google/protobuf/field_mask.d.ts +4 -4
  217. package/dist/esm/grpc/proto/google/protobuf/field_mask.js +8 -7
  218. package/dist/esm/grpc/proto/google/protobuf/field_mask.js.map +2 -2
  219. package/dist/esm/grpc/proto/google/protobuf/struct.d.ts +10 -10
  220. package/dist/esm/grpc/proto/google/protobuf/struct.js +29 -17
  221. package/dist/esm/grpc/proto/google/protobuf/struct.js.map +2 -2
  222. package/dist/esm/grpc/proto/google/protobuf/timestamp.d.ts +4 -4
  223. package/dist/esm/grpc/proto/google/protobuf/timestamp.js +21 -18
  224. package/dist/esm/grpc/proto/google/protobuf/timestamp.js.map +2 -2
  225. package/dist/esm/grpc/proto/google/rpc/error_details.d.ts +2 -2
  226. package/dist/esm/grpc/proto/google/rpc/error_details.js +40 -11
  227. package/dist/esm/grpc/proto/google/rpc/error_details.js.map +2 -2
  228. package/dist/esm/grpc/proto/google/rpc/status.d.ts +2 -2
  229. package/dist/esm/grpc/proto/google/rpc/status.js +1 -1
  230. package/dist/esm/grpc/proto/google/rpc/status.js.map +2 -2
  231. package/dist/esm/grpc/proto/sui/rpc/v2/argument.d.ts +1 -1
  232. package/dist/esm/grpc/proto/sui/rpc/v2/argument.js +7 -1
  233. package/dist/esm/grpc/proto/sui/rpc/v2/argument.js.map +2 -2
  234. package/dist/esm/grpc/proto/sui/rpc/v2/balance_change.d.ts +1 -1
  235. package/dist/esm/grpc/proto/sui/rpc/v2/balance_change.js.map +2 -2
  236. package/dist/esm/grpc/proto/sui/rpc/v2/bcs.d.ts +1 -1
  237. package/dist/esm/grpc/proto/sui/rpc/v2/bcs.js.map +2 -2
  238. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint.d.ts +6 -6
  239. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint.js +12 -7
  240. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint.js.map +2 -2
  241. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_contents.d.ts +3 -3
  242. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_contents.js +16 -4
  243. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_contents.js.map +2 -2
  244. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_summary.d.ts +5 -5
  245. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_summary.js +35 -13
  246. package/dist/esm/grpc/proto/sui/rpc/v2/checkpoint_summary.js.map +2 -2
  247. package/dist/esm/grpc/proto/sui/rpc/v2/effects.d.ts +6 -6
  248. package/dist/esm/grpc/proto/sui/rpc/v2/effects.js +65 -19
  249. package/dist/esm/grpc/proto/sui/rpc/v2/effects.js.map +2 -2
  250. package/dist/esm/grpc/proto/sui/rpc/v2/epoch.d.ts +5 -5
  251. package/dist/esm/grpc/proto/sui/rpc/v2/epoch.js +4 -8
  252. package/dist/esm/grpc/proto/sui/rpc/v2/epoch.js.map +2 -2
  253. package/dist/esm/grpc/proto/sui/rpc/v2/error_reason.js.map +2 -2
  254. package/dist/esm/grpc/proto/sui/rpc/v2/event.d.ts +3 -3
  255. package/dist/esm/grpc/proto/sui/rpc/v2/event.js +2 -2
  256. package/dist/esm/grpc/proto/sui/rpc/v2/event.js.map +2 -2
  257. package/dist/esm/grpc/proto/sui/rpc/v2/executed_transaction.d.ts +8 -8
  258. package/dist/esm/grpc/proto/sui/rpc/v2/executed_transaction.js +21 -10
  259. package/dist/esm/grpc/proto/sui/rpc/v2/executed_transaction.js.map +2 -2
  260. package/dist/esm/grpc/proto/sui/rpc/v2/execution_status.d.ts +12 -12
  261. package/dist/esm/grpc/proto/sui/rpc/v2/execution_status.js +75 -17
  262. package/dist/esm/grpc/proto/sui/rpc/v2/execution_status.js.map +2 -2
  263. package/dist/esm/grpc/proto/sui/rpc/v2/gas_cost_summary.d.ts +1 -1
  264. package/dist/esm/grpc/proto/sui/rpc/v2/gas_cost_summary.js +0 -4
  265. package/dist/esm/grpc/proto/sui/rpc/v2/gas_cost_summary.js.map +2 -2
  266. package/dist/esm/grpc/proto/sui/rpc/v2/input.d.ts +2 -2
  267. package/dist/esm/grpc/proto/sui/rpc/v2/input.js +8 -3
  268. package/dist/esm/grpc/proto/sui/rpc/v2/input.js.map +2 -2
  269. package/dist/esm/grpc/proto/sui/rpc/v2/jwk.d.ts +1 -1
  270. package/dist/esm/grpc/proto/sui/rpc/v2/jwk.js.map +2 -2
  271. package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts +18 -18
  272. package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.client.js +50 -8
  273. package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.client.js.map +2 -2
  274. package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.d.ts +15 -15
  275. package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.js +41 -20
  276. package/dist/esm/grpc/proto/sui/rpc/v2/ledger_service.js.map +2 -2
  277. package/dist/esm/grpc/proto/sui/rpc/v2/move_package.d.ts +1 -1
  278. package/dist/esm/grpc/proto/sui/rpc/v2/move_package.js +126 -20
  279. package/dist/esm/grpc/proto/sui/rpc/v2/move_package.js.map +2 -2
  280. package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.client.d.ts +12 -12
  281. package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.client.js +29 -5
  282. package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.client.js.map +2 -2
  283. package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.d.ts +5 -5
  284. package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.js +16 -6
  285. package/dist/esm/grpc/proto/sui/rpc/v2/move_package_service.js.map +2 -2
  286. package/dist/esm/grpc/proto/sui/rpc/v2/name_service.client.d.ts +8 -8
  287. package/dist/esm/grpc/proto/sui/rpc/v2/name_service.client.js +15 -3
  288. package/dist/esm/grpc/proto/sui/rpc/v2/name_service.client.js.map +2 -2
  289. package/dist/esm/grpc/proto/sui/rpc/v2/name_service.d.ts +3 -3
  290. package/dist/esm/grpc/proto/sui/rpc/v2/name_service.js +18 -7
  291. package/dist/esm/grpc/proto/sui/rpc/v2/name_service.js.map +2 -2
  292. package/dist/esm/grpc/proto/sui/rpc/v2/object.d.ts +5 -5
  293. package/dist/esm/grpc/proto/sui/rpc/v2/object.js +4 -8
  294. package/dist/esm/grpc/proto/sui/rpc/v2/object.js.map +2 -2
  295. package/dist/esm/grpc/proto/sui/rpc/v2/object_reference.d.ts +1 -1
  296. package/dist/esm/grpc/proto/sui/rpc/v2/object_reference.js +0 -1
  297. package/dist/esm/grpc/proto/sui/rpc/v2/object_reference.js.map +2 -2
  298. package/dist/esm/grpc/proto/sui/rpc/v2/owner.d.ts +1 -1
  299. package/dist/esm/grpc/proto/sui/rpc/v2/owner.js +7 -2
  300. package/dist/esm/grpc/proto/sui/rpc/v2/owner.js.map +2 -2
  301. package/dist/esm/grpc/proto/sui/rpc/v2/protocol_config.d.ts +1 -1
  302. package/dist/esm/grpc/proto/sui/rpc/v2/protocol_config.js +22 -11
  303. package/dist/esm/grpc/proto/sui/rpc/v2/protocol_config.js.map +2 -2
  304. package/dist/esm/grpc/proto/sui/rpc/v2/signature.d.ts +8 -8
  305. package/dist/esm/grpc/proto/sui/rpc/v2/signature.js +73 -17
  306. package/dist/esm/grpc/proto/sui/rpc/v2/signature.js.map +2 -2
  307. package/dist/esm/grpc/proto/sui/rpc/v2/signature_scheme.js.map +2 -2
  308. package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.ts +6 -6
  309. package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.client.js +8 -2
  310. package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.client.js.map +2 -2
  311. package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.d.ts +5 -5
  312. package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.js +7 -6
  313. package/dist/esm/grpc/proto/sui/rpc/v2/signature_verification_service.js.map +2 -2
  314. package/dist/esm/grpc/proto/sui/rpc/v2/state_service.client.d.ts +14 -14
  315. package/dist/esm/grpc/proto/sui/rpc/v2/state_service.client.js +36 -6
  316. package/dist/esm/grpc/proto/sui/rpc/v2/state_service.client.js.map +2 -2
  317. package/dist/esm/grpc/proto/sui/rpc/v2/state_service.d.ts +5 -5
  318. package/dist/esm/grpc/proto/sui/rpc/v2/state_service.js +60 -14
  319. package/dist/esm/grpc/proto/sui/rpc/v2/state_service.js.map +2 -2
  320. package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts +6 -6
  321. package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.client.js +8 -2
  322. package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.client.js.map +2 -2
  323. package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.d.ts +4 -4
  324. package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.js +9 -4
  325. package/dist/esm/grpc/proto/sui/rpc/v2/subscription_service.js.map +2 -2
  326. package/dist/esm/grpc/proto/sui/rpc/v2/system_state.d.ts +1 -1
  327. package/dist/esm/grpc/proto/sui/rpc/v2/system_state.js +26 -59
  328. package/dist/esm/grpc/proto/sui/rpc/v2/system_state.js.map +2 -2
  329. package/dist/esm/grpc/proto/sui/rpc/v2/transaction.d.ts +29 -29
  330. package/dist/esm/grpc/proto/sui/rpc/v2/transaction.js +210 -71
  331. package/dist/esm/grpc/proto/sui/rpc/v2/transaction.js.map +2 -2
  332. package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts +8 -8
  333. package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js +15 -3
  334. package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js.map +2 -2
  335. package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.d.ts +9 -9
  336. package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.js +62 -16
  337. package/dist/esm/grpc/proto/sui/rpc/v2/transaction_execution_service.js.map +2 -2
  338. package/dist/esm/jsonRpc/client.d.ts +2 -6
  339. package/dist/esm/jsonRpc/client.js +0 -8
  340. package/dist/esm/jsonRpc/client.js.map +2 -2
  341. package/dist/esm/keypairs/passkey/publickey.d.ts +1 -1
  342. package/dist/esm/multisig/publickey.d.ts +10 -10
  343. package/dist/esm/multisig/publickey.js +2 -2
  344. package/dist/esm/multisig/publickey.js.map +2 -2
  345. package/dist/esm/transactions/Transaction.d.ts +2 -2
  346. package/dist/esm/transactions/Transaction.js.map +2 -2
  347. package/dist/esm/transactions/TransactionData.d.ts +1 -0
  348. package/dist/esm/transactions/TransactionData.js +71 -0
  349. package/dist/esm/transactions/TransactionData.js.map +3 -3
  350. package/dist/esm/transactions/serializer.js +1 -1
  351. package/dist/esm/transactions/serializer.js.map +2 -2
  352. package/dist/esm/utils/index.d.ts +1 -0
  353. package/dist/esm/utils/index.js +2 -0
  354. package/dist/esm/utils/index.js.map +2 -2
  355. package/dist/esm/version.d.ts +2 -2
  356. package/dist/esm/version.js +2 -2
  357. package/dist/esm/version.js.map +1 -1
  358. package/dist/esm/zklogin/bcs.d.ts +1 -3
  359. package/dist/esm/zklogin/bcs.js +1 -1
  360. package/dist/esm/zklogin/bcs.js.map +2 -2
  361. package/dist/esm/zklogin/publickey.d.ts +1 -1
  362. package/dist/esm/zklogin/signature.d.ts +1 -1
  363. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  364. package/dist/tsconfig.tsbuildinfo +1 -1
  365. package/package.json +2 -2
  366. package/src/bcs/bcs.ts +17 -17
  367. package/src/bcs/effects.ts +1 -1
  368. package/src/bcs/type-tag-serializer.ts +4 -0
  369. package/src/cryptography/intent.ts +1 -1
  370. package/src/cryptography/keypair.ts +1 -1
  371. package/src/cryptography/publickey.ts +1 -1
  372. package/src/experimental/client.ts +0 -4
  373. package/src/experimental/types.ts +4 -17
  374. package/src/graphql/generated/queries.ts +1 -1
  375. package/src/grpc/core.ts +28 -8
  376. package/src/grpc/proto/google/protobuf/any.ts +159 -144
  377. package/src/grpc/proto/google/protobuf/duration.ts +77 -74
  378. package/src/grpc/proto/google/protobuf/empty.ts +5 -6
  379. package/src/grpc/proto/google/protobuf/field_mask.ts +59 -47
  380. package/src/grpc/proto/google/protobuf/struct.ts +223 -201
  381. package/src/grpc/proto/google/protobuf/timestamp.ts +121 -100
  382. package/src/grpc/proto/google/rpc/error_details.ts +388 -352
  383. package/src/grpc/proto/google/rpc/status.ts +32 -32
  384. package/src/grpc/proto/sui/rpc/v2/argument.ts +60 -54
  385. package/src/grpc/proto/sui/rpc/v2/balance_change.ts +26 -26
  386. package/src/grpc/proto/sui/rpc/v2/bcs.ts +19 -19
  387. package/src/grpc/proto/sui/rpc/v2/checkpoint.ts +79 -66
  388. package/src/grpc/proto/sui/rpc/v2/checkpoint_contents.ts +72 -60
  389. package/src/grpc/proto/sui/rpc/v2/checkpoint_summary.ts +219 -158
  390. package/src/grpc/proto/sui/rpc/v2/effects.ts +418 -318
  391. package/src/grpc/proto/sui/rpc/v2/epoch.ts +90 -62
  392. package/src/grpc/proto/sui/rpc/v2/error_reason.ts +12 -12
  393. package/src/grpc/proto/sui/rpc/v2/event.ts +76 -76
  394. package/src/grpc/proto/sui/rpc/v2/executed_transaction.ts +99 -80
  395. package/src/grpc/proto/sui/rpc/v2/execution_status.ts +888 -755
  396. package/src/grpc/proto/sui/rpc/v2/gas_cost_summary.ts +62 -34
  397. package/src/grpc/proto/sui/rpc/v2/input.ts +102 -89
  398. package/src/grpc/proto/sui/rpc/v2/jwk.ts +51 -51
  399. package/src/grpc/proto/sui/rpc/v2/ledger_service.client.ts +196 -106
  400. package/src/grpc/proto/sui/rpc/v2/ledger_service.ts +420 -328
  401. package/src/grpc/proto/sui/rpc/v2/move_package.ts +608 -486
  402. package/src/grpc/proto/sui/rpc/v2/move_package_service.client.ts +114 -63
  403. package/src/grpc/proto/sui/rpc/v2/move_package_service.ts +190 -172
  404. package/src/grpc/proto/sui/rpc/v2/name_service.client.ts +62 -37
  405. package/src/grpc/proto/sui/rpc/v2/name_service.ts +123 -112
  406. package/src/grpc/proto/sui/rpc/v2/object.ts +147 -120
  407. package/src/grpc/proto/sui/rpc/v2/object_reference.ts +33 -26
  408. package/src/grpc/proto/sui/rpc/v2/owner.ts +61 -48
  409. package/src/grpc/proto/sui/rpc/v2/protocol_config.ts +43 -24
  410. package/src/grpc/proto/sui/rpc/v2/signature.ts +596 -503
  411. package/src/grpc/proto/sui/rpc/v2/signature_scheme.ts +28 -28
  412. package/src/grpc/proto/sui/rpc/v2/signature_verification_service.client.ts +43 -29
  413. package/src/grpc/proto/sui/rpc/v2/signature_verification_service.ts +68 -67
  414. package/src/grpc/proto/sui/rpc/v2/state_service.client.ts +140 -76
  415. package/src/grpc/proto/sui/rpc/v2/state_service.ts +642 -573
  416. package/src/grpc/proto/sui/rpc/v2/subscription_service.client.ts +60 -48
  417. package/src/grpc/proto/sui/rpc/v2/subscription_service.ts +50 -37
  418. package/src/grpc/proto/sui/rpc/v2/system_state.ts +1055 -689
  419. package/src/grpc/proto/sui/rpc/v2/transaction.ts +1535 -1110
  420. package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.client.ts +65 -38
  421. package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts +185 -139
  422. package/src/jsonRpc/client.ts +2 -17
  423. package/src/multisig/publickey.ts +14 -14
  424. package/src/transactions/Transaction.ts +2 -2
  425. package/src/transactions/TransactionData.ts +100 -1
  426. package/src/transactions/serializer.ts +1 -1
  427. package/src/utils/index.ts +1 -0
  428. package/src/version.ts +2 -2
  429. package/src/zklogin/bcs.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// @generated by protobuf-ts 2.9.6 with parameter force_server_none,optimize_code_size,ts_nocheck\n// @generated from protobuf file \"sui/rpc/v2/transaction_execution_service.proto\" (package \"sui.rpc.v2\", syntax proto3)\n// tslint:disable\n// @ts-nocheck\n//\n// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n//\nimport { ServiceType } from \"@protobuf-ts/runtime-rpc\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\nimport { Value } from \"../../../google/protobuf/struct\";\nimport { Bcs } from \"./bcs\";\nimport { Argument } from \"./argument\";\nimport { ExecutedTransaction } from \"./executed_transaction\";\nimport { FieldMask } from \"../../../google/protobuf/field_mask\";\nimport { UserSignature } from \"./signature\";\nimport { Transaction } from \"./transaction\";\n/**\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport interface ExecuteTransactionRequest {\n /**\n * The transaction to execute.\n *\n * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n */\n transaction?: Transaction;\n /**\n * Set of `UserSignature`s authorizing the execution of the provided\n * transaction.\n *\n * @generated from protobuf field: repeated sui.rpc.v2.UserSignature signatures = 2;\n */\n signatures: UserSignature[];\n /**\n * Mask specifying which fields to read.\n * If no mask is specified, defaults to `effects.status,checkpoint`.\n *\n * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 3;\n */\n readMask?: FieldMask;\n}\n/**\n * Response message for `NodeService.ExecuteTransaction`.\n *\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport interface ExecuteTransactionResponse {\n /**\n * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n */\n transaction?: ExecutedTransaction;\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport interface SimulateTransactionRequest {\n /**\n * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n */\n transaction?: Transaction;\n /**\n * Mask specifying which fields to read.\n *\n * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;\n */\n readMask?: FieldMask;\n /**\n * Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction\n *\n * @generated from protobuf field: optional sui.rpc.v2.SimulateTransactionRequest.TransactionChecks checks = 3;\n */\n checks?: SimulateTransactionRequest_TransactionChecks;\n /**\n * Perform gas selection based on a budget estimation and include the\n * selected gas payment and budget in the response.\n *\n * This option will be ignored if `checks` is `DISABLED`.\n *\n * @generated from protobuf field: optional bool do_gas_selection = 4;\n */\n doGasSelection?: boolean;\n}\n/**\n * buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n *\n * @generated from protobuf enum sui.rpc.v2.SimulateTransactionRequest.TransactionChecks\n */\nexport enum SimulateTransactionRequest_TransactionChecks {\n /**\n * @generated from protobuf enum value: ENABLED = 0;\n */\n ENABLED = 0,\n /**\n * @generated from protobuf enum value: DISABLED = 1;\n */\n DISABLED = 1\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport interface SimulateTransactionResponse {\n /**\n * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n */\n transaction?: ExecutedTransaction;\n /**\n * @generated from protobuf field: repeated sui.rpc.v2.CommandResult command_outputs = 2;\n */\n commandOutputs: CommandResult[];\n}\n/**\n * An intermediate result/output from the execution of a single command\n *\n * @generated from protobuf message sui.rpc.v2.CommandResult\n */\nexport interface CommandResult {\n /**\n * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput return_values = 1;\n */\n returnValues: CommandOutput[];\n /**\n * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput mutated_by_ref = 2;\n */\n mutatedByRef: CommandOutput[];\n}\n/**\n * @generated from protobuf message sui.rpc.v2.CommandOutput\n */\nexport interface CommandOutput {\n /**\n * @generated from protobuf field: optional sui.rpc.v2.Argument argument = 1;\n */\n argument?: Argument;\n /**\n * @generated from protobuf field: optional sui.rpc.v2.Bcs value = 2;\n */\n value?: Bcs;\n /**\n * JSON rendering of the output.\n *\n * @generated from protobuf field: optional google.protobuf.Value json = 3;\n */\n json?: Value;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionRequest$Type extends MessageType<ExecuteTransactionRequest> {\n constructor() {\n super(\"sui.rpc.v2.ExecuteTransactionRequest\", [\n { no: 1, name: \"transaction\", kind: \"message\", T: () => Transaction },\n { no: 2, name: \"signatures\", kind: \"message\", repeat: 1 /*RepeatType.PACKED*/, T: () => UserSignature },\n { no: 3, name: \"read_mask\", kind: \"message\", T: () => FieldMask }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport const ExecuteTransactionRequest = new ExecuteTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionResponse$Type extends MessageType<ExecuteTransactionResponse> {\n constructor() {\n super(\"sui.rpc.v2.ExecuteTransactionResponse\", [\n { no: 1, name: \"transaction\", kind: \"message\", T: () => ExecutedTransaction }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport const ExecuteTransactionResponse = new ExecuteTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionRequest$Type extends MessageType<SimulateTransactionRequest> {\n constructor() {\n super(\"sui.rpc.v2.SimulateTransactionRequest\", [\n { no: 1, name: \"transaction\", kind: \"message\", T: () => Transaction },\n { no: 2, name: \"read_mask\", kind: \"message\", T: () => FieldMask },\n { no: 3, name: \"checks\", kind: \"enum\", opt: true, T: () => [\"sui.rpc.v2.SimulateTransactionRequest.TransactionChecks\", SimulateTransactionRequest_TransactionChecks] },\n { no: 4, name: \"do_gas_selection\", kind: \"scalar\", opt: true, T: 8 /*ScalarType.BOOL*/ }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport const SimulateTransactionRequest = new SimulateTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionResponse$Type extends MessageType<SimulateTransactionResponse> {\n constructor() {\n super(\"sui.rpc.v2.SimulateTransactionResponse\", [\n { no: 1, name: \"transaction\", kind: \"message\", T: () => ExecutedTransaction },\n { no: 2, name: \"command_outputs\", kind: \"message\", repeat: 1 /*RepeatType.PACKED*/, T: () => CommandResult }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport const SimulateTransactionResponse = new SimulateTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandResult$Type extends MessageType<CommandResult> {\n constructor() {\n super(\"sui.rpc.v2.CommandResult\", [\n { no: 1, name: \"return_values\", kind: \"message\", repeat: 1 /*RepeatType.PACKED*/, T: () => CommandOutput },\n { no: 2, name: \"mutated_by_ref\", kind: \"message\", repeat: 1 /*RepeatType.PACKED*/, T: () => CommandOutput }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandResult\n */\nexport const CommandResult = new CommandResult$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandOutput$Type extends MessageType<CommandOutput> {\n constructor() {\n super(\"sui.rpc.v2.CommandOutput\", [\n { no: 1, name: \"argument\", kind: \"message\", T: () => Argument },\n { no: 2, name: \"value\", kind: \"message\", T: () => Bcs },\n { no: 3, name: \"json\", kind: \"message\", T: () => Value }\n ]);\n }\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandOutput\n */\nexport const CommandOutput = new CommandOutput$Type();\n/**\n * @generated ServiceType for protobuf service sui.rpc.v2.TransactionExecutionService\n */\nexport const TransactionExecutionService = new ServiceType(\"sui.rpc.v2.TransactionExecutionService\", [\n { name: \"ExecuteTransaction\", options: {}, I: ExecuteTransactionRequest, O: ExecuteTransactionResponse },\n { name: \"SimulateTransaction\", options: {}, I: SimulateTransactionRequest, O: SimulateTransactionResponse }\n]);\n"],
5
- "mappings": "AAWA,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAwErB,IAAK,+CAAL,kBAAKA,kDAAL;AAIH,EAAAA,4FAAA,aAAU,KAAV;AAIA,EAAAA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GAAG,MAAM,eAAe,MAAM,WAAW,GAAG,MAAM,oBAAoB;AAAA,MAC5E,EAAE,IAAI,GAAG,MAAM,mBAAmB,MAAM,WAAW,QAAQ,GAAyB,GAAG,MAAM,cAAc;AAAA,IAC/G,CAAC;AAAA,EACL;AACJ;AAIO,MAAM,8BAA8B,IAAI,iCAAiC;AAEhF,MAAM,2BAA2B,YAA2B;AAAA,EACxD,cAAc;AACV,UAAM,4BAA4B;AAAA,MAC9B,EAAE,IAAI,GAAG,MAAM,iBAAiB,MAAM,WAAW,QAAQ,GAAyB,GAAG,MAAM,cAAc;AAAA,MACzG,EAAE,IAAI,GAAG,MAAM,kBAAkB,MAAM,WAAW,QAAQ,GAAyB,GAAG,MAAM,cAAc;AAAA,IAC9G,CAAC;AAAA,EACL;AACJ;AAIO,MAAM,gBAAgB,IAAI,mBAAmB;AAEpD,MAAM,2BAA2B,YAA2B;AAAA,EACxD,cAAc;AACV,UAAM,4BAA4B;AAAA,MAC9B,EAAE,IAAI,GAAG,MAAM,YAAY,MAAM,WAAW,GAAG,MAAM,SAAS;AAAA,MAC9D,EAAE,IAAI,GAAG,MAAM,SAAS,MAAM,WAAW,GAAG,MAAM,IAAI;AAAA,MACtD,EAAE,IAAI,GAAG,MAAM,QAAQ,MAAM,WAAW,GAAG,MAAM,MAAM;AAAA,IAC3D,CAAC;AAAA,EACL;AACJ;AAIO,MAAM,gBAAgB,IAAI,mBAAmB;AAI7C,MAAM,8BAA8B,IAAI,YAAY,0CAA0C;AAAA,EACjG,EAAE,MAAM,sBAAsB,SAAS,CAAC,GAAG,GAAG,2BAA2B,GAAG,2BAA2B;AAAA,EACvG,EAAE,MAAM,uBAAuB,SAAS,CAAC,GAAG,GAAG,4BAA4B,GAAG,4BAA4B;AAC9G,CAAC;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// @generated by protobuf-ts 2.9.6 with parameter force_server_none,optimize_code_size,ts_nocheck\n// @generated from protobuf file \"sui/rpc/v2/transaction_execution_service.proto\" (package \"sui.rpc.v2\", syntax proto3)\n// tslint:disable\n// @ts-nocheck\n//\n// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n//\nimport { ServiceType } from '@protobuf-ts/runtime-rpc';\nimport { MessageType } from '@protobuf-ts/runtime';\nimport { Value } from '../../../google/protobuf/struct.js';\nimport { Bcs } from './bcs.js';\nimport { Argument } from './argument.js';\nimport { ExecutedTransaction } from './executed_transaction.js';\nimport { FieldMask } from '../../../google/protobuf/field_mask.js';\nimport { UserSignature } from './signature.js';\nimport { Transaction } from './transaction.js';\n/**\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport interface ExecuteTransactionRequest {\n\t/**\n\t * The transaction to execute.\n\t *\n\t * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n\t */\n\ttransaction?: Transaction;\n\t/**\n\t * Set of `UserSignature`s authorizing the execution of the provided\n\t * transaction.\n\t *\n\t * @generated from protobuf field: repeated sui.rpc.v2.UserSignature signatures = 2;\n\t */\n\tsignatures: UserSignature[];\n\t/**\n\t * Mask specifying which fields to read.\n\t * If no mask is specified, defaults to `effects.status,checkpoint`.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 3;\n\t */\n\treadMask?: FieldMask;\n}\n/**\n * Response message for `NodeService.ExecuteTransaction`.\n *\n * @generated from protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport interface ExecuteTransactionResponse {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n\t */\n\ttransaction?: ExecutedTransaction;\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport interface SimulateTransactionRequest {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Transaction transaction = 1;\n\t */\n\ttransaction?: Transaction;\n\t/**\n\t * Mask specifying which fields to read.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 2;\n\t */\n\treadMask?: FieldMask;\n\t/**\n\t * Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction\n\t *\n\t * @generated from protobuf field: optional sui.rpc.v2.SimulateTransactionRequest.TransactionChecks checks = 3;\n\t */\n\tchecks?: SimulateTransactionRequest_TransactionChecks;\n\t/**\n\t * Perform gas selection based on a budget estimation and include the\n\t * selected gas payment and budget in the response.\n\t *\n\t * This option will be ignored if `checks` is `DISABLED`.\n\t *\n\t * @generated from protobuf field: optional bool do_gas_selection = 4;\n\t */\n\tdoGasSelection?: boolean;\n}\n/**\n * buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n *\n * @generated from protobuf enum sui.rpc.v2.SimulateTransactionRequest.TransactionChecks\n */\nexport enum SimulateTransactionRequest_TransactionChecks {\n\t/**\n\t * @generated from protobuf enum value: ENABLED = 0;\n\t */\n\tENABLED = 0,\n\t/**\n\t * @generated from protobuf enum value: DISABLED = 1;\n\t */\n\tDISABLED = 1,\n}\n/**\n * @generated from protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport interface SimulateTransactionResponse {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;\n\t */\n\ttransaction?: ExecutedTransaction;\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandResult command_outputs = 2;\n\t */\n\tcommandOutputs: CommandResult[];\n}\n/**\n * An intermediate result/output from the execution of a single command\n *\n * @generated from protobuf message sui.rpc.v2.CommandResult\n */\nexport interface CommandResult {\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput return_values = 1;\n\t */\n\treturnValues: CommandOutput[];\n\t/**\n\t * @generated from protobuf field: repeated sui.rpc.v2.CommandOutput mutated_by_ref = 2;\n\t */\n\tmutatedByRef: CommandOutput[];\n}\n/**\n * @generated from protobuf message sui.rpc.v2.CommandOutput\n */\nexport interface CommandOutput {\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Argument argument = 1;\n\t */\n\targument?: Argument;\n\t/**\n\t * @generated from protobuf field: optional sui.rpc.v2.Bcs value = 2;\n\t */\n\tvalue?: Bcs;\n\t/**\n\t * JSON rendering of the output.\n\t *\n\t * @generated from protobuf field: optional google.protobuf.Value json = 3;\n\t */\n\tjson?: Value;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionRequest$Type extends MessageType<ExecuteTransactionRequest> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.ExecuteTransactionRequest', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => Transaction },\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'signatures',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => UserSignature,\n\t\t\t},\n\t\t\t{ no: 3, name: 'read_mask', kind: 'message', T: () => FieldMask },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionRequest\n */\nexport const ExecuteTransactionRequest = new ExecuteTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass ExecuteTransactionResponse$Type extends MessageType<ExecuteTransactionResponse> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.ExecuteTransactionResponse', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.ExecuteTransactionResponse\n */\nexport const ExecuteTransactionResponse = new ExecuteTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionRequest$Type extends MessageType<SimulateTransactionRequest> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.SimulateTransactionRequest', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => Transaction },\n\t\t\t{ no: 2, name: 'read_mask', kind: 'message', T: () => FieldMask },\n\t\t\t{\n\t\t\t\tno: 3,\n\t\t\t\tname: 'checks',\n\t\t\t\tkind: 'enum',\n\t\t\t\topt: true,\n\t\t\t\tT: () => [\n\t\t\t\t\t'sui.rpc.v2.SimulateTransactionRequest.TransactionChecks',\n\t\t\t\t\tSimulateTransactionRequest_TransactionChecks,\n\t\t\t\t],\n\t\t\t},\n\t\t\t{ no: 4, name: 'do_gas_selection', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionRequest\n */\nexport const SimulateTransactionRequest = new SimulateTransactionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass SimulateTransactionResponse$Type extends MessageType<SimulateTransactionResponse> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.SimulateTransactionResponse', [\n\t\t\t{ no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'command_outputs',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => CommandResult,\n\t\t\t},\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.SimulateTransactionResponse\n */\nexport const SimulateTransactionResponse = new SimulateTransactionResponse$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandResult$Type extends MessageType<CommandResult> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.CommandResult', [\n\t\t\t{\n\t\t\t\tno: 1,\n\t\t\t\tname: 'return_values',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => CommandOutput,\n\t\t\t},\n\t\t\t{\n\t\t\t\tno: 2,\n\t\t\t\tname: 'mutated_by_ref',\n\t\t\t\tkind: 'message',\n\t\t\t\trepeat: 1 /*RepeatType.PACKED*/,\n\t\t\t\tT: () => CommandOutput,\n\t\t\t},\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandResult\n */\nexport const CommandResult = new CommandResult$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass CommandOutput$Type extends MessageType<CommandOutput> {\n\tconstructor() {\n\t\tsuper('sui.rpc.v2.CommandOutput', [\n\t\t\t{ no: 1, name: 'argument', kind: 'message', T: () => Argument },\n\t\t\t{ no: 2, name: 'value', kind: 'message', T: () => Bcs },\n\t\t\t{ no: 3, name: 'json', kind: 'message', T: () => Value },\n\t\t]);\n\t}\n}\n/**\n * @generated MessageType for protobuf message sui.rpc.v2.CommandOutput\n */\nexport const CommandOutput = new CommandOutput$Type();\n/**\n * @generated ServiceType for protobuf service sui.rpc.v2.TransactionExecutionService\n */\nexport const TransactionExecutionService = new ServiceType(\n\t'sui.rpc.v2.TransactionExecutionService',\n\t[\n\t\t{\n\t\t\tname: 'ExecuteTransaction',\n\t\t\toptions: {},\n\t\t\tI: ExecuteTransactionRequest,\n\t\t\tO: ExecuteTransactionResponse,\n\t\t},\n\t\t{\n\t\t\tname: 'SimulateTransaction',\n\t\t\toptions: {},\n\t\t\tI: SimulateTransactionRequest,\n\t\t\tO: SimulateTransactionResponse,\n\t\t},\n\t],\n);\n"],
5
+ "mappings": "AAWA,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAwErB,IAAK,+CAAL,kBAAKA,kDAAL;AAIN,EAAAA,4FAAA,aAAU,KAAV;AAIA,EAAAA,4FAAA,cAAW,KAAX;AARW,SAAAA;AAAA,GAAA;AA0DZ,MAAM,uCAAuC,YAAuC;AAAA,EACnF,cAAc;AACb,UAAM,wCAAwC;AAAA,MAC7C,EAAE,IAAI,GAAG,MAAM,eAAe,MAAM,WAAW,GAAG,MAAM,Y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,QACN,QAAQ;AAAA,QACR,GAAG,MAAM;AAAA,MACV;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAIO,MAAM,8BAA8B,IAAI,iCAAiC;AAEhF,MAAM,2BAA2B,YAA2B;AAAA,EAC3D,cAAc;AACb,UAAM,4BAA4B;AAAA,MACjC;AAAA,QACC,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,GAAG,MAAM;AAAA,MACV;AAAA,MACA;AAAA,QACC,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,GAAG,MAAM;AAAA,MACV;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAIO,MAAM,gBAAgB,IAAI,mBAAmB;AAEpD,MAAM,2BAA2B,YAA2B;AAAA,EAC3D,cAAc;AACb,UAAM,4BAA4B;AAAA,MACjC,EAAE,IAAI,GAAG,MAAM,YAAY,MAAM,WAAW,GAAG,MAAM,SAAS;AAAA,MAC9D,EAAE,IAAI,GAAG,MAAM,SAAS,MAAM,WAAW,GAAG,MAAM,IAAI;AAAA,MACtD,EAAE,IAAI,GAAG,MAAM,QAAQ,MAAM,WAAW,GAAG,MAAM,MAAM;AAAA,IACxD,CAAC;AAAA,EACF;AACD;AAIO,MAAM,gBAAgB,IAAI,mBAAmB;AAI7C,MAAM,8BAA8B,IAAI;AAAA,EAC9C;AAAA,EACA;AAAA,IACC;AAAA,MACC,MAAM;AAAA,MACN,SAAS,CAAC;AAAA,MACV,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,SAAS,CAAC;AAAA,MACV,GAAG;AAAA,MACH,GAAG;AAAA,IACJ;AAAA,EACD;AACD;",
6
6
  "names": ["SimulateTransactionRequest_TransactionChecks"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type { Signer } from '../cryptography/index.js';
2
2
  import { Experimental_BaseClient } from '../experimental/client.js';
3
- import type { Experimental_SuiClientTypes, SelfRegisteringClientExtension } from '../experimental/types.js';
3
+ import type { Experimental_SuiClientTypes } from '../experimental/types.js';
4
4
  import type { Transaction } from '../transactions/Transaction.js';
5
5
  import type { JsonRpcTransport } from './http-transport.js';
6
6
  import type { AddressMetrics, AllEpochsAddressMetrics, Checkpoint, CheckpointPage, CoinBalance, CoinMetadata, CoinSupply, CommitteeInfo, DelegatedStake, DevInspectResults, DevInspectTransactionBlockParams, DryRunTransactionBlockParams, DryRunTransactionBlockResponse, DynamicFieldPage, EpochInfo, EpochMetricsPage, EpochPage, ExecuteTransactionBlockParams, GetAllBalancesParams, GetAllCoinsParams, GetBalanceParams, GetCheckpointParams, GetCheckpointsParams, GetCoinMetadataParams, GetCoinsParams, GetCommitteeInfoParams, GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetLatestCheckpointSequenceNumberParams, GetLatestSuiSystemStateParams, GetMoveFunctionArgTypesParams, GetNormalizedMoveFunctionParams, GetNormalizedMoveModuleParams, GetNormalizedMoveModulesByPackageParams, GetNormalizedMoveStructParams, GetObjectParams, GetOwnedObjectsParams, GetProtocolConfigParams, GetReferenceGasPriceParams, GetStakesByIdsParams, GetStakesParams, GetTotalSupplyParams, GetTransactionBlockParams, MoveCallMetrics, MultiGetObjectsParams, MultiGetTransactionBlocksParams, NetworkMetrics, ObjectRead, Order, PaginatedCoins, PaginatedEvents, PaginatedObjectsResponse, PaginatedTransactionResponse, ProtocolConfig, QueryEventsParams, QueryTransactionBlocksParams, ResolvedNameServiceNames, ResolveNameServiceAddressParams, ResolveNameServiceNamesParams, SubscribeEventParams, SubscribeTransactionParams, SuiEvent, SuiMoveFunctionArgType, SuiMoveNormalizedFunction, SuiMoveNormalizedModule, SuiMoveNormalizedModules, SuiMoveNormalizedStruct, SuiObjectResponse, SuiSystemStateSummary, SuiTransactionBlockResponse, TransactionEffects, TryGetPastObjectParams, Unsubscribe, ValidatorsApy, VerifyZkLoginSignatureParams, ZkLoginVerifyResult } from './types/index.js';
@@ -31,7 +31,7 @@ type NetworkOrTransport = {
31
31
  };
32
32
  declare const SUI_CLIENT_BRAND: never;
33
33
  export declare function isSuiJsonRpcClient(client: unknown): client is SuiJsonRpcClient;
34
- export declare class SuiJsonRpcClient extends Experimental_BaseClient implements SelfRegisteringClientExtension {
34
+ export declare class SuiJsonRpcClient extends Experimental_BaseClient {
35
35
  [SUI_CLIENT_BRAND]: boolean;
36
36
  core: JSONRpcCoreClient;
37
37
  jsonRpc: this;
@@ -260,9 +260,5 @@ export declare class SuiJsonRpcClient extends Experimental_BaseClient implements
260
260
  /** The amount of time to wait between checks for the transaction block. Defaults to 2 seconds. */
261
261
  pollInterval?: number;
262
262
  } & Parameters<SuiJsonRpcClient['getTransactionBlock']>[0]): Promise<SuiTransactionBlockResponse>;
263
- experimental_asClientExtension(this: SuiJsonRpcClient): {
264
- readonly name: "jsonRPC";
265
- readonly register: () => SuiJsonRpcClient;
266
- };
267
263
  }
268
264
  export {};
@@ -810,14 +810,6 @@ class SuiJsonRpcClient extends Experimental_BaseClient {
810
810
  timeoutSignal.throwIfAborted();
811
811
  throw new Error("Unexpected error while waiting for transaction block.");
812
812
  }
813
- experimental_asClientExtension() {
814
- return {
815
- name: "jsonRPC",
816
- register: () => {
817
- return this;
818
- }
819
- };
820
- }
821
813
  }
822
814
  export {
823
815
  SuiJsonRpcClient,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/jsonRpc/client.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { fromBase58, toBase64, toHex } from '@mysten/bcs';\n\nimport type { Signer } from '../cryptography/index.js';\nimport { Experimental_BaseClient } from '../experimental/client.js';\nimport type {\n\tExperimental_SuiClientTypes,\n\tSelfRegisteringClientExtension,\n} from '../experimental/types.js';\nimport type { Transaction } from '../transactions/Transaction.js';\nimport { isTransaction } from '../transactions/Transaction.js';\nimport {\n\tisValidSuiAddress,\n\tisValidSuiObjectId,\n\tisValidTransactionDigest,\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n} from '../utils/sui-types.js';\nimport { normalizeSuiNSName } from '../utils/suins.js';\nimport { JsonRpcHTTPTransport } from './http-transport.js';\nimport type { JsonRpcTransport } from './http-transport.js';\nimport type {\n\tAddressMetrics,\n\tAllEpochsAddressMetrics,\n\tCheckpoint,\n\tCheckpointPage,\n\tCoinBalance,\n\tCoinMetadata,\n\tCoinSupply,\n\tCommitteeInfo,\n\tDelegatedStake,\n\tDevInspectResults,\n\tDevInspectTransactionBlockParams,\n\tDryRunTransactionBlockParams,\n\tDryRunTransactionBlockResponse,\n\tDynamicFieldPage,\n\tEpochInfo,\n\tEpochMetricsPage,\n\tEpochPage,\n\tExecuteTransactionBlockParams,\n\tGetAllBalancesParams,\n\tGetAllCoinsParams,\n\tGetBalanceParams,\n\tGetCheckpointParams,\n\tGetCheckpointsParams,\n\tGetCoinMetadataParams,\n\tGetCoinsParams,\n\tGetCommitteeInfoParams,\n\tGetDynamicFieldObjectParams,\n\tGetDynamicFieldsParams,\n\tGetLatestCheckpointSequenceNumberParams,\n\tGetLatestSuiSystemStateParams,\n\tGetMoveFunctionArgTypesParams,\n\tGetNormalizedMoveFunctionParams,\n\tGetNormalizedMoveModuleParams,\n\tGetNormalizedMoveModulesByPackageParams,\n\tGetNormalizedMoveStructParams,\n\tGetObjectParams,\n\tGetOwnedObjectsParams,\n\tGetProtocolConfigParams,\n\tGetReferenceGasPriceParams,\n\tGetStakesByIdsParams,\n\tGetStakesParams,\n\tGetTotalSupplyParams,\n\tGetTransactionBlockParams,\n\tMoveCallMetrics,\n\tMultiGetObjectsParams,\n\tMultiGetTransactionBlocksParams,\n\tNetworkMetrics,\n\tObjectRead,\n\tOrder,\n\tPaginatedCoins,\n\tPaginatedEvents,\n\tPaginatedObjectsResponse,\n\tPaginatedTransactionResponse,\n\tProtocolConfig,\n\tQueryEventsParams,\n\tQueryTransactionBlocksParams,\n\tResolvedNameServiceNames,\n\tResolveNameServiceAddressParams,\n\tResolveNameServiceNamesParams,\n\tSubscribeEventParams,\n\tSubscribeTransactionParams,\n\tSuiEvent,\n\tSuiMoveFunctionArgType,\n\tSuiMoveNormalizedFunction,\n\tSuiMoveNormalizedModule,\n\tSuiMoveNormalizedModules,\n\tSuiMoveNormalizedStruct,\n\tSuiObjectResponse,\n\tSuiObjectResponseQuery,\n\tSuiSystemStateSummary,\n\tSuiTransactionBlockResponse,\n\tSuiTransactionBlockResponseQuery,\n\tTransactionEffects,\n\tTryGetPastObjectParams,\n\tUnsubscribe,\n\tValidatorsApy,\n\tVerifyZkLoginSignatureParams,\n\tZkLoginVerifyResult,\n} from './types/index.js';\nimport { isValidNamedPackage } from '../utils/move-registry.js';\nimport { hasMvrName } from '../experimental/mvr.js';\nimport { JSONRpcCoreClient } from './core.js';\n\nexport interface PaginationArguments<Cursor> {\n\t/** Optional paging cursor */\n\tcursor?: Cursor;\n\t/** Maximum item returned per page */\n\tlimit?: number | null;\n}\n\nexport interface OrderArguments {\n\torder?: Order | null;\n}\n\n/**\n * Configuration options for the SuiClient\n * You must provide either a `url` or a `transport`\n */\nexport type SuiJsonRpcClientOptions = NetworkOrTransport & {\n\tnetwork?: Experimental_SuiClientTypes.Network;\n\tmvr?: Experimental_SuiClientTypes.MvrOptions;\n};\n\ntype NetworkOrTransport =\n\t| {\n\t\t\turl: string;\n\t\t\ttransport?: never;\n\t }\n\t| {\n\t\t\ttransport: JsonRpcTransport;\n\t\t\turl?: never;\n\t };\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiClient') as never;\n\nexport function isSuiJsonRpcClient(client: unknown): client is SuiJsonRpcClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport class SuiJsonRpcClient\n\textends Experimental_BaseClient\n\timplements SelfRegisteringClientExtension\n{\n\tcore: JSONRpcCoreClient;\n\tjsonRpc = this;\n\tprotected transport: JsonRpcTransport;\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Establish a connection to a Sui RPC endpoint\n\t *\n\t * @param options configuration options for the API Client\n\t */\n\tconstructor(options: SuiJsonRpcClientOptions) {\n\t\tsuper({ network: options.network ?? 'unknown' });\n\t\tthis.transport = options.transport ?? new JsonRpcHTTPTransport({ url: options.url });\n\t\tthis.core = new JSONRpcCoreClient({\n\t\t\tjsonRpcClient: this,\n\t\t\tmvr: options.mvr,\n\t\t});\n\t}\n\n\tasync getRpcApiVersion({ signal }: { signal?: AbortSignal } = {}): Promise<string | undefined> {\n\t\tconst resp = await this.transport.request<{ info: { version: string } }>({\n\t\t\tmethod: 'rpc.discover',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\n\t\treturn resp.info.version;\n\t}\n\n\t/**\n\t * Get all Coin<`coin_type`> objects owned by an address.\n\t */\n\tasync getCoins({\n\t\tcoinType,\n\t\towner,\n\t\tcursor,\n\t\tlimit,\n\t\tsignal,\n\t}: GetCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoins',\n\t\t\tparams: [owner, coinType, cursor, limit],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get all Coin objects owned by an address.\n\t */\n\tasync getAllCoins(input: GetAllCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllCoins',\n\t\t\tparams: [input.owner, input.cursor, input.limit],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for one coin type, owned by the address owner.\n\t */\n\tasync getBalance({ owner, coinType, signal }: GetBalanceParams): Promise<CoinBalance> {\n\t\tif (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getBalance',\n\t\t\tparams: [owner, coinType],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for all coin types, owned by the address owner.\n\t */\n\tasync getAllBalances(input: GetAllBalancesParams): Promise<CoinBalance[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllBalances',\n\t\t\tparams: [input.owner],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Fetch CoinMetadata for a given coin type\n\t */\n\tasync getCoinMetadata({ coinType, signal }: GetCoinMetadataParams): Promise<CoinMetadata | null> {\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoinMetadata',\n\t\t\tparams: [coinType],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Fetch total supply for a coin\n\t */\n\tasync getTotalSupply({ coinType, signal }: GetTotalSupplyParams): Promise<CoinSupply> {\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getTotalSupply',\n\t\t\tparams: [coinType],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Invoke any RPC method\n\t * @param method the method to be invoked\n\t * @param args the arguments to be passed to the RPC request\n\t */\n\tasync call<T = unknown>(\n\t\tmethod: string,\n\t\tparams: unknown[],\n\t\t{ signal }: { signal?: AbortSignal } = {},\n\t): Promise<T> {\n\t\treturn await this.transport.request({ method, params, signal });\n\t}\n\n\t/**\n\t * Get Move function argument types like read, write and full access\n\t */\n\tasync getMoveFunctionArgTypes({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tfunction: fn,\n\t\tsignal,\n\t}: GetMoveFunctionArgTypesParams): Promise<SuiMoveFunctionArgType[]> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getMoveFunctionArgTypes',\n\t\t\tparams: [pkg, module, fn],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a map from module name to\n\t * structured representations of Move modules\n\t */\n\tasync getNormalizedMoveModulesByPackage({\n\t\tpackage: pkg,\n\t\tsignal,\n\t}: GetNormalizedMoveModulesByPackageParams): Promise<SuiMoveNormalizedModules> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModulesByPackage',\n\t\t\tparams: [pkg],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move module\n\t */\n\tasync getNormalizedMoveModule({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tsignal,\n\t}: GetNormalizedMoveModuleParams): Promise<SuiMoveNormalizedModule> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModule',\n\t\t\tparams: [pkg, module],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move function\n\t */\n\tasync getNormalizedMoveFunction({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tfunction: fn,\n\t\tsignal,\n\t}: GetNormalizedMoveFunctionParams): Promise<SuiMoveNormalizedFunction> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveFunction',\n\t\t\tparams: [pkg, module, fn],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move struct\n\t */\n\tasync getNormalizedMoveStruct({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tstruct,\n\t\tsignal,\n\t}: GetNormalizedMoveStructParams): Promise<SuiMoveNormalizedStruct> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveStruct',\n\t\t\tparams: [pkg, module, struct],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get all objects owned by an address\n\t */\n\tasync getOwnedObjects(input: GetOwnedObjectsParams): Promise<PaginatedObjectsResponse> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\tconst filter = input.filter\n\t\t\t? {\n\t\t\t\t\t...input.filter,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\t\tif (filter && 'MoveModule' in filter && isValidNamedPackage(filter.MoveModule.package)) {\n\t\t\tfilter.MoveModule = {\n\t\t\t\tmodule: filter.MoveModule.module,\n\t\t\t\tpackage: (\n\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\tpackage: filter.MoveModule.package,\n\t\t\t\t\t})\n\t\t\t\t).package,\n\t\t\t};\n\t\t} else if (filter && 'StructType' in filter && hasMvrName(filter.StructType)) {\n\t\t\tfilter.StructType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: filter.StructType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getOwnedObjects',\n\t\t\tparams: [\n\t\t\t\tinput.owner,\n\t\t\t\t{\n\t\t\t\t\tfilter,\n\t\t\t\t\toptions: input.options,\n\t\t\t\t} as SuiObjectResponseQuery,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get details about an object\n\t */\n\tasync getObject(input: GetObjectParams): Promise<SuiObjectResponse> {\n\t\tif (!input.id || !isValidSuiObjectId(normalizeSuiObjectId(input.id))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getObject',\n\t\t\tparams: [input.id, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync tryGetPastObject(input: TryGetPastObjectParams): Promise<ObjectRead> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_tryGetPastObject',\n\t\t\tparams: [input.id, input.version, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Batch get details about a list of objects. If any of the object ids are duplicates the call will fail\n\t */\n\tasync multiGetObjects(input: MultiGetObjectsParams): Promise<SuiObjectResponse[]> {\n\t\tinput.ids.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Object id ${id}`);\n\t\t\t}\n\t\t});\n\t\tconst hasDuplicates = input.ids.length !== new Set(input.ids).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate object ids in batch call ${input.ids}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetObjects',\n\t\t\tparams: [input.ids, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get transaction blocks for a given query criteria\n\t */\n\tasync queryTransactionBlocks({\n\t\tfilter,\n\t\toptions,\n\t\tcursor,\n\t\tlimit,\n\t\torder,\n\t\tsignal,\n\t}: QueryTransactionBlocksParams): Promise<PaginatedTransactionResponse> {\n\t\tif (filter && 'MoveFunction' in filter && isValidNamedPackage(filter.MoveFunction.package)) {\n\t\t\tfilter = {\n\t\t\t\t...filter,\n\t\t\t\tMoveFunction: {\n\t\t\t\t\tpackage: (\n\t\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\t\tpackage: filter.MoveFunction.package,\n\t\t\t\t\t\t})\n\t\t\t\t\t).package,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryTransactionBlocks',\n\t\t\tparams: [\n\t\t\t\t{\n\t\t\t\t\tfilter,\n\t\t\t\t\toptions,\n\t\t\t\t} as SuiTransactionBlockResponseQuery,\n\t\t\t\tcursor,\n\t\t\t\tlimit,\n\t\t\t\t(order || 'descending') === 'descending',\n\t\t\t],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\tasync getTransactionBlock(\n\t\tinput: GetTransactionBlockParams,\n\t): Promise<SuiTransactionBlockResponse> {\n\t\tif (!isValidTransactionDigest(input.digest)) {\n\t\t\tthrow new Error('Invalid Transaction digest');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getTransactionBlock',\n\t\t\tparams: [input.digest, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync multiGetTransactionBlocks(\n\t\tinput: MultiGetTransactionBlocksParams,\n\t): Promise<SuiTransactionBlockResponse[]> {\n\t\tinput.digests.forEach((d) => {\n\t\t\tif (!isValidTransactionDigest(d)) {\n\t\t\t\tthrow new Error(`Invalid Transaction digest ${d}`);\n\t\t\t}\n\t\t});\n\n\t\tconst hasDuplicates = input.digests.length !== new Set(input.digests).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate digests in batch call ${input.digests}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetTransactionBlocks',\n\t\t\tparams: [input.digests, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync executeTransactionBlock({\n\t\ttransactionBlock,\n\t\tsignature,\n\t\toptions,\n\t\trequestType,\n\t\tsignal,\n\t}: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse> {\n\t\tconst result: SuiTransactionBlockResponse = await this.transport.request({\n\t\t\tmethod: 'sui_executeTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof transactionBlock === 'string' ? transactionBlock : toBase64(transactionBlock),\n\t\t\t\tArray.isArray(signature) ? signature : [signature],\n\t\t\t\toptions,\n\t\t\t],\n\t\t\tsignal,\n\t\t});\n\n\t\tif (requestType === 'WaitForLocalExecution') {\n\t\t\ttry {\n\t\t\t\tawait this.waitForTransaction({\n\t\t\t\t\tdigest: result.digest,\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\t// Ignore error while waiting for transaction\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tasync signAndExecuteTransaction({\n\t\ttransaction,\n\t\tsigner,\n\t\t...input\n\t}: {\n\t\ttransaction: Uint8Array | Transaction;\n\t\tsigner: Signer;\n\t} & Omit<\n\t\tExecuteTransactionBlockParams,\n\t\t'transactionBlock' | 'signature'\n\t>): Promise<SuiTransactionBlockResponse> {\n\t\tlet transactionBytes;\n\n\t\tif (transaction instanceof Uint8Array) {\n\t\t\ttransactionBytes = transaction;\n\t\t} else {\n\t\t\ttransaction.setSenderIfNotSet(signer.toSuiAddress());\n\t\t\ttransactionBytes = await transaction.build({ client: this });\n\t\t}\n\n\t\tconst { signature, bytes } = await signer.signTransaction(transactionBytes);\n\n\t\treturn this.executeTransactionBlock({\n\t\t\ttransactionBlock: bytes,\n\t\t\tsignature,\n\t\t\t...input,\n\t\t});\n\t}\n\n\t/**\n\t * Get total number of transactions\n\t */\n\n\tasync getTotalTransactionBlocks({ signal }: { signal?: AbortSignal } = {}): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'sui_getTotalTransactionBlocks',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Getting the reference gas price for the network\n\t */\n\tasync getReferenceGasPrice({ signal }: GetReferenceGasPriceParams = {}): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'suix_getReferenceGasPrice',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Return the delegated stakes for an address\n\t */\n\tasync getStakes(input: GetStakesParams): Promise<DelegatedStake[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getStakes',\n\t\t\tparams: [input.owner],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the delegated stakes queried by id.\n\t */\n\tasync getStakesByIds(input: GetStakesByIdsParams): Promise<DelegatedStake[]> {\n\t\tinput.stakedSuiIds.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Stake id ${id}`);\n\t\t\t}\n\t\t});\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getStakesByIds',\n\t\t\tparams: [input.stakedSuiIds],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the latest system state content.\n\t */\n\tasync getLatestSuiSystemState({\n\t\tsignal,\n\t}: GetLatestSuiSystemStateParams = {}): Promise<SuiSystemStateSummary> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getLatestSuiSystemState',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Get events for a given query criteria\n\t */\n\tasync queryEvents({\n\t\tquery,\n\t\tcursor,\n\t\tlimit,\n\t\torder,\n\t\tsignal,\n\t}: QueryEventsParams): Promise<PaginatedEvents> {\n\t\tif (query && 'MoveEventType' in query && hasMvrName(query.MoveEventType)) {\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\tMoveEventType: (\n\t\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\t\ttype: query.MoveEventType,\n\t\t\t\t\t})\n\t\t\t\t).type,\n\t\t\t};\n\t\t}\n\n\t\tif (query && 'MoveEventModule' in query && isValidNamedPackage(query.MoveEventModule.package)) {\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\tMoveEventModule: {\n\t\t\t\t\tmodule: query.MoveEventModule.module,\n\t\t\t\t\tpackage: (\n\t\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\t\tpackage: query.MoveEventModule.package,\n\t\t\t\t\t\t})\n\t\t\t\t\t).package,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tif ('MoveModule' in query && isValidNamedPackage(query.MoveModule.package)) {\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\tMoveModule: {\n\t\t\t\t\tmodule: query.MoveModule.module,\n\t\t\t\t\tpackage: (\n\t\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\t\tpackage: query.MoveModule.package,\n\t\t\t\t\t\t})\n\t\t\t\t\t).package,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryEvents',\n\t\t\tparams: [query, cursor, limit, (order || 'descending') === 'descending'],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Subscribe to get notifications whenever an event matching the filter occurs\n\t *\n\t * @deprecated\n\t */\n\tasync subscribeEvent(\n\t\tinput: SubscribeEventParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: SuiEvent) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeEvent',\n\t\t\tunsubscribe: 'suix_unsubscribeEvent',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated\n\t */\n\tasync subscribeTransaction(\n\t\tinput: SubscribeTransactionParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: TransactionEffects) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeTransaction',\n\t\t\tunsubscribe: 'suix_unsubscribeTransaction',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Runs the transaction block in dev-inspect mode. Which allows for nearly any\n\t * transaction (or Move call) with any arguments. Detailed results are\n\t * provided, including both the transaction effects and any return values.\n\t */\n\tasync devInspectTransactionBlock(\n\t\tinput: DevInspectTransactionBlockParams,\n\t): Promise<DevInspectResults> {\n\t\tlet devInspectTxBytes;\n\t\tif (isTransaction(input.transactionBlock)) {\n\t\t\tinput.transactionBlock.setSenderIfNotSet(input.sender);\n\t\t\tdevInspectTxBytes = toBase64(\n\t\t\t\tawait input.transactionBlock.build({\n\t\t\t\t\tclient: this,\n\t\t\t\t\tonlyTransactionKind: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else if (typeof input.transactionBlock === 'string') {\n\t\t\tdevInspectTxBytes = input.transactionBlock;\n\t\t} else if (input.transactionBlock instanceof Uint8Array) {\n\t\t\tdevInspectTxBytes = toBase64(input.transactionBlock);\n\t\t} else {\n\t\t\tthrow new Error('Unknown transaction block format.');\n\t\t}\n\n\t\tinput.signal?.throwIfAborted();\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_devInspectTransactionBlock',\n\t\t\tparams: [input.sender, devInspectTxBytes, input.gasPrice?.toString(), input.epoch],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Dry run a transaction block and return the result.\n\t */\n\tasync dryRunTransactionBlock(\n\t\tinput: DryRunTransactionBlockParams,\n\t): Promise<DryRunTransactionBlockResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_dryRunTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof input.transactionBlock === 'string'\n\t\t\t\t\t? input.transactionBlock\n\t\t\t\t\t: toBase64(input.transactionBlock),\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Return the list of dynamic field objects owned by an object\n\t */\n\tasync getDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage> {\n\t\tif (!input.parentId || !isValidSuiObjectId(normalizeSuiObjectId(input.parentId))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFields',\n\t\t\tparams: [input.parentId, input.cursor, input.limit],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the dynamic field object information for a specified object\n\t */\n\tasync getDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFieldObject',\n\t\t\tparams: [input.parentId, input.name],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get the sequence number of the latest checkpoint that has been executed\n\t */\n\tasync getLatestCheckpointSequenceNumber({\n\t\tsignal,\n\t}: GetLatestCheckpointSequenceNumberParams = {}): Promise<string> {\n\t\tconst resp = await this.transport.request({\n\t\t\tmethod: 'sui_getLatestCheckpointSequenceNumber',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t\treturn String(resp);\n\t}\n\n\t/**\n\t * Returns information about a given checkpoint\n\t */\n\tasync getCheckpoint(input: GetCheckpointParams): Promise<Checkpoint> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getCheckpoint',\n\t\t\tparams: [input.id],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Returns historical checkpoints paginated\n\t */\n\tasync getCheckpoints(\n\t\tinput: PaginationArguments<CheckpointPage['nextCursor']> & GetCheckpointsParams,\n\t): Promise<CheckpointPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getCheckpoints',\n\t\t\tparams: [input.cursor, input?.limit, input.descendingOrder],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCommitteeInfo(input?: GetCommitteeInfoParams): Promise<CommitteeInfo> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCommitteeInfo',\n\t\t\tparams: [input?.epoch],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\tasync getNetworkMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<NetworkMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getNetworkMetrics',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\tasync getAddressMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<AddressMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getLatestAddressMetrics',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\tasync getEpochMetrics(\n\t\tinput?: {\n\t\t\tdescendingOrder?: boolean;\n\t\t\tsignal?: AbortSignal;\n\t\t} & PaginationArguments<EpochMetricsPage['nextCursor']>,\n\t): Promise<EpochMetricsPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochMetrics',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\tasync getAllEpochAddressMetrics(input?: {\n\t\tdescendingOrder?: boolean;\n\t\tsignal?: AbortSignal;\n\t}): Promise<AllEpochsAddressMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllEpochAddressMetrics',\n\t\t\tparams: [input?.descendingOrder],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getEpochs(\n\t\tinput?: {\n\t\t\tdescendingOrder?: boolean;\n\t\t\tsignal?: AbortSignal;\n\t\t} & PaginationArguments<EpochPage['nextCursor']>,\n\t): Promise<EpochPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochs',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Returns list of top move calls by usage\n\t */\n\tasync getMoveCallMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<MoveCallMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getMoveCallMetrics',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCurrentEpoch({ signal }: { signal?: AbortSignal } = {}): Promise<EpochInfo> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCurrentEpoch',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the Validators APYs\n\t */\n\tasync getValidatorsApy({ signal }: { signal?: AbortSignal } = {}): Promise<ValidatorsApy> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getValidatorsApy',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t// TODO: Migrate this to `sui_getChainIdentifier` once it is widely available.\n\tasync getChainIdentifier({ signal }: { signal?: AbortSignal } = {}): Promise<string> {\n\t\tconst checkpoint = await this.getCheckpoint({ id: '0', signal });\n\t\tconst bytes = fromBase58(checkpoint.digest);\n\t\treturn toHex(bytes.slice(0, 4));\n\t}\n\n\tasync resolveNameServiceAddress(input: ResolveNameServiceAddressParams): Promise<string | null> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_resolveNameServiceAddress',\n\t\t\tparams: [input.name],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync resolveNameServiceNames({\n\t\tformat = 'dot',\n\t\t...input\n\t}: ResolveNameServiceNamesParams & {\n\t\tformat?: 'at' | 'dot';\n\t}): Promise<ResolvedNameServiceNames> {\n\t\tconst { nextCursor, hasNextPage, data }: ResolvedNameServiceNames =\n\t\t\tawait this.transport.request({\n\t\t\t\tmethod: 'suix_resolveNameServiceNames',\n\t\t\t\tparams: [input.address, input.cursor, input.limit],\n\t\t\t\tsignal: input.signal,\n\t\t\t});\n\n\t\treturn {\n\t\t\thasNextPage,\n\t\t\tnextCursor,\n\t\t\tdata: data.map((name) => normalizeSuiNSName(name, format)),\n\t\t};\n\t}\n\n\tasync getProtocolConfig(input?: GetProtocolConfigParams): Promise<ProtocolConfig> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getProtocolConfig',\n\t\t\tparams: [input?.version],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\tasync verifyZkLoginSignature(input: VerifyZkLoginSignatureParams): Promise<ZkLoginVerifyResult> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_verifyZkLoginSignature',\n\t\t\tparams: [input.bytes, input.signature, input.intentScope, input.author],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Wait for a transaction block result to be available over the API.\n\t * This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to\n\t * be available via the API.\n\t * This currently polls the `getTransactionBlock` API to check for the transaction.\n\t */\n\tasync waitForTransaction({\n\t\tsignal,\n\t\ttimeout = 60 * 1000,\n\t\tpollInterval = 2 * 1000,\n\t\t...input\n\t}: {\n\t\t/** An optional abort signal that can be used to cancel */\n\t\tsignal?: AbortSignal;\n\t\t/** The amount of time to wait for a transaction block. Defaults to one minute. */\n\t\ttimeout?: number;\n\t\t/** The amount of time to wait between checks for the transaction block. Defaults to 2 seconds. */\n\t\tpollInterval?: number;\n\t} & Parameters<\n\t\tSuiJsonRpcClient['getTransactionBlock']\n\t>[0]): Promise<SuiTransactionBlockResponse> {\n\t\tconst timeoutSignal = AbortSignal.timeout(timeout);\n\t\tconst timeoutPromise = new Promise((_, reject) => {\n\t\t\ttimeoutSignal.addEventListener('abort', () => reject(timeoutSignal.reason));\n\t\t});\n\n\t\ttimeoutPromise.catch(() => {\n\t\t\t// Swallow unhandled rejections that might be thrown after early return\n\t\t});\n\n\t\twhile (!timeoutSignal.aborted) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\ttry {\n\t\t\t\treturn await this.getTransactionBlock(input);\n\t\t\t} catch {\n\t\t\t\t// Wait for either the next poll interval, or the timeout.\n\t\t\t\tawait Promise.race([\n\t\t\t\t\tnew Promise((resolve) => setTimeout(resolve, pollInterval)),\n\t\t\t\t\ttimeoutPromise,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\n\t\ttimeoutSignal.throwIfAborted();\n\n\t\t// This should never happen, because the above case should always throw, but just adding it in the event that something goes horribly wrong.\n\t\tthrow new Error('Unexpected error while waiting for transaction block.');\n\t}\n\n\texperimental_asClientExtension(this: SuiJsonRpcClient) {\n\t\treturn {\n\t\t\tname: 'jsonRPC',\n\t\t\tregister: () => {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t} as const;\n\t}\n}\n"],
5
- "mappings": "AAEA,SAAS,YAAY,UAAU,aAAa;AAG5C,SAAS,+BAA+B;AAMxC,SAAS,qBAAqB;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AAkFrC,SAAS,2BAA2B;AACpC,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAgClC,MAAM,mBAAmB,OAAO,IAAI,mBAAmB;AAEhD,SAAS,mBAAmB,QAA6C;AAC/E,SACC,OAAO,WAAW,YAAY,WAAW,QAAS,OAAe,gBAAgB,MAAM;AAEzF;AAEO,MAAM,yBACJ,wBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcC,YAAY,SAAkC;AAC7C,UAAM,EAAE,SAAS,QAAQ,WAAW,UAAU,CAAC;AAbhD,mBAAU;AAcT,SAAK,YAAY,QAAQ,aAAa,IAAI,qBAAqB,EAAE,KAAK,QAAQ,IAAI,CAAC;AACnF,SAAK,OAAO,IAAI,kBAAkB;AAAA,MACjC,eAAe;AAAA,MACf,KAAK,QAAQ;AAAA,IACd,CAAC;AAAA,EACF;AAAA,EAhBA,KAAK,gBAAgB,IAAI;AACxB,WAAO;AAAA,EACR;AAAA,EAgBA,MAAM,iBAAiB,EAAE,OAAO,IAA8B,C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,CAAC,YAAY,WAAW,SAAS,YAAY,CAAC;AAAA,UAC1D;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,kBAAc,eAAe;AAG7B,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACxE;AAAA,EAEA,iCAAuD;AACtD,WAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU,MAAM;AACf,eAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { fromBase58, toBase64, toHex } from '@mysten/bcs';\n\nimport type { Signer } from '../cryptography/index.js';\nimport { Experimental_BaseClient } from '../experimental/client.js';\nimport type { Experimental_SuiClientTypes } from '../experimental/types.js';\nimport type { Transaction } from '../transactions/Transaction.js';\nimport { isTransaction } from '../transactions/Transaction.js';\nimport {\n\tisValidSuiAddress,\n\tisValidSuiObjectId,\n\tisValidTransactionDigest,\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n} from '../utils/sui-types.js';\nimport { normalizeSuiNSName } from '../utils/suins.js';\nimport { JsonRpcHTTPTransport } from './http-transport.js';\nimport type { JsonRpcTransport } from './http-transport.js';\nimport type {\n\tAddressMetrics,\n\tAllEpochsAddressMetrics,\n\tCheckpoint,\n\tCheckpointPage,\n\tCoinBalance,\n\tCoinMetadata,\n\tCoinSupply,\n\tCommitteeInfo,\n\tDelegatedStake,\n\tDevInspectResults,\n\tDevInspectTransactionBlockParams,\n\tDryRunTransactionBlockParams,\n\tDryRunTransactionBlockResponse,\n\tDynamicFieldPage,\n\tEpochInfo,\n\tEpochMetricsPage,\n\tEpochPage,\n\tExecuteTransactionBlockParams,\n\tGetAllBalancesParams,\n\tGetAllCoinsParams,\n\tGetBalanceParams,\n\tGetCheckpointParams,\n\tGetCheckpointsParams,\n\tGetCoinMetadataParams,\n\tGetCoinsParams,\n\tGetCommitteeInfoParams,\n\tGetDynamicFieldObjectParams,\n\tGetDynamicFieldsParams,\n\tGetLatestCheckpointSequenceNumberParams,\n\tGetLatestSuiSystemStateParams,\n\tGetMoveFunctionArgTypesParams,\n\tGetNormalizedMoveFunctionParams,\n\tGetNormalizedMoveModuleParams,\n\tGetNormalizedMoveModulesByPackageParams,\n\tGetNormalizedMoveStructParams,\n\tGetObjectParams,\n\tGetOwnedObjectsParams,\n\tGetProtocolConfigParams,\n\tGetReferenceGasPriceParams,\n\tGetStakesByIdsParams,\n\tGetStakesParams,\n\tGetTotalSupplyParams,\n\tGetTransactionBlockParams,\n\tMoveCallMetrics,\n\tMultiGetObjectsParams,\n\tMultiGetTransactionBlocksParams,\n\tNetworkMetrics,\n\tObjectRead,\n\tOrder,\n\tPaginatedCoins,\n\tPaginatedEvents,\n\tPaginatedObjectsResponse,\n\tPaginatedTransactionResponse,\n\tProtocolConfig,\n\tQueryEventsParams,\n\tQueryTransactionBlocksParams,\n\tResolvedNameServiceNames,\n\tResolveNameServiceAddressParams,\n\tResolveNameServiceNamesParams,\n\tSubscribeEventParams,\n\tSubscribeTransactionParams,\n\tSuiEvent,\n\tSuiMoveFunctionArgType,\n\tSuiMoveNormalizedFunction,\n\tSuiMoveNormalizedModule,\n\tSuiMoveNormalizedModules,\n\tSuiMoveNormalizedStruct,\n\tSuiObjectResponse,\n\tSuiObjectResponseQuery,\n\tSuiSystemStateSummary,\n\tSuiTransactionBlockResponse,\n\tSuiTransactionBlockResponseQuery,\n\tTransactionEffects,\n\tTryGetPastObjectParams,\n\tUnsubscribe,\n\tValidatorsApy,\n\tVerifyZkLoginSignatureParams,\n\tZkLoginVerifyResult,\n} from './types/index.js';\nimport { isValidNamedPackage } from '../utils/move-registry.js';\nimport { hasMvrName } from '../experimental/mvr.js';\nimport { JSONRpcCoreClient } from './core.js';\n\nexport interface PaginationArguments<Cursor> {\n\t/** Optional paging cursor */\n\tcursor?: Cursor;\n\t/** Maximum item returned per page */\n\tlimit?: number | null;\n}\n\nexport interface OrderArguments {\n\torder?: Order | null;\n}\n\n/**\n * Configuration options for the SuiClient\n * You must provide either a `url` or a `transport`\n */\nexport type SuiJsonRpcClientOptions = NetworkOrTransport & {\n\tnetwork?: Experimental_SuiClientTypes.Network;\n\tmvr?: Experimental_SuiClientTypes.MvrOptions;\n};\n\ntype NetworkOrTransport =\n\t| {\n\t\t\turl: string;\n\t\t\ttransport?: never;\n\t }\n\t| {\n\t\t\ttransport: JsonRpcTransport;\n\t\t\turl?: never;\n\t };\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiClient') as never;\n\nexport function isSuiJsonRpcClient(client: unknown): client is SuiJsonRpcClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport class SuiJsonRpcClient extends Experimental_BaseClient {\n\tcore: JSONRpcCoreClient;\n\tjsonRpc = this;\n\tprotected transport: JsonRpcTransport;\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Establish a connection to a Sui RPC endpoint\n\t *\n\t * @param options configuration options for the API Client\n\t */\n\tconstructor(options: SuiJsonRpcClientOptions) {\n\t\tsuper({ network: options.network ?? 'unknown' });\n\t\tthis.transport = options.transport ?? new JsonRpcHTTPTransport({ url: options.url });\n\t\tthis.core = new JSONRpcCoreClient({\n\t\t\tjsonRpcClient: this,\n\t\t\tmvr: options.mvr,\n\t\t});\n\t}\n\n\tasync getRpcApiVersion({ signal }: { signal?: AbortSignal } = {}): Promise<string | undefined> {\n\t\tconst resp = await this.transport.request<{ info: { version: string } }>({\n\t\t\tmethod: 'rpc.discover',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\n\t\treturn resp.info.version;\n\t}\n\n\t/**\n\t * Get all Coin<`coin_type`> objects owned by an address.\n\t */\n\tasync getCoins({\n\t\tcoinType,\n\t\towner,\n\t\tcursor,\n\t\tlimit,\n\t\tsignal,\n\t}: GetCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoins',\n\t\t\tparams: [owner, coinType, cursor, limit],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get all Coin objects owned by an address.\n\t */\n\tasync getAllCoins(input: GetAllCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllCoins',\n\t\t\tparams: [input.owner, input.cursor, input.limit],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for one coin type, owned by the address owner.\n\t */\n\tasync getBalance({ owner, coinType, signal }: GetBalanceParams): Promise<CoinBalance> {\n\t\tif (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getBalance',\n\t\t\tparams: [owner, coinType],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for all coin types, owned by the address owner.\n\t */\n\tasync getAllBalances(input: GetAllBalancesParams): Promise<CoinBalance[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllBalances',\n\t\t\tparams: [input.owner],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Fetch CoinMetadata for a given coin type\n\t */\n\tasync getCoinMetadata({ coinType, signal }: GetCoinMetadataParams): Promise<CoinMetadata | null> {\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoinMetadata',\n\t\t\tparams: [coinType],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Fetch total supply for a coin\n\t */\n\tasync getTotalSupply({ coinType, signal }: GetTotalSupplyParams): Promise<CoinSupply> {\n\t\tif (coinType && hasMvrName(coinType)) {\n\t\t\tcoinType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: coinType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getTotalSupply',\n\t\t\tparams: [coinType],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Invoke any RPC method\n\t * @param method the method to be invoked\n\t * @param args the arguments to be passed to the RPC request\n\t */\n\tasync call<T = unknown>(\n\t\tmethod: string,\n\t\tparams: unknown[],\n\t\t{ signal }: { signal?: AbortSignal } = {},\n\t): Promise<T> {\n\t\treturn await this.transport.request({ method, params, signal });\n\t}\n\n\t/**\n\t * Get Move function argument types like read, write and full access\n\t */\n\tasync getMoveFunctionArgTypes({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tfunction: fn,\n\t\tsignal,\n\t}: GetMoveFunctionArgTypesParams): Promise<SuiMoveFunctionArgType[]> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getMoveFunctionArgTypes',\n\t\t\tparams: [pkg, module, fn],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a map from module name to\n\t * structured representations of Move modules\n\t */\n\tasync getNormalizedMoveModulesByPackage({\n\t\tpackage: pkg,\n\t\tsignal,\n\t}: GetNormalizedMoveModulesByPackageParams): Promise<SuiMoveNormalizedModules> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModulesByPackage',\n\t\t\tparams: [pkg],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move module\n\t */\n\tasync getNormalizedMoveModule({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tsignal,\n\t}: GetNormalizedMoveModuleParams): Promise<SuiMoveNormalizedModule> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModule',\n\t\t\tparams: [pkg, module],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move function\n\t */\n\tasync getNormalizedMoveFunction({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tfunction: fn,\n\t\tsignal,\n\t}: GetNormalizedMoveFunctionParams): Promise<SuiMoveNormalizedFunction> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveFunction',\n\t\t\tparams: [pkg, module, fn],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move struct\n\t */\n\tasync getNormalizedMoveStruct({\n\t\tpackage: pkg,\n\t\tmodule,\n\t\tstruct,\n\t\tsignal,\n\t}: GetNormalizedMoveStructParams): Promise<SuiMoveNormalizedStruct> {\n\t\tif (pkg && isValidNamedPackage(pkg)) {\n\t\t\tpkg = (\n\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\tpackage: pkg,\n\t\t\t\t})\n\t\t\t).package;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveStruct',\n\t\t\tparams: [pkg, module, struct],\n\t\t\tsignal: signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get all objects owned by an address\n\t */\n\tasync getOwnedObjects(input: GetOwnedObjectsParams): Promise<PaginatedObjectsResponse> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\tconst filter = input.filter\n\t\t\t? {\n\t\t\t\t\t...input.filter,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\t\tif (filter && 'MoveModule' in filter && isValidNamedPackage(filter.MoveModule.package)) {\n\t\t\tfilter.MoveModule = {\n\t\t\t\tmodule: filter.MoveModule.module,\n\t\t\t\tpackage: (\n\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\tpackage: filter.MoveModule.package,\n\t\t\t\t\t})\n\t\t\t\t).package,\n\t\t\t};\n\t\t} else if (filter && 'StructType' in filter && hasMvrName(filter.StructType)) {\n\t\t\tfilter.StructType = (\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: filter.StructType,\n\t\t\t\t})\n\t\t\t).type;\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getOwnedObjects',\n\t\t\tparams: [\n\t\t\t\tinput.owner,\n\t\t\t\t{\n\t\t\t\t\tfilter,\n\t\t\t\t\toptions: input.options,\n\t\t\t\t} as SuiObjectResponseQuery,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get details about an object\n\t */\n\tasync getObject(input: GetObjectParams): Promise<SuiObjectResponse> {\n\t\tif (!input.id || !isValidSuiObjectId(normalizeSuiObjectId(input.id))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getObject',\n\t\t\tparams: [input.id, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync tryGetPastObject(input: TryGetPastObjectParams): Promise<ObjectRead> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_tryGetPastObject',\n\t\t\tparams: [input.id, input.version, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Batch get details about a list of objects. If any of the object ids are duplicates the call will fail\n\t */\n\tasync multiGetObjects(input: MultiGetObjectsParams): Promise<SuiObjectResponse[]> {\n\t\tinput.ids.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Object id ${id}`);\n\t\t\t}\n\t\t});\n\t\tconst hasDuplicates = input.ids.length !== new Set(input.ids).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate object ids in batch call ${input.ids}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetObjects',\n\t\t\tparams: [input.ids, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get transaction blocks for a given query criteria\n\t */\n\tasync queryTransactionBlocks({\n\t\tfilter,\n\t\toptions,\n\t\tcursor,\n\t\tlimit,\n\t\torder,\n\t\tsignal,\n\t}: QueryTransactionBlocksParams): Promise<PaginatedTransactionResponse> {\n\t\tif (filter && 'MoveFunction' in filter && isValidNamedPackage(filter.MoveFunction.package)) {\n\t\t\tfilter = {\n\t\t\t\t...filter,\n\t\t\t\tMoveFunction: {\n\t\t\t\t\tpackage: (\n\t\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\t\tpackage: filter.MoveFunction.package,\n\t\t\t\t\t\t})\n\t\t\t\t\t).package,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryTransactionBlocks',\n\t\t\tparams: [\n\t\t\t\t{\n\t\t\t\t\tfilter,\n\t\t\t\t\toptions,\n\t\t\t\t} as SuiTransactionBlockResponseQuery,\n\t\t\t\tcursor,\n\t\t\t\tlimit,\n\t\t\t\t(order || 'descending') === 'descending',\n\t\t\t],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\tasync getTransactionBlock(\n\t\tinput: GetTransactionBlockParams,\n\t): Promise<SuiTransactionBlockResponse> {\n\t\tif (!isValidTransactionDigest(input.digest)) {\n\t\t\tthrow new Error('Invalid Transaction digest');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getTransactionBlock',\n\t\t\tparams: [input.digest, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync multiGetTransactionBlocks(\n\t\tinput: MultiGetTransactionBlocksParams,\n\t): Promise<SuiTransactionBlockResponse[]> {\n\t\tinput.digests.forEach((d) => {\n\t\t\tif (!isValidTransactionDigest(d)) {\n\t\t\t\tthrow new Error(`Invalid Transaction digest ${d}`);\n\t\t\t}\n\t\t});\n\n\t\tconst hasDuplicates = input.digests.length !== new Set(input.digests).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate digests in batch call ${input.digests}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetTransactionBlocks',\n\t\t\tparams: [input.digests, input.options],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync executeTransactionBlock({\n\t\ttransactionBlock,\n\t\tsignature,\n\t\toptions,\n\t\trequestType,\n\t\tsignal,\n\t}: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse> {\n\t\tconst result: SuiTransactionBlockResponse = await this.transport.request({\n\t\t\tmethod: 'sui_executeTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof transactionBlock === 'string' ? transactionBlock : toBase64(transactionBlock),\n\t\t\t\tArray.isArray(signature) ? signature : [signature],\n\t\t\t\toptions,\n\t\t\t],\n\t\t\tsignal,\n\t\t});\n\n\t\tif (requestType === 'WaitForLocalExecution') {\n\t\t\ttry {\n\t\t\t\tawait this.waitForTransaction({\n\t\t\t\t\tdigest: result.digest,\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\t// Ignore error while waiting for transaction\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tasync signAndExecuteTransaction({\n\t\ttransaction,\n\t\tsigner,\n\t\t...input\n\t}: {\n\t\ttransaction: Uint8Array | Transaction;\n\t\tsigner: Signer;\n\t} & Omit<\n\t\tExecuteTransactionBlockParams,\n\t\t'transactionBlock' | 'signature'\n\t>): Promise<SuiTransactionBlockResponse> {\n\t\tlet transactionBytes;\n\n\t\tif (transaction instanceof Uint8Array) {\n\t\t\ttransactionBytes = transaction;\n\t\t} else {\n\t\t\ttransaction.setSenderIfNotSet(signer.toSuiAddress());\n\t\t\ttransactionBytes = await transaction.build({ client: this });\n\t\t}\n\n\t\tconst { signature, bytes } = await signer.signTransaction(transactionBytes);\n\n\t\treturn this.executeTransactionBlock({\n\t\t\ttransactionBlock: bytes,\n\t\t\tsignature,\n\t\t\t...input,\n\t\t});\n\t}\n\n\t/**\n\t * Get total number of transactions\n\t */\n\n\tasync getTotalTransactionBlocks({ signal }: { signal?: AbortSignal } = {}): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'sui_getTotalTransactionBlocks',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Getting the reference gas price for the network\n\t */\n\tasync getReferenceGasPrice({ signal }: GetReferenceGasPriceParams = {}): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'suix_getReferenceGasPrice',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Return the delegated stakes for an address\n\t */\n\tasync getStakes(input: GetStakesParams): Promise<DelegatedStake[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getStakes',\n\t\t\tparams: [input.owner],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the delegated stakes queried by id.\n\t */\n\tasync getStakesByIds(input: GetStakesByIdsParams): Promise<DelegatedStake[]> {\n\t\tinput.stakedSuiIds.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Stake id ${id}`);\n\t\t\t}\n\t\t});\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getStakesByIds',\n\t\t\tparams: [input.stakedSuiIds],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the latest system state content.\n\t */\n\tasync getLatestSuiSystemState({\n\t\tsignal,\n\t}: GetLatestSuiSystemStateParams = {}): Promise<SuiSystemStateSummary> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getLatestSuiSystemState',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Get events for a given query criteria\n\t */\n\tasync queryEvents({\n\t\tquery,\n\t\tcursor,\n\t\tlimit,\n\t\torder,\n\t\tsignal,\n\t}: QueryEventsParams): Promise<PaginatedEvents> {\n\t\tif (query && 'MoveEventType' in query && hasMvrName(query.MoveEventType)) {\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\tMoveEventType: (\n\t\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\t\ttype: query.MoveEventType,\n\t\t\t\t\t})\n\t\t\t\t).type,\n\t\t\t};\n\t\t}\n\n\t\tif (query && 'MoveEventModule' in query && isValidNamedPackage(query.MoveEventModule.package)) {\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\tMoveEventModule: {\n\t\t\t\t\tmodule: query.MoveEventModule.module,\n\t\t\t\t\tpackage: (\n\t\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\t\tpackage: query.MoveEventModule.package,\n\t\t\t\t\t\t})\n\t\t\t\t\t).package,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tif ('MoveModule' in query && isValidNamedPackage(query.MoveModule.package)) {\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\tMoveModule: {\n\t\t\t\t\tmodule: query.MoveModule.module,\n\t\t\t\t\tpackage: (\n\t\t\t\t\t\tawait this.core.mvr.resolvePackage({\n\t\t\t\t\t\t\tpackage: query.MoveModule.package,\n\t\t\t\t\t\t})\n\t\t\t\t\t).package,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryEvents',\n\t\t\tparams: [query, cursor, limit, (order || 'descending') === 'descending'],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Subscribe to get notifications whenever an event matching the filter occurs\n\t *\n\t * @deprecated\n\t */\n\tasync subscribeEvent(\n\t\tinput: SubscribeEventParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: SuiEvent) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeEvent',\n\t\t\tunsubscribe: 'suix_unsubscribeEvent',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated\n\t */\n\tasync subscribeTransaction(\n\t\tinput: SubscribeTransactionParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: TransactionEffects) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeTransaction',\n\t\t\tunsubscribe: 'suix_unsubscribeTransaction',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Runs the transaction block in dev-inspect mode. Which allows for nearly any\n\t * transaction (or Move call) with any arguments. Detailed results are\n\t * provided, including both the transaction effects and any return values.\n\t */\n\tasync devInspectTransactionBlock(\n\t\tinput: DevInspectTransactionBlockParams,\n\t): Promise<DevInspectResults> {\n\t\tlet devInspectTxBytes;\n\t\tif (isTransaction(input.transactionBlock)) {\n\t\t\tinput.transactionBlock.setSenderIfNotSet(input.sender);\n\t\t\tdevInspectTxBytes = toBase64(\n\t\t\t\tawait input.transactionBlock.build({\n\t\t\t\t\tclient: this,\n\t\t\t\t\tonlyTransactionKind: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else if (typeof input.transactionBlock === 'string') {\n\t\t\tdevInspectTxBytes = input.transactionBlock;\n\t\t} else if (input.transactionBlock instanceof Uint8Array) {\n\t\t\tdevInspectTxBytes = toBase64(input.transactionBlock);\n\t\t} else {\n\t\t\tthrow new Error('Unknown transaction block format.');\n\t\t}\n\n\t\tinput.signal?.throwIfAborted();\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_devInspectTransactionBlock',\n\t\t\tparams: [input.sender, devInspectTxBytes, input.gasPrice?.toString(), input.epoch],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Dry run a transaction block and return the result.\n\t */\n\tasync dryRunTransactionBlock(\n\t\tinput: DryRunTransactionBlockParams,\n\t): Promise<DryRunTransactionBlockResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_dryRunTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof input.transactionBlock === 'string'\n\t\t\t\t\t? input.transactionBlock\n\t\t\t\t\t: toBase64(input.transactionBlock),\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Return the list of dynamic field objects owned by an object\n\t */\n\tasync getDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage> {\n\t\tif (!input.parentId || !isValidSuiObjectId(normalizeSuiObjectId(input.parentId))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFields',\n\t\t\tparams: [input.parentId, input.cursor, input.limit],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the dynamic field object information for a specified object\n\t */\n\tasync getDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFieldObject',\n\t\t\tparams: [input.parentId, input.name],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Get the sequence number of the latest checkpoint that has been executed\n\t */\n\tasync getLatestCheckpointSequenceNumber({\n\t\tsignal,\n\t}: GetLatestCheckpointSequenceNumberParams = {}): Promise<string> {\n\t\tconst resp = await this.transport.request({\n\t\t\tmethod: 'sui_getLatestCheckpointSequenceNumber',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t\treturn String(resp);\n\t}\n\n\t/**\n\t * Returns information about a given checkpoint\n\t */\n\tasync getCheckpoint(input: GetCheckpointParams): Promise<Checkpoint> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getCheckpoint',\n\t\t\tparams: [input.id],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Returns historical checkpoints paginated\n\t */\n\tasync getCheckpoints(\n\t\tinput: PaginationArguments<CheckpointPage['nextCursor']> & GetCheckpointsParams,\n\t): Promise<CheckpointPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getCheckpoints',\n\t\t\tparams: [input.cursor, input?.limit, input.descendingOrder],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCommitteeInfo(input?: GetCommitteeInfoParams): Promise<CommitteeInfo> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCommitteeInfo',\n\t\t\tparams: [input?.epoch],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\tasync getNetworkMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<NetworkMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getNetworkMetrics',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\tasync getAddressMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<AddressMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getLatestAddressMetrics',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\tasync getEpochMetrics(\n\t\tinput?: {\n\t\t\tdescendingOrder?: boolean;\n\t\t\tsignal?: AbortSignal;\n\t\t} & PaginationArguments<EpochMetricsPage['nextCursor']>,\n\t): Promise<EpochMetricsPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochMetrics',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\tasync getAllEpochAddressMetrics(input?: {\n\t\tdescendingOrder?: boolean;\n\t\tsignal?: AbortSignal;\n\t}): Promise<AllEpochsAddressMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllEpochAddressMetrics',\n\t\t\tparams: [input?.descendingOrder],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getEpochs(\n\t\tinput?: {\n\t\t\tdescendingOrder?: boolean;\n\t\t\tsignal?: AbortSignal;\n\t\t} & PaginationArguments<EpochPage['nextCursor']>,\n\t): Promise<EpochPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochs',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Returns list of top move calls by usage\n\t */\n\tasync getMoveCallMetrics({ signal }: { signal?: AbortSignal } = {}): Promise<MoveCallMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getMoveCallMetrics',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCurrentEpoch({ signal }: { signal?: AbortSignal } = {}): Promise<EpochInfo> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCurrentEpoch',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/**\n\t * Return the Validators APYs\n\t */\n\tasync getValidatorsApy({ signal }: { signal?: AbortSignal } = {}): Promise<ValidatorsApy> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getValidatorsApy',\n\t\t\tparams: [],\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t// TODO: Migrate this to `sui_getChainIdentifier` once it is widely available.\n\tasync getChainIdentifier({ signal }: { signal?: AbortSignal } = {}): Promise<string> {\n\t\tconst checkpoint = await this.getCheckpoint({ id: '0', signal });\n\t\tconst bytes = fromBase58(checkpoint.digest);\n\t\treturn toHex(bytes.slice(0, 4));\n\t}\n\n\tasync resolveNameServiceAddress(input: ResolveNameServiceAddressParams): Promise<string | null> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_resolveNameServiceAddress',\n\t\t\tparams: [input.name],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\tasync resolveNameServiceNames({\n\t\tformat = 'dot',\n\t\t...input\n\t}: ResolveNameServiceNamesParams & {\n\t\tformat?: 'at' | 'dot';\n\t}): Promise<ResolvedNameServiceNames> {\n\t\tconst { nextCursor, hasNextPage, data }: ResolvedNameServiceNames =\n\t\t\tawait this.transport.request({\n\t\t\t\tmethod: 'suix_resolveNameServiceNames',\n\t\t\t\tparams: [input.address, input.cursor, input.limit],\n\t\t\t\tsignal: input.signal,\n\t\t\t});\n\n\t\treturn {\n\t\t\thasNextPage,\n\t\t\tnextCursor,\n\t\t\tdata: data.map((name) => normalizeSuiNSName(name, format)),\n\t\t};\n\t}\n\n\tasync getProtocolConfig(input?: GetProtocolConfigParams): Promise<ProtocolConfig> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getProtocolConfig',\n\t\t\tparams: [input?.version],\n\t\t\tsignal: input?.signal,\n\t\t});\n\t}\n\n\tasync verifyZkLoginSignature(input: VerifyZkLoginSignatureParams): Promise<ZkLoginVerifyResult> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_verifyZkLoginSignature',\n\t\t\tparams: [input.bytes, input.signature, input.intentScope, input.author],\n\t\t\tsignal: input.signal,\n\t\t});\n\t}\n\n\t/**\n\t * Wait for a transaction block result to be available over the API.\n\t * This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to\n\t * be available via the API.\n\t * This currently polls the `getTransactionBlock` API to check for the transaction.\n\t */\n\tasync waitForTransaction({\n\t\tsignal,\n\t\ttimeout = 60 * 1000,\n\t\tpollInterval = 2 * 1000,\n\t\t...input\n\t}: {\n\t\t/** An optional abort signal that can be used to cancel */\n\t\tsignal?: AbortSignal;\n\t\t/** The amount of time to wait for a transaction block. Defaults to one minute. */\n\t\ttimeout?: number;\n\t\t/** The amount of time to wait between checks for the transaction block. Defaults to 2 seconds. */\n\t\tpollInterval?: number;\n\t} & Parameters<\n\t\tSuiJsonRpcClient['getTransactionBlock']\n\t>[0]): Promise<SuiTransactionBlockResponse> {\n\t\tconst timeoutSignal = AbortSignal.timeout(timeout);\n\t\tconst timeoutPromise = new Promise((_, reject) => {\n\t\t\ttimeoutSignal.addEventListener('abort', () => reject(timeoutSignal.reason));\n\t\t});\n\n\t\ttimeoutPromise.catch(() => {\n\t\t\t// Swallow unhandled rejections that might be thrown after early return\n\t\t});\n\n\t\twhile (!timeoutSignal.aborted) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\ttry {\n\t\t\t\treturn await this.getTransactionBlock(input);\n\t\t\t} catch {\n\t\t\t\t// Wait for either the next poll interval, or the timeout.\n\t\t\t\tawait Promise.race([\n\t\t\t\t\tnew Promise((resolve) => setTimeout(resolve, pollInterval)),\n\t\t\t\t\ttimeoutPromise,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\n\t\ttimeoutSignal.throwIfAborted();\n\n\t\t// This should never happen, because the above case should always throw, but just adding it in the event that something goes horribly wrong.\n\t\tthrow new Error('Unexpected error while waiting for transaction block.');\n\t}\n}\n"],
5
+ "mappings": "AAEA,SAAS,YAAY,UAAU,aAAa;AAG5C,SAAS,+BAA+B;AAGxC,SAAS,qBAAqB;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AAkFrC,SAAS,2BAA2B;AACpC,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAgClC,MAAM,mBAAmB,OAAO,IAAI,mBAAmB;AAEhD,SAAS,mBAAmB,QAA6C;AAC/E,SACC,OAAO,WAAW,YAAY,WAAW,QAAS,OAAe,gBAAgB,MAAM;AAEzF;AAEO,MAAM,yBAAyB,wBAAwB;AAAA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;AAAA,EACJ,GAS4C;AAC3C,UAAM,gBAAgB,YAAY,QAAQ,OAAO;AACjD,UAAM,iBAAiB,IAAI,QAAQ,CAAC,GAAG,WAAW;AACjD,oBAAc,iBAAiB,SAAS,MAAM,OAAO,cAAc,MAAM,CAAC;AAAA,IAC3E,CAAC;AAED,mBAAe,MAAM,MAAM;AAAA,IAE3B,CAAC;AAED,WAAO,CAAC,cAAc,SAAS;AAC9B,cAAQ,eAAe;AACvB,UAAI;AACH,eAAO,MAAM,KAAK,oBAAoB,KAAK;AAAA,MAC5C,QAAQ;AAEP,cAAM,QAAQ,KAAK;AAAA,UAClB,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,YAAY,CAAC;AAAA,UAC1D;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,kBAAc,eAAe;AAG7B,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACxE;AACD;",
6
6
  "names": []
7
7
  }
@@ -65,7 +65,7 @@ export declare function parseSerializedPasskeySignature(signature: Uint8Array |
65
65
  signatureScheme: "Passkey";
66
66
  serializedSignature: string;
67
67
  signature: Uint8Array<ArrayBufferLike>;
68
- authenticatorData: number[];
68
+ authenticatorData: Uint8Array<ArrayBufferLike>;
69
69
  clientDataJson: string;
70
70
  userSignature: Uint8Array<ArrayBuffer>;
71
71
  publicKey: Uint8Array<ArrayBuffer>;
@@ -4,26 +4,26 @@ import type { SignatureScheme } from '../cryptography/signature-scheme.js';
4
4
  import type { ZkLoginCompatibleClient } from '../zklogin/publickey.js';
5
5
  import { MultiSigSigner } from './signer.js';
6
6
  type CompressedSignature = {
7
- ED25519: number[];
7
+ ED25519: Uint8Array;
8
8
  } | {
9
- Secp256k1: number[];
9
+ Secp256k1: Uint8Array;
10
10
  } | {
11
- Secp256r1: number[];
11
+ Secp256r1: Uint8Array;
12
12
  } | {
13
- ZkLogin: number[];
13
+ ZkLogin: Uint8Array;
14
14
  } | {
15
- Passkey: number[];
15
+ Passkey: Uint8Array;
16
16
  };
17
17
  type PublicKeyEnum = {
18
- ED25519: number[];
18
+ ED25519: Uint8Array;
19
19
  } | {
20
- Secp256k1: number[];
20
+ Secp256k1: Uint8Array;
21
21
  } | {
22
- Secp256r1: number[];
22
+ Secp256r1: Uint8Array;
23
23
  } | {
24
- ZkLogin: number[];
24
+ ZkLogin: Uint8Array;
25
25
  } | {
26
- Passkey: number[];
26
+ Passkey: Uint8Array;
27
27
  };
28
28
  type PubkeyEnumWeightPair = {
29
29
  pubKey: PublicKeyEnum;
@@ -71,7 +71,7 @@ class MultiSigPublicKey extends PublicKey {
71
71
  pk_map: publicKeys.map(({ publicKey, weight }) => {
72
72
  const scheme = SIGNATURE_FLAG_TO_SCHEME[publicKey.flag()];
73
73
  return {
74
- pubKey: { [scheme]: Array.from(publicKey.toRawBytes()) },
74
+ pubKey: { [scheme]: publicKey.toRawBytes() },
75
75
  weight
76
76
  };
77
77
  }),
@@ -171,7 +171,7 @@ class MultiSigPublicKey extends PublicKey {
171
171
  publicKey = parsed.publicKey;
172
172
  }
173
173
  compressedSignatures[i] = {
174
- [parsed.signatureScheme]: Array.from(parsed.signature.map((x) => Number(x)))
174
+ [parsed.signatureScheme]: parsed.signature
175
175
  };
176
176
  let publicKeyIndex;
177
177
  for (let j = 0; j < this.publicKeys.length; j++) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/multisig/publickey.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { fromBase64, toBase64 } from '@mysten/bcs';\nimport { blake2b } from '@noble/hashes/blake2b';\nimport { bytesToHex } from '@noble/hashes/utils';\n\nimport { bcs } from '../bcs/index.js';\nimport type { Signer } from '../cryptography/keypair.js';\nimport { bytesEqual, PublicKey } from '../cryptography/publickey.js';\nimport {\n\tSIGNATURE_FLAG_TO_SCHEME,\n\tSIGNATURE_SCHEME_TO_FLAG,\n} from '../cryptography/signature-scheme.js';\nimport type { SignatureFlag, SignatureScheme } from '../cryptography/signature-scheme.js';\nimport { parseSerializedSignature } from '../cryptography/signature.js';\nimport { normalizeSuiAddress } from '../utils/sui-types.js';\n// eslint-disable-next-line import/no-cycle\nimport { publicKeyFromRawBytes } from '../verify/index.js';\nimport type { ZkLoginCompatibleClient } from '../zklogin/publickey.js';\nimport { toZkLoginPublicIdentifier } from '../zklogin/publickey.js';\nimport { MultiSigSigner } from './signer.js';\n\ntype CompressedSignature =\n\t| { ED25519: number[] }\n\t| { Secp256k1: number[] }\n\t| { Secp256r1: number[] }\n\t| { ZkLogin: number[] }\n\t| { Passkey: number[] };\n\ntype PublicKeyEnum =\n\t| { ED25519: number[] }\n\t| { Secp256k1: number[] }\n\t| { Secp256r1: number[] }\n\t| { ZkLogin: number[] }\n\t| { Passkey: number[] };\n\ntype PubkeyEnumWeightPair = {\n\tpubKey: PublicKeyEnum;\n\tweight: number;\n};\n\ntype MultiSigPublicKeyStruct = {\n\tpk_map: PubkeyEnumWeightPair[];\n\tthreshold: number;\n};\n\nexport type MultiSigStruct = {\n\tsigs: CompressedSignature[];\n\tbitmap: number;\n\tmultisig_pk: MultiSigPublicKeyStruct;\n};\n\ntype ParsedPartialMultiSigSignature = {\n\tsignatureScheme: SignatureScheme;\n\tsignature: Uint8Array;\n\tpublicKey: PublicKey;\n\tweight: number;\n};\n\nexport const MAX_SIGNER_IN_MULTISIG = 10;\nexport const MIN_SIGNER_IN_MULTISIG = 1;\n/**\n * A MultiSig public key\n */\nexport class MultiSigPublicKey extends PublicKey {\n\tprivate rawBytes: Uint8Array<ArrayBuffer>;\n\tprivate multisigPublicKey: MultiSigPublicKeyStruct;\n\tprivate publicKeys: {\n\t\tweight: number;\n\t\tpublicKey: PublicKey;\n\t}[];\n\t/**\n\t * Create a new MultiSigPublicKey object\n\t */\n\tconstructor(\n\t\t/**\n\t\t * MultiSig public key as buffer or base-64 encoded string\n\t\t */\n\t\tvalue: string | Uint8Array | MultiSigPublicKeyStruct,\n\t\toptions: { client?: ZkLoginCompatibleClient } = {},\n\t) {\n\t\tsuper();\n\n\t\tif (typeof value === 'string') {\n\t\t\tthis.rawBytes = fromBase64(value);\n\n\t\t\tthis.multisigPublicKey = bcs.MultiSigPublicKey.parse(this.rawBytes);\n\t\t} else if (value instanceof Uint8Array) {\n\t\t\tthis.rawBytes = value as Uint8Array<ArrayBuffer>;\n\t\t\tthis.multisigPublicKey = bcs.MultiSigPublicKey.parse(this.rawBytes);\n\t\t} else {\n\t\t\tthis.multisigPublicKey = value;\n\t\t\tthis.rawBytes = bcs.MultiSigPublicKey.serialize(value).toBytes();\n\t\t}\n\t\tif (this.multisigPublicKey.threshold < 1) {\n\t\t\tthrow new Error('Invalid threshold');\n\t\t}\n\n\t\tconst seenPublicKeys = new Set<string>();\n\n\t\tthis.publicKeys = this.multisigPublicKey.pk_map.map(({ pubKey, weight }) => {\n\t\t\tconst [scheme, bytes] = Object.entries(pubKey).filter(([name]) => name !== '$kind')[0] as [\n\t\t\t\tSignatureScheme,\n\t\t\t\tnumber[],\n\t\t\t];\n\t\t\tconst publicKeyStr = Uint8Array.from(bytes).toString();\n\n\t\t\tif (seenPublicKeys.has(publicKeyStr)) {\n\t\t\t\tthrow new Error(`Multisig does not support duplicate public keys`);\n\t\t\t}\n\t\t\tseenPublicKeys.add(publicKeyStr);\n\n\t\t\tif (weight < 1) {\n\t\t\t\tthrow new Error(`Invalid weight`);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tpublicKey: publicKeyFromRawBytes(scheme, Uint8Array.from(bytes), options),\n\t\t\t\tweight,\n\t\t\t};\n\t\t});\n\n\t\tconst totalWeight = this.publicKeys.reduce((sum, { weight }) => sum + weight, 0);\n\n\t\tif (this.multisigPublicKey.threshold > totalWeight) {\n\t\t\tthrow new Error(`Unreachable threshold`);\n\t\t}\n\n\t\tif (this.publicKeys.length > MAX_SIGNER_IN_MULTISIG) {\n\t\t\tthrow new Error(`Max number of signers in a multisig is ${MAX_SIGNER_IN_MULTISIG}`);\n\t\t}\n\n\t\tif (this.publicKeys.length < MIN_SIGNER_IN_MULTISIG) {\n\t\t\tthrow new Error(`Min number of signers in a multisig is ${MIN_SIGNER_IN_MULTISIG}`);\n\t\t}\n\t}\n\t/**\n\t * \tA static method to create a new MultiSig publickey instance from a set of public keys and their associated weights pairs and threshold.\n\t */\n\n\tstatic fromPublicKeys({\n\t\tthreshold,\n\t\tpublicKeys,\n\t}: {\n\t\tthreshold: number;\n\t\tpublicKeys: { publicKey: PublicKey; weight: number }[];\n\t}) {\n\t\treturn new MultiSigPublicKey({\n\t\t\tpk_map: publicKeys.map(({ publicKey, weight }) => {\n\t\t\t\tconst scheme = SIGNATURE_FLAG_TO_SCHEME[publicKey.flag() as SignatureFlag];\n\n\t\t\t\treturn {\n\t\t\t\t\tpubKey: { [scheme]: Array.from(publicKey.toRawBytes()) } as PublicKeyEnum,\n\t\t\t\t\tweight,\n\t\t\t\t};\n\t\t\t}),\n\t\t\tthreshold,\n\t\t});\n\t}\n\n\t/**\n\t * Checks if two MultiSig public keys are equal\n\t */\n\toverride equals(publicKey: MultiSigPublicKey): boolean {\n\t\treturn super.equals(publicKey);\n\t}\n\n\t/**\n\t * Return the byte array representation of the MultiSig public key\n\t */\n\ttoRawBytes(): Uint8Array<ArrayBuffer> {\n\t\treturn this.rawBytes;\n\t}\n\n\tgetPublicKeys() {\n\t\treturn this.publicKeys;\n\t}\n\n\tgetThreshold() {\n\t\treturn this.multisigPublicKey.threshold;\n\t}\n\n\tgetSigner(...signers: [signer: Signer]) {\n\t\treturn new MultiSigSigner(this, signers);\n\t}\n\n\t/**\n\t * Return the Sui address associated with this MultiSig public key\n\t */\n\toverride toSuiAddress(): string {\n\t\t// max length = 1 flag byte + (max pk size + max weight size (u8)) * max signer size + 2 threshold bytes (u16)\n\t\tconst maxLength = 1 + (64 + 1) * MAX_SIGNER_IN_MULTISIG + 2;\n\t\tconst tmp = new Uint8Array(maxLength);\n\t\ttmp.set([SIGNATURE_SCHEME_TO_FLAG['MultiSig']]);\n\n\t\ttmp.set(bcs.u16().serialize(this.multisigPublicKey.threshold).toBytes(), 1);\n\t\t// The initial value 3 ensures that following data will be after the flag byte and threshold bytes\n\t\tlet i = 3;\n\t\tfor (const { publicKey, weight } of this.publicKeys) {\n\t\t\tconst bytes = publicKey.toSuiBytes();\n\t\t\ttmp.set(bytes, i);\n\t\t\ti += bytes.length;\n\t\t\ttmp.set([weight], i++);\n\t\t}\n\t\treturn normalizeSuiAddress(bytesToHex(blake2b(tmp.slice(0, i), { dkLen: 32 })));\n\t}\n\n\t/**\n\t * Return the Sui address associated with this MultiSig public key\n\t */\n\tflag(): number {\n\t\treturn SIGNATURE_SCHEME_TO_FLAG['MultiSig'];\n\t}\n\n\t/**\n\t * Verifies that the signature is valid for for the provided message\n\t */\n\tasync verify(message: Uint8Array, multisigSignature: string): Promise<boolean> {\n\t\t// Multisig verification only supports serialized signature\n\t\tconst parsed = parseSerializedSignature(multisigSignature);\n\n\t\tif (parsed.signatureScheme !== 'MultiSig') {\n\t\t\tthrow new Error('Invalid signature scheme');\n\t\t}\n\n\t\tconst { multisig } = parsed;\n\n\t\tlet signatureWeight = 0;\n\n\t\tif (\n\t\t\t!bytesEqual(\n\t\t\t\tbcs.MultiSigPublicKey.serialize(this.multisigPublicKey).toBytes(),\n\t\t\t\tbcs.MultiSigPublicKey.serialize(multisig.multisig_pk).toBytes(),\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const { publicKey, weight, signature } of parsePartialSignatures(multisig)) {\n\t\t\tif (!(await publicKey.verify(message, signature))) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tsignatureWeight += weight;\n\t\t}\n\n\t\treturn signatureWeight >= this.multisigPublicKey.threshold;\n\t}\n\n\t/**\n\t * Combines multiple partial signatures into a single multisig, ensuring that each public key signs only once\n\t * and that all the public keys involved are known and valid, and then serializes multisig into the standard format\n\t */\n\tcombinePartialSignatures(signatures: string[]): string {\n\t\tif (signatures.length > MAX_SIGNER_IN_MULTISIG) {\n\t\t\tthrow new Error(`Max number of signatures in a multisig is ${MAX_SIGNER_IN_MULTISIG}`);\n\t\t}\n\n\t\tlet bitmap = 0;\n\t\tconst compressedSignatures: CompressedSignature[] = new Array(signatures.length);\n\n\t\tfor (let i = 0; i < signatures.length; i++) {\n\t\t\tconst parsed = parseSerializedSignature(signatures[i]);\n\t\t\tif (parsed.signatureScheme === 'MultiSig') {\n\t\t\t\tthrow new Error('MultiSig is not supported inside MultiSig');\n\t\t\t}\n\n\t\t\tlet publicKey;\n\t\t\tif (parsed.signatureScheme === 'ZkLogin') {\n\t\t\t\tpublicKey = toZkLoginPublicIdentifier(\n\t\t\t\t\tparsed.zkLogin?.addressSeed,\n\t\t\t\t\tparsed.zkLogin?.iss,\n\t\t\t\t).toRawBytes();\n\t\t\t} else {\n\t\t\t\tpublicKey = parsed.publicKey;\n\t\t\t}\n\n\t\t\tcompressedSignatures[i] = {\n\t\t\t\t[parsed.signatureScheme]: Array.from(parsed.signature.map((x: number) => Number(x))),\n\t\t\t} as CompressedSignature;\n\n\t\t\tlet publicKeyIndex;\n\t\t\tfor (let j = 0; j < this.publicKeys.length; j++) {\n\t\t\t\tif (bytesEqual(publicKey, this.publicKeys[j].publicKey.toRawBytes())) {\n\t\t\t\t\tif (bitmap & (1 << j)) {\n\t\t\t\t\t\tthrow new Error('Received multiple signatures from the same public key');\n\t\t\t\t\t}\n\n\t\t\t\t\tpublicKeyIndex = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (publicKeyIndex === undefined) {\n\t\t\t\tthrow new Error('Received signature from unknown public key');\n\t\t\t}\n\n\t\t\tbitmap |= 1 << publicKeyIndex;\n\t\t}\n\n\t\tconst multisig: MultiSigStruct = {\n\t\t\tsigs: compressedSignatures,\n\t\t\tbitmap,\n\t\t\tmultisig_pk: this.multisigPublicKey,\n\t\t};\n\t\tconst bytes = bcs.MultiSig.serialize(multisig, { maxSize: 8192 }).toBytes();\n\t\tconst tmp = new Uint8Array(bytes.length + 1);\n\t\ttmp.set([SIGNATURE_SCHEME_TO_FLAG['MultiSig']]);\n\t\ttmp.set(bytes, 1);\n\t\treturn toBase64(tmp);\n\t}\n}\n\n/**\n * Parse multisig structure into an array of individual signatures: signature scheme, the actual individual signature, public key and its weight.\n */\nexport function parsePartialSignatures(\n\tmultisig: MultiSigStruct,\n\toptions: { client?: ZkLoginCompatibleClient } = {},\n): ParsedPartialMultiSigSignature[] {\n\tconst res: ParsedPartialMultiSigSignature[] = new Array(multisig.sigs.length);\n\tfor (let i = 0; i < multisig.sigs.length; i++) {\n\t\tconst [signatureScheme, signature] = Object.entries(multisig.sigs[i]).filter(\n\t\t\t([name]) => name !== '$kind',\n\t\t)[0] as [SignatureScheme, number[]];\n\t\tconst pkIndex = asIndices(multisig.bitmap).at(i)!;\n\t\tconst pair = multisig.multisig_pk.pk_map[pkIndex];\n\t\tconst pkBytes = Uint8Array.from(Object.values(pair.pubKey)[0]);\n\n\t\tif (signatureScheme === 'MultiSig') {\n\t\t\tthrow new Error('MultiSig is not supported inside MultiSig');\n\t\t}\n\n\t\tconst publicKey = publicKeyFromRawBytes(signatureScheme, pkBytes, options);\n\n\t\tres[i] = {\n\t\t\tsignatureScheme,\n\t\t\tsignature: Uint8Array.from(signature),\n\t\t\tpublicKey: publicKey,\n\t\t\tweight: pair.weight,\n\t\t};\n\t}\n\treturn res;\n}\n\nfunction asIndices(bitmap: number): Uint8Array {\n\tif (bitmap < 0 || bitmap > 1024) {\n\t\tthrow new Error('Invalid bitmap');\n\t}\n\tconst res: number[] = [];\n\tfor (let i = 0; i < 10; i++) {\n\t\tif ((bitmap & (1 << i)) !== 0) {\n\t\t\tres.push(i);\n\t\t}\n\t}\n\treturn Uint8Array.from(res);\n}\n"],
5
- "mappings": "AAGA,SAAS,YAAY,gBAAgB;AACrC,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAE3B,SAAS,WAAW;AAEp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';\nimport { blake2b } from '@noble/hashes/blake2b';\nimport { bytesToHex } from '@noble/hashes/utils';\n\nimport { bcs } from '../bcs/index.js';\nimport type { Signer } from '../cryptography/keypair.js';\nimport { bytesEqual, PublicKey } from '../cryptography/publickey.js';\nimport {\n\tSIGNATURE_FLAG_TO_SCHEME,\n\tSIGNATURE_SCHEME_TO_FLAG,\n} from '../cryptography/signature-scheme.js';\nimport type { SignatureFlag, SignatureScheme } from '../cryptography/signature-scheme.js';\nimport { parseSerializedSignature } from '../cryptography/signature.js';\nimport { normalizeSuiAddress } from '../utils/sui-types.js';\n// eslint-disable-next-line import/no-cycle\nimport { publicKeyFromRawBytes } from '../verify/index.js';\nimport type { ZkLoginCompatibleClient } from '../zklogin/publickey.js';\nimport { toZkLoginPublicIdentifier } from '../zklogin/publickey.js';\nimport { MultiSigSigner } from './signer.js';\n\ntype CompressedSignature =\n\t| { ED25519: Uint8Array }\n\t| { Secp256k1: Uint8Array }\n\t| { Secp256r1: Uint8Array }\n\t| { ZkLogin: Uint8Array }\n\t| { Passkey: Uint8Array };\n\ntype PublicKeyEnum =\n\t| { ED25519: Uint8Array }\n\t| { Secp256k1: Uint8Array }\n\t| { Secp256r1: Uint8Array }\n\t| { ZkLogin: Uint8Array }\n\t| { Passkey: Uint8Array };\n\ntype PubkeyEnumWeightPair = {\n\tpubKey: PublicKeyEnum;\n\tweight: number;\n};\n\ntype MultiSigPublicKeyStruct = {\n\tpk_map: PubkeyEnumWeightPair[];\n\tthreshold: number;\n};\n\nexport type MultiSigStruct = {\n\tsigs: CompressedSignature[];\n\tbitmap: number;\n\tmultisig_pk: MultiSigPublicKeyStruct;\n};\n\ntype ParsedPartialMultiSigSignature = {\n\tsignatureScheme: SignatureScheme;\n\tsignature: Uint8Array;\n\tpublicKey: PublicKey;\n\tweight: number;\n};\n\nexport const MAX_SIGNER_IN_MULTISIG = 10;\nexport const MIN_SIGNER_IN_MULTISIG = 1;\n/**\n * A MultiSig public key\n */\nexport class MultiSigPublicKey extends PublicKey {\n\tprivate rawBytes: Uint8Array<ArrayBuffer>;\n\tprivate multisigPublicKey: MultiSigPublicKeyStruct;\n\tprivate publicKeys: {\n\t\tweight: number;\n\t\tpublicKey: PublicKey;\n\t}[];\n\t/**\n\t * Create a new MultiSigPublicKey object\n\t */\n\tconstructor(\n\t\t/**\n\t\t * MultiSig public key as buffer or base-64 encoded string\n\t\t */\n\t\tvalue: string | Uint8Array | MultiSigPublicKeyStruct,\n\t\toptions: { client?: ZkLoginCompatibleClient } = {},\n\t) {\n\t\tsuper();\n\n\t\tif (typeof value === 'string') {\n\t\t\tthis.rawBytes = fromBase64(value);\n\n\t\t\tthis.multisigPublicKey = bcs.MultiSigPublicKey.parse(this.rawBytes);\n\t\t} else if (value instanceof Uint8Array) {\n\t\t\tthis.rawBytes = value as Uint8Array<ArrayBuffer>;\n\t\t\tthis.multisigPublicKey = bcs.MultiSigPublicKey.parse(this.rawBytes);\n\t\t} else {\n\t\t\tthis.multisigPublicKey = value;\n\t\t\tthis.rawBytes = bcs.MultiSigPublicKey.serialize(value).toBytes();\n\t\t}\n\t\tif (this.multisigPublicKey.threshold < 1) {\n\t\t\tthrow new Error('Invalid threshold');\n\t\t}\n\n\t\tconst seenPublicKeys = new Set<string>();\n\n\t\tthis.publicKeys = this.multisigPublicKey.pk_map.map(({ pubKey, weight }) => {\n\t\t\tconst [scheme, bytes] = Object.entries(pubKey).filter(([name]) => name !== '$kind')[0] as [\n\t\t\t\tSignatureScheme,\n\t\t\t\tUint8Array,\n\t\t\t];\n\t\t\tconst publicKeyStr = Uint8Array.from(bytes).toString();\n\n\t\t\tif (seenPublicKeys.has(publicKeyStr)) {\n\t\t\t\tthrow new Error(`Multisig does not support duplicate public keys`);\n\t\t\t}\n\t\t\tseenPublicKeys.add(publicKeyStr);\n\n\t\t\tif (weight < 1) {\n\t\t\t\tthrow new Error(`Invalid weight`);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tpublicKey: publicKeyFromRawBytes(scheme, Uint8Array.from(bytes), options),\n\t\t\t\tweight,\n\t\t\t};\n\t\t});\n\n\t\tconst totalWeight = this.publicKeys.reduce((sum, { weight }) => sum + weight, 0);\n\n\t\tif (this.multisigPublicKey.threshold > totalWeight) {\n\t\t\tthrow new Error(`Unreachable threshold`);\n\t\t}\n\n\t\tif (this.publicKeys.length > MAX_SIGNER_IN_MULTISIG) {\n\t\t\tthrow new Error(`Max number of signers in a multisig is ${MAX_SIGNER_IN_MULTISIG}`);\n\t\t}\n\n\t\tif (this.publicKeys.length < MIN_SIGNER_IN_MULTISIG) {\n\t\t\tthrow new Error(`Min number of signers in a multisig is ${MIN_SIGNER_IN_MULTISIG}`);\n\t\t}\n\t}\n\t/**\n\t * \tA static method to create a new MultiSig publickey instance from a set of public keys and their associated weights pairs and threshold.\n\t */\n\n\tstatic fromPublicKeys({\n\t\tthreshold,\n\t\tpublicKeys,\n\t}: {\n\t\tthreshold: number;\n\t\tpublicKeys: { publicKey: PublicKey; weight: number }[];\n\t}) {\n\t\treturn new MultiSigPublicKey({\n\t\t\tpk_map: publicKeys.map(({ publicKey, weight }) => {\n\t\t\t\tconst scheme = SIGNATURE_FLAG_TO_SCHEME[publicKey.flag() as SignatureFlag];\n\n\t\t\t\treturn {\n\t\t\t\t\tpubKey: { [scheme]: publicKey.toRawBytes() } as PublicKeyEnum,\n\t\t\t\t\tweight,\n\t\t\t\t};\n\t\t\t}),\n\t\t\tthreshold,\n\t\t});\n\t}\n\n\t/**\n\t * Checks if two MultiSig public keys are equal\n\t */\n\toverride equals(publicKey: MultiSigPublicKey): boolean {\n\t\treturn super.equals(publicKey);\n\t}\n\n\t/**\n\t * Return the byte array representation of the MultiSig public key\n\t */\n\ttoRawBytes(): Uint8Array<ArrayBuffer> {\n\t\treturn this.rawBytes;\n\t}\n\n\tgetPublicKeys() {\n\t\treturn this.publicKeys;\n\t}\n\n\tgetThreshold() {\n\t\treturn this.multisigPublicKey.threshold;\n\t}\n\n\tgetSigner(...signers: [signer: Signer]) {\n\t\treturn new MultiSigSigner(this, signers);\n\t}\n\n\t/**\n\t * Return the Sui address associated with this MultiSig public key\n\t */\n\toverride toSuiAddress(): string {\n\t\t// max length = 1 flag byte + (max pk size + max weight size (u8)) * max signer size + 2 threshold bytes (u16)\n\t\tconst maxLength = 1 + (64 + 1) * MAX_SIGNER_IN_MULTISIG + 2;\n\t\tconst tmp = new Uint8Array(maxLength);\n\t\ttmp.set([SIGNATURE_SCHEME_TO_FLAG['MultiSig']]);\n\n\t\ttmp.set(bcs.u16().serialize(this.multisigPublicKey.threshold).toBytes(), 1);\n\t\t// The initial value 3 ensures that following data will be after the flag byte and threshold bytes\n\t\tlet i = 3;\n\t\tfor (const { publicKey, weight } of this.publicKeys) {\n\t\t\tconst bytes = publicKey.toSuiBytes();\n\t\t\ttmp.set(bytes, i);\n\t\t\ti += bytes.length;\n\t\t\ttmp.set([weight], i++);\n\t\t}\n\t\treturn normalizeSuiAddress(bytesToHex(blake2b(tmp.slice(0, i), { dkLen: 32 })));\n\t}\n\n\t/**\n\t * Return the Sui address associated with this MultiSig public key\n\t */\n\tflag(): number {\n\t\treturn SIGNATURE_SCHEME_TO_FLAG['MultiSig'];\n\t}\n\n\t/**\n\t * Verifies that the signature is valid for for the provided message\n\t */\n\tasync verify(message: Uint8Array, multisigSignature: string): Promise<boolean> {\n\t\t// Multisig verification only supports serialized signature\n\t\tconst parsed = parseSerializedSignature(multisigSignature);\n\n\t\tif (parsed.signatureScheme !== 'MultiSig') {\n\t\t\tthrow new Error('Invalid signature scheme');\n\t\t}\n\n\t\tconst { multisig } = parsed;\n\n\t\tlet signatureWeight = 0;\n\n\t\tif (\n\t\t\t!bytesEqual(\n\t\t\t\tbcs.MultiSigPublicKey.serialize(this.multisigPublicKey).toBytes(),\n\t\t\t\tbcs.MultiSigPublicKey.serialize(multisig.multisig_pk).toBytes(),\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const { publicKey, weight, signature } of parsePartialSignatures(multisig)) {\n\t\t\tif (!(await publicKey.verify(message, signature))) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tsignatureWeight += weight;\n\t\t}\n\n\t\treturn signatureWeight >= this.multisigPublicKey.threshold;\n\t}\n\n\t/**\n\t * Combines multiple partial signatures into a single multisig, ensuring that each public key signs only once\n\t * and that all the public keys involved are known and valid, and then serializes multisig into the standard format\n\t */\n\tcombinePartialSignatures(signatures: string[]): string {\n\t\tif (signatures.length > MAX_SIGNER_IN_MULTISIG) {\n\t\t\tthrow new Error(`Max number of signatures in a multisig is ${MAX_SIGNER_IN_MULTISIG}`);\n\t\t}\n\n\t\tlet bitmap = 0;\n\t\tconst compressedSignatures: CompressedSignature[] = new Array(signatures.length);\n\n\t\tfor (let i = 0; i < signatures.length; i++) {\n\t\t\tconst parsed = parseSerializedSignature(signatures[i]);\n\t\t\tif (parsed.signatureScheme === 'MultiSig') {\n\t\t\t\tthrow new Error('MultiSig is not supported inside MultiSig');\n\t\t\t}\n\n\t\t\tlet publicKey;\n\t\t\tif (parsed.signatureScheme === 'ZkLogin') {\n\t\t\t\tpublicKey = toZkLoginPublicIdentifier(\n\t\t\t\t\tparsed.zkLogin?.addressSeed,\n\t\t\t\t\tparsed.zkLogin?.iss,\n\t\t\t\t).toRawBytes();\n\t\t\t} else {\n\t\t\t\tpublicKey = parsed.publicKey;\n\t\t\t}\n\n\t\t\tcompressedSignatures[i] = {\n\t\t\t\t[parsed.signatureScheme]: parsed.signature,\n\t\t\t} as CompressedSignature;\n\n\t\t\tlet publicKeyIndex;\n\t\t\tfor (let j = 0; j < this.publicKeys.length; j++) {\n\t\t\t\tif (bytesEqual(publicKey, this.publicKeys[j].publicKey.toRawBytes())) {\n\t\t\t\t\tif (bitmap & (1 << j)) {\n\t\t\t\t\t\tthrow new Error('Received multiple signatures from the same public key');\n\t\t\t\t\t}\n\n\t\t\t\t\tpublicKeyIndex = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (publicKeyIndex === undefined) {\n\t\t\t\tthrow new Error('Received signature from unknown public key');\n\t\t\t}\n\n\t\t\tbitmap |= 1 << publicKeyIndex;\n\t\t}\n\n\t\tconst multisig: MultiSigStruct = {\n\t\t\tsigs: compressedSignatures,\n\t\t\tbitmap,\n\t\t\tmultisig_pk: this.multisigPublicKey,\n\t\t};\n\t\tconst bytes = bcs.MultiSig.serialize(multisig, { maxSize: 8192 }).toBytes();\n\t\tconst tmp = new Uint8Array(bytes.length + 1);\n\t\ttmp.set([SIGNATURE_SCHEME_TO_FLAG['MultiSig']]);\n\t\ttmp.set(bytes, 1);\n\t\treturn toBase64(tmp);\n\t}\n}\n\n/**\n * Parse multisig structure into an array of individual signatures: signature scheme, the actual individual signature, public key and its weight.\n */\nexport function parsePartialSignatures(\n\tmultisig: MultiSigStruct,\n\toptions: { client?: ZkLoginCompatibleClient } = {},\n): ParsedPartialMultiSigSignature[] {\n\tconst res: ParsedPartialMultiSigSignature[] = new Array(multisig.sigs.length);\n\tfor (let i = 0; i < multisig.sigs.length; i++) {\n\t\tconst [signatureScheme, signature] = Object.entries(multisig.sigs[i]).filter(\n\t\t\t([name]) => name !== '$kind',\n\t\t)[0] as [SignatureScheme, Uint8Array];\n\t\tconst pkIndex = asIndices(multisig.bitmap).at(i)!;\n\t\tconst pair = multisig.multisig_pk.pk_map[pkIndex];\n\t\tconst pkBytes = Uint8Array.from(Object.values(pair.pubKey)[0]);\n\n\t\tif (signatureScheme === 'MultiSig') {\n\t\t\tthrow new Error('MultiSig is not supported inside MultiSig');\n\t\t}\n\n\t\tconst publicKey = publicKeyFromRawBytes(signatureScheme, pkBytes, options);\n\n\t\tres[i] = {\n\t\t\tsignatureScheme,\n\t\t\tsignature: Uint8Array.from(signature),\n\t\t\tpublicKey: publicKey,\n\t\t\tweight: pair.weight,\n\t\t};\n\t}\n\treturn res;\n}\n\nfunction asIndices(bitmap: number): Uint8Array {\n\tif (bitmap < 0 || bitmap > 1024) {\n\t\tth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C9B,UAAI,KAAK,CAAC;AAAA,IACX;AAAA,EACD;AACA,SAAO,WAAW,KAAK,GAAG;AAC3B;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,5 @@
1
1
  import type { SerializedBcs } from '@mysten/bcs';
2
2
  import type { InferInput } from 'valibot';
3
- import type { SuiClient } from '../client/index.js';
4
3
  import type { SignatureWithBytes, Signer } from '../cryptography/index.js';
5
4
  import type { TransactionArgument } from './Commands.js';
6
5
  import type { CallArg, Command, Argument, ObjectRef } from './data/internal.js';
@@ -9,6 +8,7 @@ import { Inputs } from './Inputs.js';
9
8
  import type { BuildTransactionOptions, SerializeTransactionOptions, TransactionPlugin } from './resolve.js';
10
9
  import { createObjectMethods } from './object.js';
11
10
  import { createPure } from './pure.js';
11
+ import type { ClientWithCoreApi } from '../experimental/core.js';
12
12
  export type TransactionObjectArgument = Exclude<InferInput<typeof ArgumentSchema>, {
13
13
  Input: unknown;
14
14
  type?: 'pure';
@@ -703,7 +703,7 @@ export declare class Transaction {
703
703
  build(options?: BuildTransactionOptions): Promise<Uint8Array<ArrayBuffer>>;
704
704
  /** Derive transaction digest */
705
705
  getDigest(options?: {
706
- client?: SuiClient;
706
+ client?: ClientWithCoreApi;
707
707
  }): Promise<string>;
708
708
  prepareForSerialization(options: SerializeTransactionOptions): Promise<void>;
709
709
  }