bond and records outputs
This commit is contained in:
parent
495bbfdb3c
commit
d3020daf2e
@ -30,5 +30,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.associateBond({ recordId: id, bondId }, 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)));
|
||||
}
|
||||
|
@ -22,5 +22,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.cancelBond({ 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)));
|
||||
}
|
||||
|
@ -36,5 +36,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const bondId = await registry.getNextBondId(privateKey);
|
||||
const result = await registry.createBond({ denom, amount }, privateKey, fee);
|
||||
console.log(true ? JSON.stringify(result, undefined, 2)+"\nBondId:"+bondId : bondId);
|
||||
const jsonString=`{"bondId":"${bondId}"}`
|
||||
console.log(verbose ? JSON.stringify(result, undefined, 2) : JSON.stringify(JSON.parse(jsonString),null,2));
|
||||
}
|
||||
|
@ -22,5 +22,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.dissociateBond({ recordId: 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)));
|
||||
}
|
||||
|
@ -28,5 +28,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.dissociateRecords({ bondId }, 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)));
|
||||
}
|
||||
|
@ -33,5 +33,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.reassociateRecords({ oldBondId, newBondId }, 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)));
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import assert from 'assert';
|
||||
import { Registry } from '@cerc-io/laconic-sdk';
|
||||
|
||||
import { getConfig, getConnectionInfo, getGasAndFees } from '../../../util';
|
||||
import { isNil } from 'lodash';
|
||||
|
||||
export const command = 'refill';
|
||||
|
||||
@ -36,5 +37,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.refillBond({ id, denom, amount }, 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)));
|
||||
}
|
||||
|
@ -36,5 +36,6 @@ export const handler = async (argv: Arguments) => {
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.withdrawBond({ id, denom, amount }, 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)));
|
||||
}
|
||||
|
@ -40,5 +40,5 @@ export const handler = async (argv: Arguments) => {
|
||||
const fee = getGasAndFees(argv, cnsConfig);
|
||||
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey as string, fee);
|
||||
|
||||
console.log(verbose ? JSON.stringify(result, undefined, 2) : result.data);
|
||||
console.log(verbose ? JSON.stringify(result, undefined, 2) : JSON.stringify(result.data,undefined,2));
|
||||
}
|
||||
|
7
watcher.yml
Normal file
7
watcher.yml
Normal file
@ -0,0 +1,7 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://cerc.io'
|
||||
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||
build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||
tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
version: 1.0.35
|
Loading…
Reference in New Issue
Block a user