Skip to content

Commit

Permalink
cardano transfer: narrow credential relation filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Mar 25, 2024
1 parent b182760 commit 706c75d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/engine/paima-funnel/src/cde/cardanoTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Routes, query } from '@dcspark/carp-client';
import type { TxAndBlockInfo } from '@dcspark/carp-client';
import { Transaction } from '@dcspark/cardano-multiplatform-lib-nodejs';
import type { BlockTxPair } from '@dcspark/carp-client';
import { RelationFilterType } from '@dcspark/carp-client';

export default async function getCdeData(
url: string,
Expand All @@ -24,10 +25,18 @@ export default async function getCdeData(
): Promise<CdeCardanoTransferDatum[]> {
let result = [] as CdeCardanoTransferDatum[];

const relationFilter =
RelationFilterType.Output |
RelationFilterType.Input |
RelationFilterType.StakeRegistration |
RelationFilterType.StakeDeregistration |
RelationFilterType.StakeDelegation |
RelationFilterType.Withdrawal;

while (true) {
const event = await timeout(
query(url, Routes.transactionHistory, {
// TODO: maybe it should be Output
relationFilter,
addresses: [extension.credential],
slotLimits: {
from: fromAbsoluteSlot,
Expand Down

0 comments on commit 706c75d

Please sign in to comment.