View Source Circlex.Api.Core.Transfers (Circlex v0.1.12)

API Client to the Core Transfers API.

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

Link to this section Summary

Functions

A transfer can be made from an existing business account to a blockchain location.

Searches for transfers from your business account.

Link to this section Functions

Link to this function

create(destination, amount, opts \\ [])

View Source

A transfer can be made from an existing business account to a blockchain location.

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

examples

Examples

iex> host = Circlex.Test.start_server()
iex> destination = %{address: "0x871A9FF377eCf2632A0928950dCEb181557F2e17", chain: "ETH", type: "blockchain"}
iex> amount = %{amount: "12345.00", currency: "USD"}
iex> Circlex.Api.Core.Transfers.create(destination, amount, host: host)
{
  :ok,
   %Circlex.Struct.Transfer{
    amount: %Circlex.Struct.Amount{amount: "12345.00", currency: "USD"},
    create_date: "2022-07-17T08:59:41.344582Z",
    destination: %Circlex.Struct.SourceDest{address: "0x871a9ff377ecf2632a0928950dceb181557f2e17", chain: "ETH", type: :blockchain},
    id: "a033a6d8-05ae-11ed-9e62-6a1733211c00",
    source: %Circlex.Struct.SourceDest{id: "1000216185", type: :wallet},
    status: "pending",
    transaction_hash: nil
  }
}
Link to this function

get_transfer(id, opts \\ [])

View Source

Get a transfer.

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

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Transfers.get_transfer("83f18616-0f26-499a-aa8f-4fa4d563b974", host: host)
{
  :ok,
  %Circlex.Struct.Transfer{
    amount: %Circlex.Struct.Amount{amount: "8999998.14", currency: "USD"},
    create_date: "2022-05-05T16:49:04.541Z",
    destination: %Circlex.Struct.SourceDest{address: "0x2eb953f992d4fa6e769fabf25d8218f21b793558", chain: "ETH", type: :blockchain},
    id: "83f18616-0f26-499a-aa8f-4fa4d563b974",
    source: %Circlex.Struct.SourceDest{id: "1000216185", type: :wallet},
    status: "complete",
    transaction_hash: "0xef6cf276368eb0e36162074b1c17a3256df14635c8603f076e826650c9f8a9ff"
  }
}
Link to this function

list_transfers(opts \\ [])

View Source

Searches for transfers from your business account.

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

TODO: Filters

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Transfers.list_transfers(host: host)
{
  :ok,
  [
    %Circlex.Struct.Transfer{
      amount: %Circlex.Struct.Amount{amount: "8999998.14", currency: "USD"},
      create_date: "2022-05-05T16:49:04.541Z",
      destination: %Circlex.Struct.SourceDest{address: "0x2eb953f992d4fa6e769fabf25d8218f21b793558", chain: "ETH", type: :blockchain},
      id: "83f18616-0f26-499a-aa8f-4fa4d563b974",
      source: %Circlex.Struct.SourceDest{id: "1000216185", type: :wallet},
      status: "complete",
      transaction_hash: "0xef6cf276368eb0e36162074b1c17a3256df14635c8603f076e826650c9f8a9ff"
    }
  ]
}