Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Update the hoprd-sdk-python to reflect the 2.1 API
Browse files Browse the repository at this point in the history
  • Loading branch information
Teebor-Choka committed Jan 9, 2024
1 parent f5ae001 commit c1c24bb
Show file tree
Hide file tree
Showing 219 changed files with 6,142 additions and 11,215 deletions.
247 changes: 94 additions & 153 deletions README.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions docs/AccountAddresses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AccountAddresses

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**hopr** | **str** | |
**native** | **str** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

143 changes: 42 additions & 101 deletions docs/AccountApi.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,19 @@
# hoprd_sdk.AccountApi

All URIs are relative to */api/v3*
All URIs are relative to */*

Method | HTTP request | Description
------------- | ------------- | -------------
[**account_get_address**](AccountApi.md#account_get_address) | **GET** /account/address |
[**account_get_addresses**](AccountApi.md#account_get_addresses) | **GET** /account/addresses |
[**account_get_balances**](AccountApi.md#account_get_balances) | **GET** /account/balances |
[**account_withdraw**](AccountApi.md#account_withdraw) | **POST** /account/withdraw |
[**addresses**](AccountApi.md#addresses) | **GET** /api/v3/account/addresses | Get node's HOPR and native addresses.
[**balances**](AccountApi.md#balances) | **GET** /api/v3/account/balances | Get node's and associated Safe's HOPR and native balances as the allowance for HOPR
[**withdraw**](AccountApi.md#withdraw) | **POST** /api/v3/account/withdraw | Withdraw funds from this node to the ethereum wallet address.

# **account_get_address**
> InlineResponse20010 account_get_address()
# **addresses**
> AddressesAddress addresses()
Get node's HOPR and native addresses.


Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node.

### Example
```python
from __future__ import print_function
import time
import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: keyScheme
configuration = hoprd_sdk.Configuration()
configuration.api_key['x-auth-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme
configuration = hoprd_sdk.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration))

try:
api_response = api_instance.account_get_address()
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->account_get_address: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**InlineResponse20010**](InlineResponse20010.md)

### Authorization

[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **account_get_addresses**
> InlineResponse20010 account_get_addresses()


Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node.
Get node's HOPR and native addresses. HOPR address is represented by the P2P PeerId and can be used by other node owner to interact with this node.

### Example
```python
Expand All @@ -76,35 +23,33 @@ import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: keyScheme
# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['x-auth-token'] = 'YOUR_API_KEY'
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme
configuration = hoprd_sdk.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration))

try:
api_response = api_instance.account_get_addresses()
# Get node's HOPR and native addresses.
api_response = api_instance.addresses()
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->account_get_addresses: %s\n" % e)
print("Exception when calling AccountApi->addresses: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**InlineResponse20010**](InlineResponse20010.md)
[**AddressesAddress**](AddressesAddress.md)

### Authorization

[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme)
[api_token](../README.md#api_token)

### HTTP request headers

Expand All @@ -113,12 +58,12 @@ This endpoint does not need any parameter.

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **account_get_balances**
> InlineResponse2009 account_get_balances()
# **balances**
> AccountBalances balances()
Get node's and associated Safe's HOPR and native balances as the allowance for HOPR

Get node's and associated Safe's HOPR and native balances as well as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance is used to fund payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain.
Get node's and associated Safe's HOPR and native balances as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance are used to fund the payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain.

### Example
```python
Expand All @@ -128,35 +73,33 @@ import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: keyScheme
# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['x-auth-token'] = 'YOUR_API_KEY'
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme
configuration = hoprd_sdk.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration))

try:
api_response = api_instance.account_get_balances()
# Get node's and associated Safe's HOPR and native balances as the allowance for HOPR
api_response = api_instance.balances()
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->account_get_balances: %s\n" % e)
print("Exception when calling AccountApi->balances: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**InlineResponse2009**](InlineResponse2009.md)
[**AccountBalances**](AccountBalances.md)

### Authorization

[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme)
[api_token](../README.md#api_token)

### HTTP request headers

Expand All @@ -165,12 +108,12 @@ This endpoint does not need any parameter.

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **account_withdraw**
> InlineResponse2008 account_withdraw(body=body)
# **withdraw**
> AccountBalances withdraw(body)
Withdraw funds from this node to the ethereum wallet address.


Withdraw funds from this node to your ethereum wallet address. You can choose whitch currency you want to withdraw, NATIVE or HOPR.
Withdraw funds from this node to the ethereum wallet address. Both NATIVE or HOPR can be withdrawn using this method.

### Example
```python
Expand All @@ -180,39 +123,37 @@ import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: keyScheme
# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['x-auth-token'] = 'YOUR_API_KEY'
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme
configuration = hoprd_sdk.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration))
body = hoprd_sdk.AccountWithdrawBody() # AccountWithdrawBody | (optional)
body = hoprd_sdk.WithdrawRequest() # WithdrawRequest |

try:
api_response = api_instance.account_withdraw(body=body)
# Withdraw funds from this node to the ethereum wallet address.
api_response = api_instance.withdraw(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->account_withdraw: %s\n" % e)
print("Exception when calling AccountApi->withdraw: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**AccountWithdrawBody**](AccountWithdrawBody.md)| | [optional]
**body** | [**WithdrawRequest**](WithdrawRequest.md)| |

### Return type

[**InlineResponse2008**](InlineResponse2008.md)
[**AccountBalances**](AccountBalances.md)

### Authorization

[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme)
[api_token](../README.md#api_token)

### HTTP request headers

Expand Down
13 changes: 13 additions & 0 deletions docs/AccountBalances.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AccountBalances

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**hopr** | **str** | |
**native** | **str** | |
**safe_hopr** | **str** | |
**safe_hopr_allowance** | **str** | |
**safe_native** | **str** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Loading

0 comments on commit c1c24bb

Please sign in to comment.