Skip to main content
POST
/
auto_sweep
/
tasks
import cobo_waas2
from cobo_waas2.models.auto_sweep_task import AutoSweepTask
from cobo_waas2.models.create_auto_sweep_task import CreateAutoSweepTask
from cobo_waas2.rest import ApiException
from pprint import pprint

# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
    # Replace `<YOUR_PRIVATE_KEY>` with your private key
    api_private_key="<YOUR_PRIVATE_KEY>",
    # Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
    host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cobo_waas2.AutoSweepApi(api_client)
    create_auto_sweep_task = cobo_waas2.CreateAutoSweepTask(
        wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479", token_id="ETH_USDT"
    )

    try:
        # Create auto-sweep task
        api_response = api_instance.create_auto_sweep_task(
            create_auto_sweep_task=create_auto_sweep_task
        )
        print("The response of AutoSweepApi->create_auto_sweep_task:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AutoSweepApi->create_auto_sweep_task: %s\n" % e)

{
  "task_id": "aff0e1cb-15b2-4e1f-9b9d-a9133715986f",
  "wallet_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "token_id": "ETH_USDT",
  "status": "Submitted",
  "transaction_ids": [
    "0011039d-27fb-49ba-b172-6e0aa80e37ec"
  ],
  "failed_reasons": [
    "exist pending transaction"
  ],
  "created_timestamp": 1610445878970,
  "updated_timestamp": 1610445878970
}
import cobo_waas2
from cobo_waas2.models.auto_sweep_task import AutoSweepTask
from cobo_waas2.models.create_auto_sweep_task import CreateAutoSweepTask
from cobo_waas2.rest import ApiException
from pprint import pprint

# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
    # Replace `<YOUR_PRIVATE_KEY>` with your private key
    api_private_key="<YOUR_PRIVATE_KEY>",
    # Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
    host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cobo_waas2.AutoSweepApi(api_client)
    create_auto_sweep_task = cobo_waas2.CreateAutoSweepTask(
        wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479", token_id="ETH_USDT"
    )

    try:
        # Create auto-sweep task
        api_response = api_instance.create_auto_sweep_task(
            create_auto_sweep_task=create_auto_sweep_task
        )
        print("The response of AutoSweepApi->create_auto_sweep_task:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AutoSweepApi->create_auto_sweep_task: %s\n" % e)

Authorizations

BIZ-API-KEY
string
header
required

The API key. For more details, refer to API key.

In the API playground, enter your API secret, and your API key will be accordingly calculated.

Body

application/json

The request body to create an auto-sweep task.

Wallet and token information required to create an auto-sweep task.

wallet_id
string
required

ID of the wallet where the token will be swept.

Example:

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

token_id
string
required

ID of the token to be swept. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens.

Example:

"ETH_USDT"

Response

Successfully created auto-sweep task.

Auto-sweep task information.

task_id
string<uuid>
required

Auto-sweep task ID.

Example:

"aff0e1cb-15b2-4e1f-9b9d-a9133715986f"

wallet_id
string
required

Wallet ID.

Example:

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

token_id
string
required

Token ID of the swept token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens.

Example:

"ETH_USDT"

status
enum<string>
required

Auto-sweep task status:

  • Submitted: The auto-sweep task has been submitted.
  • TransactionCreated: The auto-sweep task triggered one or more token sweeping transactions.
Available options:
Submitted,
TransactionCreated
Example:

"Submitted"

created_timestamp
integer
required

The time when the task was created, in Unix timestamp format, measured in milliseconds.

Example:

1610445878970

transaction_ids
string[]

IDs of the transactions triggered by the task.

failed_reasons
string[]

Reasons why the task creation failed.

updated_timestamp
integer

The time when the task was updated, in Unix timestamp format, measured in milliseconds.

Example:

1610445878970