@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,87 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// Uint8Array
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
1
|
+
export {};
|
|
2
|
+
// import {
|
|
3
|
+
// ClaimInfo,
|
|
4
|
+
// SignedClaim,
|
|
5
|
+
// } from "../../_generated/zing_identity/reclaim.js";
|
|
6
|
+
// import { bcs } from "@mysten/sui/bcs";
|
|
7
|
+
// import { ReclaimProofRequest } from "@reclaimprotocol/js-sdk";
|
|
8
|
+
// import sha3 from "js-sha3";
|
|
9
|
+
//
|
|
10
|
+
// export function hexToBytes(hex: string): Uint8Array {
|
|
11
|
+
// return new Uint8Array(
|
|
12
|
+
// hex.match(/.{1,2}/g)!.map((byte) => parseInt(byte, 16)),
|
|
13
|
+
// );
|
|
14
|
+
// }
|
|
15
|
+
//
|
|
16
|
+
// export function bytesToHex(bytes: Uint8Array): string {
|
|
17
|
+
// return Array.from(bytes)
|
|
18
|
+
// .map((byte) => byte.toString(16).padStart(2, "0"))
|
|
19
|
+
// .join("");
|
|
20
|
+
// }
|
|
21
|
+
//
|
|
22
|
+
// export function textToBytes(text: string): Uint8Array {
|
|
23
|
+
// return new TextEncoder().encode(text);
|
|
24
|
+
// }
|
|
25
|
+
//
|
|
26
|
+
// // Uint8Array ? String
|
|
27
|
+
// export function bytesToText(bytes: Uint8Array): string {
|
|
28
|
+
// return new TextDecoder().decode(bytes);
|
|
29
|
+
// }
|
|
30
|
+
//
|
|
31
|
+
// export async function startVerification({
|
|
32
|
+
// reclaimAppId,
|
|
33
|
+
// reclaimAppSecret,
|
|
34
|
+
// reclaimProviderId,
|
|
35
|
+
// }: {
|
|
36
|
+
// reclaimAppId: string;
|
|
37
|
+
// reclaimAppSecret: string;
|
|
38
|
+
// reclaimProviderId: string;
|
|
39
|
+
// }) {
|
|
40
|
+
// try {
|
|
41
|
+
// // Initialize the Reclaim SDK with your credentials
|
|
42
|
+
// const reclaimProofRequest = await ReclaimProofRequest.init(
|
|
43
|
+
// reclaimAppId,
|
|
44
|
+
// reclaimAppSecret,
|
|
45
|
+
// reclaimProviderId,
|
|
46
|
+
// );
|
|
47
|
+
//
|
|
48
|
+
// reclaimProofRequest.setModalOptions({ modalPopupTimer: 3 }); // 3min
|
|
49
|
+
//
|
|
50
|
+
// // Trigger the verification session
|
|
51
|
+
// await reclaimProofRequest.triggerReclaimFlow();
|
|
52
|
+
//
|
|
53
|
+
// // Start listening for proof submissions and return a promise
|
|
54
|
+
// const proofs = await new Promise((resolve, reject) => {
|
|
55
|
+
// reclaimProofRequest.startSession({
|
|
56
|
+
// onSuccess: (proofs) => {
|
|
57
|
+
// resolve(proofs);
|
|
58
|
+
// },
|
|
59
|
+
// onError: (error) => {
|
|
60
|
+
// console.error("Verification failed", error);
|
|
61
|
+
// reject(error);
|
|
62
|
+
// },
|
|
63
|
+
// });
|
|
64
|
+
// });
|
|
65
|
+
//
|
|
66
|
+
// return proofs;
|
|
67
|
+
// } catch (error) {
|
|
68
|
+
// console.error("Error starting verification:", error);
|
|
69
|
+
// throw error;
|
|
70
|
+
// }
|
|
71
|
+
// }
|
|
72
|
+
//
|
|
73
|
+
// export function generateCommitNonce(
|
|
74
|
+
// userAddress: string,
|
|
75
|
+
// claimIdentifier: string,
|
|
76
|
+
// ) {
|
|
77
|
+
// // Use the same random data as in Move function
|
|
78
|
+
// const randomBytes = crypto.getRandomValues(new Uint8Array(32));
|
|
79
|
+
// // Encode user address as BCS (32 bytes for address type)
|
|
80
|
+
// const addressBytes = bcs.Address.serialize(userAddress).toBytes();
|
|
81
|
+
//
|
|
82
|
+
// // Encode claim identifier as BCS address (32 bytes for address type)
|
|
83
|
+
// const identifierBytes = bcs.Address.serialize(claimIdentifier).toBytes();
|
|
84
|
+
//
|
|
85
|
+
// // Combine: random + userAddress + identifier (no timestamp to match Move logic)
|
|
86
|
+
// const combined = new Uint8Array(
|
|
87
|
+
// randomBytes.length + addressBytes.length + identifierBytes.length,
|
|
88
|
+
// );
|
|
89
|
+
//
|
|
90
|
+
// let offset = 0;
|
|
91
|
+
// combined.set(randomBytes, offset);
|
|
92
|
+
// offset += randomBytes.length;
|
|
93
|
+
// combined.set(addressBytes, offset);
|
|
94
|
+
// offset += addressBytes.length;
|
|
95
|
+
// combined.set(identifierBytes, offset);
|
|
96
|
+
//
|
|
97
|
+
// return Array.from(combined);
|
|
98
|
+
// }
|
|
99
|
+
//
|
|
100
|
+
// export function generateCommitmentHash(proof: ReclaimProof, nonce: number[]) {
|
|
101
|
+
// const claimInfoBytes = ClaimInfo.serialize({
|
|
102
|
+
// provider: proof.claimData.provider,
|
|
103
|
+
// parameters: proof.claimData.parameters,
|
|
104
|
+
// context: proof.claimData.context,
|
|
105
|
+
// }).toBytes(); // checked
|
|
106
|
+
// const signedClaimBytes = SignedClaim.serialize({
|
|
107
|
+
// claim: {
|
|
108
|
+
// identifier: proof.claimData.identifier,
|
|
109
|
+
// owner: proof.claimData.owner,
|
|
110
|
+
// epoch: proof.claimData.epoch.toString(),
|
|
111
|
+
// timestamp_s: proof.claimData.timestampS.toString(),
|
|
112
|
+
// },
|
|
113
|
+
// signatures: proof.signatures.map((sig) => hexToBytes(sig.substring(2))),
|
|
114
|
+
// }).toBytes();
|
|
115
|
+
//
|
|
116
|
+
// const combined = new Uint8Array(
|
|
117
|
+
// claimInfoBytes.length + signedClaimBytes.length + nonce.length,
|
|
118
|
+
// );
|
|
119
|
+
//
|
|
120
|
+
// let offset = 0;
|
|
121
|
+
// combined.set(claimInfoBytes, offset);
|
|
122
|
+
// offset += claimInfoBytes.length;
|
|
123
|
+
// combined.set(signedClaimBytes, offset);
|
|
124
|
+
// offset += signedClaimBytes.length;
|
|
125
|
+
// combined.set(nonce, offset);
|
|
126
|
+
//
|
|
127
|
+
// // Convert Uint8Array -> Buffer before hashing
|
|
128
|
+
// return hexToBytes(sha3.keccak256(combined));
|
|
129
|
+
// }
|
|
130
|
+
//
|
|
131
|
+
// export type ReclaimProof = {
|
|
132
|
+
// identifier: string;
|
|
133
|
+
// claimData: {
|
|
134
|
+
// provider: string;
|
|
135
|
+
// parameters: string;
|
|
136
|
+
// owner: string;
|
|
137
|
+
// timestampS: number;
|
|
138
|
+
// context: string;
|
|
139
|
+
// identifier: string;
|
|
140
|
+
// epoch: number;
|
|
141
|
+
// };
|
|
142
|
+
// signatures: string[];
|
|
143
|
+
// witnesses: {
|
|
144
|
+
// id: string;
|
|
145
|
+
// url: string;
|
|
146
|
+
// }[];
|
|
147
|
+
// publicData: string | null;
|
|
148
|
+
// };
|
package/dist/mutations/signer.js
CHANGED
|
@@ -37,7 +37,7 @@ export async function getSigner(suiClient) {
|
|
|
37
37
|
maxEpoch: zkLoginStorage.maxEpoch,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
export async function signAndExecuteGasPoolTransaction(saltServerUrl, signer, suiClient, tx, gasBudget = 0.
|
|
40
|
+
export async function signAndExecuteGasPoolTransaction(saltServerUrl, signer, suiClient, tx, gasBudget = 0.5 * 10 ** 9, reserveDurationSecs = 30) {
|
|
41
41
|
const { ephemeralKeyPair, suiAddress, decodedJwt, zkProof, maxEpoch, jwtTokenString, } = signer;
|
|
42
42
|
if (!ephemeralKeyPair || !suiAddress || !decodedJwt || !zkProof || !maxEpoch)
|
|
43
43
|
return;
|
package/dist/mutations/walrus.js
CHANGED
|
@@ -122,7 +122,7 @@ export function buildCertifyArticleBlobTransaction(config, walrusClient, owner,
|
|
|
122
122
|
config: tx.sharedObjectRef(zingStudioConfigSharedObjectRef),
|
|
123
123
|
studio: tx.object(getDerivedStudioID(zingStudioConfigSharedObjectRef.objectId, owner)),
|
|
124
124
|
walrusSystem: tx.sharedObjectRef(walrusSystemSharedObjectRef),
|
|
125
|
-
articleId: tx.
|
|
125
|
+
articleId: tx.pure.id(articleId),
|
|
126
126
|
blobIndex: tx.pure.u64(0), // TODO
|
|
127
127
|
signature: tx.pure.vector("u8", combinedSignature.signature),
|
|
128
128
|
signersBitmap: tx.pure.vector("u8", signersToBitmap(combinedSignature.signers, systemState.committee.members.length)),
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Sui object identifiers */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
export declare const UID: MoveStruct<{
|
|
7
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
|
-
}, "0x2::object::UID">;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Sui object identifiers */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
7
|
-
const $moduleName = "0x2::object";
|
|
8
|
-
export const UID = new MoveStruct({
|
|
9
|
-
name: `${$moduleName}::UID`,
|
|
10
|
-
fields: {
|
|
11
|
-
id: bcs.Address,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Sui object identifiers */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
export declare const UID: MoveStruct<{
|
|
7
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
|
-
}, "0x2::object::UID">;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Sui object identifiers */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
7
|
-
const $moduleName = "0x2::object";
|
|
8
|
-
export const UID = new MoveStruct({
|
|
9
|
-
name: `${$moduleName}::UID`,
|
|
10
|
-
fields: {
|
|
11
|
-
id: bcs.Address,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { MoveStruct } from "../utils/index.js";
|
|
2
|
-
import type { RawTransactionArgument } from "../utils/index.js";
|
|
3
|
-
import type { Transaction } from "@mysten/sui/transactions";
|
|
4
|
-
export declare const Config: MoveStruct<{
|
|
5
|
-
id: MoveStruct<{
|
|
6
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
7
|
-
}, "0x2::object::UID">;
|
|
8
|
-
registry: MoveStruct<{
|
|
9
|
-
contents: import("@mysten/sui/bcs").BcsType<{
|
|
10
|
-
name: string;
|
|
11
|
-
}[], Iterable<{
|
|
12
|
-
name: string;
|
|
13
|
-
}> & {
|
|
14
|
-
length: number;
|
|
15
|
-
}, "vector<std::type_name::TypeName>">;
|
|
16
|
-
}, string>;
|
|
17
|
-
versions: MoveStruct<{
|
|
18
|
-
contents: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
19
|
-
length: number;
|
|
20
|
-
}, "vector<u64>">;
|
|
21
|
-
}, string>;
|
|
22
|
-
base_read_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
23
|
-
}, "@local-pkg/zing_identity::config::Config">;
|
|
24
|
-
export interface PackageVersionOptions {
|
|
25
|
-
package?: string;
|
|
26
|
-
arguments?: [];
|
|
27
|
-
}
|
|
28
|
-
export declare function packageVersion(options?: PackageVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
29
|
-
export interface BaseReadFeeArguments {
|
|
30
|
-
self: RawTransactionArgument<string>;
|
|
31
|
-
}
|
|
32
|
-
export interface BaseReadFeeOptions {
|
|
33
|
-
package?: string;
|
|
34
|
-
arguments: BaseReadFeeArguments | [self: RawTransactionArgument<string>];
|
|
35
|
-
}
|
|
36
|
-
export declare function baseReadFee(options: BaseReadFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
37
|
-
export interface AddVersionArguments {
|
|
38
|
-
self: RawTransactionArgument<string>;
|
|
39
|
-
Cap: RawTransactionArgument<string>;
|
|
40
|
-
version: RawTransactionArgument<number | bigint>;
|
|
41
|
-
}
|
|
42
|
-
export interface AddVersionOptions {
|
|
43
|
-
package?: string;
|
|
44
|
-
arguments: AddVersionArguments | [
|
|
45
|
-
self: RawTransactionArgument<string>,
|
|
46
|
-
Cap: RawTransactionArgument<string>,
|
|
47
|
-
version: RawTransactionArgument<number | bigint>
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
export declare function addVersion(options: AddVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
51
|
-
export interface RemoveVersionArguments {
|
|
52
|
-
self: RawTransactionArgument<string>;
|
|
53
|
-
Cap: RawTransactionArgument<string>;
|
|
54
|
-
version: RawTransactionArgument<number | bigint>;
|
|
55
|
-
}
|
|
56
|
-
export interface RemoveVersionOptions {
|
|
57
|
-
package?: string;
|
|
58
|
-
arguments: RemoveVersionArguments | [
|
|
59
|
-
self: RawTransactionArgument<string>,
|
|
60
|
-
Cap: RawTransactionArgument<string>,
|
|
61
|
-
version: RawTransactionArgument<number | bigint>
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
export declare function removeVersion(options: RemoveVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
65
|
-
export interface UpdateReadFeeArguments {
|
|
66
|
-
self: RawTransactionArgument<string>;
|
|
67
|
-
Cap: RawTransactionArgument<string>;
|
|
68
|
-
fee: RawTransactionArgument<number | bigint>;
|
|
69
|
-
}
|
|
70
|
-
export interface UpdateReadFeeOptions {
|
|
71
|
-
package?: string;
|
|
72
|
-
arguments: UpdateReadFeeArguments | [
|
|
73
|
-
self: RawTransactionArgument<string>,
|
|
74
|
-
Cap: RawTransactionArgument<string>,
|
|
75
|
-
fee: RawTransactionArgument<number | bigint>
|
|
76
|
-
];
|
|
77
|
-
}
|
|
78
|
-
export declare function updateReadFee(options: UpdateReadFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
79
|
-
export interface DerivedObjectKeyArguments {
|
|
80
|
-
name: RawTransactionArgument<string>;
|
|
81
|
-
}
|
|
82
|
-
export interface DerivedObjectKeyOptions {
|
|
83
|
-
package?: string;
|
|
84
|
-
arguments: DerivedObjectKeyArguments | [name: RawTransactionArgument<string>];
|
|
85
|
-
typeArguments: [string];
|
|
86
|
-
}
|
|
87
|
-
export declare function derivedObjectKey(options: DerivedObjectKeyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import * as type_name from "./deps/std/type_name.js";
|
|
5
|
-
import * as object from "./deps/sui/object.js";
|
|
6
|
-
import * as vec_set from "./deps/sui/vec_set.js";
|
|
7
|
-
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
8
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
9
|
-
const $moduleName = "@local-pkg/zing_identity::config";
|
|
10
|
-
export const Config = new MoveStruct({
|
|
11
|
-
name: `${$moduleName}::Config`,
|
|
12
|
-
fields: {
|
|
13
|
-
id: object.UID,
|
|
14
|
-
registry: vec_set.VecSet(type_name.TypeName),
|
|
15
|
-
versions: vec_set.VecSet(bcs.u64()),
|
|
16
|
-
base_read_fee: bcs.u64(),
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
export function packageVersion(options = {}) {
|
|
20
|
-
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
21
|
-
return (tx) => tx.moveCall({
|
|
22
|
-
package: packageAddress,
|
|
23
|
-
module: "config",
|
|
24
|
-
function: "package_version",
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
export function baseReadFee(options) {
|
|
28
|
-
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
29
|
-
const argumentsTypes = [
|
|
30
|
-
`${packageAddress}::config::Config`,
|
|
31
|
-
];
|
|
32
|
-
const parameterNames = ["self"];
|
|
33
|
-
return (tx) => tx.moveCall({
|
|
34
|
-
package: packageAddress,
|
|
35
|
-
module: "config",
|
|
36
|
-
function: "base_read_fee",
|
|
37
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
export function addVersion(options) {
|
|
41
|
-
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
42
|
-
const argumentsTypes = [
|
|
43
|
-
`${packageAddress}::config::Config`,
|
|
44
|
-
`${packageAddress}::admin::AdminCap`,
|
|
45
|
-
"u64",
|
|
46
|
-
];
|
|
47
|
-
const parameterNames = ["self", "Cap", "version"];
|
|
48
|
-
return (tx) => tx.moveCall({
|
|
49
|
-
package: packageAddress,
|
|
50
|
-
module: "config",
|
|
51
|
-
function: "add_version",
|
|
52
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
export function removeVersion(options) {
|
|
56
|
-
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
57
|
-
const argumentsTypes = [
|
|
58
|
-
`${packageAddress}::config::Config`,
|
|
59
|
-
`${packageAddress}::admin::AdminCap`,
|
|
60
|
-
"u64",
|
|
61
|
-
];
|
|
62
|
-
const parameterNames = ["self", "Cap", "version"];
|
|
63
|
-
return (tx) => tx.moveCall({
|
|
64
|
-
package: packageAddress,
|
|
65
|
-
module: "config",
|
|
66
|
-
function: "remove_version",
|
|
67
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
export function updateReadFee(options) {
|
|
71
|
-
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
72
|
-
const argumentsTypes = [
|
|
73
|
-
`${packageAddress}::config::Config`,
|
|
74
|
-
`${packageAddress}::admin::AdminCap`,
|
|
75
|
-
"u64",
|
|
76
|
-
];
|
|
77
|
-
const parameterNames = ["self", "Cap", "fee"];
|
|
78
|
-
return (tx) => tx.moveCall({
|
|
79
|
-
package: packageAddress,
|
|
80
|
-
module: "config",
|
|
81
|
-
function: "update_read_fee",
|
|
82
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
export function derivedObjectKey(options) {
|
|
86
|
-
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
87
|
-
const argumentsTypes = [
|
|
88
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
|
|
89
|
-
];
|
|
90
|
-
const parameterNames = ["name"];
|
|
91
|
-
return (tx) => tx.moveCall({
|
|
92
|
-
package: packageAddress,
|
|
93
|
-
module: "config",
|
|
94
|
-
function: "derived_object_key",
|
|
95
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
96
|
-
typeArguments: options.typeArguments,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Functionality for converting Move types into values. Use with care! */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
export declare const TypeName: MoveStruct<{
|
|
7
|
-
/**
|
|
8
|
-
* String representation of the type. All types are represented using their source
|
|
9
|
-
* syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
|
|
10
|
-
* Struct types are represented as fully qualified type names; e.g.
|
|
11
|
-
* `00000000000000000000000000000001::string::String` or
|
|
12
|
-
* `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
|
|
13
|
-
* Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
|
|
14
|
-
* 32 depending on the Move platform)
|
|
15
|
-
*/
|
|
16
|
-
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
17
|
-
}, "std::type_name::TypeName">;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Functionality for converting Move types into values. Use with care! */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
7
|
-
const $moduleName = "std::type_name";
|
|
8
|
-
export const TypeName = new MoveStruct({
|
|
9
|
-
name: `${$moduleName}::TypeName`,
|
|
10
|
-
fields: {
|
|
11
|
-
/**
|
|
12
|
-
* String representation of the type. All types are represented using their source
|
|
13
|
-
* syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
|
|
14
|
-
* Struct types are represented as fully qualified type names; e.g.
|
|
15
|
-
* `00000000000000000000000000000001::string::String` or
|
|
16
|
-
* `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
|
|
17
|
-
* Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
|
|
18
|
-
* 32 depending on the Move platform)
|
|
19
|
-
*/
|
|
20
|
-
name: bcs.string(),
|
|
21
|
-
},
|
|
22
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Sui object identifiers */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
export declare const UID: MoveStruct<{
|
|
7
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
|
-
}, "0x2::object::UID">;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Sui object identifiers */
|
|
5
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
7
|
-
const $moduleName = "0x2::object";
|
|
8
|
-
export const UID = new MoveStruct({
|
|
9
|
-
name: `${$moduleName}::UID`,
|
|
10
|
-
fields: {
|
|
11
|
-
id: bcs.Address,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
5
|
-
export declare const ObjectTable: MoveStruct<{
|
|
6
|
-
/** the ID of this table */
|
|
7
|
-
id: MoveStruct<{
|
|
8
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
9
|
-
}, "0x2::object::UID">;
|
|
10
|
-
/** the number of key-value pairs in the table */
|
|
11
|
-
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
12
|
-
}, "0x2::object_table::ObjectTable">;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/**
|
|
5
|
-
* Similar to `sui::table`, an `ObjectTable<K, V>` is a map-like collection. But
|
|
6
|
-
* unlike `sui::table`, the values bound to these dynamic fields _must_ be objects
|
|
7
|
-
* themselves. This allows for the objects to still exist within in storage, which
|
|
8
|
-
* may be important for external tools. The difference is otherwise not observable
|
|
9
|
-
* from within Move.
|
|
10
|
-
*/
|
|
11
|
-
import * as object from "./object.js";
|
|
12
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
13
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
14
|
-
const $moduleName = "0x2::object_table";
|
|
15
|
-
export const ObjectTable = new MoveStruct({
|
|
16
|
-
name: `${$moduleName}::ObjectTable`,
|
|
17
|
-
fields: {
|
|
18
|
-
/** the ID of this table */
|
|
19
|
-
id: object.UID,
|
|
20
|
-
/** the number of key-value pairs in the table */
|
|
21
|
-
size: bcs.u64(),
|
|
22
|
-
},
|
|
23
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveStruct } from "../../../utils/index.js";
|
|
5
|
-
export declare const Table: MoveStruct<{
|
|
6
|
-
/** the ID of this table */
|
|
7
|
-
id: MoveStruct<{
|
|
8
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
9
|
-
}, "0x2::object::UID">;
|
|
10
|
-
/** the number of key-value pairs in the table */
|
|
11
|
-
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
12
|
-
}, "0x2::table::Table">;
|