Skip to main content

PlatformFee

Functionality available for contracts that inherit the PlatformFee contract.

get

Get the platform fee recipient and basis points.

platform_fees = contract.platform_fee.get()
print(platform_fees.platform_fee_basis_points)
print(platform_fees.platform_fee_recipient)
Configuration

Return Value

Returns an object containing the platform fee recipient and basis points.

class ContractPlatformFeeSchema:
platform_fee_basis_points: int = 0
platform_fee_recipient: str = ZERO_ADDRESS

set

Set the platform fee recipient and basis points.

from thirdweb.types import ContractPlatformFeeSchema

platform_fee_info = ContractPlatformFeeSchema(
platform_fee_basis_points = 100 # 1%
platform_fee_recipient = "0x7fDae677aA6f94Edff9872C4b91D26407709c790"
)

receipt = contract.platform_fee.set(platform_fee_info)
Configuration

platform_fee_basis_points

The percentage fee to take, in basis points. For example, 100 basis points is 1%.

Must be a number.

platform_fee_recipient

The wallet address that will receive the platform fees.

Must be a string.