@zing-protocol/zing-sdk 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/dist/_generated/index.js +6 -0
  2. package/dist/_generated/utils/index.d.ts +12 -0
  3. package/dist/_generated/utils/index.js +135 -0
  4. package/dist/_generated/zing_framework/coin_utils.d.ts +15 -0
  5. package/dist/_generated/zing_framework/coin_utils.js +19 -0
  6. package/dist/_generated/zing_framework/deps/sui/object.d.ts +8 -0
  7. package/{src/_generated/zing_governance/deps/sui/object.ts → dist/_generated/zing_framework/deps/sui/object.js} +4 -7
  8. package/dist/_generated/zing_framework/derived_object_bag.d.ts +166 -0
  9. package/dist/_generated/zing_framework/derived_object_bag.js +221 -0
  10. package/dist/_generated/zing_framework/derived_table.d.ts +153 -0
  11. package/dist/_generated/zing_framework/derived_table.js +200 -0
  12. package/dist/_generated/zing_governance/admin.d.ts +20 -0
  13. package/dist/_generated/zing_governance/admin.js +26 -0
  14. package/dist/_generated/zing_governance/deps/sui/object.d.ts +8 -0
  15. package/{src/_generated/zing_identity/deps/sui/object.ts → dist/_generated/zing_governance/deps/sui/object.js} +4 -7
  16. package/dist/_generated/zing_governance/treasury.d.ts +56 -0
  17. package/dist/_generated/zing_governance/treasury.js +78 -0
  18. package/dist/_generated/zing_identity/config.d.ts +87 -0
  19. package/dist/_generated/zing_identity/config.js +98 -0
  20. package/{src/_generated/zing_studio/deps/std/type_name.ts → dist/_generated/zing_identity/deps/std/type_name.d.ts} +3 -11
  21. package/dist/_generated/zing_identity/deps/std/type_name.js +22 -0
  22. package/dist/_generated/zing_identity/deps/sui/object.d.ts +8 -0
  23. package/{src/_generated/zing_studio/deps/sui/object.ts → dist/_generated/zing_identity/deps/sui/object.js} +4 -7
  24. package/dist/_generated/zing_identity/deps/sui/object_table.d.ts +12 -0
  25. package/{src/_generated/zing_identity/deps/sui/object_table.ts → dist/_generated/zing_identity/deps/sui/object_table.js} +7 -10
  26. package/dist/_generated/zing_identity/deps/sui/table.d.ts +12 -0
  27. package/{src/_generated/zing_studio/deps/sui/table.ts → dist/_generated/zing_identity/deps/sui/table.js} +7 -10
  28. package/{src/_generated/zing_identity/deps/sui/vec_set.ts → dist/_generated/zing_identity/deps/sui/vec_set.d.ts} +3 -14
  29. package/dist/_generated/zing_identity/deps/sui/vec_set.js +22 -0
  30. package/dist/_generated/zing_identity/ecdsa.d.ts +81 -0
  31. package/dist/_generated/zing_identity/ecdsa.js +87 -0
  32. package/dist/_generated/zing_identity/identity.d.ts +262 -0
  33. package/dist/_generated/zing_identity/identity.js +294 -0
  34. package/dist/_generated/zing_identity/reclaim.d.ts +356 -0
  35. package/dist/_generated/zing_identity/reclaim.js +414 -0
  36. package/dist/_generated/zing_studio/app.d.ts +351 -0
  37. package/dist/_generated/zing_studio/app.js +451 -0
  38. package/dist/_generated/zing_studio/article.d.ts +331 -0
  39. package/dist/_generated/zing_studio/article.js +331 -0
  40. package/dist/_generated/zing_studio/config.d.ts +203 -0
  41. package/dist/_generated/zing_studio/config.js +233 -0
  42. package/{src/_generated/zing_identity/deps/std/type_name.ts → dist/_generated/zing_studio/deps/std/type_name.d.ts} +3 -11
  43. package/dist/_generated/zing_studio/deps/std/type_name.js +22 -0
  44. package/dist/_generated/zing_studio/deps/sui/bag.d.ts +12 -0
  45. package/{src/_generated/zing_studio/deps/sui/bag.ts → dist/_generated/zing_studio/deps/sui/bag.js} +7 -10
  46. package/dist/_generated/zing_studio/deps/sui/balance.d.ts +12 -0
  47. package/{src/_generated/zing_studio/deps/sui/balance.ts → dist/_generated/zing_studio/deps/sui/balance.js} +4 -7
  48. package/dist/_generated/zing_studio/deps/sui/coin.d.ts +12 -0
  49. package/{src/_generated/zing_studio/deps/sui/coin.ts → dist/_generated/zing_studio/deps/sui/coin.js} +5 -8
  50. package/dist/_generated/zing_studio/deps/sui/dynamic_field.d.ts +126 -0
  51. package/dist/_generated/zing_studio/deps/sui/dynamic_field.js +140 -0
  52. package/dist/_generated/zing_studio/deps/sui/object.d.ts +8 -0
  53. package/{src/_generated/zing_framework/deps/sui/object.ts → dist/_generated/zing_studio/deps/sui/object.js} +4 -7
  54. package/dist/_generated/zing_studio/deps/sui/table.d.ts +12 -0
  55. package/{src/_generated/zing_identity/deps/sui/table.ts → dist/_generated/zing_studio/deps/sui/table.js} +7 -10
  56. package/dist/_generated/zing_studio/deps/sui/vec_map.d.ts +30 -0
  57. package/{src/_generated/zing_studio/deps/sui/vec_map.ts → dist/_generated/zing_studio/deps/sui/vec_map.js} +15 -21
  58. package/{src/_generated/zing_studio/deps/sui/vec_set.ts → dist/_generated/zing_studio/deps/sui/vec_set.d.ts} +3 -14
  59. package/dist/_generated/zing_studio/deps/sui/vec_set.js +22 -0
  60. package/dist/_generated/zing_studio/deps/walrus/blob.d.ts +20 -0
  61. package/{src/_generated/zing_studio/deps/walrus/blob.ts → dist/_generated/zing_studio/deps/walrus/blob.js} +11 -12
  62. package/dist/_generated/zing_studio/deps/walrus/events.d.ts +83 -0
  63. package/dist/_generated/zing_studio/deps/walrus/events.js +122 -0
  64. package/dist/_generated/zing_studio/deps/walrus/metadata.d.ts +71 -0
  65. package/dist/_generated/zing_studio/deps/walrus/metadata.js +73 -0
  66. package/dist/_generated/zing_studio/deps/walrus/storage_resource.d.ts +12 -0
  67. package/{src/_generated/zing_studio/deps/walrus/storage_resource.ts → dist/_generated/zing_studio/deps/walrus/storage_resource.js} +7 -8
  68. package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.d.ts +12 -0
  69. package/{src/_generated/zing_studio/deps/zing_framework/derived_object_bag.ts → dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.js} +7 -8
  70. package/dist/_generated/zing_studio/deps/zing_framework/derived_table.d.ts +12 -0
  71. package/{src/_generated/zing_studio/deps/zing_framework/derived_table.ts → dist/_generated/zing_studio/deps/zing_framework/derived_table.js} +7 -8
  72. package/dist/_generated/zing_studio/donation.d.ts +24 -0
  73. package/{src/_generated/zing_studio/donation.ts → dist/_generated/zing_studio/donation.js} +7 -8
  74. package/dist/_generated/zing_studio/enclave.d.ts +187 -0
  75. package/dist/_generated/zing_studio/enclave.js +231 -0
  76. package/dist/_generated/zing_studio/nitro_attestation.d.ts +148 -0
  77. package/dist/_generated/zing_studio/nitro_attestation.js +183 -0
  78. package/dist/_generated/zing_studio/referral.d.ts +166 -0
  79. package/dist/_generated/zing_studio/referral.js +224 -0
  80. package/dist/_generated/zing_studio/storage.d.ts +327 -0
  81. package/dist/_generated/zing_studio/storage.js +365 -0
  82. package/dist/_generated/zing_studio/studio.d.ts +282 -0
  83. package/dist/_generated/zing_studio/studio.js +360 -0
  84. package/dist/bcs.d.ts +61 -0
  85. package/dist/bcs.js +109 -0
  86. package/dist/client/index.d.ts +228 -0
  87. package/dist/client/index.js +296 -0
  88. package/dist/client/types.d.ts +23 -0
  89. package/dist/client/types.js +1 -0
  90. package/dist/components/index.js +3 -0
  91. package/dist/components/wallet-provider.d.ts +7 -0
  92. package/dist/components/wallet-provider.js +33 -0
  93. package/dist/components/walrus-provider.d.ts +31 -0
  94. package/dist/components/walrus-provider.js +71 -0
  95. package/dist/components/zing-provider.d.ts +15 -0
  96. package/dist/components/zing-provider.js +22 -0
  97. package/dist/config/common.d.ts +23 -0
  98. package/dist/config/common.js +61 -0
  99. package/dist/config/index.d.ts +8 -0
  100. package/dist/config/index.js +28 -0
  101. package/dist/config/mainnet.d.ts +6 -0
  102. package/dist/config/mainnet.js +80 -0
  103. package/dist/config/testnet.d.ts +6 -0
  104. package/dist/config/testnet.js +81 -0
  105. package/dist/config/types.d.ts +49 -0
  106. package/dist/config/types.js +1 -0
  107. package/dist/const.d.ts +4 -0
  108. package/dist/const.js +25 -0
  109. package/dist/getters.d.ts +228 -0
  110. package/dist/getters.js +317 -0
  111. package/{src/hooks/index.ts → dist/hooks/index.d.ts} +2 -3
  112. package/dist/hooks/index.js +9 -0
  113. package/dist/hooks/useGetStudio.d.ts +26 -0
  114. package/dist/hooks/useGetStudio.js +17 -0
  115. package/dist/hooks/useGetTierPlan.d.ts +7 -0
  116. package/dist/hooks/useGetTierPlan.js +85 -0
  117. package/dist/hooks/useReclaim.d.ts +12 -0
  118. package/dist/hooks/useReclaim.js +87 -0
  119. package/dist/hooks/useSignAndExecuteTransaction.d.ts +6 -0
  120. package/dist/hooks/useSignAndExecuteTransaction.js +40 -0
  121. package/dist/hooks/useSignPersonalMessage.d.ts +8 -0
  122. package/dist/hooks/useSignPersonalMessage.js +21 -0
  123. package/dist/hooks/useZingInfiniteQueries.d.ts +75 -0
  124. package/dist/hooks/useZingInfiniteQueries.js +28 -0
  125. package/dist/hooks/useZingMutation.d.ts +35 -0
  126. package/dist/hooks/useZingMutation.js +37 -0
  127. package/dist/hooks/useZingQueries.d.ts +127 -0
  128. package/dist/hooks/useZingQueries.js +37 -0
  129. package/dist/hooks/useZingQuery.d.ts +147 -0
  130. package/dist/hooks/useZingQuery.js +34 -0
  131. package/{src/index.ts → dist/index.d.ts} +2 -3
  132. package/dist/index.js +9 -0
  133. package/dist/lib/utils/colorful-logger.d.ts +2 -0
  134. package/dist/lib/utils/colorful-logger.js +23 -0
  135. package/dist/lib/utils/const.d.ts +25 -0
  136. package/dist/lib/utils/const.js +25 -0
  137. package/dist/lib/utils/helpers.d.ts +10 -0
  138. package/dist/lib/utils/helpers.js +49 -0
  139. package/dist/lib/utils/index.js +4 -0
  140. package/dist/lib/utils/init-app-with-shadow.d.ts +6 -0
  141. package/dist/lib/utils/init-app-with-shadow.js +28 -0
  142. package/dist/lib/utils/quilt.d.ts +61 -0
  143. package/dist/lib/utils/quilt.js +194 -0
  144. package/dist/lib/utils/reclaim.d.ts +29 -0
  145. package/dist/lib/utils/reclaim.js +88 -0
  146. package/dist/lib/utils/types.d.ts +5 -0
  147. package/dist/lib/utils/types.js +1 -0
  148. package/dist/mutations/index.js +3 -0
  149. package/dist/mutations/seal.d.ts +12 -0
  150. package/dist/mutations/seal.js +41 -0
  151. package/dist/mutations/signer.d.ts +10 -0
  152. package/dist/mutations/signer.js +176 -0
  153. package/dist/mutations/walrus.d.ts +98 -0
  154. package/dist/mutations/walrus.js +488 -0
  155. package/dist/stores/index.js +3 -0
  156. package/dist/stores/walletStore.d.ts +48 -0
  157. package/dist/stores/walletStore.js +232 -0
  158. package/dist/stores/walrusStore.d.ts +28 -0
  159. package/dist/stores/walrusStore.js +61 -0
  160. package/dist/stores/zkloginStore.d.ts +28 -0
  161. package/dist/stores/zkloginStore.js +27 -0
  162. package/dist/types.d.ts +99 -0
  163. package/dist/types.js +1 -0
  164. package/package.json +14 -6
  165. package/src/_generated/utils/index.ts +0 -181
  166. package/src/_generated/zing_framework/coin_utils.ts +0 -41
  167. package/src/_generated/zing_framework/derived_object_bag.ts +0 -400
  168. package/src/_generated/zing_framework/derived_table.ts +0 -366
  169. package/src/_generated/zing_governance/admin.ts +0 -47
  170. package/src/_generated/zing_governance/treasury.ts +0 -134
  171. package/src/_generated/zing_identity/config.ts +0 -191
  172. package/src/_generated/zing_identity/ecdsa.ts +0 -166
  173. package/src/_generated/zing_identity/identity.ts +0 -661
  174. package/src/_generated/zing_identity/reclaim.ts +0 -803
  175. package/src/_generated/zing_studio/app.ts +0 -855
  176. package/src/_generated/zing_studio/article.ts +0 -598
  177. package/src/_generated/zing_studio/config.ts +0 -475
  178. package/src/_generated/zing_studio/deps/sui/dynamic_field.ts +0 -272
  179. package/src/_generated/zing_studio/deps/walrus/events.ts +0 -124
  180. package/src/_generated/zing_studio/deps/walrus/metadata.ts +0 -137
  181. package/src/_generated/zing_studio/enclave.ts +0 -466
  182. package/src/_generated/zing_studio/nitro_attestation.ts +0 -308
  183. package/src/_generated/zing_studio/referral.ts +0 -447
  184. package/src/_generated/zing_studio/storage.ts +0 -664
  185. package/src/_generated/zing_studio/studio.ts +0 -682
  186. package/src/bcs.ts +0 -139
  187. package/src/client/index.ts +0 -557
  188. package/src/client/types.ts +0 -28
  189. package/src/components/wallet-provider.tsx +0 -53
  190. package/src/components/walrus-provider.tsx +0 -212
  191. package/src/components/zing-provider.tsx +0 -54
  192. package/src/config/common.ts +0 -82
  193. package/src/config/index.ts +0 -45
  194. package/src/config/mainnet.ts +0 -109
  195. package/src/config/testnet.ts +0 -111
  196. package/src/config/types.ts +0 -69
  197. package/src/const.ts +0 -32
  198. package/src/getters.ts +0 -523
  199. package/src/hooks/useGetStudio.ts +0 -22
  200. package/src/hooks/useGetTierPlan.ts +0 -115
  201. package/src/hooks/useReclaim.ts +0 -165
  202. package/src/hooks/useSignAndExecuteTransaction.ts +0 -57
  203. package/src/hooks/useSignPersonalMessage.ts +0 -28
  204. package/src/hooks/useZingInfiniteQueries.ts +0 -92
  205. package/src/hooks/useZingMutation.ts +0 -66
  206. package/src/hooks/useZingQueries.ts +0 -107
  207. package/src/hooks/useZingQuery.ts +0 -88
  208. package/src/lib/utils/colorful-logger.ts +0 -27
  209. package/src/lib/utils/const.ts +0 -25
  210. package/src/lib/utils/helpers.ts +0 -78
  211. package/src/lib/utils/init-app-with-shadow.ts +0 -42
  212. package/src/lib/utils/quilt.ts +0 -317
  213. package/src/lib/utils/reclaim.ts +0 -148
  214. package/src/lib/utils/types.ts +0 -14
  215. package/src/mutations/seal.ts +0 -78
  216. package/src/mutations/signer.ts +0 -241
  217. package/src/mutations/walrus.ts +0 -862
  218. package/src/stores/walletStore.ts +0 -360
  219. package/src/stores/walrusStore.ts +0 -118
  220. package/src/stores/zkloginStore.ts +0 -53
  221. package/src/types.ts +0 -120
  222. package/tsconfig.json +0 -12
  223. /package/{src/_generated/index.js → dist/_generated/index.d.ts} +0 -0
  224. /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
  225. /package/{src/lib/utils/index.ts → dist/lib/utils/index.d.ts} +0 -0
  226. /package/{src/mutations/index.ts → dist/mutations/index.d.ts} +0 -0
  227. /package/{src/stores/index.ts → dist/stores/index.d.ts} +0 -0
@@ -0,0 +1,98 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import * as type_name from "./deps/std/type_name.js";
5
+ import * as object from "./deps/sui/object.js";
6
+ import * as vec_set from "./deps/sui/vec_set.js";
7
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
8
+ import { bcs } from "@mysten/sui/bcs";
9
+ const $moduleName = "@local-pkg/zing_identity::config";
10
+ export const Config = new MoveStruct({
11
+ name: `${$moduleName}::Config`,
12
+ fields: {
13
+ id: object.UID,
14
+ registry: vec_set.VecSet(type_name.TypeName),
15
+ versions: vec_set.VecSet(bcs.u64()),
16
+ base_read_fee: bcs.u64(),
17
+ },
18
+ });
19
+ export function packageVersion(options = {}) {
20
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
21
+ return (tx) => tx.moveCall({
22
+ package: packageAddress,
23
+ module: "config",
24
+ function: "package_version",
25
+ });
26
+ }
27
+ export function baseReadFee(options) {
28
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
29
+ const argumentsTypes = [
30
+ `${packageAddress}::config::Config`,
31
+ ];
32
+ const parameterNames = ["self"];
33
+ return (tx) => tx.moveCall({
34
+ package: packageAddress,
35
+ module: "config",
36
+ function: "base_read_fee",
37
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
38
+ });
39
+ }
40
+ export function addVersion(options) {
41
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
42
+ const argumentsTypes = [
43
+ `${packageAddress}::config::Config`,
44
+ `${packageAddress}::admin::AdminCap`,
45
+ "u64",
46
+ ];
47
+ const parameterNames = ["self", "Cap", "version"];
48
+ return (tx) => tx.moveCall({
49
+ package: packageAddress,
50
+ module: "config",
51
+ function: "add_version",
52
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
53
+ });
54
+ }
55
+ export function removeVersion(options) {
56
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
57
+ const argumentsTypes = [
58
+ `${packageAddress}::config::Config`,
59
+ `${packageAddress}::admin::AdminCap`,
60
+ "u64",
61
+ ];
62
+ const parameterNames = ["self", "Cap", "version"];
63
+ return (tx) => tx.moveCall({
64
+ package: packageAddress,
65
+ module: "config",
66
+ function: "remove_version",
67
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
68
+ });
69
+ }
70
+ export function updateReadFee(options) {
71
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
72
+ const argumentsTypes = [
73
+ `${packageAddress}::config::Config`,
74
+ `${packageAddress}::admin::AdminCap`,
75
+ "u64",
76
+ ];
77
+ const parameterNames = ["self", "Cap", "fee"];
78
+ return (tx) => tx.moveCall({
79
+ package: packageAddress,
80
+ module: "config",
81
+ function: "update_read_fee",
82
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
83
+ });
84
+ }
85
+ export function derivedObjectKey(options) {
86
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
87
+ const argumentsTypes = [
88
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
89
+ ];
90
+ const parameterNames = ["name"];
91
+ return (tx) => tx.moveCall({
92
+ package: packageAddress,
93
+ module: "config",
94
+ function: "derived_object_key",
95
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
96
+ typeArguments: options.typeArguments,
97
+ });
98
+ }
@@ -1,16 +1,9 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
-
5
4
  /** Functionality for converting Move types into values. Use with care! */
6
-
7
5
  import { MoveStruct } from "../../../utils/index.js";
8
- import { bcs } from "@mysten/sui/bcs";
9
-
10
- const $moduleName = "std::type_name";
11
- export const TypeName = new MoveStruct({
12
- name: `${$moduleName}::TypeName`,
13
- fields: {
6
+ export declare const TypeName: MoveStruct<{
14
7
  /**
15
8
  * String representation of the type. All types are represented using their source
16
9
  * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
@@ -20,6 +13,5 @@ export const TypeName = new MoveStruct({
20
13
  * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
21
14
  * 32 depending on the Move platform)
22
15
  */
23
- name: bcs.string(),
24
- },
25
- });
16
+ name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
17
+ }, "std::type_name::TypeName">;
@@ -0,0 +1,22 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Functionality for converting Move types into values. Use with care! */
5
+ import { MoveStruct } from "../../../utils/index.js";
6
+ import { bcs } from "@mysten/sui/bcs";
7
+ const $moduleName = "std::type_name";
8
+ export const TypeName = new MoveStruct({
9
+ name: `${$moduleName}::TypeName`,
10
+ fields: {
11
+ /**
12
+ * String representation of the type. All types are represented using their source
13
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
14
+ * Struct types are represented as fully qualified type names; e.g.
15
+ * `00000000000000000000000000000001::string::String` or
16
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
17
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
18
+ * 32 depending on the Move platform)
19
+ */
20
+ name: bcs.string(),
21
+ },
22
+ });
@@ -0,0 +1,8 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Sui object identifiers */
5
+ import { MoveStruct } from "../../../utils/index.js";
6
+ export declare const UID: MoveStruct<{
7
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
8
+ }, "0x2::object::UID">;
@@ -1,16 +1,13 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
-
5
4
  /** Sui object identifiers */
6
-
7
5
  import { MoveStruct } from "../../../utils/index.js";
8
6
  import { bcs } from "@mysten/sui/bcs";
9
-
10
7
  const $moduleName = "0x2::object";
11
8
  export const UID = new MoveStruct({
12
- name: `${$moduleName}::UID`,
13
- fields: {
14
- id: bcs.Address,
15
- },
9
+ name: `${$moduleName}::UID`,
10
+ fields: {
11
+ id: bcs.Address,
12
+ },
16
13
  });
@@ -0,0 +1,12 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { MoveStruct } from "../../../utils/index.js";
5
+ export declare const ObjectTable: MoveStruct<{
6
+ /** the ID of this table */
7
+ id: MoveStruct<{
8
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
9
+ }, "0x2::object::UID">;
10
+ /** the number of key-value pairs in the table */
11
+ size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
12
+ }, "0x2::object_table::ObjectTable">;
@@ -1,7 +1,6 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
-
5
4
  /**
6
5
  * Similar to `sui::table`, an `ObjectTable<K, V>` is a map-like collection. But
7
6
  * unlike `sui::table`, the values bound to these dynamic fields _must_ be objects
@@ -9,18 +8,16 @@
9
8
  * may be important for external tools. The difference is otherwise not observable
10
9
  * from within Move.
11
10
  */
12
-
13
11
  import * as object from "./object.js";
14
12
  import { MoveStruct } from "../../../utils/index.js";
15
13
  import { bcs } from "@mysten/sui/bcs";
16
-
17
14
  const $moduleName = "0x2::object_table";
18
15
  export const ObjectTable = new MoveStruct({
19
- name: `${$moduleName}::ObjectTable`,
20
- fields: {
21
- /** the ID of this table */
22
- id: object.UID,
23
- /** the number of key-value pairs in the table */
24
- size: bcs.u64(),
25
- },
16
+ name: `${$moduleName}::ObjectTable`,
17
+ fields: {
18
+ /** the ID of this table */
19
+ id: object.UID,
20
+ /** the number of key-value pairs in the table */
21
+ size: bcs.u64(),
22
+ },
26
23
  });
@@ -0,0 +1,12 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { MoveStruct } from "../../../utils/index.js";
5
+ export declare const Table: MoveStruct<{
6
+ /** the ID of this table */
7
+ id: MoveStruct<{
8
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
9
+ }, "0x2::object::UID">;
10
+ /** the number of key-value pairs in the table */
11
+ size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
12
+ }, "0x2::table::Table">;
@@ -1,7 +1,6 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
-
5
4
  /**
6
5
  * A table is a map-like collection. But unlike a traditional collection, it's keys
7
6
  * and values are not stored within the `Table` value, but instead are stored using
@@ -21,18 +20,16 @@
21
20
  * assert!(&table1 != &table2);
22
21
  * ```
23
22
  */
24
-
25
23
  import * as object from "./object.js";
26
24
  import { MoveStruct } from "../../../utils/index.js";
27
25
  import { bcs } from "@mysten/sui/bcs";
28
-
29
26
  const $moduleName = "0x2::table";
30
27
  export const Table = new MoveStruct({
31
- name: `${$moduleName}::Table`,
32
- fields: {
33
- /** the ID of this table */
34
- id: object.UID,
35
- /** the number of key-value pairs in the table */
36
- size: bcs.u64(),
37
- },
28
+ name: `${$moduleName}::Table`,
29
+ fields: {
30
+ /** the ID of this table */
31
+ id: object.UID,
32
+ /** the number of key-value pairs in the table */
33
+ size: bcs.u64(),
34
+ },
38
35
  });
@@ -4,8 +4,6 @@
4
4
  import { MoveStruct } from "../../../utils/index.js";
5
5
  import { bcs } from "@mysten/sui/bcs";
6
6
  import type { BcsType } from "@mysten/sui/bcs";
7
-
8
- const $moduleName = "0x2::vec_set";
9
7
  /**
10
8
  * A set data structure backed by a vector. The set is guaranteed not to contain
11
9
  * duplicate keys. All operations are O(N) in the size of the set
@@ -14,15 +12,6 @@ const $moduleName = "0x2::vec_set";
14
12
  * programming against a set API. Sets that need sorted iteration rather than
15
13
  * insertion order iteration should be handwritten.
16
14
  */
17
- export function VecSet<K extends BcsType<any>>(
18
- ...typeParameters: [K]
19
- ): MoveStruct<{
20
- contents: ReturnType<typeof bcs.vector<K>>;
21
- }> {
22
- return new MoveStruct({
23
- name: `${$moduleName}::VecSet<${typeParameters[0].name as K["name"]}>`,
24
- fields: {
25
- contents: bcs.vector(typeParameters[0]),
26
- },
27
- });
28
- }
15
+ export declare function VecSet<K extends BcsType<any>>(...typeParameters: [K]): MoveStruct<{
16
+ contents: ReturnType<typeof bcs.vector<K>>;
17
+ }>;
@@ -0,0 +1,22 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { MoveStruct } from "../../../utils/index.js";
5
+ import { bcs } from "@mysten/sui/bcs";
6
+ const $moduleName = "0x2::vec_set";
7
+ /**
8
+ * A set data structure backed by a vector. The set is guaranteed not to contain
9
+ * duplicate keys. All operations are O(N) in the size of the set
10
+ *
11
+ * - the intention of this data structure is only to provide the convenience of
12
+ * programming against a set API. Sets that need sorted iteration rather than
13
+ * insertion order iteration should be handwritten.
14
+ */
15
+ export function VecSet(...typeParameters) {
16
+ return new MoveStruct({
17
+ name: `${$moduleName}::VecSet<${typeParameters[0].name}>`,
18
+ fields: {
19
+ contents: bcs.vector(typeParameters[0]),
20
+ },
21
+ });
22
+ }
@@ -0,0 +1,81 @@
1
+ import { MoveStruct } from "../utils/index.js";
2
+ import type { RawTransactionArgument } from "../utils/index.js";
3
+ import type { Transaction } from "@mysten/sui/transactions";
4
+ export declare const VerifiedEvent: MoveStruct<{
5
+ is_verified: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
6
+ }, "@local-pkg/zing_identity::ecdsa::VerifiedEvent">;
7
+ export declare const Output: MoveStruct<{
8
+ id: MoveStruct<{
9
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
10
+ }, "0x2::object::UID">;
11
+ value: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
12
+ length: number;
13
+ }, string>;
14
+ }, "@local-pkg/zing_identity::ecdsa::Output">;
15
+ export interface Keccak256Arguments {
16
+ data: RawTransactionArgument<number[]>;
17
+ recipient: RawTransactionArgument<string>;
18
+ }
19
+ export interface Keccak256Options {
20
+ package?: string;
21
+ arguments: Keccak256Arguments | [
22
+ data: RawTransactionArgument<number[]>,
23
+ recipient: RawTransactionArgument<string>
24
+ ];
25
+ }
26
+ /** Hash the data using Keccak256, output an object with the hash to recipient. */
27
+ export declare function keccak256(options: Keccak256Options): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
28
+ export interface EcrecoverArguments {
29
+ signature: RawTransactionArgument<number[]>;
30
+ msg: RawTransactionArgument<number[]>;
31
+ recipient: RawTransactionArgument<string>;
32
+ }
33
+ export interface EcrecoverOptions {
34
+ package?: string;
35
+ arguments: EcrecoverArguments | [
36
+ signature: RawTransactionArgument<number[]>,
37
+ msg: RawTransactionArgument<number[]>,
38
+ recipient: RawTransactionArgument<string>
39
+ ];
40
+ }
41
+ /**
42
+ * Recover the public key using the signature and message, assuming the signature
43
+ * was produced over the Keccak256 hash of the message. Output an object with the
44
+ * recovered pubkey to recipient.
45
+ */
46
+ export declare function ecrecover(options: EcrecoverOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
47
+ export interface EcrecoverToEthAddressArguments {
48
+ signature: RawTransactionArgument<number[]>;
49
+ msg: RawTransactionArgument<number[]>;
50
+ }
51
+ export interface EcrecoverToEthAddressOptions {
52
+ package?: string;
53
+ arguments: EcrecoverToEthAddressArguments | [
54
+ signature: RawTransactionArgument<number[]>,
55
+ msg: RawTransactionArgument<number[]>
56
+ ];
57
+ }
58
+ /**
59
+ * Recover the Ethereum address using the signature and message, assuming the
60
+ * signature was produced over the Keccak256 hash of the message. Output an object
61
+ * with the recovered address to recipient.
62
+ */
63
+ export declare function ecrecoverToEthAddress(options: EcrecoverToEthAddressOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
64
+ export interface Secp256k1VerifyArguments {
65
+ signature: RawTransactionArgument<number[]>;
66
+ publicKey: RawTransactionArgument<number[]>;
67
+ msg: RawTransactionArgument<number[]>;
68
+ }
69
+ export interface Secp256k1VerifyOptions {
70
+ package?: string;
71
+ arguments: Secp256k1VerifyArguments | [
72
+ signature: RawTransactionArgument<number[]>,
73
+ publicKey: RawTransactionArgument<number[]>,
74
+ msg: RawTransactionArgument<number[]>
75
+ ];
76
+ }
77
+ /**
78
+ * Verified the secp256k1 signature using public key and message assuming Keccak
79
+ * was using when signing. Emit an is_verified event of the verification result.
80
+ */
81
+ export declare function secp256k1Verify(options: Secp256k1VerifyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
@@ -0,0 +1,87 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import * as object from "./deps/sui/object.js";
5
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
6
+ import { bcs } from "@mysten/sui/bcs";
7
+ const $moduleName = "@local-pkg/zing_identity::ecdsa";
8
+ export const VerifiedEvent = new MoveStruct({
9
+ name: `${$moduleName}::VerifiedEvent`,
10
+ fields: {
11
+ is_verified: bcs.bool(),
12
+ },
13
+ });
14
+ export const Output = new MoveStruct({
15
+ name: `${$moduleName}::Output`,
16
+ fields: {
17
+ id: object.UID,
18
+ value: bcs.vector(bcs.u8()),
19
+ },
20
+ });
21
+ /** Hash the data using Keccak256, output an object with the hash to recipient. */
22
+ export function keccak256(options) {
23
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
24
+ const argumentsTypes = ["vector<u8>", "address"];
25
+ const parameterNames = ["data", "recipient"];
26
+ return (tx) => tx.moveCall({
27
+ package: packageAddress,
28
+ module: "ecdsa",
29
+ function: "keccak256",
30
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
31
+ });
32
+ }
33
+ /**
34
+ * Recover the public key using the signature and message, assuming the signature
35
+ * was produced over the Keccak256 hash of the message. Output an object with the
36
+ * recovered pubkey to recipient.
37
+ */
38
+ export function ecrecover(options) {
39
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
40
+ const argumentsTypes = [
41
+ "vector<u8>",
42
+ "vector<u8>",
43
+ "address",
44
+ ];
45
+ const parameterNames = ["signature", "msg", "recipient"];
46
+ return (tx) => tx.moveCall({
47
+ package: packageAddress,
48
+ module: "ecdsa",
49
+ function: "ecrecover",
50
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
51
+ });
52
+ }
53
+ /**
54
+ * Recover the Ethereum address using the signature and message, assuming the
55
+ * signature was produced over the Keccak256 hash of the message. Output an object
56
+ * with the recovered address to recipient.
57
+ */
58
+ export function ecrecoverToEthAddress(options) {
59
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
60
+ const argumentsTypes = ["vector<u8>", "vector<u8>"];
61
+ const parameterNames = ["signature", "msg"];
62
+ return (tx) => tx.moveCall({
63
+ package: packageAddress,
64
+ module: "ecdsa",
65
+ function: "ecrecover_to_eth_address",
66
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
67
+ });
68
+ }
69
+ /**
70
+ * Verified the secp256k1 signature using public key and message assuming Keccak
71
+ * was using when signing. Emit an is_verified event of the verification result.
72
+ */
73
+ export function secp256k1Verify(options) {
74
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
75
+ const argumentsTypes = [
76
+ "vector<u8>",
77
+ "vector<u8>",
78
+ "vector<u8>",
79
+ ];
80
+ const parameterNames = ["signature", "publicKey", "msg"];
81
+ return (tx) => tx.moveCall({
82
+ package: packageAddress,
83
+ module: "ecdsa",
84
+ function: "secp256k1_verify",
85
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
86
+ });
87
+ }