moltspay 1.2.1 → 1.4.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/README.md +292 -34
- package/dist/cdp/index.d.mts +4 -4
- package/dist/cdp/index.d.ts +4 -4
- package/dist/cdp/index.js +110 -30368
- package/dist/cdp/index.js.map +1 -1
- package/dist/cdp/index.mjs +94 -30360
- package/dist/cdp/index.mjs.map +1 -1
- package/dist/cdp-DeohBe1o.d.ts +66 -0
- package/dist/cdp-p_eHuQpb.d.mts +66 -0
- package/dist/chains/index.d.mts +9 -8
- package/dist/chains/index.d.ts +9 -8
- package/dist/chains/index.js +86 -0
- package/dist/chains/index.js.map +1 -1
- package/dist/chains/index.mjs +86 -0
- package/dist/chains/index.mjs.map +1 -1
- package/dist/cli/index.js +2746 -290
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +2752 -282
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/index.d.mts +60 -4
- package/dist/client/index.d.ts +60 -4
- package/dist/client/index.js +734 -43
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +732 -41
- package/dist/client/index.mjs.map +1 -1
- package/dist/facilitators/index.d.mts +220 -39
- package/dist/facilitators/index.d.ts +220 -39
- package/dist/facilitators/index.js +897 -1
- package/dist/facilitators/index.js.map +1 -1
- package/dist/facilitators/index.mjs +902 -1
- package/dist/facilitators/index.mjs.map +1 -1
- package/dist/{index-DgJPZMBG.d.mts → index-D_2FkLwV.d.mts} +6 -2
- package/dist/{index-DgJPZMBG.d.ts → index-D_2FkLwV.d.ts} +6 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2238 -30837
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2167 -30766
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.d.mts +30 -3
- package/dist/server/index.d.ts +30 -3
- package/dist/server/index.js +1345 -54
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +1355 -54
- package/dist/server/index.mjs.map +1 -1
- package/dist/verify/index.d.mts +1 -1
- package/dist/verify/index.d.ts +1 -1
- package/dist/verify/index.js +86 -0
- package/dist/verify/index.js.map +1 -1
- package/dist/verify/index.mjs +86 -0
- package/dist/verify/index.mjs.map +1 -1
- package/dist/wallet/index.d.mts +3 -3
- package/dist/wallet/index.d.ts +3 -3
- package/dist/wallet/index.js +86 -0
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs +86 -0
- package/dist/wallet/index.mjs.map +1 -1
- package/package.json +8 -2
- package/schemas/moltspay.services.schema.json +27 -132
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { B as BaseFacilitator, a as FacilitatorConfig, H as HealthCheckResult, X as X402PaymentPayload, f as X402PaymentRequirements, V as VerifyResult, e as SettleResult, b as FacilitatorFee } from './registry-OsEO2dOu.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CDP Facilitator
|
|
5
|
+
*
|
|
6
|
+
* Coinbase Developer Platform x402 facilitator implementation.
|
|
7
|
+
* Auto-detects mainnet vs testnet from chain ID in request.
|
|
8
|
+
*
|
|
9
|
+
* Supported networks:
|
|
10
|
+
* - Base mainnet (eip155:8453)
|
|
11
|
+
* - Polygon mainnet (eip155:137)
|
|
12
|
+
* - Base Sepolia testnet (eip155:84532)
|
|
13
|
+
*
|
|
14
|
+
* @see https://docs.cdp.coinbase.com/x402/core-concepts/facilitator
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface CDPFacilitatorConfig extends FacilitatorConfig {
|
|
18
|
+
/** CDP API Key ID (required) */
|
|
19
|
+
apiKeyId?: string;
|
|
20
|
+
/** CDP API Key Secret (required) */
|
|
21
|
+
apiKeySecret?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* CDP (Coinbase Developer Platform) Facilitator
|
|
25
|
+
*
|
|
26
|
+
* Handles payment verification and settlement via Coinbase's x402 facilitator.
|
|
27
|
+
*/
|
|
28
|
+
declare class CDPFacilitator extends BaseFacilitator {
|
|
29
|
+
readonly name = "cdp";
|
|
30
|
+
readonly displayName = "Coinbase CDP";
|
|
31
|
+
readonly supportedNetworks: string[];
|
|
32
|
+
private endpoint;
|
|
33
|
+
private apiKeyId?;
|
|
34
|
+
private apiKeySecret?;
|
|
35
|
+
constructor(config?: CDPFacilitatorConfig);
|
|
36
|
+
/**
|
|
37
|
+
* Get auth headers for CDP API requests
|
|
38
|
+
*/
|
|
39
|
+
private getAuthHeaders;
|
|
40
|
+
/**
|
|
41
|
+
* Health check - verify facilitator is reachable
|
|
42
|
+
*/
|
|
43
|
+
healthCheck(): Promise<HealthCheckResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Verify payment signature with facilitator
|
|
46
|
+
*/
|
|
47
|
+
verify(paymentPayload: X402PaymentPayload, requirements: X402PaymentRequirements): Promise<VerifyResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Settle payment on-chain via facilitator
|
|
50
|
+
*/
|
|
51
|
+
settle(paymentPayload: X402PaymentPayload, requirements: X402PaymentRequirements): Promise<SettleResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Get CDP fee information
|
|
54
|
+
*/
|
|
55
|
+
getFee(): Promise<FacilitatorFee>;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a chain ID is testnet
|
|
58
|
+
*/
|
|
59
|
+
static isTestnet(chainId: number): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Get configuration summary (for logging)
|
|
62
|
+
*/
|
|
63
|
+
getConfigSummary(): string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { CDPFacilitator as C, type CDPFacilitatorConfig as a };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { B as BaseFacilitator, a as FacilitatorConfig, H as HealthCheckResult, X as X402PaymentPayload, f as X402PaymentRequirements, V as VerifyResult, e as SettleResult, b as FacilitatorFee } from './registry-OsEO2dOu.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CDP Facilitator
|
|
5
|
+
*
|
|
6
|
+
* Coinbase Developer Platform x402 facilitator implementation.
|
|
7
|
+
* Auto-detects mainnet vs testnet from chain ID in request.
|
|
8
|
+
*
|
|
9
|
+
* Supported networks:
|
|
10
|
+
* - Base mainnet (eip155:8453)
|
|
11
|
+
* - Polygon mainnet (eip155:137)
|
|
12
|
+
* - Base Sepolia testnet (eip155:84532)
|
|
13
|
+
*
|
|
14
|
+
* @see https://docs.cdp.coinbase.com/x402/core-concepts/facilitator
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface CDPFacilitatorConfig extends FacilitatorConfig {
|
|
18
|
+
/** CDP API Key ID (required) */
|
|
19
|
+
apiKeyId?: string;
|
|
20
|
+
/** CDP API Key Secret (required) */
|
|
21
|
+
apiKeySecret?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* CDP (Coinbase Developer Platform) Facilitator
|
|
25
|
+
*
|
|
26
|
+
* Handles payment verification and settlement via Coinbase's x402 facilitator.
|
|
27
|
+
*/
|
|
28
|
+
declare class CDPFacilitator extends BaseFacilitator {
|
|
29
|
+
readonly name = "cdp";
|
|
30
|
+
readonly displayName = "Coinbase CDP";
|
|
31
|
+
readonly supportedNetworks: string[];
|
|
32
|
+
private endpoint;
|
|
33
|
+
private apiKeyId?;
|
|
34
|
+
private apiKeySecret?;
|
|
35
|
+
constructor(config?: CDPFacilitatorConfig);
|
|
36
|
+
/**
|
|
37
|
+
* Get auth headers for CDP API requests
|
|
38
|
+
*/
|
|
39
|
+
private getAuthHeaders;
|
|
40
|
+
/**
|
|
41
|
+
* Health check - verify facilitator is reachable
|
|
42
|
+
*/
|
|
43
|
+
healthCheck(): Promise<HealthCheckResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Verify payment signature with facilitator
|
|
46
|
+
*/
|
|
47
|
+
verify(paymentPayload: X402PaymentPayload, requirements: X402PaymentRequirements): Promise<VerifyResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Settle payment on-chain via facilitator
|
|
50
|
+
*/
|
|
51
|
+
settle(paymentPayload: X402PaymentPayload, requirements: X402PaymentRequirements): Promise<SettleResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Get CDP fee information
|
|
54
|
+
*/
|
|
55
|
+
getFee(): Promise<FacilitatorFee>;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a chain ID is testnet
|
|
58
|
+
*/
|
|
59
|
+
static isTestnet(chainId: number): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Get configuration summary (for logging)
|
|
62
|
+
*/
|
|
63
|
+
getConfigSummary(): string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { CDPFacilitator as C, type CDPFacilitatorConfig as a };
|
package/dist/chains/index.d.mts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as EvmChainName, C as ChainConfig, T as TokenSymbol, a as TokenConfig } from '../index-D_2FkLwV.mjs';
|
|
2
|
+
export { b as ChainName } from '../index-D_2FkLwV.mjs';
|
|
2
3
|
|
|
3
|
-
declare const CHAINS: Record<
|
|
4
|
+
declare const CHAINS: Record<EvmChainName, ChainConfig>;
|
|
4
5
|
/**
|
|
5
6
|
* Get token address for a chain
|
|
6
7
|
*/
|
|
7
|
-
declare function getTokenAddress(chainName:
|
|
8
|
+
declare function getTokenAddress(chainName: EvmChainName, token: TokenSymbol): string;
|
|
8
9
|
/**
|
|
9
10
|
* Get token config for a chain
|
|
10
11
|
*/
|
|
11
|
-
declare function getTokenConfig(chainName:
|
|
12
|
+
declare function getTokenConfig(chainName: EvmChainName, token: TokenSymbol): TokenConfig;
|
|
12
13
|
/**
|
|
13
14
|
* Get chain configuration
|
|
14
15
|
*/
|
|
15
|
-
declare function getChain(name:
|
|
16
|
+
declare function getChain(name: EvmChainName): ChainConfig;
|
|
16
17
|
/**
|
|
17
|
-
* List all supported chains
|
|
18
|
+
* List all supported EVM chains
|
|
18
19
|
*/
|
|
19
|
-
declare function listChains():
|
|
20
|
+
declare function listChains(): EvmChainName[];
|
|
20
21
|
/**
|
|
21
22
|
* Get chain config by chainId
|
|
22
23
|
*/
|
|
@@ -26,4 +27,4 @@ declare function getChainById(chainId: number): ChainConfig | undefined;
|
|
|
26
27
|
*/
|
|
27
28
|
declare const ERC20_ABI: string[];
|
|
28
29
|
|
|
29
|
-
export { CHAINS, ChainConfig,
|
|
30
|
+
export { CHAINS, ChainConfig, ERC20_ABI, EvmChainName, TokenSymbol, getChain, getChainById, getTokenAddress, getTokenConfig, listChains };
|
package/dist/chains/index.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as EvmChainName, C as ChainConfig, T as TokenSymbol, a as TokenConfig } from '../index-D_2FkLwV.js';
|
|
2
|
+
export { b as ChainName } from '../index-D_2FkLwV.js';
|
|
2
3
|
|
|
3
|
-
declare const CHAINS: Record<
|
|
4
|
+
declare const CHAINS: Record<EvmChainName, ChainConfig>;
|
|
4
5
|
/**
|
|
5
6
|
* Get token address for a chain
|
|
6
7
|
*/
|
|
7
|
-
declare function getTokenAddress(chainName:
|
|
8
|
+
declare function getTokenAddress(chainName: EvmChainName, token: TokenSymbol): string;
|
|
8
9
|
/**
|
|
9
10
|
* Get token config for a chain
|
|
10
11
|
*/
|
|
11
|
-
declare function getTokenConfig(chainName:
|
|
12
|
+
declare function getTokenConfig(chainName: EvmChainName, token: TokenSymbol): TokenConfig;
|
|
12
13
|
/**
|
|
13
14
|
* Get chain configuration
|
|
14
15
|
*/
|
|
15
|
-
declare function getChain(name:
|
|
16
|
+
declare function getChain(name: EvmChainName): ChainConfig;
|
|
16
17
|
/**
|
|
17
|
-
* List all supported chains
|
|
18
|
+
* List all supported EVM chains
|
|
18
19
|
*/
|
|
19
|
-
declare function listChains():
|
|
20
|
+
declare function listChains(): EvmChainName[];
|
|
20
21
|
/**
|
|
21
22
|
* Get chain config by chainId
|
|
22
23
|
*/
|
|
@@ -26,4 +27,4 @@ declare function getChainById(chainId: number): ChainConfig | undefined;
|
|
|
26
27
|
*/
|
|
27
28
|
declare const ERC20_ABI: string[];
|
|
28
29
|
|
|
29
|
-
export { CHAINS, ChainConfig,
|
|
30
|
+
export { CHAINS, ChainConfig, ERC20_ABI, EvmChainName, TokenSymbol, getChain, getChainById, getTokenAddress, getTokenConfig, listChains };
|
package/dist/chains/index.js
CHANGED
|
@@ -106,6 +106,92 @@ var CHAINS = {
|
|
|
106
106
|
explorer: "https://sepolia.basescan.org/address/",
|
|
107
107
|
explorerTx: "https://sepolia.basescan.org/tx/",
|
|
108
108
|
avgBlockTime: 2
|
|
109
|
+
},
|
|
110
|
+
// ============ Tempo Testnet (Moderato) ============
|
|
111
|
+
tempo_moderato: {
|
|
112
|
+
name: "Tempo Moderato",
|
|
113
|
+
chainId: 42431,
|
|
114
|
+
rpc: "https://rpc.moderato.tempo.xyz",
|
|
115
|
+
tokens: {
|
|
116
|
+
// TIP-20 stablecoins on Tempo testnet (from mppx SDK)
|
|
117
|
+
// Note: Tempo uses USD as native gas token, not ETH
|
|
118
|
+
USDC: {
|
|
119
|
+
address: "0x20c0000000000000000000000000000000000000",
|
|
120
|
+
// pathUSD - primary testnet stablecoin
|
|
121
|
+
decimals: 6,
|
|
122
|
+
symbol: "USDC",
|
|
123
|
+
eip712Name: "pathUSD"
|
|
124
|
+
},
|
|
125
|
+
USDT: {
|
|
126
|
+
address: "0x20c0000000000000000000000000000000000001",
|
|
127
|
+
// alphaUSD
|
|
128
|
+
decimals: 6,
|
|
129
|
+
symbol: "USDT",
|
|
130
|
+
eip712Name: "alphaUSD"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
usdc: "0x20c0000000000000000000000000000000000000",
|
|
134
|
+
explorer: "https://explore.testnet.tempo.xyz/address/",
|
|
135
|
+
explorerTx: "https://explore.testnet.tempo.xyz/tx/",
|
|
136
|
+
avgBlockTime: 0.5
|
|
137
|
+
// ~500ms finality
|
|
138
|
+
},
|
|
139
|
+
// ============ BNB Chain Testnet ============
|
|
140
|
+
bnb_testnet: {
|
|
141
|
+
name: "BNB Testnet",
|
|
142
|
+
chainId: 97,
|
|
143
|
+
rpc: "https://data-seed-prebsc-1-s1.binance.org:8545",
|
|
144
|
+
tokens: {
|
|
145
|
+
// Note: BNB uses 18 decimals for stablecoins (unlike Base/Polygon which use 6)
|
|
146
|
+
// Using official Binance-Peg testnet tokens
|
|
147
|
+
USDC: {
|
|
148
|
+
address: "0x64544969ed7EBf5f083679233325356EbE738930",
|
|
149
|
+
// Testnet USDC
|
|
150
|
+
decimals: 18,
|
|
151
|
+
symbol: "USDC",
|
|
152
|
+
eip712Name: "USD Coin"
|
|
153
|
+
},
|
|
154
|
+
USDT: {
|
|
155
|
+
address: "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
|
|
156
|
+
// Testnet USDT
|
|
157
|
+
decimals: 18,
|
|
158
|
+
symbol: "USDT",
|
|
159
|
+
eip712Name: "Tether USD"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
usdc: "0x64544969ed7EBf5f083679233325356EbE738930",
|
|
163
|
+
explorer: "https://testnet.bscscan.com/address/",
|
|
164
|
+
explorerTx: "https://testnet.bscscan.com/tx/",
|
|
165
|
+
avgBlockTime: 3,
|
|
166
|
+
// BNB-specific: requires approval for pay-for-success flow
|
|
167
|
+
requiresApproval: true
|
|
168
|
+
},
|
|
169
|
+
// ============ BNB Chain Mainnet ============
|
|
170
|
+
bnb: {
|
|
171
|
+
name: "BNB Smart Chain",
|
|
172
|
+
chainId: 56,
|
|
173
|
+
rpc: "https://bsc-dataseed.binance.org",
|
|
174
|
+
tokens: {
|
|
175
|
+
// Note: BNB uses 18 decimals for stablecoins
|
|
176
|
+
USDC: {
|
|
177
|
+
address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
|
|
178
|
+
decimals: 18,
|
|
179
|
+
symbol: "USDC",
|
|
180
|
+
eip712Name: "USD Coin"
|
|
181
|
+
},
|
|
182
|
+
USDT: {
|
|
183
|
+
address: "0x55d398326f99059fF775485246999027B3197955",
|
|
184
|
+
decimals: 18,
|
|
185
|
+
symbol: "USDT",
|
|
186
|
+
eip712Name: "Tether USD"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
usdc: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
|
|
190
|
+
explorer: "https://bscscan.com/address/",
|
|
191
|
+
explorerTx: "https://bscscan.com/tx/",
|
|
192
|
+
avgBlockTime: 3,
|
|
193
|
+
// BNB-specific: requires approval for pay-for-success flow
|
|
194
|
+
requiresApproval: true
|
|
109
195
|
}
|
|
110
196
|
};
|
|
111
197
|
function getTokenAddress(chainName, token) {
|
package/dist/chains/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/chains/index.ts"],"sourcesContent":["/**\n * Blockchain Configuration\n */\n\nimport type { ChainConfig, ChainName, TokenSymbol } from '../types/index.js';\n\nexport const CHAINS: Record<ChainName, ChainConfig> = {\n // ============ Mainnet ============\n base: {\n name: 'Base',\n chainId: 8453,\n rpc: 'https://mainnet.base.org',\n tokens: {\n USDC: {\n address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin', // EIP-712 domain name\n },\n USDT: {\n address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // deprecated, for backward compat\n explorer: 'https://basescan.org/address/',\n explorerTx: 'https://basescan.org/tx/',\n avgBlockTime: 2,\n },\n polygon: {\n name: 'Polygon',\n chainId: 137,\n rpc: 'https://polygon-bor-rpc.publicnode.com',\n tokens: {\n USDC: {\n address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: '(PoS) Tether USD', // Polygon uses this name\n },\n },\n usdc: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n explorer: 'https://polygonscan.com/address/',\n explorerTx: 'https://polygonscan.com/tx/',\n avgBlockTime: 2,\n },\n // ============ Testnet ============\n base_sepolia: {\n name: 'Base Sepolia',\n chainId: 84532,\n rpc: 'https://sepolia.base.org',\n tokens: {\n USDC: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USDC', // Testnet USDC uses 'USDC' not 'USD Coin'\n },\n USDT: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // Same as USDC on testnet (no official USDT)\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'USDC', // Uses same contract as USDC\n },\n },\n usdc: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n explorer: 'https://sepolia.basescan.org/address/',\n explorerTx: 'https://sepolia.basescan.org/tx/',\n avgBlockTime: 2,\n },\n};\n\n/**\n * Get token address for a chain\n */\nexport function getTokenAddress(chainName: ChainName, token: TokenSymbol): string {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n const tokenConfig = chain.tokens[token];\n if (!tokenConfig) {\n throw new Error(`Token ${token} not supported on ${chainName}`);\n }\n return tokenConfig.address;\n}\n\n/**\n * Get token config for a chain\n */\nexport function getTokenConfig(chainName: ChainName, token: TokenSymbol) {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n return chain.tokens[token];\n}\n\n/**\n * Get chain configuration\n */\nexport function getChain(name: ChainName): ChainConfig {\n const config = CHAINS[name];\n if (!config) {\n throw new Error(`Unsupported chain: ${name}. Supported: ${Object.keys(CHAINS).join(', ')}`);\n }\n return config;\n}\n\n/**\n * List all supported chains\n */\nexport function listChains(): ChainName[] {\n return Object.keys(CHAINS) as ChainName[];\n}\n\n/**\n * Get chain config by chainId\n */\nexport function getChainById(chainId: number): ChainConfig | undefined {\n return Object.values(CHAINS).find(c => c.chainId === chainId);\n}\n\n/**\n * ERC20 ABI (minimal, only required methods)\n */\nexport const ERC20_ABI = [\n 'function balanceOf(address owner) view returns (uint256)',\n 'function transfer(address to, uint256 amount) returns (bool)',\n 'function approve(address spender, uint256 amount) returns (bool)',\n 'function allowance(address owner, address spender) view returns (uint256)',\n 'function decimals() view returns (uint8)',\n 'function symbol() view returns (string)',\n 'function name() view returns (string)',\n 'function nonces(address owner) view returns (uint256)',\n 'function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)',\n 'event Transfer(address indexed from, address indexed to, uint256 value)',\n 'event Approval(address indexed owner, address indexed spender, uint256 value)',\n];\n\nexport type { ChainConfig, ChainName, TokenSymbol };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,SAAyC;AAAA;AAAA,EAEpD,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,YAAY;AAAA;AAAA,MACd;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IACA,MAAM;AAAA;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UA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AAsB,IAAI,gBAAgB,OAAO,KAAK,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE;AAAA,EAC5F;AACA,SAAO;AACT;AAKO,SAAS,aAA0B;AACxC,SAAO,OAAO,KAAK,MAAM;AAC3B;AAKO,SAAS,aAAa,SAA0C;AACrE,SAAO,OAAO,OAAO,MAAM,EAAE,KAAK,OAAK,EAAE,YAAY,OAAO;AAC9D;AAKO,IAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/chains/index.ts"],"sourcesContent":["/**\n * Blockchain Configuration\n */\n\nimport type { ChainConfig, ChainName, EvmChainName, TokenSymbol } from '../types/index.js';\n\nexport const CHAINS: Record<EvmChainName, ChainConfig> = {\n // ============ Mainnet ============\n base: {\n name: 'Base',\n chainId: 8453,\n rpc: 'https://mainnet.base.org',\n tokens: {\n USDC: {\n address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin', // EIP-712 domain name\n },\n USDT: {\n address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // deprecated, for backward compat\n explorer: 'https://basescan.org/address/',\n explorerTx: 'https://basescan.org/tx/',\n avgBlockTime: 2,\n },\n polygon: {\n name: 'Polygon',\n chainId: 137,\n rpc: 'https://polygon-bor-rpc.publicnode.com',\n tokens: {\n USDC: {\n address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: '(PoS) Tether USD', // Polygon uses this name\n },\n },\n usdc: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n explorer: 'https://polygonscan.com/address/',\n explorerTx: 'https://polygonscan.com/tx/',\n avgBlockTime: 2,\n },\n // ============ Testnet ============\n base_sepolia: {\n name: 'Base Sepolia',\n chainId: 84532,\n rpc: 'https://sepolia.base.org',\n tokens: {\n USDC: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USDC', // Testnet USDC uses 'USDC' not 'USD Coin'\n },\n USDT: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // Same as USDC on testnet (no official USDT)\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'USDC', // Uses same contract as USDC\n },\n },\n usdc: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n explorer: 'https://sepolia.basescan.org/address/',\n explorerTx: 'https://sepolia.basescan.org/tx/',\n avgBlockTime: 2,\n },\n // ============ Tempo Testnet (Moderato) ============\n tempo_moderato: {\n name: 'Tempo Moderato',\n chainId: 42431,\n rpc: 'https://rpc.moderato.tempo.xyz',\n tokens: {\n // TIP-20 stablecoins on Tempo testnet (from mppx SDK)\n // Note: Tempo uses USD as native gas token, not ETH\n USDC: {\n address: '0x20c0000000000000000000000000000000000000', // pathUSD - primary testnet stablecoin\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'pathUSD',\n },\n USDT: {\n address: '0x20c0000000000000000000000000000000000001', // alphaUSD\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'alphaUSD',\n },\n },\n usdc: '0x20c0000000000000000000000000000000000000',\n explorer: 'https://explore.testnet.tempo.xyz/address/',\n explorerTx: 'https://explore.testnet.tempo.xyz/tx/',\n avgBlockTime: 0.5, // ~500ms finality\n },\n // ============ BNB Chain Testnet ============\n bnb_testnet: {\n name: 'BNB Testnet',\n chainId: 97,\n rpc: 'https://data-seed-prebsc-1-s1.binance.org:8545',\n tokens: {\n // Note: BNB uses 18 decimals for stablecoins (unlike Base/Polygon which use 6)\n // Using official Binance-Peg testnet tokens\n USDC: {\n address: '0x64544969ed7EBf5f083679233325356EbE738930', // Testnet USDC\n decimals: 18,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0x337610d27c682E347C9cD60BD4b3b107C9d34dDd', // Testnet USDT\n decimals: 18,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x64544969ed7EBf5f083679233325356EbE738930',\n explorer: 'https://testnet.bscscan.com/address/',\n explorerTx: 'https://testnet.bscscan.com/tx/',\n avgBlockTime: 3,\n // BNB-specific: requires approval for pay-for-success flow\n requiresApproval: true,\n },\n // ============ BNB Chain Mainnet ============\n bnb: {\n name: 'BNB Smart Chain',\n chainId: 56,\n rpc: 'https://bsc-dataseed.binance.org',\n tokens: {\n // Note: BNB uses 18 decimals for stablecoins\n USDC: {\n address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',\n decimals: 18,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0x55d398326f99059fF775485246999027B3197955',\n decimals: 18,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',\n explorer: 'https://bscscan.com/address/',\n explorerTx: 'https://bscscan.com/tx/',\n avgBlockTime: 3,\n // BNB-specific: requires approval for pay-for-success flow\n requiresApproval: true,\n },\n};\n\n/**\n * Get token address for a chain\n */\nexport function getTokenAddress(chainName: EvmChainName, token: TokenSymbol): string {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n const tokenConfig = chain.tokens[token];\n if (!tokenConfig) {\n throw new Error(`Token ${token} not supported on ${chainName}`);\n }\n return tokenConfig.address;\n}\n\n/**\n * Get token config for a chain\n */\nexport function getTokenConfig(chainName: EvmChainName, token: TokenSymbol) {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n return chain.tokens[token];\n}\n\n/**\n * Get chain configuration\n */\nexport function getChain(name: EvmChainName): ChainConfig {\n const config = CHAINS[name];\n if (!config) {\n throw new Error(`Unsupported chain: ${name}. Supported: ${Object.keys(CHAINS).join(', ')}`);\n }\n return config;\n}\n\n/**\n * List all supported EVM chains\n */\nexport function listChains(): EvmChainName[] {\n return Object.keys(CHAINS) as EvmChainName[];\n}\n\n/**\n * Get chain config by chainId\n */\nexport function getChainById(chainId: number): ChainConfig | undefined {\n return Object.values(CHAINS).find(c => c.chainId === chainId);\n}\n\n/**\n * ERC20 ABI (minimal, only required methods)\n */\nexport const ERC20_ABI = [\n 'function balanceOf(address owner) view returns (uint256)',\n 'function transfer(address to, uint256 amount) returns (bool)',\n 'function approve(address spender, uint256 amount) returns (bool)',\n 'function allowance(address owner, address spender) view returns (uint256)',\n 'function decimals() view returns (uint8)',\n 'function symbol() view returns (string)',\n 'function name() view returns (string)',\n 'function nonces(address owner) view returns (uint256)',\n 'function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)',\n 'event Transfer(address indexed from, address indexed to, uint256 value)',\n 'event Approval(address indexed owner, address indexed spender, uint256 value)',\n];\n\nexport type { ChainConfig, ChainName, EvmChainName, TokenSymbol };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,SAA4C;AAAA;AAAA,EAEvD,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,YAAY;AAAA;AAAA,MACd;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,QACV,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B;AAKO,SAAS,eAAe,WAAyB,OAAoB;AAC1E,QAAM,QAAQ,OAAO,SAAS;AAC9B,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,sBAAsB,SAAS,EAAE;AAAA,EACnD;AACA,SAAO,MAAM,OAAO,KAAK;AAC3B;AAKO,SAAS,SAAS,MAAiC;AACxD,QAAM,SAAS,OAAO,IAAI;AAC1B,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,sBAAsB,IAAI,gBAAgB,OAAO,KAAK,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE;AAAA,EAC5F;AACA,SAAO;AACT;AAKO,SAAS,aAA6B;AAC3C,SAAO,OAAO,KAAK,MAAM;AAC3B;AAKO,SAAS,aAAa,SAA0C;AACrE,SAAO,OAAO,OAAO,MAAM,EAAE,KAAK,OAAK,EAAE,YAAY,OAAO;AAC9D;AAKO,IAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
package/dist/chains/index.mjs
CHANGED
|
@@ -76,6 +76,92 @@ var CHAINS = {
|
|
|
76
76
|
explorer: "https://sepolia.basescan.org/address/",
|
|
77
77
|
explorerTx: "https://sepolia.basescan.org/tx/",
|
|
78
78
|
avgBlockTime: 2
|
|
79
|
+
},
|
|
80
|
+
// ============ Tempo Testnet (Moderato) ============
|
|
81
|
+
tempo_moderato: {
|
|
82
|
+
name: "Tempo Moderato",
|
|
83
|
+
chainId: 42431,
|
|
84
|
+
rpc: "https://rpc.moderato.tempo.xyz",
|
|
85
|
+
tokens: {
|
|
86
|
+
// TIP-20 stablecoins on Tempo testnet (from mppx SDK)
|
|
87
|
+
// Note: Tempo uses USD as native gas token, not ETH
|
|
88
|
+
USDC: {
|
|
89
|
+
address: "0x20c0000000000000000000000000000000000000",
|
|
90
|
+
// pathUSD - primary testnet stablecoin
|
|
91
|
+
decimals: 6,
|
|
92
|
+
symbol: "USDC",
|
|
93
|
+
eip712Name: "pathUSD"
|
|
94
|
+
},
|
|
95
|
+
USDT: {
|
|
96
|
+
address: "0x20c0000000000000000000000000000000000001",
|
|
97
|
+
// alphaUSD
|
|
98
|
+
decimals: 6,
|
|
99
|
+
symbol: "USDT",
|
|
100
|
+
eip712Name: "alphaUSD"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
usdc: "0x20c0000000000000000000000000000000000000",
|
|
104
|
+
explorer: "https://explore.testnet.tempo.xyz/address/",
|
|
105
|
+
explorerTx: "https://explore.testnet.tempo.xyz/tx/",
|
|
106
|
+
avgBlockTime: 0.5
|
|
107
|
+
// ~500ms finality
|
|
108
|
+
},
|
|
109
|
+
// ============ BNB Chain Testnet ============
|
|
110
|
+
bnb_testnet: {
|
|
111
|
+
name: "BNB Testnet",
|
|
112
|
+
chainId: 97,
|
|
113
|
+
rpc: "https://data-seed-prebsc-1-s1.binance.org:8545",
|
|
114
|
+
tokens: {
|
|
115
|
+
// Note: BNB uses 18 decimals for stablecoins (unlike Base/Polygon which use 6)
|
|
116
|
+
// Using official Binance-Peg testnet tokens
|
|
117
|
+
USDC: {
|
|
118
|
+
address: "0x64544969ed7EBf5f083679233325356EbE738930",
|
|
119
|
+
// Testnet USDC
|
|
120
|
+
decimals: 18,
|
|
121
|
+
symbol: "USDC",
|
|
122
|
+
eip712Name: "USD Coin"
|
|
123
|
+
},
|
|
124
|
+
USDT: {
|
|
125
|
+
address: "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
|
|
126
|
+
// Testnet USDT
|
|
127
|
+
decimals: 18,
|
|
128
|
+
symbol: "USDT",
|
|
129
|
+
eip712Name: "Tether USD"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
usdc: "0x64544969ed7EBf5f083679233325356EbE738930",
|
|
133
|
+
explorer: "https://testnet.bscscan.com/address/",
|
|
134
|
+
explorerTx: "https://testnet.bscscan.com/tx/",
|
|
135
|
+
avgBlockTime: 3,
|
|
136
|
+
// BNB-specific: requires approval for pay-for-success flow
|
|
137
|
+
requiresApproval: true
|
|
138
|
+
},
|
|
139
|
+
// ============ BNB Chain Mainnet ============
|
|
140
|
+
bnb: {
|
|
141
|
+
name: "BNB Smart Chain",
|
|
142
|
+
chainId: 56,
|
|
143
|
+
rpc: "https://bsc-dataseed.binance.org",
|
|
144
|
+
tokens: {
|
|
145
|
+
// Note: BNB uses 18 decimals for stablecoins
|
|
146
|
+
USDC: {
|
|
147
|
+
address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
|
|
148
|
+
decimals: 18,
|
|
149
|
+
symbol: "USDC",
|
|
150
|
+
eip712Name: "USD Coin"
|
|
151
|
+
},
|
|
152
|
+
USDT: {
|
|
153
|
+
address: "0x55d398326f99059fF775485246999027B3197955",
|
|
154
|
+
decimals: 18,
|
|
155
|
+
symbol: "USDT",
|
|
156
|
+
eip712Name: "Tether USD"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
usdc: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
|
|
160
|
+
explorer: "https://bscscan.com/address/",
|
|
161
|
+
explorerTx: "https://bscscan.com/tx/",
|
|
162
|
+
avgBlockTime: 3,
|
|
163
|
+
// BNB-specific: requires approval for pay-for-success flow
|
|
164
|
+
requiresApproval: true
|
|
79
165
|
}
|
|
80
166
|
};
|
|
81
167
|
function getTokenAddress(chainName, token) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/chains/index.ts"],"sourcesContent":["/**\n * Blockchain Configuration\n */\n\nimport type { ChainConfig, ChainName, TokenSymbol } from '../types/index.js';\n\nexport const CHAINS: Record<ChainName, ChainConfig> = {\n // ============ Mainnet ============\n base: {\n name: 'Base',\n chainId: 8453,\n rpc: 'https://mainnet.base.org',\n tokens: {\n USDC: {\n address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin', // EIP-712 domain name\n },\n USDT: {\n address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // deprecated, for backward compat\n explorer: 'https://basescan.org/address/',\n explorerTx: 'https://basescan.org/tx/',\n avgBlockTime: 2,\n },\n polygon: {\n name: 'Polygon',\n chainId: 137,\n rpc: 'https://polygon-bor-rpc.publicnode.com',\n tokens: {\n USDC: {\n address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: '(PoS) Tether USD', // Polygon uses this name\n },\n },\n usdc: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n explorer: 'https://polygonscan.com/address/',\n explorerTx: 'https://polygonscan.com/tx/',\n avgBlockTime: 2,\n },\n // ============ Testnet ============\n base_sepolia: {\n name: 'Base Sepolia',\n chainId: 84532,\n rpc: 'https://sepolia.base.org',\n tokens: {\n USDC: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USDC', // Testnet USDC uses 'USDC' not 'USD Coin'\n },\n USDT: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // Same as USDC on testnet (no official USDT)\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'USDC', // Uses same contract as USDC\n },\n },\n usdc: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n explorer: 'https://sepolia.basescan.org/address/',\n explorerTx: 'https://sepolia.basescan.org/tx/',\n avgBlockTime: 2,\n },\n};\n\n/**\n * Get token address for a chain\n */\nexport function getTokenAddress(chainName: ChainName, token: TokenSymbol): string {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n const tokenConfig = chain.tokens[token];\n if (!tokenConfig) {\n throw new Error(`Token ${token} not supported on ${chainName}`);\n }\n return tokenConfig.address;\n}\n\n/**\n * Get token config for a chain\n */\nexport function getTokenConfig(chainName: ChainName, token: TokenSymbol) {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n return chain.tokens[token];\n}\n\n/**\n * Get chain configuration\n */\nexport function getChain(name: ChainName): ChainConfig {\n const config = CHAINS[name];\n if (!config) {\n throw new Error(`Unsupported chain: ${name}. Supported: ${Object.keys(CHAINS).join(', ')}`);\n }\n return config;\n}\n\n/**\n * List all supported chains\n */\nexport function listChains(): ChainName[] {\n return Object.keys(CHAINS) as ChainName[];\n}\n\n/**\n * Get chain config by chainId\n */\nexport function getChainById(chainId: number): ChainConfig | undefined {\n return Object.values(CHAINS).find(c => c.chainId === chainId);\n}\n\n/**\n * ERC20 ABI (minimal, only required methods)\n */\nexport const ERC20_ABI = [\n 'function balanceOf(address owner) view returns (uint256)',\n 'function transfer(address to, uint256 amount) returns (bool)',\n 'function approve(address spender, uint256 amount) returns (bool)',\n 'function allowance(address owner, address spender) view returns (uint256)',\n 'function decimals() view returns (uint8)',\n 'function symbol() view returns (string)',\n 'function name() view returns (string)',\n 'function nonces(address owner) view returns (uint256)',\n 'function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)',\n 'event Transfer(address indexed from, address indexed to, uint256 value)',\n 'event Approval(address indexed owner, address indexed spender, uint256 value)',\n];\n\nexport type { ChainConfig, ChainName, TokenSymbol };\n"],"mappings":";AAMO,IAAM,SAAyC;AAAA;AAAA,EAEpD,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ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I,MAAM,SAAS,KAAK,qBAAqB,SAAS,EAAE;AAAA,EAChE;AACA,SAAO,YAAY;AACrB;AAKO,SAAS,eAAe,WAAsB,OAAoB;AACvE,QAAM,QAAQ,OAAO,SAAS;AAC9B,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,sBAAsB,SAAS,EAAE;AAAA,EACnD;AACA,SAAO,MAAM,OAAO,KAAK;AAC3B;AAKO,SAAS,SAAS,MAA8B;AACrD,QAAM,SAAS,OAAO,IAAI;AAC1B,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,sBAAsB,IAAI,gBAAgB,OAAO,KAAK,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE;AAAA,EAC5F;AACA,SAAO;AACT;AAKO,SAAS,aAA0B;AACxC,SAAO,OAAO,KAAK,MAAM;AAC3B;AAKO,SAAS,aAAa,SAA0C;AACrE,SAAO,OAAO,OAAO,MAAM,EAAE,KAAK,OAAK,EAAE,YAAY,OAAO;AAC9D;AAKO,IAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/chains/index.ts"],"sourcesContent":["/**\n * Blockchain Configuration\n */\n\nimport type { ChainConfig, ChainName, EvmChainName, TokenSymbol } from '../types/index.js';\n\nexport const CHAINS: Record<EvmChainName, ChainConfig> = {\n // ============ Mainnet ============\n base: {\n name: 'Base',\n chainId: 8453,\n rpc: 'https://mainnet.base.org',\n tokens: {\n USDC: {\n address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin', // EIP-712 domain name\n },\n USDT: {\n address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // deprecated, for backward compat\n explorer: 'https://basescan.org/address/',\n explorerTx: 'https://basescan.org/tx/',\n avgBlockTime: 2,\n },\n polygon: {\n name: 'Polygon',\n chainId: 137,\n rpc: 'https://polygon-bor-rpc.publicnode.com',\n tokens: {\n USDC: {\n address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',\n decimals: 6,\n symbol: 'USDT',\n eip712Name: '(PoS) Tether USD', // Polygon uses this name\n },\n },\n usdc: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',\n explorer: 'https://polygonscan.com/address/',\n explorerTx: 'https://polygonscan.com/tx/',\n avgBlockTime: 2,\n },\n // ============ Testnet ============\n base_sepolia: {\n name: 'Base Sepolia',\n chainId: 84532,\n rpc: 'https://sepolia.base.org',\n tokens: {\n USDC: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'USDC', // Testnet USDC uses 'USDC' not 'USD Coin'\n },\n USDT: {\n address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // Same as USDC on testnet (no official USDT)\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'USDC', // Uses same contract as USDC\n },\n },\n usdc: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n explorer: 'https://sepolia.basescan.org/address/',\n explorerTx: 'https://sepolia.basescan.org/tx/',\n avgBlockTime: 2,\n },\n // ============ Tempo Testnet (Moderato) ============\n tempo_moderato: {\n name: 'Tempo Moderato',\n chainId: 42431,\n rpc: 'https://rpc.moderato.tempo.xyz',\n tokens: {\n // TIP-20 stablecoins on Tempo testnet (from mppx SDK)\n // Note: Tempo uses USD as native gas token, not ETH\n USDC: {\n address: '0x20c0000000000000000000000000000000000000', // pathUSD - primary testnet stablecoin\n decimals: 6,\n symbol: 'USDC',\n eip712Name: 'pathUSD',\n },\n USDT: {\n address: '0x20c0000000000000000000000000000000000001', // alphaUSD\n decimals: 6,\n symbol: 'USDT',\n eip712Name: 'alphaUSD',\n },\n },\n usdc: '0x20c0000000000000000000000000000000000000',\n explorer: 'https://explore.testnet.tempo.xyz/address/',\n explorerTx: 'https://explore.testnet.tempo.xyz/tx/',\n avgBlockTime: 0.5, // ~500ms finality\n },\n // ============ BNB Chain Testnet ============\n bnb_testnet: {\n name: 'BNB Testnet',\n chainId: 97,\n rpc: 'https://data-seed-prebsc-1-s1.binance.org:8545',\n tokens: {\n // Note: BNB uses 18 decimals for stablecoins (unlike Base/Polygon which use 6)\n // Using official Binance-Peg testnet tokens\n USDC: {\n address: '0x64544969ed7EBf5f083679233325356EbE738930', // Testnet USDC\n decimals: 18,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0x337610d27c682E347C9cD60BD4b3b107C9d34dDd', // Testnet USDT\n decimals: 18,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x64544969ed7EBf5f083679233325356EbE738930',\n explorer: 'https://testnet.bscscan.com/address/',\n explorerTx: 'https://testnet.bscscan.com/tx/',\n avgBlockTime: 3,\n // BNB-specific: requires approval for pay-for-success flow\n requiresApproval: true,\n },\n // ============ BNB Chain Mainnet ============\n bnb: {\n name: 'BNB Smart Chain',\n chainId: 56,\n rpc: 'https://bsc-dataseed.binance.org',\n tokens: {\n // Note: BNB uses 18 decimals for stablecoins\n USDC: {\n address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',\n decimals: 18,\n symbol: 'USDC',\n eip712Name: 'USD Coin',\n },\n USDT: {\n address: '0x55d398326f99059fF775485246999027B3197955',\n decimals: 18,\n symbol: 'USDT',\n eip712Name: 'Tether USD',\n },\n },\n usdc: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',\n explorer: 'https://bscscan.com/address/',\n explorerTx: 'https://bscscan.com/tx/',\n avgBlockTime: 3,\n // BNB-specific: requires approval for pay-for-success flow\n requiresApproval: true,\n },\n};\n\n/**\n * Get token address for a chain\n */\nexport function getTokenAddress(chainName: EvmChainName, token: TokenSymbol): string {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n const tokenConfig = chain.tokens[token];\n if (!tokenConfig) {\n throw new Error(`Token ${token} not supported on ${chainName}`);\n }\n return tokenConfig.address;\n}\n\n/**\n * Get token config for a chain\n */\nexport function getTokenConfig(chainName: EvmChainName, token: TokenSymbol) {\n const chain = CHAINS[chainName];\n if (!chain) {\n throw new Error(`Unsupported chain: ${chainName}`);\n }\n return chain.tokens[token];\n}\n\n/**\n * Get chain configuration\n */\nexport function getChain(name: EvmChainName): ChainConfig {\n const config = CHAINS[name];\n if (!config) {\n throw new Error(`Unsupported chain: ${name}. Supported: ${Object.keys(CHAINS).join(', ')}`);\n }\n return config;\n}\n\n/**\n * List all supported EVM chains\n */\nexport function listChains(): EvmChainName[] {\n return Object.keys(CHAINS) as EvmChainName[];\n}\n\n/**\n * Get chain config by chainId\n */\nexport function getChainById(chainId: number): ChainConfig | undefined {\n return Object.values(CHAINS).find(c => c.chainId === chainId);\n}\n\n/**\n * ERC20 ABI (minimal, only required methods)\n */\nexport const ERC20_ABI = [\n 'function balanceOf(address owner) view returns (uint256)',\n 'function transfer(address to, uint256 amount) returns (bool)',\n 'function approve(address spender, uint256 amount) returns (bool)',\n 'function allowance(address owner, address spender) view returns (uint256)',\n 'function decimals() view returns (uint8)',\n 'function symbol() view returns (string)',\n 'function name() view returns (string)',\n 'function nonces(address owner) view returns (uint256)',\n 'function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)',\n 'event Transfer(address indexed from, address indexed to, uint256 value)',\n 'event Approval(address indexed owner, address indexed spender, uint256 value)',\n];\n\nexport type { ChainConfig, ChainName, EvmChainName, TokenSymbol };\n"],"mappings":";AAMO,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