Skip to main content

A package to easy use API Diamond Coin API

Project description

DiamondCoin

DiamondCoin is a Python library for working with the DiamondCoin API.

Installation

Use the package manager pip to install DiamondCoin.

pip install DiamondCoin

Usage

import DiamondCoin as dc

merchant = dc.DiamondCoin(user_id='your_user_id', key='your_key')

# Send payment
merchant.send_payment(to_id='receiver_user_id', amount='1000')

# Get payment URL
merchant.get_payment_url(amount=100)

# Get transactions
merchant.get_transactions(tx=[1])

# Get balance
merchant.get_balance()

# Remove callback endpoint
merchant.remove_callback_endpoint()

# Set callback endpoint
merchant.set_callback_endpoint(ip='your_ip_address', port=8080)

# Get top users
merchant.get_top(top_type='user')

# Run callback server
merchant.run_callback()

# Payment handler
@merchant.payment_handler(handler_type='longpoll')
def payment_callback_handler(payment_data):
    print(payment_data)

merchant.run_longpoll(tx=[1])
or 
merchant.run_longpoll(tx=[2])

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

DiamondCoin-0.0.6.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file DiamondCoin-0.0.6.tar.gz.

File metadata

  • Download URL: DiamondCoin-0.0.6.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for DiamondCoin-0.0.6.tar.gz
Algorithm Hash digest
SHA256 b3e4c7a99eac05775dec3488420598b2dff3da2ef085c7c309d43fb9305be17f
MD5 e70bb889324d67113eb6b654b2ad096a
BLAKE2b-256 165948b4e804f91a6b9c5e56a2b672fd7976ff226532c110fdfe73c0bb9c283d

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