Account Service
The Account Service provides functionalities related to user accounts on the Frequency network. It includes endpoints for managing user authentication, account details, delegation, keys, and handles.
API Reference
Configuration
ℹ️ Feel free to adjust your environment variables to taste. This application recognizes the following environment variables:
Name | Description | Range/Type | Required? | Default |
---|---|---|---|---|
API_PORT | HTTP port that the application listens on | 1025 - 65535 | 3000 | |
BLOCKCHAIN_SCAN_INTERVAL_SECONDS | How many seconds to delay between successive scans of the chain for new content (after end of chain is reached) | > 0 | 12 | |
CACHE_KEY_PREFIX | Prefix to use for Redis cache keys | string | Y | |
CAPACITY_LIMIT | Maximum amount of provider capacity this app is allowed to use (per epoch) type: 'percentage' 'amount' value: number (may be percentage, ie '80', or absolute amount of capacity) | JSON (example) | Y | |
SIWF_NODE_RPC_URL | Blockchain node address resolvable from the client browser, used for SIWF | http(s): URL | Y | |
FREQUENCY_API_WS_URL | Blockchain API Websocket URL | ws(s): URL | Y | |
FREQUENCY_TIMEOUT_SECS | Frequency chain connection timeout limit; app will terminate if disconnected longer | integer | 10 | |
HEALTH_CHECK_MAX_RETRIES | Number of /health endpoint failures allowed before marking the provider webhook service down | >= 0 | 20 | |
HEALTH_CHECK_MAX_RETRY_INTERVAL_SECONDS | Number of seconds to retry provider webhook /health endpoint when failing | > 0 | 64 | |
HEALTH_CHECK_SUCCESS_THRESHOLD | Minimum number of consecutive successful calls to the provider webhook /health endpoint before it is marked up again | > 0 | 10 | |
PROVIDER_ACCESS_TOKEN | An optional bearer token authentication to the provider webhook | string | ||
PROVIDER_ACCOUNT_SEED_PHRASE | Seed phrase for provider MSA control key | string | Y | |
PROVIDER_ID | Provider MSA Id | integer | Y | |
REDIS_URL | Connection URL for Redis | URL | Y | |
TRUST_UNFINALIZED_BLOCKS | Whether to examine blocks that have not been finalized when tracking extrinsic completion | boolean | false | |
WEBHOOK_BASE_URL | Base URL for provider webhook endpoints | URL | Y | |
WEBHOOK_FAILURE_THRESHOLD | Number of failures allowed in the provider webhook before the service is marked down | > 0 | 3 | |
WEBHOOK_RETRY_INTERVAL_SECONDS | Number of seconds between provider webhook retry attempts when failing | > 0 | 10 | |
GRAPH_ENVIRONMENT_TYPE | Graph environment type. | Mainnet|TestnetPaseo | Y | |
API_TIMEOUT_MS | Api timeout limit in milliseconds | > 0 | 5000 | |
API_BODY_JSON_LIMIT | Api json body size limit in string (some examples: 100kb or 5mb or etc) | string | 1mb | |
SIWF_URL | SIWF v1: URL for Sign In With Frequency V1 UI | URL | https://ProjectLibertyLabs.github.io/siwf/v1/ui | |
SIWF_V2_URL | SIWF v2: URL for Sign In With Frequency V2 Redirect URL | URL | Frequency Access | |
SIWF_V2_URI_VALIDATION | SIWF v2: Domain (formatted as URI) to validate signin requests (*Required if using Sign In with Frequency v2) | Domain (Examples: https://www.your-app.com, example://login, localhost) | * |
Best Practices
- Secure Authentication: Always use secure methods (e.g., JWT tokens) for authentication to protect user data.
- Validate Inputs: Ensure all input data is validated to prevent injection attacks and other vulnerabilities.
- Rate Limiting: Implement rate limiting to protect the service from abuse and ensure fair usage.