@relai-fi/x402 0.6.2 → 0.6.4
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 +276 -0
- package/dist/index.cjs +26049 -2166
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +25985 -2105
- package/dist/index.js.map +1 -1
- package/dist/mpp/evm-client.cjs +23686 -0
- package/dist/mpp/evm-client.cjs.map +1 -0
- package/dist/mpp/evm-client.d.cts +38 -0
- package/dist/mpp/evm-client.d.ts +38 -0
- package/dist/mpp/evm-client.js +23656 -0
- package/dist/mpp/evm-client.js.map +1 -0
- package/dist/mpp/evm-method.cjs +13184 -0
- package/dist/mpp/evm-method.cjs.map +1 -0
- package/dist/mpp/evm-method.d.cts +50 -0
- package/dist/mpp/evm-method.d.ts +50 -0
- package/dist/mpp/evm-method.js +13163 -0
- package/dist/mpp/evm-method.js.map +1 -0
- package/dist/mpp/evm-server.cjs +13708 -0
- package/dist/mpp/evm-server.cjs.map +1 -0
- package/dist/mpp/evm-server.d.cts +52 -0
- package/dist/mpp/evm-server.d.ts +52 -0
- package/dist/mpp/evm-server.js +13687 -0
- package/dist/mpp/evm-server.js.map +1 -0
- package/package.json +18 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'mppx';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* EVM charge method for MPP — shared schema used by both server and client.
|
|
5
|
+
*
|
|
6
|
+
* Supports ERC-20 token transfers on any EVM chain (SKALE, Base, Polygon, etc.).
|
|
7
|
+
* The client sends a tx hash after broadcasting, and the server verifies the
|
|
8
|
+
* Transfer event on-chain.
|
|
9
|
+
*
|
|
10
|
+
* SKALE chains are gas-free, making them ideal for MPP micropayments.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare const charge: {
|
|
14
|
+
readonly intent: "charge";
|
|
15
|
+
readonly name: "evm";
|
|
16
|
+
readonly schema: {
|
|
17
|
+
readonly credential: {
|
|
18
|
+
readonly payload: z.ZodMiniObject<{
|
|
19
|
+
/** "hash" = client already broadcast, server verifies on-chain */
|
|
20
|
+
type: z.ZodMiniString<string>;
|
|
21
|
+
/** Transaction hash (0x-prefixed) */
|
|
22
|
+
hash: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
};
|
|
25
|
+
readonly request: z.ZodMiniObject<{
|
|
26
|
+
/** Amount in token base units (e.g. "10000" for $0.01 USDC with 6 decimals) */
|
|
27
|
+
amount: z.ZodMiniString<string>;
|
|
28
|
+
/** ERC-20 token contract address */
|
|
29
|
+
currency: z.ZodMiniString<string>;
|
|
30
|
+
/** Recipient EVM address */
|
|
31
|
+
recipient: z.ZodMiniString<string>;
|
|
32
|
+
/** Human-readable description */
|
|
33
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
34
|
+
methodDetails: z.ZodMiniObject<{
|
|
35
|
+
/** EVM chain ID */
|
|
36
|
+
chainId: z.ZodMiniNumber<number>;
|
|
37
|
+
/** Human-readable network name (e.g. "skale-base") */
|
|
38
|
+
network: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
39
|
+
/** Token decimals */
|
|
40
|
+
decimals: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
41
|
+
/** RPC URL for the chain (optional, server provides for client convenience) */
|
|
42
|
+
rpcUrl: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
|
+
/** Unique reference ID */
|
|
44
|
+
reference: z.ZodMiniString<string>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { charge };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'mppx';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* EVM charge method for MPP — shared schema used by both server and client.
|
|
5
|
+
*
|
|
6
|
+
* Supports ERC-20 token transfers on any EVM chain (SKALE, Base, Polygon, etc.).
|
|
7
|
+
* The client sends a tx hash after broadcasting, and the server verifies the
|
|
8
|
+
* Transfer event on-chain.
|
|
9
|
+
*
|
|
10
|
+
* SKALE chains are gas-free, making them ideal for MPP micropayments.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare const charge: {
|
|
14
|
+
readonly intent: "charge";
|
|
15
|
+
readonly name: "evm";
|
|
16
|
+
readonly schema: {
|
|
17
|
+
readonly credential: {
|
|
18
|
+
readonly payload: z.ZodMiniObject<{
|
|
19
|
+
/** "hash" = client already broadcast, server verifies on-chain */
|
|
20
|
+
type: z.ZodMiniString<string>;
|
|
21
|
+
/** Transaction hash (0x-prefixed) */
|
|
22
|
+
hash: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
};
|
|
25
|
+
readonly request: z.ZodMiniObject<{
|
|
26
|
+
/** Amount in token base units (e.g. "10000" for $0.01 USDC with 6 decimals) */
|
|
27
|
+
amount: z.ZodMiniString<string>;
|
|
28
|
+
/** ERC-20 token contract address */
|
|
29
|
+
currency: z.ZodMiniString<string>;
|
|
30
|
+
/** Recipient EVM address */
|
|
31
|
+
recipient: z.ZodMiniString<string>;
|
|
32
|
+
/** Human-readable description */
|
|
33
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
34
|
+
methodDetails: z.ZodMiniObject<{
|
|
35
|
+
/** EVM chain ID */
|
|
36
|
+
chainId: z.ZodMiniNumber<number>;
|
|
37
|
+
/** Human-readable network name (e.g. "skale-base") */
|
|
38
|
+
network: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
39
|
+
/** Token decimals */
|
|
40
|
+
decimals: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
41
|
+
/** RPC URL for the chain (optional, server provides for client convenience) */
|
|
42
|
+
rpcUrl: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
|
+
/** Unique reference ID */
|
|
44
|
+
reference: z.ZodMiniString<string>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { charge };
|