uvd-x402-sdk 2.11.1 → 2.13.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.
Files changed (53) hide show
  1. package/dist/adapters/index.d.mts +1 -1
  2. package/dist/adapters/index.d.ts +1 -1
  3. package/dist/adapters/index.js.map +1 -1
  4. package/dist/adapters/index.mjs.map +1 -1
  5. package/dist/backend/index.d.mts +1 -1
  6. package/dist/backend/index.d.ts +1 -1
  7. package/dist/backend/index.js.map +1 -1
  8. package/dist/backend/index.mjs.map +1 -1
  9. package/dist/{index-C60c_e5z.d.mts → index-C6Vxnneo.d.mts} +1 -1
  10. package/dist/{index-VIOUicmO.d.ts → index-DmJGKD9r.d.ts} +1 -1
  11. package/dist/{index-D-dO_FoP.d.mts → index-fIhvHqCQ.d.mts} +18 -22
  12. package/dist/{index-D-dO_FoP.d.ts → index-fIhvHqCQ.d.ts} +18 -22
  13. package/dist/index.d.mts +56 -2
  14. package/dist/index.d.ts +56 -2
  15. package/dist/index.js +59 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +58 -1
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/providers/algorand/index.d.mts +11 -5
  20. package/dist/providers/algorand/index.d.ts +11 -5
  21. package/dist/providers/algorand/index.js +142 -27
  22. package/dist/providers/algorand/index.js.map +1 -1
  23. package/dist/providers/algorand/index.mjs +142 -27
  24. package/dist/providers/algorand/index.mjs.map +1 -1
  25. package/dist/providers/evm/index.d.mts +1 -1
  26. package/dist/providers/evm/index.d.ts +1 -1
  27. package/dist/providers/evm/index.js.map +1 -1
  28. package/dist/providers/evm/index.mjs.map +1 -1
  29. package/dist/providers/near/index.d.mts +1 -1
  30. package/dist/providers/near/index.d.ts +1 -1
  31. package/dist/providers/near/index.js.map +1 -1
  32. package/dist/providers/near/index.mjs.map +1 -1
  33. package/dist/providers/solana/index.d.mts +1 -1
  34. package/dist/providers/solana/index.d.ts +1 -1
  35. package/dist/providers/solana/index.js.map +1 -1
  36. package/dist/providers/solana/index.mjs.map +1 -1
  37. package/dist/providers/stellar/index.d.mts +1 -1
  38. package/dist/providers/stellar/index.d.ts +1 -1
  39. package/dist/providers/stellar/index.js.map +1 -1
  40. package/dist/providers/stellar/index.mjs.map +1 -1
  41. package/dist/react/index.d.mts +3 -3
  42. package/dist/react/index.d.ts +3 -3
  43. package/dist/react/index.js.map +1 -1
  44. package/dist/react/index.mjs.map +1 -1
  45. package/dist/utils/index.d.mts +1 -1
  46. package/dist/utils/index.d.ts +1 -1
  47. package/dist/utils/index.js.map +1 -1
  48. package/dist/utils/index.mjs.map +1 -1
  49. package/package.json +1 -1
  50. package/src/facilitator.ts +106 -0
  51. package/src/index.ts +4 -0
  52. package/src/providers/algorand/index.ts +122 -32
  53. package/src/types/index.ts +18 -22
@@ -1,4 +1,4 @@
1
- import { w as X402ClientConfig, P as PaymentInfo, f as PaymentResult, W as WalletState, C as ChainConfig, y as X402Event, B as X402EventHandler, a as NetworkType, T as TokenType, b as TokenConfig } from './index-D-dO_FoP.mjs';
1
+ import { w as X402ClientConfig, P as PaymentInfo, f as PaymentResult, W as WalletState, C as ChainConfig, y as X402Event, B as X402EventHandler, a as NetworkType, T as TokenType, b as TokenConfig } from './index-fIhvHqCQ.mjs';
2
2
 
3
3
  /**
4
4
  * uvd-x402-sdk - Main Client
@@ -1,4 +1,4 @@
1
- import { w as X402ClientConfig, P as PaymentInfo, f as PaymentResult, W as WalletState, C as ChainConfig, y as X402Event, B as X402EventHandler, a as NetworkType, T as TokenType, b as TokenConfig } from './index-D-dO_FoP.js';
1
+ import { w as X402ClientConfig, P as PaymentInfo, f as PaymentResult, W as WalletState, C as ChainConfig, y as X402Event, B as X402EventHandler, a as NetworkType, T as TokenType, b as TokenConfig } from './index-fIhvHqCQ.js';
2
2
 
3
3
  /**
4
4
  * uvd-x402-sdk - Main Client
@@ -304,23 +304,21 @@ interface NEARPaymentPayload {
304
304
  /**
305
305
  * Algorand payment payload (atomic transaction group)
306
306
  *
307
- * Algorand uses a unique payment model where the facilitator creates and signs
308
- * an atomic transaction group. The user signs their portion (the ASA transfer)
309
- * and the facilitator submits the complete group.
307
+ * Follows the GoPlausible x402-avm spec for atomic groups:
308
+ * - Transaction 0: Fee payment (UNSIGNED) - facilitator -> facilitator, covers all fees
309
+ * - Transaction 1: ASA transfer (SIGNED) - client -> merchant
310
+ *
311
+ * The facilitator signs transaction 0 and submits the complete atomic group.
310
312
  */
311
313
  interface AlgorandPaymentPayload {
312
- /** Sender's Algorand address (58-character base32) */
313
- from: string;
314
- /** Recipient's Algorand address */
315
- to: string;
316
- /** Amount in base units (microAlgos for ALGO, or base units for ASA) */
317
- amount: string;
318
- /** USDC ASA ID (31566704 for mainnet, 10458941 for testnet) */
319
- assetId: number;
320
- /** Base64-encoded signed transaction bytes */
321
- signedTxn: string;
322
- /** Optional note field */
323
- note?: string;
314
+ /** Index of the payment transaction in the group (always 1) */
315
+ paymentIndex: number;
316
+ /**
317
+ * Array of base64-encoded msgpack transactions forming the atomic group:
318
+ * - [0]: Unsigned fee transaction (facilitator signs)
319
+ * - [1]: Signed ASA transfer (client signed)
320
+ */
321
+ paymentGroup: string[];
324
322
  }
325
323
  /**
326
324
  * Union type for all payment payloads
@@ -410,15 +408,13 @@ interface X402NEARPayload {
410
408
  signedDelegateAction: string;
411
409
  }
412
410
  /**
413
- * Algorand-specific payload in x402 header
411
+ * Algorand-specific payload in x402 header (atomic group format)
414
412
  */
415
413
  interface X402AlgorandPayload {
416
- from: string;
417
- to: string;
418
- amount: string;
419
- assetId: number;
420
- signedTxn: string;
421
- note?: string;
414
+ /** Index of the payment transaction in the group (always 1) */
415
+ paymentIndex: number;
416
+ /** Array of base64-encoded msgpack transactions */
417
+ paymentGroup: string[];
422
418
  }
423
419
  /**
424
420
  * Union of all x402 payload types
@@ -304,23 +304,21 @@ interface NEARPaymentPayload {
304
304
  /**
305
305
  * Algorand payment payload (atomic transaction group)
306
306
  *
307
- * Algorand uses a unique payment model where the facilitator creates and signs
308
- * an atomic transaction group. The user signs their portion (the ASA transfer)
309
- * and the facilitator submits the complete group.
307
+ * Follows the GoPlausible x402-avm spec for atomic groups:
308
+ * - Transaction 0: Fee payment (UNSIGNED) - facilitator -> facilitator, covers all fees
309
+ * - Transaction 1: ASA transfer (SIGNED) - client -> merchant
310
+ *
311
+ * The facilitator signs transaction 0 and submits the complete atomic group.
310
312
  */
311
313
  interface AlgorandPaymentPayload {
312
- /** Sender's Algorand address (58-character base32) */
313
- from: string;
314
- /** Recipient's Algorand address */
315
- to: string;
316
- /** Amount in base units (microAlgos for ALGO, or base units for ASA) */
317
- amount: string;
318
- /** USDC ASA ID (31566704 for mainnet, 10458941 for testnet) */
319
- assetId: number;
320
- /** Base64-encoded signed transaction bytes */
321
- signedTxn: string;
322
- /** Optional note field */
323
- note?: string;
314
+ /** Index of the payment transaction in the group (always 1) */
315
+ paymentIndex: number;
316
+ /**
317
+ * Array of base64-encoded msgpack transactions forming the atomic group:
318
+ * - [0]: Unsigned fee transaction (facilitator signs)
319
+ * - [1]: Signed ASA transfer (client signed)
320
+ */
321
+ paymentGroup: string[];
324
322
  }
325
323
  /**
326
324
  * Union type for all payment payloads
@@ -410,15 +408,13 @@ interface X402NEARPayload {
410
408
  signedDelegateAction: string;
411
409
  }
412
410
  /**
413
- * Algorand-specific payload in x402 header
411
+ * Algorand-specific payload in x402 header (atomic group format)
414
412
  */
415
413
  interface X402AlgorandPayload {
416
- from: string;
417
- to: string;
418
- amount: string;
419
- assetId: number;
420
- signedTxn: string;
421
- note?: string;
414
+ /** Index of the payment transaction in the group (always 1) */
415
+ paymentIndex: number;
416
+ /** Array of base64-encoded msgpack transactions */
417
+ paymentGroup: string[];
422
418
  }
423
419
  /**
424
420
  * Union of all x402 payload types
package/dist/index.d.mts CHANGED
@@ -1,3 +1,57 @@
1
- export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client, q as getAlgorandChains, g as getChainById, b as getChainByName, d as getChainsByNetworkType, p as getChainsByToken, e as getEVMChainIds, c as getEnabledChains, l as getExplorerAddressUrl, k as getExplorerTxUrl, j as getNetworkType, f as getSVMChains, n as getSupportedTokens, m as getTokenConfig, r as isAlgorandChain, i as isChainSupported, h as isSVMChain, o as isTokenSupported } from './index-C60c_e5z.mjs';
1
+ export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client, q as getAlgorandChains, g as getChainById, b as getChainByName, d as getChainsByNetworkType, p as getChainsByToken, e as getEVMChainIds, c as getEnabledChains, l as getExplorerAddressUrl, k as getExplorerTxUrl, j as getNetworkType, f as getSVMChains, n as getSupportedTokens, m as getTokenConfig, r as isAlgorandChain, i as isChainSupported, h as isSVMChain, o as isTokenSupported } from './index-C6Vxnneo.mjs';
2
2
  export { DEFAULT_PAYMENT_HEADER, PAYMENT_HEADER_NAMES, caip2ToChain, chainToCAIP2, convertX402Header, createPaymentHeaders, createX402Header, createX402V1Header, createX402V2Header, decodeX402Header, detectX402Version, encodeX402Header, generatePaymentOptions, getPaymentHeader, isCAIP2Format, parseNetworkIdentifier, validateAmount, validateRecipient } from './utils/index.mjs';
3
- export { A as AlgorandPaymentPayload, H as CAIP2_IDENTIFIERS, I as CAIP2_TO_CHAIN, C as ChainConfig, G as DEFAULT_CONFIG, E as EIP712Domain, d as EIP712Types, i as EVMPaymentPayload, M as MultiPaymentConfig, k as NEARPaymentPayload, N as NativeCurrency, x as NetworkBalance, a as NetworkType, g as PaymentHeaders, P as PaymentInfo, h as PaymentPayload, e as PaymentRequest, f as PaymentResult, S as SolanaPaymentPayload, j as StellarPaymentPayload, b as TokenConfig, T as TokenType, U as USDCConfig, c as WalletAdapter, W as WalletState, v as X402AlgorandPayload, w as X402ClientConfig, r as X402EVMPayload, F as X402Error, D as X402ErrorCode, y as X402Event, z as X402EventData, B as X402EventHandler, m as X402Header, X as X402HeaderName, n as X402HeaderV1, o as X402HeaderV2, u as X402NEARPayload, q as X402PayloadData, p as X402PaymentOption, s as X402SolanaPayload, t as X402StellarPayload, l as X402Version } from './index-D-dO_FoP.mjs';
3
+ export { A as AlgorandPaymentPayload, H as CAIP2_IDENTIFIERS, I as CAIP2_TO_CHAIN, C as ChainConfig, G as DEFAULT_CONFIG, E as EIP712Domain, d as EIP712Types, i as EVMPaymentPayload, M as MultiPaymentConfig, k as NEARPaymentPayload, N as NativeCurrency, x as NetworkBalance, a as NetworkType, g as PaymentHeaders, P as PaymentInfo, h as PaymentPayload, e as PaymentRequest, f as PaymentResult, S as SolanaPaymentPayload, j as StellarPaymentPayload, b as TokenConfig, T as TokenType, U as USDCConfig, c as WalletAdapter, W as WalletState, v as X402AlgorandPayload, w as X402ClientConfig, r as X402EVMPayload, F as X402Error, D as X402ErrorCode, y as X402Event, z as X402EventData, B as X402EventHandler, m as X402Header, X as X402HeaderName, n as X402HeaderV1, o as X402HeaderV2, u as X402NEARPayload, q as X402PayloadData, p as X402PaymentOption, s as X402SolanaPayload, t as X402StellarPayload, l as X402Version } from './index-fIhvHqCQ.mjs';
4
+
5
+ /**
6
+ * Facilitator wallet addresses by chain type
7
+ *
8
+ * These are the public addresses of the facilitator's wallets.
9
+ * The facilitator uses these to pay fees and sign transactions.
10
+ */
11
+ declare const FACILITATOR_ADDRESSES: {
12
+ /**
13
+ * Solana facilitator address (fee payer)
14
+ * Used for: Paying transaction fees on Solana
15
+ */
16
+ readonly solana: "F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq";
17
+ /**
18
+ * Algorand facilitator address (fee payer)
19
+ * Used for: Signing Transaction 0 (fee tx) in atomic groups
20
+ * Note: This is derived from the facilitator's Algorand mnemonic
21
+ */
22
+ readonly algorand: "SXHRBXS22SKKXHXK44DTQMWN2SXK3SFJWBDAQZGF4DRPW7PNFAUM2GYFAQ";
23
+ /**
24
+ * Algorand testnet facilitator address
25
+ */
26
+ readonly 'algorand-testnet': "SXHRBXS22SKKXHXK44DTQMWN2SXK3SFJWBDAQZGF4DRPW7PNFAUM2GYFAQ";
27
+ /**
28
+ * EVM facilitator address
29
+ * Used for: Submitting EIP-3009 transferWithAuthorization transactions
30
+ * Note: Same address across all EVM chains
31
+ */
32
+ readonly evm: "0x7c5F3AdB0C7775968Bc7e7cF61b27fECf2e2b500";
33
+ /**
34
+ * Stellar facilitator address
35
+ * Used for: Signing soroban authorization entries
36
+ */
37
+ readonly stellar: "GDUTDNV53WQPOB2JUZPO6SXH4LVT7CJSLCMLFQ7W4CNAXGIX7XYMCNP2";
38
+ /**
39
+ * NEAR facilitator address
40
+ * Used for: Relaying meta-transactions
41
+ */
42
+ readonly near: "uvd-facilitator.near";
43
+ };
44
+ /**
45
+ * Get the facilitator address for a specific chain
46
+ *
47
+ * @param chainName - The chain name (e.g., 'algorand', 'solana', 'base')
48
+ * @param networkType - The network type (e.g., 'evm', 'svm', 'algorand')
49
+ * @returns The facilitator address for that chain, or undefined if not supported
50
+ */
51
+ declare function getFacilitatorAddress(chainName: string, networkType?: string): string | undefined;
52
+ /**
53
+ * Type for facilitator addresses
54
+ */
55
+ type FacilitatorAddresses = typeof FACILITATOR_ADDRESSES;
56
+
57
+ export { FACILITATOR_ADDRESSES, type FacilitatorAddresses, getFacilitatorAddress };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,57 @@
1
- export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client, q as getAlgorandChains, g as getChainById, b as getChainByName, d as getChainsByNetworkType, p as getChainsByToken, e as getEVMChainIds, c as getEnabledChains, l as getExplorerAddressUrl, k as getExplorerTxUrl, j as getNetworkType, f as getSVMChains, n as getSupportedTokens, m as getTokenConfig, r as isAlgorandChain, i as isChainSupported, h as isSVMChain, o as isTokenSupported } from './index-VIOUicmO.js';
1
+ export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client, q as getAlgorandChains, g as getChainById, b as getChainByName, d as getChainsByNetworkType, p as getChainsByToken, e as getEVMChainIds, c as getEnabledChains, l as getExplorerAddressUrl, k as getExplorerTxUrl, j as getNetworkType, f as getSVMChains, n as getSupportedTokens, m as getTokenConfig, r as isAlgorandChain, i as isChainSupported, h as isSVMChain, o as isTokenSupported } from './index-DmJGKD9r.js';
2
2
  export { DEFAULT_PAYMENT_HEADER, PAYMENT_HEADER_NAMES, caip2ToChain, chainToCAIP2, convertX402Header, createPaymentHeaders, createX402Header, createX402V1Header, createX402V2Header, decodeX402Header, detectX402Version, encodeX402Header, generatePaymentOptions, getPaymentHeader, isCAIP2Format, parseNetworkIdentifier, validateAmount, validateRecipient } from './utils/index.js';
3
- export { A as AlgorandPaymentPayload, H as CAIP2_IDENTIFIERS, I as CAIP2_TO_CHAIN, C as ChainConfig, G as DEFAULT_CONFIG, E as EIP712Domain, d as EIP712Types, i as EVMPaymentPayload, M as MultiPaymentConfig, k as NEARPaymentPayload, N as NativeCurrency, x as NetworkBalance, a as NetworkType, g as PaymentHeaders, P as PaymentInfo, h as PaymentPayload, e as PaymentRequest, f as PaymentResult, S as SolanaPaymentPayload, j as StellarPaymentPayload, b as TokenConfig, T as TokenType, U as USDCConfig, c as WalletAdapter, W as WalletState, v as X402AlgorandPayload, w as X402ClientConfig, r as X402EVMPayload, F as X402Error, D as X402ErrorCode, y as X402Event, z as X402EventData, B as X402EventHandler, m as X402Header, X as X402HeaderName, n as X402HeaderV1, o as X402HeaderV2, u as X402NEARPayload, q as X402PayloadData, p as X402PaymentOption, s as X402SolanaPayload, t as X402StellarPayload, l as X402Version } from './index-D-dO_FoP.js';
3
+ export { A as AlgorandPaymentPayload, H as CAIP2_IDENTIFIERS, I as CAIP2_TO_CHAIN, C as ChainConfig, G as DEFAULT_CONFIG, E as EIP712Domain, d as EIP712Types, i as EVMPaymentPayload, M as MultiPaymentConfig, k as NEARPaymentPayload, N as NativeCurrency, x as NetworkBalance, a as NetworkType, g as PaymentHeaders, P as PaymentInfo, h as PaymentPayload, e as PaymentRequest, f as PaymentResult, S as SolanaPaymentPayload, j as StellarPaymentPayload, b as TokenConfig, T as TokenType, U as USDCConfig, c as WalletAdapter, W as WalletState, v as X402AlgorandPayload, w as X402ClientConfig, r as X402EVMPayload, F as X402Error, D as X402ErrorCode, y as X402Event, z as X402EventData, B as X402EventHandler, m as X402Header, X as X402HeaderName, n as X402HeaderV1, o as X402HeaderV2, u as X402NEARPayload, q as X402PayloadData, p as X402PaymentOption, s as X402SolanaPayload, t as X402StellarPayload, l as X402Version } from './index-fIhvHqCQ.js';
4
+
5
+ /**
6
+ * Facilitator wallet addresses by chain type
7
+ *
8
+ * These are the public addresses of the facilitator's wallets.
9
+ * The facilitator uses these to pay fees and sign transactions.
10
+ */
11
+ declare const FACILITATOR_ADDRESSES: {
12
+ /**
13
+ * Solana facilitator address (fee payer)
14
+ * Used for: Paying transaction fees on Solana
15
+ */
16
+ readonly solana: "F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq";
17
+ /**
18
+ * Algorand facilitator address (fee payer)
19
+ * Used for: Signing Transaction 0 (fee tx) in atomic groups
20
+ * Note: This is derived from the facilitator's Algorand mnemonic
21
+ */
22
+ readonly algorand: "SXHRBXS22SKKXHXK44DTQMWN2SXK3SFJWBDAQZGF4DRPW7PNFAUM2GYFAQ";
23
+ /**
24
+ * Algorand testnet facilitator address
25
+ */
26
+ readonly 'algorand-testnet': "SXHRBXS22SKKXHXK44DTQMWN2SXK3SFJWBDAQZGF4DRPW7PNFAUM2GYFAQ";
27
+ /**
28
+ * EVM facilitator address
29
+ * Used for: Submitting EIP-3009 transferWithAuthorization transactions
30
+ * Note: Same address across all EVM chains
31
+ */
32
+ readonly evm: "0x7c5F3AdB0C7775968Bc7e7cF61b27fECf2e2b500";
33
+ /**
34
+ * Stellar facilitator address
35
+ * Used for: Signing soroban authorization entries
36
+ */
37
+ readonly stellar: "GDUTDNV53WQPOB2JUZPO6SXH4LVT7CJSLCMLFQ7W4CNAXGIX7XYMCNP2";
38
+ /**
39
+ * NEAR facilitator address
40
+ * Used for: Relaying meta-transactions
41
+ */
42
+ readonly near: "uvd-facilitator.near";
43
+ };
44
+ /**
45
+ * Get the facilitator address for a specific chain
46
+ *
47
+ * @param chainName - The chain name (e.g., 'algorand', 'solana', 'base')
48
+ * @param networkType - The network type (e.g., 'evm', 'svm', 'algorand')
49
+ * @returns The facilitator address for that chain, or undefined if not supported
50
+ */
51
+ declare function getFacilitatorAddress(chainName: string, networkType?: string): string | undefined;
52
+ /**
53
+ * Type for facilitator addresses
54
+ */
55
+ type FacilitatorAddresses = typeof FACILITATOR_ADDRESSES;
56
+
57
+ export { FACILITATOR_ADDRESSES, type FacilitatorAddresses, getFacilitatorAddress };
package/dist/index.js CHANGED
@@ -1530,12 +1530,70 @@ var X402Client = class {
1530
1530
  }
1531
1531
  };
1532
1532
 
1533
+ // src/facilitator.ts
1534
+ var FACILITATOR_ADDRESSES = {
1535
+ /**
1536
+ * Solana facilitator address (fee payer)
1537
+ * Used for: Paying transaction fees on Solana
1538
+ */
1539
+ solana: "F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq",
1540
+ /**
1541
+ * Algorand facilitator address (fee payer)
1542
+ * Used for: Signing Transaction 0 (fee tx) in atomic groups
1543
+ * Note: This is derived from the facilitator's Algorand mnemonic
1544
+ */
1545
+ algorand: "SXHRBXS22SKKXHXK44DTQMWN2SXK3SFJWBDAQZGF4DRPW7PNFAUM2GYFAQ",
1546
+ /**
1547
+ * Algorand testnet facilitator address
1548
+ */
1549
+ "algorand-testnet": "SXHRBXS22SKKXHXK44DTQMWN2SXK3SFJWBDAQZGF4DRPW7PNFAUM2GYFAQ",
1550
+ /**
1551
+ * EVM facilitator address
1552
+ * Used for: Submitting EIP-3009 transferWithAuthorization transactions
1553
+ * Note: Same address across all EVM chains
1554
+ */
1555
+ evm: "0x7c5F3AdB0C7775968Bc7e7cF61b27fECf2e2b500",
1556
+ /**
1557
+ * Stellar facilitator address
1558
+ * Used for: Signing soroban authorization entries
1559
+ */
1560
+ stellar: "GDUTDNV53WQPOB2JUZPO6SXH4LVT7CJSLCMLFQ7W4CNAXGIX7XYMCNP2",
1561
+ /**
1562
+ * NEAR facilitator address
1563
+ * Used for: Relaying meta-transactions
1564
+ */
1565
+ near: "uvd-facilitator.near"
1566
+ };
1567
+ function getFacilitatorAddress(chainName, networkType) {
1568
+ const exactMatch = FACILITATOR_ADDRESSES[chainName];
1569
+ if (exactMatch) {
1570
+ return exactMatch;
1571
+ }
1572
+ if (networkType === "evm") {
1573
+ return FACILITATOR_ADDRESSES.evm;
1574
+ }
1575
+ if (networkType === "svm" || networkType === "solana") {
1576
+ return FACILITATOR_ADDRESSES.solana;
1577
+ }
1578
+ if (networkType === "algorand") {
1579
+ return FACILITATOR_ADDRESSES.algorand;
1580
+ }
1581
+ if (networkType === "stellar") {
1582
+ return FACILITATOR_ADDRESSES.stellar;
1583
+ }
1584
+ if (networkType === "near") {
1585
+ return FACILITATOR_ADDRESSES.near;
1586
+ }
1587
+ return void 0;
1588
+ }
1589
+
1533
1590
  exports.CAIP2_IDENTIFIERS = CAIP2_IDENTIFIERS;
1534
1591
  exports.CAIP2_TO_CHAIN = CAIP2_TO_CHAIN;
1535
1592
  exports.DEFAULT_CHAIN = DEFAULT_CHAIN;
1536
1593
  exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
1537
1594
  exports.DEFAULT_FACILITATOR_URL = DEFAULT_FACILITATOR_URL;
1538
1595
  exports.DEFAULT_PAYMENT_HEADER = DEFAULT_PAYMENT_HEADER;
1596
+ exports.FACILITATOR_ADDRESSES = FACILITATOR_ADDRESSES;
1539
1597
  exports.PAYMENT_HEADER_NAMES = PAYMENT_HEADER_NAMES;
1540
1598
  exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS;
1541
1599
  exports.X402Client = X402Client;
@@ -1560,6 +1618,7 @@ exports.getEVMChainIds = getEVMChainIds;
1560
1618
  exports.getEnabledChains = getEnabledChains;
1561
1619
  exports.getExplorerAddressUrl = getExplorerAddressUrl;
1562
1620
  exports.getExplorerTxUrl = getExplorerTxUrl;
1621
+ exports.getFacilitatorAddress = getFacilitatorAddress;
1563
1622
  exports.getNetworkType = getNetworkType;
1564
1623
  exports.getPaymentHeader = getPaymentHeader;
1565
1624
  exports.getSVMChains = getSVMChains;