Skip to main content

@iota/kiosk

Classes

ClassDescription
KioskClientA Client that allows you to interact with kiosk. Offers utilities to query kiosk, craft transactions to edit your own kiosk, purchase, manage transfer policies, create new kiosks etc. If you pass packageIds, all functionality will be managed using these packages.
KioskTransactionA helper for building transactions that involve kiosk.
TransferPolicyTransaction-

Type Aliases

Type AliasDescription
KioskTransactionParams-
TransferPolicyBaseParams-
TransferPolicyTransactionParams-
BaseRulePackageIdsThe base rule package ids that can be extended
TransferPolicyRuleThe Transfer Policy rule.
ObjectArgumentA valid argument for any of the Kiosk functions.
KioskClientOptionsThe Client Options for Both KioskClient & TransferPolicyManager.
KioskThe Kiosk object fields (for BCS queries).
PurchaseCapPurchaseCap object fields (for BCS queries).
PurchaseAndResolvePoliciesResponseThe response type of a successful purchase flow. Returns the item, and a canTransfer param.
PurchaseOptionalParamsOptional parameters for purchaseAndResolvePolicies flow. This gives us the chance to extend the function in further releases without introducing more breaking changes.
KioskListingA dynamic field Listing { ID, isExclusive } attached to the Kiosk. Holds a u64 value - the price of the item.
KioskItemA dynamic field Item { ID } attached to the Kiosk. Holds an Item T. The type of the item is known upfront.
KioskExtensionOverviewThe overview type returned from getKiosk
KioskExtensionHold the KioskExtension data
KioskDataAggregated data from the Kiosk.
PagedKioskData-
FetchKioskOptions-
OwnedKiosks-
KioskOwnerCap-
PurchaseOptions-
ItemId-
ItemReference-
ItemValue-
Price-
TransferPolicyCapThe Transfer Policy Cap in a consumable way.
TransferPolicyThe TransferPolicy object
TransferPolicyCreatedEvent emitted when a TransferPolicy is created.
RuleResolvingParams-

Variables

VariableDescription
rules-
KIOSK_MODULEThe Kiosk module.
KIOSK_TYPEThe Kiosk type.
KIOSK_OWNER_CAPThe Kiosk Owner Cap Type
KIOSK_ITEMThe Kiosk Item Type
KIOSK_LISTINGThe Kiosk Listing Type
KIOSK_LOCKThe Kiosk Lock Type
KIOSK_PURCHASE_CAPThe Kiosk PurchaseCap type
TRANSFER_POLICY_MODULEThe Transfer Policy module.
TRANSFER_POLICY_CREATED_EVENTName of the event emitted when a TransferPolicy for T is created.
TRANSFER_POLICY_TYPEThe Transfer Policy Type
TRANSFER_POLICY_CAP_TYPEThe Transfer Policy Cap Type
KIOSK_LOCK_RULEThe Kiosk Lock Rule
ROYALTY_RULEThe Royalty rule

Functions

FunctionDescription
getBaseRulesConstructs a list of rule resolvers based on the params.
getKioskObject-
extractKioskData-
attachListingsAndPricesA helper that attaches the listing prices to kiosk listings.
attachObjectsA helper that attaches the listing prices to kiosk listings.
attachLockedItemsA Helper to attach locked state to items in Kiosk Data.
getAllDynamicFieldsA helper to fetch all DF pages. We need that to fetch the kiosk DFs consistently, until we have RPC calls that allow filtering of Type / batch fetching of spec
getAllObjectsA helper to fetch all objects that works with pagination. It will fetch all objects in the array, and limit it to 50/request. Requests are sent using Promise.all.
getAllOwnedObjectsA helper to return all owned objects, with an optional filter. It parses all the pages and returns the data.
percentageToBasisPointsConverts a number to basis points. Supports up to 2 decimal points. E.g 9.95 -> 995
parseTransferPolicyCapObjectA helper to parse a transfer policy Cap into a usable object.
getNormalizedRuleType-