Operate v0.1.0-beta.15 Operate.Adapter.Bob View Source

Adapter module for loading tapes and Ops from BOB.

Examples

iex> Operate.Adapter.Bob.fetch_tx(txid, api_key: "mykey")
{:ok, %Operate.BPU.Transaction{}}

Link to this section Summary

Functions

Fetches a list of transactions by the given query map, and returns the result in an :ok / :error tuple pair.

Converts the map from the Planaria HTTP response to a Operate.BPU.Transaction.t/0.

Link to this section Types

Specs

option() ::
  {:method, Tesla.Env.method()}
  | {:url, Tesla.Env.url()}
  | {:query, Tesla.Env.query()}
  | {:headers, Tesla.Env.headers()}
  | {:body, Tesla.Env.body()}
  | {:opts, Tesla.Env.opts()}

Link to this section Functions

Link to this function

fetch_ops(refs, options \\ [])

View Source

Callback implementation for Operate.Adapter.fetch_ops/2.

Link to this function

fetch_ops!(refs, options \\ [])

View Source

Callback implementation for Operate.Adapter.fetch_ops!/2.

Link to this function

fetch_tx(txid, options \\ [])

View Source

Callback implementation for Operate.Adapter.fetch_tx/2.

Link to this function

fetch_tx!(txid, options \\ [])

View Source

Callback implementation for Operate.Adapter.fetch_tx!/2.

Link to this function

fetch_tx_by(query, options \\ [])

View Source

Fetches a list of transactions by the given query map, and returns the result in an :ok / :error tuple pair.

The query parameter should be a valid Bitquery. The project attribute cannot be used and unless otherwise specified, limit defaults to 10.

Options

The accepted options are:

  • :api_key - Planaria API key

Examples

Operate.Adapter.Bob.fetch_tx_by(%{
  "find" => %{
    "out.tape.cell" => %{
      "$elemMatch" => %{
        "i" => 0,
        "s" => "1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5"
      }
    }
  }
})
Link to this function

fetch_tx_by!(query, options \\ [])

View Source

Callback implementation for Operate.Adapter.fetch_tx_by!/2.

Specs

Converts the map from the Planaria HTTP response to a Operate.BPU.Transaction.t/0.