Skip to main content
POST
/
auto_sweep
/
sweep_to_addresses
import cobo_waas2
from cobo_waas2.models.create_sweep_to_address import CreateSweepToAddress
from cobo_waas2.models.sweep_to_address import SweepToAddress
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_sweep_to_address = cobo_waas2.CreateSweepToAddress(
        wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479", chain_id="ETH"
    )

    try:
        # create sweep-to address
        api_response = api_instance.create_wallet_sweep_to_addresses(
            create_sweep_to_address=create_sweep_to_address
        )
        print("The response of AutoSweepApi->create_wallet_sweep_to_addresses:\n")
        pprint(api_response)
    except Exception as e:
        print(
            "Exception when calling AutoSweepApi->create_wallet_sweep_to_addresses: %s\n"
            % e
        )

{
  "address": "0x0000000000000000000000000000000000000000",
  "chain_id": "ETH",
  "status": "Valid"
}
import cobo_waas2
from cobo_waas2.models.create_sweep_to_address import CreateSweepToAddress
from cobo_waas2.models.sweep_to_address import SweepToAddress
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_sweep_to_address = cobo_waas2.CreateSweepToAddress(
        wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479", chain_id="ETH"
    )

    try:
        # create sweep-to address
        api_response = api_instance.create_wallet_sweep_to_addresses(
            create_sweep_to_address=create_sweep_to_address
        )
        print("The response of AutoSweepApi->create_wallet_sweep_to_addresses:\n")
        pprint(api_response)
    except Exception as e:
        print(
            "Exception when calling AutoSweepApi->create_wallet_sweep_to_addresses: %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 generates a new sweep-to address within a specified wallet.

Information of the new sweep-to address to be created.

wallet_id
string
required

The wallet ID.

Example:

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

chain_id
string
required

The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains.

Example:

"ETH"

Response

Successfully create sweep to addresses

Information about the sweep-to address.

address
string
required

The wallet address.

Example:

"0x0000000000000000000000000000000000000000"

chain_id
string
required

The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling List enabled chains.

Example:

"ETH"

status
enum<string>

The status of the sweep-to address:

  • Valid: The sweep-to address is active and used for auto token sweeping.
  • Invalid: The sweep-to address is no longer used for auto token sweeping.
Available options:
Valid,
Invalid
Example:

"Valid"