9. Troubleshooting
Common issues and solutions when using the Amadeus Protocol SDK.
Installation Issues
"Module not found" Error
Problem: Cannot find module '@amadeus-protocol/sdk'
Solutions:
Ensure the package is installed:
npm install @amadeus-protocol/sdkCheck your
package.json:{ "dependencies": { "@amadeus-protocol/sdk": "^1.0.0" } }Clear cache and reinstall:
npm cache clean --force rm -rf node_modules package-lock.json npm install
TypeScript Errors
Problem: Type errors when importing
Solutions:
Ensure TypeScript is installed:
Check
tsconfig.json:Restart your TypeScript server/IDE
Node.js Version Issues
Problem: Errors related to Node.js version
Solutions:
Check Node.js version:
Update to Node.js 20+ if needed
Use a version manager like
nvm:
Runtime Errors
"Invalid Base58 string"
Problem: Error when decoding Base58 addresses or keys
Causes:
Invalid Base58 encoding
Missing or extra characters
Wrong string format
Solutions:
"Transaction failed: insufficient balance"
Problem: Transaction rejected due to insufficient funds
Solutions:
Check balance before transferring:
Account for transaction fees:
"Request timeout"
Problem: API requests timing out
Causes:
Network connectivity issues
Node is slow or overloaded
Timeout too short
Solutions:
Increase timeout:
Implement retry logic:
"Invalid transaction structure"
Problem: Transaction validation fails
Causes:
Transaction not properly built
Invalid arguments
Wrong contract/function names
Solutions:
Always use
TransactionBuilder:Validate inputs:
"Invalid signature"
Problem: Transaction signature validation fails
Causes:
Wrong private key used
Transaction modified after signing
Corrupted transaction data
Solutions:
Verify private key matches address:
Don't modify transactions after signing:
API Errors
404 Not Found
Problem: Resource not found
Solutions:
400 Bad Request
Problem: Invalid request parameters
Solutions:
Validate inputs before API calls:
Check error response for details:
Network Errors
Problem: Network connectivity issues
Solutions:
Check network connectivity:
Use different node URL:
Transaction Issues
Transaction Stuck/Pending
Problem: Transaction submitted but not confirming
Solutions:
Check transaction status:
Wait for confirmation:
Nonce Collisions
Problem: Multiple transactions with same nonce
Causes:
Transactions submitted too quickly
Timestamp-based nonce collision
Solutions:
Add delays between transactions:
Wrong Amount
Problem: Amount not matching expected value
Causes:
Precision loss from manual calculation
Wrong conversion
Solutions:
Always use conversion functions:
Verify amounts:
Encryption Issues
"Decryption failed"
Problem: Cannot decrypt encrypted data
Causes:
Wrong password
Corrupted encrypted data
Missing IV or salt
Solutions:
Verify password:
Ensure all components are present:
Debugging
Enable Verbose Logging
Transaction Inspection
Getting Help
Check Documentation
Review API Reference
Check Examples
Read Best Practices
Common Resources
GitHub Issues: Report bugs and request features
Documentation: Complete API reference
Examples: Real-world usage examples
Reporting Issues
When reporting issues, include:
SDK version
Node.js version
Error message and stack trace
Code snippet that reproduces the issue
Expected vs actual behavior
Next Steps
Last updated