> For the complete documentation index, see [llms.txt](https://trident-cas.sabn.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trident-cas.sabn.xyz/payment/transactions.md).

# Transactions

#### Supported Assets

| Symbol | Name     |
| ------ | -------- |
| `LTC`  | Litecoin |
| `SOL`  | Solana   |

***

#### Client -> Server Events

**`deposit-address`**

Generate/Retrieve a unique deposit address for a specific asset.

* **Payload**: `{ asset: string }`
* **Response**: Emits `deposit-address` event.

**`withdraw`**

Initiate a cryptocurrency withdrawal.

* **Payload**:

```typescript
{
    asset: string,
    to: string, // Destination wallet address
    amount: number // Amount in USD
}
```

* **Response**: Emits `withdraw` event.

***

#### Server -> Client Events

**`deposit-address`**

Returns the generated deposit address.

* **Data**:

```typescript
{
    status: true,
    address: string
} | {
    status: false,
    error: string
}
```

**`withdraw`**

Detailed status of the withdrawal request.

* **Data**:

```typescript
{
    status: true,
    queued?: boolean // present for WARM/COLD tiers
} | {
    status: "pending" // Initial acknowledgement
} | {
    status: false,
    error: string,
    kyc?: boolean // if true, KYC is required
}
```

***

#### Withdrawal Process Details

**Phase Logic**

1. **SUBMITTED**: Initial request received and validated.
2. **FUNDING / COLD\_FUNDING**: Transferring funds from treasury to intermediate processing vaults (WARM/COLD).
3. **PAYOUT\_SUBMITTED**: Funds arrived in processing vault; final payout to user address initiated.
4. **AWAITING\_TAP**: (COLD only) Awaiting manual approval/signing.
5. **COMPLETED**: Transaction successfully finalized on-chain and balance updated.

**Error Codes**

* `Insufficient balance`: User does not have enough sweepstake balance.
* `Minimum withdraw amount is $20`: Small withdrawals are restricted.
* `Hot wallets are temporarily underfunded`: Temporary liquidity issue in the HOT tier.
* `You need to wager more to withdraw`: Wager requirements not met.

***

#### Integration Example

**Requesting a Deposit Address**

```javascript
socket.emit("deposit-address", { asset: "ETH" });

socket.on("deposit-address", res => {
    if (res.status) {
        console.log("Deposit ETH to:", res.address);
    } else {
        alert(res.error);
    }
});
```

**Requesting a Withdrawal**

```javascript
socket.emit("withdraw", {
    asset: "LTC",
    to: "LTC_ADDRESS_HERE",
    amount: 100, // USD
});

socket.on("withdraw", res => {
    if (res.status === "pending") {
        console.log("Working on it...");
    } else if (res.status === true) {
        console.log("Withdrawal submitted successfully!");
    } else {
        alert(res.error);
    }
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trident-cas.sabn.xyz/payment/transactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
