Migrating from Kiosk SDK V1
The original version of Kiosk SDK provided basic experimentation with the Kiosk API. The new version of the SDK (0.7+) provides a more robust experience for building kiosk/transfer policy transactions.
The new SDK offers a builder-pattern API, which provides better autocomplete capabilities, and also makes code more readable.
While a one-to-one mapping between the old and new SDK is not possible, the following examples should help you get started.
An important benefit of the new SDK is that it works seamlessly with Personal Kiosk, which was not the case with the previous SDK (you would always have to wrap the transaction with
borrow_cap
/return_cap
calls depending on whether the kiosk is personal or not).
Placing an item to kiosk and listing it for sale
The following example is from the original Kiosk SDK V1 documentation.
Before
After
Using the new SDK, you can build the same transaction as follows:
Create a new kiosk
The following example is from the original Kiosk SDK V1 documentation.
Before
After
Using the new SDK, you can build the same transaction as follows:
Purchasing an item and resolving rules
The following example is from the original Kiosk SDK V1 documentation.
Before
After
Using the new SDK, you can build the same transaction as follows:
This works with both personal and non-personal kiosks.
Attach rules to transfer policy
The following example was taken from the original Kiosk SDK V1 documentation.
Before
After
On the new SDK, the same transaction can be built as follows: