@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,664 +0,0 @@
|
|
|
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
|
-
import type { RawTransactionArgument } from "../utils/index.js";
|
|
11
|
-
import type { Transaction } from "@mysten/sui/transactions";
|
|
12
|
-
|
|
13
|
-
const $moduleName = "@local-pkg/zing_studio::storage";
|
|
14
|
-
export const AddStorageEvent = new MoveStruct({
|
|
15
|
-
name: `${$moduleName}::AddStorageEvent`,
|
|
16
|
-
fields: {
|
|
17
|
-
current_epoch: bcs.u32(),
|
|
18
|
-
added_epoch: bcs.u32(),
|
|
19
|
-
added_size: bcs.u64(),
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
export const RemoveStorageEvent = new MoveStruct({
|
|
23
|
-
name: `${$moduleName}::RemoveStorageEvent`,
|
|
24
|
-
fields: {
|
|
25
|
-
current_epoch: bcs.u32(),
|
|
26
|
-
removed_epoch: bcs.u32(),
|
|
27
|
-
removed_size: bcs.u64(),
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
export const AllocateStorageEvent = new MoveStruct({
|
|
31
|
-
name: `${$moduleName}::AllocateStorageEvent`,
|
|
32
|
-
fields: {
|
|
33
|
-
current_epoch: bcs.u32(),
|
|
34
|
-
start_epoch: bcs.u32(),
|
|
35
|
-
end_epoch: bcs.u32(),
|
|
36
|
-
size_per_epoch: bcs.u64(),
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
export const DeallocateStorageEvent = new MoveStruct({
|
|
40
|
-
name: `${$moduleName}::DeallocateStorageEvent`,
|
|
41
|
-
fields: {
|
|
42
|
-
current_epoch: bcs.u32(),
|
|
43
|
-
start_epoch: bcs.u32(),
|
|
44
|
-
end_epoch: bcs.u32(),
|
|
45
|
-
size_per_epoch: bcs.u64(),
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
export const STORAGE = new MoveStruct({
|
|
49
|
-
name: `${$moduleName}::STORAGE`,
|
|
50
|
-
fields: {
|
|
51
|
-
dummy_field: bcs.bool(),
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
export const StorageTier = new MoveStruct({
|
|
55
|
-
name: `${$moduleName}::StorageTier`,
|
|
56
|
-
fields: {
|
|
57
|
-
price: bcs.u64(),
|
|
58
|
-
duration_days: bcs.u16(),
|
|
59
|
-
storage_limit: bcs.u64(),
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
export const StorageTreasury = new MoveStruct({
|
|
63
|
-
name: `${$moduleName}::StorageTreasury`,
|
|
64
|
-
fields: {
|
|
65
|
-
id: object.UID,
|
|
66
|
-
tier_plan: vec_map.VecMap(bcs.u8(), StorageTier),
|
|
67
|
-
/**
|
|
68
|
-
* Maps epoch number to storage resources available for that epoch Each epoch can
|
|
69
|
-
* have multiple storage resources that get fused together
|
|
70
|
-
*/
|
|
71
|
-
storages_by_epoch: vec_map.VecMap(bcs.u32(), storage_resource.Storage),
|
|
72
|
-
wal_treasury: coin.Coin,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
export const StorageSpace = new MoveStruct({
|
|
76
|
-
name: `${$moduleName}::StorageSpace`,
|
|
77
|
-
fields: {
|
|
78
|
-
id: object.UID,
|
|
79
|
-
owner: bcs.Address,
|
|
80
|
-
/** Storage tier that determines the storage limit and pricing */
|
|
81
|
-
tier: bcs.option(bcs.u8()),
|
|
82
|
-
/** Maps epoch number to storage used in that epoch */
|
|
83
|
-
storage_used: vec_map.VecMap(bcs.u32(), bcs.u64()),
|
|
84
|
-
credits: bcs.u64(),
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
export interface TierPlanArguments {
|
|
88
|
-
self: RawTransactionArgument<string>;
|
|
89
|
-
}
|
|
90
|
-
export interface TierPlanOptions {
|
|
91
|
-
package?: string;
|
|
92
|
-
arguments: TierPlanArguments | [self: RawTransactionArgument<string>];
|
|
93
|
-
}
|
|
94
|
-
export function tierPlan(options: TierPlanOptions) {
|
|
95
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
96
|
-
const argumentsTypes = [
|
|
97
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
98
|
-
] satisfies string[];
|
|
99
|
-
const parameterNames = ["self"];
|
|
100
|
-
return (tx: Transaction) =>
|
|
101
|
-
tx.moveCall({
|
|
102
|
-
package: packageAddress,
|
|
103
|
-
module: "storage",
|
|
104
|
-
function: "tier_plan",
|
|
105
|
-
arguments: normalizeMoveArguments(
|
|
106
|
-
options.arguments,
|
|
107
|
-
argumentsTypes,
|
|
108
|
-
parameterNames,
|
|
109
|
-
),
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
export interface StoragesByEpochArguments {
|
|
113
|
-
self: RawTransactionArgument<string>;
|
|
114
|
-
}
|
|
115
|
-
export interface StoragesByEpochOptions {
|
|
116
|
-
package?: string;
|
|
117
|
-
arguments: StoragesByEpochArguments | [self: RawTransactionArgument<string>];
|
|
118
|
-
}
|
|
119
|
-
export function storagesByEpoch(options: StoragesByEpochOptions) {
|
|
120
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
121
|
-
const argumentsTypes = [
|
|
122
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
123
|
-
] satisfies string[];
|
|
124
|
-
const parameterNames = ["self"];
|
|
125
|
-
return (tx: Transaction) =>
|
|
126
|
-
tx.moveCall({
|
|
127
|
-
package: packageAddress,
|
|
128
|
-
module: "storage",
|
|
129
|
-
function: "storages_by_epoch",
|
|
130
|
-
arguments: normalizeMoveArguments(
|
|
131
|
-
options.arguments,
|
|
132
|
-
argumentsTypes,
|
|
133
|
-
parameterNames,
|
|
134
|
-
),
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
export interface WalTreasuryArguments {
|
|
138
|
-
self: RawTransactionArgument<string>;
|
|
139
|
-
}
|
|
140
|
-
export interface WalTreasuryOptions {
|
|
141
|
-
package?: string;
|
|
142
|
-
arguments: WalTreasuryArguments | [self: RawTransactionArgument<string>];
|
|
143
|
-
}
|
|
144
|
-
export function walTreasury(options: WalTreasuryOptions) {
|
|
145
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
146
|
-
const argumentsTypes = [
|
|
147
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
148
|
-
] satisfies string[];
|
|
149
|
-
const parameterNames = ["self"];
|
|
150
|
-
return (tx: Transaction) =>
|
|
151
|
-
tx.moveCall({
|
|
152
|
-
package: packageAddress,
|
|
153
|
-
module: "storage",
|
|
154
|
-
function: "wal_treasury",
|
|
155
|
-
arguments: normalizeMoveArguments(
|
|
156
|
-
options.arguments,
|
|
157
|
-
argumentsTypes,
|
|
158
|
-
parameterNames,
|
|
159
|
-
),
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
export interface TierPriceArguments {
|
|
163
|
-
tier: RawTransactionArgument<string>;
|
|
164
|
-
}
|
|
165
|
-
export interface TierPriceOptions {
|
|
166
|
-
package?: string;
|
|
167
|
-
arguments: TierPriceArguments | [tier: RawTransactionArgument<string>];
|
|
168
|
-
}
|
|
169
|
-
export function tierPrice(options: TierPriceOptions) {
|
|
170
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
171
|
-
const argumentsTypes = [
|
|
172
|
-
`${packageAddress}::storage::StorageTier`,
|
|
173
|
-
] satisfies string[];
|
|
174
|
-
const parameterNames = ["tier"];
|
|
175
|
-
return (tx: Transaction) =>
|
|
176
|
-
tx.moveCall({
|
|
177
|
-
package: packageAddress,
|
|
178
|
-
module: "storage",
|
|
179
|
-
function: "tier_price",
|
|
180
|
-
arguments: normalizeMoveArguments(
|
|
181
|
-
options.arguments,
|
|
182
|
-
argumentsTypes,
|
|
183
|
-
parameterNames,
|
|
184
|
-
),
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
export interface TierDurationDaysArguments {
|
|
188
|
-
tier: RawTransactionArgument<string>;
|
|
189
|
-
}
|
|
190
|
-
export interface TierDurationDaysOptions {
|
|
191
|
-
package?: string;
|
|
192
|
-
arguments: TierDurationDaysArguments | [tier: RawTransactionArgument<string>];
|
|
193
|
-
}
|
|
194
|
-
export function tierDurationDays(options: TierDurationDaysOptions) {
|
|
195
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
196
|
-
const argumentsTypes = [
|
|
197
|
-
`${packageAddress}::storage::StorageTier`,
|
|
198
|
-
] satisfies string[];
|
|
199
|
-
const parameterNames = ["tier"];
|
|
200
|
-
return (tx: Transaction) =>
|
|
201
|
-
tx.moveCall({
|
|
202
|
-
package: packageAddress,
|
|
203
|
-
module: "storage",
|
|
204
|
-
function: "tier_duration_days",
|
|
205
|
-
arguments: normalizeMoveArguments(
|
|
206
|
-
options.arguments,
|
|
207
|
-
argumentsTypes,
|
|
208
|
-
parameterNames,
|
|
209
|
-
),
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
export interface TierDurationArguments {
|
|
213
|
-
tier: RawTransactionArgument<string>;
|
|
214
|
-
}
|
|
215
|
-
export interface TierDurationOptions {
|
|
216
|
-
package?: string;
|
|
217
|
-
arguments: TierDurationArguments | [tier: RawTransactionArgument<string>];
|
|
218
|
-
}
|
|
219
|
-
export function tierDuration(options: TierDurationOptions) {
|
|
220
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
221
|
-
const argumentsTypes = [
|
|
222
|
-
`${packageAddress}::storage::StorageTier`,
|
|
223
|
-
] satisfies string[];
|
|
224
|
-
const parameterNames = ["tier"];
|
|
225
|
-
return (tx: Transaction) =>
|
|
226
|
-
tx.moveCall({
|
|
227
|
-
package: packageAddress,
|
|
228
|
-
module: "storage",
|
|
229
|
-
function: "tier_duration",
|
|
230
|
-
arguments: normalizeMoveArguments(
|
|
231
|
-
options.arguments,
|
|
232
|
-
argumentsTypes,
|
|
233
|
-
parameterNames,
|
|
234
|
-
),
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
export interface TierStorageLimitArguments {
|
|
238
|
-
tier: RawTransactionArgument<string>;
|
|
239
|
-
}
|
|
240
|
-
export interface TierStorageLimitOptions {
|
|
241
|
-
package?: string;
|
|
242
|
-
arguments: TierStorageLimitArguments | [tier: RawTransactionArgument<string>];
|
|
243
|
-
}
|
|
244
|
-
export function tierStorageLimit(options: TierStorageLimitOptions) {
|
|
245
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
246
|
-
const argumentsTypes = [
|
|
247
|
-
`${packageAddress}::storage::StorageTier`,
|
|
248
|
-
] satisfies string[];
|
|
249
|
-
const parameterNames = ["tier"];
|
|
250
|
-
return (tx: Transaction) =>
|
|
251
|
-
tx.moveCall({
|
|
252
|
-
package: packageAddress,
|
|
253
|
-
module: "storage",
|
|
254
|
-
function: "tier_storage_limit",
|
|
255
|
-
arguments: normalizeMoveArguments(
|
|
256
|
-
options.arguments,
|
|
257
|
-
argumentsTypes,
|
|
258
|
-
parameterNames,
|
|
259
|
-
),
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
export interface StorageLimitArguments {
|
|
263
|
-
self: RawTransactionArgument<string>;
|
|
264
|
-
storageSpace: RawTransactionArgument<string>;
|
|
265
|
-
}
|
|
266
|
-
export interface StorageLimitOptions {
|
|
267
|
-
package?: string;
|
|
268
|
-
arguments:
|
|
269
|
-
| StorageLimitArguments
|
|
270
|
-
| [
|
|
271
|
-
self: RawTransactionArgument<string>,
|
|
272
|
-
storageSpace: RawTransactionArgument<string>,
|
|
273
|
-
];
|
|
274
|
-
}
|
|
275
|
-
export function storageLimit(options: StorageLimitOptions) {
|
|
276
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
277
|
-
const argumentsTypes = [
|
|
278
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
279
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
280
|
-
] satisfies string[];
|
|
281
|
-
const parameterNames = ["self", "storageSpace"];
|
|
282
|
-
return (tx: Transaction) =>
|
|
283
|
-
tx.moveCall({
|
|
284
|
-
package: packageAddress,
|
|
285
|
-
module: "storage",
|
|
286
|
-
function: "storage_limit",
|
|
287
|
-
arguments: normalizeMoveArguments(
|
|
288
|
-
options.arguments,
|
|
289
|
-
argumentsTypes,
|
|
290
|
-
parameterNames,
|
|
291
|
-
),
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
export interface OwnerArguments {
|
|
295
|
-
storageSpace: RawTransactionArgument<string>;
|
|
296
|
-
}
|
|
297
|
-
export interface OwnerOptions {
|
|
298
|
-
package?: string;
|
|
299
|
-
arguments: OwnerArguments | [storageSpace: RawTransactionArgument<string>];
|
|
300
|
-
}
|
|
301
|
-
export function owner(options: OwnerOptions) {
|
|
302
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
303
|
-
const argumentsTypes = [
|
|
304
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
305
|
-
] satisfies string[];
|
|
306
|
-
const parameterNames = ["storageSpace"];
|
|
307
|
-
return (tx: Transaction) =>
|
|
308
|
-
tx.moveCall({
|
|
309
|
-
package: packageAddress,
|
|
310
|
-
module: "storage",
|
|
311
|
-
function: "owner",
|
|
312
|
-
arguments: normalizeMoveArguments(
|
|
313
|
-
options.arguments,
|
|
314
|
-
argumentsTypes,
|
|
315
|
-
parameterNames,
|
|
316
|
-
),
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
export interface TierArguments {
|
|
320
|
-
storageSpace: RawTransactionArgument<string>;
|
|
321
|
-
}
|
|
322
|
-
export interface TierOptions {
|
|
323
|
-
package?: string;
|
|
324
|
-
arguments: TierArguments | [storageSpace: RawTransactionArgument<string>];
|
|
325
|
-
}
|
|
326
|
-
export function tier(options: TierOptions) {
|
|
327
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
328
|
-
const argumentsTypes = [
|
|
329
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
330
|
-
] satisfies string[];
|
|
331
|
-
const parameterNames = ["storageSpace"];
|
|
332
|
-
return (tx: Transaction) =>
|
|
333
|
-
tx.moveCall({
|
|
334
|
-
package: packageAddress,
|
|
335
|
-
module: "storage",
|
|
336
|
-
function: "tier",
|
|
337
|
-
arguments: normalizeMoveArguments(
|
|
338
|
-
options.arguments,
|
|
339
|
-
argumentsTypes,
|
|
340
|
-
parameterNames,
|
|
341
|
-
),
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
export interface StorageUsedArguments {
|
|
345
|
-
storageSpace: RawTransactionArgument<string>;
|
|
346
|
-
}
|
|
347
|
-
export interface StorageUsedOptions {
|
|
348
|
-
package?: string;
|
|
349
|
-
arguments:
|
|
350
|
-
| StorageUsedArguments
|
|
351
|
-
| [storageSpace: RawTransactionArgument<string>];
|
|
352
|
-
}
|
|
353
|
-
/** Returns the storage limit for this storage space */
|
|
354
|
-
export function storageUsed(options: StorageUsedOptions) {
|
|
355
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
356
|
-
const argumentsTypes = [
|
|
357
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
358
|
-
] satisfies string[];
|
|
359
|
-
const parameterNames = ["storageSpace"];
|
|
360
|
-
return (tx: Transaction) =>
|
|
361
|
-
tx.moveCall({
|
|
362
|
-
package: packageAddress,
|
|
363
|
-
module: "storage",
|
|
364
|
-
function: "storage_used",
|
|
365
|
-
arguments: normalizeMoveArguments(
|
|
366
|
-
options.arguments,
|
|
367
|
-
argumentsTypes,
|
|
368
|
-
parameterNames,
|
|
369
|
-
),
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
export interface StorageUsedByEpochArguments {
|
|
373
|
-
storageSpace: RawTransactionArgument<string>;
|
|
374
|
-
epoch: RawTransactionArgument<number>;
|
|
375
|
-
}
|
|
376
|
-
export interface StorageUsedByEpochOptions {
|
|
377
|
-
package?: string;
|
|
378
|
-
arguments:
|
|
379
|
-
| StorageUsedByEpochArguments
|
|
380
|
-
| [
|
|
381
|
-
storageSpace: RawTransactionArgument<string>,
|
|
382
|
-
epoch: RawTransactionArgument<number>,
|
|
383
|
-
];
|
|
384
|
-
}
|
|
385
|
-
export function storageUsedByEpoch(options: StorageUsedByEpochOptions) {
|
|
386
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
387
|
-
const argumentsTypes = [
|
|
388
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
389
|
-
"u32",
|
|
390
|
-
] satisfies string[];
|
|
391
|
-
const parameterNames = ["storageSpace", "epoch"];
|
|
392
|
-
return (tx: Transaction) =>
|
|
393
|
-
tx.moveCall({
|
|
394
|
-
package: packageAddress,
|
|
395
|
-
module: "storage",
|
|
396
|
-
function: "storage_used_by_epoch",
|
|
397
|
-
arguments: normalizeMoveArguments(
|
|
398
|
-
options.arguments,
|
|
399
|
-
argumentsTypes,
|
|
400
|
-
parameterNames,
|
|
401
|
-
),
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
export interface CreditsArguments {
|
|
405
|
-
storageSpace: RawTransactionArgument<string>;
|
|
406
|
-
}
|
|
407
|
-
export interface CreditsOptions {
|
|
408
|
-
package?: string;
|
|
409
|
-
arguments: CreditsArguments | [storageSpace: RawTransactionArgument<string>];
|
|
410
|
-
}
|
|
411
|
-
export function credits(options: CreditsOptions) {
|
|
412
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
413
|
-
const argumentsTypes = [
|
|
414
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
415
|
-
] satisfies string[];
|
|
416
|
-
const parameterNames = ["storageSpace"];
|
|
417
|
-
return (tx: Transaction) =>
|
|
418
|
-
tx.moveCall({
|
|
419
|
-
package: packageAddress,
|
|
420
|
-
module: "storage",
|
|
421
|
-
function: "credits",
|
|
422
|
-
arguments: normalizeMoveArguments(
|
|
423
|
-
options.arguments,
|
|
424
|
-
argumentsTypes,
|
|
425
|
-
parameterNames,
|
|
426
|
-
),
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
export interface RemainingStorageArguments {
|
|
430
|
-
self: RawTransactionArgument<string>;
|
|
431
|
-
storageSpace: RawTransactionArgument<string>;
|
|
432
|
-
epoch: RawTransactionArgument<number>;
|
|
433
|
-
}
|
|
434
|
-
export interface RemainingStorageOptions {
|
|
435
|
-
package?: string;
|
|
436
|
-
arguments:
|
|
437
|
-
| RemainingStorageArguments
|
|
438
|
-
| [
|
|
439
|
-
self: RawTransactionArgument<string>,
|
|
440
|
-
storageSpace: RawTransactionArgument<string>,
|
|
441
|
-
epoch: RawTransactionArgument<number>,
|
|
442
|
-
];
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Calculates the remaining available storage capacity Returns 0 if already over
|
|
446
|
-
* limit (defensive programming)
|
|
447
|
-
*/
|
|
448
|
-
export function remainingStorage(options: RemainingStorageOptions) {
|
|
449
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
450
|
-
const argumentsTypes = [
|
|
451
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
452
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
453
|
-
"u32",
|
|
454
|
-
] satisfies string[];
|
|
455
|
-
const parameterNames = ["self", "storageSpace", "epoch"];
|
|
456
|
-
return (tx: Transaction) =>
|
|
457
|
-
tx.moveCall({
|
|
458
|
-
package: packageAddress,
|
|
459
|
-
module: "storage",
|
|
460
|
-
function: "remaining_storage",
|
|
461
|
-
arguments: normalizeMoveArguments(
|
|
462
|
-
options.arguments,
|
|
463
|
-
argumentsTypes,
|
|
464
|
-
parameterNames,
|
|
465
|
-
),
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
export interface UpdateTierPlanArguments {
|
|
469
|
-
self: RawTransactionArgument<string>;
|
|
470
|
-
Cap: RawTransactionArgument<string>;
|
|
471
|
-
tierIndex: RawTransactionArgument<number>;
|
|
472
|
-
price: RawTransactionArgument<number | bigint>;
|
|
473
|
-
durationDays: RawTransactionArgument<number>;
|
|
474
|
-
storageLimit: RawTransactionArgument<number | bigint>;
|
|
475
|
-
}
|
|
476
|
-
export interface UpdateTierPlanOptions {
|
|
477
|
-
package?: string;
|
|
478
|
-
arguments:
|
|
479
|
-
| UpdateTierPlanArguments
|
|
480
|
-
| [
|
|
481
|
-
self: RawTransactionArgument<string>,
|
|
482
|
-
Cap: RawTransactionArgument<string>,
|
|
483
|
-
tierIndex: RawTransactionArgument<number>,
|
|
484
|
-
price: RawTransactionArgument<number | bigint>,
|
|
485
|
-
durationDays: RawTransactionArgument<number>,
|
|
486
|
-
storageLimit: RawTransactionArgument<number | bigint>,
|
|
487
|
-
];
|
|
488
|
-
}
|
|
489
|
-
export function updateTierPlan(options: UpdateTierPlanOptions) {
|
|
490
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
491
|
-
const argumentsTypes = [
|
|
492
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
493
|
-
`${packageAddress}::admin::AdminCap`,
|
|
494
|
-
"u8",
|
|
495
|
-
"u64",
|
|
496
|
-
"u16",
|
|
497
|
-
"u64",
|
|
498
|
-
] satisfies string[];
|
|
499
|
-
const parameterNames = [
|
|
500
|
-
"self",
|
|
501
|
-
"Cap",
|
|
502
|
-
"tierIndex",
|
|
503
|
-
"price",
|
|
504
|
-
"durationDays",
|
|
505
|
-
"storageLimit",
|
|
506
|
-
];
|
|
507
|
-
return (tx: Transaction) =>
|
|
508
|
-
tx.moveCall({
|
|
509
|
-
package: packageAddress,
|
|
510
|
-
module: "storage",
|
|
511
|
-
function: "update_tier_plan",
|
|
512
|
-
arguments: normalizeMoveArguments(
|
|
513
|
-
options.arguments,
|
|
514
|
-
argumentsTypes,
|
|
515
|
-
parameterNames,
|
|
516
|
-
),
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
export interface RemoveStorageByAdminArguments {
|
|
520
|
-
self: RawTransactionArgument<string>;
|
|
521
|
-
walrusSystem: RawTransactionArgument<string>;
|
|
522
|
-
Cap: RawTransactionArgument<string>;
|
|
523
|
-
epoch: RawTransactionArgument<number>;
|
|
524
|
-
splitSize: RawTransactionArgument<number | bigint>;
|
|
525
|
-
}
|
|
526
|
-
export interface RemoveStorageByAdminOptions {
|
|
527
|
-
package?: string;
|
|
528
|
-
arguments:
|
|
529
|
-
| RemoveStorageByAdminArguments
|
|
530
|
-
| [
|
|
531
|
-
self: RawTransactionArgument<string>,
|
|
532
|
-
walrusSystem: RawTransactionArgument<string>,
|
|
533
|
-
Cap: RawTransactionArgument<string>,
|
|
534
|
-
epoch: RawTransactionArgument<number>,
|
|
535
|
-
splitSize: RawTransactionArgument<number | bigint>,
|
|
536
|
-
];
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Admin function to remove storage from treasury for a specific epoch Requires
|
|
540
|
-
* AdminCap to ensure only authorized users can call this Returns the requested
|
|
541
|
-
* storage amount, splitting if necessary
|
|
542
|
-
*/
|
|
543
|
-
export function removeStorageByAdmin(options: RemoveStorageByAdminOptions) {
|
|
544
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
545
|
-
const argumentsTypes = [
|
|
546
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
547
|
-
`${packageAddress}::system::System`,
|
|
548
|
-
`${packageAddress}::admin::AdminCap`,
|
|
549
|
-
"u32",
|
|
550
|
-
"u64",
|
|
551
|
-
] satisfies string[];
|
|
552
|
-
const parameterNames = ["self", "walrusSystem", "Cap", "epoch", "splitSize"];
|
|
553
|
-
return (tx: Transaction) =>
|
|
554
|
-
tx.moveCall({
|
|
555
|
-
package: packageAddress,
|
|
556
|
-
module: "storage",
|
|
557
|
-
function: "remove_storage_by_admin",
|
|
558
|
-
arguments: normalizeMoveArguments(
|
|
559
|
-
options.arguments,
|
|
560
|
-
argumentsTypes,
|
|
561
|
-
parameterNames,
|
|
562
|
-
),
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
export interface ShareStorageSpaceArguments {
|
|
566
|
-
storageSpace: RawTransactionArgument<string>;
|
|
567
|
-
}
|
|
568
|
-
export interface ShareStorageSpaceOptions {
|
|
569
|
-
package?: string;
|
|
570
|
-
arguments:
|
|
571
|
-
| ShareStorageSpaceArguments
|
|
572
|
-
| [storageSpace: RawTransactionArgument<string>];
|
|
573
|
-
}
|
|
574
|
-
export function shareStorageSpace(options: ShareStorageSpaceOptions) {
|
|
575
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
576
|
-
const argumentsTypes = [
|
|
577
|
-
`${packageAddress}::storage::StorageSpace`,
|
|
578
|
-
] satisfies string[];
|
|
579
|
-
const parameterNames = ["storageSpace"];
|
|
580
|
-
return (tx: Transaction) =>
|
|
581
|
-
tx.moveCall({
|
|
582
|
-
package: packageAddress,
|
|
583
|
-
module: "storage",
|
|
584
|
-
function: "share_storage_space",
|
|
585
|
-
arguments: normalizeMoveArguments(
|
|
586
|
-
options.arguments,
|
|
587
|
-
argumentsTypes,
|
|
588
|
-
parameterNames,
|
|
589
|
-
),
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
export interface FundWalTreasuryArguments {
|
|
593
|
-
self: RawTransactionArgument<string>;
|
|
594
|
-
config: RawTransactionArgument<string>;
|
|
595
|
-
coin: RawTransactionArgument<string>;
|
|
596
|
-
}
|
|
597
|
-
export interface FundWalTreasuryOptions {
|
|
598
|
-
package?: string;
|
|
599
|
-
arguments:
|
|
600
|
-
| FundWalTreasuryArguments
|
|
601
|
-
| [
|
|
602
|
-
self: RawTransactionArgument<string>,
|
|
603
|
-
config: RawTransactionArgument<string>,
|
|
604
|
-
coin: RawTransactionArgument<string>,
|
|
605
|
-
];
|
|
606
|
-
}
|
|
607
|
-
export function fundWalTreasury(options: FundWalTreasuryOptions) {
|
|
608
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
609
|
-
const argumentsTypes = [
|
|
610
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
611
|
-
`${packageAddress}::config::Config`,
|
|
612
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${packageAddress}::wal::WAL>`,
|
|
613
|
-
] satisfies string[];
|
|
614
|
-
const parameterNames = ["self", "config", "coin"];
|
|
615
|
-
return (tx: Transaction) =>
|
|
616
|
-
tx.moveCall({
|
|
617
|
-
package: packageAddress,
|
|
618
|
-
module: "storage",
|
|
619
|
-
function: "fund_wal_treasury",
|
|
620
|
-
arguments: normalizeMoveArguments(
|
|
621
|
-
options.arguments,
|
|
622
|
-
argumentsTypes,
|
|
623
|
-
parameterNames,
|
|
624
|
-
),
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
export interface AddStorageToTreasuryArguments {
|
|
628
|
-
self: RawTransactionArgument<string>;
|
|
629
|
-
config: RawTransactionArgument<string>;
|
|
630
|
-
walrusSystem: RawTransactionArgument<string>;
|
|
631
|
-
storage: RawTransactionArgument<string>;
|
|
632
|
-
}
|
|
633
|
-
export interface AddStorageToTreasuryOptions {
|
|
634
|
-
package?: string;
|
|
635
|
-
arguments:
|
|
636
|
-
| AddStorageToTreasuryArguments
|
|
637
|
-
| [
|
|
638
|
-
self: RawTransactionArgument<string>,
|
|
639
|
-
config: RawTransactionArgument<string>,
|
|
640
|
-
walrusSystem: RawTransactionArgument<string>,
|
|
641
|
-
storage: RawTransactionArgument<string>,
|
|
642
|
-
];
|
|
643
|
-
}
|
|
644
|
-
export function addStorageToTreasury(options: AddStorageToTreasuryOptions) {
|
|
645
|
-
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
646
|
-
const argumentsTypes = [
|
|
647
|
-
`${packageAddress}::storage::StorageTreasury`,
|
|
648
|
-
`${packageAddress}::config::Config`,
|
|
649
|
-
`${packageAddress}::system::System`,
|
|
650
|
-
`${packageAddress}::storage_resource::Storage`,
|
|
651
|
-
] satisfies string[];
|
|
652
|
-
const parameterNames = ["self", "config", "walrusSystem", "storage"];
|
|
653
|
-
return (tx: Transaction) =>
|
|
654
|
-
tx.moveCall({
|
|
655
|
-
package: packageAddress,
|
|
656
|
-
module: "storage",
|
|
657
|
-
function: "add_storage_to_treasury",
|
|
658
|
-
arguments: normalizeMoveArguments(
|
|
659
|
-
options.arguments,
|
|
660
|
-
argumentsTypes,
|
|
661
|
-
parameterNames,
|
|
662
|
-
),
|
|
663
|
-
});
|
|
664
|
-
}
|