/api/transactions/locker/peek
GETChecks the contents of a RAIDA locker without downloading the coins. Useful for verifying what's stored in a locker before retrieving it.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
locker_key |
string | Yes | Any non-empty string used as the locker passphrase (for example, AAA-BBBB). |
Responses
Success Response (200)
Returns information about the coins stored in the locker.
{
"command": "locker-peek",
"success": true,
"message": "Locker contents retrieved",
"coins": {
"total_value": 1337,
"coin_count": 5,
"denominations": {
"1000": 1,
"100": 3,
"10": 0,
"1": 37
}
},
"locker_key": "AAA-BBBB"
}
Error Responses
400 Bad Request
Missing locker key.
{
"error": true,
"message": "Missing required parameter: locker_key",
"code": 400
}
500 Internal Server Error
RAIDA consensus failure or transport issue.
{
"error": true,
"message": "Locker peek failed",
"code": 500,
"locker_key": "AAA-BBBB",
"raida_success": 9,
"raida_status_code": 242,
"detail": "ALL_FAIL"
}
Examples
cURL Example
curl -X GET "http://localhost:8080/api/transactions/locker/peek?locker_key=AAA-BBBB"
JavaScript Example
const lockerKey = 'AAA-BBBB';
fetch(`http://localhost:8080/api/transactions/locker/peek?locker_key=${lockerKey}`)
.then(response => response.json())
.then(data => {
if (!data.error && data.success) {
console.log(`Locker contains ${data.coins.coin_count} coins worth ${data.coins.total_value} units`);
console.log('Denominations:', data.coins.denominations);
} else {
console.error('Error:', data.message, data.detail ?? '');
}
})
.catch(error => console.error('Network error:', error));
Python Example
import requests
locker_key = 'a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456'
url = f'http://localhost:8080/api/transactions/locker/peek'
params = {'locker_key': locker_key}
try:
response = requests.get(url, params=params)
data = response.json()
if not data.get('error') and data.get('success'):
coins = data.get('coins', {})
print(f"Locker contains {coins.get('coin_count')} coins")
print(f"Total value: {coins.get('total_value')} units")
print(f"Denominations: {coins.get('denominations')}")
else:
print(f"Error: {data.get('message')} ({data.get('detail')})")
except requests.RequestException as e:
print(f"Request failed: {e}")
Notes
- This operation does not download or remove coins from the locker
- The locker key can be any non-empty shared passphrase string
- Use this endpoint to verify locker contents before downloading
- The response shows the total value and breakdown by denomination
- This is a read-only operation that requires minimal RAIDA communication
Related Endpoints
- /api/transactions/locker/download - Download coins from a locker
- /api/transactions/locker/upload - Upload coins to a locker