Skip to content

Commit

Permalink
Merge pull request #216 from porters-xyz/redeem-widget
Browse files Browse the repository at this point in the history
Redeem widget
  • Loading branch information
wtfsayo authored May 3, 2024
2 parents b22f71b + 85aa008 commit 17abd87
Show file tree
Hide file tree
Showing 5 changed files with 1,358 additions and 542 deletions.
7 changes: 3 additions & 4 deletions web-portal/backend/src/utils/utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Injectable, Inject, HttpException, HttpStatus } from '@nestjs/common';
import { CustomPrismaService } from 'nestjs-prisma';
import { PrismaClient, TransactionType } from '@/.generated/client';
import { Cron, CronExpression } from '@nestjs/schedule';
import { Log, parseAbiItem } from 'viem';
import { Log, parseAbiItem, fromHex } from 'viem';
import { viemClient } from './viemClient';
import web3 from 'web3';


interface IParsedLog {
tenantId: string;
Expand Down Expand Up @@ -151,8 +151,7 @@ export class UtilsService {
});

const parsedLogs: IParsedLog[] = logs.map((log: any) => ({
tenantId: web3.utils
.toAscii(log?.args?._identifier!)
tenantId: fromHex(log?.args?._identifier!, 'string')
.replaceAll(`\x00`, ''),
amount: Number(log?.args?._amount!),
referenceId: log.transactionHash!,
Expand Down
Loading

0 comments on commit 17abd87

Please sign in to comment.