Skip to content

drake-mer/Crypto_APIs_2.0_SDK_Python

Repository files navigation

Crypto_APIs_2.0_SDK_Python

Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs 2.0 provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://cryptoapis.io

Requirements.

Python >= 3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/Crypto-APIs/Crypto_APIs_2.0_SDK_Python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/Crypto-APIs/Crypto_APIs_2.0_SDK_Python.git)

Then import the package:

import cryptoapis

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import cryptoapis

Getting Started

Please follow the installation procedure and then run the following:

import time
import cryptoapis
from pprint import pprint
from cryptoapis.api import assets_api
from cryptoapis.model.feature_mainnets_not_allowed_for_plan import FeatureMainnetsNotAllowedForPlan
from cryptoapis.model.insufficient_credits import InsufficientCredits
from cryptoapis.model.invalid_api_key import InvalidApiKey
from cryptoapis.model.invalid_data import InvalidData
from cryptoapis.model.invalid_pagination import InvalidPagination
from cryptoapis.model.invalid_request_body_structure import InvalidRequestBodyStructure
from cryptoapis.model.list_assets_details_response import ListAssetsDetailsResponse
from cryptoapis.model.request_limit_reached import RequestLimitReached
from cryptoapis.model.unexpected_server_error import UnexpectedServerError
from cryptoapis.model.unsupported_media_type import UnsupportedMediaType
# Defining the host is optional and defaults to https://rest.cryptoapis.io/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = cryptoapis.Configuration(
    host = "https://rest.cryptoapis.io/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'


# Enter a context with an instance of the API client
with cryptoapis.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = assets_api.AssetsApi(api_client)
    context = "context_example" # str | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. (optional)
asset_type = "crypto" # str | Defines the type of the supported asset. This could be either \"crypto\" or \"fiat\". (optional)
limit = 50 # int | Defines how many items should be returned in the response per page basis. (optional) (default to 50)
offset = 10 # int | The starting index of the response items, i.e. where the response should start listing the returned items. (optional) (default to 0)

    try:
        # List Assets Details
        api_response = api_instance.list_assets_details(context=context, asset_type=asset_type, limit=limit, offset=offset)
        pprint(api_response)
    except cryptoapis.ApiException as e:
        print("Exception when calling AssetsApi->list_assets_details: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://rest.cryptoapis.io/v2

Class Method HTTP request Description
AssetsApi list_assets_details GET /market-data/assets/details List Assets Details
AutomaticCoinsForwardingApi create_automatic_coins_forwarding POST /blockchain-automations/{blockchain}/{network}/coins-forwarding/automations Create Automatic Coins Forwarding
AutomaticCoinsForwardingApi delete_automatic_coins_forwarding DELETE /blockchain-automations/{blockchain}/{network}/coins-forwarding/automations/{referenceId} Delete Automatic Coins Forwarding
AutomaticCoinsForwardingApi list_coins_forwarding_automations GET /blockchain-automations/{blockchain}/{network}/coins-forwarding/automations List Coins Forwarding Automations
AutomaticTokensForwardingApi add_tokens_to_existing_from_address POST /blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations/add-token Add Tokens To Existing fromAddress
AutomaticTokensForwardingApi create_automatic_tokens_forwarding POST /blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations Create Automatic Tokens Forwarding
AutomaticTokensForwardingApi delete_automatic_tokens_forwarding DELETE /blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations/{referenceId} Delete Automatic Tokens Forwarding
AutomaticTokensForwardingApi get_fee_address_details GET /blockchain-automations/{blockchain}/{network}/tokens-forwarding/fee-addresses Get Fee Address Details
AutomaticTokensForwardingApi list_tokens_forwarding_automations GET /blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations List Tokens Forwarding Automations
CreateSubscriptionsForApi mined_transaction POST /blockchain-events/{blockchain}/{network}/subscriptions/transaction-mined Mined transaction
CreateSubscriptionsForApi new_block POST /blockchain-events/{blockchain}/{network}/subscriptions/block-mined New Block
CreateSubscriptionsForApi new_confirmed_coins_transactions POST /blockchain-events/{blockchain}/{network}/subscriptions/address-coins-transactions-confirmed New confirmed coins transactions
CreateSubscriptionsForApi new_confirmed_coins_transactions_and_each_confirmation POST /blockchain-events/{blockchain}/{network}/subscriptions/address-coins-transactions-confirmed-each-confirmation New confirmed coins transactions and each confirmation
CreateSubscriptionsForApi new_confirmed_tokens_transactions POST /blockchain-events/{blockchain}/{network}/subscriptions/address-tokens-transactions-confirmed New confirmed tokens transactions
CreateSubscriptionsForApi new_confirmed_tokens_transactions_and_each_confirmation POST /blockchain-events/{blockchain}/{network}/subscriptions/address-tokens-transactions-confirmed-each-confirmation New confirmed tokens transactions and each confirmation
CreateSubscriptionsForApi new_unconfirmed_coins_transactions POST /blockchain-events/{blockchain}/{network}/subscriptions/address-coins-transactions-unconfirmed New unconfirmed coins transactions
CreateSubscriptionsForApi new_unconfirmed_tokens_transactions POST /blockchain-events/{blockchain}/{network}/subscriptions/address-tokens-transactions-unconfirmed New unconfirmed tokens transactions
ExchangeRatesApi get_exchange_rate_by_asset_symbols GET /market-data/exchange-rates/by-symbols/{fromAssetSymbol}/{toAssetSymbol} Get Exchange Rate By Asset Symbols
ExchangeRatesApi get_exchange_rate_by_assets_ids GET /market-data/exchange-rates/by-asset-ids/{fromAssetId}/{toAssetId} Get Exchange Rate By Assets IDs
ManageSubscriptionsApi delete_blockchain_event_subscription DELETE /blockchain-events/{blockchain}/{network}/subscriptions/{referenceId} Delete Blockchain Event Subscription
ManageSubscriptionsApi list_blockchain_events_subscriptions GET /blockchain-events/{blockchain}/{network}/subscriptions List Blockchain Events Subscriptions
MetadataApi list_supported_assets GET /market-data/assets/supported List Supported Assets
OmniLayerApi get_omni_transaction_details_by_transaction_id__txid GET /blockchain-data/{blockchain}/{network}/omni/transactions/{transactionId} Get Omni Transaction Details By Transaction ID (Txid)
OmniLayerApi get_unconfirmed_omni_transaction_by_transaction_id__txid GET /blockchain-data/{blockchain}/{network}/omni/transactions-unconfirmed/{transactionId} Get Unconfirmed Omni Transaction By Transaction ID (Txid)
OmniLayerApi list_omni_tokens_by_address GET /blockchain-data/{blockchain}/{network}/omni/addresses/{address} List Omni Tokens By Address
OmniLayerApi list_omni_transactions_by_address GET /blockchain-data/{blockchain}/{network}/omni/addresses/{address}/transactions List Omni Transactions By Address
OmniLayerApi list_omni_transactions_by_block_hash GET /blockchain-data/{blockchain}/{network}/omni/blocks/hash/{blockHash}/transactions List Omni Transactions By Block Hash
OmniLayerApi list_omni_transactions_by_block_height GET /blockchain-data/{blockchain}/{network}/omni/blocks/height/{blockHeight}/transactions List Omni Transactions By Block Height
OmniLayerApi list_unconfirmed_omni_transactions_by_address GET /blockchain-data/{blockchain}/{network}/omni/address-transactions-unconfirmed/{address} List Unconfirmed Omni Transactions By Address
OmniLayerApi list_unconfirmed_omni_transactions_by_property_id GET /blockchain-data/{blockchain}/{network}/omni/properties/{propertyId}/transactions List Unconfirmed Omni Transactions By Property ID
TokensApi list_tokens_by_address GET /blockchain-data/{blockchain}/{network}/addresses/{address}/tokens List Tokens By Address
TokensApi list_tokens_transfers_by_address GET /blockchain-data/{blockchain}/{network}/addresses/{address}/tokens-transfers List Tokens Transfers By Address
TokensApi list_tokens_transfers_by_transaction_hash GET /blockchain-data/{blockchain}/{network}/transactions/{transactionHash}/tokens-transfers List Tokens Transfers By Transaction Hash
UTXOBasedApi get_hd_wallet__x_pub_y_pub_z_pub_details GET /blockchain-data/{blockchain}/{network}/hd/{extendedPublicKey}/details Get HD Wallet (xPub, yPub, zPub) Details
UTXOBasedApi list_hd_wallet__x_pub_y_pub_z_pub_transactions GET /blockchain-data/{blockchain}/{network}/hd/{extendedPublicKey}/transactions List HD Wallet (xPub, yPub, zPub) Transactions
UTXOBasedApi sync_hd_wallet__x_pub_y_pub_z_pub POST /blockchain-data/{blockchain}/{network}/hd/sync Sync HD Wallet (xPub, yPub, zPub)
UnifiedEndpointsApi get_address_details GET /blockchain-data/{blockchain}/{network}/addresses/{address} Get Address Details
UnifiedEndpointsApi get_block_details_by_block_hash GET /blockchain-data/{blockchain}/{network}/blocks/hash/{blockHash} Get Block Details By Block Hash
UnifiedEndpointsApi get_block_details_by_block_height GET /blockchain-data/{blockchain}/{network}/blocks/height/{height} Get Block Details By Block Height
UnifiedEndpointsApi get_fee_recommendations GET /blockchain-data/{blockchain}/{network}/mempool/fees Get Fee Recommendations
UnifiedEndpointsApi get_latest_mined_block GET /blockchain-data/{blockchain}/{network}/blocks/last Get Latest Mined Block
UnifiedEndpointsApi get_transaction_details_by_transaction_id GET /blockchain-data/{blockchain}/{network}/transactions/{transactionId} Get Transaction Details By Transaction ID
UnifiedEndpointsApi list_transactions_by_address GET /blockchain-data/{blockchain}/{network}/addresses/{address}/transactions List Transactions By Address
UnifiedEndpointsApi list_transactions_by_block_hash GET /blockchain-data/{blockchain}/{network}/blocks/hash/{blockHash}/transactions List Transactions by Block Hash
UnifiedEndpointsApi list_transactions_by_block_height GET /blockchain-data/{blockchain}/{network}/blocks/height/{height}/transactions List Transactions by Block Height
ValidatingApi validate_address POST /blockchain-tools/{blockchain}/{network}/addresses/validate Validate Address
XRPRippleApi get_latest_mined_xrp__ripple_block GET /blockchain-data/xrp/{network}/blocks/last Get Latest Mined XRP (Ripple) Block
XRPRippleApi get_xrp__ripple_address_details GET /blockchain-data/xrp/{network}/addresses/{address} Get XRP (Ripple) Address Details
XRPRippleApi get_xrp__ripple_block_details_by_block_hash GET /blockchain-data/xrp/{network}/blocks/hash/{blockHash} Get XRP (Ripple) Block Details By Block Hash
XRPRippleApi get_xrp__ripple_block_details_by_block_height GET /blockchain-data/xrp/{network}/blocks/height/{height} Get XRP (Ripple) Block Details By Block Height
XRPRippleApi get_xrp__ripple_transaction_details_by_transaction_id GET /blockchain-data/xrp/{network}/transactions/{transactionHash} Get XRP (Ripple) Transaction Details By Transaction ID
XRPRippleApi list_xrp__ripple_transactions_by_address GET /blockchain-data/xrp/{network}/addresses/{address}/transactions List XRP (Ripple) Transactions by Address
XRPRippleApi list_xrp__ripple_transactions_by_block_hash GET /blockchain-data/xrp/{network}/blocks/hash/{blockHash}/transactions List XRP (Ripple) Transactions By Block Hash
DefaultApi get_contract_details_by_address GET /blockchain-data/{blockchain}/{network}/addresses/{contractAddress}/contract Get Contract Details by Address

Documentation For Models

Documentation For Authorization

ApiKey

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

Author

developers@cryptoapis.io

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in cryptoapis.apis and cryptoapis.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from cryptoapis.api.default_api import DefaultApi
  • from cryptoapis.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import cryptoapis
from cryptoapis.apis import *
from cryptoapis.models import *

About

Python library/SDK for Crypto APIs 2.0

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages