@4mica/x402 1.0.2 → 1.2.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/client/scheme.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/server/scheme.js +7 -1
- package/dist/types.d.ts +22 -0
- package/dist/types.js +1 -0
- package/package.json +4 -4
- package/src/client/scheme.ts +1 -0
- package/src/server/scheme.ts +7 -1
package/dist/client/scheme.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Client, ConfigBuilder, X402Flow, } from '@4mica/sdk';
|
|
|
2
2
|
import { SUPPORTED_NETWORKS } from '../server/scheme.js';
|
|
3
3
|
const NETWORK_RPC_URLS = {
|
|
4
4
|
'eip155:11155111': 'https://ethereum.sepolia.api.4mica.xyz',
|
|
5
|
+
'eip155:84532': 'https://base.sepolia.api.4mica.xyz',
|
|
5
6
|
'eip155:80002': 'https://api.4mica.xyz',
|
|
6
7
|
};
|
|
7
8
|
export class FourMicaEvmScheme {
|
package/dist/index.d.ts
CHANGED
package/dist/server/scheme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const SUPPORTED_NETWORKS = ['eip155:11155111', 'eip155:80002'];
|
|
1
|
+
export const SUPPORTED_NETWORKS = ['eip155:11155111', 'eip155:84532', 'eip155:80002'];
|
|
2
2
|
/**
|
|
3
3
|
* EVM server implementation for the 4mica payment scheme.
|
|
4
4
|
*/
|
|
@@ -163,6 +163,12 @@ export class FourMicaEvmScheme {
|
|
|
163
163
|
version: '2',
|
|
164
164
|
decimals: 6,
|
|
165
165
|
}, // Ethereum Sepolia USDC
|
|
166
|
+
'eip155:84532': {
|
|
167
|
+
address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
|
|
168
|
+
name: 'USDC',
|
|
169
|
+
version: '2',
|
|
170
|
+
decimals: 6,
|
|
171
|
+
}, // Base Sepolia USDC
|
|
166
172
|
'eip155:80002': {
|
|
167
173
|
address: '0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582',
|
|
168
174
|
name: 'USDC',
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PaymentRequirements } from '@x402/core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Extra fields required by the 4mica V2 validation policy.
|
|
4
|
+
*/
|
|
5
|
+
export type FourMicaV2RequirementsExtra = {
|
|
6
|
+
validationRegistryAddress: string;
|
|
7
|
+
validatorAddress: string;
|
|
8
|
+
validatorAgentId: string | number;
|
|
9
|
+
minValidationScore: number;
|
|
10
|
+
jobHash: string;
|
|
11
|
+
requiredValidationTag?: string;
|
|
12
|
+
tabEndpoint?: string;
|
|
13
|
+
rpcUrl?: string;
|
|
14
|
+
resource?: {
|
|
15
|
+
url?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
mimeType?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type FourMicaPaymentRequirementsV2 = PaymentRequirements & {
|
|
21
|
+
extra: FourMicaV2RequirementsExtra;
|
|
22
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4mica/x402",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript x402 utilities for interacting with the 4Mica payment network",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"demo:dev": "cd demo && yarn dev"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@x402/core": "^2.
|
|
46
|
-
"@x402/extensions": "^2.
|
|
47
|
-
"@4mica/sdk": "^
|
|
45
|
+
"@x402/core": "^2.9.0",
|
|
46
|
+
"@x402/extensions": "^2.9.0",
|
|
47
|
+
"@4mica/sdk": "^1.2.3",
|
|
48
48
|
"viem": "^2.45.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
package/src/client/scheme.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { SUPPORTED_NETWORKS } from '../server/scheme.js'
|
|
|
12
12
|
|
|
13
13
|
const NETWORK_RPC_URLS: Record<Network, string> = {
|
|
14
14
|
'eip155:11155111': 'https://ethereum.sepolia.api.4mica.xyz',
|
|
15
|
+
'eip155:84532': 'https://base.sepolia.api.4mica.xyz',
|
|
15
16
|
'eip155:80002': 'https://api.4mica.xyz',
|
|
16
17
|
}
|
|
17
18
|
|
package/src/server/scheme.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
MoneyParser,
|
|
8
8
|
} from '@x402/core/types'
|
|
9
9
|
|
|
10
|
-
export const SUPPORTED_NETWORKS: Network[] = ['eip155:11155111', 'eip155:80002']
|
|
10
|
+
export const SUPPORTED_NETWORKS: Network[] = ['eip155:11155111', 'eip155:84532', 'eip155:80002']
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* EVM server implementation for the 4mica payment scheme.
|
|
@@ -205,6 +205,12 @@ export class FourMicaEvmScheme implements SchemeNetworkServer {
|
|
|
205
205
|
version: '2',
|
|
206
206
|
decimals: 6,
|
|
207
207
|
}, // Ethereum Sepolia USDC
|
|
208
|
+
'eip155:84532': {
|
|
209
|
+
address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
|
|
210
|
+
name: 'USDC',
|
|
211
|
+
version: '2',
|
|
212
|
+
decimals: 6,
|
|
213
|
+
}, // Base Sepolia USDC
|
|
208
214
|
'eip155:80002': {
|
|
209
215
|
address: '0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582',
|
|
210
216
|
name: 'USDC',
|