name outputs

This commit is contained in:
0xmuralik 2023-03-27 16:58:14 +05:30
parent 1de17a40ef
commit 9b9e8829ec
3 changed files with 6 additions and 3 deletions

View File

@ -23,5 +23,6 @@ export const handler = async (argv: Arguments) => {
const fee = getGasAndFees(argv, cnsConfig);
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 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 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)));
}