> For the complete documentation index, see [llms.txt](https://docs.usemoon.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usemoon.ai/sdks/python/oneinchapi.md).

# OneinchApi

## moonsdk.OneinchApi

All URIs are relative to *<https://beta.usemoon.ai>*

| Method                                        | HTTP request                         | Description |
| --------------------------------------------- | ------------------------------------ | ----------- |
| [**approve\_call\_data**](#approve_call_data) | **POST** /oneinch/approve-call-data  |             |
| [**approve\_spender**](#approve_spender)      | **POST** /oneinch/approve-spender    |             |
| [**protocols**](#protocols)                   | **POST** /oneinch/protocols          |             |
| [**quote**](#quote)                           | **POST** /oneinch/quote              |             |
| [**swap**](#swap)                             | **POST** /oneinch/{accountName}/swap |             |
| [**tokens**](#tokens)                         | **POST** /oneinch/tokens             |             |

## **approve\_call\_data**

> object approve\_call\_data(body)

#### Example

* Api Key Authentication (ApiKeyAuth):
* Api Key Authentication (BearerAuth):

```python
import moonsdk
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.OneinchApi(api_client)
    body = None # object | 

    try:
        api_response = await api_instance.approve_call_data(body)
        print("The response of OneinchApi->approve_call_data:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OneinchApi->approve_call_data: %s\n" % e)
```

#### Parameters

| Name     | Type       | Description | Notes |
| -------- | ---------- | ----------- | ----- |
| **body** | **object** |             |       |

#### Return type

**object**

#### Authorization

[ApiKeyAuth](/sdks/python.md#ApiKeyAuth), [BearerAuth](/sdks/python.md#BearerAuth)

#### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

#### HTTP response details

| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200**     | Ok          | -                |

[\[Back to top\]](/sdks/python/oneinchapi.md) [\[Back to API list\]](/sdks/python.md#documentation-for-api-endpoints) [\[Back to Model list\]](/sdks/python.md#documentation-for-models) [\[Back to README\]](/sdks/python.md)

## **approve\_spender**

> object approve\_spender(body)

#### Example

* Api Key Authentication (ApiKeyAuth):
* Api Key Authentication (BearerAuth):

```python
import moonsdk
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.OneinchApi(api_client)
    body = None # object | 

    try:
        api_response = await api_instance.approve_spender(body)
        print("The response of OneinchApi->approve_spender:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OneinchApi->approve_spender: %s\n" % e)
```

#### Parameters

| Name     | Type       | Description | Notes |
| -------- | ---------- | ----------- | ----- |
| **body** | **object** |             |       |

#### Return type

**object**

#### Authorization

[ApiKeyAuth](/sdks/python.md#ApiKeyAuth), [BearerAuth](/sdks/python.md#BearerAuth)

#### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

#### HTTP response details

| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200**     | Ok          | -                |

[\[Back to top\]](/sdks/python/oneinchapi.md) [\[Back to API list\]](/sdks/python.md#documentation-for-api-endpoints) [\[Back to Model list\]](/sdks/python.md#documentation-for-models) [\[Back to README\]](/sdks/python.md)

## **protocols**

> object protocols(body)

#### Example

* Api Key Authentication (ApiKeyAuth):
* Api Key Authentication (BearerAuth):

```python
import moonsdk
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.OneinchApi(api_client)
    body = None # object | 

    try:
        api_response = await api_instance.protocols(body)
        print("The response of OneinchApi->protocols:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OneinchApi->protocols: %s\n" % e)
```

#### Parameters

| Name     | Type       | Description | Notes |
| -------- | ---------- | ----------- | ----- |
| **body** | **object** |             |       |

#### Return type

**object**

#### Authorization

[ApiKeyAuth](/sdks/python.md#ApiKeyAuth), [BearerAuth](/sdks/python.md#BearerAuth)

#### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

#### HTTP response details

| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200**     | Ok          | -                |

[\[Back to top\]](/sdks/python/oneinchapi.md) [\[Back to API list\]](/sdks/python.md#documentation-for-api-endpoints) [\[Back to Model list\]](/sdks/python.md#documentation-for-models) [\[Back to README\]](/sdks/python.md)

## **quote**

> object quote(body)

#### Example

* Api Key Authentication (ApiKeyAuth):
* Api Key Authentication (BearerAuth):

```python
import moonsdk
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.OneinchApi(api_client)
    body = None # object | 

    try:
        api_response = await api_instance.quote(body)
        print("The response of OneinchApi->quote:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OneinchApi->quote: %s\n" % e)
```

#### Parameters

| Name     | Type       | Description | Notes |
| -------- | ---------- | ----------- | ----- |
| **body** | **object** |             |       |

#### Return type

**object**

#### Authorization

[ApiKeyAuth](/sdks/python.md#ApiKeyAuth), [BearerAuth](/sdks/python.md#BearerAuth)

#### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

#### HTTP response details

| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200**     | Ok          | -                |

[\[Back to top\]](/sdks/python/oneinchapi.md) [\[Back to API list\]](/sdks/python.md#documentation-for-api-endpoints) [\[Back to Model list\]](/sdks/python.md#documentation-for-models) [\[Back to README\]](/sdks/python.md)

## **swap**

> object swap(account\_name, authorization, get\_swap\_dto)

#### Example

* Api Key Authentication (ApiKeyAuth):
* Api Key Authentication (BearerAuth):

```python
import moonsdk
from moonsdk.models.get_swap_dto import GetSwapDto
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.OneinchApi(api_client)
    account_name = 'account_name_example' # str | 
    authorization = 'authorization_example' # str | 
    get_swap_dto = moonsdk.GetSwapDto() # GetSwapDto | 

    try:
        api_response = await api_instance.swap(account_name, authorization, get_swap_dto)
        print("The response of OneinchApi->swap:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OneinchApi->swap: %s\n" % e)
```

#### Parameters

| Name               | Type                                         | Description | Notes |
| ------------------ | -------------------------------------------- | ----------- | ----- |
| **account\_name**  | **str**                                      |             |       |
| **authorization**  | **str**                                      |             |       |
| **get\_swap\_dto** | [**GetSwapDto**](/sdks/python/getswapdto.md) |             |       |

#### Return type

**object**

#### Authorization

[ApiKeyAuth](/sdks/python.md#ApiKeyAuth), [BearerAuth](/sdks/python.md#BearerAuth)

#### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

#### HTTP response details

| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200**     | Ok          | -                |

[\[Back to top\]](/sdks/python/oneinchapi.md) [\[Back to API list\]](/sdks/python.md#documentation-for-api-endpoints) [\[Back to Model list\]](/sdks/python.md#documentation-for-models) [\[Back to README\]](/sdks/python.md)

## **tokens**

> object tokens(body)

#### Example

* Api Key Authentication (ApiKeyAuth):
* Api Key Authentication (BearerAuth):

```python
import moonsdk
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.OneinchApi(api_client)
    body = None # object | 

    try:
        api_response = await api_instance.tokens(body)
        print("The response of OneinchApi->tokens:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling OneinchApi->tokens: %s\n" % e)
```

#### Parameters

| Name     | Type       | Description | Notes |
| -------- | ---------- | ----------- | ----- |
| **body** | **object** |             |       |

#### Return type

**object**

#### Authorization

[ApiKeyAuth](/sdks/python.md#ApiKeyAuth), [BearerAuth](/sdks/python.md#BearerAuth)

#### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

#### HTTP response details

| Status code | Description | Response headers |
| ----------- | ----------- | ---------------- |
| **200**     | Ok          | -                |

[\[Back to top\]](/sdks/python/oneinchapi.md) [\[Back to API list\]](/sdks/python.md#documentation-for-api-endpoints) [\[Back to Model list\]](/sdks/python.md#documentation-for-models) [\[Back to README\]](/sdks/python.md)
