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

ParameterType
optionsKioskClientOptions

Returns

KioskClient

Properties

PropertyType
clientIotaClient
networkstring
rulesTransferPolicyRule[]
packageIds?BaseRulePackageIds

Methods

getOwnedKiosks()

getOwnedKiosks(address): Promise<OwnedKiosks>;

Get an addresses's owned kiosks.

Parameters

ParameterTypeDescription
address{ address: string; pagination?: PaginationArguments<string>; }The address for which we want to retrieve the kiosks.
address.addressstring-
address.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

ParameterTypeDescription
id{ id: string; options?: FetchKioskOptions; }The ID of the kiosk to fetch.
id.idstring-
id.options?FetchKioskOptions-

Returns

Promise<KioskData>


getKioskExtension()

getKioskExtension(kioskId): Promise<KioskExtension | null>;

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

Parameters

ParameterTypeDescription
kioskId{ kioskId: string; type: string; }The ID of the kiosk to lookup
kioskId.kioskIdstring-
kioskId.typestring-

Returns

Promise<KioskExtension | null>


getTransferPolicies()

getTransferPolicies(type): Promise<TransferPolicy[]>;

Query the Transfer Policy(ies) for type T.

Parameters

ParameterTypeDescription
type{ type: string; }The Type we're querying for (E.g 0xMyAddress::hero::Hero)
type.typestring-

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

ParameterTypeDescription
address{ address: string; }The address we're searching the owned transfer policies for.
address.addressstring-

Returns

Promise< | TransferPolicyCap[] | undefined>


getOwnedTransferPoliciesByType()

getOwnedTransferPoliciesByType(type): Promise<TransferPolicyCap[]>;

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

Parameters

ParameterTypeDescription
type{ type: string; address: string; }The Type T for the object
type.typestring-
type.addressstring-

Returns

Promise<TransferPolicyCap[]>


addRuleResolver()

addRuleResolver(rule): void;

Parameters

ParameterType
ruleTransferPolicyRule

Returns

void


getRulePackageId()

getRulePackageId(rule): string;

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

Parameters

ParameterType
rule| "kioskLockRulePackageId" | "royaltyRulePackageId" | "personalKioskRulePackageId" | "floorPriceRulePackageId"

Returns

string