FireblocksSdk.Api.ExchangeAccount (FireblocksSdk v0.2.1)

Copy Markdown View Source

Summary

Functions

Add an exchange account to the workspace.

Convert assets on an exchange account.

Find a specific exchange account by its ID.

Get a specific asset on an exchange account.

List all exchange accounts (paginated).

Get the public key used to encrypt exchange account credentials.

Transfer funds between trading accounts on the same exchange account.

Functions

add_account(opts, idempotent_key \\ "")

Add an exchange account to the workspace.

FireblocksSdk.Api.ExchangeAccount.add_account([
  exchangeType: :binance,
  name: "My Binance Account",
  key: "api-key-here"
])

Options:

  • :exchangeType - Required. The type of exchange account to add

  • :name (String.t/0) - Required. Display name of the exchange account

  • :creds (String.t/0) - Encrypted credentials

  • :key (String.t/0) - API key of the exchange

  • :mainAccountId (String.t/0) - Optional main account ID of the exchange

convert(opts, idempotent_key \\ "")

Convert assets on an exchange account.

FireblocksSdk.Api.ExchangeAccount.convert([
  exchangeId: "binance-account-id",
  amount: "100",
  srcAsset: "USDT",
  destAsset: "BTC"
])

Options:

  • :exchangeId (String.t/0) - Required. The ID of the exchange account to convert assets on

  • :amount (String.t/0) - Required. The amount to convert

  • :srcAsset (String.t/0) - Required. The source asset to convert from

  • :destAsset (String.t/0) - Required. The destination asset to convert to

get_account(exchange_id)

Find a specific exchange account by its ID.

  • exchange_id: The ID of the exchange account to retrieve

get_account_asset(exchange_account_id, asset_id)

Get a specific asset on an exchange account.

  • exchange_account_id: The ID of the exchange account
  • asset_id: The asset ID (e.g. "BTC", "ETH")

get_accounts(filter \\ [])

List all exchange accounts (paginated).

Options:

  • :before (String.t/0) - Fetch results before this cursor

  • :after (String.t/0) - Fetch results after this cursor

  • :limit (non_neg_integer/0) - Maximum number of results to return The default value is 3.

get_credentials_public_key()

Get the public key used to encrypt exchange account credentials.

Returns the RSA public key that should be used to encrypt exchange API credentials before submitting them via add_account/2.

transfer(opts, idempotent_key \\ "")

Transfer funds between trading accounts on the same exchange account.

FireblocksSdk.Api.ExchangeAccount.transfer([
  exchangeId: "binance-account-id",
  asset: "BTC",
  amount: "0.5",
  sourceType: :spot,
  destType: :futures
])

Options:

  • :exchangeId (String.t/0) - Required. The ID of the exchange account to transfer from

  • :asset (String.t/0) - Required. The asset to transfer

  • :amount (String.t/0) - Required. The amount to transfer

  • :sourceType - Required. The source trading account type. One of :coin_futures, :coin_margined_swap, :exchange, :funding, :fundable, :futures, :futures_cross, :margin, :margin_cross, :options, :spot, :usdt_margined_swap_cross, :usdt_futures, :unified

  • :destType - Required. The destination trading account type. One of :coin_futures, :coin_margined_swap, :exchange, :funding, :fundable, :futures, :futures_cross, :margin, :margin_cross, :options, :spot, :usdt_margined_swap_cross, :usdt_futures, :unified