Turnkey icon

Turnkey

Use Turnkey

Overview

This node integrates with the Turnkey API to perform various wallet and transaction-related operations within a specified organization. It is useful for automating blockchain wallet management and transaction signing workflows. Common scenarios include creating wallets, adding accounts to wallets, listing existing wallets, signing blockchain transactions, and retrieving information about the current organization.

Practical examples:

  • Automatically create a new wallet with specific accounts for a user onboarding process.
  • Sign Ethereum or Solana transactions programmatically before broadcasting them.
  • Retrieve a list of all wallets in an organization for auditing or reporting.
  • Fetch organization details to verify API access and permissions.

Properties

Name Meaning
Authentication Method of authentication; currently supports "API Key".
Base URL The base URL of the Turnkey API endpoint (default: https://api.turnkey.com).
Organization ID Identifier of the Turnkey organization to operate on.

The node supports the following operations (selected by the "Operation" property):

Name Meaning
Create Wallet Create a new wallet with a specified name and associated accounts.
Create Wallet Accounts Add one or more accounts to an existing wallet by wallet ID.
List Wallets Retrieve a list of wallets available in the organization.
Sign Transaction Sign a blockchain transaction of a specified type (Ethereum, Solana, Tron).
Whoami Get information about the current organization.

Additional properties depending on the operation:

  • Create Wallet

    • Wallet Name: Name of the wallet to create.
    • Accounts: One or more account definitions specifying curve, path format, path, and address format.
  • Create Wallet Accounts

    • Wallet ID: Identifier of the wallet to add accounts to.
    • Accounts: One or more account definitions as above.
  • Sign Transaction

    • Type: Type of transaction to sign. Options are Ethereum, Solana, or Tron.
    • Unsigned Transaction: The unsigned transaction data in the required format (hex for Ethereum/Tron, base64 for Solana).

Output

The node outputs JSON data corresponding to the result of the selected operation:

  • For Whoami, it outputs organization information.
  • For Sign Transaction, it outputs the signed transaction details.
  • For Create Wallet and Create Wallet Accounts, it outputs the created wallet or accounts information.
  • For List Wallets, it outputs an array of wallet objects.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the Turnkey API.
  • Uses the Turnkey HTTP client library (@turnkey/http) and an API key stamper utility (@turnkey/api-key-stamper) internally.
  • The node expects the user to provide the correct Base URL and Organization ID.
  • Network connectivity to the Turnkey API endpoint is necessary.

Troubleshooting

  • Common issues:

    • Missing or invalid API key credentials will cause authentication failures.
    • Incorrect Organization ID may lead to authorization errors or empty results.
    • Providing malformed unsigned transactions (wrong format or corrupted data) will cause signing to fail.
    • Unsupported operations or typos in the operation parameter will throw an error.
  • Error messages:

    • "Failed to execute operation: ..." indicates an error during API interaction or internal processing. Check the message for specifics.
    • "Operation X not supported" means the requested operation is not implemented or recognized.
    • Credential retrieval errors suggest misconfiguration of the API key credential in n8n.
  • Resolution tips:

    • Verify API key credentials are correctly set up and have sufficient permissions.
    • Double-check the Organization ID and ensure it matches the target organization in Turnkey.
    • Validate the format of unsigned transactions according to the blockchain type.
    • Use the latest version of the Turnkey API client libraries if possible.

Links and References

Discussion