# Unified Deposit Address

**Base URL**

```
https://api.enclave.money
```

**Authorization**

```
Headers: {
    ...
    Authorization: <YOUR_API_KEY>
}
```

## Getting Started

Get started by creating a UDA for a user using the API endpoint below. This endpoint can be integrated as part of your onboarding flow.

## Create a new unified deposit address for a user

> Create a new unified deposit address for a user within an organization. Requires authentication.

```json
{"openapi":"3.0.0","info":{"title":"Enclave Wallet API","version":"1.0.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/unified-deposit-address/create":{"post":{"summary":"Create a new unified deposit address for a user","description":"Create a new unified deposit address for a user within an organization. Requires authentication.","tags":["Unified Deposit Address"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","destinationChainId","destinationAddress","destinationTokenAddress"],"properties":{"userId":{"type":"string","description":"Unique user identifier"},"destinationChainId":{"type":"integer","description":"Destination chain ID (EVM chainId)"},"destinationAddress":{"type":"string","description":"Destination wallet address (EVM address)"},"destinationTokenAddress":{"type":"string","description":"Destination token contract address (EVM address)"}}}}}},"responses":{"201":{"description":"Unified deposit address created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","description":"Unified deposit address object"}}}}}},"400":{"description":"Missing or invalid required fields","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Conflict - user or enclaveId already has an active unified deposit address","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

In case you want to create multiple UDAs for your existing users at once, you can use the batch creation endpoint below.

## Create multiple unified deposit addresses in batch

> Create multiple unified deposit addresses for users within an organization in a single request. Requires authentication. Batch size is limited to 50.

```json
{"openapi":"3.0.0","info":{"title":"Enclave Wallet API","version":"1.0.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/unified-deposit-address/create/batch":{"post":{"summary":"Create multiple unified deposit addresses in batch","description":"Create multiple unified deposit addresses for users within an organization in a single request. Requires authentication. Batch size is limited to 50.","tags":["Unified Deposit Address"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["requests"],"properties":{"requests":{"type":"array","items":{"type":"object","required":["userId","destinationChainId","destinationAddress","destinationTokenAddress"],"properties":{"userId":{"type":"string","description":"Unique user identifier"},"destinationChainId":{"type":"integer","description":"Destination chain ID"},"destinationAddress":{"type":"string","description":"Destination wallet address"},"destinationTokenAddress":{"type":"string","description":"Destination token contract address"}}}}}}}}},"responses":{"201":{"description":"Batch unified deposit addresses created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","description":"Unified deposit address object"},"error":{"type":"string"}}}}}}}}},"400":{"description":"Invalid request or batch size exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Fetch unified deposit address details for a specific user

> Retrieve the unified deposit address for a user within an organization. Requires authentication.

```json
{"openapi":"3.0.0","info":{"title":"Enclave Wallet API","version":"1.0.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/unified-deposit-address/user/{userId}":{"get":{"summary":"Fetch unified deposit address details for a specific user","description":"Retrieve the unified deposit address for a user within an organization. Requires authentication.","tags":["Unified Deposit Address"],"parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"string"},"description":"Unique user identifier"}],"responses":{"200":{"description":"Unified deposit address found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","description":"Unified deposit address object"}}}}}},"400":{"description":"Missing required parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Unified deposit address not found for this user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Update destination details for a unified deposit address

> Update the destination chain, address, and token for a user's unified deposit address. Requires authentication.

```json
{"openapi":"3.0.0","info":{"title":"Enclave Wallet API","version":"1.0.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/unified-deposit-address/user/{userId}/destination":{"put":{"summary":"Update destination details for a unified deposit address","description":"Update the destination chain, address, and token for a user's unified deposit address. Requires authentication.","tags":["Unified Deposit Address"],"parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"string"},"description":"Unique user identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["destinationChainId","destinationAddress","destinationTokenAddress"],"properties":{"destinationChainId":{"type":"integer","description":"Destination chain ID (EVM chainId)"},"destinationAddress":{"type":"string","description":"Destination wallet address (EVM address)"},"destinationTokenAddress":{"type":"string","description":"Destination token contract address (EVM address)"}}}}}},"responses":{"200":{"description":"Destination details updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","description":"Updated unified deposit address object"}}}}}},"400":{"description":"Missing or invalid required fields","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Unified deposit address not found for this user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Fetch all unified deposit addresses for an organization

> Retrieve all unified deposit addresses for the authenticated organization. Supports optional status filter and pagination. If \`all=true\` is provided, returns all addresses for the organization (ignores pagination).

```json
{"openapi":"3.0.0","info":{"title":"Enclave Wallet API","version":"1.0.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/unified-deposit-address/organization":{"get":{"summary":"Fetch all unified deposit addresses for an organization","description":"Retrieve all unified deposit addresses for the authenticated organization. Supports optional status filter and pagination. If `all=true` is provided, returns all addresses for the organization (ignores pagination).","tags":["Unified Deposit Address"],"parameters":[{"in":"query","name":"status","required":false,"schema":{"type":"string","enum":["ACTIVE","INACTIVE","PENDING","DISABLED"]},"description":"Filter by deposit address status"},{"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"Number of results to return (pagination)"},{"in":"query","name":"offset","required":false,"schema":{"type":"integer","default":0,"minimum":0},"description":"Offset for pagination"},{"in":"query","name":"all","required":false,"schema":{"type":"boolean"},"description":"If true, fetch all addresses for the organization (ignores pagination)"}],"responses":{"200":{"description":"List of unified deposit addresses","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","description":"Unified deposit address object"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"count":{"type":"integer"}}}}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Fetch unified deposit address details by internal enclaveId

> Retrieve the unified deposit address by its internal enclaveId (UUID v4). Requires authentication. Intended for internal services.

```json
{"openapi":"3.0.0","info":{"title":"Enclave Wallet API","version":"1.0.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/unified-deposit-address/enclave/{enclaveId}":{"get":{"summary":"Fetch unified deposit address details by internal enclaveId","description":"Retrieve the unified deposit address by its internal enclaveId (UUID v4). Requires authentication. Intended for internal services.","tags":["Unified Deposit Address"],"parameters":[{"in":"path","name":"enclaveId","required":true,"schema":{"type":"string","format":"uuid"},"description":"Internal enclaveId (UUID v4)"}],"responses":{"200":{"description":"Unified deposit address found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","description":"Unified deposit address object"}}}}}},"400":{"description":"Missing or invalid enclaveId","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Unified deposit address not found for this enclaveId","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Query the status of a teleport request

> Get the status of a teleport request by source chain ID and source transaction hash. Requires authentication.

```json
{"openapi":"3.0.0","info":{"title":"Enclave Wallet API","version":"1.0.0"},"security":[{"ApiKeyAuth":[]}],"paths":{"/unified-deposit-address/teleport/status":{"get":{"summary":"Query the status of a teleport request","description":"Get the status of a teleport request by source chain ID and source transaction hash. Requires authentication.","tags":["Unified Deposit Address"],"parameters":[{"in":"query","name":"sourceChainId","required":true,"schema":{"type":"integer"},"description":"Source chain ID of the depost transaction"},{"in":"query","name":"inboundTransactionHash","required":true,"schema":{"type":"string"},"description":"Transaction hash of the deposit transaction"}],"responses":{"200":{"description":"Teleport request status returned successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"multiTransactionId":{"type":"string"},"overallStatus":{"type":"string","enum":["PENDING","COMPLETED","FAILED","PARTIAL"]},"transactionType":{"type":"string"},"sourceChains":{"type":"array","items":{"type":"integer"}},"destinationChains":{"type":"array","items":{"type":"integer"}},"inputTransactions":{"type":"object","description":"Map of chainId to transaction details"},"outputTransactions":{"type":"object","description":"Map of chainId to array of transaction details"},"metadata":{"type":"object","description":"Transaction metadata including token details, amounts, and fees"},"estimatedTime":{"type":"number"},"createdTimestamp":{"type":"number"},"lastUpdatedTimestamp":{"type":"number"}}}}}},"400":{"description":"Missing required parameters","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}}}},"404":{"description":"No teleport request found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}}}}}}}}}
```
