Skip to content

Commit

Permalink
ccd-js-gen: Generate code for parsing return types
Browse files Browse the repository at this point in the history
  • Loading branch information
limemloh committed Oct 2, 2023
1 parent ade0288 commit 1e3d043
Show file tree
Hide file tree
Showing 4 changed files with 1,008 additions and 595 deletions.
7 changes: 6 additions & 1 deletion examples/ccd-js-gen/wCCD/client-tokenMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ const contractAddress = SDK.ContractAddress.create(
),
parameter
);
console.log({ result });
const returnValue =
wCCDContractClient.parseReturnValueTokenMetadata(result);
console.log(
'The token metadata for wCCD can be found at: ',
returnValue?.[0].url
);
})();
15 changes: 13 additions & 2 deletions packages/ccd-js-gen/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ export async function main(): Promise<void> {
.parse(process.argv);
const options = program.opts<Options>();
console.log('Generating smart contract clients...');
await lib.generateContractClientsFromFile(options.module, options.outDir);
console.log('Done');

const startTime = Date.now();
await lib.generateContractClientsFromFile(options.module, options.outDir, {
onProgress(update) {
if (update.type === 'Progress') {
console.log(
`[${update.doneItems}/${update.totalItems}] ${update.spentTime}ms`
);
}
},
});

console.log(`Done in ${Date.now() - startTime}ms`);
}
Loading

0 comments on commit 1e3d043

Please sign in to comment.