@toon-protocol/client 5.0.2 → 5.1.1

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generateMnemonic,
3
3
  validateMnemonic
4
- } from "./chunk-WJKJ6Y4N.js";
4
+ } from "./chunk-6O5OXJVR.js";
5
5
 
6
6
  // src/keys/keystore-node.ts
7
7
  import {
@@ -163,4 +163,4 @@ export {
163
163
  loadKeystore,
164
164
  writeKeystoreFile
165
165
  };
166
- //# sourceMappingURL=chunk-2DGVNDKA.js.map
166
+ //# sourceMappingURL=chunk-VHP6XLM3.js.map
package/dist/cli/main.js CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  generateKeystore,
4
4
  importKeystore,
5
5
  openKeystore
6
- } from "../chunk-2DGVNDKA.js";
6
+ } from "../chunk-VHP6XLM3.js";
7
7
  import {
8
8
  DEVNET,
9
9
  deriveFullIdentity,
10
10
  evmDerivationPath,
11
11
  generateRandomIdentity,
12
12
  isHiddenServiceUrl
13
- } from "../chunk-WJKJ6Y4N.js";
13
+ } from "../chunk-6O5OXJVR.js";
14
14
 
15
15
  // src/cli/main.ts
16
16
  import { homedir as homedir3 } from "os";
@@ -139,6 +139,11 @@ var COMMAND_OPTIONS = {
139
139
  arg: "BASE_UNITS",
140
140
  help: "Amount in base units. On send, overrides the route price."
141
141
  },
142
+ "seal-to": {
143
+ type: "string",
144
+ arg: "URL|KEY",
145
+ help: "On send, the connector that terminates the route: its GET /ilp URL or a 0x uncompressed key. A forwarded route usually also needs --amount."
146
+ },
142
147
  to: { type: "string", arg: "ADDRESS", help: "Destination address." },
143
148
  asset: { type: "string", arg: "native|token", help: "Which asset to move. Default 'token'." }
144
149
  };
@@ -198,8 +203,8 @@ var COMMANDS = {
198
203
  },
199
204
  send: {
200
205
  summary: "Pay for one HTTP request and print the answer.",
201
- usage: "send [destination] [--method VERB] [--target PATH] [-H NAME:VALUE]... [--body TEXT | --body-file PATH | --body -] [--json-body] [--amount BASE_UNITS]",
202
- options: ["method", "target", "header", "body", "body-file", "json-body", "amount"],
206
+ usage: "send [destination] [--method VERB] [--target PATH] [-H NAME:VALUE]... [--body TEXT | --body-file PATH | --body -] [--json-body] [--amount BASE_UNITS] [--seal-to URL|KEY]",
207
+ options: ["method", "target", "header", "body", "body-file", "json-body", "amount", "seal-to"],
203
208
  minPositionals: 0,
204
209
  maxPositionals: 1,
205
210
  details: [
@@ -479,10 +484,10 @@ function resolveSettings(values, env, options = {}) {
479
484
  connector = connectorEnv;
480
485
  connectorSource = "env";
481
486
  } else {
482
- connector = DEVNET.store.url;
487
+ connector = DEVNET.connector;
483
488
  connectorSource = "default";
484
489
  warnings.push(
485
- `toon-client: no connector given, using the devnet store node ${DEVNET.store.url}.
490
+ `toon-client: no connector given, using the devnet connector ${DEVNET.connector}.
486
491
  Set --connector or ${CONNECTOR_ENV} to talk to another node.`
487
492
  );
488
493
  }
@@ -588,7 +593,7 @@ function buildClientConfig(settings, keys) {
588
593
  };
589
594
  }
590
595
  async function defaultCreateClient(config) {
591
- const module = await import("../client-WCAXMQWM.js");
596
+ const module = await import("../client-RO3VITXU.js");
592
597
  const factory = module.ToonClient;
593
598
  if (factory === void 0) {
594
599
  throw new Error(
@@ -1384,6 +1389,7 @@ function payloadFor(result) {
1384
1389
  async function run10(ctx) {
1385
1390
  const request = await buildRequest(ctx);
1386
1391
  const amountFlag = stringOption(ctx.values, "amount");
1392
+ const sealToFlag = stringOption(ctx.values, "seal-to");
1387
1393
  const client = await ctx.client();
1388
1394
  const destination = ctx.positionals[0] ?? client.defaultDestination;
1389
1395
  if (destination === void 0) {
@@ -1395,7 +1401,10 @@ async function run10(ctx) {
1395
1401
  const result = await client.send(
1396
1402
  destination,
1397
1403
  request,
1398
- amountFlag === void 0 ? void 0 : { amount: BigInt(amountFlag) }
1404
+ amountFlag === void 0 && sealToFlag === void 0 ? void 0 : {
1405
+ ...amountFlag === void 0 ? {} : { amount: BigInt(amountFlag) },
1406
+ ...sealToFlag === void 0 ? {} : { sealTo: sealToFlag }
1407
+ }
1399
1408
  );
1400
1409
  const description = await client.describe();
1401
1410
  const asset = assetFromSettlement(description.batchSettlements[0]);