Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #126 Added Python Wrapper for Harware Wallet Deamon #130

Open
wants to merge 19 commits into
base: 0.25.dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fba24c9
refs #96 Modifying the makefile to silence the warnings
Jan 18, 2019
960d7ae
Merge branch 'develop' of https://github.com/skycoin/pyskycoin into s…
Jan 31, 2019
bd0ddea
refs #96 Added in .gitignore skycoin.py and pyskycoin_wrap.c
Feb 8, 2019
21c7b83
Merge pull request #111 from simelo/stdevHan_t96_silent_swig
olemis Feb 10, 2019
1683150
[skyhwd] refs #126 Added Python Wrapper for HWallet Deamon
stdevMac Apr 11, 2019
ea9b839
[skyhwd] refs #126 Added lib to MANIFEST.in
stdevMac Apr 11, 2019
c9eb196
[skyhwd] refs #126 Updated requirements for travis
stdevMac Apr 12, 2019
40a65b9
[skyhwd] refs #126 Update test for HWD for make test-ci
stdevMac Apr 13, 2019
a93216a
[skyhwd] refs #126 Removed Unused libraries
stdevMac Apr 13, 2019
ae2eaa0
[skyhwd] refs #126 Updated MANIFEST.in for test cases
stdevMac Apr 13, 2019
84d25d7
[skyhwd] refs #126 Updated python2.7.14 version in travis for osx
stdevMac Apr 14, 2019
5d215cf
[skyhwd] refs #126 Updated Makefile, get Hardware-Wallet-Deamon spec
stdevMac Apr 14, 2019
0c1bc76
[skyhwd] refs #126 Updated travis pyenv version
stdevMac Apr 14, 2019
0c5aa72
[skyhwd] refs #126 Updated pyenv to 2.7.16
stdevMac Apr 14, 2019
5bee2b7
Merge remote-tracking branch 'remotes/origin/0.25.dev' into stdevMac_…
stdevMac Apr 14, 2019
c15d51f
[skyhwd] refs #126 Updated pip install in linux for travis
stdevMac Apr 14, 2019
ec29f66
Merge remote-tracking branch 'origin/0.25.dev' into stdevMac_t126_har…
stdevMac Apr 27, 2019
59cefe4
[manifest] refs #126 resolve Manifest directions
stdevMac May 10, 2019
bda06fa
[ci] refs #126 Ignore skyhwd swagger file in Manifest.in
stdevMac May 10, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ tests/mytest.py
# SWIG
*.kbk

skycoin/skycoin.py
swig/pyskycoin_wrap.c
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ recursive-exclude . *.orig
exclude .github
exclude .travis
exclude lib/skyapi
exclude lib/skyhwd
exclude .pytest_cache
exclude lib/skywallet-deamon.yml
recursive-exclude .github *
recursive-exclude .travis *
recursive-exclude lib/skyapi *
recursive-exclude lib/skyhwd *
recursive-exclude .pytest_cache *

29 changes: 28 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@ 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")

.DEFAULT_GOAL := help
.PHONY: configure build-libc build-swig develop build-libc-swig build
.PHONY: test test-ci help

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

PYTHON = python
PWD = $(shell pwd)
GOPATH_DIR = $(PWD)/gopath
SKYCOIN_DIR = gopath/src/github.com/skycoin/skycoin
SKYBUILD_DIR = $(SKYCOIN_DIR)/build
BUILDLIBC_DIR = $(SKYBUILD_DIR)/libskycoin
LIBC_DIR = $(SKYCOIN_DIR)/lib/cgo
LIBSWIG_DIR = swig
BUILD_DIR = build
DIST_DIR = dist
BIN_DIR = $(SKYCOIN_DIR)/bin
INCLUDE_DIR = $(SKYCOIN_DIR)/include
FULL_PATH_LIB = $(PWD)/$(BUILDLIBC_DIR)

LIB_FILES = $(shell find $(SKYCOIN_DIR)/lib/cgo -type f -name "*.go")
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/skyapi

ifeq ($(shell uname -s),Linux)
Expand Down Expand Up @@ -78,7 +105,7 @@ build: build-libc-swig ## Build PySkycoin Python package

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

test: build-libc build-swig develop ## Run project test suite
$(PYTHON) setup.py test
Expand Down
64 changes: 64 additions & 0 deletions lib/skyhwd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints
23 changes: 23 additions & 0 deletions lib/skyhwd/.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/skyhwd/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.4
14 changes: 14 additions & 0 deletions lib/skyhwd/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
#- "3.5-dev" # 3.5 development branch
#- "nightly" # points to the latest development branch e.g. 3.6-dev
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: nosetests
140 changes: 140 additions & 0 deletions lib/skyhwd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# skyhwd
This is the hardware-wallet-daemon API

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.1.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python 2.7 and 3.4+

## Installation & Usage
### pip install

If the python package is hosted on Github, you can install directly from Github

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import skyhwd
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import skyhwd
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
from __future__ import print_function
import time
import skyhwd
from skyhwd.rest import ApiException
from pprint import pprint

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

# create an instance of the API class
api_instance = skyhwd.DefaultApi(skyhwd.ApiClient(configuration))
apply_settings_request = skyhwd.ApplySettingsRequest() # ApplySettingsRequest | ApplySettingsRequest is request data for /api/v1/apply_settings (optional)

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

```

## Documentation for API Endpoints

All URIs are relative to *http://127.0.0.1:9510/api/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**apply_settings_post**](docs/DefaultApi.md#apply_settings_post) | **POST** /apply_settings |
*DefaultApi* | [**backup_post**](docs/DefaultApi.md#backup_post) | **POST** /backup |
*DefaultApi* | [**cancel_put**](docs/DefaultApi.md#cancel_put) | **PUT** /cancel |
*DefaultApi* | [**check_message_signature_post**](docs/DefaultApi.md#check_message_signature_post) | **POST** /check_message_signature |
*DefaultApi* | [**connected_get**](docs/DefaultApi.md#connected_get) | **GET** /connected |
*DefaultApi* | [**csrf_get**](docs/DefaultApi.md#csrf_get) | **GET** /csrf |
*DefaultApi* | [**features_get**](docs/DefaultApi.md#features_get) | **GET** /features |
*DefaultApi* | [**firmware_update_put**](docs/DefaultApi.md#firmware_update_put) | **PUT** /firmware_update |
*DefaultApi* | [**generate_addresses_post**](docs/DefaultApi.md#generate_addresses_post) | **POST** /generate_addresses |
*DefaultApi* | [**generate_mnemonic_post**](docs/DefaultApi.md#generate_mnemonic_post) | **POST** /generate_mnemonic |
*DefaultApi* | [**intermediate_passphrase_post**](docs/DefaultApi.md#intermediate_passphrase_post) | **POST** /intermediate/passphrase |
*DefaultApi* | [**intermediate_pin_matrix_post**](docs/DefaultApi.md#intermediate_pin_matrix_post) | **POST** /intermediate/pin_matrix |
*DefaultApi* | [**intermediate_word_post**](docs/DefaultApi.md#intermediate_word_post) | **POST** /intermediate/word |
*DefaultApi* | [**recovery_post**](docs/DefaultApi.md#recovery_post) | **POST** /recovery |
*DefaultApi* | [**set_mnemonic_post**](docs/DefaultApi.md#set_mnemonic_post) | **POST** /set_mnemonic |
*DefaultApi* | [**set_pin_code_post**](docs/DefaultApi.md#set_pin_code_post) | **POST** /set_pin_code |
*DefaultApi* | [**sign_message_post**](docs/DefaultApi.md#sign_message_post) | **POST** /sign_message |
*DefaultApi* | [**transaction_sign_post**](docs/DefaultApi.md#transaction_sign_post) | **POST** /transaction_sign |
*DefaultApi* | [**wipe_delete**](docs/DefaultApi.md#wipe_delete) | **DELETE** /wipe |


## Documentation For Models

- [ApplySettingsRequest](docs/ApplySettingsRequest.md)
- [CSRFResponse](docs/CSRFResponse.md)
- [CheckMessageSignatureRequest](docs/CheckMessageSignatureRequest.md)
- [FeaturesResponse](docs/FeaturesResponse.md)
- [FeaturesResponseData](docs/FeaturesResponseData.md)
- [GenerateAddressesRequest](docs/GenerateAddressesRequest.md)
- [GenerateAddressesResponse](docs/GenerateAddressesResponse.md)
- [GenerateMnemonicRequest](docs/GenerateMnemonicRequest.md)
- [HTTPErrorResponse](docs/HTTPErrorResponse.md)
- [HTTPErrorResponseError](docs/HTTPErrorResponseError.md)
- [HTTPSuccessResponse](docs/HTTPSuccessResponse.md)
- [InlineResponse200](docs/InlineResponse200.md)
- [PassphraseRequest](docs/PassphraseRequest.md)
- [PinMatrixRequest](docs/PinMatrixRequest.md)
- [RecoveryRequest](docs/RecoveryRequest.md)
- [SetMnemonicRequest](docs/SetMnemonicRequest.md)
- [SignMessageRequest](docs/SignMessageRequest.md)
- [SignMessageResponse](docs/SignMessageResponse.md)
- [TransactionInput](docs/TransactionInput.md)
- [TransactionOutput](docs/TransactionOutput.md)
- [TransactionSignRequest](docs/TransactionSignRequest.md)
- [TransactionSignResponse](docs/TransactionSignResponse.md)
- [WordRequest](docs/WordRequest.md)


## Documentation For Authorization


## csrfAuth

- **Type**: API key
- **API key parameter name**: X-CSRF-TOKEN
- **Location**: HTTP header


## Author

[email protected]


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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | **str** | | [optional]
**use_passphrase** | **bool** | | [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)


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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | **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)


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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **str** | |
**signature** | **str** | |
**address** | **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