@atxp/client 0.7.1 → 0.7.2
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/baseConstants.js +18 -1
- package/dist/baseConstants.js.map +1 -1
- package/dist/index.cjs +80 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +74 -1
- package/dist/index.js.map +1 -1
- package/dist/worldConstants.js +57 -1
- package/dist/worldConstants.js.map +1 -1
- package/package.json +2 -2
package/dist/baseConstants.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
const USDC_CONTRACT_ADDRESS_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"; // USDC on Base mainnet
|
|
2
|
+
const USDC_CONTRACT_ADDRESS_BASE_SEPOLIA = "0x036CbD53842c5426634e7929541eC2318f3dCF7e"; // USDC on Base Sepolia testnet
|
|
3
|
+
/**
|
|
4
|
+
* Get USDC contract address for Base chain by chain ID
|
|
5
|
+
* @param chainId - Chain ID (8453 for mainnet, 84532 for sepolia)
|
|
6
|
+
* @returns USDC contract address
|
|
7
|
+
* @throws Error if chain ID is not supported
|
|
8
|
+
*/
|
|
9
|
+
const getBaseUSDCAddress = (chainId) => {
|
|
10
|
+
switch (chainId) {
|
|
11
|
+
case 8453: // Base mainnet
|
|
12
|
+
return USDC_CONTRACT_ADDRESS_BASE;
|
|
13
|
+
case 84532: // Base Sepolia
|
|
14
|
+
return USDC_CONTRACT_ADDRESS_BASE_SEPOLIA;
|
|
15
|
+
default:
|
|
16
|
+
throw new Error(`Unsupported Base Chain ID: ${chainId}. Supported chains: 8453 (mainnet), 84532 (sepolia)`);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
2
19
|
|
|
3
|
-
export { USDC_CONTRACT_ADDRESS_BASE };
|
|
20
|
+
export { USDC_CONTRACT_ADDRESS_BASE, USDC_CONTRACT_ADDRESS_BASE_SEPOLIA, getBaseUSDCAddress };
|
|
4
21
|
//# sourceMappingURL=baseConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseConstants.js","sources":["../src/baseConstants.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,0BAA0B,GAAG,6CAA6C;;;;"}
|
|
1
|
+
{"version":3,"file":"baseConstants.js","sources":["../src/baseConstants.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,0BAA0B,GAAG,6CAA6C;AAChF,MAAM,kCAAkC,GAAG,6CAA6C;AAE/F;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,OAAe,KAAY;IAC5D,QAAQ,OAAO;QACb,KAAK,IAAI;AACP,YAAA,OAAO,0BAA0B;QACnC,KAAK,KAAK;AACR,YAAA,OAAO,kCAAkC;AAC3C,QAAA;AACE,YAAA,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,CAAA,mDAAA,CAAqD,CAAC;;AAEjH;;;;"}
|
package/dist/index.cjs
CHANGED
|
@@ -15999,6 +15999,23 @@ class SolanaPaymentMaker {
|
|
|
15999
15999
|
}
|
|
16000
16000
|
|
|
16001
16001
|
const USDC_CONTRACT_ADDRESS_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"; // USDC on Base mainnet
|
|
16002
|
+
const USDC_CONTRACT_ADDRESS_BASE_SEPOLIA = "0x036CbD53842c5426634e7929541eC2318f3dCF7e"; // USDC on Base Sepolia testnet
|
|
16003
|
+
/**
|
|
16004
|
+
* Get USDC contract address for Base chain by chain ID
|
|
16005
|
+
* @param chainId - Chain ID (8453 for mainnet, 84532 for sepolia)
|
|
16006
|
+
* @returns USDC contract address
|
|
16007
|
+
* @throws Error if chain ID is not supported
|
|
16008
|
+
*/
|
|
16009
|
+
const getBaseUSDCAddress = (chainId) => {
|
|
16010
|
+
switch (chainId) {
|
|
16011
|
+
case 8453: // Base mainnet
|
|
16012
|
+
return USDC_CONTRACT_ADDRESS_BASE;
|
|
16013
|
+
case 84532: // Base Sepolia
|
|
16014
|
+
return USDC_CONTRACT_ADDRESS_BASE_SEPOLIA;
|
|
16015
|
+
default:
|
|
16016
|
+
throw new Error(`Unsupported Base Chain ID: ${chainId}. Supported chains: 8453 (mainnet), 84532 (sepolia)`);
|
|
16017
|
+
}
|
|
16018
|
+
};
|
|
16002
16019
|
|
|
16003
16020
|
// Helper function to convert to base64url that works in both Node.js and browsers
|
|
16004
16021
|
function toBase64Url(data) {
|
|
@@ -16350,6 +16367,7 @@ class ATXPAccount {
|
|
|
16350
16367
|
}
|
|
16351
16368
|
|
|
16352
16369
|
const USDC_CONTRACT_ADDRESS_WORLD_MAINNET = "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"; // USDC.e on World Chain mainnet
|
|
16370
|
+
const USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA = "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"; // USDC.e on World Chain Sepolia (placeholder - update with actual address)
|
|
16353
16371
|
// World Chain Mainnet (Chain ID: 480)
|
|
16354
16372
|
const WORLD_CHAIN_MAINNET = {
|
|
16355
16373
|
id: 480,
|
|
@@ -16362,6 +16380,19 @@ const WORLD_CHAIN_MAINNET = {
|
|
|
16362
16380
|
default: { name: 'WorldScan', url: 'https://worldscan.org' }
|
|
16363
16381
|
}
|
|
16364
16382
|
};
|
|
16383
|
+
// World Chain Sepolia Testnet (Chain ID: 4801)
|
|
16384
|
+
const WORLD_CHAIN_SEPOLIA = {
|
|
16385
|
+
id: 4801,
|
|
16386
|
+
name: 'World Chain Sepolia',
|
|
16387
|
+
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
|
|
16388
|
+
rpcUrls: {
|
|
16389
|
+
default: { http: ['https://worldchain-sepolia.g.alchemy.com/public'] }
|
|
16390
|
+
},
|
|
16391
|
+
blockExplorers: {
|
|
16392
|
+
default: { name: 'WorldScan Sepolia', url: 'https://sepolia.worldscan.org' }
|
|
16393
|
+
},
|
|
16394
|
+
testnet: true
|
|
16395
|
+
};
|
|
16365
16396
|
/**
|
|
16366
16397
|
* Get World Chain Mainnet configuration with custom RPC URL (e.g., with API key)
|
|
16367
16398
|
* @param rpcUrl - Custom RPC URL, e.g., 'https://worldchain-mainnet.g.alchemy.com/v2/YOUR_API_KEY'
|
|
@@ -16372,6 +16403,48 @@ const getWorldChainMainnetWithRPC = (rpcUrl) => ({
|
|
|
16372
16403
|
default: { http: [rpcUrl] }
|
|
16373
16404
|
}
|
|
16374
16405
|
});
|
|
16406
|
+
/**
|
|
16407
|
+
* Get World Chain Sepolia configuration with custom RPC URL (e.g., with API key)
|
|
16408
|
+
* @param rpcUrl - Custom RPC URL, e.g., 'https://worldchain-sepolia.g.alchemy.com/v2/YOUR_API_KEY'
|
|
16409
|
+
*/
|
|
16410
|
+
const getWorldChainSepoliaWithRPC = (rpcUrl) => ({
|
|
16411
|
+
...WORLD_CHAIN_SEPOLIA,
|
|
16412
|
+
rpcUrls: {
|
|
16413
|
+
default: { http: [rpcUrl] }
|
|
16414
|
+
}
|
|
16415
|
+
});
|
|
16416
|
+
/**
|
|
16417
|
+
* Get World Chain configuration by chain ID
|
|
16418
|
+
* @param chainId - Chain ID (480 for mainnet, 4801 for sepolia)
|
|
16419
|
+
* @returns World Chain configuration
|
|
16420
|
+
* @throws Error if chain ID is not supported
|
|
16421
|
+
*/
|
|
16422
|
+
const getWorldChainByChainId = (chainId) => {
|
|
16423
|
+
switch (chainId) {
|
|
16424
|
+
case 480:
|
|
16425
|
+
return WORLD_CHAIN_MAINNET;
|
|
16426
|
+
case 4801:
|
|
16427
|
+
return WORLD_CHAIN_SEPOLIA;
|
|
16428
|
+
default:
|
|
16429
|
+
throw new Error(`Unsupported World Chain ID: ${chainId}. Supported chains: 480 (mainnet), 4801 (sepolia)`);
|
|
16430
|
+
}
|
|
16431
|
+
};
|
|
16432
|
+
/**
|
|
16433
|
+
* Get USDC contract address for World Chain by chain ID
|
|
16434
|
+
* @param chainId - Chain ID (480 for mainnet, 4801 for sepolia)
|
|
16435
|
+
* @returns USDC contract address
|
|
16436
|
+
* @throws Error if chain ID is not supported
|
|
16437
|
+
*/
|
|
16438
|
+
const getWorldChainUSDCAddress = (chainId) => {
|
|
16439
|
+
switch (chainId) {
|
|
16440
|
+
case 480:
|
|
16441
|
+
return USDC_CONTRACT_ADDRESS_WORLD_MAINNET;
|
|
16442
|
+
case 4801:
|
|
16443
|
+
return USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA;
|
|
16444
|
+
default:
|
|
16445
|
+
throw new Error(`Unsupported World Chain ID: ${chainId}. Supported chains: 480 (mainnet), 4801 (sepolia)`);
|
|
16446
|
+
}
|
|
16447
|
+
};
|
|
16375
16448
|
|
|
16376
16449
|
class BaseAccount {
|
|
16377
16450
|
constructor(baseRPCUrl, sourceSecretKey) {
|
|
@@ -16414,12 +16487,19 @@ exports.PaymentNetworkError = PaymentNetworkError;
|
|
|
16414
16487
|
exports.SolanaAccount = SolanaAccount;
|
|
16415
16488
|
exports.SolanaPaymentMaker = SolanaPaymentMaker;
|
|
16416
16489
|
exports.USDC_CONTRACT_ADDRESS_BASE = USDC_CONTRACT_ADDRESS_BASE;
|
|
16490
|
+
exports.USDC_CONTRACT_ADDRESS_BASE_SEPOLIA = USDC_CONTRACT_ADDRESS_BASE_SEPOLIA;
|
|
16417
16491
|
exports.USDC_CONTRACT_ADDRESS_WORLD_MAINNET = USDC_CONTRACT_ADDRESS_WORLD_MAINNET;
|
|
16492
|
+
exports.USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA = USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA;
|
|
16418
16493
|
exports.ValidateTransferError = ValidateTransferError;
|
|
16419
16494
|
exports.WORLD_CHAIN_MAINNET = WORLD_CHAIN_MAINNET;
|
|
16495
|
+
exports.WORLD_CHAIN_SEPOLIA = WORLD_CHAIN_SEPOLIA;
|
|
16420
16496
|
exports.atxpClient = atxpClient;
|
|
16421
16497
|
exports.atxpFetch = atxpFetch;
|
|
16422
16498
|
exports.buildClientConfig = buildClientConfig;
|
|
16423
16499
|
exports.buildStreamableTransport = buildStreamableTransport;
|
|
16500
|
+
exports.getBaseUSDCAddress = getBaseUSDCAddress;
|
|
16501
|
+
exports.getWorldChainByChainId = getWorldChainByChainId;
|
|
16424
16502
|
exports.getWorldChainMainnetWithRPC = getWorldChainMainnetWithRPC;
|
|
16503
|
+
exports.getWorldChainSepoliaWithRPC = getWorldChainSepoliaWithRPC;
|
|
16504
|
+
exports.getWorldChainUSDCAddress = getWorldChainUSDCAddress;
|
|
16425
16505
|
//# sourceMappingURL=index.cjs.map
|