fabric-samples/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/getAllAssets.ts
Mark S. Lewis 9540c443c8
Fix ESLint failures
- Updates to ESLint v10 and fixes lint failures.
- Aligns tsconfig on Node 20, which is the current minimum required Node
  version.
- Adds package-lock.json files to source control to avoid future random
  failures when dependencies update.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2026-02-25 13:53:45 +00:00

22 lines
777 B
TypeScript

/*
* Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
*
* SPDX-License-Identifier: Apache-2.0
*/
import { Gateway } from '@hyperledger/fabric-gateway';
import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
import { AssetTransfer } from '../contract';
export default async function main(gateway: Gateway): Promise<void> {
const network = gateway.getNetwork(CHANNEL_NAME);
const contract = network.getContract(CHAINCODE_NAME);
const smartContract = new AssetTransfer(contract);
const assets = await smartContract.getAllAssets();
const assetsJson = JSON.stringify(assets, undefined, 2);
assetsJson.split('\n').forEach(line => {
console.log(line);
}); // Write line-by-line to avoid truncation
}