diff --git a/packages/node-sdk/paima-utils-backend/src/cde-access-internals.ts b/packages/node-sdk/paima-utils-backend/src/cde-access-internals.ts index d84be6b60..4ecc48001 100644 --- a/packages/node-sdk/paima-utils-backend/src/cde-access-internals.ts +++ b/packages/node-sdk/paima-utils-backend/src/cde-access-internals.ts @@ -15,7 +15,12 @@ import { cdeCardanoPoolGetAddressDelegation, cdeCardanoAssetUtxosByAddress, } from '@paima/db'; -import type { OwnedNftsResponse, GenericCdeDataUnit, TokenIdPair } from './types.js'; +import type { + OwnedNftsResponse, + GenericCdeDataUnit, + TokenIdPair, + CardanoAssetUtxo, +} from './types.js'; /* Functions to retrieve CDE ID: */ @@ -197,7 +202,7 @@ export async function internalGetCardanoAssetUtxos( address: string, filterBy: string, value: string -): Promise<{ txId: string; outputIndex: number; amount: string }[]> { +): Promise { const arg = { address, [filterBy]: value }; const results = await cdeCardanoAssetUtxosByAddress.run(arg, readonlyDBConn); diff --git a/packages/node-sdk/paima-utils-backend/src/cde-access.ts b/packages/node-sdk/paima-utils-backend/src/cde-access.ts index 4f787fee2..8fd75c1c9 100644 --- a/packages/node-sdk/paima-utils-backend/src/cde-access.ts +++ b/packages/node-sdk/paima-utils-backend/src/cde-access.ts @@ -15,7 +15,12 @@ import { internalGetCardanoAddressDelegation, internalGetCardanoAssetUtxos, } from './cde-access-internals.js'; -import type { OwnedNftsResponse, GenericCdeDataUnit, TokenIdPair } from './types.js'; +import type { + OwnedNftsResponse, + GenericCdeDataUnit, + TokenIdPair, + CardanoAssetUtxo, +} from './types.js'; /** * Fetch the owner of the NFT from the database @@ -173,7 +178,7 @@ export async function getCardanoAssetUtxosByFingerprint( readonlyDBConn: Pool, address: string, cip14Fingerprint: string -): Promise<{ txId: string; outputIndex: number; amount: string }[]> { +): Promise { return await internalGetCardanoAssetUtxos( readonlyDBConn, address, @@ -186,6 +191,6 @@ export async function getCardanoAssetUtxosByPolicyId( readonlyDBConn: Pool, address: string, policyId: string -): Promise<{ txId: string; outputIndex: number; amount: string }[]> { +): Promise { return await internalGetCardanoAssetUtxos(readonlyDBConn, address, 'policy_id', policyId); } diff --git a/packages/node-sdk/paima-utils-backend/src/types.ts b/packages/node-sdk/paima-utils-backend/src/types.ts index 9308e3616..91502211c 100644 --- a/packages/node-sdk/paima-utils-backend/src/types.ts +++ b/packages/node-sdk/paima-utils-backend/src/types.ts @@ -9,3 +9,11 @@ export interface GenericCdeDataUnit { blockHeight: number; payload: any; } + +export interface CardanoAssetUtxo { + txId: string; + outputIndex: number; + amount: string; + policyId: string; + assetName: string; +}