Skip to main content

Class: TransferPolicyTransaction

Constructors

Constructor

new TransferPolicyTransaction(__namedParameters): TransferPolicyTransaction;

Parameters

ParameterType
__namedParametersTransferPolicyTransactionParams

Returns

TransferPolicyTransaction

Properties

PropertyType
transactionTransaction
kioskClientKioskClient
policy?ObjectArgument
policyCap?ObjectArgument
type?string

Methods

createAndShare()

createAndShare(type): Promise<void>;

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

ParameterTypeDescription
typeTransferPolicyBaseParams & objectThe Type (T) for which we're creating the transfer policy.

Returns

Promise<void>


create()

create(type): Promise<TransferPolicyTransaction>;

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

ParameterTypeDescription
typeTransferPolicyBaseParamsThe Type (T) for which we're creating the transfer policy.

Returns

Promise<TransferPolicyTransaction>


shareAndTransferCap()

shareAndTransferCap(address): void;

This can be called after calling the create function to share the TransferPolicy, and transfer the TransferPolicyCap to the specified address

Parameters

ParameterTypeDescription
addressstringThe address to transfer the TransferPolicyCap

Returns

void


setCap()

setCap(policyCapId): TransferPolicyTransaction;

Setup the TransferPolicy by passing a cap returned from kioskClient.getOwnedTransferPolicies or kioskClient.getOwnedTransferPoliciesByType.

Parameters

ParameterTypeDescription
policyCapIdTransferPolicyCapThe TransferPolicyCap

Returns

TransferPolicyTransaction


withdraw()

withdraw(address, amount?): TransferPolicyTransaction;

Withdraw from the transfer policy's profits.

Parameters

ParameterTypeDescription
addressstringAddress to transfer the profits to.
amount?string | bigint(Optional) amount parameter. Will withdraw all profits if the amount is not specified.

Returns

TransferPolicyTransaction


addRoyaltyRule()

addRoyaltyRule(percentageBps, minAmount): TransferPolicyTransaction;

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

ParameterTypeDescription
percentageBpsstring | numberThe royalty percentage in basis points. Use percentageToBasisPoints helper to convert from percentage [0,100].
minAmountstring | numberThe minimum royalty amount per request in NANOS.

Returns

TransferPolicyTransaction


addLockRule()

addLockRule(): TransferPolicyTransaction;

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;

Attaches the Personal Kiosk Rule, making a purchase valid only for SoulBound kiosks.

Returns

TransferPolicyTransaction


addFloorPriceRule()

addFloorPriceRule(minPrice): TransferPolicyTransaction;

A function to add the floor price rule to a transfer policy.

Parameters

ParameterTypeDescription
minPricestring | bigintThe minimum price in NANOS.

Returns

TransferPolicyTransaction


removeRule()

removeRule(ruleType): void;

Generic helper to remove a rule, not from the SDK's base ruleset.

Parameters

ParameterTypeDescription
ruleType{ ruleType: string; configType: string; }The Rule Type
ruleType.ruleTypestring-
ruleType.configTypestring-

Returns

void


removeLockRule()

removeLockRule(): TransferPolicyTransaction;

Removes the lock rule.

Returns

TransferPolicyTransaction


removeRoyaltyRule()

removeRoyaltyRule(): TransferPolicyTransaction;

Removes the Royalty rule

Returns

TransferPolicyTransaction


removePersonalKioskRule()

removePersonalKioskRule(): TransferPolicyTransaction;

Returns

TransferPolicyTransaction


removeFloorPriceRule()

removeFloorPriceRule(): TransferPolicyTransaction;

Returns

TransferPolicyTransaction


getPolicy()

getPolicy(): ObjectArgument;

Returns

ObjectArgument


getPolicyCap()

getPolicyCap(): ObjectArgument;

Returns

ObjectArgument