Wallet service API SDK
Project description
Wallet Python SDK
Python interface for a wallet service.x
Table Of Contents
Overview
Wallet service Python 3 SDK.
Install the wallet-sdk
pip package. Then use the WalletClient
class.
import wallet_sdk
import sys
# Initialize the client
c = wallet_sdk.WalletClient.LoadFromConfig("./your-authority-client-config.json")
# Ensure wallet service is operational
try:
c.check_service_health()
except wallet_sdk.WalletAPIError as e:
print("Failed to ensure wallet service is running:", e)
sys.exit(1)
# Add 10 to user 0's wallet
entry = c.create_entry(user_id='0', amount=10, reason='testing')
print(entry) # {'authority_id': '<your authority id>', 'user_id': '0', 'created_on': 1596869670.124, 'amount': 10, 'reason': 'testing'}
# Get the value of all wallets
wallets = c.get_wallets()
print(wallets) # [{'id': '0', 'total': 10}]
Development
A virtual environment is provided for development purposes.
Install Pipenv, the official Python virtual environment manager.
Then install dependencies:
pipenv install
Finally activate the environment:
pipenv shell
Package
This section documents how the wallet-sdk
pip package is generated.
First activate the development python virtual environment:
pipenv shell
Edit the version in wallet_sdk/VERSION
.
Publish to pip:
make publish PIP_REPO=pypi
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for wallet-sdk-Noah-Huppert-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50d56ba6256aa63db015098e1fcecc79ad325061204782209a6b74131de5922c |
|
MD5 | eb03b5b128973cbcab36630907dd81e1 |
|
BLAKE2b-256 | be93460f2451e3a7d6f64eddf2cd10a3ce2d0d2d8c107b35aa7761434cf268bc |
Close
Hashes for wallet_sdk_Noah_Huppert-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50fdfc2caabce216707c5d8e1796554e1c162ec4eb3a0bb1b3b528b9901c6396 |
|
MD5 | 0affa80c003fab003fa677367cbcf162 |
|
BLAKE2b-256 | c2790121a4021d032feaf65cad8aea94cf38cf38bacd98f85762ed0b75154163 |