Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/0.25.dev' into stdevMac_…
Browse files Browse the repository at this point in the history
…t126_hardware_wallet_demon_python_api_wrapper
  • Loading branch information
stdevMac committed Apr 14, 2019
2 parents 0c5aa72 + 1b73050 commit 5bee2b7
Show file tree
Hide file tree
Showing 95 changed files with 25,244 additions and 10,018 deletions.
2 changes: 2 additions & 0 deletions .travis/install-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ chmod +x "$HOME/bin/gimme"
# Install Python libraries
$PIP install --upgrade pip setuptools tox-travis
$PIP install -r "$REPO_ROOT/requirements.dev.txt"
$PIP install -r "$REPO_ROOT/skyapi/requirements.txt"
$PIP install -r "$REPO_ROOT/skyapi/test-requirements.txt"

# Compile SWIG
mkdir swig_build && \
Expand Down
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.DEFAULT_GOAL := help
.PHONY: configure build-libc build-swig develop build-libc-swig build
.PHONY: configure build-libc build-swig develop build-libc-swig build
.PHONY: test test-ci help

# Compilation output
.ONESHELL:
SHELL := /bin/bash

PYTHON_BIN = python
PYTHON = python
PWD = $(shell pwd)
GOPATH_DIR = $(PWD)/gopath
SKYCOIN_DIR = gopath/src/github.com/skycoin/skycoin
Expand All @@ -25,6 +25,8 @@ SRC_FILES = $(shell find $(SKYCOIN_DIR)/src -type f -name "*.go")
SWIG_FILES = $(shell find $(LIBSWIG_DIR) -type f -name "*.i")
HEADER_FILES = $(shell find $(SKYCOIN_DIR)/include -type f -name "*.h")

PYTHON_CLIENT_DIR = lib

ifeq ($(shell uname -s),Linux)
TEMP_DIR = tmp
else ifeq ($(shell uname -s),Darwin)
Expand All @@ -35,8 +37,6 @@ configure: ## Configure build environment
mkdir -p $(BUILD_DIR)/usr/tmp $(BUILD_DIR)/usr/lib $(BUILD_DIR)/usr/include
mkdir -p $(BUILDLIBC_DIR) $(BIN_DIR) $(INCLUDE_DIR)
mkdir -p $(DIST_DIR)
rm -rf lib/skywallet-deamon-spec.yml
(cd lib && wget https://github.com/skycoin/hardware-wallet-daemon/blob/master/swagger.yml && mv swagger.yml skywallet-deamon-spec.yml)

$(BUILDLIBC_DIR)/libskycoin.a: $(LIB_FILES) $(SRC_FILES) $(HEADER_FILES)
rm -f $(BUILDLIBC_DIR)/libskycoin.a
Expand Down Expand Up @@ -64,28 +64,33 @@ build-swig: ## Generate Python C module from SWIG interfaces
rm -f swig/pyskycoin_wrap.c
rm -f swig/include/swig.h
cp -v gopath/src/github.com/skycoin/skycoin/include/swig.h swig/include/
swig -python -w501,505,401,302,509,451 -Iswig/include -I$(INCLUDE_DIR) -outdir ./skycoin/ -o swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/pyskycoin.i
swig -python -Iswig/include -I$(INCLUDE_DIR) -outdir ./skycoin/ -o swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/pyskycoin.i

develop: ## Install PySkycoin for development
$(PYTHON_BIN) setup.py develop
$(PYTHON) setup.py develop
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py develop)

build-libc-swig: build-libc build-swig

build: build-libc-swig ## Build PySkycoin Python package
$(PYTHON_BIN) setup.py build
$(PYTHON) setup.py build
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py build)

test-ci: ## Run tests on (Travis) CI build
tox
(cd lib/skyhwd && tox)

test: build-libc build-swig develop ## Run project test suite
$(PYTHON_BIN) setup.py test
$(PYTHON) setup.py test
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py test)

sdist: ## Create source distribution archive
$(PYTHON_BIN) setup.py sdist --formats=gztar
$(PYTHON) setup.py sdist --formats=gztar
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py sdist --formats=gztar)

bdist_wheel: ## Create architecture-specific binary wheel distribution archive
$(PYTHON_BIN) setup.py bdist_wheel
$(PYTHON) setup.py bdist_wheel
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py bdist_wheel)

# FIXME: After libskycoin 32-bits binaries add bdist_manylinux_i686
bdist_manylinux: bdist_manylinux_amd64 ## Create multilinux binary wheel distribution archives
Expand All @@ -109,4 +114,3 @@ check-dist: dist ## Perform self-tests upon distributions archives

help: ## List available commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**branch** | **str** | git branch name | [optional]
**commit** | **str** | git commit id | [optional]
**version** | **str** | version number | [optional]

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


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

All URIs are relative to *http://staging.node.skycoin.net*

Method | HTTP request | Description
------------- | ------------- | -------------
[**coin_supply**](DefaultApi.md#coin_supply) | **GET** /api/v1/coinSupply |
[**csrf_token**](DefaultApi.md#csrf_token) | **GET** /api/v1/csrf | Creates a new CSRF token. Previous CSRF tokens are invalidated by this call.
[**resend_unconfirmed_txns**](DefaultApi.md#resend_unconfirmed_txns) | **POST** /api/v1/resendUnconfirmedTxns |
[**version**](DefaultApi.md#version) | **GET** /api/v1/version |
[**wallet_folder**](DefaultApi.md#wallet_folder) | **GET** /api/v1/wallets/folderName |


# **coin_supply**
> coin_supply()


coinSupplyHandler returns coin distribution supply stats

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

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
api_instance.coin_supply()
except ApiException as e:
print("Exception when calling DefaultApi->coin_supply: %s\n" % e)
```

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

### Return type

void (empty response body)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **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)

# **csrf_token**
> InlineResponse200 csrf_token()
Creates a new CSRF token. Previous CSRF tokens are invalidated by this call.

Response -> CSRF token to use in POST requests

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

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
# Creates a new CSRF token. Previous CSRF tokens are invalidated by this call.
api_response = api_instance.csrf_token()
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->csrf_token: %s\n" % e)
```

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

### Return type

[**InlineResponse200**](InlineResponse200.md)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **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)

# **resend_unconfirmed_txns**
> resend_unconfirmed_txns()


Broadcasts all unconfirmed transactions from the unconfirmed transaction pool

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

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
api_instance.resend_unconfirmed_txns()
except ApiException as e:
print("Exception when calling DefaultApi->resend_unconfirmed_txns: %s\n" % e)
```

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

### Return type

void (empty response body)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **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)

# **version**
> BuildInfo version()


versionHandler returns the application version info

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

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

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

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

### Return type

[**BuildInfo**](BuildInfo.md)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **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)

# **wallet_folder**
> wallet_folder()


Returns the wallet directory path

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

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
api_instance.wallet_folder()
except ApiException as e:
print("Exception when calling DefaultApi->wallet_folder: %s\n" % e)
```

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

### Return type

void (empty response body)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **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)

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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**csrf_token** | **str** | Csrf Token is here | [optional]

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


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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | | [optional]
**field** | **str** | | [optional]
**message** | **str** | | [optional]

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


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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | | [optional]
**message** | **str** | | [optional]

[[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 5bee2b7

Please sign in to comment.