This guide demonstrates how to integrate Turnkey’s secure signing infrastructure with the Adamik API. By following this implementation, you can leverage Turnkey’s institutional-grade key management system to sign transactions across all Adamik-supported blockchains.
Depending on your project structure, you’ll need to set up environment variables slightly differently:For frontend projects (like adamik-tutorial):
Copy
# These variables need the VITE_ prefix for client-side accessVITE_TURNKEY_BASE_URL="https://api.turnkey.com"VITE_TURNKEY_API_PUBLIC_KEY="your-api-public-key"VITE_TURNKEY_API_PRIVATE_KEY="your-api-private-key"VITE_TURNKEY_ORGANIZATION_ID="your-organization-id"VITE_TURNKEY_WALLET_ID="your-wallet-id"
# No VITE_ prefix needed for server-side codeTURNKEY_BASE_URL="https://api.turnkey.com"TURNKEY_API_PUBLIC_KEY="your-api-public-key"TURNKEY_API_PRIVATE_KEY="your-api-private-key"TURNKEY_ORGANIZATION_ID="your-organization-id"TURNKEY_WALLET_ID="your-wallet-id"
The Turnkey signer automatically creates accounts with the correct derivation paths and address formats based on the blockchain requirements. If an account already exists, it retrieves it:
The implementation includes proper error handling for common scenarios, including the case where an account exists but wasn’t found in the initial lookup:
The integration of Turnkey with Adamik API provides a secure and scalable solution for multi-chain applications. By following this implementation guide, you can leverage Turnkey’s institutional-grade security while maintaining the flexibility to operate across multiple blockchains through a single interface.For more details, explore the full source code in our GitHub repository, particularly the src/signers/Turnkey.ts file for the implementation details.