Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ docx/
# Added by Autocommiter: ensure *.env*
*.env*
# Added by Autocommiter: ensure .docx/
.docx/
.docx/*.nexus.backup
17 changes: 17 additions & 0 deletions blockintel-gate.ts
Original file line number Diff line number Diff line change
@@ -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<unknown> },
tx: unknown
): Promise<unknown> {
return gate.guard(ctx, async () => signer.sendTransaction(tx));
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -37,4 +38,4 @@
"tailwindcss": "^3.4.18",
"typescript": "^5.9.3"
}
}
}