Giter VIP home page Giter VIP logo

python-core-client's Introduction

Radix Core / System API - Python Clients and Models

  • Core API version: 1.0.0
  • 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 construction_api
from core_client.model.construction_build_request import ConstructionBuildRequest
from core_client.model.construction_build_response import ConstructionBuildResponse
from core_client.model.construction_derive_request import ConstructionDeriveRequest
from core_client.model.construction_derive_response import ConstructionDeriveResponse
from core_client.model.construction_finalize_request import ConstructionFinalizeRequest
from core_client.model.construction_finalize_response import ConstructionFinalizeResponse
from core_client.model.construction_hash_request import ConstructionHashRequest
from core_client.model.construction_hash_response import ConstructionHashResponse
from core_client.model.construction_parse_request import ConstructionParseRequest
from core_client.model.construction_parse_response import ConstructionParseResponse
from core_client.model.construction_submit_request import ConstructionSubmitRequest
from core_client.model.construction_submit_response import ConstructionSubmitResponse
from core_client.model.unexpected_error import UnexpectedError
# Defining the host is optional and defaults to http://localhost:3333
# See configuration.py for a list of all supported configuration parameters.
configuration = core_client.Configuration(
    host = "http://localhost:3333"
)



# 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 = construction_api.ConstructionApi(api_client)
    construction_build_request = ConstructionBuildRequest(
        network_identifier=NetworkIdentifier(
            network="network_example",
        ),
        operation_groups=[
            OperationGroup(
                operations=[
                    Operation(
                        type="type_example",
                        entity_identifier=EntityIdentifier(
                            address="address_example",
                            sub_entity=SubEntity(
                                address="address_example",
                                metadata=SubEntityMetadata(
                                    validator_address="validator_address_example",
                                    epoch_unlock=1,
                                ),
                            ),
                        ),
                        substate=Substate(
                            substate_operation="BOOTUP",
                            substate_identifier=SubstateIdentifier(
                                identifier="identifier_example",
                            ),
                        ),
                        amount=ResourceAmount(
                            value=BigInteger("-80728"),
                            resource_identifier=ResourceIdentifier(),
                        ),
                        data=Data(
                            action="CREATE",
                            data_object=DataObject(),
                        ),
                        metadata={},
                    ),
                ],
                metadata={},
            ),
        ],
        fee_payer=EntityIdentifier(
            address="address_example",
            sub_entity=SubEntity(
                address="address_example",
                metadata=SubEntityMetadata(
                    validator_address="validator_address_example",
                    epoch_unlock=1,
                ),
            ),
        ),
        message="message_example",
        disable_resource_allocate_and_destroy=True,
    ) # ConstructionBuildRequest | 

    try:
        # Build Transaction
        api_response = api_instance.construction_build_post(construction_build_request)
        pprint(api_response)
    except core_client.ApiException as e:
        print("Exception when calling ConstructionApi->construction_build_post: %s\n" % e)

Documentation for API Endpoints

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

Class Method HTTP request Description
ConstructionApi construction_build_post POST /construction/build Build Transaction
ConstructionApi construction_derive_post POST /construction/derive Derive Entity Identifier
ConstructionApi construction_finalize_post POST /construction/finalize Finalize Transaction
ConstructionApi construction_hash_post POST /construction/hash Get Transaction Hash
ConstructionApi construction_parse_post POST /construction/parse Parse Transaction
ConstructionApi construction_submit_post POST /construction/submit Submit Transaction
EngineApi engine_configuration_post POST /engine/configuration Get Engine Configuration
EngineApi engine_forks_voting_results_post POST /engine/forks-voting-results Get forks voting results for the given epoch
EngineApi engine_status_post POST /engine/status Get Engine Current Status
EntityApi entity_post POST /entity Get Entity Information
KeyApi key_list_post POST /key/list Get public keys
KeyApi key_sign_post POST /key/sign Sign transaction
KeyApi key_vote_post POST /key/vote Vote for the candidate fork (if present)
KeyApi key_withdraw_vote_post POST /key/withdraw-vote Withdraw the vote for the candidate fork
MempoolApi mempool_post POST /mempool Get Mempool Transactions
MempoolApi mempool_transaction_post POST /mempool/transaction Get Mempool Transaction
NetworkApi network_configuration_post POST /network/configuration Get Network Configuration
NetworkApi network_status_post POST /network/status Get Network Status
TransactionsApi transactions_post POST /transactions Get Committed Transactions

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 *

python-core-client's People

Contributors

dhedey avatar talekhinezh avatar theoklitos avatar shambupujar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.