polkadot-cli 1.10.0 → 1.11.0

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.
package/README.md CHANGED
@@ -478,8 +478,10 @@ dot tx Balances.transferKeepAlive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694
478
478
  # Submit a raw SCALE-encoded call (e.g. from a multisig proposal or another tool)
479
479
  dot tx 0x0503008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 --from alice
480
480
 
481
- # Batch multiple transfers with Utility.batchAll
482
- dot tx Utility.batchAll '[{"type":"Balances","value":{"type":"transfer_keep_alive","value":{"dest":"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty","value":1000000000000}}},{"type":"Balances","value":{"type":"transfer_keep_alive","value":{"dest":"5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y","value":2000000000000}}}]' --from alice
481
+ # Batch multiple transfers with Utility.batchAll (comma-separated encoded calls)
482
+ A=$(dot tx Balances.transfer_keep_alive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --encode)
483
+ B=$(dot tx Balances.transfer_keep_alive 5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y 2000000000000 --encode)
484
+ dot tx Utility.batchAll $A,$B --from alice
483
485
  ```
484
486
 
485
487
  #### Enum shorthand
package/dist/cli.mjs CHANGED
@@ -1023,8 +1023,12 @@ function typeHint(entry, meta) {
1023
1023
  case "tuple":
1024
1024
  return "a JSON array";
1025
1025
  case "sequence":
1026
- case "array":
1027
- return "a JSON array or hex-encoded bytes";
1026
+ case "array": {
1027
+ const inner = resolved.value;
1028
+ if (inner?.type === "primitive" && inner.value === "u8")
1029
+ return "hex-encoded bytes or text";
1030
+ return "a JSON array, comma-separated values, or hex-encoded bytes";
1031
+ }
1028
1032
  default:
1029
1033
  return describeType(meta.lookup, entry.id);
1030
1034
  }
@@ -1233,6 +1237,10 @@ async function parseTypedArg(meta, entry, arg) {
1233
1237
  return normalizeValue(meta.lookup, entry, JSON.parse(arg));
1234
1238
  } catch {}
1235
1239
  }
1240
+ if (arg.includes(",")) {
1241
+ const elements = arg.split(",");
1242
+ return Promise.all(elements.map((el) => parseTypedArg(meta, inner, el.trim())));
1243
+ }
1236
1244
  if (/^0x[0-9a-fA-F]*$/.test(arg))
1237
1245
  return Binary2.fromHex(arg);
1238
1246
  return parseValue(arg);
@@ -2189,7 +2197,7 @@ var init_complete = __esm(() => {
2189
2197
  // src/cli.ts
2190
2198
  import cac from "cac";
2191
2199
  // package.json
2192
- var version = "1.10.0";
2200
+ var version = "1.11.0";
2193
2201
 
2194
2202
  // src/commands/account.ts
2195
2203
  init_accounts_store();
@@ -4650,8 +4658,12 @@ function typeHint2(entry, meta) {
4650
4658
  case "tuple":
4651
4659
  return "a JSON array";
4652
4660
  case "sequence":
4653
- case "array":
4654
- return "a JSON array or hex-encoded bytes";
4661
+ case "array": {
4662
+ const inner = resolved.value;
4663
+ if (inner?.type === "primitive" && inner.value === "u8")
4664
+ return "hex-encoded bytes or text";
4665
+ return "a JSON array, comma-separated values, or hex-encoded bytes";
4666
+ }
4655
4667
  default:
4656
4668
  return describeType(meta.lookup, entry.id);
4657
4669
  }
@@ -4880,6 +4892,10 @@ async function parseTypedArg2(meta, entry, arg) {
4880
4892
  return normalizeValue2(meta.lookup, entry, JSON.parse(arg));
4881
4893
  } catch {}
4882
4894
  }
4895
+ if (arg.includes(",")) {
4896
+ const elements = arg.split(",");
4897
+ return Promise.all(elements.map((el) => parseTypedArg2(meta, inner, el.trim())));
4898
+ }
4883
4899
  if (/^0x[0-9a-fA-F]*$/.test(arg))
4884
4900
  return Binary3.fromHex(arg);
4885
4901
  return parseValue(arg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polkadot-cli",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "CLI tool for querying Polkadot-ecosystem on-chain state",
5
5
  "type": "module",
6
6
  "bin": {