Skip to main content

KioskClient

@iota/kiosk


@iota/kiosk / KioskClient

Class: KioskClient

Defined in: client/kiosk-client.ts:30

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

Defined in: client/kiosk-client.ts:36

Parameters

options

KioskClientOptions

Returns

KioskClient

Properties

client

client: IotaClient

Defined in: client/kiosk-client.ts:31


network

network: string

Defined in: client/kiosk-client.ts:32


packageIds?

optional packageIds?: BaseRulePackageIds

Defined in: client/kiosk-client.ts:34


rules

rules: TransferPolicyRule[]

Defined in: client/kiosk-client.ts:33

Methods

addRuleResolver()

addRuleResolver(rule): void

Defined in: client/kiosk-client.ts:129

Parameters

rule

TransferPolicyRule

Returns

void


getKiosk()

getKiosk(id): Promise<KioskData>

Defined in: client/kiosk-client.ts:81

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>

Defined in: client/kiosk-client.ts:96

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>


getOwnedKiosks()

getOwnedKiosks(address): Promise<OwnedKiosks>

Defined in: client/kiosk-client.ts:55

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.


getOwnedTransferPolicies()

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

Defined in: client/kiosk-client.ts:113

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[]>

Defined in: client/kiosk-client.ts:122

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

Parameters

type

The Type T for the object

address

string

type

string

Returns

Promise<TransferPolicyCap[]>


getRulePackageId()

getRulePackageId(rule): string

Defined in: client/kiosk-client.ts:139

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

Parameters

rule

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

Returns

string


getTransferPolicies()

getTransferPolicies(type): Promise<TransferPolicy[]>

Defined in: client/kiosk-client.ts:104

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[]>