@mysten/kiosk 0.14.6 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +114 -2
- package/dist/client/kiosk-client.d.mts +126 -0
- package/dist/client/kiosk-client.d.mts.map +1 -0
- package/dist/client/kiosk-client.mjs +124 -0
- package/dist/client/kiosk-client.mjs.map +1 -0
- package/dist/client/kiosk-transaction.d.mts +236 -0
- package/dist/client/kiosk-transaction.d.mts.map +1 -0
- package/dist/client/kiosk-transaction.mjs +472 -0
- package/dist/client/kiosk-transaction.mjs.map +1 -0
- package/dist/client/tp-transaction.d.mts +139 -0
- package/dist/client/tp-transaction.d.mts.map +1 -0
- package/dist/client/tp-transaction.mjs +273 -0
- package/dist/client/tp-transaction.mjs.map +1 -0
- package/dist/constants.d.mts +42 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +62 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/contracts/0x2/bag.mjs +19 -0
- package/dist/contracts/0x2/bag.mjs.map +1 -0
- package/dist/contracts/0x2/balance.mjs +20 -0
- package/dist/contracts/0x2/balance.mjs.map +1 -0
- package/dist/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +16 -0
- package/dist/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
- package/dist/contracts/0x2/kiosk.mjs +244 -0
- package/dist/contracts/0x2/kiosk.mjs.map +1 -0
- package/dist/contracts/0x2/kiosk_extension.mjs +25 -0
- package/dist/contracts/0x2/kiosk_extension.mjs.map +1 -0
- package/dist/contracts/0x2/transfer_policy.mjs +99 -0
- package/dist/contracts/0x2/transfer_policy.mjs.map +1 -0
- package/dist/contracts/0x2/vec_set.mjs +18 -0
- package/dist/contracts/0x2/vec_set.mjs.map +1 -0
- package/dist/contracts/kiosk/deps/sui/kiosk.mjs +98 -0
- package/dist/contracts/kiosk/deps/sui/kiosk.mjs.map +1 -0
- package/dist/contracts/kiosk/floor_price_rule.mjs +70 -0
- package/dist/contracts/kiosk/floor_price_rule.mjs.map +1 -0
- package/dist/contracts/kiosk/kiosk_lock_rule.mjs +72 -0
- package/dist/contracts/kiosk/kiosk_lock_rule.mjs.map +1 -0
- package/dist/contracts/kiosk/personal_kiosk.mjs +102 -0
- package/dist/contracts/kiosk/personal_kiosk.mjs.map +1 -0
- package/dist/contracts/kiosk/personal_kiosk_rule.mjs +66 -0
- package/dist/contracts/kiosk/personal_kiosk_rule.mjs.map +1 -0
- package/dist/contracts/kiosk/royalty_rule.mjs +115 -0
- package/dist/contracts/kiosk/royalty_rule.mjs.map +1 -0
- package/dist/contracts/utils/index.mjs +118 -0
- package/dist/contracts/utils/index.mjs.map +1 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +9 -0
- package/dist/query/client-utils.mjs +30 -0
- package/dist/query/client-utils.mjs.map +1 -0
- package/dist/query/kiosk.mjs +154 -0
- package/dist/query/kiosk.mjs.map +1 -0
- package/dist/query/transfer-policy.mjs +110 -0
- package/dist/query/transfer-policy.mjs.map +1 -0
- package/dist/tx/kiosk.mjs +20 -0
- package/dist/tx/kiosk.mjs.map +1 -0
- package/dist/tx/rules/resolve.mjs +114 -0
- package/dist/tx/rules/resolve.mjs.map +1 -0
- package/dist/tx/transfer-policy.mjs +38 -0
- package/dist/tx/transfer-policy.mjs.map +1 -0
- package/dist/types/index.d.mts +23 -0
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/kiosk.d.mts +165 -0
- package/dist/types/kiosk.d.mts.map +1 -0
- package/dist/types/kiosk.mjs +21 -0
- package/dist/types/kiosk.mjs.map +1 -0
- package/dist/types/transfer-policy.d.mts +56 -0
- package/dist/types/transfer-policy.d.mts.map +1 -0
- package/dist/types/transfer-policy.mjs +19 -0
- package/dist/types/transfer-policy.mjs.map +1 -0
- package/dist/utils.d.mts +45 -0
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.mjs +156 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +31 -20
- package/src/client/kiosk-client.ts +42 -5
- package/src/client/kiosk-transaction.ts +144 -65
- package/src/client/tp-transaction.ts +149 -95
- package/src/constants.ts +19 -24
- package/src/contracts/0x2/accumulator.ts +24 -0
- package/src/contracts/0x2/accumulator_metadata.ts +38 -0
- package/src/contracts/0x2/accumulator_settlement.ts +14 -0
- package/src/contracts/0x2/address.ts +145 -0
- package/src/contracts/0x2/address_alias.ts +92 -0
- package/src/contracts/0x2/authenticator_state.ts +44 -0
- package/src/contracts/0x2/bag.ts +192 -0
- package/src/contracts/0x2/balance.ts +269 -0
- package/src/contracts/0x2/bcs.ts +495 -0
- package/src/contracts/0x2/bls12381.ts +717 -0
- package/src/contracts/0x2/borrow.ts +99 -0
- package/src/contracts/0x2/clock.ts +30 -0
- package/src/contracts/0x2/coin.ts +977 -0
- package/src/contracts/0x2/coin_registry.ts +874 -0
- package/src/contracts/0x2/config.ts +30 -0
- package/src/contracts/0x2/deny_list.ts +55 -0
- package/src/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.ts +12 -0
- package/src/contracts/0x2/derived_object.ts +95 -0
- package/src/contracts/0x2/display.ts +258 -0
- package/src/contracts/0x2/dynamic_field.ts +171 -0
- package/src/contracts/0x2/dynamic_object_field.ts +167 -0
- package/src/contracts/0x2/ecdsa_k1.ts +65 -0
- package/src/contracts/0x2/ecdsa_r1.ts +49 -0
- package/src/contracts/0x2/ecvrf.ts +29 -0
- package/src/contracts/0x2/ed25519.ts +25 -0
- package/src/contracts/0x2/event.ts +42 -0
- package/src/contracts/0x2/funds_accumulator.ts +86 -0
- package/src/contracts/0x2/groth16.ts +171 -0
- package/src/contracts/0x2/group_ops.ts +49 -0
- package/src/contracts/0x2/hash.ts +37 -0
- package/src/contracts/0x2/hex.ts +37 -0
- package/src/contracts/0x2/hmac.ts +21 -0
- package/src/contracts/0x2/kiosk.ts +797 -0
- package/src/contracts/0x2/kiosk_extension.ts +270 -0
- package/src/contracts/0x2/linked_table.ts +354 -0
- package/src/contracts/0x2/math.ts +117 -0
- package/src/contracts/0x2/nitro_attestation.ts +186 -0
- package/src/contracts/0x2/object.ts +249 -0
- package/src/contracts/0x2/object_bag.ts +210 -0
- package/src/contracts/0x2/object_table.ts +200 -0
- package/src/contracts/0x2/package.ts +414 -0
- package/src/contracts/0x2/party.ts +37 -0
- package/src/contracts/0x2/pay.ts +153 -0
- package/src/contracts/0x2/poseidon.ts +21 -0
- package/src/contracts/0x2/priority_queue.ts +139 -0
- package/src/contracts/0x2/random.ts +294 -0
- package/src/contracts/0x2/sui.ts +29 -0
- package/src/contracts/0x2/table.ts +200 -0
- package/src/contracts/0x2/table_vec.ts +232 -0
- package/src/contracts/0x2/token.ts +873 -0
- package/src/contracts/0x2/transfer.ts +216 -0
- package/src/contracts/0x2/transfer_policy.ts +400 -0
- package/src/contracts/0x2/tx_context.ts +129 -0
- package/src/contracts/0x2/types.ts +24 -0
- package/src/contracts/0x2/url.ts +77 -0
- package/src/contracts/0x2/vdf.ts +45 -0
- package/src/contracts/0x2/vec_map.ts +401 -0
- package/src/contracts/0x2/vec_set.ts +211 -0
- package/src/contracts/0x2/versioned.ts +153 -0
- package/src/contracts/0x2/zklogin_verified_id.ts +172 -0
- package/src/contracts/0x2/zklogin_verified_issuer.ts +99 -0
- package/src/contracts/kiosk/deps/sui/kiosk.ts +94 -0
- package/src/contracts/kiosk/deps/sui/object.ts +15 -0
- package/src/contracts/kiosk/floor_price_rule.ts +92 -0
- package/src/contracts/kiosk/kiosk_lock_rule.ts +97 -0
- package/src/contracts/kiosk/personal_kiosk.ts +295 -0
- package/src/contracts/kiosk/personal_kiosk_rule.ts +89 -0
- package/src/contracts/kiosk/royalty_rule.ts +144 -0
- package/src/contracts/kiosk/witness_rule.ts +92 -0
- package/src/contracts/utils/index.ts +234 -0
- package/src/query/client-utils.ts +51 -0
- package/src/query/kiosk.ts +128 -100
- package/src/query/transfer-policy.ts +112 -78
- package/src/tx/kiosk.ts +7 -231
- package/src/tx/rules/resolve.ts +97 -48
- package/src/tx/transfer-policy.ts +25 -86
- package/src/types/index.ts +3 -14
- package/src/types/kiosk.ts +10 -12
- package/src/types/transfer-policy.ts +4 -4
- package/src/utils.ts +90 -128
- package/dist/cjs/bcs.d.ts +0 -23
- package/dist/cjs/bcs.js +0 -50
- package/dist/cjs/bcs.js.map +0 -7
- package/dist/cjs/client/kiosk-client.d.ts +0 -76
- package/dist/cjs/client/kiosk-client.js +0 -123
- package/dist/cjs/client/kiosk-client.js.map +0 -7
- package/dist/cjs/client/kiosk-transaction.d.ts +0 -186
- package/dist/cjs/client/kiosk-transaction.js +0 -462
- package/dist/cjs/client/kiosk-transaction.js.map +0 -7
- package/dist/cjs/client/tp-transaction.d.ts +0 -114
- package/dist/cjs/client/tp-transaction.js +0 -307
- package/dist/cjs/client/tp-transaction.js.map +0 -7
- package/dist/cjs/constants.d.ts +0 -31
- package/dist/cjs/constants.js +0 -102
- package/dist/cjs/constants.js.map +0 -7
- package/dist/cjs/index.d.ts +0 -6
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/package.json +0 -5
- package/dist/cjs/query/kiosk.d.ts +0 -8
- package/dist/cjs/query/kiosk.js +0 -181
- package/dist/cjs/query/kiosk.js.map +0 -7
- package/dist/cjs/query/transfer-policy.d.ts +0 -29
- package/dist/cjs/query/transfer-policy.js +0 -92
- package/dist/cjs/query/transfer-policy.js.map +0 -7
- package/dist/cjs/tx/kiosk.d.ts +0 -71
- package/dist/cjs/tx/kiosk.js +0 -130
- package/dist/cjs/tx/kiosk.js.map +0 -7
- package/dist/cjs/tx/personal-kiosk.d.ts +0 -7
- package/dist/cjs/tx/personal-kiosk.js +0 -38
- package/dist/cjs/tx/personal-kiosk.js.map +0 -7
- package/dist/cjs/tx/rules/attach.d.ts +0 -7
- package/dist/cjs/tx/rules/attach.js +0 -62
- package/dist/cjs/tx/rules/attach.js.map +0 -7
- package/dist/cjs/tx/rules/resolve.d.ts +0 -15
- package/dist/cjs/tx/rules/resolve.js +0 -109
- package/dist/cjs/tx/rules/resolve.js.map +0 -7
- package/dist/cjs/tx/transfer-policy.d.ts +0 -29
- package/dist/cjs/tx/transfer-policy.js +0 -78
- package/dist/cjs/tx/transfer-policy.js.map +0 -7
- package/dist/cjs/types/index.d.ts +0 -27
- package/dist/cjs/types/index.js +0 -33
- package/dist/cjs/types/index.js.map +0 -7
- package/dist/cjs/types/kiosk.d.ts +0 -160
- package/dist/cjs/types/kiosk.js +0 -37
- package/dist/cjs/types/kiosk.js.map +0 -7
- package/dist/cjs/types/transfer-policy.d.ts +0 -53
- package/dist/cjs/types/transfer-policy.js +0 -35
- package/dist/cjs/types/transfer-policy.js.map +0 -7
- package/dist/cjs/utils.d.ts +0 -51
- package/dist/cjs/utils.js +0 -198
- package/dist/cjs/utils.js.map +0 -7
- package/dist/esm/bcs.d.ts +0 -23
- package/dist/esm/bcs.js +0 -35
- package/dist/esm/bcs.js.map +0 -7
- package/dist/esm/client/kiosk-client.d.ts +0 -76
- package/dist/esm/client/kiosk-client.js +0 -114
- package/dist/esm/client/kiosk-client.js.map +0 -7
- package/dist/esm/client/kiosk-transaction.d.ts +0 -186
- package/dist/esm/client/kiosk-transaction.js +0 -432
- package/dist/esm/client/kiosk-transaction.js.map +0 -7
- package/dist/esm/client/tp-transaction.d.ts +0 -114
- package/dist/esm/client/tp-transaction.js +0 -298
- package/dist/esm/client/tp-transaction.js.map +0 -7
- package/dist/esm/constants.d.ts +0 -31
- package/dist/esm/constants.js +0 -87
- package/dist/esm/constants.js.map +0 -7
- package/dist/esm/index.d.ts +0 -6
- package/dist/esm/index.js +0 -7
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/package.json +0 -5
- package/dist/esm/query/kiosk.d.ts +0 -8
- package/dist/esm/query/kiosk.js +0 -169
- package/dist/esm/query/kiosk.js.map +0 -7
- package/dist/esm/query/transfer-policy.d.ts +0 -29
- package/dist/esm/query/transfer-policy.js +0 -76
- package/dist/esm/query/transfer-policy.js.map +0 -7
- package/dist/esm/tx/kiosk.d.ts +0 -71
- package/dist/esm/tx/kiosk.js +0 -110
- package/dist/esm/tx/kiosk.js.map +0 -7
- package/dist/esm/tx/personal-kiosk.d.ts +0 -7
- package/dist/esm/tx/personal-kiosk.js +0 -18
- package/dist/esm/tx/personal-kiosk.js.map +0 -7
- package/dist/esm/tx/rules/attach.d.ts +0 -7
- package/dist/esm/tx/rules/attach.js +0 -42
- package/dist/esm/tx/rules/attach.js.map +0 -7
- package/dist/esm/tx/rules/resolve.d.ts +0 -15
- package/dist/esm/tx/rules/resolve.js +0 -89
- package/dist/esm/tx/rules/resolve.js.map +0 -7
- package/dist/esm/tx/transfer-policy.d.ts +0 -29
- package/dist/esm/tx/transfer-policy.js +0 -58
- package/dist/esm/tx/transfer-policy.js.map +0 -7
- package/dist/esm/types/index.d.ts +0 -27
- package/dist/esm/types/index.js +0 -12
- package/dist/esm/types/index.js.map +0 -7
- package/dist/esm/types/kiosk.d.ts +0 -160
- package/dist/esm/types/kiosk.js +0 -17
- package/dist/esm/types/kiosk.js.map +0 -7
- package/dist/esm/types/transfer-policy.d.ts +0 -53
- package/dist/esm/types/transfer-policy.js +0 -15
- package/dist/esm/types/transfer-policy.js.map +0 -7
- package/dist/esm/utils.d.ts +0 -51
- package/dist/esm/utils.js +0 -183
- package/dist/esm/utils.js.map +0 -7
- package/dist/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/bcs.ts +0 -39
- package/src/tx/personal-kiosk.ts +0 -34
- package/src/tx/rules/attach.ts +0 -73
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.mjs";
|
|
2
|
+
import { Balance } from "./balance.mjs";
|
|
3
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
4
|
+
|
|
5
|
+
//#region src/contracts/0x2/kiosk.ts
|
|
6
|
+
/**************************************************************
|
|
7
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
8
|
+
**************************************************************/
|
|
9
|
+
const $moduleName = "0x2::kiosk";
|
|
10
|
+
const Kiosk = new MoveStruct({
|
|
11
|
+
name: `${$moduleName}::Kiosk`,
|
|
12
|
+
fields: {
|
|
13
|
+
id: bcs.Address,
|
|
14
|
+
profits: Balance,
|
|
15
|
+
owner: bcs.Address,
|
|
16
|
+
item_count: bcs.u32(),
|
|
17
|
+
allow_extensions: bcs.bool()
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const KioskOwnerCap = new MoveStruct({
|
|
21
|
+
name: `${$moduleName}::KioskOwnerCap`,
|
|
22
|
+
fields: {
|
|
23
|
+
id: bcs.Address,
|
|
24
|
+
for: bcs.Address
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const PurchaseCap = new MoveStruct({
|
|
28
|
+
name: `${$moduleName}::PurchaseCap`,
|
|
29
|
+
fields: {
|
|
30
|
+
id: bcs.Address,
|
|
31
|
+
kiosk_id: bcs.Address,
|
|
32
|
+
item_id: bcs.Address,
|
|
33
|
+
min_price: bcs.u64()
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const Borrow = new MoveStruct({
|
|
37
|
+
name: `${$moduleName}::Borrow`,
|
|
38
|
+
fields: {
|
|
39
|
+
kiosk_id: bcs.Address,
|
|
40
|
+
item_id: bcs.Address
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const Item = new MoveStruct({
|
|
44
|
+
name: `${$moduleName}::Item`,
|
|
45
|
+
fields: { id: bcs.Address }
|
|
46
|
+
});
|
|
47
|
+
const Listing = new MoveStruct({
|
|
48
|
+
name: `${$moduleName}::Listing`,
|
|
49
|
+
fields: {
|
|
50
|
+
id: bcs.Address,
|
|
51
|
+
is_exclusive: bcs.bool()
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const Lock = new MoveStruct({
|
|
55
|
+
name: `${$moduleName}::Lock`,
|
|
56
|
+
fields: { id: bcs.Address }
|
|
57
|
+
});
|
|
58
|
+
const ItemListed = new MoveStruct({
|
|
59
|
+
name: `${$moduleName}::ItemListed`,
|
|
60
|
+
fields: {
|
|
61
|
+
kiosk: bcs.Address,
|
|
62
|
+
id: bcs.Address,
|
|
63
|
+
price: bcs.u64()
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const ItemPurchased = new MoveStruct({
|
|
67
|
+
name: `${$moduleName}::ItemPurchased`,
|
|
68
|
+
fields: {
|
|
69
|
+
kiosk: bcs.Address,
|
|
70
|
+
id: bcs.Address,
|
|
71
|
+
price: bcs.u64()
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const ItemDelisted = new MoveStruct({
|
|
75
|
+
name: `${$moduleName}::ItemDelisted`,
|
|
76
|
+
fields: {
|
|
77
|
+
kiosk: bcs.Address,
|
|
78
|
+
id: bcs.Address
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
function _new(options = {}) {
|
|
82
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
83
|
+
return (tx) => tx.moveCall({
|
|
84
|
+
package: packageAddress,
|
|
85
|
+
module: "kiosk",
|
|
86
|
+
function: "new"
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function place(options) {
|
|
90
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
91
|
+
const argumentsTypes = [
|
|
92
|
+
null,
|
|
93
|
+
null,
|
|
94
|
+
`${options.typeArguments[0]}`
|
|
95
|
+
];
|
|
96
|
+
return (tx) => tx.moveCall({
|
|
97
|
+
package: packageAddress,
|
|
98
|
+
module: "kiosk",
|
|
99
|
+
function: "place",
|
|
100
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
101
|
+
typeArguments: options.typeArguments
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function lock(options) {
|
|
105
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
106
|
+
const argumentsTypes = [
|
|
107
|
+
null,
|
|
108
|
+
null,
|
|
109
|
+
null,
|
|
110
|
+
`${options.typeArguments[0]}`
|
|
111
|
+
];
|
|
112
|
+
return (tx) => tx.moveCall({
|
|
113
|
+
package: packageAddress,
|
|
114
|
+
module: "kiosk",
|
|
115
|
+
function: "lock",
|
|
116
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
117
|
+
typeArguments: options.typeArguments
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function take(options) {
|
|
121
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
122
|
+
const argumentsTypes = [
|
|
123
|
+
null,
|
|
124
|
+
null,
|
|
125
|
+
"0x2::object::ID"
|
|
126
|
+
];
|
|
127
|
+
return (tx) => tx.moveCall({
|
|
128
|
+
package: packageAddress,
|
|
129
|
+
module: "kiosk",
|
|
130
|
+
function: "take",
|
|
131
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
132
|
+
typeArguments: options.typeArguments
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function list(options) {
|
|
136
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
137
|
+
const argumentsTypes = [
|
|
138
|
+
null,
|
|
139
|
+
null,
|
|
140
|
+
"0x2::object::ID",
|
|
141
|
+
"u64"
|
|
142
|
+
];
|
|
143
|
+
return (tx) => tx.moveCall({
|
|
144
|
+
package: packageAddress,
|
|
145
|
+
module: "kiosk",
|
|
146
|
+
function: "list",
|
|
147
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
148
|
+
typeArguments: options.typeArguments
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function placeAndList(options) {
|
|
152
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
153
|
+
const argumentsTypes = [
|
|
154
|
+
null,
|
|
155
|
+
null,
|
|
156
|
+
`${options.typeArguments[0]}`,
|
|
157
|
+
"u64"
|
|
158
|
+
];
|
|
159
|
+
return (tx) => tx.moveCall({
|
|
160
|
+
package: packageAddress,
|
|
161
|
+
module: "kiosk",
|
|
162
|
+
function: "place_and_list",
|
|
163
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
164
|
+
typeArguments: options.typeArguments
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function delist(options) {
|
|
168
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
169
|
+
const argumentsTypes = [
|
|
170
|
+
null,
|
|
171
|
+
null,
|
|
172
|
+
"0x2::object::ID"
|
|
173
|
+
];
|
|
174
|
+
return (tx) => tx.moveCall({
|
|
175
|
+
package: packageAddress,
|
|
176
|
+
module: "kiosk",
|
|
177
|
+
function: "delist",
|
|
178
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
179
|
+
typeArguments: options.typeArguments
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function purchase(options) {
|
|
183
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
184
|
+
const argumentsTypes = [
|
|
185
|
+
null,
|
|
186
|
+
"0x2::object::ID",
|
|
187
|
+
null
|
|
188
|
+
];
|
|
189
|
+
return (tx) => tx.moveCall({
|
|
190
|
+
package: packageAddress,
|
|
191
|
+
module: "kiosk",
|
|
192
|
+
function: "purchase",
|
|
193
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
194
|
+
typeArguments: options.typeArguments
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function withdraw(options) {
|
|
198
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
199
|
+
const argumentsTypes = [
|
|
200
|
+
null,
|
|
201
|
+
null,
|
|
202
|
+
"0x1::option::Option<u64>"
|
|
203
|
+
];
|
|
204
|
+
return (tx) => tx.moveCall({
|
|
205
|
+
package: packageAddress,
|
|
206
|
+
module: "kiosk",
|
|
207
|
+
function: "withdraw",
|
|
208
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes)
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function borrowVal(options) {
|
|
212
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
213
|
+
const argumentsTypes = [
|
|
214
|
+
null,
|
|
215
|
+
null,
|
|
216
|
+
"0x2::object::ID"
|
|
217
|
+
];
|
|
218
|
+
return (tx) => tx.moveCall({
|
|
219
|
+
package: packageAddress,
|
|
220
|
+
module: "kiosk",
|
|
221
|
+
function: "borrow_val",
|
|
222
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
223
|
+
typeArguments: options.typeArguments
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function returnVal(options) {
|
|
227
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
228
|
+
const argumentsTypes = [
|
|
229
|
+
null,
|
|
230
|
+
`${options.typeArguments[0]}`,
|
|
231
|
+
null
|
|
232
|
+
];
|
|
233
|
+
return (tx) => tx.moveCall({
|
|
234
|
+
package: packageAddress,
|
|
235
|
+
module: "kiosk",
|
|
236
|
+
function: "return_val",
|
|
237
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
238
|
+
typeArguments: options.typeArguments
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
//#endregion
|
|
243
|
+
export { Kiosk, KioskOwnerCap, Listing, Lock, _new, borrowVal, delist, list, lock, place, placeAndList, purchase, returnVal, take, withdraw };
|
|
244
|
+
//# sourceMappingURL=kiosk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiosk.mjs","names":["balance.Balance"],"sources":["../../../src/contracts/0x2/kiosk.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs, type BcsType } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nimport * as balance from './balance.js';\nconst $moduleName = '0x2::kiosk';\nexport const Kiosk = new MoveStruct({\n\tname: `${$moduleName}::Kiosk`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tprofits: balance.Balance,\n\t\towner: bcs.Address,\n\t\titem_count: bcs.u32(),\n\t\tallow_extensions: bcs.bool(),\n\t},\n});\nexport const KioskOwnerCap = new MoveStruct({\n\tname: `${$moduleName}::KioskOwnerCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tfor: bcs.Address,\n\t},\n});\nexport const PurchaseCap = new MoveStruct({\n\tname: `${$moduleName}::PurchaseCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tkiosk_id: bcs.Address,\n\t\titem_id: bcs.Address,\n\t\tmin_price: bcs.u64(),\n\t},\n});\nexport const Borrow = new MoveStruct({\n\tname: `${$moduleName}::Borrow`,\n\tfields: {\n\t\tkiosk_id: bcs.Address,\n\t\titem_id: bcs.Address,\n\t},\n});\nexport const Item = new MoveStruct({\n\tname: `${$moduleName}::Item`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const Listing = new MoveStruct({\n\tname: `${$moduleName}::Listing`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tis_exclusive: bcs.bool(),\n\t},\n});\nexport const Lock = new MoveStruct({\n\tname: `${$moduleName}::Lock`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const ItemListed = new MoveStruct({\n\tname: `${$moduleName}::ItemListed`,\n\tfields: {\n\t\tkiosk: bcs.Address,\n\t\tid: bcs.Address,\n\t\tprice: bcs.u64(),\n\t},\n});\nexport const ItemPurchased = new MoveStruct({\n\tname: `${$moduleName}::ItemPurchased`,\n\tfields: {\n\t\tkiosk: bcs.Address,\n\t\tid: bcs.Address,\n\t\tprice: bcs.u64(),\n\t},\n});\nexport const ItemDelisted = new MoveStruct({\n\tname: `${$moduleName}::ItemDelisted`,\n\tfields: {\n\t\tkiosk: bcs.Address,\n\t\tid: bcs.Address,\n\t},\n});\nexport interface DefaultOptions {\n\tpackage?: string;\n\targuments?: [];\n}\nexport function _default(options: DefaultOptions = {}) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'default',\n\t\t});\n}\nexport interface NewOptions {\n\tpackage?: string;\n\targuments?: [];\n}\nexport function _new(options: NewOptions = {}) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'new',\n\t\t});\n}\nexport interface CloseAndWithdrawOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function closeAndWithdraw(options: CloseAndWithdrawOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'close_and_withdraw',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface SetOwnerOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function setOwner(options: SetOwnerOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'set_owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface SetOwnerCustomOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n}\nexport function setOwnerCustom(options: SetOwnerCustomOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, 'address'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'set_owner_custom',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface PlaceOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<T0>,\n\t];\n\ttypeArguments: [string];\n}\nexport function place<T0 extends BcsType<any>>(options: PlaceOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, `${options.typeArguments[0]}`] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'place',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface LockOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<T0>,\n\t];\n\ttypeArguments: [string];\n}\nexport function lock<T0 extends BcsType<any>>(options: LockOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, null, `${options.typeArguments[0]}`] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'lock',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface TakeOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function take(options: TakeOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'take',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ListOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<number | bigint>,\n\t];\n\ttypeArguments: [string];\n}\nexport function list(options: ListOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x2::object::ID', 'u64'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'list',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PlaceAndListOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<T0>,\n\t\tRawTransactionArgument<number | bigint>,\n\t];\n\ttypeArguments: [string];\n}\nexport function placeAndList<T0 extends BcsType<any>>(options: PlaceAndListOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, `${options.typeArguments[0]}`, 'u64'] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'place_and_list',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DelistOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function delist(options: DelistOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'delist',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PurchaseOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function purchase(options: PurchaseOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, '0x2::object::ID', null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'purchase',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ListWithPurchaseCapOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<number | bigint>,\n\t];\n\ttypeArguments: [string];\n}\nexport function listWithPurchaseCap(options: ListWithPurchaseCapOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x2::object::ID', 'u64'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'list_with_purchase_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PurchaseWithCapOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function purchaseWithCap(options: PurchaseWithCapOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'purchase_with_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ReturnPurchaseCapOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function returnPurchaseCap(options: ReturnPurchaseCapOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'return_purchase_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface WithdrawOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<number | bigint | null>,\n\t];\n}\nexport function withdraw(options: WithdrawOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x1::option::Option<u64>'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'withdraw',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface HasItemOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function hasItem(options: HasItemOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'has_item',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface HasItemWithTypeOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function hasItemWithType(options: HasItemWithTypeOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'has_item_with_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface IsLockedOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function isLocked(options: IsLockedOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'is_locked',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface IsListedOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function isListed(options: IsListedOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'is_listed',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface IsListedExclusivelyOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function isListedExclusively(options: IsListedExclusivelyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'is_listed_exclusively',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface HasAccessOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function hasAccess(options: HasAccessOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'has_access',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface UidMutAsOwnerOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function uidMutAsOwner(options: UidMutAsOwnerOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'uid_mut_as_owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface SetAllowExtensionsOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<boolean>,\n\t];\n}\nexport function setAllowExtensions(options: SetAllowExtensionsOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, 'bool'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'set_allow_extensions',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface UidOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n}\nexport function uid(options: UidOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'uid',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface UidMutOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n}\nexport function uidMut(options: UidMutOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'uid_mut',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface OwnerOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n}\nexport function owner(options: OwnerOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface ItemCountOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n}\nexport function itemCount(options: ItemCountOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'item_count',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface ProfitsAmountOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n}\nexport function profitsAmount(options: ProfitsAmountOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'profits_amount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface ProfitsMutOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n}\nexport function profitsMut(options: ProfitsMutOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'profits_mut',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface BorrowOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function borrow(options: BorrowOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'borrow',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface BorrowMutOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function borrowMut(options: BorrowMutOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'borrow_mut',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface BorrowValOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function borrowVal(options: BorrowValOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'borrow_val',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ReturnValOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<T0>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function returnVal<T0 extends BcsType<any>>(options: ReturnValOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, `${options.typeArguments[0]}`, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'return_val',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface KioskOwnerCapForOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n}\nexport function kioskOwnerCapFor(options: KioskOwnerCapForOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'kiosk_owner_cap_for',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t});\n}\nexport interface PurchaseCapKioskOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function purchaseCapKiosk(options: PurchaseCapKioskOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'purchase_cap_kiosk',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PurchaseCapItemOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function purchaseCapItem(options: PurchaseCapItemOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'purchase_cap_item',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PurchaseCapMinPriceOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function purchaseCapMinPrice(options: PurchaseCapMinPriceOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk',\n\t\t\tfunction: 'purchase_cap_min_price',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,SAASA;EACT,OAAO,IAAI;EACX,YAAY,IAAI,KAAK;EACrB,kBAAkB,IAAI,MAAM;EAC5B;CACD,CAAC;AACF,MAAa,gBAAgB,IAAI,WAAW;CAC3C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,KAAK,IAAI;EACT;CACD,CAAC;AACF,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,UAAU,IAAI;EACd,SAAS,IAAI;EACb,WAAW,IAAI,KAAK;EACpB;CACD,CAAC;AACF,MAAa,SAAS,IAAI,WAAW;CACpC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,UAAU,IAAI;EACd,SAAS,IAAI;EACb;CACD,CAAC;AACF,MAAa,OAAO,IAAI,WAAW;CAClC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,IAAI,IAAI,SACR;CACD,CAAC;AACF,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,cAAc,IAAI,MAAM;EACxB;CACD,CAAC;AACF,MAAa,OAAO,IAAI,WAAW;CAClC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,IAAI,IAAI,SACR;CACD,CAAC;AACF,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,OAAO,IAAI;EACX,IAAI,IAAI;EACR,OAAO,IAAI,KAAK;EAChB;CACD,CAAC;AACF,MAAa,gBAAgB,IAAI,WAAW;CAC3C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,OAAO,IAAI;EACX,IAAI,IAAI;EACR,OAAO,IAAI,KAAK;EAChB;CACD,CAAC;AACF,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,OAAO,IAAI;EACX,IAAI,IAAI;EACR;CACD,CAAC;AAmBF,SAAgB,KAAK,UAAsB,EAAE,EAAE;CAC9C,MAAM,iBACL,QAAQ,WAAW;AACpB,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,CAAC;;AA+DJ,SAAgB,MAA+B,SAA2B;CACzE,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM,GAAG,QAAQ,cAAc;EAAK;AAClE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAYJ,SAAgB,KAA8B,SAA0B;CACvE,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM,GAAG,QAAQ,cAAc;EAAK;AAIxE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAWJ,SAAgB,KAAK,SAAsB;CAC1C,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAkB;AACtD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAYJ,SAAgB,KAAK,SAAsB;CAC1C,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAmB;EAAM;AAC7D,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAYJ,SAAgB,aAAsC,SAAkC;CACvF,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM,GAAG,QAAQ,cAAc;EAAM;EAAM;AAIzE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAWJ,SAAgB,OAAO,SAAwB;CAC9C,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAkB;AACtD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAWJ,SAAgB,SAAS,SAA0B;CAClD,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAmB;EAAK;AACtD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAyEJ,SAAgB,SAAS,SAA0B;CAClD,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAA2B;AAC/D,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,CAAC;;AA6RJ,SAAgB,UAAU,SAA2B;CACpD,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAkB;AACtD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAWJ,SAAgB,UAAmC,SAA+B;CACjF,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM,GAAG,QAAQ,cAAc;EAAM;EAAK;AAClE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MoveStruct } from "../utils/index.mjs";
|
|
2
|
+
import { Bag } from "./bag.mjs";
|
|
3
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
4
|
+
|
|
5
|
+
//#region src/contracts/0x2/kiosk_extension.ts
|
|
6
|
+
/**************************************************************
|
|
7
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
8
|
+
**************************************************************/
|
|
9
|
+
const $moduleName = "0x2::kiosk_extension";
|
|
10
|
+
const Extension = new MoveStruct({
|
|
11
|
+
name: `${$moduleName}::Extension`,
|
|
12
|
+
fields: {
|
|
13
|
+
storage: Bag,
|
|
14
|
+
permissions: bcs.u128(),
|
|
15
|
+
is_enabled: bcs.bool()
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const ExtensionKey = new MoveStruct({
|
|
19
|
+
name: `${$moduleName}::ExtensionKey`,
|
|
20
|
+
fields: { dummy_field: bcs.bool() }
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Extension, ExtensionKey };
|
|
25
|
+
//# sourceMappingURL=kiosk_extension.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiosk_extension.mjs","names":["bag.Bag"],"sources":["../../../src/contracts/0x2/kiosk_extension.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs, type BcsType } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nimport * as bag from './bag.js';\nconst $moduleName = '0x2::kiosk_extension';\nexport const Extension = new MoveStruct({\n\tname: `${$moduleName}::Extension`,\n\tfields: {\n\t\tstorage: bag.Bag,\n\t\tpermissions: bcs.u128(),\n\t\tis_enabled: bcs.bool(),\n\t},\n});\nexport const ExtensionKey = new MoveStruct({\n\tname: `${$moduleName}::ExtensionKey`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport interface AddOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<T0>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<number | bigint>,\n\t];\n\ttypeArguments: [string];\n}\nexport function add<T0 extends BcsType<any>>(options: AddOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`${options.typeArguments[0]}`, null, null, 'u128'] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DisableOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function disable(options: DisableOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'disable',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface EnableOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function enable(options: EnableOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'enable',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface RemoveOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function remove(options: RemoveOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'remove',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface StorageOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<T0>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function storage<T0 extends BcsType<any>>(options: StorageOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`${options.typeArguments[0]}`, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'storage',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface StorageMutOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<T0>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function storageMut<T0 extends BcsType<any>>(options: StorageMutOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`${options.typeArguments[0]}`, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'storage_mut',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PlaceOptions<T0 extends BcsType<any>, T1 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<T0>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<T1>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string, string];\n}\nexport function place<T0 extends BcsType<any>, T1 extends BcsType<any>>(\n\toptions: PlaceOptions<T0, T1>,\n) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [\n\t\t`${options.typeArguments[0]}`,\n\t\tnull,\n\t\t`${options.typeArguments[1]}`,\n\t\tnull,\n\t] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'place',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface LockOptions<T0 extends BcsType<any>, T1 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<T0>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<T1>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string, string];\n}\nexport function lock<T0 extends BcsType<any>, T1 extends BcsType<any>>(\n\toptions: LockOptions<T0, T1>,\n) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [\n\t\t`${options.typeArguments[0]}`,\n\t\tnull,\n\t\t`${options.typeArguments[1]}`,\n\t\tnull,\n\t] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'lock',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface IsInstalledOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function isInstalled(options: IsInstalledOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'is_installed',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface IsEnabledOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function isEnabled(options: IsEnabledOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'is_enabled',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface CanPlaceOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function canPlace(options: CanPlaceOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'can_place',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface CanLockOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function canLock(options: CanLockOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_extension',\n\t\t\tfunction: 'can_lock',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,cAAc;AACpB,MAAa,YAAY,IAAI,WAAW;CACvC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,SAASA;EACT,aAAa,IAAI,MAAM;EACvB,YAAY,IAAI,MAAM;EACtB;CACD,CAAC;AACF,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.mjs";
|
|
2
|
+
import { Balance } from "./balance.mjs";
|
|
3
|
+
import { VecSet } from "./vec_set.mjs";
|
|
4
|
+
import { TypeName } from "./deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs";
|
|
5
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
6
|
+
|
|
7
|
+
//#region src/contracts/0x2/transfer_policy.ts
|
|
8
|
+
/**************************************************************
|
|
9
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
10
|
+
**************************************************************/
|
|
11
|
+
const $moduleName = "0x2::transfer_policy";
|
|
12
|
+
const TransferRequest = new MoveStruct({
|
|
13
|
+
name: `${$moduleName}::TransferRequest`,
|
|
14
|
+
fields: {
|
|
15
|
+
item: bcs.Address,
|
|
16
|
+
paid: bcs.u64(),
|
|
17
|
+
from: bcs.Address,
|
|
18
|
+
receipts: VecSet(TypeName)
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const TransferPolicy = new MoveStruct({
|
|
22
|
+
name: `${$moduleName}::TransferPolicy`,
|
|
23
|
+
fields: {
|
|
24
|
+
id: bcs.Address,
|
|
25
|
+
balance: Balance,
|
|
26
|
+
rules: VecSet(TypeName)
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const TransferPolicyCap = new MoveStruct({
|
|
30
|
+
name: `${$moduleName}::TransferPolicyCap`,
|
|
31
|
+
fields: {
|
|
32
|
+
id: bcs.Address,
|
|
33
|
+
policy_id: bcs.Address
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const TransferPolicyCreated = new MoveStruct({
|
|
37
|
+
name: `${$moduleName}::TransferPolicyCreated`,
|
|
38
|
+
fields: { id: bcs.Address }
|
|
39
|
+
});
|
|
40
|
+
const TransferPolicyDestroyed = new MoveStruct({
|
|
41
|
+
name: `${$moduleName}::TransferPolicyDestroyed`,
|
|
42
|
+
fields: { id: bcs.Address }
|
|
43
|
+
});
|
|
44
|
+
const RuleKey = new MoveStruct({
|
|
45
|
+
name: `${$moduleName}::RuleKey`,
|
|
46
|
+
fields: { dummy_field: bcs.bool() }
|
|
47
|
+
});
|
|
48
|
+
function _new(options) {
|
|
49
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
50
|
+
const argumentsTypes = [null];
|
|
51
|
+
return (tx) => tx.moveCall({
|
|
52
|
+
package: packageAddress,
|
|
53
|
+
module: "transfer_policy",
|
|
54
|
+
function: "new",
|
|
55
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
56
|
+
typeArguments: options.typeArguments
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function withdraw(options) {
|
|
60
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
61
|
+
const argumentsTypes = [
|
|
62
|
+
null,
|
|
63
|
+
null,
|
|
64
|
+
"0x1::option::Option<u64>"
|
|
65
|
+
];
|
|
66
|
+
return (tx) => tx.moveCall({
|
|
67
|
+
package: packageAddress,
|
|
68
|
+
module: "transfer_policy",
|
|
69
|
+
function: "withdraw",
|
|
70
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
71
|
+
typeArguments: options.typeArguments
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function confirmRequest(options) {
|
|
75
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
76
|
+
const argumentsTypes = [null, null];
|
|
77
|
+
return (tx) => tx.moveCall({
|
|
78
|
+
package: packageAddress,
|
|
79
|
+
module: "transfer_policy",
|
|
80
|
+
function: "confirm_request",
|
|
81
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
82
|
+
typeArguments: options.typeArguments
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function removeRule(options) {
|
|
86
|
+
const packageAddress = options.package ?? "0x0000000000000000000000000000000000000000000000000000000000000002";
|
|
87
|
+
const argumentsTypes = [null, null];
|
|
88
|
+
return (tx) => tx.moveCall({
|
|
89
|
+
package: packageAddress,
|
|
90
|
+
module: "transfer_policy",
|
|
91
|
+
function: "remove_rule",
|
|
92
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
93
|
+
typeArguments: options.typeArguments
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
export { TransferPolicy, TransferPolicyCap, _new, confirmRequest, removeRule, withdraw };
|
|
99
|
+
//# sourceMappingURL=transfer_policy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfer_policy.mjs","names":["vec_set.VecSet","type_name.TypeName","balance.Balance"],"sources":["../../../src/contracts/0x2/transfer_policy.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs, type BcsType } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nimport * as vec_set from './vec_set.js';\nimport * as type_name from './deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.js';\nimport * as balance from './balance.js';\nconst $moduleName = '0x2::transfer_policy';\nexport const TransferRequest = new MoveStruct({\n\tname: `${$moduleName}::TransferRequest`,\n\tfields: {\n\t\titem: bcs.Address,\n\t\tpaid: bcs.u64(),\n\t\tfrom: bcs.Address,\n\t\treceipts: vec_set.VecSet(type_name.TypeName),\n\t},\n});\nexport const TransferPolicy = new MoveStruct({\n\tname: `${$moduleName}::TransferPolicy`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tbalance: balance.Balance,\n\t\trules: vec_set.VecSet(type_name.TypeName),\n\t},\n});\nexport const TransferPolicyCap = new MoveStruct({\n\tname: `${$moduleName}::TransferPolicyCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tpolicy_id: bcs.Address,\n\t},\n});\nexport const TransferPolicyCreated = new MoveStruct({\n\tname: `${$moduleName}::TransferPolicyCreated`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const TransferPolicyDestroyed = new MoveStruct({\n\tname: `${$moduleName}::TransferPolicyDestroyed`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const RuleKey = new MoveStruct({\n\tname: `${$moduleName}::RuleKey`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport interface NewRequestOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<number | bigint>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string];\n}\nexport function newRequest(options: NewRequestOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = ['0x2::object::ID', 'u64', '0x2::object::ID'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'new_request',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface NewOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function _new(options: NewOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'new',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DefaultOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function _default(options: DefaultOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'default',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface WithdrawOptions {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<number | bigint | null>,\n\t];\n\ttypeArguments: [string];\n}\nexport function withdraw(options: WithdrawOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null, '0x1::option::Option<u64>'] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'withdraw',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DestroyAndWithdrawOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function destroyAndWithdraw(options: DestroyAndWithdrawOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'destroy_and_withdraw',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ConfirmRequestOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function confirmRequest(options: ConfirmRequestOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'confirm_request',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface AddRuleOptions<T1 extends BcsType<any>, T2 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<T1>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<T2>,\n\t];\n\ttypeArguments: [string, string, string];\n}\nexport function addRule<T1 extends BcsType<any>, T2 extends BcsType<any>>(\n\toptions: AddRuleOptions<T1, T2>,\n) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [\n\t\t`${options.typeArguments[1]}`,\n\t\tnull,\n\t\tnull,\n\t\t`${options.typeArguments[2]}`,\n\t] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'add_rule',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface GetRuleOptions<T1 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<T1>, RawTransactionArgument<string>];\n\ttypeArguments: [string, string, string];\n}\nexport function getRule<T1 extends BcsType<any>>(options: GetRuleOptions<T1>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'get_rule',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface AddToBalanceOptions<T1 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [\n\t\tRawTransactionArgument<T1>,\n\t\tRawTransactionArgument<string>,\n\t\tRawTransactionArgument<string>,\n\t];\n\ttypeArguments: [string, string];\n}\nexport function addToBalance<T1 extends BcsType<any>>(options: AddToBalanceOptions<T1>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`${options.typeArguments[1]}`, null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'add_to_balance',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface AddReceiptOptions<T1 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<T1>, RawTransactionArgument<string>];\n\ttypeArguments: [string, string];\n}\nexport function addReceipt<T1 extends BcsType<any>>(options: AddReceiptOptions<T1>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'add_receipt',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface HasRuleOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string, string];\n}\nexport function hasRule(options: HasRuleOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'has_rule',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface RemoveRuleOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string, string, string];\n}\nexport function removeRule(options: RemoveRuleOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'remove_rule',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface UidOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function uid(options: UidOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'uid',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface UidMutAsOwnerOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function uidMutAsOwner(options: UidMutAsOwnerOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'uid_mut_as_owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface RulesOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function rules(options: RulesOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'rules',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ItemOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function item(options: ItemOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'item',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PaidOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function paid(options: PaidOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'paid',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface FromOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function _from(options: FromOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'transfer_policy',\n\t\t\tfunction: 'from',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;AASA,MAAM,cAAc;AACpB,MAAa,kBAAkB,IAAI,WAAW;CAC7C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,MAAM,IAAI;EACV,MAAM,IAAI,KAAK;EACf,MAAM,IAAI;EACV,UAAUA,OAAeC,SAAmB;EAC5C;CACD,CAAC;AACF,MAAa,iBAAiB,IAAI,WAAW;CAC5C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,SAASC;EACT,OAAOF,OAAeC,SAAmB;EACzC;CACD,CAAC;AACF,MAAa,oBAAoB,IAAI,WAAW;CAC/C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,WAAW,IAAI;EACf;CACD,CAAC;AACF,MAAa,wBAAwB,IAAI,WAAW;CACnD,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,IAAI,IAAI,SACR;CACD,CAAC;AACF,MAAa,0BAA0B,IAAI,WAAW;CACrD,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,IAAI,IAAI,SACR;CACD,CAAC;AACF,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AA4BF,SAAgB,KAAK,SAAqB;CACzC,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB,CAAC,KAAK;AAC7B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AA6BJ,SAAgB,SAAS,SAA0B;CAClD,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAA2B;AAC/D,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAyBJ,SAAgB,eAAe,SAAgC;CAC9D,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB,CAAC,MAAM,KAAK;AACnC,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC;;AAiHJ,SAAgB,WAAW,SAA4B;CACtD,MAAM,iBACL,QAAQ,WAAW;CACpB,MAAM,iBAAiB,CAAC,MAAM,KAAK;AACnC,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,eAAe;EACpE,eAAe,QAAQ;EACvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MoveStruct } from "../utils/index.mjs";
|
|
2
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
3
|
+
|
|
4
|
+
//#region src/contracts/0x2/vec_set.ts
|
|
5
|
+
/**************************************************************
|
|
6
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
7
|
+
**************************************************************/
|
|
8
|
+
const $moduleName = "0x2::vec_set";
|
|
9
|
+
function VecSet(...typeParameters) {
|
|
10
|
+
return new MoveStruct({
|
|
11
|
+
name: `${$moduleName}::VecSet<${typeParameters[0].name}>`,
|
|
12
|
+
fields: { contents: bcs.vector(typeParameters[0]) }
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { VecSet };
|
|
18
|
+
//# sourceMappingURL=vec_set.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vec_set.mjs","names":[],"sources":["../../../src/contracts/0x2/vec_set.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { type BcsType, bcs } from '@mysten/sui/bcs';\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { type Transaction } from '@mysten/sui/transactions';\nconst $moduleName = '0x2::vec_set';\nexport function VecSet<T0 extends BcsType<any>>(...typeParameters: [T0]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::VecSet<${typeParameters[0].name as T0['name']}>`,\n\t\tfields: {\n\t\t\tcontents: bcs.vector(typeParameters[0]),\n\t\t},\n\t});\n}\nexport interface EmptyOptions {\n\tpackage?: string;\n\targuments?: [];\n\ttypeArguments: [string];\n}\nexport function empty(options: EmptyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'empty',\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface SingletonOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<T0>];\n\ttypeArguments: [string];\n}\nexport function singleton<T0 extends BcsType<any>>(options: SingletonOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`${options.typeArguments[0]}`] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'singleton',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface InsertOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];\n\ttypeArguments: [string];\n}\nexport function insert<T0 extends BcsType<any>>(options: InsertOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'insert',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface RemoveOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];\n\ttypeArguments: [string];\n}\nexport function remove<T0 extends BcsType<any>>(options: RemoveOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'remove',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ContainsOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];\n\ttypeArguments: [string];\n}\nexport function contains<T0 extends BcsType<any>>(options: ContainsOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'contains',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface LengthOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function length(options: LengthOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'length',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface IsEmptyOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function isEmpty(options: IsEmptyOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'is_empty',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface IntoKeysOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function intoKeys(options: IntoKeysOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'into_keys',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface FromKeysOptions<T0 extends BcsType<any>> {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<T0[]>];\n\ttypeArguments: [string];\n}\nexport function fromKeys<T0 extends BcsType<any>>(options: FromKeysOptions<T0>) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [`vector<${options.typeArguments[0]}>`] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'from_keys',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface KeysOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function keys(options: KeysOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'keys',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface SizeOptions {\n\tpackage?: string;\n\targuments: [RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function size(options: SizeOptions) {\n\tconst packageAddress =\n\t\toptions.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'vec_set',\n\t\t\tfunction: 'size',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;AAMA,MAAM,cAAc;AACpB,SAAgB,OAAgC,GAAG,gBAAsB;AACxE,QAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,WAAW,eAAe,GAAG,KAAmB;EACrE,QAAQ,EACP,UAAU,IAAI,OAAO,eAAe,GAAG,EACvC;EACD,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { MoveStruct } from "../../../utils/index.mjs";
|
|
2
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
3
|
+
|
|
4
|
+
//#region src/contracts/kiosk/deps/sui/kiosk.ts
|
|
5
|
+
/**************************************************************
|
|
6
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
7
|
+
**************************************************************/
|
|
8
|
+
/**
|
|
9
|
+
* Kiosk is a primitive for building safe, decentralized and trustless trading
|
|
10
|
+
* experiences. It allows storing and trading any types of assets as long as the
|
|
11
|
+
* creator of these assets implements a `TransferPolicy` for them.
|
|
12
|
+
*
|
|
13
|
+
* ### Principles and philosophy:
|
|
14
|
+
*
|
|
15
|
+
* - Kiosk provides guarantees of "true ownership"; - just like single owner
|
|
16
|
+
* objects, assets stored in the Kiosk can only be managed by the Kiosk owner.
|
|
17
|
+
* Only the owner can `place`, `take`, `list`, perform any other actions on
|
|
18
|
+
* assets in the Kiosk.
|
|
19
|
+
*
|
|
20
|
+
* - Kiosk aims to be generic - allowing for a small set of default behaviors and
|
|
21
|
+
* not imposing any restrictions on how the assets can be traded. The only
|
|
22
|
+
* default scenario is a `list` + `purchase` flow; any other trading logic can be
|
|
23
|
+
* implemented on top using the `list_with_purchase_cap` (and a matching
|
|
24
|
+
* `purchase_with_cap`) flow.
|
|
25
|
+
*
|
|
26
|
+
* - For every transaction happening with a third party a `TransferRequest` is
|
|
27
|
+
* created - this way creators are fully in control of the trading experience.
|
|
28
|
+
*
|
|
29
|
+
* ### Asset states in the Kiosk:
|
|
30
|
+
*
|
|
31
|
+
* - `placed` - An asset is `place`d into the Kiosk and can be `take`n out by the
|
|
32
|
+
* Kiosk owner; it's freely tradable and modifiable via the `borrow_mut` and
|
|
33
|
+
* `borrow_val` functions.
|
|
34
|
+
*
|
|
35
|
+
* - `locked` - Similar to `placed` except that `take` is disabled and the only way
|
|
36
|
+
* to move the asset out of the Kiosk is to `list` it or `list_with_purchase_cap`
|
|
37
|
+
* therefore performing a trade (issuing a `TransferRequest`). The check on the
|
|
38
|
+
* `lock` function makes sure that the `TransferPolicy` exists to not lock the
|
|
39
|
+
* item in a `Kiosk` forever.
|
|
40
|
+
*
|
|
41
|
+
* - `listed` - A `place`d or a `lock`ed item can be `list`ed for a fixed price
|
|
42
|
+
* allowing anyone to `purchase` it from the Kiosk. While listed, an item can not
|
|
43
|
+
* be taken or modified. However, an immutable borrow via `borrow` call is still
|
|
44
|
+
* available. The `delist` function returns the asset to the previous state.
|
|
45
|
+
*
|
|
46
|
+
* - `listed_exclusively` - An item is listed via the `list_with_purchase_cap`
|
|
47
|
+
* function (and a `PurchaseCap` is created). While listed this way, an item can
|
|
48
|
+
* not be `delist`-ed unless a `PurchaseCap` is returned. All actions available
|
|
49
|
+
* at this item state require a `PurchaseCap`:
|
|
50
|
+
*
|
|
51
|
+
* 1. `purchase_with_cap` - to purchase the item for a price equal or higher than
|
|
52
|
+
* the `min_price` set in the `PurchaseCap`.
|
|
53
|
+
* 2. `return_purchase_cap` - to return the `PurchaseCap` and return the asset
|
|
54
|
+
* into the previous state.
|
|
55
|
+
*
|
|
56
|
+
* When an item is listed exclusively it cannot be modified nor taken and losing a
|
|
57
|
+
* `PurchaseCap` would lock the item in the Kiosk forever. Therefore, it is
|
|
58
|
+
* recommended to only use `PurchaseCap` functionality in trusted applications and
|
|
59
|
+
* not use it for direct trading (eg sending to another account).
|
|
60
|
+
*
|
|
61
|
+
* ### Using multiple Transfer Policies for different "tracks":
|
|
62
|
+
*
|
|
63
|
+
* Every `purchase` or `purchase_with_purchase_cap` creates a `TransferRequest` hot
|
|
64
|
+
* potato which must be resolved in a matching `TransferPolicy` for the transaction
|
|
65
|
+
* to pass. While the default scenario implies that there should be a single
|
|
66
|
+
* `TransferPolicy<T>` for `T`; it is possible to have multiple, each one having
|
|
67
|
+
* its own set of rules.
|
|
68
|
+
*
|
|
69
|
+
* ### Examples:
|
|
70
|
+
*
|
|
71
|
+
* - I create one `TransferPolicy` with "Royalty Rule" for everyone
|
|
72
|
+
* - I create a special `TransferPolicy` for bearers of a "Club Membership" object
|
|
73
|
+
* so they don't have to pay anything
|
|
74
|
+
* - I create and wrap a `TransferPolicy` so that players of my game can transfer
|
|
75
|
+
* items between `Kiosk`s in game without any charge (and maybe not even paying
|
|
76
|
+
* the price with a 0 SUI PurchaseCap)
|
|
77
|
+
*
|
|
78
|
+
* ```
|
|
79
|
+
* Kiosk -> (Item, TransferRequest)
|
|
80
|
+
* ... TransferRequest ------> Common Transfer Policy
|
|
81
|
+
* ... TransferRequest ------> In-game Wrapped Transfer Policy
|
|
82
|
+
* ... TransferRequest ------> Club Membership Transfer Policy
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* See `transfer_policy` module for more details on how they function.
|
|
86
|
+
*/
|
|
87
|
+
const $moduleName = "0x2::kiosk";
|
|
88
|
+
const KioskOwnerCap = new MoveStruct({
|
|
89
|
+
name: `${$moduleName}::KioskOwnerCap`,
|
|
90
|
+
fields: {
|
|
91
|
+
id: bcs.Address,
|
|
92
|
+
for: bcs.Address
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
export { KioskOwnerCap };
|
|
98
|
+
//# sourceMappingURL=kiosk.mjs.map
|