@atxp/client 0.6.4 → 0.7.0

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/index.d.ts CHANGED
@@ -186,6 +186,38 @@ declare class ATXPAccount implements Account {
186
186
 
187
187
  declare const USDC_CONTRACT_ADDRESS_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
188
188
 
189
+ /**
190
+ * World Chain configuration type, compatible with viem's Chain interface
191
+ */
192
+ type WorldChain = {
193
+ readonly id: number;
194
+ readonly name: string;
195
+ readonly nativeCurrency: {
196
+ readonly name: string;
197
+ readonly symbol: string;
198
+ readonly decimals: number;
199
+ };
200
+ readonly rpcUrls: {
201
+ readonly default: {
202
+ readonly http: readonly string[];
203
+ };
204
+ };
205
+ readonly blockExplorers: {
206
+ readonly default: {
207
+ readonly name: string;
208
+ readonly url: string;
209
+ };
210
+ };
211
+ readonly testnet?: boolean;
212
+ };
213
+ declare const USDC_CONTRACT_ADDRESS_WORLD_MAINNET = "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1";
214
+ declare const WORLD_CHAIN_MAINNET: WorldChain;
215
+ /**
216
+ * Get World Chain Mainnet configuration with custom RPC URL (e.g., with API key)
217
+ * @param rpcUrl - Custom RPC URL, e.g., 'https://worldchain-mainnet.g.alchemy.com/v2/YOUR_API_KEY'
218
+ */
219
+ declare const getWorldChainMainnetWithRPC: (rpcUrl: string) => WorldChain;
220
+
189
221
  declare class BaseAccount implements Account {
190
222
  accountId: string;
191
223
  paymentMakers: {
@@ -249,5 +281,5 @@ declare class ATXPLocalAccount implements LocalAccount {
249
281
  readonly source: "custom";
250
282
  }
251
283
 
252
- export { ATXPAccount, ATXPLocalAccount, BaseAccount, BasePaymentMaker, DEFAULT_CLIENT_CONFIG, InsufficientFundsError, OAuthAuthenticationRequiredError, OAuthClient, PaymentNetworkError, SolanaAccount, SolanaPaymentMaker, USDC_CONTRACT_ADDRESS_BASE, ValidateTransferError, atxpClient, atxpFetch, buildClientConfig, buildStreamableTransport };
253
- export type { Account, AccountIdString, ClientArgs, ClientConfig, FetchWrapper, Hex, OAuthClientConfig, PaymentMaker, ProspectivePayment };
284
+ export { ATXPAccount, ATXPLocalAccount, BaseAccount, BasePaymentMaker, DEFAULT_CLIENT_CONFIG, InsufficientFundsError, OAuthAuthenticationRequiredError, OAuthClient, PaymentNetworkError, SolanaAccount, SolanaPaymentMaker, USDC_CONTRACT_ADDRESS_BASE, USDC_CONTRACT_ADDRESS_WORLD_MAINNET, ValidateTransferError, WORLD_CHAIN_MAINNET, atxpClient, atxpFetch, buildClientConfig, buildStreamableTransport, getWorldChainMainnetWithRPC };
285
+ export type { Account, AccountIdString, ClientArgs, ClientConfig, FetchWrapper, Hex, OAuthClientConfig, PaymentMaker, ProspectivePayment, WorldChain };
package/dist/index.js CHANGED
@@ -663,7 +663,6 @@ class ATXPFetcher {
663
663
  paymentRequests = messages.flatMap(message => parsePaymentRequests(message)).filter(pr => pr !== null);
664
664
  }
665
665
  else {
666
- // Handle regular JSON responses
667
666
  const json = JSON.parse(body);
668
667
  const messages = await parseMcpMessages(json);
669
668
  paymentRequests = messages.flatMap(message => parsePaymentRequests(message)).filter(pr => pr !== null);
@@ -16329,6 +16328,30 @@ class ATXPAccount {
16329
16328
  }
16330
16329
  }
16331
16330
 
16331
+ const USDC_CONTRACT_ADDRESS_WORLD_MAINNET = "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"; // USDC.e on World Chain mainnet
16332
+ // World Chain Mainnet (Chain ID: 480)
16333
+ const WORLD_CHAIN_MAINNET = {
16334
+ id: 480,
16335
+ name: 'World Chain',
16336
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
16337
+ rpcUrls: {
16338
+ default: { http: ['https://worldchain-mainnet.g.alchemy.com/public'] }
16339
+ },
16340
+ blockExplorers: {
16341
+ default: { name: 'WorldScan', url: 'https://worldscan.org' }
16342
+ }
16343
+ };
16344
+ /**
16345
+ * Get World Chain Mainnet configuration with custom RPC URL (e.g., with API key)
16346
+ * @param rpcUrl - Custom RPC URL, e.g., 'https://worldchain-mainnet.g.alchemy.com/v2/YOUR_API_KEY'
16347
+ */
16348
+ const getWorldChainMainnetWithRPC = (rpcUrl) => ({
16349
+ ...WORLD_CHAIN_MAINNET,
16350
+ rpcUrls: {
16351
+ default: { http: [rpcUrl] }
16352
+ }
16353
+ });
16354
+
16332
16355
  class BaseAccount {
16333
16356
  constructor(baseRPCUrl, sourceSecretKey) {
16334
16357
  if (!baseRPCUrl) {
@@ -16358,5 +16381,5 @@ class BaseAccount {
16358
16381
  }
16359
16382
  }
16360
16383
 
16361
- export { ATXPAccount, ATXPLocalAccount, BaseAccount, BasePaymentMaker, DEFAULT_CLIENT_CONFIG, InsufficientFundsError, OAuthAuthenticationRequiredError, OAuthClient, PaymentNetworkError, SolanaAccount, SolanaPaymentMaker, USDC_CONTRACT_ADDRESS_BASE, ValidateTransferError, atxpClient, atxpFetch, buildClientConfig, buildStreamableTransport };
16384
+ export { ATXPAccount, ATXPLocalAccount, BaseAccount, BasePaymentMaker, DEFAULT_CLIENT_CONFIG, InsufficientFundsError, OAuthAuthenticationRequiredError, OAuthClient, PaymentNetworkError, SolanaAccount, SolanaPaymentMaker, USDC_CONTRACT_ADDRESS_BASE, USDC_CONTRACT_ADDRESS_WORLD_MAINNET, ValidateTransferError, WORLD_CHAIN_MAINNET, atxpClient, atxpFetch, buildClientConfig, buildStreamableTransport, getWorldChainMainnetWithRPC };
16362
16385
  //# sourceMappingURL=index.js.map