Skip to content

Commit a7b90ea

Browse files
committed
Add get_actions function to account_history
1 parent 07380be commit a7b90ea

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

lib/eosrpc/account_history.ex

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
defmodule EOSRPC.AccountHistory do
22
@moduledoc """
33
EOS Account History Apis Wrapper for Elixir
4+
5+
Based on: https://developers.eos.io/eosio-nodeos/reference on History section
46
"""
57

68
use Tesla
@@ -10,6 +12,18 @@ defmodule EOSRPC.AccountHistory do
1012
plug(Tesla.Middleware.JSON)
1113
plug(EOSRPC.Middleware.Error)
1214

15+
16+
@doc """
17+
Gets all actions for a given account
18+
"""
19+
def get_actions(account_name) do
20+
"get_actions" |> url() |> post(%{account_name: account_name})
21+
end
22+
23+
def get_actions!(account_name) do
24+
unwrap_or_raise(get_actions(account_name))
25+
end
26+
1327
@doc """
1428
Get transaction data
1529
"""

lib/eosrpc/chain.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule EOSRPC.Chain do
22
@moduledoc """
33
EOSRPC Wallet Wrapper for Elixir
44
5-
Based on: https://developers.eos.io/eosio-nodeos/v1.2.0/reference
5+
Based on: https://developers.eos.io/eosio-nodeos/v1.2.0/reference on Chain section
66
"""
77

88
use Tesla

lib/eosrpc/history.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ defmodule EOSRPC.History do
77
@callback get_actions(account_name :: binary, post :: integer, offset :: integer) :: any
88
@callback url(url :: binary) :: binary
99

10+
use Tesla
11+
1012
import EOSRPC
1113

1214
@doc """

0 commit comments

Comments
 (0)