Compare commits

..
8 Commits
Author SHA1 Message Date
telackey 6814707752 Update SDK version. (#48)
Reviewed-on: cerc-io/laconic-registry-cli#48
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-21 21:38:11 +00:00
telackey e1da44bae7 Bump version (#47)
Reviewed-on: cerc-io/laconic-registry-cli#47
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-13 21:13:39 +00:00
telackey 51fd81a082 Decode JSON strings automatically. 2023-12-13 15:10:09 -06:00
telackey 3cdd930b82 0.1.5 (#46)
Reviewed-on: cerc-io/laconic-registry-cli#46
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-08 04:55:27 +00:00
telackey 80d1b01713 SDK 0.1.11 (#45)
Reviewed-on: cerc-io/laconic-registry-cli#45
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-08 04:53:08 +00:00
telackey f3c0ae8c34 Use SDK 0.1.10 (#44)
Reviewed-on: cerc-io/laconic-registry-cli#44
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-07 22:15:04 +00:00
telackey f5625d0c87 Take the path as-is, not relative to the current dir. (#43)
Reviewed-on: cerc-io/laconic-registry-cli#43
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-05 03:53:15 +00:00
telackey fb381c07f3 Fix cns name resolve (#42)
The `cns name resolve` does not return the result.  Obviously it should.

Reviewed-on: cerc-io/laconic-registry-cli#42
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-30 05:01:25 +00:00
6 changed files with 20 additions and 14 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@cerc-io/laconic-registry-cli", "name": "@cerc-io/laconic-registry-cli",
"version": "0.1.2", "version": "0.1.7",
"main": "index.js", "main": "index.js",
"repository": "git@github.com:cerc-io/laconic-registry-cli.git", "repository": "git@github.com:cerc-io/laconic-registry-cli.git",
"author": "", "author": "",
@@ -15,7 +15,7 @@
}, },
"dependencies": { "dependencies": {
"fs-extra": "^10.1.0", "fs-extra": "^10.1.0",
"@cerc-io/laconic-sdk": "0.1.9", "@cerc-io/laconic-sdk": "^0.1.13",
"js-yaml": "^3.14.1", "js-yaml": "^3.14.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"lodash-clean": "^2.2.3", "lodash-clean": "^2.2.3",
+4 -4
View File
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
import assert from 'assert'; import assert from 'assert';
import { Registry } from '@cerc-io/laconic-sdk'; import { Registry } from '@cerc-io/laconic-sdk';
import { getConfig, getConnectionInfo,txOutput } from '../../../util'; import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
export const command = 'resolve [name]'; export const command = 'resolve [name]';
@@ -20,8 +20,8 @@ export const handler = async (argv: Arguments) => {
const registry = new Registry(gqlEndpoint, restEndpoint, chainId); const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
const result = await registry.resolveNames([name]); let result = await registry.resolveNames([name]);
const success = `{"success":${result.code==0}}` result = result.filter((v: any) => v);
txOutput(result,success,argv.output,argv.verbose)
queryOutput(result, argv.output);
} }
+2 -2
View File
@@ -48,11 +48,11 @@ export const handler = async (argv: Arguments) => {
// Apply ex post filters. // Apply ex post filters.
if (bondId) { if (bondId) {
result = result.filter(v => v.bondId === bondId); result = result.filter((v: any) => v.bondId === bondId);
} }
if (owner) { if (owner) {
result = result.filter(v => v.owners?.find((e: string) => e === owner)); result = result.filter((v: any) => v.owners?.find((e: string) => e === owner));
} }
queryOutput(result, argv.output) queryOutput(result, argv.output)
+1 -1
View File
@@ -30,7 +30,7 @@ export const handler = async (argv: Arguments) => {
let file = null; let file = null;
if (filename) { if (filename) {
file = path.join(process.cwd(), filename as string); file = filename as string;
} else { } else {
file = 0; // stdin file = 0; // stdin
} }
+7 -1
View File
@@ -11,6 +11,12 @@ export const queryOutput = (result: any, output: unknown) => {
if (output=="json"){ if (output=="json"){
console.log(JSON.parse(JSON.stringify(result))); console.log(JSON.parse(JSON.stringify(result)));
} else { } else {
console.log(JSON.stringify(result,undefined,2)); console.log(JSON.stringify(result, (key, value) => {
try {
return JSON.parse(value)
} catch (e) {
return value;
}
}, 2));
} }
} }
+4 -4
View File
@@ -2,10 +2,10 @@
# yarn lockfile v1 # yarn lockfile v1
"@cerc-io/laconic-sdk@0.1.9": "@cerc-io/laconic-sdk@^0.1.13":
version "0.1.9" version "0.1.13"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.9/laconic-sdk-0.1.9.tgz#cf11d20a22c75fd61126640824d27d687f925151" resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.13/laconic-sdk-0.1.13.tgz#a51c601f50f3c96656556b7c3f28bc544aac8aef"
integrity sha512-LlOBZ39cYalvu9YZBpf5KUkgJJDlsuUhAaBReedwVV5O7zwy+3zRaM4HkX+3saG3a4qR8VfYWEeS5GqF9b6Ixw== integrity sha512-P5dCEZjpQTGupSDz1mBfGl3SK/95KKHP0Yww6zlz9xva8l66P9t6juYcF//Os2vA4PzDujCTETPr15kJHSFcTQ==
dependencies: dependencies:
"@cosmjs/amino" "^0.28.1" "@cosmjs/amino" "^0.28.1"
"@cosmjs/crypto" "^0.28.1" "@cosmjs/crypto" "^0.28.1"