Before using any service endpoints, you must configure and manage your resource budget. The following functions from src/services/Skynet.ts handle budget management:
Required environment variables for budget management:
PROVIDER_RPC= # Your RPC provider URL
AGENT_PRIVATE_KEY= # Your wallet private key
PROJECT_ID= # Your project NFT ID
DEFAULT_RESOURCE_BUDGET= # Default budget amount in ETH
Example usage:
// Before making API calls, verify budgetawaitverifyBudget("MyApp","4");
Ensure sufficient budget is maintained to use the service endpoints
The system automatically tops up when balance falls below 50% of DEFAULT_RESOURCE_BUDGET
Initial budget creation is required for first-time subnet usage
Budget management functions require proper wallet configuration with sufficient funds