x402-stellar-sdk 1.0.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.
- package/dist/chunk-6Q22RJI6.js +38 -0
- package/dist/chunk-CBSQ4354.js +38 -0
- package/dist/chunk-FRGC7Q3Z.js +50 -0
- package/dist/chunk-UFTMXLKQ.js +27 -0
- package/dist/client/index.d.ts +32 -0
- package/dist/client/index.js +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17 -0
- package/dist/server/hono.d.ts +20 -0
- package/dist/server/hono.js +27 -0
- package/dist/server/index.d.ts +57 -0
- package/dist/server/index.js +16 -0
- package/dist/server/next.d.ts +13 -0
- package/dist/server/next.js +22 -0
- package/dist/types-CibbvCHY.d.ts +32 -0
- package/dist/verify-YIB2KFUK.js +6 -0
- package/package.json +55 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// src/client/index.ts
|
|
2
|
+
function parse402Response(response) {
|
|
3
|
+
if (response.status !== 402) return null;
|
|
4
|
+
const amount = response.headers.get("x-402-amount") ?? response.headers.get("X-402-Amount");
|
|
5
|
+
const assetCode = response.headers.get("x-402-asset-code") ?? response.headers.get("X-402-Asset-Code");
|
|
6
|
+
const network = response.headers.get("x-402-network") ?? response.headers.get("X-402-Network");
|
|
7
|
+
const destination = response.headers.get("x-402-destination") ?? response.headers.get("X-402-Destination");
|
|
8
|
+
const issuer = response.headers.get("x-402-issuer") ?? response.headers.get("X-402-Issuer") ?? void 0;
|
|
9
|
+
const memo = response.headers.get("x-402-memo") ?? response.headers.get("X-402-Memo") ?? void 0;
|
|
10
|
+
if (!amount || !assetCode || !network || !destination) return null;
|
|
11
|
+
return { amount, assetCode, network, destination, ...issuer && { issuer }, ...memo && { memo } };
|
|
12
|
+
}
|
|
13
|
+
function addPaymentHeaders(headers, payment) {
|
|
14
|
+
const h = new Headers(headers);
|
|
15
|
+
h.set("X-402-Transaction-Hash", payment.transactionHash);
|
|
16
|
+
if (payment.timestamp) h.set("X-402-Timestamp", payment.timestamp);
|
|
17
|
+
return h;
|
|
18
|
+
}
|
|
19
|
+
async function x402Fetch(input, init, options) {
|
|
20
|
+
const res = await fetch(input, init);
|
|
21
|
+
const paymentRequest = parse402Response(res);
|
|
22
|
+
if (!paymentRequest) return res;
|
|
23
|
+
const payWithStellar = options?.payWithStellar;
|
|
24
|
+
if (!payWithStellar) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
"402 Payment Required. Provide x402Fetch(..., { payWithStellar }) to handle Stellar payments."
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
const payment = await payWithStellar(paymentRequest);
|
|
30
|
+
if (!payment) return res;
|
|
31
|
+
const newHeaders = addPaymentHeaders(init?.headers ?? {}, payment);
|
|
32
|
+
const retryInit = { ...init, headers: newHeaders };
|
|
33
|
+
return fetch(input, retryInit);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
x402Fetch
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// src/server/middleware.ts
|
|
2
|
+
function createPaymentRequiredResponse(options) {
|
|
3
|
+
const headers = {
|
|
4
|
+
"Content-Type": "application/json",
|
|
5
|
+
"X-402-Amount": options.price,
|
|
6
|
+
"X-402-Asset-Code": options.assetCode,
|
|
7
|
+
"X-402-Network": options.network,
|
|
8
|
+
"X-402-Destination": options.destination
|
|
9
|
+
};
|
|
10
|
+
if (options.issuer) headers["X-402-Issuer"] = options.issuer;
|
|
11
|
+
if (options.memo) headers["X-402-Memo"] = options.memo;
|
|
12
|
+
return {
|
|
13
|
+
status: 402,
|
|
14
|
+
headers,
|
|
15
|
+
body: {
|
|
16
|
+
error: "Payment Required",
|
|
17
|
+
amount: options.price,
|
|
18
|
+
assetCode: options.assetCode,
|
|
19
|
+
...options.issuer && { issuer: options.issuer },
|
|
20
|
+
network: options.network,
|
|
21
|
+
destination: options.destination,
|
|
22
|
+
...options.memo && { memo: options.memo }
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async function processPaymentMiddleware(requestHeaders, options) {
|
|
27
|
+
const txHash = requestHeaders["x-402-transaction-hash"] ?? requestHeaders["X-402-Transaction-Hash"];
|
|
28
|
+
if (!txHash?.trim()) return { allowed: false };
|
|
29
|
+
const { verifyPaymentOnChain } = await import("./verify-YIB2KFUK.js");
|
|
30
|
+
const { valid, error } = await verifyPaymentOnChain(txHash.trim(), options);
|
|
31
|
+
if (!valid) return { allowed: false };
|
|
32
|
+
return { allowed: true };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
createPaymentRequiredResponse,
|
|
37
|
+
processPaymentMiddleware
|
|
38
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/server/verify.ts
|
|
2
|
+
var HORIZON = {
|
|
3
|
+
testnet: "https://horizon-testnet.stellar.org",
|
|
4
|
+
mainnet: "https://horizon.stellar.org"
|
|
5
|
+
};
|
|
6
|
+
function decodeMemo(memoType, memoValue) {
|
|
7
|
+
if (memoType !== "text" || !memoValue) return null;
|
|
8
|
+
try {
|
|
9
|
+
const base64 = memoValue.replace(/-/g, "+").replace(/_/g, "/");
|
|
10
|
+
if (typeof Buffer !== "undefined") return Buffer.from(base64, "base64").toString("utf8");
|
|
11
|
+
return atob(base64);
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function verifyPaymentOnChain(txHash, options) {
|
|
17
|
+
const base = HORIZON[options.network];
|
|
18
|
+
let tx;
|
|
19
|
+
try {
|
|
20
|
+
const res = await fetch(`${base}/transactions/${txHash}`);
|
|
21
|
+
if (!res.ok) return { valid: false, error: `Horizon ${res.status}: ${await res.text()}` };
|
|
22
|
+
tx = await res.json();
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return { valid: false, error: e instanceof Error ? e.message : "Failed to fetch transaction" };
|
|
25
|
+
}
|
|
26
|
+
if (!tx.successful) return { valid: false, error: "Transaction not successful" };
|
|
27
|
+
if (options.memo && tx.memo_type && tx.memo) {
|
|
28
|
+
const decoded = decodeMemo(tx.memo_type, tx.memo);
|
|
29
|
+
if (decoded !== options.memo) return { valid: false, error: "Memo mismatch" };
|
|
30
|
+
}
|
|
31
|
+
const paymentsRes = await fetch(`${base}/transactions/${txHash}/operations?limit=20`);
|
|
32
|
+
if (!paymentsRes.ok) return { valid: false, error: "Failed to fetch operations" };
|
|
33
|
+
const opsData = await paymentsRes.json();
|
|
34
|
+
const records = opsData._embedded?.records ?? [];
|
|
35
|
+
const paymentOps = records.filter((r) => r.type === "payment");
|
|
36
|
+
const requiredAmount = parseFloat(options.price);
|
|
37
|
+
const isNative = !options.issuer && (options.assetCode === "XLM" || !options.assetCode);
|
|
38
|
+
for (const op of paymentOps) {
|
|
39
|
+
if (op.to !== options.destination) continue;
|
|
40
|
+
const amount = parseFloat(op.amount);
|
|
41
|
+
if (amount < requiredAmount) continue;
|
|
42
|
+
if (isNative && op.asset_type === "native") return { valid: true };
|
|
43
|
+
if (!isNative && options.issuer && op.asset_type !== "native" && op.asset_code === options.assetCode && op.asset_issuer === options.issuer) return { valid: true };
|
|
44
|
+
}
|
|
45
|
+
return { valid: false, error: "No matching payment to destination with required amount/asset" };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
verifyPaymentOnChain
|
|
50
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPaymentRequiredResponse,
|
|
3
|
+
processPaymentMiddleware
|
|
4
|
+
} from "./chunk-CBSQ4354.js";
|
|
5
|
+
|
|
6
|
+
// src/server/index.ts
|
|
7
|
+
function x402(options) {
|
|
8
|
+
if (!options.price || !options.assetCode || !options.destination || !options.network) {
|
|
9
|
+
throw new Error("x402() requires price, assetCode, destination, and network");
|
|
10
|
+
}
|
|
11
|
+
return async (req, res, next) => {
|
|
12
|
+
const headers = {};
|
|
13
|
+
if (typeof req.headers === "object") {
|
|
14
|
+
for (const [k, v] of Object.entries(req.headers)) {
|
|
15
|
+
if (typeof v === "string") headers[k.toLowerCase()] = v;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const result = await processPaymentMiddleware(headers, options);
|
|
19
|
+
if (result.allowed) return next();
|
|
20
|
+
const payment402 = createPaymentRequiredResponse(options);
|
|
21
|
+
res.status(402).json(payment402.body);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
x402
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* x402 client – payment request from 402 response.
|
|
3
|
+
*/
|
|
4
|
+
interface X402PaymentRequest {
|
|
5
|
+
amount: string;
|
|
6
|
+
assetCode: string;
|
|
7
|
+
issuer?: string;
|
|
8
|
+
network: string;
|
|
9
|
+
destination: string;
|
|
10
|
+
memo?: string;
|
|
11
|
+
}
|
|
12
|
+
interface X402PaymentResponse {
|
|
13
|
+
transactionHash: string;
|
|
14
|
+
timestamp?: string;
|
|
15
|
+
}
|
|
16
|
+
interface X402ClientOptions {
|
|
17
|
+
/** Retry request after payment (default true) */
|
|
18
|
+
autoRetry?: boolean;
|
|
19
|
+
/** Pluggable: perform Stellar payment (e.g. Freighter), return tx hash */
|
|
20
|
+
payWithStellar?: (req: X402PaymentRequest) => Promise<X402PaymentResponse | null>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* x402 client – fetch with automatic 402 handling and Stellar payment flow.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Fetch that handles 402: on 402, calls payWithStellar (or throws), then retries with payment headers.
|
|
29
|
+
*/
|
|
30
|
+
declare function x402Fetch(input: RequestInfo | URL, init?: RequestInit, options?: X402ClientOptions): Promise<Response>;
|
|
31
|
+
|
|
32
|
+
export { type X402ClientOptions, type X402PaymentRequest, type X402PaymentResponse, x402Fetch };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createPaymentRequiredResponse, processPaymentMiddleware, x402 } from './server/index.js';
|
|
2
|
+
export { P as PaymentRequiredResponse, X as X402StellarOptions } from './types-CibbvCHY.js';
|
|
3
|
+
export { X402ClientOptions, X402PaymentRequest, X402PaymentResponse, x402Fetch } from './client/index.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
x402
|
|
3
|
+
} from "./chunk-UFTMXLKQ.js";
|
|
4
|
+
import {
|
|
5
|
+
createPaymentRequiredResponse,
|
|
6
|
+
processPaymentMiddleware
|
|
7
|
+
} from "./chunk-CBSQ4354.js";
|
|
8
|
+
import {
|
|
9
|
+
x402Fetch
|
|
10
|
+
} from "./chunk-6Q22RJI6.js";
|
|
11
|
+
import "./chunk-FRGC7Q3Z.js";
|
|
12
|
+
export {
|
|
13
|
+
createPaymentRequiredResponse,
|
|
14
|
+
processPaymentMiddleware,
|
|
15
|
+
x402,
|
|
16
|
+
x402Fetch
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { X as X402StellarOptions } from '../types-CibbvCHY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hono adapter for x402 – use x402Hono(options) as middleware.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
type HonoContext = {
|
|
8
|
+
req: {
|
|
9
|
+
header: (name: string) => string | undefined;
|
|
10
|
+
raw: Request;
|
|
11
|
+
};
|
|
12
|
+
json: (body: unknown, status?: number, headers?: Record<string, string>) => Response;
|
|
13
|
+
};
|
|
14
|
+
type HonoNext = () => Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* x402 middleware for Hono. Returns 402 with Stellar payment metadata when payment is missing or invalid.
|
|
17
|
+
*/
|
|
18
|
+
declare function x402Hono(options: X402StellarOptions): (c: HonoContext, next: HonoNext) => Promise<Response | undefined>;
|
|
19
|
+
|
|
20
|
+
export { x402Hono };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPaymentRequiredResponse,
|
|
3
|
+
processPaymentMiddleware
|
|
4
|
+
} from "../chunk-CBSQ4354.js";
|
|
5
|
+
|
|
6
|
+
// src/server/hono.ts
|
|
7
|
+
function x402Hono(options) {
|
|
8
|
+
if (!options.price || !options.assetCode || !options.destination || !options.network) {
|
|
9
|
+
throw new Error("x402Hono() requires price, assetCode, destination, and network");
|
|
10
|
+
}
|
|
11
|
+
return async (c, next) => {
|
|
12
|
+
const raw = c.req.raw;
|
|
13
|
+
const headers = {};
|
|
14
|
+
raw.headers.forEach((v, k) => {
|
|
15
|
+
headers[k.toLowerCase()] = v;
|
|
16
|
+
});
|
|
17
|
+
const result = await processPaymentMiddleware(headers, options);
|
|
18
|
+
if (!result.allowed) {
|
|
19
|
+
const payment402 = createPaymentRequiredResponse(options);
|
|
20
|
+
return c.json(payment402.body, 402, payment402.headers);
|
|
21
|
+
}
|
|
22
|
+
await next();
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
x402Hono
|
|
27
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { X as X402StellarOptions, P as PaymentRequiredResponse } from '../types-CibbvCHY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Core x402 middleware – returns 402 with Stellar payment metadata.
|
|
5
|
+
* Framework-agnostic; Hono/Express adapters call this.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface MiddlewareResult {
|
|
9
|
+
allowed: boolean;
|
|
10
|
+
paymentRequired?: PaymentRequiredResponse;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create 402 response body and headers for Stellar payment.
|
|
14
|
+
* Client uses: destination, amount, assetCode, issuer, network, memo to create payment.
|
|
15
|
+
*/
|
|
16
|
+
declare function createPaymentRequiredResponse(options: X402StellarOptions): PaymentRequiredResponse;
|
|
17
|
+
/**
|
|
18
|
+
* Process payment check: extract receipt from headers and verify on Horizon.
|
|
19
|
+
*/
|
|
20
|
+
declare function processPaymentMiddleware(requestHeaders: Record<string, string>, options: X402StellarOptions): Promise<MiddlewareResult>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Verify Stellar payment on Horizon (transaction hash + destination/amount/asset/memo).
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Verify that the transaction with given hash paid the destination with at least the required amount/asset.
|
|
28
|
+
*/
|
|
29
|
+
declare function verifyPaymentOnChain(txHash: string, options: X402StellarOptions): Promise<{
|
|
30
|
+
valid: boolean;
|
|
31
|
+
error?: string;
|
|
32
|
+
}>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* x402 server – Stellar payment-gated middleware.
|
|
36
|
+
* Same ergonomics as x402-mantle-sdk: x402({ price, assetCode, issuer, network, destination }).
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/** Express-style request (headers) and response (status + json). */
|
|
40
|
+
type X402Request = {
|
|
41
|
+
headers: Record<string, string | string[] | undefined>;
|
|
42
|
+
};
|
|
43
|
+
type X402Response = {
|
|
44
|
+
status(n: number): {
|
|
45
|
+
json(b: unknown): void;
|
|
46
|
+
};
|
|
47
|
+
json(b: unknown): void;
|
|
48
|
+
};
|
|
49
|
+
type X402Next = () => void | Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* x402 middleware – use in Express/Hono/Next.
|
|
52
|
+
* On missing/invalid payment: respond 402 with Stellar payment metadata.
|
|
53
|
+
* On valid payment: call next().
|
|
54
|
+
*/
|
|
55
|
+
declare function x402(options: X402StellarOptions): (req: X402Request, res: X402Response, next: X402Next) => Promise<void>;
|
|
56
|
+
|
|
57
|
+
export { PaymentRequiredResponse, type X402Next, type X402Request, type X402Response, X402StellarOptions, createPaymentRequiredResponse, processPaymentMiddleware, verifyPaymentOnChain, x402 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
x402
|
|
3
|
+
} from "../chunk-UFTMXLKQ.js";
|
|
4
|
+
import {
|
|
5
|
+
createPaymentRequiredResponse,
|
|
6
|
+
processPaymentMiddleware
|
|
7
|
+
} from "../chunk-CBSQ4354.js";
|
|
8
|
+
import {
|
|
9
|
+
verifyPaymentOnChain
|
|
10
|
+
} from "../chunk-FRGC7Q3Z.js";
|
|
11
|
+
export {
|
|
12
|
+
createPaymentRequiredResponse,
|
|
13
|
+
processPaymentMiddleware,
|
|
14
|
+
verifyPaymentOnChain,
|
|
15
|
+
x402
|
|
16
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { X as X402StellarOptions } from '../types-CibbvCHY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Next.js adapter for x402 – verify payment in API routes and return 402 or continue.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use in Next.js API route (App Router or Pages API).
|
|
9
|
+
* Pass the request headers and your x402 options; returns null if paid, or a NextResponse with 402 if not.
|
|
10
|
+
*/
|
|
11
|
+
declare function withX402(requestHeaders: Headers, options: X402StellarOptions): Promise<Response | null>;
|
|
12
|
+
|
|
13
|
+
export { X402StellarOptions, withX402 };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPaymentRequiredResponse,
|
|
3
|
+
processPaymentMiddleware
|
|
4
|
+
} from "../chunk-CBSQ4354.js";
|
|
5
|
+
|
|
6
|
+
// src/server/next.ts
|
|
7
|
+
async function withX402(requestHeaders, options) {
|
|
8
|
+
const headers = {};
|
|
9
|
+
requestHeaders.forEach((v, k) => {
|
|
10
|
+
headers[k.toLowerCase()] = v;
|
|
11
|
+
});
|
|
12
|
+
const result = await processPaymentMiddleware(headers, options);
|
|
13
|
+
if (result.allowed) return null;
|
|
14
|
+
const payment402 = createPaymentRequiredResponse(options);
|
|
15
|
+
return new Response(JSON.stringify(payment402.body), {
|
|
16
|
+
status: 402,
|
|
17
|
+
headers: { "Content-Type": "application/json", ...payment402.headers }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
withX402
|
|
22
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* x402 server options – Stellar payment metadata (asset code + issuer, not ERC20).
|
|
3
|
+
*/
|
|
4
|
+
interface X402StellarOptions {
|
|
5
|
+
/** Price amount (e.g. "10.5") */
|
|
6
|
+
price: string;
|
|
7
|
+
/** Asset code (e.g. "XLM", "USDC") */
|
|
8
|
+
assetCode: string;
|
|
9
|
+
/** Issuer account ID (G...) for custom assets; omit for native XLM */
|
|
10
|
+
issuer?: string;
|
|
11
|
+
/** "mainnet" | "testnet" */
|
|
12
|
+
network: "mainnet" | "testnet";
|
|
13
|
+
/** Destination account that receives payment (G...) */
|
|
14
|
+
destination: string;
|
|
15
|
+
/** Optional memo (e.g. request id) for payment correlation */
|
|
16
|
+
memo?: string;
|
|
17
|
+
}
|
|
18
|
+
interface PaymentRequiredResponse {
|
|
19
|
+
status: 402;
|
|
20
|
+
headers: Record<string, string>;
|
|
21
|
+
body: {
|
|
22
|
+
error: "Payment Required";
|
|
23
|
+
amount: string;
|
|
24
|
+
assetCode: string;
|
|
25
|
+
issuer?: string;
|
|
26
|
+
network: string;
|
|
27
|
+
destination: string;
|
|
28
|
+
memo?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type { PaymentRequiredResponse as P, X402StellarOptions as X };
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "x402-stellar-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "HTTP 402 payment-gated APIs with Stellar payments",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./server": {
|
|
14
|
+
"types": "./dist/server/index.d.ts",
|
|
15
|
+
"import": "./dist/server/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./server/hono": {
|
|
18
|
+
"types": "./dist/server/hono.d.ts",
|
|
19
|
+
"import": "./dist/server/hono.js"
|
|
20
|
+
},
|
|
21
|
+
"./server/next": {
|
|
22
|
+
"types": "./dist/server/next.d.ts",
|
|
23
|
+
"import": "./dist/server/next.js"
|
|
24
|
+
},
|
|
25
|
+
"./client": {
|
|
26
|
+
"types": "./dist/client/index.d.ts",
|
|
27
|
+
"import": "./dist/client/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"dev": "tsup --watch",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"prepublishOnly": "npm run build"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"tsup": "^8.5.0",
|
|
42
|
+
"typescript": "^5.3.0"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/codewmilan/stellar-agent-kit.git"
|
|
47
|
+
},
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=18"
|
|
54
|
+
}
|
|
55
|
+
}
|