Managing Owned Kiosk
KioskClient
helps in managing a kiosk.
You need to follow the steps explained in the Kiosk Transaction section to
create a KioskTransaction
.
Available functions
take
Removes an item from the Kiosk and returns a TransactionArgument
to use it in a different
Programmable Transaction Block (PTB) call.
transfer
Similar to take
, but transfers the item to an address internally.
place
Places an item in the kiosk.
list
Lists an item for sale (the item must be in the kiosk).
placeAndList
List an item for sale by first placing it in the kiosk (places the item and lists it for sale). It's
a short hand for place()
and list()
.
delist
Removes the listing, keeping the item placed in the kiosk.
withdraw
Withdraw (all or specific amount) from a kiosk.
amount
: Can be empty, which will withdraw all the funds.
borrowTx (callback)
Borrows an item from a kiosk. This function follows the callback
approach, similar to the
ownerCap. The return of the item happens automatically after the execution of the callback.
borrow / return
Similar to borrowTx
, borrows an item from the kiosk, but returns two transaction arguments: item
& promise
. You can use the item
in your PTBs, but you must always call the return()
function
with the item
and the Promise
.