@arcenpay/react 0.0.1 → 0.0.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.
@@ -1,3 +1,9 @@
1
+ import {
2
+ ConnectorUtil,
3
+ WalletUtil,
4
+ init_ConnectorUtil,
5
+ init_WalletUtil
6
+ } from "./chunk-GUHCPHEG.mjs";
1
7
  import {
2
8
  e,
3
9
  e2,
@@ -20,13 +26,7 @@ import {
20
26
  n,
21
27
  o,
22
28
  r
23
- } from "./chunk-ZKNFAGRN.mjs";
24
- import {
25
- ConnectorUtil,
26
- WalletUtil,
27
- init_ConnectorUtil,
28
- init_WalletUtil
29
- } from "./chunk-GUHCPHEG.mjs";
29
+ } from "./chunk-DK2DW6NJ.mjs";
30
30
  import {
31
31
  ApiController,
32
32
  AssetController,
@@ -0,0 +1,21 @@
1
+ import {
2
+ DEFAULT_CHAIN_ID,
3
+ SUPPORTED_CHAINS,
4
+ TOKENS,
5
+ baseMainnet,
6
+ baseSepolia,
7
+ getBlockExplorerUrl,
8
+ getChain,
9
+ sepolia
10
+ } from "./chunk-GY2HMODH.mjs";
11
+ import "./chunk-X2BMVUAF.mjs";
12
+ export {
13
+ DEFAULT_CHAIN_ID,
14
+ SUPPORTED_CHAINS,
15
+ TOKENS,
16
+ baseMainnet,
17
+ baseSepolia,
18
+ getBlockExplorerUrl,
19
+ getChain,
20
+ sepolia
21
+ };
@@ -0,0 +1,94 @@
1
+ // src/internal/sdk-core/chains.ts
2
+ import { defineChain } from "viem";
3
+ var sepolia = defineChain({
4
+ id: 11155111,
5
+ name: "Sepolia",
6
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
7
+ rpcUrls: {
8
+ default: { http: ["https://ethereum-sepolia-rpc.publicnode.com"] }
9
+ },
10
+ blockExplorers: {
11
+ default: { name: "Etherscan", url: "https://sepolia.etherscan.io" }
12
+ },
13
+ testnet: true
14
+ });
15
+ var baseSepolia = defineChain({
16
+ id: 84532,
17
+ name: "Base Sepolia",
18
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
19
+ rpcUrls: {
20
+ default: { http: ["https://sepolia.base.org"] }
21
+ },
22
+ blockExplorers: {
23
+ default: { name: "BaseScan", url: "https://sepolia.basescan.org" }
24
+ },
25
+ testnet: true
26
+ });
27
+ var baseMainnet = defineChain({
28
+ id: 8453,
29
+ name: "Base",
30
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
31
+ rpcUrls: {
32
+ default: { http: ["https://mainnet.base.org"] }
33
+ },
34
+ blockExplorers: {
35
+ default: { name: "BaseScan", url: "https://basescan.org" }
36
+ }
37
+ });
38
+ var SUPPORTED_CHAINS = {
39
+ sepolia,
40
+ baseSepolia,
41
+ baseMainnet
42
+ };
43
+ var TOKENS = {
44
+ // Ethereum Sepolia
45
+ 11155111: {
46
+ USDC: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"
47
+ },
48
+ // Base Sepolia
49
+ 84532: {
50
+ USDC: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
51
+ },
52
+ // Base Mainnet
53
+ 8453: {
54
+ USDC: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
55
+ }
56
+ };
57
+ var DEFAULT_CHAIN_ID = 84532;
58
+ function getBlockExplorerUrl(chainId, txHash) {
59
+ const chainMap = {
60
+ 11155111: sepolia,
61
+ 84532: baseSepolia,
62
+ 8453: baseMainnet
63
+ };
64
+ const chain = chainMap[chainId];
65
+ if (!chain) return "";
66
+ const explorerUrl = chain.blockExplorers?.default?.url;
67
+ if (!explorerUrl) return "";
68
+ return `${explorerUrl}/tx/${txHash}`;
69
+ }
70
+ function getChain(chainId) {
71
+ const chainMap = {
72
+ 11155111: sepolia,
73
+ 84532: baseSepolia,
74
+ 8453: baseMainnet
75
+ };
76
+ const chain = chainMap[chainId];
77
+ if (!chain) {
78
+ throw new Error(
79
+ `[getChain] Unsupported chainId: ${chainId}. Supported: ${Object.keys(chainMap).join(", ")}`
80
+ );
81
+ }
82
+ return chain;
83
+ }
84
+
85
+ export {
86
+ sepolia,
87
+ baseSepolia,
88
+ baseMainnet,
89
+ SUPPORTED_CHAINS,
90
+ TOKENS,
91
+ DEFAULT_CHAIN_ID,
92
+ getBlockExplorerUrl,
93
+ getChain
94
+ };