/api/transactions/locker/remove

POST

Removes all coins from a RAIDA locker. This is a destructive operation that permanently deletes the coins from RAIDA storage without downloading them to your wallet.

Endpoint: http://localhost:8080/api/transactions/locker/remove

Parameters

Name Type Required Description
locker_key string Yes The 32-character hexadecimal locker key

Responses

Success Response (200)

Returns confirmation that the coins were successfully removed from the locker.

{
    "success": true,
    "message": "Successfully removed coins from locker",
    "coins_removed": 5,
    "total_value_removed": 1337,
    "locker_key": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}

Error Responses

400 Bad Request

Invalid or missing locker key

{
    "error": true,
    "message": "Invalid locker key format. Must be 32 hex characters",
    "code": 400
}

404 Not Found

Locker is empty or doesn't exist

{
    "error": true,
    "message": "Locker is empty or does not exist",
    "code": 404
}

500 Internal Server Error

Server error or RAIDA network issue

{
    "error": true,
    "message": "Failed to remove coins from locker: RAIDA network error",
    "code": 500
}

Examples

cURL Example

curl -X POST "http://localhost:8080/api/transactions/locker/remove?locker_key=a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"

JavaScript Example

const lockerKey = 'a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456';

fetch(`http://localhost:8080/api/transactions/locker/remove?locker_key=${lockerKey}`, {
    method: 'POST'
})
    .then(response => response.json())
    .then(data => {
        if (data.success) {
            console.log(`Successfully removed ${data.coins_removed} coins`);
            console.log(`Total value removed: ${data.total_value_removed} units`);
        } else {
            console.error('Error:', data.message);
        }
    })
    .catch(error => console.error('Network error:', error));

Python Example

import requests

locker_key = 'a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456'
url = f'http://localhost:8080/api/transactions/locker/remove'
params = {'locker_key': locker_key}

try:
    response = requests.post(url, params=params)
    data = response.json()

    if data.get('success'):
        print(f"Successfully removed {data.get('coins_removed')} coins")
        print(f"Total value removed: {data.get('total_value_removed')} units")
    else:
        print(f"Error: {data.get('message')}")
except requests.RequestException as e:
    print(f"Request failed: {e}")

Notes

  • DESTRUCTIVE OPERATION: This permanently deletes coins from RAIDA storage without downloading them
  • The coins are NOT transferred to your wallet - they are completely removed
  • Use /api/transactions/locker/download if you want to retrieve the coins first
  • Consider using /api/transactions/locker/peek to verify contents before removing
  • The locker key must be exactly 32 hexadecimal characters
  • This operation cannot be undone - removed coins are permanently lost
  • Requires successful communication with at least 13 of the 25 RAIDA servers

Use Cases

  • Cleaning up temporary locker storage after successful coin transfer
  • Removing expired or abandoned coins from a locker
  • Clearing locker space for future transactions
  • Deleting unwanted coins without importing them to your wallet

Security Considerations

  • The locker key provides sole access - protect it carefully
  • Anyone with the locker key can remove coins from the locker
  • There is no recovery mechanism once coins are removed
  • Always verify locker contents with peek before removing