azeth_create_payment_agreement
Set up an on-chain recurring payment agreement to automate periodic transfers to another participant. Specify the payee, token, amount, and interval to create a self-executing payment schedule.
Instructions
Set up a recurring payment agreement to another participant. Payments execute on a fixed interval.
Use this when: You need automated recurring payments (subscriptions, data feeds, scheduled transfers) between participants.
Returns: The agreement ID and creation transaction hash.
Note: This creates an on-chain agreement via the PaymentAgreementModule. The payee or anyone can call execute once each interval has elapsed. Requires sufficient token balance for each execution. The payer account is determined by the AZETH_PRIVATE_KEY environment variable.
Example: { "payee": "Alice", "token": "0x036CbD53842c5426634e7929541eC2318f3dCF7e", "amount": "1.00", "intervalSeconds": 86400 }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet"). | |
| payee | Yes | Recipient: Ethereum address, participant name, "me", or "#N" (account index). | |
| token | Yes | Payment token address. Use an ERC-20 contract address (e.g., USDC) or 0x0000000000000000000000000000000000000000 for native ETH. | |
| amount | Yes | Payment amount per interval in human-readable units (e.g., "10.00" for 10 USDC). | |
| intervalSeconds | Yes | Time between payments in seconds (minimum 60). E.g., 86400 for daily, 604800 for weekly. | |
| maxExecutions | No | Maximum number of payments. 0 or omit for unlimited. | |
| decimals | No | Token decimals. Defaults to 6 (USDC). Use 18 for WETH or native ETH. |