mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
- 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>
22 lines
777 B
TypeScript
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
|
|
}
|