import type { Transaction } from '@iota/iota-sdk/transactions'; import type { ObjectArgument, TransferPolicyCap } from '../types/index.js'; import type { KioskClient } from './kiosk-client.js'; export type TransferPolicyBaseParams = { type: string; publisher: ObjectArgument; skipCheck?: boolean; }; export type TransferPolicyTransactionParams = { kioskClient: KioskClient; transaction: Transaction; /** @deprecated use transaction instead */ transactionBlock?: Transaction; cap?: TransferPolicyCap; }; export declare class TransferPolicyTransaction { #private; transaction: Transaction; kioskClient: KioskClient; policy?: ObjectArgument; policyCap?: ObjectArgument; type?: string; constructor({ kioskClient, transactionBlock, transaction, cap, }: TransferPolicyTransactionParams); /** * A function to create a new transfer policy. * Checks if there's already an existing transfer policy to prevent * double transfer policy mistakes. * There's an optional `skipCheck` flag that will just create the policy * without checking * * @param type The Type (`T`) for which we're creating the transfer policy. * @param publisher The Publisher Object Id. * @param address Address to save the `TransferPolicyCap` object to. * @param skipCheck (Optional) skip checking if a transfer policy already exists */ createAndShare({ type, publisher, address, skipCheck, }: TransferPolicyBaseParams & { address: string; }): Promise; /** * A convenient function to create a Transfer Policy and attach some rules * before sharing it (so you can prepare it in a single PTB) * @param type The Type (`T`) for which we're creating the transfer policy. * @param publisher The Publisher Object Id. * @param address Address to save the `TransferPolicyCap` object to. * @param skipCheck (Optional) skip checking if a transfer policy already exists */ create({ type, publisher, skipCheck, }: TransferPolicyBaseParams): Promise; /** * This can be called after calling the `create` function to share the `TransferPolicy`, * and transfer the `TransferPolicyCap` to the specified address * * @param address The address to transfer the `TransferPolicyCap` */ shareAndTransferCap(address: string): void; /** * Setup the TransferPolicy by passing a `cap` returned from `kioskClient.getOwnedTransferPolicies` or * `kioskClient.getOwnedTransferPoliciesByType`. * @param policyCapId The `TransferPolicyCap` */ setCap({ policyId, policyCapId, type }: TransferPolicyCap): this; /** * Withdraw from the transfer policy's profits. * @param address Address to transfer the profits to. * @param amount (Optional) amount parameter. Will withdraw all profits if the amount is not specified. */ withdraw(address: string, amount?: string | bigint): this; /** * Adds the Kiosk Royalty rule to the Transfer Policy. * You can pass the percentage, as well as a minimum amount. * The royalty that will be paid is the MAX(percentage, minAmount). * You can pass 0 in either value if you want only percentage royalty, or a fixed amount fee. * (but you should define at least one of them for the rule to make sense). * * @param percentageBps The royalty percentage in basis points. Use `percentageToBasisPoints` helper to convert from percentage [0,100]. * @param minAmount The minimum royalty amount per request in NANOS. */ addRoyaltyRule(percentageBps: number | string, // this is in basis points. minAmount: number | string): this; /** * Adds the Kiosk Lock Rule to the Transfer Policy. * This Rule forces buyer to lock the item in the kiosk, preserving strong royalties. */ addLockRule(): this; /** * Attaches the Personal Kiosk Rule, making a purchase valid only for `SoulBound` kiosks. */ addPersonalKioskRule(): this; /** * A function to add the floor price rule to a transfer policy. * @param minPrice The minimum price in NANOS. */ addFloorPriceRule(minPrice: string | bigint): this; /** * Generic helper to remove a rule, not from the SDK's base ruleset. * @param ruleType The Rule Type * @param configType The Config Type */ removeRule({ ruleType, configType }: { ruleType: string; configType: string; }): void; /** * Removes the lock rule. */ removeLockRule(): this; /** * Removes the Royalty rule */ removeRoyaltyRule(): this; removePersonalKioskRule(): this; removeFloorPriceRule(): this; getPolicy(): ObjectArgument; getPolicyCap(): ObjectArgument; }