Skip to main content

Connect

Establishes a connection to the Gate.io cryptocurrency exchange using API credentials, creating a reusable client session for subsequent trading and data operations.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Options

  • Api Key - Gate.io API key credential for authentication. Store this securely in Robomotion Vault.
  • Secret Key - Gate.io API secret key credential for signing requests. Store this securely in Robomotion Vault.

Output

  • Client Id - A unique identifier for the established connection that must be passed to other Gate.io nodes.

How It Works

The Connect node is the first step in any Gate.io automation workflow. It establishes a secure connection to Gate.io and creates a client session.

When executed, the node:

  1. Retrieves the API Key and Secret Key from the provided credentials
  2. Validates that both credentials are not empty
  3. Creates a new Gate.io client instance with the provided credentials
  4. Configures the base URL (defaults to https://api.gateio.ws/api/v4)
  5. Generates a unique client ID for the session
  6. Stores the client in memory for use by other nodes
  7. Returns the client ID for subsequent operations

Requirements

  • A valid Gate.io account
  • Gate.io API Key and Secret Key (created from Gate.io Account Settings > API Management)
  • Both credentials stored in Robomotion Vault
  • Appropriate API permissions enabled (e.g., spot trading, reading)

Error Handling

The node will return specific errors in the following cases:

  • ErrCredentials - Failed to retrieve credentials from Vault
  • ErrInvalidArg - API Key or Secret Key is empty or invalid

Usage Notes

  • The Connect node should be executed before any other Gate.io operations
  • The returned Client Id must be passed to all subsequent Gate.io nodes
  • Each Connect node creates a new client session
  • Always pair Connect with Disconnect to properly clean up resources
  • The client session is stored in memory and automatically removed when the flow stops
  • The node automatically detects testnet URLs (fx-api-testnet.gateio.ws)

Best Practices

  • Store your Gate.io API credentials in Robomotion Vault, never hardcode them
  • Use a single Connect node at the beginning of your flow
  • Always pair Connect with Disconnect nodes to clean up resources
  • Enable IP whitelist restrictions on your Gate.io API keys for security
  • Grant only the minimum necessary permissions to your API keys
  • Use read-only API keys for monitoring flows that don't need trading access
  • For trading bots, avoid granting withdrawal permissions unless absolutely necessary

Security Considerations

  • Enable two-factor authentication (2FA) on your Gate.io account
  • Regularly rotate your API keys
  • Monitor your API key usage in Gate.io account settings
  • Set up IP address whitelisting to restrict API access
  • Never share or expose your API credentials
  • Use separate API keys for different automation purposes
  • Test with small amounts initially when setting up trading automations

Example Flow

[Connect] -> [Get Balance] -> [Get Price] -> [Buy Order] -> [Disconnect]
| ^
+--------------------------------------------------------------+
(Pass Client Id to all nodes)

Alternative Authentication

Most Gate.io nodes support direct credential authentication without using the Connect node. You can provide API Key and Secret Key directly in those nodes' options. However, using the Connect node is recommended for:

  • Better resource management
  • Reusing the same client across multiple operations
  • Cleaner flow design
  • Easier credential updates
  • Reduced API overhead

Testnet Support

To use Gate.io Testnet for testing your automations:

  1. Modify the base URL to use the testnet endpoint
  2. The node automatically detects testnet URLs
  3. Testnet endpoint: fx-api-testnet.gateio.ws
  4. Create separate API keys for testnet from your Gate.io testnet account

Example Usage

Basic Connection

  1. Add a Connect node to your flow
  2. Select your Gate.io API Key credential from Vault
  3. Select your Gate.io Secret Key credential from Vault
  4. Store the output Client Id in a variable
  5. Pass this Client Id to all subsequent Gate.io nodes
  6. Add a Disconnect node at the end of your flow

Error Handling Example

[Connect] -> [Try]
|
+-> [Get Balance]
|
+-> [Catch] -> [Log Error]
|
+-> [Finally] -> [Disconnect]

This ensures the connection is always properly closed, even if errors occur during trading operations.