@agirails/sdk 2.0.2 → 2.0.4

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 (94) hide show
  1. package/README.md +22 -22
  2. package/dist/ACTPClient.d.ts +24 -24
  3. package/dist/ACTPClient.d.ts.map +1 -1
  4. package/dist/ACTPClient.js +18 -18
  5. package/dist/ACTPClient.js.map +1 -1
  6. package/dist/adapters/BaseAdapter.js +2 -2
  7. package/dist/adapters/BaseAdapter.js.map +1 -1
  8. package/dist/adapters/BasicAdapter.d.ts +152 -0
  9. package/dist/adapters/BasicAdapter.d.ts.map +1 -0
  10. package/dist/adapters/BasicAdapter.js +168 -0
  11. package/dist/adapters/BasicAdapter.js.map +1 -0
  12. package/dist/adapters/StandardAdapter.d.ts +211 -0
  13. package/dist/adapters/StandardAdapter.d.ts.map +1 -0
  14. package/dist/adapters/StandardAdapter.js +260 -0
  15. package/dist/adapters/StandardAdapter.js.map +1 -0
  16. package/dist/adapters/index.d.ts +4 -4
  17. package/dist/adapters/index.d.ts.map +1 -1
  18. package/dist/adapters/index.js +7 -7
  19. package/dist/adapters/index.js.map +1 -1
  20. package/dist/builders/QuoteBuilder.js +1 -1
  21. package/dist/builders/QuoteBuilder.js.map +1 -1
  22. package/dist/cli/commands/config.js +1 -1
  23. package/dist/cli/commands/config.js.map +1 -1
  24. package/dist/cli/commands/pay.d.ts +1 -1
  25. package/dist/cli/commands/pay.js +2 -2
  26. package/dist/cli/commands/pay.js.map +1 -1
  27. package/dist/cli/commands/simulate.js.map +1 -1
  28. package/dist/cli/commands/time.d.ts.map +1 -1
  29. package/dist/cli/commands/time.js.map +1 -1
  30. package/dist/cli/commands/tx.d.ts +1 -1
  31. package/dist/cli/commands/tx.js +13 -13
  32. package/dist/cli/commands/tx.js.map +1 -1
  33. package/dist/cli/commands/watch.js +2 -2
  34. package/dist/cli/commands/watch.js.map +1 -1
  35. package/dist/index.d.ts +3 -3
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +6 -6
  38. package/dist/index.js.map +1 -1
  39. package/dist/level0/request.d.ts.map +1 -1
  40. package/dist/level0/request.js +1 -2
  41. package/dist/level0/request.js.map +1 -1
  42. package/dist/level1/Agent.d.ts.map +1 -1
  43. package/dist/level1/Agent.js.map +1 -1
  44. package/dist/level1/pricing/PriceCalculator.js +1 -1
  45. package/dist/level1/pricing/PriceCalculator.js.map +1 -1
  46. package/dist/level1/types/Options.d.ts.map +1 -1
  47. package/dist/protocol/ACTPKernel.d.ts +5 -5
  48. package/dist/protocol/ACTPKernel.js +5 -5
  49. package/dist/protocol/MessageSigner.js +1 -1
  50. package/dist/protocol/MessageSigner.js.map +1 -1
  51. package/dist/protocol/ProofGenerator.d.ts.map +1 -1
  52. package/dist/protocol/ProofGenerator.js +1 -0
  53. package/dist/protocol/ProofGenerator.js.map +1 -1
  54. package/dist/runtime/BlockchainRuntime.d.ts +4 -4
  55. package/dist/runtime/BlockchainRuntime.d.ts.map +1 -1
  56. package/dist/runtime/BlockchainRuntime.js +4 -4
  57. package/dist/runtime/BlockchainRuntime.js.map +1 -1
  58. package/dist/runtime/IACTPRuntime.d.ts +1 -1
  59. package/dist/runtime/MockRuntime.d.ts.map +1 -1
  60. package/dist/runtime/MockRuntime.js.map +1 -1
  61. package/dist/utils/ErrorRecoveryGuide.d.ts +2 -2
  62. package/dist/utils/ErrorRecoveryGuide.d.ts.map +1 -1
  63. package/dist/utils/ErrorRecoveryGuide.js +3 -4
  64. package/dist/utils/ErrorRecoveryGuide.js.map +1 -1
  65. package/dist/utils/UsedAttestationTracker.d.ts +1 -1
  66. package/dist/utils/UsedAttestationTracker.d.ts.map +1 -1
  67. package/dist/utils/UsedAttestationTracker.js +1 -1
  68. package/dist/utils/UsedAttestationTracker.js.map +1 -1
  69. package/package.json +1 -1
  70. package/src/ACTPClient.ts +26 -26
  71. package/src/adapters/BaseAdapter.ts +2 -2
  72. package/src/adapters/{BeginnerAdapter.ts → BasicAdapter.ts} +12 -13
  73. package/src/adapters/{IntermediateAdapter.ts → StandardAdapter.ts} +16 -16
  74. package/src/adapters/index.ts +4 -4
  75. package/src/builders/QuoteBuilder.ts +1 -1
  76. package/src/cli/commands/config.ts +1 -1
  77. package/src/cli/commands/pay.ts +2 -2
  78. package/src/cli/commands/simulate.ts +1 -1
  79. package/src/cli/commands/time.ts +1 -2
  80. package/src/cli/commands/tx.ts +13 -13
  81. package/src/cli/commands/watch.ts +2 -2
  82. package/src/index.ts +8 -8
  83. package/src/level0/request.ts +1 -2
  84. package/src/level1/Agent.ts +2 -2
  85. package/src/level1/pricing/PriceCalculator.ts +1 -1
  86. package/src/level1/types/Options.ts +1 -1
  87. package/src/protocol/ACTPKernel.ts +5 -5
  88. package/src/protocol/MessageSigner.ts +1 -1
  89. package/src/protocol/ProofGenerator.ts +1 -0
  90. package/src/runtime/BlockchainRuntime.ts +4 -4
  91. package/src/runtime/IACTPRuntime.ts +1 -1
  92. package/src/runtime/MockRuntime.ts +0 -2
  93. package/src/utils/ErrorRecoveryGuide.ts +3 -4
  94. package/src/utils/UsedAttestationTracker.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * BeginnerAdapter - High-level, opinionated API for simple use cases
2
+ * BasicAdapter - High-level, opinionated API for simple use cases
3
3
  *
4
4
  * Provides the simplest possible interface for creating and checking transactions.
5
5
  * Designed for developers who want to "just make it work" without deep protocol knowledge.
@@ -10,20 +10,19 @@
10
10
  * - User-friendly input (strings, no BigInt)
11
11
  * - User-friendly output (formatted amounts, ISO dates)
12
12
  *
13
- * @module adapters/BeginnerAdapter
13
+ * @module adapters/BasicAdapter
14
14
  */
15
15
 
16
- import { BaseAdapter, ValidationError, DEFAULT_DISPUTE_WINDOW_SECONDS } from './BaseAdapter';
16
+ import { BaseAdapter, ValidationError } from './BaseAdapter';
17
17
  import { IACTPRuntime } from '../runtime/IACTPRuntime';
18
- import { TransactionState } from '../runtime/types/MockState';
19
18
  import { EASHelper } from '../protocol/EASHelper';
20
19
 
21
20
  /**
22
21
  * Parameters for creating a simple payment.
23
22
  *
24
- * This is the most beginner-friendly interface - minimal required fields.
23
+ * This is the most user-friendly interface - minimal required fields.
25
24
  */
26
- export interface BeginnerPayParams {
25
+ export interface BasicPayParams {
27
26
  /** Recipient address (provider) */
28
27
  to: string;
29
28
 
@@ -42,7 +41,7 @@ export interface BeginnerPayParams {
42
41
  *
43
42
  * Provides user-friendly formatted data (not raw protocol types).
44
43
  */
45
- export interface BeginnerPayResult {
44
+ export interface BasicPayResult {
46
45
  /** Transaction ID (bytes32 hex string) */
47
46
  txId: string;
48
47
 
@@ -63,7 +62,7 @@ export interface BeginnerPayResult {
63
62
  }
64
63
 
65
64
  /**
66
- * BeginnerAdapter - High-level API for simple payment flows.
65
+ * BasicAdapter - High-level API for simple payment flows.
67
66
  *
68
67
  * This adapter provides the simplest possible interface:
69
68
  * - `pay()` - Create and fund a transaction in one call
@@ -76,7 +75,7 @@ export interface BeginnerPayResult {
76
75
  * const client = await ACTPClient.create({ mode: 'mock' });
77
76
  *
78
77
  * // Simple payment (all defaults)
79
- * const result = await client.beginner.pay({
78
+ * const result = await client.basic.pay({
80
79
  * to: '0xProvider123',
81
80
  * amount: '100',
82
81
  * });
@@ -84,15 +83,15 @@ export interface BeginnerPayResult {
84
83
  * console.log('Amount:', result.amount); // "100.00 USDC"
85
84
  *
86
85
  * // Check status
87
- * const status = await client.beginner.checkStatus(result.txId);
86
+ * const status = await client.basic.checkStatus(result.txId);
88
87
  * if (status.canAccept) {
89
88
  * console.log('Provider can accept this transaction');
90
89
  * }
91
90
  * ```
92
91
  */
93
- export class BeginnerAdapter extends BaseAdapter {
92
+ export class BasicAdapter extends BaseAdapter {
94
93
  /**
95
- * Creates a new BeginnerAdapter instance.
94
+ * Creates a new BasicAdapter instance.
96
95
  *
97
96
  * @param runtime - ACTP runtime implementation (MockRuntime or BlockchainRuntime)
98
97
  * @param requesterAddress - The requester's Ethereum address
@@ -136,7 +135,7 @@ export class BeginnerAdapter extends BaseAdapter {
136
135
  * });
137
136
  * ```
138
137
  */
139
- async pay(params: BeginnerPayParams): Promise<BeginnerPayResult> {
138
+ async pay(params: BasicPayParams): Promise<BasicPayResult> {
140
139
  // Validate and parse inputs
141
140
  const provider = this.validateAddress(params.to, 'to');
142
141
  const amount = this.parseAmount(params.amount);
@@ -1,7 +1,7 @@
1
1
  /**
2
- * IntermediateAdapter - Balanced API for developers with some protocol knowledge
2
+ * StandardAdapter - Balanced API for developers with some protocol knowledge
3
3
  *
4
- * Provides more control than BeginnerAdapter while still offering convenience:
4
+ * Provides more control than BasicAdapter while still offering convenience:
5
5
  * - Explicit transaction lifecycle methods
6
6
  * - Direct escrow operations
7
7
  * - State transition control
@@ -9,20 +9,20 @@
9
9
  * Use this adapter when you need fine-grained control but still want
10
10
  * user-friendly input parsing and validation.
11
11
  *
12
- * @module adapters/IntermediateAdapter
12
+ * @module adapters/StandardAdapter
13
13
  */
14
14
 
15
- import { BaseAdapter, ValidationError, DEFAULT_DISPUTE_WINDOW_SECONDS } from './BaseAdapter';
15
+ import { BaseAdapter, ValidationError } from './BaseAdapter';
16
16
  import { IACTPRuntime } from '../runtime/IACTPRuntime';
17
17
  import { MockTransaction, TransactionState } from '../runtime/types/MockState';
18
18
  import { EASHelper } from '../protocol/EASHelper';
19
19
 
20
20
  /**
21
- * Parameters for creating a transaction (intermediate level).
21
+ * Parameters for creating a transaction (standard level).
22
22
  *
23
- * More explicit than BeginnerPayParams but still with smart defaults.
23
+ * More explicit than BasicPayParams but still with smart defaults.
24
24
  */
25
- export interface IntermediateTransactionParams {
25
+ export interface StandardTransactionParams {
26
26
  /** Provider's Ethereum address */
27
27
  provider: string;
28
28
 
@@ -40,7 +40,7 @@ export interface IntermediateTransactionParams {
40
40
  }
41
41
 
42
42
  /**
43
- * IntermediateAdapter - Balanced API for transaction lifecycle control.
43
+ * StandardAdapter - Balanced API for transaction lifecycle control.
44
44
  *
45
45
  * Provides explicit methods for each stage of the ACTP lifecycle:
46
46
  * - `createTransaction()` - Create transaction without escrow
@@ -55,25 +55,25 @@ export interface IntermediateTransactionParams {
55
55
  * const client = await ACTPClient.create({ mode: 'mock' });
56
56
  *
57
57
  * // Create transaction (INITIATED state)
58
- * const txId = await client.intermediate.createTransaction({
58
+ * const txId = await client.standard.createTransaction({
59
59
  * provider: '0xProvider123',
60
60
  * amount: '100',
61
61
  * deadline: '+7d',
62
62
  * });
63
63
  *
64
64
  * // Link escrow (auto-transitions to COMMITTED)
65
- * await client.intermediate.linkEscrow(txId, '100');
65
+ * await client.standard.linkEscrow(txId, '100');
66
66
  *
67
67
  * // Provider delivers
68
- * await client.intermediate.transitionState(txId, 'DELIVERED');
68
+ * await client.standard.transitionState(txId, 'DELIVERED');
69
69
  *
70
70
  * // Release funds after dispute window
71
- * await client.intermediate.releaseEscrow(escrowId);
71
+ * await client.standard.releaseEscrow(escrowId);
72
72
  * ```
73
73
  */
74
- export class IntermediateAdapter extends BaseAdapter {
74
+ export class StandardAdapter extends BaseAdapter {
75
75
  /**
76
- * Creates a new IntermediateAdapter instance.
76
+ * Creates a new StandardAdapter instance.
77
77
  *
78
78
  * @param runtime - ACTP runtime implementation (MockRuntime or BlockchainRuntime)
79
79
  * @param requesterAddress - The requester's Ethereum address
@@ -90,7 +90,7 @@ export class IntermediateAdapter extends BaseAdapter {
90
90
  /**
91
91
  * Create a transaction (INITIATED state, no escrow yet).
92
92
  *
93
- * Unlike `beginner.pay()`, this only creates the transaction
93
+ * Unlike `basic.pay()`, this only creates the transaction
94
94
  * without linking escrow. You must call `linkEscrow()` separately.
95
95
  *
96
96
  * @param params - Transaction parameters
@@ -106,7 +106,7 @@ export class IntermediateAdapter extends BaseAdapter {
106
106
  * });
107
107
  * ```
108
108
  */
109
- async createTransaction(params: IntermediateTransactionParams): Promise<string> {
109
+ async createTransaction(params: StandardTransactionParams): Promise<string> {
110
110
  const provider = this.validateAddress(params.provider, 'provider');
111
111
  const amount = this.parseAmount(params.amount);
112
112
  const currentTime = this.runtime.time.now();
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * This module exports all adapter classes and types for the Three-Level API:
5
5
  * - BaseAdapter: Abstract base with shared utilities
6
- * - BeginnerAdapter: High-level, opinionated API
7
- * - IntermediateAdapter: Balanced control API
6
+ * - BasicAdapter: High-level, opinionated API
7
+ * - StandardAdapter: Balanced control API
8
8
  *
9
9
  * @module adapters
10
10
  */
@@ -18,8 +18,8 @@ export {
18
18
  MAX_DEADLINE_HOURS,
19
19
  MAX_DEADLINE_DAYS,
20
20
  } from './BaseAdapter';
21
- export { BeginnerAdapter, BeginnerPayParams, BeginnerPayResult } from './BeginnerAdapter';
22
- export { IntermediateAdapter, IntermediateTransactionParams } from './IntermediateAdapter';
21
+ export { BasicAdapter, BasicPayParams, BasicPayResult } from './BasicAdapter';
22
+ export { StandardAdapter, StandardTransactionParams } from './StandardAdapter';
23
23
 
24
24
  // Re-export runtime interface for convenience
25
25
  export { IACTPRuntime, CreateTransactionParams } from '../runtime/IACTPRuntime';
@@ -233,7 +233,7 @@ export class QuoteBuilder {
233
233
  */
234
234
  computeHash(quote: QuoteMessage): string {
235
235
  // Remove signature field for hashing
236
- const { signature, ...quoteWithoutSig } = quote;
236
+ const { signature: _signature, ...quoteWithoutSig } = quote;
237
237
  return keccak256(toUtf8Bytes(canonicalJsonStringify(quoteWithoutSig)));
238
238
  }
239
239
 
@@ -156,7 +156,7 @@ function createConfigSetCommand(): Command {
156
156
  updates.address = value.toLowerCase();
157
157
  }
158
158
 
159
- const newConfig = updateConfig(updates);
159
+ updateConfig(updates);
160
160
 
161
161
  output.result({
162
162
  [key]: key === 'privateKey' ? '****' + value.slice(-4) : value,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Pay Command - One-liner payment command (beginner API)
2
+ * Pay Command - One-liner payment command (basic API)
3
3
  *
4
4
  * The simplest way to create a payment transaction.
5
5
  * Creates transaction, links escrow, and returns immediately.
@@ -76,7 +76,7 @@ async function runPay(
76
76
  const disputeWindow = parseInt(options.disputeWindow, 10);
77
77
 
78
78
  // Create payment
79
- const result = await client.beginner.pay({
79
+ const result = await client.basic.pay({
80
80
  to,
81
81
  amount,
82
82
  deadline,
@@ -14,7 +14,7 @@ import { Command } from 'commander';
14
14
  import { Output, ExitCode, fmt } from '../utils/output';
15
15
  import { loadConfig } from '../utils/config';
16
16
  import { mapError } from '../utils/client';
17
- import { BaseAdapter, ValidationError, MIN_AMOUNT_WEI } from '../../adapters/BaseAdapter';
17
+ import { BaseAdapter } from '../../adapters/BaseAdapter';
18
18
 
19
19
  // ============================================================================
20
20
  // Command Definition
@@ -10,10 +10,9 @@
10
10
  */
11
11
 
12
12
  import { Command } from 'commander';
13
- import { Output, ExitCode, fmt } from '../utils/output';
13
+ import { Output, ExitCode } from '../utils/output';
14
14
  import { loadConfig } from '../utils/config';
15
15
  import { createClient, mapError } from '../utils/client';
16
- import { MockRuntime } from '../../runtime/MockRuntime';
17
16
  import { IMockRuntime } from '../../runtime/IACTPRuntime';
18
17
 
19
18
  // ============================================================================
@@ -2,7 +2,7 @@
2
2
  * Transaction Commands - tx subcommand group
3
3
  *
4
4
  * Commands for managing ACTP transactions:
5
- * - tx create: Create a new transaction (intermediate API)
5
+ * - tx create: Create a new transaction (standard API)
6
6
  * - tx status: Check transaction status
7
7
  * - tx list: List all transactions
8
8
  * - tx deliver: Mark transaction as delivered
@@ -66,7 +66,7 @@ function createTxCreateCommand(): Command {
66
66
  const disputeWindow = parseInt(options.disputeWindow, 10);
67
67
 
68
68
  // Create transaction
69
- const txId = await client.intermediate.createTransaction({
69
+ const txId = await client.standard.createTransaction({
70
70
  provider,
71
71
  amount,
72
72
  deadline,
@@ -77,10 +77,10 @@ function createTxCreateCommand(): Command {
77
77
  // Optionally fund
78
78
  let escrowId: string | undefined;
79
79
  if (options.fund) {
80
- escrowId = await client.intermediate.linkEscrow(txId);
80
+ escrowId = await client.standard.linkEscrow(txId);
81
81
  }
82
82
 
83
- const tx = await client.intermediate.getTransaction(txId);
83
+ const tx = await client.standard.getTransaction(txId);
84
84
  if (!tx) throw new Error('Transaction not found after creation');
85
85
 
86
86
  output.result(
@@ -134,13 +134,13 @@ function createTxStatusCommand(): Command {
134
134
  }
135
135
 
136
136
  const client = await createClient();
137
- const tx = await client.intermediate.getTransaction(txId);
137
+ const tx = await client.standard.getTransaction(txId);
138
138
 
139
139
  if (!tx) {
140
140
  throw new Error(`Transaction not found: ${txId}`);
141
141
  }
142
142
 
143
- const status = await client.beginner.checkStatus(txId);
143
+ const status = await client.basic.checkStatus(txId);
144
144
 
145
145
  if (options.quiet) {
146
146
  output.raw(tx.state);
@@ -289,9 +289,9 @@ function createTxDeliverCommand(): Command {
289
289
  const client = await createClient();
290
290
 
291
291
  // Transition to DELIVERED
292
- await client.intermediate.transitionState(txId, 'DELIVERED' as TransactionState);
292
+ await client.standard.transitionState(txId, 'DELIVERED' as TransactionState);
293
293
 
294
- const tx = await client.intermediate.getTransaction(txId);
294
+ const tx = await client.standard.getTransaction(txId);
295
295
  if (!tx) throw new Error('Transaction not found');
296
296
 
297
297
  output.result(
@@ -345,15 +345,15 @@ function createTxSettleCommand(): Command {
345
345
  const client = await createClient();
346
346
 
347
347
  // Get transaction to find escrow
348
- const tx = await client.intermediate.getTransaction(txId);
348
+ const tx = await client.standard.getTransaction(txId);
349
349
  if (!tx) throw new Error(`Transaction not found: ${txId}`);
350
350
  if (!tx.escrowId) throw new Error('Transaction has no linked escrow');
351
351
 
352
352
  // Release escrow
353
- await client.intermediate.releaseEscrow(tx.escrowId);
353
+ await client.standard.releaseEscrow(tx.escrowId);
354
354
 
355
355
  // Get updated transaction
356
- const updatedTx = await client.intermediate.getTransaction(txId);
356
+ const updatedTx = await client.standard.getTransaction(txId);
357
357
  if (!updatedTx) throw new Error('Transaction not found');
358
358
 
359
359
  output.result(
@@ -402,9 +402,9 @@ function createTxCancelCommand(): Command {
402
402
  const client = await createClient();
403
403
 
404
404
  // Transition to CANCELLED
405
- await client.intermediate.transitionState(txId, 'CANCELLED' as TransactionState);
405
+ await client.standard.transitionState(txId, 'CANCELLED' as TransactionState);
406
406
 
407
- const tx = await client.intermediate.getTransaction(txId);
407
+ const tx = await client.standard.getTransaction(txId);
408
408
  if (!tx) throw new Error('Transaction not found');
409
409
 
410
410
  output.result(
@@ -85,7 +85,7 @@ async function runWatch(
85
85
  }
86
86
 
87
87
  // Get initial state
88
- const tx = await client.intermediate.getTransaction(txId);
88
+ const tx = await client.standard.getTransaction(txId);
89
89
  if (!tx) {
90
90
  throw new Error(`Transaction not found: ${txId}`);
91
91
  }
@@ -123,7 +123,7 @@ async function runWatch(
123
123
  }
124
124
 
125
125
  try {
126
- const updatedTx = await client.intermediate.getTransaction(txId);
126
+ const updatedTx = await client.standard.getTransaction(txId);
127
127
  if (!updatedTx) {
128
128
  output.warning('Transaction no longer exists');
129
129
  process.exit(ExitCode.ERROR);
package/src/index.ts CHANGED
@@ -20,7 +20,7 @@
20
20
  * await client.mintTokens(client.getAddress(), '10000000000');
21
21
  *
22
22
  * // Create a payment
23
- * const result = await client.beginner.pay({
23
+ * const result = await client.basic.pay({
24
24
  * to: '0xProvider...',
25
25
  * amount: '100',
26
26
  * });
@@ -54,15 +54,15 @@ export {
54
54
  } from './adapters/BaseAdapter';
55
55
 
56
56
  export {
57
- BeginnerAdapter,
58
- BeginnerPayParams,
59
- BeginnerPayResult,
60
- } from './adapters/BeginnerAdapter';
57
+ BasicAdapter,
58
+ BasicPayParams,
59
+ BasicPayResult,
60
+ } from './adapters/BasicAdapter';
61
61
 
62
62
  export {
63
- IntermediateAdapter,
64
- IntermediateTransactionParams,
65
- } from './adapters/IntermediateAdapter';
63
+ StandardAdapter,
64
+ StandardTransactionParams,
65
+ } from './adapters/StandardAdapter';
66
66
 
67
67
  // =============================================================================
68
68
  // Runtime Layer - Protocol Implementation
@@ -164,7 +164,6 @@ export async function request(
164
164
 
165
165
  let tx = await client.runtime.getTransaction(txId);
166
166
  let attempts = 0;
167
- let timedOut = false;
168
167
 
169
168
  while (tx && tx.state !== 'DELIVERED' && tx.state !== 'SETTLED' && attempts < maxAttempts) {
170
169
  // Check for terminal states that indicate failure
@@ -190,7 +189,7 @@ export async function request(
190
189
 
191
190
  // Check if we got a result
192
191
  if (!tx || (tx.state !== 'DELIVERED' && tx.state !== 'SETTLED')) {
193
- timedOut = true;
192
+ const _timedOut = true; // Flag for potential future use
194
193
 
195
194
  // SECURITY FIX (H-3): Auto-cancel transaction on timeout if still in early state
196
195
  // This prevents funds from being locked indefinitely if provider never responds
@@ -14,10 +14,10 @@ import * as fs from 'fs';
14
14
  import { ethers } from 'ethers';
15
15
  import { ACTPClient } from '../ACTPClient';
16
16
  import { Job, JobHandler, JobContext } from './types/Job';
17
- import { ProvideOptions, RequestOptions, RequestResult, NetworkOption } from './types/Options';
17
+ import { RequestOptions, RequestResult, NetworkOption } from './types/Options';
18
18
  import { PricingStrategy } from './pricing/PricingStrategy';
19
19
  import { AgentLifecycleError, ServiceConfigError, ValidationError } from '../errors';
20
- import { validateServiceName, validatePath, isValidAddress, LRUCache } from '../utils/security';
20
+ import { validateServiceName, validatePath, LRUCache } from '../utils/security';
21
21
  import { Logger } from '../utils/Logger';
22
22
  import { ServiceHash } from '../utils/Helpers';
23
23
  import { Semaphore } from '../utils/Semaphore';
@@ -214,7 +214,7 @@ function estimateUnits(job: Job, unit: string): number {
214
214
  *
215
215
  * @internal
216
216
  */
217
- function estimateApiCost(api: string, job: Job): number {
217
+ function estimateApiCost(_api: string, _job: Job): number {
218
218
  // MVP: Returns 0 (API costs tracked externally by agent)
219
219
  // V2: Integrate with OpenAI/Anthropic pricing APIs
220
220
 
@@ -4,7 +4,7 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
 
7
- import { JobHandler, Job } from './Job';
7
+ import { Job } from './Job';
8
8
 
9
9
  /**
10
10
  * Wallet configuration options
@@ -455,13 +455,13 @@ export class ACTPKernel {
455
455
  *
456
456
  * **REQUIRED: Use secure wrapper methods instead:**
457
457
  *
458
- * 1. **BeginnerAdapter.completePayment()** (recommended for most users)
458
+ * 1. **BasicAdapter.completePayment()** (recommended for most users)
459
459
  * - Automatically verifies attestation before release
460
460
  * - Validates attestation belongs to this transaction
461
461
  * - Checks attestation hasn't been used before
462
462
  * - Handles all state transitions
463
463
  *
464
- * 2. **IntermediateAdapter.releaseEscrow()** (for more control)
464
+ * 2. **StandardAdapter.releaseEscrow()** (for more control)
465
465
  * - Explicitly requires attestation verification
466
466
  * - Throws error if attestation invalid or missing
467
467
  * - Allows custom verification logic
@@ -493,15 +493,15 @@ export class ACTPKernel {
493
493
  *
494
494
  * **For testnet/mainnet deployments:**
495
495
  * - MUST configure easConfig in ACTPClient
496
- * - MUST use wrapper methods (Beginner/Intermediate adapters)
496
+ * - MUST use wrapper methods (Basic/Standard adapters)
497
497
  * - NEVER call this method directly unless attestation verified
498
498
  *
499
499
  * @param txId - Transaction ID to settle
500
500
  * @throws {ValidationError} If txId is invalid
501
501
  * @throws {TransactionRevertedError} If contract reverts
502
502
  *
503
- * @see {@link BeginnerAdapter.completePayment} Recommended method with built-in verification
504
- * @see {@link IntermediateAdapter.releaseEscrow} Explicit verification method
503
+ * @see {@link BasicAdapter.completePayment} Recommended method with built-in verification
504
+ * @see {@link StandardAdapter.releaseEscrow} Explicit verification method
505
505
  * @see {@link EASHelper.verifyDeliveryAttestation} Manual verification helper
506
506
  */
507
507
  async releaseEscrow(txId: string): Promise<void> {
@@ -157,7 +157,7 @@ export class MessageSigner {
157
157
  );
158
158
  }
159
159
 
160
- const { type, version, from, to, timestamp, nonce, signature, ...payload } = message;
160
+ const { type, version, from, to, timestamp, nonce, signature: _sig, ...payload } = message;
161
161
 
162
162
  // SECURITY FIX (H-3): Validate nonce format (must be bytes32)
163
163
  if (!nonce || !/^0x[a-fA-F0-9]{64}$/.test(nonce)) {
@@ -230,6 +230,7 @@ export class ProofGenerator {
230
230
  throw new Error('Response body is not readable');
231
231
  }
232
232
 
233
+ // eslint-disable-next-line no-constant-condition
233
234
  while (true) {
234
235
  const { done, value } = await reader.read();
235
236
 
@@ -84,7 +84,7 @@ export interface BlockchainRuntimeConfig {
84
84
  * });
85
85
  *
86
86
  * // Now use with adapters
87
- * const adapter = new BeginnerAdapter(runtime, requesterAddress);
87
+ * const adapter = new BasicAdapter(runtime, requesterAddress);
88
88
  * await adapter.createJob({...});
89
89
  * ```
90
90
  */
@@ -892,7 +892,7 @@ export class BlockchainRuntime implements IACTPRuntime {
892
892
  * @param params - Transaction parameters
893
893
  * @returns Estimated gas limit and cost in wei
894
894
  */
895
- async estimateCreateTransactionGas(params: CreateTransactionParams): Promise<{
895
+ async estimateCreateTransactionGas(_params: CreateTransactionParams): Promise<{
896
896
  gasLimit: bigint;
897
897
  gasCostWei: bigint;
898
898
  gasCostGwei: string;
@@ -921,7 +921,7 @@ export class BlockchainRuntime implements IACTPRuntime {
921
921
  * @param txId - Transaction ID
922
922
  * @returns Estimated gas limit and cost
923
923
  */
924
- async estimateLinkEscrowGas(txId: string): Promise<{
924
+ async estimateLinkEscrowGas(_txId: string): Promise<{
925
925
  gasLimit: bigint;
926
926
  gasCostWei: bigint;
927
927
  gasCostGwei: string;
@@ -949,7 +949,7 @@ export class BlockchainRuntime implements IACTPRuntime {
949
949
  * @param newState - Target state
950
950
  * @returns Estimated gas limit and cost
951
951
  */
952
- async estimateTransitionGas(txId: string, newState: string): Promise<{
952
+ async estimateTransitionGas(_txId: string, _newState: string): Promise<{
953
953
  gasLimit: bigint;
954
954
  gasCostWei: bigint;
955
955
  gasCostGwei: string;
@@ -49,7 +49,7 @@ export interface CreateTransactionParams {
49
49
  * });
50
50
  *
51
51
  * // Adapters work with either implementation
52
- * const adapter = new BeginnerAdapter(runtime, requesterAddress);
52
+ * const adapter = new BasicAdapter(runtime, requesterAddress);
53
53
  * ```
54
54
  */
55
55
  export interface IACTPRuntime {
@@ -25,8 +25,6 @@ import {
25
25
  MockEscrow,
26
26
  MockEvent,
27
27
  TransactionState,
28
- TransactionStateValue,
29
- MOCK_STATE_DEFAULTS,
30
28
  } from './types/MockState';
31
29
  import { IACTPRuntime, CreateTransactionParams } from './IACTPRuntime';
32
30
 
@@ -465,7 +465,7 @@ const DEFAULT_RECOVERY: ErrorRecoveryInfo = {
465
465
  * @example
466
466
  * ```typescript
467
467
  * try {
468
- * await client.beginner.pay({ to: provider, amount: '100' });
468
+ * await client.basic.pay({ to: provider, amount: '100' });
469
469
  * } catch (error) {
470
470
  * const recovery = ErrorRecoveryGuide.analyze(error);
471
471
  * console.log('Category:', recovery.category);
@@ -622,7 +622,7 @@ ${recovery.securityNotes.map((n) => ` ! ${n}`).join('\n')}`;
622
622
  * @example
623
623
  * ```typescript
624
624
  * const result = await withRecoveryGuidance(
625
- * () => client.beginner.pay({ to: provider, amount: '100' }),
625
+ * () => client.basic.pay({ to: provider, amount: '100' }),
626
626
  * { logGuidance: true, autoRetry: true }
627
627
  * );
628
628
  * ```
@@ -637,14 +637,12 @@ export async function withRecoveryGuidance<T>(
637
637
  ): Promise<T> {
638
638
  const { logGuidance = false, autoRetry = false, onError } = options;
639
639
 
640
- let lastError: unknown;
641
640
  let attempts = 0;
642
641
 
643
642
  do {
644
643
  try {
645
644
  return await operation();
646
645
  } catch (error) {
647
- lastError = error;
648
646
  const recovery = ErrorRecoveryGuide.analyze(error);
649
647
 
650
648
  if (onError) {
@@ -671,5 +669,6 @@ export async function withRecoveryGuidance<T>(
671
669
 
672
670
  throw error;
673
671
  }
672
+ // eslint-disable-next-line no-constant-condition
674
673
  } while (true);
675
674
  }
@@ -202,7 +202,7 @@ export class InMemoryUsedAttestationTracker implements IUsedAttestationTracker {
202
202
  *
203
203
  * @param maxAgeHours - Remove entries older than this many hours
204
204
  */
205
- cleanupOldEntries(maxAgeHours: number): number {
205
+ cleanupOldEntries(_maxAgeHours: number): number {
206
206
  // In-memory tracker doesn't track timestamps
207
207
  // This is a placeholder for future enhancement
208
208
  console.warn(