Skip to main content
import cobo_waas2
from cobo_waas2.models.list_transactions200_response import ListTransactions200Response
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.TransactionsApi(api_client)
    request_id = "web_send_by_user_327_1610444045047"
    cobo_ids = "20231213122855000000000000000000,20231213122955000000000000000000"
    transaction_ids = (
        "f47ac10b-58cc-4372-a567-0e02b2c3d479,557918d2-632a-4fe1-932f-315711f05fe3"
    )
    transaction_hashes = (
        "239861be9a4afe080c359b7fe4a1d035945ec46256b1a0f44d1267c71de8ec28"
    )
    types = "Deposit,Withdrawal"
    statuses = "Completed,Failed"
    wallet_ids = (
        "f47ac10b-58cc-4372-a567-0e02b2c3d479,1ddca562-8434-41c9-8809-d437bad9c868"
    )
    chain_ids = "BTC,ETH"
    token_ids = "ETH_USDT,ETH_USDC"
    asset_ids = "USDT,USDC"
    vault_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479"
    project_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479"
    min_created_timestamp = 1635744000000
    max_created_timestamp = 1635744000000
    limit = 10
    before = "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1"
    after = "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"

    try:
        # List all transactions
        api_response = api_instance.list_transactions(
            request_id=request_id,
            cobo_ids=cobo_ids,
            transaction_ids=transaction_ids,
            transaction_hashes=transaction_hashes,
            types=types,
            statuses=statuses,
            wallet_ids=wallet_ids,
            chain_ids=chain_ids,
            token_ids=token_ids,
            asset_ids=asset_ids,
            vault_id=vault_id,
            project_id=project_id,
            min_created_timestamp=min_created_timestamp,
            max_created_timestamp=max_created_timestamp,
            limit=limit,
            before=before,
            after=after,
        )
        print("The response of TransactionsApi->list_transactions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TransactionsApi->list_transactions: %s\n" % e)