Package: pyontio
Ontology Python SDKIntroductionThe Ontology official Python SDK is a comprehensive SDK which is based onPython3.6. Currently, it supports local wallet management, digital identity management, digital asset management, deployment and invoke for smart contract, the calling of OEP4, and communication with the Ontology blockchain. The future will also support more functions and applications.PreparationsInstallation requires a Python 3.7 or later environment.pipinstallontology-python-sdkInterfaceRead more in theontology-python-sdk API document.NetworkThis is an API set that allows you to interact with an Ontology nodes.Main Function1get_version()2get_balance()3get_allowance()4get_gas_price()5get_network_id()6get_node_count()7get_block_count()8get_block_height()9get_block_by_hash()10get_block_by_height()11get_current_block_hash()12get_block_hash_by_height()13get_storage()14get_smart_contract()15get_smart_contract_event_by_tx_hash()16get_smart_contract_event_by_height()WalletThis is an API set that allows you to handle with wallet account in the form ofAccountData.Main Function1add_account()2remove_account()Note: This package hasNOTbeen audited and might potentially be unsafe. Take precautions to clear memory properly, store the private keys safely, and test transaction receiving and sending functionality properly before using in production!AccountThis is an API set that allows you to generate Ontology accounts and sign transactions and data.Main Function1export_wif()2get_signature_scheme()3get_public_key_bytes()4get_private_key_bytes()5get_public_key_hex()6get_public_key_bytes()7get_private_key_from_wif()8get_gcm_decoded_private_key()9export_gcm_encrypted_private_key()10get_address_hex()11get_address_hex_reverse()12get_address_base58()13generate_signature()Note: This package hasNOTbeen audited and might potentially be unsafe. Take precautions to clear memory properly, store the private keys safely, and test transaction receiving and sending functionality properly before using in production!IdentityThis is an API set that allows you to generateOntology Digital Identity.Main Function1parse_ddo()2send_get_ddo()3new_get_ddo_transaction()4new_add_recovery_transaction()5new_add_attribute_transaction()6new_add_public_key_transaction()7new_remove_public_key_transaction()8new_registry_ont_id_transaction()9new_remove_attribute_transaction()10send_add_recovery_transaction()11send_add_attribute_transaction()12send_add_public_key_transaction()13send_registry_ont_id_transaction()14remove_public_key()15send_remove_attribute_transaction()16send_add_public_key_by_recovery()17sign_transaction()18add_sign_transaction()19add_multi_sign_transaction()20get_merkle_proof()21get_transaction_by_tx_hash()22send_raw_transaction()23send_raw_transaction_pre_exec()Note: This package hasNOTbeen audited and might potentially be unsafe. Take precautions to clear memory properly, store the private keys safely, and test transaction receiving and sending functionality properly before using in production!AccountManagerThis is an API set that allows you to manage your multiple account in an wallet file.Main Function1import_account()2create_account()3create_account_from_private_key()4get_account()5get_accounts()6get_default_account()7get_default_account_address()8set_default_account_by_index()9set_default_account_by_address()Note: This package hasNOTbeen audited and might potentially be unsafe. Take precautions to clear memory properly, store the private keys safely, and test transaction receiving and sending functionality properly before using in production!IdentityManagerThis is an API set that allows you to manage your multiple identity in an wallet file.Main Function1create_identity()2import_identity()3create_identity_from_private_key()Note: This package hasNOTbeen audited and might potentially be unsafe. Take precautions to clear memory properly, store the private keys safely, and test transaction receiving and sending functionality properly before using in production!AssetTheAssetpackage allows you to interact with Ontology Native Digital Asset(ONT, ONG) easily.Main Function1query_name()2query_symbol()3query_balance()4query_decimals()5query_allowance()6query_unbound_ong()7get_asset_address()8new_approve_transaction()9new_transfer_transaction()10new_transfer_from_transaction()11new_withdraw_ong_transaction()12send_transfer()13send_approve()14send_transfer_from()15send_withdraw_ong_transaction()ABITheABIpackage allows you to interact with a deployed smart contract easily.Main Function1get_function]()2get_parameter()3set_params_value()OEP4TheOEP4package allows you to interact with an deployed Ontology OEP4 smart contract easily.Main Function1init()2get_name()3get_symbol()4get_decimal()5get_total_supply()6approve()7allowance()8balance_of()9transfer()10transfer_multi()11transfer_from()Note: This package hasNOTbeen audited and might potentially be unsafe. Take precautions to clear memory properly, store the private keys safely, and test transaction receiving and sending functionality properly before using in production!UtilsTheUtilspackage provides utility functions forOntology Dappsand otherOntology-Python-Sdkpackages.Main Function1get_random_hex_str()2get_asset_address()3get_random_bytes()Sitehttps://ont.io/LicenseThe Ontology library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the License file.