Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

radixdlt/python-core-client

Repository files navigation

Radix Core / System API - Python Clients and Models

  • Core API version: v1.0.4
  • Package version: 1.0.0

This Core/System API client is generated from the Core/System API spec using an Open API Generator. However, the current python generator is rather buggy, so we've had to customise the generation with templates to get a working client.

For more information on this, or to regenerate, check out the regeneration folder.

Both of the API clients are generated over the top of each other, so

API Docs

See the API specifications on the Radix docs site.

Open API Autogen'd Docs (from Core API generation)

Requirements.

Python >= 3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

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 core_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 core_client

Getting Started

Please follow the installation procedure and then run the following:

import time
import core_client
from pprint import pprint
from core_client.api import lts_api
from core_client.model.basic_error_response import BasicErrorResponse
from core_client.model.lts_state_account_all_fungible_resource_balances_request import LtsStateAccountAllFungibleResourceBalancesRequest
from core_client.model.lts_state_account_all_fungible_resource_balances_response import LtsStateAccountAllFungibleResourceBalancesResponse
from core_client.model.lts_state_account_deposit_behaviour_request import LtsStateAccountDepositBehaviourRequest
from core_client.model.lts_state_account_deposit_behaviour_response import LtsStateAccountDepositBehaviourResponse
from core_client.model.lts_state_account_fungible_resource_balance_request import LtsStateAccountFungibleResourceBalanceRequest
from core_client.model.lts_state_account_fungible_resource_balance_response import LtsStateAccountFungibleResourceBalanceResponse
from core_client.model.lts_stream_account_transaction_outcomes_request import LtsStreamAccountTransactionOutcomesRequest
from core_client.model.lts_stream_account_transaction_outcomes_response import LtsStreamAccountTransactionOutcomesResponse
from core_client.model.lts_stream_transaction_outcomes_request import LtsStreamTransactionOutcomesRequest
from core_client.model.lts_stream_transaction_outcomes_response import LtsStreamTransactionOutcomesResponse
from core_client.model.lts_transaction_construction_request import LtsTransactionConstructionRequest
from core_client.model.lts_transaction_construction_response import LtsTransactionConstructionResponse
from core_client.model.lts_transaction_status_request import LtsTransactionStatusRequest
from core_client.model.lts_transaction_status_response import LtsTransactionStatusResponse
from core_client.model.lts_transaction_submit_request import LtsTransactionSubmitRequest
from core_client.model.lts_transaction_submit_response import LtsTransactionSubmitResponse
from core_client.model.transaction_submit_error_response import TransactionSubmitErrorResponse
# Defining the host is optional and defaults to http://localhost:3333/core
# See configuration.py for a list of all supported configuration parameters.
configuration = core_client.Configuration(
    host = "http://localhost:3333/core"
)



# Enter a context with an instance of the API client
with core_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = lts_api.LTSApi(api_client)
    lts_state_account_all_fungible_resource_balances_request = LtsStateAccountAllFungibleResourceBalancesRequest(
        network="{{network}}",
        account_address="account_address_example",
    ) # LtsStateAccountAllFungibleResourceBalancesRequest | 

    try:
        # Get All Account Balances
        api_response = api_instance.lts_state_account_all_fungible_resource_balances_post(lts_state_account_all_fungible_resource_balances_request)
        pprint(api_response)
    except core_client.ApiException as e:
        print("Exception when calling LTSApi->lts_state_account_all_fungible_resource_balances_post: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost:3333/core

Class Method HTTP request Description
LTSApi lts_state_account_all_fungible_resource_balances_post POST /lts/state/account-all-fungible-resource-balances Get All Account Balances
LTSApi lts_state_account_deposit_behaviour_post POST /lts/state/account-deposit-behaviour Get Account Deposit Behaviour
LTSApi lts_state_account_fungible_resource_balance_post POST /lts/state/account-fungible-resource-balance Get Single Account Balance
LTSApi lts_stream_account_transaction_outcomes_post POST /lts/stream/account-transaction-outcomes Get Account Transaction Outcomes
LTSApi lts_stream_transaction_outcomes_post POST /lts/stream/transaction-outcomes Get Transaction Outcomes
LTSApi lts_transaction_construction_post POST /lts/transaction/construction Get Construction Metadata
LTSApi lts_transaction_status_post POST /lts/transaction/status Get Transaction Status
LTSApi lts_transaction_submit_post POST /lts/transaction/submit Submit Transaction
MempoolApi mempool_list_post POST /mempool/list Get Mempool List
MempoolApi mempool_transaction_post POST /mempool/transaction Get Mempool Transaction
StateApi state_access_controller_post POST /state/access-controller Get Access Controller Details
StateApi state_account_post POST /state/account Get Account Details
StateApi state_component_post POST /state/component Get Component Details
StateApi state_consensus_manager_post POST /state/consensus-manager Get Consensus Manager Details
StateApi state_non_fungible_post POST /state/non-fungible Get Non-Fungible Details
StateApi state_package_post POST /state/package Get Package Details
StateApi state_resource_post POST /state/resource Get Resource Details
StateApi state_validator_post POST /state/validator Get Validator Details
StatusApi status_network_configuration_post POST /status/network-configuration Get Network Configuration
StatusApi status_network_status_post POST /status/network-status Get Network Status
StatusApi status_scenarios_post POST /status/scenarios Get Scenarios' results.
StreamApi stream_transactions_post POST /stream/transactions Get Committed Transactions
TransactionApi transaction_call_preview_post POST /transaction/call-preview Scrypto Call Preview
TransactionApi transaction_parse_post POST /transaction/parse Parse Transaction Payload
TransactionApi transaction_preview_post POST /transaction/preview Transaction Preview
TransactionApi transaction_receipt_post POST /transaction/receipt Get Transaction Receipt
TransactionApi transaction_status_post POST /transaction/status Get Transaction Status
TransactionApi transaction_submit_post POST /transaction/submit Transaction Submit

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in core_client.apis and core_client.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from core_client.api.default_api import DefaultApi
  • from core_client.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import core_client
from core_client.apis import *
from core_client.models import *