Phantasma SDK for Python
Project description
Phantasma Py
Python SimpleWallet Sample app
This 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 Samples
The 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.py
-
Create Scripts, Transactions and Sign them using HEX Private Key. Examples: /Python/Samples/VMSamples/transferFungible.py /Python/Samples/VMSamples/transferNonFungible.py
swagger-client
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This Python package is automatically generated by the Swagger Codegen project:
- API version: v1
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen For more information, please visit https://phantasma.io
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import swagger_client
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 swagger_client
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_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)
except ApiException as e:
print("Exception when calling AccountApi->api_v1_get_account_get: %s\n" % e)
# create an instance of the API class
api_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)
except ApiException as e:
print("Exception when calling AccountApi->api_v1_get_accounts_get: %s\n" % e)
# create an instance of the API class
api_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)
except ApiException as e:
print("Exception when calling AccountApi->api_v1_get_addresses_by_symbol_get: %s\n" % e)
# create an instance of the API class
api_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)
except ApiException as e:
print("Exception when calling AccountApi->api_v1_look_up_name_get: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to /
Class | Method | HTTP request | Description |
---|---|---|---|
AccountApi | api_v1_get_account_get | GET /api/v1/GetAccount | |
AccountApi | api_v1_get_accounts_get | GET /api/v1/GetAccounts | |
AccountApi | api_v1_get_addresses_by_symbol_get | GET /api/v1/GetAddressesBySymbol | |
AccountApi | api_v1_look_up_name_get | GET /api/v1/LookUpName | |
AuctionApi | api_v1_get_auction_get | GET /api/v1/GetAuction | |
AuctionApi | api_v1_get_auctions_count_get | GET /api/v1/GetAuctionsCount | |
AuctionApi | api_v1_get_auctions_get | GET /api/v1/GetAuctions | |
BlockApi | api_v1_get_block_by_hash_get | GET /api/v1/GetBlockByHash | |
BlockApi | api_v1_get_block_by_height_get | GET /api/v1/GetBlockByHeight | |
BlockApi | api_v1_get_block_height_get | GET /api/v1/GetBlockHeight | |
BlockApi | api_v1_get_block_transaction_count_by_hash_get | GET /api/v1/GetBlockTransactionCountByHash | |
BlockApi | api_v1_get_latest_block_get | GET /api/v1/GetLatestBlock | |
BlockApi | api_v1_get_raw_block_by_hash_get | GET /api/v1/GetRawBlockByHash | |
BlockApi | api_v1_get_raw_block_by_height_get | GET /api/v1/GetRawBlockByHeight | |
BlockApi | api_v1_get_raw_latest_block_get | GET /api/v1/GetRawLatestBlock | |
ChainApi | api_v1_get_chains_get | GET /api/v1/GetChains | |
ConnectionApi | api_v1_abci_query_get | GET /api/v1/abci_query | |
ConnectionApi | api_v1_get_validators_settings_get | GET /api/v1/GetValidatorsSettings | |
ConnectionApi | api_v1_health_get | GET /api/v1/health | |
ConnectionApi | api_v1_net_info_get | GET /api/v1/net_info | |
ConnectionApi | api_v1_request_block_get | GET /api/v1/request_block | |
ConnectionApi | api_v1_status_get | GET /api/v1/status | |
ContractApi | api_v1_get_contract_by_address_get | GET /api/v1/GetContractByAddress | |
ContractApi | api_v1_get_contract_get | GET /api/v1/GetContract | |
LeaderboardApi | api_v1_get_leaderboard_get | GET /api/v1/GetLeaderboard | |
NexusApi | api_v1_get_nexus_get | GET /api/v1/GetNexus | |
OrganizationApi | api_v1_get_organization_by_name_get | GET /api/v1/GetOrganizationByName | |
OrganizationApi | api_v1_get_organization_get | GET /api/v1/GetOrganization | |
OrganizationApi | api_v1_get_organizations_get | GET /api/v1/GetOrganizations | |
PlatformApi | api_v1_get_interop_get | GET /api/v1/GetInterop | |
PlatformApi | api_v1_get_platform_get | GET /api/v1/GetPlatform | |
PlatformApi | api_v1_get_platforms_get | GET /api/v1/GetPlatforms | |
RpcApi | rpc_post | POST /rpc | |
SaleApi | api_v1_get_latest_sale_hash_get | GET /api/v1/GetLatestSaleHash | |
SaleApi | api_v1_get_sale_get | GET /api/v1/GetSale | |
TokenApi | api_v1_get_nft_get | GET /api/v1/GetNFT | |
TokenApi | api_v1_get_nfts_get | GET /api/v1/GetNFTs | |
TokenApi | api_v1_get_token_balance_get | GET /api/v1/GetTokenBalance | |
TokenApi | api_v1_get_token_data_get | GET /api/v1/GetTokenData | |
TokenApi | api_v1_get_token_get | GET /api/v1/GetToken | |
TokenApi | api_v1_get_tokens_get | GET /api/v1/GetTokens | |
TransactionApi | api_v1_get_address_transaction_count_get | GET /api/v1/GetAddressTransactionCount | |
TransactionApi | api_v1_get_address_transactions_get | GET /api/v1/GetAddressTransactions | |
TransactionApi | api_v1_get_transaction_by_block_hash_and_index_get | GET /api/v1/GetTransactionByBlockHashAndIndex | |
TransactionApi | api_v1_get_transaction_get | GET /api/v1/GetTransaction | |
TransactionApi | api_v1_invoke_raw_script_get | GET /api/v1/InvokeRawScript | |
TransactionApi | api_v1_send_raw_transaction_get | GET /api/v1/SendRawTransaction | |
ValidatorApi | api_v1_get_validators_get | GET /api/v1/GetValidators | |
ValidatorApi | api_v1_get_validators_type_get | GET /api/v1/GetValidators/{type} |
Documentation For Models
- ABIEventResult
- ABIMethodResult
- ABIParameterResult
- AccountResult
- Address
- AddressKind
- ArchiveResult
- AuctionResult
- BalanceResult
- BlockResult
- ChainResult
- ContractResult
- CrowdsaleResult
- EventResult
- GovernanceResult
- InteropResult
- LeaderboardResult
- LeaderboardRowResult
- NetInfoPeer
- NetInfoPeerConnectionStatus
- NetInfoPeerConnectionStatusChannel
- NetInfoPeerConnectionStatusMonitor
- NexusResult
- NodeInfo
- NodeInfoOther
- NodeInfoProtocolVersion
- OracleResult
- OrganizationResult
- PaginatedResult
- PlatformResult
- PubKey
- ResponseQuery
- ResultAbciQuery
- ResultHealth
- ResultNetInfo
- ResultStatus
- ResultStatusSyncInfo
- ResultStatusValidatorInfo
- RpcRequest
- RpcResponse
- ScriptResult
- SignatureResult
- StakeResult
- StorageResult
- TokenDataResult
- TokenExternalResult
- TokenPriceResult
- TokenPropertyResult
- TokenResult
- TokenSeriesResult
- TransactionResult
- ValidatorResult
- ValidatorSettings
Documentation For Authorization
All endpoints do not require authorization.
Author
Tests
Running 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 -m unittest discover
python3 -m unittest src.phantasma_py.test
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 Distribution
Built Distribution
File details
Details for the file phantasma-py-1.0.4.tar.gz
.
File metadata
- Download URL: phantasma-py-1.0.4.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5e7244f4f0ae6ade6cd9189c49c206a68fb653bf15071561339ff34d4d9c559 |
|
MD5 | a0726947dd523743b9c650334271a8a0 |
|
BLAKE2b-256 | 45756f52159afc89c6750fa2f1c1901e0c2652cc2f47fe8df4db0a183aea42b0 |
File details
Details for the file phantasma_py-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: phantasma_py-1.0.4-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f3b36dd648da8fc359aa937b8fd551b176785f1f8dbf8b2f900b7207ee5756 |
|
MD5 | 5ed03bb967d833f4d48b7264ad782e76 |
|
BLAKE2b-256 | f33b3be6003311a91910c59ccd6da9ac17ec9bcee2bfd5d666297c101c7bc59d |