oculon 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -5
- package/dist/cli/main.js +297 -0
- package/dist/core/evm.d.ts +20 -0
- package/dist/core/evm.js +165 -0
- package/dist/core/http.js +7 -0
- package/dist/core/quota.js +23 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +68 -0
- package/dist/mcp.js +81 -2
- package/dist/modules/address.d.ts +32 -0
- package/dist/modules/address.js +91 -0
- package/dist/modules/breach.d.ts +53 -0
- package/dist/modules/breach.js +98 -0
- package/dist/modules/company.d.ts +53 -0
- package/dist/modules/company.js +149 -0
- package/dist/modules/hashcheck.d.ts +29 -0
- package/dist/modules/hashcheck.js +82 -0
- package/dist/modules/headers.d.ts +50 -0
- package/dist/modules/headers.js +108 -0
- package/dist/modules/honeypot.d.ts +36 -0
- package/dist/modules/honeypot.js +53 -0
- package/dist/modules/iban.d.ts +30 -0
- package/dist/modules/iban.js +82 -0
- package/dist/modules/ipintel.d.ts +52 -0
- package/dist/modules/ipintel.js +149 -0
- package/dist/modules/lookalike.d.ts +34 -0
- package/dist/modules/lookalike.js +122 -0
- package/dist/modules/personal.d.ts +1 -1
- package/dist/modules/personal.js +14 -4
- package/dist/modules/phone.d.ts +32 -0
- package/dist/modules/phone.js +148 -0
- package/dist/modules/ransomware.d.ts +56 -0
- package/dist/modules/ransomware.js +85 -0
- package/dist/modules/satellites.d.ts +45 -0
- package/dist/modules/satellites.js +113 -0
- package/dist/modules/utility.d.ts +121 -0
- package/dist/modules/utility.js +306 -0
- package/dist/sources/threatintel.d.ts +151 -0
- package/dist/sources/threatintel.js +256 -0
- package/dist/telegram.d.ts +2 -0
- package/dist/telegram.js +93 -6
- package/dist/web/assets/logo-200.png +0 -0
- package/dist/web/burns.d.ts +21 -0
- package/dist/web/burns.js +53 -0
- package/dist/web/index.html +70 -3
- package/dist/web/insights.js +2 -0
- package/dist/web/landing.html +1 -1
- package/dist/web/legal.html +1 -1
- package/dist/web/mcp.html +1 -1
- package/dist/web/openapi.js +11 -0
- package/dist/web/public.js +13 -1
- package/dist/web/server.d.ts +17 -0
- package/dist/web/server.js +161 -4
- package/dist/web/token.html +97 -0
- package/dist/web/token.json +9 -0
- package/dist/web/utility.html +225 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Open-source intelligence engine for the physical and digital world.** Oculon watches more than 50 public data sources (routing tables, exploit catalogs, transponders, satellites, ship trackers, registries and prediction markets), finds what is unusual, fuses observations about the same subject from independent sources into scored signals, and labels every result with where it came from and how fresh it is. An AI agent on top answers plain-language questions with sources.
|
|
4
4
|
|
|
5
|
-
[oculon.live](https://oculon.live) · [Documentation](https://oculon.live/docs) · [Privacy](https://oculon.live/privacy) · [Terms](https://oculon.live/terms)
|
|
5
|
+
[oculon.live](https://oculon.live) · [Documentation](https://oculon.live/docs) · [Privacy](https://oculon.live/privacy) · [Terms](https://oculon.live/terms) · [Token](#official-token)
|
|
6
6
|
|
|
7
7
|
[](https://github.com/oculonlive/oculon/actions/workflows/ci.yml)
|
|
8
8
|
[](LICENSE)
|
|
@@ -21,15 +21,16 @@ npx oculon ask "why is Nvidia in the news this week?"
|
|
|
21
21
|
- **Sourced by design.** Every answer names the sources it used and whether each one was live, cached or unavailable. Nothing is presented without provenance.
|
|
22
22
|
- **Cross-source signals.** When independent sources move on the same subject, Oculon fuses them into one scored signal with the evidence behind it, and storylines are tracked across days.
|
|
23
23
|
- **Measured, not claimed.** A time machine replays past days to calibrate the radar, a first-to-know check compares Oculon against media coverage, and forecasts are timestamped on Bitcoin so they cannot be edited later.
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
24
|
+
- **Robinhood Chain, read block by block.** Oculon watches pools the minute they open, follows each token back to the wallet that deployed it (directly or through a launchpad) and counts how many of that wallet's launches are already dead. See [On-chain](#on-chain-robinhood-chain).
|
|
25
|
+
- **Built for agents.** 88 MCP tools locally over stdio (95 with the on-chain tools on), and 86 remotely at `https://mcp.oculon.live`; the SDK and CLI return the same objects, and `--json` works on every command.
|
|
26
|
+
- **Everyday checks.** Is this message a scam? Is this link dangerous? Is this claim true? Is my car recalled? Can someone spoof my email domain? Are my dependencies safe? What should I know before I travel? Who is calling me? Has my password leaked? Is this supplier real? Each answer names its sources, and any result can be shared as a link with a preview card.
|
|
26
27
|
- **Monitors in plain words.** "Tell me when there is an internet outage in Iran" becomes a rule that is re-checked on a schedule and reports only what changed, by email, in Telegram or in the app. Every visitor keeps their own monitors, with no account.
|
|
27
28
|
- **Everywhere people are.** A public Telegram bot ([@oculon_radar_bot](https://t.me/oculon_radar_bot)): forward it a suspicious message and it checks it. An OpenAPI spec at `/openapi.json` for ChatGPT Actions, n8n and Zapier.
|
|
28
29
|
- **Free to run.** Daily per-source budgets keep every free tier free, and the data lives in one local SQLite file.
|
|
29
30
|
|
|
30
31
|
## Contents
|
|
31
32
|
|
|
32
|
-
[What it does](#what-it-does) · [Install](#install) · [CLI](#cli) · [MCP server](#mcp-server) · [Remote MCP](#remote-mcp) · [Analyst](#oculon-analyst) · [SDK](#sdk) · [Web app](#dashboard-and-schedule) · [Telegram bot](#telegram-bot) · [Configuration](#configuration) · [Deploy](#deploy) · [How it works](#how-it-works) · [Limits](#limits) · [Development](#development)
|
|
33
|
+
[What it does](#what-it-does) · [Install](#install) · [CLI](#cli) · [MCP server](#mcp-server) · [Remote MCP](#remote-mcp) · [Analyst](#oculon-analyst) · [SDK](#sdk) · [Web app](#dashboard-and-schedule) · [Telegram bot](#telegram-bot) · [Configuration](#configuration) · [Deploy](#deploy) · [How it works](#how-it-works) · [Limits](#limits) · [Development](#development) · [On-chain](#on-chain-robinhood-chain) · [Official token](#official-token)
|
|
33
34
|
|
|
34
35
|
## What it does
|
|
35
36
|
|
|
@@ -45,6 +46,19 @@ npx oculon ask "why is Nvidia in the news this week?"
|
|
|
45
46
|
| Papers | `oculon papers "<topic>"` | Research brief: the most cited papers of recent years among the most relevant, the newest relevant ones, papers per year (growing, steady or shrinking), PubMed counts for medical topics, and a short overview that cites the numbered papers | OpenAlex, PubMed, Semantic Scholar, Groq, Gemini, Mistral |
|
|
46
47
|
| Country | `oculon country <name>` | One-page country brief: GDP, growth, GDP per person, inflation, unemployment and population, the IMF outlook for this year and next, head of state and government, capital, currency and its rate to the dollar, US and UK travel advice, internet outages, disaster alerts and the latest headlines | World Bank, IMF, Wikidata, open.er-api.com, US State Department, UK FCDO, Cloudflare Radar, GDACS, Guardian |
|
|
47
48
|
| Airport | `oculon airport <JFK\|EGLL\|name>` | Is an airport running normally? Current METAR and TAF (flight category, wind, visibility, ceiling), FAA ground stops, ground delay programs, delays and closures at US airports, and aircraft squawking an emergency within 150 km | aviationweather.gov (NOAA), FAA NAS status, adsb.lol, OurAirports |
|
|
49
|
+
| Phone | `oculon phone <+number> [--country US]` | Who is behind a number in a suspicious SMS or a missed call: country from the calling code, line type (mobile, landline, VoIP, premium rate), carrier and location, and warnings for premium-rate numbers, UK 070 personal numbers and the Caribbean area codes the FCC names in "one ring" callback scams. Never looks up the owner | ITU calling codes (offline), Numverify (free key, 100 a month) |
|
|
50
|
+
| IBAN | `oculon iban <IBAN> [--country NL]` | Checks an IBAN before you pay: country, length, ISO 13616 check digits and bank code, and a warning when the account is in a different country than the supplier. A valid IBAN does not prove who owns the account | Offline |
|
|
51
|
+
| Email headers | `oculon headers < headers.txt` | Paste the raw headers of a suspicious email: SPF, DKIM and DMARC results, the delivery path, the origin IP and country, and spoofing signs such as a Reply-To elsewhere or a display name posing as an address | Offline, ip-api.com |
|
|
52
|
+
| Lookalike domains | `oculon lookalike <domain>` | Typos, swapped letters, homoglyphs, extra words and other endings of a brand that exist in DNS, with mail servers, plus certificates issued in the last 90 days for names containing the brand | Google DNS, crt.sh, CertSpotter |
|
|
53
|
+
| Honeypot | `oculon honeypot <token> [--chain eth\|bsc\|base]` | Can this token be sold? A buy and sell simulation on its main pool plus recent holders' sells: honeypot verdict, buy and sell tax, holders who could not sell | honeypot.is |
|
|
54
|
+
| Crypto address | `oculon address <address>` | Before you send funds: chain from the format (Bitcoin, EVM, Solana, Tron), US OFAC sanctions, balance, transactions and labels, contracts posing as wallets, unused addresses | mempool.space, Blockscout, Solana RPC, OFAC |
|
|
55
|
+
| Password | `oculon password` · web app | Has a password appeared in a data breach? Only the first 5 characters of its SHA-1 hash are sent and the match happens locally (in the web app, in the browser); the password is never stored, logged or shown | Have I Been Pwned (Pwned Passwords) |
|
|
56
|
+
| Breaches | `oculon breaches [domain]` | The newest breaches added to Have I Been Pwned, or every breach of one domain or company: date, accounts affected and the kinds of data exposed. Sensitive breaches are left out | Have I Been Pwned (CC BY 4.0) |
|
|
57
|
+
| Company | `oculon company <name\|LEI\|EU VAT>` | Is a supplier real before you pay its invoice? An EU VAT number is checked live (valid or not, registered name and address); a name or LEI returns the legal entity, registered address, status, registration number and ultimate parent, with warnings for invalid numbers, inactive companies and lapsed records | EU VIES, GLEIF (Global LEI Index) |
|
|
58
|
+
| IP check | `oculon ip <IP\|domain>` | Who runs an address and is it known for abuse: network, owner and type, location, abuse reports, internet scanning, threat reports, antivirus verdicts, malware infrastructure, hijacked or criminal networks, Tor exits and open ports; a verdict, a 0-100 risk and the reasons. Big shared services that collect stray reports are not blamed | AbuseIPDB, GreyNoise, AlienVault OTX, VirusTotal, ThreatFox, Spamhaus DROP, Tor Project, ip-api.com, IPinfo, PeeringDB, Shodan InternetDB |
|
|
59
|
+
| Hash check | `oculon hash <md5\|sha1\|sha256>` | Is a file known malware, a known good file, or unknown? Malware family, first seen, detections, and the known-software sets it belongs to | CIRCL hashlookup (NIST NSRL), MalwareBazaar, ThreatFox, AlienVault OTX, VirusTotal |
|
|
60
|
+
| Ransomware | `oculon ransomware [CC\|sector\|name]` | Claims posted on ransomware leak sites, newest first, by country, sector or a company or domain, with counts by group, country and sector. Leak-site links are never passed on | ransomware.live |
|
|
61
|
+
| Satellites | `oculon satellite [name\|NORAD id]` | Everything launched in the last 30 days grouped by launch, or one object's orbit (perigee, apogee, period, inclination), owner, launch date and status | CelesTrak |
|
|
48
62
|
| Share | web app · `/r/<id>` | Any everyday check can be shared as a link: the server runs the check, keeps a snapshot and serves it as a page with a preview card for X, Telegram, WhatsApp and Slack | Oculon |
|
|
49
63
|
| Personal monitors | web app · Telegram `/monitor` | Each visitor (a random id in a cookie, no account) or Telegram chat keeps up to 10 monitors of its own, written in plain language and re-checked about hourly; changes are kept as alerts and sent by email (after a confirmation link, with one-click unsubscribe) or to the Telegram chat | Resend (email), Meerkat |
|
|
50
64
|
| Monitor | `oculon monitor "<request>"` | Watch anything in plain language: "internet outages in Iran", "critical CVEs for nginx", "earthquakes above 6 near Tokyo", "news about OpenAI", "travel risk changes for Bangkok", "flood or cyclone alerts for the Philippines". The request becomes a watchlist rule; only changes are reported, with evidence, in the app, Telegram and the signal feed | Groq, Gemini, Mistral (with a pattern fallback), Meerkat |
|
|
@@ -129,6 +143,19 @@ oculon watch add company Nvidia # watchlist: company domain plane
|
|
|
129
143
|
oculon watch run # report only what changed since last time
|
|
130
144
|
oculon brief # today's brief
|
|
131
145
|
oculon quota # today's API usage vs daily budgets
|
|
146
|
+
oculon phone "+1 876 555 0100" # who is calling? one-ring scam area code
|
|
147
|
+
oculon iban "DE89 3704 0044 0532 0130 00" --country NL # IBAN valid? account in another country?
|
|
148
|
+
oculon headers < headers.txt # was this email spoofed?
|
|
149
|
+
oculon lookalike example.com # lookalike domains and new certificates
|
|
150
|
+
oculon honeypot 0x6982508145454Ce325dDbE47a25d4ec3d2311933 # can this token be sold?
|
|
151
|
+
oculon address bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh # sanctions, balance, activity
|
|
152
|
+
oculon password # has my password leaked? (asked without echo)
|
|
153
|
+
oculon breaches adobe.com # breaches of a domain
|
|
154
|
+
oculon company NL004495445B01 # EU VAT number, LEI or company name
|
|
155
|
+
oculon ip 185.220.101.1 # abuse reports, scanners, Tor, threat reports
|
|
156
|
+
oculon hash <sha256> # known malware or a known good file?
|
|
157
|
+
oculon ransomware Healthcare # ransomware leak-site claims
|
|
158
|
+
oculon satellite 25544 # ISS orbit, owner, status
|
|
132
159
|
oculon ask "is there a geomagnetic storm right now?"
|
|
133
160
|
oculon radar # what the world is suddenly watching
|
|
134
161
|
oculon dossier Nvidia # company / person dossier
|
|
@@ -263,7 +290,7 @@ TELEGRAM_ALERT_MIN_SCORE=70
|
|
|
263
290
|
TELEGRAM_WATCH_MINUTES=15
|
|
264
291
|
```
|
|
265
292
|
|
|
266
|
-
Run `oculon telegram` (or `oculon serve --telegram`). Every module has a command (`/help` lists them), including `/ask`, `/case`, `/calendar`, `/connect Nvidia to Jensen Huang`, `/live`, `/brief`, `/report` and `/alerts on|off`. Alerts arrive with Useful and Noise buttons; `/feedback` shows how the votes moved each module's alert bar. Chats outside the allowlist are refused and cannot vote.
|
|
293
|
+
Run `oculon telegram` (or `oculon serve --telegram`). Every module has a command (`/help` lists them; the password check is left out so nobody types a password into a chat), including `/ask`, `/case`, `/calendar`, `/connect Nvidia to Jensen Huang`, `/live`, `/brief`, `/report` and `/alerts on|off`. Alerts arrive with Useful and Noise buttons; `/feedback` shows how the votes moved each module's alert bar. Chats outside the allowlist are refused and cannot vote.
|
|
267
294
|
|
|
268
295
|
## Configuration
|
|
269
296
|
|
|
@@ -337,6 +364,8 @@ The repository includes a `Dockerfile` (on Railway, set the service health check
|
|
|
337
364
|
- Social pulse samples are small (X returns about 10 posts per search on Apify's free plan) and X, TikTok and Bluesky are fetched by popularity, so pace is measured on Reddit only. Address labels come from a community dataset (MIT) and can be incomplete or stale.
|
|
338
365
|
- Plugins run with full Node permissions; install only code you trust.
|
|
339
366
|
- `oculon ask` answers are written by an LLM from tool results; they can still misread data, so check the cited sources.
|
|
367
|
+
- The VirusTotal public API is for non-commercial use and allows 4 lookups a minute, so IP and hash checks can wait up to 15 s for it. Numverify's free plan allows 100 lookups a month (Oculon uses at most 3 a day); after that the phone check answers from the offline calling-code table. ip-api.com and Numverify free plans are HTTP only.
|
|
368
|
+
- Ransomware claims are posted by criminal groups and are sometimes wrong or exaggerated. EU VIES often answers "too many requests" for a country for a few minutes; the check retries once and then says so. Germany does not publish VAT holders' names through VIES.
|
|
340
369
|
- Respect each data provider's terms. OpenStreetMap, Nominatim and adsb.lol data are ODbL-licensed and require attribution.
|
|
341
370
|
|
|
342
371
|
## Development
|
|
@@ -353,6 +382,47 @@ npm run build
|
|
|
353
382
|
|
|
354
383
|
Issues and pull requests are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md). Please report vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
|
|
355
384
|
|
|
385
|
+
## On-chain: Robinhood Chain
|
|
386
|
+
|
|
387
|
+
Robinhood Chain pools, token and deployer checks, wallet checks and DeFi are live on [oculon.live](https://oculon.live) and on the remote MCP server. In your own install they are off by default; set `OCULON_ONCHAIN=1` to turn on the commands, MCP and agent tools, the schedule task, watch kinds and web sections.
|
|
388
|
+
|
|
389
|
+
| Check | Command | What it does | Sources |
|
|
390
|
+
|---|---|---|---|
|
|
391
|
+
| Robinhood Chain pools | `oculon rh` | Activity, trending and newly created pools with risk flags: thin liquidity, buys without sells, sudden dumps | GeckoTerminal, Blockscout |
|
|
392
|
+
| Deployer reputation | `oculon deployer <address>` | Every token a wallet launched, directly or through a launchpad, and how many are already dead | Blockscout, Robinhood Chain RPC |
|
|
393
|
+
| Token risk | `oculon token <address> --chain robinhood` (also eth, base, arbitrum, bsc, polygon) | Honeypot, tax and owner flags, contract verification, holder concentration, DEX liquidity and price, with a DANGER, CAUTION or OK verdict | GoPlus, Webacy, DexScreener, Blockscout |
|
|
394
|
+
| Wallet | `oculon wallet <address>` | Portfolio, age, transactions, known entities it trades with and risk labels (EVM, Solana, Robinhood Chain) | Zerion, Etherscan, Helius, Robinhood Chain RPC |
|
|
395
|
+
| DeFi | `oculon defi` | TVL crashes, stablecoin depegs, hacks, fear and greed | DefiLlama |
|
|
396
|
+
|
|
397
|
+
```sh
|
|
398
|
+
OCULON_ONCHAIN=1 npx oculon rh
|
|
399
|
+
OCULON_ONCHAIN=1 npx oculon deployer 0x...
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Token and deployer verdicts are heuristics over pool and explorer data, not contract audits, and a verdict can be wrong.
|
|
403
|
+
|
|
404
|
+
## Official token
|
|
405
|
+
|
|
406
|
+
The only official Oculon token is `$OCULON` on Robinhood Chain:
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
0x12a3f1a05d827007f17a43a250cce44868c4a263
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
The same address is posted on [x.com/oculonlive](https://x.com/oculonlive) and at [oculon.live/thetoken](https://oculon.live/thetoken). If an address does not match all three exactly, it is not Oculon. Launchpad page: [ponsfamily.com](https://ponsfamily.com/launchpad/0x12a3f1a05d827007f17a43a250cce44868c4a263). Nothing here is financial advice.
|
|
413
|
+
|
|
414
|
+
### Utility
|
|
415
|
+
|
|
416
|
+
Everything is read from Robinhood Chain: nothing is custodied and nothing is paid to anyone. Burns go to the dead address, each burn counts once, and only the wallet that burned can use it (it signs the request). Oculon itself stays free.
|
|
417
|
+
|
|
418
|
+
| Use | How | What you get |
|
|
419
|
+
|---|---|---|
|
|
420
|
+
| Deep investigation | Burn 1,500,000 OCULON | One domain, wallet, token or company checked against every relevant source, published as a public page that links the burn |
|
|
421
|
+
| Live safety badge | Burn 2,000,000 OCULON | 30 days of live monitoring of one Robinhood Chain token, with an embeddable badge (`/badge/<token>.svg`) that turns red on danger. Burning never changes the verdict |
|
|
422
|
+
| Holder tier | Hold 3,500,000 OCULON, sign once | Up to 30 personal monitors, checked every 15 minutes instead of every hour |
|
|
423
|
+
|
|
424
|
+
Start at [oculon.live/utility](https://oculon.live/utility). Wallet sign-in is checked with keccak256 and secp256k1 written in this repo (`src/core/evm.ts`), so it adds no dependency.
|
|
425
|
+
|
|
356
426
|
## License
|
|
357
427
|
|
|
358
428
|
[MIT](LICENSE). Data from third-party sources remains subject to each provider's terms.
|
package/dist/cli/main.js
CHANGED
|
@@ -189,6 +189,21 @@ ${c.bold('Everyday checks')}
|
|
|
189
189
|
oculon papers "<topic>" research brief: most cited and newest papers
|
|
190
190
|
oculon country <name> country brief: economy, leaders, currency, advice, news
|
|
191
191
|
oculon airport <JFK|EGLL|name> airport weather, FAA delays and ground stops
|
|
192
|
+
oculon phone <+number> [--country US] who is calling? country, line type, premium-rate and callback-scam warnings
|
|
193
|
+
oculon password has this password leaked? (asked without echo; k-anonymity)
|
|
194
|
+
oculon breaches [domain] newest data breaches, or every breach of one domain (HIBP)
|
|
195
|
+
oculon company <name|LEI|EU VAT> is this supplier real? VAT check (VIES), LEI register (GLEIF)
|
|
196
|
+
oculon iban <IBAN> [--country NL] is this IBAN valid, and is the account in the supplier's country?
|
|
197
|
+
oculon headers < headers.txt raw email headers: SPF, DKIM, DMARC, path, origin, spoofing signs
|
|
198
|
+
oculon address <crypto address> chain, OFAC sanctions, balance and activity, no keys needed
|
|
199
|
+
|
|
200
|
+
${c.bold('Threat intel')}
|
|
201
|
+
oculon ip <IP|domain> abuse reports, scanners, threat reports, Tor, Spamhaus DROP, open ports
|
|
202
|
+
oculon hash <md5|sha1|sha256> is this file known malware or a known good file?
|
|
203
|
+
oculon lookalike <domain> lookalike domains that exist, new certificates naming the brand
|
|
204
|
+
oculon honeypot <token> [--chain eth|bsc|base] can this token be sold? buy/sell simulation, taxes
|
|
205
|
+
oculon ransomware [CC|sector|name] ransomware leak-site claims, newest first
|
|
206
|
+
oculon satellite [name|NORAD id] launches of the last 30 days, or one object's orbit (CelesTrak)
|
|
192
207
|
|
|
193
208
|
${c.bold('Web')}
|
|
194
209
|
oculon search <query> web search
|
|
@@ -231,6 +246,39 @@ const need = (a, i, what) => {
|
|
|
231
246
|
};
|
|
232
247
|
class UsageError extends Error {
|
|
233
248
|
}
|
|
249
|
+
/** Read one line from the terminal without echoing it (for passwords). */
|
|
250
|
+
function readHidden(prompt) {
|
|
251
|
+
return new Promise((resolveLine) => {
|
|
252
|
+
const stdin = process.stdin;
|
|
253
|
+
process.stdout.write(prompt);
|
|
254
|
+
let buf = '';
|
|
255
|
+
stdin.setRawMode?.(true);
|
|
256
|
+
stdin.resume();
|
|
257
|
+
stdin.setEncoding('utf8');
|
|
258
|
+
const done = (v) => {
|
|
259
|
+
stdin.setRawMode?.(false);
|
|
260
|
+
stdin.pause();
|
|
261
|
+
stdin.removeListener('data', onData);
|
|
262
|
+
process.stdout.write('\n');
|
|
263
|
+
resolveLine(v);
|
|
264
|
+
};
|
|
265
|
+
const onData = (ch) => {
|
|
266
|
+
for (const k of ch) {
|
|
267
|
+
if (k === '\r' || k === '\n')
|
|
268
|
+
return done(buf);
|
|
269
|
+
if (k === '\u0003') {
|
|
270
|
+
done('');
|
|
271
|
+
process.exit(130);
|
|
272
|
+
}
|
|
273
|
+
if (k === '\u007f' || k === '\b')
|
|
274
|
+
buf = buf.slice(0, -1);
|
|
275
|
+
else
|
|
276
|
+
buf += k;
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
stdin.on('data', onData);
|
|
280
|
+
});
|
|
281
|
+
}
|
|
234
282
|
const json = (a) => a.flags.json === true;
|
|
235
283
|
const emit = (a, data, human) => (json(a) ? out(JSON.stringify(data, null, 2)) : human());
|
|
236
284
|
export const COMMANDS = {
|
|
@@ -711,6 +759,252 @@ export const COMMANDS = {
|
|
|
711
759
|
printSources(r);
|
|
712
760
|
});
|
|
713
761
|
},
|
|
762
|
+
async ip(o, a) {
|
|
763
|
+
const q = a.pos[1]?.trim();
|
|
764
|
+
if (!q)
|
|
765
|
+
throw new UsageError('usage: oculon ip <IP address | domain>');
|
|
766
|
+
const r = await o.ipCheck(q);
|
|
767
|
+
emit(a, r, () => {
|
|
768
|
+
const d = r.result;
|
|
769
|
+
const tone = d.verdict === 'malicious' ? c.red : d.verdict === 'suspicious' ? c.yellow : c.green;
|
|
770
|
+
out(`${c.bold(d.ip)}${d.resolvedFrom ? c.dim(` (${d.resolvedFrom})`) : ''} ${tone(d.verdict.toUpperCase())} ${c.dim(`risk ${d.risk}/100`)}`);
|
|
771
|
+
const where = d.location ? [d.location.city, d.location.region, d.location.country].filter(Boolean).join(', ') : 'unknown';
|
|
772
|
+
out(` network ${[d.network.asn, d.network.name].filter(Boolean).join(' ') || 'unknown'}${d.network.type ? c.dim(` · ${d.network.type}`) : ''}`);
|
|
773
|
+
out(` where ${where}${d.network.reverse ? c.dim(` · ${d.network.reverse}`) : ''}`);
|
|
774
|
+
const fl = Object.entries(d.flags).filter(([, v]) => v).map(([k]) => k);
|
|
775
|
+
if (fl.length)
|
|
776
|
+
out(` flags ${fl.join(', ')}`);
|
|
777
|
+
if (d.ports?.ports.length)
|
|
778
|
+
out(` ports ${d.ports.ports.slice(0, 12).join(', ')}${d.ports.vulns.length ? c.yellow(` · ${d.ports.vulns.length} known CVEs`) : ''}`);
|
|
779
|
+
for (const x of d.reasons)
|
|
780
|
+
out(` - ${x}`);
|
|
781
|
+
for (const x of d.advice)
|
|
782
|
+
out(` → ${x}`);
|
|
783
|
+
printSources(r);
|
|
784
|
+
});
|
|
785
|
+
},
|
|
786
|
+
async hash(o, a) {
|
|
787
|
+
const q = a.pos[1]?.trim();
|
|
788
|
+
if (!q)
|
|
789
|
+
throw new UsageError('usage: oculon hash <MD5 | SHA-1 | SHA-256>');
|
|
790
|
+
const r = await o.hashCheck(q);
|
|
791
|
+
emit(a, r, () => {
|
|
792
|
+
const d = r.result;
|
|
793
|
+
const tone = d.verdict === 'malicious' ? c.red : d.verdict === 'suspicious' ? c.yellow : d.verdict === 'known good' ? c.green : c.gray;
|
|
794
|
+
out(`${tone(d.verdict.toUpperCase())} ${c.dim(`${d.algorithm} ${d.hash}`)}`);
|
|
795
|
+
if (d.name || d.family)
|
|
796
|
+
out(` ${[d.name, d.family && `family ${d.family}`].filter(Boolean).join(' · ')}`);
|
|
797
|
+
for (const x of d.reasons)
|
|
798
|
+
out(` - ${x}`);
|
|
799
|
+
if (d.bazaar)
|
|
800
|
+
out(c.dim(` ${d.bazaar.link}`));
|
|
801
|
+
if (d.virustotal)
|
|
802
|
+
out(c.dim(` ${d.virustotal.link}`));
|
|
803
|
+
for (const x of d.advice)
|
|
804
|
+
out(` → ${x}`);
|
|
805
|
+
printSources(r);
|
|
806
|
+
});
|
|
807
|
+
},
|
|
808
|
+
async ransomware(o, a) {
|
|
809
|
+
const r = await o.ransomware(a.pos.slice(1).join(' ').trim());
|
|
810
|
+
emit(a, r, () => {
|
|
811
|
+
const d = r.result;
|
|
812
|
+
out(`${c.bold(d.query ? `Ransomware claims: ${d.query}` : 'Newest ransomware claims')} ${c.dim(`${d.total} found`)}`);
|
|
813
|
+
if (d.byGroup.length)
|
|
814
|
+
out(c.dim(` groups ${d.byGroup.slice(0, 6).map((x) => `${x.name} ${x.count}`).join(' · ')}`));
|
|
815
|
+
if (d.byCountry.length && d.mode !== 'country')
|
|
816
|
+
out(c.dim(` countries ${d.byCountry.slice(0, 6).map((x) => `${x.name} ${x.count}`).join(' · ')}`));
|
|
817
|
+
for (const v of d.victims.slice(0, 15))
|
|
818
|
+
out(` ${c.dim((v.discovered ?? v.attacked ?? '').slice(0, 10))} ${c.bold(trunc(v.victim, 60))} ${c.red(v.group)}${v.country ? c.dim(` ${v.country}`) : ''}${v.sector ? c.dim(` · ${v.sector}`) : ''}`);
|
|
819
|
+
out(c.dim(` ${d.note}`));
|
|
820
|
+
printSources(r);
|
|
821
|
+
});
|
|
822
|
+
},
|
|
823
|
+
async company(o, a) {
|
|
824
|
+
const q = a.pos.slice(1).join(' ').trim();
|
|
825
|
+
if (!q)
|
|
826
|
+
throw new UsageError('usage: oculon company <name | LEI | EU VAT number>');
|
|
827
|
+
const r = await o.companyCheck(q);
|
|
828
|
+
emit(a, r, () => {
|
|
829
|
+
const d = r.result;
|
|
830
|
+
if (d.vat)
|
|
831
|
+
out(`${c.bold(`VAT ${d.vat.country}${d.vat.number}`)} ${d.vat.valid ? c.green('VALID') : c.red('NOT VALID')}${d.vat.name ? ` ${d.vat.name}` : ''}${d.vat.address ? c.dim(`\n ${d.vat.address}`) : ''}`);
|
|
832
|
+
for (const x of d.records.slice(0, 6)) {
|
|
833
|
+
out(`${c.bold(x.name)} ${c.dim(x.lei)} ${x.status === 'ACTIVE' ? c.green(x.status) : c.yellow(x.status ?? '?')} ${x.registration === 'ISSUED' ? c.dim('LEI issued') : c.yellow(`LEI ${(x.registration ?? '?').toLowerCase()}`)}`);
|
|
834
|
+
out(c.dim(` ${[x.address, x.registeredAs && `reg. ${x.registeredAs}`, x.created && `since ${x.created}`].filter(Boolean).join(' · ')}`));
|
|
835
|
+
if (x.parent)
|
|
836
|
+
out(c.dim(` ultimate parent ${x.parent.name} (${x.parent.lei})`));
|
|
837
|
+
}
|
|
838
|
+
for (const w of d.warnings)
|
|
839
|
+
out(c.yellow(` ! ${w}`));
|
|
840
|
+
printSources(r);
|
|
841
|
+
});
|
|
842
|
+
},
|
|
843
|
+
async password(o, a) {
|
|
844
|
+
let pw = a.pos.slice(1).join(' ');
|
|
845
|
+
if (!pw && !process.stdin.isTTY)
|
|
846
|
+
pw = readFileSync(0, 'utf8').replace(/\r?\n$/, '');
|
|
847
|
+
if (!pw && process.stdin.isTTY)
|
|
848
|
+
pw = await readHidden('Password (not shown, not stored): ');
|
|
849
|
+
if (!pw)
|
|
850
|
+
throw new UsageError('usage: oculon password (asks without echo; or pipe it in)');
|
|
851
|
+
const r = await o.passwordCheck(pw);
|
|
852
|
+
emit(a, r, () => {
|
|
853
|
+
const d = r.result;
|
|
854
|
+
out(d.pwned ? c.red(`PWNED seen ${d.count.toLocaleString('en-US')} times in breaches`) : c.green('NOT FOUND in known breaches'));
|
|
855
|
+
for (const x of d.advice)
|
|
856
|
+
out(` → ${x}`);
|
|
857
|
+
out(c.dim(' Only the first 5 characters of the SHA-1 hash were sent (Have I Been Pwned, k-anonymity).'));
|
|
858
|
+
});
|
|
859
|
+
},
|
|
860
|
+
async breaches(o, a) {
|
|
861
|
+
const r = await o.breaches(a.pos.slice(1).join(' ').trim());
|
|
862
|
+
emit(a, r, () => {
|
|
863
|
+
const d = r.result;
|
|
864
|
+
out(c.bold(d.query ? `Breaches: ${d.query} ${d.total ? c.red(`${d.total} found`) : c.green('none found')}` : 'Newest breaches in Have I Been Pwned'));
|
|
865
|
+
for (const b of d.breaches)
|
|
866
|
+
out(` ${c.dim(b.breachDate ?? '')} ${c.bold(b.title)}${b.domain ? c.dim(` ${b.domain}`) : ''} ${b.accounts.toLocaleString('en-US')} accounts\n ${c.dim(trunc(b.dataClasses.join(', '), 120))}`);
|
|
867
|
+
out(c.dim(` ${d.note}`));
|
|
868
|
+
printSources(r);
|
|
869
|
+
});
|
|
870
|
+
},
|
|
871
|
+
async phone(o, a) {
|
|
872
|
+
const q = a.pos.slice(1).join(' ').trim();
|
|
873
|
+
if (!q)
|
|
874
|
+
throw new UsageError('usage: oculon phone <+number> [--country US]');
|
|
875
|
+
const r = await o.phoneCheck(q, typeof a.flags.country === 'string' ? { country: a.flags.country } : {});
|
|
876
|
+
emit(a, r, () => {
|
|
877
|
+
const d = r.result;
|
|
878
|
+
const tone = d.risk === 'high' ? c.red : d.risk === 'medium' ? c.yellow : c.green;
|
|
879
|
+
out(`${c.bold(d.e164)} ${tone(`${d.risk.toUpperCase()} RISK`)}${d.valid === false ? c.red(' not valid') : ''}`);
|
|
880
|
+
out(` ${[d.country, d.location, d.lineType, d.carrier].filter(Boolean).join(' · ')}`);
|
|
881
|
+
for (const w of d.warnings)
|
|
882
|
+
out(c.yellow(` ! ${w}`));
|
|
883
|
+
for (const x of d.advice)
|
|
884
|
+
out(` → ${x}`);
|
|
885
|
+
printSources(r);
|
|
886
|
+
});
|
|
887
|
+
},
|
|
888
|
+
async iban(o, a) {
|
|
889
|
+
const q = a.pos.slice(1).join(' ').trim();
|
|
890
|
+
if (!q)
|
|
891
|
+
throw new UsageError('usage: oculon iban <IBAN> [--country NL]');
|
|
892
|
+
const r = await o.ibanCheck(q, typeof a.flags.country === 'string' ? { country: a.flags.country } : {});
|
|
893
|
+
emit(a, r, () => {
|
|
894
|
+
const d = r.result;
|
|
895
|
+
out(`${c.bold(d.formatted ?? d.input)} ${d.valid ? c.green('VALID FORMAT') : c.red('NOT VALID')}`);
|
|
896
|
+
if (d.countryName)
|
|
897
|
+
out(` ${[d.countryName, d.bank ? `${d.bank.kind} ${d.bank.code}` : null, d.sortCode ? `sort code ${d.sortCode}` : null].filter(Boolean).join(' · ')}`);
|
|
898
|
+
for (const p of d.problems)
|
|
899
|
+
out(c.red(` x ${p}`));
|
|
900
|
+
for (const w of d.warnings)
|
|
901
|
+
out(c.yellow(` ! ${w}`));
|
|
902
|
+
for (const x of d.advice)
|
|
903
|
+
out(` → ${x}`);
|
|
904
|
+
});
|
|
905
|
+
},
|
|
906
|
+
async headers(o, a) {
|
|
907
|
+
let raw = a.pos.slice(1).join(' ').trim();
|
|
908
|
+
if (raw && existsSync(raw))
|
|
909
|
+
raw = readFileSync(raw, 'utf8');
|
|
910
|
+
if (!raw && !process.stdin.isTTY)
|
|
911
|
+
raw = readFileSync(0, 'utf8');
|
|
912
|
+
if (!raw)
|
|
913
|
+
throw new UsageError('usage: oculon headers <file> (or pipe the raw headers in: oculon headers < headers.txt)');
|
|
914
|
+
const r = await o.headerCheck(raw);
|
|
915
|
+
emit(a, r, () => {
|
|
916
|
+
const d = r.result;
|
|
917
|
+
const tone = d.verdict === 'likely spoofed' ? c.red : d.verdict === 'suspicious' ? c.yellow : c.green;
|
|
918
|
+
out(`${c.bold(d.from.address ?? 'unknown sender')} ${tone(d.verdict.toUpperCase())} ${c.dim(`risk ${d.risk}/100`)}`);
|
|
919
|
+
out(` SPF ${d.auth.spf ?? '?'} · DKIM ${d.auth.dkim ?? '?'} · DMARC ${d.auth.dmarc ?? '?'}`);
|
|
920
|
+
if (d.origin.ip)
|
|
921
|
+
out(` sent from ${d.origin.ip}${d.origin.country ? ` · ${d.origin.country}` : ''}${d.origin.isp ? ` · ${d.origin.isp}` : ''}`);
|
|
922
|
+
for (const f of d.flags)
|
|
923
|
+
out(c.yellow(` ! ${f}`));
|
|
924
|
+
for (const x of d.advice)
|
|
925
|
+
out(` → ${x}`);
|
|
926
|
+
printSources(r);
|
|
927
|
+
});
|
|
928
|
+
},
|
|
929
|
+
async lookalike(o, a) {
|
|
930
|
+
const q = String(a.pos[1] ?? '').trim();
|
|
931
|
+
if (!q)
|
|
932
|
+
throw new UsageError('usage: oculon lookalike <domain>');
|
|
933
|
+
const r = await o.lookalikes(q);
|
|
934
|
+
emit(a, r, () => {
|
|
935
|
+
const d = r.result;
|
|
936
|
+
const tone = d.risk === 'high' ? c.red : d.risk === 'medium' ? c.yellow : c.green;
|
|
937
|
+
out(`${c.bold(d.domain)} ${tone(`${d.risk.toUpperCase()} RISK`)} ${c.dim(`${d.live.length} of ${d.checked} lookalikes exist`)}`);
|
|
938
|
+
for (const l of d.live.slice(0, 25))
|
|
939
|
+
out(` ${l.domain.padEnd(34)} ${c.dim(l.kind)}${l.mx ? c.yellow(' mail') : ''}${l.certSeen ? c.red(` cert ${l.certSeen.slice(0, 10)}`) : ''}`);
|
|
940
|
+
if (d.certs.length) {
|
|
941
|
+
out(c.bold(' Certificates naming the brand, last 90 days'));
|
|
942
|
+
for (const x of d.certs.slice(0, 12))
|
|
943
|
+
out(` ${x.firstSeen.slice(0, 10)} ${x.name} ${c.dim(x.issuer)}`);
|
|
944
|
+
}
|
|
945
|
+
out(c.dim(` ${d.note}`));
|
|
946
|
+
printSources(r);
|
|
947
|
+
});
|
|
948
|
+
},
|
|
949
|
+
async honeypot(o, a) {
|
|
950
|
+
const q = String(a.pos[1] ?? '').trim();
|
|
951
|
+
if (!q)
|
|
952
|
+
throw new UsageError('usage: oculon honeypot <token address> [--chain eth|bsc|base]');
|
|
953
|
+
const r = await o.honeypotCheck(q, typeof a.flags.chain === 'string' ? { chain: a.flags.chain } : {});
|
|
954
|
+
emit(a, r, () => {
|
|
955
|
+
const d = r.result;
|
|
956
|
+
const tone = d.verdict === 'honeypot' || d.verdict === 'high risk' ? c.red : d.verdict === 'caution' ? c.yellow : c.green;
|
|
957
|
+
out(`${c.bold(d.symbol ?? d.address)} on ${d.chain} ${tone(d.verdict.toUpperCase())}`);
|
|
958
|
+
out(` buy tax ${d.buyTax ?? '?'}% · sell tax ${d.sellTax ?? '?'}%${d.holders ? ` · ${d.holders.failed} of ${d.holders.checked} recent holders could not sell` : ''}`);
|
|
959
|
+
for (const x of d.reasons)
|
|
960
|
+
out(c.yellow(` ! ${x}`));
|
|
961
|
+
for (const x of d.advice)
|
|
962
|
+
out(` → ${x}`);
|
|
963
|
+
printSources(r);
|
|
964
|
+
});
|
|
965
|
+
},
|
|
966
|
+
async address(o, a) {
|
|
967
|
+
const q = String(a.pos[1] ?? '').trim();
|
|
968
|
+
if (!q)
|
|
969
|
+
throw new UsageError('usage: oculon address <crypto address> [--network robinhood]');
|
|
970
|
+
const r = await o.addressCheck(q, typeof a.flags.network === 'string' ? { network: a.flags.network } : {});
|
|
971
|
+
emit(a, r, () => {
|
|
972
|
+
const d = r.result;
|
|
973
|
+
out(`${c.bold(d.address)} ${d.sanctioned ? c.red('SANCTIONED') : d.warnings.length ? c.yellow('CHECK FIRST') : c.green('NO RED FLAGS')}`);
|
|
974
|
+
out(` ${d.format}${d.network ? ` · ${d.network}` : ''}`);
|
|
975
|
+
if (d.activity)
|
|
976
|
+
out(` ${[d.activity.label, d.activity.balance, d.activity.txCount !== null ? `${d.activity.txCount} transactions` : null, d.activity.isContract ? 'smart contract' : null].filter(Boolean).join(' · ')}`);
|
|
977
|
+
for (const w of d.warnings)
|
|
978
|
+
out(c.yellow(` ! ${w}`));
|
|
979
|
+
for (const x of d.advice)
|
|
980
|
+
out(` → ${x}`);
|
|
981
|
+
printSources(r);
|
|
982
|
+
});
|
|
983
|
+
},
|
|
984
|
+
async satellite(o, a) {
|
|
985
|
+
const r = await o.satellites(a.pos.slice(1).join(' ').trim());
|
|
986
|
+
emit(a, r, () => {
|
|
987
|
+
const d = r.result;
|
|
988
|
+
if (d.mode === 'recent') {
|
|
989
|
+
out(`${c.bold('Launched in the last 30 days')} ${c.dim(`${d.total} objects`)}`);
|
|
990
|
+
for (const l of d.launches.slice(0, 20))
|
|
991
|
+
out(` ${c.dim(l.id)} ${l.names.join(', ')} ${c.dim(`(${l.objects})`)}`);
|
|
992
|
+
}
|
|
993
|
+
else {
|
|
994
|
+
if (!d.objects.length)
|
|
995
|
+
out(c.yellow(` ${d.note}`));
|
|
996
|
+
for (const x of d.objects) {
|
|
997
|
+
out(`${c.bold(x.name)} ${c.dim(`NORAD ${x.norad} · ${x.intlId}`)}${x.status ? ` ${x.status}` : ''}`);
|
|
998
|
+
if (x.orbit)
|
|
999
|
+
out(` ${x.orbit.regime} ${x.orbit.perigeeKm}-${x.orbit.apogeeKm} km · ${x.orbit.periodMin} min · ${x.orbit.inclination}°`);
|
|
1000
|
+
const meta = [x.owner && `owner ${x.owner}`, x.type, x.launchDate && `launched ${x.launchDate}`, x.decayed && `decayed ${x.decayed}`].filter(Boolean);
|
|
1001
|
+
if (meta.length)
|
|
1002
|
+
out(c.dim(` ${meta.join(' · ')}`));
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
printSources(r);
|
|
1006
|
+
});
|
|
1007
|
+
},
|
|
714
1008
|
async papers(o, a) {
|
|
715
1009
|
const topic = a.pos.slice(1).join(' ').trim();
|
|
716
1010
|
if (!topic)
|
|
@@ -1800,6 +2094,7 @@ export const COMMANDS = {
|
|
|
1800
2094
|
allowedChats: (process.env.TELEGRAM_ALLOWED_CHATS ?? '').split(',').map((s) => s.trim()).filter(Boolean),
|
|
1801
2095
|
alertMinScore: Number(process.env.TELEGRAM_ALERT_MIN_SCORE ?? 70),
|
|
1802
2096
|
watchMinutes: 0,
|
|
2097
|
+
scheduleMinutes: Number(a.flags.watch ?? 0),
|
|
1803
2098
|
oculon: o,
|
|
1804
2099
|
log: (m) => log(`telegram ${m}`),
|
|
1805
2100
|
});
|
|
@@ -1865,6 +2160,8 @@ export const COMMANDS = {
|
|
|
1865
2160
|
['on-chain', ['ZERION_API_KEY', 'ETHERSCAN_API_KEY', 'WEBACY_API_KEY', 'HELIUS_API_KEY', 'ROBINHOOD_PUBLIC_RPC_URL']],
|
|
1866
2161
|
['companies', ['ADZUNA_APP_KEY', 'COURTLISTENER_TOKEN', 'COMPANIES_HOUSE_API_KEY', 'BRANDFETCH_API_KEY']],
|
|
1867
2162
|
['web security', ['URLSCAN_API_KEY', 'SAFE_BROWSING_KEY', 'ABUSECH_AUTH_KEY']],
|
|
2163
|
+
['threat intel', ['ABUSEIPDB_API_KEY', 'OTX_API_KEY', 'IPINFO_TOKEN', 'VIRUSTOTAL_API_KEY']],
|
|
2164
|
+
['phone', ['NUMVERIFY_API_KEY']],
|
|
1868
2165
|
['fact checks', ['GOOGLE_API_KEY']],
|
|
1869
2166
|
['social/research', ['YOUTUBE_API_KEY', 'BLUESKY_APP_PASSWORD', 'OPENALEX_API_KEY']],
|
|
1870
2167
|
['air quality', ['OPENAQ_API_KEY']],
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal EVM cryptography with no dependencies: keccak256 and secp256k1 public-key recovery, enough to
|
|
3
|
+
* check an Ethereum "personal_sign" signature (Sign-In with Ethereum) and turn it into the signer's address.
|
|
4
|
+
* Plain BigInt arithmetic: slow next to native code, but a sign-in needs one recovery.
|
|
5
|
+
*/
|
|
6
|
+
/** Keccak-256 as used by Ethereum (original Keccak padding, not NIST SHA3-256). */
|
|
7
|
+
export declare function keccak256(data: Uint8Array | string): Uint8Array;
|
|
8
|
+
export declare const toHex: (b: Uint8Array) => string;
|
|
9
|
+
export declare const fromHex: (h: string) => Uint8Array<ArrayBuffer>;
|
|
10
|
+
/** Recover the uncompressed public key (64 bytes, x||y) from a message hash and an (r, s, recovery id) signature. */
|
|
11
|
+
export declare function recoverPublicKey(hash: Uint8Array, r: bigint, s: bigint, recId: number): Uint8Array | null;
|
|
12
|
+
export declare const addressOf: (pub64: Uint8Array) => string;
|
|
13
|
+
/** The address of a private key (used by tests to build signatures). */
|
|
14
|
+
export declare function addressFromPrivateKey(priv: bigint): string;
|
|
15
|
+
/** A 65-byte Ethereum signature (r, s, v) over a 32-byte hash, low-s. `k` must be a fresh random nonce. Tests use it; Oculon never holds keys. */
|
|
16
|
+
export declare function signHash(hash: Uint8Array, priv: bigint, k: bigint): string;
|
|
17
|
+
/** The hash Ethereum wallets sign for personal_sign: keccak256("\x19Ethereum Signed Message:\n" + length + message). */
|
|
18
|
+
export declare function personalHash(message: string): Uint8Array;
|
|
19
|
+
/** The lower-case address that signed a personal_sign message, or null if the signature is malformed. */
|
|
20
|
+
export declare function recoverPersonalSigner(message: string, signature: string): string | null;
|