uvd-x402-sdk 2.17.0 → 2.19.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.
@@ -1,4 +1,4 @@
1
- import { m as X402Version, f as PaymentResult } from '../index-BE5cH7oS.mjs';
1
+ import { K as X402Version, k as PaymentResult } from '../index-B49n9gXd.mjs';
2
2
 
3
3
  /**
4
4
  * uvd-x402-sdk - Wagmi/Viem Adapter
@@ -1,4 +1,4 @@
1
- import { m as X402Version, f as PaymentResult } from '../index-BE5cH7oS.js';
1
+ import { K as X402Version, k as PaymentResult } from '../index-B49n9gXd.js';
2
2
 
3
3
  /**
4
4
  * uvd-x402-sdk - Wagmi/Viem Adapter
@@ -1,4 +1,4 @@
1
- import { m as X402Version, n as X402Header } from '../index-BE5cH7oS.mjs';
1
+ import { w as X402Header, K as X402Version } from '../index-B49n9gXd.mjs';
2
2
 
3
3
  /**
4
4
  * uvd-x402-sdk - Backend Utilities
@@ -1037,7 +1037,7 @@ declare function escrowTimeRemaining(escrow: EscrowPayment): number;
1037
1037
  */
1038
1038
  declare const ERC8004_EXTENSION_ID = "8004-reputation";
1039
1039
  /**
1040
- * ERC-8004 contract addresses per network
1040
+ * ERC-8004 contract addresses per network (12 networks)
1041
1041
  */
1042
1042
  declare const ERC8004_CONTRACTS: Record<string, {
1043
1043
  identityRegistry?: string;
@@ -1047,7 +1047,10 @@ declare const ERC8004_CONTRACTS: Record<string, {
1047
1047
  /**
1048
1048
  * Network type for ERC-8004 operations
1049
1049
  */
1050
- type Erc8004Network = 'ethereum' | 'ethereum-sepolia';
1050
+ /**
1051
+ * Network type for ERC-8004 operations (12 networks)
1052
+ */
1053
+ type Erc8004Network = 'ethereum' | 'base-mainnet' | 'polygon' | 'arbitrum' | 'celo' | 'bsc' | 'monad' | 'ethereum-sepolia' | 'base-sepolia' | 'polygon-amoy' | 'arbitrum-sepolia' | 'celo-sepolia';
1051
1054
  /**
1052
1055
  * Proof of payment returned when settling with ERC-8004 extension
1053
1056
  */
@@ -1422,5 +1425,218 @@ declare function buildErc8004PaymentRequirements(options: PaymentRequirementsOpt
1422
1425
  };
1423
1426
  };
1424
1427
  };
1428
+ /**
1429
+ * PAYMENT_INFO_TYPEHASH used for nonce computation.
1430
+ * Must match the on-chain AuthCaptureEscrow contract.
1431
+ */
1432
+ declare const PAYMENT_INFO_TYPEHASH = "0xae68ac7ce30c86ece8196b61a7c486d8f0061f575037fbd34e7fe4e2820c6591";
1433
+ declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
1434
+ /**
1435
+ * Contract deposit limit (enforced by PaymentOperator condition).
1436
+ * As of 2026-02-03, commerce-payments contracts enforce $100 max per deposit.
1437
+ */
1438
+ declare const DEPOSIT_LIMIT_USDC = "100000000";
1439
+ /**
1440
+ * Base Mainnet contract addresses for the Advanced Escrow system.
1441
+ */
1442
+ declare const BASE_MAINNET_CONTRACTS: {
1443
+ operator: string;
1444
+ escrow: string;
1445
+ tokenCollector: string;
1446
+ usdc: string;
1447
+ };
1448
+ /**
1449
+ * Task tiers determine timing parameters for escrow operations.
1450
+ */
1451
+ type AdvancedEscrowTaskTier = 'micro' | 'standard' | 'premium' | 'enterprise';
1452
+ /**
1453
+ * Timing configuration per task tier (in seconds).
1454
+ */
1455
+ declare const TIER_TIMINGS: Record<AdvancedEscrowTaskTier, {
1456
+ pre: number;
1457
+ auth: number;
1458
+ refund: number;
1459
+ }>;
1460
+ /**
1461
+ * PaymentInfo struct matching the on-chain PaymentOperator contract.
1462
+ */
1463
+ interface AdvancedPaymentInfo {
1464
+ operator: string;
1465
+ receiver: string;
1466
+ token: string;
1467
+ maxAmount: string;
1468
+ preApprovalExpiry: number;
1469
+ authorizationExpiry: number;
1470
+ refundExpiry: number;
1471
+ minFeeBps: number;
1472
+ maxFeeBps: number;
1473
+ feeReceiver: string;
1474
+ salt: string;
1475
+ }
1476
+ /**
1477
+ * Result of an AUTHORIZE operation.
1478
+ */
1479
+ interface AdvancedAuthorizationResult {
1480
+ success: boolean;
1481
+ transactionHash?: string;
1482
+ paymentInfo?: AdvancedPaymentInfo;
1483
+ salt?: string;
1484
+ error?: string;
1485
+ }
1486
+ /**
1487
+ * Result of an on-chain transaction (release, refund, charge).
1488
+ */
1489
+ interface AdvancedTransactionResult {
1490
+ success: boolean;
1491
+ transactionHash?: string;
1492
+ gasUsed?: number;
1493
+ error?: string;
1494
+ }
1495
+ /**
1496
+ * Contract addresses configuration for AdvancedEscrowClient.
1497
+ */
1498
+ interface AdvancedEscrowContracts {
1499
+ operator: string;
1500
+ escrow: string;
1501
+ tokenCollector: string;
1502
+ usdc: string;
1503
+ }
1504
+ /**
1505
+ * Configuration options for AdvancedEscrowClient.
1506
+ */
1507
+ interface AdvancedEscrowClientOptions {
1508
+ /** Facilitator URL for AUTHORIZE operations */
1509
+ facilitatorUrl?: string;
1510
+ /** JSON-RPC URL for on-chain operations */
1511
+ rpcUrl?: string;
1512
+ /** Chain ID (default: 8453 for Base Mainnet) */
1513
+ chainId?: number;
1514
+ /** Contract addresses (default: Base Mainnet) */
1515
+ contracts?: AdvancedEscrowContracts;
1516
+ /** Gas limit for transactions (default: 300000) */
1517
+ gasLimit?: number;
1518
+ }
1519
+ /**
1520
+ * Minimal PaymentOperator ABI for the 4 on-chain functions.
1521
+ * (AUTHORIZE goes through the facilitator, not directly on-chain)
1522
+ */
1523
+ declare const OPERATOR_ABI: string[];
1524
+ /**
1525
+ * AdvancedEscrowClient provides the 5 Advanced Escrow flows via the
1526
+ * PaymentOperator contract on Base Mainnet.
1527
+ *
1528
+ * @example
1529
+ * ```typescript
1530
+ * import { ethers } from 'ethers';
1531
+ * import { AdvancedEscrowClient } from 'uvd-x402-sdk/backend';
1532
+ *
1533
+ * const client = new AdvancedEscrowClient(signer, {
1534
+ * facilitatorUrl: 'https://facilitator.ultravioletadao.xyz',
1535
+ * rpcUrl: 'https://mainnet.base.org',
1536
+ * });
1537
+ *
1538
+ * // Lock funds in escrow
1539
+ * const pi = client.buildPaymentInfo('0xWorker...', '5000000', 'standard');
1540
+ * const auth = await client.authorize(pi);
1541
+ *
1542
+ * // After work is done, release to worker
1543
+ * const tx = await client.release(pi);
1544
+ *
1545
+ * // Or cancel and refund
1546
+ * const refund = await client.refundInEscrow(pi);
1547
+ * ```
1548
+ */
1549
+ declare class AdvancedEscrowClient {
1550
+ private facilitatorUrl;
1551
+ private chainId;
1552
+ private gasLimit;
1553
+ private contracts;
1554
+ private signer;
1555
+ private payerAddress;
1556
+ constructor(signer: any, options?: AdvancedEscrowClientOptions);
1557
+ /**
1558
+ * Initialize the client (resolves signer address).
1559
+ * Call this before using any methods.
1560
+ */
1561
+ init(): Promise<void>;
1562
+ /**
1563
+ * Build a PaymentInfo struct with appropriate timing for the task tier.
1564
+ *
1565
+ * @param receiver - Worker's wallet address
1566
+ * @param amount - Amount in token atomic units (e.g., '5000000' for $5 USDC)
1567
+ * @param tier - Task tier determines timing parameters
1568
+ * @param salt - Random salt (auto-generated if not provided)
1569
+ */
1570
+ buildPaymentInfo(receiver: string, amount: string, tier?: AdvancedEscrowTaskTier, salt?: string): AdvancedPaymentInfo;
1571
+ /**
1572
+ * Compute the correct nonce (with PAYMENT_INFO_TYPEHASH).
1573
+ * Matches the on-chain AuthCaptureEscrow nonce derivation.
1574
+ */
1575
+ private computeNonce;
1576
+ /**
1577
+ * Sign ReceiveWithAuthorization for ERC-3009.
1578
+ */
1579
+ private signErc3009;
1580
+ /**
1581
+ * Build the on-chain PaymentInfo tuple for contract calls.
1582
+ */
1583
+ private buildTuple;
1584
+ /**
1585
+ * AUTHORIZE: Lock funds in escrow via the facilitator.
1586
+ *
1587
+ * Sends an ERC-3009 ReceiveWithAuthorization to the facilitator,
1588
+ * which calls PaymentOperator.authorize() on-chain.
1589
+ */
1590
+ authorize(paymentInfo: AdvancedPaymentInfo): Promise<AdvancedAuthorizationResult>;
1591
+ /**
1592
+ * RELEASE: Capture escrowed funds to receiver (worker gets paid).
1593
+ *
1594
+ * Calls PaymentOperator.release() -> escrow.capture()
1595
+ *
1596
+ * @param paymentInfo - PaymentInfo from the authorize step
1597
+ * @param amount - Amount to release (defaults to maxAmount)
1598
+ */
1599
+ release(paymentInfo: AdvancedPaymentInfo, amount?: string): Promise<AdvancedTransactionResult>;
1600
+ /**
1601
+ * REFUND IN ESCROW: Return escrowed funds to payer (cancel task).
1602
+ *
1603
+ * Calls PaymentOperator.refundInEscrow() -> escrow.partialVoid()
1604
+ *
1605
+ * @param paymentInfo - PaymentInfo from the authorize step
1606
+ * @param amount - Amount to refund (defaults to maxAmount)
1607
+ */
1608
+ refundInEscrow(paymentInfo: AdvancedPaymentInfo, amount?: string): Promise<AdvancedTransactionResult>;
1609
+ /**
1610
+ * CHARGE: Direct instant payment (no escrow hold).
1611
+ *
1612
+ * Calls PaymentOperator.charge() -> escrow.charge()
1613
+ * Funds go directly from payer to receiver.
1614
+ *
1615
+ * @param paymentInfo - PaymentInfo with receiver and amount
1616
+ * @param amount - Amount to charge (defaults to maxAmount)
1617
+ */
1618
+ charge(paymentInfo: AdvancedPaymentInfo, amount?: string): Promise<AdvancedTransactionResult>;
1619
+ /**
1620
+ * REFUND POST ESCROW: Dispute refund after funds were released.
1621
+ *
1622
+ * Calls PaymentOperator.refundPostEscrow() -> escrow.refund()
1623
+ *
1624
+ * WARNING: NOT FUNCTIONAL IN PRODUCTION (as of 2026-02-03).
1625
+ * The protocol team has not implemented the required tokenCollector
1626
+ * contract. This call will fail on-chain.
1627
+ *
1628
+ * For dispute resolution, use refundInEscrow() instead: keep funds
1629
+ * in escrow and refund before releasing. This guarantees funds are
1630
+ * available and under arbiter control.
1631
+ *
1632
+ * Kept for future use when tokenCollector is implemented.
1633
+ *
1634
+ * @param paymentInfo - PaymentInfo from the original authorization
1635
+ * @param amount - Amount to refund (defaults to maxAmount)
1636
+ * @param tokenCollector - Address of token collector for refund sourcing
1637
+ * @param collectorData - Data for the token collector
1638
+ */
1639
+ refundPostEscrow(paymentInfo: AdvancedPaymentInfo, amount?: string, tokenCollector?: string, collectorData?: string): Promise<AdvancedTransactionResult>;
1640
+ }
1425
1641
 
1426
- export { type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, isEscrowExpired, parsePaymentHeader };
1642
+ export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, OPERATOR_ABI, PAYMENT_INFO_TYPEHASH, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_TIMINGS, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, isEscrowExpired, parsePaymentHeader };
@@ -1,4 +1,4 @@
1
- import { m as X402Version, n as X402Header } from '../index-BE5cH7oS.js';
1
+ import { w as X402Header, K as X402Version } from '../index-B49n9gXd.js';
2
2
 
3
3
  /**
4
4
  * uvd-x402-sdk - Backend Utilities
@@ -1037,7 +1037,7 @@ declare function escrowTimeRemaining(escrow: EscrowPayment): number;
1037
1037
  */
1038
1038
  declare const ERC8004_EXTENSION_ID = "8004-reputation";
1039
1039
  /**
1040
- * ERC-8004 contract addresses per network
1040
+ * ERC-8004 contract addresses per network (12 networks)
1041
1041
  */
1042
1042
  declare const ERC8004_CONTRACTS: Record<string, {
1043
1043
  identityRegistry?: string;
@@ -1047,7 +1047,10 @@ declare const ERC8004_CONTRACTS: Record<string, {
1047
1047
  /**
1048
1048
  * Network type for ERC-8004 operations
1049
1049
  */
1050
- type Erc8004Network = 'ethereum' | 'ethereum-sepolia';
1050
+ /**
1051
+ * Network type for ERC-8004 operations (12 networks)
1052
+ */
1053
+ type Erc8004Network = 'ethereum' | 'base-mainnet' | 'polygon' | 'arbitrum' | 'celo' | 'bsc' | 'monad' | 'ethereum-sepolia' | 'base-sepolia' | 'polygon-amoy' | 'arbitrum-sepolia' | 'celo-sepolia';
1051
1054
  /**
1052
1055
  * Proof of payment returned when settling with ERC-8004 extension
1053
1056
  */
@@ -1422,5 +1425,218 @@ declare function buildErc8004PaymentRequirements(options: PaymentRequirementsOpt
1422
1425
  };
1423
1426
  };
1424
1427
  };
1428
+ /**
1429
+ * PAYMENT_INFO_TYPEHASH used for nonce computation.
1430
+ * Must match the on-chain AuthCaptureEscrow contract.
1431
+ */
1432
+ declare const PAYMENT_INFO_TYPEHASH = "0xae68ac7ce30c86ece8196b61a7c486d8f0061f575037fbd34e7fe4e2820c6591";
1433
+ declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
1434
+ /**
1435
+ * Contract deposit limit (enforced by PaymentOperator condition).
1436
+ * As of 2026-02-03, commerce-payments contracts enforce $100 max per deposit.
1437
+ */
1438
+ declare const DEPOSIT_LIMIT_USDC = "100000000";
1439
+ /**
1440
+ * Base Mainnet contract addresses for the Advanced Escrow system.
1441
+ */
1442
+ declare const BASE_MAINNET_CONTRACTS: {
1443
+ operator: string;
1444
+ escrow: string;
1445
+ tokenCollector: string;
1446
+ usdc: string;
1447
+ };
1448
+ /**
1449
+ * Task tiers determine timing parameters for escrow operations.
1450
+ */
1451
+ type AdvancedEscrowTaskTier = 'micro' | 'standard' | 'premium' | 'enterprise';
1452
+ /**
1453
+ * Timing configuration per task tier (in seconds).
1454
+ */
1455
+ declare const TIER_TIMINGS: Record<AdvancedEscrowTaskTier, {
1456
+ pre: number;
1457
+ auth: number;
1458
+ refund: number;
1459
+ }>;
1460
+ /**
1461
+ * PaymentInfo struct matching the on-chain PaymentOperator contract.
1462
+ */
1463
+ interface AdvancedPaymentInfo {
1464
+ operator: string;
1465
+ receiver: string;
1466
+ token: string;
1467
+ maxAmount: string;
1468
+ preApprovalExpiry: number;
1469
+ authorizationExpiry: number;
1470
+ refundExpiry: number;
1471
+ minFeeBps: number;
1472
+ maxFeeBps: number;
1473
+ feeReceiver: string;
1474
+ salt: string;
1475
+ }
1476
+ /**
1477
+ * Result of an AUTHORIZE operation.
1478
+ */
1479
+ interface AdvancedAuthorizationResult {
1480
+ success: boolean;
1481
+ transactionHash?: string;
1482
+ paymentInfo?: AdvancedPaymentInfo;
1483
+ salt?: string;
1484
+ error?: string;
1485
+ }
1486
+ /**
1487
+ * Result of an on-chain transaction (release, refund, charge).
1488
+ */
1489
+ interface AdvancedTransactionResult {
1490
+ success: boolean;
1491
+ transactionHash?: string;
1492
+ gasUsed?: number;
1493
+ error?: string;
1494
+ }
1495
+ /**
1496
+ * Contract addresses configuration for AdvancedEscrowClient.
1497
+ */
1498
+ interface AdvancedEscrowContracts {
1499
+ operator: string;
1500
+ escrow: string;
1501
+ tokenCollector: string;
1502
+ usdc: string;
1503
+ }
1504
+ /**
1505
+ * Configuration options for AdvancedEscrowClient.
1506
+ */
1507
+ interface AdvancedEscrowClientOptions {
1508
+ /** Facilitator URL for AUTHORIZE operations */
1509
+ facilitatorUrl?: string;
1510
+ /** JSON-RPC URL for on-chain operations */
1511
+ rpcUrl?: string;
1512
+ /** Chain ID (default: 8453 for Base Mainnet) */
1513
+ chainId?: number;
1514
+ /** Contract addresses (default: Base Mainnet) */
1515
+ contracts?: AdvancedEscrowContracts;
1516
+ /** Gas limit for transactions (default: 300000) */
1517
+ gasLimit?: number;
1518
+ }
1519
+ /**
1520
+ * Minimal PaymentOperator ABI for the 4 on-chain functions.
1521
+ * (AUTHORIZE goes through the facilitator, not directly on-chain)
1522
+ */
1523
+ declare const OPERATOR_ABI: string[];
1524
+ /**
1525
+ * AdvancedEscrowClient provides the 5 Advanced Escrow flows via the
1526
+ * PaymentOperator contract on Base Mainnet.
1527
+ *
1528
+ * @example
1529
+ * ```typescript
1530
+ * import { ethers } from 'ethers';
1531
+ * import { AdvancedEscrowClient } from 'uvd-x402-sdk/backend';
1532
+ *
1533
+ * const client = new AdvancedEscrowClient(signer, {
1534
+ * facilitatorUrl: 'https://facilitator.ultravioletadao.xyz',
1535
+ * rpcUrl: 'https://mainnet.base.org',
1536
+ * });
1537
+ *
1538
+ * // Lock funds in escrow
1539
+ * const pi = client.buildPaymentInfo('0xWorker...', '5000000', 'standard');
1540
+ * const auth = await client.authorize(pi);
1541
+ *
1542
+ * // After work is done, release to worker
1543
+ * const tx = await client.release(pi);
1544
+ *
1545
+ * // Or cancel and refund
1546
+ * const refund = await client.refundInEscrow(pi);
1547
+ * ```
1548
+ */
1549
+ declare class AdvancedEscrowClient {
1550
+ private facilitatorUrl;
1551
+ private chainId;
1552
+ private gasLimit;
1553
+ private contracts;
1554
+ private signer;
1555
+ private payerAddress;
1556
+ constructor(signer: any, options?: AdvancedEscrowClientOptions);
1557
+ /**
1558
+ * Initialize the client (resolves signer address).
1559
+ * Call this before using any methods.
1560
+ */
1561
+ init(): Promise<void>;
1562
+ /**
1563
+ * Build a PaymentInfo struct with appropriate timing for the task tier.
1564
+ *
1565
+ * @param receiver - Worker's wallet address
1566
+ * @param amount - Amount in token atomic units (e.g., '5000000' for $5 USDC)
1567
+ * @param tier - Task tier determines timing parameters
1568
+ * @param salt - Random salt (auto-generated if not provided)
1569
+ */
1570
+ buildPaymentInfo(receiver: string, amount: string, tier?: AdvancedEscrowTaskTier, salt?: string): AdvancedPaymentInfo;
1571
+ /**
1572
+ * Compute the correct nonce (with PAYMENT_INFO_TYPEHASH).
1573
+ * Matches the on-chain AuthCaptureEscrow nonce derivation.
1574
+ */
1575
+ private computeNonce;
1576
+ /**
1577
+ * Sign ReceiveWithAuthorization for ERC-3009.
1578
+ */
1579
+ private signErc3009;
1580
+ /**
1581
+ * Build the on-chain PaymentInfo tuple for contract calls.
1582
+ */
1583
+ private buildTuple;
1584
+ /**
1585
+ * AUTHORIZE: Lock funds in escrow via the facilitator.
1586
+ *
1587
+ * Sends an ERC-3009 ReceiveWithAuthorization to the facilitator,
1588
+ * which calls PaymentOperator.authorize() on-chain.
1589
+ */
1590
+ authorize(paymentInfo: AdvancedPaymentInfo): Promise<AdvancedAuthorizationResult>;
1591
+ /**
1592
+ * RELEASE: Capture escrowed funds to receiver (worker gets paid).
1593
+ *
1594
+ * Calls PaymentOperator.release() -> escrow.capture()
1595
+ *
1596
+ * @param paymentInfo - PaymentInfo from the authorize step
1597
+ * @param amount - Amount to release (defaults to maxAmount)
1598
+ */
1599
+ release(paymentInfo: AdvancedPaymentInfo, amount?: string): Promise<AdvancedTransactionResult>;
1600
+ /**
1601
+ * REFUND IN ESCROW: Return escrowed funds to payer (cancel task).
1602
+ *
1603
+ * Calls PaymentOperator.refundInEscrow() -> escrow.partialVoid()
1604
+ *
1605
+ * @param paymentInfo - PaymentInfo from the authorize step
1606
+ * @param amount - Amount to refund (defaults to maxAmount)
1607
+ */
1608
+ refundInEscrow(paymentInfo: AdvancedPaymentInfo, amount?: string): Promise<AdvancedTransactionResult>;
1609
+ /**
1610
+ * CHARGE: Direct instant payment (no escrow hold).
1611
+ *
1612
+ * Calls PaymentOperator.charge() -> escrow.charge()
1613
+ * Funds go directly from payer to receiver.
1614
+ *
1615
+ * @param paymentInfo - PaymentInfo with receiver and amount
1616
+ * @param amount - Amount to charge (defaults to maxAmount)
1617
+ */
1618
+ charge(paymentInfo: AdvancedPaymentInfo, amount?: string): Promise<AdvancedTransactionResult>;
1619
+ /**
1620
+ * REFUND POST ESCROW: Dispute refund after funds were released.
1621
+ *
1622
+ * Calls PaymentOperator.refundPostEscrow() -> escrow.refund()
1623
+ *
1624
+ * WARNING: NOT FUNCTIONAL IN PRODUCTION (as of 2026-02-03).
1625
+ * The protocol team has not implemented the required tokenCollector
1626
+ * contract. This call will fail on-chain.
1627
+ *
1628
+ * For dispute resolution, use refundInEscrow() instead: keep funds
1629
+ * in escrow and refund before releasing. This guarantees funds are
1630
+ * available and under arbiter control.
1631
+ *
1632
+ * Kept for future use when tokenCollector is implemented.
1633
+ *
1634
+ * @param paymentInfo - PaymentInfo from the original authorization
1635
+ * @param amount - Amount to refund (defaults to maxAmount)
1636
+ * @param tokenCollector - Address of token collector for refund sourcing
1637
+ * @param collectorData - Data for the token collector
1638
+ */
1639
+ refundPostEscrow(paymentInfo: AdvancedPaymentInfo, amount?: string, tokenCollector?: string, collectorData?: string): Promise<AdvancedTransactionResult>;
1640
+ }
1425
1641
 
1426
- export { type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, isEscrowExpired, parsePaymentHeader };
1642
+ export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, OPERATOR_ABI, PAYMENT_INFO_TYPEHASH, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_TIMINGS, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, isEscrowExpired, parsePaymentHeader };