View Source Circlex.Api.Core.Addresses (Circlex v0.1.6)

API Client to the Circle Core Addresses API.

For example, to create a deposit address:

> Circlex.Api.Core.Addresses.generate_deposit_address("USD", "ETH")
{:ok,
  %{
    address: "0x6a9DE7dF6a986a0398348EFB0ECD91f341547b31",
    chain: "ETH",
    currency: "USD"
  }}

To get a list of deposit addresses:

> Circlex.Api.Core.Addresses.list_deposit_addresses()
{
  :ok,
  [
    %{address: "0x522C4caaf435FDF1822C7b6A081858344623Cf84", chain: "ETH", currency: "USD"},
    %{address: "mpLQ2waXiQW6aAtnp9XMWh52R42k3QVjtU", chain: "BTC", currency: "BTC"},
    %{address: "0x6a9DE7dF6a986a0398348EFB0ECD91f341547b31", chain: "ETH", currency: "USD"}
  ]
}

Or to add a recipient address:

> Circlex.Api.Core.Addresses.add_recipient_address("0x9999999999999999999999999999999999999999", "USD", "ETH", "Nines", host: host)
{:ok,
  %Circlex.Struct.Recipient{
    address: "0x9999999999999999999999999999999999999999",
    chain: "ETH",
    currency: "USD",
    description: "Nines",
    id: "a033a6d8-05ae-11ed-9e62-6a1733211c00"
  }}

Reference: https://developers.circle.com/reference/generatebusinessaccountdepositaddress

Link to this section Summary

Functions

Generates a new blockchain address for a wallet for a given currency/chain pair.

Get a list of deposit addresses.

Get a list of verified recipient addresses.

Link to this section Functions

Link to this function

add_recipient_address(address, currency, chain, description, opts \\ [])

View Source

Stores an external blockchain address.

Reference: https://developers.circle.com/reference/createbusinessaccountrecipientaddress

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Addresses.add_recipient_address("0x9999999999999999999999999999999999999999", "USD", "ETH", "Nines", host: host)
{:ok,
  %Circlex.Struct.Recipient{
    address: "0x9999999999999999999999999999999999999999",
    chain: "ETH",
    currency: "USD",
    description: "Nines",
    id: "a033a6d8-05ae-11ed-9e62-6a1733211c00"
  }}
Link to this function

generate_deposit_address(currency, chain, opts \\ [])

View Source

Generates a new blockchain address for a wallet for a given currency/chain pair.

Reference: https://developers.circle.com/reference/generatebusinessaccountdepositaddress

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Addresses.generate_deposit_address("USD", "ETH", host: host)
{:ok,
  %Circlex.Struct.Address{
    address: "0x5d2e4a271103100c8dd463a3229e9fbb7e079f50",
    chain: "ETH",
    currency: "USD"
  }}
Link to this function

list_deposit_addresses(opts \\ [])

View Source

Get a list of deposit addresses.

Reference: https://developers.circle.com/reference/getbusinessaccountdepositaddresses

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Addresses.list_deposit_addresses(host: host)
{
  :ok,
  [
    %{address: "0x522c4caaf435fdf1822c7b6a081858344623cf84", chain: "ETH", currency: "USD"},
    %{address: "mpLQ2waXiQW6aAtnp9XMWh52R42k3QVjtU", chain: "BTC", currency: "BTC"},
    %{address: "0x6a9de7df6a986a0398348efb0ecd91f341547b31", chain: "ETH", currency: "USD"}
  ]
}
Link to this function

list_recipient_address(opts \\ [])

View Source

Get a list of verified recipient addresses.

Reference: https://developers.circle.com/reference/getbusinessaccountrecipientaddresses

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Addresses.list_recipient_address(host: host)
{
  :ok,
  [
    %Circlex.Struct.Recipient{
      address: "0x9dfb4f706a4747355a7ef65cd341a0289034a385",
      chain: "ETH",
      currency: "USD",
      description: "Treasury Adaptor v1",
      id: "7bfd6d2a-3682-52b5-a041-714af6913086"
    },
    %Circlex.Struct.Recipient{
      address: "0x2eb953f992d4fa6e769fabf25d8218f21b793558",
      chain: "ETH",
      currency: "USD",
      description: "Fireblocks Address",
      id: "b2cef1b0-6c54-52b8-9d62-71b85f5b51ed"
    }
  ]
}