From ea55cbdc7a4d318cedae1a6c7ebffbfb77d0c731 Mon Sep 17 00:00:00 2001 From: nikugogoi Date: Fri, 9 Dec 2022 14:26:00 +0530 Subject: [PATCH] Change in registry constructor (#8) --- src/cmds/cns-cmds/account-cmds/get.ts | 2 +- src/cmds/cns-cmds/auction-cmds/bid-cmds/commit.ts | 2 +- src/cmds/cns-cmds/auction-cmds/bid-cmds/reveal.ts | 2 +- src/cmds/cns-cmds/auction-cmds/get.ts | 2 +- src/cmds/cns-cmds/authority-cmds/bond-cmds/set.ts | 2 +- src/cmds/cns-cmds/authority-cmds/reserve.ts | 2 +- src/cmds/cns-cmds/authority-cmds/whois.ts | 2 +- src/cmds/cns-cmds/bond-cmds/associate.ts | 2 +- src/cmds/cns-cmds/bond-cmds/cancel.ts | 2 +- src/cmds/cns-cmds/bond-cmds/create.ts | 2 +- src/cmds/cns-cmds/bond-cmds/dissociate.ts | 2 +- src/cmds/cns-cmds/bond-cmds/get.ts | 2 +- src/cmds/cns-cmds/bond-cmds/list.ts | 2 +- src/cmds/cns-cmds/bond-cmds/records-cmds/dissociate.ts | 2 +- src/cmds/cns-cmds/bond-cmds/records-cmds/reassociate.ts | 2 +- src/cmds/cns-cmds/bond-cmds/refill.ts | 2 +- src/cmds/cns-cmds/bond-cmds/withdraw.ts | 2 +- src/cmds/cns-cmds/name-cmds/delete.ts | 2 +- src/cmds/cns-cmds/name-cmds/lookup.ts | 2 +- src/cmds/cns-cmds/name-cmds/resolve.ts | 2 +- src/cmds/cns-cmds/name-cmds/set.ts | 2 +- src/cmds/cns-cmds/record-cmds/get.ts | 2 +- src/cmds/cns-cmds/record-cmds/list.ts | 2 +- src/cmds/cns-cmds/record-cmds/publish.ts | 2 +- src/cmds/cns-cmds/status.ts | 2 +- src/cmds/cns-cmds/tokens-cmds/send.ts | 2 +- yarn.lock | 4 ++-- 27 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/cmds/cns-cmds/account-cmds/get.ts b/src/cmds/cns-cmds/account-cmds/get.ts index a77fd78..eca10e0 100644 --- a/src/cmds/cns-cmds/account-cmds/get.ts +++ b/src/cmds/cns-cmds/account-cmds/get.ts @@ -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)); diff --git a/src/cmds/cns-cmds/auction-cmds/bid-cmds/commit.ts b/src/cmds/cns-cmds/auction-cmds/bid-cmds/commit.ts index 3b79101..9c98586 100644 --- a/src/cmds/cns-cmds/auction-cmds/bid-cmds/commit.ts +++ b/src/cmds/cns-cmds/auction-cmds/bid-cmds/commit.ts @@ -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); diff --git a/src/cmds/cns-cmds/auction-cmds/bid-cmds/reveal.ts b/src/cmds/cns-cmds/auction-cmds/bid-cmds/reveal.ts index 7eafe10..f3fd3f0 100644 --- a/src/cmds/cns-cmds/auction-cmds/bid-cmds/reveal.ts +++ b/src/cmds/cns-cmds/auction-cmds/bid-cmds/reveal.ts @@ -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)); diff --git a/src/cmds/cns-cmds/auction-cmds/get.ts b/src/cmds/cns-cmds/auction-cmds/get.ts index 9ce1ac5..055af46 100644 --- a/src/cmds/cns-cmds/auction-cmds/get.ts +++ b/src/cmds/cns-cmds/auction-cmds/get.ts @@ -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)); diff --git a/src/cmds/cns-cmds/authority-cmds/bond-cmds/set.ts b/src/cmds/cns-cmds/authority-cmds/bond-cmds/set.ts index 879e098..228263f 100644 --- a/src/cmds/cns-cmds/authority-cmds/bond-cmds/set.ts +++ b/src/cmds/cns-cmds/authority-cmds/bond-cmds/set.ts @@ -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)); diff --git a/src/cmds/cns-cmds/authority-cmds/reserve.ts b/src/cmds/cns-cmds/authority-cmds/reserve.ts index 1b47821..b42a5a7 100644 --- a/src/cmds/cns-cmds/authority-cmds/reserve.ts +++ b/src/cmds/cns-cmds/authority-cmds/reserve.ts @@ -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); diff --git a/src/cmds/cns-cmds/authority-cmds/whois.ts b/src/cmds/cns-cmds/authority-cmds/whois.ts index 30ae975..7784707 100644 --- a/src/cmds/cns-cmds/authority-cmds/whois.ts +++ b/src/cmds/cns-cmds/authority-cmds/whois.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/associate.ts b/src/cmds/cns-cmds/bond-cmds/associate.ts index 5f3f144..b7dc785 100644 --- a/src/cmds/cns-cmds/bond-cmds/associate.ts +++ b/src/cmds/cns-cmds/bond-cmds/associate.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/cancel.ts b/src/cmds/cns-cmds/bond-cmds/cancel.ts index 2bc50ee..d439699 100644 --- a/src/cmds/cns-cmds/bond-cmds/cancel.ts +++ b/src/cmds/cns-cmds/bond-cmds/cancel.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/create.ts b/src/cmds/cns-cmds/bond-cmds/create.ts index b41878d..57a0844 100644 --- a/src/cmds/cns-cmds/bond-cmds/create.ts +++ b/src/cmds/cns-cmds/bond-cmds/create.ts @@ -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); diff --git a/src/cmds/cns-cmds/bond-cmds/dissociate.ts b/src/cmds/cns-cmds/bond-cmds/dissociate.ts index d9da0b6..32b1381 100644 --- a/src/cmds/cns-cmds/bond-cmds/dissociate.ts +++ b/src/cmds/cns-cmds/bond-cmds/dissociate.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/get.ts b/src/cmds/cns-cmds/bond-cmds/get.ts index bf53182..4b985b0 100644 --- a/src/cmds/cns-cmds/bond-cmds/get.ts +++ b/src/cmds/cns-cmds/bond-cmds/get.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/list.ts b/src/cmds/cns-cmds/bond-cmds/list.ts index 90eb46d..59c215b 100644 --- a/src/cmds/cns-cmds/bond-cmds/list.ts +++ b/src/cmds/cns-cmds/bond-cmds/list.ts @@ -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 }); diff --git a/src/cmds/cns-cmds/bond-cmds/records-cmds/dissociate.ts b/src/cmds/cns-cmds/bond-cmds/records-cmds/dissociate.ts index 85da6a5..e06b44c 100644 --- a/src/cmds/cns-cmds/bond-cmds/records-cmds/dissociate.ts +++ b/src/cmds/cns-cmds/bond-cmds/records-cmds/dissociate.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/records-cmds/reassociate.ts b/src/cmds/cns-cmds/bond-cmds/records-cmds/reassociate.ts index 9fdb5b0..abd8c37 100644 --- a/src/cmds/cns-cmds/bond-cmds/records-cmds/reassociate.ts +++ b/src/cmds/cns-cmds/bond-cmds/records-cmds/reassociate.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/refill.ts b/src/cmds/cns-cmds/bond-cmds/refill.ts index 322282b..2ae537a 100644 --- a/src/cmds/cns-cmds/bond-cmds/refill.ts +++ b/src/cmds/cns-cmds/bond-cmds/refill.ts @@ -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)); diff --git a/src/cmds/cns-cmds/bond-cmds/withdraw.ts b/src/cmds/cns-cmds/bond-cmds/withdraw.ts index 1b6be0e..eb1d6d2 100644 --- a/src/cmds/cns-cmds/bond-cmds/withdraw.ts +++ b/src/cmds/cns-cmds/bond-cmds/withdraw.ts @@ -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)); diff --git a/src/cmds/cns-cmds/name-cmds/delete.ts b/src/cmds/cns-cmds/name-cmds/delete.ts index eea3867..61897df 100644 --- a/src/cmds/cns-cmds/name-cmds/delete.ts +++ b/src/cmds/cns-cmds/name-cmds/delete.ts @@ -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); diff --git a/src/cmds/cns-cmds/name-cmds/lookup.ts b/src/cmds/cns-cmds/name-cmds/lookup.ts index ef496ce..03bb9a0 100644 --- a/src/cmds/cns-cmds/name-cmds/lookup.ts +++ b/src/cmds/cns-cmds/name-cmds/lookup.ts @@ -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)); diff --git a/src/cmds/cns-cmds/name-cmds/resolve.ts b/src/cmds/cns-cmds/name-cmds/resolve.ts index 584df13..bb8d2b3 100644 --- a/src/cmds/cns-cmds/name-cmds/resolve.ts +++ b/src/cmds/cns-cmds/name-cmds/resolve.ts @@ -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)); diff --git a/src/cmds/cns-cmds/name-cmds/set.ts b/src/cmds/cns-cmds/name-cmds/set.ts index 8c2ce88..2a61482 100644 --- a/src/cmds/cns-cmds/name-cmds/set.ts +++ b/src/cmds/cns-cmds/name-cmds/set.ts @@ -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); diff --git a/src/cmds/cns-cmds/record-cmds/get.ts b/src/cmds/cns-cmds/record-cmds/get.ts index 1b6d27e..5dd2e70 100644 --- a/src/cmds/cns-cmds/record-cmds/get.ts +++ b/src/cmds/cns-cmds/record-cmds/get.ts @@ -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)); diff --git a/src/cmds/cns-cmds/record-cmds/list.ts b/src/cmds/cns-cmds/record-cmds/list.ts index d0a9834..63c8e2a 100644 --- a/src/cmds/cns-cmds/record-cmds/list.ts +++ b/src/cmds/cns-cmds/record-cmds/list.ts @@ -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)); diff --git a/src/cmds/cns-cmds/record-cmds/publish.ts b/src/cmds/cns-cmds/record-cmds/publish.ts index 59bf4af..123e13b 100644 --- a/src/cmds/cns-cmds/record-cmds/publish.ts +++ b/src/cmds/cns-cmds/record-cmds/publish.ts @@ -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); diff --git a/src/cmds/cns-cmds/status.ts b/src/cmds/cns-cmds/status.ts index 4b05d8f..a137745 100644 --- a/src/cmds/cns-cmds/status.ts +++ b/src/cmds/cns-cmds/status.ts @@ -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)); diff --git a/src/cmds/cns-cmds/tokens-cmds/send.ts b/src/cmds/cns-cmds/tokens-cmds/send.ts index 079224f..26d5499 100644 --- a/src/cmds/cns-cmds/tokens-cmds/send.ts +++ b/src/cmds/cns-cmds/tokens-cmds/send.ts @@ -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]); diff --git a/yarn.lock b/yarn.lock index 20e3a9b..f694d78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1148,9 +1148,9 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -"laconic-client@https://github.com/cerc-io/laconic-client.git#dboreham/release": +"laconic-sdk@https://github.com/cerc-io/laconic-sdk.git#dboreham/release": version "0.1.0" - resolved "https://github.com/cerc-io/laconic-client.git#9176bb1a5a5ba225f021c9e6cca2ccc5dc24f7f2" + resolved "https://github.com/cerc-io/laconic-sdk.git#9176bb1a5a5ba225f021c9e6cca2ccc5dc24f7f2" dependencies: "@cosmjs/amino" "^0.28.1" "@cosmjs/crypto" "^0.28.1"