@zing-protocol/zing-sdk 0.0.17 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) 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/config/common.d.ts +0 -6
  48. package/dist/config/common.js +0 -51
  49. package/dist/config/mainnet.js +12 -38
  50. package/dist/config/testnet.js +2 -26
  51. package/dist/config/types.d.ts +1 -6
  52. package/dist/const.js +1 -1
  53. package/dist/getters.d.ts +17 -62
  54. package/dist/getters.js +62 -56
  55. package/dist/hooks/index.d.ts +0 -1
  56. package/dist/hooks/index.js +1 -1
  57. package/dist/hooks/useGetStudio.d.ts +4 -10
  58. package/dist/hooks/useReclaim.d.ts +0 -10
  59. package/dist/hooks/useReclaim.js +169 -92
  60. package/dist/hooks/useSignAndExecuteTransaction.js +4 -1
  61. package/dist/hooks/useZingInfiniteQueries.d.ts +3 -9
  62. package/dist/hooks/useZingInfiniteQueries.js +1 -0
  63. package/dist/hooks/useZingQueries.d.ts +8 -27
  64. package/dist/hooks/useZingQueries.js +1 -2
  65. package/dist/hooks/useZingQuery.d.ts +11 -36
  66. package/dist/hooks/useZingQuery.js +1 -2
  67. package/dist/lib/utils/index.d.ts +0 -1
  68. package/dist/lib/utils/index.js +0 -1
  69. package/dist/lib/utils/reclaim.d.ts +1 -29
  70. package/dist/lib/utils/reclaim.js +148 -87
  71. package/dist/mutations/signer.js +1 -1
  72. package/dist/mutations/walrus.js +1 -1
  73. package/package.json +1 -1
  74. package/dist/_generated/zing_framework/deps/sui/object.d.ts +0 -8
  75. package/dist/_generated/zing_framework/deps/sui/object.js +0 -13
  76. package/dist/_generated/zing_governance/deps/sui/object.d.ts +0 -8
  77. package/dist/_generated/zing_governance/deps/sui/object.js +0 -13
  78. package/dist/_generated/zing_identity/config.d.ts +0 -87
  79. package/dist/_generated/zing_identity/config.js +0 -98
  80. package/dist/_generated/zing_identity/deps/std/type_name.d.ts +0 -17
  81. package/dist/_generated/zing_identity/deps/std/type_name.js +0 -22
  82. package/dist/_generated/zing_identity/deps/sui/object.d.ts +0 -8
  83. package/dist/_generated/zing_identity/deps/sui/object.js +0 -13
  84. package/dist/_generated/zing_identity/deps/sui/object_table.d.ts +0 -12
  85. package/dist/_generated/zing_identity/deps/sui/object_table.js +0 -23
  86. package/dist/_generated/zing_identity/deps/sui/table.d.ts +0 -12
  87. package/dist/_generated/zing_identity/deps/sui/table.js +0 -35
  88. package/dist/_generated/zing_identity/deps/sui/vec_set.d.ts +0 -17
  89. package/dist/_generated/zing_identity/deps/sui/vec_set.js +0 -22
  90. package/dist/_generated/zing_identity/ecdsa.d.ts +0 -81
  91. package/dist/_generated/zing_identity/ecdsa.js +0 -87
  92. package/dist/_generated/zing_identity/identity.d.ts +0 -262
  93. package/dist/_generated/zing_identity/identity.js +0 -294
  94. package/dist/_generated/zing_identity/reclaim.d.ts +0 -356
  95. package/dist/_generated/zing_identity/reclaim.js +0 -414
  96. package/dist/_generated/zing_studio/nitro_attestation.d.ts +0 -148
  97. package/dist/_generated/zing_studio/nitro_attestation.js +0 -183
  98. package/dist/lib/oauth-pwa.d.ts +0 -11
  99. package/dist/lib/oauth-pwa.js +0 -55
@@ -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 * as vec_map from "./deps/sui/vec_map.js";
6
5
  import * as blob from "./deps/walrus/blob.js";
7
6
  import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
@@ -23,19 +22,6 @@ export const File = new MoveStruct({
23
22
  });
24
23
  export const PublishArticleEvent = new MoveStruct({
25
24
  name: `${$moduleName}::PublishArticleEvent`,
26
- fields: {
27
- article_id: bcs.Address,
28
- owner: bcs.Address,
29
- blob_ids: bcs.vector(bcs.u256()),
30
- blob_sizes: bcs.vector(bcs.u64()),
31
- blob_storage_sizes: bcs.vector(bcs.u64()),
32
- blob_end_epochs: bcs.vector(bcs.u32()),
33
- files: vec_map.VecMap(bcs.string(), File),
34
- timestamp_ms: bcs.u64(),
35
- },
36
- });
37
- export const PublishArticleEventV1 = new MoveStruct({
38
- name: `${$moduleName}::PublishArticleEventV1`,
39
25
  fields: {
40
26
  article_id: bcs.Address,
41
27
  owner: bcs.Address,
@@ -77,7 +63,7 @@ export const ARTICLE = new MoveStruct({
77
63
  export const Article = new MoveStruct({
78
64
  name: `${$moduleName}::Article`,
79
65
  fields: {
80
- id: object.UID,
66
+ id: bcs.Address,
81
67
  owner: bcs.Address,
82
68
  deleted: bcs.bool(),
83
69
  created_at: bcs.u64(),
@@ -93,9 +79,7 @@ export const Article = new MoveStruct({
93
79
  });
94
80
  export function owner(options) {
95
81
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
96
- const argumentsTypes = [
97
- `${packageAddress}::article::Article`,
98
- ];
82
+ const argumentsTypes = [null];
99
83
  const parameterNames = ["self"];
100
84
  return (tx) => tx.moveCall({
101
85
  package: packageAddress,
@@ -106,9 +90,7 @@ export function owner(options) {
106
90
  }
107
91
  export function deleted(options) {
108
92
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
109
- const argumentsTypes = [
110
- `${packageAddress}::article::Article`,
111
- ];
93
+ const argumentsTypes = [null];
112
94
  const parameterNames = ["self"];
113
95
  return (tx) => tx.moveCall({
114
96
  package: packageAddress,
@@ -119,9 +101,7 @@ export function deleted(options) {
119
101
  }
120
102
  export function createdAt(options) {
121
103
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
122
- const argumentsTypes = [
123
- `${packageAddress}::article::Article`,
124
- ];
104
+ const argumentsTypes = [null];
125
105
  const parameterNames = ["self"];
126
106
  return (tx) => tx.moveCall({
127
107
  package: packageAddress,
@@ -132,9 +112,7 @@ export function createdAt(options) {
132
112
  }
133
113
  export function subscriptionLevel(options) {
134
114
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
135
- const argumentsTypes = [
136
- `${packageAddress}::article::Article`,
137
- ];
115
+ const argumentsTypes = [null];
138
116
  const parameterNames = ["self"];
139
117
  return (tx) => tx.moveCall({
140
118
  package: packageAddress,
@@ -145,9 +123,7 @@ export function subscriptionLevel(options) {
145
123
  }
146
124
  export function blobs(options) {
147
125
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
148
- const argumentsTypes = [
149
- `${packageAddress}::article::Article`,
150
- ];
126
+ const argumentsTypes = [null];
151
127
  const parameterNames = ["self"];
152
128
  return (tx) => tx.moveCall({
153
129
  package: packageAddress,
@@ -158,9 +134,7 @@ export function blobs(options) {
158
134
  }
159
135
  export function files(options) {
160
136
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
161
- const argumentsTypes = [
162
- `${packageAddress}::article::Article`,
163
- ];
137
+ const argumentsTypes = [null];
164
138
  const parameterNames = ["self"];
165
139
  return (tx) => tx.moveCall({
166
140
  package: packageAddress,
@@ -176,9 +150,7 @@ export function files(options) {
176
150
  */
177
151
  export function endEpoch(options) {
178
152
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
179
- const argumentsTypes = [
180
- `${packageAddress}::article::Article`,
181
- ];
153
+ const argumentsTypes = [null];
182
154
  const parameterNames = ["self"];
183
155
  return (tx) => tx.moveCall({
184
156
  package: packageAddress,
@@ -190,9 +162,7 @@ export function endEpoch(options) {
190
162
  /** Calculates the total size of all blobs in the article */
191
163
  export function totalBlobSize(options) {
192
164
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
193
- const argumentsTypes = [
194
- `${packageAddress}::article::Article`,
195
- ];
165
+ const argumentsTypes = [null];
196
166
  const parameterNames = ["self"];
197
167
  return (tx) => tx.moveCall({
198
168
  package: packageAddress,
@@ -203,10 +173,7 @@ export function totalBlobSize(options) {
203
173
  }
204
174
  export function isExpired(options) {
205
175
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
206
- const argumentsTypes = [
207
- `${packageAddress}::article::Article`,
208
- `${packageAddress}::system::System`,
209
- ];
176
+ const argumentsTypes = [null, null];
210
177
  const parameterNames = ["self", "walrusSystem"];
211
178
  return (tx) => tx.moveCall({
212
179
  package: packageAddress,
@@ -217,9 +184,7 @@ export function isExpired(options) {
217
184
  }
218
185
  export function isPublic(options) {
219
186
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
220
- const argumentsTypes = [
221
- `${packageAddress}::article::Article`,
222
- ];
187
+ const argumentsTypes = [null];
223
188
  const parameterNames = ["self"];
224
189
  return (tx) => tx.moveCall({
225
190
  package: packageAddress,
@@ -230,9 +195,7 @@ export function isPublic(options) {
230
195
  }
231
196
  export function blobIndex(options) {
232
197
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
233
- const argumentsTypes = [
234
- `${packageAddress}::article::File`,
235
- ];
198
+ const argumentsTypes = [null];
236
199
  const parameterNames = ["file"];
237
200
  return (tx) => tx.moveCall({
238
201
  package: packageAddress,
@@ -243,9 +206,7 @@ export function blobIndex(options) {
243
206
  }
244
207
  export function mimeType(options) {
245
208
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
246
- const argumentsTypes = [
247
- `${packageAddress}::article::File`,
248
- ];
209
+ const argumentsTypes = [null];
249
210
  const parameterNames = ["file"];
250
211
  return (tx) => tx.moveCall({
251
212
  package: packageAddress,
@@ -256,9 +217,7 @@ export function mimeType(options) {
256
217
  }
257
218
  export function fileSize(options) {
258
219
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
259
- const argumentsTypes = [
260
- `${packageAddress}::article::File`,
261
- ];
220
+ const argumentsTypes = [null];
262
221
  const parameterNames = ["file"];
263
222
  return (tx) => tx.moveCall({
264
223
  package: packageAddress,
@@ -269,12 +228,7 @@ export function fileSize(options) {
269
228
  }
270
229
  export function articleBlobAddMetadata(options) {
271
230
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
272
- const argumentsTypes = [
273
- `${packageAddress}::config::Config`,
274
- `${packageAddress}::article::Article`,
275
- "u64",
276
- `${packageAddress}::metadata::Metadata`,
277
- ];
231
+ const argumentsTypes = [null, null, "u64", null];
278
232
  const parameterNames = ["config", "self", "blobIndex", "metadata"];
279
233
  return (tx) => tx.moveCall({
280
234
  package: packageAddress,
@@ -285,12 +239,7 @@ export function articleBlobAddMetadata(options) {
285
239
  }
286
240
  export function articleBlobRemoveMetadata(options) {
287
241
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
288
- const argumentsTypes = [
289
- `${packageAddress}::config::Config`,
290
- `${packageAddress}::article::Article`,
291
- "u64",
292
- "0x0000000000000000000000000000000000000000000000000000000000000001::string::String",
293
- ];
242
+ const argumentsTypes = [null, null, "u64", "0x1::string::String"];
294
243
  const parameterNames = ["config", "self", "blobIndex", "key"];
295
244
  return (tx) => tx.moveCall({
296
245
  package: packageAddress,
@@ -302,11 +251,11 @@ export function articleBlobRemoveMetadata(options) {
302
251
  export function articleBlobInsertOrUpdateMetadataPair(options) {
303
252
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
304
253
  const argumentsTypes = [
305
- `${packageAddress}::config::Config`,
306
- `${packageAddress}::article::Article`,
254
+ null,
255
+ null,
307
256
  "u64",
308
- "0x0000000000000000000000000000000000000000000000000000000000000001::string::String",
309
- "0x0000000000000000000000000000000000000000000000000000000000000001::string::String",
257
+ "0x1::string::String",
258
+ "0x1::string::String",
310
259
  ];
311
260
  const parameterNames = ["config", "self", "blobIndex", "key", "value"];
312
261
  return (tx) => tx.moveCall({
@@ -319,9 +268,9 @@ export function articleBlobInsertOrUpdateMetadataPair(options) {
319
268
  export function certifyArticleBlob(options) {
320
269
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
321
270
  const argumentsTypes = [
322
- `${packageAddress}::config::Config`,
323
- `${packageAddress}::article::Article`,
324
- `${packageAddress}::system::System`,
271
+ null,
272
+ null,
273
+ null,
325
274
  "u64",
326
275
  "vector<u8>",
327
276
  "vector<u8>",
@@ -2,14 +2,13 @@ import { MoveStruct } from "../utils/index.js";
2
2
  import type { RawTransactionArgument } from "../utils/index.js";
3
3
  import type { Transaction } from "@mysten/sui/transactions";
4
4
  export declare const Config: MoveStruct<{
5
- id: MoveStruct<{
6
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
7
- }, "0x2::object::UID">;
5
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
8
6
  versions: MoveStruct<{
9
7
  contents: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
10
8
  length: number;
11
9
  }, "vector<u64>">;
12
10
  }, string>;
11
+ is_paused: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
13
12
  managers: MoveStruct<{
14
13
  contents: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
15
14
  length: number;
@@ -61,6 +60,14 @@ export interface BlobExtendedDurationOptions {
61
60
  arguments?: [];
62
61
  }
63
62
  export declare function blobExtendedDuration(options?: BlobExtendedDurationOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
63
+ export interface IsPausedArguments {
64
+ self: RawTransactionArgument<string>;
65
+ }
66
+ export interface IsPausedOptions {
67
+ package?: string;
68
+ arguments: IsPausedArguments | [self: RawTransactionArgument<string>];
69
+ }
70
+ export declare function isPaused(options: IsPausedOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
64
71
  export interface ManagersArguments {
65
72
  self: RawTransactionArgument<string>;
66
73
  }
@@ -93,6 +100,30 @@ export interface AllowedStablecoinsOptions {
93
100
  arguments: AllowedStablecoinsArguments | [self: RawTransactionArgument<string>];
94
101
  }
95
102
  export declare function allowedStablecoins(options: AllowedStablecoinsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
103
+ export interface PauseArguments {
104
+ self: RawTransactionArgument<string>;
105
+ Cap: RawTransactionArgument<string>;
106
+ }
107
+ export interface PauseOptions {
108
+ package?: string;
109
+ arguments: PauseArguments | [
110
+ self: RawTransactionArgument<string>,
111
+ Cap: RawTransactionArgument<string>
112
+ ];
113
+ }
114
+ export declare function pause(options: PauseOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
115
+ export interface UnpauseArguments {
116
+ self: RawTransactionArgument<string>;
117
+ Cap: RawTransactionArgument<string>;
118
+ }
119
+ export interface UnpauseOptions {
120
+ package?: string;
121
+ arguments: UnpauseArguments | [
122
+ self: RawTransactionArgument<string>,
123
+ Cap: RawTransactionArgument<string>
124
+ ];
125
+ }
126
+ export declare function unpause(options: UnpauseOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
96
127
  export interface AddVersionArguments {
97
128
  self: RawTransactionArgument<string>;
98
129
  Cap: RawTransactionArgument<string>;
@@ -2,7 +2,6 @@
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
4
  import * as type_name from "./deps/std/type_name.js";
5
- import * as object from "./deps/sui/object.js";
6
5
  import * as vec_set from "./deps/sui/vec_set.js";
7
6
  import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
8
7
  import { bcs } from "@mysten/sui/bcs";
@@ -10,8 +9,9 @@ const $moduleName = "@local-pkg/zing_studio::config";
10
9
  export const Config = new MoveStruct({
11
10
  name: `${$moduleName}::Config`,
12
11
  fields: {
13
- id: object.UID,
12
+ id: bcs.Address,
14
13
  versions: vec_set.VecSet(bcs.u64()),
14
+ is_paused: bcs.bool(),
15
15
  managers: vec_set.VecSet(bcs.Address),
16
16
  allowed_works: vec_set.VecSet(type_name.TypeName),
17
17
  platform_fee_bps: bcs.u64(),
@@ -59,11 +59,20 @@ export function blobExtendedDuration(options = {}) {
59
59
  function: "blob_extended_duration",
60
60
  });
61
61
  }
62
+ export function isPaused(options) {
63
+ const packageAddress = options.package ?? "@local-pkg/zing_studio";
64
+ const argumentsTypes = [null];
65
+ const parameterNames = ["self"];
66
+ return (tx) => tx.moveCall({
67
+ package: packageAddress,
68
+ module: "config",
69
+ function: "is_paused",
70
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
71
+ });
72
+ }
62
73
  export function managers(options) {
63
74
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
64
- const argumentsTypes = [
65
- `${packageAddress}::config::Config`,
66
- ];
75
+ const argumentsTypes = [null];
67
76
  const parameterNames = ["self"];
68
77
  return (tx) => tx.moveCall({
69
78
  package: packageAddress,
@@ -74,9 +83,7 @@ export function managers(options) {
74
83
  }
75
84
  export function allowedWorks(options) {
76
85
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
77
- const argumentsTypes = [
78
- `${packageAddress}::config::Config`,
79
- ];
86
+ const argumentsTypes = [null];
80
87
  const parameterNames = ["self"];
81
88
  return (tx) => tx.moveCall({
82
89
  package: packageAddress,
@@ -87,9 +94,7 @@ export function allowedWorks(options) {
87
94
  }
88
95
  export function platformFeeBps(options) {
89
96
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
90
- const argumentsTypes = [
91
- `${packageAddress}::config::Config`,
92
- ];
97
+ const argumentsTypes = [null];
93
98
  const parameterNames = ["self"];
94
99
  return (tx) => tx.moveCall({
95
100
  package: packageAddress,
@@ -100,9 +105,7 @@ export function platformFeeBps(options) {
100
105
  }
101
106
  export function allowedStablecoins(options) {
102
107
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
103
- const argumentsTypes = [
104
- `${packageAddress}::config::Config`,
105
- ];
108
+ const argumentsTypes = [null];
106
109
  const parameterNames = ["self"];
107
110
  return (tx) => tx.moveCall({
108
111
  package: packageAddress,
@@ -111,13 +114,31 @@ export function allowedStablecoins(options) {
111
114
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
112
115
  });
113
116
  }
117
+ export function pause(options) {
118
+ const packageAddress = options.package ?? "@local-pkg/zing_studio";
119
+ const argumentsTypes = [null, null];
120
+ const parameterNames = ["self", "Cap"];
121
+ return (tx) => tx.moveCall({
122
+ package: packageAddress,
123
+ module: "config",
124
+ function: "pause",
125
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
126
+ });
127
+ }
128
+ export function unpause(options) {
129
+ const packageAddress = options.package ?? "@local-pkg/zing_studio";
130
+ const argumentsTypes = [null, null];
131
+ const parameterNames = ["self", "Cap"];
132
+ return (tx) => tx.moveCall({
133
+ package: packageAddress,
134
+ module: "config",
135
+ function: "unpause",
136
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
137
+ });
138
+ }
114
139
  export function addVersion(options) {
115
140
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
116
- const argumentsTypes = [
117
- `${packageAddress}::config::Config`,
118
- `${packageAddress}::admin::AdminCap`,
119
- "u64",
120
- ];
141
+ const argumentsTypes = [null, null, "u64"];
121
142
  const parameterNames = ["self", "Cap", "version"];
122
143
  return (tx) => tx.moveCall({
123
144
  package: packageAddress,
@@ -128,11 +149,7 @@ export function addVersion(options) {
128
149
  }
129
150
  export function removeVersion(options) {
130
151
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
131
- const argumentsTypes = [
132
- `${packageAddress}::config::Config`,
133
- `${packageAddress}::admin::AdminCap`,
134
- "u64",
135
- ];
152
+ const argumentsTypes = [null, null, "u64"];
136
153
  const parameterNames = ["self", "Cap", "version"];
137
154
  return (tx) => tx.moveCall({
138
155
  package: packageAddress,
@@ -143,10 +160,7 @@ export function removeVersion(options) {
143
160
  }
144
161
  export function addAllowedWorks(options) {
145
162
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
146
- const argumentsTypes = [
147
- `${packageAddress}::config::Config`,
148
- `${packageAddress}::admin::AdminCap`,
149
- ];
163
+ const argumentsTypes = [null, null];
150
164
  const parameterNames = ["self", "Cap"];
151
165
  return (tx) => tx.moveCall({
152
166
  package: packageAddress,
@@ -158,10 +172,7 @@ export function addAllowedWorks(options) {
158
172
  }
159
173
  export function removeAllowedWorks(options) {
160
174
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
161
- const argumentsTypes = [
162
- `${packageAddress}::config::Config`,
163
- `${packageAddress}::admin::AdminCap`,
164
- ];
175
+ const argumentsTypes = [null, null];
165
176
  const parameterNames = ["self", "Cap"];
166
177
  return (tx) => tx.moveCall({
167
178
  package: packageAddress,
@@ -173,11 +184,7 @@ export function removeAllowedWorks(options) {
173
184
  }
174
185
  export function updatePlatformFeeBps(options) {
175
186
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
176
- const argumentsTypes = [
177
- `${packageAddress}::config::Config`,
178
- `${packageAddress}::admin::AdminCap`,
179
- "u64",
180
- ];
187
+ const argumentsTypes = [null, null, "u64"];
181
188
  const parameterNames = ["self", "Cap", "platformFeeBps"];
182
189
  return (tx) => tx.moveCall({
183
190
  package: packageAddress,
@@ -188,10 +195,7 @@ export function updatePlatformFeeBps(options) {
188
195
  }
189
196
  export function addAllowedStablecoins(options) {
190
197
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
191
- const argumentsTypes = [
192
- `${packageAddress}::config::Config`,
193
- `${packageAddress}::admin::AdminCap`,
194
- ];
198
+ const argumentsTypes = [null, null];
195
199
  const parameterNames = ["self", "Cap"];
196
200
  return (tx) => tx.moveCall({
197
201
  package: packageAddress,
@@ -203,10 +207,7 @@ export function addAllowedStablecoins(options) {
203
207
  }
204
208
  export function removeAllowedStablecoins(options) {
205
209
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
206
- const argumentsTypes = [
207
- `${packageAddress}::config::Config`,
208
- `${packageAddress}::admin::AdminCap`,
209
- ];
210
+ const argumentsTypes = [null, null];
210
211
  const parameterNames = ["self", "Cap"];
211
212
  return (tx) => tx.moveCall({
212
213
  package: packageAddress,
@@ -218,11 +219,7 @@ export function removeAllowedStablecoins(options) {
218
219
  }
219
220
  export function updaqteMaxNumOfSubscriptionLevel(options) {
220
221
  const packageAddress = options.package ?? "@local-pkg/zing_studio";
221
- const argumentsTypes = [
222
- `${packageAddress}::config::Config`,
223
- `${packageAddress}::admin::AdminCap`,
224
- "u8",
225
- ];
222
+ const argumentsTypes = [null, null, "u8"];
226
223
  const parameterNames = ["self", "Cap", "num"];
227
224
  return (tx) => tx.moveCall({
228
225
  package: packageAddress,
@@ -1,12 +1,34 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
+ /**
5
+ * A bag is a heterogeneous map-like collection. The collection is similar to
6
+ * `sui::table` in that its keys and values are not stored within the `Bag` value,
7
+ * but instead are stored using Sui's object system. The `Bag` struct acts only as
8
+ * a handle into the object system to retrieve those keys and values. Note that
9
+ * this means that `Bag` values with exactly the same key-value mapping will not be
10
+ * equal, with `==`, at runtime. For example
11
+ *
12
+ * ```
13
+ * let bag1 = bag::new();
14
+ * let bag2 = bag::new();
15
+ * bag::add(&mut bag1, 0, false);
16
+ * bag::add(&mut bag1, 1, true);
17
+ * bag::add(&mut bag2, 0, false);
18
+ * bag::add(&mut bag2, 1, true);
19
+ * // bag1 does not equal bag2, despite having the same entries
20
+ * assert!(&bag1 != &bag2);
21
+ * ```
22
+ *
23
+ * At it's core, `sui::bag` is a wrapper around `UID` that allows for access to
24
+ * `sui::dynamic_field` while preventing accidentally stranding field values. A
25
+ * `UID` can be deleted, even if it has dynamic fields associated with it, but a
26
+ * bag, on the other hand, must be empty to be destroyed.
27
+ */
4
28
  import { MoveStruct } from "../../../utils/index.js";
5
29
  export declare const Bag: MoveStruct<{
6
30
  /** the ID of this bag */
7
- id: MoveStruct<{
8
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
9
- }, "0x2::object::UID">;
31
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
10
32
  /** the number of key-value pairs in the bag */
11
33
  size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
12
34
  }, "0x2::bag::Bag">;
@@ -25,7 +25,6 @@
25
25
  * `UID` can be deleted, even if it has dynamic fields associated with it, but a
26
26
  * bag, on the other hand, must be empty to be destroyed.
27
27
  */
28
- import * as object from "./object.js";
29
28
  import { MoveStruct } from "../../../utils/index.js";
30
29
  import { bcs } from "@mysten/sui/bcs";
31
30
  const $moduleName = "0x2::bag";
@@ -33,7 +32,7 @@ export const Bag = new MoveStruct({
33
32
  name: `${$moduleName}::Bag`,
34
33
  fields: {
35
34
  /** the ID of this bag */
36
- id: object.UID,
35
+ id: bcs.Address,
37
36
  /** the number of key-value pairs in the bag */
38
37
  size: bcs.u64(),
39
38
  },
@@ -9,4 +9,4 @@
9
9
  import { MoveStruct } from "../../../utils/index.js";
10
10
  export declare const Balance: MoveStruct<{
11
11
  value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
12
- }, "0x2::balance::Balance">;
12
+ }, "0x2::balance::Balance<phantom T>">;
@@ -10,7 +10,7 @@ import { MoveStruct } from "../../../utils/index.js";
10
10
  import { bcs } from "@mysten/sui/bcs";
11
11
  const $moduleName = "0x2::balance";
12
12
  export const Balance = new MoveStruct({
13
- name: `${$moduleName}::Balance`,
13
+ name: `${$moduleName}::Balance<phantom T>`,
14
14
  fields: {
15
15
  value: bcs.u64(),
16
16
  },
@@ -3,10 +3,8 @@
3
3
  **************************************************************/
4
4
  import { MoveStruct } from "../../../utils/index.js";
5
5
  export declare const Coin: MoveStruct<{
6
- id: MoveStruct<{
7
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
8
- }, "0x2::object::UID">;
6
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
9
7
  balance: MoveStruct<{
10
8
  value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
11
- }, "0x2::balance::Balance">;
12
- }, "0x2::coin::Coin">;
9
+ }, "0x2::balance::Balance<phantom T>">;
10
+ }, "0x2::coin::Coin<phantom T>">;
@@ -6,13 +6,13 @@
6
6
  * coins. `Coin` can be described as a secure wrapper around `Balance` type.
7
7
  */
8
8
  import * as balance from "./balance.js";
9
- import * as object from "./object.js";
10
9
  import { MoveStruct } from "../../../utils/index.js";
10
+ import { bcs } from "@mysten/sui/bcs";
11
11
  const $moduleName = "0x2::coin";
12
12
  export const Coin = new MoveStruct({
13
- name: `${$moduleName}::Coin`,
13
+ name: `${$moduleName}::Coin<phantom T>`,
14
14
  fields: {
15
- id: object.UID,
15
+ id: bcs.Address,
16
16
  balance: balance.Balance,
17
17
  },
18
18
  });
@@ -1,12 +1,29 @@
1
1
  /**************************************************************
2
2
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
3
  **************************************************************/
4
+ /**
5
+ * A table is a map-like collection. But unlike a traditional collection, it's keys
6
+ * and values are not stored within the `Table` value, but instead are stored using
7
+ * Sui's object system. The `Table` struct acts only as a handle into the object
8
+ * system to retrieve those keys and values. Note that this means that `Table`
9
+ * values with exactly the same key-value mapping will not be equal, with `==`, at
10
+ * runtime. For example
11
+ *
12
+ * ```
13
+ * let table1 = table::new<u64, bool>();
14
+ * let table2 = table::new<u64, bool>();
15
+ * table::add(&mut table1, 0, false);
16
+ * table::add(&mut table1, 1, true);
17
+ * table::add(&mut table2, 0, false);
18
+ * table::add(&mut table2, 1, true);
19
+ * // table1 does not equal table2, despite having the same entries
20
+ * assert!(&table1 != &table2);
21
+ * ```
22
+ */
4
23
  import { MoveStruct } from "../../../utils/index.js";
5
24
  export declare const Table: MoveStruct<{
6
25
  /** 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">;
26
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
10
27
  /** the number of key-value pairs in the table */
11
28
  size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
12
- }, "0x2::table::Table">;
29
+ }, "0x2::table::Table<phantom K, phantom V>">;
@@ -20,15 +20,14 @@
20
20
  * assert!(&table1 != &table2);
21
21
  * ```
22
22
  */
23
- import * as object from "./object.js";
24
23
  import { MoveStruct } from "../../../utils/index.js";
25
24
  import { bcs } from "@mysten/sui/bcs";
26
25
  const $moduleName = "0x2::table";
27
26
  export const Table = new MoveStruct({
28
- name: `${$moduleName}::Table`,
27
+ name: `${$moduleName}::Table<phantom K, phantom V>`,
29
28
  fields: {
30
29
  /** the ID of this table */
31
- id: object.UID,
30
+ id: bcs.Address,
32
31
  /** the number of key-value pairs in the table */
33
32
  size: bcs.u64(),
34
33
  },
@@ -1,17 +1,13 @@
1
1
  import { MoveStruct } from "../../../utils/index.js";
2
2
  export declare const Blob: MoveStruct<{
3
- id: MoveStruct<{
4
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
5
- }, "0x2::object::UID">;
3
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
6
4
  registered_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
7
5
  blob_id: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u256">;
8
6
  size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
9
7
  encoding_type: import("@mysten/sui/bcs").BcsType<number, number, "u8">;
10
8
  certified_epoch: import("@mysten/sui/bcs").BcsType<number | null, number | null | undefined, "Option<u32>">;
11
9
  storage: MoveStruct<{
12
- id: MoveStruct<{
13
- id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
14
- }, "0x2::object::UID">;
10
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
15
11
  start_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
16
12
  end_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
17
13
  storage_size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;