@zing-protocol/zing-sdk 0.0.1 → 0.0.2
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 +14 -6
- 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,153 @@
|
|
|
1
|
+
import { MoveStruct } from "../utils/index.js";
|
|
2
|
+
import type { RawTransactionArgument } from "../utils/index.js";
|
|
3
|
+
import type { BcsType } from "@mysten/sui/bcs";
|
|
4
|
+
import type { Transaction } from "@mysten/sui/transactions";
|
|
5
|
+
export declare const DerivedTable: MoveStruct<{
|
|
6
|
+
/** the ID of this table */
|
|
7
|
+
id: MoveStruct<{
|
|
8
|
+
id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
9
|
+
}, "0x2::object::UID">;
|
|
10
|
+
/** the number of key-value pairs in the table */
|
|
11
|
+
size: BcsType<string, string | number | bigint, "u64">;
|
|
12
|
+
}, "@local-pkg/zing_framework::derived_table::DerivedTable">;
|
|
13
|
+
export interface NewArguments<DerivedObjectKey extends BcsType<any>> {
|
|
14
|
+
parent: RawTransactionArgument<string>;
|
|
15
|
+
key: RawTransactionArgument<DerivedObjectKey>;
|
|
16
|
+
}
|
|
17
|
+
export interface NewOptions<DerivedObjectKey extends BcsType<any>> {
|
|
18
|
+
package?: string;
|
|
19
|
+
arguments: NewArguments<DerivedObjectKey> | [
|
|
20
|
+
parent: RawTransactionArgument<string>,
|
|
21
|
+
key: RawTransactionArgument<DerivedObjectKey>
|
|
22
|
+
];
|
|
23
|
+
typeArguments: [string, string, string];
|
|
24
|
+
}
|
|
25
|
+
/** Creates a new, empty table */
|
|
26
|
+
export declare function _new<DerivedObjectKey extends BcsType<any>>(options: NewOptions<DerivedObjectKey>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
27
|
+
export interface AddArguments<K extends BcsType<any>, V extends BcsType<any>> {
|
|
28
|
+
table: RawTransactionArgument<string>;
|
|
29
|
+
k: RawTransactionArgument<K>;
|
|
30
|
+
v: RawTransactionArgument<V>;
|
|
31
|
+
}
|
|
32
|
+
export interface AddOptions<K extends BcsType<any>, V extends BcsType<any>> {
|
|
33
|
+
package?: string;
|
|
34
|
+
arguments: AddArguments<K, V> | [
|
|
35
|
+
table: RawTransactionArgument<string>,
|
|
36
|
+
k: RawTransactionArgument<K>,
|
|
37
|
+
v: RawTransactionArgument<V>
|
|
38
|
+
];
|
|
39
|
+
typeArguments: [string, string];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Adds a key-value pair to the table `table: &mut DerivedTable<K, V>` Aborts with
|
|
43
|
+
* `sui::dynamic_field::EFieldAlreadyExists` if the table already has an entry with
|
|
44
|
+
* that key `k: K`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function add<K extends BcsType<any>, V extends BcsType<any>>(options: AddOptions<K, V>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
47
|
+
export interface BorrowArguments<K extends BcsType<any>> {
|
|
48
|
+
table: RawTransactionArgument<string>;
|
|
49
|
+
k: RawTransactionArgument<K>;
|
|
50
|
+
}
|
|
51
|
+
export interface BorrowOptions<K extends BcsType<any>> {
|
|
52
|
+
package?: string;
|
|
53
|
+
arguments: BorrowArguments<K> | [table: RawTransactionArgument<string>, k: RawTransactionArgument<K>];
|
|
54
|
+
typeArguments: [string, string];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Immutable borrows the value associated with the key in the table
|
|
58
|
+
* `table: &DerivedTable<K, V>`. Aborts with
|
|
59
|
+
* `sui::dynamic_field::EFieldDoesNotExist` if the table does not have an entry
|
|
60
|
+
* with that key `k: K`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function borrow<K extends BcsType<any>>(options: BorrowOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
63
|
+
export interface BorrowMutArguments<K extends BcsType<any>> {
|
|
64
|
+
table: RawTransactionArgument<string>;
|
|
65
|
+
k: RawTransactionArgument<K>;
|
|
66
|
+
}
|
|
67
|
+
export interface BorrowMutOptions<K extends BcsType<any>> {
|
|
68
|
+
package?: string;
|
|
69
|
+
arguments: BorrowMutArguments<K> | [table: RawTransactionArgument<string>, k: RawTransactionArgument<K>];
|
|
70
|
+
typeArguments: [string, string];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Mutably borrows the value associated with the key in the table
|
|
74
|
+
* `table: &mut DerivedTable<K, V>`. Aborts with
|
|
75
|
+
* `sui::dynamic_field::EFieldDoesNotExist` if the table does not have an entry
|
|
76
|
+
* with that key `k: K`.
|
|
77
|
+
*/
|
|
78
|
+
export declare function borrowMut<K extends BcsType<any>>(options: BorrowMutOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
79
|
+
export interface RemoveArguments<K extends BcsType<any>> {
|
|
80
|
+
table: RawTransactionArgument<string>;
|
|
81
|
+
k: RawTransactionArgument<K>;
|
|
82
|
+
}
|
|
83
|
+
export interface RemoveOptions<K extends BcsType<any>> {
|
|
84
|
+
package?: string;
|
|
85
|
+
arguments: RemoveArguments<K> | [table: RawTransactionArgument<string>, k: RawTransactionArgument<K>];
|
|
86
|
+
typeArguments: [string, string];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Removes the key-value pair in the table `table: &mut DerivedTable<K, V>` and
|
|
90
|
+
* returns the value. Aborts with `sui::dynamic_field::EFieldDoesNotExist` if the
|
|
91
|
+
* table does not have an entry with that key `k: K`.
|
|
92
|
+
*/
|
|
93
|
+
export declare function remove<K extends BcsType<any>>(options: RemoveOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
94
|
+
export interface ContainsArguments<K extends BcsType<any>> {
|
|
95
|
+
table: RawTransactionArgument<string>;
|
|
96
|
+
k: RawTransactionArgument<K>;
|
|
97
|
+
}
|
|
98
|
+
export interface ContainsOptions<K extends BcsType<any>> {
|
|
99
|
+
package?: string;
|
|
100
|
+
arguments: ContainsArguments<K> | [table: RawTransactionArgument<string>, k: RawTransactionArgument<K>];
|
|
101
|
+
typeArguments: [string, string];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Returns true if there is a value associated with the key `k: K` in table
|
|
105
|
+
* `table: &DerivedTable<K, V>`
|
|
106
|
+
*/
|
|
107
|
+
export declare function contains<K extends BcsType<any>>(options: ContainsOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
108
|
+
export interface LengthArguments {
|
|
109
|
+
table: RawTransactionArgument<string>;
|
|
110
|
+
}
|
|
111
|
+
export interface LengthOptions {
|
|
112
|
+
package?: string;
|
|
113
|
+
arguments: LengthArguments | [table: RawTransactionArgument<string>];
|
|
114
|
+
typeArguments: [string, string];
|
|
115
|
+
}
|
|
116
|
+
/** Returns the size of the table, the number of key-value pairs */
|
|
117
|
+
export declare function length(options: LengthOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
118
|
+
export interface IsEmptyArguments {
|
|
119
|
+
table: RawTransactionArgument<string>;
|
|
120
|
+
}
|
|
121
|
+
export interface IsEmptyOptions {
|
|
122
|
+
package?: string;
|
|
123
|
+
arguments: IsEmptyArguments | [table: RawTransactionArgument<string>];
|
|
124
|
+
typeArguments: [string, string];
|
|
125
|
+
}
|
|
126
|
+
/** Returns true if the table is empty (if `length` returns `0`) */
|
|
127
|
+
export declare function isEmpty(options: IsEmptyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
128
|
+
export interface DestroyEmptyArguments {
|
|
129
|
+
table: RawTransactionArgument<string>;
|
|
130
|
+
}
|
|
131
|
+
export interface DestroyEmptyOptions {
|
|
132
|
+
package?: string;
|
|
133
|
+
arguments: DestroyEmptyArguments | [table: RawTransactionArgument<string>];
|
|
134
|
+
typeArguments: [string, string];
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Destroys an empty table Aborts with `EDerivedTableNotEmpty` if the table still
|
|
138
|
+
* contains values
|
|
139
|
+
*/
|
|
140
|
+
export declare function destroyEmpty(options: DestroyEmptyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
141
|
+
export interface DropArguments {
|
|
142
|
+
table: RawTransactionArgument<string>;
|
|
143
|
+
}
|
|
144
|
+
export interface DropOptions {
|
|
145
|
+
package?: string;
|
|
146
|
+
arguments: DropArguments | [table: RawTransactionArgument<string>];
|
|
147
|
+
typeArguments: [string, string];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Drop a possibly non-empty table. Usable only if the value type `V` has the
|
|
151
|
+
* `drop` ability
|
|
152
|
+
*/
|
|
153
|
+
export declare function drop(options: DropOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import * as object from "./deps/sui/object.js";
|
|
5
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
6
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
7
|
+
const $moduleName = "@local-pkg/zing_framework::derived_table";
|
|
8
|
+
export const DerivedTable = new MoveStruct({
|
|
9
|
+
name: `${$moduleName}::DerivedTable`,
|
|
10
|
+
fields: {
|
|
11
|
+
/** the ID of this table */
|
|
12
|
+
id: object.UID,
|
|
13
|
+
/** the number of key-value pairs in the table */
|
|
14
|
+
size: bcs.u64(),
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
/** Creates a new, empty table */
|
|
18
|
+
export function _new(options) {
|
|
19
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
20
|
+
const argumentsTypes = [
|
|
21
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::object::UID",
|
|
22
|
+
`${options.typeArguments[0]}`,
|
|
23
|
+
];
|
|
24
|
+
const parameterNames = ["parent", "key"];
|
|
25
|
+
return (tx) => tx.moveCall({
|
|
26
|
+
package: packageAddress,
|
|
27
|
+
module: "derived_table",
|
|
28
|
+
function: "new",
|
|
29
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
30
|
+
typeArguments: options.typeArguments,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Adds a key-value pair to the table `table: &mut DerivedTable<K, V>` Aborts with
|
|
35
|
+
* `sui::dynamic_field::EFieldAlreadyExists` if the table already has an entry with
|
|
36
|
+
* that key `k: K`.
|
|
37
|
+
*/
|
|
38
|
+
export function add(options) {
|
|
39
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
40
|
+
const argumentsTypes = [
|
|
41
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
42
|
+
`${options.typeArguments[0]}`,
|
|
43
|
+
`${options.typeArguments[1]}`,
|
|
44
|
+
];
|
|
45
|
+
const parameterNames = ["table", "k", "v"];
|
|
46
|
+
return (tx) => tx.moveCall({
|
|
47
|
+
package: packageAddress,
|
|
48
|
+
module: "derived_table",
|
|
49
|
+
function: "add",
|
|
50
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
51
|
+
typeArguments: options.typeArguments,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Immutable borrows the value associated with the key in the table
|
|
56
|
+
* `table: &DerivedTable<K, V>`. Aborts with
|
|
57
|
+
* `sui::dynamic_field::EFieldDoesNotExist` if the table does not have an entry
|
|
58
|
+
* with that key `k: K`.
|
|
59
|
+
*/
|
|
60
|
+
export function borrow(options) {
|
|
61
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
62
|
+
const argumentsTypes = [
|
|
63
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
64
|
+
`${options.typeArguments[0]}`,
|
|
65
|
+
];
|
|
66
|
+
const parameterNames = ["table", "k"];
|
|
67
|
+
return (tx) => tx.moveCall({
|
|
68
|
+
package: packageAddress,
|
|
69
|
+
module: "derived_table",
|
|
70
|
+
function: "borrow",
|
|
71
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
72
|
+
typeArguments: options.typeArguments,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Mutably borrows the value associated with the key in the table
|
|
77
|
+
* `table: &mut DerivedTable<K, V>`. Aborts with
|
|
78
|
+
* `sui::dynamic_field::EFieldDoesNotExist` if the table does not have an entry
|
|
79
|
+
* with that key `k: K`.
|
|
80
|
+
*/
|
|
81
|
+
export function borrowMut(options) {
|
|
82
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
83
|
+
const argumentsTypes = [
|
|
84
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
85
|
+
`${options.typeArguments[0]}`,
|
|
86
|
+
];
|
|
87
|
+
const parameterNames = ["table", "k"];
|
|
88
|
+
return (tx) => tx.moveCall({
|
|
89
|
+
package: packageAddress,
|
|
90
|
+
module: "derived_table",
|
|
91
|
+
function: "borrow_mut",
|
|
92
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
93
|
+
typeArguments: options.typeArguments,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Removes the key-value pair in the table `table: &mut DerivedTable<K, V>` and
|
|
98
|
+
* returns the value. Aborts with `sui::dynamic_field::EFieldDoesNotExist` if the
|
|
99
|
+
* table does not have an entry with that key `k: K`.
|
|
100
|
+
*/
|
|
101
|
+
export function remove(options) {
|
|
102
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
103
|
+
const argumentsTypes = [
|
|
104
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
105
|
+
`${options.typeArguments[0]}`,
|
|
106
|
+
];
|
|
107
|
+
const parameterNames = ["table", "k"];
|
|
108
|
+
return (tx) => tx.moveCall({
|
|
109
|
+
package: packageAddress,
|
|
110
|
+
module: "derived_table",
|
|
111
|
+
function: "remove",
|
|
112
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
113
|
+
typeArguments: options.typeArguments,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Returns true if there is a value associated with the key `k: K` in table
|
|
118
|
+
* `table: &DerivedTable<K, V>`
|
|
119
|
+
*/
|
|
120
|
+
export function contains(options) {
|
|
121
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
122
|
+
const argumentsTypes = [
|
|
123
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
124
|
+
`${options.typeArguments[0]}`,
|
|
125
|
+
];
|
|
126
|
+
const parameterNames = ["table", "k"];
|
|
127
|
+
return (tx) => tx.moveCall({
|
|
128
|
+
package: packageAddress,
|
|
129
|
+
module: "derived_table",
|
|
130
|
+
function: "contains",
|
|
131
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
132
|
+
typeArguments: options.typeArguments,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/** Returns the size of the table, the number of key-value pairs */
|
|
136
|
+
export function length(options) {
|
|
137
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
138
|
+
const argumentsTypes = [
|
|
139
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
140
|
+
];
|
|
141
|
+
const parameterNames = ["table"];
|
|
142
|
+
return (tx) => tx.moveCall({
|
|
143
|
+
package: packageAddress,
|
|
144
|
+
module: "derived_table",
|
|
145
|
+
function: "length",
|
|
146
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
147
|
+
typeArguments: options.typeArguments,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/** Returns true if the table is empty (if `length` returns `0`) */
|
|
151
|
+
export function isEmpty(options) {
|
|
152
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
153
|
+
const argumentsTypes = [
|
|
154
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
155
|
+
];
|
|
156
|
+
const parameterNames = ["table"];
|
|
157
|
+
return (tx) => tx.moveCall({
|
|
158
|
+
package: packageAddress,
|
|
159
|
+
module: "derived_table",
|
|
160
|
+
function: "is_empty",
|
|
161
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
162
|
+
typeArguments: options.typeArguments,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Destroys an empty table Aborts with `EDerivedTableNotEmpty` if the table still
|
|
167
|
+
* contains values
|
|
168
|
+
*/
|
|
169
|
+
export function destroyEmpty(options) {
|
|
170
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
171
|
+
const argumentsTypes = [
|
|
172
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
173
|
+
];
|
|
174
|
+
const parameterNames = ["table"];
|
|
175
|
+
return (tx) => tx.moveCall({
|
|
176
|
+
package: packageAddress,
|
|
177
|
+
module: "derived_table",
|
|
178
|
+
function: "destroy_empty",
|
|
179
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
180
|
+
typeArguments: options.typeArguments,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Drop a possibly non-empty table. Usable only if the value type `V` has the
|
|
185
|
+
* `drop` ability
|
|
186
|
+
*/
|
|
187
|
+
export function drop(options) {
|
|
188
|
+
const packageAddress = options.package ?? "@local-pkg/zing_framework";
|
|
189
|
+
const argumentsTypes = [
|
|
190
|
+
`${packageAddress}::derived_table::DerivedTable<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
191
|
+
];
|
|
192
|
+
const parameterNames = ["table"];
|
|
193
|
+
return (tx) => tx.moveCall({
|
|
194
|
+
package: packageAddress,
|
|
195
|
+
module: "derived_table",
|
|
196
|
+
function: "drop",
|
|
197
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
198
|
+
typeArguments: options.typeArguments,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 AdminCap: MoveStruct<{
|
|
5
|
+
id: MoveStruct<{
|
|
6
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
7
|
+
}, "0x2::object::UID">;
|
|
8
|
+
}, "@local-pkg/zing_governance::admin::AdminCap">;
|
|
9
|
+
export interface NewAdminCapArguments {
|
|
10
|
+
Cap: RawTransactionArgument<string>;
|
|
11
|
+
recipient: RawTransactionArgument<string>;
|
|
12
|
+
}
|
|
13
|
+
export interface NewAdminCapOptions {
|
|
14
|
+
package?: string;
|
|
15
|
+
arguments: NewAdminCapArguments | [
|
|
16
|
+
Cap: RawTransactionArgument<string>,
|
|
17
|
+
recipient: RawTransactionArgument<string>
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
export declare function newAdminCap(options: NewAdminCapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import * as object from "./deps/sui/object.js";
|
|
5
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
6
|
+
const $moduleName = "@local-pkg/zing_governance::admin";
|
|
7
|
+
export const AdminCap = new MoveStruct({
|
|
8
|
+
name: `${$moduleName}::AdminCap`,
|
|
9
|
+
fields: {
|
|
10
|
+
id: object.UID,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export function newAdminCap(options) {
|
|
14
|
+
const packageAddress = options.package ?? "@local-pkg/zing_governance";
|
|
15
|
+
const argumentsTypes = [
|
|
16
|
+
`${packageAddress}::admin::AdminCap`,
|
|
17
|
+
"address",
|
|
18
|
+
];
|
|
19
|
+
const parameterNames = ["Cap", "recipient"];
|
|
20
|
+
return (tx) => tx.moveCall({
|
|
21
|
+
package: packageAddress,
|
|
22
|
+
module: "admin",
|
|
23
|
+
function: "new_admin_cap",
|
|
24
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Sui object identifiers */
|
|
5
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
+
export declare const UID: MoveStruct<{
|
|
7
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
|
+
}, "0x2::object::UID">;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**************************************************************
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
|
-
|
|
5
4
|
/** Sui object identifiers */
|
|
6
|
-
|
|
7
5
|
import { MoveStruct } from "../../../utils/index.js";
|
|
8
6
|
import { bcs } from "@mysten/sui/bcs";
|
|
9
|
-
|
|
10
7
|
const $moduleName = "0x2::object";
|
|
11
8
|
export const UID = new MoveStruct({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
name: `${$moduleName}::UID`,
|
|
10
|
+
fields: {
|
|
11
|
+
id: bcs.Address,
|
|
12
|
+
},
|
|
16
13
|
});
|
|
@@ -0,0 +1,56 @@
|
|
|
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 TreasurySupplyEvent: MoveStruct<{
|
|
5
|
+
coin_type: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
6
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
7
|
+
}, "@local-pkg/zing_governance::treasury::TreasurySupplyEvent">;
|
|
8
|
+
export declare const TreasuryClaimEvent: MoveStruct<{
|
|
9
|
+
coin_type: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
10
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
11
|
+
}, "@local-pkg/zing_governance::treasury::TreasuryClaimEvent">;
|
|
12
|
+
export declare const BalanceKey: MoveStruct<{
|
|
13
|
+
dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
14
|
+
}, "@local-pkg/zing_governance::treasury::BalanceKey">;
|
|
15
|
+
export declare const Treasury: MoveStruct<{
|
|
16
|
+
id: MoveStruct<{
|
|
17
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
18
|
+
}, "0x2::object::UID">;
|
|
19
|
+
}, "@local-pkg/zing_governance::treasury::Treasury">;
|
|
20
|
+
export interface BalanceOfArguments {
|
|
21
|
+
self: RawTransactionArgument<string>;
|
|
22
|
+
}
|
|
23
|
+
export interface BalanceOfOptions {
|
|
24
|
+
package?: string;
|
|
25
|
+
arguments: BalanceOfArguments | [self: RawTransactionArgument<string>];
|
|
26
|
+
typeArguments: [string];
|
|
27
|
+
}
|
|
28
|
+
export declare function balanceOf(options: BalanceOfOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
29
|
+
export interface SupplyTreasuryArguments {
|
|
30
|
+
self: RawTransactionArgument<string>;
|
|
31
|
+
balance: RawTransactionArgument<string>;
|
|
32
|
+
}
|
|
33
|
+
export interface SupplyTreasuryOptions {
|
|
34
|
+
package?: string;
|
|
35
|
+
arguments: SupplyTreasuryArguments | [
|
|
36
|
+
self: RawTransactionArgument<string>,
|
|
37
|
+
balance: RawTransactionArgument<string>
|
|
38
|
+
];
|
|
39
|
+
typeArguments: [string];
|
|
40
|
+
}
|
|
41
|
+
export declare function supplyTreasury(options: SupplyTreasuryOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
42
|
+
export interface ClaimArguments {
|
|
43
|
+
self: RawTransactionArgument<string>;
|
|
44
|
+
Cap: RawTransactionArgument<string>;
|
|
45
|
+
value: RawTransactionArgument<number | bigint>;
|
|
46
|
+
}
|
|
47
|
+
export interface ClaimOptions {
|
|
48
|
+
package?: string;
|
|
49
|
+
arguments: ClaimArguments | [
|
|
50
|
+
self: RawTransactionArgument<string>,
|
|
51
|
+
Cap: RawTransactionArgument<string>,
|
|
52
|
+
value: RawTransactionArgument<number | bigint>
|
|
53
|
+
];
|
|
54
|
+
typeArguments: [string];
|
|
55
|
+
}
|
|
56
|
+
export declare function claim(options: ClaimOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import * as object from "./deps/sui/object.js";
|
|
5
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
6
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
7
|
+
const $moduleName = "@local-pkg/zing_governance::treasury";
|
|
8
|
+
export const TreasurySupplyEvent = new MoveStruct({
|
|
9
|
+
name: `${$moduleName}::TreasurySupplyEvent`,
|
|
10
|
+
fields: {
|
|
11
|
+
coin_type: bcs.string(),
|
|
12
|
+
value: bcs.u64(),
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export const TreasuryClaimEvent = new MoveStruct({
|
|
16
|
+
name: `${$moduleName}::TreasuryClaimEvent`,
|
|
17
|
+
fields: {
|
|
18
|
+
coin_type: bcs.string(),
|
|
19
|
+
value: bcs.u64(),
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
export const BalanceKey = new MoveStruct({
|
|
23
|
+
name: `${$moduleName}::BalanceKey`,
|
|
24
|
+
fields: {
|
|
25
|
+
dummy_field: bcs.bool(),
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const Treasury = new MoveStruct({
|
|
29
|
+
name: `${$moduleName}::Treasury`,
|
|
30
|
+
fields: {
|
|
31
|
+
id: object.UID,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export function balanceOf(options) {
|
|
35
|
+
const packageAddress = options.package ?? "@local-pkg/zing_governance";
|
|
36
|
+
const argumentsTypes = [
|
|
37
|
+
`${packageAddress}::treasury::Treasury`,
|
|
38
|
+
];
|
|
39
|
+
const parameterNames = ["self"];
|
|
40
|
+
return (tx) => tx.moveCall({
|
|
41
|
+
package: packageAddress,
|
|
42
|
+
module: "treasury",
|
|
43
|
+
function: "balance_of",
|
|
44
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
45
|
+
typeArguments: options.typeArguments,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function supplyTreasury(options) {
|
|
49
|
+
const packageAddress = options.package ?? "@local-pkg/zing_governance";
|
|
50
|
+
const argumentsTypes = [
|
|
51
|
+
`${packageAddress}::treasury::Treasury`,
|
|
52
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
53
|
+
];
|
|
54
|
+
const parameterNames = ["self", "balance"];
|
|
55
|
+
return (tx) => tx.moveCall({
|
|
56
|
+
package: packageAddress,
|
|
57
|
+
module: "treasury",
|
|
58
|
+
function: "supply_treasury",
|
|
59
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
60
|
+
typeArguments: options.typeArguments,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export function claim(options) {
|
|
64
|
+
const packageAddress = options.package ?? "@local-pkg/zing_governance";
|
|
65
|
+
const argumentsTypes = [
|
|
66
|
+
`${packageAddress}::treasury::Treasury`,
|
|
67
|
+
`${packageAddress}::admin::AdminCap`,
|
|
68
|
+
"u64",
|
|
69
|
+
];
|
|
70
|
+
const parameterNames = ["self", "Cap", "value"];
|
|
71
|
+
return (tx) => tx.moveCall({
|
|
72
|
+
package: packageAddress,
|
|
73
|
+
module: "treasury",
|
|
74
|
+
function: "claim",
|
|
75
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
76
|
+
typeArguments: options.typeArguments,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MoveStruct } from "../utils/index.js";
|
|
2
|
+
import type { RawTransactionArgument } from "../utils/index.js";
|
|
3
|
+
import type { Transaction } from "@mysten/sui/transactions";
|
|
4
|
+
export declare const Config: MoveStruct<{
|
|
5
|
+
id: MoveStruct<{
|
|
6
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
7
|
+
}, "0x2::object::UID">;
|
|
8
|
+
registry: MoveStruct<{
|
|
9
|
+
contents: import("@mysten/sui/bcs").BcsType<{
|
|
10
|
+
name: string;
|
|
11
|
+
}[], Iterable<{
|
|
12
|
+
name: string;
|
|
13
|
+
}> & {
|
|
14
|
+
length: number;
|
|
15
|
+
}, "vector<std::type_name::TypeName>">;
|
|
16
|
+
}, string>;
|
|
17
|
+
versions: MoveStruct<{
|
|
18
|
+
contents: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
19
|
+
length: number;
|
|
20
|
+
}, "vector<u64>">;
|
|
21
|
+
}, string>;
|
|
22
|
+
base_read_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
23
|
+
}, "@local-pkg/zing_identity::config::Config">;
|
|
24
|
+
export interface PackageVersionOptions {
|
|
25
|
+
package?: string;
|
|
26
|
+
arguments?: [];
|
|
27
|
+
}
|
|
28
|
+
export declare function packageVersion(options?: PackageVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
29
|
+
export interface BaseReadFeeArguments {
|
|
30
|
+
self: RawTransactionArgument<string>;
|
|
31
|
+
}
|
|
32
|
+
export interface BaseReadFeeOptions {
|
|
33
|
+
package?: string;
|
|
34
|
+
arguments: BaseReadFeeArguments | [self: RawTransactionArgument<string>];
|
|
35
|
+
}
|
|
36
|
+
export declare function baseReadFee(options: BaseReadFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
37
|
+
export interface AddVersionArguments {
|
|
38
|
+
self: RawTransactionArgument<string>;
|
|
39
|
+
Cap: RawTransactionArgument<string>;
|
|
40
|
+
version: RawTransactionArgument<number | bigint>;
|
|
41
|
+
}
|
|
42
|
+
export interface AddVersionOptions {
|
|
43
|
+
package?: string;
|
|
44
|
+
arguments: AddVersionArguments | [
|
|
45
|
+
self: RawTransactionArgument<string>,
|
|
46
|
+
Cap: RawTransactionArgument<string>,
|
|
47
|
+
version: RawTransactionArgument<number | bigint>
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
export declare function addVersion(options: AddVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
51
|
+
export interface RemoveVersionArguments {
|
|
52
|
+
self: RawTransactionArgument<string>;
|
|
53
|
+
Cap: RawTransactionArgument<string>;
|
|
54
|
+
version: RawTransactionArgument<number | bigint>;
|
|
55
|
+
}
|
|
56
|
+
export interface RemoveVersionOptions {
|
|
57
|
+
package?: string;
|
|
58
|
+
arguments: RemoveVersionArguments | [
|
|
59
|
+
self: RawTransactionArgument<string>,
|
|
60
|
+
Cap: RawTransactionArgument<string>,
|
|
61
|
+
version: RawTransactionArgument<number | bigint>
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
export declare function removeVersion(options: RemoveVersionOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
65
|
+
export interface UpdateReadFeeArguments {
|
|
66
|
+
self: RawTransactionArgument<string>;
|
|
67
|
+
Cap: RawTransactionArgument<string>;
|
|
68
|
+
fee: RawTransactionArgument<number | bigint>;
|
|
69
|
+
}
|
|
70
|
+
export interface UpdateReadFeeOptions {
|
|
71
|
+
package?: string;
|
|
72
|
+
arguments: UpdateReadFeeArguments | [
|
|
73
|
+
self: RawTransactionArgument<string>,
|
|
74
|
+
Cap: RawTransactionArgument<string>,
|
|
75
|
+
fee: RawTransactionArgument<number | bigint>
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
export declare function updateReadFee(options: UpdateReadFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
79
|
+
export interface DerivedObjectKeyArguments {
|
|
80
|
+
name: RawTransactionArgument<string>;
|
|
81
|
+
}
|
|
82
|
+
export interface DerivedObjectKeyOptions {
|
|
83
|
+
package?: string;
|
|
84
|
+
arguments: DerivedObjectKeyArguments | [name: RawTransactionArgument<string>];
|
|
85
|
+
typeArguments: [string];
|
|
86
|
+
}
|
|
87
|
+
export declare function derivedObjectKey(options: DerivedObjectKeyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|