@zing-protocol/zing-sdk 0.0.17 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/_generated/index.d.ts +0 -2
  2. package/dist/_generated/index.js +0 -2
  3. package/dist/_generated/utils/index.d.ts +21 -2
  4. package/dist/_generated/utils/index.js +35 -11
  5. package/dist/_generated/zing_framework/coin_utils.js +1 -4
  6. package/dist/_generated/zing_framework/derived_object_bag.d.ts +4 -3
  7. package/dist/_generated/zing_framework/derived_object_bag.js +12 -37
  8. package/dist/_generated/zing_framework/derived_table.d.ts +5 -4
  9. package/dist/_generated/zing_framework/derived_table.js +12 -33
  10. package/dist/_generated/zing_governance/admin.d.ts +4 -17
  11. package/dist/_generated/zing_governance/admin.js +3 -17
  12. package/dist/_generated/zing_governance/treasury.d.ts +5 -4
  13. package/dist/_generated/zing_governance/treasury.js +5 -15
  14. package/dist/_generated/zing_studio/app.d.ts +70 -2
  15. package/dist/_generated/zing_studio/app.js +154 -100
  16. package/dist/_generated/zing_studio/article.d.ts +6 -52
  17. package/dist/_generated/zing_studio/article.js +23 -74
  18. package/dist/_generated/zing_studio/config.d.ts +34 -3
  19. package/dist/_generated/zing_studio/config.js +47 -50
  20. package/dist/_generated/zing_studio/deps/sui/bag.d.ts +25 -3
  21. package/dist/_generated/zing_studio/deps/sui/bag.js +1 -2
  22. package/dist/_generated/zing_studio/deps/sui/balance.d.ts +1 -1
  23. package/dist/_generated/zing_studio/deps/sui/balance.js +1 -1
  24. package/dist/_generated/zing_studio/deps/sui/coin.d.ts +3 -5
  25. package/dist/_generated/zing_studio/deps/sui/coin.js +3 -3
  26. package/dist/_generated/zing_studio/deps/sui/table.d.ts +21 -4
  27. package/dist/_generated/zing_studio/deps/sui/table.js +2 -3
  28. package/dist/_generated/zing_studio/deps/walrus/blob.d.ts +2 -6
  29. package/dist/_generated/zing_studio/deps/walrus/blob.js +1 -2
  30. package/dist/_generated/zing_studio/deps/walrus/storage_resource.d.ts +1 -3
  31. package/dist/_generated/zing_studio/deps/walrus/storage_resource.js +1 -2
  32. package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.d.ts +1 -3
  33. package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.js +1 -2
  34. package/dist/_generated/zing_studio/deps/zing_framework/derived_table.d.ts +2 -4
  35. package/dist/_generated/zing_studio/deps/zing_framework/derived_table.js +2 -3
  36. package/dist/_generated/zing_studio/donation.d.ts +6 -14
  37. package/dist/_generated/zing_studio/donation.js +2 -2
  38. package/dist/_generated/zing_studio/enclave.d.ts +17 -10
  39. package/dist/_generated/zing_studio/enclave.js +16 -41
  40. package/dist/_generated/zing_studio/referral.js +15 -46
  41. package/dist/_generated/zing_studio/storage.d.ts +13 -17
  42. package/dist/_generated/zing_studio/storage.js +46 -100
  43. package/dist/_generated/zing_studio/studio.d.ts +6 -28
  44. package/dist/_generated/zing_studio/studio.js +23 -96
  45. package/dist/client/index.d.ts +18 -55
  46. package/dist/client/index.js +1 -28
  47. package/dist/getters.d.ts +17 -62
  48. package/dist/getters.js +62 -56
  49. package/dist/hooks/index.d.ts +0 -1
  50. package/dist/hooks/index.js +1 -1
  51. package/dist/hooks/useGetStudio.d.ts +4 -10
  52. package/dist/hooks/useReclaim.d.ts +0 -10
  53. package/dist/hooks/useReclaim.js +169 -92
  54. package/dist/hooks/useSignAndExecuteTransaction.js +4 -1
  55. package/dist/hooks/useZingInfiniteQueries.d.ts +3 -9
  56. package/dist/hooks/useZingInfiniteQueries.js +1 -0
  57. package/dist/hooks/useZingQueries.d.ts +8 -27
  58. package/dist/hooks/useZingQueries.js +1 -2
  59. package/dist/hooks/useZingQuery.d.ts +11 -36
  60. package/dist/hooks/useZingQuery.js +1 -2
  61. package/dist/lib/utils/index.d.ts +0 -1
  62. package/dist/lib/utils/index.js +0 -1
  63. package/dist/lib/utils/reclaim.d.ts +1 -29
  64. package/dist/lib/utils/reclaim.js +148 -87
  65. package/dist/mutations/signer.js +1 -1
  66. package/dist/mutations/walrus.js +1 -1
  67. package/package.json +1 -1
  68. package/dist/_generated/zing_framework/deps/sui/object.d.ts +0 -8
  69. package/dist/_generated/zing_framework/deps/sui/object.js +0 -13
  70. package/dist/_generated/zing_governance/deps/sui/object.d.ts +0 -8
  71. package/dist/_generated/zing_governance/deps/sui/object.js +0 -13
  72. package/dist/_generated/zing_identity/config.d.ts +0 -87
  73. package/dist/_generated/zing_identity/config.js +0 -98
  74. package/dist/_generated/zing_identity/deps/std/type_name.d.ts +0 -17
  75. package/dist/_generated/zing_identity/deps/std/type_name.js +0 -22
  76. package/dist/_generated/zing_identity/deps/sui/object.d.ts +0 -8
  77. package/dist/_generated/zing_identity/deps/sui/object.js +0 -13
  78. package/dist/_generated/zing_identity/deps/sui/object_table.d.ts +0 -12
  79. package/dist/_generated/zing_identity/deps/sui/object_table.js +0 -23
  80. package/dist/_generated/zing_identity/deps/sui/table.d.ts +0 -12
  81. package/dist/_generated/zing_identity/deps/sui/table.js +0 -35
  82. package/dist/_generated/zing_identity/deps/sui/vec_set.d.ts +0 -17
  83. package/dist/_generated/zing_identity/deps/sui/vec_set.js +0 -22
  84. package/dist/_generated/zing_identity/ecdsa.d.ts +0 -81
  85. package/dist/_generated/zing_identity/ecdsa.js +0 -87
  86. package/dist/_generated/zing_identity/identity.d.ts +0 -262
  87. package/dist/_generated/zing_identity/identity.js +0 -294
  88. package/dist/_generated/zing_identity/reclaim.d.ts +0 -356
  89. package/dist/_generated/zing_identity/reclaim.js +0 -414
  90. package/dist/_generated/zing_studio/nitro_attestation.d.ts +0 -148
  91. package/dist/_generated/zing_studio/nitro_attestation.js +0 -183
@@ -1,5 +1,3 @@
1
- export * as Reclaim from "./zing_identity/reclaim.js";
2
- export * as Identity from "./zing_identity/identity.js";
3
1
  export * as StudioApp from "./zing_studio/app.js";
4
2
  export * as Studio from "./zing_studio/studio.js";
5
3
  export * as Article from "./zing_studio/article.js";
@@ -1,5 +1,3 @@
1
- export * as Reclaim from "./zing_identity/reclaim.js";
2
- export * as Identity from "./zing_identity/identity.js";
3
1
  export * as StudioApp from "./zing_studio/app.js";
4
2
  export * as Studio from "./zing_studio/studio.js";
5
3
  export * as Article from "./zing_studio/article.js";
@@ -1,12 +1,31 @@
1
1
  import { BcsStruct, BcsEnum, BcsTuple } from "@mysten/sui/bcs";
2
2
  import type { BcsType, TypeTag } from "@mysten/sui/bcs";
3
+ import type { ClientWithCoreApi, SuiClientTypes } from "@mysten/sui/client";
3
4
  import type { TransactionArgument } from "@mysten/sui/transactions";
4
5
  export type RawTransactionArgument<T> = T | TransactionArgument;
6
+ export interface GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, "content"> = object> extends SuiClientTypes.GetObjectOptions<Include> {
7
+ client: ClientWithCoreApi;
8
+ }
9
+ export interface GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, "content"> = object> extends SuiClientTypes.GetObjectsOptions<Include> {
10
+ client: ClientWithCoreApi;
11
+ }
5
12
  export declare function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null;
6
- export declare function normalizeMoveArguments(args: unknown[] | object, argTypes: string[], parameterNames?: string[]): TransactionArgument[];
13
+ export declare function normalizeMoveArguments(args: unknown[] | object, argTypes: readonly (string | null)[], parameterNames?: string[]): TransactionArgument[];
7
14
  export declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
15
+ get<Include extends Omit<SuiClientTypes.ObjectInclude, "content" | "json"> = object>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
16
+ content: true;
17
+ json: true;
18
+ }> & {
19
+ json: BcsStruct<T>["$inferType"];
20
+ }>;
21
+ getMany<Include extends Omit<SuiClientTypes.ObjectInclude, "content" | "json"> = object>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
22
+ content: true;
23
+ json: true;
24
+ }> & {
25
+ json: BcsStruct<T>["$inferType"];
26
+ }>>;
8
27
  }
9
28
  export declare class MoveEnum<T extends Record<string, BcsType<any> | null>, const Name extends string> extends BcsEnum<T, Name> {
10
29
  }
11
- export declare class MoveTuple<T extends readonly BcsType<any>[], const Name extends string> extends BcsTuple<T, Name> {
30
+ export declare class MoveTuple<const T extends readonly BcsType<any>[], const Name extends string> extends BcsTuple<T, Name> {
12
31
  }
@@ -3,7 +3,6 @@ import { isArgument } from "@mysten/sui/transactions";
3
3
  import { normalizeSuiAddress } from "@mysten/sui/utils";
4
4
  const MOVE_STDLIB_ADDRESS = normalizeSuiAddress("0x1");
5
5
  const SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress("0x2");
6
- const SUI_SYSTEM_ADDRESS = normalizeSuiAddress("0x3");
7
6
  function stringify(val) {
8
7
  if (typeof val === "object") {
9
8
  return JSON.stringify(val, (val) => val);
@@ -47,7 +46,7 @@ export function getPureBcsSchema(typeTag) {
47
46
  }
48
47
  else if ("struct" in parsedTag) {
49
48
  const structTag = parsedTag.struct;
50
- const pkg = normalizeSuiAddress(parsedTag.struct.address);
49
+ const pkg = normalizeSuiAddress(structTag.address);
51
50
  if (pkg === MOVE_STDLIB_ADDRESS) {
52
51
  if ((structTag.module === "ascii" || structTag.module === "string") &&
53
52
  structTag.name === "String") {
@@ -59,8 +58,8 @@ export function getPureBcsSchema(typeTag) {
59
58
  }
60
59
  }
61
60
  if (pkg === SUI_FRAMEWORK_ADDRESS &&
62
- structTag.module === "Object" &&
63
- structTag.name === "ID") {
61
+ structTag.module === "object" &&
62
+ (structTag.name === "ID" || structTag.name === "UID")) {
64
63
  return bcs.Address;
65
64
  }
66
65
  }
@@ -74,19 +73,19 @@ export function normalizeMoveArguments(args, argTypes, parameterNames) {
74
73
  const normalizedArgs = [];
75
74
  let index = 0;
76
75
  for (const [i, argType] of argTypes.entries()) {
77
- if (argType === `${SUI_FRAMEWORK_ADDRESS}::deny_list::DenyList`) {
78
- normalizedArgs.push((tx) => tx.object.denyList());
76
+ if (argType === "0x2::clock::Clock") {
77
+ normalizedArgs.push((tx) => tx.object.clock());
79
78
  continue;
80
79
  }
81
- if (argType === `${SUI_FRAMEWORK_ADDRESS}::random::Random`) {
80
+ if (argType === "0x2::random::Random") {
82
81
  normalizedArgs.push((tx) => tx.object.random());
83
82
  continue;
84
83
  }
85
- if (argType === `${SUI_FRAMEWORK_ADDRESS}::clock::Clock`) {
86
- normalizedArgs.push((tx) => tx.object.clock());
84
+ if (argType === "0x2::deny_list::DenyList") {
85
+ normalizedArgs.push((tx) => tx.object.denyList());
87
86
  continue;
88
87
  }
89
- if (argType === `${SUI_SYSTEM_ADDRESS}::sui_system::SuiSystemState`) {
88
+ if (argType === "0x3::sui_system::SuiSystemState") {
90
89
  normalizedArgs.push((tx) => tx.object.system());
91
90
  continue;
92
91
  }
@@ -113,7 +112,7 @@ export function normalizeMoveArguments(args, argTypes, parameterNames) {
113
112
  continue;
114
113
  }
115
114
  const type = argTypes[i];
116
- const bcsType = getPureBcsSchema(type);
115
+ const bcsType = type === null ? null : getPureBcsSchema(type);
117
116
  if (bcsType) {
118
117
  const bytes = bcsType.serialize(arg);
119
118
  normalizedArgs.push((tx) => tx.pure(bytes));
@@ -128,6 +127,31 @@ export function normalizeMoveArguments(args, argTypes, parameterNames) {
128
127
  return normalizedArgs;
129
128
  }
130
129
  export class MoveStruct extends BcsStruct {
130
+ async get({ objectId, ...options }) {
131
+ const [res] = await this.getMany({
132
+ ...options,
133
+ objectIds: [objectId],
134
+ });
135
+ return res;
136
+ }
137
+ async getMany({ client, ...options }) {
138
+ const response = (await client.core.getObjects({
139
+ ...options,
140
+ include: {
141
+ ...options.include,
142
+ content: true,
143
+ },
144
+ }));
145
+ return response.objects.map((obj) => {
146
+ if (obj instanceof Error) {
147
+ throw obj;
148
+ }
149
+ return {
150
+ ...obj,
151
+ json: this.parse(obj.content),
152
+ };
153
+ });
154
+ }
131
155
  }
132
156
  export class MoveEnum extends BcsEnum {
133
157
  }
@@ -4,10 +4,7 @@
4
4
  import { normalizeMoveArguments } from "../utils/index.js";
5
5
  export function burnOrSendPositiveCoin(options) {
6
6
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
7
- const argumentsTypes = [
8
- `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`,
9
- "address",
10
- ];
7
+ const argumentsTypes = [null, "address"];
11
8
  const parameterNames = ["coin", "recipient"];
12
9
  return (tx) => tx.moveCall({
13
10
  package: packageAddress,
@@ -1,12 +1,13 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
1
4
  import { MoveStruct } from "../utils/index.js";
2
5
  import type { RawTransactionArgument } from "../utils/index.js";
3
6
  import type { BcsType } from "@mysten/sui/bcs";
4
7
  import type { Transaction } from "@mysten/sui/transactions";
5
8
  export declare const DerivedObjectBag: MoveStruct<{
6
9
  /** the ID of this bag */
7
- id: MoveStruct<{
8
- id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
9
- }, "0x2::object::UID">;
10
+ id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
10
11
  /** the number of key-value pairs in the bag */
11
12
  size: BcsType<string, string | number | bigint, "u64">;
12
13
  }, "@local-pkg/zing_framework::derived_object_bag::DerivedObjectBag">;
@@ -1,7 +1,6 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
- import * as object from "./deps/sui/object.js";
5
4
  import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
6
5
  import { bcs } from "@mysten/sui/bcs";
7
6
  const $moduleName = "@local-pkg/zing_framework::derived_object_bag";
@@ -9,7 +8,7 @@ export const DerivedObjectBag = new MoveStruct({
9
8
  name: `${$moduleName}::DerivedObjectBag`,
10
9
  fields: {
11
10
  /** the ID of this bag */
12
- id: object.UID,
11
+ id: bcs.Address,
13
12
  /** the number of key-value pairs in the bag */
14
13
  size: bcs.u64(),
15
14
  },
@@ -18,7 +17,7 @@ export const DerivedObjectBag = new MoveStruct({
18
17
  export function _new(options) {
19
18
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
20
19
  const argumentsTypes = [
21
- "0x0000000000000000000000000000000000000000000000000000000000000002::object::UID",
20
+ "0x2::object::ID",
22
21
  `${options.typeArguments[0]}`,
23
22
  ];
24
23
  const parameterNames = ["parent", "key"];
@@ -38,7 +37,7 @@ export function _new(options) {
38
37
  export function add(options) {
39
38
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
40
39
  const argumentsTypes = [
41
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
40
+ null,
42
41
  `${options.typeArguments[0]}`,
43
42
  `${options.typeArguments[1]}`,
44
43
  ];
@@ -60,10 +59,7 @@ export function add(options) {
60
59
  */
61
60
  export function borrow(options) {
62
61
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
63
- const argumentsTypes = [
64
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
65
- `${options.typeArguments[0]}`,
66
- ];
62
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
67
63
  const parameterNames = ["bag", "k"];
68
64
  return (tx) => tx.moveCall({
69
65
  package: packageAddress,
@@ -82,10 +78,7 @@ export function borrow(options) {
82
78
  */
83
79
  export function borrowMut(options) {
84
80
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
85
- const argumentsTypes = [
86
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
87
- `${options.typeArguments[0]}`,
88
- ];
81
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
89
82
  const parameterNames = ["bag", "k"];
90
83
  return (tx) => tx.moveCall({
91
84
  package: packageAddress,
@@ -104,10 +97,7 @@ export function borrowMut(options) {
104
97
  */
105
98
  export function remove(options) {
106
99
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
107
- const argumentsTypes = [
108
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
109
- `${options.typeArguments[0]}`,
110
- ];
100
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
111
101
  const parameterNames = ["bag", "k"];
112
102
  return (tx) => tx.moveCall({
113
103
  package: packageAddress,
@@ -123,10 +113,7 @@ export function remove(options) {
123
113
  */
124
114
  export function contains(options) {
125
115
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
126
- const argumentsTypes = [
127
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
128
- `${options.typeArguments[0]}`,
129
- ];
116
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
130
117
  const parameterNames = ["bag", "k"];
131
118
  return (tx) => tx.moveCall({
132
119
  package: packageAddress,
@@ -142,10 +129,7 @@ export function contains(options) {
142
129
  */
143
130
  export function containsWithType(options) {
144
131
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
145
- const argumentsTypes = [
146
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
147
- `${options.typeArguments[0]}`,
148
- ];
132
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
149
133
  const parameterNames = ["bag", "k"];
150
134
  return (tx) => tx.moveCall({
151
135
  package: packageAddress,
@@ -158,9 +142,7 @@ export function containsWithType(options) {
158
142
  /** Returns the size of the bag, the number of key-value pairs */
159
143
  export function length(options) {
160
144
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
161
- const argumentsTypes = [
162
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
163
- ];
145
+ const argumentsTypes = [null];
164
146
  const parameterNames = ["bag"];
165
147
  return (tx) => tx.moveCall({
166
148
  package: packageAddress,
@@ -172,9 +154,7 @@ export function length(options) {
172
154
  /** Returns true iff the bag is empty (if `length` returns `0`) */
173
155
  export function isEmpty(options) {
174
156
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
175
- const argumentsTypes = [
176
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
177
- ];
157
+ const argumentsTypes = [null];
178
158
  const parameterNames = ["bag"];
179
159
  return (tx) => tx.moveCall({
180
160
  package: packageAddress,
@@ -189,9 +169,7 @@ export function isEmpty(options) {
189
169
  */
190
170
  export function destroyEmpty(options) {
191
171
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
192
- const argumentsTypes = [
193
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
194
- ];
172
+ const argumentsTypes = [null];
195
173
  const parameterNames = ["bag"];
196
174
  return (tx) => tx.moveCall({
197
175
  package: packageAddress,
@@ -206,10 +184,7 @@ export function destroyEmpty(options) {
206
184
  */
207
185
  export function valueId(options) {
208
186
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
209
- const argumentsTypes = [
210
- `${packageAddress}::derived_object_bag::DerivedObjectBag`,
211
- `${options.typeArguments[0]}`,
212
- ];
187
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
213
188
  const parameterNames = ["bag", "k"];
214
189
  return (tx) => tx.moveCall({
215
190
  package: packageAddress,
@@ -1,15 +1,16 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
1
4
  import { MoveStruct } from "../utils/index.js";
2
5
  import type { RawTransactionArgument } from "../utils/index.js";
3
6
  import type { BcsType } from "@mysten/sui/bcs";
4
7
  import type { Transaction } from "@mysten/sui/transactions";
5
8
  export declare const DerivedTable: MoveStruct<{
6
9
  /** the ID of this table */
7
- id: MoveStruct<{
8
- id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
9
- }, "0x2::object::UID">;
10
+ id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
10
11
  /** the number of key-value pairs in the table */
11
12
  size: BcsType<string, string | number | bigint, "u64">;
12
- }, "@local-pkg/zing_framework::derived_table::DerivedTable">;
13
+ }, "@local-pkg/zing_framework::derived_table::DerivedTable<phantom K, phantom V>">;
13
14
  export interface NewArguments<DerivedObjectKey extends BcsType<any>> {
14
15
  parent: RawTransactionArgument<string>;
15
16
  key: RawTransactionArgument<DerivedObjectKey>;
@@ -1,15 +1,14 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
- import * as object from "./deps/sui/object.js";
5
4
  import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
6
5
  import { bcs } from "@mysten/sui/bcs";
7
6
  const $moduleName = "@local-pkg/zing_framework::derived_table";
8
7
  export const DerivedTable = new MoveStruct({
9
- name: `${$moduleName}::DerivedTable`,
8
+ name: `${$moduleName}::DerivedTable<phantom K, phantom V>`,
10
9
  fields: {
11
10
  /** the ID of this table */
12
- id: object.UID,
11
+ id: bcs.Address,
13
12
  /** the number of key-value pairs in the table */
14
13
  size: bcs.u64(),
15
14
  },
@@ -18,7 +17,7 @@ export const DerivedTable = new MoveStruct({
18
17
  export function _new(options) {
19
18
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
20
19
  const argumentsTypes = [
21
- "0x0000000000000000000000000000000000000000000000000000000000000002::object::UID",
20
+ "0x2::object::ID",
22
21
  `${options.typeArguments[0]}`,
23
22
  ];
24
23
  const parameterNames = ["parent", "key"];
@@ -38,7 +37,7 @@ export function _new(options) {
38
37
  export function add(options) {
39
38
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
40
39
  const argumentsTypes = [
41
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
40
+ null,
42
41
  `${options.typeArguments[0]}`,
43
42
  `${options.typeArguments[1]}`,
44
43
  ];
@@ -59,10 +58,7 @@ export function add(options) {
59
58
  */
60
59
  export function borrow(options) {
61
60
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
62
- const argumentsTypes = [
63
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
64
- `${options.typeArguments[0]}`,
65
- ];
61
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
66
62
  const parameterNames = ["table", "k"];
67
63
  return (tx) => tx.moveCall({
68
64
  package: packageAddress,
@@ -80,10 +76,7 @@ export function borrow(options) {
80
76
  */
81
77
  export function borrowMut(options) {
82
78
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
83
- const argumentsTypes = [
84
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
85
- `${options.typeArguments[0]}`,
86
- ];
79
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
87
80
  const parameterNames = ["table", "k"];
88
81
  return (tx) => tx.moveCall({
89
82
  package: packageAddress,
@@ -100,10 +93,7 @@ export function borrowMut(options) {
100
93
  */
101
94
  export function remove(options) {
102
95
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
103
- const argumentsTypes = [
104
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
105
- `${options.typeArguments[0]}`,
106
- ];
96
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
107
97
  const parameterNames = ["table", "k"];
108
98
  return (tx) => tx.moveCall({
109
99
  package: packageAddress,
@@ -119,10 +109,7 @@ export function remove(options) {
119
109
  */
120
110
  export function contains(options) {
121
111
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
122
- const argumentsTypes = [
123
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
124
- `${options.typeArguments[0]}`,
125
- ];
112
+ const argumentsTypes = [null, `${options.typeArguments[0]}`];
126
113
  const parameterNames = ["table", "k"];
127
114
  return (tx) => tx.moveCall({
128
115
  package: packageAddress,
@@ -135,9 +122,7 @@ export function contains(options) {
135
122
  /** Returns the size of the table, the number of key-value pairs */
136
123
  export function length(options) {
137
124
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
138
- const argumentsTypes = [
139
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
140
- ];
125
+ const argumentsTypes = [null];
141
126
  const parameterNames = ["table"];
142
127
  return (tx) => tx.moveCall({
143
128
  package: packageAddress,
@@ -150,9 +135,7 @@ export function length(options) {
150
135
  /** Returns true if the table is empty (if `length` returns `0`) */
151
136
  export function isEmpty(options) {
152
137
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
153
- const argumentsTypes = [
154
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
155
- ];
138
+ const argumentsTypes = [null];
156
139
  const parameterNames = ["table"];
157
140
  return (tx) => tx.moveCall({
158
141
  package: packageAddress,
@@ -168,9 +151,7 @@ export function isEmpty(options) {
168
151
  */
169
152
  export function destroyEmpty(options) {
170
153
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
171
- const argumentsTypes = [
172
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
173
- ];
154
+ const argumentsTypes = [null];
174
155
  const parameterNames = ["table"];
175
156
  return (tx) => tx.moveCall({
176
157
  package: packageAddress,
@@ -186,9 +167,7 @@ export function destroyEmpty(options) {
186
167
  */
187
168
  export function drop(options) {
188
169
  const packageAddress = options.package ?? "@local-pkg/zing_framework";
189
- const argumentsTypes = [
190
- `${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
191
- ];
170
+ const argumentsTypes = [null];
192
171
  const parameterNames = ["table"];
193
172
  return (tx) => tx.moveCall({
194
173
  package: packageAddress,
@@ -1,20 +1,7 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
1
4
  import { MoveStruct } from "../utils/index.js";
2
- import type { RawTransactionArgument } from "../utils/index.js";
3
- import type { Transaction } from "@mysten/sui/transactions";
4
5
  export declare const AdminCap: MoveStruct<{
5
- id: MoveStruct<{
6
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
7
- }, "0x2::object::UID">;
6
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
8
7
  }, "@local-pkg/zing_governance::admin::AdminCap">;
9
- export interface NewAdminCapArguments {
10
- Cap: RawTransactionArgument<string>;
11
- recipient: RawTransactionArgument<string>;
12
- }
13
- export interface NewAdminCapOptions {
14
- package?: string;
15
- arguments: NewAdminCapArguments | [
16
- Cap: RawTransactionArgument<string>,
17
- recipient: RawTransactionArgument<string>
18
- ];
19
- }
20
- export declare function newAdminCap(options: NewAdminCapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
@@ -1,26 +1,12 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
- import * as object from "./deps/sui/object.js";
5
- import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
4
+ import { MoveStruct } from "../utils/index.js";
5
+ import { bcs } from "@mysten/sui/bcs";
6
6
  const $moduleName = "@local-pkg/zing_governance::admin";
7
7
  export const AdminCap = new MoveStruct({
8
8
  name: `${$moduleName}::AdminCap`,
9
9
  fields: {
10
- id: object.UID,
10
+ id: bcs.Address,
11
11
  },
12
12
  });
13
- export function newAdminCap(options) {
14
- const packageAddress = options.package ?? "@local-pkg/zing_governance";
15
- const argumentsTypes = [
16
- `${packageAddress}::admin::AdminCap`,
17
- "address",
18
- ];
19
- const parameterNames = ["Cap", "recipient"];
20
- return (tx) => tx.moveCall({
21
- package: packageAddress,
22
- module: "admin",
23
- function: "new_admin_cap",
24
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
25
- });
26
- }
@@ -1,3 +1,6 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
1
4
  import { MoveStruct } from "../utils/index.js";
2
5
  import type { RawTransactionArgument } from "../utils/index.js";
3
6
  import type { Transaction } from "@mysten/sui/transactions";
@@ -11,11 +14,9 @@ export declare const TreasuryClaimEvent: MoveStruct<{
11
14
  }, "@local-pkg/zing_governance::treasury::TreasuryClaimEvent">;
12
15
  export declare const BalanceKey: MoveStruct<{
13
16
  dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
14
- }, "@local-pkg/zing_governance::treasury::BalanceKey">;
17
+ }, "@local-pkg/zing_governance::treasury::BalanceKey<phantom T>">;
15
18
  export declare const Treasury: MoveStruct<{
16
- id: MoveStruct<{
17
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
18
- }, "0x2::object::UID">;
19
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
19
20
  }, "@local-pkg/zing_governance::treasury::Treasury">;
20
21
  export interface BalanceOfArguments {
21
22
  self: RawTransactionArgument<string>;
@@ -1,7 +1,6 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
- import * as object from "./deps/sui/object.js";
5
4
  import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
6
5
  import { bcs } from "@mysten/sui/bcs";
7
6
  const $moduleName = "@local-pkg/zing_governance::treasury";
@@ -20,7 +19,7 @@ export const TreasuryClaimEvent = new MoveStruct({
20
19
  },
21
20
  });
22
21
  export const BalanceKey = new MoveStruct({
23
- name: `${$moduleName}::BalanceKey`,
22
+ name: `${$moduleName}::BalanceKey<phantom T>`,
24
23
  fields: {
25
24
  dummy_field: bcs.bool(),
26
25
  },
@@ -28,14 +27,12 @@ export const BalanceKey = new MoveStruct({
28
27
  export const Treasury = new MoveStruct({
29
28
  name: `${$moduleName}::Treasury`,
30
29
  fields: {
31
- id: object.UID,
30
+ id: bcs.Address,
32
31
  },
33
32
  });
34
33
  export function balanceOf(options) {
35
34
  const packageAddress = options.package ?? "@local-pkg/zing_governance";
36
- const argumentsTypes = [
37
- `${packageAddress}::treasury::Treasury`,
38
- ];
35
+ const argumentsTypes = [null];
39
36
  const parameterNames = ["self"];
40
37
  return (tx) => tx.moveCall({
41
38
  package: packageAddress,
@@ -47,10 +44,7 @@ export function balanceOf(options) {
47
44
  }
48
45
  export function supplyTreasury(options) {
49
46
  const packageAddress = options.package ?? "@local-pkg/zing_governance";
50
- const argumentsTypes = [
51
- `${packageAddress}::treasury::Treasury`,
52
- `0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
53
- ];
47
+ const argumentsTypes = [null, null];
54
48
  const parameterNames = ["self", "balance"];
55
49
  return (tx) => tx.moveCall({
56
50
  package: packageAddress,
@@ -62,11 +56,7 @@ export function supplyTreasury(options) {
62
56
  }
63
57
  export function claim(options) {
64
58
  const packageAddress = options.package ?? "@local-pkg/zing_governance";
65
- const argumentsTypes = [
66
- `${packageAddress}::treasury::Treasury`,
67
- `${packageAddress}::admin::AdminCap`,
68
- "u64",
69
- ];
59
+ const argumentsTypes = [null, null, "u64"];
70
60
  const parameterNames = ["self", "Cap", "value"];
71
61
  return (tx) => tx.moveCall({
72
62
  package: packageAddress,