@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.
- package/dist/_generated/index.d.ts +0 -2
- package/dist/_generated/index.js +0 -2
- package/dist/_generated/utils/index.d.ts +21 -2
- package/dist/_generated/utils/index.js +35 -11
- package/dist/_generated/zing_framework/coin_utils.js +1 -4
- package/dist/_generated/zing_framework/derived_object_bag.d.ts +4 -3
- package/dist/_generated/zing_framework/derived_object_bag.js +12 -37
- package/dist/_generated/zing_framework/derived_table.d.ts +5 -4
- package/dist/_generated/zing_framework/derived_table.js +12 -33
- package/dist/_generated/zing_governance/admin.d.ts +4 -17
- package/dist/_generated/zing_governance/admin.js +3 -17
- package/dist/_generated/zing_governance/treasury.d.ts +5 -4
- package/dist/_generated/zing_governance/treasury.js +5 -15
- package/dist/_generated/zing_studio/app.d.ts +70 -2
- package/dist/_generated/zing_studio/app.js +154 -100
- package/dist/_generated/zing_studio/article.d.ts +6 -52
- package/dist/_generated/zing_studio/article.js +23 -74
- package/dist/_generated/zing_studio/config.d.ts +34 -3
- package/dist/_generated/zing_studio/config.js +47 -50
- package/dist/_generated/zing_studio/deps/sui/bag.d.ts +25 -3
- package/dist/_generated/zing_studio/deps/sui/bag.js +1 -2
- package/dist/_generated/zing_studio/deps/sui/balance.d.ts +1 -1
- package/dist/_generated/zing_studio/deps/sui/balance.js +1 -1
- package/dist/_generated/zing_studio/deps/sui/coin.d.ts +3 -5
- package/dist/_generated/zing_studio/deps/sui/coin.js +3 -3
- package/dist/_generated/zing_studio/deps/sui/table.d.ts +21 -4
- package/dist/_generated/zing_studio/deps/sui/table.js +2 -3
- package/dist/_generated/zing_studio/deps/walrus/blob.d.ts +2 -6
- package/dist/_generated/zing_studio/deps/walrus/blob.js +1 -2
- package/dist/_generated/zing_studio/deps/walrus/storage_resource.d.ts +1 -3
- package/dist/_generated/zing_studio/deps/walrus/storage_resource.js +1 -2
- package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.d.ts +1 -3
- package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.js +1 -2
- package/dist/_generated/zing_studio/deps/zing_framework/derived_table.d.ts +2 -4
- package/dist/_generated/zing_studio/deps/zing_framework/derived_table.js +2 -3
- package/dist/_generated/zing_studio/donation.d.ts +6 -14
- package/dist/_generated/zing_studio/donation.js +2 -2
- package/dist/_generated/zing_studio/enclave.d.ts +17 -10
- package/dist/_generated/zing_studio/enclave.js +16 -41
- package/dist/_generated/zing_studio/referral.js +15 -46
- package/dist/_generated/zing_studio/storage.d.ts +13 -17
- package/dist/_generated/zing_studio/storage.js +46 -100
- package/dist/_generated/zing_studio/studio.d.ts +6 -28
- package/dist/_generated/zing_studio/studio.js +23 -96
- package/dist/client/index.d.ts +18 -55
- package/dist/client/index.js +1 -28
- package/dist/config/common.d.ts +0 -6
- package/dist/config/common.js +0 -51
- package/dist/config/mainnet.js +12 -38
- package/dist/config/testnet.js +2 -26
- package/dist/config/types.d.ts +1 -6
- package/dist/const.js +1 -1
- package/dist/getters.d.ts +17 -62
- package/dist/getters.js +62 -56
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useGetStudio.d.ts +4 -10
- package/dist/hooks/useReclaim.d.ts +0 -10
- package/dist/hooks/useReclaim.js +169 -92
- package/dist/hooks/useSignAndExecuteTransaction.js +4 -1
- package/dist/hooks/useZingInfiniteQueries.d.ts +3 -9
- package/dist/hooks/useZingInfiniteQueries.js +1 -0
- package/dist/hooks/useZingQueries.d.ts +8 -27
- package/dist/hooks/useZingQueries.js +1 -2
- package/dist/hooks/useZingQuery.d.ts +11 -36
- package/dist/hooks/useZingQuery.js +1 -2
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/index.js +0 -1
- package/dist/lib/utils/reclaim.d.ts +1 -29
- package/dist/lib/utils/reclaim.js +148 -87
- package/dist/mutations/signer.js +1 -1
- package/dist/mutations/walrus.js +1 -1
- package/package.json +1 -1
- package/dist/_generated/zing_framework/deps/sui/object.d.ts +0 -8
- package/dist/_generated/zing_framework/deps/sui/object.js +0 -13
- package/dist/_generated/zing_governance/deps/sui/object.d.ts +0 -8
- package/dist/_generated/zing_governance/deps/sui/object.js +0 -13
- package/dist/_generated/zing_identity/config.d.ts +0 -87
- package/dist/_generated/zing_identity/config.js +0 -98
- package/dist/_generated/zing_identity/deps/std/type_name.d.ts +0 -17
- package/dist/_generated/zing_identity/deps/std/type_name.js +0 -22
- package/dist/_generated/zing_identity/deps/sui/object.d.ts +0 -8
- package/dist/_generated/zing_identity/deps/sui/object.js +0 -13
- package/dist/_generated/zing_identity/deps/sui/object_table.d.ts +0 -12
- package/dist/_generated/zing_identity/deps/sui/object_table.js +0 -23
- package/dist/_generated/zing_identity/deps/sui/table.d.ts +0 -12
- package/dist/_generated/zing_identity/deps/sui/table.js +0 -35
- package/dist/_generated/zing_identity/deps/sui/vec_set.d.ts +0 -17
- package/dist/_generated/zing_identity/deps/sui/vec_set.js +0 -22
- package/dist/_generated/zing_identity/ecdsa.d.ts +0 -81
- package/dist/_generated/zing_identity/ecdsa.js +0 -87
- package/dist/_generated/zing_identity/identity.d.ts +0 -262
- package/dist/_generated/zing_identity/identity.js +0 -294
- package/dist/_generated/zing_identity/reclaim.d.ts +0 -356
- package/dist/_generated/zing_identity/reclaim.js +0 -414
- package/dist/_generated/zing_studio/nitro_attestation.d.ts +0 -148
- package/dist/_generated/zing_studio/nitro_attestation.js +0 -183
- package/dist/lib/oauth-pwa.d.ts +0 -11
- 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 derived_object_bag from "./deps/zing_framework/derived_object_bag.js";
|
|
7
6
|
import * as derived_table from "./deps/zing_framework/derived_table.js";
|
|
@@ -28,7 +27,7 @@ export const STUDIO = new MoveStruct({
|
|
|
28
27
|
export const Studio = new MoveStruct({
|
|
29
28
|
name: `${$moduleName}::Studio`,
|
|
30
29
|
fields: {
|
|
31
|
-
id:
|
|
30
|
+
id: bcs.Address,
|
|
32
31
|
/** The owner of this studio - only they can add/remove works */
|
|
33
32
|
owner: bcs.Address,
|
|
34
33
|
period: Period,
|
|
@@ -71,9 +70,7 @@ export function membershipSubscriptionEarningKey(options = {}) {
|
|
|
71
70
|
/** Returns the owner address of this studio */
|
|
72
71
|
export function owner(options) {
|
|
73
72
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
74
|
-
const argumentsTypes = [
|
|
75
|
-
`${packageAddress}::studio::Studio`,
|
|
76
|
-
];
|
|
73
|
+
const argumentsTypes = [null];
|
|
77
74
|
const parameterNames = ["self"];
|
|
78
75
|
return (tx) => tx.moveCall({
|
|
79
76
|
package: packageAddress,
|
|
@@ -84,9 +81,7 @@ export function owner(options) {
|
|
|
84
81
|
}
|
|
85
82
|
export function period(options) {
|
|
86
83
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
87
|
-
const argumentsTypes = [
|
|
88
|
-
`${packageAddress}::studio::Studio`,
|
|
89
|
-
];
|
|
84
|
+
const argumentsTypes = [null];
|
|
90
85
|
const parameterNames = ["self"];
|
|
91
86
|
return (tx) => tx.moveCall({
|
|
92
87
|
package: packageAddress,
|
|
@@ -97,9 +92,7 @@ export function period(options) {
|
|
|
97
92
|
}
|
|
98
93
|
export function startAt(options) {
|
|
99
94
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
100
|
-
const argumentsTypes = [
|
|
101
|
-
`${packageAddress}::studio::Studio`,
|
|
102
|
-
];
|
|
95
|
+
const argumentsTypes = [null];
|
|
103
96
|
const parameterNames = ["self"];
|
|
104
97
|
return (tx) => tx.moveCall({
|
|
105
98
|
package: packageAddress,
|
|
@@ -110,9 +103,7 @@ export function startAt(options) {
|
|
|
110
103
|
}
|
|
111
104
|
export function endAt(options) {
|
|
112
105
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
113
|
-
const argumentsTypes = [
|
|
114
|
-
`${packageAddress}::studio::Studio`,
|
|
115
|
-
];
|
|
106
|
+
const argumentsTypes = [null];
|
|
116
107
|
const parameterNames = ["self"];
|
|
117
108
|
return (tx) => tx.moveCall({
|
|
118
109
|
package: packageAddress,
|
|
@@ -123,9 +114,7 @@ export function endAt(options) {
|
|
|
123
114
|
}
|
|
124
115
|
export function memberLevel(options) {
|
|
125
116
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
126
|
-
const argumentsTypes = [
|
|
127
|
-
`${packageAddress}::studio::Member`,
|
|
128
|
-
];
|
|
117
|
+
const argumentsTypes = [null];
|
|
129
118
|
const parameterNames = ["member"];
|
|
130
119
|
return (tx) => tx.moveCall({
|
|
131
120
|
package: packageAddress,
|
|
@@ -136,9 +125,7 @@ export function memberLevel(options) {
|
|
|
136
125
|
}
|
|
137
126
|
export function memberExpiredAt(options) {
|
|
138
127
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
139
|
-
const argumentsTypes = [
|
|
140
|
-
`${packageAddress}::studio::Member`,
|
|
141
|
-
];
|
|
128
|
+
const argumentsTypes = [null];
|
|
142
129
|
const parameterNames = ["member"];
|
|
143
130
|
return (tx) => tx.moveCall({
|
|
144
131
|
package: packageAddress,
|
|
@@ -149,9 +136,7 @@ export function memberExpiredAt(options) {
|
|
|
149
136
|
}
|
|
150
137
|
export function monthlySubscriptionFee(options) {
|
|
151
138
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
152
|
-
const argumentsTypes = [
|
|
153
|
-
`${packageAddress}::studio::Studio`,
|
|
154
|
-
];
|
|
139
|
+
const argumentsTypes = [null];
|
|
155
140
|
const parameterNames = ["self"];
|
|
156
141
|
return (tx) => tx.moveCall({
|
|
157
142
|
package: packageAddress,
|
|
@@ -162,9 +147,7 @@ export function monthlySubscriptionFee(options) {
|
|
|
162
147
|
}
|
|
163
148
|
export function earnings(options) {
|
|
164
149
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
165
|
-
const argumentsTypes = [
|
|
166
|
-
`${packageAddress}::studio::Studio`,
|
|
167
|
-
];
|
|
150
|
+
const argumentsTypes = [null];
|
|
168
151
|
const parameterNames = ["self"];
|
|
169
152
|
return (tx) => tx.moveCall({
|
|
170
153
|
package: packageAddress,
|
|
@@ -175,9 +158,7 @@ export function earnings(options) {
|
|
|
175
158
|
}
|
|
176
159
|
export function membership(options) {
|
|
177
160
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
178
|
-
const argumentsTypes = [
|
|
179
|
-
`${packageAddress}::studio::Studio`,
|
|
180
|
-
];
|
|
161
|
+
const argumentsTypes = [null];
|
|
181
162
|
const parameterNames = ["self"];
|
|
182
163
|
return (tx) => tx.moveCall({
|
|
183
164
|
package: packageAddress,
|
|
@@ -192,10 +173,7 @@ export function membership(options) {
|
|
|
192
173
|
*/
|
|
193
174
|
export function assetOf(options) {
|
|
194
175
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
195
|
-
const argumentsTypes = [
|
|
196
|
-
`${packageAddress}::studio::Studio`,
|
|
197
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::object::ID",
|
|
198
|
-
];
|
|
176
|
+
const argumentsTypes = [null, "0x2::object::ID"];
|
|
199
177
|
const parameterNames = ["self", "assetId"];
|
|
200
178
|
return (tx) => tx.moveCall({
|
|
201
179
|
package: packageAddress,
|
|
@@ -207,9 +185,7 @@ export function assetOf(options) {
|
|
|
207
185
|
}
|
|
208
186
|
export function works(options) {
|
|
209
187
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
210
|
-
const argumentsTypes = [
|
|
211
|
-
`${packageAddress}::studio::Studio`,
|
|
212
|
-
];
|
|
188
|
+
const argumentsTypes = [null];
|
|
213
189
|
const parameterNames = ["self"];
|
|
214
190
|
return (tx) => tx.moveCall({
|
|
215
191
|
package: packageAddress,
|
|
@@ -220,9 +196,7 @@ export function works(options) {
|
|
|
220
196
|
}
|
|
221
197
|
export function encryptedFileKey(options) {
|
|
222
198
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
223
|
-
const argumentsTypes = [
|
|
224
|
-
`${packageAddress}::studio::Studio`,
|
|
225
|
-
];
|
|
199
|
+
const argumentsTypes = [null];
|
|
226
200
|
const parameterNames = ["self"];
|
|
227
201
|
return (tx) => tx.moveCall({
|
|
228
202
|
package: packageAddress,
|
|
@@ -233,11 +207,7 @@ export function encryptedFileKey(options) {
|
|
|
233
207
|
}
|
|
234
208
|
export function sealApproveStudioOwner(options) {
|
|
235
209
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
236
|
-
const argumentsTypes = [
|
|
237
|
-
"vector<u8>",
|
|
238
|
-
`${packageAddress}::config::Config`,
|
|
239
|
-
`${packageAddress}::studio::Studio`,
|
|
240
|
-
];
|
|
210
|
+
const argumentsTypes = ["vector<u8>", null, null];
|
|
241
211
|
const parameterNames = ["id", "config", "self"];
|
|
242
212
|
return (tx) => tx.moveCall({
|
|
243
213
|
package: packageAddress,
|
|
@@ -246,29 +216,9 @@ export function sealApproveStudioOwner(options) {
|
|
|
246
216
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
247
217
|
});
|
|
248
218
|
}
|
|
249
|
-
export function sealApproveRegisteredEnclave(options) {
|
|
250
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
251
|
-
const argumentsTypes = [
|
|
252
|
-
"vector<u8>",
|
|
253
|
-
`${packageAddress}::config::Config`,
|
|
254
|
-
`${packageAddress}::studio::Studio`,
|
|
255
|
-
`${packageAddress}::enclave::Enclave`,
|
|
256
|
-
];
|
|
257
|
-
const parameterNames = ["id", "config", "self", "enclave"];
|
|
258
|
-
return (tx) => tx.moveCall({
|
|
259
|
-
package: packageAddress,
|
|
260
|
-
module: "studio",
|
|
261
|
-
function: "seal_approve_registered_enclave",
|
|
262
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
219
|
export function sealApproveManager(options) {
|
|
266
220
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
267
|
-
const argumentsTypes = [
|
|
268
|
-
"vector<u8>",
|
|
269
|
-
`${packageAddress}::config::Config`,
|
|
270
|
-
`${packageAddress}::studio::Studio`,
|
|
271
|
-
];
|
|
221
|
+
const argumentsTypes = ["vector<u8>", null, null];
|
|
272
222
|
const parameterNames = ["id", "config", "self"];
|
|
273
223
|
return (tx) => tx.moveCall({
|
|
274
224
|
package: packageAddress,
|
|
@@ -283,10 +233,7 @@ export function sealApproveManager(options) {
|
|
|
283
233
|
*/
|
|
284
234
|
export function studioOf(options) {
|
|
285
235
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
286
|
-
const argumentsTypes = [
|
|
287
|
-
`${packageAddress}::config::Config`,
|
|
288
|
-
"address",
|
|
289
|
-
];
|
|
236
|
+
const argumentsTypes = [null, "address"];
|
|
290
237
|
const parameterNames = ["config", "owner"];
|
|
291
238
|
return (tx) => tx.moveCall({
|
|
292
239
|
package: packageAddress,
|
|
@@ -301,10 +248,7 @@ export function studioOf(options) {
|
|
|
301
248
|
*/
|
|
302
249
|
export function studioExists(options) {
|
|
303
250
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
304
|
-
const argumentsTypes = [
|
|
305
|
-
`${packageAddress}::config::Config`,
|
|
306
|
-
"address",
|
|
307
|
-
];
|
|
251
|
+
const argumentsTypes = [null, "address"];
|
|
308
252
|
const parameterNames = ["config", "owner"];
|
|
309
253
|
return (tx) => tx.moveCall({
|
|
310
254
|
package: packageAddress,
|
|
@@ -315,10 +259,7 @@ export function studioExists(options) {
|
|
|
315
259
|
}
|
|
316
260
|
export function isInValidPeriod(options) {
|
|
317
261
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
318
|
-
const argumentsTypes = [
|
|
319
|
-
`${packageAddress}::studio::Studio`,
|
|
320
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
321
|
-
];
|
|
262
|
+
const argumentsTypes = [null, "0x2::clock::Clock"];
|
|
322
263
|
const parameterNames = ["self"];
|
|
323
264
|
return (tx) => tx.moveCall({
|
|
324
265
|
package: packageAddress,
|
|
@@ -329,11 +270,7 @@ export function isInValidPeriod(options) {
|
|
|
329
270
|
}
|
|
330
271
|
export function membershipLevel(options) {
|
|
331
272
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
332
|
-
const argumentsTypes = [
|
|
333
|
-
`${packageAddress}::studio::Studio`,
|
|
334
|
-
"address",
|
|
335
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
336
|
-
];
|
|
273
|
+
const argumentsTypes = [null, "address", "0x2::clock::Clock"];
|
|
337
274
|
const parameterNames = ["self", "member"];
|
|
338
275
|
return (tx) => tx.moveCall({
|
|
339
276
|
package: packageAddress,
|
|
@@ -344,11 +281,7 @@ export function membershipLevel(options) {
|
|
|
344
281
|
}
|
|
345
282
|
export function isMembership(options) {
|
|
346
283
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
347
|
-
const argumentsTypes = [
|
|
348
|
-
`${packageAddress}::studio::Studio`,
|
|
349
|
-
"address",
|
|
350
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
351
|
-
];
|
|
284
|
+
const argumentsTypes = [null, "address", "0x2::clock::Clock"];
|
|
352
285
|
const parameterNames = ["self", "member"];
|
|
353
286
|
return (tx) => tx.moveCall({
|
|
354
287
|
package: packageAddress,
|
|
@@ -364,9 +297,7 @@ export function isMembership(options) {
|
|
|
364
297
|
*/
|
|
365
298
|
export function _new(options) {
|
|
366
299
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
367
|
-
const argumentsTypes = [
|
|
368
|
-
`${packageAddress}::config::Config`,
|
|
369
|
-
];
|
|
300
|
+
const argumentsTypes = [null];
|
|
370
301
|
const parameterNames = ["config"];
|
|
371
302
|
return (tx) => tx.moveCall({
|
|
372
303
|
package: packageAddress,
|
|
@@ -377,9 +308,7 @@ export function _new(options) {
|
|
|
377
308
|
}
|
|
378
309
|
export function shareStudio(options) {
|
|
379
310
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
380
|
-
const argumentsTypes = [
|
|
381
|
-
`${packageAddress}::studio::Studio`,
|
|
382
|
-
];
|
|
311
|
+
const argumentsTypes = [null];
|
|
383
312
|
const parameterNames = ["self"];
|
|
384
313
|
return (tx) => tx.moveCall({
|
|
385
314
|
package: packageAddress,
|
|
@@ -390,9 +319,7 @@ export function shareStudio(options) {
|
|
|
390
319
|
}
|
|
391
320
|
export function totalEarning(options) {
|
|
392
321
|
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
393
|
-
const argumentsTypes = [
|
|
394
|
-
`${packageAddress}::studio::Studio`,
|
|
395
|
-
];
|
|
322
|
+
const argumentsTypes = [null];
|
|
396
323
|
const parameterNames = ["self"];
|
|
397
324
|
return (tx) => tx.moveCall({
|
|
398
325
|
package: packageAddress,
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SessionKey } from "@mysten/seal";
|
|
2
2
|
import { Transaction } from "@mysten/sui/transactions";
|
|
3
3
|
import type { PurchaseStorageTierParams, SetMonthlySubscriptionFeeParams, SubscribeParams } from "./types.js";
|
|
4
|
-
import type { CoinSymbol,
|
|
4
|
+
import type { CoinSymbol, WorkType } from "../config/index.js";
|
|
5
5
|
import type { Config } from "../config/types.js";
|
|
6
6
|
import type { SuiNetwork, ZKLoginSignerState } from "../types.js";
|
|
7
7
|
import type { SealClient } from "@mysten/seal";
|
|
@@ -24,17 +24,10 @@ export declare class ZingClient {
|
|
|
24
24
|
getDerivedWorksID(address: string): string;
|
|
25
25
|
getDerivedMembershipID(address: string): string;
|
|
26
26
|
getReferralID(address: string): string;
|
|
27
|
-
getIdentifierByAddress(platform: PlatformType, address: string): Promise<string | null>;
|
|
28
|
-
getIdentifierInfoByIdentifier(platform: PlatformType, identifier: string): Promise<{
|
|
29
|
-
owner: string;
|
|
30
|
-
updated_at: string;
|
|
31
|
-
} | null>;
|
|
32
27
|
getStudio(owner: string): Promise<{
|
|
33
|
-
id:
|
|
34
|
-
id: string;
|
|
35
|
-
};
|
|
28
|
+
id: string;
|
|
36
29
|
owner: string;
|
|
37
|
-
period: string
|
|
30
|
+
period: [string, string];
|
|
38
31
|
monthly_subscription_fee: {
|
|
39
32
|
contents: {
|
|
40
33
|
key: number;
|
|
@@ -42,15 +35,11 @@ export declare class ZingClient {
|
|
|
42
35
|
}[];
|
|
43
36
|
};
|
|
44
37
|
membership: {
|
|
45
|
-
id:
|
|
46
|
-
id: string;
|
|
47
|
-
};
|
|
38
|
+
id: string;
|
|
48
39
|
size: string;
|
|
49
40
|
};
|
|
50
41
|
works: {
|
|
51
|
-
id:
|
|
52
|
-
id: string;
|
|
53
|
-
};
|
|
42
|
+
id: string;
|
|
54
43
|
size: string;
|
|
55
44
|
};
|
|
56
45
|
encrypted_file_key: number[] | null;
|
|
@@ -62,9 +51,7 @@ export declare class ZingClient {
|
|
|
62
51
|
};
|
|
63
52
|
} | null>;
|
|
64
53
|
getStorageSpace(owner: string): Promise<{
|
|
65
|
-
id:
|
|
66
|
-
id: string;
|
|
67
|
-
};
|
|
54
|
+
id: string;
|
|
68
55
|
owner: string;
|
|
69
56
|
tier: number | null;
|
|
70
57
|
storage_used: {
|
|
@@ -80,9 +67,7 @@ export declare class ZingClient {
|
|
|
80
67
|
};
|
|
81
68
|
} | null>;
|
|
82
69
|
getStorageTreasury(): Promise<{
|
|
83
|
-
id:
|
|
84
|
-
id: string;
|
|
85
|
-
};
|
|
70
|
+
id: string;
|
|
86
71
|
tier_plan: {
|
|
87
72
|
contents: {
|
|
88
73
|
key: number;
|
|
@@ -97,9 +82,7 @@ export declare class ZingClient {
|
|
|
97
82
|
contents: {
|
|
98
83
|
key: number;
|
|
99
84
|
value: {
|
|
100
|
-
id:
|
|
101
|
-
id: string;
|
|
102
|
-
};
|
|
85
|
+
id: string;
|
|
103
86
|
start_epoch: number;
|
|
104
87
|
end_epoch: number;
|
|
105
88
|
storage_size: string;
|
|
@@ -113,9 +96,7 @@ export declare class ZingClient {
|
|
|
113
96
|
}[];
|
|
114
97
|
};
|
|
115
98
|
wal_treasury: {
|
|
116
|
-
id:
|
|
117
|
-
id: string;
|
|
118
|
-
};
|
|
99
|
+
id: string;
|
|
119
100
|
balance: {
|
|
120
101
|
value: string;
|
|
121
102
|
};
|
|
@@ -149,26 +130,20 @@ export declare class ZingClient {
|
|
|
149
130
|
expired_at: string;
|
|
150
131
|
} | null>;
|
|
151
132
|
getWork(workId: string, workType?: WorkType): Promise<{
|
|
152
|
-
id:
|
|
153
|
-
id: string;
|
|
154
|
-
};
|
|
133
|
+
id: string;
|
|
155
134
|
owner: string;
|
|
156
135
|
deleted: boolean;
|
|
157
136
|
created_at: string;
|
|
158
137
|
subscription_level: number | null;
|
|
159
138
|
blobs: {
|
|
160
|
-
id:
|
|
161
|
-
id: string;
|
|
162
|
-
};
|
|
139
|
+
id: string;
|
|
163
140
|
registered_epoch: number;
|
|
164
141
|
blob_id: string;
|
|
165
142
|
size: string;
|
|
166
143
|
encoding_type: number;
|
|
167
144
|
certified_epoch: number | null;
|
|
168
145
|
storage: {
|
|
169
|
-
id:
|
|
170
|
-
id: string;
|
|
171
|
-
};
|
|
146
|
+
id: string;
|
|
172
147
|
start_epoch: number;
|
|
173
148
|
end_epoch: number;
|
|
174
149
|
storage_size: string;
|
|
@@ -188,26 +163,20 @@ export declare class ZingClient {
|
|
|
188
163
|
} | null>;
|
|
189
164
|
getWorks(owner: string, workType?: WorkType, cursor?: string, limit?: number): Promise<{
|
|
190
165
|
data: {
|
|
191
|
-
id:
|
|
192
|
-
id: string;
|
|
193
|
-
};
|
|
166
|
+
id: string;
|
|
194
167
|
owner: string;
|
|
195
168
|
deleted: boolean;
|
|
196
169
|
created_at: string;
|
|
197
170
|
subscription_level: number | null;
|
|
198
171
|
blobs: {
|
|
199
|
-
id:
|
|
200
|
-
id: string;
|
|
201
|
-
};
|
|
172
|
+
id: string;
|
|
202
173
|
registered_epoch: number;
|
|
203
174
|
blob_id: string;
|
|
204
175
|
size: string;
|
|
205
176
|
encoding_type: number;
|
|
206
177
|
certified_epoch: number | null;
|
|
207
178
|
storage: {
|
|
208
|
-
id:
|
|
209
|
-
id: string;
|
|
210
|
-
};
|
|
179
|
+
id: string;
|
|
211
180
|
start_epoch: number;
|
|
212
181
|
end_epoch: number;
|
|
213
182
|
storage_size: string;
|
|
@@ -229,26 +198,20 @@ export declare class ZingClient {
|
|
|
229
198
|
hasNextPage: boolean;
|
|
230
199
|
}>;
|
|
231
200
|
getWorksByObjectIds(owner: string, workObjectIds: string[], workType?: WorkType): Promise<{
|
|
232
|
-
id:
|
|
233
|
-
id: string;
|
|
234
|
-
};
|
|
201
|
+
id: string;
|
|
235
202
|
owner: string;
|
|
236
203
|
deleted: boolean;
|
|
237
204
|
created_at: string;
|
|
238
205
|
subscription_level: number | null;
|
|
239
206
|
blobs: {
|
|
240
|
-
id:
|
|
241
|
-
id: string;
|
|
242
|
-
};
|
|
207
|
+
id: string;
|
|
243
208
|
registered_epoch: number;
|
|
244
209
|
blob_id: string;
|
|
245
210
|
size: string;
|
|
246
211
|
encoding_type: number;
|
|
247
212
|
certified_epoch: number | null;
|
|
248
213
|
storage: {
|
|
249
|
-
id:
|
|
250
|
-
id: string;
|
|
251
|
-
};
|
|
214
|
+
id: string;
|
|
252
215
|
start_epoch: number;
|
|
253
216
|
end_epoch: number;
|
|
254
217
|
storage_size: string;
|
package/dist/client/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { addReferralToStudio } from "../_generated/zing_studio/referral.js";
|
|
|
4
4
|
import { shareStorageSpace } from "../_generated/zing_studio/storage.js";
|
|
5
5
|
import { _new as newStudio, sealApproveStudioOwner, shareStudio, } from "../_generated/zing_studio/studio.js";
|
|
6
6
|
import { getConfig } from "../config/index.js";
|
|
7
|
-
import { getDerivedMembershipID, getDerivedStorageID, getDerivedStudioID, getDerivedWorksID,
|
|
7
|
+
import { getDerivedMembershipID, getDerivedStorageID, getDerivedStudioID, getDerivedWorksID, getMember, getMembers, getReferral, getReferralID, getStorageSpace, getStorageTreasury, getStudio, getWork, getWorks, getWorksByObjectIds, } from "../getters.js";
|
|
8
8
|
import { importFileKey } from "../mutations/seal.js";
|
|
9
9
|
import { signPersonalMessage } from "../mutations/signer.js";
|
|
10
10
|
import { SessionKey } from "@mysten/seal";
|
|
@@ -36,33 +36,6 @@ export class ZingClient {
|
|
|
36
36
|
getReferralID(address) {
|
|
37
37
|
return getReferralID(this.config.zing.ZING_STUDIO_CONFIG_SHARED_OBJECT_REF.objectId, address);
|
|
38
38
|
}
|
|
39
|
-
async getIdentifierByAddress(platform, address) {
|
|
40
|
-
return getIdentifierByAddress(this.suiGrpcClient, this.config.zing.IDENTITY_PLATFORMS[platform]
|
|
41
|
-
.IDENTITY_MANAGER_ADDRESS_TO_IDENTIFIER_DF_ID, address);
|
|
42
|
-
}
|
|
43
|
-
async getIdentifierInfoByIdentifier(platform, identifier) {
|
|
44
|
-
return getIdentifierInfoByIdentifier(this.suiGrpcClient, this.config.zing.IDENTITY_PLATFORMS[platform]
|
|
45
|
-
.IDENTITY_MANAGER_IDENTIFIER_INFO_DF_ID, identifier);
|
|
46
|
-
}
|
|
47
|
-
// async getDonationByIdentifier(identifier: string) {
|
|
48
|
-
// const donations = await getDonationByIdentifier(
|
|
49
|
-
// this.suiGrpcClient,
|
|
50
|
-
// this.config.zing.DONATIONS_TABLE_DF_ID,
|
|
51
|
-
// identifier,
|
|
52
|
-
// );
|
|
53
|
-
//
|
|
54
|
-
// return Object.keys(this.config.coins).reduce(
|
|
55
|
-
// (acc, coinSymbol) => {
|
|
56
|
-
// const symbol = coinSymbol as CoinSymbol;
|
|
57
|
-
// const donation = donations?.contents.find(
|
|
58
|
-
// (c) => c.key.name === this.config.coins[symbol],
|
|
59
|
-
// );
|
|
60
|
-
// if (donation) acc[symbol] = donation.value;
|
|
61
|
-
// return acc;
|
|
62
|
-
// },
|
|
63
|
-
// {} as Record<CoinSymbol, string>,
|
|
64
|
-
// );
|
|
65
|
-
// }
|
|
66
39
|
async getStudio(owner) {
|
|
67
40
|
return getStudio(this.suiGrpcClient, this.getDerivedStudioID(owner));
|
|
68
41
|
}
|
package/dist/config/common.d.ts
CHANGED
|
@@ -15,9 +15,3 @@ export type ProviderInfo = {
|
|
|
15
15
|
name: string;
|
|
16
16
|
icon: string;
|
|
17
17
|
};
|
|
18
|
-
export declare const PLATFORM_PROVIDER_INFO: Record<PlatformType, ProviderInfo>;
|
|
19
|
-
export declare const PLATFORMS_HOSTNAME: Record<PlatformType, string>;
|
|
20
|
-
export declare const MEMBERSHIP_LEVELS: Record<number, {
|
|
21
|
-
nameKey: string;
|
|
22
|
-
featureKeys: string[];
|
|
23
|
-
}>;
|
package/dist/config/common.js
CHANGED
|
@@ -15,54 +15,3 @@ export const WALRUS_UPLOAD_FLOW_STAGES = [
|
|
|
15
15
|
export const COIN_DECIMALS = {
|
|
16
16
|
USDC: 6,
|
|
17
17
|
};
|
|
18
|
-
export const PLATFORM_PROVIDER_INFO = {
|
|
19
|
-
twitter: {
|
|
20
|
-
name: "Twitter",
|
|
21
|
-
icon: "/icons/twitter.svg",
|
|
22
|
-
providerHash: "0x168c2d4c2c7fd8c0eb21d4cd9aa634a716b61186b1f61e7ab78cd0dbff34fb04",
|
|
23
|
-
},
|
|
24
|
-
// instagram: {
|
|
25
|
-
// name: 'Instagram',
|
|
26
|
-
// icon: 'popup/icons/instagram.svg',
|
|
27
|
-
// providerHash: '',
|
|
28
|
-
// },
|
|
29
|
-
// medium: {
|
|
30
|
-
// name: 'Medium',
|
|
31
|
-
// icon: 'popup/icons/medium.svg',
|
|
32
|
-
// providerHash: '',
|
|
33
|
-
// },
|
|
34
|
-
// substack: {
|
|
35
|
-
// name: 'Substack',
|
|
36
|
-
// icon: 'popup/icons/substack.svg',
|
|
37
|
-
// providerHash: '',
|
|
38
|
-
// },
|
|
39
|
-
};
|
|
40
|
-
export const PLATFORMS_HOSTNAME = {
|
|
41
|
-
twitter: "https://x.com",
|
|
42
|
-
// medium: 'https://medium.com',
|
|
43
|
-
// substack: 'https://substack.com',
|
|
44
|
-
// instagram: 'https://www.instagram.com',
|
|
45
|
-
};
|
|
46
|
-
export const MEMBERSHIP_LEVELS = {
|
|
47
|
-
0: {
|
|
48
|
-
nameKey: "membershipTier.0.name",
|
|
49
|
-
featureKeys: ["membershipTier.0.features.0", "membershipTier.0.features.1"],
|
|
50
|
-
},
|
|
51
|
-
1: {
|
|
52
|
-
nameKey: "membershipTier.1.name",
|
|
53
|
-
featureKeys: [
|
|
54
|
-
"membershipTier.1.features.0",
|
|
55
|
-
"membershipTier.1.features.1",
|
|
56
|
-
"membershipTier.1.features.2",
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
2: {
|
|
60
|
-
nameKey: "membershipTier.2.name",
|
|
61
|
-
featureKeys: [
|
|
62
|
-
"membershipTier.2.features.0",
|
|
63
|
-
"membershipTier.2.features.1",
|
|
64
|
-
"membershipTier.2.features.2",
|
|
65
|
-
"membershipTier.2.features.3",
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
};
|
package/dist/config/mainnet.js
CHANGED
|
@@ -1,53 +1,28 @@
|
|
|
1
1
|
// zing
|
|
2
2
|
export const mainnetZingConfig = {
|
|
3
|
-
ZING_FRAMEWORK_PACKAGE_ADDRESS: "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
ZING_STUDIO_V0_PACKAGE_ADDRESS: "0xf245105e9896942a02614e4dbbb6c6636452879d58b1e12db1e0364c0d1532a7",
|
|
3
|
+
ZING_FRAMEWORK_PACKAGE_ADDRESS: "0x176ca50788521662366802f5847edd1e41abb2532cc65d4d69b583a47f5444cd",
|
|
4
|
+
ZING_STUDIO_PACKAGE_ADDRESS: "0x6ee54cd57f6f30a70cffeccb16251fc59be211a9706d7c8f0ea8e08c22aaf667",
|
|
5
|
+
ZING_STUDIO_V0_PACKAGE_ADDRESS: "0x6ee54cd57f6f30a70cffeccb16251fc59be211a9706d7c8f0ea8e08c22aaf667",
|
|
7
6
|
ZING_TREASURY_SHARED_OBJECT_REF: {
|
|
8
|
-
objectId: "
|
|
9
|
-
initialSharedVersion:
|
|
7
|
+
objectId: "0x1536fde075b1ad16b4ed52c41518e792af25813ab9eb9f234af926a700a3c4a8",
|
|
8
|
+
initialSharedVersion: 798329790,
|
|
10
9
|
mutable: true,
|
|
11
10
|
},
|
|
12
|
-
ZING_IDENTITY_CONFIG_SHARED_OBJECT_REF: {
|
|
13
|
-
objectId: "0xd511beaa68a5647cdc193b753f3658e8e33bc87ec603857c3d6d315562f0e470",
|
|
14
|
-
initialSharedVersion: 661729843,
|
|
15
|
-
mutable: true,
|
|
16
|
-
},
|
|
17
|
-
PROOF_COMMITMENT_TYPE: "0xd666d3234eb46551273014f5616ed2575e709a861dd3812613d59104a4cb7344::reclaim::ProofCommitment",
|
|
18
|
-
IDENTITY_PLATFORMS: {
|
|
19
|
-
twitter: {
|
|
20
|
-
PLATFORM_UPDATE_PROOF_TARGET: "0x910fd7e88647ea9369ab269fa5629f0efd815dfa5a7b7ef2355ffee13852413b::twitter::update_with_twitter_proof",
|
|
21
|
-
PLATFORM_TYPE: "0x910fd7e88647ea9369ab269fa5629f0efd815dfa5a7b7ef2355ffee13852413b::twitter::Twitter",
|
|
22
|
-
RECLAIM_MANAGER_SHARED_OBJECT_REF: {
|
|
23
|
-
objectId: "0xe8849f48412d3b7220902fd56b7f128f324ffb27615bf57e83c638f523aa10e6",
|
|
24
|
-
initialSharedVersion: 662715429,
|
|
25
|
-
mutable: true,
|
|
26
|
-
},
|
|
27
|
-
IDENTITY_MANAGER_SHARED_OBJECT_REF: {
|
|
28
|
-
objectId: "0xff54f2a3bfc4daedbbc7ecbb1b0985e8311c95fd847f070825882e7e083af5f1",
|
|
29
|
-
initialSharedVersion: 662715429,
|
|
30
|
-
mutable: true,
|
|
31
|
-
},
|
|
32
|
-
IDENTITY_MANAGER_IDENTIFIER_INFO_DF_ID: "0xcbe996d13835c0fcc9a0a015098546997ae9ff58dd075389bfe764d43bb46c2e",
|
|
33
|
-
IDENTITY_MANAGER_ADDRESS_TO_IDENTIFIER_DF_ID: "0x20ba08956972f73a956b288dde1659f9ad6059256205beb20bc3fa2cc0377ac2",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
11
|
ZING_STUDIO_CONFIG_SHARED_OBJECT_REF: {
|
|
37
|
-
objectId: "
|
|
38
|
-
initialSharedVersion:
|
|
12
|
+
objectId: "0x69d470648e17e28489e50e27deb1bb78141dfd68ac68b433632d2499efa72477",
|
|
13
|
+
initialSharedVersion: 798329791,
|
|
39
14
|
mutable: true,
|
|
40
15
|
},
|
|
41
16
|
ZING_STORAGE_TREASURY_SHARED_OBJECT_REF: {
|
|
42
|
-
objectId: "
|
|
43
|
-
initialSharedVersion:
|
|
17
|
+
objectId: "0xb0b272378f226b61b22f4f9fd7c496d9acc9ddc14b70339e100b2811143fdcfe",
|
|
18
|
+
initialSharedVersion: 798329791,
|
|
44
19
|
mutable: true,
|
|
45
20
|
},
|
|
46
21
|
ZING_WORKS_TYPE: {
|
|
47
|
-
article: "
|
|
22
|
+
article: "0x6ee54cd57f6f30a70cffeccb16251fc59be211a9706d7c8f0ea8e08c22aaf667::article::Article",
|
|
48
23
|
},
|
|
49
24
|
EVENT_TYPES: {
|
|
50
|
-
publishArticleEvent: "
|
|
25
|
+
publishArticleEvent: "0x6ee54cd57f6f30a70cffeccb16251fc59be211a9706d7c8f0ea8e08c22aaf667::article::PublishArticle",
|
|
51
26
|
},
|
|
52
27
|
};
|
|
53
28
|
// walrus
|
|
@@ -60,14 +35,13 @@ export const mainnetWalrusConfig = {
|
|
|
60
35
|
mutable: true, // mutable when register_blob
|
|
61
36
|
},
|
|
62
37
|
WALRUS_AGGREGATORS: ["https://aggregator.suicore.com"],
|
|
63
|
-
WALRUS_UPLOAD_RELAY_BASE_URL: "https://walrus-upload-relay-production-73a4.up.railway.app",
|
|
64
38
|
EVENT_TYPES: {
|
|
65
39
|
blobRegistered: "0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::events::BlobRegistered",
|
|
66
40
|
},
|
|
67
41
|
};
|
|
68
42
|
// coins
|
|
69
43
|
export const mainnetCoinConfig = {
|
|
70
|
-
USDC: "
|
|
44
|
+
USDC: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
71
45
|
};
|
|
72
46
|
// seal
|
|
73
47
|
export const mainnetSealConfig = {
|