open-index/open-npm huggingface dataset:
npm package: @obscr-io/emergency-withdraw
Description: Emergency withdraw module for Obscura project
Latest version: 1.0.7

# Obscura Emergency Withdraw

This project scans an EVM-based wallet contract for encrypted balances and enables emergency withdrawals using a private
seed.

## 📦 Features

- 🔐 Decrypts private balances stored in a wallet contract.
- 📜 Prepares `emergencyWithdraw` transaction data.
- 🧪 Usable via CLI for scripting and debugging.

---

## Requirements

- Node.js
- npm

## 🚀 Usage via CLI

1. Install dependencies:

   📦 As a regular project dependency:

   ```bash
   npm install @obscr-io/emergency-withdraw
   ```

   🌍 As a global CLI tool (accessible anywhere):

   ```bash
   npm install -g @obscr-io/emergency-withdraw
   ```

2. Run `getAmounts` command to scan the wallet:

   ```bash
   obscr getAmounts \
    --nodeUrl=https://ethereum-mainnet.example \
    --evmChainId=0x1 \
    --walletContractAddress=0x322... \
    --userAddress=0x59E... \
    --tokenAddresses=0xToken1,0xToken2 \
    --seed=0x876...
   ```

   Example output:

   ```json
   {
     "0xToken1": {
       "amount": "Amount",
       "balanceSecret": "0xBalanceSecret"
     }
   }
   ```

3. Use the result to generate a withdrawal transaction per Token, via `getEmergencyWithdrawTx` command:

   ```bash
   obscr getEmergencyWithdrawTx \
    --nodeUrl=https://ethereum-mainnet.example \
    --evmChainId=0x1 \
    --walletContractAddress=0x322... \
    --tokenAddress=0xToken1 \
    --amount=Amount \
    --balanceSecret=0xBalanceSecret
   ```

   Example output, transaction data:

   ```
   '0xData'
   ```

   This will return a raw transaction data string (hex) for the emergencyWithdraw call, ready to be signed and
   broadcasted to the network.