Package: phantasma-py
Phantasma PyPython SimpleWallet Sample appThis is a simple wallet sample that needs to be connected to a RPC node. By default it uses the localhost:7077/rpc endpoint, but you can switch to your own URL.To run the sample app, follow these steps:Install "requests" module (Run "pip install requests" on command line inside app folder)Run the sample app!Python VM SamplesThe VM Module implements the following classes EventDecoder, ScriptBuilder and Transaction in order to provide support to:Decode TX events data.
Examples:
/Python/Samples/VMSamples/parsetxevents.pyCreate Scripts, Transactions and Sign them using HEX Private Key.
Examples:
/Python/Samples/VMSamples/transferFungible.py
/Python/Samples/VMSamples/transferNonFungible.pyswagger-clientNo description provided (generated by Swagger Codegenhttps://github.com/swagger-api/swagger-codegen)This Python package is automatically generated by theSwagger Codegenproject:API version: v1Package version: 1.0.0Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
For more information, please visithttps://phantasma.ioRequirements.Python 2.7 and 3.4+Installation & Usagepip installIf the python package is hosted on Github, you can install directly from Githubpipinstallgit+https://github.com/GIT_USER_ID/GIT_REPO_ID.git(you may need to runpipwith root permission:sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)Then import the package:importswagger_clientSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importswagger_clientGetting StartedPlease follow theinstallation procedureand then run the following:from__future__importprint_functionimporttimeimportswagger_clientfromswagger_client.restimportApiExceptionfrompprintimportpprint# create an instance of the API classapi_instance=swagger_client.AccountApi(swagger_client.ApiClient(configuration))account='account_example'# str |  (optional)try:api_response=api_instance.api_v1_get_account_get(account=account)pprint(api_response)exceptApiExceptionase:print("Exception when calling AccountApi->api_v1_get_account_get:%s\n"%e)# create an instance of the API classapi_instance=swagger_client.AccountApi(swagger_client.ApiClient(configuration))account_text='account_text_example'# str |  (optional)try:api_response=api_instance.api_v1_get_accounts_get(account_text=account_text)pprint(api_response)exceptApiExceptionase:print("Exception when calling AccountApi->api_v1_get_accounts_get:%s\n"%e)# create an instance of the API classapi_instance=swagger_client.AccountApi(swagger_client.ApiClient(configuration))symbol='symbol_example'# str |  (optional)extended=false# bool |  (optional) (default to false)try:api_response=api_instance.api_v1_get_addresses_by_symbol_get(symbol=symbol,extended=extended)pprint(api_response)exceptApiExceptionase:print("Exception when calling AccountApi->api_v1_get_addresses_by_symbol_get:%s\n"%e)# create an instance of the API classapi_instance=swagger_client.AccountApi(swagger_client.ApiClient(configuration))name='name_example'# str |  (optional)try:api_response=api_instance.api_v1_look_up_name_get(name=name)pprint(api_response)exceptApiExceptionase:print("Exception when calling AccountApi->api_v1_look_up_name_get:%s\n"%e)Documentation for API EndpointsAll URIs are relative to/ClassMethodHTTP requestDescriptionAccountApiapi_v1_get_account_getGET/api/v1/GetAccountAccountApiapi_v1_get_accounts_getGET/api/v1/GetAccountsAccountApiapi_v1_get_addresses_by_symbol_getGET/api/v1/GetAddressesBySymbolAccountApiapi_v1_look_up_name_getGET/api/v1/LookUpNameAuctionApiapi_v1_get_auction_getGET/api/v1/GetAuctionAuctionApiapi_v1_get_auctions_count_getGET/api/v1/GetAuctionsCountAuctionApiapi_v1_get_auctions_getGET/api/v1/GetAuctionsBlockApiapi_v1_get_block_by_hash_getGET/api/v1/GetBlockByHashBlockApiapi_v1_get_block_by_height_getGET/api/v1/GetBlockByHeightBlockApiapi_v1_get_block_height_getGET/api/v1/GetBlockHeightBlockApiapi_v1_get_block_transaction_count_by_hash_getGET/api/v1/GetBlockTransactionCountByHashBlockApiapi_v1_get_latest_block_getGET/api/v1/GetLatestBlockBlockApiapi_v1_get_raw_block_by_hash_getGET/api/v1/GetRawBlockByHashBlockApiapi_v1_get_raw_block_by_height_getGET/api/v1/GetRawBlockByHeightBlockApiapi_v1_get_raw_latest_block_getGET/api/v1/GetRawLatestBlockChainApiapi_v1_get_chains_getGET/api/v1/GetChainsConnectionApiapi_v1_abci_query_getGET/api/v1/abci_queryConnectionApiapi_v1_get_validators_settings_getGET/api/v1/GetValidatorsSettingsConnectionApiapi_v1_health_getGET/api/v1/healthConnectionApiapi_v1_net_info_getGET/api/v1/net_infoConnectionApiapi_v1_request_block_getGET/api/v1/request_blockConnectionApiapi_v1_status_getGET/api/v1/statusContractApiapi_v1_get_contract_by_address_getGET/api/v1/GetContractByAddressContractApiapi_v1_get_contract_getGET/api/v1/GetContractLeaderboardApiapi_v1_get_leaderboard_getGET/api/v1/GetLeaderboardNexusApiapi_v1_get_nexus_getGET/api/v1/GetNexusOrganizationApiapi_v1_get_organization_by_name_getGET/api/v1/GetOrganizationByNameOrganizationApiapi_v1_get_organization_getGET/api/v1/GetOrganizationOrganizationApiapi_v1_get_organizations_getGET/api/v1/GetOrganizationsPlatformApiapi_v1_get_interop_getGET/api/v1/GetInteropPlatformApiapi_v1_get_platform_getGET/api/v1/GetPlatformPlatformApiapi_v1_get_platforms_getGET/api/v1/GetPlatformsRpcApirpc_postPOST/rpcSaleApiapi_v1_get_latest_sale_hash_getGET/api/v1/GetLatestSaleHashSaleApiapi_v1_get_sale_getGET/api/v1/GetSaleTokenApiapi_v1_get_nft_getGET/api/v1/GetNFTTokenApiapi_v1_get_nfts_getGET/api/v1/GetNFTsTokenApiapi_v1_get_token_balance_getGET/api/v1/GetTokenBalanceTokenApiapi_v1_get_token_data_getGET/api/v1/GetTokenDataTokenApiapi_v1_get_token_getGET/api/v1/GetTokenTokenApiapi_v1_get_tokens_getGET/api/v1/GetTokensTransactionApiapi_v1_get_address_transaction_count_getGET/api/v1/GetAddressTransactionCountTransactionApiapi_v1_get_address_transactions_getGET/api/v1/GetAddressTransactionsTransactionApiapi_v1_get_transaction_by_block_hash_and_index_getGET/api/v1/GetTransactionByBlockHashAndIndexTransactionApiapi_v1_get_transaction_getGET/api/v1/GetTransactionTransactionApiapi_v1_invoke_raw_script_getGET/api/v1/InvokeRawScriptTransactionApiapi_v1_send_raw_transaction_getGET/api/v1/SendRawTransactionValidatorApiapi_v1_get_validators_getGET/api/v1/GetValidatorsValidatorApiapi_v1_get_validators_type_getGET/api/v1/GetValidators/{type}Documentation For ModelsABIEventResultABIMethodResultABIParameterResultAccountResultAddressAddressKindArchiveResultAuctionResultBalanceResultBlockResultChainResultContractResultCrowdsaleResultEventResultGovernanceResultInteropResultLeaderboardResultLeaderboardRowResultNetInfoPeerNetInfoPeerConnectionStatusNetInfoPeerConnectionStatusChannelNetInfoPeerConnectionStatusMonitorNexusResultNodeInfoNodeInfoOtherNodeInfoProtocolVersionOracleResultOrganizationResultPaginatedResultPlatformResultPubKeyResponseQueryResultAbciQueryResultHealthResultNetInfoResultStatusResultStatusSyncInfoResultStatusValidatorInfoRpcRequestRpcResponseScriptResultSignatureResultStakeResultStorageResultTokenDataResultTokenExternalResultTokenPriceResultTokenPropertyResultTokenResultTokenSeriesResultTransactionResultValidatorResultValidatorSettingsDocumentation For AuthorizationAll endpoints do not require authorization.AuthorTestsRunning the Test:Run the test file directly in your terminal or command line.
You can also use a Python IDE that supports running unittest test cases.
If your project contains multiple test files, you can run all of them using a test discovery feature:python-munittestdiscover

python3-munittestsrc.phantasma_py.test