token-safety-react 1.0.0

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 ADDED
@@ -0,0 +1,45 @@
1
+ # token-safety-react
2
+
3
+ React component for the [Antigravity Token Safety Scanner](https://antigravity-connect-ia.vercel.app/token-safety). Embed a token scanner widget in any React/Next.js app with one component.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install token-safety-react
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```jsx
14
+ import { TokenScanner } from "token-safety-react";
15
+
16
+ export default function Page() {
17
+ return (
18
+ <div>
19
+ <h1>Check any token for rug pulls</h1>
20
+ <TokenScanner />
21
+ </div>
22
+ );
23
+ }
24
+ ```
25
+
26
+ ### With props
27
+
28
+ ```jsx
29
+ <TokenScanner theme="light" />
30
+ ```
31
+
32
+ ## Props
33
+
34
+ | Prop | Type | Default | Description |
35
+ |-----------|---------------------|---------|----------------------------|
36
+ | `theme` | `"dark" \| "light"` | `dark` | Color theme |
37
+ | `address` | `string` | — | Pre-fill address (TBD) |
38
+
39
+ ## How it works
40
+
41
+ The component loads the embed script from the Antigravity scanner API and renders a `<token-scanner-widget>` custom element. Users can paste any Base chain token address and get an instant safety score.
42
+
43
+ ## Web
44
+
45
+ Full interactive scanner: [antigravity-connect-ia.vercel.app/token-safety](https://antigravity-connect-ia.vercel.app/token-safety)
package/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+
3
+ interface TokenScannerProps {
4
+ theme?: "dark" | "light";
5
+ address?: string;
6
+ }
7
+
8
+ export const TokenScanner: React.FC<TokenScannerProps>;
package/index.js ADDED
@@ -0,0 +1,30 @@
1
+ const { useEffect, useRef } = require("react");
2
+
3
+ const BASE_URL = "https://antigravity-connect-ia.vercel.app";
4
+
5
+ function TokenScanner({ theme, address } = {}) {
6
+ const ref = useRef(null);
7
+ const loadedRef = useRef(false);
8
+
9
+ useEffect(() => {
10
+ if (loadedRef.current) return;
11
+ loadedRef.current = true;
12
+
13
+ const script = document.createElement("script");
14
+ script.src = `${BASE_URL}/embed.js`;
15
+ script.async = true;
16
+ document.body.appendChild(script);
17
+
18
+ return () => {
19
+ script.remove();
20
+ };
21
+ }, []);
22
+
23
+ const attrs = {};
24
+ if (theme) attrs.theme = theme;
25
+ if (address) attrs.address = address;
26
+
27
+ return <token-scanner-widget {...attrs} ref={ref} />;
28
+ }
29
+
30
+ module.exports = { TokenScanner };
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "token-safety-react",
3
+ "version": "1.0.0",
4
+ "description": "React component for the Antigravity Token Safety Scanner. Embed a token scanner widget in any React/Next.js app with one component. Detects rug pulls, honeypots, and scams on Base chain.",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "files": ["index.js", "index.d.ts", "README.md"],
8
+ "keywords": [
9
+ "react",
10
+ "token-scanner",
11
+ "rug-pull-detector",
12
+ "honeypot-checker",
13
+ "crypto-security",
14
+ "base-chain",
15
+ "web3",
16
+ "react-component",
17
+ "nextjs"
18
+ ],
19
+ "peerDependencies": {
20
+ "react": ">=16.8.0"
21
+ },
22
+ "author": "Antigravity Labs",
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/josemiguel3125-sketch/live-agent-os-infra.git"
27
+ }
28
+ }