import { BaseRulePackageIds, TransferPolicyRule } from "../constants.mjs"; import { FetchKioskOptions, KioskData, KioskExtension, OwnedKiosks } from "../types/kiosk.mjs"; import { TransferPolicy, TransferPolicyCap } from "../types/transfer-policy.mjs"; import { KioskClientOptions, KioskCompatibleClient, KioskPaginationArguments } from "../types/index.mjs"; import { SuiClientTypes } from "@mysten/sui/client"; //#region src/client/kiosk-client.d.ts type KioskExtensionOptions = { name?: Name; packageIds?: BaseRulePackageIds; }; /** * Creates a kiosk client extension that can be used with `client.$extend()`. * * @example * ```ts * import { SuiGrpcClient } from '@mysten/sui/grpc'; * import { kiosk } from '@mysten/kiosk'; * * const client = new SuiGrpcClient({ * baseUrl: 'https://fullnode.mainnet.sui.io:443', * network: 'mainnet', * }).$extend(kiosk()); * * const ownedKiosks = await client.kiosk.getOwnedKiosks({ address: '0x...' }); * ``` */ declare function kiosk({ name, packageIds }?: KioskExtensionOptions): { name: Name; register: (client: KioskCompatibleClient) => 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. */ declare class KioskClient { client: KioskCompatibleClient; network: SuiClientTypes.Network; rules: TransferPolicyRule[]; packageIds?: BaseRulePackageIds; constructor(options: KioskClientOptions); /** * Get an addresses's owned kiosks. * @param address The address for which we want to retrieve the kiosks. * @param pagination Optional pagination arguments. * @returns An Object containing all the `kioskOwnerCap` objects as well as the kioskIds. */ getOwnedKiosks({ address, pagination }: { address: string; pagination?: KioskPaginationArguments; }): Promise; /** * Fetches the kiosk contents. * @param id The ID of the kiosk to fetch. * @param options Optional to control the fetch behavior. * @returns */ getKiosk({ id, options }: { id: string; options?: FetchKioskOptions; }): Promise; /** * Fetch the extension data (if any) for a kiosk, by type * @param kioskId The ID of the kiosk to lookup * @param extensionType The Type of the extension (can be used from by using the type returned by `getKiosk()`) */ getKioskExtension({ kioskId, type }: { kioskId: string; type: string; }): Promise; /** * Query the Transfer Policy(ies) for type `T`. * @param type The Type we're querying for (E.g `0xMyAddress::hero::Hero`) */ getTransferPolicies({ type }: { type: string; }): Promise; /** * Query all the owned transfer policies for an address. * Returns `TransferPolicyCap` which uncludes `policyId, policyCapId, type`. * @param address The address we're searching the owned transfer policies for. */ getOwnedTransferPolicies({ address }: { address: string; }): Promise; /** * Query the Transfer Policy Cap for type `T`, owned by `address` * @param type The Type `T` for the object * @param address The address that owns the cap. */ getOwnedTransferPoliciesByType({ type, address }: { type: string; address: string; }): Promise; addRuleResolver(rule: TransferPolicyRule): void; /** * A convenient helper to get the packageIds for our supported ruleset, * based on `kioskClient` configuration. */ getRulePackageId(rule: 'kioskLockRulePackageId' | 'royaltyRulePackageId' | 'personalKioskRulePackageId' | 'floorPriceRulePackageId'): string | undefined; } //#endregion export { KioskClient, KioskExtensionOptions, kiosk }; //# sourceMappingURL=kiosk-client.d.mts.map