ExCcxt.Credential (ex_ccxt v0.1.1)

Represents authentication credentials for accessing private APIs on cryptocurrency exchanges.

This struct contains the various authentication parameters that may be required by different exchanges for private operations like trading, fetching balances, and order management. Use ExCcxt.Credential.new/1 to create and validate credentials based on exchange requirements.

Fields

  • :name - Exchange name (required, e.g., "binance", "kraken")
  • :apiKey - API key credential (boolean field indicating if provided)
  • :secret - Secret key credential (boolean field indicating if provided)
  • :password - Password/passphrase credential (boolean field indicating if provided)
  • :login - Login credential (boolean field indicating if provided)
  • :uid - User ID credential (boolean field indicating if provided)
  • :token - Token credential (boolean field indicating if provided)
  • :twofa - Two-factor authentication credential (boolean field indicating if provided)
  • :privateKey - Private key credential (boolean field indicating if provided)
  • :walletAddress - Wallet address credential (boolean field indicating if provided)

Usage

# Create credentials for an exchange
{:ok, cred} = ExCcxt.Credential.new(
  name: "binance",
  apiKey: "your_api_key",
  secret: "your_secret"
)

# Use credentials with private API functions
ExCcxt.fetch_balance(cred)

Summary

Types

t()

@type t() :: %ExCcxt.Credential{
  apiKey: boolean() | nil,
  login: boolean() | nil,
  name: String.t() | nil,
  password: boolean() | nil,
  privateKey: boolean() | nil,
  secret: boolean() | nil,
  token: boolean() | nil,
  twofa: boolean() | nil,
  uid: boolean() | nil,
  walletAddress: boolean() | nil
}

Functions

new(keywords)