Payment & Streaming
This section covers the core payment and streaming functionality of the Papaya protocol.
permitAndCall
Executes a permit and then performs an action in a single transaction.
function permitAndCall(bytes permit, bytes action) external payable
Parameters
permit
(bytes): The permit data for token approvalaction
(bytes): The action to execute after the permit
Description
This function allows users to approve tokens and execute an action in a single transaction. This is useful for gasless interactions where users sign permits off-chain.
Example
// Execute permit and action in one transaction
await papayaContract.permitAndCall(permitData, actionData, {
value: ethers.utils.parseEther("0.1")
});
Related Events
Transfer: Emitted when tokens are transferred during streaming
Related Errors
WrongSignature: When permit signature is invalid
DeadlineExceeded: When permit has expired
Last updated