@apitoll/shared 0.1.0-beta.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.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @apitoll/shared
2
+
3
+ Shared types, utilities, and constants for the [API Toll](https://apitoll.com) SDK ecosystem.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @apitoll/shared
9
+ ```
10
+
11
+ ## What's Included
12
+
13
+ - **Types** — `PaymentRequirement`, `PaymentReceipt`, `SellerConfig`, `AgentConfig`, `Policy`, `Transaction`, `ChainConfig`, and more
14
+ - **Utilities** — USDC unit conversion, route matching, fee calculation, budget checking, input validation, nonce tracking
15
+ - **Logger** — Structured JSON/pretty logger with child loggers and request/transaction logging
16
+ - **Constants** — Chain configs, plan limits, platform fee defaults, security headers
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import {
22
+ type PaymentRequirement,
23
+ type SellerConfig,
24
+ calculateFeeBreakdown,
25
+ getPlanLimits,
26
+ } from "@apitoll/shared";
27
+ ```
28
+
29
+ ## Part of API Toll
30
+
31
+ This package is used internally by:
32
+ - [`@apitoll/seller-sdk`](https://www.npmjs.com/package/@apitoll/seller-sdk) — Monetize any API with x402 micropayments
33
+ - [`@apitoll/buyer-sdk`](https://www.npmjs.com/package/@apitoll/buyer-sdk) — Give AI agents the ability to pay for APIs
34
+
35
+ Learn more at [apitoll.com](https://apitoll.com) | [GitHub](https://github.com/TasnidChain/APITOLL)
36
+
37
+ ## License
38
+
39
+ MIT
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+ export * from "./utils";
3
+ export * from "./logger";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+ export * from "./utils";
3
+ export * from "./logger";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Structured logging module for Apitoll.
3
+ * Outputs JSON logs in production, pretty logs in development.
4
+ * Compatible with common log aggregation tools (Datadog, Grafana, etc.)
5
+ */
6
+ export type LogLevel = "debug" | "info" | "warn" | "error";
7
+ export interface LogEntry {
8
+ timestamp: string;
9
+ level: LogLevel;
10
+ message: string;
11
+ service: string;
12
+ [key: string]: unknown;
13
+ }
14
+ export interface LoggerOptions {
15
+ service: string;
16
+ level?: LogLevel;
17
+ pretty?: boolean;
18
+ }
19
+ export declare class Logger {
20
+ private service;
21
+ private minLevel;
22
+ private pretty;
23
+ constructor(options: LoggerOptions);
24
+ debug(message: string, data?: Record<string, unknown>): void;
25
+ info(message: string, data?: Record<string, unknown>): void;
26
+ warn(message: string, data?: Record<string, unknown>): void;
27
+ error(message: string, data?: Record<string, unknown>): void;
28
+ /**
29
+ * Create a child logger with additional context fields.
30
+ */
31
+ child(context: Record<string, unknown>): ChildLogger;
32
+ /**
33
+ * Log a request/response cycle with timing.
34
+ */
35
+ request(method: string, path: string, status: number, durationMs: number, extra?: Record<string, unknown>): void;
36
+ /**
37
+ * Log a transaction event.
38
+ */
39
+ transaction(event: string, data: Record<string, unknown>): void;
40
+ private log;
41
+ }
42
+ declare class ChildLogger {
43
+ private parent;
44
+ private context;
45
+ constructor(parent: Logger, context: Record<string, unknown>);
46
+ debug(message: string, data?: Record<string, unknown>): void;
47
+ info(message: string, data?: Record<string, unknown>): void;
48
+ warn(message: string, data?: Record<string, unknown>): void;
49
+ error(message: string, data?: Record<string, unknown>): void;
50
+ }
51
+ /**
52
+ * Create a logger for a specific service.
53
+ */
54
+ export declare function createLogger(service: string, options?: Partial<LoggerOptions>): Logger;
55
+ export declare const loggers: {
56
+ sellerSdk: Logger;
57
+ buyerSdk: Logger;
58
+ indexer: Logger;
59
+ discovery: Logger;
60
+ dashboard: Logger;
61
+ billing: Logger;
62
+ platform: Logger;
63
+ };
64
+ export {};
65
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AASD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAU;gBAEZ,OAAO,EAAE,aAAa;IAMlC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI5D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI3D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI3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,aAAa,CAAC,GAAG,MAAM,CAKtF;AAGD,eAAO,MAAM,OAAO;;;;;;;;CAQnB,CAAC"}
package/dist/logger.js ADDED
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Structured logging module for Apitoll.
3
+ * Outputs JSON logs in production, pretty logs in development.
4
+ * Compatible with common log aggregation tools (Datadog, Grafana, etc.)
5
+ */
6
+ const LOG_LEVELS = {
7
+ debug: 0,
8
+ info: 1,
9
+ warn: 2,
10
+ error: 3,
11
+ };
12
+ export class Logger {
13
+ service;
14
+ minLevel;
15
+ pretty;
16
+ constructor(options) {
17
+ this.service = options.service;
18
+ this.minLevel = LOG_LEVELS[options.level ?? "info"];
19
+ this.pretty = options.pretty ?? process.env.NODE_ENV !== "production";
20
+ }
21
+ debug(message, data) {
22
+ this.log("debug", message, data);
23
+ }
24
+ info(message, data) {
25
+ this.log("info", message, data);
26
+ }
27
+ warn(message, data) {
28
+ this.log("warn", message, data);
29
+ }
30
+ error(message, data) {
31
+ this.log("error", message, data);
32
+ }
33
+ /**
34
+ * Create a child logger with additional context fields.
35
+ */
36
+ child(context) {
37
+ return new ChildLogger(this, context);
38
+ }
39
+ /**
40
+ * Log a request/response cycle with timing.
41
+ */
42
+ request(method, path, status, durationMs, extra) {
43
+ const level = status >= 500 ? "error" : status >= 400 ? "warn" : "info";
44
+ this.log(level, `${method} ${path} ${status}`, {
45
+ method,
46
+ path,
47
+ status,
48
+ durationMs,
49
+ ...extra,
50
+ });
51
+ }
52
+ /**
53
+ * Log a transaction event.
54
+ */
55
+ transaction(event, data) {
56
+ this.info(`tx:${event}`, { ...data, category: "transaction" });
57
+ }
58
+ log(level, message, data) {
59
+ if (LOG_LEVELS[level] < this.minLevel)
60
+ return;
61
+ const entry = {
62
+ timestamp: new Date().toISOString(),
63
+ level,
64
+ message,
65
+ service: this.service,
66
+ ...data,
67
+ };
68
+ if (this.pretty) {
69
+ const color = level === "error" ? "\x1b[31m" : level === "warn" ? "\x1b[33m" : level === "debug" ? "\x1b[90m" : "\x1b[36m";
70
+ const reset = "\x1b[0m";
71
+ const dataStr = data && Object.keys(data).length > 0 ? ` ${JSON.stringify(data)}` : "";
72
+ const output = `${color}[${this.service}] ${level.toUpperCase()}${reset} ${message}${dataStr}`;
73
+ if (level === "error") {
74
+ console.error(output);
75
+ }
76
+ else if (level === "warn") {
77
+ console.warn(output);
78
+ }
79
+ else {
80
+ console.log(output);
81
+ }
82
+ }
83
+ else {
84
+ // Structured JSON for production
85
+ const output = JSON.stringify(entry);
86
+ if (level === "error") {
87
+ console.error(output);
88
+ }
89
+ else {
90
+ console.log(output);
91
+ }
92
+ }
93
+ }
94
+ }
95
+ class ChildLogger {
96
+ parent;
97
+ context;
98
+ constructor(parent, context) {
99
+ this.parent = parent;
100
+ this.context = context;
101
+ }
102
+ debug(message, data) {
103
+ this.parent.debug(message, { ...this.context, ...data });
104
+ }
105
+ info(message, data) {
106
+ this.parent.info(message, { ...this.context, ...data });
107
+ }
108
+ warn(message, data) {
109
+ this.parent.warn(message, { ...this.context, ...data });
110
+ }
111
+ error(message, data) {
112
+ this.parent.error(message, { ...this.context, ...data });
113
+ }
114
+ }
115
+ /**
116
+ * Create a logger for a specific service.
117
+ */
118
+ export function createLogger(service, options) {
119
+ return new Logger({
120
+ service,
121
+ ...options,
122
+ });
123
+ }
124
+ // Pre-configured loggers for common services
125
+ export const loggers = {
126
+ sellerSdk: createLogger("seller-sdk"),
127
+ buyerSdk: createLogger("buyer-sdk"),
128
+ indexer: createLogger("indexer"),
129
+ discovery: createLogger("discovery"),
130
+ dashboard: createLogger("dashboard"),
131
+ billing: createLogger("billing"),
132
+ platform: createLogger("platform"),
133
+ };
134
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,MAAM,UAAU,GAA6B;IAC3C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAA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OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,IAA8B;QACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,OAAgC;IAC5E,OAAO,IAAI,MAAM,CAAC;QAChB,OAAO;QACP,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,SAAS,EAAE,YAAY,CAAC,YAAY,CAAC;IACrC,QAAQ,EAAE,YAAY,CAAC,WAAW,CAAC;IACnC,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC;IAChC,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC;IACpC,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC;IACpC,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC;IAChC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC;CACnC,CAAC"}
@@ -0,0 +1,268 @@
1
+ export type SupportedChain = "base" | "solana";
2
+ export type ChainConfig = {
3
+ chain: SupportedChain;
4
+ /** CAIP-2 network identifier (e.g., "eip155:8453" for Base, "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" for Solana mainnet) */
5
+ networkId: string;
6
+ /** RPC endpoint URL */
7
+ rpcUrl: string;
8
+ /** USDC contract/mint address */
9
+ usdcAddress: string;
10
+ /** x402 facilitator URL */
11
+ facilitatorUrl: string;
12
+ };
13
+ export declare const DEFAULT_CHAIN_CONFIGS: Record<SupportedChain, ChainConfig>;
14
+ export type PaymentScheme = "exact";
15
+ export interface PaymentRequirement {
16
+ /** Scheme for payment (currently only "exact") */
17
+ scheme: PaymentScheme;
18
+ /** CAIP-2 network identifier */
19
+ network: string;
20
+ /** Maximum amount in smallest unit (e.g., USDC has 6 decimals) */
21
+ maxAmountRequired: string;
22
+ /** Resource description */
23
+ description?: string;
24
+ /** Payment recipient address */
25
+ payTo: string;
26
+ /** Token/asset contract address */
27
+ asset: string;
28
+ /** Extra metadata */
29
+ extra?: Record<string, unknown>;
30
+ }
31
+ export interface PaymentPayload {
32
+ /** Base64-encoded signed payment data */
33
+ payload: string;
34
+ /** Payment scheme used */
35
+ scheme: PaymentScheme;
36
+ /** CAIP-2 network */
37
+ network: string;
38
+ }
39
+ export interface PaymentReceipt {
40
+ /** On-chain transaction hash */
41
+ txHash: string;
42
+ /** Chain the payment settled on */
43
+ chain: SupportedChain;
44
+ /** Amount in USDC (human-readable, e.g., "0.005") */
45
+ amount: string;
46
+ /** Payer wallet address */
47
+ from: string;
48
+ /** Recipient wallet address */
49
+ to: string;
50
+ /** ISO timestamp */
51
+ timestamp: string;
52
+ /** Block number (EVM) or slot (Solana) */
53
+ blockNumber?: number;
54
+ }
55
+ export interface EndpointConfig {
56
+ /** Price in USDC (human-readable, e.g., "0.005") */
57
+ price: string;
58
+ /** Supported chains */
59
+ chains: SupportedChain[];
60
+ /** Human-readable description of what this endpoint does */
61
+ description: string;
62
+ /** USDC currency (always USDC for now) */
63
+ currency?: "USDC";
64
+ /** Optional JSON schema for input */
65
+ inputSchema?: Record<string, unknown>;
66
+ /** Optional JSON schema for output */
67
+ outputSchema?: Record<string, unknown>;
68
+ }
69
+ export type EndpointRegistry = Record<string, EndpointConfig>;
70
+ export type TransactionStatus = "pending" | "settled" | "failed" | "refunded";
71
+ export interface Transaction {
72
+ /** Unique transaction ID (platform-generated) */
73
+ id: string;
74
+ /** On-chain tx hash */
75
+ txHash: string;
76
+ /** Agent wallet address (payer) */
77
+ agentAddress: string;
78
+ /** Agent ID (platform-level) */
79
+ agentId?: string;
80
+ /** Seller ID */
81
+ sellerId: string;
82
+ /** Endpoint that was called */
83
+ endpoint: string;
84
+ /** HTTP method */
85
+ method: string;
86
+ /** Amount in USDC */
87
+ amount: string;
88
+ /** Chain used */
89
+ chain: SupportedChain;
90
+ /** Current status */
91
+ status: TransactionStatus;
92
+ /** ISO timestamp of request */
93
+ requestedAt: string;
94
+ /** ISO timestamp of settlement */
95
+ settledAt?: string;
96
+ /** Response status code */
97
+ responseStatus?: number;
98
+ /** Latency in ms */
99
+ latencyMs?: number;
100
+ }
101
+ export type PolicyType = "budget" | "vendor_acl" | "rate_limit";
102
+ export interface BudgetPolicy {
103
+ type: "budget";
104
+ /** Max USDC per day */
105
+ dailyCap: number;
106
+ /** Max USDC per week */
107
+ weeklyCap?: number;
108
+ /** Max USDC per single request */
109
+ maxPerRequest: number;
110
+ }
111
+ export interface VendorAclPolicy {
112
+ type: "vendor_acl";
113
+ /** Allowed seller IDs or "*" for all */
114
+ allowedVendors: string[];
115
+ /** Blocked seller IDs */
116
+ blockedVendors?: string[];
117
+ }
118
+ export interface RateLimitPolicy {
119
+ type: "rate_limit";
120
+ /** Max requests per minute */
121
+ maxPerMinute: number;
122
+ /** Max requests per hour */
123
+ maxPerHour?: number;
124
+ }
125
+ export type Policy = BudgetPolicy | VendorAclPolicy | RateLimitPolicy;
126
+ export interface AgentConfig {
127
+ /** Agent name */
128
+ name: string;
129
+ /** Primary chain */
130
+ chain: SupportedChain;
131
+ /** Policies to enforce */
132
+ policies: Policy[];
133
+ /** Optional: pre-funded wallet private key (hex or base58) */
134
+ privateKey?: string;
135
+ /** Optional: webhook URL for transaction notifications */
136
+ webhookUrl?: string;
137
+ }
138
+ export interface AgentWallet {
139
+ /** Platform agent ID */
140
+ id: string;
141
+ /** Agent name */
142
+ name: string;
143
+ /** Wallet address */
144
+ address: string;
145
+ /** Primary chain */
146
+ chain: SupportedChain;
147
+ /** Current USDC balance */
148
+ balance: string;
149
+ /** Active policies */
150
+ policies: Policy[];
151
+ /** Created timestamp */
152
+ createdAt: string;
153
+ }
154
+ export interface PlatformFeeConfig {
155
+ /** Fee in basis points (100 = 1%, 300 = 3%) */
156
+ feeBps: number;
157
+ /** Platform wallet address for receiving fees on Base */
158
+ platformWalletBase?: string;
159
+ /** Platform wallet address for receiving fees on Solana */
160
+ platformWalletSolana?: string;
161
+ }
162
+ export interface FeeBreakdown {
163
+ /** Total amount charged to buyer */
164
+ totalAmount: string;
165
+ /** Amount going to seller */
166
+ sellerAmount: string;
167
+ /** Amount going to platform */
168
+ platformFee: string;
169
+ /** Fee in basis points */
170
+ feeBps: number;
171
+ }
172
+ export type PlanTier = "free" | "pro" | "enterprise";
173
+ export interface PlanLimits {
174
+ /** Max API calls per day */
175
+ maxCallsPerDay: number;
176
+ /** Max agents allowed */
177
+ maxAgents: number;
178
+ /** Max sellers (endpoints) allowed */
179
+ maxSellers: number;
180
+ /** Analytics retention in days */
181
+ analyticsRetentionDays: number;
182
+ /** Whether webhooks are enabled */
183
+ webhooksEnabled: boolean;
184
+ /** Whether premium analytics are enabled */
185
+ premiumAnalytics: boolean;
186
+ /** Whether featured listings are allowed */
187
+ featuredListings: boolean;
188
+ /** Custom policies allowed */
189
+ customPolicies: boolean;
190
+ }
191
+ export declare const PLAN_LIMITS: Record<PlanTier, PlanLimits>;
192
+ export type DisputeStatus = "open" | "under_review" | "resolved" | "rejected";
193
+ export type DisputeResolution = "refunded" | "partial_refund" | "denied";
194
+ export interface Dispute {
195
+ /** Unique dispute ID */
196
+ id: string;
197
+ /** Transaction ID being disputed */
198
+ transactionId: string;
199
+ /** Organization filing the dispute */
200
+ orgId: string;
201
+ /** Reason for dispute */
202
+ reason: string;
203
+ /** Current status */
204
+ status: DisputeStatus;
205
+ /** Resolution (if resolved) */
206
+ resolution?: DisputeResolution;
207
+ /** Refund amount (if applicable) */
208
+ refundAmount?: string;
209
+ /** Admin notes */
210
+ notes?: string;
211
+ /** ISO timestamps */
212
+ createdAt: string;
213
+ resolvedAt?: string;
214
+ }
215
+ export interface SellerConfig {
216
+ /** Seller wallet address for receiving payments */
217
+ walletAddress: string;
218
+ /** Endpoint pricing registry */
219
+ endpoints: EndpointRegistry;
220
+ /** Chain configs (uses defaults if not provided) */
221
+ chainConfigs?: Partial<Record<SupportedChain, Partial<ChainConfig>>>;
222
+ /** Facilitator URL override */
223
+ facilitatorUrl?: string;
224
+ /** Webhook URL for transaction events */
225
+ webhookUrl?: string;
226
+ /** Platform API key for analytics reporting */
227
+ platformApiKey?: string;
228
+ /** Platform fee configuration */
229
+ platformFee?: PlatformFeeConfig;
230
+ }
231
+ export interface SpendSummary {
232
+ /** Time period */
233
+ period: "1h" | "24h" | "7d" | "30d";
234
+ /** Total USDC spent */
235
+ totalSpend: string;
236
+ /** Number of transactions */
237
+ transactionCount: number;
238
+ /** Breakdown by chain */
239
+ byChain: Record<SupportedChain, {
240
+ spend: string;
241
+ count: number;
242
+ }>;
243
+ /** Breakdown by seller */
244
+ bySeller: Record<string, {
245
+ spend: string;
246
+ count: number;
247
+ }>;
248
+ /** Average cost per request */
249
+ avgCostPerRequest: string;
250
+ }
251
+ export type EventType = "transaction.created" | "transaction.settled" | "transaction.failed" | "budget.threshold" | "budget.exceeded" | "agent.low_balance";
252
+ export interface PlatformEvent {
253
+ type: EventType;
254
+ timestamp: string;
255
+ data: Transaction | {
256
+ agentId: string;
257
+ message: string;
258
+ };
259
+ }
260
+ export interface ApiResponse<T> {
261
+ success: boolean;
262
+ data?: T;
263
+ error?: {
264
+ code: string;
265
+ message: string;
266
+ };
267
+ }
268
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB,6HAA6H;IAC7H,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACj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AAID,MAAM,MAAM,SAAS,GACjB,qBAAqB,GACrB,qBAAqB,GACrB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,CAAC;AAExB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,WAAW,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1D;AAID,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
package/dist/types.js ADDED
@@ -0,0 +1,50 @@
1
+ // ─── Chain & Network Types ──────────────────────────────────────
2
+ export const DEFAULT_CHAIN_CONFIGS = {
3
+ base: {
4
+ chain: "base",
5
+ networkId: "eip155:8453",
6
+ rpcUrl: "https://mainnet.base.org",
7
+ usdcAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
8
+ facilitatorUrl: "https://x402.org/facilitator",
9
+ },
10
+ solana: {
11
+ chain: "solana",
12
+ networkId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
13
+ rpcUrl: "https://api.mainnet-beta.solana.com",
14
+ usdcAddress: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
15
+ facilitatorUrl: "https://x402.org/facilitator",
16
+ },
17
+ };
18
+ export const PLAN_LIMITS = {
19
+ free: {
20
+ maxCallsPerDay: 1000,
21
+ maxAgents: 1,
22
+ maxSellers: 2,
23
+ analyticsRetentionDays: 7,
24
+ webhooksEnabled: false,
25
+ premiumAnalytics: false,
26
+ featuredListings: false,
27
+ customPolicies: false,
28
+ },
29
+ pro: {
30
+ maxCallsPerDay: 100_000,
31
+ maxAgents: 10,
32
+ maxSellers: 25,
33
+ analyticsRetentionDays: 90,
34
+ webhooksEnabled: true,
35
+ premiumAnalytics: true,
36
+ featuredListings: true,
37
+ customPolicies: true,
38
+ },
39
+ enterprise: {
40
+ maxCallsPerDay: Infinity,
41
+ maxAgents: Infinity,
42
+ maxSellers: Infinity,
43
+ analyticsRetentionDays: 365,
44
+ webhooksEnabled: true,
45
+ premiumAnalytics: true,
46
+ featuredListings: true,
47
+ customPolicies: true,
48
+ },
49
+ };
50
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAgBnE,MAAM,CAAC,MAAM,qBAAqB,GAAwC;IACxE,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,aAAa;QACxB,MAAM,EAAE,0BAA0B;QAClC,WAAW,EAAE,4CAA4C;QACzD,cAAc,EAAE,8BAA8B;KAC/C;IACD,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,SAAS,EAAE,yCAAyC;QACpD,MAAM,EAAE,qCAAqC;QAC7C,WAAW,EAAE,8CAA8C;QAC3D,cAAc,EAAE,8BAA8B;KAC/C;CACF,CAAC;AAoNF,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,IAAI,EAAE;QACJ,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,CAAC;QACb,sBAAsB,EAAE,CAAC;QACzB,eAAe,EAAE,KAAK;QACtB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE,KAAK;QACvB,cAAc,EAAE,KAAK;KACtB;IACD,GAAG,EAAE;QACH,cAAc,EAAE,OAAO;QACvB,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,EAAE;QACd,sBAAsB,EAAE,EAAE;QAC1B,eAAe,EAAE,IAAI;QACrB,gBAAgB,EAAE,IAAI;QACtB,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,IAAI;KACrB;IACD,UAAU,EAAE;QACV,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,QAAQ;QACpB,sBAAsB,EAAE,GAAG;QAC3B,eAAe,EAAE,IAAI;QACrB,gBAAgB,EAAE,IAAI;QACtB,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,IAAI;KACrB;CACF,CAAC"}