wowok 2.1.40 → 2.1.41

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