@relai-fi/x402 0.6.5 → 0.6.7
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 +251 -0
- package/dist/bridge.cjs +109 -0
- package/dist/bridge.cjs.map +1 -0
- package/dist/bridge.d.cts +78 -0
- package/dist/bridge.d.ts +78 -0
- package/dist/bridge.js +80 -0
- package/dist/bridge.js.map +1 -0
- package/dist/client.cjs +131 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +13 -1
- package/dist/client.d.ts +13 -1
- package/dist/client.js +131 -1
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +586 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +291 -30
- package/dist/index.d.ts +291 -30
- package/dist/index.js +578 -105
- package/dist/index.js.map +1 -1
- package/dist/mpp/bridge-client.cjs +23922 -0
- package/dist/mpp/bridge-client.cjs.map +1 -0
- package/dist/mpp/bridge-client.d.cts +58 -0
- package/dist/mpp/bridge-client.d.ts +58 -0
- package/dist/mpp/bridge-client.js +23892 -0
- package/dist/mpp/bridge-client.js.map +1 -0
- package/dist/mpp/bridge-method.cjs +13202 -0
- package/dist/mpp/bridge-method.cjs.map +1 -0
- package/dist/mpp/bridge-method.d.cts +69 -0
- package/dist/mpp/bridge-method.d.ts +69 -0
- package/dist/mpp/bridge-method.js +13181 -0
- package/dist/mpp/bridge-method.js.map +1 -0
- package/dist/mpp/bridge-server.cjs +13887 -0
- package/dist/mpp/bridge-server.cjs.map +1 -0
- package/dist/mpp/bridge-server.d.cts +62 -0
- package/dist/mpp/bridge-server.d.ts +62 -0
- package/dist/mpp/bridge-server.js +13866 -0
- package/dist/mpp/bridge-server.js.map +1 -0
- package/dist/mpp/evm-server.cjs +49 -33
- package/dist/mpp/evm-server.cjs.map +1 -1
- package/dist/mpp/evm-server.js +49 -33
- package/dist/mpp/evm-server.js.map +1 -1
- package/dist/mpp/verify-erc20.cjs +71 -0
- package/dist/mpp/verify-erc20.cjs.map +1 -0
- package/dist/mpp/verify-erc20.d.cts +27 -0
- package/dist/mpp/verify-erc20.d.ts +27 -0
- package/dist/mpp/verify-erc20.js +46 -0
- package/dist/mpp/verify-erc20.js.map +1 -0
- package/dist/mpp/verify-spl.cjs +96 -0
- package/dist/mpp/verify-spl.cjs.map +1 -0
- package/dist/mpp/verify-spl.d.cts +30 -0
- package/dist/mpp/verify-spl.d.ts +30 -0
- package/dist/mpp/verify-spl.js +71 -0
- package/dist/mpp/verify-spl.js.map +1 -0
- package/dist/mpp/with-bridge.cjs +23956 -0
- package/dist/mpp/with-bridge.cjs.map +1 -0
- package/dist/mpp/with-bridge.d.cts +53 -0
- package/dist/mpp/with-bridge.d.ts +53 -0
- package/dist/mpp/with-bridge.js +23926 -0
- package/dist/mpp/with-bridge.js.map +1 -0
- package/dist/plugins.d.cts +2 -2
- package/dist/plugins.d.ts +2 -2
- package/dist/react/index.cjs +131 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +131 -1
- package/dist/react/index.js.map +1 -1
- package/dist/{server-DaySqG5H.d.ts → server-D9ZfrFFx.d.ts} +1 -1
- package/dist/{server-CBZ2RjEP.d.cts → server-DgMG2zhy.d.cts} +1 -1
- package/dist/server.cjs +6 -39
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +6 -39
- package/dist/server.js.map +1 -1
- package/dist/{types-Y9ni5XwY.d.cts → types-DjEveKgt.d.cts} +1 -1
- package/dist/{types-Y9ni5XwY.d.ts → types-DjEveKgt.d.ts} +1 -1
- package/package.json +31 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
2
|
+
import * as zod_mini from 'zod/mini';
|
|
3
|
+
import { Method } from 'mppx';
|
|
4
|
+
import { Account } from 'viem';
|
|
5
|
+
|
|
6
|
+
interface EvmChargeWithBridgeConfig {
|
|
7
|
+
/** viem Account (from privateKeyToAccount or similar) */
|
|
8
|
+
evmAccount?: Account;
|
|
9
|
+
/** The EVM chain ID where this account lives (e.g., 4217 for Tempo, 8453 for Base) */
|
|
10
|
+
sourceChainId?: number;
|
|
11
|
+
/** RPC URL for the source chain (required for bridge payments) */
|
|
12
|
+
sourceRpcUrl?: string;
|
|
13
|
+
/** Solana keypair for Solana source chain payments */
|
|
14
|
+
solanaKeypair?: {
|
|
15
|
+
publicKey: {
|
|
16
|
+
toBase58(): string;
|
|
17
|
+
};
|
|
18
|
+
secretKey: Uint8Array;
|
|
19
|
+
};
|
|
20
|
+
/** Solana RPC URL (default: https://api.mainnet-beta.solana.com) */
|
|
21
|
+
solanaRpcUrl?: string;
|
|
22
|
+
/** Override RPC URLs per chain: { "eip155:4217": "https://..." } */
|
|
23
|
+
rpcUrls?: Record<string, string>;
|
|
24
|
+
/** RelAI API base URL for bridge auto-discovery (default: https://api.relai.fi) */
|
|
25
|
+
bridgeBaseUrl?: string;
|
|
26
|
+
}
|
|
27
|
+
declare function evmChargeWithBridge(config: EvmChargeWithBridgeConfig): Method.Client<{
|
|
28
|
+
readonly intent: "charge";
|
|
29
|
+
readonly name: "evm";
|
|
30
|
+
readonly schema: {
|
|
31
|
+
readonly credential: {
|
|
32
|
+
readonly payload: zod_mini.ZodMiniObject<{
|
|
33
|
+
type: zod_mini.ZodMiniString<string>;
|
|
34
|
+
hash: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
35
|
+
}, zod_v4_core.$strip>;
|
|
36
|
+
};
|
|
37
|
+
readonly request: zod_mini.ZodMiniObject<{
|
|
38
|
+
amount: zod_mini.ZodMiniString<string>;
|
|
39
|
+
currency: zod_mini.ZodMiniString<string>;
|
|
40
|
+
recipient: zod_mini.ZodMiniString<string>;
|
|
41
|
+
description: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
42
|
+
methodDetails: zod_mini.ZodMiniObject<{
|
|
43
|
+
chainId: zod_mini.ZodMiniNumber<number>;
|
|
44
|
+
network: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
45
|
+
decimals: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNumber<number>>;
|
|
46
|
+
rpcUrl: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
47
|
+
reference: zod_mini.ZodMiniString<string>;
|
|
48
|
+
}, zod_v4_core.$strip>;
|
|
49
|
+
}, zod_v4_core.$strip>;
|
|
50
|
+
};
|
|
51
|
+
}, undefined>;
|
|
52
|
+
|
|
53
|
+
export { type EvmChargeWithBridgeConfig, evmChargeWithBridge };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
2
|
+
import * as zod_mini from 'zod/mini';
|
|
3
|
+
import { Method } from 'mppx';
|
|
4
|
+
import { Account } from 'viem';
|
|
5
|
+
|
|
6
|
+
interface EvmChargeWithBridgeConfig {
|
|
7
|
+
/** viem Account (from privateKeyToAccount or similar) */
|
|
8
|
+
evmAccount?: Account;
|
|
9
|
+
/** The EVM chain ID where this account lives (e.g., 4217 for Tempo, 8453 for Base) */
|
|
10
|
+
sourceChainId?: number;
|
|
11
|
+
/** RPC URL for the source chain (required for bridge payments) */
|
|
12
|
+
sourceRpcUrl?: string;
|
|
13
|
+
/** Solana keypair for Solana source chain payments */
|
|
14
|
+
solanaKeypair?: {
|
|
15
|
+
publicKey: {
|
|
16
|
+
toBase58(): string;
|
|
17
|
+
};
|
|
18
|
+
secretKey: Uint8Array;
|
|
19
|
+
};
|
|
20
|
+
/** Solana RPC URL (default: https://api.mainnet-beta.solana.com) */
|
|
21
|
+
solanaRpcUrl?: string;
|
|
22
|
+
/** Override RPC URLs per chain: { "eip155:4217": "https://..." } */
|
|
23
|
+
rpcUrls?: Record<string, string>;
|
|
24
|
+
/** RelAI API base URL for bridge auto-discovery (default: https://api.relai.fi) */
|
|
25
|
+
bridgeBaseUrl?: string;
|
|
26
|
+
}
|
|
27
|
+
declare function evmChargeWithBridge(config: EvmChargeWithBridgeConfig): Method.Client<{
|
|
28
|
+
readonly intent: "charge";
|
|
29
|
+
readonly name: "evm";
|
|
30
|
+
readonly schema: {
|
|
31
|
+
readonly credential: {
|
|
32
|
+
readonly payload: zod_mini.ZodMiniObject<{
|
|
33
|
+
type: zod_mini.ZodMiniString<string>;
|
|
34
|
+
hash: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
35
|
+
}, zod_v4_core.$strip>;
|
|
36
|
+
};
|
|
37
|
+
readonly request: zod_mini.ZodMiniObject<{
|
|
38
|
+
amount: zod_mini.ZodMiniString<string>;
|
|
39
|
+
currency: zod_mini.ZodMiniString<string>;
|
|
40
|
+
recipient: zod_mini.ZodMiniString<string>;
|
|
41
|
+
description: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
42
|
+
methodDetails: zod_mini.ZodMiniObject<{
|
|
43
|
+
chainId: zod_mini.ZodMiniNumber<number>;
|
|
44
|
+
network: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
45
|
+
decimals: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNumber<number>>;
|
|
46
|
+
rpcUrl: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
|
|
47
|
+
reference: zod_mini.ZodMiniString<string>;
|
|
48
|
+
}, zod_v4_core.$strip>;
|
|
49
|
+
}, zod_v4_core.$strip>;
|
|
50
|
+
};
|
|
51
|
+
}, undefined>;
|
|
52
|
+
|
|
53
|
+
export { type EvmChargeWithBridgeConfig, evmChargeWithBridge };
|