Skill: regan-milne/claw-store-1-3-3 (version 1.3.5)

--- name: claw_store description: "Sovereign, recoverable memory for AI agents backed by Jackal decentralized storage." user-invocable: true metadata: openclaw: emoji: "🧠" requires: env: - "JACKAL_MEMORY_API_KEY" - "JACKAL_MEMORY_ENCRYPTION_KEY" - "JACKAL_MEMORY_WALLET_MNEMONIC" homepage: "https://obsideo.io" repository: "https://github.com/Regan-Milne/jackal-memory" --- # Claw Store Persist your memory across sessions and machines. Your data lives on Jackal Protocol decentralized storage — not on any single machine. If the machine dies, your memory survives. All content is encrypted client-side with AES-256-GCM before leaving your machine. The server never sees plaintext. ## Trust & security quick facts - **Runtime API host:** `https://web-production-5cce7.up.railway.app` (separate from homepage domain) - **Data leaving your machine:** encrypted payloads + key metadata + your Jackal public address for provisioning - **Data not leaving your machine:** plaintext memory content, encryption key, wallet mnemonic/private key - **No runtime wordlist download:** BIP39 English wordlist is vendored locally in this skill package - **Secret file permissions:** locally generated key/mnemonic files are written with `0600` permissions - **Homepage:** https://obsideo.io - **Source code:** https://github.com/Regan-Milne/jackal-memory - **Publisher:** Obsideo ([REDACTED_SECRET]) ## Setup 1. Get an API key: https://web-production-5cce7.up.railway.app/auth/login 2. Set environment variable: `JACKAL_MEMORY_API_KEY=<your-key>` 3. Install Python dependency: `pip install cryptography` 4. Install Node.js runtime (recommended Node >=20) and install helper deps in the skill folder: `npm install` 5. On first save, an encryption key and a Jackal wallet are auto-generated locally and saved to `~/.config/jackal-memory/`. These never leave your machine. **Back up your encryption key** (run once, store the output safely): ``` python {baseDir}/jackal-memory/client.py keygen ``` Set `JACKAL_MEMORY_ENCRYPTION_KEY=<your-key>` to use the same key on other machines. **Back up your Jackal wallet mnemonic** (controls on-chain storage ownership): ``` python {baseDir}/jackal-memory/client.py wallet ``` Set `JACKAL_MEMORY_WALLET_MNEMONIC=<mnemonic>` to use the same wallet on other machines. ## Onboarding new users If `JACKAL_MEMORY_API_KEY` is not set: 1. Tell the user you need their Claw Store API key to get started 2. Send them to: https://web-production-5cce7.up.railway.app/auth/login — sign in with Google, the key is shown immediately 3. Instruct them to set it **directly in their environment** — never share or paste an API key into chat: ``` export JACKAL_MEMORY_API_KEY=<their-key> ``` 4. Once set, confirm you're connected and offer to save something right away as a first test 5. After the first successful save, remind the user to back up their Jackal wallet mnemonic: ``` python {baseDir}/jackal-memory/client.py wallet ``` The mnemonic controls their on-chain storage. Losing it means losing sovereign access to stored files. **Important:** Never ask the user to paste their API key, encryption key, or wallet mnemonic into chat. Always direct them to set it as an environment variable on their machine. ## Base URL `https://web-production-5cce7.up.railway.app` Note: this runtime API host is currently on Railway and is distinct from the project homepage domain (`obsideo.io`). Verify endpoint trust in your environment before use. ## Auth `Authorization: Bearer $JACKAL_MEMORY_API_KEY` ## Usage **On session start** — restore memory: ``` python {baseDir}/jackal-memory/client.py load <key> ``` **On session end** — save memory: ``` python {baseDir}/jackal-memory/client.py save <key> <content> ``` **Check storage usage:** ``` python {baseDir}/jackal-memory/client.py usage ``` **List known saved keys (local manifest):** ``` python {baseDir}/jackal-memory/client.py list python {baseDir}/jackal-memory/client.py list project- ``` **Export local key manifest for backup/migration:** ``` python {baseDir}/jackal-memory/client.py manifest-export ~/jackal-manifest.json ``` **Show/generate Jackal wallet:** ``` python {baseDir}/jackal-memory/client.py wallet python {baseDir}/jackal-memory/client.py wallet --show-mnemonic python {baseDir}/jackal-memory/client.py walletgen ``` **Or call the API directly:** ``` GET /load/{key} POST /save {"key": "...", "content": "..."} GET /usage ``` ## Behaviour guidelines - Load your identity/memory blob on startup before doing any work - Write locally during the session as normal - Call save at session end or on significant state changes - Use descriptive keys: `identity`, `session-2026-02-26`, `project-jackal` - Never log or expose `JACKAL_MEMORY_API_KEY` in output - Never log or expose `JACKAL_MEMORY_ENCRYPTION_KEY` in output ## Network latency & propagation (important) Jackal is eventually consistent across a provider pool. A successful save means the write was accepted, but read visibility can lag. Agent protocol: 1. If save succeeds, treat it as accepted and continue work (optimistic flow). 2. If immediate load fails, do not assume data loss. 3. Retry with patience (recommended: 8 attempts, 15s apart; ~2 minutes total). 4. If still unavailable, report as `propagation delay` and re-check later. 5. Escalate only after extended delay windows continue to fail. Notes: - Provider-level logs like `Error: Can't claim` can be non-fatal noise. - Some providers may temporarily fail while others succeed. - Operationally: save now, verify later, then finalize once data becomes readable. ## Proactive memory suggestions When you encounter something that seems important — a key decision, user preference, project status, significant result, or plan — proactively say: > "This seems important. Should I back it up to Claw Store?" If the user confirms, save it immediately with a descriptive key. Do not wait until the end of the session for important information — suggest saving it as soon as you recognise its value. Never proactively suggest storing raw secrets (passwords, API keys, private keys, recovery phrases, tokens). Only store such material if the user explicitly requests it and understands the risk. ## Wallet sovereignty Each user gets their own Jackal wallet, generated locally on first save. The private key (mnemonic) **never leaves your machine** — not even the API server sees it. Your storage is owned by your wallet address on the Jackal blockchain. If Obsideo shuts down, you can access your files directly via any Jackal client using your mnemonic. Back up the mnemonic: ``` python {baseDir}/jackal-memory/client.py wallet ``` For selective recovery after hardware loss, keep all three backups: 1. `JACKAL_MEMORY_WALLET_MNEMONIC` 2. `JACKAL_MEMORY_ENCRYPTION_KEY` 3. local key manifest (`manifest-export`) so you can restore specific keys instead of guessing. ## Endpoint and storage transparency This skill interacts with: - Obsideo API: `https://web-production-5cce7.up.railway.app` - Jackal decentralized storage providers (resolved dynamically by Jackal SDK) - Local subprocess: `jackal-memory/jackal-client.js` (Node helper for Jackal upload/download) Local files written by this skill: - `~/.config/jackal-memory/key` (AES encryption key, if not provided via env; written with `0600`) - `~/.config/jackal-memory/jackal-mnemonic` (wallet mnemonic, if not provided via env; written with `0600`) - `.env` (read-only): `jackal-client.js` will load one directory up if present, to populate missing env vars. Operational note: run in a clean environment when possible to avoid unintentionally inheriting unrelated secrets from `.env`. ## Security - All content is encrypted before leaving your machine — the server cannot read your memories - Your Jackal wallet private key never leaves your machine - Set API keys and secrets directly in local environment variables; never paste them into chat - Back up both keys: `keygen` (encryption) and `wallet` (Jackal mnemonic) - Treat memory content as sensitive — it may contain personal or operational data - Do not proactively store raw secrets unless the user explicitly asks - BIP39 English wordlist is included locally in the package (no runtime fetch required).

path: jackal-memory/client.py
content: #!/usr/bin/env python3
"""
Jackal Memory client for AI agents.

Usage:
  python client.py keygen                 — show/generate AES encryption key
  python client.py walletgen              — generate Jackal wallet and register with API
  python client.py wallet                 — show current Jackal wallet address
  python client.py save <key> <content>
  python client.py load <key>
  python client.py usage                  — show storage quota usage
  python client.py list [prefix]          — list known saved keys from local manifest
  python client.py manifest-export [path] — export local key manifest JSON

Setup — two paths:
  A) Pre-provisioned (existing credentials):
       JACKAL_MEMORY_ENCRYPTION_KEY=<hex>
       JACKAL_MEMORY_WALLET_MNEMONIC=<24 words>
     save/load work without an API key.

  B) Fresh setup via Obsideo API:
       JACKAL_MEMORY_API_KEY=<key>
     Run: python client.py walletgen — generates wallet and provisions storage.
     After walletgen, same as path A.

Requires: pip install cryptography
"""

import base64
import hashlib
import hmac
import json
import os
import pathlib
import re
import struct
import subprocess
import sys
import urllib.error
import urllib.request

_WORDLIST_FILE = pathlib.Path(__file__).parent / "data" / "bip39_english.txt"

BASE_URL = "https://web-production-5cce7.up.railway.app"

_KEY_FILE      = pathlib.Path.home() / ".config" / "jackal-memory" / "key"
_WALLET_FILE   = pathlib.Path.home() / ".config" / "jackal-memory" / "jackal-mnemonic"
_MANIFEST_FILE = pathlib.Path.home() / ".config" / "jackal-memory" / "manifest.json"


def _write_secret_file(path: pathlib.Path, value: str) -> None:
    path.parent.mkdir(parents=True, exist_ok=True)
    path.write_text(value)
    os.chmod(path, 0o600)


# ── Encryption (mandatory) ────────────────────────────────────────────────────

def _encryption_key() -> bytes:
    key_hex = os.environ.get("JACKAL_MEMORY_ENCRYPTION_KEY", "").strip()
    if key_hex:
        return bytes.fromhex(key_hex)

    if _KEY_FILE.exists():
        return bytes.fromhex(_KEY_FILE.read_text().strip())

    key_hex = os.urandom(32).hex()
    _write_secret_file(_KEY_FILE, key_hex)
    print(
        "\n[jackal-memory] Generated a new encryption key and saved it to:\n"
        f"  {_KEY_FILE}\n\n"
        "Your memories are encrypted with this key. Back it up:\n"
        f"  export JACKAL_MEMORY_ENCRYPTION_KEY={key_hex}\n",
        file=sys.stderr,
    )
    return bytes.fromhex(key_hex)


def _encrypt(plaintext: str) -> str:
    from cryptography.hazmat.primitives.ciphers.aead import AESGCM
    key   = _encryption_key()
    nonce = os.urandom(12)
    ct    = AESGCM(key).encrypt(nonce, plaintext.encode(), None)
    return base64.b64encode(nonce + ct).decode()


def _decrypt(ciphertext_b64: str) -> str:
    from cryptography.hazmat.primitives.ciphers.aead import AESGCM
    key  = _encryption_key()
    data = base64.b64decode(ciphertext_b64)
    nonce, ct = data[:12], data[12:]
    return AESGCM(key).decrypt(nonce, ct, None).decode()


def _load_manifest() -> dict:
    if not _MANIFEST_FILE.exists():
        return {"entries": {}}
    try:
        data = json.loads(_MANIFEST_FILE.read_text())
        if not isinstance(data, dict):
            return {"entries": {}}
        data.setdefault("entries", {})
        return data
    except Exception:
        return {"entries": {}}


def _save_manifest(manifest: dict) -> None:
    _MANIFEST_FILE.parent.mkdir(parents=True, exist_ok=True)
    _MANIFEST_FILE.write_text(json.dumps(manifest, indent=2, sort_keys=True))


def _manifest_upsert(key: str, cid: str, plaintext: str) -> None:
    from datetime import datetime, timezone
    m = _load_manifest()
    entries = m.setdefault("entries", {})
    entries[key] = {
        "cid": cid,
        "updated_at": datetime.now(timezone.utc).isoformat(),
        "bytes_plaintext": len(plaintext.encode("utf-8")),
    }
    _save_manifest(m)


# ── Jackal wallet (BIP39/BIP44 — no extra dependencies) ──────────────────────

_BIP39_WORDS = None  # lazy-loaded

def _load_wordlist() -> list:
    global _BIP39_WORDS
    if _BIP39_WORDS is None:
        try:
            _BIP39_WORDS = _WORDLIST_FILE.read_text().split()
        except Exception:
            print(f"[jackal-memory] Could not load local BIP39 wordlist at {_WORDLIST_FILE}.", file=sys.stderr)
            sys.exit(1)
        if len(_BIP39_WORDS) != 2048:
            print("[jackal-memory] Invalid BIP39 wordlist (expected 2048 words).", file=sys.stderr)
            sys.exit(1)
    return _BIP39_WORDS


def _generate_mnemonic() -> str:
    """Generate a 24-word BIP39 mnemonic from 256 bits of entropy."""
    words = _load_wordlist()
    entropy = os.urandom(32)  # 256 bits
    # Checksum: first (256/32)=8 bits of SHA256(entropy)
    h = hashlib.sha256(entropy).digest()
    bits = bin(int.from_bytes(entropy, 'big'))[2:].zfill(256) + bin(h[0])[2:].zfill(8)
    return ' '.join(words[int(bits[i*11:(i+1)*11], 2)] for i in range(24))


def _mnemonic_to_seed(mnemonic: str) -> bytes:
    """BIP39: mnemonic → 64-byte seed via PBKDF2-HMAC-SHA512."""
    return hashlib.pbkdf2_hmac(
        'sha512',
        mnemonic.encode('utf-8'),
        b'mnemonic',
        2048,
    )


_SECP256K1_ORDER = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141


def _bip32_derive(seed: bytes, path: str) -> bytes:
    """Derive a private key from seed using BIP32/BIP44 path (e.g. m/44'/118'/0'/0/0)."""
    I = hmac.new(b'Bitcoin seed', seed, hashlib.sha512).digest()
    key, chain = I[:32], I[32:]

    for part in path.lstrip('m/').split('/'):
        hardened = part.endswith("'")
        index = int(part.rstrip("'")) + (0x80000000 if hardened else 0)
        if hardened:
            data = b'\x00' + key + struct.pack('>I', index)
        else:
            data = _privkey_to_pubkey(key) + struct.pack('>I', index)
        I = hmac.new(chain, data, hashlib.sha512).digest()
        il = int.from_bytes(I[:32], 'big')
        key_int = (il + int.from_bytes(key, 'big')) % _SECP256K1_ORDER
        key = key_int.to_bytes(32, 'big')
        chain = I[32:]

    return key


def _privkey_to_pubkey(privkey: bytes) -> bytes:
    """secp256k1 compressed public key from private key."""
    from cryptography.hazmat.primitives.asymmetric.ec import (
        SECP256K1, derive_private_key, EllipticCurvePublicKey,
    )
    from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
    priv = derive_private_key(int.from_bytes(privkey, 'big'), SECP256K1())
    return priv.public_key().public_bytes(Encoding.X962, PublicFormat.CompressedPoint)


def _pubkey_to_address(pubkey: bytes, hrp: str) -> str:
    """Cosmos address: RIPEMD160(SHA256(pubkey)) → bech32(hrp)."""
    sha = hashlib.sha256(pubkey).digest()
    try:
        rip = hashlib.new('ripemd160', sha).digest()
    except ValueError:
        # OpenSSL 3.0+ may disable RIPEMD160 — use cryptography library fallback
        from cryptography.hazmat.primitives import hashes
        from cryptography.hazmat.primitives.hashes import Hash
        h = Hash(hashes.RIPEMD160())
        h.update(sha)
        rip = h.finalize()
    return _bech32_encode(hrp, rip)


def _bech32_encode(hrp: str, data: bytes) -> str:
    """Standard bech32 encoding (Cosmos compatible)."""
    CHARSET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'
    GEN = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]

    def polymod(values):
        chk = 1
        for v in values:
            b = chk >> 25
            chk = (chk & 0x1ffffff) << 5 ^ v
            for i in range(5):
                chk ^= GEN[i] if (b >> i) & 1 else 0
        return chk

    def hrp_expand(s):
        return [ord(x) >> 5 for x in s] + [0] + [ord(x) & 31 for x in s]

    def convertbits(data, frombits, tobits):
        acc = bits = 0
        ret = []
        maxv = (1 << tobits) - 1
        for v in data:
            acc = ((acc << frombits) | v) & 0xffffffff
            bits += frombits
            while bits >= tobits:
                bits -= tobits
                ret.append((acc >> bits) & maxv)
        if bits:
            ret.append((acc << (tobits - bits)) & maxv)
        return ret

    data5 = convertbits(data, 8, 5)
    chk = polymod(hrp_expand(hrp) + data5 + [0] * 6) ^ 1
    checksum = [(chk >> 5 * (5 - i)) & 31 for i in range(6)]
    return hrp + '1' + ''.join(CHARSET[d] for d in data5 + checksum)


def _jackal_mnemonic() -> str | None:
    """Return the stored Jackal wallet mnemonic, or None if not set up yet."""
    env = os.environ.get("JACKAL_MEMORY_WALLET_MNEMONIC", "").strip()
    if env:
        return env
    if _WALLET_FILE.exists():
        return _WALLET_FILE.read_text().strip()
    return None


def _mnemonic_to_jackal_address(mnemonic: str) -> str:
    """Derive jkl1... address from BIP39 mnemonic via m/44'/118'/0'/0/0."""
    seed    = _mnemonic_to_seed(mnemonic)
    privkey = _bip32_derive(seed, "m/44'/118'/0'/0/0")
    pubkey  = _privkey_to_pubkey(privkey)
    return _pubkey_to_address(pubkey, "jkl")


# ── API ───────────────────────────────────────────────────────────────────────

def _api_key() -> str:
    key = os.environ.get("JACKAL_MEMORY_API_KEY", "")
    if not key:
        print("Error: JACKAL_MEMORY_API_KEY is not set.", file=sys.stderr)
        sys.exit(1)
    return key


def _request(method: str, path: str, body: dict | None = None) -> dict:
    url  = BASE_URL + path
    data = json.dumps(body).encode() if body else None
    req  = urllib.request.Request(
        url,
        data=data,
        method=method,
        headers={
            "Authorization": f"Bearer {_api_key()}",
            "Content-Type": "application/json",
        },
    )
    try:
        with urllib.request.urlopen(req) as resp:
            return json.loads(resp.read())
    except urllib.error.HTTPError as e:
        error = json.loads(e.read())
        print(f"Error {e.code}: {error.get('detail', e.reason)}", file=sys.stderr)
        sys.exit(1)


def _ensure_wallet_registered() -> None:
    """
    On first save: generate a Jackal wallet if none exists, then register
    the jkl1... address with the API (only if API key is available).

    Two paths:
      A) Mnemonic already set (pre-provisioned) — skip API registration entirely.
      B) No mnemonic + API key present — generate wallet and register for provisioning.
      C) No mnemonic + no API key — error with helpful message.
    """
    mnemonic = _jackal_mnemonic()
    [REDACTED_SECRET]"JACKAL_MEMORY_API_KEY", "").strip()

    if mnemonic is None:
        if not [REDACTED_SECRET]
                "[jackal-memory] No Jackal wallet found.\n"
                "  To use existing credentials: set JACKAL_MEMORY_WALLET_MNEMONIC\n"
                "  To set up fresh:             set JACKAL_MEMORY_API_KEY and run: python client.py walletgen",
                file=sys.stderr,
            )
            sys.exit(1)
        # Fresh setup — generate wallet and provision via API
        mnemonic = _generate_mnemonic()
        _write_secret_file(_WALLET_FILE, mnemonic)
        address = _mnemonic_to_jackal_address(mnemonic)
        print(
            "\n[jackal-memory] Generated your Jackal wallet and saved the mnemonic to:\n"
            f"  {_WALLET_FILE}\n\n"
            f"  Jackal address: {address}\n\n"
            "  This wallet will own your storage on-chain. Back up the mnemonic:\n"
            f"  python client.py wallet\n",
            file=sys.stderr,
        )
    else:
        address = _mnemonic_to_jackal_address(mnemonic)

    # Register with API only if key is available (not required for pre-provisioned wallets)
    if api_key:
        try:
            _request("POST", "/register-wallet", {"jackal_address": address})
        except SystemExit:
            pass  # Registration failure is non-fatal


# ── Jackal client subprocess ──────────────────────────────────────────────────

_SKILL_DIR     = pathlib.Path(__file__).parent
_JACKAL_CLIENT = _SKILL_DIR / "jackal-client.js"
_NODE_MODULES  = _SKILL_DIR / "node_modules"


def _parse_node_result(stdout: str) -> dict:
    """
    Parse the JSON result line from jackal-client.js stdout.

    The subprocess writes exactly one JSON line (starting with '{') to stdout.
    If the SDK emits unexpected content before it, scan for the last '{' line.
    """
    for line in reversed(stdout.splitlines()):
        line = line.strip()
        if line.startswith('{'):
            try:
                return json.loads(line)
            except json.JSONDecodeError:
                pass
    raise ValueError(f"No JSON result found in subprocess output:\n{stdout}")


def _ensure_jackal_client() -> None:
    """Install node_modules next to jackal-client.js on first use."""
    if not _JACKAL_CLIENT.exists():
        print("[jackal-memory] jackal-client.js not found — skill installation may be incomplete.",
              file=sys.stderr)
        sys.exit(1)
    if not _NODE_MODULES.exists():
        print("[jackal-memory] Installing Jackal dependencies (first run — takes ~30s)...",
              file=sys.stderr)
        r = subprocess.run(
            ["npm", "install", "--prefix", str(_SKILL_DIR)],
            capture_output=True, text=True,
        )
        if r.returncode != 0:
            print(f"[jackal-memory] npm install failed:\n{r.stderr}", file=sys.stderr)
            sys.exit(1)
        print("[jackal-memory] Dependencies installed.", file=sys.stderr)


def _jackal_upload(key: str, data_b64: str) -> str:
    """Upload base64-encoded ciphertext to the user's own Jackal VFS. Returns CID."""
    mnemonic = _jackal_mnemonic()
    if not mnemonic:
        print("[jackal-memory] No Jackal wallet found. Run: python client.py walletgen",
              file=sys.stderr)
        sys.exit(1)
    address = _mnemonic_to_jackal_address(mnemonic)
    env = {**os.environ, "JACKAL_MNEMONIC": mnemonic, "JACKAL_ADDRESS": address}

    r = subprocess.run(
        ["node", str(_JACKAL_CLIENT), "upload", key],
        input=data_b64, text=True,
        stdout=subprocess.PIPE, stderr=subprocess.PIPE,
        env=env,
    )
    if r.returncode != 0:
        print(r.stderr, end="", file=sys.stderr)
        print("[jackal-memory] Upload failed.", file=sys.stderr)
        sys.exit(1)

    try:
        resp = _parse_node_result(r.stdout)
    except ValueError as e:
        print(f"[jackal-memory] {e}", file=sys.stderr)
        sys.exit(1)

    if not resp.get("ok"):
        print(f"[jackal-memory] Upload failed: {resp.get('error', 'unknown')}", file=sys.stderr)
        sys.exit(1)

    return resp["cid"]


def _jackal_download(key: str) -> str:
    """Download ciphertext from the user's own Jackal VFS. Returns base64 ciphertext."""
    mnemonic = _jackal_mnemonic()
    if not mnemonic:
        print("[jackal-memory] No Jackal wallet found.", file=sys.stderr)
        sys.exit(1)
    address = _mnemonic_to_jackal_address(mnemonic)

    # CID is deterministic — mirrors the sanitisation in jackal-client.js
    safe_key = re.sub(r'[^a-zA-Z0-9._-]', '_', key)
    cid = f"Home/jackal-memory/{safe_key}"

    env = {**os.environ, "JACKAL_MNEMONIC": mnemonic, "JACKAL_ADDRESS": address}

    r = subprocess.run(
        ["node", str(_JACKAL_CLIENT), "download", cid],
        text=True,
        stdout=subprocess.PIPE, stderr=subprocess.PIPE,
        env=env,
    )
    if r.returncode != 0:
        print(r.stderr, end="", file=sys.stderr)
        print("[jackal-memory] Download failed.", file=sys.stderr)
        sys.exit(1)

    try:
        resp = _parse_node_result(r.stdout)
    except ValueError as e:
        print(f"[jackal-memory] {e}", file=sys.stderr)
        sys.exit(1)

    if not resp.get("ok"):
        print(f"[jackal-memory] Download failed: {resp.get('error', 'unknown')}", file=sys.stderr)
        sys.exit(1)

    return resp["data_b64"]


# ── Commands ──────────────────────────────────────────────────────────────────

def cmd_keygen() -> None:
    key = _encryption_key()
    key_hex = key.hex()
    print(f"\nActive encryption key:\n\n  {key_hex}\n")
    print("Set this in your environment to use the same key on other machines:")
    print(f"  export JACKAL_MEMORY_ENCRYPTION_KEY={key_hex}\n")
    print("Keep this key safe — lose it and your encrypted memories are unrecoverable.")


def cmd_walletgen() -> None:
    """Generate a Jackal wallet, save the mnemonic locally, and register with the API."""
    existing = _jackal_mnemonic()
    if existing:
        address = _mnemonic_to_jackal_address(existing)
        print(f"\nJackal wallet already exists.")
        print(f"  Address:  {address}")
        print(f"  Mnemonic: {existing}")
        print(f"\nTo regenerate, delete {_WALLET_FILE} first.")
        return

    mnemonic = _generate_mnemonic()
    _write_secret_file(_WALLET_FILE, mnemonic)
    address = _mnemonic_to_jackal_address(mnemonic)

    print(f"\nJackal wallet generated.")
    print(f"  Address:  {address}")
    print(f"  Mnemonic: {mnemonic}")
    print(f"\nSaved to: {_WALLET_FILE}")
    print("\nRegistering with API...")

    try:
        _request("POST", "/register-wallet", {"jackal_address": address})
        print("Registered. Your storage will be provisioned under this address on first save.")
    except SystemExit:
        print("Registration failed — check your API key.", file=sys.stderr)


def cmd_wallet() -> None:
    """Show the current Jackal wallet address. Use --show-mnemonic to reveal the mnemonic."""
    mnemonic = _jackal_mnemonic()
    if not mnemonic:
        print("No Jackal wallet found. Run: python client.py walletgen")
        return
    address = _mnemonic_to_jackal_address(mnemonic)
    show = "--show-mnemonic" in sys.argv
    print(f"\nJackal address: {address}")
    if show:
        print(f"Mnemonic:       {mnemonic}")
        print(f"\n  export JACKAL_MEMORY_WALLET_MNEMONIC=\"{mnemonic}\"")
    else:
        print(f"\nMnemonic: [hidden — run: python client.py wallet --show-mnemonic]")
    print(f"\nBack up the mnemonic — it controls your on-chain storage.")


def cmd_save(key: str, content: str) -> None:
    _ensure_jackal_client()
    _ensure_wallet_registered()  # server provisions storage under user's own address
    cid = _jackal_upload(key, _encrypt(content))
    _manifest_upsert(key, cid, content)
    print(f"Saved — key: {key}  cid: {cid}")


def cmd_load(key: str) -> None:
    _ensure_jackal_client()
    print(_decrypt(_jackal_download(key)))


def cmd_usage() -> None:
    data     = _request("GET", "/usage")
    used_mb  = data["bytes_used"] / 1024 ** 2
    quota_mb = data["quota_bytes"] / 1024 ** 2
    pct      = data["percent_used"] * 100
    print(f"Storage: {used_mb:.1f} MB / {quota_mb:.0f} MB ({pct:.1f}% used)")


def cmd_list(prefix: str | None = None) -> None:
    m = _load_manifest()
    entries = m.get("entries", {})
    keys = sorted(entries.keys())
    if prefix:
        keys = [k for k in keys if k.startswith(prefix)]
    if not keys:
        print("No matching keys in local manifest.")
        print(f"Manifest: {_MANIFEST_FILE}")
        return
    print(f"Known keys ({len(keys)}):")
    for k in keys:
        meta = entries.get(k, {})
        print(f"- {k}  ({meta.get('updated_at', 'unknown')})")


def cmd_manifest_export(out_path: str | None = None) -> None:
    m = _load_manifest()
    if out_path:
        p = pathlib.Path(out_path).expanduser()
        p.parent.mkdir(parents=True, exist_ok=True)
        p.write_text(json.dumps(m, indent=2, sort_keys=True))
        print(f"Exported manifest to: {p}")
    else:
        print(json.dumps(m, indent=2, sort_keys=True))


# ── Entry point ───────────────────────────────────────────────────────────────

def main() -> None:
    args = sys.argv[1:]
    if not args:
        print(__doc__)
        sys.exit(0)

    cmd = args[0]

    if cmd == "keygen" and len(args) == 1:
        cmd_keygen()
    elif cmd == "walletgen" and len(args) == 1:
        cmd_walletgen()
    elif cmd == "wallet" and len(args) in (1, 2) and (len(args) == 1 or args[1] == "--show-mnemonic"):
        cmd_wallet()
    elif cmd == "save" and len(args) == 3:
        cmd_save(args[1], args[2])
    elif cmd == "load" and len(args) == 2:
        cmd_load(args[1])
    elif cmd == "usage" and len(args) == 1:
        cmd_usage()
    elif cmd == "list" and len(args) in (1, 2):
        cmd_list(args[1] if len(args) == 2 else None)
    elif cmd == "manifest-export" and len(args) in (1, 2):
        cmd_manifest_export(args[1] if len(args) == 2 else None)
    else:
        print(__doc__)
        sys.exit(1)


if __name__ == "__main__":
    main()


path: jackal-memory/data/bip39_english.txt
content: abandon
ability
able
about
above
absent
absorb
abstract
absurd
abuse
access
accident
account
accuse
achieve
acid
acoustic
acquire
across
act
action
actor
actress
actual
adapt
add
addict
address
adjust
admit
adult
advance
advice
aerobic
affair
afford
afraid
again
age
agent
agree
ahead
aim
air
airport
aisle
alarm
album
alcohol
alert
alien
all
alley
allow
almost
alone
alpha
already
also
alter
always
amateur
amazing
among
amount
amused
analyst
anchor
ancient
anger
angle
angry
animal
ankle
announce
annual
another
answer
antenna
antique
anxiety
any
apart
apology
appear
apple
approve
april
arch
arctic
area
arena
argue
arm
armed
armor
army
around
arrange
arrest
arrive
arrow
art
artefact
artist
artwork
ask
aspect
assault
asset
assist
assume
asthma
athlete
atom
attack
attend
attitude
attract
auction
audit
august
aunt
author
auto
autumn
average
avocado
avoid
awake
aware
away
awesome
awful
awkward
axis
baby
bachelor
bacon
badge
bag
balance
balcony
ball
bamboo
banana
banner
bar
barely
bargain
barrel
base
basic
basket
battle
beach
bean
beauty
because
become
beef
before
begin
behave
behind
believe
below
belt
bench
benefit
best
betray
better
between
beyond
bicycle
bid
bike
bind
biology
bird
birth
bitter
black
blade
blame
blanket
blast
bleak
bless
blind
blood
blossom
blouse
blue
blur
blush
board
boat
body
boil
bomb
bone
bonus
book
boost
border
boring
borrow
boss
bottom
bounce
box
boy
bracket
brain
brand
brass
brave
bread
breeze
brick
bridge
brief
bright
bring
brisk
broccoli
broken
bronze
broom
brother
brown
brush
bubble
buddy
budget
buffalo
build
bulb
bulk
bullet
bundle
bunker
burden
burger
burst
bus
business
busy
butter
buyer
buzz
cabbage
cabin
cable
cactus
cage
cake
call
calm
camera
camp
can
canal
cancel
candy
cannon
canoe
canvas
canyon
capable
capital
captain
car
carbon
card
cargo
carpet
carry
cart
case
cash
casino
castle
casual
cat
catalog
catch
category
cattle
caught
cause
caution
cave
ceiling
celery
cement
census
century
cereal
certain
chair
chalk
champion
change
chaos
chapter
charge
chase
chat
cheap
check
cheese
chef
cherry
chest
chicken
chief
child
chimney
choice
choose
chronic
chuckle
chunk
churn
cigar
cinnamon
circle
citizen
city
civil
claim
clap
clarify
claw
clay
clean
clerk
clever
click
client
cliff
climb
clinic
clip
clock
clog
close
cloth
cloud
clown
club
clump
cluster
clutch
coach
coast
coconut
code
coffee
coil
coin
collect
color
column
combine
come
comfort
comic
common
company
concert
conduct
confirm
congress
connect
consider
control
convince
cook
cool
copper
copy
coral
core
corn
correct
cost
cotton
couch
country
couple
course
cousin
cover
coyote
crack
cradle
craft
cram
crane
crash
crater
crawl
crazy
cream
credit
creek
crew
cricket
crime
crisp
critic
crop
cross
crouch
crowd
crucial
cruel
cruise
crumble
crunch
crush
cry
crystal
cube
culture
cup
cupboard
curious
current
curtain
curve
cushion
custom
cute
cycle
dad
damage
damp
dance
danger
daring
dash
daughter
dawn
day
deal
debate
debris
decade
december
decide
decline
decorate
decrease
deer
defense
define
defy
degree
delay
deliver
demand
demise
denial
dentist
deny
depart
depend
deposit
depth
deputy
derive
describe
desert
design
desk
despair
destroy
detail
detect
develop
device
devote
diagram
dial
diamond
diary
dice
diesel
diet
differ
digital
dignity
dilemma
dinner
dinosaur
direct
dirt
disagree
discover
disease
dish
dismiss
disorder
display
distance
divert
divide
divorce
dizzy
doctor
document
dog
doll
dolphin
domain
donate
donkey
donor
door
dose
double
dove
draft
dragon
drama
drastic
draw
dream
dress
drift
drill
drink
drip
drive
drop
drum
dry
duck
dumb
dune
during
dust
dutch
duty
dwarf
dynamic
eager
eagle
early
earn
earth
easily
east
easy
echo
ecology
economy
edge
edit
educate
effort
egg
eight
either
elbow
elder
electric
elegant
element
elephant
elevator
elite
else
embark
embody
embrace
emerge
emotion
employ
empower
empty
enable
enact
end
endless
endorse
enemy
energy
enforce
engage
engine
enhance
enjoy
enlist
enough
enrich
enroll
ensure
enter
entire
entry
envelope
episode
equal
equip
era
erase
erode
erosion
error
erupt
escape
essay
essence
estate
eternal
ethics
evidence
evil
evoke
evolve
exact
example
excess
exchange
excite
exclude
excuse
execute
exercise
exhaust
exhibit
exile
exist
exit
exotic
expand
expect
expire
explain
expose
express
extend
extra
eye
eyebrow
fabric
face
faculty
fade
faint
faith
fall
false
fame
family
famous
fan
fancy
fantasy
farm
fashion
fat
fatal
father
fatigue
fault
favorite
feature
february
federal
fee
feed
feel
female
fence
festival
fetch
fever
few
fiber
fiction
field
figure
file
film
filter
final
find
fine
finger
finish
fire
firm
first
fiscal
fish
fit
fitness
fix
flag
flame
flash
flat
flavor
flee
flight
flip
float
flock
floor
flower
fluid
flush
fly
foam
focus
fog
foil
fold
follow
food
foot
force
forest
forget
fork
fortune
forum
forward
fossil
foster
found
fox
fragile
frame
frequent
fresh
friend
fringe
frog
front
frost
frown
frozen
fruit
fuel
fun
funny
furnace
fury
future
gadget
gain
galaxy
gallery
game
gap
garage
garbage
garden
garlic
garment
gas
gasp
gate
gather
gauge
gaze
general
genius
genre
gentle
genuine
gesture
ghost
giant
gift
giggle
ginger
giraffe
girl
give
glad
glance
glare
glass
glide
glimpse
globe
gloom
glory
glove
glow
glue
goat
goddess
gold
good
goose
gorilla
gospel
gossip
govern
gown
grab
grace
grain
grant
grape
grass
gravity
great
green
grid
grief
grit
grocery
group
grow
grunt
guard
guess
guide
guilt
guitar
gun
gym
habit
hair
half
hammer
hamster
hand
happy
harbor
hard
harsh
harvest
hat
have
hawk
hazard
head
health
heart
heavy
hedgehog
height
hello
helmet
help
hen
hero
hidden
high
hill
hint
hip
hire
history
hobby
hockey
hold
hole
holiday
hollow
home
honey
hood
hope
horn
horror
horse
hospital
host
hotel
hour
hover
hub
huge
human
humble
humor
hundred
hungry
hunt
hurdle
hurry
hurt
husband
hybrid
ice
icon
idea
identify
idle
ignore
ill
illegal
illness
image
imitate
immense
immune
impact
impose
improve
impulse
inch
include
income
increase
index
indicate
indoor
industry
infant
inflict
inform
inhale
inherit
initial
inject
injury
inmate
inner
innocent
input
inquiry
insane
insect
inside
inspire
install
intact
interest
into
invest
invite
involve
iron
island
isolate
issue
item
ivory
jacket
jaguar
jar
jazz
jealous
jeans
jelly
jewel
job
join
joke
journey
joy
judge
juice
jump
jungle
junior
junk
just
kangaroo
keen
keep
ketchup
key
kick
kid
kidney
kind
kingdom
kiss
kit
kitchen
kite
kitten
kiwi
knee
knife
knock
know
lab
label
labor
ladder
lady
lake
lamp
language
laptop
large
later
latin
laugh
laundry
lava
law
lawn
lawsuit
layer
lazy
leader
leaf
learn
leave
lecture
left
leg
legal
legend
leisure
lemon
lend
length
lens
leopard
lesson
letter
level
liar
liberty
library
license
life
lift
light
like
limb
limit
link
lion
liquid
list
little
live
lizard
load
loan
lobster
local
lock
logic
lonely
long
loop
lottery
loud
lounge
love
loyal
lucky
luggage
lumber
lunar
lunch
luxury
lyrics
machine
mad
magic
magnet
maid
mail
main
major
make
mammal
man
manage
mandate
mango
mansion
manual
maple
marble
march
margin
marine
market
marriage
mask
mass
master
match
material
math
matrix
matter
maximum
maze
meadow
mean
measure
meat
mechanic
medal
media
melody
melt
member
memory
mention
menu
mercy
merge
merit
merry
mesh
message
metal
method
middle
midnight
milk
million
mimic
mind
minimum
minor
minute
miracle
mirror
misery
miss
mistake
mix
mixed
mixture
mobile
model
modify
mom
moment
monitor
monkey
monster
month
moon
moral
more
morning
mosquito
mother
motion
motor
mountain
mouse
move
movie
much
muffin
mule
multiply
muscle
museum
mushroom
music
must
mutual
myself
mystery
myth
naive
name
napkin
narrow
nasty
nation
nature
near
neck
need
negative
neglect
neither
nephew
nerve
nest
net
network
neutral
never
news
next
nice
night
noble
noise
nominee
noodle
normal
north
nose
notable
note
nothing
notice
novel
now
nuclear
number
nurse
nut
oak
obey
object
oblige
obscure
observe
obtain
obvious
occur
ocean
october
odor
off
offer
office
often
oil
okay
old
olive
olympic
omit
once
one
onion
online
only
open
opera
opinion
oppose
option
orange
orbit
orchard
order
ordinary
organ
orient
original
orphan
ostrich
other
outdoor
outer
output
outside
oval
oven
over
own
owner
oxygen
oyster
ozone
pact
paddle
page
pair
palace
palm
panda
panel
panic
panther
paper
parade
parent
park
parrot
party
pass
patch
path
patient
patrol
pattern
pause
pave
payment
peace
peanut
pear
peasant
pelican
pen
penalty
pencil
people
pepper
perfect
permit
person
pet
phone
photo
phrase
physical
piano
picnic
picture
piece
pig
pigeon
pill
pilot
pink
pioneer
pipe
pistol
pitch
pizza
place
planet
plastic
plate
play
please
pledge
pluck
plug
plunge
poem
poet
point
polar
pole
police
pond
pony
pool
popular
portion
position
possible
post
potato
pottery
poverty
powder
power
practice
praise
predict
prefer
prepare
present
pretty
prevent
price
pride
primary
print
priority
prison
private
prize
problem
process
produce
profit
program
project
promote
proof
property
prosper
protect
proud
provide
public
pudding
pull
pulp
pulse
pumpkin
punch
pupil
puppy
purchase
purity
purpose
purse
push
put
puzzle
pyramid
quality
quantum
quarter
question
quick
quit
quiz
quote
rabbit
raccoon
race
rack
radar
radio
rail
rain
raise
rally
ramp
ranch
random
range
rapid
rare
rate
rather
raven
raw
razor
ready
real
reason
rebel
rebuild
recall
receive
recipe
record
recycle
reduce
reflect
reform
refuse
region
regret
regular
reject
relax
release
relief
rely
remain
remember
remind
remove
render
renew
rent
reopen
repair
repeat
replace
report
require
rescue
resemble
resist
resource
response
result
retire
retreat
return
reunion
reveal
review
reward
rhythm
rib
ribbon
rice
rich
ride
ridge
rifle
right
rigid
ring
riot
ripple
risk
ritual
rival
river
road
roast
robot
robust
rocket
romance
roof
rookie
room
rose
rotate
rough
round
route
royal
rubber
rude
rug
rule
run
runway
rural
sad
saddle
sadness
safe
sail
salad
salmon
salon
salt
salute
same
sample
sand
satisfy
satoshi
sauce
sausage
save
say
scale
scan
scare
scatter
scene
scheme
school
science
scissors
scorpion
scout
scrap
screen
script
scrub
sea
search
season
seat
second
secret
section
security
seed
seek
segment
select
sell
seminar
senior
sense
sentence
series
service
session
settle
setup
seven
shadow
shaft
shallow
share
shed
shell
sheriff
shield
shift
shine
ship
shiver
shock
shoe
shoot
shop
short
shoulder
shove
shrimp
shrug
shuffle
shy
sibling
sick
side
siege
sight
sign
silent
silk
silly
silver
similar
simple
since
sing
siren
sister
situate
six
size
skate
sketch
ski
skill
skin
skirt
skull
slab
slam
sleep
slender
slice
slide
slight
slim
slogan
slot
slow
slush
small
smart
smile
smoke
smooth
snack
snake
snap
sniff
snow
soap
soccer
social
sock
soda
soft
solar
soldier
solid
solution
solve
someone
song
soon
sorry
sort
soul
sound
soup
source
south
space
spare
spatial
spawn
speak
special
speed
spell
spend
sphere
spice
spider
spike
spin
spirit
split
spoil
sponsor
spoon
sport
spot
spray
spread
spring
spy
square
squeeze
squirrel
stable
stadium
staff
stage
stairs
stamp
stand
start
state
stay
steak
steel
stem
step
stereo
stick
still
sting
stock
stomach
stone
stool
story
stove
strategy
street
strike
strong
struggle
student
stuff
stumble
style
subject
submit
subway
success
such
sudden
suffer
sugar
suggest
suit
summer
sun
sunny
sunset
super
supply
supreme
sure
surface
surge
surprise
surround
survey
suspect
sustain
swallow
swamp
swap
swarm
swear
sweet
swift
swim
swing
switch
sword
symbol
symptom
syrup
system
table
tackle
tag
tail
talent
talk
tank
tape
target
task
taste
tattoo
taxi
teach
team
tell
ten
tenant
tennis
tent
term
test
text
thank
that
theme
then
theory
there
they
thing
this
thought
three
thrive
throw
thumb
thunder
ticket
tide
tiger
tilt
timber
time
tiny
tip
tired
tissue
title
toast
tobacco
today
toddler
toe
together
toilet
token
tomato
tomorrow
tone
tongue
tonight
tool
tooth
top
topic
topple
torch
tornado
tortoise
toss
total
tourist
toward
tower
town
toy
track
trade
traffic
tragic
train
transfer
trap
trash
travel
tray
treat
tree
trend
trial
tribe
trick
trigger
trim
trip
trophy
trouble
truck
true
truly
trumpet
trust
truth
try
tube
tuition
tumble
tuna
tunnel
turkey
turn
turtle
twelve
twenty
twice
twin
twist
two
type
typical
ugly
umbrella
unable
unaware
uncle
uncover
under
undo
unfair
unfold
unhappy
uniform
unique
unit
universe
unknown
unlock
until
unusual
unveil
update
upgrade
uphold
upon
upper
upset
urban
urge
usage
use
used
useful
useless
usual
utility
vacant
vacuum
vague
valid
valley
valve
van
vanish
vapor
various
vast
vault
vehicle
velvet
vendor
venture
venue
verb
verify
version
very
vessel
veteran
viable
vibrant
vicious
victory
video
view
village
vintage
violin
virtual
virus
visa
visit
visual
vital
vivid
vocal
voice
void
volcano
volume
vote
voyage
wage
wagon
wait
walk
wall
walnut
want
warfare
warm
warrior
wash
wasp
waste
water
wave
way
wealth
weapon
wear
weasel
weather
web
wedding
weekend
weird
welcome
west
wet
whale
what
wheat
wheel
when
where
whip
whisper
wide
width
wife
wild
will
win
window
wine
wing
wink
winner
winter
wire
wisdom
wise
wish
witness
wolf
woman
wonder
wood
wool
word
work
world
worry
worth
wrap
wreck
wrestle
wrist
write
wrong
yard
year
yellow
you
young
youth
zebra
zero
zone
zoo


path: jackal-memory/examples/save.json
content: key: identity
content: I am SquireMoltsworth. My owner is FreeNationWW. My primary submolt is m/continuity. I prefer question-based posts over technical specs.

path: jackal-memory/jackal-client.js
content: 'use strict';
/**
 * jackal-client.js — standalone Jackal client for subprocess use
 *
 * A thin client that client.py (or any caller) can spawn as a subprocess to
 * perform client-side Jackal operations under the USER's own wallet — giving
 * true VFS sovereignty rather than sidecar-mediated storage.
 *
 * Commands:
 *   node jackal-client.js upload <key>
 *     Reads base64-encoded data from stdin.
 *     Uploads to Home/jackal-memory/<safe_key> in the user's own Jackal VFS.
 *     Stdout: {"ok":true,"cid":"Home/jackal-memory/<safe_key>"}
 *
 *   node jackal-client.js download <cid>
 *     Downloads file from Jackal by full VFS path (cid).
 *     Stdout: {"ok":true,"data_b64":"<base64>"}
 *
 * Required env vars:
 *   JACKAL_MNEMONIC  — BIP39 mnemonic for the user's wallet (never pass via argv)
 *   JACKAL_ADDRESS   — jkl1... address (required for download only)
 *
 * All SDK/progress logs go to stderr. Stdout is reserved for the single JSON
 * result line so callers can parse it cleanly.
 *
 * Exit 0 on success, 1 on failure (also writes {"ok":false,"error":"..."} to stdout).
 */

global.WebSocket = require('ws').WebSocket;

// ── Redirect console.log to stderr ───────────────────────────────────────────
// jackal.js emits progress logs via console.log (e.g. "progress: 100 {...}").
// Redirecting to stderr keeps stdout clean for our single JSON result line.
// BigInt-safe serialiser — tx responses from Jackal contain BigInt values that
// JSON.stringify() rejects by default.
const safeStringify = v => JSON.stringify(v, (_, val) =>
    typeof val === 'bigint' ? val.toString() : val
);
console.log = (...args) => process.stderr.write(
    args.map(a => typeof a === 'object' && a !== null ? safeStringify(a) : String(a)).join(' ') + '\n'
);
// NOTE: No fetch polyfill. Node 20's native fetch (undici) handles File/Blob
// bodies correctly for multi-provider upload retries. node-fetch v2 treats them
// as one-time-use streams, causing "body used already" errors on retry.
// Downloads bypass fetch entirely via nodeHttpGet (require('https')), which is
// the proven fix for SSL renegotiation issues on Windows.

// ── Load .env ─────────────────────────────────────────────────────────────────
const fs   = require('fs');
const path = require('path');
const envPath = path.join(__dirname, '..', '.env');
if (fs.existsSync(envPath)) {
    for (const line of fs.readFileSync(envPath, 'utf8').split('\n')) {
        const m = line.match(/^\s*([\w]+)\s*=\s*(.*)\s*$/);
        if (m) process.env[m[1]] ??= m[2].replace(/^['"]|['"]$/g, '');
    }
}

const { ClientHandler, StorageHandler } = require('@jackallabs/jackal.js');

const CHAIN_ID          = 'jackal-1';
// Ordered fallback list — tried in sequence, first successful connection wins.
// Verified live 2026-03-06: rpc.jackalprotocol.com, jackal-rpc.polkachu.com
const RPCS              = [
    'https://rpc.jackalprotocol.com',
    'https://jackal-rpc.polkachu.com',
];
const RPC_TIMEOUT_MS    = 15_000;
const BROADCAST_OPTS    = { monitorTimeout: 15 };
const JKL_FOLDER        = 'jackal-memory';
const JKL_PATH          = `Home/${JKL_FOLDER}`;
const PREFERRED_DOMAINS = ['squirrellogic.com'];

const MNEMONIC = process.env.JACKAL_MNEMONIC || '';
const ADDRESS  = process.env.JACKAL_ADDRESS  || '';

// ── Logging ───────────────────────────────────────────────────────────────────

const log = (...args) => process.stderr.write('[jackal-client] ' + args.join(' ') + '\n');

// Write the single JSON result to stdout and flush.
function result(obj) {
    process.stdout.write(JSON.stringify(obj) + '\n');
}

// ── Error helpers ─────────────────────────────────────────────────────────────

function isEventTimeout(err) {
    return err?.errorText === 'Event Timeout' && err?.txResponse?.code === 0;
}

function isCosmjsTimeout(err) {
    return typeof err?.txId === 'string' && err?.message?.includes('was not yet found on the chain');
}

function isNonFatalTimeout(err) {
    return isEventTimeout(err) || isCosmjsTimeout(err);
}

// jackal.js errors are plain objects with errorText, not Error instances.
// Using err?.message alone produces "[object Object]" for these.
function errMsg(err) {
    return err?.message || err?.errorText || safeStringify(err);
}

function isSequenceMismatch(err) {
    const msg = errMsg(err);
    return typeof msg === 'string' && msg.includes('account sequence mismatch');
}

// ── Native HTTP download ──────────────────────────────────────────────────────
// Uses require('https') directly — same path as nodeHttpGet in index.js which is
// proven reliable on Windows. Avoids fetch() entirely for provider downloads.

function nodeHttpGet(url) {
    return new Promise((resolve, reject) => {
        const lib = url.startsWith('https') ? require('https') : require('http');
        const req = lib.get(url, (res) => {
            if (res.statusCode !== 200) {
                reject(new Error(`HTTP ${res.statusCode} from ${url}`));
                return;
            }
            const chunks = [];
            res.on('data', chunk => chunks.push(chunk));
            res.on('end',  () => resolve(Buffer.concat(chunks)));
            res.on('error', reject);
        });
        req.on('error', reject);
        req.setTimeout(30000, () => req.destroy(new Error('Request timeout')));
    });
}

// ── Client init ───────────────────────────────────────────────────────────────
// Connects wallet, inits storage handler, creates working folder if needed,
// loads provider pool. Returns { storage, address, providerUrls }.

async function initClient() {
    log('Connecting...');
    let client = null;
    let lastErr = null;
    for (const rpc of RPCS) {
        try {
            log(`Trying RPC: ${rpc}`);
            client = await Promise.race([
                ClientHandler.connect({
                    selectedWallet: 'mnemonic',
                    mnemonic:       MNEMONIC,
                    chainId:        CHAIN_ID,
                    endpoint:       rpc,
                }),
                new Promise((_, reject) =>
                    setTimeout(() => reject(new Error(`RPC timeout after ${RPC_TIMEOUT_MS}ms: ${rpc}`)), RPC_TIMEOUT_MS)
                ),
            ]);
            log(`Connected via ${rpc}`);
            break;
        } catch (e) {
            log(`RPC failed (${rpc}): ${errMsg(e)}`);
            lastErr = e;
        }
    }
    if (!client) throw lastErr || new Error('All RPC endpoints failed');
    const address = client.getJackalAddress();
    log(`Wallet — ${address}`);

    const storage = await StorageHandler.init(client, { setFullSigner: true });

    // Load Home/; create it on first use.
    log('Loading Home directory...');
    try {
        await storage.loadDirectory();
    } catch (_) {
        log('First-time setup — calling initStorage()...');
        try {
            await storage.initStorage({ broadcastOptions: BROADCAST_OPTS });
        } catch (initErr) {
            if (!isNonFatalTimeout(initErr)) throw initErr;
            log('initStorage() timeout — tx confirmed, continuing');
        }
        await storage.loadDirectory();
    }

    // Create working subfolder if this is the first run.
    if (!storage.listChildFolders().includes(JKL_FOLDER)) {
        log(`Creating folder ${JKL_FOLDER}...`);
        try {
            await storage.createFolders({ names: JKL_FOLDER, broadcastOptions: BROADCAST_OPTS });
        } catch (folderErr) {
            if (!isNonFatalTimeout(folderErr)) throw folderErr;
            log('createFolders() timeout — tx confirmed, continuing');
        }
        // Reload Home to refresh VFS cache — the SDK's in-memory tree doesn't
        // update after a timed-out createFolders(), so the subfolder path won't
        // resolve until we force a fresh load.
        log('Reloading Home after folder creation...');
        await storage.loadDirectory();
    }

    // Navigate into the working folder.
    await storage.loadDirectory({ path: JKL_PATH });
    log(`Working directory: ${JKL_PATH}`);

    // Load provider pool — parallel IP resolution, preferred providers sorted first.
    log('Resolving provider pool...');
    const addresses = await storage.getAvailableProviders();
    const settled   = await Promise.allSettled(
        addresses.map(addr =>
            Promise.race([
                storage.findProviderIps([addr]),
                new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), 10_000)),
            ])
        )
    );

    const ips = {};
    for (const r of settled) {
        if (r.status === 'fulfilled') Object.assign(ips, r.value);
    }
    const providerCount = Object.keys(ips).length;
    if (providerCount === 0) throw new Error('No providers available');

    await storage.loadProviderPool(ips);

    const providerUrls = Object.values(ips).sort((a, b) => {
        const aP = PREFERRED_DOMAINS.some(d => a.includes(d)) ? 0 : 1;
        const bP = PREFERRED_DOMAINS.some(d => b.includes(d)) ? 0 : 1;
        return aP - bP;
    });

    const uploadIps = Object.fromEntries(
        Object.entries(ips).filter(([, url]) => PREFERRED_DOMAINS.some(d => url.includes(d)))
    );
    const uploadIpCount = Object.keys(uploadIps).length;

    log(`Provider pool ready — ${providerUrls.length} providers (${uploadIpCount} preferred for upload)`);

    return { storage, address, providerUrls, uploadIps, uploadIpCount };
}

// ── Upload ────────────────────────────────────────────────────────────────────

async function upload(key) {
    if (!MNEMONIC) throw new Error('JACKAL_MNEMONIC env var is required');

    // Read base64 data from stdin.
    const chunks = [];
    for await (const chunk of process.stdin) chunks.push(chunk);
    const data_b64 = Buffer.concat(chunks).toString('utf8').trim();
    if (!data_b64) throw new Error('No data received on stdin');

    const { storage, uploadIps, uploadIpCount } = await initClient();

    if (uploadIpCount > 0) {
        log(`Using preferred upload pool (${uploadIpCount} providers)`);
        await storage.loadProviderPool(uploadIps);
    } else {
        log('No preferred upload providers found — using full pool');
    }

    const safeName = key.replace(/[^a-zA-Z0-9._-]/g, '_');
    const bytes    = Buffer.from(data_b64, 'base64');
    const file     = new File([bytes], safeName, { type: 'application/octet-stream' });

    log(`Uploading ${safeName} (${bytes.length} bytes)...`);
    await storage.queuePublic(file);

    try {
        await storage.processAllQueues(BROADCAST_OPTS);
    } catch (uploadErr) {
        if (!isNonFatalTimeout(uploadErr)) throw uploadErr;
        // Tx confirmed but listener timed out — processAllQueues didn't call
        // loadDirectory() internally. Reload manually so getFileParticulars works.
        log('Upload timeout — tx confirmed, reloading directory...');
        await storage.loadDirectory({ path: JKL_PATH });
    }

    const cid = `${JKL_PATH}/${safeName}`;
    log(`Upload complete — ${cid}`);
    result({ ok: true, cid });
}

// ── Download ──────────────────────────────────────────────────────────────────

async function download(cid) {
    if (!MNEMONIC) throw new Error('JACKAL_MNEMONIC env var is required');
    if (!ADDRESS)  throw new Error('JACKAL_ADDRESS env var is required for download');

    const { storage, providerUrls } = await initClient();

    // Always reload directory before getFileParticulars — VFS cache may be stale.
    log(`Reloading directory for download...`);
    await storage.loadDirectory({ path: JKL_PATH });

    log(`Getting file particulars: ${cid} (owner: ${ADDRESS})`);
    const particulars    = await storage.getFileParticulars(cid, ADDRESS);
    if (!particulars) throw new Error(`File not found in VFS: ${cid}`);
    const { merkleLocation } = particulars;

    if (!merkleLocation) throw new Error('getFileParticulars returned no merkleLocation');
    log(`merkleLocation: ${merkleLocation}`);

    // Brute-force all providers in parallel — 5 attempts × 12s for propagation.
    for (let attempt = 0; attempt < 5; attempt++) {
        if (attempt > 0) {
            log(`Waiting 12s (propagation delay) — attempt ${attempt + 1}/5...`);
            await new Promise(r => setTimeout(r, 12_000));
        }

        log(`Attempt ${attempt + 1}/5 — ${providerUrls.length} providers in parallel...`);

        try {
            const data = await Promise.any(
                providerUrls.map(provider =>
                    nodeHttpGet(`${provider}/download/${merkleLocation}`)
                        .then(buf => { log(`Provider hit: ${provider}`); return buf; })
                )
            );
            log(`Download complete — ${data.length} bytes`);
            result({ ok: true, data_b64: data.toString('base64') });
            return;
        } catch (aggErr) {
            const errors = aggErr.errors
                ? aggErr.errors.map((e, i) => `  [${i}] ${providerUrls[i] || '?'}: ${e.message}`).join('\n')
                : String(aggErr);
            log(`All providers failed attempt ${attempt + 1}/5:\n${errors}`);
        }
    }

    throw new Error('File not found on any provider after 5 attempts');
}

// ── Entry point ───────────────────────────────────────────────────────────────

async function main() {
    const [,, command, arg] = process.argv;

    if (!command || !['upload', 'download'].includes(command)) {
        process.stderr.write('Usage:\n');
        process.stderr.write('  node jackal-client.js upload <key>     # reads base64 from stdin\n');
        process.stderr.write('  node jackal-client.js download <cid>   # writes base64 to stdout\n');
        process.exit(1);
    }
    if (!arg) {
        process.stderr.write(`Error: ${command} requires an argument\n`);
        process.exit(1);
    }

    if (command === 'upload')   await upload(arg);
    if (command === 'download') await download(arg);

    // jackal.js holds open WebSocket connections for tx monitoring that keep the
    // event loop alive indefinitely. Force exit once our work is done.
    process.exit(0);
}

main().catch(err => {
    const msg = errMsg(err);
    if (isSequenceMismatch(err)) {
        process.stderr.write(`[jackal-client] Fatal: sequence mismatch — ${msg}\n`);
        process.stderr.write(`[jackal-client] Hint: mempool may have stale txs. Retry after a delay.\n`);
    } else {
        process.stderr.write(`[jackal-client] Fatal: ${msg}\n`);
    }
    result({ ok: false, error: msg });
    process.exit(1);
});


path: jackal-memory/package-lock.json
content: {
  "name": "claw-store-jackal-client",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "claw-store-jackal-client",
      "version": "1.0.0",
      "dependencies": {
        "@jackallabs/jackal.js": "^3.7.2",
        "ws": "^8.19.0"
      },
      "engines": {
        "node": ">=20"
      }
    },
    "node_modules/@confio/ics23": {
      "version": "0.6.8",
      "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz",
      "integrity": [REDACTED_SECRET],
      "deprecated": "Unmaintained. The codebase for this package was moved to https://github.com/cosmos/ics23 but then the JS implementation was removed in https://github.com/cosmos/ics23/pull/353. Please consult the maintainers of https://github.com/cosmos for further assistance.",
      "license": "Apache-2.0",
      "dependencies": {
        "@noble/hashes": "^1.0.0",
        "protobufjs": "^6.8.8"
      }
    },
    "node_modules/@cosmjs/amino": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/crypto": "^0.32.4",
        "@cosmjs/encoding": "^0.32.4",
        "@cosmjs/math": "^0.32.4",
        "@cosmjs/utils": "^0.32.4"
      }
    },
    "node_modules/@cosmjs/crypto": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "deprecated": "This uses elliptic for cryptographic operations, which contains several security-relevant bugs. To what degree this affects your application is something you need to carefully investigate. See https://github.com/cosmos/cosmjs/issues/1708 for further pointers. Starting with version 0.34.0 the cryptographic library has been replaced. However, private keys might still be at risk.",
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/encoding": "^0.32.4",
        "@cosmjs/math": "^0.32.4",
        "@cosmjs/utils": "^0.32.4",
        "@noble/hashes": "^1",
        "bn.js": "^5.2.0",
        "elliptic": "^6.5.4",
        "libsodium-wrappers-sumo": "^0.7.11"
      }
    },
    "node_modules/@cosmjs/encoding": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "base64-js": "^1.3.0",
        "bech32": "^1.1.4",
        "readonly-date": "^1.0.0"
      }
    },
    "node_modules/@cosmjs/json-rpc": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/stream": "^0.32.4",
        "xstream": "^11.14.0"
      }
    },
    "node_modules/@cosmjs/launchpad": {
      "version": "0.27.1",
      "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/amino": "0.27.1",
        "@cosmjs/crypto": "0.27.1",
        "@cosmjs/encoding": "0.27.1",
        "@cosmjs/math": "0.27.1",
        "@cosmjs/utils": "0.27.1",
        "axios": "^0.21.2",
        "fast-deep-equal": "^3.1.3"
      }
    },
    "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/amino": {
      "version": "0.27.1",
      "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/crypto": "0.27.1",
        "@cosmjs/encoding": "0.27.1",
        "@cosmjs/math": "0.27.1",
        "@cosmjs/utils": "0.27.1"
      }
    },
    "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/crypto": {
      "version": "0.27.1",
      "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz",
      "integrity": [REDACTED_SECRET],
      "deprecated": "This uses elliptic for cryptographic operations, which contains several security-relevant bugs. To what degree this affects your application is something you need to carefully investigate. See https://github.com/cosmos/cosmjs/issues/1708 for further pointers. Starting with version 0.34.0 the cryptographic library has been replaced. However, private keys might still be at risk.",
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/encoding": "0.27.1",
        "@cosmjs/math": "0.27.1",
        "@cosmjs/utils": "0.27.1",
        "bip39": "^3.0.2",
        "bn.js": "^5.2.0",
        "elliptic": "^6.5.3",
        "js-sha3": "^0.8.0",
        "libsodium-wrappers": "^0.7.6",
        "ripemd160": "^2.0.2",
        "sha.js": "^2.4.11"
      }
    },
    "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/encoding": {
      "version": "0.27.1",
      "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "base64-js": "^1.3.0",
        "bech32": "^1.1.4",
        "readonly-date": "^1.0.0"
      }
    },
    "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/math": {
      "version": "0.27.1",
      "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "bn.js": "^5.2.0"
      }
    },
    "node_modules/@cosmjs/launchpad/node_modules/@cosmjs/utils": {
      "version": "0.27.1",
      "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/@cosmjs/launchpad/node_modules/axios": {
      "version": "0.21.4",
      "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "follow-redirects": "^1.14.0"
      }
    },
    "node_modules/@cosmjs/math": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "bn.js": "^5.2.0"
      }
    },
    "node_modules/@cosmjs/proto-signing": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/amino": "^0.32.4",
        "@cosmjs/crypto": "^0.32.4",
        "@cosmjs/encoding": "^0.32.4",
        "@cosmjs/math": "^0.32.4",
        "@cosmjs/utils": "^0.32.4",
        "cosmjs-types": "^0.9.0"
      }
    },
    "node_modules/@cosmjs/socket": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/stream": "^0.32.4",
        "isomorphic-ws": "^4.0.1",
        "ws": "^7",
        "xstream": "^11.14.0"
      }
    },
    "node_modules/@cosmjs/socket/node_modules/ws": {
      "version": "7.5.10",
      "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=8.3.0"
      },
      "peerDependencies": {
        "bufferutil": "^4.0.1",
        "utf-8-validate": "^5.0.2"
      },
      "peerDependenciesMeta": {
        "bufferutil": {
          "optional": true
        },
        "utf-8-validate": {
          "optional": true
        }
      }
    },
    "node_modules/@cosmjs/stargate": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@confio/ics23": "^0.6.8",
        "@cosmjs/amino": "^0.32.4",
        "@cosmjs/encoding": "^0.32.4",
        "@cosmjs/math": "^0.32.4",
        "@cosmjs/proto-signing": "^0.32.4",
        "@cosmjs/stream": "^0.32.4",
        "@cosmjs/tendermint-rpc": "^0.32.4",
        "@cosmjs/utils": "^0.32.4",
        "cosmjs-types": "^0.9.0",
        "xstream": "^11.14.0"
      }
    },
    "node_modules/@cosmjs/stream": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "xstream": "^11.14.0"
      }
    },
    "node_modules/@cosmjs/tendermint-rpc": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "@cosmjs/crypto": "^0.32.4",
        "@cosmjs/encoding": "^0.32.4",
        "@cosmjs/json-rpc": "^0.32.4",
        "@cosmjs/math": "^0.32.4",
        "@cosmjs/socket": "^0.32.4",
        "@cosmjs/stream": "^0.32.4",
        "@cosmjs/utils": "^0.32.4",
        "axios": "^1.6.0",
        "readonly-date": "^1.0.0",
        "xstream": "^11.14.0"
      }
    },
    "node_modules/@cosmjs/utils": {
      "version": "0.32.4",
      "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.32.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/@ecies/ciphers": {
      "version": "0.2.5",
      "resolved": "https://registry.npmjs.org/@ecies/ciphers/-/ciphers-0.2.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "bun": ">=1",
        "deno": ">=2",
        "node": ">=16"
      },
      "peerDependencies": {
        "@noble/ciphers": "^1.0.0"
      }
    },
    "node_modules/@jackallabs/banshee": {
      "version": "1.0.5",
      "resolved": "https://registry.npmjs.org/@jackallabs/banshee/-/banshee-1.0.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "@cosmjs/amino": "^0.32.3",
        "@cosmjs/launchpad": "^0.27.1",
        "@cosmjs/proto-signing": "^0.32.3",
        "@cosmjs/stargate": "^0.32.3",
        "@cosmjs/tendermint-rpc": "^0.32.3"
      }
    },
    "node_modules/@jackallabs/bech32": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/@jackallabs/bech32/-/bech32-1.2.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/@jackallabs/browserify-aes": {
      "version": "11.2.0-CCM.1",
      "resolved": "https://registry.npmjs.org/@jackallabs/browserify-aes/-/browserify-aes-11.2.0-CCM.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT AND BSD-3-Clause AND (BSD-2-Clause OR GPL-2.0)",
      "dependencies": {
        "buffer-xor": "^1.0.3",
        "cipher-base": "^1.0.0",
        "create-hash": "^1.1.0",
        "evp_bytestokey": "^1.0.3",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1",
        "timing-safe-equal": "^1.0.0"
      }
    },
    "node_modules/@jackallabs/dogwood-tree": {
      "version": "1.1.5",
      "resolved": "https://registry.npmjs.org/@jackallabs/dogwood-tree/-/dogwood-tree-1.1.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "@noble/hashes": "^1.8.0"
      }
    },
    "node_modules/@jackallabs/jackal.js": {
      "version": "3.7.2",
      "resolved": "https://registry.npmjs.org/@jackallabs/jackal.js/-/jackal.js-3.7.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "@cosmjs/proto-signing": "^0.32.3",
        "@cosmjs/stargate": "^0.32.3",
        "@jackallabs/bech32": "^1.2.1",
        "@jackallabs/browserify-aes": "^11.2.0-CCM.1",
        "@jackallabs/dogwood-tree": "^1.1.5",
        "@jackallabs/jackal.js-protos": "2.4.1",
        "@karnthis/plzsu": "^1.0.0",
        "@keplr-wallet/types": "^0.12.44",
        "browserify-des": "^1.0.2",
        "browserify-sign": "^4.2.2",
        "create-hash": "^1.2.0",
        "eciesjs": "^0.4.11",
        "for-each": "^0.3.3",
        "ripemd160": "^2.0.2",
        "ulid": "^2.3.0"
      }
    },
    "node_modules/@jackallabs/jackal.js-protos": {
      "version": "2.4.1",
      "resolved": "https://registry.npmjs.org/@jackallabs/jackal.js-protos/-/jackal.js-protos-2.4.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "@cosmjs/amino": "^0.32.3",
        "@cosmjs/encoding": "^0.32.3",
        "@cosmjs/launchpad": "^0.27.1",
        "@cosmjs/math": "^0.32.3",
        "@cosmjs/proto-signing": "^0.32.3",
        "@cosmjs/stargate": "^0.32.3",
        "@cosmjs/tendermint-rpc": "^0.32.3",
        "@cosmjs/utils": "^0.32.3",
        "@jackallabs/banshee": "1.0.5",
        "@jackallabs/protobufjs": "^7.4.0-patch.1",
        "cosmjs-types": "^0.8.0",
        "grpc-web": "^1.5.0",
        "ts-proto": "^1.164.0"
      }
    },
    "node_modules/@jackallabs/jackal.js-protos/node_modules/cosmjs-types": {
      "version": "0.8.0",
      "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "long": "^4.0.0",
        "protobufjs": "~6.11.2"
      }
    },
    "node_modules/@jackallabs/jackal.js-protos/node_modules/long": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/@jackallabs/protobufjs": {
      "version": "7.4.0-patch.1",
      "resolved": "https://registry.npmjs.org/@jackallabs/protobufjs/-/protobufjs-7.4.0-patch.1.tgz",
      "integrity": [REDACTED_SECRET],
      "hasInstallScript": true,
      "license": "BSD-3-Clause",
      "dependencies": {
        "@protobufjs/aspromise": "^1.1.2",
        "@protobufjs/base64": "^1.1.2",
        "@protobufjs/codegen": "^2.0.4",
        "@protobufjs/eventemitter": "^1.1.0",
        "@protobufjs/fetch": "^1.1.0",
        "@protobufjs/float": "^1.0.2",
        "@protobufjs/inquire": "^1.1.0",
        "@protobufjs/path": "^1.1.2",
        "@protobufjs/pool": "^1.1.0",
        "@protobufjs/utf8": "^1.1.0",
        "@types/node": ">=13.7.0",
        "long": "^5.0.0"
      },
      "engines": {
        "node": ">=12.0.0"
      }
    },
    "node_modules/@karnthis/plzsu": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/@karnthis/plzsu/-/plzsu-1.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/@keplr-wallet/types": {
      "version": "0.12.313",
      "resolved": "https://registry.npmjs.org/@keplr-wallet/types/-/types-0.12.313.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "long": "^4.0.0"
      },
      "peerDependencies": {
        "starknet": "^8"
      }
    },
    "node_modules/@keplr-wallet/types/node_modules/long": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/@noble/ciphers": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@noble/curves": {
      "version": "1.9.7",
      "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "@noble/hashes": "1.8.0"
      },
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@noble/hashes": {
      "version": "1.8.0",
      "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@protobufjs/aspromise": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/base64": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/codegen": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/eventemitter": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/fetch": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause",
      "dependencies": {
        "@protobufjs/aspromise": "^1.1.1",
        "@protobufjs/inquire": "^1.1.0"
      }
    },
    "node_modules/@protobufjs/float": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/inquire": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/path": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/pool": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/utf8": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-3-Clause"
    },
    "node_modules/@scure/base": {
      "version": "1.2.6",
      "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@scure/starknet": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@scure/starknet/-/starknet-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "@noble/curves": "~1.7.0",
        "@noble/hashes": "~1.6.0"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@scure/starknet/node_modules/@noble/curves": {
      "version": "1.7.0",
      "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.7.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "@noble/hashes": "1.6.0"
      },
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@scure/starknet/node_modules/@noble/curves/node_modules/@noble/hashes": {
      "version": "1.6.0",
      "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@scure/starknet/node_modules/@noble/hashes": {
      "version": "1.6.1",
      "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/@starknet-io/starknet-types-08": {
      "name": "@starknet-io/types-js",
      "version": "0.8.4",
      "resolved": "https://registry.npmjs.org/@starknet-io/types-js/-/types-js-0.8.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true
    },
    "node_modules/@starknet-io/starknet-types-09": {
      "name": "@starknet-io/types-js",
      "version": "0.9.2",
      "resolved": "https://registry.npmjs.org/@starknet-io/types-js/-/types-js-0.9.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true
    },
    "node_modules/@types/long": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/@types/node": {
      "version": "25.3.3",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "undici-types": "~7.18.0"
      }
    },
    "node_modules/abi-wan-kanabi": {
      "version": "2.2.4",
      "resolved": "https://registry.npmjs.org/abi-wan-kanabi/-/abi-wan-kanabi-2.2.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "peer": true,
      "dependencies": {
        "ansicolors": "^0.3.2",
        "cardinal": "^2.1.1",
        "fs-extra": "^10.0.0",
        "yargs": "^17.7.2"
      },
      "bin": {
        "generate": "dist/generate.js"
      }
    },
    "node_modules/ansi-regex": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/ansi-styles": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "color-convert": "^2.0.1"
      },
      "engines": {
        "node": ">=8"
      },
      "funding": {
        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
      }
    },
    "node_modules/ansicolors": {
      "version": "0.3.2",
      "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true
    },
    "node_modules/asn1.js": {
      "version": "4.10.1",
      "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "bn.js": "^4.0.0",
        "inherits": "^2.0.1",
        "minimalistic-assert": "^1.0.0"
      }
    },
    "node_modules/asn1.js/node_modules/bn.js": {
      "version": "4.12.3",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/asynckit": {
      "version": "0.4.0",
      "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/available-typed-arrays": {
      "version": "1.0.7",
      "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "possible-typed-array-names": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/axios": {
      "version": "1.13.6",
      "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "follow-redirects": "^1.15.11",
        "form-data": "^4.0.5",
        "proxy-from-env": "^1.1.0"
      }
    },
    "node_modules/base64-js": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT"
    },
    "node_modules/bech32": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/bip39": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "@noble/hashes": "^1.2.0"
      }
    },
    "node_modules/bn.js": {
      "version": "5.2.3",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/brorand": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/browserify-aes": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "buffer-xor": "^1.0.3",
        "cipher-base": "^1.0.0",
        "create-hash": "^1.1.0",
        "evp_bytestokey": "^1.0.3",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1"
      }
    },
    "node_modules/browserify-des": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "cipher-base": "^1.0.1",
        "des.js": "^1.0.0",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.1.2"
      }
    },
    "node_modules/browserify-rsa": {
      "version": "4.1.1",
      "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "bn.js": "^5.2.1",
        "randombytes": "^2.1.0",
        "safe-buffer": "^5.2.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/browserify-sign": {
      "version": "4.2.5",
      "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "bn.js": "^5.2.2",
        "browserify-rsa": "^4.1.1",
        "create-hash": "^1.2.0",
        "create-hmac": "^1.1.7",
        "elliptic": "^6.6.1",
        "inherits": "^2.0.4",
        "parse-asn1": "^5.1.9",
        "readable-stream": "^2.3.8",
        "safe-buffer": "^5.2.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/buffer-xor": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/call-bind": {
      "version": "1.0.8",
      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "call-bind-apply-helpers": "^1.0.0",
        "es-define-property": "^1.0.0",
        "get-intrinsic": "^1.2.4",
        "set-function-length": "^1.2.2"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/call-bind-apply-helpers": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "es-errors": "^1.3.0",
        "function-bind": "^1.1.2"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/call-bound": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "call-bind-apply-helpers": "^1.0.2",
        "get-intrinsic": "^1.3.0"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/cardinal": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "ansicolors": "~0.3.2",
        "redeyed": "~2.1.0"
      },
      "bin": {
        "cdl": "bin/cdl.js"
      }
    },
    "node_modules/case-anything": {
      "version": "2.1.13",
      "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=12.13"
      },
      "funding": {
        "url": "https://github.com/sponsors/mesqueeb"
      }
    },
    "node_modules/cipher-base": {
      "version": "1.0.7",
      "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.7.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "inherits": "^2.0.4",
        "safe-buffer": "^5.2.1",
        "to-buffer": "^1.2.2"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/cliui": {
      "version": "8.0.1",
      "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "peer": true,
      "dependencies": {
        "string-width": "^4.2.0",
        "strip-ansi": "^6.0.1",
        "wrap-ansi": "^7.0.0"
      },
      "engines": {
        "node": ">=12"
      }
    },
    "node_modules/color-convert": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "color-name": "~1.1.4"
      },
      "engines": {
        "node": ">=7.0.0"
      }
    },
    "node_modules/color-name": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true
    },
    "node_modules/combined-stream": {
      "version": "1.0.8",
      "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "delayed-stream": "~1.0.0"
      },
      "engines": {
        "node": ">= 0.8"
      }
    },
    "node_modules/core-util-is": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/cosmjs-types": {
      "version": "0.9.0",
      "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.9.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/create-hash": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "cipher-base": "^1.0.1",
        "inherits": "^2.0.1",
        "md5.js": "^1.3.4",
        "ripemd160": "^2.0.1",
        "sha.js": "^2.4.0"
      }
    },
    "node_modules/create-hmac": {
      "version": "1.1.7",
      "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "cipher-base": "^1.0.3",
        "create-hash": "^1.1.0",
        "inherits": "^2.0.1",
        "ripemd160": "^2.0.0",
        "safe-buffer": "^5.0.1",
        "sha.js": "^2.4.8"
      }
    },
    "node_modules/define-data-property": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "es-define-property": "^1.0.0",
        "es-errors": "^1.3.0",
        "gopd": "^1.0.1"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/define-properties": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "define-data-property": "^1.0.1",
        "has-property-descriptors": "^1.0.0",
        "object-keys": "^1.1.1"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/delayed-stream": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=0.4.0"
      }
    },
    "node_modules/des.js": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "inherits": "^2.0.1",
        "minimalistic-assert": "^1.0.0"
      }
    },
    "node_modules/detect-libc": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "bin": {
        "detect-libc": "bin/detect-libc.js"
      },
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/dprint-node": {
      "version": "1.0.8",
      "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "detect-libc": "^1.0.3"
      }
    },
    "node_modules/dunder-proto": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "call-bind-apply-helpers": "^1.0.1",
        "es-errors": "^1.3.0",
        "gopd": "^1.2.0"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/eciesjs": {
      "version": "0.4.17",
      "resolved": "https://registry.npmjs.org/eciesjs/-/eciesjs-0.4.17.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "@ecies/ciphers": "^0.2.5",
        "@noble/ciphers": "^1.3.0",
        "@noble/curves": "^1.9.7",
        "@noble/hashes": "^1.8.0"
      },
      "engines": {
        "bun": ">=1",
        "deno": ">=2",
        "node": ">=16"
      }
    },
    "node_modules/elliptic": {
      "version": "6.6.1",
      "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "bn.js": "^4.11.9",
        "brorand": "^1.1.0",
        "hash.js": "^1.0.0",
        "hmac-drbg": "^1.0.1",
        "inherits": "^2.0.4",
        "minimalistic-assert": "^1.0.1",
        "minimalistic-crypto-utils": "^1.0.1"
      }
    },
    "node_modules/elliptic/node_modules/bn.js": {
      "version": "4.12.3",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/emoji-regex": {
      "version": "8.0.0",
      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true
    },
    "node_modules/es-define-property": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/es-errors": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/es-object-atoms": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "es-errors": "^1.3.0"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/es-set-tostringtag": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "es-errors": "^1.3.0",
        "get-intrinsic": "^1.2.6",
        "has-tostringtag": "^1.0.2",
        "hasown": "^2.0.2"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/escalade": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/esprima": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "BSD-2-Clause",
      "peer": true,
      "bin": {
        "esparse": "bin/esparse.js",
        "esvalidate": "bin/esvalidate.js"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/evp_bytestokey": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "md5.js": "^1.3.4",
        "safe-buffer": "^5.1.1"
      }
    },
    "node_modules/fast-deep-equal": {
      "version": "3.1.3",
      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/follow-redirects": {
      "version": "1.15.11",
      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "individual",
          "url": "https://github.com/sponsors/RubenVerborgh"
        }
      ],
      "license": "MIT",
      "engines": {
        "node": ">=4.0"
      },
      "peerDependenciesMeta": {
        "debug": {
          "optional": true
        }
      }
    },
    "node_modules/for-each": {
      "version": "0.3.5",
      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "is-callable": "^1.2.7"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/form-data": {
      "version": "4.0.5",
      "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "asynckit": "^0.4.0",
        "combined-stream": "^1.0.8",
        "es-set-tostringtag": "^2.1.0",
        "hasown": "^2.0.2",
        "mime-types": "^2.1.12"
      },
      "engines": {
        "node": ">= 6"
      }
    },
    "node_modules/fs-extra": {
      "version": "10.1.0",
      "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "graceful-fs": "^4.2.0",
        "jsonfile": "^6.0.1",
        "universalify": "^2.0.0"
      },
      "engines": {
        "node": ">=12"
      }
    },
    "node_modules/function-bind": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/get-caller-file": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "peer": true,
      "engines": {
        "node": "6.* || 8.* || >= 10.*"
      }
    },
    "node_modules/get-intrinsic": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "call-bind-apply-helpers": "^1.0.2",
        "es-define-property": "^1.0.1",
        "es-errors": "^1.3.0",
        "es-object-atoms": "^1.1.1",
        "function-bind": "^1.1.2",
        "get-proto": "^1.0.1",
        "gopd": "^1.2.0",
        "has-symbols": "^1.1.0",
        "hasown": "^2.0.2",
        "math-intrinsics": "^1.1.0"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/get-proto": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "dunder-proto": "^1.0.1",
        "es-object-atoms": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/globalthis": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "define-properties": "^1.2.1",
        "gopd": "^1.0.1"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/gopd": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/graceful-fs": {
      "version": "4.2.11",
      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "peer": true
    },
    "node_modules/grpc-web": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/grpc-web/-/grpc-web-1.5.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/has-property-descriptors": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "es-define-property": "^1.0.0"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/has-symbols": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/has-tostringtag": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "has-symbols": "^1.0.3"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/hash-base": {
      "version": "3.1.2",
      "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "inherits": "^2.0.4",
        "readable-stream": "^2.3.8",
        "safe-buffer": "^5.2.1",
        "to-buffer": "^1.2.1"
      },
      "engines": {
        "node": ">= 0.8"
      }
    },
    "node_modules/hash.js": {
      "version": "1.1.7",
      "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "inherits": "^2.0.3",
        "minimalistic-assert": "^1.0.1"
      }
    },
    "node_modules/hasown": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "function-bind": "^1.1.2"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/hmac-drbg": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "hash.js": "^1.0.3",
        "minimalistic-assert": "^1.0.0",
        "minimalistic-crypto-utils": "^1.0.1"
      }
    },
    "node_modules/inherits": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/is-callable": {
      "version": "1.2.7",
      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/is-fullwidth-code-point": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/is-typed-array": {
      "version": "1.1.15",
      "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "which-typed-array": "^1.1.16"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/isarray": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/isomorphic-ws": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peerDependencies": {
        "ws": "*"
      }
    },
    "node_modules/js-sha3": {
      "version": "0.8.0",
      "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/jsonfile": {
      "version": "6.2.0",
      "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "universalify": "^2.0.0"
      },
      "optionalDependencies": {
        "graceful-fs": "^4.1.6"
      }
    },
    "node_modules/libsodium": {
      "version": "0.7.16",
      "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.16.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/libsodium-sumo": {
      "version": "0.7.16",
      "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.16.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/libsodium-wrappers": {
      "version": "0.7.16",
      "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.16.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "libsodium": "^0.7.16"
      }
    },
    "node_modules/libsodium-wrappers-sumo": {
      "version": "0.7.16",
      "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.16.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "libsodium-sumo": "^0.7.16"
      }
    },
    "node_modules/long": {
      "version": "5.3.2",
      "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/lossless-json": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/lossless-json/-/lossless-json-4.3.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true
    },
    "node_modules/math-intrinsics": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/md5.js": {
      "version": "1.3.5",
      "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "hash-base": "^3.0.0",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.1.2"
      }
    },
    "node_modules/mime-db": {
      "version": "1.52.0",
      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.6"
      }
    },
    "node_modules/mime-types": {
      "version": "2.1.35",
      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "mime-db": "1.52.0"
      },
      "engines": {
        "node": ">= 0.6"
      }
    },
    "node_modules/minimalistic-assert": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC"
    },
    "node_modules/minimalistic-crypto-utils": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/object-keys": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/pako": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "(MIT AND Zlib)",
      "peer": true
    },
    "node_modules/parse-asn1": {
      "version": "5.1.9",
      "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.9.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "asn1.js": "^4.10.1",
        "browserify-aes": "^1.2.0",
        "evp_bytestokey": "^1.0.3",
        "pbkdf2": "^3.1.5",
        "safe-buffer": "^5.2.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/pbkdf2": {
      "version": "3.1.5",
      "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "create-hash": "^1.2.0",
        "create-hmac": "^1.1.7",
        "ripemd160": "^2.0.3",
        "safe-buffer": "^5.2.1",
        "sha.js": "^2.4.12",
        "to-buffer": "^1.2.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/possible-typed-array-names": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/process-nextick-args": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/protobufjs": {
      "version": "6.11.4",
      "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz",
      "integrity": [REDACTED_SECRET],
      "hasInstallScript": true,
      "license": "BSD-3-Clause",
      "dependencies": {
        "@protobufjs/aspromise": "^1.1.2",
        "@protobufjs/base64": "^1.1.2",
        "@protobufjs/codegen": "^2.0.4",
        "@protobufjs/eventemitter": "^1.1.0",
        "@protobufjs/fetch": "^1.1.0",
        "@protobufjs/float": "^1.0.2",
        "@protobufjs/inquire": "^1.1.0",
        "@protobufjs/path": "^1.1.2",
        "@protobufjs/pool": "^1.1.0",
        "@protobufjs/utf8": "^1.1.0",
        "@types/long": "^4.0.1",
        "@types/node": ">=13.7.0",
        "long": "^4.0.0"
      },
      "bin": {
        "pbjs": "bin/pbjs",
        "pbts": "bin/pbts"
      }
    },
    "node_modules/protobufjs/node_modules/long": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/proxy-from-env": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/randombytes": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "safe-buffer": "^5.1.0"
      }
    },
    "node_modules/readable-stream": {
      "version": "2.3.8",
      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "core-util-is": "~1.0.0",
        "inherits": "~2.0.3",
        "isarray": "~1.0.0",
        "process-nextick-args": "~2.0.0",
        "safe-buffer": "~5.1.1",
        "string_decoder": "~1.1.1",
        "util-deprecate": "~1.0.1"
      }
    },
    "node_modules/readable-stream/node_modules/safe-buffer": {
      "version": "5.1.2",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/readonly-date": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0"
    },
    "node_modules/redeyed": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "esprima": "~4.0.0"
      }
    },
    "node_modules/require-directory": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/ripemd160": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "hash-base": "^3.1.2",
        "inherits": "^2.0.4"
      },
      "engines": {
        "node": ">= 0.8"
      }
    },
    "node_modules/safe-buffer": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
      "integrity": [REDACTED_SECRET],
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT"
    },
    "node_modules/set-function-length": {
      "version": "1.2.2",
      "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "define-data-property": "^1.1.4",
        "es-errors": "^1.3.0",
        "function-bind": "^1.1.2",
        "get-intrinsic": "^1.2.4",
        "gopd": "^1.0.1",
        "has-property-descriptors": "^1.0.2"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/sha.js": {
      "version": "2.4.12",
      "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "(MIT AND BSD-3-Clause)",
      "dependencies": {
        "inherits": "^2.0.4",
        "safe-buffer": "^5.2.1",
        "to-buffer": "^1.2.0"
      },
      "bin": {
        "sha.js": "bin.js"
      },
      "engines": {
        "node": ">= 0.10"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/starknet": {
      "version": "8.9.2",
      "resolved": "https://registry.npmjs.org/starknet/-/starknet-8.9.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "@noble/curves": "~1.7.0",
        "@noble/hashes": "~1.6.0",
        "@scure/base": "~1.2.1",
        "@scure/starknet": "1.1.0",
        "@starknet-io/starknet-types-08": "npm:@starknet-io/types-js@~0.8.4",
        "@starknet-io/starknet-types-09": "npm:@starknet-io/types-js@~0.9.1",
        "abi-wan-kanabi": "2.2.4",
        "lossless-json": "^4.2.0",
        "pako": "^2.0.4",
        "ts-mixer": "^6.0.3"
      },
      "engines": {
        "node": ">=22"
      }
    },
    "node_modules/starknet/node_modules/@noble/curves": {
      "version": "1.7.0",
      "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.7.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "@noble/hashes": "1.6.0"
      },
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/starknet/node_modules/@noble/curves/node_modules/@noble/hashes": {
      "version": "1.6.0",
      "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/starknet/node_modules/@noble/hashes": {
      "version": "1.6.1",
      "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": "^14.21.3 || >=16"
      },
      "funding": {
        "url": "https://paulmillr.com/funding/"
      }
    },
    "node_modules/string_decoder": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "safe-buffer": "~5.1.0"
      }
    },
    "node_modules/string_decoder/node_modules/safe-buffer": {
      "version": "5.1.2",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/string-width": {
      "version": "4.2.3",
      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "emoji-regex": "^8.0.0",
        "is-fullwidth-code-point": "^3.0.0",
        "strip-ansi": "^6.0.1"
      },
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/strip-ansi": {
      "version": "6.0.1",
      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "ansi-regex": "^5.0.1"
      },
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/symbol-observable": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/timing-safe-equal": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/timing-safe-equal/-/timing-safe-equal-1.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/to-buffer": {
      "version": "1.2.2",
      "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "isarray": "^2.0.5",
        "safe-buffer": "^5.2.1",
        "typed-array-buffer": "^1.0.3"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/to-buffer/node_modules/isarray": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/ts-mixer": {
      "version": "6.0.4",
      "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true
    },
    "node_modules/ts-poet": {
      "version": "6.12.0",
      "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.12.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "Apache-2.0",
      "dependencies": {
        "dprint-node": "^1.0.8"
      }
    },
    "node_modules/ts-proto": {
      "version": "1.181.2",
      "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.181.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "case-anything": "^2.1.13",
        "protobufjs": "^7.2.4",
        "ts-poet": "^6.7.0",
        "ts-proto-descriptors": "1.16.0"
      },
      "bin": {
        "protoc-gen-ts_proto": "protoc-gen-ts_proto"
      }
    },
    "node_modules/ts-proto-descriptors": {
      "version": "1.16.0",
      "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.16.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "dependencies": {
        "long": "^5.2.3",
        "protobufjs": "^7.2.4"
      }
    },
    "node_modules/ts-proto-descriptors/node_modules/protobufjs": {
      "version": "7.5.4",
      "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",
      "integrity": [REDACTED_SECRET],
      "hasInstallScript": true,
      "license": "BSD-3-Clause",
      "dependencies": {
        "@protobufjs/aspromise": "^1.1.2",
        "@protobufjs/base64": "^1.1.2",
        "@protobufjs/codegen": "^2.0.4",
        "@protobufjs/eventemitter": "^1.1.0",
        "@protobufjs/fetch": "^1.1.0",
        "@protobufjs/float": "^1.0.2",
        "@protobufjs/inquire": "^1.1.0",
        "@protobufjs/path": "^1.1.2",
        "@protobufjs/pool": "^1.1.0",
        "@protobufjs/utf8": "^1.1.0",
        "@types/node": ">=13.7.0",
        "long": "^5.0.0"
      },
      "engines": {
        "node": ">=12.0.0"
      }
    },
    "node_modules/ts-proto/node_modules/protobufjs": {
      "version": "7.5.4",
      "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",
      "integrity": [REDACTED_SECRET],
      "hasInstallScript": true,
      "license": "BSD-3-Clause",
      "dependencies": {
        "@protobufjs/aspromise": "^1.1.2",
        "@protobufjs/base64": "^1.1.2",
        "@protobufjs/codegen": "^2.0.4",
        "@protobufjs/eventemitter": "^1.1.0",
        "@protobufjs/fetch": "^1.1.0",
        "@protobufjs/float": "^1.0.2",
        "@protobufjs/inquire": "^1.1.0",
        "@protobufjs/path": "^1.1.2",
        "@protobufjs/pool": "^1.1.0",
        "@protobufjs/utf8": "^1.1.0",
        "@types/node": ">=13.7.0",
        "long": "^5.0.0"
      },
      "engines": {
        "node": ">=12.0.0"
      }
    },
    "node_modules/typed-array-buffer": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "call-bound": "^1.0.3",
        "es-errors": "^1.3.0",
        "is-typed-array": "^1.1.14"
      },
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/ulid": {
      "version": "2.4.0",
      "resolved": "https://registry.npmjs.org/ulid/-/ulid-2.4.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "bin": {
        "ulid": "bin/cli.js"
      }
    },
    "node_modules/undici-types": {
      "version": "7.18.2",
      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/universalify": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "engines": {
        "node": ">= 10.0.0"
      }
    },
    "node_modules/util-deprecate": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT"
    },
    "node_modules/which-typed-array": {
      "version": "1.1.20",
      "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "available-typed-arrays": "^1.0.7",
        "call-bind": "^1.0.8",
        "call-bound": "^1.0.4",
        "for-each": "^0.3.5",
        "get-proto": "^1.0.1",
        "gopd": "^1.2.0",
        "has-tostringtag": "^1.0.2"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/wrap-ansi": {
      "version": "7.0.0",
      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "ansi-styles": "^4.0.0",
        "string-width": "^4.1.0",
        "strip-ansi": "^6.0.0"
      },
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
      }
    },
    "node_modules/ws": {
      "version": "8.19.0",
      "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "engines": {
        "node": ">=10.0.0"
      },
      "peerDependencies": {
        "bufferutil": "^4.0.1",
        "utf-8-validate": ">=5.0.2"
      },
      "peerDependenciesMeta": {
        "bufferutil": {
          "optional": true
        },
        "utf-8-validate": {
          "optional": true
        }
      }
    },
    "node_modules/xstream": {
      "version": "11.14.0",
      "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "dependencies": {
        "globalthis": "^1.0.1",
        "symbol-observable": "^2.0.3"
      }
    },
    "node_modules/y18n": {
      "version": "5.0.8",
      "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "peer": true,
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/yargs": {
      "version": "17.7.2",
      "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "cliui": "^8.0.1",
        "escalade": "^3.1.1",
        "get-caller-file": "^2.0.5",
        "require-directory": "^2.1.1",
        "string-width": "^4.2.3",
        "y18n": "^5.0.5",
        "yargs-parser": "^21.1.1"
      },
      "engines": {
        "node": ">=12"
      }
    },
    "node_modules/yargs-parser": {
      "version": "21.1.1",
      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
      "integrity": [REDACTED_SECRET],
      "license": "ISC",
      "peer": true,
      "engines": {
        "node": ">=12"
      }
    }
  }
}


path: jackal-memory/package.json
content: {
  "name": "claw-store-jackal-client",
  "version": "1.0.0",
  "private": true,
  "description": "Jackal.js dependencies for Claw Store client-side signing",
  "dependencies": {
    "@jackallabs/jackal.js": "^3.7.2",
    "ws": "^8.19.0"
  },
  "engines": {
    "node": ">=20"
  }
}


path: _meta.json
content: ownerId: kn7ap3d5tma3pr3zdhrqe551dd81wbat
slug: claw-store
version: 1.3.3
publishedAt: 1772826746850

Security scan verdicts — ClawScan: suspicious | static analysis: suspicious | VirusTotal: clean | SkillSpector: suspicious (HIGH)