diff --git a/.gitignore b/.gitignore index 3fba1e7..dd06ffa 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,4 @@ docx/ # Added by Autocommiter: ensure *.env* *.env* # Added by Autocommiter: ensure .docx/ -.docx/ +.docx/*.nexus.backup diff --git a/blockintel-gate.ts b/blockintel-gate.ts new file mode 100644 index 0000000..cd45543 --- /dev/null +++ b/blockintel-gate.ts @@ -0,0 +1,17 @@ +/** + * BlockIntel Gate — use sendWithGate(signer, tx) for Gate-protected transaction sends. + * Replace signer.sendTransaction(tx) with: + * import { sendWithGate } from "./blockintel-gate"; + * await sendWithGate(signer, tx); + */ +import { Gate } from "blockintel-gate-sdk"; + +const gate = new Gate({ apiKey: process.env.BLOCKINTEL_API_KEY }); +const ctx = { requestId: "nexus_v1", reason: "opt-in" }; + +export async function sendWithGate( + signer: { sendTransaction: (tx: unknown) => Promise }, + tx: unknown +): Promise { + return gate.guard(ctx, async () => signer.sendTransaction(tx)); +} diff --git a/package.json b/package.json index b866fd8..714fdcf 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "react-hot-toast": "^2.5.2", "react-icons": "^5.5.0", "tailwind-merge": "^3.3.0", - "zustand": "^5.0.5" + "zustand": "^5.0.5", + "blockintel-gate-sdk": "^0.3.6" }, "devDependencies": { "@types/node": "20.19.23", @@ -37,4 +38,4 @@ "tailwindcss": "^3.4.18", "typescript": "^5.9.3" } -} +} \ No newline at end of file