uvd-x402-sdk 2.12.0 → 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.
- package/dist/index.d.mts +54 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -1
- package/dist/index.mjs.map +1 -1
- package/dist/providers/algorand/index.js +47 -2
- package/dist/providers/algorand/index.js.map +1 -1
- package/dist/providers/algorand/index.mjs +47 -2
- package/dist/providers/algorand/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/facilitator.ts +106 -0
- package/src/index.ts +4 -0
- package/src/providers/algorand/index.ts +8 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
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
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
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
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;
|