plansUtility functions for creating and managing payment plans.
get_fiat_price_configget_fiat_price_config(amount: int, receiver: str) → PlanPriceConfig
Get a fixed fiat price configuration for a plan.
Args:
amount: The amount in the smallest unit of the fiat currencyreceiver: The address that will receive the paymentReturns: A PlanPriceConfig object configured for fiat payments
Raises:
ValueError: If the receiver address is not a valid Ethereum addressget_crypto_price_configget_crypto_price_config(
amount: int,
receiver: str,
token_address: str = '0x0000000000000000000000000000000000000000'
) → PlanPriceConfig
Get a fixed crypto price configuration for a plan.
Args:
amount: The amount in the smallest unit of the tokenreceiver: The address that will receive the paymenttoken_address: The address of the token to use for payment (defaults to native token)Returns: A PlanPriceConfig object configured for crypto payments
Raises:
ValueError: If the receiver address is not a valid Ethereum addressget_erc20_price_configget_erc20_price_config(
amount: int,
token_address: str,
receiver: str
) → PlanPriceConfig
Get a fixed ERC20 token price configuration for a plan.
Args:
amount: The amount in the smallest unit of the ERC20 tokentoken_address: The address of the ERC20 tokenreceiver: The address that will receive the paymentReturns: A PlanPriceConfig object configured for ERC20 token payments
get_free_price_configget_free_price_config() → PlanPriceConfig
Get a free price configuration for a plan.
Returns: A PlanPriceConfig object configured for free plans
get_native_token_price_configget_native_token_price_config(amount: int, receiver: str) → PlanPriceConfig
Get a fixed native token price configuration for a plan.
Args:
amount: The amount in the smallest unit of the native tokenreceiver: The address that will receive the paymentReturns: A PlanPriceConfig object configured for native token payments
get_expirable_duration_configget_expirable_duration_config(duration_of_plan: int) → PlanCreditsConfig
Get an expirable duration configuration for a plan.
Args:
duration_of_plan: The duration of the plan in secondsReturns: A PlanCreditsConfig object configured for expirable duration
get_non_expirable_duration_configget_non_expirable_duration_config() → PlanCreditsConfig
Get a non-expirable duration configuration for a plan.
Returns: A PlanCreditsConfig object configured for non-expirable duration
get_fixed_credits_configget_fixed_credits_config(
credits_granted: int,
credits_per_request: int = 1
) → PlanCreditsConfig
Get a fixed credits configuration for a plan.
Args:
credits_granted: The total number of credits grantedcredits_per_request: The number of credits consumed per request (default: 1)Returns: A PlanCreditsConfig object configured for fixed credits
get_dynamic_credits_configget_dynamic_credits_config(
credits_granted: int,
min_credits_per_request: int = 1,
max_credits_per_request: int = 1
) → PlanCreditsConfig
Get a dynamic credits configuration for a plan.
Args:
credits_granted: The total number of credits grantedmin_credits_per_request: The minimum number of credits consumed per request (default: 1)max_credits_per_request: The maximum number of credits consumed per request (default: 1)Returns: A PlanCreditsConfig object configured for dynamic credits
set_redemption_typeset_redemption_type(
credits_config: PlanCreditsConfig,
redemption_type: PlanRedemptionType
) → PlanCreditsConfig
Set the redemption type for a credits configuration.
Args:
credits_config: The credits configuration to modifyredemption_type: The new redemption typeReturns: A new PlanCreditsConfig with the updated redemption type
set_proof_requiredset_proof_required(
credits_config: PlanCreditsConfig,
proof_required: bool = True
) → PlanCreditsConfig
Set whether proof is required for a credits configuration.
Args:
credits_config: The credits configuration to modifyproof_required: Whether proof is required (default: True)Returns: A new PlanCreditsConfig with the updated proof requirement
This file was automatically generated via lazydocs.