Skip to content

Commit

Permalink
Release preparations
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielaIvanova committed Jan 31, 2020
1 parent 20bdcce commit 880ec36
Show file tree
Hide file tree
Showing 134 changed files with 9,071 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
# The directory Mix downloads your dependencies sources to.
/deps/

# Directories, where we keep autogenerated code.
/lib/aeternity_node/
/lib/middleware/

# Where third-party dependencies like ExDoc output generated docs.
/doc/

Expand Down
2 changes: 1 addition & 1 deletion examples/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ First, add **Aepp SDK Elixir** to your `mix.exs` dependencies:
``` elixir
defp deps do
[
{:aepp_sdk_elixir, git: "https://github.com/aeternity/aepp-sdk-elixir.git", tag: "v0.5.3"}
{:aepp_sdk_elixir, git: "https://github.com/aeternity/aepp-sdk-elixir.git", tag: "v0.5.4"}
]
end
```
Expand Down
23 changes: 23 additions & 0 deletions lib/aeternity_node/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
1 change: 1 addition & 0 deletions lib/aeternity_node/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.1.0-SNAPSHOT
122 changes: 122 additions & 0 deletions lib/aeternity_node/api/account.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
defmodule AeternityNode.Api.Account do
@moduledoc """
API calls for all endpoints tagged `Account`.
"""

alias AeternityNode.Connection
import AeternityNode.RequestBuilder

@doc """
Get an account by public key
## Parameters
- connection (AeternityNode.Connection): Connection to server
- pubkey (String.t): The public key of the account
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %AeternityNode.Model.Account{}} on success
{:error, info} on failure
"""
@spec get_account_by_pubkey(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, AeternityNode.Model.Account.t()} | {:error, Tesla.Env.t()}
def get_account_by_pubkey(connection, pubkey, _opts \\ []) do
%{}
|> method(:get)
|> url("/accounts/#{pubkey}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %AeternityNode.Model.Account{}},
{400, %AeternityNode.Model.Error{}},
{404, %AeternityNode.Model.Error{}}
])
end

@doc """
Get an account by public key after the block indicated by hash
## Parameters
- connection (AeternityNode.Connection): Connection to server
- pubkey (String.t): The public key of the account
- hash (String.t): The hash of the block
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %AeternityNode.Model.Account{}} on success
{:error, info} on failure
"""
@spec get_account_by_pubkey_and_hash(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, AeternityNode.Model.Account.t()} | {:error, Tesla.Env.t()}
def get_account_by_pubkey_and_hash(connection, pubkey, hash, _opts \\ []) do
%{}
|> method(:get)
|> url("/accounts/#{pubkey}/hash/#{hash}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %AeternityNode.Model.Account{}},
{400, %AeternityNode.Model.Error{}},
{404, %AeternityNode.Model.Error{}}
])
end

@doc """
Get an account by public key after the opening key block of the generation at height
## Parameters
- connection (AeternityNode.Connection): Connection to server
- pubkey (String.t): The public key of the account
- height (integer()): The height
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %AeternityNode.Model.Account{}} on success
{:error, info} on failure
"""
@spec get_account_by_pubkey_and_height(Tesla.Env.client(), String.t(), integer(), keyword()) ::
{:ok, AeternityNode.Model.Account.t()} | {:error, Tesla.Env.t()}
def get_account_by_pubkey_and_height(connection, pubkey, height, _opts \\ []) do
%{}
|> method(:get)
|> url("/accounts/#{pubkey}/height/#{height}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %AeternityNode.Model.Account{}},
{400, %AeternityNode.Model.Error{}},
{404, %AeternityNode.Model.Error{}}
])
end

@doc """
Get pending account transactions by public key
## Parameters
- connection (AeternityNode.Connection): Connection to server
- pubkey (String.t): The public key of the account
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %AeternityNode.Model.GenericTxs{}} on success
{:error, info} on failure
"""
@spec get_pending_account_transactions_by_pubkey(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, AeternityNode.Model.GenericTxs.t()} | {:error, Tesla.Env.t()}
def get_pending_account_transactions_by_pubkey(connection, pubkey, _opts \\ []) do
%{}
|> method(:get)
|> url("/accounts/#{pubkey}/transactions/pending")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %AeternityNode.Model.GenericTxs{}},
{400, %AeternityNode.Model.Error{}},
{404, %AeternityNode.Model.Error{}}
])
end
end
Loading

0 comments on commit 880ec36

Please sign in to comment.