Skip to content

Commit

Permalink
Merge pull request #29 from klayrHQ/validator-recipient
Browse files Browse the repository at this point in the history
added validator recipient
  • Loading branch information
Theezr authored Aug 12, 2024
2 parents 498f878 + a358d9d commit c7f57cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/transaction/transaction.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ export class TransactionService {
totalBurntPerBlock: Map<number, UpdateBlockFee>;
}): Promise<Prisma.TransactionCreateManyInput> {
const { tx, height, index, totalBurntPerBlock } = params;
const txParams = this.nodeApiService.decodeTxData(tx.module, tx.command, tx.params);
const txParams: any = this.nodeApiService.decodeTxData(tx.module, tx.command, tx.params);

const recipientAddress = txParams['recipientAddress'] || null;
const recipientAddress =
txParams?.recipientAddress || txParams?.stakes?.[0]?.validatorAddress || null;
const senderAddress = getKlayr32AddressFromPublicKey(tx.senderPublicKey);

await this.handleAccounts(tx, senderAddress, recipientAddress);
Expand Down

0 comments on commit c7f57cb

Please sign in to comment.