Class ContractPlatformFee<TContract>

Handle platform fees and recipients

Remarks

Configure platform fees for a contract, which can be applied on certain paid transactions

Example

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
})

Type Parameters

  • TContract extends IPlatformFee

Hierarchy

  • ContractPlatformFee

Implements

  • DetectableFeature

Constructors

Properties

Methods

Constructors

Properties

contractWrapper: ContractWrapper<IPlatformFee>
featureName: "PlatformFee" = FEATURE_PLATFORM_FEE.name
set: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Set the platform fee recipient and basis points

      Parameters

      • Rest ...args: [platformFeeInfo: {
            platform_fee_basis_points?: number;
            platform_fee_recipient?: string;
        }]

      Returns Promise<TResult>

      Example

      await contract.platformFees.set({
      platform_fee_basis_points: 100, // 1% fee
      platform_fee_recipient: "0x..." // the fee recipient
      })

      Twfeature

      PlatformFee

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [platformFeeInfo: {
              platform_fee_basis_points?: number;
              platform_fee_recipient?: string;
          }]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

Methods

  • Get the platform fee recipient and basis points

    Returns Promise<{
        platform_fee_basis_points: number;
        platform_fee_recipient: string;
    }>

    Example

    const feeInfo = await contract.platformFees.get();
    console.log(feeInfo.platform_fee_recipient);
    console.log(feeInfo.platform_fee_basis_points);

    Twfeature

    PlatformFee

Generated using TypeDoc