fix cmd outputs #33

Merged
0xmuralik merged 6 commits from murali/output into main 2023-03-28 12:30:56 +00:00
3 changed files with 6 additions and 3 deletions
Showing only changes of commit 9b9e8829ec - Show all commits

View File

@ -23,5 +23,6 @@ export const handler = async (argv: Arguments) => {
const fee = getGasAndFees(argv, cnsConfig); const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.deleteName({ crn: name }, privateKey, fee); const result = await registry.deleteName({ crn: name }, privateKey, fee);
console.log(JSON.stringify(result, undefined, 2)); const success = `{"success":${result.code==0}}`
console.log(argv.verbose ? JSON.stringify(result, undefined, 2): JSON.stringify(JSON.parse(success)));
} }

View File

@ -21,5 +21,6 @@ export const handler = async (argv: Arguments) => {
const registry = new Registry(gqlEndpoint, restEndpoint, chainId); const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.resolveNames([name]); const result = await registry.resolveNames([name]);
console.log(JSON.stringify(result, undefined, 4)); const success = `{"success":${result.code==0}}`
console.log(argv.verbose ? JSON.stringify(result, undefined, 2): JSON.stringify(JSON.parse(success)));
} }

View File

@ -25,5 +25,6 @@ export const handler = async (argv: Arguments) => {
const fee = getGasAndFees(argv, cnsConfig); const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.setName({ crn: name, cid: id }, privateKey, fee); const result = await registry.setName({ crn: name, cid: id }, privateKey, fee);
console.log(JSON.stringify(result, undefined, 2)); const success = `{"success":${result.code==0}}`
console.log(argv.verbose ? JSON.stringify(result, undefined, 2): JSON.stringify(JSON.parse(success)));
} }