For the complete documentation index, see llms.txt. This page is also available as Markdown.

Subscription Management

This section covers the functions for creating and managing streaming subscriptions between users.

subscribe

Creates a subscription to stream tokens to an author.

function subscribe(address author, uint96 subscriptionRate, uint256 projectId) external

Parameters

  • author (address): The address of the content creator to subscribe to

  • subscriptionRate (uint96): The rate of tokens to stream per second

  • projectId (uint256): The ID of the project for this subscription

Description

Creates a subscription that streams tokens from the caller to the specified author at the given rate. The subscription is associated with a specific project ID for fee management.

Example

// Subscribe to an author at 0.001 tokens per second for project 1
await papayaContract.subscribe(
  "0xauthor...",
  ethers.utils.parseEther("0.001"),
  1
);

unsubscribe

Cancels a subscription to an author.

Parameters

  • author (address): The address of the author to unsubscribe from

Description

Cancels an active subscription to the specified author. This stops the token streaming immediately.

Example

Last updated