Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into main #13

Merged
merged 11 commits into from
Jul 25, 2024
Next Next commit
chore: manifest.json
  • Loading branch information
gentlementlegen committed Jul 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 3f78eb1017efc3d1f58a5d676084f23106cc43c8
11 changes: 11 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Wallet",
"description": "Allows users to register their wallets to collect rewards.",
"commands": [
{
"command": "/wallet",
"example": "/wallet ubiquibot.eth",
"description": "Wallet address to query, e.g. 0x000000000000000000000000000000000000001 or ubiquibot.eth"
}
]
}
9 changes: 9 additions & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { Value } from "@sinclair/typebox/value";
import { plugin } from "./plugin";
import { Env, envValidator, pluginSettingsSchema, pluginSettingsValidator } from "./types";
import manifest from "../manifest.json";

export default {
async fetch(request: Request, env: Env): Promise<Response> {
try {
if (request.method === "GET") {
const url = new URL(request.url);
if (url.pathname === "/manifest.json") {
return new Response(JSON.stringify(manifest), {
headers: { "content-type": "application/json" },
});
}
}
if (request.method !== "POST") {
return new Response(JSON.stringify({ error: `Only POST requests are supported.` }), {
status: 405,