From 636711e31faa2f1a58925dd55412d40c06878dbf Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Wed, 29 Mar 2023 09:59:16 +0200 Subject: [PATCH 01/16] Added an "example" example --- examples/client/getAccountInfo.ts | 38 +++++++++++++ examples/client/tsconfig.json | 95 +++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 examples/client/getAccountInfo.ts create mode 100644 examples/client/tsconfig.json diff --git a/examples/client/getAccountInfo.ts b/examples/client/getAccountInfo.ts new file mode 100644 index 000000000..03addb456 --- /dev/null +++ b/examples/client/getAccountInfo.ts @@ -0,0 +1,38 @@ +import { AccountAddress, AccountInfo } from '@concordium/common-sdk'; +import { createConcordiumClient } from '../../packages/nodejs/src/clientV2'; +import { credentials } from '@grpc/grpc-js/'; + +const args = process.argv.slice(2); + +const [address, port] = args[0] + ? args[0].split(':') + : ['node.testnet.concordium.com', '20000']; +const client = createConcordiumClient( + address, + Number(port), + credentials.createInsecure(), + { timeout: 15000 } +); + +const account = args[1] + ? args[1] + : '3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G'; +const blockHash = args[2] + ? args[2] + : 'fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e'; + +/// Retrieves information about an account. The function must be provided an account address or a credential registration id. +/// If a credential registration id is provided, then the node returns the information of the account, +/// which the corresponding credential is (or was) deployed to. +/// If there is no account that matches the address or credential id at the provided +/// block, then undefined will be returned. + +(async () => { + const accountAddress = new AccountAddress(account); + const accountInfo: AccountInfo = await client.getAccountInfo( + accountAddress, + blockHash + ); + + console.dir(accountInfo, { depth: null, colors: true }); +})(); diff --git a/examples/client/tsconfig.json b/examples/client/tsconfig.json new file mode 100644 index 000000000..cfbc0f5ef --- /dev/null +++ b/examples/client/tsconfig.json @@ -0,0 +1,95 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + /* Language and Environment */ + "target": "es2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} \ No newline at end of file From 46f00e46325160dc3283a04252f97d3975b832b2 Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Wed, 29 Mar 2023 13:50:11 +0200 Subject: [PATCH 02/16] Got example running --- examples/client/getAccountInfo.ts | 52 ++- examples/client/tsconfig.json | 95 ------ examples/package.json | 7 + package.json | 3 +- yarn.lock | 518 +++++++++++++++++++++++++++++- 5 files changed, 561 insertions(+), 114 deletions(-) delete mode 100644 examples/client/tsconfig.json create mode 100644 examples/package.json diff --git a/examples/client/getAccountInfo.ts b/examples/client/getAccountInfo.ts index 03addb456..70108b881 100644 --- a/examples/client/getAccountInfo.ts +++ b/examples/client/getAccountInfo.ts @@ -1,12 +1,39 @@ import { AccountAddress, AccountInfo } from '@concordium/common-sdk'; -import { createConcordiumClient } from '../../packages/nodejs/src/clientV2'; -import { credentials } from '@grpc/grpc-js/'; +import { createConcordiumClient } from '@concordium/node-sdk'; +import { credentials } from '@grpc/grpc-js'; -const args = process.argv.slice(2); +import meow from 'meow'; -const [address, port] = args[0] - ? args[0].split(':') - : ['node.testnet.concordium.com', '20000']; +const cli = meow(` + Usage + $ yarn example getAccountInfo + + Options + --endpoint, -e Specify endpoint of the form "address:port" + --account, -a An account address to get info from + --blockhash, -b A blockhash to query the info from +`, { + importMeta: import.meta, + flags: { + endpoint: { + type: 'string', + shortFlag: 'e', + default: 'node.testnet.concordium.com:20000' + }, + account: { + type: 'string', + short: 'a', + default: '3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G' + }, + blockhash: { + type: 'string', + short: 'b', + default: 'fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e' + } + } +}); + +const [address, port] = cli.flags.endpoint.split(':') const client = createConcordiumClient( address, Number(port), @@ -14,13 +41,6 @@ const client = createConcordiumClient( { timeout: 15000 } ); -const account = args[1] - ? args[1] - : '3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G'; -const blockHash = args[2] - ? args[2] - : 'fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e'; - /// Retrieves information about an account. The function must be provided an account address or a credential registration id. /// If a credential registration id is provided, then the node returns the information of the account, /// which the corresponding credential is (or was) deployed to. @@ -28,11 +48,11 @@ const blockHash = args[2] /// block, then undefined will be returned. (async () => { - const accountAddress = new AccountAddress(account); + const accountAddress = new AccountAddress(cli.flags.account); const accountInfo: AccountInfo = await client.getAccountInfo( accountAddress, - blockHash + cli.flags.blockhash ); console.dir(accountInfo, { depth: null, colors: true }); -})(); +})(); \ No newline at end of file diff --git a/examples/client/tsconfig.json b/examples/client/tsconfig.json deleted file mode 100644 index cfbc0f5ef..000000000 --- a/examples/client/tsconfig.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "es2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -} \ No newline at end of file diff --git a/examples/package.json b/examples/package.json new file mode 100644 index 000000000..6adbf3f63 --- /dev/null +++ b/examples/package.json @@ -0,0 +1,7 @@ +{ + "type": "module", + "devDependencies": { + "meow": "11.0", + "ts-node": "10.9" + } +} diff --git a/package.json b/package.json index f44f3e292..21a21c595 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "./packages/rust-bindings", "./packages/common", "./packages/nodejs", - "./packages/web" + "./packages/web", + "./examples" ] }, "husky": { diff --git a/yarn.lock b/yarn.lock index dad2f808d..fd9a29f6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1415,6 +1415,15 @@ __metadata: languageName: unknown linkType: soft +"@cspotcode/source-map-support@npm:^0.8.0": + version: 0.8.1 + resolution: "@cspotcode/source-map-support@npm:0.8.1" + dependencies: + "@jridgewell/trace-mapping": 0.3.9 + checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa + languageName: node + linkType: hard + "@discoveryjs/json-ext@npm:^0.5.0": version: 0.5.7 resolution: "@discoveryjs/json-ext@npm:0.5.7" @@ -1775,6 +1784,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:0.3.9": + version: 0.3.9 + resolution: "@jridgewell/trace-mapping@npm:0.3.9" + dependencies: + "@jridgewell/resolve-uri": ^3.0.3 + "@jridgewell/sourcemap-codec": ^1.4.10 + checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:^0.3.7, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.14 resolution: "@jridgewell/trace-mapping@npm:0.3.14" @@ -2076,6 +2095,34 @@ __metadata: languageName: node linkType: hard +"@tsconfig/node10@npm:^1.0.7": + version: 1.0.9 + resolution: "@tsconfig/node10@npm:1.0.9" + checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df + languageName: node + linkType: hard + +"@tsconfig/node12@npm:^1.0.7": + version: 1.0.11 + resolution: "@tsconfig/node12@npm:1.0.11" + checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a + languageName: node + linkType: hard + +"@tsconfig/node14@npm:^1.0.0": + version: 1.0.3 + resolution: "@tsconfig/node14@npm:1.0.3" + checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d + languageName: node + linkType: hard + +"@tsconfig/node16@npm:^1.0.2": + version: 1.0.3 + resolution: "@tsconfig/node16@npm:1.0.3" + checksum: 3a8b657dd047495b7ad23437d6afd20297ce90380ff0bdee93fc7d39a900dbd8d9e26e53ff6b465e7967ce2adf0b218782590ce9013285121e6a5928fbd6819f + languageName: node + linkType: hard + "@types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14": version: 7.1.19 resolution: "@types/babel__core@npm:7.1.19" @@ -2239,6 +2286,13 @@ __metadata: languageName: node linkType: hard +"@types/minimist@npm:^1.2.2": + version: 1.2.2 + resolution: "@types/minimist@npm:1.2.2" + checksum: b8da83c66eb4aac0440e64674b19564d9d86c80ae273144db9681e5eeff66f238ade9515f5006ffbfa955ceff8b89ad2bd8ec577d7caee74ba101431fb07045d + languageName: node + linkType: hard + "@types/node@npm:*, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0": version: 18.0.1 resolution: "@types/node@npm:18.0.1" @@ -2246,6 +2300,13 @@ __metadata: languageName: node linkType: hard +"@types/normalize-package-data@npm:^2.4.1": + version: 2.4.1 + resolution: "@types/normalize-package-data@npm:2.4.1" + checksum: e87bccbf11f95035c89a132b52b79ce69a1e3652fe55962363063c9c0dae0fe2477ebc585e03a9652adc6f381d24ba5589cc5e51849df4ced3d3e004a7d40ed5 + languageName: node + linkType: hard + "@types/parse-json@npm:^4.0.0": version: 4.0.0 resolution: "@types/parse-json@npm:4.0.0" @@ -2646,6 +2707,13 @@ __metadata: languageName: node linkType: hard +"acorn-walk@npm:^8.1.1": + version: 8.2.0 + resolution: "acorn-walk@npm:8.2.0" + checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1 + languageName: node + linkType: hard + "acorn@npm:^7.1.1, acorn@npm:^7.4.0": version: 7.4.1 resolution: "acorn@npm:7.4.1" @@ -2826,6 +2894,13 @@ __metadata: languageName: node linkType: hard +"arg@npm:^4.1.0": + version: 4.1.3 + resolution: "arg@npm:4.1.3" + checksum: 544af8dd3f60546d3e4aff084d451b96961d2267d668670199692f8d054f0415d86fc5497d0e641e91546f0aa920e7c29e5250e99fc89f5552a34b5d93b77f43 + languageName: node + linkType: hard + "argparse@npm:^1.0.7": version: 1.0.10 resolution: "argparse@npm:1.0.10" @@ -2867,6 +2942,13 @@ __metadata: languageName: node linkType: hard +"arrify@npm:^1.0.1": + version: 1.0.1 + resolution: "arrify@npm:1.0.1" + checksum: 745075dd4a4624ff0225c331dacb99be501a515d39bcb7c84d24660314a6ec28e68131b137e6f7e16318170842ce97538cd298fc4cd6b2cc798e0b957f2747e7 + languageName: node + linkType: hard + "astral-regex@npm:^2.0.0": version: 2.0.0 resolution: "astral-regex@npm:2.0.0" @@ -3202,6 +3284,18 @@ __metadata: languageName: node linkType: hard +"camelcase-keys@npm:^8.0.2": + version: 8.0.2 + resolution: "camelcase-keys@npm:8.0.2" + dependencies: + camelcase: ^7.0.0 + map-obj: ^4.3.0 + quick-lru: ^6.1.1 + type-fest: ^2.13.0 + checksum: 878fdaffa55737486101845232b2bc017fec95e06711d8a4133461cabf2432b55a59b20ff6afafce9b48a5629f25181bac3ecb10023032d3eb7cf3247c6e34f6 + languageName: node + linkType: hard + "camelcase@npm:^5.3.1": version: 5.3.1 resolution: "camelcase@npm:5.3.1" @@ -3216,6 +3310,13 @@ __metadata: languageName: node linkType: hard +"camelcase@npm:^7.0.0": + version: 7.0.1 + resolution: "camelcase@npm:7.0.1" + checksum: 86ab8f3ebf08bcdbe605a211a242f00ed30d8bfb77dab4ebb744dd36efbc84432d1c4adb28975ba87a1b8be40a80fbd1e60e2f06565315918fa7350011a26d3d + languageName: node + linkType: hard + "caniuse-lite@npm:^1.0.30001359": version: 1.0.30001363 resolution: "caniuse-lite@npm:1.0.30001363" @@ -3519,6 +3620,13 @@ __metadata: languageName: node linkType: hard +"create-require@npm:^1.1.0": + version: 1.1.1 + resolution: "create-require@npm:1.1.1" + checksum: a9a1503d4390d8b59ad86f4607de7870b39cad43d929813599a23714831e81c520bddf61bcdd1f8e30f05fd3a2b71ae8538e946eb2786dc65c2bbc520f692eff + languageName: node + linkType: hard + "cross-env@npm:5.0.5": version: 5.0.5 resolution: "cross-env@npm:5.0.5" @@ -3627,6 +3735,30 @@ __metadata: languageName: node linkType: hard +"decamelize-keys@npm:^1.1.0": + version: 1.1.1 + resolution: "decamelize-keys@npm:1.1.1" + dependencies: + decamelize: ^1.1.0 + map-obj: ^1.0.0 + checksum: fc645fe20b7bda2680bbf9481a3477257a7f9304b1691036092b97ab04c0ab53e3bf9fcc2d2ae382536568e402ec41fb11e1d4c3836a9abe2d813dd9ef4311e0 + languageName: node + linkType: hard + +"decamelize@npm:^1.1.0": + version: 1.2.0 + resolution: "decamelize@npm:1.2.0" + checksum: ad8c51a7e7e0720c70ec2eeb1163b66da03e7616d7b98c9ef43cce2416395e84c1e9548dd94f5f6ffecfee9f8b94251fc57121a8b021f2ff2469b2bae247b8aa + languageName: node + linkType: hard + +"decamelize@npm:^6.0.0": + version: 6.0.0 + resolution: "decamelize@npm:6.0.0" + checksum: 0066bc30798ec11e01adf0c19ad975caef86545d4bb6f70cfb90b7eb8e3cbf7974cf774ac2e6ea2586e4e07b1f654bfecc4e772c42128a79a89f8584fc546753 + languageName: node + linkType: hard + "decimal.js@npm:^10.2.1": version: 10.3.1 resolution: "decimal.js@npm:10.3.1" @@ -3714,6 +3846,13 @@ __metadata: languageName: node linkType: hard +"diff@npm:^4.0.1": + version: 4.0.2 + resolution: "diff@npm:4.0.2" + checksum: f2c09b0ce4e6b301c221addd83bf3f454c0bc00caa3dd837cf6c127d6edf7223aa2bbe3b688feea110b7f262adbfc845b757c44c8a9f8c0c5b15d8fa9ce9d20d + languageName: node + linkType: hard + "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -4203,6 +4342,15 @@ __metadata: languageName: node linkType: hard +"examples-1f5c57@workspace:examples": + version: 0.0.0-use.local + resolution: "examples-1f5c57@workspace:examples" + dependencies: + meow: 11.0 + ts-node: 10.9 + languageName: unknown + linkType: soft + "execa@npm:^5.0.0, execa@npm:^5.1.1": version: 5.1.1 resolution: "execa@npm:5.1.1" @@ -4363,6 +4511,16 @@ __metadata: languageName: node linkType: hard +"find-up@npm:^6.3.0": + version: 6.3.0 + resolution: "find-up@npm:6.3.0" + dependencies: + locate-path: ^7.1.0 + path-exists: ^5.0.0 + checksum: 9a21b7f9244a420e54c6df95b4f6fc3941efd3c3e5476f8274eb452f6a85706e7a6a90de71353ee4f091fcb4593271a6f92810a324ec542650398f928783c280 + languageName: node + linkType: hard + "find-versions@npm:^4.0.0": version: 4.0.0 resolution: "find-versions@npm:4.0.0" @@ -4686,6 +4844,13 @@ __metadata: languageName: node linkType: hard +"hard-rejection@npm:^2.1.0": + version: 2.1.0 + resolution: "hard-rejection@npm:2.1.0" + checksum: 7baaf80a0c7fff4ca79687b4060113f1529589852152fa935e6787a2bc96211e784ad4588fb3048136ff8ffc9dfcf3ae385314a5b24db32de20bea0d1597f9dc + languageName: node + linkType: hard + "has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" @@ -4769,6 +4934,24 @@ __metadata: languageName: node linkType: hard +"hosted-git-info@npm:^4.0.1": + version: 4.1.0 + resolution: "hosted-git-info@npm:4.1.0" + dependencies: + lru-cache: ^6.0.0 + checksum: c3f87b3c2f7eb8c2748c8f49c0c2517c9a95f35d26f4bf54b2a8cba05d2e668f3753548b6ea366b18ec8dadb4e12066e19fa382a01496b0ffa0497eb23cbe461 + languageName: node + linkType: hard + +"hosted-git-info@npm:^5.0.0": + version: 5.2.1 + resolution: "hosted-git-info@npm:5.2.1" + dependencies: + lru-cache: ^7.5.1 + checksum: fa35df185224adfd69141f3b2f8cc31f50e705a5ebb415ccfbfd055c5b94bd08d3e658edf1edad9e2ac7d81831ac7cf261f5d219b3adc8d744fb8cdacaaf2ead + languageName: node + linkType: hard + "html-encoding-sniffer@npm:^2.0.1": version: 2.0.1 resolution: "html-encoding-sniffer@npm:2.0.1" @@ -4936,6 +5119,13 @@ __metadata: languageName: node linkType: hard +"indent-string@npm:^5.0.0": + version: 5.0.0 + resolution: "indent-string@npm:5.0.0" + checksum: e466c27b6373440e6d84fbc19e750219ce25865cb82d578e41a6053d727e5520dc5725217d6eb1cc76005a1bb1696a0f106d84ce7ebda3033b963a38583fb3b3 + languageName: node + linkType: hard + "infer-owner@npm:^1.0.4": version: 1.0.4 resolution: "infer-owner@npm:1.0.4" @@ -5018,6 +5208,15 @@ __metadata: languageName: node linkType: hard +"is-core-module@npm:^2.5.0": + version: 2.11.0 + resolution: "is-core-module@npm:2.11.0" + dependencies: + has: ^1.0.3 + checksum: f96fd490c6b48eb4f6d10ba815c6ef13f410b0ba6f7eb8577af51697de523e5f2cd9de1c441b51d27251bf0e4aebc936545e33a5d26d5d51f28d25698d4a8bab + languageName: node + linkType: hard + "is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": version: 2.9.0 resolution: "is-core-module@npm:2.9.0" @@ -5103,6 +5302,13 @@ __metadata: languageName: node linkType: hard +"is-plain-obj@npm:^1.1.0": + version: 1.1.0 + resolution: "is-plain-obj@npm:1.1.0" + checksum: 0ee04807797aad50859652a7467481816cbb57e5cc97d813a7dcd8915da8195dc68c436010bf39d195226cde6a2d352f4b815f16f26b7bf486a5754290629931 + languageName: node + linkType: hard + "is-plain-object@npm:^2.0.4": version: 2.0.4 resolution: "is-plain-object@npm:2.0.4" @@ -5911,7 +6117,7 @@ __metadata: languageName: node linkType: hard -"kind-of@npm:^6.0.2": +"kind-of@npm:^6.0.2, kind-of@npm:^6.0.3": version: 6.0.3 resolution: "kind-of@npm:6.0.3" checksum: 3ab01e7b1d440b22fe4c31f23d8d38b4d9b91d9f291df683476576493d5dfd2e03848a8b05813dd0c3f0e835bc63f433007ddeceb71f05cb25c45ae1b19c6d3b @@ -6057,6 +6263,15 @@ __metadata: languageName: node linkType: hard +"locate-path@npm:^7.1.0": + version: 7.2.0 + resolution: "locate-path@npm:7.2.0" + dependencies: + p-locate: ^6.0.0 + checksum: c1b653bdf29beaecb3d307dfb7c44d98a2a98a02ebe353c9ad055d1ac45d6ed4e1142563d222df9b9efebc2bcb7d4c792b507fad9e7150a04c29530b7db570f8 + languageName: node + linkType: hard + "lodash.camelcase@npm:^4.3.0": version: 4.3.0 resolution: "lodash.camelcase@npm:4.3.0" @@ -6137,6 +6352,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^7.5.1": + version: 7.18.3 + resolution: "lru-cache@npm:7.18.3" + checksum: e550d772384709deea3f141af34b6d4fa392e2e418c1498c078de0ee63670f1f46f5eee746e8ef7e69e1c895af0d4224e62ee33e66a543a14763b0f2e74c1356 + languageName: node + linkType: hard + "lru-cache@npm:^7.7.1": version: 7.12.0 resolution: "lru-cache@npm:7.12.0" @@ -6153,7 +6375,7 @@ __metadata: languageName: node linkType: hard -"make-error@npm:1.x": +"make-error@npm:1.x, make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" checksum: b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 @@ -6193,6 +6415,20 @@ __metadata: languageName: node linkType: hard +"map-obj@npm:^1.0.0": + version: 1.0.1 + resolution: "map-obj@npm:1.0.1" + checksum: 9949e7baec2a336e63b8d4dc71018c117c3ce6e39d2451ccbfd3b8350c547c4f6af331a4cbe1c83193d7c6b786082b6256bde843db90cb7da2a21e8fcc28afed + languageName: node + linkType: hard + +"map-obj@npm:^4.3.0": + version: 4.3.0 + resolution: "map-obj@npm:4.3.0" + checksum: fbc554934d1a27a1910e842bc87b177b1a556609dd803747c85ece420692380827c6ae94a95cce4407c054fa0964be3bf8226f7f2cb2e9eeee432c7c1985684e + languageName: node + linkType: hard + "md5.js@npm:^1.3.4": version: 1.3.5 resolution: "md5.js@npm:1.3.5" @@ -6204,6 +6440,26 @@ __metadata: languageName: node linkType: hard +"meow@npm:11.0": + version: 11.0.0 + resolution: "meow@npm:11.0.0" + dependencies: + "@types/minimist": ^1.2.2 + camelcase-keys: ^8.0.2 + decamelize: ^6.0.0 + decamelize-keys: ^1.1.0 + hard-rejection: ^2.1.0 + minimist-options: 4.1.0 + normalize-package-data: ^4.0.1 + read-pkg-up: ^9.1.0 + redent: ^4.0.0 + trim-newlines: ^4.0.2 + type-fest: ^3.1.0 + yargs-parser: ^21.1.1 + checksum: 2e815b8d2acc6cda0ea10e0a6dcd6fbdcc2fb8b24412c3c70acd77220642ca0dc727c6fccd79d64b7ca811d099e8a9ad62ea261a8f39d4b61fcdcaf551c5c788 + languageName: node + linkType: hard + "merge-stream@npm:^2.0.0": version: 2.0.0 resolution: "merge-stream@npm:2.0.0" @@ -6251,6 +6507,13 @@ __metadata: languageName: node linkType: hard +"min-indent@npm:^1.0.1": + version: 1.0.1 + resolution: "min-indent@npm:1.0.1" + checksum: bfc6dd03c5eaf623a4963ebd94d087f6f4bbbfd8c41329a7f09706b0cb66969c4ddd336abeb587bc44bc6f08e13bf90f0b374f9d71f9f01e04adc2cd6f083ef1 + languageName: node + linkType: hard + "minimalistic-assert@npm:^1.0.1": version: 1.0.1 resolution: "minimalistic-assert@npm:1.0.1" @@ -6276,6 +6539,17 @@ __metadata: languageName: node linkType: hard +"minimist-options@npm:4.1.0": + version: 4.1.0 + resolution: "minimist-options@npm:4.1.0" + dependencies: + arrify: ^1.0.1 + is-plain-obj: ^1.1.0 + kind-of: ^6.0.3 + checksum: 8c040b3068811e79de1140ca2b708d3e203c8003eb9a414c1ab3cd467fc5f17c9ca02a5aef23bedc51a7f8bfbe77f87e9a7e31ec81fba304cda675b019496f4e + languageName: node + linkType: hard + "minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.6 resolution: "minimist@npm:1.2.6" @@ -6484,6 +6758,30 @@ __metadata: languageName: node linkType: hard +"normalize-package-data@npm:^3.0.2": + version: 3.0.3 + resolution: "normalize-package-data@npm:3.0.3" + dependencies: + hosted-git-info: ^4.0.1 + is-core-module: ^2.5.0 + semver: ^7.3.4 + validate-npm-package-license: ^3.0.1 + checksum: bbcee00339e7c26fdbc760f9b66d429258e2ceca41a5df41f5df06cc7652de8d82e8679ff188ca095cad8eff2b6118d7d866af2b68400f74602fbcbce39c160a + languageName: node + linkType: hard + +"normalize-package-data@npm:^4.0.1": + version: 4.0.1 + resolution: "normalize-package-data@npm:4.0.1" + dependencies: + hosted-git-info: ^5.0.0 + is-core-module: ^2.8.1 + semver: ^7.3.5 + validate-npm-package-license: ^3.0.4 + checksum: 292e0aa740e73d62f84bbd9d55d4bfc078155f32d5d7572c32c9807f96d543af0f43ff7e5c80bfa6238667123fd68bd83cd412eae9b27b85b271fb041f624528 + languageName: node + linkType: hard + "normalize-path@npm:^3.0.0": version: 3.0.0 resolution: "normalize-path@npm:3.0.0" @@ -6657,6 +6955,15 @@ __metadata: languageName: node linkType: hard +"p-limit@npm:^4.0.0": + version: 4.0.0 + resolution: "p-limit@npm:4.0.0" + dependencies: + yocto-queue: ^1.0.0 + checksum: 01d9d70695187788f984226e16c903475ec6a947ee7b21948d6f597bed788e3112cc7ec2e171c1d37125057a5f45f3da21d8653e04a3a793589e12e9e80e756b + languageName: node + linkType: hard + "p-locate@npm:^2.0.0": version: 2.0.0 resolution: "p-locate@npm:2.0.0" @@ -6684,6 +6991,15 @@ __metadata: languageName: node linkType: hard +"p-locate@npm:^6.0.0": + version: 6.0.0 + resolution: "p-locate@npm:6.0.0" + dependencies: + p-limit: ^4.0.0 + checksum: 2bfe5234efa5e7a4e74b30a5479a193fdd9236f8f6b4d2f3f69e3d286d9a7d7ab0c118a2a50142efcf4e41625def635bd9332d6cbf9cc65d85eb0718c579ab38 + languageName: node + linkType: hard + "p-map@npm:^4.0.0": version: 4.0.0 resolution: "p-map@npm:4.0.0" @@ -6749,6 +7065,13 @@ __metadata: languageName: node linkType: hard +"path-exists@npm:^5.0.0": + version: 5.0.0 + resolution: "path-exists@npm:5.0.0" + checksum: 8ca842868cab09423994596eb2c5ec2a971c17d1a3cb36dbf060592c730c725cd524b9067d7d2a1e031fef9ba7bd2ac6dc5ec9fb92aa693265f7be3987045254 + languageName: node + linkType: hard + "path-is-absolute@npm:^1.0.0": version: 1.0.1 resolution: "path-is-absolute@npm:1.0.1" @@ -6982,6 +7305,13 @@ __metadata: languageName: node linkType: hard +"quick-lru@npm:^6.1.1": + version: 6.1.1 + resolution: "quick-lru@npm:6.1.1" + checksum: a9c75bf1d208c1d207590e10403a75d037f9faf7857f2e0d38c294d92b40d8b400776bcb5d4dd516baa84e6f5e3baf2a16cf405e6fedc18107922f46aeae83ee + languageName: node + linkType: hard + "randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" @@ -6998,6 +7328,29 @@ __metadata: languageName: node linkType: hard +"read-pkg-up@npm:^9.1.0": + version: 9.1.0 + resolution: "read-pkg-up@npm:9.1.0" + dependencies: + find-up: ^6.3.0 + read-pkg: ^7.1.0 + type-fest: ^2.5.0 + checksum: 41b8ba4bdb7c1e914aa6ce2d36a7c1651e9086938977fa12f058f6fca51ee15315634af648ca4ef70dd074e575e854616b39032ad0b376e9e97d61a9d0867afe + languageName: node + linkType: hard + +"read-pkg@npm:^7.1.0": + version: 7.1.0 + resolution: "read-pkg@npm:7.1.0" + dependencies: + "@types/normalize-package-data": ^2.4.1 + normalize-package-data: ^3.0.2 + parse-json: ^5.2.0 + type-fest: ^2.0.0 + checksum: 20d11c59be3ae1fc79d4b9c8594dabeaec58105f9dfd710570ef9690ec2ac929247006e79ca114257683228663199735d60f149948dbc5f34fcd2d28883ab5f7 + languageName: node + linkType: hard + "readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0": version: 3.6.0 resolution: "readable-stream@npm:3.6.0" @@ -7018,6 +7371,16 @@ __metadata: languageName: node linkType: hard +"redent@npm:^4.0.0": + version: 4.0.0 + resolution: "redent@npm:4.0.0" + dependencies: + indent-string: ^5.0.0 + strip-indent: ^4.0.0 + checksum: 6944e7b1d8f3fd28c2515f5c605b9f7f0ea0f4edddf41890bbbdd4d9ee35abb7540c3b278f03ff827bd278bb6ff4a5bd8692ca406b748c5c1c3ce7355e9fbf8f + languageName: node + linkType: hard + "regenerate-unicode-properties@npm:^10.0.1": version: 10.0.1 resolution: "regenerate-unicode-properties@npm:10.0.1" @@ -7364,6 +7727,17 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.3.4": + version: 7.3.8 + resolution: "semver@npm:7.3.8" + dependencies: + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: ba9c7cbbf2b7884696523450a61fee1a09930d888b7a8d7579025ad93d459b2d1949ee5bbfeb188b2be5f4ac163544c5e98491ad6152df34154feebc2cc337c1 + languageName: node + linkType: hard + "serialize-javascript@npm:^6.0.0": version: 6.0.0 resolution: "serialize-javascript@npm:6.0.0" @@ -7549,6 +7923,40 @@ __metadata: languageName: node linkType: hard +"spdx-correct@npm:^3.0.0": + version: 3.2.0 + resolution: "spdx-correct@npm:3.2.0" + dependencies: + spdx-expression-parse: ^3.0.0 + spdx-license-ids: ^3.0.0 + checksum: e9ae98d22f69c88e7aff5b8778dc01c361ef635580e82d29e5c60a6533cc8f4d820803e67d7432581af0cc4fb49973125076ee3b90df191d153e223c004193b2 + languageName: node + linkType: hard + +"spdx-exceptions@npm:^2.1.0": + version: 2.3.0 + resolution: "spdx-exceptions@npm:2.3.0" + checksum: cb69a26fa3b46305637123cd37c85f75610e8c477b6476fa7354eb67c08128d159f1d36715f19be6f9daf4b680337deb8c65acdcae7f2608ba51931540687ac0 + languageName: node + linkType: hard + +"spdx-expression-parse@npm:^3.0.0": + version: 3.0.1 + resolution: "spdx-expression-parse@npm:3.0.1" + dependencies: + spdx-exceptions: ^2.1.0 + spdx-license-ids: ^3.0.0 + checksum: a1c6e104a2cbada7a593eaa9f430bd5e148ef5290d4c0409899855ce8b1c39652bcc88a725259491a82601159d6dc790bedefc9016c7472f7de8de7361f8ccde + languageName: node + linkType: hard + +"spdx-license-ids@npm:^3.0.0": + version: 3.0.13 + resolution: "spdx-license-ids@npm:3.0.13" + checksum: 3469d85c65f3245a279fa11afc250c3dca96e9e847f2f79d57f466940c5bb8495da08a542646086d499b7f24a74b8d0b42f3fc0f95d50ff99af1f599f6360ad7 + languageName: node + linkType: hard + "sprintf-js@npm:~1.0.2": version: 1.0.3 resolution: "sprintf-js@npm:1.0.3" @@ -7693,6 +8101,15 @@ __metadata: languageName: node linkType: hard +"strip-indent@npm:^4.0.0": + version: 4.0.0 + resolution: "strip-indent@npm:4.0.0" + dependencies: + min-indent: ^1.0.1 + checksum: 06cbcd93da721c46bc13caeb1c00af93a9b18146a1c95927672d2decab6a25ad83662772417cea9317a2507fb143253ecc23c4415b64f5828cef9b638a744598 + languageName: node + linkType: hard + "strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -7920,6 +8337,13 @@ __metadata: languageName: node linkType: hard +"trim-newlines@npm:^4.0.2": + version: 4.1.1 + resolution: "trim-newlines@npm:4.1.1" + checksum: 5b09f8e329e8f33c1111ef26906332ba7ba7248cde3e26fc054bb3d69f2858bf5feedca9559c572ff91f33e52977c28e0d41c387df6a02a633cbb8c2d8238627 + languageName: node + linkType: hard + "ts-jest@npm:^27.0.3": version: 27.1.5 resolution: "ts-jest@npm:27.1.5" @@ -7953,6 +8377,44 @@ __metadata: languageName: node linkType: hard +"ts-node@npm:10.9": + version: 10.9.1 + resolution: "ts-node@npm:10.9.1" + dependencies: + "@cspotcode/source-map-support": ^0.8.0 + "@tsconfig/node10": ^1.0.7 + "@tsconfig/node12": ^1.0.7 + "@tsconfig/node14": ^1.0.0 + "@tsconfig/node16": ^1.0.2 + acorn: ^8.4.1 + acorn-walk: ^8.1.1 + arg: ^4.1.0 + create-require: ^1.1.0 + diff: ^4.0.1 + make-error: ^1.1.1 + v8-compile-cache-lib: ^3.0.1 + yn: 3.1.1 + peerDependencies: + "@swc/core": ">=1.2.50" + "@swc/wasm": ">=1.2.50" + "@types/node": "*" + typescript: ">=2.7" + peerDependenciesMeta: + "@swc/core": + optional: true + "@swc/wasm": + optional: true + bin: + ts-node: dist/bin.js + ts-node-cwd: dist/bin-cwd.js + ts-node-esm: dist/bin-esm.js + ts-node-script: dist/bin-script.js + ts-node-transpile-only: dist/bin-transpile.js + ts-script: dist/bin-script-deprecated.js + checksum: 090adff1302ab20bd3486e6b4799e90f97726ed39e02b39e566f8ab674fd5bd5f727f43615debbfc580d33c6d9d1c6b1b3ce7d8e3cca3e20530a145ffa232c35 + languageName: node + linkType: hard + "tsconfig-paths@npm:^3.14.1": version: 3.14.1 resolution: "tsconfig-paths@npm:3.14.1" @@ -8029,6 +8491,20 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^2.0.0, type-fest@npm:^2.13.0, type-fest@npm:^2.5.0": + version: 2.19.0 + resolution: "type-fest@npm:2.19.0" + checksum: a4ef07ece297c9fba78fc1bd6d85dff4472fe043ede98bd4710d2615d15776902b595abf62bd78339ed6278f021235fb28a96361f8be86ed754f778973a0d278 + languageName: node + linkType: hard + +"type-fest@npm:^3.1.0": + version: 3.7.1 + resolution: "type-fest@npm:3.7.1" + checksum: a694e0d62a06a60dec0f57e2e681d2e8d301992a3abd515fcc2f8f135ca12aa4f7d4aab24532ee781e4fb7735d6cfbd127ff0337b13cdbca6ff32b74d091c403 + languageName: node + linkType: hard + "typedarray-to-buffer@npm:^3.1.5": version: 3.1.5 resolution: "typedarray-to-buffer@npm:3.1.5" @@ -8194,6 +8670,13 @@ __metadata: languageName: node linkType: hard +"v8-compile-cache-lib@npm:^3.0.1": + version: 3.0.1 + resolution: "v8-compile-cache-lib@npm:3.0.1" + checksum: 78089ad549e21bcdbfca10c08850022b22024cdcc2da9b168bcf5a73a6ed7bf01a9cebb9eac28e03cd23a684d81e0502797e88f3ccd27a32aeab1cfc44c39da0 + languageName: node + linkType: hard + "v8-compile-cache@npm:^2.0.3": version: 2.3.0 resolution: "v8-compile-cache@npm:2.3.0" @@ -8212,6 +8695,16 @@ __metadata: languageName: node linkType: hard +"validate-npm-package-license@npm:^3.0.1, validate-npm-package-license@npm:^3.0.4": + version: 3.0.4 + resolution: "validate-npm-package-license@npm:3.0.4" + dependencies: + spdx-correct: ^3.0.0 + spdx-expression-parse: ^3.0.0 + checksum: 35703ac889d419cf2aceef63daeadbe4e77227c39ab6287eeb6c1b36a746b364f50ba22e88591f5d017bc54685d8137bc2d328d0a896e4d3fd22093c0f32a9ad + languageName: node + linkType: hard + "w3c-hr-time@npm:^1.0.2": version: 1.0.2 resolution: "w3c-hr-time@npm:1.0.2" @@ -8578,6 +9071,13 @@ __metadata: languageName: node linkType: hard +"yargs-parser@npm:^21.1.1": + version: 21.1.1 + resolution: "yargs-parser@npm:21.1.1" + checksum: ed2d96a616a9e3e1cc7d204c62ecc61f7aaab633dcbfab2c6df50f7f87b393993fe6640d017759fe112d0cb1e0119f2b4150a87305cc873fd90831c6a58ccf1c + languageName: node + linkType: hard + "yargs@npm:^16.2.0": version: 16.2.0 resolution: "yargs@npm:16.2.0" @@ -8593,9 +9093,23 @@ __metadata: languageName: node linkType: hard +"yn@npm:3.1.1": + version: 3.1.1 + resolution: "yn@npm:3.1.1" + checksum: 2c487b0e149e746ef48cda9f8bad10fc83693cd69d7f9dcd8be4214e985de33a29c9e24f3c0d6bcf2288427040a8947406ab27f7af67ee9456e6b84854f02dd6 + languageName: node + linkType: hard + "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" checksum: f77b3d8d00310def622123df93d4ee654fc6a0096182af8bd60679ddcdfb3474c56c6c7190817c84a2785648cdee9d721c0154eb45698c62176c322fb46fc700 languageName: node linkType: hard + +"yocto-queue@npm:^1.0.0": + version: 1.0.0 + resolution: "yocto-queue@npm:1.0.0" + checksum: 2cac84540f65c64ccc1683c267edce396b26b1e931aa429660aefac8fbe0188167b7aee815a3c22fa59a28a58d898d1a2b1825048f834d8d629f4c2a5d443801 + languageName: node + linkType: hard From d1d61404687f4f9aca0235e9f36147d3f659acfb Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Thu, 30 Mar 2023 12:21:07 +0200 Subject: [PATCH 03/16] lint works --- .eslintrc.json | 4 +-- examples/client/getAccountInfo.ts | 60 ++++++++++++++++--------------- examples/package.json | 22 ++++++++++-- examples/tsconfig.eslint.json | 7 ++++ examples/tsconfig.json | 20 +++++++++++ yarn.lock | 14 +++++++- 6 files changed, 94 insertions(+), 33 deletions(-) create mode 100644 examples/tsconfig.eslint.json create mode 100644 examples/tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json index 652afe3f7..be3c44b64 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,7 +13,7 @@ "parserOptions": { "ecmaVersion": 2020, "sourceType": "module", - "project": [ "./packages/**/tsconfig.eslint.json", "./tsconfig.eslint.json"] + "project": [ "./packages/**/tsconfig.eslint.json", "./tsconfig.eslint.json", "./examples/tsconfig.eslint.json"] }, "plugins": [ "@typescript-eslint", @@ -21,7 +21,7 @@ ], "rules": { "quotes": [2, "single", { "avoidEscape": true }], - "import/no-unresolved": [2, { "ignore": ["@concordium/rust-bindings", "@concordium/common-sdk", "grpc"]}], + "import/no-unresolved": [2, { "ignore": ["@concordium/rust-bindings", "@concordium/common-sdk", "@concordium/node-sdk", "grpc"]}], "import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.ts", "**/*.test.tsx", "**/*.config.js"]}], "@typescript-eslint/no-unused-vars": ["warn", { "ignoreRestSiblings": true }] }, diff --git a/examples/client/getAccountInfo.ts b/examples/client/getAccountInfo.ts index 70108b881..2d370b033 100644 --- a/examples/client/getAccountInfo.ts +++ b/examples/client/getAccountInfo.ts @@ -4,36 +4,40 @@ import { credentials } from '@grpc/grpc-js'; import meow from 'meow'; -const cli = meow(` - Usage - $ yarn example getAccountInfo +const cli = meow( + ` + Usage + $ yarn example getAccountInfo - Options - --endpoint, -e Specify endpoint of the form "address:port" - --account, -a An account address to get info from - --blockhash, -b A blockhash to query the info from -`, { - importMeta: import.meta, - flags: { - endpoint: { - type: 'string', - shortFlag: 'e', - default: 'node.testnet.concordium.com:20000' - }, - account: { - type: 'string', - short: 'a', - default: '3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G' - }, - blockhash: { - type: 'string', - short: 'b', - default: 'fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e' + Options + --endpoint, -e Specify endpoint of the form "address:port" + --account, -a An account address to get info from + --blockhash, -b A blockhash to query the info from +`, + { + importMeta: import.meta, + flags: { + endpoint: { + type: 'string', + shortFlag: 'e', + default: 'node.testnet.concordium.com:20000', + }, + account: { + type: 'string', + short: 'a', + default: '3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G', + }, + blockhash: { + type: 'string', + short: 'b', + default: + 'fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e', + }, + }, } - } -}); +); -const [address, port] = cli.flags.endpoint.split(':') +const [address, port] = cli.flags.endpoint.split(':'); const client = createConcordiumClient( address, Number(port), @@ -55,4 +59,4 @@ const client = createConcordiumClient( ); console.dir(accountInfo, { depth: null, colors: true }); -})(); \ No newline at end of file +})(); diff --git a/examples/package.json b/examples/package.json index 6adbf3f63..e7052cdf2 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,7 +1,25 @@ { "type": "module", - "devDependencies": { + "dependencies": { + "@concordium/common-sdk": "6.4.0", + "@concordium/node-sdk": "6.3.0", + "@grpc/grpc-js": "^1.3.4", + "@typescript-eslint/eslint-plugin": "^4.28.1", + "@typescript-eslint/parser": "^4.28.1", + "eslint": "^7.29.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-import": "^2.23.4", + "eslint-plugin-prettier": "^3.4.0", + "lint-staged": "^12.0.2", "meow": "11.0", - "ts-node": "10.9" + "prettier": "^2.3.2", + "ts-node": "10.9", + "typescript": "^4.3.5" + }, + "scripts": { + "lint": "eslint . --cache --ext .ts,.tsx --max-warnings 0", + "lint-fix": "yarn lint --fix; exit 0", + "build": "tsc", + "build-dev": "tsc" } } diff --git a/examples/tsconfig.eslint.json b/examples/tsconfig.eslint.json new file mode 100644 index 000000000..78cd7ad3a --- /dev/null +++ b/examples/tsconfig.eslint.json @@ -0,0 +1,7 @@ +{ + "include": [ + "client/**/*", + "common/**/*", + ] +} + diff --git a/examples/tsconfig.json b/examples/tsconfig.json new file mode 100644 index 000000000..9f08c79fb --- /dev/null +++ b/examples/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "ts-node/node12/tsconfig.json", + "ts-node": { + "files": true, + "esm": true + }, + "compilerOptions": { + "esModuleInterop": true, + "outDir": "./lib", + "lib": [ + "dom", + "esnext", + "webworker" + ], + "baseUrl": ".", + "module": "es2020", + "target": "es2020" + } +} + diff --git a/yarn.lock b/yarn.lock index fd9a29f6e..40c900775 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1350,7 +1350,7 @@ __metadata: languageName: unknown linkType: soft -"@concordium/node-sdk@workspace:packages/nodejs": +"@concordium/node-sdk@6.3.0, @concordium/node-sdk@workspace:packages/nodejs": version: 0.0.0-use.local resolution: "@concordium/node-sdk@workspace:packages/nodejs" dependencies: @@ -4346,8 +4346,20 @@ __metadata: version: 0.0.0-use.local resolution: "examples-1f5c57@workspace:examples" dependencies: + "@concordium/common-sdk": 6.4.0 + "@concordium/node-sdk": 6.3.0 + "@grpc/grpc-js": ^1.3.4 + "@typescript-eslint/eslint-plugin": ^4.28.1 + "@typescript-eslint/parser": ^4.28.1 + eslint: ^7.29.0 + eslint-config-prettier: ^8.3.0 + eslint-plugin-import: ^2.23.4 + eslint-plugin-prettier: ^3.4.0 + lint-staged: ^12.0.2 meow: 11.0 + prettier: ^2.3.2 ts-node: 10.9 + typescript: ^4.3.5 languageName: unknown linkType: soft From 2a2853e0a3d3bad055675d5f3634d00c328af02b Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Thu, 30 Mar 2023 22:29:37 +0200 Subject: [PATCH 04/16] Added help flag --- examples/client/getAccountInfo.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/client/getAccountInfo.ts b/examples/client/getAccountInfo.ts index 2d370b033..3de0be5cb 100644 --- a/examples/client/getAccountInfo.ts +++ b/examples/client/getAccountInfo.ts @@ -10,6 +10,7 @@ const cli = meow( $ yarn example getAccountInfo Options + --help, -h Displays this message --endpoint, -e Specify endpoint of the form "address:port" --account, -a An account address to get info from --blockhash, -b A blockhash to query the info from @@ -45,6 +46,10 @@ const client = createConcordiumClient( { timeout: 15000 } ); +if (cli.flags.h) { + cli.showHelp(); +} + /// Retrieves information about an account. The function must be provided an account address or a credential registration id. /// If a credential registration id is provided, then the node returns the information of the account, /// which the corresponding credential is (or was) deployed to. From b0f101883301e64b5c3c1b1e81039ea1dbadb884 Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Thu, 30 Mar 2023 22:48:17 +0200 Subject: [PATCH 05/16] Added easier way of running example --- examples/client/getAccountInfo.ts | 2 +- examples/execute-example.bash | 3 +++ examples/package.json | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 examples/execute-example.bash diff --git a/examples/client/getAccountInfo.ts b/examples/client/getAccountInfo.ts index 3de0be5cb..e0f96ab5f 100644 --- a/examples/client/getAccountInfo.ts +++ b/examples/client/getAccountInfo.ts @@ -47,7 +47,7 @@ const client = createConcordiumClient( ); if (cli.flags.h) { - cli.showHelp(); + cli.showHelp(); } /// Retrieves information about an account. The function must be provided an account address or a credential registration id. diff --git a/examples/execute-example.bash b/examples/execute-example.bash new file mode 100755 index 000000000..2299012ca --- /dev/null +++ b/examples/execute-example.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +path=$(find client common -name "*$1*" | grep '\.ts$' | head) +yarn ts-node $path "${@:2}" diff --git a/examples/package.json b/examples/package.json index e7052cdf2..d788fa150 100644 --- a/examples/package.json +++ b/examples/package.json @@ -17,9 +17,11 @@ "typescript": "^4.3.5" }, "scripts": { + "example": "./execute-example.bash", "lint": "eslint . --cache --ext .ts,.tsx --max-warnings 0", "lint-fix": "yarn lint --fix; exit 0", "build": "tsc", "build-dev": "tsc" } } + From ae43ca826d1f9237f4d3a599dd7f227a717c2b6c Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Tue, 11 Apr 2023 13:16:28 +0200 Subject: [PATCH 06/16] Addressed comments --- examples/client/getAccountInfo.ts | 23 ++++++++++++----------- examples/execute-example.bash | 3 --- 2 files changed, 12 insertions(+), 14 deletions(-) delete mode 100755 examples/execute-example.bash diff --git a/examples/client/getAccountInfo.ts b/examples/client/getAccountInfo.ts index e0f96ab5f..b1bd169ae 100644 --- a/examples/client/getAccountInfo.ts +++ b/examples/client/getAccountInfo.ts @@ -7,32 +7,33 @@ import meow from 'meow'; const cli = meow( ` Usage - $ yarn example getAccountInfo + $ yarn ts-node [options] + + Required + --account, -a An account address to get info from Options --help, -h Displays this message - --endpoint, -e Specify endpoint of the form "address:port" - --account, -a An account address to get info from - --blockhash, -b A blockhash to query the info from + --endpoint, -e Specify endpoint of the form "address:port", defaults to localhost + --blockhash, -b A blockhash to query the info from, defaults to last final block `, { importMeta: import.meta, flags: { endpoint: { type: 'string', - shortFlag: 'e', - default: 'node.testnet.concordium.com:20000', + alias: 'e', + default: 'localhost:20000', }, account: { type: 'string', - short: 'a', - default: '3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G', + alias: 'a', + isRequired: true, }, blockhash: { type: 'string', - short: 'b', - default: - 'fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e', + alias: 'b', + default: '', // This defaults to LastFinal }, }, } diff --git a/examples/execute-example.bash b/examples/execute-example.bash deleted file mode 100755 index 2299012ca..000000000 --- a/examples/execute-example.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -path=$(find client common -name "*$1*" | grep '\.ts$' | head) -yarn ts-node $path "${@:2}" From 3e73ae35a5aa4a06b8d7004c36fe656ec1316f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Fri, 31 Mar 2023 12:37:35 +0200 Subject: [PATCH 07/16] Fix use of setImmediate so that the common package can be used from browsers as well. --- packages/common/CHANGELOG.md | 5 +++++ packages/common/src/GRPCClient.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index fdd3e7353..7224b9be1 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +- Replace use of `setImmediate` with `setTimeout` since the former is not + supported in browsers. + ## 6.4.0 2023-03-22 ### Added diff --git a/packages/common/src/GRPCClient.ts b/packages/common/src/GRPCClient.ts index 95513ae1e..2cc2d360e 100644 --- a/packages/common/src/GRPCClient.ts +++ b/packages/common/src/GRPCClient.ts @@ -435,7 +435,7 @@ export default class ConcordiumNodeClient { if (response.status === 'finalized') { // Simply doing `abortController.abort()` causes an error. // See: https://github.com/grpc/grpc-node/issues/1652 - setImmediate(() => abortController.abort()); + setTimeout(() => abortController.abort(), 0); return resolve(response.outcome.blockHash); } @@ -446,7 +446,7 @@ export default class ConcordiumNodeClient { transactionHash ); if (response.status === 'finalized') { - setImmediate(() => abortController.abort()); + setTimeout(() => abortController.abort(), 0); return resolve(response.outcome.blockHash); } } From 099c007877bcb902e315f3b7c77949d34439b01e Mon Sep 17 00:00:00 2001 From: Hjort Date: Fri, 31 Mar 2023 14:16:29 +0200 Subject: [PATCH 08/16] Bump versions for release --- packages/common/CHANGELOG.md | 2 +- packages/common/package.json | 2 +- packages/nodejs/package.json | 2 +- packages/web/CHANGELOG.md | 6 ++++++ packages/web/package.json | 4 ++-- yarn.lock | 6 +++--- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index 7224b9be1..168382a74 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 6.4.1 2023-03-31 - Replace use of `setImmediate` with `setTimeout` since the former is not supported in browsers. diff --git a/packages/common/package.json b/packages/common/package.json index 127dffcbc..494b6bc3c 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@concordium/common-sdk", - "version": "6.4.0", + "version": "6.4.1", "license": "Apache-2.0", "engines": { "node": ">=14.16.0" diff --git a/packages/nodejs/package.json b/packages/nodejs/package.json index 7cdb3133e..eb242cfa4 100644 --- a/packages/nodejs/package.json +++ b/packages/nodejs/package.json @@ -60,7 +60,7 @@ "build-dev": "tsc" }, "dependencies": { - "@concordium/common-sdk": "6.4.0", + "@concordium/common-sdk": "6.4.1", "@grpc/grpc-js": "^1.3.4", "@protobuf-ts/grpc-transport": "^2.8.2", "buffer": "^6.0.3", diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index 765fefe2c..49e1c78a7 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 3.4.1 2023-3-31 + +### Changed + +- Bumped @concordium/common-sdk to 6.4.1. (Fixes `waitForTransactionFinalization`) + ## 3.4.0 2023-3-22 ### Changed diff --git a/packages/web/package.json b/packages/web/package.json index e7156db5d..f15df5aa0 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@concordium/web-sdk", - "version": "3.4.0", + "version": "3.4.1", "license": "Apache-2.0", "browser": "lib/concordium.min.js", "types": "lib/index.d.ts", @@ -48,7 +48,7 @@ "webpack-cli": "^4.9.2" }, "dependencies": { - "@concordium/common-sdk": "6.4.0", + "@concordium/common-sdk": "6.4.1", "@concordium/rust-bindings": "0.11.0", "@grpc/grpc-js": "^1.3.4", "@protobuf-ts/grpcweb-transport": "^2.8.2", diff --git a/yarn.lock b/yarn.lock index 40c900775..76c475a6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1312,7 +1312,7 @@ __metadata: languageName: node linkType: hard -"@concordium/common-sdk@6.4.0, @concordium/common-sdk@workspace:packages/common": +"@concordium/common-sdk@6.4.1, @concordium/common-sdk@workspace:packages/common": version: 0.0.0-use.local resolution: "@concordium/common-sdk@workspace:packages/common" dependencies: @@ -1354,7 +1354,7 @@ __metadata: version: 0.0.0-use.local resolution: "@concordium/node-sdk@workspace:packages/nodejs" dependencies: - "@concordium/common-sdk": 6.4.0 + "@concordium/common-sdk": 6.4.1 "@grpc/grpc-js": ^1.3.4 "@noble/ed25519": ^1.7.1 "@protobuf-ts/grpc-transport": ^2.8.2 @@ -1393,7 +1393,7 @@ __metadata: version: 0.0.0-use.local resolution: "@concordium/web-sdk@workspace:packages/web" dependencies: - "@concordium/common-sdk": 6.4.0 + "@concordium/common-sdk": 6.4.1 "@concordium/rust-bindings": 0.11.0 "@grpc/grpc-js": ^1.3.4 "@protobuf-ts/grpcweb-transport": ^2.8.2 From ccd621eaf72f717b83d6748c7950e11d7fecd9f3 Mon Sep 17 00:00:00 2001 From: Hjort Date: Mon, 3 Apr 2023 15:55:09 +0200 Subject: [PATCH 09/16] Add missing docs for getBlockSummary gRPC v2 replacement endpoints --- docs/gRPC.md | 13 ++++++++++--- docs/grpc-migration.md | 25 +++++++++++++++++++++++-- packages/common/src/types.ts | 8 ++++---- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/docs/gRPC.md b/docs/gRPC.md index 8982491b3..4d37d1f7b 100644 --- a/docs/gRPC.md +++ b/docs/gRPC.md @@ -867,7 +867,7 @@ If a blockhash is not supplied it will pick the latest finalized block. An optio ```js const blockHash = "39122a9c720cae643b999d93dd7bf09bcf50e99bb716767dd35c39690390db54"; -const pendingUpdates: AsyncIterable = this.client.getBlockSpecialEvents(blockHash); +const pendingUpdates: AsyncIterable = this.client.getBlockPendingUpdates(blockHash); for await (const pendingUpdate of pendingUpdates) { console.log(pendingUpdate); @@ -875,11 +875,18 @@ for await (const pendingUpdate of pendingUpdates) { ``` ## getBlockFinalizationSummary -Get the summary of the finalization data in a given block. +Get the summary of the finalization data in a given block. Only finalized blocks will return a finalization summary, if the summary is requested for a non-finalized block, this will return an object with only the tag field, with value "none". If a blockhash is not supplied it will pick the latest finalized block. ```js const blockHash = "fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e"; -const pendingUpdates: BlockFinalizationSummary = await this.client.getBlockSpecialEvents(blockHash); +const blockFinalizationSummary: BlockFinalizationSummary = await this.client.getBlockFinalizationSummary(blockHash); + +if (blockFinalizationSummary.tag === "record") { + // Response contains finalization summary for the given block: + const { block, index, delay, finalizers} = blockFinalizationSummary.record; +} else { + // Given block has not been finalized. +} ``` diff --git a/docs/grpc-migration.md b/docs/grpc-migration.md index ae8530276..17493345c 100644 --- a/docs/grpc-migration.md +++ b/docs/grpc-migration.md @@ -5,10 +5,31 @@ Blockhash inputs are now optional, and if given must be given as a hex encoded s ## GetBlockSummary -The `getBlockSummary` endpoint has been split up. +The `getBlockSummary` endpoint has been split up in the following endpoints: -To access the chain parameters, use the `getBlockChainParameters` endpoint, which corresponds to the `blockSummary.updates.chainParameters`, + - getBlockChainParameters + - getBlockSpecialEvents + - getBlockFinalizationSummary + - getBlockTransactionEvents + - getBlockPendingUpdates + - getNextUpdateSequenceNumbers + +To access the chain parameters, use the `getBlockChainParameters` endpoint, which corresponds to the `blockSummary.updates.chainParameters` field, except that the foundationAccountIndex field is no longer present, instead the foundationAccount field is present and contains the account address of the foundation account instead of the account index, +Note that this also contains the `blockSummary.updates.keys` field. + +To access any pending updates at the time of the block, use the `getBlockPendingUpdates` endpoint, which corresponds to the `blockSummary.updates.updateQueues.*.queue` fields. +Note that this endpoint now returns a stream of the pending updates in block. + +To access the next sequence number for any updates, use the `getNextUpdateSequenceNumbers` endpoint, which corresponds to `blockSummary.updates.updateQueues.*.nextSequenceNumber` fields. + +To access the special events from the block, use the 'getBlockSpecialEvents', which corresponds to the `blockSummary.specialEvents` field. +Note that this endpoint now returns a stream of the special events in the block. + +To access the finalization data, which was previously found in the `blockSummary.finalizationData` field, use the `getBlockFinalizationSummary` endpoints. +Note that the structure of the data has been changed, both how it is wrapped and the field names. + +To access the events generated from the transactions in the block, use the `getBlockTransactionEvents` endpoint. This replaces the `blockSummary.transactionSummaries`, but note that structure is different. ## GetPoolStatus diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index 3357cf155..f89896edb 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -1099,14 +1099,14 @@ export interface NextUpdateSequenceNumbers { } export type BlockFinalizationSummary = - | BlockFinalizationSummary_None - | BlockFinalizationSummary_Record; + | BlockFinalizationSummaryNone + | BlockFinalizationSummaryRecord; -export interface BlockFinalizationSummary_None { +export interface BlockFinalizationSummaryNone { tag: 'none'; } -export interface BlockFinalizationSummary_Record { +export interface BlockFinalizationSummaryRecord { tag: 'record'; record: FinalizationSummary; } From 3ab4e22b933f9abd29da7fbbdb6e5a7d1e70faee Mon Sep 17 00:00:00 2001 From: Hjort Date: Mon, 3 Apr 2023 15:55:40 +0200 Subject: [PATCH 10/16] Move license to project root --- packages/common/LICENSE => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/common/LICENSE => LICENSE (100%) diff --git a/packages/common/LICENSE b/LICENSE similarity index 100% rename from packages/common/LICENSE rename to LICENSE From a8179fb20446c3323444d5c89af0f6a613336460 Mon Sep 17 00:00:00 2001 From: Hjort Date: Mon, 3 Apr 2023 15:57:27 +0200 Subject: [PATCH 11/16] revert type rename --- packages/common/src/types.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index f89896edb..3357cf155 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -1099,14 +1099,14 @@ export interface NextUpdateSequenceNumbers { } export type BlockFinalizationSummary = - | BlockFinalizationSummaryNone - | BlockFinalizationSummaryRecord; + | BlockFinalizationSummary_None + | BlockFinalizationSummary_Record; -export interface BlockFinalizationSummaryNone { +export interface BlockFinalizationSummary_None { tag: 'none'; } -export interface BlockFinalizationSummaryRecord { +export interface BlockFinalizationSummary_Record { tag: 'record'; record: FinalizationSummary; } From f85256b1c55d73a8c0c17ae20789f7fd9e34669a Mon Sep 17 00:00:00 2001 From: Rasmus Kirk Date: Wed, 12 Apr 2023 09:11:30 +0000 Subject: [PATCH 12/16] Update examples/tsconfig.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Søren Hjort <87635671+shjortConcordium@users.noreply.github.com> --- examples/tsconfig.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/tsconfig.json b/examples/tsconfig.json index 9f08c79fb..18e627dcf 100644 --- a/examples/tsconfig.json +++ b/examples/tsconfig.json @@ -8,9 +8,7 @@ "esModuleInterop": true, "outDir": "./lib", "lib": [ - "dom", - "esnext", - "webworker" + "esnext" ], "baseUrl": ".", "module": "es2020", From 14f6564d60c514a204856cfb33adc7fc16392646 Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Wed, 12 Apr 2023 11:16:57 +0200 Subject: [PATCH 13/16] Removed examples script from package.json --- examples/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/package.json b/examples/package.json index d788fa150..e7052cdf2 100644 --- a/examples/package.json +++ b/examples/package.json @@ -17,11 +17,9 @@ "typescript": "^4.3.5" }, "scripts": { - "example": "./execute-example.bash", "lint": "eslint . --cache --ext .ts,.tsx --max-warnings 0", "lint-fix": "yarn lint --fix; exit 0", "build": "tsc", "build-dev": "tsc" } } - From 96de540e70b2210a55f1562d6ecee0384aed61d2 Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Wed, 12 Apr 2023 11:25:39 +0200 Subject: [PATCH 14/16] Fixed lint --- yarn.lock | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/yarn.lock b/yarn.lock index 76c475a6d..c0888482f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1350,6 +1350,26 @@ __metadata: languageName: unknown linkType: soft +"@concordium/common-sdk@npm:6.4.0": + version: 6.4.0 + resolution: "@concordium/common-sdk@npm:6.4.0" + dependencies: + "@concordium/rust-bindings": 0.11.0 + "@grpc/grpc-js": ^1.3.4 + "@noble/ed25519": ^1.7.1 + "@protobuf-ts/runtime-rpc": ^2.8.2 + "@scure/bip39": ^1.1.0 + bs58check: ^2.1.2 + buffer: ^6.0.3 + cross-fetch: 3.1.5 + hash.js: ^1.1.7 + iso-3166-1: ^2.1.1 + json-bigint: ^1.0.0 + uuid: ^8.3.2 + checksum: d4d8fcd1961cfbe6939958afec90eeff05cc88c83cbb5bd6e1dcf5f887324e15b2c175e4e0dced4cf2860cdc06dcb945b94c88a7790f087028d4f1dcd9b40f86 + languageName: node + linkType: hard + "@concordium/node-sdk@6.3.0, @concordium/node-sdk@workspace:packages/nodejs": version: 0.0.0-use.local resolution: "@concordium/node-sdk@workspace:packages/nodejs" From b67dc2b4a31066fda67f930bda64cd5f5c0f57a0 Mon Sep 17 00:00:00 2001 From: rasmus-kirk Date: Wed, 12 Apr 2023 11:43:57 +0200 Subject: [PATCH 15/16] Added readme --- examples/readme.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/readme.md diff --git a/examples/readme.md b/examples/readme.md new file mode 100644 index 000000000..f84667dbf --- /dev/null +++ b/examples/readme.md @@ -0,0 +1,12 @@ +## Examples for the Concordium NodeJS-SDK + +This is a collection of scripts/examples that utilizes the SDK. There are +two directories with examples `client`, containing examples that utilize the +client, and `common`, that use various general functions from the library. To +run an example call: + +```shell +yarn ts-node /path/to/example.ts [opts] +``` + +Where opts are any arguments that the example script takes. From d6b96fec031d4af654e0f3003d804de0de437e15 Mon Sep 17 00:00:00 2001 From: Rasmus Kirk Date: Mon, 17 Apr 2023 08:43:49 +0000 Subject: [PATCH 16/16] Update examples/readme.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Søren Hjort <87635671+shjortConcordium@users.noreply.github.com> --- examples/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/readme.md b/examples/readme.md index f84667dbf..85b4c0a1c 100644 --- a/examples/readme.md +++ b/examples/readme.md @@ -2,7 +2,7 @@ This is a collection of scripts/examples that utilizes the SDK. There are two directories with examples `client`, containing examples that utilize the -client, and `common`, that use various general functions from the library. To +client to interact with a Concordium node, and `common`, that use various general functions from the library. To run an example call: ```shell