Skip to main content

The light package for the SCU blockchain in the IOTA system.

Project description

SCoinAPI Documentation

Package overview

The scoinAPI is a Python package providing fast, simplify, and to manage the role's authority. It aims to be a fundamental package to access the method of the SCoin system instead of writing a method without fully understood. Besides that, it's easy to get started in creating a role in the SCoin system. Also, This package will auto-update after the real API has been updated.

Getting started

  • What is scoinAPI ?

    The light package for SCU blockchain in the IOTA system.
  • Who can use the scoinAPI ?

    The developer of SCoin system.
  • How do I install the package ?

    Run the following command to install:
    $ pip install SCoinAPI
    
  • What is the role of the SCoin system ?

    There are three roles which are the central bank, bank, and retailer.
  • What is the difference between each role ?

    Each role has a different authority to access the method.
  • How can import the package ?

    To import the package based on the roles:
    • The Central Bank

    from SCoinAPI import CentralBank
    cb = Central_Bank()
    
    • The Bank

    from SCoinAPI import Bank
    bk = Bank()
    
    • The Retailer

    from SCoinAPI import Retailer
    rt = Retailer()
    
  • What are the layer in SCoin system ?

    The layer in SCoin system means that the role of user. (a) layer 1 = the central bank (b) layer 2 = the bank or retailer

Each role's methods in the SCoin system

API Reference

  • connection_test

    • Description :

      To test the real API connection wether is serving.
    • Parameters :

      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status and message.
    • Usage :

      r = cb.connection_test()
      
  • send_token

    • Description :

      To make transaction within two user of SCoin system,but it only available for layer 1 user did.
    • Parameters :

      • password(str) : The user's password.
      • sen(str) : The sender's username.
      • rev(str) : The receiver's username.
      • num(int) : The transaction amount.
      • method(str) : Optinal,The user method, default value is light.
      • description(any) : Optional,The metadata of transaction.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.send_token('SENDER_PASSWORD','SENDER','RECEIVABLE',20)
      
  • send_tokens

    • Description :

      To make transaction within two user of SCoin system,it is available for basic transaction.
    • Parameters :

      • password(str) : The user's password.
      • sen(str) : The sender's username.
      • rev(str) : The receiver's username.
      • num(int) : The transaction amount.
      • method(str) : Optinal,The user method, default value is light.
      • description(any) : Optional,The metadata of transaction.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.send_token('SENDER_PASSWORD','SENDER','RECEIVABLE',20)
      
  • get_balance

    • Description :

      To get the user's balance through the user's did.
    • Parameters :

      • name(str) : The user's did.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.get_balance('USERNAME')
      
  • create_did

    • Description :

      To create an user did in the SCoin system.
    • Parameters :

      • name(str) : The user's did.
      • password(str) : The user's password.
      • method(str) : Optinal,The user method, default value is light.
      • description(any) : Optional,The metadata of transaction.
      • l(str) : Optional,To set the real API link if it has been changed.
      • pub_key(str) : Optional,RSA public key or endpoint, service will generate one key-pair if this field is empty.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.create_did('DID','PASSWORD')
      
  • get_did

    • Description :

      To get an user's did detail through hash value(pub_key).
    • Parameters :

      • hash_(str) : The public key of user's did.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.get_did('HASH_VALUE')
      
  • verify_token

    • Description :

      To verify self-token.
    • Parameters :

      • name(str) : The user's did.
      • password(str) : The user's password.
      • token(str) : The hash value of token to be verify.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status and message.
    • Usage :

      r = cb.verify_token('DID','PASSWORD','HASH_VALUE')
      
  • remove_layer1

    • Description :

      To downgrade the authority of the user to layer-2.
    • Parameters :

      • name(str) : The user's did to be downgrade.
      • password(str) : The user's password to be downgrade.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status and message.
    • Usage :

      r = cb.remove_layer1('DID','PASSWORD','HASH_VALUE')
      
  • get_transactions_by_timestamp

    • Description :

      To get the transaction during a specific time range.
    • Parameters :

      • start_time(int) : The start time.
      • end_time(int) : The end time.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.get_transactions_by_timestamp(0,10000000)
      
  • get_user_by_timestamp

    • Description :

      To get the sign up user during a specific time range.
    • Parameters :

      • start_time(int) : The start time.
      • end_time(int) : The end time.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.get_user_by_timestamp(0,10000000)
      
  • get_info

    • Description :

      To get the total number of sign up user.
    • Parameters :

      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status, response data and message.
    • Usage :

      r = cb.get_info()
      
  • set_central_bank

    • Description :

      To upgrade the authority of the user to layer-1.
    • Parameters :

      • name(str) : The user's did to be upgrade.
      • password(str) : The user's password to be upgrade.
      • l(str) : Optional,To set the real API link if it has been changed.
    • Returns :

      Dict of status and message.
    • Usage :

      r = cb.set_central_bank('DID','PASSWORD')
      

If you have any issues, please contact the information below.

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

SCoinAPI-1.1.2.tar.gz (67.7 kB view details)

Uploaded Source

Built Distribution

SCoinAPI-1.1.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file SCoinAPI-1.1.2.tar.gz.

File metadata

  • Download URL: SCoinAPI-1.1.2.tar.gz
  • Upload date:
  • Size: 67.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6rc1

File hashes

Hashes for SCoinAPI-1.1.2.tar.gz
Algorithm Hash digest
SHA256 ae722e123bef054f4a0c84930bd8e98b4cedcf26963fe7da1ad309ca339f2f63
MD5 6dca6b7fff74fce02cdf81ea9063363c
BLAKE2b-256 59ffffeb5d3d9eee6038bd95cc4b20d0622f70194d80279bf6b8aac75125f6cb

See more details on using hashes here.

File details

Details for the file SCoinAPI-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: SCoinAPI-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6rc1

File hashes

Hashes for SCoinAPI-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 710c776611a05cb1ba5fb92df7ffe83f0cee6c31f1acdf23f5d21c2130fe4afa
MD5 28b552821e308ff431a3b4904fa2facd
BLAKE2b-256 28b134c1e1d9472dea92ffd03428f83389550f103796d7bed1cf3dd7b22f21a9

See more details on using hashes here.

Supported by

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