cns -> lns to avoid variable collision
This commit is contained in:
parent
e0bb3ae3af
commit
1d47318073
@ -11,8 +11,8 @@ export const desc = 'Get account.';
|
|||||||
export const handler = async (argv: Arguments) => {
|
export const handler = async (argv: Arguments) => {
|
||||||
let address = argv.address as string;
|
let address = argv.address as string;
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -21,8 +21,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(quantity, 'Invalid token quantity.');
|
assert(quantity, 'Invalid token quantity.');
|
||||||
assert(denom, 'Invalid token type.');
|
assert(denom, 'Invalid token type.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
@ -40,7 +40,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
fs.writeFileSync(revealFilePath, JSON.stringify(reveal, undefined, 2));
|
fs.writeFileSync(revealFilePath, JSON.stringify(reveal, undefined, 2));
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
|
|
||||||
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
|
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
|
@ -16,15 +16,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(auctionId, 'Invalid auction ID.');
|
assert(auctionId, 'Invalid auction ID.');
|
||||||
assert(filePath, 'Invalid reveal file path.');
|
assert(filePath, 'Invalid reveal file path.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
|
|
||||||
const reveal = fs.readFileSync(path.resolve(filePath));
|
const reveal = fs.readFileSync(path.resolve(filePath));
|
||||||
const result = await registry.revealBid({ auctionId, reveal: reveal.toString('hex') }, privateKey, fee);
|
const result = await registry.revealBid({ auctionId, reveal: reveal.toString('hex') }, privateKey, fee);
|
||||||
|
@ -12,8 +12,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const { id, config } = argv;
|
const { id, config } = argv;
|
||||||
assert(id, 'Invalid auction ID.');
|
assert(id, 'Invalid auction ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(config as string)
|
const { services: { lns: lnsConfig } } = getConfig(config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -14,15 +14,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(name, 'Invalid authority name.');
|
assert(name, 'Invalid authority name.');
|
||||||
assert(bondId, 'Invalid Bond ID.');
|
assert(bondId, 'Invalid Bond ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
|
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -20,15 +20,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const owner = argv.owner as string;
|
const owner = argv.owner as string;
|
||||||
assert(name, 'Invalid authority name.');
|
assert(name, 'Invalid authority name.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
|
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
|
||||||
|
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
|
@ -12,8 +12,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const name = argv.name as string;
|
const name = argv.name as string;
|
||||||
assert(name, 'Invalid authority name.');
|
assert(name, 'Invalid authority name.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -20,15 +20,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(id, 'Invalid Record ID.');
|
assert(id, 'Invalid Record ID.');
|
||||||
assert(bondId, 'Invalid Bond ID.');
|
assert(bondId, 'Invalid Bond ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee);
|
const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -12,15 +12,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const id = argv.id as string
|
const id = argv.id as string
|
||||||
assert(id, 'Invalid Bond ID.');
|
assert(id, 'Invalid Bond ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.cancelBond({ id }, privateKey, fee);
|
const result = await registry.cancelBond({ id }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -25,15 +25,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(denom, 'Invalid Type.');
|
assert(denom, 'Invalid Type.');
|
||||||
assert(amount, 'Invalid Quantity.');
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(config as string)
|
const { services: { lns: lnsConfig } } = getConfig(config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.createBond({ denom, amount }, privateKey, fee);
|
const result = await registry.createBond({ denom, amount }, privateKey, fee);
|
||||||
console.log(verbose ? JSON.stringify(result, undefined, 2) : result.data);
|
console.log(verbose ? JSON.stringify(result, undefined, 2) : result.data);
|
||||||
}
|
}
|
||||||
|
@ -12,15 +12,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const id = argv.id as string;
|
const id = argv.id as string;
|
||||||
assert(id, 'Invalid Record ID.');
|
assert(id, 'Invalid Record ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.dissociateBond({ recordId: id }, privateKey, fee);
|
const result = await registry.dissociateBond({ recordId: id }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const { id, config } = argv;
|
const { id, config } = argv;
|
||||||
console.assert(id, 'Bond Id is required.');
|
console.assert(id, 'Bond Id is required.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(config as string)
|
const { services: { lns: lnsConfig } } = getConfig(config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -15,8 +15,8 @@ export const builder = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
export const handler = async (argv: Arguments) => {
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -18,15 +18,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const bondId = argv.bondId as string;
|
const bondId = argv.bondId as string;
|
||||||
assert(bondId, 'Invalid Bond ID.');
|
assert(bondId, 'Invalid Bond ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.dissociateRecords({ bondId }, privateKey, fee);
|
const result = await registry.dissociateRecords({ bondId }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -23,15 +23,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(oldBondId, 'Invalid Old Bond ID.');
|
assert(oldBondId, 'Invalid Old Bond ID.');
|
||||||
assert(newBondId, 'Invalid New Bond ID.');
|
assert(newBondId, 'Invalid New Bond ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee);
|
const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -26,15 +26,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(denom, 'Invalid Type.');
|
assert(denom, 'Invalid Type.');
|
||||||
assert(amount, 'Invalid Quantity.');
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.refillBond({ id, denom, amount }, privateKey, fee);
|
const result = await registry.refillBond({ id, denom, amount }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -26,15 +26,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(denom, 'Invalid Type.');
|
assert(denom, 'Invalid Type.');
|
||||||
assert(amount, 'Invalid Quantity.');
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee);
|
const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
}
|
}
|
||||||
|
@ -12,15 +12,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const name = argv.name as string;
|
const name = argv.name as string;
|
||||||
assert(name, 'Invalid Name.');
|
assert(name, 'Invalid Name.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
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));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
|
@ -18,8 +18,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const name = argv.name as string;
|
const name = argv.name as string;
|
||||||
assert(name, 'Invalid Name.');
|
assert(name, 'Invalid Name.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -12,8 +12,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const name = argv.name as string;
|
const name = argv.name as string;
|
||||||
assert(name, 'Invalid Name.');
|
assert(name, 'Invalid Name.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -14,15 +14,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(name, 'Invalid Name.');
|
assert(name, 'Invalid Name.');
|
||||||
assert(id, 'Invalid Record ID.');
|
assert(id, 'Invalid Record ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
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));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
|
@ -12,8 +12,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const { id, config } = argv;
|
const { id, config } = argv;
|
||||||
assert(id, 'Invalid Record ID.');
|
assert(id, 'Invalid Record ID.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(config as string)
|
const { services: { lns: lnsConfig } } = getConfig(config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -25,8 +25,8 @@ export const builder = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
export const handler = async (argv: Arguments) => {
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
const { type, name, bondId, all } = argv;
|
const { type, name, bondId, all } = argv;
|
||||||
|
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
|
@ -19,8 +19,8 @@ export const builder = {
|
|||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
export const handler = async (argv: Arguments) => {
|
||||||
const { txKey, filename, verbose, config } = argv;
|
const { txKey, filename, verbose, config } = argv;
|
||||||
const { services: { cns: cnsConfig } } = getConfig(config as string)
|
const { services: { lns: lnsConfig } } = getConfig(config as string)
|
||||||
const { restEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
|
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
@ -37,7 +37,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
|
|
||||||
const { record } = await yaml.load(fs.readFileSync(file, 'utf-8')) as any;
|
const { record } = await yaml.load(fs.readFileSync(file, 'utf-8')) as any;
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey as string, fee);
|
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) : result.data);
|
||||||
|
@ -9,8 +9,8 @@ export const command = 'status';
|
|||||||
export const desc = 'Get Registry status.';
|
export const desc = 'Get Registry status.';
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
export const handler = async (argv: Arguments) => {
|
||||||
const { services: { cns } } = getConfig(argv.config as string)
|
const { services: { lns } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cns);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, lns);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid Registry Chain ID.');
|
assert(chainId, 'Invalid Registry Chain ID.');
|
||||||
|
@ -26,8 +26,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(denom, 'Invalid Type.');
|
assert(denom, 'Invalid Type.');
|
||||||
assert(amount, 'Invalid Quantity.');
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
const { services: { cns: cnsConfig } } = getConfig(argv.config as string)
|
const { services: { lns: lnsConfig } } = getConfig(argv.config as string)
|
||||||
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, lnsConfig);
|
||||||
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
assert(restEndpoint, 'Invalid Registry REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid Registry GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
@ -37,7 +37,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const fromAddress = account.formattedCosmosAddress;
|
const fromAddress = account.formattedCosmosAddress;
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const fee = getGasAndFees(argv, cnsConfig);
|
const fee = getGasAndFees(argv, lnsConfig);
|
||||||
await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee);
|
await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee);
|
||||||
const result = await registry.getAccounts([fromAddress, destinationAddress]);
|
const result = await registry.getAccounts([fromAddress, destinationAddress]);
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
|
Loading…
Reference in New Issue
Block a user