@agentcash/router 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1636 -1420
- package/dist/index.d.cts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +1636 -1420
- package/package.json +1 -1
- package/dist/client/index.cjs +0 -94
- package/dist/client/index.d.cts +0 -86
- package/dist/client/index.d.ts +0 -86
- package/dist/client/index.js +0 -56
- package/dist/siwx-BMlja_nt.d.cts +0 -9
- package/dist/siwx-BMlja_nt.d.ts +0 -9
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,6 @@ import { ZodType } from 'zod';
|
|
|
4
4
|
import { Store } from 'mppx';
|
|
5
5
|
import { PaymentRequirements, PaymentRequired, SettleResponse, Network } from '@x402/core/types';
|
|
6
6
|
import * as viem from 'viem';
|
|
7
|
-
export { S as SIWX_ERROR_MESSAGES, a as SiwxErrorCode } from './siwx-BMlja_nt.cjs';
|
|
8
7
|
|
|
9
8
|
interface EntitlementStore {
|
|
10
9
|
has(route: string, wallet: string): Promise<boolean>;
|
|
@@ -520,7 +519,7 @@ interface ResolvedX402Facilitator {
|
|
|
520
519
|
config: X402RouterFacilitatorConfig;
|
|
521
520
|
}
|
|
522
521
|
|
|
523
|
-
interface
|
|
522
|
+
interface RouterDeps {
|
|
524
523
|
x402Server: X402Server | null;
|
|
525
524
|
initPromise: Promise<void>;
|
|
526
525
|
x402InitError?: string;
|
|
@@ -547,6 +546,9 @@ interface OrchestrateDeps {
|
|
|
547
546
|
tempoClient?: viem.Client | null;
|
|
548
547
|
}
|
|
549
548
|
|
|
549
|
+
/** @deprecated alias kept for downstream consumers; use `RouterDeps`. */
|
|
550
|
+
type OrchestrateDeps = RouterDeps;
|
|
551
|
+
|
|
550
552
|
type True = true;
|
|
551
553
|
type False = false;
|
|
552
554
|
/**
|
|
@@ -747,6 +749,14 @@ declare function x402AcceptsFromEnv(env: RouterEnv, options?: {
|
|
|
747
749
|
}): X402AcceptConfig[];
|
|
748
750
|
declare function paidOptionsForProtocols(protocols: readonly ProtocolType[]): PaidOptions;
|
|
749
751
|
|
|
752
|
+
/**
|
|
753
|
+
* SIWX verification error codes.
|
|
754
|
+
* Enables clients to auto-retry transient failures (e.g., expired challenge).
|
|
755
|
+
*/
|
|
756
|
+
type SiwxErrorCode = 'siwx_missing_header' | 'siwx_malformed' | 'siwx_expired' | 'siwx_nonce_used' | 'siwx_invalid_signature';
|
|
757
|
+
/** Human-readable error messages for each SIWX error code. */
|
|
758
|
+
declare const SIWX_ERROR_MESSAGES: Record<SiwxErrorCode, string>;
|
|
759
|
+
|
|
750
760
|
interface MonitorEntry {
|
|
751
761
|
provider: string;
|
|
752
762
|
route: string;
|
|
@@ -767,4 +777,4 @@ declare function createRouter<const P extends Record<string, string> = Record<ne
|
|
|
767
777
|
prices?: P;
|
|
768
778
|
}): ServiceRouter<Extract<keyof P, string>>;
|
|
769
779
|
|
|
770
|
-
export { type AlertEvent, type AlertFn, type AlertLevel, type AuthEvent, type AuthMode, BASE_NETWORK, type DiscoveryConfig, type EntitlementStore, type ErrorEvent, type HandlerContext, type HandlerPaymentContext, HttpError, MemoryEntitlementStore, MemoryNonceStore, type MonitorEntry, type MppProtocolInfo, type NonceStore, type OveragePolicy, type PaidOptions, type PayToConfig, type PaymentEvent, type PaymentStatus, type PluginContext, type PricingConfig, type ProtocolType, type ProviderConfig, type ProviderQuotaEvent, type QuotaInfo, type QuotaLevel, type RedisEntitlementStoreOptions, type RedisNonceStoreOptions, type RequestMeta, type ResponseMeta, RouteBuilder, type RouteEntry, RouteRegistry, type RouterConfig, RouterConfigError, type RouterConfigIssue, type RouterConfigIssueCode, type RouterConfigValidationOptions, type RouterEnv, type RouterPlugin, SIWX_CHALLENGE_EXPIRY_MS, SOLANA_MAINNET_NETWORK, type ServiceRouter, type SettledHandlerErrorContext, type SettlementErrorContext, type SettlementEvent, type SettlementLifecycle, type SettlementLifecycleContext, type SettlementSettledContext, TEMPO_USDC_CURRENCY, type TierConfig, type X402AcceptConfig, type X402FacilitatorTarget, type X402FacilitatorsConfig, type X402ResolvedAccept, type X402RouterFacilitatorConfig, type X402Server, ZERO_EVM_ADDRESS, consolePlugin, createRedisEntitlementStore, createRedisNonceStore, createRouter, formatRouterConfigIssues, getRouterConfigIssues, mppFromEnv, paidOptionsForProtocols, validateRouterConfig, x402AcceptsFromEnv };
|
|
780
|
+
export { type AlertEvent, type AlertFn, type AlertLevel, type AuthEvent, type AuthMode, BASE_NETWORK, type DiscoveryConfig, type EntitlementStore, type ErrorEvent, type HandlerContext, type HandlerPaymentContext, HttpError, MemoryEntitlementStore, MemoryNonceStore, type MonitorEntry, type MppProtocolInfo, type NonceStore, type OveragePolicy, type PaidOptions, type PayToConfig, type PaymentEvent, type PaymentStatus, type PluginContext, type PricingConfig, type ProtocolType, type ProviderConfig, type ProviderQuotaEvent, type QuotaInfo, type QuotaLevel, type RedisEntitlementStoreOptions, type RedisNonceStoreOptions, type RequestMeta, type ResponseMeta, RouteBuilder, type RouteEntry, RouteRegistry, type RouterConfig, RouterConfigError, type RouterConfigIssue, type RouterConfigIssueCode, type RouterConfigValidationOptions, type RouterEnv, type RouterPlugin, SIWX_CHALLENGE_EXPIRY_MS, SIWX_ERROR_MESSAGES, SOLANA_MAINNET_NETWORK, type ServiceRouter, type SettledHandlerErrorContext, type SettlementErrorContext, type SettlementEvent, type SettlementLifecycle, type SettlementLifecycleContext, type SettlementSettledContext, type SiwxErrorCode, TEMPO_USDC_CURRENCY, type TierConfig, type X402AcceptConfig, type X402FacilitatorTarget, type X402FacilitatorsConfig, type X402ResolvedAccept, type X402RouterFacilitatorConfig, type X402Server, ZERO_EVM_ADDRESS, consolePlugin, createRedisEntitlementStore, createRedisNonceStore, createRouter, formatRouterConfigIssues, getRouterConfigIssues, mppFromEnv, paidOptionsForProtocols, validateRouterConfig, x402AcceptsFromEnv };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { ZodType } from 'zod';
|
|
|
4
4
|
import { Store } from 'mppx';
|
|
5
5
|
import { PaymentRequirements, PaymentRequired, SettleResponse, Network } from '@x402/core/types';
|
|
6
6
|
import * as viem from 'viem';
|
|
7
|
-
export { S as SIWX_ERROR_MESSAGES, a as SiwxErrorCode } from './siwx-BMlja_nt.js';
|
|
8
7
|
|
|
9
8
|
interface EntitlementStore {
|
|
10
9
|
has(route: string, wallet: string): Promise<boolean>;
|
|
@@ -520,7 +519,7 @@ interface ResolvedX402Facilitator {
|
|
|
520
519
|
config: X402RouterFacilitatorConfig;
|
|
521
520
|
}
|
|
522
521
|
|
|
523
|
-
interface
|
|
522
|
+
interface RouterDeps {
|
|
524
523
|
x402Server: X402Server | null;
|
|
525
524
|
initPromise: Promise<void>;
|
|
526
525
|
x402InitError?: string;
|
|
@@ -547,6 +546,9 @@ interface OrchestrateDeps {
|
|
|
547
546
|
tempoClient?: viem.Client | null;
|
|
548
547
|
}
|
|
549
548
|
|
|
549
|
+
/** @deprecated alias kept for downstream consumers; use `RouterDeps`. */
|
|
550
|
+
type OrchestrateDeps = RouterDeps;
|
|
551
|
+
|
|
550
552
|
type True = true;
|
|
551
553
|
type False = false;
|
|
552
554
|
/**
|
|
@@ -747,6 +749,14 @@ declare function x402AcceptsFromEnv(env: RouterEnv, options?: {
|
|
|
747
749
|
}): X402AcceptConfig[];
|
|
748
750
|
declare function paidOptionsForProtocols(protocols: readonly ProtocolType[]): PaidOptions;
|
|
749
751
|
|
|
752
|
+
/**
|
|
753
|
+
* SIWX verification error codes.
|
|
754
|
+
* Enables clients to auto-retry transient failures (e.g., expired challenge).
|
|
755
|
+
*/
|
|
756
|
+
type SiwxErrorCode = 'siwx_missing_header' | 'siwx_malformed' | 'siwx_expired' | 'siwx_nonce_used' | 'siwx_invalid_signature';
|
|
757
|
+
/** Human-readable error messages for each SIWX error code. */
|
|
758
|
+
declare const SIWX_ERROR_MESSAGES: Record<SiwxErrorCode, string>;
|
|
759
|
+
|
|
750
760
|
interface MonitorEntry {
|
|
751
761
|
provider: string;
|
|
752
762
|
route: string;
|
|
@@ -767,4 +777,4 @@ declare function createRouter<const P extends Record<string, string> = Record<ne
|
|
|
767
777
|
prices?: P;
|
|
768
778
|
}): ServiceRouter<Extract<keyof P, string>>;
|
|
769
779
|
|
|
770
|
-
export { type AlertEvent, type AlertFn, type AlertLevel, type AuthEvent, type AuthMode, BASE_NETWORK, type DiscoveryConfig, type EntitlementStore, type ErrorEvent, type HandlerContext, type HandlerPaymentContext, HttpError, MemoryEntitlementStore, MemoryNonceStore, type MonitorEntry, type MppProtocolInfo, type NonceStore, type OveragePolicy, type PaidOptions, type PayToConfig, type PaymentEvent, type PaymentStatus, type PluginContext, type PricingConfig, type ProtocolType, type ProviderConfig, type ProviderQuotaEvent, type QuotaInfo, type QuotaLevel, type RedisEntitlementStoreOptions, type RedisNonceStoreOptions, type RequestMeta, type ResponseMeta, RouteBuilder, type RouteEntry, RouteRegistry, type RouterConfig, RouterConfigError, type RouterConfigIssue, type RouterConfigIssueCode, type RouterConfigValidationOptions, type RouterEnv, type RouterPlugin, SIWX_CHALLENGE_EXPIRY_MS, SOLANA_MAINNET_NETWORK, type ServiceRouter, type SettledHandlerErrorContext, type SettlementErrorContext, type SettlementEvent, type SettlementLifecycle, type SettlementLifecycleContext, type SettlementSettledContext, TEMPO_USDC_CURRENCY, type TierConfig, type X402AcceptConfig, type X402FacilitatorTarget, type X402FacilitatorsConfig, type X402ResolvedAccept, type X402RouterFacilitatorConfig, type X402Server, ZERO_EVM_ADDRESS, consolePlugin, createRedisEntitlementStore, createRedisNonceStore, createRouter, formatRouterConfigIssues, getRouterConfigIssues, mppFromEnv, paidOptionsForProtocols, validateRouterConfig, x402AcceptsFromEnv };
|
|
780
|
+
export { type AlertEvent, type AlertFn, type AlertLevel, type AuthEvent, type AuthMode, BASE_NETWORK, type DiscoveryConfig, type EntitlementStore, type ErrorEvent, type HandlerContext, type HandlerPaymentContext, HttpError, MemoryEntitlementStore, MemoryNonceStore, type MonitorEntry, type MppProtocolInfo, type NonceStore, type OveragePolicy, type PaidOptions, type PayToConfig, type PaymentEvent, type PaymentStatus, type PluginContext, type PricingConfig, type ProtocolType, type ProviderConfig, type ProviderQuotaEvent, type QuotaInfo, type QuotaLevel, type RedisEntitlementStoreOptions, type RedisNonceStoreOptions, type RequestMeta, type ResponseMeta, RouteBuilder, type RouteEntry, RouteRegistry, type RouterConfig, RouterConfigError, type RouterConfigIssue, type RouterConfigIssueCode, type RouterConfigValidationOptions, type RouterEnv, type RouterPlugin, SIWX_CHALLENGE_EXPIRY_MS, SIWX_ERROR_MESSAGES, SOLANA_MAINNET_NETWORK, type ServiceRouter, type SettledHandlerErrorContext, type SettlementErrorContext, type SettlementEvent, type SettlementLifecycle, type SettlementLifecycleContext, type SettlementSettledContext, type SiwxErrorCode, TEMPO_USDC_CURRENCY, type TierConfig, type X402AcceptConfig, type X402FacilitatorTarget, type X402FacilitatorsConfig, type X402ResolvedAccept, type X402RouterFacilitatorConfig, type X402Server, ZERO_EVM_ADDRESS, consolePlugin, createRedisEntitlementStore, createRedisNonceStore, createRouter, formatRouterConfigIssues, getRouterConfigIssues, mppFromEnv, paidOptionsForProtocols, validateRouterConfig, x402AcceptsFromEnv };
|