@zing-protocol/zing-sdk 0.0.1 → 0.0.3
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.js +6 -0
- package/dist/_generated/utils/index.d.ts +12 -0
- package/dist/_generated/utils/index.js +135 -0
- package/dist/_generated/zing_framework/coin_utils.d.ts +15 -0
- package/dist/_generated/zing_framework/coin_utils.js +19 -0
- package/dist/_generated/zing_framework/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_governance/deps/sui/object.ts → dist/_generated/zing_framework/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_framework/derived_object_bag.d.ts +166 -0
- package/dist/_generated/zing_framework/derived_object_bag.js +221 -0
- package/dist/_generated/zing_framework/derived_table.d.ts +153 -0
- package/dist/_generated/zing_framework/derived_table.js +200 -0
- package/dist/_generated/zing_governance/admin.d.ts +20 -0
- package/dist/_generated/zing_governance/admin.js +26 -0
- package/dist/_generated/zing_governance/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_identity/deps/sui/object.ts → dist/_generated/zing_governance/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_governance/treasury.d.ts +56 -0
- package/dist/_generated/zing_governance/treasury.js +78 -0
- package/dist/_generated/zing_identity/config.d.ts +87 -0
- package/dist/_generated/zing_identity/config.js +98 -0
- package/{src/_generated/zing_studio/deps/std/type_name.ts → dist/_generated/zing_identity/deps/std/type_name.d.ts} +3 -11
- package/dist/_generated/zing_identity/deps/std/type_name.js +22 -0
- package/dist/_generated/zing_identity/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_studio/deps/sui/object.ts → dist/_generated/zing_identity/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_identity/deps/sui/object_table.d.ts +12 -0
- package/{src/_generated/zing_identity/deps/sui/object_table.ts → dist/_generated/zing_identity/deps/sui/object_table.js} +7 -10
- package/dist/_generated/zing_identity/deps/sui/table.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/table.ts → dist/_generated/zing_identity/deps/sui/table.js} +7 -10
- package/{src/_generated/zing_identity/deps/sui/vec_set.ts → dist/_generated/zing_identity/deps/sui/vec_set.d.ts} +3 -14
- package/dist/_generated/zing_identity/deps/sui/vec_set.js +22 -0
- package/dist/_generated/zing_identity/ecdsa.d.ts +81 -0
- package/dist/_generated/zing_identity/ecdsa.js +87 -0
- package/dist/_generated/zing_identity/identity.d.ts +262 -0
- package/dist/_generated/zing_identity/identity.js +294 -0
- package/dist/_generated/zing_identity/reclaim.d.ts +356 -0
- package/dist/_generated/zing_identity/reclaim.js +414 -0
- package/dist/_generated/zing_studio/app.d.ts +351 -0
- package/dist/_generated/zing_studio/app.js +451 -0
- package/dist/_generated/zing_studio/article.d.ts +331 -0
- package/dist/_generated/zing_studio/article.js +331 -0
- package/dist/_generated/zing_studio/config.d.ts +203 -0
- package/dist/_generated/zing_studio/config.js +233 -0
- package/{src/_generated/zing_identity/deps/std/type_name.ts → dist/_generated/zing_studio/deps/std/type_name.d.ts} +3 -11
- package/dist/_generated/zing_studio/deps/std/type_name.js +22 -0
- package/dist/_generated/zing_studio/deps/sui/bag.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/bag.ts → dist/_generated/zing_studio/deps/sui/bag.js} +7 -10
- package/dist/_generated/zing_studio/deps/sui/balance.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/balance.ts → dist/_generated/zing_studio/deps/sui/balance.js} +4 -7
- package/dist/_generated/zing_studio/deps/sui/coin.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/coin.ts → dist/_generated/zing_studio/deps/sui/coin.js} +5 -8
- package/dist/_generated/zing_studio/deps/sui/dynamic_field.d.ts +126 -0
- package/dist/_generated/zing_studio/deps/sui/dynamic_field.js +140 -0
- package/dist/_generated/zing_studio/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_framework/deps/sui/object.ts → dist/_generated/zing_studio/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_studio/deps/sui/table.d.ts +12 -0
- package/{src/_generated/zing_identity/deps/sui/table.ts → dist/_generated/zing_studio/deps/sui/table.js} +7 -10
- package/dist/_generated/zing_studio/deps/sui/vec_map.d.ts +30 -0
- package/{src/_generated/zing_studio/deps/sui/vec_map.ts → dist/_generated/zing_studio/deps/sui/vec_map.js} +15 -21
- package/{src/_generated/zing_studio/deps/sui/vec_set.ts → dist/_generated/zing_studio/deps/sui/vec_set.d.ts} +3 -14
- package/dist/_generated/zing_studio/deps/sui/vec_set.js +22 -0
- package/dist/_generated/zing_studio/deps/walrus/blob.d.ts +20 -0
- package/{src/_generated/zing_studio/deps/walrus/blob.ts → dist/_generated/zing_studio/deps/walrus/blob.js} +11 -12
- package/dist/_generated/zing_studio/deps/walrus/events.d.ts +83 -0
- package/dist/_generated/zing_studio/deps/walrus/events.js +122 -0
- package/dist/_generated/zing_studio/deps/walrus/metadata.d.ts +71 -0
- package/dist/_generated/zing_studio/deps/walrus/metadata.js +73 -0
- package/dist/_generated/zing_studio/deps/walrus/storage_resource.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/walrus/storage_resource.ts → dist/_generated/zing_studio/deps/walrus/storage_resource.js} +7 -8
- package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/zing_framework/derived_object_bag.ts → dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.js} +7 -8
- package/dist/_generated/zing_studio/deps/zing_framework/derived_table.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/zing_framework/derived_table.ts → dist/_generated/zing_studio/deps/zing_framework/derived_table.js} +7 -8
- package/dist/_generated/zing_studio/donation.d.ts +24 -0
- package/{src/_generated/zing_studio/donation.ts → dist/_generated/zing_studio/donation.js} +7 -8
- package/dist/_generated/zing_studio/enclave.d.ts +187 -0
- package/dist/_generated/zing_studio/enclave.js +231 -0
- package/dist/_generated/zing_studio/nitro_attestation.d.ts +148 -0
- package/dist/_generated/zing_studio/nitro_attestation.js +183 -0
- package/dist/_generated/zing_studio/referral.d.ts +166 -0
- package/dist/_generated/zing_studio/referral.js +224 -0
- package/dist/_generated/zing_studio/storage.d.ts +327 -0
- package/dist/_generated/zing_studio/storage.js +365 -0
- package/dist/_generated/zing_studio/studio.d.ts +282 -0
- package/dist/_generated/zing_studio/studio.js +360 -0
- package/dist/bcs.d.ts +61 -0
- package/dist/bcs.js +109 -0
- package/dist/client/index.d.ts +228 -0
- package/dist/client/index.js +296 -0
- package/dist/client/types.d.ts +23 -0
- package/dist/client/types.js +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/wallet-provider.d.ts +7 -0
- package/dist/components/wallet-provider.js +33 -0
- package/dist/components/walrus-provider.d.ts +31 -0
- package/dist/components/walrus-provider.js +71 -0
- package/dist/components/zing-provider.d.ts +15 -0
- package/dist/components/zing-provider.js +22 -0
- package/dist/config/common.d.ts +23 -0
- package/dist/config/common.js +61 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.js +28 -0
- package/dist/config/mainnet.d.ts +6 -0
- package/dist/config/mainnet.js +80 -0
- package/dist/config/testnet.d.ts +6 -0
- package/dist/config/testnet.js +81 -0
- package/dist/config/types.d.ts +49 -0
- package/dist/config/types.js +1 -0
- package/dist/const.d.ts +4 -0
- package/dist/const.js +25 -0
- package/dist/getters.d.ts +228 -0
- package/dist/getters.js +317 -0
- package/{src/hooks/index.ts → dist/hooks/index.d.ts} +2 -3
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/useGetStudio.d.ts +26 -0
- package/dist/hooks/useGetStudio.js +17 -0
- package/dist/hooks/useGetTierPlan.d.ts +7 -0
- package/dist/hooks/useGetTierPlan.js +85 -0
- package/dist/hooks/useReclaim.d.ts +12 -0
- package/dist/hooks/useReclaim.js +87 -0
- package/dist/hooks/useSignAndExecuteTransaction.d.ts +6 -0
- package/dist/hooks/useSignAndExecuteTransaction.js +40 -0
- package/dist/hooks/useSignPersonalMessage.d.ts +8 -0
- package/dist/hooks/useSignPersonalMessage.js +21 -0
- package/dist/hooks/useZingInfiniteQueries.d.ts +75 -0
- package/dist/hooks/useZingInfiniteQueries.js +28 -0
- package/dist/hooks/useZingMutation.d.ts +35 -0
- package/dist/hooks/useZingMutation.js +37 -0
- package/dist/hooks/useZingQueries.d.ts +127 -0
- package/dist/hooks/useZingQueries.js +37 -0
- package/dist/hooks/useZingQuery.d.ts +147 -0
- package/dist/hooks/useZingQuery.js +34 -0
- package/{src/index.ts → dist/index.d.ts} +2 -3
- package/dist/index.js +9 -0
- package/dist/lib/utils/colorful-logger.d.ts +2 -0
- package/dist/lib/utils/colorful-logger.js +23 -0
- package/dist/lib/utils/const.d.ts +25 -0
- package/dist/lib/utils/const.js +25 -0
- package/dist/lib/utils/helpers.d.ts +10 -0
- package/dist/lib/utils/helpers.js +49 -0
- package/dist/lib/utils/index.js +4 -0
- package/dist/lib/utils/init-app-with-shadow.d.ts +6 -0
- package/dist/lib/utils/init-app-with-shadow.js +28 -0
- package/dist/lib/utils/quilt.d.ts +61 -0
- package/dist/lib/utils/quilt.js +194 -0
- package/dist/lib/utils/reclaim.d.ts +29 -0
- package/dist/lib/utils/reclaim.js +88 -0
- package/dist/lib/utils/types.d.ts +5 -0
- package/dist/lib/utils/types.js +1 -0
- package/dist/mutations/index.js +3 -0
- package/dist/mutations/seal.d.ts +12 -0
- package/dist/mutations/seal.js +41 -0
- package/dist/mutations/signer.d.ts +10 -0
- package/dist/mutations/signer.js +176 -0
- package/dist/mutations/walrus.d.ts +98 -0
- package/dist/mutations/walrus.js +488 -0
- package/dist/stores/index.js +3 -0
- package/dist/stores/walletStore.d.ts +48 -0
- package/dist/stores/walletStore.js +232 -0
- package/dist/stores/walrusStore.d.ts +28 -0
- package/dist/stores/walrusStore.js +61 -0
- package/dist/stores/zkloginStore.d.ts +28 -0
- package/dist/stores/zkloginStore.js +27 -0
- package/dist/types.d.ts +99 -0
- package/dist/types.js +1 -0
- package/package.json +18 -10
- package/src/_generated/utils/index.ts +0 -181
- package/src/_generated/zing_framework/coin_utils.ts +0 -41
- package/src/_generated/zing_framework/derived_object_bag.ts +0 -400
- package/src/_generated/zing_framework/derived_table.ts +0 -366
- package/src/_generated/zing_governance/admin.ts +0 -47
- package/src/_generated/zing_governance/treasury.ts +0 -134
- package/src/_generated/zing_identity/config.ts +0 -191
- package/src/_generated/zing_identity/ecdsa.ts +0 -166
- package/src/_generated/zing_identity/identity.ts +0 -661
- package/src/_generated/zing_identity/reclaim.ts +0 -803
- package/src/_generated/zing_studio/app.ts +0 -855
- package/src/_generated/zing_studio/article.ts +0 -598
- package/src/_generated/zing_studio/config.ts +0 -475
- package/src/_generated/zing_studio/deps/sui/dynamic_field.ts +0 -272
- package/src/_generated/zing_studio/deps/walrus/events.ts +0 -124
- package/src/_generated/zing_studio/deps/walrus/metadata.ts +0 -137
- package/src/_generated/zing_studio/enclave.ts +0 -466
- package/src/_generated/zing_studio/nitro_attestation.ts +0 -308
- package/src/_generated/zing_studio/referral.ts +0 -447
- package/src/_generated/zing_studio/storage.ts +0 -664
- package/src/_generated/zing_studio/studio.ts +0 -682
- package/src/bcs.ts +0 -139
- package/src/client/index.ts +0 -557
- package/src/client/types.ts +0 -28
- package/src/components/wallet-provider.tsx +0 -53
- package/src/components/walrus-provider.tsx +0 -212
- package/src/components/zing-provider.tsx +0 -54
- package/src/config/common.ts +0 -82
- package/src/config/index.ts +0 -45
- package/src/config/mainnet.ts +0 -109
- package/src/config/testnet.ts +0 -111
- package/src/config/types.ts +0 -69
- package/src/const.ts +0 -32
- package/src/getters.ts +0 -523
- package/src/hooks/useGetStudio.ts +0 -22
- package/src/hooks/useGetTierPlan.ts +0 -115
- package/src/hooks/useReclaim.ts +0 -165
- package/src/hooks/useSignAndExecuteTransaction.ts +0 -57
- package/src/hooks/useSignPersonalMessage.ts +0 -28
- package/src/hooks/useZingInfiniteQueries.ts +0 -92
- package/src/hooks/useZingMutation.ts +0 -66
- package/src/hooks/useZingQueries.ts +0 -107
- package/src/hooks/useZingQuery.ts +0 -88
- package/src/lib/utils/colorful-logger.ts +0 -27
- package/src/lib/utils/const.ts +0 -25
- package/src/lib/utils/helpers.ts +0 -78
- package/src/lib/utils/init-app-with-shadow.ts +0 -42
- package/src/lib/utils/quilt.ts +0 -317
- package/src/lib/utils/reclaim.ts +0 -148
- package/src/lib/utils/types.ts +0 -14
- package/src/mutations/seal.ts +0 -78
- package/src/mutations/signer.ts +0 -241
- package/src/mutations/walrus.ts +0 -862
- package/src/stores/walletStore.ts +0 -360
- package/src/stores/walrusStore.ts +0 -118
- package/src/stores/zkloginStore.ts +0 -53
- package/src/types.ts +0 -120
- package/tsconfig.json +0 -12
- /package/{src/_generated/index.js → dist/_generated/index.d.ts} +0 -0
- /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
- /package/{src/lib/utils/index.ts → dist/lib/utils/index.d.ts} +0 -0
- /package/{src/mutations/index.ts → dist/mutations/index.d.ts} +0 -0
- /package/{src/stores/index.ts → dist/stores/index.d.ts} +0 -0
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
5
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
6
|
-
import type { RawTransactionArgument } from "../utils/index.js";
|
|
7
|
-
import type { Transaction } from "@mysten/sui/transactions";
|
|
8
|
-
|
|
9
|
-
const $moduleName = "@local-pkg/zing_studio::nitro_attestation";
|
|
10
|
-
export const PCREntry = new MoveStruct({
|
|
11
|
-
name: `${$moduleName}::PCREntry`,
|
|
12
|
-
fields: {
|
|
13
|
-
index: bcs.u8(),
|
|
14
|
-
value: bcs.vector(bcs.u8()),
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
export const NitroAttestationDocument = new MoveStruct({
|
|
18
|
-
name: `${$moduleName}::NitroAttestationDocument`,
|
|
19
|
-
fields: {
|
|
20
|
-
/** Issuing Nitro hypervisor module ID. */
|
|
21
|
-
module_id: bcs.vector(bcs.u8()),
|
|
22
|
-
/** UTC time when document was created, in milliseconds since UNIX epoch. */
|
|
23
|
-
timestamp: bcs.u64(),
|
|
24
|
-
/** The digest function used for calculating the register values. */
|
|
25
|
-
digest: bcs.vector(bcs.u8()),
|
|
26
|
-
/**
|
|
27
|
-
* A list of PCREntry containing the index and the PCR bytes.
|
|
28
|
-
* <https://docs.aws.amazon.com/enclaves/latest/user/set-up-attestation.html#where>.
|
|
29
|
-
*/
|
|
30
|
-
pcrs: bcs.vector(PCREntry),
|
|
31
|
-
/**
|
|
32
|
-
* An optional DER-encoded key the attestation, consumer can use to encrypt data
|
|
33
|
-
* with.
|
|
34
|
-
*/
|
|
35
|
-
public_key: bcs.option(bcs.vector(bcs.u8())),
|
|
36
|
-
/** Additional signed user data, defined by protocol. */
|
|
37
|
-
user_data: bcs.option(bcs.vector(bcs.u8())),
|
|
38
|
-
/**
|
|
39
|
-
* An optional cryptographic nonce provided by the attestation consumer as a proof
|
|
40
|
-
* of authenticity.
|
|
41
|
-
*/
|
|
42
|
-
nonce: bcs.option(bcs.vector(bcs.u8())),
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
export interface LoadNitroAttestationArguments {
|
|
46
|
-
attestation: RawTransactionArgument<number[]>;
|
|
47
|
-
}
|
|
48
|
-
export interface LoadNitroAttestationOptions {
|
|
49
|
-
package?: string;
|
|
50
|
-
arguments:
|
|
51
|
-
| LoadNitroAttestationArguments
|
|
52
|
-
| [attestation: RawTransactionArgument<number[]>];
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* @param attestation: attesttaion documents bytes data. @param clock: the clock
|
|
56
|
-
* object.
|
|
57
|
-
*
|
|
58
|
-
* Returns the parsed NitroAttestationDocument after verifying the attestation, may
|
|
59
|
-
* abort with errors described above.
|
|
60
|
-
*/
|
|
61
|
-
export function loadNitroAttestation(options: LoadNitroAttestationOptions) {
|
|
62
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
63
|
-
const argumentsTypes = [
|
|
64
|
-
"vector<u8>",
|
|
65
|
-
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
66
|
-
] satisfies string[];
|
|
67
|
-
const parameterNames = ["attestation"];
|
|
68
|
-
return (tx: Transaction) =>
|
|
69
|
-
tx.moveCall({
|
|
70
|
-
package: packageAddress,
|
|
71
|
-
module: "nitro_attestation",
|
|
72
|
-
function: "load_nitro_attestation",
|
|
73
|
-
arguments: normalizeMoveArguments(
|
|
74
|
-
options.arguments,
|
|
75
|
-
argumentsTypes,
|
|
76
|
-
parameterNames,
|
|
77
|
-
),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export interface ModuleIdArguments {
|
|
81
|
-
attestation: RawTransactionArgument<string>;
|
|
82
|
-
}
|
|
83
|
-
export interface ModuleIdOptions {
|
|
84
|
-
package?: string;
|
|
85
|
-
arguments: ModuleIdArguments | [attestation: RawTransactionArgument<string>];
|
|
86
|
-
}
|
|
87
|
-
export function moduleId(options: ModuleIdOptions) {
|
|
88
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
89
|
-
const argumentsTypes = [
|
|
90
|
-
`${packageAddress}::nitro_attestation::NitroAttestationDocument`,
|
|
91
|
-
] satisfies string[];
|
|
92
|
-
const parameterNames = ["attestation"];
|
|
93
|
-
return (tx: Transaction) =>
|
|
94
|
-
tx.moveCall({
|
|
95
|
-
package: packageAddress,
|
|
96
|
-
module: "nitro_attestation",
|
|
97
|
-
function: "module_id",
|
|
98
|
-
arguments: normalizeMoveArguments(
|
|
99
|
-
options.arguments,
|
|
100
|
-
argumentsTypes,
|
|
101
|
-
parameterNames,
|
|
102
|
-
),
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
export interface TimestampArguments {
|
|
106
|
-
attestation: RawTransactionArgument<string>;
|
|
107
|
-
}
|
|
108
|
-
export interface TimestampOptions {
|
|
109
|
-
package?: string;
|
|
110
|
-
arguments: TimestampArguments | [attestation: RawTransactionArgument<string>];
|
|
111
|
-
}
|
|
112
|
-
export function timestamp(options: TimestampOptions) {
|
|
113
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
114
|
-
const argumentsTypes = [
|
|
115
|
-
`${packageAddress}::nitro_attestation::NitroAttestationDocument`,
|
|
116
|
-
] satisfies string[];
|
|
117
|
-
const parameterNames = ["attestation"];
|
|
118
|
-
return (tx: Transaction) =>
|
|
119
|
-
tx.moveCall({
|
|
120
|
-
package: packageAddress,
|
|
121
|
-
module: "nitro_attestation",
|
|
122
|
-
function: "timestamp",
|
|
123
|
-
arguments: normalizeMoveArguments(
|
|
124
|
-
options.arguments,
|
|
125
|
-
argumentsTypes,
|
|
126
|
-
parameterNames,
|
|
127
|
-
),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
export interface DigestArguments {
|
|
131
|
-
attestation: RawTransactionArgument<string>;
|
|
132
|
-
}
|
|
133
|
-
export interface DigestOptions {
|
|
134
|
-
package?: string;
|
|
135
|
-
arguments: DigestArguments | [attestation: RawTransactionArgument<string>];
|
|
136
|
-
}
|
|
137
|
-
export function digest(options: DigestOptions) {
|
|
138
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
139
|
-
const argumentsTypes = [
|
|
140
|
-
`${packageAddress}::nitro_attestation::NitroAttestationDocument`,
|
|
141
|
-
] satisfies string[];
|
|
142
|
-
const parameterNames = ["attestation"];
|
|
143
|
-
return (tx: Transaction) =>
|
|
144
|
-
tx.moveCall({
|
|
145
|
-
package: packageAddress,
|
|
146
|
-
module: "nitro_attestation",
|
|
147
|
-
function: "digest",
|
|
148
|
-
arguments: normalizeMoveArguments(
|
|
149
|
-
options.arguments,
|
|
150
|
-
argumentsTypes,
|
|
151
|
-
parameterNames,
|
|
152
|
-
),
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
export interface PcrsArguments {
|
|
156
|
-
attestation: RawTransactionArgument<string>;
|
|
157
|
-
}
|
|
158
|
-
export interface PcrsOptions {
|
|
159
|
-
package?: string;
|
|
160
|
-
arguments: PcrsArguments | [attestation: RawTransactionArgument<string>];
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Returns a list of mapping PCREntry containg the index and the PCR bytes.
|
|
164
|
-
* Currently AWS supports PCR0, PCR1, PCR2, PCR3, PCR4, PCR8.
|
|
165
|
-
*/
|
|
166
|
-
export function pcrs(options: PcrsOptions) {
|
|
167
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
168
|
-
const argumentsTypes = [
|
|
169
|
-
`${packageAddress}::nitro_attestation::NitroAttestationDocument`,
|
|
170
|
-
] satisfies string[];
|
|
171
|
-
const parameterNames = ["attestation"];
|
|
172
|
-
return (tx: Transaction) =>
|
|
173
|
-
tx.moveCall({
|
|
174
|
-
package: packageAddress,
|
|
175
|
-
module: "nitro_attestation",
|
|
176
|
-
function: "pcrs",
|
|
177
|
-
arguments: normalizeMoveArguments(
|
|
178
|
-
options.arguments,
|
|
179
|
-
argumentsTypes,
|
|
180
|
-
parameterNames,
|
|
181
|
-
),
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
export interface PublicKeyArguments {
|
|
185
|
-
attestation: RawTransactionArgument<string>;
|
|
186
|
-
}
|
|
187
|
-
export interface PublicKeyOptions {
|
|
188
|
-
package?: string;
|
|
189
|
-
arguments: PublicKeyArguments | [attestation: RawTransactionArgument<string>];
|
|
190
|
-
}
|
|
191
|
-
export function publicKey(options: PublicKeyOptions) {
|
|
192
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
193
|
-
const argumentsTypes = [
|
|
194
|
-
`${packageAddress}::nitro_attestation::NitroAttestationDocument`,
|
|
195
|
-
] satisfies string[];
|
|
196
|
-
const parameterNames = ["attestation"];
|
|
197
|
-
return (tx: Transaction) =>
|
|
198
|
-
tx.moveCall({
|
|
199
|
-
package: packageAddress,
|
|
200
|
-
module: "nitro_attestation",
|
|
201
|
-
function: "public_key",
|
|
202
|
-
arguments: normalizeMoveArguments(
|
|
203
|
-
options.arguments,
|
|
204
|
-
argumentsTypes,
|
|
205
|
-
parameterNames,
|
|
206
|
-
),
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
export interface UserDataArguments {
|
|
210
|
-
attestation: RawTransactionArgument<string>;
|
|
211
|
-
}
|
|
212
|
-
export interface UserDataOptions {
|
|
213
|
-
package?: string;
|
|
214
|
-
arguments: UserDataArguments | [attestation: RawTransactionArgument<string>];
|
|
215
|
-
}
|
|
216
|
-
export function userData(options: UserDataOptions) {
|
|
217
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
218
|
-
const argumentsTypes = [
|
|
219
|
-
`${packageAddress}::nitro_attestation::NitroAttestationDocument`,
|
|
220
|
-
] satisfies string[];
|
|
221
|
-
const parameterNames = ["attestation"];
|
|
222
|
-
return (tx: Transaction) =>
|
|
223
|
-
tx.moveCall({
|
|
224
|
-
package: packageAddress,
|
|
225
|
-
module: "nitro_attestation",
|
|
226
|
-
function: "user_data",
|
|
227
|
-
arguments: normalizeMoveArguments(
|
|
228
|
-
options.arguments,
|
|
229
|
-
argumentsTypes,
|
|
230
|
-
parameterNames,
|
|
231
|
-
),
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
export interface NonceArguments {
|
|
235
|
-
attestation: RawTransactionArgument<string>;
|
|
236
|
-
}
|
|
237
|
-
export interface NonceOptions {
|
|
238
|
-
package?: string;
|
|
239
|
-
arguments: NonceArguments | [attestation: RawTransactionArgument<string>];
|
|
240
|
-
}
|
|
241
|
-
export function nonce(options: NonceOptions) {
|
|
242
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
243
|
-
const argumentsTypes = [
|
|
244
|
-
`${packageAddress}::nitro_attestation::NitroAttestationDocument`,
|
|
245
|
-
] satisfies string[];
|
|
246
|
-
const parameterNames = ["attestation"];
|
|
247
|
-
return (tx: Transaction) =>
|
|
248
|
-
tx.moveCall({
|
|
249
|
-
package: packageAddress,
|
|
250
|
-
module: "nitro_attestation",
|
|
251
|
-
function: "nonce",
|
|
252
|
-
arguments: normalizeMoveArguments(
|
|
253
|
-
options.arguments,
|
|
254
|
-
argumentsTypes,
|
|
255
|
-
parameterNames,
|
|
256
|
-
),
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
export interface IndexArguments {
|
|
260
|
-
entry: RawTransactionArgument<string>;
|
|
261
|
-
}
|
|
262
|
-
export interface IndexOptions {
|
|
263
|
-
package?: string;
|
|
264
|
-
arguments: IndexArguments | [entry: RawTransactionArgument<string>];
|
|
265
|
-
}
|
|
266
|
-
export function index(options: IndexOptions) {
|
|
267
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
268
|
-
const argumentsTypes = [
|
|
269
|
-
`${packageAddress}::nitro_attestation::PCREntry`,
|
|
270
|
-
] satisfies string[];
|
|
271
|
-
const parameterNames = ["entry"];
|
|
272
|
-
return (tx: Transaction) =>
|
|
273
|
-
tx.moveCall({
|
|
274
|
-
package: packageAddress,
|
|
275
|
-
module: "nitro_attestation",
|
|
276
|
-
function: "index",
|
|
277
|
-
arguments: normalizeMoveArguments(
|
|
278
|
-
options.arguments,
|
|
279
|
-
argumentsTypes,
|
|
280
|
-
parameterNames,
|
|
281
|
-
),
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
export interface ValueArguments {
|
|
285
|
-
entry: RawTransactionArgument<string>;
|
|
286
|
-
}
|
|
287
|
-
export interface ValueOptions {
|
|
288
|
-
package?: string;
|
|
289
|
-
arguments: ValueArguments | [entry: RawTransactionArgument<string>];
|
|
290
|
-
}
|
|
291
|
-
export function value(options: ValueOptions) {
|
|
292
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
293
|
-
const argumentsTypes = [
|
|
294
|
-
`${packageAddress}::nitro_attestation::PCREntry`,
|
|
295
|
-
] satisfies string[];
|
|
296
|
-
const parameterNames = ["entry"];
|
|
297
|
-
return (tx: Transaction) =>
|
|
298
|
-
tx.moveCall({
|
|
299
|
-
package: packageAddress,
|
|
300
|
-
module: "nitro_attestation",
|
|
301
|
-
function: "value",
|
|
302
|
-
arguments: normalizeMoveArguments(
|
|
303
|
-
options.arguments,
|
|
304
|
-
argumentsTypes,
|
|
305
|
-
parameterNames,
|
|
306
|
-
),
|
|
307
|
-
});
|
|
308
|
-
}
|