Purchasing from a kiosk
One of the base functionalities of the SDK is a seamless purchasing flow, allowing for ease of rules
resolving (hiding away the calls). The SDK supports all four rules by default, and works for
TESTNET
and MAINNET
. To support other networks,
follow the instructions in the Introduction.
How to purchase
By default, the SDK places the item in the caller's kiosk, unless there's a lock rule, in which case it locks it.
Them following is an example of a purchase call.
The function queries for a TransferPolicy for that item, and if a policy is found, it automatically resolves all the rules, one by one. You can add a custom rule resolver in the
KioskClient
instance, with instructions on how to resolve a custom rule. Read more in the next section.
Supporting a custom rule
You can use the purchaseAndResolve
function to support a custom rule.