Skip to main content

Python wrapper to interact with the ZUM Services API.

Project description

ZUM Services Python API Interface

This wrapper allows you to easily interact with the ZUM Services 1.0.1 API to quickly develop applications that interact with the ZumCoin Network.

Table of Contents

  1. Installation
  2. Intialization
  3. Documentation
  4. Methods

Installation

pip install zumservices-api-py

Intialization

import os
from ZUMservices import ZS

os.environ["ZUM_SERVICES_TOKEN"] = "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoieW8iLCJhcHBJZCI6MjAsInVzZXJJZCI6MiwicGVybWlzc2lvbnMiOlsiYWRkcmVzczpuZXciLCJhZGRyZXNzOnZpZXciLCJhZGRyZXNzOmFsbCIsImFkZHJlc3M6c2NhbiIsImFkZHJlc3M6ZGVsZXRlIiwidHJhbnNmZXI6bmV3IiwidHJhbnNmZXI6dmlldyJdLCJpYXQiOjE1Mzk5OTQ4OTgsImV4cCI6MTU3MTU1MjQ5OCwiYXVkIjoiZ2FuZy5jb20iLCJpc3MiOiJUUlRMIFNlcnZpY2VzIiwianRpIjoiMjIifQ.KkKyg18aqZfLGMGTnUDhYQmVSUoocrr4CCdLBm2K7V87s2T-3hTtM2MChJB2UdbDLWnf58GiMa_t8xp9ZjZjIg"

os.environ["ZUM_SERVICES_TIMEOUT"] = 2000

Generate a token with the ZUM Services Dashboard and store it as the variable ZUM_SERVICES_TOKEN in your os environment along with ZUM_SERVICES_TIMEOUT if you wish the change the default timeout of 2000.

Documentation

API documentation is available at https://zum.services/documentation

Methods

createAddress()

Create a new ZUM addresses

ZS.createAddress()

getAddress(address)

Get address details by address

ZS.getAddress("Zum1yfSrdpfiSNG5CtYmckgpGe1FiAc9gLCEZxKq29puNCX92DUkFYFfEGKugPS6EhWaJXmhAzhePGs3jXvNgK4NbWXG4yaGBHC")

deleteAddress(address)

Delete a selected ZUM address

ZS.deleteAdddress("Zum1yfSrdpfiSNG5CtYmckgpGe1FiAc9gLCEZxKq29puNCX92DUkFYFfEGKugPS6EhWaJXmhAzhePGs3jXvNgK4NbWXG4yaGBHC")

getAddresses()

View all addresses.

ZS.getAddresses()

scanAddress(address, blockIndex)

Scan an address for transactions between a 100 block range starting from the specified blockIndex.

ZS.scanAddress("Zum1yfSrdpfiSNG5CtYmckgpGe1FiAc9gLCEZxKq29puNCX92DUkFYFfEGKugPS6EhWaJXmhAzhePGs3jXvNgK4NbWXG4yaGBHC", 899093)

getAddressKeys(address)

Get the public and secret spend key of an address.

ZS.getAddressKeys("Zum1yfSrdpfiSNG5CtYmckgpGe1FiAc9gLCEZxKq29puNCX92DUkFYFfEGKugPS6EhWaJXmhAzhePGs3jXvNgK4NbWXG4yaGBHC")

integrateAddress(address, paymentId)

Create an integrated address with an address and payment ID.

ZS.integrateAddress("Zum1yfSrdpfiSNG5CtYmckgpGe1FiAc9gLCEZxKq29puNCX92DUkFYFfEGKugPS6EhWaJXmhAzhePGs3jXvNgK4NbWXG4yaGBHC", "7d89a2d16365a1198c46db5bbe1af03d2b503a06404f39496d1d94a0a46f8804")

getIntegratedAddresses(address)

Get all integrated addresses by address.

ZS.getIntegratedAddresses("Zum1yfSrdpfiSNG5CtYmckgpGe1FiAc9gLCEZxKq29puNCX92DUkFYFfEGKugPS6EhWaJXmhAzhePGs3jXvNgK4NbWXG4yaGBHC")

getFee(amount)

Calculate the ZUM Services fee for an amount specified in ZUM with two decimal points.

ZS.getFee(1.23)

createTransfer(sender, receiver, amount, fee, paymentId, extra)

Send a ZUM transaction with an address with the amount specified two decimal points.

ZS.createTransfer(
  "Zum1yfSrdpfiSNG5CtYmckgpGe1FiAc9gLCEZxKq29puNCX92DUkFYFfEGKugPS6EhWaJXmhAzhePGs3jXvNgK4NbWXG4yaGBHC",
  "Zum1yhbRwHsXj19c1hZgFzgxVcWDywsJcDKURDud83MqMNKoDTvKEDf6k7BoHnfCiPbj4kY2arEmQTwiVmhoELPv3UKhjYjCMcm",
  1234.56,
  1.23,
  "7d89a2d16365a1198c46db5bbe1af03d2b503a06404f39496d1d94a0a46f8804",
  "3938f915a11582f62d93f82f710df9203a029f929fd2f915f2701d947f920f99"
)

You can leave the last two fields (paymentId and extra) blank.

getTransfer(address)

Get a transaction details specified by transaction hash.

ZS.getTransfer("EohMUzR1DELyeQM9RVVwpmn5Y1DP0lh1b1ZpLQrfXQsgtvGHnDdJSG31nX2yESYZ")

getWallet()

Get wallet container info and health check.

ZS.getWallet()

getStatus()

Get the current status of the ZUM Services infrastructure.

ZS.getStatus()

License

Copyright (c) 2019 ZumCoin Development Team

Please see the included LICENSE file for more information.

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

zumservices-api-py-1.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zumservices_api_py-1.0.1-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file zumservices-api-py-1.0.1.tar.gz.

File metadata

  • Download URL: zumservices-api-py-1.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for zumservices-api-py-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c822b9d2976e978d9ac6fa6588b1e3358b884777f4b4e365feaca1eba1ec5a5d
MD5 a47cb6568788a48f4c04bf832412148a
BLAKE2b-256 b64fea16e1292312109eb19ce329baccd265ddf6d782afd29c153f39ffbae438

See more details on using hashes here.

File details

Details for the file zumservices_api_py-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: zumservices_api_py-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for zumservices_api_py-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb8dfa9c8cb6d43375205371c8100e8ca365c5d48248dedc6341a7859c3c3f98
MD5 6aa992f9a878d95e1d58289dcf3b94ba
BLAKE2b-256 2c2b7cbc870bf6544037ea989aee53935b08a2119fae6770a37eda627cdb8842

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page