Prerequisites
Install Deno
The Points Adapters SDK requires Deno runtime.
Testing a Single Adapter
Use thetest.ts script to test your adapter with a specific wallet address:
Command Format
<adapter-path>- Path to your adapter file (e.g.,adapters/sonic.ts)<wallet-address>- Wallet address to test (EVM or Solana format)[options]- Optional flags:--skip-address-checkor-sac- Skip address format validation tests
Understanding Test Output
When you run the test script, you’ll see several sections of output:1. Detailed Data Table
The first output shows the structured data from your adapter’sdata function:
2. Total Points
Shows the aggregate points from your adapter’stotal function:
3. User Rank (if applicable)
4. Claimable Status (if applicable)
5. Address Format Validation
The test script automatically validates that your adapter handles different address formats consistently:6. CORS Validation
Checks if your API URLs will work in the browser:If
good is false, make sure you wrapped your API URL with maybeWrapCORSProxy.Testing with Different Address Types
Testing EVM Addresses
Testing Solana Addresses
supportedAddressTypes.
Skipping Address Format Checks
For faster iteration during development, you can skip the address format validation:Adapter Health Check
Test multiple adapters at once with configured addresses using the health check script:Configuring Health Checks
Editmonitoring/config.json to configure the health check:
addresses- Array of wallet addresses to test against all adaptersdisabledAdapters- Array of adapter names to skip during testingtimeout_ms- Timeout in milliseconds per adapter test (default: 30000)
Health Check Output
The health check runs all enabled adapters against all configured addresses:Discord Notifications
To receive failure notifications in Discord, set theDISCORD_WEBHOOK_URL environment variable:
.env file:
What to Look For in Test Output
Verify Data Accuracy
Verify Data Accuracy
Check that the detailed data matches what you expect from the protocol’s API:
- All relevant fields are present
- Values are correctly formatted (numbers, dates, strings)
- Labels are human-readable and clear
Validate Total Points
Validate Total Points
Ensure the total points calculation is correct:
- For simple totals, verify the number matches the main points field
- For multi-season programs, check that all seasons are included
- For custom terminology, ensure labels match between
dataandtotal
Check Address Format Handling
Check Address Format Handling
All format comparison results should show
equal: true:- Lowercase format
- Uppercase format
- Mixed case format
- Checksummed format
false, implement address normalization in your fetch function.Confirm CORS Compatibility
Confirm CORS Compatibility
All API URLs should show
good: true in the CORS validation table.If any show false, wrap those URLs with maybeWrapCORSProxy.Validate Deprecated Points (if applicable)
Validate Deprecated Points (if applicable)
If your adapter includes deprecated points:
- Check that the labels match your
dataexport keys - Verify the timestamp is in the past
- Ensure the date displayed is correct
Common Testing Issues
Address Format Inconsistencies
Problem: Different address formats return different results Solution: Normalize addresses in yourfetch function:
CORS Errors
Problem: CORS validation showsgood: false
Solution: Wrap your API URL with maybeWrapCORSProxy:
Timeout Errors
Problem: Adapter times out during testing Solution:- Check if the API is responsive
- Verify the API URL is correct
- Ensure your
fetchfunction has proper error handling - Consider adding a timeout to your fetch calls
Invalid Address Type
Problem: Error about unsupported address type Solution: Verify yoursupportedAddressTypes matches the addresses you’re testing:
Changing the CORS Proxy
For local development, you can use a custom CORS proxy:Next Steps
Creating an Adapter
Learn how to build a new adapter from scratch
Custom Terminology
Use custom terms instead of “Points”