Skip to main content

Interface.IDppService

Digital Product Passport (DPP) operations.

Provides methods to retrieve product information and claim DPPs on the blockchain. All claim operations return a transaction hash that can be used to track the on-chain transaction status.

Example

// Retrieve a product sheet
const productSheet = await dppService.getProductSheet("prod_123");
console.log(productSheet.name, productSheet.description);

// Claim a DPP with explicit product sheet and DPP IDs
const { transactionHash } = await dppService.claim("prod_123", "dpp_456");
console.log("Transaction:", transactionHash);

// Claim a DPP using a magic token (single-use claim link)
const result = await dppService.magicClaim("prod_123", "magic_xyz");

Properties

PropertyTypeDescription
claim(productSheetId: string, dppId: string) => Promise<{ dppId: string; tokenId: string; transactionHash: string; }>Claims a Digital Product Passport (DPP) on the blockchain. Associates a specific DPP instance with the authenticated user's account by creating an on-chain claim transaction. The user must be authenticated and authorized to claim the specified DPP. Throws If authentication fails, DPP is already claimed, or transaction fails Example const result = await dppService.claim("prod_shirt_001", "dpp_serial_12345"); console.log("DPP claimed! Transaction:", result); // transactionHash format: "0x..." (Ethereum) or similar depending on network
getProductSheet(productSheetId: string) => Promise<{ application: string; certifiedPaths?: string[]; createdAt: string; data: { brand?: { description?: string; identifier?: string; image?: string; name?: string; }; countryOfOrigin?: { description?: string; identifier?: string; image?: string; name?: string; }; description?: string; gtin?: string; identifier?: string; image?: string; keywords?: string[]; name?: string; sku?: string; }; id: string; network: | "EthereumAnvil" | "PolygonAmoy" | "StarknetDevnet" | "StarknetSepolia" | "StarknetMainnet" | "StellarMainnet" | "StellarQuickstart" | "StellarTestnet"; status: "ACTIVE" | "ARCHIVED" | "DRAFT" | "UNLISTED"; updatedAt: string; }>Retrieves a single product sheet by ID. Returns comprehensive product information including name, description, images, brand, country of origin, identifiers (GTIN, SKU), certification paths, network status, and timestamps. Throws If the product sheet is not found or the user lacks permission Example const sheet = await dppService.getProductSheet("prod_abc123"); console.log("Product:", sheet.name, "by", sheet.brand); console.log("Status:", sheet.status); // "ACTIVE", "ARCHIVED", "DRAFT", "UNLISTED"
magicClaim(productSheetId: string, magicToken: string) => Promise<{ dppId: string; tokenId: string; transactionHash: string; }>Claims a Digital Product Passport using a single-use magic token. Simplified claim flow using a pre-authorized token (typically from a QR code or claim link). The magic token embeds the DPP authorization, allowing claim without explicitly specifying the DPP ID. Throws If the token is invalid, expired, already used, or transaction fails Example // Magic token typically obtained from scanning QR code or clicking claim link const magicToken = "*****"; const result = await dppService.magicClaim("prod_shirt_001", magicToken); console.log("DPP claimed via magic link!", result);