Change in registry constructor (#8)

This commit was merged in pull request #8.
This commit is contained in:
2022-12-09 14:26:00 +05:30
committed by GitHub
parent 67819510f7
commit ea55cbdc7a
27 changed files with 28 additions and 28 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ export const handler = async (argv: Arguments) => {
address = new Account(Buffer.from(privateKey, 'hex')).getCosmosAddress();
}
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.getAccounts([address]);
console.log(JSON.stringify(result, undefined, 2));
@@ -39,7 +39,7 @@ export const handler = async (argv: Arguments) => {
await ensureDir(outDirPath);
fs.writeFileSync(revealFilePath, JSON.stringify(reveal, undefined, 2));
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
@@ -23,7 +23,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const reveal = fs.readFileSync(path.resolve(filePath));
+1 -1
View File
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.getAuctionsByIds([id as string]);
console.log(JSON.stringify(result, undefined, 2));
@@ -21,7 +21,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
console.log(JSON.stringify(result, undefined, 2));
+1 -1
View File
@@ -27,7 +27,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
+1 -1
View File
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.lookupAuthorities([name], true);
console.log(JSON.stringify(result, undefined, 2));
+1 -1
View File
@@ -27,7 +27,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
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));
+1 -1
View File
@@ -19,7 +19,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
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));
+1 -1
View File
@@ -32,7 +32,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.createBond({ denom, amount }, privateKey, fee);
console.log(verbose ? JSON.stringify(result, undefined, 2) : result.data);
+1 -1
View File
@@ -19,7 +19,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
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));
+1 -1
View File
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.getBondsByIds([id as string]);
console.log(JSON.stringify(result, undefined, 2));
+1 -1
View File
@@ -21,7 +21,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const { owner } = argv;
const result = await registry.queryBonds({ owner });
@@ -25,7 +25,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
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));
@@ -30,7 +30,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
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));
+1 -1
View File
@@ -33,7 +33,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
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));
+1 -1
View File
@@ -33,7 +33,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
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));
+1 -1
View File
@@ -19,7 +19,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.deleteName({ crn: name }, privateKey, fee);
+1 -1
View File
@@ -24,7 +24,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.lookupNames([name], argv.history as boolean);
console.log(JSON.stringify(result, undefined, 2));
+1 -1
View File
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.resolveNames([name]);
console.log(JSON.stringify(result, undefined, 4));
+1 -1
View File
@@ -21,7 +21,7 @@ export const handler = async (argv: Arguments) => {
assert(privateKey, 'Invalid Transaction Key.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.setName({ crn: name, cid: id }, privateKey, fee);
+1 -1
View File
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.getRecordsByIds([id as string]);
console.log(JSON.stringify(result, undefined, 2));
+1 -1
View File
@@ -33,7 +33,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.queryRecords({ bondId, type, name }, all as boolean);
console.log(JSON.stringify(result, undefined, 2));
+1 -1
View File
@@ -36,7 +36,7 @@ export const handler = async (argv: Arguments) => {
}
const { record } = await yaml.load(fs.readFileSync(file, 'utf-8')) as any;
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey as string, fee);
+1 -1
View File
@@ -15,7 +15,7 @@ export const handler = async (argv: Arguments) => {
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
assert(chainId, 'Invalid CNS Chain ID.');
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.getStatus();
console.log(JSON.stringify(result, undefined, 2));
+1 -1
View File
@@ -36,7 +36,7 @@ export const handler = async (argv: Arguments) => {
const account = new Account(Buffer.from(privateKey, 'hex'));
const fromAddress = account.formattedCosmosAddress;
const registry = new Registry(restEndpoint, gqlEndpoint, chainId);
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const fee = getGasAndFees(argv, cnsConfig);
await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee);
const result = await registry.getAccounts([fromAddress, destinationAddress]);