@openfort/react 1.6.1 → 1.6.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.
- package/build/components/Pages/AssetInventory/SolanaAssetInventory.js +41 -2
- package/build/components/Pages/AssetInventory/SolanaAssetInventory.js.map +1 -1
- package/build/components/Pages/AssetInventory/index.js +50 -6
- package/build/components/Pages/AssetInventory/index.js.map +1 -1
- package/build/components/Pages/Connected/EthereumConnected.js +2 -5
- package/build/components/Pages/Connected/EthereumConnected.js.map +1 -1
- package/build/constants/defaultAssets.d.ts +18 -0
- package/build/constants/defaultAssets.js +70 -0
- package/build/constants/defaultAssets.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useEffect } from 'react';
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
3
|
import { formatUnits } from 'viem';
|
|
4
4
|
import { currencyLogoUrl } from '../../../constants/logos.js';
|
|
5
|
+
import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
|
|
5
6
|
import { useSolanaWalletAssets } from '../../../solana/hooks/useSolanaWalletAssets.js';
|
|
6
7
|
import { ModalHeading } from '../../Common/Modal/styles.js';
|
|
7
8
|
import { routes } from '../../Openfort/types.js';
|
|
@@ -10,6 +11,37 @@ import { AssetChainLogo } from '../Deposit/AssetChainLogo.js';
|
|
|
10
11
|
import { SelectTokenContent, EmptyState, ContentWrapper, TokenList, TokenContainer, TokenLeftGroup, TokenInfo, TokenSymbol, TokenName, TokenLogoArea } from '../SelectToken/styles.js';
|
|
11
12
|
|
|
12
13
|
const ZERO = BigInt(0);
|
|
14
|
+
const USDC_MINT_MAINNET = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
|
|
15
|
+
const USDC_MINT_DEVNET = '4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU';
|
|
16
|
+
const USDT_MINT_MAINNET = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB';
|
|
17
|
+
/**
|
|
18
|
+
* Default tokens to surface at zero balance: native SOL plus the stablecoins we
|
|
19
|
+
* ship verified mints for (USDC on the active cluster, USDT on mainnet). Skips any
|
|
20
|
+
* already held.
|
|
21
|
+
*/
|
|
22
|
+
function buildSolanaDefaults(cluster, held) {
|
|
23
|
+
const isMainnet = cluster === 'mainnet-beta' || cluster === 'mainnet';
|
|
24
|
+
const heldMints = new Set(held.map((t) => t.mint));
|
|
25
|
+
const defaults = [];
|
|
26
|
+
if (!heldMints.has('native')) {
|
|
27
|
+
defaults.push({ mint: 'native', symbol: 'SOL', name: 'Solana', amount: ZERO, decimals: 9, isNative: true });
|
|
28
|
+
}
|
|
29
|
+
const usdcMint = isMainnet ? USDC_MINT_MAINNET : USDC_MINT_DEVNET;
|
|
30
|
+
if (!heldMints.has(usdcMint)) {
|
|
31
|
+
defaults.push({ mint: usdcMint, symbol: 'USDC', name: 'USD Coin', amount: ZERO, decimals: 6, isNative: false });
|
|
32
|
+
}
|
|
33
|
+
if (isMainnet && !heldMints.has(USDT_MINT_MAINNET)) {
|
|
34
|
+
defaults.push({
|
|
35
|
+
mint: USDT_MINT_MAINNET,
|
|
36
|
+
symbol: 'USDT',
|
|
37
|
+
name: 'Tether USD',
|
|
38
|
+
amount: ZERO,
|
|
39
|
+
decimals: 6,
|
|
40
|
+
isNative: false,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return defaults;
|
|
44
|
+
}
|
|
13
45
|
/** Token logo with the Solana chain badge, matching the EVM inventory. */
|
|
14
46
|
function SolanaTokenLogo({ symbol }) {
|
|
15
47
|
var _a, _b;
|
|
@@ -23,11 +55,18 @@ function SolanaTokenLogo({ symbol }) {
|
|
|
23
55
|
const SolanaAssetInventory = () => {
|
|
24
56
|
const { data, isLoading } = useSolanaWalletAssets();
|
|
25
57
|
const { triggerResize } = useOpenfort();
|
|
58
|
+
const wallet = useSolanaEmbeddedWallet();
|
|
59
|
+
const cluster = wallet.cluster;
|
|
26
60
|
useEffect(() => {
|
|
27
61
|
if (!isLoading)
|
|
28
62
|
triggerResize();
|
|
29
63
|
}, [isLoading, triggerResize]);
|
|
30
|
-
|
|
64
|
+
// Held tokens first, then default zero-balance tokens (SOL + stablecoins) so the
|
|
65
|
+
// list is never empty.
|
|
66
|
+
const tokens = useMemo(() => {
|
|
67
|
+
const held = (data !== null && data !== void 0 ? data : []).filter((t) => t.amount > ZERO);
|
|
68
|
+
return [...held, ...buildSolanaDefaults(cluster, held)];
|
|
69
|
+
}, [data, cluster]);
|
|
31
70
|
if (isLoading) {
|
|
32
71
|
return (jsxs(SelectTokenContent, { onBack: routes.SOL_CONNECTED, children: [jsx(ModalHeading, { children: "Your assets" }), jsx(EmptyState, { children: "Loading balances..." })] }));
|
|
33
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaAssetInventory.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolanaAssetInventory.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,8 +2,11 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
3
|
import { useState, useEffect, useMemo } from 'react';
|
|
4
4
|
import { formatUnits } from 'viem';
|
|
5
|
+
import { DEFAULT_ASSETS, isStableSymbol } from '../../../constants/defaultAssets.js';
|
|
5
6
|
import { TOKEN_LOGO, symbolToColor } from '../../../constants/logos.js';
|
|
7
|
+
import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
6
8
|
import { useEthereumWalletAssets } from '../../../ethereum/hooks/useEthereumWalletAssets.js';
|
|
9
|
+
import { getNativeCurrency } from '../../../utils/rpc.js';
|
|
7
10
|
import Chain from '../../Common/Chain/index.js';
|
|
8
11
|
import { ModalHeading } from '../../Common/Modal/styles.js';
|
|
9
12
|
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
@@ -23,6 +26,44 @@ const priceFormatter = new Intl.NumberFormat('en-US', {
|
|
|
23
26
|
minimumFractionDigits: 2,
|
|
24
27
|
maximumFractionDigits: 4,
|
|
25
28
|
});
|
|
29
|
+
/**
|
|
30
|
+
* Default tokens to surface at zero balance so the inventory is never empty: the
|
|
31
|
+
* active chain's native token plus the documented default ERC-20s for that chain
|
|
32
|
+
* (USDC / USDT / DAI / wrapped native). Skips any already held.
|
|
33
|
+
*/
|
|
34
|
+
function buildDefaultTokens(chainId, held) {
|
|
35
|
+
var _a;
|
|
36
|
+
if (chainId === undefined)
|
|
37
|
+
return [];
|
|
38
|
+
const heldKeys = new Set(held.map((t) => (t.type === 'erc20' ? `${t.chainId}-${t.address.toLowerCase()}` : `${t.chainId}-native`)));
|
|
39
|
+
const defaults = [];
|
|
40
|
+
if (!heldKeys.has(`${chainId}-native`)) {
|
|
41
|
+
const native = getNativeCurrency(chainId);
|
|
42
|
+
defaults.push({
|
|
43
|
+
type: 'native',
|
|
44
|
+
chainId,
|
|
45
|
+
balance: ZERO,
|
|
46
|
+
metadata: { symbol: native.symbol, decimals: native.decimals, fiat: { value: 0, currency: 'USD' } },
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
for (const token of (_a = DEFAULT_ASSETS[chainId]) !== null && _a !== void 0 ? _a : []) {
|
|
50
|
+
if (heldKeys.has(`${chainId}-${token.address.toLowerCase()}`))
|
|
51
|
+
continue;
|
|
52
|
+
defaults.push({
|
|
53
|
+
type: 'erc20',
|
|
54
|
+
chainId,
|
|
55
|
+
address: token.address,
|
|
56
|
+
balance: ZERO,
|
|
57
|
+
metadata: {
|
|
58
|
+
symbol: token.symbol,
|
|
59
|
+
name: token.name,
|
|
60
|
+
decimals: token.decimals,
|
|
61
|
+
fiat: isStableSymbol(token.symbol) ? { value: 1, currency: 'USD' } : undefined,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return defaults;
|
|
66
|
+
}
|
|
26
67
|
function getTokenLogoUrl(token) {
|
|
27
68
|
var _a;
|
|
28
69
|
const symbol = getAssetSymbol(token).toUpperCase();
|
|
@@ -35,7 +76,7 @@ function TokenLogo({ token }) {
|
|
|
35
76
|
return (jsxs(TokenLogoArea, { children: [logoUrl && !imgError ? (jsx(TokenLogoImg, { src: logoUrl, alt: symbol, onError: () => setImgError(true) })) : (jsx(TokenLogoFallback, { "$bg": symbolToColor(symbol), children: symbol.charAt(0).toUpperCase() })), jsx(ChainBadge, { children: jsx(Chain, { id: token.chainId, unsupported: false, size: 14 }) })] }));
|
|
36
77
|
}
|
|
37
78
|
function renderTokenRow(token) {
|
|
38
|
-
var _a, _b, _c
|
|
79
|
+
var _a, _b, _c;
|
|
39
80
|
const key = token.type === 'erc20' ? `${token.chainId}-${token.address}` : `${token.chainId}-native`;
|
|
40
81
|
const displaySymbol = getAssetSymbol(token);
|
|
41
82
|
const displayName = ((_a = token.metadata) === null || _a === void 0 ? void 0 : _a.name) || displaySymbol || 'Unknown Token';
|
|
@@ -45,9 +86,6 @@ function renderTokenRow(token) {
|
|
|
45
86
|
let balanceNum = '';
|
|
46
87
|
let priceDisplay = null;
|
|
47
88
|
const isBalanceLoaded = token.balance !== undefined;
|
|
48
|
-
const hasZeroBalance = isBalanceLoaded && ((_d = token.balance) !== null && _d !== void 0 ? _d : ZERO) <= ZERO;
|
|
49
|
-
if (hasZeroBalance)
|
|
50
|
-
return null;
|
|
51
89
|
if (isBalanceLoaded && token.balance !== undefined) {
|
|
52
90
|
const amount = parseFloat(formatUnits(token.balance, decimals));
|
|
53
91
|
if (Number.isFinite(amount)) {
|
|
@@ -101,6 +139,7 @@ const AssetInventory = () => {
|
|
|
101
139
|
var _a;
|
|
102
140
|
const { data, multiChain, isLoading: isBalancesLoading } = useEthereumWalletAssets({ multiChain: true });
|
|
103
141
|
const { triggerResize, chains } = useOpenfort();
|
|
142
|
+
const { chainId } = useEthereumEmbeddedWallet();
|
|
104
143
|
const [showDetails, setShowDetails] = useState(false);
|
|
105
144
|
useEffect(() => {
|
|
106
145
|
if (!isBalancesLoading)
|
|
@@ -110,7 +149,12 @@ const AssetInventory = () => {
|
|
|
110
149
|
triggerResize();
|
|
111
150
|
}, [showDetails]);
|
|
112
151
|
const tokens = (_a = (multiChain ? data : null)) !== null && _a !== void 0 ? _a : [];
|
|
113
|
-
|
|
152
|
+
// Held tokens (any chain) first, then default zero-balance tokens for the active
|
|
153
|
+
// chain so the list is never empty and always shows the chain's essentials.
|
|
154
|
+
const displayTokens = useMemo(() => {
|
|
155
|
+
const held = tokens.filter((t) => t.balance > ZERO);
|
|
156
|
+
return [...held, ...buildDefaultTokens(chainId, held)];
|
|
157
|
+
}, [tokens, chainId]);
|
|
114
158
|
const chainNameMap = useMemo(() => {
|
|
115
159
|
const map = new Map();
|
|
116
160
|
for (const c of chains)
|
|
@@ -138,7 +182,7 @@ const AssetInventory = () => {
|
|
|
138
182
|
setShowDetails(false);
|
|
139
183
|
}, children: [jsx(ModalHeading, { children: "Configured assets" }), jsx(motion.div, { initial: { opacity: 0, scale: 1.1 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.2, ease: [0.26, 0.08, 0.25, 1] }, style: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 }, children: jsx(ContentWrapper, { style: { overflowY: 'auto', maxHeight: 400 }, children: Array.from(groupedByChain.entries()).map(([chainId, assets]) => (jsxs(ChainGroup, { children: [jsxs(ChainGroupHeader, { children: [jsx(Chain, { id: chainId, unsupported: false, size: 18 }), chainNameMap.get(chainId) || `Chain ${chainId}`] }), assets.map((a) => (jsxs(TokenPill, { children: [jsx(PillLogo, { symbol: a.symbol }), jsx(TokenPillSymbol, { children: a.symbol }), a.name !== a.symbol && a.name] }, `${chainId}-${a.symbol}`)))] }, chainId))) }) })] }, "details"));
|
|
140
184
|
}
|
|
141
|
-
return (jsxs(SelectTokenContent, { children: [jsx(ModalHeading, { children: "Your assets" }), jsxs(ContentWrapper, { children: [jsxs(InfoLink, { type: "button", onClick: () => setShowDetails(true), children: [jsxs("svg", { role: "img", "aria-label": "Info", width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("circle", { cx: "7", cy: "7", r: "6", stroke: "currentColor", strokeWidth: "1.25" }), jsx("path", { d: "M7 6.25V10", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round" }), jsx("circle", { cx: "7", cy: "4.25", r: "0.75", fill: "currentColor" })] }), "Only configured chains and tokens are shown"] }), jsx(TokenList, { children:
|
|
185
|
+
return (jsxs(SelectTokenContent, { children: [jsx(ModalHeading, { children: "Your assets" }), jsxs(ContentWrapper, { children: [jsxs(InfoLink, { type: "button", onClick: () => setShowDetails(true), children: [jsxs("svg", { role: "img", "aria-label": "Info", width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("circle", { cx: "7", cy: "7", r: "6", stroke: "currentColor", strokeWidth: "1.25" }), jsx("path", { d: "M7 6.25V10", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round" }), jsx("circle", { cx: "7", cy: "4.25", r: "0.75", fill: "currentColor" })] }), "Only configured chains and tokens are shown"] }), jsx(TokenList, { children: displayTokens.length > 0 ? displayTokens.map(renderTokenRow) : jsx(EmptyState, { children: "No assets found" }) })] })] }, "assets"));
|
|
142
186
|
};
|
|
143
187
|
|
|
144
188
|
export { AssetInventory };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -106,11 +106,8 @@ const EthereumConnected = () => {
|
|
|
106
106
|
: undefined;
|
|
107
107
|
const locales = useLocales();
|
|
108
108
|
const balanceNode = assets && !isLoading ? (jsx(TextLinkButton, { type: "button", onClick: () => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
setRoute(routes.NO_ASSETS_AVAILABLE);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
109
|
+
// The inventory always shows the chain's native token + stablecoin
|
|
110
|
+
// defaults, so there's no empty state to gate on.
|
|
114
111
|
setRoute(routes.ASSET_INVENTORY);
|
|
115
112
|
}, children: jsxs(Balance, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 }, children: ["$", nFormatter(totalBalanceUsd)] }, `chain-${chain === null || chain === void 0 ? void 0 : chain.id}`) })) : null;
|
|
116
113
|
const noWalletFallback = hasEthereumWallets ? (jsx(Button, { onClick: () => context.setRoute(routes.SELECT_WALLET_TO_RECOVER), children: "Manage wallets" })) : (jsx(Button, { onClick: () => context.setRoute({ route: routes.CONNECTORS, connectType: 'link' }), icon: jsx(Unsupported, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: jsxs("svg", { width: "130", height: "120", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("title", { children: "Unsupported wallet icon" }), jsx("path", { d: "M2.61317 11.2501H9.46246C10.6009 11.2501 11.3256 10.3506 11.3256 9.3549C11.3256 9.05145 11.255 8.73244 11.0881 8.43303L7.65903 2.14708C7.659 2.14702 7.65897 2.14696 7.65893 2.1469C7.65889 2.14682 7.65884 2.14673 7.65879 2.14664C7.31045 1.50746 6.6741 1.17871 6.04 1.17871C5.41478 1.17871 4.763 1.50043 4.41518 2.14968L0.993416 8.43476C0.828865 8.72426 0.75 9.04297 0.75 9.3549C0.75 10.3506 1.47471 11.2501 2.61317 11.2501Z", fill: "currentColor", stroke: "var(--ck-body-background, #fff)", strokeWidth: "1.5" }), jsx("path", { d: "M6.03258 7.43916C5.77502 7.43916 5.63096 7.29153 5.62223 7.02311L5.55675 4.96973C5.54802 4.69684 5.74446 4.5 6.02821 4.5C6.3076 4.5 6.51277 4.70131 6.50404 4.9742L6.43856 7.01864C6.42546 7.29153 6.2814 7.43916 6.03258 7.43916ZM6.03258 9.11676C5.7401 9.11676 5.5 8.9065 5.5 8.60677C5.5 8.30704 5.7401 8.09678 6.03258 8.09678C6.32506 8.09678 6.56515 8.30256 6.56515 8.60677C6.56515 8.91097 6.32069 9.11676 6.03258 9.11676Z", fill: "white" })] }) }), children: "Connect wallet" }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumConnected.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthereumConnected.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
/** A default token surfaced when no custom assets are configured. */
|
|
3
|
+
type DefaultAsset = {
|
|
4
|
+
symbol: string;
|
|
5
|
+
name: string;
|
|
6
|
+
decimals: number;
|
|
7
|
+
address: Hex;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Default ERC-20 assets per chain id, mirroring the set returned by
|
|
11
|
+
* `wallet_getAssets` — see https://www.openfort.io/docs/configuration/default-assets.
|
|
12
|
+
* Used to surface common tokens (USDC / USDT / DAI / wrapped native) in the asset
|
|
13
|
+
* inventory even at zero balance. Native tokens come from `getNativeCurrency`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_ASSETS: Record<number, DefaultAsset[]>;
|
|
16
|
+
/** Whether a symbol is a ~$1 stablecoin (for the inventory's USD estimate). */
|
|
17
|
+
export declare function isStableSymbol(symbol: string): boolean;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default ERC-20 assets per chain id, mirroring the set returned by
|
|
3
|
+
* `wallet_getAssets` — see https://www.openfort.io/docs/configuration/default-assets.
|
|
4
|
+
* Used to surface common tokens (USDC / USDT / DAI / wrapped native) in the asset
|
|
5
|
+
* inventory even at zero balance. Native tokens come from `getNativeCurrency`.
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_ASSETS = {
|
|
8
|
+
// Ethereum Mainnet
|
|
9
|
+
1: [
|
|
10
|
+
{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' },
|
|
11
|
+
{ symbol: 'USDT', name: 'Tether USD', decimals: 6, address: '0xdAC17F958D2ee523a2206206994597C13D831ec7' },
|
|
12
|
+
{ symbol: 'DAI', name: 'Dai Stablecoin', decimals: 18, address: '0x6B175474E89094C44Da98b954EedeAC495271d0F' },
|
|
13
|
+
{ symbol: 'WETH', name: 'Wrapped Ether', decimals: 18, address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' },
|
|
14
|
+
],
|
|
15
|
+
// Optimism
|
|
16
|
+
10: [
|
|
17
|
+
{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85' },
|
|
18
|
+
{ symbol: 'USDT', name: 'Tether USD', decimals: 6, address: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58' },
|
|
19
|
+
{ symbol: 'DAI', name: 'Dai Stablecoin', decimals: 18, address: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1' },
|
|
20
|
+
{ symbol: 'WETH', name: 'Wrapped Ether', decimals: 18, address: '0x4200000000000000000000000000000000000006' },
|
|
21
|
+
],
|
|
22
|
+
// BSC
|
|
23
|
+
56: [
|
|
24
|
+
{ symbol: 'USDC', name: 'USD Coin', decimals: 18, address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d' },
|
|
25
|
+
{ symbol: 'USDT', name: 'Tether USD', decimals: 18, address: '0x55d398326f99059fF775485246999027B3197955' },
|
|
26
|
+
{ symbol: 'DAI', name: 'Dai Stablecoin', decimals: 18, address: '0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3' },
|
|
27
|
+
{ symbol: 'WBNB', name: 'Wrapped BNB', decimals: 18, address: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c' },
|
|
28
|
+
],
|
|
29
|
+
// Polygon
|
|
30
|
+
137: [
|
|
31
|
+
{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359' },
|
|
32
|
+
{ symbol: 'USDT', name: 'Tether USD', decimals: 6, address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F' },
|
|
33
|
+
{ symbol: 'DAI', name: 'Dai Stablecoin', decimals: 18, address: '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063' },
|
|
34
|
+
{ symbol: 'WMATIC', name: 'Wrapped Matic', decimals: 18, address: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270' },
|
|
35
|
+
],
|
|
36
|
+
// Base
|
|
37
|
+
8453: [
|
|
38
|
+
{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' },
|
|
39
|
+
{ symbol: 'DAI', name: 'Dai Stablecoin', decimals: 18, address: '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb' },
|
|
40
|
+
{ symbol: 'WETH', name: 'Wrapped Ether', decimals: 18, address: '0x4200000000000000000000000000000000000006' },
|
|
41
|
+
],
|
|
42
|
+
// Arbitrum
|
|
43
|
+
42161: [
|
|
44
|
+
{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' },
|
|
45
|
+
{ symbol: 'USDT', name: 'Tether USD', decimals: 6, address: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9' },
|
|
46
|
+
{ symbol: 'DAI', name: 'Dai Stablecoin', decimals: 18, address: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1' },
|
|
47
|
+
{ symbol: 'WETH', name: 'Wrapped Ether', decimals: 18, address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' },
|
|
48
|
+
],
|
|
49
|
+
// Avalanche
|
|
50
|
+
43114: [
|
|
51
|
+
{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E' },
|
|
52
|
+
{ symbol: 'USDT', name: 'Tether USD', decimals: 6, address: '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7' },
|
|
53
|
+
{ symbol: 'DAI.e', name: 'Dai Stablecoin', decimals: 18, address: '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70' },
|
|
54
|
+
{ symbol: 'WETH.e', name: 'Wrapped Ether', decimals: 18, address: '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB' },
|
|
55
|
+
],
|
|
56
|
+
// Sepolia
|
|
57
|
+
11155111: [{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238' }],
|
|
58
|
+
// Amoy
|
|
59
|
+
80002: [{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582' }],
|
|
60
|
+
// Base Sepolia
|
|
61
|
+
84532: [{ symbol: 'USDC', name: 'USD Coin', decimals: 6, address: '0x036CbD53842c5426634e7929541eC2318f3dCF7e' }],
|
|
62
|
+
};
|
|
63
|
+
const STABLE_SYMBOLS = new Set(['USDC', 'USDT', 'DAI', 'DAI.E']);
|
|
64
|
+
/** Whether a symbol is a ~$1 stablecoin (for the inventory's USD estimate). */
|
|
65
|
+
function isStableSymbol(symbol) {
|
|
66
|
+
return STABLE_SYMBOLS.has(symbol.toUpperCase());
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { DEFAULT_ASSETS, isStableSymbol };
|
|
70
|
+
//# sourceMappingURL=defaultAssets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultAssets.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OPENFORT_VERSION = "1.6.
|
|
1
|
+
export declare const OPENFORT_VERSION = "1.6.2";
|
package/build/version.js
CHANGED