@streamr/cli-tools 103.0.0-rc.1 → 103.0.0-rc.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/streamr-identity-generate.js +21 -0
  3. package/dist/bin/streamr-identity-generate.js.map +1 -0
  4. package/dist/bin/streamr-identity-whoami.d.ts +2 -0
  5. package/dist/bin/{streamr-wallet-whoami.js → streamr-identity-whoami.js} +2 -2
  6. package/dist/bin/streamr-identity-whoami.js.map +1 -0
  7. package/dist/bin/{streamr-wallet.js → streamr-identity.js} +4 -3
  8. package/dist/bin/streamr-identity.js.map +1 -0
  9. package/dist/bin/streamr-internal-operator-create.d.ts +2 -0
  10. package/dist/bin/streamr-internal-operator-create.js +28 -0
  11. package/dist/bin/streamr-internal-operator-create.js.map +1 -0
  12. package/dist/bin/streamr-internal-operator-delegate.js +3 -3
  13. package/dist/bin/streamr-internal-operator-delegate.js.map +1 -1
  14. package/dist/bin/streamr-internal-operator-stake.js +1 -2
  15. package/dist/bin/streamr-internal-operator-stake.js.map +1 -1
  16. package/dist/bin/streamr-internal-operator-undelegate.js +3 -3
  17. package/dist/bin/streamr-internal-operator-undelegate.js.map +1 -1
  18. package/dist/bin/streamr-internal-operator-unstake.js +1 -2
  19. package/dist/bin/streamr-internal-operator-unstake.js.map +1 -1
  20. package/dist/bin/streamr-internal-sponsorship-create.d.ts +2 -0
  21. package/dist/bin/streamr-internal-sponsorship-create.js +24 -0
  22. package/dist/bin/streamr-internal-sponsorship-create.js.map +1 -0
  23. package/dist/bin/streamr-internal-sponsorship-sponsor.js +1 -1
  24. package/dist/bin/streamr-internal-sponsorship-sponsor.js.map +1 -1
  25. package/dist/bin/streamr-internal-token-mint.js +23 -5
  26. package/dist/bin/streamr-internal-token-mint.js.map +1 -1
  27. package/dist/bin/streamr-internal.js +2 -0
  28. package/dist/bin/streamr-internal.js.map +1 -1
  29. package/dist/bin/streamr.js +1 -1
  30. package/dist/bin/streamr.js.map +1 -1
  31. package/dist/package.json +9 -7
  32. package/dist/src/client.js +12 -2
  33. package/dist/src/client.js.map +1 -1
  34. package/dist/src/command.d.ts +4 -1
  35. package/dist/src/command.js +5 -2
  36. package/dist/src/command.js.map +1 -1
  37. package/dist/src/common.d.ts +4 -2
  38. package/dist/src/common.js +19 -1
  39. package/dist/src/common.js.map +1 -1
  40. package/dist/src/permission.js +2 -1
  41. package/dist/src/permission.js.map +1 -1
  42. package/dist/src/resend.js +1 -1
  43. package/dist/src/resend.js.map +1 -1
  44. package/package.json +9 -7
  45. package/dist/bin/streamr-wallet-whoami.js.map +0 -1
  46. package/dist/bin/streamr-wallet.js.map +0 -1
  47. /package/dist/bin/{streamr-wallet-whoami.d.ts → streamr-identity-generate.d.ts} +0 -0
  48. /package/dist/bin/{streamr-wallet.d.ts → streamr-identity.d.ts} +0 -0
package/README.md CHANGED
@@ -166,7 +166,7 @@ You must pass either the `--private-key` or `--config` option.
166
166
 
167
167
  ### Configuration
168
168
 
169
- User can specify environment and authentication details with the following command line arguments:
169
+ User can specify environment and identity details with the following command line arguments:
170
170
  - `--private-key <key>`, e.g. `--private-key 0x1234567890123456789012345678901234567890123456789012345678901234`
171
171
  - `--config <file>`, e.g. `--config foobar.json`
172
172
  - `--env` use a pre-defined environment, e.g. `--env dev2` to use the [development environment](https://github.com/streamr-dev/streamr-docker-dev)
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ require("../src/logLevel");
5
+ const sdk_1 = require("@streamr/sdk");
6
+ const utils_1 = require("@streamr/utils");
7
+ const command_1 = require("../src/command");
8
+ const common_1 = require("../src/common");
9
+ (0, command_1.createCommand)()
10
+ .description('generate a public/private key pair based on the --key-type option')
11
+ .requiredOption('--key-type [key-type]', `type of public/private key (${(0, common_1.formEnumArgValueDescription)(sdk_1.validKeyTypeValues)})`, (0, common_1.createFnParseEnum)('key-type', sdk_1.validKeyTypeValues))
12
+ .action(async (options) => {
13
+ const config = sdk_1.IdentityMapping[options.keyType]; // required option
14
+ const identity = config.generate();
15
+ console.info(JSON.stringify({
16
+ publicKey: await identity.getUserId(),
17
+ privateKey: (0, utils_1.binaryToHex)(await identity.getPrivateKey()),
18
+ }, null, 4));
19
+ })
20
+ .parse();
21
+ //# sourceMappingURL=streamr-identity-generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamr-identity-generate.js","sourceRoot":"","sources":["../../bin/streamr-identity-generate.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAkE;AAClE,0CAA4C;AAC5C,4CAAuD;AACvD,0CAA8E;AAE9E,IAAA,uBAAa,GAAE;KACV,WAAW,CAAC,mEAAmE,CAAC;KAChF,cAAc,CAAC,uBAAuB,EAAE,+BAA+B,IAAA,oCAA2B,EAAC,wBAAkB,CAAC,GAAG,EACtH,IAAA,0BAAiB,EAAC,UAAU,EAAE,wBAAkB,CAAC,CAAC;KACrD,MAAM,CAAC,KAAK,EAAE,OAAgB,EAAE,EAAE;IAC/B,MAAM,MAAM,GAAG,qBAAe,CAAC,OAAO,CAAC,OAAQ,CAAC,CAAA,CAAC,kBAAkB;IACnE,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAqB,CAAA;IACrD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QACxB,SAAS,EAAE,MAAM,QAAQ,CAAC,SAAS,EAAE;QACrC,UAAU,EAAE,IAAA,mBAAW,EAAC,MAAM,QAAQ,CAAC,aAAa,EAAE,CAAC;KAC1D,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC,CAAC;KACD,KAAK,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../src/logLevel';
@@ -6,6 +6,6 @@ const command_1 = require("../src/command");
6
6
  (0, command_1.createClientCommand)(async (client) => {
7
7
  console.info(await client.getUserId());
8
8
  })
9
- .description('displays your public address')
9
+ .description('displays your user id (public key)')
10
10
  .parseAsync();
11
- //# sourceMappingURL=streamr-wallet-whoami.js.map
11
+ //# sourceMappingURL=streamr-identity-whoami.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamr-identity-whoami.js","sourceRoot":"","sources":["../../bin/streamr-identity-whoami.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAGxB,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,EAAE;IAChD,OAAO,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;AAC1C,CAAC,CAAC;KACG,WAAW,CAAC,oCAAoC,CAAC;KACjD,UAAU,EAAE,CAAA"}
@@ -9,7 +9,8 @@ const package_json_1 = __importDefault(require("../package.json"));
9
9
  commander_1.program
10
10
  .version(package_json_1.default.version)
11
11
  .usage('<command> [<args>]')
12
- .description('wallet subcommands')
13
- .command('whoami', 'displays your public address')
12
+ .description('identity subcommands')
13
+ .command('whoami', 'displays your public key')
14
+ .command('generate', 'generates a new key pair')
14
15
  .parse();
15
- //# sourceMappingURL=streamr-wallet.js.map
16
+ //# sourceMappingURL=streamr-identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamr-identity.js","sourceRoot":"","sources":["../../bin/streamr-identity.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,sBAAsB,CAAC;KACnC,OAAO,CAAC,QAAQ,EAAE,0BAA0B,CAAC;KAC7C,OAAO,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC/C,KAAK,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../src/logLevel';
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ require("../src/logLevel");
5
+ const sdk_1 = require("@streamr/sdk");
6
+ const command_1 = require("../src/command");
7
+ const common_1 = require("../src/common");
8
+ (0, command_1.createClientCommand)(async (client, options) => {
9
+ const metadata = (options.redundancyFactor !== undefined) ? JSON.stringify({ redundancyFactor: options.redundancyFactor }) : '';
10
+ const contract = await sdk_1._operatorContractUtils.deployOperatorContract({
11
+ deployer: await client.getSigner(),
12
+ // TODO maybe we could change the operatorsCutPercentage type in _operatorContractUtils.deployTestOperatorContract so that the percentages
13
+ // aren't affected by floating point numbers (now e.g. input 12.3 stores the value as 12.3000000000000016)
14
+ operatorsCutPercentage: options.cut,
15
+ metadata,
16
+ environmentId: client.getConfig().environment
17
+ });
18
+ if (options.nodeAddresses !== undefined) {
19
+ await (await contract.setNodeAddresses(options.nodeAddresses)).wait();
20
+ }
21
+ console.info(JSON.stringify({ address: await contract.getAddress() }, undefined, 4));
22
+ })
23
+ .description('create operator')
24
+ .requiredOption('-c, --cut <number>', 'Operator\'s cut in percentage')
25
+ .option('-r, --redundancy-factor <number>', 'Redundancy factor')
26
+ .option('-n, --node-addresses <addresses>', 'Node addresses (comma separated list of Ethereum addresses)', (0, common_1.createFnParseEthereumAddressList)('nodeAddresses'))
27
+ .parseAsync();
28
+ //# sourceMappingURL=streamr-internal-operator-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamr-internal-operator-create.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-create.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAqF;AACrF,4CAA4E;AAC5E,0CAAgE;AAQhE,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,OAAgB,EAAE,EAAE;IAClE,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/H,MAAM,QAAQ,GAAG,MAAM,4BAAsB,CAAC,sBAAsB,CAAC;QACjE,QAAQ,EAAE,MAAM,MAAM,CAAC,SAAS,EAAE;QAClC,0IAA0I;QAC1I,0GAA0G;QAC1G,sBAAsB,EAAE,OAAO,CAAC,GAAG;QACnC,QAAQ;QACR,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,WAAW;KAChD,CAAC,CAAA;IACF,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,CAAC,MAAM,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IACzE,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAA;AACxF,CAAC,CAAC;KACG,WAAW,CAAC,iBAAiB,CAAC;KAC9B,cAAc,CAAC,oBAAoB,EAAE,+BAA+B,CAAC;KACrE,MAAM,CAAC,kCAAkC,EAAE,mBAAmB,CAAC;KAC/D,MAAM,CAAC,kCAAkC,EAAE,6DAA6D,EACrG,IAAA,yCAAgC,EAAC,eAAe,CAAC,CAAC;KACrD,UAAU,EAAE,CAAA"}
@@ -5,10 +5,10 @@ require("../src/logLevel");
5
5
  const sdk_1 = require("@streamr/sdk");
6
6
  const command_1 = require("../src/command");
7
7
  const ethers_1 = require("ethers");
8
- (0, command_1.createClientCommand)(async (client, operatorAddress, dataTokenAmount) => {
9
- await sdk_1._operatorContractUtils.delegate(await client.getSigner(), operatorAddress, (0, ethers_1.parseEther)(dataTokenAmount), sdk_1._operatorContractUtils.getTestTokenContract());
8
+ (0, command_1.createClientCommand)(async (client, operatorContractAddress, dataTokenAmount) => {
9
+ await sdk_1._operatorContractUtils.delegate(await client.getSigner(), operatorContractAddress, (0, ethers_1.parseEther)(dataTokenAmount));
10
10
  })
11
11
  .description('delegate funds to an operator')
12
- .arguments('<operatorAddress> <dataTokenAmount>')
12
+ .arguments('<operatorContractAddress> <dataTokenAmount>')
13
13
  .parseAsync();
14
14
  //# sourceMappingURL=streamr-internal-operator-delegate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"streamr-internal-operator-delegate.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-delegate.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,eAAuB,EAAE,eAAuB,EAAE,EAAE;IAClG,MAAM,4BAAsB,CAAC,QAAQ,CACjC,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,eAAe,EACf,IAAA,mBAAU,EAAC,eAAe,CAAC,EAC3B,4BAAsB,CAAC,oBAAoB,EAAE,CAChD,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,+BAA+B,CAAC;KAC5C,SAAS,CAAC,qCAAqC,CAAC;KAChD,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"streamr-internal-operator-delegate.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-delegate.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,uBAA+B,EAAE,eAAuB,EAAE,EAAE;IAC1G,MAAM,4BAAsB,CAAC,QAAQ,CACjC,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,uBAAuB,EACvB,IAAA,mBAAU,EAAC,eAAe,CAAC,CAC9B,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,+BAA+B,CAAC;KAC5C,SAAS,CAAC,6CAA6C,CAAC;KACxD,UAAU,EAAE,CAAA"}
@@ -6,8 +6,7 @@ const sdk_1 = require("@streamr/sdk");
6
6
  const command_1 = require("../src/command");
7
7
  const ethers_1 = require("ethers");
8
8
  (0, command_1.createClientCommand)(async (client, operatorContractAddress, sponsorshipAddress, dataTokenAmount) => {
9
- const operatorContract = sdk_1._operatorContractUtils.getOperatorContract(operatorContractAddress).connect(await client.getSigner());
10
- await sdk_1._operatorContractUtils.stake(operatorContract, sponsorshipAddress, (0, ethers_1.parseEther)(dataTokenAmount));
9
+ await sdk_1._operatorContractUtils.stake(await client.getSigner(), operatorContractAddress, sponsorshipAddress, (0, ethers_1.parseEther)(dataTokenAmount));
11
10
  })
12
11
  .description('stake funds to a sponsorship')
13
12
  .arguments('<operatorContractAddress> <sponsorshipAddress> <dataTokenAmount>')
@@ -1 +1 @@
1
- {"version":3,"file":"streamr-internal-operator-stake.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-stake.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,uBAA+B,EAAE,kBAA0B,EAAE,eAAuB,EAAE,EAAE;IACtI,MAAM,gBAAgB,GAAG,4BAAsB,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;IAC9H,MAAM,4BAAsB,CAAC,KAAK,CAC9B,gBAAgB,EAChB,kBAAkB,EAClB,IAAA,mBAAU,EAAC,eAAe,CAAC,CAC9B,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,8BAA8B,CAAC;KAC3C,SAAS,CAAC,kEAAkE,CAAC;KAC7E,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"streamr-internal-operator-stake.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-stake.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,uBAA+B,EAAE,kBAA0B,EAAE,eAAuB,EAAE,EAAE;IACtI,MAAM,4BAAsB,CAAC,KAAK,CAC9B,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,IAAA,mBAAU,EAAC,eAAe,CAAC,CAC9B,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,8BAA8B,CAAC;KAC3C,SAAS,CAAC,kEAAkE,CAAC;KAC7E,UAAU,EAAE,CAAA"}
@@ -5,10 +5,10 @@ require("../src/logLevel");
5
5
  const sdk_1 = require("@streamr/sdk");
6
6
  const command_1 = require("../src/command");
7
7
  const ethers_1 = require("ethers");
8
- (0, command_1.createClientCommand)(async (client, operatorAddress, dataTokenAmount) => {
9
- await sdk_1._operatorContractUtils.undelegate(await client.getSigner(), sdk_1._operatorContractUtils.getOperatorContract(operatorAddress), (0, ethers_1.parseEther)(dataTokenAmount));
8
+ (0, command_1.createClientCommand)(async (client, operatorContractAddress, dataTokenAmount) => {
9
+ await sdk_1._operatorContractUtils.undelegate(await client.getSigner(), operatorContractAddress, (0, ethers_1.parseEther)(dataTokenAmount));
10
10
  })
11
11
  .description('undelegate funds from an operator')
12
- .arguments('<operatorAddress> <dataTokenAmount>')
12
+ .arguments('<operatorContractAddress> <dataTokenAmount>')
13
13
  .parseAsync();
14
14
  //# sourceMappingURL=streamr-internal-operator-undelegate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"streamr-internal-operator-undelegate.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-undelegate.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,eAAuB,EAAE,eAAuB,EAAE,EAAE;IAClG,MAAM,4BAAsB,CAAC,UAAU,CACnC,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,4BAAsB,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAC3D,IAAA,mBAAU,EAAC,eAAe,CAAC,CAC9B,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,mCAAmC,CAAC;KAChD,SAAS,CAAC,qCAAqC,CAAC;KAChD,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"streamr-internal-operator-undelegate.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-undelegate.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,uBAA+B,EAAE,eAAuB,EAAE,EAAE;IAC1G,MAAM,4BAAsB,CAAC,UAAU,CACnC,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,uBAAuB,EACvB,IAAA,mBAAU,EAAC,eAAe,CAAC,CAC9B,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,mCAAmC,CAAC;KAChD,SAAS,CAAC,6CAA6C,CAAC;KACxD,UAAU,EAAE,CAAA"}
@@ -5,8 +5,7 @@ require("../src/logLevel");
5
5
  const sdk_1 = require("@streamr/sdk");
6
6
  const command_1 = require("../src/command");
7
7
  (0, command_1.createClientCommand)(async (client, operatorContractAddress, sponsorshipAddress) => {
8
- const operatorContract = sdk_1._operatorContractUtils.getOperatorContract(operatorContractAddress).connect(await client.getSigner());
9
- await sdk_1._operatorContractUtils.unstake(operatorContract, sponsorshipAddress);
8
+ await sdk_1._operatorContractUtils.unstake(await client.getSigner(), operatorContractAddress, sponsorshipAddress);
10
9
  })
11
10
  .arguments('<operatorContractAddress> <sponsorshipAddress>')
12
11
  .description('unstake all funds from a sponsorship')
@@ -1 +1 @@
1
- {"version":3,"file":"streamr-internal-operator-unstake.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-unstake.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,uBAA+B,EAAE,kBAA0B,EAAE,EAAE;IAC7G,MAAM,gBAAgB,GAAG,4BAAsB,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;IAC9H,MAAM,4BAAsB,CAAC,OAAO,CAChC,gBAAgB,EAChB,kBAAkB,CACrB,CAAA;AACL,CAAC,CAAC;KACG,SAAS,CAAC,gDAAgD,CAAC;KAC3D,WAAW,CAAC,sCAAsC,CAAC;KACnD,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"streamr-internal-operator-unstake.js","sourceRoot":"","sources":["../../bin/streamr-internal-operator-unstake.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,uBAA+B,EAAE,kBAA0B,EAAE,EAAE;IAC7G,MAAM,4BAAsB,CAAC,OAAO,CAChC,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,uBAAuB,EACvB,kBAAkB,CACrB,CAAA;AACL,CAAC,CAAC;KACG,SAAS,CAAC,gDAAgD,CAAC;KAC3D,WAAW,CAAC,sCAAsC,CAAC;KACnD,UAAU,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../src/logLevel';
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ require("../src/logLevel");
5
+ const sdk_1 = require("@streamr/sdk");
6
+ const command_1 = require("../src/command");
7
+ const utils_1 = require("@streamr/utils");
8
+ const ethers_1 = require("ethers");
9
+ (0, command_1.createClientCommand)(async (client, streamId, options) => {
10
+ const contract = await sdk_1._operatorContractUtils.deploySponsorshipContract({
11
+ streamId: (0, utils_1.toStreamID)(streamId, (0, utils_1.toEthereumAddress)(await client.getUserId())),
12
+ earningsPerSecond: (0, ethers_1.parseEther)(options.earningsPerSecond),
13
+ deployer: await client.getSigner(),
14
+ minOperatorCount: options.minOperatorCount,
15
+ environmentId: client.getConfig().environment
16
+ });
17
+ console.info(JSON.stringify({ address: await contract.getAddress() }, undefined, 4));
18
+ })
19
+ .description('create sponsorship')
20
+ .arguments('<streamId>')
21
+ .requiredOption('-e, --earnings-per-second <number>', 'Earnings per second')
22
+ .option('-c, --min-operator-count <number>', 'Minimum operator count')
23
+ .parseAsync();
24
+ //# sourceMappingURL=streamr-internal-sponsorship-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamr-internal-sponsorship-create.js","sourceRoot":"","sources":["../../bin/streamr-internal-sponsorship-create.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAA4E;AAC5E,0CAA8D;AAC9D,mCAAmC;AAOnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,QAAgB,EAAE,OAAgB,EAAE,EAAE;IACpF,MAAM,QAAQ,GAAG,MAAM,4BAAsB,CAAC,yBAAyB,CAAC;QACpE,QAAQ,EAAE,IAAA,kBAAU,EAAC,QAAQ,EAAE,IAAA,yBAAiB,EAAC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC3E,iBAAiB,EAAE,IAAA,mBAAU,EAAC,OAAO,CAAC,iBAAiB,CAAC;QACxD,QAAQ,EAAE,MAAM,MAAM,CAAC,SAAS,EAAE;QAClC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,WAAW;KAChD,CAAC,CAAA;IACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAA;AACxF,CAAC,CAAC;KACG,WAAW,CAAC,oBAAoB,CAAC;KACjC,SAAS,CAAC,YAAY,CAAC;KACvB,cAAc,CAAC,oCAAoC,EAAE,qBAAqB,CAAC;KAC3E,MAAM,CAAC,mCAAmC,EAAE,wBAAwB,CAAC;KACrE,UAAU,EAAE,CAAA"}
@@ -6,7 +6,7 @@ const sdk_1 = require("@streamr/sdk");
6
6
  const command_1 = require("../src/command");
7
7
  const ethers_1 = require("ethers");
8
8
  (0, command_1.createClientCommand)(async (client, sponsorshipAddress, dataTokenAmount) => {
9
- await sdk_1._operatorContractUtils.sponsor(await client.getSigner(), sponsorshipAddress, (0, ethers_1.parseEther)(dataTokenAmount), sdk_1._operatorContractUtils.getTestTokenContract());
9
+ await sdk_1._operatorContractUtils.sponsor(await client.getSigner(), sponsorshipAddress, (0, ethers_1.parseEther)(dataTokenAmount));
10
10
  })
11
11
  .description('sponsor a stream')
12
12
  .arguments('<sponsorshipAddress> <tokenAmount>')
@@ -1 +1 @@
1
- {"version":3,"file":"streamr-internal-sponsorship-sponsor.js","sourceRoot":"","sources":["../../bin/streamr-internal-sponsorship-sponsor.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,kBAA0B,EAAE,eAAuB,EAAE,EAAE;IACrG,MAAM,4BAAsB,CAAC,OAAO,CAChC,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,kBAAkB,EAClB,IAAA,mBAAU,EAAC,eAAe,CAAC,EAC3B,4BAAsB,CAAC,oBAAoB,EAAE,CAChD,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,kBAAkB,CAAC;KAC/B,SAAS,CAAC,oCAAoC,CAAC;KAC/C,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"streamr-internal-sponsorship-sponsor.js","sourceRoot":"","sources":["../../bin/streamr-internal-sponsorship-sponsor.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAoE;AACpE,4CAAoD;AACpD,mCAAmC;AAEnC,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,kBAA0B,EAAE,eAAuB,EAAE,EAAE;IACrG,MAAM,4BAAsB,CAAC,OAAO,CAChC,MAAM,MAAM,CAAC,SAAS,EAAE,EACxB,kBAAkB,EAClB,IAAA,mBAAU,EAAC,eAAe,CAAC,CAC9B,CAAA;AACL,CAAC,CAAC;KACG,WAAW,CAAC,kBAAkB,CAAC;KAC/B,SAAS,CAAC,oCAAoC,CAAC;KAC/C,UAAU,EAAE,CAAA"}
@@ -2,12 +2,29 @@
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  require("../src/logLevel");
5
- const sdk_1 = require("@streamr/sdk");
5
+ const config_1 = require("@streamr/config");
6
+ const network_contracts_1 = require("@streamr/network-contracts");
6
7
  const ethers_1 = require("ethers");
7
8
  const command_1 = require("../src/command");
8
- (0, command_1.createCommand)().action(async (targetAddress, dataTokenAmount, gasAmount) => {
9
- const adminWallet = sdk_1._operatorContractUtils.getTestAdminWallet();
10
- const token = sdk_1._operatorContractUtils.getTestTokenContract().connect(adminWallet);
9
+ const SELF_TARGET_ADDRESS_ID = 'self';
10
+ const TEST_CHAIN_CONFIG = config_1.config.dev2;
11
+ const getTestTokenContract = () => {
12
+ return new ethers_1.Contract(TEST_CHAIN_CONFIG.contracts.DATA, network_contracts_1.DATAv2ABI);
13
+ };
14
+ const getTestAdminWallet = (provider) => {
15
+ return new ethers_1.Wallet(TEST_CHAIN_CONFIG.adminPrivateKey, provider);
16
+ };
17
+ (0, command_1.createClientCommand)(async (client, targetAddress, dataTokenAmount, gasAmount) => {
18
+ if (client.getConfig().environment !== 'dev2') {
19
+ // adminPrivateKey is only available for "dev2" in the CHAIN_CONFIG
20
+ console.error('only "dev2" environment is supported');
21
+ process.exit(1);
22
+ }
23
+ if (targetAddress === SELF_TARGET_ADDRESS_ID) {
24
+ targetAddress = await client.getUserId();
25
+ }
26
+ const adminWallet = getTestAdminWallet((await client.getSigner()).provider);
27
+ const token = getTestTokenContract().connect(adminWallet);
11
28
  await (await token.mint(targetAddress, (0, ethers_1.parseEther)(dataTokenAmount))).wait();
12
29
  if (gasAmount !== undefined) {
13
30
  await (await adminWallet.sendTransaction({
@@ -17,6 +34,7 @@ const command_1 = require("../src/command");
17
34
  }
18
35
  })
19
36
  .arguments('<targetAddress> <dataTokenAmount> [gasAmount]')
20
- .description('mint test tokens and optionally transfer gas to the given Ethereum address')
37
+ .description('mint test tokens and optionally transfer gas to the given Ethereum address' +
38
+ '\n\nNote: use keyword "self" as targetAddress to mint for the authenticated user')
21
39
  .parseAsync();
22
40
  //# sourceMappingURL=streamr-internal-token-mint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"streamr-internal-token-mint.js","sourceRoot":"","sources":["../../bin/streamr-internal-token-mint.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAExB,sCAAqD;AACrD,mCAAmC;AACnC,4CAA8C;AAE9C,IAAA,uBAAa,GAAE,CAAC,MAAM,CAAC,KAAK,EAAE,aAAqB,EAAE,eAAuB,EAAE,SAAkB,EAAE,EAAE;IAChG,MAAM,WAAW,GAAG,4BAAsB,CAAC,kBAAkB,EAAE,CAAA;IAC/D,MAAM,KAAK,GAAG,4BAAsB,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAChF,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,IAAA,mBAAU,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC3E,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,CAAC,MAAM,WAAW,CAAC,eAAe,CAAC;YACrC,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,IAAA,mBAAU,EAAC,SAAS,CAAC;SAC/B,CAAC,CAAC,CAAC,IAAI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CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACzD,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,IAAA,mBAAU,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC3E,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,CAAC,MAAM,WAAW,CAAC,eAAe,CAAC;YACrC,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,IAAA,mBAAU,EAAC,SAAS,CAAC;SAC/B,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IACd,CAAC;AACL,CAAC,CAAC;KACG,SAAS,CAAC,+CAA+C,CAAC;KAC1D,WAAW,CAAC,4EAA4E;IACrF,kFAAkF,CAAC;KACtF,UAAU,EAAE,CAAA"}
@@ -13,7 +13,9 @@ commander_1.program
13
13
  .command('node-info', 'info about a node')
14
14
  .command('visualize-topology', 'visualize network topology')
15
15
  .command('show-sdk-config', 'show config used by internal StreamrClient')
16
+ .command('sponsorship-create', 'create sponsorship')
16
17
  .command('sponsorship-sponsor', 'sponsor a sponsorship')
18
+ .command('operator-create', 'create operator')
17
19
  .command('operator-delegate', 'delegate funds to an operator')
18
20
  .command('operator-undelegate', 'undelegate funds from an operator')
19
21
  .command('operator-stake', 'stake operator\'s funds to a sponsorship')
@@ -1 +1 @@
1
- {"version":3,"file":"streamr-internal.js","sourceRoot":"","sources":["../../bin/streamr-internal.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,kEAAkE,CAAC;KAC/E,OAAO,CAAC,WAAW,EAAE,mBAAmB,CAAC;KACzC,OAAO,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;KAC3D,OAAO,CAAC,iBAAiB,EAAE,4CAA4C,CAAC;KACxE,OAAO,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;KACvD,OAAO,CAAC,mBAAmB,EAAE,+BAA+B,CAAC;KAC7D,OAAO,CAAC,qBAAqB,EAAE,mCAAmC,CAAC;KACnE,OAAO,CAAC,gBAAgB,EAAE,0CAA0C,CAAC;KACrE,OAAO,CAAC,kBAAkB,EAAE,kDAAkD,CAAC;KAC/E,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACzC,KAAK,EAAE,CAAA"}
1
+ {"version":3,"file":"streamr-internal.js","sourceRoot":"","sources":["../../bin/streamr-internal.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,kEAAkE,CAAC;KAC/E,OAAO,CAAC,WAAW,EAAE,mBAAmB,CAAC;KACzC,OAAO,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;KAC3D,OAAO,CAAC,iBAAiB,EAAE,4CAA4C,CAAC;KACxE,OAAO,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;KACnD,OAAO,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;KACvD,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;KAC7C,OAAO,CAAC,mBAAmB,EAAE,+BAA+B,CAAC;KAC7D,OAAO,CAAC,qBAAqB,EAAE,mCAAmC,CAAC;KACnE,OAAO,CAAC,gBAAgB,EAAE,0CAA0C,CAAC;KACrE,OAAO,CAAC,kBAAkB,EAAE,kDAAkD,CAAC;KAC/E,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACzC,KAAK,EAAE,CAAA"}
@@ -13,7 +13,7 @@ commander_1.program
13
13
  .command('stream', 'stream subcommands')
14
14
  .command('storage-node', 'storage node subcommands')
15
15
  .command('mock-data', 'mock data subcommands')
16
- .command('wallet', 'wallet subcommands')
16
+ .command('identity', 'subcommands for keys and wallets')
17
17
  .command('internal', 'subcommands for internal use')
18
18
  .parse();
19
19
  //# sourceMappingURL=streamr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"streamr.js","sourceRoot":"","sources":["../../bin/streamr.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,iCAAiC,CAAC;KACxC,WAAW,CAAC,yEAAyE,CAAC;KACtF,OAAO,CAAC,QAAQ,EAAE,oBAAoB,CAAC;KACvC,OAAO,CAAC,cAAc,EAAE,0BAA0B,CAAC;KACnD,OAAO,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC7C,OAAO,CAAC,QAAQ,EAAE,oBAAoB,CAAC;KACvC,OAAO,CAAC,UAAU,EAAE,8BAA8B,CAAC;KACnD,KAAK,EAAE,CAAA"}
1
+ {"version":3,"file":"streamr.js","sourceRoot":"","sources":["../../bin/streamr.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,iCAAiC,CAAC;KACxC,WAAW,CAAC,yEAAyE,CAAC;KACtF,OAAO,CAAC,QAAQ,EAAE,oBAAoB,CAAC;KACvC,OAAO,CAAC,cAAc,EAAE,0BAA0B,CAAC;KACnD,OAAO,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC7C,OAAO,CAAC,UAAU,EAAE,kCAAkC,CAAC;KACvD,OAAO,CAAC,UAAU,EAAE,8BAA8B,CAAC;KACnD,KAAK,EAAE,CAAA"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamr/cli-tools",
3
- "version": "103.0.0-rc.1",
3
+ "version": "103.0.0-rc.12",
4
4
  "description": "Command line tools for Streamr",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,10 +32,12 @@
32
32
  "author": "Streamr Network AG <contact@streamr.com>",
33
33
  "license": "AGPL-3.0",
34
34
  "dependencies": {
35
- "@streamr/dht": "103.0.0-rc.1",
36
- "@streamr/sdk": "103.0.0-rc.1",
37
- "@streamr/trackerless-network": "103.0.0-rc.1",
38
- "@streamr/utils": "103.0.0-rc.1",
35
+ "@streamr/config": "^5.5.3",
36
+ "@streamr/dht": "103.0.0-rc.12",
37
+ "@streamr/network-contracts": "^9.1.0",
38
+ "@streamr/sdk": "103.0.0-rc.12",
39
+ "@streamr/trackerless-network": "103.0.0-rc.12",
40
+ "@streamr/utils": "103.0.0-rc.12",
39
41
  "commander": "^13.1.0",
40
42
  "easy-table": "^1.1.1",
41
43
  "ethers": "^6.13.0",
@@ -44,11 +46,11 @@
44
46
  "semver": "^7.7.1"
45
47
  },
46
48
  "devDependencies": {
47
- "@streamr/test-utils": "103.0.0-rc.1",
49
+ "@streamr/test-utils": "103.0.0-rc.12",
48
50
  "@types/event-stream": "^4.0.5",
49
51
  "@types/lodash": "^4.17.16",
50
52
  "@types/merge2": "^1.4.4",
51
- "@types/semver": "^7.5.8",
53
+ "@types/semver": "^7.7.0",
52
54
  "merge2": "^1.4.1"
53
55
  }
54
56
  }
@@ -10,8 +10,18 @@ const config_1 = require("./config");
10
10
  const getClientConfig = (commandOptions, overridenOptions = {}) => {
11
11
  const configFileJson = (0, config_1.getConfig)(commandOptions.config)?.client;
12
12
  const environmentOptions = { environment: commandOptions.env };
13
- const authenticationOptions = (commandOptions.privateKey !== undefined) ? { auth: { privateKey: commandOptions.privateKey } } : undefined;
14
- return (0, merge_1.default)(configFileJson, environmentOptions, authenticationOptions, overridenOptions);
13
+ const keyPairConfig = (commandOptions.privateKey) ? {
14
+ privateKey: commandOptions.privateKey,
15
+ publicKey: commandOptions.publicKey,
16
+ keyType: commandOptions.keyType
17
+ } : undefined;
18
+ const encryptionOptions = (commandOptions.quantum === true) ? {
19
+ encryption: {
20
+ requireQuantumResistantKeyExchange: true,
21
+ requireQuantumResistantSignatures: true,
22
+ }
23
+ } : {};
24
+ return (0, merge_1.default)(configFileJson, environmentOptions, keyPairConfig ? { auth: keyPairConfig } : {}, encryptionOptions, overridenOptions);
15
25
  };
16
26
  exports.getClientConfig = getClientConfig;
17
27
  const addInterruptHandler = (client) => {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,sCAAiE;AACjE,yDAAgC;AAEhC,qCAAoC;AAE7B,MAAM,eAAe,GAAG,CAAC,cAAuB,EAAE,mBAAwC,EAAE,EAAuB,EAAE;IACxH,MAAM,cAAc,GAAG,IAAA,kBAAS,EAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IAC/D,MAAM,kBAAkB,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,GAAG,EAAE,CAAA;IAC9D,MAAM,qBAAqB,GAAG,CAAC,cAAc,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,cAAc,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IACzI,OAAO,IAAA,eAAK,EACR,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,CACnB,CAAA;AACL,CAAC,CAAA;AAVY,QAAA,eAAe,mBAU3B;AAED,MAAM,mBAAmB,GAAG,CAAC,MAAqB,EAAE,EAAE;IAClD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QAC5B,IAAI,CAAC;YACD,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC;QAAC,MAAM,CAAC;YACL,QAAQ;QACZ,CAAC;QACD,OAAO,CAAC,IAAI,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAEM,MAAM,YAAY,GAAG,CAAC,cAAuB,EAAE,mBAAwC,EAAE,EAAiB,EAAE;IAC/G,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AAM,mBAAmB,GAAG,CAAC,MAAqB,EAAE,EAAE;IAClD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QAC5B,IAAI,CAAC;YACD,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC;QAAC,MAAM,CAAC;YACL,QAAQ;QACZ,CAAC;QACD,OAAO,CAAC,IAAI,EAAE,CAAA;IAClB,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAEM,MAAM,YAAY,GAAG,CAAC,cAAuB,EAAE,mBAAwC,EAAE,EAAiB,EAAE;IAC/G,MAAM,MAAM,GAAG,IAAA,uBAAe,EAAC,cAAc,EAAE,gBAAgB,CAAC,CAAA;IAChE,MAAM,MAAM,GAAG,IAAI,mBAAa,CAAC,MAAM,CAAC,CAAA;IACxC,mBAAmB,CAAC,MAAM,CAAC,CAAA;IAC3B,OAAO,MAAM,CAAA;AACjB,CAAC,CAAA;AALY,QAAA,YAAY,gBAKxB"}
@@ -1,9 +1,12 @@
1
- import { EnvironmentId, StreamrClientConfig } from '@streamr/sdk';
1
+ import { EnvironmentId, StreamrClientConfig, KeyType } from '@streamr/sdk';
2
2
  import commander from 'commander';
3
3
  export interface Options {
4
+ publicKey?: string;
4
5
  privateKey?: string;
6
+ keyType?: KeyType;
5
7
  config?: string;
6
8
  env?: EnvironmentId;
9
+ quantum?: boolean;
7
10
  }
8
11
  export declare const createCommand: () => commander.Command;
9
12
  export interface CommandOpts {
@@ -21,9 +21,12 @@ const createClientCommand = (action, opts = {
21
21
  clientOptionsFactory: () => ({})
22
22
  }) => {
23
23
  return (0, exports.createCommand)()
24
- .option('--private-key <key>', 'use an Ethereum private key to authenticate')
25
- .option('--config <file>', 'read connection and authentication settings from a config file')
24
+ .option('--private-key <key>', 'a private key to establish your identity')
25
+ .option('--key-type [key-type]', `type of public/private key (${(0, common_1.formEnumArgValueDescription)(sdk_1.validKeyTypeValues, sdk_1.DEFAULT_KEY_TYPE)})`, (0, common_1.createFnParseEnum)('key-type', sdk_1.validKeyTypeValues))
26
+ .option('--public-key [public-key]', 'a public key - required by some key types')
27
+ .option('--config <file>', 'read connection and identity settings from a config file')
26
28
  .option('--env <environmentId>', `use pre-defined environment (${(0, common_1.formEnumArgValueDescription)(sdk_1.ENVIRONMENT_IDS, sdk_1.DEFAULT_ENVIRONMENT_ID)})`, (0, common_1.createFnParseEnum)('env', sdk_1.ENVIRONMENT_IDS))
29
+ .option('--quantum', 'require quantum resistant key exchange and signature algorithms to be used')
27
30
  .action(async (...args) => {
28
31
  const commandOptions = args[args.length - 1].opts();
29
32
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/command.ts"],"names":[],"mappings":";;;;;;AAAA,sCAA0G;AAC1G,yCAA8C;AAC9C,mEAAiC;AACjC,qCAAuC;AACvC,qCAAyE;AAQlE,MAAM,aAAa,GAAG,GAAsB,EAAE;IACjD,OAAO,IAAI,mBAAO,EAAE;SACf,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;SACpB,kBAAkB,EAAE;SACpB,oBAAoB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC,CAAA;AALY,QAAA,aAAa,iBAKzB;AAOM,MAAM,mBAAmB,GAAG,CAC/B,MAA+C,EAC/C,OAAoB;IAChB,iBAAiB,EAAE,IAAI;IACvB,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;CACnC,EACgB,EAAE;IACnB,OAAO,IAAA,qBAAa,GAAE;SACjB,MAAM,CAAC,qBAAqB,EAAE,6CAA6C,CAAC;SAC5E,MAAM,CAAC,iBAAiB,EAAE,gEAAgE,CAAC;SAC3F,MAAM,CAAC,uBAAuB,EAAE,gCAAgC,IAAA,oCAA2B,EAAC,qBAAe,EAAE,4BAAsB,CAAC,GAAG,EACpI,IAAA,0BAAiB,EAAC,KAAK,EAAE,qBAAe,CAAC,CAAC;SAC7C,MAAM,CAAC,KAAK,EAAE,GAAG,IAAW,EA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mB,uBAgC/B"}
@@ -1,9 +1,11 @@
1
+ import { EthereumAddress } from '@streamr/utils';
1
2
  export declare enum OptionType {
2
3
  FLAG = 0,// e.g. "--enable"
3
4
  ARGUMENT = 1
4
5
  }
5
6
  export declare const getOptionType: (value: string | boolean) => OptionType | never;
6
7
  export declare function createFnParseInt(name: string): (s: string) => number;
7
- export declare function createFnParseEnum(name: string, allowedValues: string[]): (s: string) => string;
8
- export declare const formEnumArgValueDescription: (allowedValues: string[], defaultValue: string) => string;
8
+ export declare function createFnParseEnum(name: string, allowedValues: readonly string[]): (s: string) => string;
9
+ export declare const formEnumArgValueDescription: (allowedValues: readonly string[], defaultValue?: string) => string;
9
10
  export declare const wrapWithQuotes: (str: string) => string;
11
+ export declare function createFnParseEthereumAddressList(name: string): (s: string) => EthereumAddress[];
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.wrapWithQuotes = exports.formEnumArgValueDescription = exports.getOptionType = exports.OptionType = void 0;
4
4
  exports.createFnParseInt = createFnParseInt;
5
5
  exports.createFnParseEnum = createFnParseEnum;
6
+ exports.createFnParseEthereumAddressList = createFnParseEthereumAddressList;
7
+ const utils_1 = require("@streamr/utils");
6
8
  var OptionType;
7
9
  (function (OptionType) {
8
10
  OptionType[OptionType["FLAG"] = 0] = "FLAG";
@@ -40,11 +42,27 @@ function createFnParseEnum(name, allowedValues) {
40
42
  };
41
43
  }
42
44
  const formEnumArgValueDescription = (allowedValues, defaultValue) => {
43
- return `one of: ${allowedValues.map(exports.wrapWithQuotes).join(', ')}, default: ${(0, exports.wrapWithQuotes)(defaultValue)}`;
45
+ return `one of: ${allowedValues.map(exports.wrapWithQuotes).join(', ')}${defaultValue ? `, default: ${(0, exports.wrapWithQuotes)(defaultValue)}` : ''}`;
44
46
  };
45
47
  exports.formEnumArgValueDescription = formEnumArgValueDescription;
46
48
  const wrapWithQuotes = (str) => {
47
49
  return `"${str}"`;
48
50
  };
49
51
  exports.wrapWithQuotes = wrapWithQuotes;
52
+ function createFnParseEthereumAddressList(name) {
53
+ return (value) => {
54
+ const items = value.split(',').map((item) => item.trim());
55
+ const result = [];
56
+ for (const item of items) {
57
+ try {
58
+ result.push((0, utils_1.toEthereumAddress)(item));
59
+ }
60
+ catch {
61
+ console.error(`${name} has invalid Ethereum address: "${item}"`);
62
+ process.exit(1);
63
+ }
64
+ }
65
+ return result;
66
+ };
67
+ }
50
68
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":";;;AAeA,4CASC;AAED,8CAQC;AAlCD,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,2CAAI,CAAA;IACJ,mDAAQ,CAAA,CAAE,8BAA8B;AAC5C,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAEM,MAAM,aAAa,GAAG,CAAC,KAAuB,EAAsB,EAAE;IACzE,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC,IAAI,CAAA;IAC1B,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC,QAAQ,CAAA;IAC9B,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,+BAA+B,KAAK,GAAG,CAAC,CAAA;IAC5D,CAAC;AACL,CAAC,CAAA;AARY,QAAA,aAAa,iBAQzB;AAED,SAAgB,gBAAgB,CAAC,IAAY;IACzC,OAAO,CAAC,GAAW,EAAE,EAAE;QACnB,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAC3B,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,6BAA6B,GAAG,IAAI,CAAC,CAAA;YAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACnB,CAAC;QACD,OAA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I,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,cAAc,IAAA,sBAAc,EAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;AACvI,CAAC,CAAA;AAFY,QAAA,2BAA2B,+BAEvC;AAEM,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE;IAClD,OAAO,IAAI,GAAG,GAAG,CAAA;AACrB,CAAC,CAAA;AAFY,QAAA,cAAc,kBAE1B;AAED,SAAgB,gCAAgC,CAAC,IAAY;IACzD,OAAO,CAAC,KAAa,EAAE,EAAE;QACrB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACxD,MAAM,MAAM,GAAsB,EAAE,CAAA;QACpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IAAI,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC,IAAA,yBAAiB,EAAC,IAAI,CAAC,CAAC,CAAA;YACxC,CAAC;YAAC,MAAM,CAAC;gBACL,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,mCAAmC,IAAI,GAAG,CAAC,CAAA;gBAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACnB,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAA;IACjB,CAAC,CAAA;AACL,CAAC"}
@@ -46,7 +46,8 @@ const runModifyPermissionsCommand = (modify, modification) => {
46
46
  .addArgument(new commander_1.Argument('<streamId>'))
47
47
  .addArgument(new commander_1.Argument('<user>'))
48
48
  .addArgument(new commander_1.Argument('<permissions...>').choices(Array.from(exports.PERMISSIONS.keys())))
49
- .description(`${modification} permission: use keyword "public" as a user to ${modification} a public permission`)
49
+ .description(`${modification} permission: use keyword "public" as the <user> to ${modification} a public permission. ` +
50
+ `Valid <permissions...> are: [${Array.from(exports.PERMISSIONS.keys()).join(', ')}]`)
50
51
  .parseAsync(process.argv);
51
52
  };
52
53
  exports.runModifyPermissionsCommand = runModifyPermissionsCommand;
@@ -1 +1 @@
1
- {"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/permission.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,sCAA4F;AAC5F,uCAA+C;AAE/C,MAAM,cAAc,GAAG,QAAQ,CAAA;AAElB,QAAA,WAAW,GAAG,IAAI,GAAG,CAA2B;IACzD,CAAC,WAAW,EAAE,sBAAgB,CAAC,SAAS,CAAC;IACzC,CAAC,SAAS,EAAE,sBAAgB,CAAC,OAAO,CAAC;IACrC,CAAC,MAAM,EAAE,sBAAgB,CAAC,IAAI,CAAC;IAC/B,CAAC,QAAQ,EAAE,sBAAgB,CAAC,MAAM,CAAC;IACnC,CAAC,OAAO,EAAE,sBAAgB,CAAC,KAAK,CAAC;CACpC,CAAC,CAAA;AAEK,MAAM,aAAa,GAAG,CAAC,EAAU,EAA4B,EAAE;IAClE,MAAM,MAAM,GAAG,mBAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAClC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,MAAM,CAAA;AACjB,CAAC,CAAA;AANY,QAAA,aAAa,iBAMzB;AAEM,MAAM,eAAe,GAAG,CAAC,UAA4B,EAAU,EAAE;IACpE,OAAO,KAAK,CAAC,IAAI,CAAC,mBAAW,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CAAE,CAAC,CAAC,CAAC,CAAA;AACrF,CAAC,CAAA;AAFY,QAAA,eAAe,mBAE3B;AAEM,MAAM,2BAA2B,GAAG,CACvC,MAA2E,EAC3E,YAAoB,EAChB,EAAE;IACN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EAAE,CAAC;YAC1B,UAAU,GAAG;gBACT,WAAW;gBACX,MAAM,EAAE,IAAI;aACf,CAAA;QACL,CAAC;aAAM,CAAC;YACJ,UAAU,GAAG;gBACT,WAAW;gBACX,MAAM,EAAE,IAAI;aACf,CAAA;QACL,CAAC;QACD,MAAM,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACpC,CAAC,CAAC;SACG,WAAW,CAAC,IAAI,oBAAQ,CAAC,YAAY,CAAC,CAAC;SACvC,WAAW,CAAC,IAAI,oBAAQ,CAAC,QAAQ,CAAC,CAAC;SACnC,WAAW,CAAC,IAAI,oBAAQ,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SACrF,WAAW,CAAC,GAAG,YAAY,sDAAsD,YAAY,wBAAwB;QAClH,gCAAgC,KAAK,CAAC,IAAI,CAAC,mBAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;SAChF,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC,CAAA;AA3BY,QAAA,2BAA2B,+BA2BvC"}
@@ -24,7 +24,7 @@ const resend = async (streamId, resendOpts, client, subscribe) => {
24
24
  }
25
25
  }
26
26
  catch (err) {
27
- console.error(err.message ? err.message : err);
27
+ console.error(err.message ?? err);
28
28
  process.exit(1);
29
29
  }
30
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"resend.js","sourceRoot":"","sources":["../../src/resend.ts"],"names":[],"mappings":";;;AAEO,MAAM,uBAAuB,GAAG,CACnC,OAAgB,EAChB,OAAgB,EAChB,YAAoB,EACpB,cAAiB,EACL,EAAE;IACd,IAAI,CAAC,OAAO,IAAI,cAAc,IAAI,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,cAAc,IAAI,CAAC,CAAC,OAAO,IA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CAAC,OAAO,IAAI,cAAc,IAAI,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC;QAC7H,OAAO,CAAC,KAAK,CAAC,UAAU,YAAY,EAAE,CAAC,CAAA;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC;AACL,CAAC,CAAA;AAVY,QAAA,uBAAuB,2BAUnC;AAEM,MAAM,MAAM,GAAG,KAAK,EACvB,QAAgB,EAChB,UAAyB,EACzB,MAAqB,EACrB,SAAkB,EACL,EAAE;IACf,IAAI,CAAC;QACD,MAAM,OAAO,GAAG,CAAC,OAAY,EAAE,EAAE;YAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;QACzC,CAAC,CAAA;QACD,IAAI,SAAS,EAAE,CAAC;YACZ,MAAM,MAAM,CAAC,SAAS,CAAC;gBACnB,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,UAAU;aACrB,EAAE,OAAO,CAAC,CAAA;QACf,CAAC;aAAM,CAAC;YACJ,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QACtD,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAA;QACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC;AACL,CAAC,CAAA;AAtBY,QAAA,MAAM,UAsBlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamr/cli-tools",
3
- "version": "103.0.0-rc.1",
3
+ "version": "103.0.0-rc.12",
4
4
  "description": "Command line tools for Streamr",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,10 +32,12 @@
32
32
  "author": "Streamr Network AG <contact@streamr.com>",
33
33
  "license": "AGPL-3.0",
34
34
  "dependencies": {
35
- "@streamr/dht": "103.0.0-rc.1",
36
- "@streamr/sdk": "103.0.0-rc.1",
37
- "@streamr/trackerless-network": "103.0.0-rc.1",
38
- "@streamr/utils": "103.0.0-rc.1",
35
+ "@streamr/config": "^5.5.3",
36
+ "@streamr/dht": "103.0.0-rc.12",
37
+ "@streamr/network-contracts": "^9.1.0",
38
+ "@streamr/sdk": "103.0.0-rc.12",
39
+ "@streamr/trackerless-network": "103.0.0-rc.12",
40
+ "@streamr/utils": "103.0.0-rc.12",
39
41
  "commander": "^13.1.0",
40
42
  "easy-table": "^1.1.1",
41
43
  "ethers": "^6.13.0",
@@ -44,11 +46,11 @@
44
46
  "semver": "^7.7.1"
45
47
  },
46
48
  "devDependencies": {
47
- "@streamr/test-utils": "103.0.0-rc.1",
49
+ "@streamr/test-utils": "103.0.0-rc.12",
48
50
  "@types/event-stream": "^4.0.5",
49
51
  "@types/lodash": "^4.17.16",
50
52
  "@types/merge2": "^1.4.4",
51
- "@types/semver": "^7.5.8",
53
+ "@types/semver": "^7.7.0",
52
54
  "merge2": "^1.4.1"
53
55
  }
54
56
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"streamr-wallet-whoami.js","sourceRoot":"","sources":["../../bin/streamr-wallet-whoami.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAGxB,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,EAAE;IAChD,OAAO,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;AAC1C,CAAC,CAAC;KACG,WAAW,CAAC,8BAA8B,CAAC;KAC3C,UAAU,EAAE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"streamr-wallet.js","sourceRoot":"","sources":["../../bin/streamr-wallet.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,oBAAoB,CAAC;KACjC,OAAO,CAAC,QAAQ,EAAE,8BAA8B,CAAC;KACjD,KAAK,EAAE,CAAA"}