-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mathieu Lefebvre
committed
Oct 23, 2023
1 parent
6381514
commit 84ab7fa
Showing
8 changed files
with
177 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Logger, type ILogObj } from "tslog"; | ||
import { name } from "../package.json" assert { type: "json" }; | ||
|
||
class TsLogger extends Logger<ILogObj> { | ||
constructor() { | ||
super(); | ||
this.settings.minLevel = 5; | ||
this.settings.name = name; | ||
} | ||
|
||
public enable(type: "pretty" | "json" = "pretty") { | ||
this.settings.type = type; | ||
this.settings.minLevel = 0; | ||
} | ||
|
||
public disable() { | ||
this.settings.type = "hidden"; | ||
} | ||
} | ||
|
||
export const logger = new TsLogger(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,66 @@ | ||
import { createRoute } from '@hono/zod-openapi'; | ||
import * as schemas from './schemas'; | ||
|
||
|
||
import { createRoute } from "@hono/zod-openapi"; | ||
import * as schemas from "./schemas"; | ||
|
||
export const indexRoute = createRoute({ | ||
method: 'get', | ||
path: '/', | ||
method: "get", | ||
path: "/", | ||
responses: { | ||
200: { | ||
description: 'Index page banner.', | ||
description: "Index page banner.", | ||
}, | ||
}, | ||
}); | ||
|
||
|
||
export const TotalSupplyQueryRoute = createRoute({ | ||
method: 'get', | ||
path: '/supply', | ||
method: "get", | ||
path: "/supply", | ||
request: { | ||
query: schemas.SupplySchema, | ||
}, | ||
responses: { | ||
200: { | ||
content: { | ||
'application/json': { | ||
"application/json": { | ||
schema: schemas.SupplyResponseSchema, | ||
}, | ||
}, | ||
description: 'Get the total supply of an ERC20 contract', | ||
description: "Get the total supply of an ERC20 contract", | ||
}, | ||
}, | ||
}); | ||
|
||
|
||
export const ContractQueryRoute = createRoute({ | ||
method: 'get', | ||
path: '/contract', | ||
method: "get", | ||
path: "/contract", | ||
request: { | ||
query: schemas.ContractSchema, | ||
}, | ||
responses: { | ||
200: { | ||
content: { | ||
'application/json': { | ||
"application/json": { | ||
schema: schemas.ContractResponseSchema, | ||
}, | ||
}, | ||
description: 'Get the ERC20 contract information', | ||
description: "Get the ERC20 contract information", | ||
}, | ||
}, | ||
}); | ||
|
||
|
||
export const BalanceQueryRoute = createRoute({ | ||
method: 'get', | ||
path: '/balance', | ||
method: "get", | ||
path: "/balance", | ||
request: { | ||
query: schemas.BalanceSchema, | ||
}, | ||
responses: { | ||
200: { | ||
content: { | ||
'application/json': { | ||
"application/json": { | ||
schema: schemas.BalanceResponseSchema, | ||
}, | ||
}, | ||
description: 'Get the ERC20 contract information', | ||
description: "Get the ERC20 contract information", | ||
}, | ||
}, | ||
}); | ||
}); |
Oops, something went wrong.