aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-27 08:17:30 +0000
committerAdam Soltys <[email protected]>2024-11-27 08:17:32 +0000
commit19d257f9a794eead23a5e34a3bc948b4a4b8756d (patch)
tree9570f00e79b4c5e15e8247ed65b4005e7ccae9d4
parent430b17d26fa3fe2ef31c6fb0850882a9fd4c830c (diff)
downloadcoinos-server-19d257f9a794eead23a5e34a3bc948b4a4b8756d.tar.gz
coinos-server-19d257f9a794eead23a5e34a3bc948b4a4b8756d.zip
payload is body
-rw-r--r--index.ts2
-rw-r--r--lib/app.ts2
-rw-r--r--routes/ecash.ts4
3 files changed, 5 insertions, 3 deletions
diff --git a/index.ts b/index.ts
index 97b3a71d..f84560f2 100644
--- a/index.ts
+++ b/index.ts
@@ -132,6 +132,8 @@ app.post("/claim", auth, ecash.claim);
app.post("/mint", auth, ecash.mint);
app.post("/melt", auth, ecash.melt);
app.post("/ecash/:id", ecash.receive);
+app.get("/liquid-asset-proof-c938c75d110b18aed74b45caf613ebfc1eeb9f77ab48f85016eca850489d07c2", (_, res) => res.send("Authorize linking the domain name coinos.io to the Liquid asset c938c75d110b18aed74b45caf613ebfc1eeb9f77ab48f85016eca850489d07c2"));
+
app.post("/echo", (req, res) => {
console.log("echo", req.body);
diff --git a/lib/app.ts b/lib/app.ts
index 3b31a923..837d2647 100644
--- a/lib/app.ts
+++ b/lib/app.ts
@@ -46,7 +46,7 @@ app.addHook("onResponse", async (req, reply) => {
app.register(fastifyRateLimit, {
allowList: (req) => req.raw.url?.includes("public"),
- max: 500,
+ max: 2000,
timeWindow: 2000,
keyGenerator: (req) => req.headers["cf-connecting-ip"] as string,
errorResponseBuilder: () => {
diff --git a/routes/ecash.ts b/routes/ecash.ts
index a807cdb5..e5039aa4 100644
--- a/routes/ecash.ts
+++ b/routes/ecash.ts
@@ -144,8 +144,7 @@ export default {
async receive(req, res) {
try {
- const { payload } = req.body;
- const { id, proofs, mint, memo } = payload;
+ const { id, proofs, mint, memo } = req.body;
const { uid: ref } = await g(`invoice:${id}`);
const amount = await claim(
@@ -159,6 +158,7 @@ export default {
res.send({ id });
} catch (e) {
+ console.log(e);
err(e.message);
bail(res, e.message);
}