@avaprotocol/sdk-js 4.0.0-dev.0 → 4.0.0-dev.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.
Files changed (33) hide show
  1. package/dist/index.js +98 -14
  2. package/dist/index.mjs +98 -14
  3. package/dist/v4/builders/nodes.d.ts +3 -0
  4. package/dist/v4/builders/nodes.d.ts.map +1 -1
  5. package/dist/v4/builders/nodes.js +1 -0
  6. package/dist/v4/resources/executions.d.ts +6 -0
  7. package/dist/v4/resources/executions.d.ts.map +1 -1
  8. package/dist/v4/resources/executions.js +6 -0
  9. package/dist/v4/resources/health.d.ts +11 -1
  10. package/dist/v4/resources/health.d.ts.map +1 -1
  11. package/dist/v4/resources/health.js +11 -1
  12. package/dist/v4/resources/nodes.d.ts +21 -1
  13. package/dist/v4/resources/nodes.d.ts.map +1 -1
  14. package/dist/v4/resources/nodes.js +21 -1
  15. package/dist/v4/resources/operators.d.ts +15 -1
  16. package/dist/v4/resources/operators.d.ts.map +1 -1
  17. package/dist/v4/resources/operators.js +15 -1
  18. package/dist/v4/resources/secrets.d.ts +10 -0
  19. package/dist/v4/resources/secrets.d.ts.map +1 -1
  20. package/dist/v4/resources/secrets.js +10 -0
  21. package/dist/v4/resources/tokens.d.ts +16 -4
  22. package/dist/v4/resources/tokens.d.ts.map +1 -1
  23. package/dist/v4/resources/tokens.js +16 -4
  24. package/dist/v4/resources/triggers.d.ts +21 -1
  25. package/dist/v4/resources/triggers.d.ts.map +1 -1
  26. package/dist/v4/resources/triggers.js +21 -1
  27. package/dist/v4/resources/wallets.d.ts +53 -6
  28. package/dist/v4/resources/wallets.d.ts.map +1 -1
  29. package/dist/v4/resources/wallets.js +53 -6
  30. package/dist/v4/resources/workflows.d.ts +10 -0
  31. package/dist/v4/resources/workflows.d.ts.map +1 -1
  32. package/dist/v4/resources/workflows.js +10 -0
  33. package/package.json +7 -2
package/dist/index.js CHANGED
@@ -419,6 +419,11 @@ var HealthResource = class {
419
419
  constructor(transport) {
420
420
  this.transport = transport;
421
421
  }
422
+ /**
423
+ * GET /health — returns `{ status, chainId, version }` when the
424
+ * gateway is up. Use for liveness checks; do not rely on it for
425
+ * deep readiness (it doesn't probe worker connectivity).
426
+ */
422
427
  check() {
423
428
  return this.transport.request({ path: "/health" });
424
429
  }
@@ -429,7 +434,21 @@ var NodesResource = class {
429
434
  constructor(transport) {
430
435
  this.transport = transport;
431
436
  }
432
- /** POST /nodes:run — execute a single node against inline input. */
437
+ /**
438
+ * POST /nodes:run — execute one node against inline `inputVariables`.
439
+ *
440
+ * The request shape mirrors a single entry from `workflows.simulate`:
441
+ * a complete node definition + the variables the node would have seen
442
+ * inside a workflow. The gateway runs the node in-process (no worker
443
+ * delegation, no persistence) and returns the raw output keyed by
444
+ * node type — `{ success, output: { <nodeType>: {...} } }`.
445
+ *
446
+ * Chain context: the gateway resolves the target chain in this order:
447
+ * `body.chainId` → `inputVariables.settings.chain_id` → the JWT's
448
+ * `aud` claim → the gateway's default chain. Specify `chainId`
449
+ * explicitly when calling a contract that lives on a non-default
450
+ * chain (e.g. a sepolia oracle when the gateway defaults to mainnet).
451
+ */
433
452
  run(req) {
434
453
  return this.transport.request({
435
454
  path: "/nodes:run",
@@ -444,7 +463,15 @@ var OperatorsResource = class {
444
463
  constructor(transport) {
445
464
  this.transport = transport;
446
465
  }
447
- /** GET /operators — connected operators + capabilities. */
466
+ /**
467
+ * GET /operators — every operator currently connected to the
468
+ * gateway, plus their advertised capabilities (block / time /
469
+ * event monitoring) and the timestamp of their last heartbeat.
470
+ *
471
+ * An empty array means no operators are connected — workflows will
472
+ * still accept, but won't execute until at least one operator
473
+ * comes online.
474
+ */
448
475
  list() {
449
476
  return this.transport.request({ path: "/operators" });
450
477
  }
@@ -486,10 +513,16 @@ var TokensResource = class {
486
513
  this.transport = transport;
487
514
  }
488
515
  /**
489
- * GET /tokens/{address} — returns `{ found: false }` (not 404)
490
- * when the token is not in the aggregator's whitelist and the
491
- * on-chain fallback fails. Partial info (the address) is still
492
- * useful to callers.
516
+ * GET /tokens/{address} — resolve a token by contract address.
517
+ *
518
+ * Returns `{ found: false, address }` (not 404) when the token
519
+ * isn't on the whitelist and the on-chain probe also fails — the
520
+ * partial response keeps the caller's UI from breaking on
521
+ * unrecognized tokens.
522
+ *
523
+ * `opts.chainId` picks which chain's whitelist + RPC to consult.
524
+ * Omit it to fall back to the JWT's `aud` chain (the gateway's
525
+ * default chain context for the authenticated user).
493
526
  */
494
527
  retrieve(address, opts) {
495
528
  return this.transport.request({
@@ -504,7 +537,20 @@ var TriggersResource = class {
504
537
  constructor(transport) {
505
538
  this.transport = transport;
506
539
  }
507
- /** POST /triggers:run — evaluate a trigger config against inline input. */
540
+ /**
541
+ * POST /triggers:run — evaluate a trigger config against inline
542
+ * input and return the same shape an executor would see.
543
+ *
544
+ * For event triggers, the gateway uses Tenderly to simulate a
545
+ * matching event log against the request's `addresses` + `topics`
546
+ * filter, then returns the decoded log under `output.data` and
547
+ * the raw log under `output.metadata`.
548
+ *
549
+ * For time-based triggers (cron, fixedTime, block), the response
550
+ * carries the next scheduled fire time / block height.
551
+ *
552
+ * No workflow record is created and no execution is persisted.
553
+ */
508
554
  run(req) {
509
555
  return this.transport.request({
510
556
  path: "/triggers:run",
@@ -519,13 +565,29 @@ var WalletsResource = class {
519
565
  constructor(transport) {
520
566
  this.transport = transport;
521
567
  }
522
- /** GET /wallets */
568
+ /**
569
+ * GET /wallets — every smart wallet owned by the authenticated
570
+ * EOA on the JWT's audience chain.
571
+ *
572
+ * Hidden wallets (`isHidden=true`) are excluded by default. The
573
+ * response is an envelope `{ data: Wallet[] }`, not a bare array.
574
+ */
523
575
  list() {
524
576
  return this.transport.request({ path: "/wallets" });
525
577
  }
526
578
  /**
527
579
  * POST /wallets — idempotent "ensure exists". Derives the CREATE2
528
- * address from (owner, salt, factory) and persists the record.
580
+ * address from `(owner, salt, factory)` and persists the record;
581
+ * calling twice with the same triple returns the same address.
582
+ *
583
+ * The on-chain account is **not** deployed by this call — deployment
584
+ * happens lazily as part of the first UserOp (workflow execution or
585
+ * `withdraw`) via the `initCode` field, so the smart wallet costs
586
+ * zero gas until it's first used.
587
+ *
588
+ * Per-owner cap is enforced by `max_wallets_per_owner` in the
589
+ * aggregator config; the call returns 429 `WALLETS_LIMIT_REACHED`
590
+ * when exceeded.
529
591
  */
530
592
  create(req) {
531
593
  return this.transport.request({
@@ -535,8 +597,11 @@ var WalletsResource = class {
535
597
  });
536
598
  }
537
599
  /**
538
- * PATCH /wallets/{address} — partial update. Today the only
539
- * mutable field is `isHidden`.
600
+ * PATCH /wallets/{address} — partial update. The only mutable
601
+ * field today is `isHidden`, used by the Studio UI's hide/unhide
602
+ * wallet action. Keyed by **address**, not salt — callers that
603
+ * still think in salts must look up the address first via
604
+ * `create({ salt })`.
540
605
  */
541
606
  update(address, body) {
542
607
  return this.transport.request({
@@ -545,7 +610,18 @@ var WalletsResource = class {
545
610
  body
546
611
  });
547
612
  }
548
- /** POST /wallets/{address}:withdraw — UserOp-driven withdraw. */
613
+ /**
614
+ * POST /wallets/{address}:withdraw — transfer ETH or an ERC-20 out
615
+ * of the smart wallet via a UserOp through the bundler + paymaster.
616
+ *
617
+ * Per-chain config (bundler URL, paymaster address, RPC) is resolved
618
+ * by the gateway from the JWT's `aud` claim or `body.chainId`.
619
+ * The response's `status` is one of `pending | confirmed | failed`:
620
+ * `confirmed` means the bundler returned a receipt synchronously,
621
+ * `pending` means it accepted the UserOp but the receipt hasn't
622
+ * landed yet, `failed` means the bundler rejected the op or it
623
+ * reverted before inclusion.
624
+ */
549
625
  withdraw(address, req) {
550
626
  return this.transport.request({
551
627
  path: `/wallets/${encodeURIComponent(address)}:withdraw`,
@@ -553,7 +629,14 @@ var WalletsResource = class {
553
629
  body: req
554
630
  });
555
631
  }
556
- /** GET /wallets/{address}:getNonce */
632
+ /**
633
+ * GET /wallets/{address}:getNonce — current AA nonce for the wallet.
634
+ *
635
+ * Used when an external signer needs to assemble a UserOp outside
636
+ * the SDK's bundler path. Most callers don't need this directly —
637
+ * `workflows.simulate` and `wallets.withdraw` handle nonce sourcing
638
+ * internally.
639
+ */
557
640
  getNonce(address) {
558
641
  return this.transport.request({
559
642
  path: `/wallets/${encodeURIComponent(address)}:getNonce`
@@ -801,7 +884,8 @@ var Nodes = Object.freeze({
801
884
  url: opts.url,
802
885
  method: opts.method,
803
886
  ...opts.body ? { body: opts.body } : {},
804
- ...opts.headers ? { headers: opts.headers } : {}
887
+ ...opts.headers ? { headers: opts.headers } : {},
888
+ ...opts.options ? { options: opts.options } : {}
805
889
  }
806
890
  };
807
891
  },
package/dist/index.mjs CHANGED
@@ -374,6 +374,11 @@ var HealthResource = class {
374
374
  constructor(transport) {
375
375
  this.transport = transport;
376
376
  }
377
+ /**
378
+ * GET /health — returns `{ status, chainId, version }` when the
379
+ * gateway is up. Use for liveness checks; do not rely on it for
380
+ * deep readiness (it doesn't probe worker connectivity).
381
+ */
377
382
  check() {
378
383
  return this.transport.request({ path: "/health" });
379
384
  }
@@ -384,7 +389,21 @@ var NodesResource = class {
384
389
  constructor(transport) {
385
390
  this.transport = transport;
386
391
  }
387
- /** POST /nodes:run — execute a single node against inline input. */
392
+ /**
393
+ * POST /nodes:run — execute one node against inline `inputVariables`.
394
+ *
395
+ * The request shape mirrors a single entry from `workflows.simulate`:
396
+ * a complete node definition + the variables the node would have seen
397
+ * inside a workflow. The gateway runs the node in-process (no worker
398
+ * delegation, no persistence) and returns the raw output keyed by
399
+ * node type — `{ success, output: { <nodeType>: {...} } }`.
400
+ *
401
+ * Chain context: the gateway resolves the target chain in this order:
402
+ * `body.chainId` → `inputVariables.settings.chain_id` → the JWT's
403
+ * `aud` claim → the gateway's default chain. Specify `chainId`
404
+ * explicitly when calling a contract that lives on a non-default
405
+ * chain (e.g. a sepolia oracle when the gateway defaults to mainnet).
406
+ */
388
407
  run(req) {
389
408
  return this.transport.request({
390
409
  path: "/nodes:run",
@@ -399,7 +418,15 @@ var OperatorsResource = class {
399
418
  constructor(transport) {
400
419
  this.transport = transport;
401
420
  }
402
- /** GET /operators — connected operators + capabilities. */
421
+ /**
422
+ * GET /operators — every operator currently connected to the
423
+ * gateway, plus their advertised capabilities (block / time /
424
+ * event monitoring) and the timestamp of their last heartbeat.
425
+ *
426
+ * An empty array means no operators are connected — workflows will
427
+ * still accept, but won't execute until at least one operator
428
+ * comes online.
429
+ */
403
430
  list() {
404
431
  return this.transport.request({ path: "/operators" });
405
432
  }
@@ -441,10 +468,16 @@ var TokensResource = class {
441
468
  this.transport = transport;
442
469
  }
443
470
  /**
444
- * GET /tokens/{address} — returns `{ found: false }` (not 404)
445
- * when the token is not in the aggregator's whitelist and the
446
- * on-chain fallback fails. Partial info (the address) is still
447
- * useful to callers.
471
+ * GET /tokens/{address} — resolve a token by contract address.
472
+ *
473
+ * Returns `{ found: false, address }` (not 404) when the token
474
+ * isn't on the whitelist and the on-chain probe also fails — the
475
+ * partial response keeps the caller's UI from breaking on
476
+ * unrecognized tokens.
477
+ *
478
+ * `opts.chainId` picks which chain's whitelist + RPC to consult.
479
+ * Omit it to fall back to the JWT's `aud` chain (the gateway's
480
+ * default chain context for the authenticated user).
448
481
  */
449
482
  retrieve(address, opts) {
450
483
  return this.transport.request({
@@ -459,7 +492,20 @@ var TriggersResource = class {
459
492
  constructor(transport) {
460
493
  this.transport = transport;
461
494
  }
462
- /** POST /triggers:run — evaluate a trigger config against inline input. */
495
+ /**
496
+ * POST /triggers:run — evaluate a trigger config against inline
497
+ * input and return the same shape an executor would see.
498
+ *
499
+ * For event triggers, the gateway uses Tenderly to simulate a
500
+ * matching event log against the request's `addresses` + `topics`
501
+ * filter, then returns the decoded log under `output.data` and
502
+ * the raw log under `output.metadata`.
503
+ *
504
+ * For time-based triggers (cron, fixedTime, block), the response
505
+ * carries the next scheduled fire time / block height.
506
+ *
507
+ * No workflow record is created and no execution is persisted.
508
+ */
463
509
  run(req) {
464
510
  return this.transport.request({
465
511
  path: "/triggers:run",
@@ -474,13 +520,29 @@ var WalletsResource = class {
474
520
  constructor(transport) {
475
521
  this.transport = transport;
476
522
  }
477
- /** GET /wallets */
523
+ /**
524
+ * GET /wallets — every smart wallet owned by the authenticated
525
+ * EOA on the JWT's audience chain.
526
+ *
527
+ * Hidden wallets (`isHidden=true`) are excluded by default. The
528
+ * response is an envelope `{ data: Wallet[] }`, not a bare array.
529
+ */
478
530
  list() {
479
531
  return this.transport.request({ path: "/wallets" });
480
532
  }
481
533
  /**
482
534
  * POST /wallets — idempotent "ensure exists". Derives the CREATE2
483
- * address from (owner, salt, factory) and persists the record.
535
+ * address from `(owner, salt, factory)` and persists the record;
536
+ * calling twice with the same triple returns the same address.
537
+ *
538
+ * The on-chain account is **not** deployed by this call — deployment
539
+ * happens lazily as part of the first UserOp (workflow execution or
540
+ * `withdraw`) via the `initCode` field, so the smart wallet costs
541
+ * zero gas until it's first used.
542
+ *
543
+ * Per-owner cap is enforced by `max_wallets_per_owner` in the
544
+ * aggregator config; the call returns 429 `WALLETS_LIMIT_REACHED`
545
+ * when exceeded.
484
546
  */
485
547
  create(req) {
486
548
  return this.transport.request({
@@ -490,8 +552,11 @@ var WalletsResource = class {
490
552
  });
491
553
  }
492
554
  /**
493
- * PATCH /wallets/{address} — partial update. Today the only
494
- * mutable field is `isHidden`.
555
+ * PATCH /wallets/{address} — partial update. The only mutable
556
+ * field today is `isHidden`, used by the Studio UI's hide/unhide
557
+ * wallet action. Keyed by **address**, not salt — callers that
558
+ * still think in salts must look up the address first via
559
+ * `create({ salt })`.
495
560
  */
496
561
  update(address, body) {
497
562
  return this.transport.request({
@@ -500,7 +565,18 @@ var WalletsResource = class {
500
565
  body
501
566
  });
502
567
  }
503
- /** POST /wallets/{address}:withdraw — UserOp-driven withdraw. */
568
+ /**
569
+ * POST /wallets/{address}:withdraw — transfer ETH or an ERC-20 out
570
+ * of the smart wallet via a UserOp through the bundler + paymaster.
571
+ *
572
+ * Per-chain config (bundler URL, paymaster address, RPC) is resolved
573
+ * by the gateway from the JWT's `aud` claim or `body.chainId`.
574
+ * The response's `status` is one of `pending | confirmed | failed`:
575
+ * `confirmed` means the bundler returned a receipt synchronously,
576
+ * `pending` means it accepted the UserOp but the receipt hasn't
577
+ * landed yet, `failed` means the bundler rejected the op or it
578
+ * reverted before inclusion.
579
+ */
504
580
  withdraw(address, req) {
505
581
  return this.transport.request({
506
582
  path: `/wallets/${encodeURIComponent(address)}:withdraw`,
@@ -508,7 +584,14 @@ var WalletsResource = class {
508
584
  body: req
509
585
  });
510
586
  }
511
- /** GET /wallets/{address}:getNonce */
587
+ /**
588
+ * GET /wallets/{address}:getNonce — current AA nonce for the wallet.
589
+ *
590
+ * Used when an external signer needs to assemble a UserOp outside
591
+ * the SDK's bundler path. Most callers don't need this directly —
592
+ * `workflows.simulate` and `wallets.withdraw` handle nonce sourcing
593
+ * internally.
594
+ */
512
595
  getNonce(address) {
513
596
  return this.transport.request({
514
597
  path: `/wallets/${encodeURIComponent(address)}:getNonce`
@@ -756,7 +839,8 @@ var Nodes = Object.freeze({
756
839
  url: opts.url,
757
840
  method: opts.method,
758
841
  ...opts.body ? { body: opts.body } : {},
759
- ...opts.headers ? { headers: opts.headers } : {}
842
+ ...opts.headers ? { headers: opts.headers } : {},
843
+ ...opts.options ? { options: opts.options } : {}
760
844
  }
761
845
  };
762
846
  },
@@ -61,6 +61,9 @@ export declare const Nodes: Readonly<{
61
61
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
62
62
  body?: string;
63
63
  headers?: Record<string, string>;
64
+ options?: {
65
+ summarize?: boolean;
66
+ };
64
67
  }): v4.Node;
65
68
  branch(opts: {
66
69
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/v4/builders/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK;sBACE;QAChB,EAAE,EA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EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAA;SAAE,CAAC,CAAC;KACxF,GAAG,EAAE,CAAC,IAAI;iBASE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,EAAE,CAAC,IAAI;eASnF;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC;KACjB,GAAG,EAAE,CAAC,IAAI;qBAaM;QACf,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;KAChB,GAAG,EAAE,CAAC,IAAI;kBAYG;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,EAAE,CAAC,IAAI;EAcX,CAAC"}
@@ -73,6 +73,7 @@ export const Nodes = Object.freeze({
73
73
  method: opts.method,
74
74
  ...(opts.body ? { body: opts.body } : {}),
75
75
  ...(opts.headers ? { headers: opts.headers } : {}),
76
+ ...(opts.options ? { options: opts.options } : {}),
76
77
  },
77
78
  };
78
79
  },
@@ -31,6 +31,12 @@ export interface StreamExecutionParams {
31
31
  /** Optional AbortSignal to close the stream early. */
32
32
  signal?: AbortSignal;
33
33
  }
34
+ /**
35
+ * `client.executions.*` — read-only access to past workflow runs and
36
+ * a live SSE stream for in-flight ones. Workflow executions are
37
+ * created by the operator when a trigger fires (or by `workflows.trigger`
38
+ * for manual runs); this resource never creates them, only reads.
39
+ */
34
40
  export declare class ExecutionsResource {
35
41
  private readonly transport;
36
42
  constructor(transport: Transport);
@@ -1 +1 @@
1
- {"version":3,"file":"executions.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/executions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,sBAA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SAAS,CAAC;IAO5E,oDAAoD;IACpD,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,EAAE,CAAC,sBAAsB,CAAC;IAO1F,4BAA4B;IAC5B,KAAK,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,EAAE,CAAC,cAAc,CAAC;IAOjE,4BAA4B;IAC5B,KAAK,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,EAAE,CAAC,cAAc,CAAC;IAOhE;;;;;;OAMG;IACI,MAAM,CACX,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,qBAAqB,GAC5B,cAAc,CAAC,EAAE,CAAC,sBAAsB,EAAE,IAAI,EAAE,SAAS,CAAC;IAwC7D;;;;OAIG;IACG,eAAe,CACnB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,EAAE,CAAC,sBAAsB,CAAC;CAatC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * `client.executions.*` — read-only access to past workflow runs and
3
+ * a live SSE stream for in-flight ones. Workflow executions are
4
+ * created by the operator when a trigger fires (or by `workflows.trigger`
5
+ * for manual runs); this resource never creates them, only reads.
6
+ */
1
7
  export class ExecutionsResource {
2
8
  constructor(transport) {
3
9
  this.transport = transport;
@@ -1,9 +1,19 @@
1
1
  import type { v4 } from "@avaprotocol/types";
2
2
  import { Transport } from "../internal/transport";
3
- /** `client.health.check()` — liveness probe; no auth required. */
3
+ /**
4
+ * `client.health.*` — gateway liveness + version probes.
5
+ *
6
+ * Anonymous (no Bearer token required) — safe to call from
7
+ * unauthenticated browser code or external monitors.
8
+ */
4
9
  export declare class HealthResource {
5
10
  private readonly transport;
6
11
  constructor(transport: Transport);
12
+ /**
13
+ * GET /health — returns `{ status, chainId, version }` when the
14
+ * gateway is up. Use for liveness checks; do not rely on it for
15
+ * deep readiness (it doesn't probe worker connectivity).
16
+ */
7
17
  check(): Promise<v4.HealthStatus>;
8
18
  }
9
19
  //# sourceMappingURL=health.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,kEAAkE;AAClE,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,KAAK,IAAI,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC;CAGlC"}
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;GAKG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC;CAGlC"}
@@ -1,8 +1,18 @@
1
- /** `client.health.check()` — liveness probe; no auth required. */
1
+ /**
2
+ * `client.health.*` — gateway liveness + version probes.
3
+ *
4
+ * Anonymous (no Bearer token required) — safe to call from
5
+ * unauthenticated browser code or external monitors.
6
+ */
2
7
  export class HealthResource {
3
8
  constructor(transport) {
4
9
  this.transport = transport;
5
10
  }
11
+ /**
12
+ * GET /health — returns `{ status, chainId, version }` when the
13
+ * gateway is up. Use for liveness checks; do not rely on it for
14
+ * deep readiness (it doesn't probe worker connectivity).
15
+ */
6
16
  check() {
7
17
  return this.transport.request({ path: "/health" });
8
18
  }
@@ -1,9 +1,29 @@
1
1
  import type { v4 } from "@avaprotocol/types";
2
2
  import { Transport } from "../internal/transport";
3
+ /**
4
+ * `client.nodes.*` — execute a single node definition in isolation,
5
+ * without persisting a workflow. Used by the Studio UI's per-node
6
+ * "Run once" affordance and by SDK test suites that exercise a node
7
+ * shape against a live gateway.
8
+ */
3
9
  export declare class NodesResource {
4
10
  private readonly transport;
5
11
  constructor(transport: Transport);
6
- /** POST /nodes:run — execute a single node against inline input. */
12
+ /**
13
+ * POST /nodes:run — execute one node against inline `inputVariables`.
14
+ *
15
+ * The request shape mirrors a single entry from `workflows.simulate`:
16
+ * a complete node definition + the variables the node would have seen
17
+ * inside a workflow. The gateway runs the node in-process (no worker
18
+ * delegation, no persistence) and returns the raw output keyed by
19
+ * node type — `{ success, output: { <nodeType>: {...} } }`.
20
+ *
21
+ * Chain context: the gateway resolves the target chain in this order:
22
+ * `body.chainId` → `inputVariables.settings.chain_id` → the JWT's
23
+ * `aud` claim → the gateway's default chain. Specify `chainId`
24
+ * explicitly when calling a contract that lives on a non-default
25
+ * chain (e.g. a sepolia oracle when the gateway defaults to mainnet).
26
+ */
7
27
  run(req: v4.RunNodeRequest): Promise<v4.RunNodeResponse>;
8
28
  }
9
29
  //# sourceMappingURL=nodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,oEAAoE;IACpE,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,GAAG,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC;CAOzD"}
1
+ {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;GAKG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,GAAG,OAAO,CAAC,EAAE,CAAC,eAAe,CAAC;CAOzD"}
@@ -1,8 +1,28 @@
1
+ /**
2
+ * `client.nodes.*` — execute a single node definition in isolation,
3
+ * without persisting a workflow. Used by the Studio UI's per-node
4
+ * "Run once" affordance and by SDK test suites that exercise a node
5
+ * shape against a live gateway.
6
+ */
1
7
  export class NodesResource {
2
8
  constructor(transport) {
3
9
  this.transport = transport;
4
10
  }
5
- /** POST /nodes:run — execute a single node against inline input. */
11
+ /**
12
+ * POST /nodes:run — execute one node against inline `inputVariables`.
13
+ *
14
+ * The request shape mirrors a single entry from `workflows.simulate`:
15
+ * a complete node definition + the variables the node would have seen
16
+ * inside a workflow. The gateway runs the node in-process (no worker
17
+ * delegation, no persistence) and returns the raw output keyed by
18
+ * node type — `{ success, output: { <nodeType>: {...} } }`.
19
+ *
20
+ * Chain context: the gateway resolves the target chain in this order:
21
+ * `body.chainId` → `inputVariables.settings.chain_id` → the JWT's
22
+ * `aud` claim → the gateway's default chain. Specify `chainId`
23
+ * explicitly when calling a contract that lives on a non-default
24
+ * chain (e.g. a sepolia oracle when the gateway defaults to mainnet).
25
+ */
6
26
  run(req) {
7
27
  return this.transport.request({
8
28
  path: "/nodes:run",
@@ -1,9 +1,23 @@
1
1
  import type { v4 } from "@avaprotocol/types";
2
2
  import { Transport } from "../internal/transport";
3
+ /**
4
+ * `client.operators.*` — read-only view of the operator pool the
5
+ * gateway is currently dispatching to. Used by dashboards and the
6
+ * Studio sidebar's network-health widget; not part of the workflow
7
+ * lifecycle.
8
+ */
3
9
  export declare class OperatorsResource {
4
10
  private readonly transport;
5
11
  constructor(transport: Transport);
6
- /** GET /operators — connected operators + capabilities. */
12
+ /**
13
+ * GET /operators — every operator currently connected to the
14
+ * gateway, plus their advertised capabilities (block / time /
15
+ * event monitoring) and the timestamp of their last heartbeat.
16
+ *
17
+ * An empty array means no operators are connected — workflows will
18
+ * still accept, but won't execute until at least one operator
19
+ * comes online.
20
+ */
7
21
  list(): Promise<v4.OperatorList>;
8
22
  }
9
23
  //# sourceMappingURL=operators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/operators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,2DAA2D;IAC3D,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC;CAGjC"}
1
+ {"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/operators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;GAKG;AACH,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD;;;;;;;;OAQG;IACH,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC;CAGjC"}
@@ -1,8 +1,22 @@
1
+ /**
2
+ * `client.operators.*` — read-only view of the operator pool the
3
+ * gateway is currently dispatching to. Used by dashboards and the
4
+ * Studio sidebar's network-health widget; not part of the workflow
5
+ * lifecycle.
6
+ */
1
7
  export class OperatorsResource {
2
8
  constructor(transport) {
3
9
  this.transport = transport;
4
10
  }
5
- /** GET /operators — connected operators + capabilities. */
11
+ /**
12
+ * GET /operators — every operator currently connected to the
13
+ * gateway, plus their advertised capabilities (block / time /
14
+ * event monitoring) and the timestamp of their last heartbeat.
15
+ *
16
+ * An empty array means no operators are connected — workflows will
17
+ * still accept, but won't execute until at least one operator
18
+ * comes online.
19
+ */
6
20
  list() {
7
21
  return this.transport.request({ path: "/operators" });
8
22
  }
@@ -11,6 +11,16 @@ export interface DeleteSecretParams {
11
11
  workflowId?: string;
12
12
  orgId?: string;
13
13
  }
14
+ /**
15
+ * `client.secrets.*` — write-only secret store, scoped to the
16
+ * authenticated user. Values are referenced from workflow nodes via
17
+ * `{{secrets.NAME}}` template variables and are decrypted server-side
18
+ * at execution time; the SDK never receives the plaintext value back.
19
+ *
20
+ * `put` is a single idempotent endpoint replacing v3's create + update
21
+ * split — sending the same name twice rotates the value silently
22
+ * rather than erroring.
23
+ */
14
24
  export declare class SecretsResource {
15
25
  private readonly transport;
16
26
  constructor(transport: Transport);
@@ -1 +1 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,2DAA2D;I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EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAOjE"}
@@ -1,3 +1,13 @@
1
+ /**
2
+ * `client.secrets.*` — write-only secret store, scoped to the
3
+ * authenticated user. Values are referenced from workflow nodes via
4
+ * `{{secrets.NAME}}` template variables and are decrypted server-side
5
+ * at execution time; the SDK never receives the plaintext value back.
6
+ *
7
+ * `put` is a single idempotent endpoint replacing v3's create + update
8
+ * split — sending the same name twice rotates the value silently
9
+ * rather than erroring.
10
+ */
1
11
  export class SecretsResource {
2
12
  constructor(transport) {
3
13
  this.transport = transport;
@@ -1,13 +1,25 @@
1
1
  import type { v4 } from "@avaprotocol/types";
2
2
  import { Transport } from "../internal/transport";
3
+ /**
4
+ * `client.tokens.*` — ERC-20 metadata resolution backed by the
5
+ * aggregator's curated whitelist plus an on-chain `name/symbol/decimals`
6
+ * fallback. Used by the Studio token-picker, transfer-preview UI, and
7
+ * the notification cost-line renderer.
8
+ */
3
9
  export declare class TokensResource {
4
10
  private readonly transport;
5
11
  constructor(transport: Transport);
6
12
  /**
7
- * GET /tokens/{address} — returns `{ found: false }` (not 404)
8
- * when the token is not in the aggregator's whitelist and the
9
- * on-chain fallback fails. Partial info (the address) is still
10
- * useful to callers.
13
+ * GET /tokens/{address} — resolve a token by contract address.
14
+ *
15
+ * Returns `{ found: false, address }` (not 404) when the token
16
+ * isn't on the whitelist and the on-chain probe also fails — the
17
+ * partial response keeps the caller's UI from breaking on
18
+ * unrecognized tokens.
19
+ *
20
+ * `opts.chainId` picks which chain's whitelist + RPC to consult.
21
+ * Omit it to fall back to the JWT's `aud` chain (the gateway's
22
+ * default chain context for the authenticated user).
11
23
  */
12
24
  retrieve(address: string, opts?: {
13
25
  chainId?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,EAAE,CAAC,qBAAqB,CAAC;CAM1F"}
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;GAKG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,EAAE,CAAC,qBAAqB,CAAC;CAM1F"}
@@ -1,12 +1,24 @@
1
+ /**
2
+ * `client.tokens.*` — ERC-20 metadata resolution backed by the
3
+ * aggregator's curated whitelist plus an on-chain `name/symbol/decimals`
4
+ * fallback. Used by the Studio token-picker, transfer-preview UI, and
5
+ * the notification cost-line renderer.
6
+ */
1
7
  export class TokensResource {
2
8
  constructor(transport) {
3
9
  this.transport = transport;
4
10
  }
5
11
  /**
6
- * GET /tokens/{address} — returns `{ found: false }` (not 404)
7
- * when the token is not in the aggregator's whitelist and the
8
- * on-chain fallback fails. Partial info (the address) is still
9
- * useful to callers.
12
+ * GET /tokens/{address} — resolve a token by contract address.
13
+ *
14
+ * Returns `{ found: false, address }` (not 404) when the token
15
+ * isn't on the whitelist and the on-chain probe also fails — the
16
+ * partial response keeps the caller's UI from breaking on
17
+ * unrecognized tokens.
18
+ *
19
+ * `opts.chainId` picks which chain's whitelist + RPC to consult.
20
+ * Omit it to fall back to the JWT's `aud` chain (the gateway's
21
+ * default chain context for the authenticated user).
10
22
  */
11
23
  retrieve(address, opts) {
12
24
  return this.transport.request({
@@ -1,9 +1,29 @@
1
1
  import type { v4 } from "@avaprotocol/types";
2
2
  import { Transport } from "../internal/transport";
3
+ /**
4
+ * `client.triggers.*` — evaluate a trigger config in isolation,
5
+ * mirroring the per-node `nodes.run` shape. Use when designing or
6
+ * debugging a trigger before wiring it into a full workflow — e.g.
7
+ * confirming that an `eventTrigger` topic filter matches a known
8
+ * historical event, or that a cron expression parses.
9
+ */
3
10
  export declare class TriggersResource {
4
11
  private readonly transport;
5
12
  constructor(transport: Transport);
6
- /** POST /triggers:run — evaluate a trigger config against inline input. */
13
+ /**
14
+ * POST /triggers:run — evaluate a trigger config against inline
15
+ * input and return the same shape an executor would see.
16
+ *
17
+ * For event triggers, the gateway uses Tenderly to simulate a
18
+ * matching event log against the request's `addresses` + `topics`
19
+ * filter, then returns the decoded log under `output.data` and
20
+ * the raw log under `output.metadata`.
21
+ *
22
+ * For time-based triggers (cron, fixedTime, block), the response
23
+ * carries the next scheduled fire time / block height.
24
+ *
25
+ * No workflow record is created and no execution is persisted.
26
+ */
7
27
  run(req: v4.RunTriggerRequest): Promise<v4.RunTriggerResponse>;
8
28
  }
9
29
  //# sourceMappingURL=triggers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/triggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,2EAA2E;IAC3E,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,iBAAiB,GAAG,OAAO,CAAC,EAAE,CAAC,kBAAkB,CAAC;CAO/D"}
1
+ {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/triggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;GAMG;AACH,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,iBAAiB,GAAG,OAAO,CAAC,EAAE,CAAC,kBAAkB,CAAC;CAO/D"}
@@ -1,8 +1,28 @@
1
+ /**
2
+ * `client.triggers.*` — evaluate a trigger config in isolation,
3
+ * mirroring the per-node `nodes.run` shape. Use when designing or
4
+ * debugging a trigger before wiring it into a full workflow — e.g.
5
+ * confirming that an `eventTrigger` topic filter matches a known
6
+ * historical event, or that a cron expression parses.
7
+ */
1
8
  export class TriggersResource {
2
9
  constructor(transport) {
3
10
  this.transport = transport;
4
11
  }
5
- /** POST /triggers:run — evaluate a trigger config against inline input. */
12
+ /**
13
+ * POST /triggers:run — evaluate a trigger config against inline
14
+ * input and return the same shape an executor would see.
15
+ *
16
+ * For event triggers, the gateway uses Tenderly to simulate a
17
+ * matching event log against the request's `addresses` + `topics`
18
+ * filter, then returns the decoded log under `output.data` and
19
+ * the raw log under `output.metadata`.
20
+ *
21
+ * For time-based triggers (cron, fixedTime, block), the response
22
+ * carries the next scheduled fire time / block height.
23
+ *
24
+ * No workflow record is created and no execution is persisted.
25
+ */
6
26
  run(req) {
7
27
  return this.transport.request({
8
28
  path: "/triggers:run",
@@ -1,25 +1,72 @@
1
1
  import type { v4 } from "@avaprotocol/types";
2
2
  import { Transport } from "../internal/transport";
3
+ /**
4
+ * `client.wallets.*` — smart-wallet CRUD plus the UserOp-driven
5
+ * withdraw action. A "wallet" here is an ERC-6900 / ERC-4337 smart
6
+ * account derived deterministically from `(owner, factory, salt)` —
7
+ * the SDK never creates an EOA, it ensures-and-registers smart
8
+ * accounts owned by the authenticated user's EOA.
9
+ *
10
+ * All endpoints require auth and operate on wallets owned by the
11
+ * JWT's subject EOA.
12
+ */
3
13
  export declare class WalletsResource {
4
14
  private readonly transport;
5
15
  constructor(transport: Transport);
6
- /** GET /wallets */
16
+ /**
17
+ * GET /wallets — every smart wallet owned by the authenticated
18
+ * EOA on the JWT's audience chain.
19
+ *
20
+ * Hidden wallets (`isHidden=true`) are excluded by default. The
21
+ * response is an envelope `{ data: Wallet[] }`, not a bare array.
22
+ */
7
23
  list(): Promise<v4.WalletList>;
8
24
  /**
9
25
  * POST /wallets — idempotent "ensure exists". Derives the CREATE2
10
- * address from (owner, salt, factory) and persists the record.
26
+ * address from `(owner, salt, factory)` and persists the record;
27
+ * calling twice with the same triple returns the same address.
28
+ *
29
+ * The on-chain account is **not** deployed by this call — deployment
30
+ * happens lazily as part of the first UserOp (workflow execution or
31
+ * `withdraw`) via the `initCode` field, so the smart wallet costs
32
+ * zero gas until it's first used.
33
+ *
34
+ * Per-owner cap is enforced by `max_wallets_per_owner` in the
35
+ * aggregator config; the call returns 429 `WALLETS_LIMIT_REACHED`
36
+ * when exceeded.
11
37
  */
12
38
  create(req: v4.CreateWalletRequest): Promise<v4.Wallet>;
13
39
  /**
14
- * PATCH /wallets/{address} — partial update. Today the only
15
- * mutable field is `isHidden`.
40
+ * PATCH /wallets/{address} — partial update. The only mutable
41
+ * field today is `isHidden`, used by the Studio UI's hide/unhide
42
+ * wallet action. Keyed by **address**, not salt — callers that
43
+ * still think in salts must look up the address first via
44
+ * `create({ salt })`.
16
45
  */
17
46
  update(address: string, body: {
18
47
  isHidden?: boolean;
19
48
  }): Promise<v4.Wallet>;
20
- /** POST /wallets/{address}:withdraw — UserOp-driven withdraw. */
49
+ /**
50
+ * POST /wallets/{address}:withdraw — transfer ETH or an ERC-20 out
51
+ * of the smart wallet via a UserOp through the bundler + paymaster.
52
+ *
53
+ * Per-chain config (bundler URL, paymaster address, RPC) is resolved
54
+ * by the gateway from the JWT's `aud` claim or `body.chainId`.
55
+ * The response's `status` is one of `pending | confirmed | failed`:
56
+ * `confirmed` means the bundler returned a receipt synchronously,
57
+ * `pending` means it accepted the UserOp but the receipt hasn't
58
+ * landed yet, `failed` means the bundler rejected the op or it
59
+ * reverted before inclusion.
60
+ */
21
61
  withdraw(address: string, req: v4.WithdrawRequest): Promise<v4.WithdrawResponse>;
22
- /** GET /wallets/{address}:getNonce */
62
+ /**
63
+ * GET /wallets/{address}:getNonce — current AA nonce for the wallet.
64
+ *
65
+ * Used when an external signer needs to assemble a UserOp outside
66
+ * the SDK's bundler path. Most callers don't need this directly —
67
+ * `workflows.simulate` and `wallets.withdraw` handle nonce sourcing
68
+ * internally.
69
+ */
23
70
  getNonce(address: string): Promise<v4.NonceResponse>;
24
71
  }
25
72
  //# sourceMappingURL=wallets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../../src/v4/resources/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,mBAAmB;IACnB,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC;IAI9B;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,GAAG,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC;IAQvD;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KA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UserOp-driven
3
+ * withdraw action. A "wallet" here is an ERC-6900 / ERC-4337 smart
4
+ * account derived deterministically from `(owner, factory, salt)` —
5
+ * the SDK never creates an EOA, it ensures-and-registers smart
6
+ * accounts owned by the authenticated user's EOA.
7
+ *
8
+ * All endpoints require auth and operate on wallets owned by the
9
+ * JWT's subject EOA.
10
+ */
1
11
  export class WalletsResource {
2
12
  constructor(transport) {
3
13
  this.transport = transport;
4
14
  }
5
- /** GET /wallets */
15
+ /**
16
+ * GET /wallets — every smart wallet owned by the authenticated
17
+ * EOA on the JWT's audience chain.
18
+ *
19
+ * Hidden wallets (`isHidden=true`) are excluded by default. The
20
+ * response is an envelope `{ data: Wallet[] }`, not a bare array.
21
+ */
6
22
  list() {
7
23
  return this.transport.request({ path: "/wallets" });
8
24
  }
9
25
  /**
10
26
  * POST /wallets — idempotent "ensure exists". Derives the CREATE2
11
- * address from (owner, salt, factory) and persists the record.
27
+ * address from `(owner, salt, factory)` and persists the record;
28
+ * calling twice with the same triple returns the same address.
29
+ *
30
+ * The on-chain account is **not** deployed by this call — deployment
31
+ * happens lazily as part of the first UserOp (workflow execution or
32
+ * `withdraw`) via the `initCode` field, so the smart wallet costs
33
+ * zero gas until it's first used.
34
+ *
35
+ * Per-owner cap is enforced by `max_wallets_per_owner` in the
36
+ * aggregator config; the call returns 429 `WALLETS_LIMIT_REACHED`
37
+ * when exceeded.
12
38
  */
13
39
  create(req) {
14
40
  return this.transport.request({
@@ -18,8 +44,11 @@ export class WalletsResource {
18
44
  });
19
45
  }
20
46
  /**
21
- * PATCH /wallets/{address} — partial update. Today the only
22
- * mutable field is `isHidden`.
47
+ * PATCH /wallets/{address} — partial update. The only mutable
48
+ * field today is `isHidden`, used by the Studio UI's hide/unhide
49
+ * wallet action. Keyed by **address**, not salt — callers that
50
+ * still think in salts must look up the address first via
51
+ * `create({ salt })`.
23
52
  */
24
53
  update(address, body) {
25
54
  return this.transport.request({
@@ -28,7 +57,18 @@ export class WalletsResource {
28
57
  body,
29
58
  });
30
59
  }
31
- /** POST /wallets/{address}:withdraw — UserOp-driven withdraw. */
60
+ /**
61
+ * POST /wallets/{address}:withdraw — transfer ETH or an ERC-20 out
62
+ * of the smart wallet via a UserOp through the bundler + paymaster.
63
+ *
64
+ * Per-chain config (bundler URL, paymaster address, RPC) is resolved
65
+ * by the gateway from the JWT's `aud` claim or `body.chainId`.
66
+ * The response's `status` is one of `pending | confirmed | failed`:
67
+ * `confirmed` means the bundler returned a receipt synchronously,
68
+ * `pending` means it accepted the UserOp but the receipt hasn't
69
+ * landed yet, `failed` means the bundler rejected the op or it
70
+ * reverted before inclusion.
71
+ */
32
72
  withdraw(address, req) {
33
73
  return this.transport.request({
34
74
  path: `/wallets/${encodeURIComponent(address)}:withdraw`,
@@ -36,7 +76,14 @@ export class WalletsResource {
36
76
  body: req,
37
77
  });
38
78
  }
39
- /** GET /wallets/{address}:getNonce */
79
+ /**
80
+ * GET /wallets/{address}:getNonce — current AA nonce for the wallet.
81
+ *
82
+ * Used when an external signer needs to assemble a UserOp outside
83
+ * the SDK's bundler path. Most callers don't need this directly —
84
+ * `workflows.simulate` and `wallets.withdraw` handle nonce sourcing
85
+ * internally.
86
+ */
40
87
  getNonce(address) {
41
88
  return this.transport.request({
42
89
  path: `/wallets/${encodeURIComponent(address)}:getNonce`,
@@ -24,6 +24,16 @@ export interface CountWorkflowsParams {
24
24
  status?: v4.WorkflowStatus[];
25
25
  chainId?: number;
26
26
  }
27
+ /**
28
+ * `client.workflows.*` — the primary surface for creating and
29
+ * controlling automations. A "workflow" is one trigger + a DAG of
30
+ * nodes that fires when the trigger condition matches. This resource
31
+ * covers the full lifecycle: create, list, retrieve, pause / resume,
32
+ * cancel, manual trigger, dry-run simulation, and fee estimation.
33
+ *
34
+ * Executions produced by these workflows are read via
35
+ * [`ExecutionsResource`](ExecutionsResource.mdx).
36
+ */
27
37
  export declare class WorkflowsResource {
28
38
  private readonly transport;
29
39
  constructor(transport: Transport);
@@ -1 +1 @@
1
- {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for creating and
3
+ * controlling automations. A "workflow" is one trigger + a DAG of
4
+ * nodes that fires when the trigger condition matches. This resource
5
+ * covers the full lifecycle: create, list, retrieve, pause / resume,
6
+ * cancel, manual trigger, dry-run simulation, and fee estimation.
7
+ *
8
+ * Executions produced by these workflows are read via
9
+ * [`ExecutionsResource`](ExecutionsResource.mdx).
10
+ */
1
11
  export class WorkflowsResource {
2
12
  constructor(transport) {
3
13
  this.transport = transport;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "4.0.0-dev.0",
3
+ "version": "4.0.0-dev.1",
4
4
  "description": "TypeScript SDK for Ava Protocol's AVS REST API (v4). Resource-grouped sub-clients, fetch transport, EIP-191 auth.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,12 +27,17 @@
27
27
  "build:declarations": "tsc -b tsconfig.json",
28
28
  "build:js": "tsup src/index.ts --format cjs,esm",
29
29
  "build": "yarn build:declarations && yarn build:js",
30
- "clean": "rm -rf node_modules dist tsconfig.tsbuildinfo",
30
+ "clean": "rm -rf node_modules dist tsconfig.tsbuildinfo docs-api",
31
+ "docs": "typedoc && node scripts/flatten-docs.js",
31
32
  "prepare": "node ../../scripts/prepare-package.js"
32
33
  },
33
34
  "dependencies": {
34
35
  "@avaprotocol/types": "4.0.0-dev.0",
35
36
  "dotenv": "^16.4.5",
36
37
  "ethers": "^6.13.2"
38
+ },
39
+ "devDependencies": {
40
+ "typedoc": "^0.28.19",
41
+ "typedoc-plugin-markdown": "^4.11.0"
37
42
  }
38
43
  }