-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20bdcce
commit 880ec36
Showing
134 changed files
with
9,071 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.1.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.