{"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\tAddArguments | [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;;AAYF,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"}