@atxp/client 0.7.1 → 0.7.3

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.
@@ -1,4 +1,5 @@
1
1
  const USDC_CONTRACT_ADDRESS_WORLD_MAINNET = "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"; // USDC.e on World Chain mainnet
2
+ const USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA = "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"; // USDC.e on World Chain Sepolia (placeholder - update with actual address)
2
3
  // World Chain Mainnet (Chain ID: 480)
3
4
  const WORLD_CHAIN_MAINNET = {
4
5
  id: 480,
@@ -11,6 +12,19 @@ const WORLD_CHAIN_MAINNET = {
11
12
  default: { name: 'WorldScan', url: 'https://worldscan.org' }
12
13
  }
13
14
  };
15
+ // World Chain Sepolia Testnet (Chain ID: 4801)
16
+ const WORLD_CHAIN_SEPOLIA = {
17
+ id: 4801,
18
+ name: 'World Chain Sepolia',
19
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
20
+ rpcUrls: {
21
+ default: { http: ['https://worldchain-sepolia.g.alchemy.com/public'] }
22
+ },
23
+ blockExplorers: {
24
+ default: { name: 'WorldScan Sepolia', url: 'https://sepolia.worldscan.org' }
25
+ },
26
+ testnet: true
27
+ };
14
28
  /**
15
29
  * Get World Chain Mainnet configuration with custom RPC URL (e.g., with API key)
16
30
  * @param rpcUrl - Custom RPC URL, e.g., 'https://worldchain-mainnet.g.alchemy.com/v2/YOUR_API_KEY'
@@ -21,6 +35,48 @@ const getWorldChainMainnetWithRPC = (rpcUrl) => ({
21
35
  default: { http: [rpcUrl] }
22
36
  }
23
37
  });
38
+ /**
39
+ * Get World Chain Sepolia configuration with custom RPC URL (e.g., with API key)
40
+ * @param rpcUrl - Custom RPC URL, e.g., 'https://worldchain-sepolia.g.alchemy.com/v2/YOUR_API_KEY'
41
+ */
42
+ const getWorldChainSepoliaWithRPC = (rpcUrl) => ({
43
+ ...WORLD_CHAIN_SEPOLIA,
44
+ rpcUrls: {
45
+ default: { http: [rpcUrl] }
46
+ }
47
+ });
48
+ /**
49
+ * Get World Chain configuration by chain ID
50
+ * @param chainId - Chain ID (480 for mainnet, 4801 for sepolia)
51
+ * @returns World Chain configuration
52
+ * @throws Error if chain ID is not supported
53
+ */
54
+ const getWorldChainByChainId = (chainId) => {
55
+ switch (chainId) {
56
+ case 480:
57
+ return WORLD_CHAIN_MAINNET;
58
+ case 4801:
59
+ return WORLD_CHAIN_SEPOLIA;
60
+ default:
61
+ throw new Error(`Unsupported World Chain ID: ${chainId}. Supported chains: 480 (mainnet), 4801 (sepolia)`);
62
+ }
63
+ };
64
+ /**
65
+ * Get USDC contract address for World Chain by chain ID
66
+ * @param chainId - Chain ID (480 for mainnet, 4801 for sepolia)
67
+ * @returns USDC contract address
68
+ * @throws Error if chain ID is not supported
69
+ */
70
+ const getWorldChainUSDCAddress = (chainId) => {
71
+ switch (chainId) {
72
+ case 480:
73
+ return USDC_CONTRACT_ADDRESS_WORLD_MAINNET;
74
+ case 4801:
75
+ return USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA;
76
+ default:
77
+ throw new Error(`Unsupported World Chain ID: ${chainId}. Supported chains: 480 (mainnet), 4801 (sepolia)`);
78
+ }
79
+ };
24
80
 
25
- export { USDC_CONTRACT_ADDRESS_WORLD_MAINNET, WORLD_CHAIN_MAINNET, getWorldChainMainnetWithRPC };
81
+ export { USDC_CONTRACT_ADDRESS_WORLD_MAINNET, USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA, WORLD_CHAIN_MAINNET, WORLD_CHAIN_SEPOLIA, getWorldChainByChainId, getWorldChainMainnetWithRPC, getWorldChainSepoliaWithRPC, getWorldChainUSDCAddress };
26
82
  //# sourceMappingURL=worldConstants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worldConstants.js","sources":["../src/worldConstants.ts"],"sourcesContent":[null],"names":[],"mappings":"AAoBO,MAAM,mC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D,CAAC;;AAEhH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atxp/client",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "ATXP Client - MCP client with OAuth authentication and payment processing",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "pack:dry": "npm pack --dry-run"
34
34
  },
35
35
  "dependencies": {
36
- "@atxp/common": "0.7.1",
36
+ "@atxp/common": "0.7.3",
37
37
  "@modelcontextprotocol/sdk": "^1.15.0",
38
38
  "bignumber.js": "^9.3.0",
39
39
  "oauth4webapi": "^3.5.0"