Skip to main content

Social Vault API

Endpoints for managing Social Vault security features.

Get Vault Configuration

Get the user’s Social Vault configuration.
curl -X GET "https://api.usmewe.com/v1/social-vault/config" \
  -H "Authorization: Bearer YOUR_TOKEN"

Create Social Vault

Initialize a new Social Vault.
curl -X POST "https://api.usmewe.com/v1/social-vault" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dailyLimit": 100,
    "timelockDuration": 86400,
    "requiredSignatures": 2,
    "duressPin": "1234"
  }'

Configuration Parameters

ParameterTypeDescription
dailyLimitnumberMax instant withdrawal (USDC)
timelockDurationnumberTimelock in seconds (3600-604800)
requiredSignaturesnumberRequired guardian approvals
duressPinstring4-6 digit emergency code

Deposit to Social Vault

Deposit USDC into Social Vault.
curl -X POST "https://api.usmewe.com/v1/social-vault/deposit" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500
  }'

Instant Withdrawal

Withdraw within daily limit (no timelock).
curl -X POST "https://api.usmewe.com/v1/social-vault/withdraw/instant" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50,
    "recipient": "0x..."
  }'

Request Large Withdrawal

Request withdrawal exceeding daily limit (requires timelock + approvals).
curl -X POST "https://api.usmewe.com/v1/social-vault/withdraw/request" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500,
    "recipient": "0x..."
  }'

List Pending Withdrawals

Get all pending withdrawal requests.
curl -X GET "https://api.usmewe.com/v1/social-vault/withdrawals/pending" \
  -H "Authorization: Bearer YOUR_TOKEN"

Approve Withdrawal (Guardian)

As a guardian, approve a pending withdrawal.
curl -X POST "https://api.usmewe.com/v1/social-vault/withdrawals/{withdrawalId}/approve" \
  -H "Authorization: Bearer GUARDIAN_TOKEN"

Execute Withdrawal

Execute an approved withdrawal after timelock.
curl -X POST "https://api.usmewe.com/v1/social-vault/withdrawals/{withdrawalId}/execute" \
  -H "Authorization: Bearer YOUR_TOKEN"

Cancel Withdrawal

Cancel a pending withdrawal request.
curl -X POST "https://api.usmewe.com/v1/social-vault/withdrawals/{withdrawalId}/cancel" \
  -H "Authorization: Bearer YOUR_TOKEN"

Emergency Lock (Duress PIN)

Lock the vault using duress PIN.
curl -X POST "https://api.usmewe.com/v1/social-vault/lock" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "duressPin": "1234"
  }'
Emergency lock cancels all pending withdrawals and notifies guardians silently.

Manage Guardians

Add Guardian

curl -X POST "https://api.usmewe.com/v1/social-vault/guardians" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"walletAddress": "0x..."}'

Remove Guardian

curl -X DELETE "https://api.usmewe.com/v1/social-vault/guardians/{guardianId}" \
  -H "Authorization: Bearer YOUR_TOKEN"

List Guardians

curl -X GET "https://api.usmewe.com/v1/social-vault/guardians" \
  -H "Authorization: Bearer YOUR_TOKEN"

Webhook Events

// Withdrawal requested
{
  "event": "social_vault.withdrawal_requested",
  "data": {
    "withdrawalId": "wd_abc123",
    "amount": "500.00",
    "requiredApprovals": 2
  }
}

// Withdrawal approved
{
  "event": "social_vault.withdrawal_approved",
  "data": {
    "withdrawalId": "wd_abc123",
    "approver": "guardian_1",
    "totalApprovals": 1
  }
}

// Vault locked
{
  "event": "social_vault.locked",
  "data": {
    "vaultOwner": "user_abc123",
    "lockedAt": "2024-01-15T12:00:00Z"
  }
}

Error Responses

CodeErrorDescription
400DAILY_LIMIT_EXCEEDEDAmount exceeds daily limit
400VAULT_LOCKEDVault is locked
403NOT_GUARDIANNot authorized as guardian
409TIMELOCK_ACTIVEWithdrawal still in timelock