IPublicationActionModule

Git Source

Author: Lens Protocol

This is the standard interface for all Lens-compatible Publication Actions. Publication action modules allow users to execute actions directly from a publication, like:

  • Minting NFTs.
  • Collecting a publication.
  • Sending funds to the publication author (e.g. tipping).
  • Etc. Referrers are supported, so any publication or profile that references the publication can receive a share from the publication's action if the action module supports it.

Functions

initializePublicationAction

Initializes the action module for the given publication being published with this Action module.

function initializePublicationAction(uint256 profileId, uint256 pubId, address transactionExecutor, bytes calldata data)
    external
    returns (bytes memory);

Parameters

NameTypeDescription
profileIduint256The profile ID of the author publishing the content with this Publication Action.
pubIduint256The publication ID being published.
transactionExecutoraddressThe address of the transaction executor (e.g. for any funds to transferFrom).
databytesArbitrary data passed from the user to be decoded by the Action Module during initialization.

Returns

NameTypeDescription
<none>bytesbytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by indexers or UIs.

processPublicationAction

Processes the action for a given publication. This includes the action's logic and any monetary/token operations.

function processPublicationAction(Types.ProcessActionParams calldata processActionParams)
    external
    returns (bytes memory);

Parameters

NameTypeDescription
processActionParamsTypes.ProcessActionParamsThe parameters needed to execute the publication action.

Returns

NameTypeDescription
<none>bytesbytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by indexers or UIs.