import moonsdk
from moonsdk.models.broad_cast_raw_transaction_api_response import BroadCastRawTransactionAPIResponse
from moonsdk.models.broadcast_input import BroadcastInput
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
authorization = 'authorization_example' # str |
account_name = 'account_name_example' # str |
broadcast_input = moonsdk.BroadcastInput() # BroadcastInput |
try:
api_response = await api_instance.broadcast_tx(authorization, account_name, broadcast_input)
print("The response of AccountsApi->broadcast_tx:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->broadcast_tx: %s\n" % e)
import moonsdk
from moonsdk.models.account_api_response import AccountAPIResponse
from moonsdk.models.create_account_input import CreateAccountInput
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
authorization = 'authorization_example' # str |
create_account_input = moonsdk.CreateAccountInput() # CreateAccountInput |
try:
api_response = await api_instance.create_account(authorization, create_account_input)
print("The response of AccountsApi->create_account:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->create_account: %s\n" % e)
import moonsdk
from moonsdk.models.account_api_response import AccountAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
authorization = 'authorization_example' # str |
account_name = 'account_name_example' # str |
try:
api_response = await api_instance.delete_account(authorization, account_name)
print("The response of AccountsApi->delete_account:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->delete_account: %s\n" % e)
import moonsdk
from moonsdk.models.deploy_input import DeployInput
from moonsdk.models.transaction_api_response import TransactionAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
authorization = 'authorization_example' # str |
account_name = 'account_name_example' # str |
deploy_input = moonsdk.DeployInput() # DeployInput |
try:
api_response = await api_instance.deploy_contract(authorization, account_name, deploy_input)
print("The response of AccountsApi->deploy_contract:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->deploy_contract: %s\n" % e)
import moonsdk
from moonsdk.models.account_api_response import AccountAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
authorization = 'authorization_example' # str |
account_name = 'account_name_example' # str |
try:
api_response = await api_instance.get_account(authorization, account_name)
print("The response of AccountsApi->get_account:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->get_account: %s\n" % e)
import moonsdk
from moonsdk.models.balance_api_response import BalanceAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
account_name = 'account_name_example' # str |
authorization = 'authorization_example' # str |
chain_id = 'chain_id_example' # str |
try:
api_response = await api_instance.get_balance(account_name, authorization, chain_id)
print("The response of AccountsApi->get_balance:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->get_balance: %s\n" % e)
import moonsdk
from moonsdk.models.nonce_api_response import NonceAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
account_name = 'account_name_example' # str |
authorization = 'authorization_example' # str |
try:
api_response = await api_instance.get_nonce(account_name, authorization)
print("The response of AccountsApi->get_nonce:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->get_nonce: %s\n" % e)
Parameters
Name
Type
Description
Notes
account_name
str
authorization
str
Return type
Authorization
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code
Description
Response headers
200
Ok
-
list_accounts
AccountAPIResponse list_accounts(authorization)
Example
Api Key Authentication (ApiKeyAuth):
Api Key Authentication (BearerAuth):
import moonsdk
from moonsdk.models.account_api_response import AccountAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
authorization = 'authorization_example' # str |
try:
api_response = await api_instance.list_accounts(authorization)
print("The response of AccountsApi->list_accounts:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->list_accounts: %s\n" % e)
import moonsdk
from moonsdk.models.sign_message import SignMessage
from moonsdk.models.sign_message_api_response import SignMessageAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
account_name = 'account_name_example' # str |
authorization = 'authorization_example' # str |
sign_message = moonsdk.SignMessage() # SignMessage |
try:
api_response = await api_instance.sign_message(account_name, authorization, sign_message)
print("The response of AccountsApi->sign_message:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->sign_message: %s\n" % e)
import moonsdk
from moonsdk.models.input_body import InputBody
from moonsdk.models.transaction_api_response import TransactionAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
account_name = 'account_name_example' # str |
authorization = 'authorization_example' # str |
input_body = moonsdk.InputBody() # InputBody |
try:
api_response = await api_instance.sign_transaction(account_name, authorization, input_body)
print("The response of AccountsApi->sign_transaction:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->sign_transaction: %s\n" % e)
import moonsdk
from moonsdk.models.sign_message_api_response import SignMessageAPIResponse
from moonsdk.models.sign_typed_data import SignTypedData
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
account_name = 'account_name_example' # str |
authorization = 'authorization_example' # str |
sign_typed_data = moonsdk.SignTypedData() # SignTypedData |
try:
api_response = await api_instance.sign_typed_data(account_name, authorization, sign_typed_data)
print("The response of AccountsApi->sign_typed_data:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->sign_typed_data: %s\n" % e)
import moonsdk
from moonsdk.models.input_body import InputBody
from moonsdk.models.transaction_api_response import TransactionAPIResponse
from moonsdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://beta.usemoon.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = moonsdk.Configuration(
host = "https://beta.usemoon.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure API key authorization: BearerAuth
configuration.api_key['BearerAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['BearerAuth'] = 'Bearer'
# Enter a context with an instance of the API client
async with moonsdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = moonsdk.AccountsApi(api_client)
account_name = 'account_name_example' # str |
authorization = 'authorization_example' # str |
input_body = moonsdk.InputBody() # InputBody |
try:
api_response = await api_instance.transfer_eth(account_name, authorization, input_body)
print("The response of AccountsApi->transfer_eth:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AccountsApi->transfer_eth: %s\n" % e)