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
| Parameter | Type |
|---|---|
options | KioskClientOptions |
Returns
KioskClient
Properties
| Property | Type |
|---|---|
client | IotaClient |
network | string |
rules | TransferPolicyRule[] |
packageIds? | BaseRulePackageIds |
Methods
getOwnedKiosks()
getOwnedKiosks(address): Promise<OwnedKiosks>;
Get an addresses's owned kiosks.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | { address: string; pagination?: PaginationArguments<string>; } | The address for which we want to retrieve the kiosks. |
address.address | string | - |
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
| Parameter | Type | Description |
|---|---|---|
id | { id: string; options?: FetchKioskOptions; } | The ID of the kiosk to fetch. |
id.id | string | - |
id.options? | FetchKioskOptions | - |
Returns
Promise<KioskData>
getKioskExtension()
getKioskExtension(kioskId): Promise<KioskExtension | null>;
Fetch the extension data (if any) for a kiosk, by type
Parameters
| Parameter | Type | Description |
|---|---|---|
kioskId | { kioskId: string; type: string; } | The ID of the kiosk to lookup |
kioskId.kioskId | string | - |
kioskId.type | string | - |
Returns
Promise<KioskExtension | null>
getTransferPolicies()
getTransferPolicies(type): Promise<TransferPolicy[]>;
Query the Transfer Policy(ies) for type T.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | { type: string; } | The Type we're querying for (E.g 0xMyAddress::hero::Hero) |
type.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
| Parameter | Type | Description |
|---|---|---|
address | { address: string; } | The address we're searching the owned transfer policies for. |
address.address | string | - |
Returns
Promise<
| TransferPolicyCap[]
| undefined>
getOwnedTransferPoliciesByType()
getOwnedTransferPoliciesByType(type): Promise<TransferPolicyCap[]>;
Query the Transfer Policy Cap for type T, owned by address
Parameters
| Parameter | Type | Description |
|---|---|---|
type | { type: string; address: string; } | The Type T for the object |
type.type | string | - |
type.address | string | - |
Returns
Promise<TransferPolicyCap[]>
addRuleResolver()
addRuleResolver(rule): void;
Parameters
| Parameter | Type |
|---|---|
rule | TransferPolicyRule |
Returns
void
getRulePackageId()
getRulePackageId(rule): string;
A convenient helper to get the packageIds for our supported ruleset,
based on kioskClient configuration.
Parameters
| Parameter | Type |
|---|---|
rule | | "kioskLockRulePackageId" | "royaltyRulePackageId" | "personalKioskRulePackageId" | "floorPriceRulePackageId" |
Returns
string