Skip to main content

Class: KioskClient

A 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.

Constructors

Constructor

new KioskClient(options): KioskClient

Parameters

options

KioskClientOptions

Returns

KioskClient

Properties

client

client: IotaClient


network

network: string


rules

rules: TransferPolicyRule[]


packageIds?

optional packageIds: BaseRulePackageIds

Methods

getOwnedKiosks()

getOwnedKiosks(address): Promise<OwnedKiosks>

Get an addresses's owned kiosks.

Parameters

address

The address for which we want to retrieve the kiosks.

address

string

pagination?

PaginationArguments<string>

Returns

Promise<OwnedKiosks>

An Object containing all the kioskOwnerCap objects as well as the kioskIds.


getKiosk()

getKiosk(id): Promise<KioskData>

Fetches the kiosk contents.

Parameters

id

The ID of the kiosk to fetch.

id

string

options?

FetchKioskOptions

Returns

Promise<KioskData>


getKioskExtension()

getKioskExtension(kioskId): Promise<KioskExtension | null>

Fetch the extension data (if any) for a kiosk, by type

Parameters

kioskId

The ID of the kiosk to lookup

kioskId

string

type

string

Returns

Promise<KioskExtension | null>


getTransferPolicies()

getTransferPolicies(type): Promise<TransferPolicy[]>

Query the Transfer Policy(ies) for type T.

Parameters

type

The Type we're querying for (E.g 0xMyAddress::hero::Hero)

type

string

Returns

Promise<TransferPolicy[]>


getOwnedTransferPolicies()

getOwnedTransferPolicies(address): Promise<TransferPolicyCap[] | undefined>

Query all the owned transfer policies for an address. Returns TransferPolicyCap which includes policyId, policyCapId, type.

Parameters

address

The address we're searching the owned transfer policies for.

address

string

Returns

Promise<TransferPolicyCap[] | undefined>


getOwnedTransferPoliciesByType()

getOwnedTransferPoliciesByType(type): Promise<TransferPolicyCap[]>

Query the Transfer Policy Cap for type T, owned by address

Parameters

type

The Type T for the object

type

string

address

string

Returns

Promise<TransferPolicyCap[]>


addRuleResolver()

addRuleResolver(rule): void

Parameters

rule

TransferPolicyRule

Returns

void


getRulePackageId()

getRulePackageId(rule): string

A convenient helper to get the packageIds for our supported ruleset, based on kioskClient configuration.

Parameters

rule

"kioskLockRulePackageId" | "royaltyRulePackageId" | "personalKioskRulePackageId" | "floorPriceRulePackageId"

Returns

string