Package: xcash
XCASH Foundation ecosystem python API wrapperWhat is it?Is a client Python wrapper library around XCASH Foundation ecosystem products.IntegrationsBlockchain Explorer api wrapperDelegates Explorer api wrapperShared Delegate api wrapperRPCDaemonWalletDpopsPyPi publishedSetupInstall required packagePackage can be installed withpip, the python package index.pip3installxcashorpipinstallxcashEcosystem accessible productsTo access products you are required to import packages and initiate them:# Access to blockchain datafromxcash.blockchainExplorerimportBlockchainExplorerblockchain_api=BlockchainExplorer()# Access Delegates Explorer of DPOPS systemfromxcash.delegatesExplorerimportDelegatesExplorerdelegates_api=DelegatesExplorer()# Access Shared delegate through apifromxcash.sharedDelegateimportSharedDelegatedelegate_api=SharedDelegate(delegate_url="DELEGATE URL")RPC server Daemon, Wallet and Dpops wallet (delegate)Pre-requirements -> Start the RPC server!In order to be able to execute calls to RPC you are required to first initiate RPC server.Cd to the wallet folderbinwherexcash-wallet-rpcis located, and open the location with eithercmd(
Windows) or terminal (Ubuntu)Initiate PRC server either with:Local daemon# Windowsxcash-wallet-rpc.exe--wallet-file<WalletName>--password<WalletPSW>--rpc-bind-port18285--disable-rpc-login--confirm-external-bind--trusted-daemon#Ubuntu./xcash-wallet-rpc--wallet-file<WalletName>--password<WalletPSW>--rpc-bind-port18285--disable-rpc-login--confirm-external-bind--trusted-daemonRemote daemon# Windowsxcash-wallet-rpc.exe--wallet-file<WalletName>--password<WalletPSW>--rpc-bind-port18285--disable-rpc-login--confirm-external-bind--daemon-address<daemon_address>:18281# Ubuntu./xcash-wallet-rpc--wallet-file<WalletName>--password<WalletPSW>--rpc-bind-port18285--disable-rpc-login--confirm-external-bind--daemon-address<daemon_address>:18281Import desired packages to python script# Access endpoints for XCASH Daemonfromxcash.rpcimportXcashDaemonRpcdaemon=XcashDaemonRpc()# Access endpoints for XCASH walletfromxcash.rpcimportXcashWalletRpcwallet=XcashWalletRpc()# Access endpoints on wallet dedicated for delegate.fromxcash.rpcimportXcashDpopsWalletRpcdpops=XcashDpopsWalletRpc()ExamplesBlockchain Explorer Apifromxcash.blockchainExplorerimportBlockchainExplorerfrompprintimportpprint# Initiate blockchain explorer clientblockchain_api=BlockchainExplorer()# Get blockchain datablockchain_data=blockchain_api.get_blockchain_data()# Print datapprint(blockchain_data)Examples on all available methods to communicate with XCASH blockchain Rest API can be
foundhereDelegates Explorer Apifromxcash.delegatesExplorerimportDelegatesExplorerfrompprintimportpprint# Initiate delegates explorer clientdelegates_api=DelegatesExplorer()# Get delegates/DPOPS statisticsstatistics=delegates_api.get_delegate_website_statistics()# Print datapprint(statistics)Examples on all available methods to communicate with XCASH DPOPS Delegates Explorer Rest API can be
foundhereShared Delegate Apifromxcash.sharedDelegateimportSharedDelegatefrompprintimportpprint# Initiate shared delegate and provide delegates address as param to access APIurl="http://xpayment.x-network.eu"delegate_api=SharedDelegate(delegate_url=url)# Delegate statistics data from delegate websitestatistics=delegate_api.get_delegate_website_statistic()# Print datapprint(statistics)Examples on all available methods to communicate with Shared Delegate Rest API can be
foundhereDaemon RPC callfromxcash.rpcimportXcashDaemonRpcfrompprintimportpprintdaemon=XcashDaemonRpc()# Get the daemon versionversion=daemon.get_version()pprint(version)Examples on all available methods to communicate with Daemon RPC API can be
foundhereWallet RPC callfromxcash.rpcimportXcashWalletRpcfrompprintimportpprintwallet=XcashWalletRpc()# Get balancebalance=wallet.get_balance()pprint(balance)Examples on all available methods to communicate with Wallet RPC API can be
foundhereDPOPS Wallet RPC callfromxcash.rpcimportXcashDpopsWalletRpcfrompprintimportpprintdpops_wallet=XcashDpopsWalletRpc()status=dpops_wallet.register_delegate(delegate_name="Animus-Test",delegate_ip_address="100.100.00.00")pprint(status)Examples on all available methods to communicate with DPOPS wallet RPC API can be
foundhereReferenceshttps://docs.xcash.foundation/applications/rpc-calls/json-rpc-methodshttps://docs.xcash.foundation/applications/rpc-calls/xcash-wallet-rpchttps://docs.xcash.foundation/applications/rpc-calls/xcash-wallet-rpc/dpops-wallet-rpc-callsContributors