diff --git a/.changeset/popular-items-rush.md b/.changeset/popular-items-rush.md new file mode 100644 index 0000000000..d5cfc59855 --- /dev/null +++ b/.changeset/popular-items-rush.md @@ -0,0 +1,5 @@ +--- +"@kadena/graph": patch +--- + +Fixed issue when finding cross chain transfer when original transfer is the starting one diff --git a/packages/apps/graph/src/graph/objects/transfer.ts b/packages/apps/graph/src/graph/objects/transfer.ts index bdc01dffe5..065020dda7 100644 --- a/packages/apps/graph/src/graph/objects/transfer.ts +++ b/packages/apps/graph/src/graph/objects/transfer.ts @@ -78,11 +78,14 @@ export default builder.prismaNode(Prisma.ModelName.Transfer, { // Filter the transactions to find the counterTransaction let counterTransaction = transactions.find( (transaction) => - transaction.pactId === parent.requestKey || - (transaction.blockHash === parent.blockHash && - transaction.requestKey === parent.requestKey && - transaction.pactId !== null && - transaction.pactId !== undefined), + (transaction.pactId === parent.requestKey || + (transaction.blockHash === parent.blockHash && + transaction.requestKey === parent.requestKey && + transaction.pactId !== null && + transaction.pactId !== undefined)) && + transaction.transfers.find((transfer) => + transfer.amount.equals(new Decimal(parent.amount)), + ), ); if (!counterTransaction) {