Skip to content

Commit

Permalink
Working patch 2024-11-28
Browse files Browse the repository at this point in the history
  • Loading branch information
fa2a5qj3 committed Nov 28, 2024
1 parent 9e59b69 commit 0194d70
Show file tree
Hide file tree
Showing 7 changed files with 453 additions and 541 deletions.
20 changes: 10 additions & 10 deletions backend/src/api/bisq/bisq.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ class BisqRoutes {
res.send(result.toString());
}

private getBisqTransaction(req: Request, res: Response) {
const result = bisq.getTransaction(req.params.txId);
private async getBisqTransaction(req: Request, res: Response) {
const result = await bisq.$getTransaction(req.params.txId);
if (result) {
res.json(result);
} else {
res.status(404).send('Bisq transaction not found');
}
}

private getBisqTransactions(req: Request, res: Response) {
private async getBisqTransactions(req: Request, res: Response) {
const types: string[] = [];
req.query.types = req.query.types || [];
if (!Array.isArray(req.query.types)) {
Expand All @@ -64,30 +64,30 @@ class BisqRoutes {

const index = parseInt(req.params.index, 10) || 0;
const length = parseInt(req.params.length, 10) > 100 ? 100 : parseInt(req.params.length, 10) || 25;
const [transactions, count] = bisq.getTransactions(index, length, types);
const [transactions, count] = await bisq.$getTransactions(index, length, types);
res.header('X-Total-Count', count.toString());
res.json(transactions);
}

private getBisqBlock(req: Request, res: Response) {
const result = bisq.getBlock(req.params.hash);
private async getBisqBlock(req: Request, res: Response) {
const result = await bisq.$getBlock(req.params.hash);
if (result) {
res.json(result);
} else {
res.status(404).send('Bisq block not found');
}
}

private getBisqBlocks(req: Request, res: Response) {
private async getBisqBlocks(req: Request, res: Response) {
const index = parseInt(req.params.index, 10) || 0;
const length = parseInt(req.params.length, 10) > 100 ? 100 : parseInt(req.params.length, 10) || 25;
const [transactions, count] = bisq.getBlocks(index, length);
const [transactions, count] = await bisq.$getBlocks(index, length);
res.header('X-Total-Count', count.toString());
res.json(transactions);
}

private getBisqAddress(req: Request, res: Response) {
const result = bisq.getAddress(req.params.address.substr(1));
private async getBisqAddress(req: Request, res: Response) {
const result = await bisq.$getAddress(req.params.address.substr(1));
if (result) {
res.json(result);
} else {
Expand Down
Loading

0 comments on commit 0194d70

Please sign in to comment.