TransferPolicyTransaction
@iota/kiosk / TransferPolicyTransaction
Class: TransferPolicyTransaction
Defined in: client/tp-transaction.ts:35
Constructors
Constructor
new TransferPolicyTransaction(
__namedParameters):TransferPolicyTransaction
Defined in: client/tp-transaction.ts:42
Parameters
__namedParameters
TransferPolicyTransactionParams
Returns
TransferPolicyTransaction
Properties
kioskClient
kioskClient:
KioskClient
Defined in: client/tp-transaction.ts:37
policy?
optionalpolicy?:ObjectArgument
Defined in: client/tp-transaction.ts:38
policyCap?
optionalpolicyCap?:ObjectArgument
Defined in: client/tp-transaction.ts:39
transaction
transaction:
Transaction
Defined in: client/tp-transaction.ts:36
type?
optionaltype?:string
Defined in: client/tp-transaction.ts:40
Methods
addFloorPriceRule()
addFloorPriceRule(
minPrice):TransferPolicyTransaction
Defined in: client/tp-transaction.ts:222
A function to add the floor price rule to a transfer policy.
Parameters
minPrice
string | bigint
The minimum price in NANOS.
Returns
TransferPolicyTransaction
addLockRule()
addLockRule():
TransferPolicyTransaction
Defined in: client/tp-transaction.ts:189
Adds the Kiosk Lock Rule to the Transfer Policy. This Rule forces buyer to lock the item in the kiosk, preserving strong royalties.
Returns
TransferPolicyTransaction
addPersonalKioskRule()
addPersonalKioskRule():
TransferPolicyTransaction
Defined in: client/tp-transaction.ts:205
Attaches the Personal Kiosk Rule, making a purchase valid only for SoulBound kiosks.
Returns
TransferPolicyTransaction
addRoyaltyRule()
addRoyaltyRule(
percentageBps,minAmount):TransferPolicyTransaction
Defined in: client/tp-transaction.ts:164
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).
Parameters
percentageBps
string | number
The royalty percentage in basis points. Use percentageToBasisPoints helper to convert from percentage [0,100].
minAmount
string | number
The minimum royalty amount per request in NANOS.
Returns
TransferPolicyTransaction
create()
create(
type):Promise<TransferPolicyTransaction>
Defined in: client/tp-transaction.ts:85
A convenient function to create a Transfer Policy and attach some rules before sharing it (so you can prepare it in a single PTB)
Parameters
type
The Type (T) for which we're creating the transfer policy.
Returns
Promise<TransferPolicyTransaction>
createAndShare()
createAndShare(
type):Promise<void>
Defined in: client/tp-transaction.ts:60
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
Parameters
type
TransferPolicyBaseParams & object
The Type (T) for which we're creating the transfer policy.
Returns
Promise<void>
getPolicy()
getPolicy():
ObjectArgument
Defined in: client/tp-transaction.ts:324
Returns
getPolicyCap()
getPolicyCap():
ObjectArgument
Defined in: client/tp-transaction.ts:329
Returns
removeFloorPriceRule()
removeFloorPriceRule():
TransferPolicyTransaction
Defined in: client/tp-transaction.ts:308
Returns
TransferPolicyTransaction
removeLockRule()
removeLockRule():
TransferPolicyTransaction
Defined in: client/tp-transaction.ts:257
Removes the lock rule.
Returns
TransferPolicyTransaction
removePersonalKioskRule()
removePersonalKioskRule():
TransferPolicyTransaction
Defined in: client/tp-transaction.ts:292
Returns
TransferPolicyTransaction
removeRoyaltyRule()
removeRoyaltyRule():
TransferPolicyTransaction
Defined in: client/tp-transaction.ts:276
Removes the Royalty rule
Returns
TransferPolicyTransaction
removeRule()
removeRule(
ruleType):void
Defined in: client/tp-transaction.ts:241
Generic helper to remove a rule, not from the SDK's base ruleset.
Parameters
ruleType
The Rule Type
configType
string
ruleType
string
Returns
void
setCap()
setCap(
policyCapId):TransferPolicyTransaction
Defined in: client/tp-transaction.ts:129
Setup the TransferPolicy by passing a cap returned from kioskClient.getOwnedTransferPolicies or
kioskClient.getOwnedTransferPoliciesByType.
Parameters
policyCapId
The TransferPolicyCap
Returns
TransferPolicyTransaction
shareAndTransferCap()
shareAndTransferCap(
address):void
Defined in: client/tp-transaction.ts:111
This can be called after calling the create function to share the TransferPolicy,
and transfer the TransferPolicyCap to the specified address
Parameters
address
string
The address to transfer the TransferPolicyCap
Returns
void
withdraw()
withdraw(
address,amount?):TransferPolicyTransaction
Defined in: client/tp-transaction.ts:138
Withdraw from the transfer policy's profits.
Parameters
address
string
Address to transfer the profits to.
amount?
string | bigint
(Optional) amount parameter. Will withdraw all profits if the amount is not specified.
Returns
TransferPolicyTransaction