ContractPlatformFee
Handle platform fees and recipients
Configure platform fees for a contract, which can be applied on certain paid transactions
const contract = await sdk.getContract("{{contract_address}}");const feeInfo = await contract.platformFees.get();await contract.platformFees.set({ platform_fee_basis_points: 100, // 1% fee platform_fee_recipient: "0x...", // the fee recipient});
class ContractPlatformFee implements DetectableFeature {}
function constructor( contractWrapper: ContractWrapper<IPlatformFee>,
Get the platform fee recipient and basis points
const feeInfo = await contract.platformFees.get();console.log(feeInfo.platform_fee_recipient);console.log(feeInfo.platform_fee_basis_points);
function get(): Promise<{ platform_fee_basis_points: number; platform_fee_recipient: string;}>;
function set(platformFeeInfo: { platform_fee_basis_points?: number; platform_fee_recipient?: string;}): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling set.prepare()
with same arguments.Learn more
let featureName: "PlatformFee";