@mysten/kiosk 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/contracts/0x2/kiosk.mjs.map +1 -1
- package/dist/contracts/0x2/transfer_policy.mjs.map +1 -1
- package/dist/contracts/kiosk/floor_price_rule.mjs.map +1 -1
- package/dist/contracts/kiosk/kiosk_lock_rule.mjs.map +1 -1
- package/dist/contracts/kiosk/personal_kiosk.mjs.map +1 -1
- package/dist/contracts/kiosk/personal_kiosk_rule.mjs.map +1 -1
- package/dist/contracts/kiosk/royalty_rule.mjs.map +1 -1
- package/dist/contracts/utils/index.mjs +2 -1
- package/dist/contracts/utils/index.mjs.map +1 -1
- package/docs/advanced-examples.md +1 -1
- package/docs/from-v1.md +1 -1
- package/docs/index.md +5 -5
- package/docs/kiosk-client/introduction.md +6 -6
- package/docs/kiosk-client/kiosk-transaction/examples.md +3 -3
- package/docs/kiosk-client/kiosk-transaction/kiosk-transaction.md +1 -1
- package/docs/kiosk-client/kiosk-transaction/managing.md +11 -11
- package/docs/kiosk-client/kiosk-transaction/purchasing.md +1 -1
- package/docs/kiosk-client/querying.md +1 -1
- package/docs/kiosk-client/transfer-policy-transaction/introduction.md +1 -1
- package/docs/kiosk-client/transfer-policy-transaction/using-the-manager.md +1 -3
- package/docs/llms-index.md +9 -6
- package/package.json +4 -4
- package/src/contracts/0x2/kiosk.ts +22 -26
- package/src/contracts/0x2/transfer_policy.ts +6 -6
- package/src/contracts/kiosk/floor_price_rule.ts +3 -3
- package/src/contracts/kiosk/kiosk_lock_rule.ts +3 -5
- package/src/contracts/kiosk/personal_kiosk.ts +3 -3
- package/src/contracts/kiosk/personal_kiosk_rule.ts +3 -5
- package/src/contracts/kiosk/royalty_rule.ts +3 -3
- package/src/contracts/kiosk/witness_rule.ts +3 -3
- package/src/contracts/utils/index.ts +7 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @mysten/kiosk
|
|
2
2
|
|
|
3
|
+
## 1.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c96956e: Regenerate generated Move types against the latest contract sources. The generated
|
|
8
|
+
`utils/index.ts` `GetOptions` / `GetManyOptions` are now exported as type aliases (intersection)
|
|
9
|
+
instead of interfaces. SuiNS gains `SubnamePrunedEvent`, `pruneExpiredSubname`, and
|
|
10
|
+
`pruneExpiredSubnames`.
|
|
11
|
+
|
|
12
|
+
## 1.2.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- e9570a1: Regenerated Move call bindings. Parameters that can't accept a plain value (non-`key`
|
|
17
|
+
struct or enum, `vector<KeyStruct>`, etc.) are now typed as `TransactionArgument`, forcing callers
|
|
18
|
+
to pass a prior move-call result or `tx.makeMoveVec(...)`. Passing a bare string or array for
|
|
19
|
+
these parameters was always broken at runtime.
|
|
20
|
+
- Updated dependencies [6adc085]
|
|
21
|
+
- Updated dependencies [b1bf49a]
|
|
22
|
+
- @mysten/sui@2.16.0
|
|
23
|
+
|
|
3
24
|
## 1.2.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -1 +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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\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":"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"}
|
|
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, type TransactionArgument } 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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\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 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: [RawTransactionArgument<string>, RawTransactionArgument<T0>, TransactionArgument];\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}\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}\n"],"mappings":"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"}
|
|
@@ -1 +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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const TransferPolicyDestroyed = new MoveStruct({\n\tname: `${$moduleName}::TransferPolicyDestroyed<phantom T0>`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const RuleKey = new MoveStruct({\n\tname: `${$moduleName}::RuleKey<phantom T0>`,\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"}
|
|
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, type TransactionArgument } 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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\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<phantom T0>`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const TransferPolicyDestroyed = new MoveStruct({\n\tname: `${$moduleName}::TransferPolicyDestroyed<phantom T0>`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const RuleKey = new MoveStruct({\n\tname: `${$moduleName}::RuleKey<phantom T0>`,\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>, TransactionArgument];\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>, TransactionArgument];\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: [TransactionArgument];\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: [TransactionArgument];\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: [TransactionArgument];\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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floor_price_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/floor_price_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which sets the floor price for items of\n * type T.\n *\n * Configuration:\n *\n * - floor_price - the floor price in MIST.\n *\n * Use cases:\n *\n * - Defining a floor price for all trades of type T.\n * - Prevent trading of locked items with low amounts (e.g. by using purchase_cap).\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::floor_price_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const Config = new MoveStruct({\n\tname: `${$moduleName}::Config`,\n\tfields: {\n\t\tfloor_price: bcs.u64(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\tfloorPrice: RawTransactionArgument<number | bigint>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [\n\t\t\t\tpolicy: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\tfloorPrice: RawTransactionArgument<number | bigint>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Creator action: Add the Floor Price Rule for the `T`. Pass in the\n * `TransferPolicy`, `TransferPolicyCap` and `floor_price`.\n */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap', 'floorPrice'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'floor_price_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProveArguments {\n\tpolicy: RawTransactionArgument<string>;\n\trequest:
|
|
1
|
+
{"version":3,"file":"floor_price_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/floor_price_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which sets the floor price for items of\n * type T.\n *\n * Configuration:\n *\n * - floor_price - the floor price in MIST.\n *\n * Use cases:\n *\n * - Defining a floor price for all trades of type T.\n * - Prevent trading of locked items with low amounts (e.g. by using purchase_cap).\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::floor_price_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const Config = new MoveStruct({\n\tname: `${$moduleName}::Config`,\n\tfields: {\n\t\tfloor_price: bcs.u64(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\tfloorPrice: RawTransactionArgument<number | bigint>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [\n\t\t\t\tpolicy: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\tfloorPrice: RawTransactionArgument<number | bigint>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Creator action: Add the Floor Price Rule for the `T`. Pass in the\n * `TransferPolicy`, `TransferPolicyCap` and `floor_price`.\n */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap', 'floorPrice'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'floor_price_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProveArguments {\n\tpolicy: RawTransactionArgument<string>;\n\trequest: TransactionArgument;\n}\nexport interface ProveOptions {\n\tpackage?: string;\n\targuments:\n\t\t| ProveArguments\n\t\t| [policy: RawTransactionArgument<string>, request: TransactionArgument];\n\ttypeArguments: [string];\n}\n/** Buyer action: Prove that the amount is higher or equal to the floor_price. */\nexport function prove(options: ProveOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'request'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'floor_price_rule',\n\t\t\tfunction: 'prove',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,cAAc;AACpB,MAAa,OAAO,IAAI,WAAW;CAClC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,SAAS,IAAI,WAAW;CACpC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,KAAK,EACtB;CACD,CAAC;;;;;AAqBF,SAAgB,IAAI,SAAqB;CACxC,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM;CAC1C,MAAM,iBAAiB;EAAC;EAAU;EAAO;EAAa;AACtD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;;AAcJ,SAAgB,MAAM,SAAuB;CAC5C,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,UAAU,UAAU;AAC5C,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kiosk_lock_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/kiosk_lock_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which forces buyers to put the purchased\n * item into the Kiosk and lock it. The most common use case for the Rule is making\n * sure an item never leaves Kiosks and has policies enforced on every transfer.\n *\n * Configuration:\n *\n * - None\n *\n * Use cases:\n *\n * - Enforcing policies on every trade\n * - Making sure an item never leaves the Kiosk / certain ecosystem\n *\n * Notes:\n *\n * - \"locking\" mechanic disallows the `kiosk::take` function and forces the owner\n * to use `list` or `list_with_purchase_cap` methods if they wish to move the\n * item somewhere else.\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::kiosk_lock_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const Config = new MoveStruct({\n\tname: `${$moduleName}::Config`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [policy: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/**\n * Creator: Adds a `kiosk_lock_rule` Rule to the `TransferPolicy` forcing buyers to\n * lock the item in a Kiosk on purchase.\n */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_lock_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProveArguments {\n\trequest:
|
|
1
|
+
{"version":3,"file":"kiosk_lock_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/kiosk_lock_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which forces buyers to put the purchased\n * item into the Kiosk and lock it. The most common use case for the Rule is making\n * sure an item never leaves Kiosks and has policies enforced on every transfer.\n *\n * Configuration:\n *\n * - None\n *\n * Use cases:\n *\n * - Enforcing policies on every trade\n * - Making sure an item never leaves the Kiosk / certain ecosystem\n *\n * Notes:\n *\n * - \"locking\" mechanic disallows the `kiosk::take` function and forces the owner\n * to use `list` or `list_with_purchase_cap` methods if they wish to move the\n * item somewhere else.\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::kiosk_lock_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const Config = new MoveStruct({\n\tname: `${$moduleName}::Config`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [policy: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/**\n * Creator: Adds a `kiosk_lock_rule` Rule to the `TransferPolicy` forcing buyers to\n * lock the item in a Kiosk on purchase.\n */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_lock_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProveArguments {\n\trequest: TransactionArgument;\n\tkiosk: RawTransactionArgument<string>;\n}\nexport interface ProveOptions {\n\tpackage?: string;\n\targuments: ProveArguments | [request: TransactionArgument, kiosk: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/**\n * Buyer: Prove the item was locked in the Kiosk to get the receipt and unblock the\n * transfer request confirmation.\n */\nexport function prove(options: ProveOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['request', 'kiosk'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'kiosk_lock_rule',\n\t\t\tfunction: 'prove',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,cAAc;AACpB,MAAa,OAAO,IAAI,WAAW;CAClC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,SAAS,IAAI,WAAW;CACpC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;;;;;AAgBF,SAAgB,IAAI,SAAqB;CACxC,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,UAAU,MAAM;AACxC,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;;;;;AAeJ,SAAgB,MAAM,SAAuB;CAC5C,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,WAAW,QAAQ;AAC3C,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personal_kiosk.mjs","names":["kiosk.KioskOwnerCap"],"sources":["../../../src/contracts/kiosk/personal_kiosk.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module provides a wrapper for the KioskOwnerCap that makes the\n * Kiosk non-transferable and \"owned\".\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nimport * as kiosk from './deps/sui/kiosk.js';\nconst $moduleName = '@local-pkg/kiosk::personal_kiosk';\nexport const PersonalKioskCap = new MoveStruct({\n\tname: `${$moduleName}::PersonalKioskCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tcap: bcs.option(kiosk.KioskOwnerCap),\n\t},\n});\nexport const Borrow = new MoveStruct({\n\tname: `${$moduleName}::Borrow`,\n\tfields: {\n\t\tcap_id: bcs.Address,\n\t\towned_id: bcs.Address,\n\t},\n});\nexport const OwnerMarker = new MoveStruct({\n\tname: `${$moduleName}::OwnerMarker`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const NewPersonalKiosk = new MoveStruct({\n\tname: `${$moduleName}::NewPersonalKiosk`,\n\tfields: {\n\t\tkiosk_id: bcs.Address,\n\t},\n});\nexport interface DefaultArguments {\n\tkiosk: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface DefaultOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DefaultArguments\n\t\t| [kiosk: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n}\n/** The default setup for the PersonalKioskCap. */\nexport function _default(options: DefaultOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'default',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface NewArguments {\n\tkiosk: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface NewOptions {\n\tpackage?: string;\n\targuments:\n\t\t| NewArguments\n\t\t| [kiosk: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n}\n/**\n * Wrap the KioskOwnerCap making the Kiosk \"owned\" and non-transferable. The\n * `PersonalKioskCap` is returned to allow chaining within a PTB, but the value\n * must be consumed by the `transfer_to_sender` call in any case.\n */\nexport function _new(options: NewOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'new',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface CreateForArguments {\n\tkiosk: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\trecipient: RawTransactionArgument<string>;\n}\nexport interface CreateForOptions {\n\tpackage?: string;\n\targuments:\n\t\t| CreateForArguments\n\t\t| [\n\t\t\t\tkiosk: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\trecipient: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * Create a `PersonalKiosk` for `recipient`. This is useful when (e.g.) an admin\n * account wants to mint an asset with royalty enforcement on behalf of a user.\n */\nexport function createFor(options: CreateForOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, 'address'] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk', 'cap', 'recipient'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'create_for',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BorrowArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowOptions {\n\tpackage?: string;\n\targuments: BorrowArguments | [self: RawTransactionArgument<string>];\n}\n/** Borrow the `KioskOwnerCap` from the `PersonalKioskCap` object. */\nexport function borrow(options: BorrowOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'borrow',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BorrowMutArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowMutOptions {\n\tpackage?: string;\n\targuments: BorrowMutArguments | [self: RawTransactionArgument<string>];\n}\n/** Mutably borrow the `KioskOwnerCap` from the `PersonalKioskCap` object. */\nexport function borrowMut(options: BorrowMutOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'borrow_mut',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BorrowValArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowValOptions {\n\tpackage?: string;\n\targuments: BorrowValArguments | [self: RawTransactionArgument<string>];\n}\n/**\n * Borrow the `KioskOwnerCap` from the `PersonalKioskCap` object; `Borrow`\n * hot-potato makes sure that the Cap is returned via `return_val` call.\n */\nexport function borrowVal(options: BorrowValOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'borrow_val',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface ReturnValArguments {\n\tself: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\tborrow: RawTransactionArgument<string>;\n}\nexport interface ReturnValOptions {\n\tpackage?: string;\n\targuments:\n\t\t| ReturnValArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\tborrow: RawTransactionArgument<string>,\n\t\t ];\n}\n/** Return the Cap to the PersonalKioskCap object. */\nexport function returnVal(options: ReturnValOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'cap', 'borrow'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'return_val',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface IsPersonalArguments {\n\tkiosk: RawTransactionArgument<string>;\n}\nexport interface IsPersonalOptions {\n\tpackage?: string;\n\targuments: IsPersonalArguments | [kiosk: RawTransactionArgument<string>];\n}\n/** Check if the Kiosk is \"personal\". */\nexport function isPersonal(options: IsPersonalOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'is_personal',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface OwnerArguments {\n\tkiosk: RawTransactionArgument<string>;\n}\nexport interface OwnerOptions {\n\tpackage?: string;\n\targuments: OwnerArguments | [kiosk: RawTransactionArgument<string>];\n}\n/** Get the owner of the Kiosk if the Kiosk is \"personal\". Aborts otherwise. */\nexport function owner(options: OwnerOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface TryOwnerArguments {\n\tkiosk: RawTransactionArgument<string>;\n}\nexport interface TryOwnerOptions {\n\tpackage?: string;\n\targuments: TryOwnerArguments | [kiosk: RawTransactionArgument<string>];\n}\n/**\n * Try to get the owner of the Kiosk if the Kiosk is \"personal\". Returns None\n * otherwise.\n */\nexport function tryOwner(options: TryOwnerOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'try_owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface TransferToSenderArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TransferToSenderOptions {\n\tpackage?: string;\n\targuments: TransferToSenderArguments | [self: RawTransactionArgument<string>];\n}\n/** Transfer the `PersonalKioskCap` to the transaction sender. */\nexport function transferToSender(options: TransferToSenderOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'transfer_to_sender',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,cAAc;AACpB,MAAa,mBAAmB,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,KAAK,IAAI,OAAOA,cAAoB;EACpC;CACD,CAAC;AACF,MAAa,SAAS,IAAI,WAAW;CACpC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,QAAQ,IAAI;EACZ,UAAU,IAAI;EACd;CACD,CAAC;AACF,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,mBAAmB,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,UAAU,IAAI,SACd;CACD,CAAC;;;;;;AAuCF,SAAgB,KAAK,SAAqB;CACzC,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,SAAS,MAAM;AACvC,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;;;;AAoFJ,SAAgB,UAAU,SAA2B;CACpD,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,KAAK;CAC7B,MAAM,iBAAiB,CAAC,OAAO;AAC/B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;AAkBJ,SAAgB,UAAU,SAA2B;CACpD,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAK;CACzC,MAAM,iBAAiB;EAAC;EAAQ;EAAO;EAAS;AAChD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;AAyEJ,SAAgB,iBAAiB,SAAkC;CAClE,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,KAAK;CAC7B,MAAM,iBAAiB,CAAC,OAAO;AAC/B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC"}
|
|
1
|
+
{"version":3,"file":"personal_kiosk.mjs","names":["kiosk.KioskOwnerCap"],"sources":["../../../src/contracts/kiosk/personal_kiosk.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module provides a wrapper for the KioskOwnerCap that makes the\n * Kiosk non-transferable and \"owned\".\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as kiosk from './deps/sui/kiosk.js';\nconst $moduleName = '@local-pkg/kiosk::personal_kiosk';\nexport const PersonalKioskCap = new MoveStruct({\n\tname: `${$moduleName}::PersonalKioskCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tcap: bcs.option(kiosk.KioskOwnerCap),\n\t},\n});\nexport const Borrow = new MoveStruct({\n\tname: `${$moduleName}::Borrow`,\n\tfields: {\n\t\tcap_id: bcs.Address,\n\t\towned_id: bcs.Address,\n\t},\n});\nexport const OwnerMarker = new MoveStruct({\n\tname: `${$moduleName}::OwnerMarker`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const NewPersonalKiosk = new MoveStruct({\n\tname: `${$moduleName}::NewPersonalKiosk`,\n\tfields: {\n\t\tkiosk_id: bcs.Address,\n\t},\n});\nexport interface DefaultArguments {\n\tkiosk: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface DefaultOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DefaultArguments\n\t\t| [kiosk: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n}\n/** The default setup for the PersonalKioskCap. */\nexport function _default(options: DefaultOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'default',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface NewArguments {\n\tkiosk: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface NewOptions {\n\tpackage?: string;\n\targuments:\n\t\t| NewArguments\n\t\t| [kiosk: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n}\n/**\n * Wrap the KioskOwnerCap making the Kiosk \"owned\" and non-transferable. The\n * `PersonalKioskCap` is returned to allow chaining within a PTB, but the value\n * must be consumed by the `transfer_to_sender` call in any case.\n */\nexport function _new(options: NewOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'new',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface CreateForArguments {\n\tkiosk: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\trecipient: RawTransactionArgument<string>;\n}\nexport interface CreateForOptions {\n\tpackage?: string;\n\targuments:\n\t\t| CreateForArguments\n\t\t| [\n\t\t\t\tkiosk: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\trecipient: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * Create a `PersonalKiosk` for `recipient`. This is useful when (e.g.) an admin\n * account wants to mint an asset with royalty enforcement on behalf of a user.\n */\nexport function createFor(options: CreateForOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, 'address'] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk', 'cap', 'recipient'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'create_for',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BorrowArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowOptions {\n\tpackage?: string;\n\targuments: BorrowArguments | [self: RawTransactionArgument<string>];\n}\n/** Borrow the `KioskOwnerCap` from the `PersonalKioskCap` object. */\nexport function borrow(options: BorrowOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'borrow',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BorrowMutArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowMutOptions {\n\tpackage?: string;\n\targuments: BorrowMutArguments | [self: RawTransactionArgument<string>];\n}\n/** Mutably borrow the `KioskOwnerCap` from the `PersonalKioskCap` object. */\nexport function borrowMut(options: BorrowMutOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'borrow_mut',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface BorrowValArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface BorrowValOptions {\n\tpackage?: string;\n\targuments: BorrowValArguments | [self: RawTransactionArgument<string>];\n}\n/**\n * Borrow the `KioskOwnerCap` from the `PersonalKioskCap` object; `Borrow`\n * hot-potato makes sure that the Cap is returned via `return_val` call.\n */\nexport function borrowVal(options: BorrowValOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'borrow_val',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface ReturnValArguments {\n\tself: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\tborrow: TransactionArgument;\n}\nexport interface ReturnValOptions {\n\tpackage?: string;\n\targuments:\n\t\t| ReturnValArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\tborrow: TransactionArgument,\n\t\t ];\n}\n/** Return the Cap to the PersonalKioskCap object. */\nexport function returnVal(options: ReturnValOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'cap', 'borrow'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'return_val',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface IsPersonalArguments {\n\tkiosk: RawTransactionArgument<string>;\n}\nexport interface IsPersonalOptions {\n\tpackage?: string;\n\targuments: IsPersonalArguments | [kiosk: RawTransactionArgument<string>];\n}\n/** Check if the Kiosk is \"personal\". */\nexport function isPersonal(options: IsPersonalOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'is_personal',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface OwnerArguments {\n\tkiosk: RawTransactionArgument<string>;\n}\nexport interface OwnerOptions {\n\tpackage?: string;\n\targuments: OwnerArguments | [kiosk: RawTransactionArgument<string>];\n}\n/** Get the owner of the Kiosk if the Kiosk is \"personal\". Aborts otherwise. */\nexport function owner(options: OwnerOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface TryOwnerArguments {\n\tkiosk: RawTransactionArgument<string>;\n}\nexport interface TryOwnerOptions {\n\tpackage?: string;\n\targuments: TryOwnerArguments | [kiosk: RawTransactionArgument<string>];\n}\n/**\n * Try to get the owner of the Kiosk if the Kiosk is \"personal\". Returns None\n * otherwise.\n */\nexport function tryOwner(options: TryOwnerOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'try_owner',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface TransferToSenderArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TransferToSenderOptions {\n\tpackage?: string;\n\targuments: TransferToSenderArguments | [self: RawTransactionArgument<string>];\n}\n/** Transfer the `PersonalKioskCap` to the transaction sender. */\nexport function transferToSender(options: TransferToSenderOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk',\n\t\t\tfunction: 'transfer_to_sender',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,cAAc;AACpB,MAAa,mBAAmB,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,KAAK,IAAI,OAAOA,cAAoB;EACpC;CACD,CAAC;AACF,MAAa,SAAS,IAAI,WAAW;CACpC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,QAAQ,IAAI;EACZ,UAAU,IAAI;EACd;CACD,CAAC;AACF,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,mBAAmB,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,UAAU,IAAI,SACd;CACD,CAAC;;;;;;AAuCF,SAAgB,KAAK,SAAqB;CACzC,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,SAAS,MAAM;AACvC,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;;;;AAoFJ,SAAgB,UAAU,SAA2B;CACpD,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,KAAK;CAC7B,MAAM,iBAAiB,CAAC,OAAO;AAC/B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;AAkBJ,SAAgB,UAAU,SAA2B;CACpD,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAK;CACzC,MAAM,iBAAiB;EAAC;EAAQ;EAAO;EAAS;AAChD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;AAyEJ,SAAgB,iBAAiB,SAAkC;CAClE,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,KAAK;CAC7B,MAAM,iBAAiB,CAAC,OAAO;AAC/B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personal_kiosk_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/personal_kiosk_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which checks that the Kiosk is\n * \"personal\" meaning that the owner cannot change. By default, `KioskOwnerCap` can\n * be transferred and owned by an application therefore the owner of the Kiosk is\n * not fixed.\n *\n * Configuration:\n *\n * - None\n *\n * Use cases:\n *\n * - Strong royalty enforcement - personal Kiosks cannot be transferred with the\n * assets inside which means that the item will never change the owner.\n *\n * Notes:\n *\n * - Combination of `kiosk_lock_rule` and `personal_kiosk_rule` can be used to\n * enforce policies on every trade (item can be transferred only through a\n * trade + Kiosk is fixed to the owner).\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::personal_kiosk_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [policy: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Add the \"owned\" rule to the KioskOwnerCap. */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProveArguments {\n\tkiosk: RawTransactionArgument<string>;\n\trequest:
|
|
1
|
+
{"version":3,"file":"personal_kiosk_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/personal_kiosk_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which checks that the Kiosk is\n * \"personal\" meaning that the owner cannot change. By default, `KioskOwnerCap` can\n * be transferred and owned by an application therefore the owner of the Kiosk is\n * not fixed.\n *\n * Configuration:\n *\n * - None\n *\n * Use cases:\n *\n * - Strong royalty enforcement - personal Kiosks cannot be transferred with the\n * assets inside which means that the item will never change the owner.\n *\n * Notes:\n *\n * - Combination of `kiosk_lock_rule` and `personal_kiosk_rule` can be used to\n * enforce policies on every trade (item can be transferred only through a\n * trade + Kiosk is fixed to the owner).\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::personal_kiosk_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [policy: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Add the \"owned\" rule to the KioskOwnerCap. */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ProveArguments {\n\tkiosk: RawTransactionArgument<string>;\n\trequest: TransactionArgument;\n}\nexport interface ProveOptions {\n\tpackage?: string;\n\targuments: ProveArguments | [kiosk: RawTransactionArgument<string>, request: TransactionArgument];\n\ttypeArguments: [string];\n}\n/**\n * Make sure that the destination Kiosk has the Owner key. Item is already placed\n * by the time this check is performed - otherwise fails.\n */\nexport function prove(options: ProveOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['kiosk', 'request'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'personal_kiosk_rule',\n\t\t\tfunction: 'prove',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,cAAc;AACpB,MAAa,OAAO,IAAI,WAAW;CAClC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;;AAaF,SAAgB,IAAI,SAAqB;CACxC,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,UAAU,MAAM;AACxC,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;;;;;AAeJ,SAAgB,MAAM,SAAuB;CAC5C,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,SAAS,UAAU;AAC3C,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"royalty_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/royalty_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which requires a payment on a purchase.\n * The payment amount can be either a fixed amount (min_amount) or a percentage of\n * the purchase price (amount_bp). Or both: the higher of the two is used.\n *\n * Configuration:\n *\n * - amount_bp - the percentage of the purchase price to be paid as a fee,\n * denominated in basis points (100_00 = 100%, 1 = 0.01%).\n * - min_amount - the minimum amount to be paid as a fee if the relative amount is\n * lower than this setting.\n *\n * Use cases:\n *\n * - Percentage-based Royalty fee for the creator of the NFT.\n * - Fixed commission fee on a trade.\n * - A mix of both: the higher of the two is used.\n *\n * Notes:\n *\n * - To use it as a fixed commission set the `amount_bp` to 0 and use the\n * `min_amount` to set the fixed amount.\n * - To use it as a percentage-based fee set the `min_amount` to 0 and use the\n * `amount_bp` to set the percentage.\n * - To use it as a mix of both set the `min_amount` to the min amount acceptable\n * and the `amount_bp` to the percentage of the purchase price. The higher of the\n * two will be used.\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::royalty_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const Config = new MoveStruct({\n\tname: `${$moduleName}::Config`,\n\tfields: {\n\t\tamount_bp: bcs.u16(),\n\t\tmin_amount: bcs.u64(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\tamountBp: RawTransactionArgument<number>;\n\tminAmount: RawTransactionArgument<number | bigint>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [\n\t\t\t\tpolicy: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\tamountBp: RawTransactionArgument<number>,\n\t\t\t\tminAmount: RawTransactionArgument<number | bigint>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Creator action: Add the Royalty Rule for the `T`. Pass in the `TransferPolicy`,\n * `TransferPolicyCap` and the configuration for the policy: `amount_bp` and\n * `min_amount`.\n */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, 'u16', 'u64'] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap', 'amountBp', 'minAmount'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'royalty_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PayArguments {\n\tpolicy: RawTransactionArgument<string>;\n\trequest:
|
|
1
|
+
{"version":3,"file":"royalty_rule.mjs","names":[],"sources":["../../../src/contracts/kiosk/royalty_rule.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Description: This module defines a Rule which requires a payment on a purchase.\n * The payment amount can be either a fixed amount (min_amount) or a percentage of\n * the purchase price (amount_bp). Or both: the higher of the two is used.\n *\n * Configuration:\n *\n * - amount_bp - the percentage of the purchase price to be paid as a fee,\n * denominated in basis points (100_00 = 100%, 1 = 0.01%).\n * - min_amount - the minimum amount to be paid as a fee if the relative amount is\n * lower than this setting.\n *\n * Use cases:\n *\n * - Percentage-based Royalty fee for the creator of the NFT.\n * - Fixed commission fee on a trade.\n * - A mix of both: the higher of the two is used.\n *\n * Notes:\n *\n * - To use it as a fixed commission set the `amount_bp` to 0 and use the\n * `min_amount` to set the fixed amount.\n * - To use it as a percentage-based fee set the `min_amount` to 0 and use the\n * `amount_bp` to set the percentage.\n * - To use it as a mix of both set the `min_amount` to the min amount acceptable\n * and the `amount_bp` to the percentage of the purchase price. The higher of the\n * two will be used.\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nconst $moduleName = '@local-pkg/kiosk::royalty_rule';\nexport const Rule = new MoveStruct({\n\tname: `${$moduleName}::Rule`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const Config = new MoveStruct({\n\tname: `${$moduleName}::Config`,\n\tfields: {\n\t\tamount_bp: bcs.u16(),\n\t\tmin_amount: bcs.u64(),\n\t},\n});\nexport interface AddArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tcap: RawTransactionArgument<string>;\n\tamountBp: RawTransactionArgument<number>;\n\tminAmount: RawTransactionArgument<number | bigint>;\n}\nexport interface AddOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddArguments\n\t\t| [\n\t\t\t\tpolicy: RawTransactionArgument<string>,\n\t\t\t\tcap: RawTransactionArgument<string>,\n\t\t\t\tamountBp: RawTransactionArgument<number>,\n\t\t\t\tminAmount: RawTransactionArgument<number | bigint>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Creator action: Add the Royalty Rule for the `T`. Pass in the `TransferPolicy`,\n * `TransferPolicyCap` and the configuration for the policy: `amount_bp` and\n * `min_amount`.\n */\nexport function add(options: AddOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, 'u16', 'u64'] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'cap', 'amountBp', 'minAmount'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'royalty_rule',\n\t\t\tfunction: 'add',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface PayArguments {\n\tpolicy: RawTransactionArgument<string>;\n\trequest: TransactionArgument;\n\tpayment: RawTransactionArgument<string>;\n}\nexport interface PayOptions {\n\tpackage?: string;\n\targuments:\n\t\t| PayArguments\n\t\t| [\n\t\t\t\tpolicy: RawTransactionArgument<string>,\n\t\t\t\trequest: TransactionArgument,\n\t\t\t\tpayment: RawTransactionArgument<string>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/** Buyer action: Pay the royalty fee for the transfer. */\nexport function pay(options: PayOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'request', 'payment'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'royalty_rule',\n\t\t\tfunction: 'pay',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface FeeAmountArguments {\n\tpolicy: RawTransactionArgument<string>;\n\tpaid: RawTransactionArgument<number | bigint>;\n}\nexport interface FeeAmountOptions {\n\tpackage?: string;\n\targuments:\n\t\t| FeeAmountArguments\n\t\t| [policy: RawTransactionArgument<string>, paid: RawTransactionArgument<number | bigint>];\n\ttypeArguments: [string];\n}\n/**\n * Helper function to calculate the amount to be paid for the transfer. Can be used\n * dry-runned to estimate the fee amount based on the Kiosk listing price.\n */\nexport function feeAmount(options: FeeAmountOptions) {\n\tconst packageAddress = options.package ?? '@local-pkg/kiosk';\n\tconst argumentsTypes = [null, 'u64'] satisfies (string | null)[];\n\tconst parameterNames = ['policy', 'paid'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'royalty_rule',\n\t\t\tfunction: 'fee_amount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,cAAc;AACpB,MAAa,OAAO,IAAI,WAAW;CAClC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,SAAS,IAAI,WAAW;CACpC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,WAAW,IAAI,KAAK;EACpB,YAAY,IAAI,KAAK;EACrB;CACD,CAAC;;;;;;AAwBF,SAAgB,IAAI,SAAqB;CACxC,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAO;EAAM;CACjD,MAAM,iBAAiB;EAAC;EAAU;EAAO;EAAY;EAAY;AACjE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;;AAmBJ,SAAgB,IAAI,SAAqB;CACxC,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAK;CACzC,MAAM,iBAAiB;EAAC;EAAU;EAAW;EAAU;AACvD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;;;;;AAiBJ,SAAgB,UAAU,SAA2B;CACpD,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,MAAM;CACpC,MAAM,iBAAiB,CAAC,UAAU,OAAO;AACzC,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC"}
|
|
@@ -75,7 +75,8 @@ function normalizeMoveArguments(args, argTypes, parameterNames) {
|
|
|
75
75
|
const bytes = bcsType.serialize(arg);
|
|
76
76
|
normalizedArgs.push((tx) => tx.pure(bytes));
|
|
77
77
|
continue;
|
|
78
|
-
}
|
|
78
|
+
}
|
|
79
|
+
if (typeof arg === "string") {
|
|
79
80
|
normalizedArgs.push((tx) => tx.object(arg));
|
|
80
81
|
continue;
|
|
81
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["SUI_FRAMEWORK_ADDRESS","val"],"sources":["../../../src/contracts/utils/index.ts"],"sourcesContent":["import {\n\tbcs,\n\ttype BcsType,\n\ttype TypeTag,\n\tTypeTagSerializer,\n\tBcsStruct,\n\tBcsEnum,\n\tBcsTuple,\n} from '@mysten/sui/bcs';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\nimport { type TransactionArgument, isArgument } from '@mysten/sui/transactions';\nimport { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';\n\nconst MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');\nconst SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');\n\nexport type RawTransactionArgument<T> = T | TransactionArgument;\n\nexport
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["SUI_FRAMEWORK_ADDRESS","val"],"sources":["../../../src/contracts/utils/index.ts"],"sourcesContent":["import {\n\tbcs,\n\ttype BcsType,\n\ttype TypeTag,\n\tTypeTagSerializer,\n\tBcsStruct,\n\tBcsEnum,\n\tBcsTuple,\n} from '@mysten/sui/bcs';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\nimport { type TransactionArgument, isArgument } from '@mysten/sui/transactions';\nimport { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';\n\nconst MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');\nconst SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');\n\nexport type RawTransactionArgument<T> = T | TransactionArgument;\n\nexport type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =\n\tSuiClientTypes.GetObjectOptions<Include> & { client: ClientWithCoreApi };\n\nexport type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =\n\tSuiClientTypes.GetObjectsOptions<Include> & { client: ClientWithCoreApi };\n\nexport function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null {\n\tconst parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;\n\n\tif ('u8' in parsedTag) {\n\t\treturn bcs.U8;\n\t} else if ('u16' in parsedTag) {\n\t\treturn bcs.U16;\n\t} else if ('u32' in parsedTag) {\n\t\treturn bcs.U32;\n\t} else if ('u64' in parsedTag) {\n\t\treturn bcs.U64;\n\t} else if ('u128' in parsedTag) {\n\t\treturn bcs.U128;\n\t} else if ('u256' in parsedTag) {\n\t\treturn bcs.U256;\n\t} else if ('address' in parsedTag) {\n\t\treturn bcs.Address;\n\t} else if ('bool' in parsedTag) {\n\t\treturn bcs.Bool;\n\t} else if ('vector' in parsedTag) {\n\t\tconst type = getPureBcsSchema(parsedTag.vector);\n\t\treturn type ? bcs.vector(type) : null;\n\t} else if ('struct' in parsedTag) {\n\t\tconst structTag = parsedTag.struct;\n\t\tconst pkg = normalizeSuiAddress(structTag.address);\n\n\t\tif (pkg === MOVE_STDLIB_ADDRESS) {\n\t\t\tif (\n\t\t\t\t(structTag.module === 'ascii' || structTag.module === 'string') &&\n\t\t\t\tstructTag.name === 'String'\n\t\t\t) {\n\t\t\t\treturn bcs.String;\n\t\t\t}\n\n\t\t\tif (structTag.module === 'option' && structTag.name === 'Option') {\n\t\t\t\tconst type = getPureBcsSchema(structTag.typeParams[0]);\n\t\t\t\treturn type ? bcs.option(type) : null;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tpkg === SUI_FRAMEWORK_ADDRESS &&\n\t\t\tstructTag.module === 'object' &&\n\t\t\t(structTag.name === 'ID' || structTag.name === 'UID')\n\t\t) {\n\t\t\treturn bcs.Address;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function normalizeMoveArguments(\n\targs: unknown[] | object,\n\targTypes: readonly (string | null)[],\n\tparameterNames?: string[],\n) {\n\tconst argLen = Array.isArray(args) ? args.length : Object.keys(args).length;\n\tif (parameterNames && argLen !== parameterNames.length) {\n\t\tthrow new Error(\n\t\t\t`Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`,\n\t\t);\n\t}\n\n\tconst normalizedArgs: TransactionArgument[] = [];\n\n\tlet index = 0;\n\tfor (const [i, argType] of argTypes.entries()) {\n\t\tif (argType === '0x2::clock::Clock') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.clock());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x2::random::Random') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.random());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x2::deny_list::DenyList') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.denyList());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x3::sui_system::SuiSystemState') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.system());\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet arg;\n\t\tif (Array.isArray(args)) {\n\t\t\tif (index >= args.length) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\targ = args[index];\n\t\t} else {\n\t\t\tif (!parameterNames) {\n\t\t\t\tthrow new Error(`Expected arguments to be passed as an array`);\n\t\t\t}\n\t\t\tconst name = parameterNames[index];\n\t\t\targ = args[name as keyof typeof args];\n\n\t\t\tif (arg === undefined) {\n\t\t\t\tthrow new Error(`Parameter ${name} is required`);\n\t\t\t}\n\t\t}\n\n\t\tindex += 1;\n\n\t\tif (typeof arg === 'function' || isArgument(arg)) {\n\t\t\tnormalizedArgs.push(arg as TransactionArgument);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst type = argTypes[i];\n\t\tconst bcsType = type === null ? null : getPureBcsSchema(type);\n\n\t\tif (bcsType) {\n\t\t\tconst bytes = bcsType.serialize(arg as never);\n\t\t\tnormalizedArgs.push((tx) => tx.pure(bytes));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof arg === 'string') {\n\t\t\tnormalizedArgs.push((tx) => tx.object(arg));\n\t\t\tcontinue;\n\t\t}\n\n\t\tthrow new Error(`Invalid argument ${stringify(arg)} for type ${type}`);\n\t}\n\n\treturn normalizedArgs;\n}\n\nexport class MoveStruct<\n\tT extends Record<string, BcsType<any>>,\n\tconst Name extends string = string,\n> extends BcsStruct<T, Name> {\n\tasync get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({\n\t\tobjectId,\n\t\t...options\n\t}: GetOptions<Include>): Promise<\n\t\tSuiClientTypes.Object<Include & { content: true; json: true }> & {\n\t\t\tjson: BcsStruct<T>['$inferType'];\n\t\t}\n\t> {\n\t\tconst [res] = await this.getMany<Include>({\n\t\t\t...options,\n\t\t\tobjectIds: [objectId],\n\t\t});\n\n\t\treturn res;\n\t}\n\n\tasync getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({\n\t\tclient,\n\t\t...options\n\t}: GetManyOptions<Include>): Promise<\n\t\tArray<\n\t\t\tSuiClientTypes.Object<Include & { content: true; json: true }> & {\n\t\t\t\tjson: BcsStruct<T>['$inferType'];\n\t\t\t}\n\t\t>\n\t> {\n\t\tconst response = (await client.core.getObjects({\n\t\t\t...options,\n\t\t\tinclude: {\n\t\t\t\t...options.include,\n\t\t\t\tcontent: true,\n\t\t\t},\n\t\t})) as SuiClientTypes.GetObjectsResponse<Include & { content: true }>;\n\n\t\treturn response.objects.map((obj) => {\n\t\t\tif (obj instanceof Error) {\n\t\t\t\tthrow obj;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...obj,\n\t\t\t\tjson: this.parse(obj.content),\n\t\t\t};\n\t\t});\n\t}\n}\n\nexport class MoveEnum<\n\tT extends Record<string, BcsType<any> | null>,\n\tconst Name extends string,\n> extends BcsEnum<T, Name> {}\n\nexport class MoveTuple<\n\tconst T extends readonly BcsType<any>[],\n\tconst Name extends string,\n> extends BcsTuple<T, Name> {}\n\nfunction stringify(val: unknown) {\n\tif (typeof val === 'object') {\n\t\treturn JSON.stringify(val, (val: unknown) => val);\n\t}\n\tif (typeof val === 'bigint') {\n\t\treturn val.toString();\n\t}\n\n\treturn val;\n}\n"],"mappings":"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"}
|
package/docs/from-v1.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Migrating from Kiosk SDK V1
|
|
2
2
|
|
|
3
|
-
> Migrate from Kiosk SDK v1 to the current version
|
|
3
|
+
> Migrate from Kiosk SDK v1 to the current version with the builder-pattern API.
|
|
4
4
|
|
|
5
5
|
The original version of Kiosk SDK provided basic experimentation with the Kiosk API. The new version
|
|
6
6
|
of the SDK (0.7+) provides a more robust experience for building kiosk/transfer policy transactions.
|
package/docs/index.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Kiosk SDK
|
|
2
2
|
|
|
3
|
-
> TypeScript SDK for interacting with Sui Kiosk
|
|
3
|
+
> TypeScript SDK for interacting with Sui Kiosk onchain commerce.
|
|
4
4
|
|
|
5
|
-
Kiosk SDK is a tool to interact with Sui
|
|
6
|
-
build transactions to interact, and extend Kiosk to support custom rules.
|
|
5
|
+
Kiosk SDK is a tool to interact with Sui and Mysten Kiosk. You can use it to query kiosk related
|
|
6
|
+
data, build transactions to interact, and extend Kiosk to support custom rules.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
@@ -14,9 +14,9 @@ npm i @mysten/kiosk
|
|
|
14
14
|
## About
|
|
15
15
|
|
|
16
16
|
The Kiosk SDK exports a client extension that integrates with Sui clients. Add it to your client
|
|
17
|
-
using `$extend(kiosk())` to access kiosk functionality
|
|
17
|
+
using `$extend(kiosk())` to access kiosk functionality through `client.kiosk`.
|
|
18
18
|
|
|
19
|
-
>
|
|
19
|
+
> The Kiosk SDK requires `SuiJsonRpcClient` or `SuiGraphQLClient`. It does not work with
|
|
20
20
|
> `SuiGrpcClient` because it uses event queries that are not available in gRPC.
|
|
21
21
|
|
|
22
22
|
- [Read more about setting up the Kiosk client extension](/kiosk/kiosk-client/introduction)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Kiosk Client
|
|
2
2
|
|
|
3
|
-
> Introduction to the KioskClient for querying and managing kiosks
|
|
3
|
+
> Introduction to the KioskClient extension for querying and managing kiosks on Sui.
|
|
4
4
|
|
|
5
5
|
The Kiosk SDK exports a client extension that provides all Kiosk functionality.
|
|
6
6
|
|
|
7
|
-
> We recommend you keep only one client instance throughout your
|
|
7
|
+
> We recommend you keep only one client instance throughout your app or script. For example, in
|
|
8
8
|
> React, you'd use a context to provide the client.
|
|
9
9
|
|
|
10
|
-
>
|
|
10
|
+
> The Kiosk SDK requires `SuiJsonRpcClient` or `SuiGraphQLClient`. It does not work with
|
|
11
11
|
> `SuiGrpcClient` because it uses event queries that are not available in gRPC.
|
|
12
12
|
|
|
13
13
|
## Setting up the kiosk extension
|
|
@@ -15,8 +15,8 @@ The Kiosk SDK exports a client extension that provides all Kiosk functionality.
|
|
|
15
15
|
Add the kiosk extension to your Sui client using `$extend()`. The extension currently supports
|
|
16
16
|
`mainnet` and `testnet`. See the next section for usage on other networks.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
require constantly changing the package IDs).
|
|
18
|
+
Mysten Kiosk rules and extensions are not supported in Devnet due to network wipes (that would
|
|
19
|
+
require constantly changing the package IDs).
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
const client = new SuiJsonRpcClient({
|
|
@@ -28,7 +28,7 @@ const client = new SuiJsonRpcClient({
|
|
|
28
28
|
const { kioskOwnerCaps } = await client.kiosk.getOwnedKiosks({ address: '0x...' });
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
### Using the kiosk extension on
|
|
31
|
+
### Using the kiosk extension on Devnet or Localnet
|
|
32
32
|
|
|
33
33
|
To use all the functionality of Kiosk SDK outside of `mainnet` and `testnet`, pass the `packageIds`
|
|
34
34
|
for the rules and extensions you want to use.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Examples
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Practical code examples for kiosk transactions including minting, listing, and purchasing.
|
|
4
4
|
|
|
5
|
-
The following
|
|
5
|
+
The following app-focused examples demonstrate how to use the SDK to interact with Kiosk.
|
|
6
6
|
|
|
7
7
|
## Minting into Kiosk example
|
|
8
8
|
|
|
9
|
-
For every scenario using Kiosk in
|
|
9
|
+
For every scenario using Kiosk in apps, the user who has connected their wallet either has at least
|
|
10
10
|
one kiosk already or you must create it for them.
|
|
11
11
|
|
|
12
12
|
The SDK supports the scenario of `silently` creating the kiosk, as part of our Programmable
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# KioskTransaction
|
|
2
2
|
|
|
3
|
-
> Build kiosk transactions for listing, purchasing, and managing items
|
|
3
|
+
> Build kiosk transactions for listing, purchasing, and managing items on Sui.
|
|
4
4
|
|
|
5
5
|
`KioskTransaction` is the client to build transactions that involve Kiosk. It's used similar to
|
|
6
6
|
`Transaction`, and helps in building a transaction.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Managing Owned Kiosk
|
|
2
2
|
|
|
3
|
-
> Manage kiosk items
|
|
3
|
+
> Manage kiosk items by placing, listing, delisting, and withdrawing using the Kiosk SDK.
|
|
4
4
|
|
|
5
5
|
The kiosk extension (`client.kiosk`) helps in managing a kiosk.
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ create a `KioskTransaction`.
|
|
|
9
9
|
|
|
10
10
|
## Available functions
|
|
11
11
|
|
|
12
|
-
### take
|
|
12
|
+
### `take`
|
|
13
13
|
|
|
14
14
|
Removes an item from the Kiosk and returns a `TransactionArgument` to use it in a different
|
|
15
15
|
Programmable Transaction Block (PTB) call.
|
|
@@ -37,7 +37,7 @@ kioskTx.finalize();
|
|
|
37
37
|
await signAndExecuteTransaction({ tx: tx });
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
### transfer
|
|
40
|
+
### `transfer`
|
|
41
41
|
|
|
42
42
|
Similar to `take`, but transfers the item to an address internally.
|
|
43
43
|
|
|
@@ -61,7 +61,7 @@ kioskTx
|
|
|
61
61
|
await signAndExecuteTransaction({ tx: tx });
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
### place
|
|
64
|
+
### `place`
|
|
65
65
|
|
|
66
66
|
Places an item in the kiosk.
|
|
67
67
|
|
|
@@ -83,7 +83,7 @@ kioskTx
|
|
|
83
83
|
await signAndExecuteTransaction({ tx: tx });
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
### list
|
|
86
|
+
### `list`
|
|
87
87
|
|
|
88
88
|
Lists an item for sale (the item must be in the kiosk).
|
|
89
89
|
|
|
@@ -106,7 +106,7 @@ kioskTx
|
|
|
106
106
|
await signAndExecuteTransaction({ tx: tx });
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
### placeAndList
|
|
109
|
+
### `placeAndList`
|
|
110
110
|
|
|
111
111
|
List an item for sale by first placing it in the kiosk (places the item and lists it for sale). It's
|
|
112
112
|
a short hand for `place()` and `list()`.
|
|
@@ -130,7 +130,7 @@ kioskTx
|
|
|
130
130
|
await signAndExecuteTransaction({ tx: tx });
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
### delist
|
|
133
|
+
### `delist`
|
|
134
134
|
|
|
135
135
|
Removes the listing, keeping the item placed in the kiosk.
|
|
136
136
|
|
|
@@ -152,7 +152,7 @@ kioskTx
|
|
|
152
152
|
await signAndExecuteTransaction({ tx: tx });
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
### withdraw
|
|
155
|
+
### `withdraw`
|
|
156
156
|
|
|
157
157
|
Withdraw (all or specific amount) from a kiosk.
|
|
158
158
|
|
|
@@ -168,7 +168,7 @@ kioskTx.withdraw('address_to_transfer_funds', 100000n).finalize();
|
|
|
168
168
|
await signAndExecuteTransaction({ tx: tx });
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
### borrowTx (callback)
|
|
171
|
+
### `borrowTx` (callback)
|
|
172
172
|
|
|
173
173
|
Borrows an item from a kiosk. This function follows the `callback` approach, similar to the
|
|
174
174
|
ownerCap. The return of the item happens automatically after the execution of the callback.
|
|
@@ -199,10 +199,10 @@ kioskTx
|
|
|
199
199
|
await signAndExecuteTransaction({ tx: tx });
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
-
### borrow / return
|
|
202
|
+
### `borrow` / `return`
|
|
203
203
|
|
|
204
204
|
Similar to `borrowTx`, borrows an item from the kiosk, but returns two transaction arguments: `item`
|
|
205
|
-
|
|
205
|
+
and `promise`. You can use the `item` in your PTBs, but you must always call the `return()` function
|
|
206
206
|
with the `item` and the `Promise`.
|
|
207
207
|
|
|
208
208
|
```typescript
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Purchasing from a kiosk
|
|
2
2
|
|
|
3
|
-
> Purchase items from kiosks with transfer policy resolution
|
|
3
|
+
> Purchase items from kiosks with automatic transfer policy rule resolution.
|
|
4
4
|
|
|
5
5
|
One of the base functionalities of the SDK is a seamless purchasing flow, allowing for ease of rules
|
|
6
6
|
resolving (hiding away the calls). The SDK supports all four rules by default, and works for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Querying
|
|
2
2
|
|
|
3
|
-
> Query kiosk contents, items, and transfer policies
|
|
3
|
+
> Query kiosk contents, owned kiosks, items, and transfer policies using the Kiosk SDK.
|
|
4
4
|
|
|
5
5
|
You can use `client.kiosk` to query kiosk data. It helps you get owned kiosks for an address, as
|
|
6
6
|
well as fetching all the contents of a specified kiosk.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TransferPolicyTransaction
|
|
2
2
|
|
|
3
|
-
> Create and manage transfer policies for kiosk items
|
|
3
|
+
> Create and manage transfer policies for kiosk items using the Kiosk SDK.
|
|
4
4
|
|
|
5
5
|
`TransferPolicyTransaction` is the client to build transactions that involve transfer policy
|
|
6
6
|
management. It's used similar to `KioskTransaction`, and helps in crafting transactions to manage a
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Using the manager
|
|
2
2
|
|
|
3
|
-
> Use the TransferPolicyTransaction manager
|
|
4
|
-
|
|
5
|
-
# How to use
|
|
3
|
+
> Use the TransferPolicyTransaction manager to add rules and withdraw profits.
|
|
6
4
|
|
|
7
5
|
After following the introduction steps on how to initialize a transfer policy transaction you can
|
|
8
6
|
call any of the available functions to prepare your Programmable Transaction Block (PTB).
|
package/docs/llms-index.md
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
> Interact with on-chain commerce applications
|
|
4
4
|
|
|
5
|
-
- [Kiosk SDK](
|
|
6
|
-
- [Kiosk Client](./kiosk-client/introduction.md): Introduction to the KioskClient for
|
|
7
|
-
managing kiosks
|
|
8
|
-
- [Querying](./kiosk-client/querying.md): Query kiosk contents, items, and transfer
|
|
9
|
-
|
|
10
|
-
- [
|
|
5
|
+
- [Kiosk SDK](..md): TypeScript SDK for interacting with Sui Kiosk onchain commerce.
|
|
6
|
+
- [Kiosk Client](./kiosk-client/introduction.md): Introduction to the KioskClient extension for
|
|
7
|
+
querying and managing kiosks on Sui.
|
|
8
|
+
- [Querying](./kiosk-client/querying.md): Query kiosk contents, owned kiosks, items, and transfer
|
|
9
|
+
policies using the Kiosk SDK.
|
|
10
|
+
- [Advanced Examples](./advanced-examples.md): Advanced Kiosk SDK usage patterns and code examples
|
|
11
|
+
for complex scenarios.
|
|
12
|
+
- [Migrating from Kiosk SDK V1](./from-v1.md): Migrate from Kiosk SDK v1 to the current version with
|
|
13
|
+
the builder-pattern API.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@mysten/kiosk",
|
|
3
3
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
4
4
|
"description": "Sui Kiosk library",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.3",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.mjs",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"vite": "^8.0.5",
|
|
44
44
|
"vitest": "^4.0.17",
|
|
45
45
|
"wait-on": "^9.0.3",
|
|
46
|
-
"@mysten/codegen": "^0.
|
|
47
|
-
"@mysten/sui": "^2.
|
|
46
|
+
"@mysten/codegen": "^0.10.0",
|
|
47
|
+
"@mysten/sui": "^2.16.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@mysten/sui": "^2.
|
|
50
|
+
"@mysten/sui": "^2.16.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "rm -rf dist && tsc --noEmit && tsdown",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
5
5
|
import { bcs, type BcsType } from '@mysten/sui/bcs';
|
|
6
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
6
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
7
7
|
import * as balance from './balance.js';
|
|
8
8
|
const $moduleName = '0x2::kiosk';
|
|
9
9
|
export const Kiosk = new MoveStruct({
|
|
@@ -521,26 +521,6 @@ export function uidMutAsOwner(options: UidMutAsOwnerOptions) {
|
|
|
521
521
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
|
-
export interface SetAllowExtensionsOptions {
|
|
525
|
-
package?: string;
|
|
526
|
-
arguments: [
|
|
527
|
-
RawTransactionArgument<string>,
|
|
528
|
-
RawTransactionArgument<string>,
|
|
529
|
-
RawTransactionArgument<boolean>,
|
|
530
|
-
];
|
|
531
|
-
}
|
|
532
|
-
export function setAllowExtensions(options: SetAllowExtensionsOptions) {
|
|
533
|
-
const packageAddress =
|
|
534
|
-
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
535
|
-
const argumentsTypes = [null, null, 'bool'] satisfies (string | null)[];
|
|
536
|
-
return (tx: Transaction) =>
|
|
537
|
-
tx.moveCall({
|
|
538
|
-
package: packageAddress,
|
|
539
|
-
module: 'kiosk',
|
|
540
|
-
function: 'set_allow_extensions',
|
|
541
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
524
|
export interface UidOptions {
|
|
545
525
|
package?: string;
|
|
546
526
|
arguments: [RawTransactionArgument<string>];
|
|
@@ -705,11 +685,7 @@ export function borrowVal(options: BorrowValOptions) {
|
|
|
705
685
|
}
|
|
706
686
|
export interface ReturnValOptions<T0 extends BcsType<any>> {
|
|
707
687
|
package?: string;
|
|
708
|
-
arguments: [
|
|
709
|
-
RawTransactionArgument<string>,
|
|
710
|
-
RawTransactionArgument<T0>,
|
|
711
|
-
RawTransactionArgument<string>,
|
|
712
|
-
];
|
|
688
|
+
arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>, TransactionArgument];
|
|
713
689
|
typeArguments: [string];
|
|
714
690
|
}
|
|
715
691
|
export function returnVal<T0 extends BcsType<any>>(options: ReturnValOptions<T0>) {
|
|
@@ -795,3 +771,23 @@ export function purchaseCapMinPrice(options: PurchaseCapMinPriceOptions) {
|
|
|
795
771
|
typeArguments: options.typeArguments,
|
|
796
772
|
});
|
|
797
773
|
}
|
|
774
|
+
export interface SetAllowExtensionsOptions {
|
|
775
|
+
package?: string;
|
|
776
|
+
arguments: [
|
|
777
|
+
RawTransactionArgument<string>,
|
|
778
|
+
RawTransactionArgument<string>,
|
|
779
|
+
RawTransactionArgument<boolean>,
|
|
780
|
+
];
|
|
781
|
+
}
|
|
782
|
+
export function setAllowExtensions(options: SetAllowExtensionsOptions) {
|
|
783
|
+
const packageAddress =
|
|
784
|
+
options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
|
|
785
|
+
const argumentsTypes = [null, null, 'bool'] satisfies (string | null)[];
|
|
786
|
+
return (tx: Transaction) =>
|
|
787
|
+
tx.moveCall({
|
|
788
|
+
package: packageAddress,
|
|
789
|
+
module: 'kiosk',
|
|
790
|
+
function: 'set_allow_extensions',
|
|
791
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
|
|
792
|
+
});
|
|
793
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
5
5
|
import { bcs, type BcsType } from '@mysten/sui/bcs';
|
|
6
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
6
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
7
7
|
import * as vec_set from './vec_set.js';
|
|
8
8
|
import * as type_name from './deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.js';
|
|
9
9
|
import * as balance from './balance.js';
|
|
@@ -150,7 +150,7 @@ export function destroyAndWithdraw(options: DestroyAndWithdrawOptions) {
|
|
|
150
150
|
}
|
|
151
151
|
export interface ConfirmRequestOptions {
|
|
152
152
|
package?: string;
|
|
153
|
-
arguments: [RawTransactionArgument<string>,
|
|
153
|
+
arguments: [RawTransactionArgument<string>, TransactionArgument];
|
|
154
154
|
typeArguments: [string];
|
|
155
155
|
}
|
|
156
156
|
export function confirmRequest(options: ConfirmRequestOptions) {
|
|
@@ -238,7 +238,7 @@ export function addToBalance<T1 extends BcsType<any>>(options: AddToBalanceOptio
|
|
|
238
238
|
}
|
|
239
239
|
export interface AddReceiptOptions<T1 extends BcsType<any>> {
|
|
240
240
|
package?: string;
|
|
241
|
-
arguments: [RawTransactionArgument<T1>,
|
|
241
|
+
arguments: [RawTransactionArgument<T1>, TransactionArgument];
|
|
242
242
|
typeArguments: [string, string];
|
|
243
243
|
}
|
|
244
244
|
export function addReceipt<T1 extends BcsType<any>>(options: AddReceiptOptions<T1>) {
|
|
@@ -346,7 +346,7 @@ export function rules(options: RulesOptions) {
|
|
|
346
346
|
}
|
|
347
347
|
export interface ItemOptions {
|
|
348
348
|
package?: string;
|
|
349
|
-
arguments: [
|
|
349
|
+
arguments: [TransactionArgument];
|
|
350
350
|
typeArguments: [string];
|
|
351
351
|
}
|
|
352
352
|
export function item(options: ItemOptions) {
|
|
@@ -364,7 +364,7 @@ export function item(options: ItemOptions) {
|
|
|
364
364
|
}
|
|
365
365
|
export interface PaidOptions {
|
|
366
366
|
package?: string;
|
|
367
|
-
arguments: [
|
|
367
|
+
arguments: [TransactionArgument];
|
|
368
368
|
typeArguments: [string];
|
|
369
369
|
}
|
|
370
370
|
export function paid(options: PaidOptions) {
|
|
@@ -382,7 +382,7 @@ export function paid(options: PaidOptions) {
|
|
|
382
382
|
}
|
|
383
383
|
export interface FromOptions {
|
|
384
384
|
package?: string;
|
|
385
|
-
arguments: [
|
|
385
|
+
arguments: [TransactionArgument];
|
|
386
386
|
typeArguments: [string];
|
|
387
387
|
}
|
|
388
388
|
export function _from(options: FromOptions) {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
20
20
|
import { bcs } from '@mysten/sui/bcs';
|
|
21
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
21
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
22
22
|
const $moduleName = '@local-pkg/kiosk::floor_price_rule';
|
|
23
23
|
export const Rule = new MoveStruct({
|
|
24
24
|
name: `${$moduleName}::Rule`,
|
|
@@ -67,13 +67,13 @@ export function add(options: AddOptions) {
|
|
|
67
67
|
}
|
|
68
68
|
export interface ProveArguments {
|
|
69
69
|
policy: RawTransactionArgument<string>;
|
|
70
|
-
request:
|
|
70
|
+
request: TransactionArgument;
|
|
71
71
|
}
|
|
72
72
|
export interface ProveOptions {
|
|
73
73
|
package?: string;
|
|
74
74
|
arguments:
|
|
75
75
|
| ProveArguments
|
|
76
|
-
| [policy: RawTransactionArgument<string>, request:
|
|
76
|
+
| [policy: RawTransactionArgument<string>, request: TransactionArgument];
|
|
77
77
|
typeArguments: [string];
|
|
78
78
|
}
|
|
79
79
|
/** Buyer action: Prove that the amount is higher or equal to the floor_price. */
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
27
27
|
import { bcs } from '@mysten/sui/bcs';
|
|
28
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
28
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
29
29
|
const $moduleName = '@local-pkg/kiosk::kiosk_lock_rule';
|
|
30
30
|
export const Rule = new MoveStruct({
|
|
31
31
|
name: `${$moduleName}::Rule`,
|
|
@@ -68,14 +68,12 @@ export function add(options: AddOptions) {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
export interface ProveArguments {
|
|
71
|
-
request:
|
|
71
|
+
request: TransactionArgument;
|
|
72
72
|
kiosk: RawTransactionArgument<string>;
|
|
73
73
|
}
|
|
74
74
|
export interface ProveOptions {
|
|
75
75
|
package?: string;
|
|
76
|
-
arguments:
|
|
77
|
-
| ProveArguments
|
|
78
|
-
| [request: RawTransactionArgument<string>, kiosk: RawTransactionArgument<string>];
|
|
76
|
+
arguments: ProveArguments | [request: TransactionArgument, kiosk: RawTransactionArgument<string>];
|
|
79
77
|
typeArguments: [string];
|
|
80
78
|
}
|
|
81
79
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
11
11
|
import { bcs } from '@mysten/sui/bcs';
|
|
12
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
12
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
13
13
|
import * as kiosk from './deps/sui/kiosk.js';
|
|
14
14
|
const $moduleName = '@local-pkg/kiosk::personal_kiosk';
|
|
15
15
|
export const PersonalKioskCap = new MoveStruct({
|
|
@@ -185,7 +185,7 @@ export function borrowVal(options: BorrowValOptions) {
|
|
|
185
185
|
export interface ReturnValArguments {
|
|
186
186
|
self: RawTransactionArgument<string>;
|
|
187
187
|
cap: RawTransactionArgument<string>;
|
|
188
|
-
borrow:
|
|
188
|
+
borrow: TransactionArgument;
|
|
189
189
|
}
|
|
190
190
|
export interface ReturnValOptions {
|
|
191
191
|
package?: string;
|
|
@@ -194,7 +194,7 @@ export interface ReturnValOptions {
|
|
|
194
194
|
| [
|
|
195
195
|
self: RawTransactionArgument<string>,
|
|
196
196
|
cap: RawTransactionArgument<string>,
|
|
197
|
-
borrow:
|
|
197
|
+
borrow: TransactionArgument,
|
|
198
198
|
];
|
|
199
199
|
}
|
|
200
200
|
/** Return the Cap to the PersonalKioskCap object. */
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
28
28
|
import { bcs } from '@mysten/sui/bcs';
|
|
29
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
29
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
30
30
|
const $moduleName = '@local-pkg/kiosk::personal_kiosk_rule';
|
|
31
31
|
export const Rule = new MoveStruct({
|
|
32
32
|
name: `${$moduleName}::Rule`,
|
|
@@ -61,13 +61,11 @@ export function add(options: AddOptions) {
|
|
|
61
61
|
}
|
|
62
62
|
export interface ProveArguments {
|
|
63
63
|
kiosk: RawTransactionArgument<string>;
|
|
64
|
-
request:
|
|
64
|
+
request: TransactionArgument;
|
|
65
65
|
}
|
|
66
66
|
export interface ProveOptions {
|
|
67
67
|
package?: string;
|
|
68
|
-
arguments:
|
|
69
|
-
| ProveArguments
|
|
70
|
-
| [kiosk: RawTransactionArgument<string>, request: RawTransactionArgument<string>];
|
|
68
|
+
arguments: ProveArguments | [kiosk: RawTransactionArgument<string>, request: TransactionArgument];
|
|
71
69
|
typeArguments: [string];
|
|
72
70
|
}
|
|
73
71
|
/**
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
35
35
|
import { bcs } from '@mysten/sui/bcs';
|
|
36
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
36
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
37
37
|
const $moduleName = '@local-pkg/kiosk::royalty_rule';
|
|
38
38
|
export const Rule = new MoveStruct({
|
|
39
39
|
name: `${$moduleName}::Rule`,
|
|
@@ -86,7 +86,7 @@ export function add(options: AddOptions) {
|
|
|
86
86
|
}
|
|
87
87
|
export interface PayArguments {
|
|
88
88
|
policy: RawTransactionArgument<string>;
|
|
89
|
-
request:
|
|
89
|
+
request: TransactionArgument;
|
|
90
90
|
payment: RawTransactionArgument<string>;
|
|
91
91
|
}
|
|
92
92
|
export interface PayOptions {
|
|
@@ -95,7 +95,7 @@ export interface PayOptions {
|
|
|
95
95
|
| PayArguments
|
|
96
96
|
| [
|
|
97
97
|
policy: RawTransactionArgument<string>,
|
|
98
|
-
request:
|
|
98
|
+
request: TransactionArgument,
|
|
99
99
|
payment: RawTransactionArgument<string>,
|
|
100
100
|
];
|
|
101
101
|
typeArguments: [string];
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
23
23
|
import { bcs, type BcsType } from '@mysten/sui/bcs';
|
|
24
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
24
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
25
25
|
const $moduleName = '@local-pkg/kiosk::witness_rule';
|
|
26
26
|
export const Rule = new MoveStruct({
|
|
27
27
|
name: `${$moduleName}::Rule<phantom Proof>`,
|
|
@@ -60,7 +60,7 @@ export function add(options: AddOptions) {
|
|
|
60
60
|
export interface ProveArguments<Proof extends BcsType<any>> {
|
|
61
61
|
Proof: RawTransactionArgument<Proof>;
|
|
62
62
|
policy: RawTransactionArgument<string>;
|
|
63
|
-
request:
|
|
63
|
+
request: TransactionArgument;
|
|
64
64
|
}
|
|
65
65
|
export interface ProveOptions<Proof extends BcsType<any>> {
|
|
66
66
|
package?: string;
|
|
@@ -69,7 +69,7 @@ export interface ProveOptions<Proof extends BcsType<any>> {
|
|
|
69
69
|
| [
|
|
70
70
|
Proof: RawTransactionArgument<Proof>,
|
|
71
71
|
policy: RawTransactionArgument<string>,
|
|
72
|
-
request:
|
|
72
|
+
request: TransactionArgument,
|
|
73
73
|
];
|
|
74
74
|
typeArguments: [string, string];
|
|
75
75
|
}
|
|
@@ -16,17 +16,11 @@ const SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');
|
|
|
16
16
|
|
|
17
17
|
export type RawTransactionArgument<T> = T | TransactionArgument;
|
|
18
18
|
|
|
19
|
-
export
|
|
20
|
-
Include
|
|
21
|
-
> extends SuiClientTypes.GetObjectOptions<Include> {
|
|
22
|
-
client: ClientWithCoreApi;
|
|
23
|
-
}
|
|
19
|
+
export type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =
|
|
20
|
+
SuiClientTypes.GetObjectOptions<Include> & { client: ClientWithCoreApi };
|
|
24
21
|
|
|
25
|
-
export
|
|
26
|
-
Include
|
|
27
|
-
> extends SuiClientTypes.GetObjectsOptions<Include> {
|
|
28
|
-
client: ClientWithCoreApi;
|
|
29
|
-
}
|
|
22
|
+
export type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =
|
|
23
|
+
SuiClientTypes.GetObjectsOptions<Include> & { client: ClientWithCoreApi };
|
|
30
24
|
|
|
31
25
|
export function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null {
|
|
32
26
|
const parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;
|
|
@@ -150,7 +144,9 @@ export function normalizeMoveArguments(
|
|
|
150
144
|
const bytes = bcsType.serialize(arg as never);
|
|
151
145
|
normalizedArgs.push((tx) => tx.pure(bytes));
|
|
152
146
|
continue;
|
|
153
|
-
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (typeof arg === 'string') {
|
|
154
150
|
normalizedArgs.push((tx) => tx.object(arg));
|
|
155
151
|
continue;
|
|
156
152
|
}
|