@wtflabs/x402 0.0.1-beta.3 → 0.0.1-beta.5
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/cjs/client/index.d.ts +1 -1
- package/dist/cjs/client/index.js +6 -1
- package/dist/cjs/client/index.js.map +1 -1
- package/dist/cjs/facilitator/index.d.ts +1 -1
- package/dist/cjs/facilitator/index.js +119 -6
- package/dist/cjs/facilitator/index.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +119 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{middleware-Brgsx32F.d.ts → middleware-nzDe-TDJ.d.ts} +1 -1
- package/dist/cjs/paywall/index.d.ts +1 -1
- package/dist/cjs/schemes/index.d.ts +25 -7
- package/dist/cjs/schemes/index.js +151 -13
- package/dist/cjs/schemes/index.js.map +1 -1
- package/dist/cjs/shared/index.d.ts +2 -2
- package/dist/cjs/shared/index.js +6 -1
- package/dist/cjs/shared/index.js.map +1 -1
- package/dist/cjs/types/index.d.ts +93 -4
- package/dist/cjs/types/index.js +64 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/verify/index.d.ts +2 -2
- package/dist/cjs/verify/index.js +6 -1
- package/dist/cjs/verify/index.js.map +1 -1
- package/dist/{esm/x402Specs-CYq5tSY1.d.mts → cjs/x402Specs-BtRXj67U.d.ts} +43 -10
- package/dist/esm/{chunk-RX2JKK4O.mjs → chunk-J3FMDNC3.mjs} +2 -2
- package/dist/esm/{chunk-34YNR4LY.mjs → chunk-K5SAFQCZ.mjs} +3 -3
- package/dist/esm/{chunk-UCBE7FDY.mjs → chunk-NPWDNT2P.mjs} +67 -2
- package/dist/esm/chunk-NPWDNT2P.mjs.map +1 -0
- package/dist/esm/{chunk-ZEZOGZ3K.mjs → chunk-TAYXZJPR.mjs} +101 -16
- package/dist/esm/chunk-TAYXZJPR.mjs.map +1 -0
- package/dist/esm/{chunk-CJV3GAPG.mjs → chunk-URGZOTVQ.mjs} +3 -3
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +3 -3
- package/dist/esm/facilitator/index.d.mts +1 -1
- package/dist/esm/facilitator/index.mjs +4 -4
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/{middleware-BSjsPDKM.d.mts → middleware-DSDucaQ5.d.mts} +1 -1
- package/dist/esm/paywall/index.d.mts +1 -1
- package/dist/esm/schemes/index.d.mts +25 -7
- package/dist/esm/schemes/index.mjs +3 -3
- package/dist/esm/shared/index.d.mts +2 -2
- package/dist/esm/shared/index.mjs +1 -1
- package/dist/esm/types/index.d.mts +93 -4
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/verify/index.d.mts +2 -2
- package/dist/esm/verify/index.mjs +1 -1
- package/dist/{cjs/x402Specs-CYq5tSY1.d.ts → esm/x402Specs-BtRXj67U.d.mts} +43 -10
- package/package.json +15 -15
- package/dist/cjs/middleware-6_1ApcJn.d.ts +0 -93
- package/dist/cjs/middleware-B_ewwsQp.d.ts +0 -93
- package/dist/cjs/middleware-BwfW7mAs.d.ts +0 -93
- package/dist/cjs/middleware-CQb61c1k.d.ts +0 -93
- package/dist/cjs/middleware-DB9lqy9f.d.ts +0 -93
- package/dist/cjs/middleware-DcHctwQV.d.ts +0 -93
- package/dist/cjs/middleware-De0jD3Bp.d.ts +0 -93
- package/dist/cjs/middleware-HoFOmpgv.d.ts +0 -93
- package/dist/cjs/middleware-Y8AiAfYw.d.ts +0 -93
- package/dist/cjs/middleware-pnres9YM.d.ts +0 -93
- package/dist/cjs/network-RtNddYQk.d.ts +0 -11
- package/dist/cjs/rpc-Ca8eHCWz.d.ts +0 -35
- package/dist/cjs/wallet-BRWfOM5D.d.ts +0 -153
- package/dist/cjs/wallet-BYRAGtOB.d.ts +0 -153
- package/dist/cjs/wallet-BmEtlgEf.d.ts +0 -48
- package/dist/cjs/wallet-CNOAmyZ6.d.ts +0 -48
- package/dist/cjs/wallet-D1SoxFTw.d.ts +0 -48
- package/dist/cjs/wallet-SJ-hbjm9.d.ts +0 -153
- package/dist/cjs/wallet-ecnda4Aj.d.ts +0 -48
- package/dist/cjs/wallet-gP8Qoi-c.d.ts +0 -74
- package/dist/cjs/x402Specs-B7InXo2L.d.ts +0 -1065
- package/dist/cjs/x402Specs-BLH3j34O.d.ts +0 -1696
- package/dist/cjs/x402Specs-C7LipAZg.d.ts +0 -1715
- package/dist/cjs/x402Specs-CeajqonG.d.ts +0 -1696
- package/dist/cjs/x402Specs-qMujgEV5.d.ts +0 -1715
- package/dist/cjs/x402Specs-qUBCpcuz.d.ts +0 -1715
- package/dist/esm/chunk-UCBE7FDY.mjs.map +0 -1
- package/dist/esm/chunk-ZEZOGZ3K.mjs.map +0 -1
- /package/dist/esm/{chunk-RX2JKK4O.mjs.map → chunk-J3FMDNC3.mjs.map} +0 -0
- /package/dist/esm/{chunk-34YNR4LY.mjs.map → chunk-K5SAFQCZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-CJV3GAPG.mjs.map → chunk-URGZOTVQ.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wtflabs/x402",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.5",
|
|
4
4
|
"main": "./dist/cjs/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start": "tsx --env-file=.env index.ts",
|
|
9
|
-
"build": "tsup",
|
|
10
|
-
"build:paywall": "tsx src/paywall/build.ts",
|
|
11
|
-
"test": "vitest run",
|
|
12
|
-
"test:watch": "vitest",
|
|
13
|
-
"watch": "tsc --watch",
|
|
14
|
-
"format": "prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"",
|
|
15
|
-
"format:check": "prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\"",
|
|
16
|
-
"lint": "eslint . --ext .ts --fix",
|
|
17
|
-
"lint:check": "eslint . --ext .ts"
|
|
18
|
-
},
|
|
19
7
|
"keywords": [],
|
|
20
8
|
"license": "Apache-2.0",
|
|
21
9
|
"author": "",
|
|
@@ -144,5 +132,17 @@
|
|
|
144
132
|
},
|
|
145
133
|
"files": [
|
|
146
134
|
"dist"
|
|
147
|
-
]
|
|
148
|
-
|
|
135
|
+
],
|
|
136
|
+
"scripts": {
|
|
137
|
+
"start": "tsx --env-file=.env index.ts",
|
|
138
|
+
"build": "tsup",
|
|
139
|
+
"build:paywall": "tsx src/paywall/build.ts",
|
|
140
|
+
"test": "vitest run",
|
|
141
|
+
"test:watch": "vitest",
|
|
142
|
+
"watch": "tsc --watch",
|
|
143
|
+
"format": "prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"",
|
|
144
|
+
"format:check": "prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\"",
|
|
145
|
+
"lint": "eslint . --ext .ts --fix",
|
|
146
|
+
"lint:check": "eslint . --ext .ts"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { N as Network } from './network-RtNddYQk.js';
|
|
3
|
-
import { E as EvmSigner } from './wallet-gP8Qoi-c.js';
|
|
4
|
-
import { a as PaymentPayload, P as PaymentRequirements, J as VerifyResponse, S as SettleResponse, X as SupportedPaymentKindsResponse, M as ListDiscoveryResourcesRequest, O as ListDiscoveryResourcesResponse, z as HTTPRequestStructure } from './x402Specs-C7LipAZg.js';
|
|
5
|
-
|
|
6
|
-
declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
|
|
7
|
-
type Money = z.input<typeof moneySchema>;
|
|
8
|
-
|
|
9
|
-
type Resource = `${string}://${string}`;
|
|
10
|
-
|
|
11
|
-
type CreateHeaders = () => Promise<{
|
|
12
|
-
verify: Record<string, string>;
|
|
13
|
-
settle: Record<string, string>;
|
|
14
|
-
supported: Record<string, string>;
|
|
15
|
-
list?: Record<string, string>;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a facilitator client for interacting with the X402 payment facilitator service
|
|
19
|
-
*
|
|
20
|
-
* @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
|
|
21
|
-
* @returns An object containing verify and settle functions for interacting with the facilitator
|
|
22
|
-
*/
|
|
23
|
-
declare function useFacilitator(facilitator?: FacilitatorConfig): {
|
|
24
|
-
verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
25
|
-
settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
26
|
-
supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
27
|
-
list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
28
|
-
};
|
|
29
|
-
declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
30
|
-
declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
31
|
-
declare const supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
32
|
-
declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
33
|
-
|
|
34
|
-
type FacilitatorConfig = {
|
|
35
|
-
url: Resource;
|
|
36
|
-
createAuthHeaders?: CreateHeaders;
|
|
37
|
-
};
|
|
38
|
-
type PaywallConfig = {
|
|
39
|
-
cdpClientKey?: string;
|
|
40
|
-
appName?: string;
|
|
41
|
-
appLogo?: string;
|
|
42
|
-
sessionTokenEndpoint?: string;
|
|
43
|
-
};
|
|
44
|
-
type PaymentMiddlewareConfig = {
|
|
45
|
-
description?: string;
|
|
46
|
-
mimeType?: string;
|
|
47
|
-
maxTimeoutSeconds?: number;
|
|
48
|
-
inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
|
|
49
|
-
outputSchema?: object;
|
|
50
|
-
discoverable?: boolean;
|
|
51
|
-
customPaywallHtml?: string;
|
|
52
|
-
resource?: Resource;
|
|
53
|
-
errorMessages?: {
|
|
54
|
-
paymentRequired?: string;
|
|
55
|
-
invalidPayment?: string;
|
|
56
|
-
noMatchingRequirements?: string;
|
|
57
|
-
verificationFailed?: string;
|
|
58
|
-
settlementFailed?: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
interface ERC20TokenAmount {
|
|
62
|
-
amount: string;
|
|
63
|
-
asset: {
|
|
64
|
-
address: `0x${string}`;
|
|
65
|
-
decimals: number;
|
|
66
|
-
eip712: {
|
|
67
|
-
name: string;
|
|
68
|
-
version: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
interface SPLTokenAmount {
|
|
73
|
-
amount: string;
|
|
74
|
-
asset: {
|
|
75
|
-
address: string;
|
|
76
|
-
decimals: number;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
type Price = Money | ERC20TokenAmount | SPLTokenAmount;
|
|
80
|
-
interface RouteConfig {
|
|
81
|
-
price: Price;
|
|
82
|
-
network: Network;
|
|
83
|
-
config?: PaymentMiddlewareConfig;
|
|
84
|
-
}
|
|
85
|
-
type RoutesConfig = Record<string, Price | RouteConfig>;
|
|
86
|
-
interface RoutePattern {
|
|
87
|
-
verb: string;
|
|
88
|
-
pattern: RegExp;
|
|
89
|
-
config: RouteConfig;
|
|
90
|
-
}
|
|
91
|
-
type Wallet = EvmSigner;
|
|
92
|
-
|
|
93
|
-
export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { N as Network } from './network-FrFmmiyj.js';
|
|
3
|
-
import { E as EvmSigner } from './wallet-SJ-hbjm9.js';
|
|
4
|
-
import { a as PaymentPayload, P as PaymentRequirements, J as VerifyResponse, S as SettleResponse, X as SupportedPaymentKindsResponse, M as ListDiscoveryResourcesRequest, O as ListDiscoveryResourcesResponse, z as HTTPRequestStructure } from './x402Specs-CYq5tSY1.js';
|
|
5
|
-
|
|
6
|
-
declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
|
|
7
|
-
type Money = z.input<typeof moneySchema>;
|
|
8
|
-
|
|
9
|
-
type Resource = `${string}://${string}`;
|
|
10
|
-
|
|
11
|
-
type CreateHeaders = () => Promise<{
|
|
12
|
-
verify: Record<string, string>;
|
|
13
|
-
settle: Record<string, string>;
|
|
14
|
-
supported: Record<string, string>;
|
|
15
|
-
list?: Record<string, string>;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a facilitator client for interacting with the X402 payment facilitator service
|
|
19
|
-
*
|
|
20
|
-
* @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
|
|
21
|
-
* @returns An object containing verify and settle functions for interacting with the facilitator
|
|
22
|
-
*/
|
|
23
|
-
declare function useFacilitator(facilitator?: FacilitatorConfig): {
|
|
24
|
-
verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
25
|
-
settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
26
|
-
supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
27
|
-
list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
28
|
-
};
|
|
29
|
-
declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
30
|
-
declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
31
|
-
declare const supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
32
|
-
declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
33
|
-
|
|
34
|
-
type FacilitatorConfig = {
|
|
35
|
-
url: Resource;
|
|
36
|
-
createAuthHeaders?: CreateHeaders;
|
|
37
|
-
};
|
|
38
|
-
type PaywallConfig = {
|
|
39
|
-
cdpClientKey?: string;
|
|
40
|
-
appName?: string;
|
|
41
|
-
appLogo?: string;
|
|
42
|
-
sessionTokenEndpoint?: string;
|
|
43
|
-
};
|
|
44
|
-
type PaymentMiddlewareConfig = {
|
|
45
|
-
description?: string;
|
|
46
|
-
mimeType?: string;
|
|
47
|
-
maxTimeoutSeconds?: number;
|
|
48
|
-
inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
|
|
49
|
-
outputSchema?: object;
|
|
50
|
-
discoverable?: boolean;
|
|
51
|
-
customPaywallHtml?: string;
|
|
52
|
-
resource?: Resource;
|
|
53
|
-
errorMessages?: {
|
|
54
|
-
paymentRequired?: string;
|
|
55
|
-
invalidPayment?: string;
|
|
56
|
-
noMatchingRequirements?: string;
|
|
57
|
-
verificationFailed?: string;
|
|
58
|
-
settlementFailed?: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
interface ERC20TokenAmount {
|
|
62
|
-
amount: string;
|
|
63
|
-
asset: {
|
|
64
|
-
address: `0x${string}`;
|
|
65
|
-
decimals: number;
|
|
66
|
-
eip712: {
|
|
67
|
-
name: string;
|
|
68
|
-
version: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
interface SPLTokenAmount {
|
|
73
|
-
amount: string;
|
|
74
|
-
asset: {
|
|
75
|
-
address: string;
|
|
76
|
-
decimals: number;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
type Price = Money | ERC20TokenAmount | SPLTokenAmount;
|
|
80
|
-
interface RouteConfig {
|
|
81
|
-
price: Price;
|
|
82
|
-
network: Network;
|
|
83
|
-
config?: PaymentMiddlewareConfig;
|
|
84
|
-
}
|
|
85
|
-
type RoutesConfig = Record<string, Price | RouteConfig>;
|
|
86
|
-
interface RoutePattern {
|
|
87
|
-
verb: string;
|
|
88
|
-
pattern: RegExp;
|
|
89
|
-
config: RouteConfig;
|
|
90
|
-
}
|
|
91
|
-
type Wallet = EvmSigner;
|
|
92
|
-
|
|
93
|
-
export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { N as Network } from './network-FrFmmiyj.js';
|
|
3
|
-
import { E as EvmSigner } from './wallet-BRWfOM5D.js';
|
|
4
|
-
import { a as PaymentPayload, P as PaymentRequirements, J as VerifyResponse, S as SettleResponse, X as SupportedPaymentKindsResponse, M as ListDiscoveryResourcesRequest, O as ListDiscoveryResourcesResponse, z as HTTPRequestStructure } from './x402Specs-CYq5tSY1.js';
|
|
5
|
-
|
|
6
|
-
declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
|
|
7
|
-
type Money = z.input<typeof moneySchema>;
|
|
8
|
-
|
|
9
|
-
type Resource = `${string}://${string}`;
|
|
10
|
-
|
|
11
|
-
type CreateHeaders = () => Promise<{
|
|
12
|
-
verify: Record<string, string>;
|
|
13
|
-
settle: Record<string, string>;
|
|
14
|
-
supported: Record<string, string>;
|
|
15
|
-
list?: Record<string, string>;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a facilitator client for interacting with the X402 payment facilitator service
|
|
19
|
-
*
|
|
20
|
-
* @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
|
|
21
|
-
* @returns An object containing verify and settle functions for interacting with the facilitator
|
|
22
|
-
*/
|
|
23
|
-
declare function useFacilitator(facilitator?: FacilitatorConfig): {
|
|
24
|
-
verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
25
|
-
settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
26
|
-
supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
27
|
-
list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
28
|
-
};
|
|
29
|
-
declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
30
|
-
declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
31
|
-
declare const supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
32
|
-
declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
33
|
-
|
|
34
|
-
type FacilitatorConfig = {
|
|
35
|
-
url: Resource;
|
|
36
|
-
createAuthHeaders?: CreateHeaders;
|
|
37
|
-
};
|
|
38
|
-
type PaywallConfig = {
|
|
39
|
-
cdpClientKey?: string;
|
|
40
|
-
appName?: string;
|
|
41
|
-
appLogo?: string;
|
|
42
|
-
sessionTokenEndpoint?: string;
|
|
43
|
-
};
|
|
44
|
-
type PaymentMiddlewareConfig = {
|
|
45
|
-
description?: string;
|
|
46
|
-
mimeType?: string;
|
|
47
|
-
maxTimeoutSeconds?: number;
|
|
48
|
-
inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
|
|
49
|
-
outputSchema?: object;
|
|
50
|
-
discoverable?: boolean;
|
|
51
|
-
customPaywallHtml?: string;
|
|
52
|
-
resource?: Resource;
|
|
53
|
-
errorMessages?: {
|
|
54
|
-
paymentRequired?: string;
|
|
55
|
-
invalidPayment?: string;
|
|
56
|
-
noMatchingRequirements?: string;
|
|
57
|
-
verificationFailed?: string;
|
|
58
|
-
settlementFailed?: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
interface ERC20TokenAmount {
|
|
62
|
-
amount: string;
|
|
63
|
-
asset: {
|
|
64
|
-
address: `0x${string}`;
|
|
65
|
-
decimals: number;
|
|
66
|
-
eip712: {
|
|
67
|
-
name: string;
|
|
68
|
-
version: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
interface SPLTokenAmount {
|
|
73
|
-
amount: string;
|
|
74
|
-
asset: {
|
|
75
|
-
address: string;
|
|
76
|
-
decimals: number;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
type Price = Money | ERC20TokenAmount | SPLTokenAmount;
|
|
80
|
-
interface RouteConfig {
|
|
81
|
-
price: Price;
|
|
82
|
-
network: Network;
|
|
83
|
-
config?: PaymentMiddlewareConfig;
|
|
84
|
-
}
|
|
85
|
-
type RoutesConfig = Record<string, Price | RouteConfig>;
|
|
86
|
-
interface RoutePattern {
|
|
87
|
-
verb: string;
|
|
88
|
-
pattern: RegExp;
|
|
89
|
-
config: RouteConfig;
|
|
90
|
-
}
|
|
91
|
-
type Wallet = EvmSigner;
|
|
92
|
-
|
|
93
|
-
export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { N as Network } from './network-RtNddYQk.js';
|
|
3
|
-
import { E as EvmSigner } from './wallet-gP8Qoi-c.js';
|
|
4
|
-
import { a as PaymentPayload, P as PaymentRequirements, z as VerifyResponse, S as SettleResponse, K as SupportedPaymentKindsResponse, B as ListDiscoveryResourcesRequest, F as ListDiscoveryResourcesResponse, q as HTTPRequestStructure } from './x402Specs-BLH3j34O.js';
|
|
5
|
-
|
|
6
|
-
declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
|
|
7
|
-
type Money = z.input<typeof moneySchema>;
|
|
8
|
-
|
|
9
|
-
type Resource = `${string}://${string}`;
|
|
10
|
-
|
|
11
|
-
type CreateHeaders = () => Promise<{
|
|
12
|
-
verify: Record<string, string>;
|
|
13
|
-
settle: Record<string, string>;
|
|
14
|
-
supported: Record<string, string>;
|
|
15
|
-
list?: Record<string, string>;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a facilitator client for interacting with the X402 payment facilitator service
|
|
19
|
-
*
|
|
20
|
-
* @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
|
|
21
|
-
* @returns An object containing verify and settle functions for interacting with the facilitator
|
|
22
|
-
*/
|
|
23
|
-
declare function useFacilitator(facilitator?: FacilitatorConfig): {
|
|
24
|
-
verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
25
|
-
settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
26
|
-
supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
27
|
-
list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
28
|
-
};
|
|
29
|
-
declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
30
|
-
declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
31
|
-
declare const supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
32
|
-
declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
33
|
-
|
|
34
|
-
type FacilitatorConfig = {
|
|
35
|
-
url: Resource;
|
|
36
|
-
createAuthHeaders?: CreateHeaders;
|
|
37
|
-
};
|
|
38
|
-
type PaywallConfig = {
|
|
39
|
-
cdpClientKey?: string;
|
|
40
|
-
appName?: string;
|
|
41
|
-
appLogo?: string;
|
|
42
|
-
sessionTokenEndpoint?: string;
|
|
43
|
-
};
|
|
44
|
-
type PaymentMiddlewareConfig = {
|
|
45
|
-
description?: string;
|
|
46
|
-
mimeType?: string;
|
|
47
|
-
maxTimeoutSeconds?: number;
|
|
48
|
-
inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
|
|
49
|
-
outputSchema?: object;
|
|
50
|
-
discoverable?: boolean;
|
|
51
|
-
customPaywallHtml?: string;
|
|
52
|
-
resource?: Resource;
|
|
53
|
-
errorMessages?: {
|
|
54
|
-
paymentRequired?: string;
|
|
55
|
-
invalidPayment?: string;
|
|
56
|
-
noMatchingRequirements?: string;
|
|
57
|
-
verificationFailed?: string;
|
|
58
|
-
settlementFailed?: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
interface ERC20TokenAmount {
|
|
62
|
-
amount: string;
|
|
63
|
-
asset: {
|
|
64
|
-
address: `0x${string}`;
|
|
65
|
-
decimals: number;
|
|
66
|
-
eip712: {
|
|
67
|
-
name: string;
|
|
68
|
-
version: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
interface SPLTokenAmount {
|
|
73
|
-
amount: string;
|
|
74
|
-
asset: {
|
|
75
|
-
address: string;
|
|
76
|
-
decimals: number;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
type Price = Money | ERC20TokenAmount | SPLTokenAmount;
|
|
80
|
-
interface RouteConfig {
|
|
81
|
-
price: Price;
|
|
82
|
-
network: Network;
|
|
83
|
-
config?: PaymentMiddlewareConfig;
|
|
84
|
-
}
|
|
85
|
-
type RoutesConfig = Record<string, Price | RouteConfig>;
|
|
86
|
-
interface RoutePattern {
|
|
87
|
-
verb: string;
|
|
88
|
-
pattern: RegExp;
|
|
89
|
-
config: RouteConfig;
|
|
90
|
-
}
|
|
91
|
-
type Wallet = EvmSigner;
|
|
92
|
-
|
|
93
|
-
export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { N as Network } from './network-FrFmmiyj.js';
|
|
3
|
-
import { E as EvmSigner } from './wallet-gP8Qoi-c.js';
|
|
4
|
-
import { a as PaymentPayload, P as PaymentRequirements, J as VerifyResponse, S as SettleResponse, X as SupportedPaymentKindsResponse, M as ListDiscoveryResourcesRequest, O as ListDiscoveryResourcesResponse, z as HTTPRequestStructure } from './x402Specs-qUBCpcuz.js';
|
|
5
|
-
|
|
6
|
-
declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
|
|
7
|
-
type Money = z.input<typeof moneySchema>;
|
|
8
|
-
|
|
9
|
-
type Resource = `${string}://${string}`;
|
|
10
|
-
|
|
11
|
-
type CreateHeaders = () => Promise<{
|
|
12
|
-
verify: Record<string, string>;
|
|
13
|
-
settle: Record<string, string>;
|
|
14
|
-
supported: Record<string, string>;
|
|
15
|
-
list?: Record<string, string>;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a facilitator client for interacting with the X402 payment facilitator service
|
|
19
|
-
*
|
|
20
|
-
* @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
|
|
21
|
-
* @returns An object containing verify and settle functions for interacting with the facilitator
|
|
22
|
-
*/
|
|
23
|
-
declare function useFacilitator(facilitator?: FacilitatorConfig): {
|
|
24
|
-
verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
25
|
-
settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
26
|
-
supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
27
|
-
list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
28
|
-
};
|
|
29
|
-
declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
30
|
-
declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
31
|
-
declare const supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
32
|
-
declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
33
|
-
|
|
34
|
-
type FacilitatorConfig = {
|
|
35
|
-
url: Resource;
|
|
36
|
-
createAuthHeaders?: CreateHeaders;
|
|
37
|
-
};
|
|
38
|
-
type PaywallConfig = {
|
|
39
|
-
cdpClientKey?: string;
|
|
40
|
-
appName?: string;
|
|
41
|
-
appLogo?: string;
|
|
42
|
-
sessionTokenEndpoint?: string;
|
|
43
|
-
};
|
|
44
|
-
type PaymentMiddlewareConfig = {
|
|
45
|
-
description?: string;
|
|
46
|
-
mimeType?: string;
|
|
47
|
-
maxTimeoutSeconds?: number;
|
|
48
|
-
inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
|
|
49
|
-
outputSchema?: object;
|
|
50
|
-
discoverable?: boolean;
|
|
51
|
-
customPaywallHtml?: string;
|
|
52
|
-
resource?: Resource;
|
|
53
|
-
errorMessages?: {
|
|
54
|
-
paymentRequired?: string;
|
|
55
|
-
invalidPayment?: string;
|
|
56
|
-
noMatchingRequirements?: string;
|
|
57
|
-
verificationFailed?: string;
|
|
58
|
-
settlementFailed?: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
interface ERC20TokenAmount {
|
|
62
|
-
amount: string;
|
|
63
|
-
asset: {
|
|
64
|
-
address: `0x${string}`;
|
|
65
|
-
decimals: number;
|
|
66
|
-
eip712: {
|
|
67
|
-
name: string;
|
|
68
|
-
version: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
interface SPLTokenAmount {
|
|
73
|
-
amount: string;
|
|
74
|
-
asset: {
|
|
75
|
-
address: string;
|
|
76
|
-
decimals: number;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
type Price = Money | ERC20TokenAmount | SPLTokenAmount;
|
|
80
|
-
interface RouteConfig {
|
|
81
|
-
price: Price;
|
|
82
|
-
network: Network;
|
|
83
|
-
config?: PaymentMiddlewareConfig;
|
|
84
|
-
}
|
|
85
|
-
type RoutesConfig = Record<string, Price | RouteConfig>;
|
|
86
|
-
interface RoutePattern {
|
|
87
|
-
verb: string;
|
|
88
|
-
pattern: RegExp;
|
|
89
|
-
config: RouteConfig;
|
|
90
|
-
}
|
|
91
|
-
type Wallet = EvmSigner;
|
|
92
|
-
|
|
93
|
-
export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { N as Network } from './network-RtNddYQk.js';
|
|
3
|
-
import { E as EvmSigner } from './wallet-gP8Qoi-c.js';
|
|
4
|
-
import { a as PaymentPayload, P as PaymentRequirements, z as VerifyResponse, S as SettleResponse, K as SupportedPaymentKindsResponse, B as ListDiscoveryResourcesRequest, F as ListDiscoveryResourcesResponse, q as HTTPRequestStructure } from './x402Specs-CeajqonG.js';
|
|
5
|
-
|
|
6
|
-
declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
|
|
7
|
-
type Money = z.input<typeof moneySchema>;
|
|
8
|
-
|
|
9
|
-
type Resource = `${string}://${string}`;
|
|
10
|
-
|
|
11
|
-
type CreateHeaders = () => Promise<{
|
|
12
|
-
verify: Record<string, string>;
|
|
13
|
-
settle: Record<string, string>;
|
|
14
|
-
supported: Record<string, string>;
|
|
15
|
-
list?: Record<string, string>;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a facilitator client for interacting with the X402 payment facilitator service
|
|
19
|
-
*
|
|
20
|
-
* @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
|
|
21
|
-
* @returns An object containing verify and settle functions for interacting with the facilitator
|
|
22
|
-
*/
|
|
23
|
-
declare function useFacilitator(facilitator?: FacilitatorConfig): {
|
|
24
|
-
verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
25
|
-
settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
26
|
-
supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
27
|
-
list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
28
|
-
};
|
|
29
|
-
declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
|
|
30
|
-
declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
|
|
31
|
-
declare const supported: () => Promise<SupportedPaymentKindsResponse>;
|
|
32
|
-
declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
|
|
33
|
-
|
|
34
|
-
type FacilitatorConfig = {
|
|
35
|
-
url: Resource;
|
|
36
|
-
createAuthHeaders?: CreateHeaders;
|
|
37
|
-
};
|
|
38
|
-
type PaywallConfig = {
|
|
39
|
-
cdpClientKey?: string;
|
|
40
|
-
appName?: string;
|
|
41
|
-
appLogo?: string;
|
|
42
|
-
sessionTokenEndpoint?: string;
|
|
43
|
-
};
|
|
44
|
-
type PaymentMiddlewareConfig = {
|
|
45
|
-
description?: string;
|
|
46
|
-
mimeType?: string;
|
|
47
|
-
maxTimeoutSeconds?: number;
|
|
48
|
-
inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
|
|
49
|
-
outputSchema?: object;
|
|
50
|
-
discoverable?: boolean;
|
|
51
|
-
customPaywallHtml?: string;
|
|
52
|
-
resource?: Resource;
|
|
53
|
-
errorMessages?: {
|
|
54
|
-
paymentRequired?: string;
|
|
55
|
-
invalidPayment?: string;
|
|
56
|
-
noMatchingRequirements?: string;
|
|
57
|
-
verificationFailed?: string;
|
|
58
|
-
settlementFailed?: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
interface ERC20TokenAmount {
|
|
62
|
-
amount: string;
|
|
63
|
-
asset: {
|
|
64
|
-
address: `0x${string}`;
|
|
65
|
-
decimals: number;
|
|
66
|
-
eip712: {
|
|
67
|
-
name: string;
|
|
68
|
-
version: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
interface SPLTokenAmount {
|
|
73
|
-
amount: string;
|
|
74
|
-
asset: {
|
|
75
|
-
address: string;
|
|
76
|
-
decimals: number;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
type Price = Money | ERC20TokenAmount | SPLTokenAmount;
|
|
80
|
-
interface RouteConfig {
|
|
81
|
-
price: Price;
|
|
82
|
-
network: Network;
|
|
83
|
-
config?: PaymentMiddlewareConfig;
|
|
84
|
-
}
|
|
85
|
-
type RoutesConfig = Record<string, Price | RouteConfig>;
|
|
86
|
-
interface RoutePattern {
|
|
87
|
-
verb: string;
|
|
88
|
-
pattern: RegExp;
|
|
89
|
-
config: RouteConfig;
|
|
90
|
-
}
|
|
91
|
-
type Wallet = EvmSigner;
|
|
92
|
-
|
|
93
|
-
export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
|