@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
|
@@ -0,0 +1,327 @@
|
|
|
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 AddStorageEvent: MoveStruct<{
|
|
5
|
+
current_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
6
|
+
added_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
7
|
+
added_size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
8
|
+
}, "@local-pkg/zing_studio::storage::AddStorageEvent">;
|
|
9
|
+
export declare const RemoveStorageEvent: MoveStruct<{
|
|
10
|
+
current_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
11
|
+
removed_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
12
|
+
removed_size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
13
|
+
}, "@local-pkg/zing_studio::storage::RemoveStorageEvent">;
|
|
14
|
+
export declare const AllocateStorageEvent: MoveStruct<{
|
|
15
|
+
current_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
16
|
+
start_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
17
|
+
end_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
18
|
+
size_per_epoch: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
19
|
+
}, "@local-pkg/zing_studio::storage::AllocateStorageEvent">;
|
|
20
|
+
export declare const DeallocateStorageEvent: MoveStruct<{
|
|
21
|
+
current_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
22
|
+
start_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
23
|
+
end_epoch: import("@mysten/sui/bcs").BcsType<number, number, "u32">;
|
|
24
|
+
size_per_epoch: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
25
|
+
}, "@local-pkg/zing_studio::storage::DeallocateStorageEvent">;
|
|
26
|
+
export declare const STORAGE: MoveStruct<{
|
|
27
|
+
dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
28
|
+
}, "@local-pkg/zing_studio::storage::STORAGE">;
|
|
29
|
+
export declare const StorageTier: MoveStruct<{
|
|
30
|
+
price: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
31
|
+
duration_days: import("@mysten/sui/bcs").BcsType<number, number, "u16">;
|
|
32
|
+
storage_limit: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
33
|
+
}, "@local-pkg/zing_studio::storage::StorageTier">;
|
|
34
|
+
export declare const StorageTreasury: MoveStruct<{
|
|
35
|
+
id: MoveStruct<{
|
|
36
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
37
|
+
}, "0x2::object::UID">;
|
|
38
|
+
tier_plan: MoveStruct<{
|
|
39
|
+
contents: import("@mysten/sui/bcs").BcsType<{
|
|
40
|
+
key: number;
|
|
41
|
+
value: {
|
|
42
|
+
price: string;
|
|
43
|
+
duration_days: number;
|
|
44
|
+
storage_limit: string;
|
|
45
|
+
};
|
|
46
|
+
}[], Iterable<{
|
|
47
|
+
key: number;
|
|
48
|
+
value: {
|
|
49
|
+
price: string | number | bigint;
|
|
50
|
+
duration_days: number;
|
|
51
|
+
storage_limit: string | number | bigint;
|
|
52
|
+
};
|
|
53
|
+
}> & {
|
|
54
|
+
length: number;
|
|
55
|
+
}, string>;
|
|
56
|
+
}, "0x2::vec_map::VecMap<u8, @local-pkg/zing_studio::storage::StorageTier>">;
|
|
57
|
+
/**
|
|
58
|
+
* Maps epoch number to storage resources available for that epoch Each epoch can
|
|
59
|
+
* have multiple storage resources that get fused together
|
|
60
|
+
*/
|
|
61
|
+
storages_by_epoch: MoveStruct<{
|
|
62
|
+
contents: import("@mysten/sui/bcs").BcsType<{
|
|
63
|
+
key: number;
|
|
64
|
+
value: {
|
|
65
|
+
id: {
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
68
|
+
start_epoch: number;
|
|
69
|
+
end_epoch: number;
|
|
70
|
+
storage_size: string;
|
|
71
|
+
};
|
|
72
|
+
}[], Iterable<{
|
|
73
|
+
key: number;
|
|
74
|
+
value: {
|
|
75
|
+
id: {
|
|
76
|
+
id: string | Uint8Array<ArrayBufferLike>;
|
|
77
|
+
};
|
|
78
|
+
start_epoch: number;
|
|
79
|
+
end_epoch: number;
|
|
80
|
+
storage_size: string | number | bigint;
|
|
81
|
+
};
|
|
82
|
+
}> & {
|
|
83
|
+
length: number;
|
|
84
|
+
}, string>;
|
|
85
|
+
}, "0x2::vec_map::VecMap<u32, walrus::storage_resource::Storage>">;
|
|
86
|
+
wal_treasury: MoveStruct<{
|
|
87
|
+
id: MoveStruct<{
|
|
88
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
89
|
+
}, "0x2::object::UID">;
|
|
90
|
+
balance: MoveStruct<{
|
|
91
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
92
|
+
}, "0x2::balance::Balance">;
|
|
93
|
+
}, "0x2::coin::Coin">;
|
|
94
|
+
}, "@local-pkg/zing_studio::storage::StorageTreasury">;
|
|
95
|
+
export declare const StorageSpace: MoveStruct<{
|
|
96
|
+
id: MoveStruct<{
|
|
97
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
98
|
+
}, "0x2::object::UID">;
|
|
99
|
+
owner: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
100
|
+
/** Storage tier that determines the storage limit and pricing */
|
|
101
|
+
tier: import("@mysten/sui/bcs").BcsType<number | null, number | null | undefined, "Option<u8>">;
|
|
102
|
+
/** Maps epoch number to storage used in that epoch */
|
|
103
|
+
storage_used: MoveStruct<{
|
|
104
|
+
contents: import("@mysten/sui/bcs").BcsType<{
|
|
105
|
+
key: number;
|
|
106
|
+
value: string;
|
|
107
|
+
}[], Iterable<{
|
|
108
|
+
key: number;
|
|
109
|
+
value: string | number | bigint;
|
|
110
|
+
}> & {
|
|
111
|
+
length: number;
|
|
112
|
+
}, string>;
|
|
113
|
+
}, "0x2::vec_map::VecMap<u32, u64>">;
|
|
114
|
+
credits: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
115
|
+
}, "@local-pkg/zing_studio::storage::StorageSpace">;
|
|
116
|
+
export interface TierPlanArguments {
|
|
117
|
+
self: RawTransactionArgument<string>;
|
|
118
|
+
}
|
|
119
|
+
export interface TierPlanOptions {
|
|
120
|
+
package?: string;
|
|
121
|
+
arguments: TierPlanArguments | [self: RawTransactionArgument<string>];
|
|
122
|
+
}
|
|
123
|
+
export declare function tierPlan(options: TierPlanOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
124
|
+
export interface StoragesByEpochArguments {
|
|
125
|
+
self: RawTransactionArgument<string>;
|
|
126
|
+
}
|
|
127
|
+
export interface StoragesByEpochOptions {
|
|
128
|
+
package?: string;
|
|
129
|
+
arguments: StoragesByEpochArguments | [self: RawTransactionArgument<string>];
|
|
130
|
+
}
|
|
131
|
+
export declare function storagesByEpoch(options: StoragesByEpochOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
132
|
+
export interface WalTreasuryArguments {
|
|
133
|
+
self: RawTransactionArgument<string>;
|
|
134
|
+
}
|
|
135
|
+
export interface WalTreasuryOptions {
|
|
136
|
+
package?: string;
|
|
137
|
+
arguments: WalTreasuryArguments | [self: RawTransactionArgument<string>];
|
|
138
|
+
}
|
|
139
|
+
export declare function walTreasury(options: WalTreasuryOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
140
|
+
export interface TierPriceArguments {
|
|
141
|
+
tier: RawTransactionArgument<string>;
|
|
142
|
+
}
|
|
143
|
+
export interface TierPriceOptions {
|
|
144
|
+
package?: string;
|
|
145
|
+
arguments: TierPriceArguments | [tier: RawTransactionArgument<string>];
|
|
146
|
+
}
|
|
147
|
+
export declare function tierPrice(options: TierPriceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
148
|
+
export interface TierDurationDaysArguments {
|
|
149
|
+
tier: RawTransactionArgument<string>;
|
|
150
|
+
}
|
|
151
|
+
export interface TierDurationDaysOptions {
|
|
152
|
+
package?: string;
|
|
153
|
+
arguments: TierDurationDaysArguments | [tier: RawTransactionArgument<string>];
|
|
154
|
+
}
|
|
155
|
+
export declare function tierDurationDays(options: TierDurationDaysOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
156
|
+
export interface TierDurationArguments {
|
|
157
|
+
tier: RawTransactionArgument<string>;
|
|
158
|
+
}
|
|
159
|
+
export interface TierDurationOptions {
|
|
160
|
+
package?: string;
|
|
161
|
+
arguments: TierDurationArguments | [tier: RawTransactionArgument<string>];
|
|
162
|
+
}
|
|
163
|
+
export declare function tierDuration(options: TierDurationOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
164
|
+
export interface TierStorageLimitArguments {
|
|
165
|
+
tier: RawTransactionArgument<string>;
|
|
166
|
+
}
|
|
167
|
+
export interface TierStorageLimitOptions {
|
|
168
|
+
package?: string;
|
|
169
|
+
arguments: TierStorageLimitArguments | [tier: RawTransactionArgument<string>];
|
|
170
|
+
}
|
|
171
|
+
export declare function tierStorageLimit(options: TierStorageLimitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
172
|
+
export interface StorageLimitArguments {
|
|
173
|
+
self: RawTransactionArgument<string>;
|
|
174
|
+
storageSpace: RawTransactionArgument<string>;
|
|
175
|
+
}
|
|
176
|
+
export interface StorageLimitOptions {
|
|
177
|
+
package?: string;
|
|
178
|
+
arguments: StorageLimitArguments | [
|
|
179
|
+
self: RawTransactionArgument<string>,
|
|
180
|
+
storageSpace: RawTransactionArgument<string>
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
export declare function storageLimit(options: StorageLimitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
184
|
+
export interface OwnerArguments {
|
|
185
|
+
storageSpace: RawTransactionArgument<string>;
|
|
186
|
+
}
|
|
187
|
+
export interface OwnerOptions {
|
|
188
|
+
package?: string;
|
|
189
|
+
arguments: OwnerArguments | [storageSpace: RawTransactionArgument<string>];
|
|
190
|
+
}
|
|
191
|
+
export declare function owner(options: OwnerOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
192
|
+
export interface TierArguments {
|
|
193
|
+
storageSpace: RawTransactionArgument<string>;
|
|
194
|
+
}
|
|
195
|
+
export interface TierOptions {
|
|
196
|
+
package?: string;
|
|
197
|
+
arguments: TierArguments | [storageSpace: RawTransactionArgument<string>];
|
|
198
|
+
}
|
|
199
|
+
export declare function tier(options: TierOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
200
|
+
export interface StorageUsedArguments {
|
|
201
|
+
storageSpace: RawTransactionArgument<string>;
|
|
202
|
+
}
|
|
203
|
+
export interface StorageUsedOptions {
|
|
204
|
+
package?: string;
|
|
205
|
+
arguments: StorageUsedArguments | [storageSpace: RawTransactionArgument<string>];
|
|
206
|
+
}
|
|
207
|
+
/** Returns the storage limit for this storage space */
|
|
208
|
+
export declare function storageUsed(options: StorageUsedOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
209
|
+
export interface StorageUsedByEpochArguments {
|
|
210
|
+
storageSpace: RawTransactionArgument<string>;
|
|
211
|
+
epoch: RawTransactionArgument<number>;
|
|
212
|
+
}
|
|
213
|
+
export interface StorageUsedByEpochOptions {
|
|
214
|
+
package?: string;
|
|
215
|
+
arguments: StorageUsedByEpochArguments | [
|
|
216
|
+
storageSpace: RawTransactionArgument<string>,
|
|
217
|
+
epoch: RawTransactionArgument<number>
|
|
218
|
+
];
|
|
219
|
+
}
|
|
220
|
+
export declare function storageUsedByEpoch(options: StorageUsedByEpochOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
221
|
+
export interface CreditsArguments {
|
|
222
|
+
storageSpace: RawTransactionArgument<string>;
|
|
223
|
+
}
|
|
224
|
+
export interface CreditsOptions {
|
|
225
|
+
package?: string;
|
|
226
|
+
arguments: CreditsArguments | [storageSpace: RawTransactionArgument<string>];
|
|
227
|
+
}
|
|
228
|
+
export declare function credits(options: CreditsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
229
|
+
export interface RemainingStorageArguments {
|
|
230
|
+
self: RawTransactionArgument<string>;
|
|
231
|
+
storageSpace: RawTransactionArgument<string>;
|
|
232
|
+
epoch: RawTransactionArgument<number>;
|
|
233
|
+
}
|
|
234
|
+
export interface RemainingStorageOptions {
|
|
235
|
+
package?: string;
|
|
236
|
+
arguments: RemainingStorageArguments | [
|
|
237
|
+
self: RawTransactionArgument<string>,
|
|
238
|
+
storageSpace: RawTransactionArgument<string>,
|
|
239
|
+
epoch: RawTransactionArgument<number>
|
|
240
|
+
];
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Calculates the remaining available storage capacity Returns 0 if already over
|
|
244
|
+
* limit (defensive programming)
|
|
245
|
+
*/
|
|
246
|
+
export declare function remainingStorage(options: RemainingStorageOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
247
|
+
export interface UpdateTierPlanArguments {
|
|
248
|
+
self: RawTransactionArgument<string>;
|
|
249
|
+
Cap: RawTransactionArgument<string>;
|
|
250
|
+
tierIndex: RawTransactionArgument<number>;
|
|
251
|
+
price: RawTransactionArgument<number | bigint>;
|
|
252
|
+
durationDays: RawTransactionArgument<number>;
|
|
253
|
+
storageLimit: RawTransactionArgument<number | bigint>;
|
|
254
|
+
}
|
|
255
|
+
export interface UpdateTierPlanOptions {
|
|
256
|
+
package?: string;
|
|
257
|
+
arguments: UpdateTierPlanArguments | [
|
|
258
|
+
self: RawTransactionArgument<string>,
|
|
259
|
+
Cap: RawTransactionArgument<string>,
|
|
260
|
+
tierIndex: RawTransactionArgument<number>,
|
|
261
|
+
price: RawTransactionArgument<number | bigint>,
|
|
262
|
+
durationDays: RawTransactionArgument<number>,
|
|
263
|
+
storageLimit: RawTransactionArgument<number | bigint>
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
export declare function updateTierPlan(options: UpdateTierPlanOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
267
|
+
export interface RemoveStorageByAdminArguments {
|
|
268
|
+
self: RawTransactionArgument<string>;
|
|
269
|
+
walrusSystem: RawTransactionArgument<string>;
|
|
270
|
+
Cap: RawTransactionArgument<string>;
|
|
271
|
+
epoch: RawTransactionArgument<number>;
|
|
272
|
+
splitSize: RawTransactionArgument<number | bigint>;
|
|
273
|
+
}
|
|
274
|
+
export interface RemoveStorageByAdminOptions {
|
|
275
|
+
package?: string;
|
|
276
|
+
arguments: RemoveStorageByAdminArguments | [
|
|
277
|
+
self: RawTransactionArgument<string>,
|
|
278
|
+
walrusSystem: RawTransactionArgument<string>,
|
|
279
|
+
Cap: RawTransactionArgument<string>,
|
|
280
|
+
epoch: RawTransactionArgument<number>,
|
|
281
|
+
splitSize: RawTransactionArgument<number | bigint>
|
|
282
|
+
];
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Admin function to remove storage from treasury for a specific epoch Requires
|
|
286
|
+
* AdminCap to ensure only authorized users can call this Returns the requested
|
|
287
|
+
* storage amount, splitting if necessary
|
|
288
|
+
*/
|
|
289
|
+
export declare function removeStorageByAdmin(options: RemoveStorageByAdminOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
290
|
+
export interface ShareStorageSpaceArguments {
|
|
291
|
+
storageSpace: RawTransactionArgument<string>;
|
|
292
|
+
}
|
|
293
|
+
export interface ShareStorageSpaceOptions {
|
|
294
|
+
package?: string;
|
|
295
|
+
arguments: ShareStorageSpaceArguments | [storageSpace: RawTransactionArgument<string>];
|
|
296
|
+
}
|
|
297
|
+
export declare function shareStorageSpace(options: ShareStorageSpaceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
298
|
+
export interface FundWalTreasuryArguments {
|
|
299
|
+
self: RawTransactionArgument<string>;
|
|
300
|
+
config: RawTransactionArgument<string>;
|
|
301
|
+
coin: RawTransactionArgument<string>;
|
|
302
|
+
}
|
|
303
|
+
export interface FundWalTreasuryOptions {
|
|
304
|
+
package?: string;
|
|
305
|
+
arguments: FundWalTreasuryArguments | [
|
|
306
|
+
self: RawTransactionArgument<string>,
|
|
307
|
+
config: RawTransactionArgument<string>,
|
|
308
|
+
coin: RawTransactionArgument<string>
|
|
309
|
+
];
|
|
310
|
+
}
|
|
311
|
+
export declare function fundWalTreasury(options: FundWalTreasuryOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
312
|
+
export interface AddStorageToTreasuryArguments {
|
|
313
|
+
self: RawTransactionArgument<string>;
|
|
314
|
+
config: RawTransactionArgument<string>;
|
|
315
|
+
walrusSystem: RawTransactionArgument<string>;
|
|
316
|
+
storage: RawTransactionArgument<string>;
|
|
317
|
+
}
|
|
318
|
+
export interface AddStorageToTreasuryOptions {
|
|
319
|
+
package?: string;
|
|
320
|
+
arguments: AddStorageToTreasuryArguments | [
|
|
321
|
+
self: RawTransactionArgument<string>,
|
|
322
|
+
config: RawTransactionArgument<string>,
|
|
323
|
+
walrusSystem: RawTransactionArgument<string>,
|
|
324
|
+
storage: RawTransactionArgument<string>
|
|
325
|
+
];
|
|
326
|
+
}
|
|
327
|
+
export declare function addStorageToTreasury(options: AddStorageToTreasuryOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import * as coin from "./deps/sui/coin.js";
|
|
5
|
+
import * as object from "./deps/sui/object.js";
|
|
6
|
+
import * as vec_map from "./deps/sui/vec_map.js";
|
|
7
|
+
import * as storage_resource from "./deps/walrus/storage_resource.js";
|
|
8
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
9
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
10
|
+
const $moduleName = "@local-pkg/zing_studio::storage";
|
|
11
|
+
export const AddStorageEvent = new MoveStruct({
|
|
12
|
+
name: `${$moduleName}::AddStorageEvent`,
|
|
13
|
+
fields: {
|
|
14
|
+
current_epoch: bcs.u32(),
|
|
15
|
+
added_epoch: bcs.u32(),
|
|
16
|
+
added_size: bcs.u64(),
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export const RemoveStorageEvent = new MoveStruct({
|
|
20
|
+
name: `${$moduleName}::RemoveStorageEvent`,
|
|
21
|
+
fields: {
|
|
22
|
+
current_epoch: bcs.u32(),
|
|
23
|
+
removed_epoch: bcs.u32(),
|
|
24
|
+
removed_size: bcs.u64(),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export const AllocateStorageEvent = new MoveStruct({
|
|
28
|
+
name: `${$moduleName}::AllocateStorageEvent`,
|
|
29
|
+
fields: {
|
|
30
|
+
current_epoch: bcs.u32(),
|
|
31
|
+
start_epoch: bcs.u32(),
|
|
32
|
+
end_epoch: bcs.u32(),
|
|
33
|
+
size_per_epoch: bcs.u64(),
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
export const DeallocateStorageEvent = new MoveStruct({
|
|
37
|
+
name: `${$moduleName}::DeallocateStorageEvent`,
|
|
38
|
+
fields: {
|
|
39
|
+
current_epoch: bcs.u32(),
|
|
40
|
+
start_epoch: bcs.u32(),
|
|
41
|
+
end_epoch: bcs.u32(),
|
|
42
|
+
size_per_epoch: bcs.u64(),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
export const STORAGE = new MoveStruct({
|
|
46
|
+
name: `${$moduleName}::STORAGE`,
|
|
47
|
+
fields: {
|
|
48
|
+
dummy_field: bcs.bool(),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export const StorageTier = new MoveStruct({
|
|
52
|
+
name: `${$moduleName}::StorageTier`,
|
|
53
|
+
fields: {
|
|
54
|
+
price: bcs.u64(),
|
|
55
|
+
duration_days: bcs.u16(),
|
|
56
|
+
storage_limit: bcs.u64(),
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
export const StorageTreasury = new MoveStruct({
|
|
60
|
+
name: `${$moduleName}::StorageTreasury`,
|
|
61
|
+
fields: {
|
|
62
|
+
id: object.UID,
|
|
63
|
+
tier_plan: vec_map.VecMap(bcs.u8(), StorageTier),
|
|
64
|
+
/**
|
|
65
|
+
* Maps epoch number to storage resources available for that epoch Each epoch can
|
|
66
|
+
* have multiple storage resources that get fused together
|
|
67
|
+
*/
|
|
68
|
+
storages_by_epoch: vec_map.VecMap(bcs.u32(), storage_resource.Storage),
|
|
69
|
+
wal_treasury: coin.Coin,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
export const StorageSpace = new MoveStruct({
|
|
73
|
+
name: `${$moduleName}::StorageSpace`,
|
|
74
|
+
fields: {
|
|
75
|
+
id: object.UID,
|
|
76
|
+
owner: bcs.Address,
|
|
77
|
+
/** Storage tier that determines the storage limit and pricing */
|
|
78
|
+
tier: bcs.option(bcs.u8()),
|
|
79
|
+
/** Maps epoch number to storage used in that epoch */
|
|
80
|
+
storage_used: vec_map.VecMap(bcs.u32(), bcs.u64()),
|
|
81
|
+
credits: bcs.u64(),
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
export function tierPlan(options) {
|
|
85
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
86
|
+
const argumentsTypes = [
|
|
87
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
88
|
+
];
|
|
89
|
+
const parameterNames = ["self"];
|
|
90
|
+
return (tx) => tx.moveCall({
|
|
91
|
+
package: packageAddress,
|
|
92
|
+
module: "storage",
|
|
93
|
+
function: "tier_plan",
|
|
94
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
export function storagesByEpoch(options) {
|
|
98
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
99
|
+
const argumentsTypes = [
|
|
100
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
101
|
+
];
|
|
102
|
+
const parameterNames = ["self"];
|
|
103
|
+
return (tx) => tx.moveCall({
|
|
104
|
+
package: packageAddress,
|
|
105
|
+
module: "storage",
|
|
106
|
+
function: "storages_by_epoch",
|
|
107
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
export function walTreasury(options) {
|
|
111
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
112
|
+
const argumentsTypes = [
|
|
113
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
114
|
+
];
|
|
115
|
+
const parameterNames = ["self"];
|
|
116
|
+
return (tx) => tx.moveCall({
|
|
117
|
+
package: packageAddress,
|
|
118
|
+
module: "storage",
|
|
119
|
+
function: "wal_treasury",
|
|
120
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
export function tierPrice(options) {
|
|
124
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
125
|
+
const argumentsTypes = [
|
|
126
|
+
`${packageAddress}::storage::StorageTier`,
|
|
127
|
+
];
|
|
128
|
+
const parameterNames = ["tier"];
|
|
129
|
+
return (tx) => tx.moveCall({
|
|
130
|
+
package: packageAddress,
|
|
131
|
+
module: "storage",
|
|
132
|
+
function: "tier_price",
|
|
133
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
export function tierDurationDays(options) {
|
|
137
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
138
|
+
const argumentsTypes = [
|
|
139
|
+
`${packageAddress}::storage::StorageTier`,
|
|
140
|
+
];
|
|
141
|
+
const parameterNames = ["tier"];
|
|
142
|
+
return (tx) => tx.moveCall({
|
|
143
|
+
package: packageAddress,
|
|
144
|
+
module: "storage",
|
|
145
|
+
function: "tier_duration_days",
|
|
146
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
export function tierDuration(options) {
|
|
150
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
151
|
+
const argumentsTypes = [
|
|
152
|
+
`${packageAddress}::storage::StorageTier`,
|
|
153
|
+
];
|
|
154
|
+
const parameterNames = ["tier"];
|
|
155
|
+
return (tx) => tx.moveCall({
|
|
156
|
+
package: packageAddress,
|
|
157
|
+
module: "storage",
|
|
158
|
+
function: "tier_duration",
|
|
159
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
export function tierStorageLimit(options) {
|
|
163
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
164
|
+
const argumentsTypes = [
|
|
165
|
+
`${packageAddress}::storage::StorageTier`,
|
|
166
|
+
];
|
|
167
|
+
const parameterNames = ["tier"];
|
|
168
|
+
return (tx) => tx.moveCall({
|
|
169
|
+
package: packageAddress,
|
|
170
|
+
module: "storage",
|
|
171
|
+
function: "tier_storage_limit",
|
|
172
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
export function storageLimit(options) {
|
|
176
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
177
|
+
const argumentsTypes = [
|
|
178
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
179
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
180
|
+
];
|
|
181
|
+
const parameterNames = ["self", "storageSpace"];
|
|
182
|
+
return (tx) => tx.moveCall({
|
|
183
|
+
package: packageAddress,
|
|
184
|
+
module: "storage",
|
|
185
|
+
function: "storage_limit",
|
|
186
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
export function owner(options) {
|
|
190
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
191
|
+
const argumentsTypes = [
|
|
192
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
193
|
+
];
|
|
194
|
+
const parameterNames = ["storageSpace"];
|
|
195
|
+
return (tx) => tx.moveCall({
|
|
196
|
+
package: packageAddress,
|
|
197
|
+
module: "storage",
|
|
198
|
+
function: "owner",
|
|
199
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
export function tier(options) {
|
|
203
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
204
|
+
const argumentsTypes = [
|
|
205
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
206
|
+
];
|
|
207
|
+
const parameterNames = ["storageSpace"];
|
|
208
|
+
return (tx) => tx.moveCall({
|
|
209
|
+
package: packageAddress,
|
|
210
|
+
module: "storage",
|
|
211
|
+
function: "tier",
|
|
212
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/** Returns the storage limit for this storage space */
|
|
216
|
+
export function storageUsed(options) {
|
|
217
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
218
|
+
const argumentsTypes = [
|
|
219
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
220
|
+
];
|
|
221
|
+
const parameterNames = ["storageSpace"];
|
|
222
|
+
return (tx) => tx.moveCall({
|
|
223
|
+
package: packageAddress,
|
|
224
|
+
module: "storage",
|
|
225
|
+
function: "storage_used",
|
|
226
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
export function storageUsedByEpoch(options) {
|
|
230
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
231
|
+
const argumentsTypes = [
|
|
232
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
233
|
+
"u32",
|
|
234
|
+
];
|
|
235
|
+
const parameterNames = ["storageSpace", "epoch"];
|
|
236
|
+
return (tx) => tx.moveCall({
|
|
237
|
+
package: packageAddress,
|
|
238
|
+
module: "storage",
|
|
239
|
+
function: "storage_used_by_epoch",
|
|
240
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
export function credits(options) {
|
|
244
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
245
|
+
const argumentsTypes = [
|
|
246
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
247
|
+
];
|
|
248
|
+
const parameterNames = ["storageSpace"];
|
|
249
|
+
return (tx) => tx.moveCall({
|
|
250
|
+
package: packageAddress,
|
|
251
|
+
module: "storage",
|
|
252
|
+
function: "credits",
|
|
253
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Calculates the remaining available storage capacity Returns 0 if already over
|
|
258
|
+
* limit (defensive programming)
|
|
259
|
+
*/
|
|
260
|
+
export function remainingStorage(options) {
|
|
261
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
262
|
+
const argumentsTypes = [
|
|
263
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
264
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
265
|
+
"u32",
|
|
266
|
+
];
|
|
267
|
+
const parameterNames = ["self", "storageSpace", "epoch"];
|
|
268
|
+
return (tx) => tx.moveCall({
|
|
269
|
+
package: packageAddress,
|
|
270
|
+
module: "storage",
|
|
271
|
+
function: "remaining_storage",
|
|
272
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
export function updateTierPlan(options) {
|
|
276
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
277
|
+
const argumentsTypes = [
|
|
278
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
279
|
+
`${packageAddress}::admin::AdminCap`,
|
|
280
|
+
"u8",
|
|
281
|
+
"u64",
|
|
282
|
+
"u16",
|
|
283
|
+
"u64",
|
|
284
|
+
];
|
|
285
|
+
const parameterNames = [
|
|
286
|
+
"self",
|
|
287
|
+
"Cap",
|
|
288
|
+
"tierIndex",
|
|
289
|
+
"price",
|
|
290
|
+
"durationDays",
|
|
291
|
+
"storageLimit",
|
|
292
|
+
];
|
|
293
|
+
return (tx) => tx.moveCall({
|
|
294
|
+
package: packageAddress,
|
|
295
|
+
module: "storage",
|
|
296
|
+
function: "update_tier_plan",
|
|
297
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Admin function to remove storage from treasury for a specific epoch Requires
|
|
302
|
+
* AdminCap to ensure only authorized users can call this Returns the requested
|
|
303
|
+
* storage amount, splitting if necessary
|
|
304
|
+
*/
|
|
305
|
+
export function removeStorageByAdmin(options) {
|
|
306
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
307
|
+
const argumentsTypes = [
|
|
308
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
309
|
+
`${packageAddress}::system::System`,
|
|
310
|
+
`${packageAddress}::admin::AdminCap`,
|
|
311
|
+
"u32",
|
|
312
|
+
"u64",
|
|
313
|
+
];
|
|
314
|
+
const parameterNames = ["self", "walrusSystem", "Cap", "epoch", "splitSize"];
|
|
315
|
+
return (tx) => tx.moveCall({
|
|
316
|
+
package: packageAddress,
|
|
317
|
+
module: "storage",
|
|
318
|
+
function: "remove_storage_by_admin",
|
|
319
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
export function shareStorageSpace(options) {
|
|
323
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
324
|
+
const argumentsTypes = [
|
|
325
|
+
`${packageAddress}::storage::StorageSpace`,
|
|
326
|
+
];
|
|
327
|
+
const parameterNames = ["storageSpace"];
|
|
328
|
+
return (tx) => tx.moveCall({
|
|
329
|
+
package: packageAddress,
|
|
330
|
+
module: "storage",
|
|
331
|
+
function: "share_storage_space",
|
|
332
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
export function fundWalTreasury(options) {
|
|
336
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
337
|
+
const argumentsTypes = [
|
|
338
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
339
|
+
`${packageAddress}::config::Config`,
|
|
340
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${packageAddress}::wal::WAL>`,
|
|
341
|
+
];
|
|
342
|
+
const parameterNames = ["self", "config", "coin"];
|
|
343
|
+
return (tx) => tx.moveCall({
|
|
344
|
+
package: packageAddress,
|
|
345
|
+
module: "storage",
|
|
346
|
+
function: "fund_wal_treasury",
|
|
347
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
export function addStorageToTreasury(options) {
|
|
351
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
352
|
+
const argumentsTypes = [
|
|
353
|
+
`${packageAddress}::storage::StorageTreasury`,
|
|
354
|
+
`${packageAddress}::config::Config`,
|
|
355
|
+
`${packageAddress}::system::System`,
|
|
356
|
+
`${packageAddress}::storage_resource::Storage`,
|
|
357
|
+
];
|
|
358
|
+
const parameterNames = ["self", "config", "walrusSystem", "storage"];
|
|
359
|
+
return (tx) => tx.moveCall({
|
|
360
|
+
package: packageAddress,
|
|
361
|
+
module: "storage",
|
|
362
|
+
function: "add_storage_to_treasury",
|
|
363
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
364
|
+
});
|
|
365
|
+
}
|