All URIs are relative to http://localhost/v2.1.0
| Method | HTTP request | Description |
|---|---|---|
| add_node | POST /node | Add node |
| add_to_blacklist | PUT /blacklist | Add to blacklist |
| add_to_whitelist | PUT /whitelist | Add to whitelist |
| broadcast_raw_transaction | POST /transaction/raw | Broadcast a raw transaction |
| compose_raw_transaction | GET /compose-raw-transaction | Compose an unsigned raw transaction |
| create_account | POST /account | Create or import an account |
| delete_account | DELETE /account | Delete account |
| get_account | GET /account | Get account |
| get_account_pending_transactions | GET /account/pending-transactions | Get pending transactions of the account |
| get_account_transactions | GET /account/transactions | Get account transactions |
| get_account_votes | GET /account/votes | Get account votes |
| get_block_by_hash | GET /block-by-hash | Get block by hash |
| get_block_by_number | GET /block-by-number | Get block by number |
| get_delegate | GET /delegate | Get a delegate |
| get_delegates | GET /delegates | Get all delegates |
| get_info | GET /info | Get info |
| get_latest_block | GET /latest-block | Get latest block |
| get_latest_block_number | GET /latest-block-number | Get latest block number |
| get_peers | GET /peers | Get peers |
| get_pending_transactions | GET /pending-transactions | Get pending transactions |
| get_root | GET / | Get root |
| get_syncing_progress | GET /syncing | Get syncing progress |
| get_transaction | GET /transaction | Get transaction |
| get_transaction_limits | GET /transaction-limits | Get transaction limits |
| get_validators | GET /validators | Get validators |
| get_vote | GET /vote | Get vote |
| get_votes | GET /votes | Get a delegate's votes |
| list_accounts | GET /accounts | List accounts |
| register_delegate | POST /transaction/delegate | Register delegate |
| sign_message | GET /sign-message | Sign a message |
| sign_raw_transaction | GET /sign-raw-transaction | Sign an unsigned raw transaction |
| transfer | POST /transaction/transfer | Transfer coins |
| unvote | POST /transaction/unvote | Unvote |
| verify_message | GET /verify-message | Verify a message |
| vote | POST /transaction/vote | Vote |
AddNodeResponse add_node(node)
Add node
Adds a node to node manager.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
node = 'node_example' # str | Address of the node in host:port format
try:
# Add node
api_response = api_instance.add_node(node)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->add_node: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| node | str | Address of the node in host:port format |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiHandlerResponse add_to_blacklist(ip)
Add to blacklist
Adds an IP address to blacklist.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
ip = 'ip_example' # str | IP address
try:
# Add to blacklist
api_response = api_instance.add_to_blacklist(ip)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->add_to_blacklist: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| ip | str | IP address |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiHandlerResponse add_to_whitelist(ip)
Add to whitelist
Adds an IP address to whitelist.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
ip = 'ip_example' # str | IP address
try:
# Add to whitelist
api_response = api_instance.add_to_whitelist(ip)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->add_to_whitelist: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| ip | str | IP address |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DoTransactionResponse broadcast_raw_transaction(raw, validate_nonce=validate_nonce)
Broadcast a raw transaction
Broadcasts a raw transaction to the network.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
raw = 'raw_example' # str | Raw transaction encoded in hexadecimal string.
validate_nonce = false # bool | Whether to validate tx nonce against the current account state, default to false if omitted (optional) (default to false)
try:
# Broadcast a raw transaction
api_response = api_instance.broadcast_raw_transaction(raw, validate_nonce=validate_nonce)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->broadcast_raw_transaction: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| raw | str | Raw transaction encoded in hexadecimal string. | |
| validate_nonce | bool | Whether to validate tx nonce against the current account state, default to false if omitted | [optional] [default to false] |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ComposeRawTransactionResponse compose_raw_transaction(network, type, fee, nonce, to=to, value=value, timestamp=timestamp, data=data)
Compose an unsigned raw transaction
Compose an unsigned raw transaction then return its hexadecimal encoded string. An unsigned raw transaction can be signed using /sign-raw-transaction API.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
network = 'network_example' # str | Network name
type = 'type_example' # str | Transaction type
fee = 'fee_example' # str | Transaction fee in nano
nonce = 'nonce_example' # str | Transaction nonce
to = 'to_example' # str | Recipient's address (optional)
value = 'value_example' # str | Transaction value in nano SEM (optional)
timestamp = 'timestamp_example' # str | Transaction timestamp in milliseconds. Default to current time. (optional)
data = 'data_example' # str | Hexadecimal encoded transaction data. (optional)
try:
# Compose an unsigned raw transaction
api_response = api_instance.compose_raw_transaction(network, type, fee, nonce, to=to, value=value, timestamp=timestamp, data=data)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->compose_raw_transaction: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| network | str | Network name | |
| type | str | Transaction type | |
| fee | str | Transaction fee in nano | |
| nonce | str | Transaction nonce | |
| to | str | Recipient's address | [optional] |
| value | str | Transaction value in nano SEM | [optional] |
| timestamp | str | Transaction timestamp in milliseconds. Default to current time. | [optional] |
| data | str | Hexadecimal encoded transaction data. | [optional] |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateAccountResponse create_account(name=name, private_key=private_key)
Create or import an account
Creates a new account by generating a new private key or importing an existing private key when parameter 'privateKey' is provided.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
name = 'name_example' # str | Assigned alias to the created account. (optional)
private_key = 'private_key_example' # str | The private key to be imported, create a new key if omitted (optional)
try:
# Create or import an account
api_response = api_instance.create_account(name=name, private_key=private_key)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->create_account: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Assigned alias to the created account. | [optional] |
| private_key | str | The private key to be imported, create a new key if omitted | [optional] |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteAccountResponse delete_account(address)
Delete account
Deletes an account from this wallet.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Address of the account
try:
# Delete account
api_response = api_instance.delete_account(address)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->delete_account: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Address of the account |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetAccountResponse get_account(address)
Get account
Returns an account.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Address of account
try:
# Get account
api_response = api_instance.get_account(address)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_account: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Address of account |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetAccountPendingTransactionsResponse get_account_pending_transactions(address, _from, to)
Get pending transactions of the account
Returns pending transactions from/to an account.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Address of account
_from = '_from_example' # str | Starting range of transactions
to = 'to_example' # str | Ending range of transactions
try:
# Get pending transactions of the account
api_response = api_instance.get_account_pending_transactions(address, _from, to)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_account_pending_transactions: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Address of account | |
| _from | str | Starting range of transactions | |
| to | str | Ending range of transactions |
GetAccountPendingTransactionsResponse
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetAccountTransactionsResponse get_account_transactions(address, _from, to)
Get account transactions
Returns transactions from/to an account.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Address of account
_from = '_from_example' # str | Starting range of transactions
to = 'to_example' # str | Ending range of transactions
try:
# Get account transactions
api_response = api_instance.get_account_transactions(address, _from, to)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_account_transactions: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Address of account | |
| _from | str | Starting range of transactions | |
| to | str | Ending range of transactions |
GetAccountTransactionsResponse
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetAccountVotesResponse get_account_votes(address)
Get account votes
Returns votes from the account.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Address of account
try:
# Get account votes
api_response = api_instance.get_account_votes(address)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_account_votes: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Address of account |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBlockResponse get_block_by_hash(hash)
Get block by hash
Returns a block by block hash.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
hash = 'hash_example' # str | Hash of block
try:
# Get block by hash
api_response = api_instance.get_block_by_hash(hash)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_block_by_hash: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| hash | str | Hash of block |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBlockResponse get_block_by_number(number)
Get block by number
Returns a block by block number.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
number = 'number_example' # str | Number of block
try:
# Get block by number
api_response = api_instance.get_block_by_number(number)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_block_by_number: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| number | str | Number of block |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDelegateResponse get_delegate(address)
Get a delegate
Returns a delegate.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Delegate address
try:
# Get a delegate
api_response = api_instance.get_delegate(address)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_delegate: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Delegate address |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDelegatesResponse get_delegates()
Get all delegates
Returns a list of delegates.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get all delegates
api_response = api_instance.get_delegates()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_delegates: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetInfoResponse get_info()
Get info
Returns kernel info.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get info
api_response = api_instance.get_info()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_info: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetLatestBlockResponse get_latest_block()
Get latest block
Returns the latest block.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get latest block
api_response = api_instance.get_latest_block()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_latest_block: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetLatestBlockNumberResponse get_latest_block_number()
Get latest block number
Returns the number of the latest block.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get latest block number
api_response = api_instance.get_latest_block_number()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_latest_block_number: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetPeersResponse get_peers()
Get peers
Returns connected peers.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get peers
api_response = api_instance.get_peers()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_peers: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetPendingTransactionsResponse get_pending_transactions()
Get pending transactions
Returns all the pending transactions.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get pending transactions
api_response = api_instance.get_pending_transactions()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_pending_transactions: %s\n" % e)This endpoint does not need any parameter.
GetPendingTransactionsResponse
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetRootResponse get_root()
Get root
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get root
api_response = api_instance.get_root()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_root: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetSyncingProgressResponse get_syncing_progress()
Get syncing progress
Returns an object with data about the sync status
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get syncing progress
api_response = api_instance.get_syncing_progress()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_syncing_progress: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetTransactionResponse get_transaction(hash)
Get transaction
Returns a transactions if exists.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
hash = 'hash_example' # str | Transaction hash
try:
# Get transaction
api_response = api_instance.get_transaction(hash)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_transaction: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| hash | str | Transaction hash |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetTransactionLimitsResponse get_transaction_limits(type)
Get transaction limits
Returns transaction limitations including minimum transaction fee and maximum transaction size.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
type = 'type_example' # str | Type of transaction
try:
# Get transaction limits
api_response = api_instance.get_transaction_limits(type)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_transaction_limits: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| type | str | Type of transaction |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetValidatorsResponse get_validators()
Get validators
Returns a list of validators in Semux addresses.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# Get validators
api_response = api_instance.get_validators()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_validators: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetVoteResponse get_vote(delegate, voter)
Get vote
Returns the vote from a voter to a delegate.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
delegate = 'delegate_example' # str | Delegate address
voter = 'voter_example' # str | Voter address
try:
# Get vote
api_response = api_instance.get_vote(delegate, voter)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_vote: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| delegate | str | Delegate address | |
| voter | str | Voter address |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetVotesResponse get_votes(delegate)
Get a delegate's votes
Returns all the votes to a delegate as a map of [voter address] => [votes]
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
delegate = 'delegate_example' # str | Delegate address
try:
# Get a delegate's votes
api_response = api_instance.get_votes(delegate)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->get_votes: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| delegate | str | Delegate address |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListAccountsResponse list_accounts()
List accounts
Returns accounts in the wallet.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
try:
# List accounts
api_response = api_instance.list_accounts()
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->list_accounts: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DoTransactionResponse register_delegate(_from, data, fee=fee, nonce=nonce, validate_nonce=validate_nonce)
Register delegate
Registers as a delegate
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
_from = '_from_example' # str | Registering address
data = 'data_example' # str | Delegate name in hexadecimal encoded UTF-8 string, 16 bytes of data at maximum
fee = 'fee_example' # str | Transaction fee in nano SEM, default to minimum fee if omitted (optional)
nonce = 'nonce_example' # str | Transaction nonce, default to sender's nonce if omitted (optional)
validate_nonce = false # bool | Whether validate tx nonce against the current account state, default to false if omitted (optional) (default to false)
try:
# Register delegate
api_response = api_instance.register_delegate(_from, data, fee=fee, nonce=nonce, validate_nonce=validate_nonce)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->register_delegate: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| _from | str | Registering address | |
| data | str | Delegate name in hexadecimal encoded UTF-8 string, 16 bytes of data at maximum | |
| fee | str | Transaction fee in nano SEM, default to minimum fee if omitted | [optional] |
| nonce | str | Transaction nonce, default to sender's nonce if omitted | [optional] |
| validate_nonce | bool | Whether validate tx nonce against the current account state, default to false if omitted | [optional] [default to false] |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SignMessageResponse sign_message(address, message)
Sign a message
Sign a message.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Signing address. The address must exist in the wallet.data of this Semux node.
message = 'message_example' # str | Message to sign in UTF-8 string
try:
# Sign a message
api_response = api_instance.sign_message(address, message)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->sign_message: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Signing address. The address must exist in the wallet.data of this Semux node. | |
| message | str | Message to sign in UTF-8 string |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SignRawTransactionResponse sign_raw_transaction(raw, address)
Sign an unsigned raw transaction
Sign an unsigned raw transaction then return its hexadecimal encoded string. An unsigned raw transaction can be created using /compose-raw-transaction API.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
raw = 'raw_example' # str | Unsigned raw transaction encoded in hexadecimal string.
address = 'address_example' # str | Signer's address. This address must exist in the wallet.
try:
# Sign an unsigned raw transaction
api_response = api_instance.sign_raw_transaction(raw, address)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->sign_raw_transaction: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| raw | str | Unsigned raw transaction encoded in hexadecimal string. | |
| address | str | Signer's address. This address must exist in the wallet. |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DoTransactionResponse transfer(_from, to, value, fee=fee, nonce=nonce, validate_nonce=validate_nonce, data=data)
Transfer coins
Transfers coins to another address.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
_from = '_from_example' # str | Sender's address. The address must exist in the wallet.data of this Semux node.
to = 'to_example' # str | Recipient's address
value = 'value_example' # str | Amount of SEM to transfer in nano SEM
fee = 'fee_example' # str | Transaction fee in nano SEM, default to minimum fee if omitted (optional)
nonce = 'nonce_example' # str | Transaction nonce, default to sender's nonce if omitted (optional)
validate_nonce = false # bool | Whether validate tx nonce against the current account state, default to false if omitted (optional) (default to false)
data = 'data_example' # str | Transaction data encoded in hexadecimal string (optional)
try:
# Transfer coins
api_response = api_instance.transfer(_from, to, value, fee=fee, nonce=nonce, validate_nonce=validate_nonce, data=data)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->transfer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| _from | str | Sender's address. The address must exist in the wallet.data of this Semux node. | |
| to | str | Recipient's address | |
| value | str | Amount of SEM to transfer in nano SEM | |
| fee | str | Transaction fee in nano SEM, default to minimum fee if omitted | [optional] |
| nonce | str | Transaction nonce, default to sender's nonce if omitted | [optional] |
| validate_nonce | bool | Whether validate tx nonce against the current account state, default to false if omitted | [optional] [default to false] |
| data | str | Transaction data encoded in hexadecimal string | [optional] |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DoTransactionResponse unvote(_from, to, value, fee=fee, nonce=nonce, validate_nonce=validate_nonce)
Unvote
Unvotes for a delegate.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
_from = '_from_example' # str | Voter's address. The address must exist in the wallet.data of this Semux node.
to = 'to_example' # str | Delegate address
value = 'value_example' # str | Number of votes in nano SEM
fee = 'fee_example' # str | Transaction fee in nano SEM, default to minimum fee if omitted (optional)
nonce = 'nonce_example' # str | Transaction nonce, default to sender's nonce if omitted (optional)
validate_nonce = false # bool | Whether validate tx nonce against the current account state, default to false if omitted (optional) (default to false)
try:
# Unvote
api_response = api_instance.unvote(_from, to, value, fee=fee, nonce=nonce, validate_nonce=validate_nonce)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->unvote: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| _from | str | Voter's address. The address must exist in the wallet.data of this Semux node. | |
| to | str | Delegate address | |
| value | str | Number of votes in nano SEM | |
| fee | str | Transaction fee in nano SEM, default to minimum fee if omitted | [optional] |
| nonce | str | Transaction nonce, default to sender's nonce if omitted | [optional] |
| validate_nonce | bool | Whether validate tx nonce against the current account state, default to false if omitted | [optional] [default to false] |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
VerifyMessageResponse verify_message(address, message, signature)
Verify a message
Verify a signed message.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
address = 'address_example' # str | Address of the message signer
message = 'message_example' # str | Message in UTF-8 string
signature = 'signature_example' # str | Signature to verify
try:
# Verify a message
api_response = api_instance.verify_message(address, message, signature)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->verify_message: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| address | str | Address of the message signer | |
| message | str | Message in UTF-8 string | |
| signature | str | Signature to verify |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DoTransactionResponse vote(_from, to, value, fee=fee, nonce=nonce, validate_nonce=validate_nonce)
Vote
Votes for a delegate.
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration.host = 'YOUR_HOST'
# create an instance of the API class
api_instance = swagger_client.SemuxApi(swagger_client.ApiClient(configuration))
_from = '_from_example' # str | Voter's address. The address must exist in the wallet.data of this Semux node.
to = 'to_example' # str | Delegate address
value = 'value_example' # str | Number of votes in nano SEM
fee = 'fee_example' # str | Transaction fee in nano SEM, default to minimum fee if omitted (optional)
nonce = 'nonce_example' # str | Transaction nonce, default to sender's nonce if omitted (optional)
validate_nonce = false # bool | Whether validate tx nonce against the current account state, default to false if omitted (optional) (default to false)
try:
# Vote
api_response = api_instance.vote(_from, to, value, fee=fee, nonce=nonce, validate_nonce=validate_nonce)
pprint(api_response)
except ApiException as e:
print("Exception when calling SemuxApi->vote: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| _from | str | Voter's address. The address must exist in the wallet.data of this Semux node. | |
| to | str | Delegate address | |
| value | str | Number of votes in nano SEM | |
| fee | str | Transaction fee in nano SEM, default to minimum fee if omitted | [optional] |
| nonce | str | Transaction nonce, default to sender's nonce if omitted | [optional] |
| validate_nonce | bool | Whether validate tx nonce against the current account state, default to false if omitted | [optional] [default to false] |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]