wowok 2.1.13 → 2.1.15

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 (397) hide show
  1. package/dist/cjs/bcs/bcs.js +160 -164
  2. package/dist/cjs/bcs/bcs.js.map +1 -1
  3. package/dist/cjs/bcs/effects.js +109 -112
  4. package/dist/cjs/bcs/effects.js.map +1 -1
  5. package/dist/cjs/bcs/index.js +49 -58
  6. package/dist/cjs/bcs/index.js.map +1 -1
  7. package/dist/cjs/bcs/pure.js +14 -17
  8. package/dist/cjs/bcs/pure.js.map +1 -1
  9. package/dist/cjs/bcs/type-tag-serializer.js +6 -11
  10. package/dist/cjs/bcs/type-tag-serializer.js.map +1 -1
  11. package/dist/cjs/bcs/types.js +1 -4
  12. package/dist/cjs/bcs/types.js.map +1 -1
  13. package/dist/cjs/client/index.js +4 -15
  14. package/dist/cjs/client/index.js.map +1 -1
  15. package/dist/cjs/client/network.js +3 -7
  16. package/dist/cjs/client/network.js.map +1 -1
  17. package/dist/cjs/cryptography/index.js +6 -27
  18. package/dist/cjs/cryptography/index.js.map +1 -1
  19. package/dist/cjs/cryptography/intent.js +4 -7
  20. package/dist/cjs/cryptography/intent.js.map +1 -1
  21. package/dist/cjs/cryptography/keypair.js +26 -33
  22. package/dist/cjs/cryptography/keypair.js.map +1 -1
  23. package/dist/cjs/cryptography/mnemonics.js +8 -14
  24. package/dist/cjs/cryptography/mnemonics.js.map +1 -1
  25. package/dist/cjs/cryptography/publickey.js +19 -25
  26. package/dist/cjs/cryptography/publickey.js.map +1 -1
  27. package/dist/cjs/cryptography/signature-scheme.js +3 -6
  28. package/dist/cjs/cryptography/signature-scheme.js.map +1 -1
  29. package/dist/cjs/cryptography/signature.js +14 -18
  30. package/dist/cjs/cryptography/signature.js.map +1 -1
  31. package/dist/cjs/experimental/cache.js +1 -5
  32. package/dist/cjs/experimental/cache.js.map +1 -1
  33. package/dist/cjs/experimental/client.js +3 -7
  34. package/dist/cjs/experimental/client.js.map +1 -1
  35. package/dist/cjs/experimental/core.js +11 -15
  36. package/dist/cjs/experimental/core.js.map +1 -1
  37. package/dist/cjs/experimental/errors.js +2 -7
  38. package/dist/cjs/experimental/errors.js.map +1 -1
  39. package/dist/cjs/experimental/index.js +5 -12
  40. package/dist/cjs/experimental/index.js.map +1 -1
  41. package/dist/cjs/experimental/persistent-storage.js +30 -36
  42. package/dist/cjs/experimental/persistent-storage.js.map +1 -1
  43. package/dist/cjs/experimental/persistent-storage.test.js +18 -20
  44. package/dist/cjs/experimental/persistent-storage.test.js.map +1 -1
  45. package/dist/cjs/experimental/transports/utils.js +6 -10
  46. package/dist/cjs/experimental/transports/utils.js.map +1 -1
  47. package/dist/cjs/experimental/types.js +1 -2
  48. package/dist/cjs/experimental/types.js.map +1 -1
  49. package/dist/cjs/faucet/faucet.js +6 -15
  50. package/dist/cjs/faucet/faucet.js.map +1 -1
  51. package/dist/cjs/faucet/index.js +1 -10
  52. package/dist/cjs/faucet/index.js.map +1 -1
  53. package/dist/cjs/grpc/client.js +20 -24
  54. package/dist/cjs/grpc/client.js.map +1 -1
  55. package/dist/cjs/grpc/core.js +65 -70
  56. package/dist/cjs/grpc/core.js.map +1 -1
  57. package/dist/cjs/grpc/index.js +2 -7
  58. package/dist/cjs/grpc/index.js.map +1 -1
  59. package/dist/cjs/grpc/proto/google/protobuf/any.js +10 -13
  60. package/dist/cjs/grpc/proto/google/protobuf/any.js.map +1 -1
  61. package/dist/cjs/grpc/proto/google/protobuf/duration.js +8 -11
  62. package/dist/cjs/grpc/proto/google/protobuf/duration.js.map +1 -1
  63. package/dist/cjs/grpc/proto/google/protobuf/empty.js +3 -6
  64. package/dist/cjs/grpc/proto/google/protobuf/empty.js.map +1 -1
  65. package/dist/cjs/grpc/proto/google/protobuf/field_mask.js +7 -10
  66. package/dist/cjs/grpc/proto/google/protobuf/field_mask.js.map +1 -1
  67. package/dist/cjs/grpc/proto/google/protobuf/struct.js +25 -28
  68. package/dist/cjs/grpc/proto/google/protobuf/struct.js.map +1 -1
  69. package/dist/cjs/grpc/proto/google/protobuf/timestamp.js +11 -14
  70. package/dist/cjs/grpc/proto/google/protobuf/timestamp.js.map +1 -1
  71. package/dist/cjs/grpc/proto/google/rpc/error_details.js +36 -39
  72. package/dist/cjs/grpc/proto/google/rpc/error_details.js.map +1 -1
  73. package/dist/cjs/grpc/proto/google/rpc/status.js +5 -8
  74. package/dist/cjs/grpc/proto/google/rpc/status.js.map +1 -1
  75. package/dist/cjs/grpc/proto/sui/rpc/v2/argument.js +5 -8
  76. package/dist/cjs/grpc/proto/sui/rpc/v2/argument.js.map +1 -1
  77. package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.js +3 -6
  78. package/dist/cjs/grpc/proto/sui/rpc/v2/balance_change.js.map +1 -1
  79. package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.js +3 -6
  80. package/dist/cjs/grpc/proto/sui/rpc/v2/bcs.js.map +1 -1
  81. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.js +13 -16
  82. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint.js.map +1 -1
  83. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.js +10 -13
  84. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_contents.js.map +1 -1
  85. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.js +20 -23
  86. package/dist/cjs/grpc/proto/sui/rpc/v2/checkpoint_summary.js.map +1 -1
  87. package/dist/cjs/grpc/proto/sui/rpc/v2/effects.js +29 -32
  88. package/dist/cjs/grpc/proto/sui/rpc/v2/effects.js.map +1 -1
  89. package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.js +12 -15
  90. package/dist/cjs/grpc/proto/sui/rpc/v2/epoch.js.map +1 -1
  91. package/dist/cjs/grpc/proto/sui/rpc/v2/error_reason.js +2 -5
  92. package/dist/cjs/grpc/proto/sui/rpc/v2/error_reason.js.map +1 -1
  93. package/dist/cjs/grpc/proto/sui/rpc/v2/event.js +11 -14
  94. package/dist/cjs/grpc/proto/sui/rpc/v2/event.js.map +1 -1
  95. package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.js +17 -20
  96. package/dist/cjs/grpc/proto/sui/rpc/v2/executed_transaction.js.map +1 -1
  97. package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.js +45 -48
  98. package/dist/cjs/grpc/proto/sui/rpc/v2/execution_status.js.map +1 -1
  99. package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.js +3 -6
  100. package/dist/cjs/grpc/proto/sui/rpc/v2/gas_cost_summary.js.map +1 -1
  101. package/dist/cjs/grpc/proto/sui/rpc/v2/input.js +7 -10
  102. package/dist/cjs/grpc/proto/sui/rpc/v2/input.js.map +1 -1
  103. package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.js +5 -8
  104. package/dist/cjs/grpc/proto/sui/rpc/v2/jwk.js.map +1 -1
  105. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.js +13 -17
  106. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.client.js.map +1 -1
  107. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.js +73 -76
  108. package/dist/cjs/grpc/proto/sui/rpc/v2/ledger_service.js.map +1 -1
  109. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.js +48 -51
  110. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package.js.map +1 -1
  111. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.js +10 -14
  112. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.client.js.map +1 -1
  113. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.js +36 -39
  114. package/dist/cjs/grpc/proto/sui/rpc/v2/move_package_service.js.map +1 -1
  115. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.js +8 -12
  116. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.client.js.map +1 -1
  117. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.js +21 -24
  118. package/dist/cjs/grpc/proto/sui/rpc/v2/name_service.js.map +1 -1
  119. package/dist/cjs/grpc/proto/sui/rpc/v2/object.js +15 -18
  120. package/dist/cjs/grpc/proto/sui/rpc/v2/object.js.map +1 -1
  121. package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.js +3 -6
  122. package/dist/cjs/grpc/proto/sui/rpc/v2/object_reference.js.map +1 -1
  123. package/dist/cjs/grpc/proto/sui/rpc/v2/owner.js +5 -8
  124. package/dist/cjs/grpc/proto/sui/rpc/v2/owner.js.map +1 -1
  125. package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.js +3 -6
  126. package/dist/cjs/grpc/proto/sui/rpc/v2/protocol_config.js.map +1 -1
  127. package/dist/cjs/grpc/proto/sui/rpc/v2/signature.js +67 -70
  128. package/dist/cjs/grpc/proto/sui/rpc/v2/signature.js.map +1 -1
  129. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_scheme.js +2 -5
  130. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_scheme.js.map +1 -1
  131. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.js +7 -11
  132. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.client.js.map +1 -1
  133. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.js +15 -18
  134. package/dist/cjs/grpc/proto/sui/rpc/v2/signature_verification_service.js.map +1 -1
  135. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.js +11 -15
  136. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.client.js.map +1 -1
  137. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.js +67 -70
  138. package/dist/cjs/grpc/proto/sui/rpc/v2/state_service.js.map +1 -1
  139. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.js +7 -11
  140. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.client.js.map +1 -1
  141. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.js +13 -16
  142. package/dist/cjs/grpc/proto/sui/rpc/v2/subscription_service.js.map +1 -1
  143. package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.js +38 -41
  144. package/dist/cjs/grpc/proto/sui/rpc/v2/system_state.js.map +1 -1
  145. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.js +124 -127
  146. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction.js.map +1 -1
  147. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js +8 -12
  148. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.client.js.map +1 -1
  149. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.js +41 -44
  150. package/dist/cjs/grpc/proto/sui/rpc/v2/transaction_execution_service.js.map +1 -1
  151. package/dist/cjs/index.js +22 -87
  152. package/dist/cjs/index.js.map +1 -1
  153. package/dist/cjs/jsonRpc/client.js +29 -34
  154. package/dist/cjs/jsonRpc/client.js.map +1 -1
  155. package/dist/cjs/jsonRpc/core.js +29 -33
  156. package/dist/cjs/jsonRpc/core.js.map +1 -1
  157. package/dist/cjs/jsonRpc/errors.js +3 -9
  158. package/dist/cjs/jsonRpc/errors.js.map +1 -1
  159. package/dist/cjs/jsonRpc/http-transport.js +9 -13
  160. package/dist/cjs/jsonRpc/http-transport.js.map +1 -1
  161. package/dist/cjs/jsonRpc/index.js +3 -12
  162. package/dist/cjs/jsonRpc/index.js.map +1 -1
  163. package/dist/cjs/jsonRpc/json-rpc-resolver.js +19 -22
  164. package/dist/cjs/jsonRpc/json-rpc-resolver.js.map +1 -1
  165. package/dist/cjs/jsonRpc/rpc-websocket-client.js +5 -9
  166. package/dist/cjs/jsonRpc/rpc-websocket-client.js.map +1 -1
  167. package/dist/cjs/jsonRpc/types/chain.js +1 -2
  168. package/dist/cjs/jsonRpc/types/chain.js.map +1 -1
  169. package/dist/cjs/jsonRpc/types/changes.js +1 -2
  170. package/dist/cjs/jsonRpc/types/changes.js.map +1 -1
  171. package/dist/cjs/jsonRpc/types/coins.js +1 -2
  172. package/dist/cjs/jsonRpc/types/coins.js.map +1 -1
  173. package/dist/cjs/jsonRpc/types/common.js +1 -2
  174. package/dist/cjs/jsonRpc/types/common.js.map +1 -1
  175. package/dist/cjs/jsonRpc/types/generated.js +1 -2
  176. package/dist/cjs/jsonRpc/types/generated.js.map +1 -1
  177. package/dist/cjs/jsonRpc/types/index.js +1 -2
  178. package/dist/cjs/jsonRpc/types/index.js.map +1 -1
  179. package/dist/cjs/jsonRpc/types/params.js +1 -2
  180. package/dist/cjs/jsonRpc/types/params.js.map +1 -1
  181. package/dist/cjs/keypairs/ed25519/ed25519-hd-key.js +7 -11
  182. package/dist/cjs/keypairs/ed25519/ed25519-hd-key.js.map +1 -1
  183. package/dist/cjs/keypairs/ed25519/index.js +2 -8
  184. package/dist/cjs/keypairs/ed25519/index.js.map +1 -1
  185. package/dist/cjs/keypairs/ed25519/keypair.js +26 -30
  186. package/dist/cjs/keypairs/ed25519/keypair.js.map +1 -1
  187. package/dist/cjs/keypairs/ed25519/publickey.js +10 -14
  188. package/dist/cjs/keypairs/ed25519/publickey.js.map +1 -1
  189. package/dist/cjs/keypairs/index.js +4 -20
  190. package/dist/cjs/keypairs/index.js.map +1 -1
  191. package/dist/cjs/keypairs/passkey/index.js +2 -9
  192. package/dist/cjs/keypairs/passkey/index.js.map +1 -1
  193. package/dist/cjs/keypairs/passkey/keypair.js +29 -35
  194. package/dist/cjs/keypairs/passkey/keypair.js.map +1 -1
  195. package/dist/cjs/keypairs/passkey/publickey.js +35 -41
  196. package/dist/cjs/keypairs/passkey/publickey.js.map +1 -1
  197. package/dist/cjs/keypairs/passkey/types.js +1 -2
  198. package/dist/cjs/keypairs/passkey/types.js.map +1 -1
  199. package/dist/cjs/keypairs/secp256k1/index.js +2 -8
  200. package/dist/cjs/keypairs/secp256k1/index.js.map +1 -1
  201. package/dist/cjs/keypairs/secp256k1/keypair.js +25 -29
  202. package/dist/cjs/keypairs/secp256k1/keypair.js.map +1 -1
  203. package/dist/cjs/keypairs/secp256k1/publickey.js +11 -15
  204. package/dist/cjs/keypairs/secp256k1/publickey.js.map +1 -1
  205. package/dist/cjs/keypairs/secp256r1/index.js +2 -8
  206. package/dist/cjs/keypairs/secp256r1/index.js.map +1 -1
  207. package/dist/cjs/keypairs/secp256r1/keypair.js +25 -29
  208. package/dist/cjs/keypairs/secp256r1/keypair.js.map +1 -1
  209. package/dist/cjs/keypairs/secp256r1/publickey.js +12 -16
  210. package/dist/cjs/keypairs/secp256r1/publickey.js.map +1 -1
  211. package/dist/cjs/multisig/index.js +2 -8
  212. package/dist/cjs/multisig/index.js.map +1 -1
  213. package/dist/cjs/multisig/publickey.js +40 -45
  214. package/dist/cjs/multisig/publickey.js.map +1 -1
  215. package/dist/cjs/multisig/signer.js +5 -9
  216. package/dist/cjs/multisig/signer.js.map +1 -1
  217. package/dist/cjs/transactions/Arguments.js +5 -8
  218. package/dist/cjs/transactions/Arguments.js.map +1 -1
  219. package/dist/cjs/transactions/Commands.js +21 -24
  220. package/dist/cjs/transactions/Commands.js.map +1 -1
  221. package/dist/cjs/transactions/Inputs.js +7 -10
  222. package/dist/cjs/transactions/Inputs.js.map +1 -1
  223. package/dist/cjs/transactions/ObjectCache.js +7 -13
  224. package/dist/cjs/transactions/ObjectCache.js.map +1 -1
  225. package/dist/cjs/transactions/Transaction.js +54 -59
  226. package/dist/cjs/transactions/Transaction.js.map +1 -1
  227. package/dist/cjs/transactions/TransactionData.js +27 -31
  228. package/dist/cjs/transactions/TransactionData.js.map +1 -1
  229. package/dist/cjs/transactions/__tests__/Transaction.test.js +71 -73
  230. package/dist/cjs/transactions/__tests__/Transaction.test.js.map +1 -1
  231. package/dist/cjs/transactions/__tests__/bcs.test.js +26 -28
  232. package/dist/cjs/transactions/__tests__/bcs.test.js.map +1 -1
  233. package/dist/cjs/transactions/data/internal.js +122 -126
  234. package/dist/cjs/transactions/data/internal.js.map +1 -1
  235. package/dist/cjs/transactions/data/v1.js +114 -119
  236. package/dist/cjs/transactions/data/v1.js.map +1 -1
  237. package/dist/cjs/transactions/data/v2.js +63 -66
  238. package/dist/cjs/transactions/data/v2.js.map +1 -1
  239. package/dist/cjs/transactions/executor/caching.js +7 -11
  240. package/dist/cjs/transactions/executor/caching.js.map +1 -1
  241. package/dist/cjs/transactions/executor/parallel.js +20 -24
  242. package/dist/cjs/transactions/executor/parallel.js.map +1 -1
  243. package/dist/cjs/transactions/executor/queue.js +2 -7
  244. package/dist/cjs/transactions/executor/queue.js.map +1 -1
  245. package/dist/cjs/transactions/executor/serial.js +11 -16
  246. package/dist/cjs/transactions/executor/serial.js.map +1 -1
  247. package/dist/cjs/transactions/hash.js +3 -6
  248. package/dist/cjs/transactions/hash.js.map +1 -1
  249. package/dist/cjs/transactions/index.js +12 -31
  250. package/dist/cjs/transactions/index.js.map +1 -1
  251. package/dist/cjs/transactions/intents/CoinWithBalance.js +21 -25
  252. package/dist/cjs/transactions/intents/CoinWithBalance.js.map +1 -1
  253. package/dist/cjs/transactions/object.js +4 -7
  254. package/dist/cjs/transactions/object.js.map +1 -1
  255. package/dist/cjs/transactions/plugins/NamedPackagesPlugin.js +2 -7
  256. package/dist/cjs/transactions/plugins/NamedPackagesPlugin.js.map +1 -1
  257. package/dist/cjs/transactions/pure.js +19 -22
  258. package/dist/cjs/transactions/pure.js.map +1 -1
  259. package/dist/cjs/transactions/resolve.js +10 -15
  260. package/dist/cjs/transactions/resolve.js.map +1 -1
  261. package/dist/cjs/transactions/serializer.js +34 -40
  262. package/dist/cjs/transactions/serializer.js.map +1 -1
  263. package/dist/cjs/transactions/utils.js +15 -23
  264. package/dist/cjs/transactions/utils.js.map +1 -1
  265. package/dist/cjs/utils/constants.js +18 -21
  266. package/dist/cjs/utils/constants.js.map +1 -1
  267. package/dist/cjs/utils/derived-objects.js +5 -8
  268. package/dist/cjs/utils/derived-objects.js.map +1 -1
  269. package/dist/cjs/utils/dynamic-fields.js +9 -12
  270. package/dist/cjs/utils/dynamic-fields.js.map +1 -1
  271. package/dist/cjs/utils/format.js +2 -6
  272. package/dist/cjs/utils/format.js.map +1 -1
  273. package/dist/cjs/utils/index.js +10 -46
  274. package/dist/cjs/utils/index.js.map +1 -1
  275. package/dist/cjs/utils/move-registry.js +5 -10
  276. package/dist/cjs/utils/move-registry.js.map +1 -1
  277. package/dist/cjs/utils/sui-types.js +15 -25
  278. package/dist/cjs/utils/sui-types.js.map +1 -1
  279. package/dist/cjs/utils/suins.js +2 -6
  280. package/dist/cjs/utils/suins.js.map +1 -1
  281. package/dist/cjs/verify/index.js +1 -9
  282. package/dist/cjs/verify/index.js.map +1 -1
  283. package/dist/cjs/verify/verify.js +21 -28
  284. package/dist/cjs/verify/verify.js.map +1 -1
  285. package/dist/cjs/version.js +2 -5
  286. package/dist/cjs/version.js.map +1 -1
  287. package/dist/cjs/w/call/allocation.js +88 -99
  288. package/dist/cjs/w/call/allocation.js.map +1 -1
  289. package/dist/cjs/w/call/arb.js +49 -58
  290. package/dist/cjs/w/call/arb.js.map +1 -1
  291. package/dist/cjs/w/call/arbitration.js +380 -406
  292. package/dist/cjs/w/call/arbitration.js.map +1 -1
  293. package/dist/cjs/w/call/base.js +63 -73
  294. package/dist/cjs/w/call/base.js.map +1 -1
  295. package/dist/cjs/w/call/contact.js +111 -123
  296. package/dist/cjs/w/call/contact.js.map +1 -1
  297. package/dist/cjs/w/call/demand.js +221 -238
  298. package/dist/cjs/w/call/demand.js.map +1 -1
  299. package/dist/cjs/w/call/entity.js +58 -75
  300. package/dist/cjs/w/call/entity.js.map +1 -1
  301. package/dist/cjs/w/call/guard-ins.js +1191 -1196
  302. package/dist/cjs/w/call/guard-ins.js.map +1 -1
  303. package/dist/cjs/w/call/guard.js +265 -286
  304. package/dist/cjs/w/call/guard.js.map +1 -1
  305. package/dist/cjs/w/call/index.js +22 -66
  306. package/dist/cjs/w/call/index.js.map +1 -1
  307. package/dist/cjs/w/call/machine.js +351 -378
  308. package/dist/cjs/w/call/machine.js.map +1 -1
  309. package/dist/cjs/w/call/order.js +102 -113
  310. package/dist/cjs/w/call/order.js.map +1 -1
  311. package/dist/cjs/w/call/passport.js +53 -65
  312. package/dist/cjs/w/call/passport.js.map +1 -1
  313. package/dist/cjs/w/call/payment.js +41 -50
  314. package/dist/cjs/w/call/payment.js.map +1 -1
  315. package/dist/cjs/w/call/permission.js +233 -263
  316. package/dist/cjs/w/call/permission.js.map +1 -1
  317. package/dist/cjs/w/call/personal.js +38 -42
  318. package/dist/cjs/w/call/personal.js.map +1 -1
  319. package/dist/cjs/w/call/progress.js +222 -240
  320. package/dist/cjs/w/call/progress.js.map +1 -1
  321. package/dist/cjs/w/call/proof.js +23 -30
  322. package/dist/cjs/w/call/proof.js.map +1 -1
  323. package/dist/cjs/w/call/repository.js +283 -302
  324. package/dist/cjs/w/call/repository.js.map +1 -1
  325. package/dist/cjs/w/call/resource.js +27 -37
  326. package/dist/cjs/w/call/resource.js.map +1 -1
  327. package/dist/cjs/w/call/reward.js +227 -241
  328. package/dist/cjs/w/call/reward.js.map +1 -1
  329. package/dist/cjs/w/call/service.js +653 -694
  330. package/dist/cjs/w/call/service.js.map +1 -1
  331. package/dist/cjs/w/call/treasury.js +270 -289
  332. package/dist/cjs/w/call/treasury.js.map +1 -1
  333. package/dist/cjs/w/call/util.js +201 -208
  334. package/dist/cjs/w/call/util.js.map +1 -1
  335. package/dist/cjs/w/common.js +117 -168
  336. package/dist/cjs/w/common.js.map +1 -1
  337. package/dist/cjs/w/exception.js +18 -30
  338. package/dist/cjs/w/exception.js.map +1 -1
  339. package/dist/cjs/w/index.js +8 -24
  340. package/dist/cjs/w/index.js.map +1 -1
  341. package/dist/cjs/w/local/account.js +73 -77
  342. package/dist/cjs/w/local/account.js.map +1 -1
  343. package/dist/cjs/w/local/cache.js +5 -9
  344. package/dist/cjs/w/local/cache.js.map +1 -1
  345. package/dist/cjs/w/local/config.js +10 -14
  346. package/dist/cjs/w/local/config.js.map +1 -1
  347. package/dist/cjs/w/local/index.js +65 -98
  348. package/dist/cjs/w/local/index.js.map +1 -1
  349. package/dist/cjs/w/local/local.js +59 -65
  350. package/dist/cjs/w/local/local.js.map +1 -1
  351. package/dist/cjs/w/local/storage.js +13 -56
  352. package/dist/cjs/w/local/storage.js.map +1 -1
  353. package/dist/cjs/w/local/token.js +20 -24
  354. package/dist/cjs/w/local/token.js.map +1 -1
  355. package/dist/cjs/w/local/util.js +3 -39
  356. package/dist/cjs/w/local/util.js.map +1 -1
  357. package/dist/cjs/w/local/wip.js +22 -70
  358. package/dist/cjs/w/local/wip.js.map +1 -1
  359. package/dist/cjs/w/messenger/crypto.js +34 -57
  360. package/dist/cjs/w/messenger/crypto.js.map +1 -1
  361. package/dist/cjs/w/messenger/index.js +4 -31
  362. package/dist/cjs/w/messenger/index.js.map +1 -1
  363. package/dist/cjs/w/messenger/messenger-api.js +125 -174
  364. package/dist/cjs/w/messenger/messenger-api.js.map +1 -1
  365. package/dist/cjs/w/messenger/messenger-manager.js +49 -53
  366. package/dist/cjs/w/messenger/messenger-manager.js.map +1 -1
  367. package/dist/cjs/w/messenger/messenger.js +100 -137
  368. package/dist/cjs/w/messenger/messenger.js.map +1 -1
  369. package/dist/cjs/w/messenger/server.js +40 -44
  370. package/dist/cjs/w/messenger/server.js.map +1 -1
  371. package/dist/cjs/w/messenger/session.js +52 -56
  372. package/dist/cjs/w/messenger/session.js.map +1 -1
  373. package/dist/cjs/w/messenger/storage.js +13 -57
  374. package/dist/cjs/w/messenger/storage.js.map +1 -1
  375. package/dist/cjs/w/messenger/types.js +23 -27
  376. package/dist/cjs/w/messenger/types.js.map +1 -1
  377. package/dist/cjs/w/messenger/utils.js +1 -4
  378. package/dist/cjs/w/messenger/utils.js.map +1 -1
  379. package/dist/cjs/w/query/bult-in.js +22 -27
  380. package/dist/cjs/w/query/bult-in.js.map +1 -1
  381. package/dist/cjs/w/query/event.js +13 -18
  382. package/dist/cjs/w/query/event.js.map +1 -1
  383. package/dist/cjs/w/query/index.js +5 -21
  384. package/dist/cjs/w/query/index.js.map +1 -1
  385. package/dist/cjs/w/query/object.js +229 -266
  386. package/dist/cjs/w/query/object.js.map +1 -1
  387. package/dist/cjs/w/query/received.js +17 -21
  388. package/dist/cjs/w/query/received.js.map +1 -1
  389. package/dist/cjs/w/query/util.js +13 -17
  390. package/dist/cjs/w/query/util.js.map +1 -1
  391. package/dist/cjs/w/util.js +211 -225
  392. package/dist/cjs/w/util.js.map +1 -1
  393. package/dist/esm/experimental/persistent-storage.test.js +1 -1
  394. package/dist/esm/experimental/persistent-storage.test.js.map +1 -1
  395. package/package.json +7 -4
  396. package/scripts/download-prebuilds.js +213 -195
  397. package/scripts/install-better-sqlite3.js +8 -8
@@ -1,45 +1,20 @@
1
- "use strict";
2
1
  // Copyright (c) Wowok.
3
2
  // SPDX-License-Identifier: Apache-2.0
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.MAX_VOTING_GUARD_COUNT = exports.CallArbitration = void 0;
6
- exports.create = create;
7
- exports.newArbitration = newArbitration;
8
- exports.description_set = description_set;
9
- exports.location_set = location_set;
10
- exports.voting_guard_add = voting_guard_add;
11
- exports.voting_guard_remove = voting_guard_remove;
12
- exports.voting_guard_clear = voting_guard_clear;
13
- exports.usage_guard_set = usage_guard_set;
14
- exports.usage_guard_none = usage_guard_none;
15
- exports.pause = pause;
16
- exports.fee_set = fee_set;
17
- exports.dispute = dispute;
18
- exports.vote = vote;
19
- exports.arbitration = arbitration;
20
- exports.feedback = feedback;
21
- exports.confirm = confirm;
22
- exports.voting_deadline_change = voting_deadline_change;
23
- exports.reset = reset;
24
- exports.arb_withdraw = arb_withdraw;
25
- exports.fees_alloc = fees_alloc;
26
- exports.fees_transfer = fees_transfer;
27
- exports.um_set = um_set;
28
- const common_js_1 = require("../common.js");
29
- const exception_js_1 = require("../exception.js");
30
- const local_js_1 = require("../local/local.js");
31
- const object_js_1 = require("../query/object.js");
32
- const util_js_1 = require("../util.js");
33
- const base_js_1 = require("./base.js");
34
- const permission_js_1 = require("./permission.js");
35
- const sui_types_js_1 = require("../../utils/sui-types.js");
36
- const arb_js_1 = require("./arb.js");
37
- const arb_js_2 = require("./arb.js");
38
- const permission_js_2 = require("./permission.js");
39
- const received_js_1 = require("../query/received.js");
3
+ import { toTxObject, isValidDescription, MAX_DESCRIPTION_LENGTH, PackageAddress, isValidU8, isValidU64, GetObjectExisted, GetObject, IsValidArgType, isValidLongName, MAX_LONG_NAME_LENGTH, isValidU32, isValidArray, GetObjectDescription, arbitrationFn, } from "../common.js";
4
+ import { W_ERROR, WErrors } from "../exception.js";
5
+ import { LocalMark } from "../local/local.js";
6
+ import { ObjectType } from "../query/object.js";
7
+ import { owner_receive, parseObjectType, validObjects } from "../util.js";
8
+ import { CallBase, getCoinParam } from "./base.js";
9
+ import { BuiltinPermissionIndex, newPermission } from "./permission.js";
10
+ import { isValidWowAddress } from "../../utils/sui-types.js";
11
+ import { MAX_PROPOSITION_COUNT } from "./arb.js";
12
+ import { create as arbCreate } from "./arb.js";
13
+ import { create as permissionCreate } from "./permission.js";
14
+ import { query_received } from "../query/received.js";
40
15
  // ================================================
41
16
  // 数据操作类
42
- class CallArbitration extends base_js_1.CallBase {
17
+ export class CallArbitration extends CallBase {
43
18
  data;
44
19
  object_address = undefined;
45
20
  permission_address = undefined;
@@ -52,28 +27,28 @@ class CallArbitration extends base_js_1.CallBase {
52
27
  async prepare(env) {
53
28
  await super.prepare(env);
54
29
  if (!this.object_address) {
55
- this.object_address = await (0, common_js_1.GetObjectExisted)(this.data?.object);
30
+ this.object_address = await GetObjectExisted(this.data?.object);
56
31
  }
57
32
  if (this.object_address) {
58
- await this.update_content(env, object_js_1.ObjectType.Arbitration, this.object_address);
33
+ await this.update_content(env, ObjectType.Arbitration, this.object_address);
59
34
  if (!this.content)
60
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.object:" + this.object_address);
35
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.object:" + this.object_address);
61
36
  this.permission_address = this.content.permission;
62
- this.parameter_type = (0, util_js_1.parseObjectType)(this.content.type_raw, "arbitration::Arbitration");
37
+ this.parameter_type = parseObjectType(this.content.type_raw, "arbitration::Arbitration");
63
38
  if (!this.permission_address) {
64
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.object.permission is empty");
39
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.object.permission is empty");
65
40
  }
66
- if (!(0, common_js_1.IsValidArgType)(this.parameter_type)) {
67
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.IsValidArgType, "CallArbitration_Data.data.object.type_parameter is empty");
41
+ if (!IsValidArgType(this.parameter_type)) {
42
+ W_ERROR(WErrors.IsValidArgType, "CallArbitration_Data.data.object.type_parameter is empty");
68
43
  }
69
44
  }
70
45
  else {
71
- const n = (0, common_js_1.GetObject)(this.data.object);
72
- this.permission_address = await (0, common_js_1.GetObjectExisted)(n?.permission);
73
- this.new_permission_description = (0, common_js_1.GetObjectDescription)(n);
46
+ const n = GetObject(this.data.object);
47
+ this.permission_address = await GetObjectExisted(n?.permission);
48
+ this.new_permission_description = GetObjectDescription(n);
74
49
  this.parameter_type = n?.type_parameter;
75
- if (!(0, common_js_1.IsValidArgType)(this.parameter_type)) {
76
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.IsValidArgType, "CallArbitration_Data.data.object.type_parameter invalid");
50
+ if (!IsValidArgType(this.parameter_type)) {
51
+ W_ERROR(WErrors.IsValidArgType, "CallArbitration_Data.data.object.type_parameter invalid");
77
52
  }
78
53
  }
79
54
  }
@@ -93,11 +68,11 @@ class CallArbitration extends base_js_1.CallBase {
93
68
  };
94
69
  const obj = this.content;
95
70
  if (this.permission_address && !this.object_address) {
96
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_NEW);
71
+ add_perm(BuiltinPermissionIndex.ARBITRATION_NEW);
97
72
  }
98
73
  if (this.data?.dispute != null) {
99
74
  if (obj.bPaused) {
100
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "Arbitration is paused and cannot be disputed");
75
+ W_ERROR(WErrors.InvalidParam, "Arbitration is paused and cannot be disputed");
101
76
  }
102
77
  if (obj.usage_guard) {
103
78
  add_guard(obj.usage_guard);
@@ -106,75 +81,75 @@ class CallArbitration extends base_js_1.CallBase {
106
81
  if (this.permission_address &&
107
82
  this.data?.description != null &&
108
83
  this.object_address) {
109
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_DESCRIPTION);
84
+ add_perm(BuiltinPermissionIndex.ARBITRATION_DESCRIPTION);
110
85
  }
111
86
  if (this.permission_address && this.data?.location != null) {
112
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_LOCATION);
87
+ add_perm(BuiltinPermissionIndex.ARBITRATION_LOCATION);
113
88
  }
114
89
  if (this.permission_address && this.data?.fee != null) {
115
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_FEE);
90
+ add_perm(BuiltinPermissionIndex.ARBITRATION_FEE);
116
91
  }
117
92
  if (this.permission_address && this.data?.usage_guard !== undefined) {
118
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_USAGE_GUARD);
93
+ add_perm(BuiltinPermissionIndex.ARBITRATION_USAGE_GUARD);
119
94
  }
120
95
  if (this.permission_address && this.data?.vote != null) {
121
96
  this.data.vote.voting_guard =
122
- await local_js_1.LocalMark.Instance().get_address(this.data.vote.voting_guard);
97
+ await LocalMark.Instance().get_address(this.data.vote.voting_guard);
123
98
  if (this.data.vote.voting_guard) {
124
99
  add_guard(this.data.vote.voting_guard);
125
100
  }
126
101
  else {
127
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `CallArbitration_Data.data.vote.voting_guard ${this.data.vote.voting_guard} invalid`);
102
+ W_ERROR(WErrors.InvalidParam, `CallArbitration_Data.data.vote.voting_guard ${this.data.vote.voting_guard} invalid`);
128
103
  }
129
104
  }
130
105
  if (this.permission_address && this.data?.voting_guard != null) {
131
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_VOTING_GUARD);
106
+ add_perm(BuiltinPermissionIndex.ARBITRATION_VOTING_GUARD);
132
107
  }
133
108
  if (this.permission_address && this.data?.pause !== undefined) {
134
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_PAUSE);
109
+ add_perm(BuiltinPermissionIndex.ARBITRATION_PAUSE);
135
110
  }
136
111
  if (this.permission_address && this.data?.owner_receive != null) {
137
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_OWNER_RECEIVE);
112
+ add_perm(BuiltinPermissionIndex.ARBITRATION_OWNER_RECEIVE);
138
113
  }
139
114
  // 处理 arbitration 操作权限
140
115
  if (this.permission_address && this.data?.arbitration != null) {
141
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_ARBITRATION);
116
+ add_perm(BuiltinPermissionIndex.ARBITRATION_ARBITRATION);
142
117
  }
143
118
  // 处理 feedback 操作权限
144
119
  if (this.permission_address && this.data?.feedback != null) {
145
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_FEEDBACK);
120
+ add_perm(BuiltinPermissionIndex.ARBITRATION_FEEDBACK);
146
121
  }
147
122
  // 处理 confirm 操作权限
148
123
  if (this.permission_address && this.data?.confirm != null) {
149
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_CONFIRM);
124
+ add_perm(BuiltinPermissionIndex.ARBITRATION_CONFIRM);
150
125
  }
151
126
  // 处理 voting_deadline_change 操作权限
152
127
  if (this.permission_address &&
153
128
  this.data?.voting_deadline_change != null) {
154
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_VOTING_DEADLINE_CHANGE);
129
+ add_perm(BuiltinPermissionIndex.ARBITRATION_VOTING_DEADLINE_CHANGE);
155
130
  }
156
131
  // 处理 reset 操作权限
157
132
  if (this.permission_address && this.data?.reset != null) {
158
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_RESET);
133
+ add_perm(BuiltinPermissionIndex.ARBITRATION_RESET);
159
134
  }
160
135
  // 处理 arb_withdraw 操作权限
161
136
  if (this.permission_address && this.data?.arb_withdraw != null) {
162
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_ARB_WITHDRAW);
137
+ add_perm(BuiltinPermissionIndex.ARBITRATION_ARB_WITHDRAW);
163
138
  }
164
139
  // 处理 fees_alloc 操作权限
165
140
  if (this.permission_address && this.data?.fees_transfer != null) {
166
141
  if ("allocator" in this.data.fees_transfer.to) {
167
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_FEES_ALLOC);
142
+ add_perm(BuiltinPermissionIndex.ARBITRATION_FEES_ALLOC);
168
143
  }
169
144
  else if ("treasury" in this.data.fees_transfer.to) {
170
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_FEES_TRANSFER);
145
+ add_perm(BuiltinPermissionIndex.ARBITRATION_FEES_TRANSFER);
171
146
  }
172
147
  else {
173
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.fees_withdraw.to is invalid");
148
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_withdraw.to is invalid");
174
149
  }
175
150
  }
176
151
  if (this.permission_address && this.data.um !== undefined) {
177
- add_perm(permission_js_1.BuiltinPermissionIndex.ARBITRATION_UM);
152
+ add_perm(BuiltinPermissionIndex.ARBITRATION_UM);
178
153
  }
179
154
  if (this.permission_address || guards.length > 0) {
180
155
  return await this.check_permission_and_call(env, this.permission_address, perms, guards);
@@ -186,23 +161,23 @@ class CallArbitration extends base_js_1.CallBase {
186
161
  let object = this.object_address;
187
162
  if (!this.object_address) {
188
163
  if (!permission) {
189
- permission = (0, permission_js_1.newPermission)(tx, this.new_permission_description ?? "");
164
+ permission = newPermission(tx, this.new_permission_description ?? "");
190
165
  }
191
166
  if (permission && this.parameter_type) {
192
167
  object = newArbitration(tx, this.parameter_type, permission, this.data?.description ?? "", passport);
193
168
  }
194
169
  }
195
170
  if (!object || !permission) {
196
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.object:" + this.object_address);
171
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.object:" + this.object_address);
197
172
  }
198
173
  if (this.data.dispute != null) {
199
- const order = await local_js_1.LocalMark.Instance().get_address(this.data.dispute.order);
174
+ const order = await LocalMark.Instance().get_address(this.data.dispute.order);
200
175
  if (!order) {
201
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.dispute.order:" +
176
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.dispute.order:" +
202
177
  this.data.dispute.order);
203
178
  }
204
179
  const arb = await dispute(env, tx, object, this.parameter_type, order, this.data.dispute.description, this.data.dispute.proposition, this.data.dispute.fee, passport);
205
- await this.new_with_mark(env, tx, object_js_1.ObjectType.Arb, (0, arb_js_2.create)(tx, arb, this.parameter_type), (0, common_js_1.GetObject)(this.data?.dispute.namedArb));
180
+ await this.new_with_mark(env, tx, ObjectType.Arb, arbCreate(tx, arb, this.parameter_type), GetObject(this.data?.dispute.namedArb));
206
181
  }
207
182
  // 处理 description 更新
208
183
  if (this.data.description != null && this.object_address) {
@@ -222,76 +197,76 @@ class CallArbitration extends base_js_1.CallBase {
222
197
  }
223
198
  // 处理 confirm 操作
224
199
  if (this.data.confirm != null) {
225
- const arb = await local_js_1.LocalMark.Instance().get_address(this.data.confirm.arb);
200
+ const arb = await LocalMark.Instance().get_address(this.data.confirm.arb);
226
201
  if (arb) {
227
202
  confirm(tx, object, this.parameter_type, permission, arb, this.data.confirm.voting_deadline, passport);
228
203
  }
229
204
  else {
230
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.confirm.arb:" +
205
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.confirm.arb:" +
231
206
  this.data.confirm.arb);
232
207
  }
233
208
  }
234
209
  // 处理 voting_deadline_change 操作
235
210
  if (this.data.voting_deadline_change != null) {
236
- const arb = await local_js_1.LocalMark.Instance().get_address(this.data.voting_deadline_change.arb);
211
+ const arb = await LocalMark.Instance().get_address(this.data.voting_deadline_change.arb);
237
212
  if (arb) {
238
213
  voting_deadline_change(tx, object, this.parameter_type, permission, arb, this.data.voting_deadline_change.voting_deadline, passport);
239
214
  }
240
215
  else {
241
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.voting_deadline_change.arb:" +
216
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.voting_deadline_change.arb:" +
242
217
  this.data.voting_deadline_change.arb);
243
218
  }
244
219
  }
245
220
  if (this.data.vote != null) {
246
- const arb = await local_js_1.LocalMark.Instance().get_address(this.data.vote.arb);
221
+ const arb = await LocalMark.Instance().get_address(this.data.vote.arb);
247
222
  if (arb) {
248
223
  vote(tx, object, this.parameter_type, permission, arb, this.data.vote.votes, this.data.vote.voting_guard, passport);
249
224
  }
250
225
  else {
251
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.vote.arb:" + this.data.vote.arb);
226
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.vote.arb:" + this.data.vote.arb);
252
227
  }
253
228
  }
254
229
  // 处理 feedback 操作
255
230
  if (this.data.feedback != null) {
256
- const arb = await local_js_1.LocalMark.Instance().get_address(this.data.feedback.arb);
231
+ const arb = await LocalMark.Instance().get_address(this.data.feedback.arb);
257
232
  if (arb) {
258
233
  feedback(tx, object, this.parameter_type, permission, arb, this.data.feedback.feedback, passport);
259
234
  }
260
235
  else {
261
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.feedback.arb:" +
236
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.feedback.arb:" +
262
237
  this.data.feedback.arb);
263
238
  }
264
239
  }
265
240
  // 处理 arbitration 操作
266
241
  if (this.data.arbitration != null) {
267
- const arb = await local_js_1.LocalMark.Instance().get_address(this.data.arbitration.arb);
242
+ const arb = await LocalMark.Instance().get_address(this.data.arbitration.arb);
268
243
  if (arb) {
269
244
  arbitration(tx, object, this.parameter_type, permission, arb, this.data.arbitration.feedback, this.data.arbitration.indemnity, passport);
270
245
  }
271
246
  else {
272
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.arbitration.arb:" +
247
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.arbitration.arb:" +
273
248
  this.data.arbitration.arb);
274
249
  }
275
250
  }
276
251
  // 处理 reset 操作
277
252
  if (this.data.reset != null) {
278
- const arb = await local_js_1.LocalMark.Instance().get_address(this.data.reset.arb);
253
+ const arb = await LocalMark.Instance().get_address(this.data.reset.arb);
279
254
  if (arb) {
280
255
  reset(tx, object, this.parameter_type, permission, arb, this.data.reset.feedback, passport);
281
256
  }
282
257
  else {
283
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.reset.arb:" +
258
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.reset.arb:" +
284
259
  this.data.reset.arb);
285
260
  }
286
261
  }
287
262
  // 处理 arb_withdraw 操作
288
263
  if (this.data.arb_withdraw != null) {
289
- const arb = await local_js_1.LocalMark.Instance().get_address(this.data.arb_withdraw.arb);
264
+ const arb = await LocalMark.Instance().get_address(this.data.arb_withdraw.arb);
290
265
  if (arb) {
291
266
  arb_withdraw(tx, object, this.parameter_type, permission, arb, passport);
292
267
  }
293
268
  else {
294
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.arb_withdraw.arb:" +
269
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.arb_withdraw.arb:" +
295
270
  this.data.arb_withdraw.arb);
296
271
  }
297
272
  }
@@ -299,36 +274,36 @@ class CallArbitration extends base_js_1.CallBase {
299
274
  if (this.data.fees_transfer != null) {
300
275
  let payment_address = undefined;
301
276
  if ("allocation" in this.data.fees_transfer.to) {
302
- const a = await local_js_1.LocalMark.Instance().get_address(this.data.fees_transfer.to.allocation);
277
+ const a = await LocalMark.Instance().get_address(this.data.fees_transfer.to.allocation);
303
278
  if (a) {
304
279
  payment_address = fees_alloc(tx, object, this.parameter_type, permission, a, this.data.fees_transfer.payment_remark, this.data.fees_transfer.payment_index);
305
280
  }
306
281
  else {
307
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.fees_transfer.to.allocation:" +
282
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_transfer.to.allocation:" +
308
283
  this.data.fees_transfer.to.allocation);
309
284
  }
310
285
  }
311
286
  else if ("treasury" in this.data.fees_transfer.to) {
312
- const t = await local_js_1.LocalMark.Instance().get_address(this.data.fees_transfer.to.treasury);
287
+ const t = await LocalMark.Instance().get_address(this.data.fees_transfer.to.treasury);
313
288
  if (t) {
314
289
  payment_address = fees_transfer(tx, object, this.parameter_type, permission, t, this.data.fees_transfer.payment_remark, this.data.fees_transfer.payment_index, passport);
315
290
  }
316
291
  else {
317
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.fees_transfer.to.treasury:" +
292
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_transfer.to.treasury:" +
318
293
  this.data.fees_transfer.to.treasury);
319
294
  }
320
295
  }
321
296
  else {
322
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.fees_withdraw.to is invalid");
297
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.fees_withdraw.to is invalid");
323
298
  }
324
299
  if (this.data.fees_transfer.newPayment != null && payment_address) {
325
- await this.new_with_mark(env, tx, object_js_1.ObjectType.Payment, payment_address, this.data.fees_transfer.newPayment);
300
+ await this.new_with_mark(env, tx, ObjectType.Payment, payment_address, this.data.fees_transfer.newPayment);
326
301
  }
327
302
  }
328
303
  // 处理 usage_guard 更新
329
304
  if (this.data.usage_guard !== undefined) {
330
305
  if (this.data.usage_guard) {
331
- const guard = await local_js_1.LocalMark.Instance().get_address(this.data.usage_guard);
306
+ const guard = await LocalMark.Instance().get_address(this.data.usage_guard);
332
307
  if (guard) {
333
308
  usage_guard_set(tx, object, this.parameter_type, permission, guard, passport);
334
309
  }
@@ -343,14 +318,14 @@ class CallArbitration extends base_js_1.CallBase {
343
318
  case "add":
344
319
  case "set": {
345
320
  if (this.data.voting_guard.guards.length >
346
- exports.MAX_VOTING_GUARD_COUNT) {
347
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Voting guard count exceeds maximum count ${exports.MAX_VOTING_GUARD_COUNT}`);
321
+ MAX_VOTING_GUARD_COUNT) {
322
+ W_ERROR(WErrors.InvalidParam, `Voting guard count exceeds maximum count ${MAX_VOTING_GUARD_COUNT}`);
348
323
  }
349
324
  if (this.data.voting_guard.op === "set") {
350
325
  voting_guard_clear(tx, object, this.parameter_type, permission, passport);
351
326
  }
352
327
  const guards = await Promise.all(this.data.voting_guard.guards.map(async (vg) => {
353
- const guard = await local_js_1.LocalMark.Instance().get_address(vg.guard);
328
+ const guard = await LocalMark.Instance().get_address(vg.guard);
354
329
  return {
355
330
  originalGuard: vg.guard,
356
331
  guard,
@@ -361,7 +336,7 @@ class CallArbitration extends base_js_1.CallBase {
361
336
  .filter((vg) => vg.guard === undefined)
362
337
  .map((vg) => vg.originalGuard);
363
338
  if (invalidGuards.length > 0) {
364
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Invalid voting guards: ${invalidGuards.join(", ")} could not be resolved to valid addresses`);
339
+ W_ERROR(WErrors.InvalidParam, `Invalid voting guards: ${invalidGuards.join(", ")} could not be resolved to valid addresses`);
365
340
  }
366
341
  const voting_guards = guards.map((vg) => ({
367
342
  guard: vg.guard,
@@ -371,9 +346,9 @@ class CallArbitration extends base_js_1.CallBase {
371
346
  break;
372
347
  }
373
348
  case "remove": {
374
- const guards = await local_js_1.LocalMark.Instance().get_many_address_availables(this.data.voting_guard.guards);
375
- if (guards.length > exports.MAX_VOTING_GUARD_COUNT) {
376
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Voting guard count exceeds maximum count ${exports.MAX_VOTING_GUARD_COUNT}`);
349
+ const guards = await LocalMark.Instance().get_many_address_availables(this.data.voting_guard.guards);
350
+ if (guards.length > MAX_VOTING_GUARD_COUNT) {
351
+ W_ERROR(WErrors.InvalidParam, `Voting guard count exceeds maximum count ${MAX_VOTING_GUARD_COUNT}`);
377
352
  }
378
353
  voting_guard_remove(tx, object, this.parameter_type, permission, guards, passport);
379
354
  break;
@@ -388,65 +363,64 @@ class CallArbitration extends base_js_1.CallBase {
388
363
  if (this.data.owner_receive != null && this.object_address) {
389
364
  // 直接传递整个ReceivedObjects参数给owner_receive函数
390
365
  if (this.data.owner_receive === "recently") {
391
- this.data.owner_receive = await (0, received_js_1.query_received)({
366
+ this.data.owner_receive = await query_received({
392
367
  object: this.object_address,
393
368
  all_type: true,
394
369
  no_cache: env.no_cache,
395
370
  network: env.network,
396
371
  });
397
372
  }
398
- await (0, util_js_1.owner_receive)(tx, object, permission, this.data.owner_receive, this.parameter_type, (name) => `${common_js_1.PackageAddress}::arbitration::${name}`, passport);
373
+ await owner_receive(tx, object, permission, this.data.owner_receive, this.parameter_type, (name) => `${PackageAddress}::arbitration::${name}`, passport);
399
374
  }
400
375
  // 处理 um
401
376
  if (this.data.um !== undefined) {
402
377
  let um_address = null;
403
378
  if (this.data.um) {
404
379
  um_address =
405
- (await local_js_1.LocalMark.Instance().get_address(this.data.um)) ||
380
+ (await LocalMark.Instance().get_address(this.data.um)) ||
406
381
  null;
407
382
  if (!um_address) {
408
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, "CallArbitration_Data.data.um:" + this.data.um);
383
+ W_ERROR(WErrors.InvalidParam, "CallArbitration_Data.data.um:" + this.data.um);
409
384
  }
410
385
  }
411
386
  um_set(tx, object, this.parameter_type, permission, um_address, passport);
412
387
  }
413
388
  if (!this.permission_address) {
414
- const p = (0, common_js_1.GetObject)(this.data?.object);
415
- await this.new_with_mark(env, tx, object_js_1.ObjectType.Permission, (0, permission_js_2.create)(tx, permission), (0, common_js_1.GetObject)(p.permission));
389
+ const p = GetObject(this.data?.object);
390
+ await this.new_with_mark(env, tx, ObjectType.Permission, permissionCreate(tx, permission), GetObject(p.permission));
416
391
  }
417
392
  if (!this.object_address) {
418
- await this.new_with_mark(env, tx, object_js_1.ObjectType.Arbitration, create(tx, object, this.parameter_type), (0, common_js_1.GetObject)(this.data?.object));
393
+ await this.new_with_mark(env, tx, ObjectType.Arbitration, create(tx, object, this.parameter_type), GetObject(this.data?.object));
419
394
  }
420
395
  }
421
396
  }
422
- exports.CallArbitration = CallArbitration;
423
397
  // ================================================
424
398
  // move 调用函数
425
- exports.MAX_VOTING_GUARD_COUNT = 50;
426
- function create(tx, arbitration, parameter_type) {
427
- (0, util_js_1.validObjects)([arbitration]);
428
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
429
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
399
+ export const MAX_VOTING_GUARD_COUNT = 50;
400
+ export function create(tx, arbitration, parameter_type) {
401
+ validObjects([arbitration]);
402
+ if (!IsValidArgType(parameter_type)) {
403
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
430
404
  }
431
405
  return tx.moveCall({
432
- target: (0, common_js_1.arbitrationFn)(`create`),
433
- arguments: [(0, common_js_1.toTxObject)(tx, arbitration)],
406
+ target: arbitrationFn(`create`),
407
+ arguments: [toTxObject(tx, arbitration)],
434
408
  typeArguments: [parameter_type],
435
409
  });
436
410
  }
437
- function newArbitration(tx, parameter_type, permission, description, passport) {
438
- (0, util_js_1.validObjects)([permission]);
439
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
440
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
411
+ export function newArbitration(tx, parameter_type, permission, description, passport) {
412
+ validObjects([permission]);
413
+ if (!IsValidArgType(parameter_type)) {
414
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
441
415
  }
442
- if (!(0, common_js_1.isValidDescription)(description)) {
443
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration description ${description} exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
416
+ if (!isValidDescription(description)) {
417
+ W_ERROR(WErrors.InvalidParam, `Arbitration description ${description} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
444
418
  }
445
419
  if (passport) {
446
420
  return tx.moveCall({
447
- target: (0, common_js_1.arbitrationFn)(`new_with_passport`),
421
+ target: arbitrationFn(`new_with_passport`),
448
422
  arguments: [
449
- (0, common_js_1.toTxObject)(tx, permission),
423
+ toTxObject(tx, permission),
450
424
  passport,
451
425
  tx.pure.string(description),
452
426
  tx.object.mutRegistrar(),
@@ -457,9 +431,9 @@ function newArbitration(tx, parameter_type, permission, description, passport) {
457
431
  }
458
432
  else {
459
433
  return tx.moveCall({
460
- target: (0, common_js_1.arbitrationFn)(`new`),
434
+ target: arbitrationFn(`new`),
461
435
  arguments: [
462
- (0, common_js_1.toTxObject)(tx, permission),
436
+ toTxObject(tx, permission),
463
437
  tx.pure.string(description),
464
438
  tx.object.mutRegistrar(),
465
439
  tx.object.clock(),
@@ -468,20 +442,20 @@ function newArbitration(tx, parameter_type, permission, description, passport) {
468
442
  });
469
443
  }
470
444
  }
471
- function description_set(tx, arbitration, parameter_type, permission, description, passport) {
472
- (0, util_js_1.validObjects)([arbitration, permission]);
473
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
474
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
445
+ export function description_set(tx, arbitration, parameter_type, permission, description, passport) {
446
+ validObjects([arbitration, permission]);
447
+ if (!IsValidArgType(parameter_type)) {
448
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
475
449
  }
476
- if (!(0, common_js_1.isValidDescription)(description)) {
477
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration description ${description} exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
450
+ if (!isValidDescription(description)) {
451
+ W_ERROR(WErrors.InvalidParam, `Arbitration description ${description} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
478
452
  }
479
453
  if (passport) {
480
454
  tx.moveCall({
481
- target: (0, common_js_1.arbitrationFn)(`description_set_with_passsport`),
455
+ target: arbitrationFn(`description_set_with_passsport`),
482
456
  arguments: [
483
- (0, common_js_1.toTxObject)(tx, arbitration),
484
- (0, common_js_1.toTxObject)(tx, permission),
457
+ toTxObject(tx, arbitration),
458
+ toTxObject(tx, permission),
485
459
  passport,
486
460
  tx.pure.string(description),
487
461
  ],
@@ -490,30 +464,30 @@ function description_set(tx, arbitration, parameter_type, permission, descriptio
490
464
  }
491
465
  else {
492
466
  tx.moveCall({
493
- target: (0, common_js_1.arbitrationFn)(`description_set`),
467
+ target: arbitrationFn(`description_set`),
494
468
  arguments: [
495
- (0, common_js_1.toTxObject)(tx, arbitration),
496
- (0, common_js_1.toTxObject)(tx, permission),
469
+ toTxObject(tx, arbitration),
470
+ toTxObject(tx, permission),
497
471
  tx.pure.string(description),
498
472
  ],
499
473
  typeArguments: [parameter_type],
500
474
  });
501
475
  }
502
476
  }
503
- function location_set(tx, arbitration, parameter_type, permission, location, passport) {
504
- (0, util_js_1.validObjects)([arbitration, permission]);
505
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
506
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
477
+ export function location_set(tx, arbitration, parameter_type, permission, location, passport) {
478
+ validObjects([arbitration, permission]);
479
+ if (!IsValidArgType(parameter_type)) {
480
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
507
481
  }
508
- if (!(0, common_js_1.isValidLongName)(location)) {
509
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration location ${location} is exceeds maximum length ${common_js_1.MAX_LONG_NAME_LENGTH}`);
482
+ if (!isValidLongName(location)) {
483
+ W_ERROR(WErrors.InvalidParam, `Arbitration location ${location} is exceeds maximum length ${MAX_LONG_NAME_LENGTH}`);
510
484
  }
511
485
  if (passport) {
512
486
  tx.moveCall({
513
- target: (0, common_js_1.arbitrationFn)(`location_set_with_passport`),
487
+ target: arbitrationFn(`location_set_with_passport`),
514
488
  arguments: [
515
- (0, common_js_1.toTxObject)(tx, arbitration),
516
- (0, common_js_1.toTxObject)(tx, permission),
489
+ toTxObject(tx, arbitration),
490
+ toTxObject(tx, permission),
517
491
  passport,
518
492
  tx.pure.string(location),
519
493
  ],
@@ -522,35 +496,35 @@ function location_set(tx, arbitration, parameter_type, permission, location, pas
522
496
  }
523
497
  else {
524
498
  tx.moveCall({
525
- target: (0, common_js_1.arbitrationFn)(`location_set`),
499
+ target: arbitrationFn(`location_set`),
526
500
  arguments: [
527
- (0, common_js_1.toTxObject)(tx, arbitration),
528
- (0, common_js_1.toTxObject)(tx, permission),
501
+ toTxObject(tx, arbitration),
502
+ toTxObject(tx, permission),
529
503
  tx.pure.string(location),
530
504
  ],
531
505
  typeArguments: [parameter_type],
532
506
  });
533
507
  }
534
508
  }
535
- function voting_guard_add(tx, arbitration, parameter_type, permission, voting_guards, passport) {
536
- (0, util_js_1.validObjects)([arbitration, permission]);
537
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
538
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
509
+ export function voting_guard_add(tx, arbitration, parameter_type, permission, voting_guards, passport) {
510
+ validObjects([arbitration, permission]);
511
+ if (!IsValidArgType(parameter_type)) {
512
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
539
513
  }
540
514
  voting_guards.forEach((vg) => {
541
- if (!(0, sui_types_js_1.isValidWowAddress)(vg.guard)) {
542
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Voting guard ${vg.guard} is not valid`);
515
+ if (!isValidWowAddress(vg.guard)) {
516
+ W_ERROR(WErrors.InvalidParam, `Voting guard ${vg.guard} is not valid`);
543
517
  }
544
518
  if ("GuardIdentifier" in vg.vote_weight) {
545
- if (!(0, common_js_1.isValidU8)(vg.vote_weight.GuardIdentifier)) {
546
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Voting guard ${vg.vote_weight.GuardIdentifier} must be u8 number`);
519
+ if (!isValidU8(vg.vote_weight.GuardIdentifier)) {
520
+ W_ERROR(WErrors.InvalidParam, `Voting guard ${vg.vote_weight.GuardIdentifier} must be u8 number`);
547
521
  }
548
522
  if (passport) {
549
523
  tx.moveCall({
550
- target: (0, common_js_1.arbitrationFn)(`voting_guard_add_by_id_add_with_passport`),
524
+ target: arbitrationFn(`voting_guard_add_by_id_add_with_passport`),
551
525
  arguments: [
552
- (0, common_js_1.toTxObject)(tx, arbitration),
553
- (0, common_js_1.toTxObject)(tx, permission),
526
+ toTxObject(tx, arbitration),
527
+ toTxObject(tx, permission),
554
528
  passport,
555
529
  tx.object(vg.guard),
556
530
  tx.pure.u8(vg.vote_weight.GuardIdentifier),
@@ -560,10 +534,10 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
560
534
  }
561
535
  else {
562
536
  tx.moveCall({
563
- target: (0, common_js_1.arbitrationFn)(`voting_guard_add_by_id_add`),
537
+ target: arbitrationFn(`voting_guard_add_by_id_add`),
564
538
  arguments: [
565
- (0, common_js_1.toTxObject)(tx, arbitration),
566
- (0, common_js_1.toTxObject)(tx, permission),
539
+ toTxObject(tx, arbitration),
540
+ toTxObject(tx, permission),
567
541
  tx.object(vg.guard),
568
542
  tx.pure.u8(vg.vote_weight.GuardIdentifier),
569
543
  ],
@@ -572,15 +546,15 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
572
546
  }
573
547
  }
574
548
  else if ("FixedValue" in vg.vote_weight) {
575
- if (!(0, common_js_1.isValidU32)(vg.vote_weight.FixedValue)) {
576
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Voting guard ${vg.vote_weight.FixedValue} must be u32 number`);
549
+ if (!isValidU32(vg.vote_weight.FixedValue)) {
550
+ W_ERROR(WErrors.InvalidParam, `Voting guard ${vg.vote_weight.FixedValue} must be u32 number`);
577
551
  }
578
552
  if (passport) {
579
553
  tx.moveCall({
580
- target: (0, common_js_1.arbitrationFn)(`voting_guard_fixed_add_with_passport`),
554
+ target: arbitrationFn(`voting_guard_fixed_add_with_passport`),
581
555
  arguments: [
582
- (0, common_js_1.toTxObject)(tx, arbitration),
583
- (0, common_js_1.toTxObject)(tx, permission),
556
+ toTxObject(tx, arbitration),
557
+ toTxObject(tx, permission),
584
558
  passport,
585
559
  tx.object(vg.guard),
586
560
  tx.pure.u32(vg.vote_weight.FixedValue),
@@ -592,10 +566,10 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
592
566
  }
593
567
  else {
594
568
  tx.moveCall({
595
- target: (0, common_js_1.arbitrationFn)(`voting_guard_fixed_add`),
569
+ target: arbitrationFn(`voting_guard_fixed_add`),
596
570
  arguments: [
597
- (0, common_js_1.toTxObject)(tx, arbitration),
598
- (0, common_js_1.toTxObject)(tx, permission),
571
+ toTxObject(tx, arbitration),
572
+ toTxObject(tx, permission),
599
573
  tx.object(vg.guard),
600
574
  tx.pure.u32(vg.vote_weight.FixedValue),
601
575
  tx.object.mutRegistrar(),
@@ -607,20 +581,20 @@ function voting_guard_add(tx, arbitration, parameter_type, permission, voting_gu
607
581
  }
608
582
  });
609
583
  }
610
- function voting_guard_remove(tx, arbitration, parameter_type, permission, guards, passport) {
584
+ export function voting_guard_remove(tx, arbitration, parameter_type, permission, guards, passport) {
611
585
  if (guards.length === 0) {
612
586
  return;
613
587
  }
614
- (0, util_js_1.validObjects)([arbitration, permission, ...guards]);
615
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
616
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
588
+ validObjects([arbitration, permission, ...guards]);
589
+ if (!IsValidArgType(parameter_type)) {
590
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
617
591
  }
618
592
  if (passport) {
619
593
  tx.moveCall({
620
- target: (0, common_js_1.arbitrationFn)(`voting_guard_remove_with_passport`),
594
+ target: arbitrationFn(`voting_guard_remove_with_passport`),
621
595
  arguments: [
622
- (0, common_js_1.toTxObject)(tx, arbitration),
623
- (0, common_js_1.toTxObject)(tx, permission),
596
+ toTxObject(tx, arbitration),
597
+ toTxObject(tx, permission),
624
598
  passport,
625
599
  tx.pure.vector("address", guards),
626
600
  tx.object.mutRegistrar(),
@@ -630,10 +604,10 @@ function voting_guard_remove(tx, arbitration, parameter_type, permission, guards
630
604
  }
631
605
  else {
632
606
  tx.moveCall({
633
- target: (0, common_js_1.arbitrationFn)(`voting_guard_remove`),
607
+ target: arbitrationFn(`voting_guard_remove`),
634
608
  arguments: [
635
- (0, common_js_1.toTxObject)(tx, arbitration),
636
- (0, common_js_1.toTxObject)(tx, permission),
609
+ toTxObject(tx, arbitration),
610
+ toTxObject(tx, permission),
637
611
  tx.pure.vector("address", guards),
638
612
  tx.object.mutRegistrar(),
639
613
  ],
@@ -641,17 +615,17 @@ function voting_guard_remove(tx, arbitration, parameter_type, permission, guards
641
615
  });
642
616
  }
643
617
  }
644
- function voting_guard_clear(tx, arbitration, parameter_type, permission, passport) {
645
- (0, util_js_1.validObjects)([arbitration, permission]);
646
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
647
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
618
+ export function voting_guard_clear(tx, arbitration, parameter_type, permission, passport) {
619
+ validObjects([arbitration, permission]);
620
+ if (!IsValidArgType(parameter_type)) {
621
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
648
622
  }
649
623
  if (passport) {
650
624
  tx.moveCall({
651
- target: (0, common_js_1.arbitrationFn)(`voting_guard_clear_with_passport`),
625
+ target: arbitrationFn(`voting_guard_clear_with_passport`),
652
626
  arguments: [
653
- (0, common_js_1.toTxObject)(tx, arbitration),
654
- (0, common_js_1.toTxObject)(tx, permission),
627
+ toTxObject(tx, arbitration),
628
+ toTxObject(tx, permission),
655
629
  passport,
656
630
  tx.object.mutRegistrar(),
657
631
  ],
@@ -660,27 +634,27 @@ function voting_guard_clear(tx, arbitration, parameter_type, permission, passpor
660
634
  }
661
635
  else {
662
636
  tx.moveCall({
663
- target: (0, common_js_1.arbitrationFn)(`voting_guard_clear`),
637
+ target: arbitrationFn(`voting_guard_clear`),
664
638
  arguments: [
665
- (0, common_js_1.toTxObject)(tx, arbitration),
666
- (0, common_js_1.toTxObject)(tx, permission),
639
+ toTxObject(tx, arbitration),
640
+ toTxObject(tx, permission),
667
641
  tx.object.mutRegistrar(),
668
642
  ],
669
643
  typeArguments: [parameter_type],
670
644
  });
671
645
  }
672
646
  }
673
- function usage_guard_set(tx, arbitration, parameter_type, permission, guard, passport) {
674
- (0, util_js_1.validObjects)([arbitration, permission, guard]);
675
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
676
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
647
+ export function usage_guard_set(tx, arbitration, parameter_type, permission, guard, passport) {
648
+ validObjects([arbitration, permission, guard]);
649
+ if (!IsValidArgType(parameter_type)) {
650
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
677
651
  }
678
652
  if (passport) {
679
653
  tx.moveCall({
680
- target: (0, common_js_1.arbitrationFn)(`usage_guard_set_with_passport`),
654
+ target: arbitrationFn(`usage_guard_set_with_passport`),
681
655
  arguments: [
682
- (0, common_js_1.toTxObject)(tx, arbitration),
683
- (0, common_js_1.toTxObject)(tx, permission),
656
+ toTxObject(tx, arbitration),
657
+ toTxObject(tx, permission),
684
658
  passport,
685
659
  tx.object(guard),
686
660
  tx.object.mutRegistrar(),
@@ -691,10 +665,10 @@ function usage_guard_set(tx, arbitration, parameter_type, permission, guard, pas
691
665
  }
692
666
  else {
693
667
  tx.moveCall({
694
- target: (0, common_js_1.arbitrationFn)(`usage_guard_set`),
668
+ target: arbitrationFn(`usage_guard_set`),
695
669
  arguments: [
696
- (0, common_js_1.toTxObject)(tx, arbitration),
697
- (0, common_js_1.toTxObject)(tx, permission),
670
+ toTxObject(tx, arbitration),
671
+ toTxObject(tx, permission),
698
672
  tx.object(guard),
699
673
  tx.object.mutRegistrar(),
700
674
  tx.object.clock(),
@@ -703,17 +677,17 @@ function usage_guard_set(tx, arbitration, parameter_type, permission, guard, pas
703
677
  });
704
678
  }
705
679
  }
706
- function usage_guard_none(tx, arbitration, parameter_type, permission, passport) {
707
- (0, util_js_1.validObjects)([arbitration, permission]);
708
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
709
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
680
+ export function usage_guard_none(tx, arbitration, parameter_type, permission, passport) {
681
+ validObjects([arbitration, permission]);
682
+ if (!IsValidArgType(parameter_type)) {
683
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
710
684
  }
711
685
  if (passport) {
712
686
  tx.moveCall({
713
- target: (0, common_js_1.arbitrationFn)(`usage_guard_none_with_passport`),
687
+ target: arbitrationFn(`usage_guard_none_with_passport`),
714
688
  arguments: [
715
- (0, common_js_1.toTxObject)(tx, arbitration),
716
- (0, common_js_1.toTxObject)(tx, permission),
689
+ toTxObject(tx, arbitration),
690
+ toTxObject(tx, permission),
717
691
  passport,
718
692
  tx.object.mutRegistrar(),
719
693
  ],
@@ -722,27 +696,27 @@ function usage_guard_none(tx, arbitration, parameter_type, permission, passport)
722
696
  }
723
697
  else {
724
698
  tx.moveCall({
725
- target: (0, common_js_1.arbitrationFn)(`usage_guard_none`),
699
+ target: arbitrationFn(`usage_guard_none`),
726
700
  arguments: [
727
- (0, common_js_1.toTxObject)(tx, arbitration),
728
- (0, common_js_1.toTxObject)(tx, permission),
701
+ toTxObject(tx, arbitration),
702
+ toTxObject(tx, permission),
729
703
  tx.object.mutRegistrar(),
730
704
  ],
731
705
  typeArguments: [parameter_type],
732
706
  });
733
707
  }
734
708
  }
735
- function pause(tx, arbitration, parameter_type, permission, pause, passport) {
736
- (0, util_js_1.validObjects)([arbitration, permission]);
737
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
738
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
709
+ export function pause(tx, arbitration, parameter_type, permission, pause, passport) {
710
+ validObjects([arbitration, permission]);
711
+ if (!IsValidArgType(parameter_type)) {
712
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
739
713
  }
740
714
  if (passport) {
741
715
  tx.moveCall({
742
- target: (0, common_js_1.arbitrationFn)(`pause_with_passport`),
716
+ target: arbitrationFn(`pause_with_passport`),
743
717
  arguments: [
744
- (0, common_js_1.toTxObject)(tx, arbitration),
745
- (0, common_js_1.toTxObject)(tx, permission),
718
+ toTxObject(tx, arbitration),
719
+ toTxObject(tx, permission),
746
720
  passport,
747
721
  tx.pure.bool(pause),
748
722
  ],
@@ -751,30 +725,30 @@ function pause(tx, arbitration, parameter_type, permission, pause, passport) {
751
725
  }
752
726
  else {
753
727
  tx.moveCall({
754
- target: (0, common_js_1.arbitrationFn)(`pause`),
728
+ target: arbitrationFn(`pause`),
755
729
  arguments: [
756
- (0, common_js_1.toTxObject)(tx, arbitration),
757
- (0, common_js_1.toTxObject)(tx, permission),
730
+ toTxObject(tx, arbitration),
731
+ toTxObject(tx, permission),
758
732
  tx.pure.bool(pause),
759
733
  ],
760
734
  typeArguments: [parameter_type],
761
735
  });
762
736
  }
763
737
  }
764
- function fee_set(tx, arbitration, parameter_type, permission, fee, passport) {
765
- (0, util_js_1.validObjects)([arbitration, permission]);
766
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
767
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
738
+ export function fee_set(tx, arbitration, parameter_type, permission, fee, passport) {
739
+ validObjects([arbitration, permission]);
740
+ if (!IsValidArgType(parameter_type)) {
741
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
768
742
  }
769
- if (!(0, common_js_1.isValidU64)(fee)) {
770
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Fee ${fee} is not valid u64`);
743
+ if (!isValidU64(fee)) {
744
+ W_ERROR(WErrors.InvalidParam, `Fee ${fee} is not valid u64`);
771
745
  }
772
746
  if (passport) {
773
747
  tx.moveCall({
774
- target: (0, common_js_1.arbitrationFn)(`fee_set_with_passport`),
748
+ target: arbitrationFn(`fee_set_with_passport`),
775
749
  arguments: [
776
- (0, common_js_1.toTxObject)(tx, arbitration),
777
- (0, common_js_1.toTxObject)(tx, permission),
750
+ toTxObject(tx, arbitration),
751
+ toTxObject(tx, permission),
778
752
  passport,
779
753
  tx.pure.u64(fee),
780
754
  ],
@@ -783,38 +757,38 @@ function fee_set(tx, arbitration, parameter_type, permission, fee, passport) {
783
757
  }
784
758
  else {
785
759
  tx.moveCall({
786
- target: (0, common_js_1.arbitrationFn)(`fee_set`),
760
+ target: arbitrationFn(`fee_set`),
787
761
  arguments: [
788
- (0, common_js_1.toTxObject)(tx, arbitration),
789
- (0, common_js_1.toTxObject)(tx, permission),
762
+ toTxObject(tx, arbitration),
763
+ toTxObject(tx, permission),
790
764
  tx.pure.u64(fee),
791
765
  ],
792
766
  typeArguments: [parameter_type],
793
767
  });
794
768
  }
795
769
  }
796
- async function dispute(env, tx, arbitration, parameter_type, order, description, proposition, fee, passport) {
797
- (0, util_js_1.validObjects)([arbitration, order]);
798
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
799
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
770
+ export async function dispute(env, tx, arbitration, parameter_type, order, description, proposition, fee, passport) {
771
+ validObjects([arbitration, order]);
772
+ if (!IsValidArgType(parameter_type)) {
773
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
800
774
  }
801
- if (!(0, common_js_1.isValidDescription)(description)) {
802
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.IsValidDescription, `Description exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
775
+ if (!isValidDescription(description)) {
776
+ W_ERROR(WErrors.IsValidDescription, `Description exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
803
777
  }
804
- if (proposition.length > arb_js_1.MAX_PROPOSITION_COUNT) {
805
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Proposition count exceeds maximum count ${arb_js_1.MAX_PROPOSITION_COUNT}`);
778
+ if (proposition.length > MAX_PROPOSITION_COUNT) {
779
+ W_ERROR(WErrors.InvalidParam, `Proposition count exceeds maximum count ${MAX_PROPOSITION_COUNT}`);
806
780
  }
807
- if (!(0, common_js_1.isValidArray)(proposition, common_js_1.isValidLongName)) {
808
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Proposition ${proposition} is not valid array of string, each string must less than ${common_js_1.MAX_LONG_NAME_LENGTH}`);
781
+ if (!isValidArray(proposition, isValidLongName)) {
782
+ W_ERROR(WErrors.InvalidParam, `Proposition ${proposition} is not valid array of string, each string must less than ${MAX_LONG_NAME_LENGTH}`);
809
783
  }
810
- const c = await (0, base_js_1.getCoinParam)(env, tx, fee, parameter_type);
784
+ const c = await getCoinParam(env, tx, fee, parameter_type);
811
785
  if (passport) {
812
786
  return tx.moveCall({
813
- target: (0, common_js_1.arbitrationFn)(`dispute_with_passport`),
787
+ target: arbitrationFn(`dispute_with_passport`),
814
788
  arguments: [
815
- (0, common_js_1.toTxObject)(tx, arbitration),
789
+ toTxObject(tx, arbitration),
816
790
  passport,
817
- (0, common_js_1.toTxObject)(tx, order),
791
+ toTxObject(tx, order),
818
792
  tx.pure.string(description),
819
793
  tx.pure.vector("string", proposition),
820
794
  c,
@@ -825,10 +799,10 @@ async function dispute(env, tx, arbitration, parameter_type, order, description,
825
799
  }
826
800
  else {
827
801
  return tx.moveCall({
828
- target: (0, common_js_1.arbitrationFn)(`dispute`),
802
+ target: arbitrationFn(`dispute`),
829
803
  arguments: [
830
- (0, common_js_1.toTxObject)(tx, arbitration),
831
- (0, common_js_1.toTxObject)(tx, order),
804
+ toTxObject(tx, arbitration),
805
+ toTxObject(tx, order),
832
806
  tx.pure.string(description),
833
807
  tx.pure.vector("string", proposition),
834
808
  c,
@@ -838,24 +812,24 @@ async function dispute(env, tx, arbitration, parameter_type, order, description,
838
812
  });
839
813
  }
840
814
  }
841
- function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_guard, passport) {
842
- (0, util_js_1.validObjects)([arbitration, permission, arb, voting_guard]);
843
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
844
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
815
+ export function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_guard, passport) {
816
+ validObjects([arbitration, permission, arb, voting_guard]);
817
+ if (!IsValidArgType(parameter_type)) {
818
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
845
819
  }
846
- if (!(0, common_js_1.isValidArray)(votes, common_js_1.isValidU8)) {
847
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Votes ${votes} is not valid array of u8`);
820
+ if (!isValidArray(votes, isValidU8)) {
821
+ W_ERROR(WErrors.InvalidParam, `Votes ${votes} is not valid array of u8`);
848
822
  }
849
823
  if (passport) {
850
824
  // voting by voting-guard
851
825
  if (voting_guard) {
852
826
  tx.moveCall({
853
- target: (0, common_js_1.arbitrationFn)(`vote_with_voting_guard`),
827
+ target: arbitrationFn(`vote_with_voting_guard`),
854
828
  arguments: [
855
- (0, common_js_1.toTxObject)(tx, arbitration),
829
+ toTxObject(tx, arbitration),
856
830
  passport,
857
- (0, common_js_1.toTxObject)(tx, arb),
858
- (0, common_js_1.toTxObject)(tx, voting_guard),
831
+ toTxObject(tx, arb),
832
+ toTxObject(tx, voting_guard),
859
833
  tx.pure.vector("u8", votes),
860
834
  tx.object.clock(),
861
835
  ],
@@ -864,12 +838,12 @@ function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_gu
864
838
  }
865
839
  else {
866
840
  tx.moveCall({
867
- target: (0, common_js_1.arbitrationFn)(`vote_with_passport`),
841
+ target: arbitrationFn(`vote_with_passport`),
868
842
  arguments: [
869
- (0, common_js_1.toTxObject)(tx, arbitration),
870
- (0, common_js_1.toTxObject)(tx, permission),
843
+ toTxObject(tx, arbitration),
844
+ toTxObject(tx, permission),
871
845
  passport,
872
- (0, common_js_1.toTxObject)(tx, arb),
846
+ toTxObject(tx, arb),
873
847
  tx.pure.vector("u8", votes),
874
848
  tx.object.clock(),
875
849
  ],
@@ -879,11 +853,11 @@ function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_gu
879
853
  }
880
854
  else {
881
855
  tx.moveCall({
882
- target: (0, common_js_1.arbitrationFn)(`vote`),
856
+ target: arbitrationFn(`vote`),
883
857
  arguments: [
884
- (0, common_js_1.toTxObject)(tx, arbitration),
885
- (0, common_js_1.toTxObject)(tx, permission),
886
- (0, common_js_1.toTxObject)(tx, arb),
858
+ toTxObject(tx, arbitration),
859
+ toTxObject(tx, permission),
860
+ toTxObject(tx, arb),
887
861
  tx.pure.vector("u8", votes),
888
862
  tx.object.clock(),
889
863
  ],
@@ -891,25 +865,25 @@ function vote(tx, arbitration, parameter_type, permission, arb, votes, voting_gu
891
865
  });
892
866
  }
893
867
  }
894
- function arbitration(tx, arbitration, parameter_type, permission, arb, feedback, indemnity, passport) {
895
- (0, util_js_1.validObjects)([arbitration, permission, arb]);
896
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
897
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
868
+ export function arbitration(tx, arbitration, parameter_type, permission, arb, feedback, indemnity, passport) {
869
+ validObjects([arbitration, permission, arb]);
870
+ if (!IsValidArgType(parameter_type)) {
871
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
898
872
  }
899
- if (!(0, common_js_1.isValidDescription)(feedback)) {
900
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
873
+ if (!isValidDescription(feedback)) {
874
+ W_ERROR(WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
901
875
  }
902
- if (!(0, common_js_1.isValidU64)(indemnity)) {
903
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Indemnity ${indemnity} must be u64 number`);
876
+ if (!isValidU64(indemnity)) {
877
+ W_ERROR(WErrors.InvalidParam, `Indemnity ${indemnity} must be u64 number`);
904
878
  }
905
879
  if (passport) {
906
880
  tx.moveCall({
907
- target: (0, common_js_1.arbitrationFn)(`arbitration_with_passport`),
881
+ target: arbitrationFn(`arbitration_with_passport`),
908
882
  arguments: [
909
- (0, common_js_1.toTxObject)(tx, arbitration),
910
- (0, common_js_1.toTxObject)(tx, permission),
883
+ toTxObject(tx, arbitration),
884
+ toTxObject(tx, permission),
911
885
  passport,
912
- (0, common_js_1.toTxObject)(tx, arb),
886
+ toTxObject(tx, arb),
913
887
  tx.pure.string(feedback),
914
888
  tx.pure.u64(indemnity),
915
889
  tx.object.clock(),
@@ -919,11 +893,11 @@ function arbitration(tx, arbitration, parameter_type, permission, arb, feedback,
919
893
  }
920
894
  else {
921
895
  tx.moveCall({
922
- target: (0, common_js_1.arbitrationFn)(`arbitration`),
896
+ target: arbitrationFn(`arbitration`),
923
897
  arguments: [
924
- (0, common_js_1.toTxObject)(tx, arbitration),
925
- (0, common_js_1.toTxObject)(tx, permission),
926
- (0, common_js_1.toTxObject)(tx, arb),
898
+ toTxObject(tx, arbitration),
899
+ toTxObject(tx, permission),
900
+ toTxObject(tx, arb),
927
901
  tx.pure.string(feedback),
928
902
  tx.pure.u64(indemnity),
929
903
  tx.object.clock(),
@@ -932,22 +906,22 @@ function arbitration(tx, arbitration, parameter_type, permission, arb, feedback,
932
906
  });
933
907
  }
934
908
  }
935
- function feedback(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
936
- (0, util_js_1.validObjects)([arbitration, permission, arb]);
937
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
938
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
909
+ export function feedback(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
910
+ validObjects([arbitration, permission, arb]);
911
+ if (!IsValidArgType(parameter_type)) {
912
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
939
913
  }
940
- if (!(0, common_js_1.isValidDescription)(feedback)) {
941
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
914
+ if (!isValidDescription(feedback)) {
915
+ W_ERROR(WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
942
916
  }
943
917
  if (passport) {
944
918
  tx.moveCall({
945
- target: (0, common_js_1.arbitrationFn)(`feedback_with_passport`),
919
+ target: arbitrationFn(`feedback_with_passport`),
946
920
  arguments: [
947
- (0, common_js_1.toTxObject)(tx, arbitration),
948
- (0, common_js_1.toTxObject)(tx, permission),
921
+ toTxObject(tx, arbitration),
922
+ toTxObject(tx, permission),
949
923
  passport,
950
- (0, common_js_1.toTxObject)(tx, arb),
924
+ toTxObject(tx, arb),
951
925
  tx.pure.string(feedback),
952
926
  ],
953
927
  typeArguments: [parameter_type],
@@ -955,33 +929,33 @@ function feedback(tx, arbitration, parameter_type, permission, arb, feedback, pa
955
929
  }
956
930
  else {
957
931
  tx.moveCall({
958
- target: (0, common_js_1.arbitrationFn)(`feedback`),
932
+ target: arbitrationFn(`feedback`),
959
933
  arguments: [
960
- (0, common_js_1.toTxObject)(tx, arbitration),
961
- (0, common_js_1.toTxObject)(tx, permission),
962
- (0, common_js_1.toTxObject)(tx, arb),
934
+ toTxObject(tx, arbitration),
935
+ toTxObject(tx, permission),
936
+ toTxObject(tx, arb),
963
937
  tx.pure.string(feedback),
964
938
  ],
965
939
  typeArguments: [parameter_type],
966
940
  });
967
941
  }
968
942
  }
969
- function confirm(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
970
- (0, util_js_1.validObjects)([arbitration, permission, arb]);
971
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
972
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
943
+ export function confirm(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
944
+ validObjects([arbitration, permission, arb]);
945
+ if (!IsValidArgType(parameter_type)) {
946
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
973
947
  }
974
- if (voting_deadline !== null && !(0, common_js_1.isValidU64)(voting_deadline)) {
975
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Voting deadline ${voting_deadline} must be u64 number or null`);
948
+ if (voting_deadline !== null && !isValidU64(voting_deadline)) {
949
+ W_ERROR(WErrors.InvalidParam, `Voting deadline ${voting_deadline} must be u64 number or null`);
976
950
  }
977
951
  if (passport) {
978
952
  tx.moveCall({
979
- target: (0, common_js_1.arbitrationFn)(`confirm_with_passport`),
953
+ target: arbitrationFn(`confirm_with_passport`),
980
954
  arguments: [
981
- (0, common_js_1.toTxObject)(tx, arbitration),
982
- (0, common_js_1.toTxObject)(tx, permission),
955
+ toTxObject(tx, arbitration),
956
+ toTxObject(tx, permission),
983
957
  passport,
984
- (0, common_js_1.toTxObject)(tx, arb),
958
+ toTxObject(tx, arb),
985
959
  tx.pure.option("u64", voting_deadline),
986
960
  ],
987
961
  typeArguments: [parameter_type],
@@ -989,33 +963,33 @@ function confirm(tx, arbitration, parameter_type, permission, arb, voting_deadli
989
963
  }
990
964
  else {
991
965
  tx.moveCall({
992
- target: (0, common_js_1.arbitrationFn)(`confirm`),
966
+ target: arbitrationFn(`confirm`),
993
967
  arguments: [
994
- (0, common_js_1.toTxObject)(tx, arbitration),
995
- (0, common_js_1.toTxObject)(tx, permission),
996
- (0, common_js_1.toTxObject)(tx, arb),
968
+ toTxObject(tx, arbitration),
969
+ toTxObject(tx, permission),
970
+ toTxObject(tx, arb),
997
971
  tx.pure.option("u64", voting_deadline),
998
972
  ],
999
973
  typeArguments: [parameter_type],
1000
974
  });
1001
975
  }
1002
976
  }
1003
- function voting_deadline_change(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
1004
- (0, util_js_1.validObjects)([arbitration, permission, arb]);
1005
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
1006
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
977
+ export function voting_deadline_change(tx, arbitration, parameter_type, permission, arb, voting_deadline, passport) {
978
+ validObjects([arbitration, permission, arb]);
979
+ if (!IsValidArgType(parameter_type)) {
980
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1007
981
  }
1008
- if (voting_deadline !== null && !(0, common_js_1.isValidU64)(voting_deadline)) {
1009
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Voting deadline ${voting_deadline} must be u64 number or null`);
982
+ if (voting_deadline !== null && !isValidU64(voting_deadline)) {
983
+ W_ERROR(WErrors.InvalidParam, `Voting deadline ${voting_deadline} must be u64 number or null`);
1010
984
  }
1011
985
  if (passport) {
1012
986
  tx.moveCall({
1013
- target: (0, common_js_1.arbitrationFn)(`voting_deadline_change_with_passport`),
987
+ target: arbitrationFn(`voting_deadline_change_with_passport`),
1014
988
  arguments: [
1015
- (0, common_js_1.toTxObject)(tx, arbitration),
1016
- (0, common_js_1.toTxObject)(tx, permission),
989
+ toTxObject(tx, arbitration),
990
+ toTxObject(tx, permission),
1017
991
  passport,
1018
- (0, common_js_1.toTxObject)(tx, arb),
992
+ toTxObject(tx, arb),
1019
993
  tx.pure.option("u64", voting_deadline),
1020
994
  ],
1021
995
  typeArguments: [parameter_type],
@@ -1023,33 +997,33 @@ function voting_deadline_change(tx, arbitration, parameter_type, permission, arb
1023
997
  }
1024
998
  else {
1025
999
  tx.moveCall({
1026
- target: (0, common_js_1.arbitrationFn)(`voting_deadline_change`),
1000
+ target: arbitrationFn(`voting_deadline_change`),
1027
1001
  arguments: [
1028
- (0, common_js_1.toTxObject)(tx, arbitration),
1029
- (0, common_js_1.toTxObject)(tx, permission),
1030
- (0, common_js_1.toTxObject)(tx, arb),
1002
+ toTxObject(tx, arbitration),
1003
+ toTxObject(tx, permission),
1004
+ toTxObject(tx, arb),
1031
1005
  tx.pure.option("u64", voting_deadline),
1032
1006
  ],
1033
1007
  typeArguments: [parameter_type],
1034
1008
  });
1035
1009
  }
1036
1010
  }
1037
- function reset(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
1038
- (0, util_js_1.validObjects)([arbitration, permission, arb]);
1039
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
1040
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1011
+ export function reset(tx, arbitration, parameter_type, permission, arb, feedback, passport) {
1012
+ validObjects([arbitration, permission, arb]);
1013
+ if (!IsValidArgType(parameter_type)) {
1014
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1041
1015
  }
1042
- if (!(0, common_js_1.isValidDescription)(feedback)) {
1043
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
1016
+ if (!isValidDescription(feedback)) {
1017
+ W_ERROR(WErrors.InvalidParam, `Feedback ${feedback} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
1044
1018
  }
1045
1019
  if (passport) {
1046
1020
  tx.moveCall({
1047
- target: (0, common_js_1.arbitrationFn)(`reset_with_passport`),
1021
+ target: arbitrationFn(`reset_with_passport`),
1048
1022
  arguments: [
1049
- (0, common_js_1.toTxObject)(tx, arbitration),
1050
- (0, common_js_1.toTxObject)(tx, permission),
1023
+ toTxObject(tx, arbitration),
1024
+ toTxObject(tx, permission),
1051
1025
  passport,
1052
- (0, common_js_1.toTxObject)(tx, arb),
1026
+ toTxObject(tx, arb),
1053
1027
  tx.pure.string(feedback),
1054
1028
  ],
1055
1029
  typeArguments: [parameter_type],
@@ -1057,30 +1031,30 @@ function reset(tx, arbitration, parameter_type, permission, arb, feedback, passp
1057
1031
  }
1058
1032
  else {
1059
1033
  tx.moveCall({
1060
- target: (0, common_js_1.arbitrationFn)(`reset`),
1034
+ target: arbitrationFn(`reset`),
1061
1035
  arguments: [
1062
- (0, common_js_1.toTxObject)(tx, arbitration),
1063
- (0, common_js_1.toTxObject)(tx, permission),
1064
- (0, common_js_1.toTxObject)(tx, arb),
1036
+ toTxObject(tx, arbitration),
1037
+ toTxObject(tx, permission),
1038
+ toTxObject(tx, arb),
1065
1039
  tx.pure.string(feedback),
1066
1040
  ],
1067
1041
  typeArguments: [parameter_type],
1068
1042
  });
1069
1043
  }
1070
1044
  }
1071
- function arb_withdraw(tx, arbitration, parameter_type, permission, arb, passport) {
1072
- (0, util_js_1.validObjects)([arbitration, permission, arb]);
1073
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
1074
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1045
+ export function arb_withdraw(tx, arbitration, parameter_type, permission, arb, passport) {
1046
+ validObjects([arbitration, permission, arb]);
1047
+ if (!IsValidArgType(parameter_type)) {
1048
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1075
1049
  }
1076
1050
  if (passport) {
1077
1051
  tx.moveCall({
1078
- target: (0, common_js_1.arbitrationFn)(`arb_withdraw_with_passport`),
1052
+ target: arbitrationFn(`arb_withdraw_with_passport`),
1079
1053
  arguments: [
1080
- (0, common_js_1.toTxObject)(tx, arbitration),
1081
- (0, common_js_1.toTxObject)(tx, permission),
1054
+ toTxObject(tx, arbitration),
1055
+ toTxObject(tx, permission),
1082
1056
  passport,
1083
- (0, common_js_1.toTxObject)(tx, arb),
1057
+ toTxObject(tx, arb),
1084
1058
  tx.object.clock(),
1085
1059
  ],
1086
1060
  typeArguments: [parameter_type],
@@ -1088,36 +1062,36 @@ function arb_withdraw(tx, arbitration, parameter_type, permission, arb, passport
1088
1062
  }
1089
1063
  else {
1090
1064
  tx.moveCall({
1091
- target: (0, common_js_1.arbitrationFn)(`arb_withdraw`),
1065
+ target: arbitrationFn(`arb_withdraw`),
1092
1066
  arguments: [
1093
- (0, common_js_1.toTxObject)(tx, arbitration),
1094
- (0, common_js_1.toTxObject)(tx, permission),
1095
- (0, common_js_1.toTxObject)(tx, arb),
1067
+ toTxObject(tx, arbitration),
1068
+ toTxObject(tx, permission),
1069
+ toTxObject(tx, arb),
1096
1070
  tx.object.clock(),
1097
1071
  ],
1098
1072
  typeArguments: [parameter_type],
1099
1073
  });
1100
1074
  }
1101
1075
  }
1102
- function fees_alloc(tx, arbitration, parameter_type, permission, allocation, payment_remark, payment_index, passport) {
1103
- (0, util_js_1.validObjects)([arbitration, permission, allocation]);
1104
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
1105
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1076
+ export function fees_alloc(tx, arbitration, parameter_type, permission, allocation, payment_remark, payment_index, passport) {
1077
+ validObjects([arbitration, permission, allocation]);
1078
+ if (!IsValidArgType(parameter_type)) {
1079
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1106
1080
  }
1107
- if (!(0, common_js_1.isValidDescription)(payment_remark)) {
1108
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Payment remark ${payment_remark} exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
1081
+ if (!isValidDescription(payment_remark)) {
1082
+ W_ERROR(WErrors.InvalidParam, `Payment remark ${payment_remark} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
1109
1083
  }
1110
- if (!(0, common_js_1.isValidU64)(payment_index)) {
1111
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Payment index ${payment_index} must be u64 number`);
1084
+ if (!isValidU64(payment_index)) {
1085
+ W_ERROR(WErrors.InvalidParam, `Payment index ${payment_index} must be u64 number`);
1112
1086
  }
1113
1087
  if (passport) {
1114
1088
  return tx.moveCall({
1115
- target: (0, common_js_1.arbitrationFn)(`fees_alloc_with_passport`),
1089
+ target: arbitrationFn(`fees_alloc_with_passport`),
1116
1090
  arguments: [
1117
- (0, common_js_1.toTxObject)(tx, arbitration),
1118
- (0, common_js_1.toTxObject)(tx, permission),
1091
+ toTxObject(tx, arbitration),
1092
+ toTxObject(tx, permission),
1119
1093
  passport,
1120
- (0, common_js_1.toTxObject)(tx, allocation),
1094
+ toTxObject(tx, allocation),
1121
1095
  tx.pure.string(payment_remark),
1122
1096
  tx.pure.u64(payment_index),
1123
1097
  tx.object.mutRegistrar(),
@@ -1128,11 +1102,11 @@ function fees_alloc(tx, arbitration, parameter_type, permission, allocation, pay
1128
1102
  }
1129
1103
  else {
1130
1104
  return tx.moveCall({
1131
- target: (0, common_js_1.arbitrationFn)(`fees_alloc`),
1105
+ target: arbitrationFn(`fees_alloc`),
1132
1106
  arguments: [
1133
- (0, common_js_1.toTxObject)(tx, arbitration),
1134
- (0, common_js_1.toTxObject)(tx, permission),
1135
- (0, common_js_1.toTxObject)(tx, allocation),
1107
+ toTxObject(tx, arbitration),
1108
+ toTxObject(tx, permission),
1109
+ toTxObject(tx, allocation),
1136
1110
  tx.pure.string(payment_remark),
1137
1111
  tx.pure.u64(payment_index),
1138
1112
  tx.object.mutRegistrar(),
@@ -1142,25 +1116,25 @@ function fees_alloc(tx, arbitration, parameter_type, permission, allocation, pay
1142
1116
  });
1143
1117
  }
1144
1118
  }
1145
- function fees_transfer(tx, arbitration, parameter_type, permission, treasury, payment_remark, payment_index, passport) {
1146
- (0, util_js_1.validObjects)([arbitration, permission, treasury]);
1147
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
1148
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1119
+ export function fees_transfer(tx, arbitration, parameter_type, permission, treasury, payment_remark, payment_index, passport) {
1120
+ validObjects([arbitration, permission, treasury]);
1121
+ if (!IsValidArgType(parameter_type)) {
1122
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1149
1123
  }
1150
- if (!(0, common_js_1.isValidDescription)(payment_remark)) {
1151
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Payment remark ${payment_remark} exceeds maximum length ${common_js_1.MAX_DESCRIPTION_LENGTH}`);
1124
+ if (!isValidDescription(payment_remark)) {
1125
+ W_ERROR(WErrors.InvalidParam, `Payment remark ${payment_remark} exceeds maximum length ${MAX_DESCRIPTION_LENGTH}`);
1152
1126
  }
1153
- if (!(0, common_js_1.isValidU64)(payment_index)) {
1154
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Payment index ${payment_index} must be u64 number`);
1127
+ if (!isValidU64(payment_index)) {
1128
+ W_ERROR(WErrors.InvalidParam, `Payment index ${payment_index} must be u64 number`);
1155
1129
  }
1156
1130
  if (passport) {
1157
1131
  return tx.moveCall({
1158
- target: (0, common_js_1.arbitrationFn)(`fees_transfer_with_passport`),
1132
+ target: arbitrationFn(`fees_transfer_with_passport`),
1159
1133
  arguments: [
1160
- (0, common_js_1.toTxObject)(tx, arbitration),
1161
- (0, common_js_1.toTxObject)(tx, permission),
1134
+ toTxObject(tx, arbitration),
1135
+ toTxObject(tx, permission),
1162
1136
  passport,
1163
- (0, common_js_1.toTxObject)(tx, treasury),
1137
+ toTxObject(tx, treasury),
1164
1138
  tx.pure.string(payment_remark),
1165
1139
  tx.pure.u64(payment_index),
1166
1140
  tx.object.mutRegistrar(),
@@ -1171,11 +1145,11 @@ function fees_transfer(tx, arbitration, parameter_type, permission, treasury, pa
1171
1145
  }
1172
1146
  else {
1173
1147
  return tx.moveCall({
1174
- target: (0, common_js_1.arbitrationFn)(`fees_transfer`),
1148
+ target: arbitrationFn(`fees_transfer`),
1175
1149
  arguments: [
1176
- (0, common_js_1.toTxObject)(tx, arbitration),
1177
- (0, common_js_1.toTxObject)(tx, permission),
1178
- (0, common_js_1.toTxObject)(tx, treasury),
1150
+ toTxObject(tx, arbitration),
1151
+ toTxObject(tx, permission),
1152
+ toTxObject(tx, treasury),
1179
1153
  tx.pure.string(payment_remark),
1180
1154
  tx.pure.u64(payment_index),
1181
1155
  tx.object.mutRegistrar(),
@@ -1185,20 +1159,20 @@ function fees_transfer(tx, arbitration, parameter_type, permission, treasury, pa
1185
1159
  });
1186
1160
  }
1187
1161
  }
1188
- function um_set(tx, arbitration, parameter_type, permission, um, passport) {
1189
- (0, util_js_1.validObjects)([arbitration, permission]);
1190
- if (!(0, common_js_1.IsValidArgType)(parameter_type)) {
1191
- (0, exception_js_1.W_ERROR)(exception_js_1.WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1162
+ export function um_set(tx, arbitration, parameter_type, permission, um, passport) {
1163
+ validObjects([arbitration, permission]);
1164
+ if (!IsValidArgType(parameter_type)) {
1165
+ W_ERROR(WErrors.InvalidParam, `Arbitration type ${parameter_type} is not valid`);
1192
1166
  }
1193
1167
  if (um) {
1194
1168
  if (passport) {
1195
1169
  tx.moveCall({
1196
- target: (0, common_js_1.arbitrationFn)(`um_set_with_passport`),
1170
+ target: arbitrationFn(`um_set_with_passport`),
1197
1171
  arguments: [
1198
- (0, common_js_1.toTxObject)(tx, arbitration),
1199
- (0, common_js_1.toTxObject)(tx, permission),
1172
+ toTxObject(tx, arbitration),
1173
+ toTxObject(tx, permission),
1200
1174
  passport,
1201
- (0, common_js_1.toTxObject)(tx, um),
1175
+ toTxObject(tx, um),
1202
1176
  tx.object.mutRegistrar(),
1203
1177
  tx.object.clock(),
1204
1178
  ],
@@ -1207,11 +1181,11 @@ function um_set(tx, arbitration, parameter_type, permission, um, passport) {
1207
1181
  }
1208
1182
  else {
1209
1183
  tx.moveCall({
1210
- target: (0, common_js_1.arbitrationFn)(`um_set`),
1184
+ target: arbitrationFn(`um_set`),
1211
1185
  arguments: [
1212
- (0, common_js_1.toTxObject)(tx, arbitration),
1213
- (0, common_js_1.toTxObject)(tx, permission),
1214
- (0, common_js_1.toTxObject)(tx, um),
1186
+ toTxObject(tx, arbitration),
1187
+ toTxObject(tx, permission),
1188
+ toTxObject(tx, um),
1215
1189
  tx.object.mutRegistrar(),
1216
1190
  tx.object.clock(),
1217
1191
  ],
@@ -1222,10 +1196,10 @@ function um_set(tx, arbitration, parameter_type, permission, um, passport) {
1222
1196
  else {
1223
1197
  if (passport) {
1224
1198
  tx.moveCall({
1225
- target: (0, common_js_1.arbitrationFn)(`um_none_with_passport`),
1199
+ target: arbitrationFn(`um_none_with_passport`),
1226
1200
  arguments: [
1227
- (0, common_js_1.toTxObject)(tx, arbitration),
1228
- (0, common_js_1.toTxObject)(tx, permission),
1201
+ toTxObject(tx, arbitration),
1202
+ toTxObject(tx, permission),
1229
1203
  passport,
1230
1204
  tx.object.mutRegistrar(),
1231
1205
  ],
@@ -1234,10 +1208,10 @@ function um_set(tx, arbitration, parameter_type, permission, um, passport) {
1234
1208
  }
1235
1209
  else {
1236
1210
  tx.moveCall({
1237
- target: (0, common_js_1.arbitrationFn)(`um_none`),
1211
+ target: arbitrationFn(`um_none`),
1238
1212
  arguments: [
1239
- (0, common_js_1.toTxObject)(tx, arbitration),
1240
- (0, common_js_1.toTxObject)(tx, permission),
1213
+ toTxObject(tx, arbitration),
1214
+ toTxObject(tx, permission),
1241
1215
  tx.object.mutRegistrar(),
1242
1216
  ],
1243
1217
  typeArguments: [parameter_type],