@@ -3,34 +3,57 @@ defmodule EOSRPC.AccountHistory do
33 EOS Account History Apis Wrapper for Elixir
44 """
55
6+ use Tesla
7+
68 import EOSRPC
79
10+ plug ( Tesla.Middleware.JSON )
11+ plug ( EOSRPC.Middleware.Error )
12+
813 @ doc """
914 Get transaction data
1015 """
1116 def get_transaction ( transaction_id ) do
1217 "/get_transaction" |> url ( ) |> post ( % { transaction_id: transaction_id } )
1318 end
1419
20+ def get_transaction! ( transaction_id ) do
21+ unwrap_or_raise ( get_transaction ( transaction_id ) )
22+ end
23+
1524 @ doc """
1625 Get transactions for a given account
1726 """
1827 def get_transactions ( account_name ) do
1928 "/get_transactions" |> url ( ) |> post ( % { account_name: account_name } )
2029 end
2130
31+ def get_transactions! ( account_name ) do
32+ unwrap_or_raise ( get_transactions ( account_name ) )
33+ end
34+
2235 @ doc """
2336 Retrieve accounts associated with a public key
2437 """
2538 def get_key_accounts ( public_key ) do
2639 "/get_key_accounts" |> url ( ) |> post ( % { public_key: public_key } )
2740 end
2841
42+ def get_key_accounts! ( public_key ) do
43+ unwrap_or_raise ( get_key_accounts ( public_key ) )
44+ end
45+
2946 @ doc """
3047 Retrieve accounts which are created by the given account
3148 """
3249 def get_controlled_accounts ( account_name ) do
33- "/get_controlled_accounts" |> url ( ) |> post ( % { controlling_account: account_name } )
50+ "/get_controlled_accounts"
51+ |> url ( )
52+ |> post ( % { controlling_account: account_name } )
53+ end
54+
55+ def get_controlled_accounts! ( account_name ) do
56+ unwrap_or_raise ( get_controlled_accounts ( account_name ) )
3457 end
3558
3659 def url ( url ) ,
0 commit comments