eosrpc v0.4.1 EOSRPC View Source

EOSRPC Wrapper for Elixir

Based on: https://eosio.github.io/eos/group__eosiorpc.html

See the functions on modules EOSRPC.Wallet and EOSRPC.Chain

There’s also a helper module that has functions to basic scenarios as easy transaction push and account creation: EOSRPC.Helper

Link to this section Summary

Functions

Macro that “bangify” functions, and normalize the exception throws when returning status tuples: {:ok, value} and {:error, reason}

Link to this section Functions

Link to this macro unwrap_or_raise(call) View Source (macro)

Macro that “bangify” functions, and normalize the exception throws when returning status tuples: {:ok, value} and {:error, reason}

Usage

defmodule X do
  import EOSRPC

  def normal(param) do
    if param == 1 do
      {:ok, param + 1}
    else
      {:error, "not one"}
    end
  end

  def normal!() do
    unwrap_or_raise(normal())
  end
end