Class: TransferPolicyTransaction
Constructors
Constructor
new TransferPolicyTransaction(__namedParameters): TransferPolicyTransaction;
Parameters
| Parameter | Type |
|---|---|
__namedParameters | TransferPolicyTransactionParams |
Returns
TransferPolicyTransaction
Properties
| Property | Type |
|---|---|
transaction | Transaction |
kioskClient | KioskClient |
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
| Parameter | Type | Description |
|---|---|---|
type | TransferPolicyBaseParams & object | The 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
| Parameter | Type | Description |
|---|---|---|
type | TransferPolicyBaseParams | The 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
| Parameter | Type | Description |
|---|---|---|
address | string | The 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
| Parameter | Type | Description |
|---|---|---|
policyCapId | TransferPolicyCap | The TransferPolicyCap |
Returns
TransferPolicyTransaction
withdraw()
withdraw(address, amount?): TransferPolicyTransaction;
Withdraw from the transfer policy's profits.
Parameters
| Parameter | Type | Description |
|---|---|---|
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
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
| Parameter | Type | Description |
|---|---|---|
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
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
| Parameter | Type | Description |
|---|---|---|
minPrice | string | bigint | The minimum price in NANOS. |
Returns
TransferPolicyTransaction
removeRule()
removeRule(ruleType): void;
Generic helper to remove a rule, not from the SDK's base ruleset.
Parameters
| Parameter | Type | Description |
|---|---|---|
ruleType | { ruleType: string; configType: string; } | The Rule Type |
ruleType.ruleType | string | - |
ruleType.configType | string | - |
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
getPolicyCap()
getPolicyCap(): ObjectArgument;