SDK for Apollopayment API
Project description
ApolloPayment SDK
ApolloPayment SDK is a comprehensive JavaScript library designed to streamline the integration of blockchain-based payment solutions into various applications. This SDK provides developers with the tools necessary to facilitate secure, transparent, and efficient transactions on supported blockchain networks.
Key Features:
- Ease of Integration: Simplifies the process of adding blockchain payment capabilities to your applications.
- Security: Ensures high-level security for all transactions using blockchain technology.
- Transparency: Leverages the transparency of blockchain networks to provide clear and verifiable transaction records.
- Multi-Network Support: Supports multiple blockchain networks, providing flexibility and scalability.
For detailed documentation, installation guides, and API references, please visit ApolloPayment Documentation.
This package makes it easy ApolloPayment Api.
Installation
pip install apollopayment-api
Use
Go to your personal account https://app.apollopayment.io/api-keys and get api-keys.
Substitute keys in class call:
from apollopayment_api import Client
client = Client("__PUBLIC_KEY__", "__PRIVATE_KEY__")
Check signature
You can test your signature within this method
checkSignature = client.basic_actions.check_x_api_signature
if not checkSignature["success"]:
print("Signature incorrect", checkSignature)
else:
if checkSignature["response"]["checkSignatureResult"]:
print("Signature correct")
else:
print("Signature incorrect:", checkSignature["response"]["errors"][0])
Fetch available currencies
Get list of available currencies for depositing/withdrawing
availableCurrencies = client.basic_actions.get_currencies()
if not availableCurrencies["success"]:
print("Request error", availableCurrencies)
else:
for currency in availableCurrencies["response"]:
print("%s (%s) = %s".format(currency["currency"], currency["alias"], currency["priceUSD"]))
if len(currency["networks"]) > 0:
print("\tnetworks:")
for network in currency["networks"]:
print("\t\t%s %s".format(network["name"], network["alias"]))
Get currencies price-rate
Get price rate from one currency to another
price = client.basic_actions.get_currency_price(fromCurrency="ETH", toCurrency="USDT")
if not price["success"]:
print("Request error", price)
else:
print("Price", price["response"])
Get advanced balances info
Get info about advanced balance by its id
balance = client.advanced_account.get_advanced_balance()
if not balance["success"]:
print("Request error", balance)
else:
print("[%s] (%s) \n\tAvailable for deposit: %s".format(balance["response"]["advancedBalanceId"], balance["response"]["currency"], ", ".join(balance["response"]["availableCurrenciesForDeposit"])))
Create order
from apollopayment_api import Client
def main():
order_link = create_order(currency="USDT", network="tron", amount="100")
#
def create_order(currency, network, amount):
client = Client("__PUBLIC_KEY__", "__PRIVATE_KEY__")
order = client.orders.create_order(
currency=currency,
network=network,
amount=amount,
order="Order #1234567",
errorWebhook="https://merchant.domain/webhook-url",
successWebhook="https://merchant.domain/webhook-url",
returnUrl="https://merchant.domain",
description="Buy some item",
)
if not order["success"]:
raise order["error"]["message"]
return order["response"]["link"]
Auto-swap to external address
from apollopayment_api import Client
def main():
auto_swap_id = make_withdrawal(currency="USDT", network="tron", address="TUfVHn...DDC", amount="100")
#
def make_withdrawal(currency, network, address, amount):
client = Client("__PUBLIC_KEY__", "__PRIVATE_KEY__")
swap = client.auto_swaps.create_swap(
address=address,
currency=currency,
network=network,
amountTo=amount,
webhook="https://merchant.domain/webhook-url",
)
if not swap["success"]:
raise swap["error"]["message"]
return swap["response"]["id"]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file apollopayment_api-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: apollopayment_api-0.0.8-py3-none-any.whl
- Upload date:
- Size: 31.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 548857810c57f67c7be94ccf294eb891b7be7e9e1eca33df71741bb2a9c641db |
|
MD5 | 10ef17fa484559bb0f4ea41da622ec12 |
|
BLAKE2b-256 | 87ad64d6744d343d222d9685252e23bd0e5ae29d2703eb9c591c23692ceefab4 |