@axicov/x402-cronos-sdk 0.1.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/dist/example.d.ts +1 -0
- package/dist/index.js +28894 -0
- package/dist/src/facilitator.d.ts +7 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/middleware.d.ts +5 -0
- package/dist/src/types.d.ts +7 -0
- package/package.json +26 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Facilitator, CronosNetwork } from "@crypto.com/facilitator-client";
|
|
2
|
+
import type { PaymentRequirements } from "@crypto.com/facilitator-client";
|
|
3
|
+
export declare const facilitator: Facilitator;
|
|
4
|
+
export declare function verify(payment: string, requirements: PaymentRequirements): Promise<import("@crypto.com/facilitator-client").X402VerifyResponse>;
|
|
5
|
+
export declare function settle(payment: string, requirements: PaymentRequirements): Promise<import("@crypto.com/facilitator-client").X402SettleResponse>;
|
|
6
|
+
export { Facilitator, CronosNetwork };
|
|
7
|
+
export type { PaymentRequirements };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import type { X402Config } from "./types";
|
|
3
|
+
export declare function createx402Tool<TInput, TOutput>(fn: (input: TInput) => Promise<TOutput>, config: X402Config): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
4
|
+
export type { X402Config } from "./types";
|
|
5
|
+
export { Facilitator, CronosNetwork } from "@crypto.com/facilitator-client";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Context, Next } from "hono";
|
|
2
|
+
import type { X402Config } from "./types";
|
|
3
|
+
export declare function x402Middleware(config: X402Config): (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{
|
|
4
|
+
error: string;
|
|
5
|
+
}, 402, "json">) | undefined>;
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@axicov/x402-cronos-sdk",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target node && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
12
|
+
"prepublishOnly": "bun run build",
|
|
13
|
+
"example": "bun run example.ts"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@crypto.com/facilitator-client": "^1.0.4",
|
|
17
|
+
"@hono/node-server": "^1.8.0",
|
|
18
|
+
"ethers": "^6.0.0",
|
|
19
|
+
"hono": "^4.0.0",
|
|
20
|
+
"viem": "^2.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^20.0.0",
|
|
24
|
+
"typescript": "^5.0.0"
|
|
25
|
+
}
|
|
26
|
+
}
|