Operate v0.1.0-beta.7 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 Ops by the given list of Op references. Returns the result
in an :ok
/ :error
tuple pair.
As c:fetch_ops/2
, but returns the result or raises an exception.
Fetches a transaction by the given txid, and returns the result in an
:ok
/ :error
tuple pair.
As c:fetch_tx/2
, but returns the transaction or raises an exception.
Fetches a list of transactions by the given query map, and returns the result
in an :ok
/ :error
tuple pair.
As c:fetch_tx_by/2
, but returns the result or raises an exception.
Converts the map from the Planaria HTTP response to a Operate.BPU.Transaction.t/0
.
Link to this section Types
option()
View Sourceoption() :: {: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
Fetches a list of Ops by the given list of Op references. Returns the result
in an :ok
/ :error
tuple pair.
Callback implementation for Operate.Adapter.fetch_ops/2
.
As c:fetch_ops/2
, but returns the result or raises an exception.
Callback implementation for Operate.Adapter.fetch_ops!/2
.
Fetches a transaction by the given txid, and returns the result in an
:ok
/ :error
tuple pair.
Callback implementation for Operate.Adapter.fetch_tx/2
.
As c:fetch_tx/2
, but returns the transaction or raises an exception.
Callback implementation for Operate.Adapter.fetch_tx!/2
.
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"
}
}
}
})
As c:fetch_tx_by/2
, but returns the result or raises an exception.
Callback implementation for Operate.Adapter.fetch_tx_by!/2
.
to_bpu(tx)
View Sourceto_bpu(map()) :: Operate.BPU.Transaction.t() | [Operate.BPU.Transaction.t(), ...]
Converts the map from the Planaria HTTP response to a Operate.BPU.Transaction.t/0
.