Nabla Finance API for token swaps
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 0.5.0
- Package version: 1.0.0
- Generator version: 7.17.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Python 3.9+
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 openapi_clientInstall 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 openapi_clientExecute pytest to run the tests.
Please follow the installation procedure and then run the following:
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.ApproveApi(api_client)
chain_id = 56 # int | Network chain ID
token_address = 'token_address_example' # str | Contract address of the token to check allowance for
wallet_address = 'wallet_address_example' # str | Wallet address of the user
try:
# Get the current allowance of a token on Nabla Finance
api_response = api_instance.approve_allowance_chains_chain_id_approve_allowance_get(chain_id, token_address, wallet_address)
print("The response of ApproveApi->approve_allowance_chains_chain_id_approve_allowance_get:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling ApproveApi->approve_allowance_chains_chain_id_approve_allowance_get: %s\n" % e)All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ApproveApi | approve_allowance_chains_chain_id_approve_allowance_get | GET /chains/{chainId}/approve/allowance | Get the current allowance of a token on Nabla Finance |
| ApproveApi | approve_spender_chains_chain_id_approve_spender_get | GET /chains/{chainId}/approve/spender | Get the spender address for token approvals on Nabla Finance |
| ApproveApi | approve_transaction_chains_chain_id_approve_transaction_get | GET /chains/{chainId}/approve/transaction | Generate calldata to approve token spending on Nabla Finance |
| HealthApi | health_check_health_status_get | GET /health/status | Health check |
| HealthApi | health_check_health_status_get_0 | GET /health/status | Health check |
| HealthApi | prices_health_prices_get | GET /health/prices | Check cached token prices |
| SwapApi | quote_endpoint_chains_chain_id_quote_get | GET /chains/{chainId}/quote | Find the best quote to swap with Nabla Finance |
| SwapApi | swap_endpoint_chains_chain_id_swap_get | GET /chains/{chainId}/swap | Generate calldata to swap on Nabla Finance |
| TokensApi | chain_tokens_endpoint_chains_chain_id_tokens_get | GET /chains/{chainId}/tokens | List of tokens that are available for swap on Nabla Finance |
- AllowanceResponse
- ApprovalResponse
- ApprovalTx
- ChainInfo
- HTTPValidationError
- QuoteResponse
- RouterInfo
- SpenderResponse
- SwapResponse
- SwapTx
- TokenInfo
- ValidationError
- ValidationErrorLocInner
Endpoints do not require authorization.