@solana/connector 0.2.1 → 0.2.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/dist/{chunk-HPQ5T32K.mjs → chunk-3623Z2QL.mjs} +4 -4
- package/dist/{chunk-HPQ5T32K.mjs.map → chunk-3623Z2QL.mjs.map} +1 -1
- package/dist/{chunk-UCISIAOG.mjs → chunk-A7WQ3K75.mjs} +3 -3
- package/dist/{chunk-UCISIAOG.mjs.map → chunk-A7WQ3K75.mjs.map} +1 -1
- package/dist/{chunk-SITQ4JWM.js → chunk-BF67LVVM.js} +17 -21
- package/dist/chunk-BF67LVVM.js.map +1 -0
- package/dist/{chunk-MDR4Y37Z.mjs → chunk-DFHJYZKZ.mjs} +5 -4
- package/dist/chunk-DFHJYZKZ.mjs.map +1 -0
- package/dist/chunk-E3DAIOYS.mjs +22 -0
- package/dist/chunk-E3DAIOYS.mjs.map +1 -0
- package/dist/chunk-FG7HTQTV.mjs +7 -0
- package/dist/chunk-FG7HTQTV.mjs.map +1 -0
- package/dist/{chunk-BJAVJQLK.js → chunk-I2XX5FUG.js} +6 -6
- package/dist/{chunk-BJAVJQLK.js.map → chunk-I2XX5FUG.js.map} +1 -1
- package/dist/chunk-L5FWMNWO.js +9 -0
- package/dist/chunk-L5FWMNWO.js.map +1 -0
- package/dist/{chunk-HN5AJF7F.js → chunk-NLPEO5GT.js} +5 -5
- package/dist/{chunk-HN5AJF7F.js.map → chunk-NLPEO5GT.js.map} +1 -1
- package/dist/chunk-QST7XLMB.js +26 -0
- package/dist/chunk-QST7XLMB.js.map +1 -0
- package/dist/{chunk-ZZTY3O4N.mjs → chunk-SJCQ3KZE.mjs} +4 -7
- package/dist/chunk-SJCQ3KZE.mjs.map +1 -0
- package/dist/{chunk-IDTUFDNB.mjs → chunk-SQ2JEA2M.mjs} +58 -11
- package/dist/chunk-SQ2JEA2M.mjs.map +1 -0
- package/dist/{chunk-BZ2VBJCZ.js → chunk-TRSJSU33.js} +141 -94
- package/dist/chunk-TRSJSU33.js.map +1 -0
- package/dist/{chunk-4Z2F6ERB.js → chunk-VVLY6QPI.js} +49 -48
- package/dist/chunk-VVLY6QPI.js.map +1 -0
- package/dist/compat.js +2 -2
- package/dist/compat.mjs +1 -1
- package/dist/fireblocks-FLKRTJU3.js +67 -0
- package/dist/fireblocks-FLKRTJU3.js.map +1 -0
- package/dist/fireblocks-KCJV3GEK.mjs +65 -0
- package/dist/fireblocks-KCJV3GEK.mjs.map +1 -0
- package/dist/headless.d.mts +6 -11
- package/dist/headless.d.ts +6 -11
- package/dist/headless.js +147 -147
- package/dist/headless.mjs +4 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +188 -188
- package/dist/index.mjs +5 -5
- package/dist/privy-6LYDE24Z.mjs +64 -0
- package/dist/privy-6LYDE24Z.mjs.map +1 -0
- package/dist/privy-ID4YFTKR.js +66 -0
- package/dist/privy-ID4YFTKR.js.map +1 -0
- package/dist/protocol-G-z1lRqo.d.mts +166 -0
- package/dist/protocol-G-z1lRqo.d.ts +166 -0
- package/dist/react.d.mts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +49 -49
- package/dist/react.mjs +2 -2
- package/dist/remote.d.mts +46 -0
- package/dist/remote.d.ts +46 -0
- package/dist/remote.js +212 -0
- package/dist/remote.js.map +1 -0
- package/dist/remote.mjs +198 -0
- package/dist/remote.mjs.map +1 -0
- package/dist/server.d.mts +141 -0
- package/dist/server.d.ts +141 -0
- package/dist/server.js +189 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +187 -0
- package/dist/server.mjs.map +1 -0
- package/dist/{standard-shim-tmnQelaJ.d.ts → standard-shim-Cg6fmjK_.d.ts} +10 -0
- package/dist/{standard-shim-CGB88PPO.d.mts → standard-shim-Cz4UNS7t.d.mts} +10 -0
- package/dist/{walletconnect-447EY3OJ.js → walletconnect-F2M3PAAN.js} +8 -8
- package/dist/{walletconnect-447EY3OJ.js.map → walletconnect-F2M3PAAN.js.map} +1 -1
- package/dist/walletconnect-Z6LPGALR.mjs +3 -0
- package/dist/{walletconnect-U455PO4I.mjs.map → walletconnect-Z6LPGALR.mjs.map} +1 -1
- package/package.json +27 -2
- package/dist/chunk-4Z2F6ERB.js.map +0 -1
- package/dist/chunk-BZ2VBJCZ.js.map +0 -1
- package/dist/chunk-IDTUFDNB.mjs.map +0 -1
- package/dist/chunk-MDR4Y37Z.mjs.map +0 -1
- package/dist/chunk-SITQ4JWM.js.map +0 -1
- package/dist/chunk-ZZTY3O4N.mjs.map +0 -1
- package/dist/walletconnect-U455PO4I.mjs +0 -3
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkTRSJSU33_js = require('./chunk-TRSJSU33.js');
|
|
4
|
+
var chunkBF67LVVM_js = require('./chunk-BF67LVVM.js');
|
|
5
|
+
var chunkL5FWMNWO_js = require('./chunk-L5FWMNWO.js');
|
|
5
6
|
var React4 = require('react');
|
|
6
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
var addresses = require('@solana/addresses');
|
|
@@ -11,7 +12,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
11
12
|
|
|
12
13
|
var React4__default = /*#__PURE__*/_interopDefault(React4);
|
|
13
14
|
|
|
14
|
-
var logger =
|
|
15
|
+
var logger = chunkBF67LVVM_js.createLogger("ErrorBoundary");
|
|
15
16
|
var ErrorLogger = class {
|
|
16
17
|
static log(error, errorInfo, context) {
|
|
17
18
|
if (process.env.NODE_ENV === "development" && logger.error(error.message, {
|
|
@@ -31,28 +32,28 @@ var ErrorLogger = class {
|
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
function classifyError(error) {
|
|
34
|
-
if (
|
|
35
|
+
if (chunkBF67LVVM_js.isConnectorError(error)) {
|
|
35
36
|
let typeMapping = {
|
|
36
|
-
WALLET_NOT_CONNECTED:
|
|
37
|
-
WALLET_NOT_FOUND:
|
|
38
|
-
CONNECTION_FAILED:
|
|
39
|
-
USER_REJECTED:
|
|
40
|
-
RPC_ERROR:
|
|
41
|
-
NETWORK_TIMEOUT:
|
|
42
|
-
SIGNING_FAILED:
|
|
43
|
-
SEND_FAILED:
|
|
37
|
+
WALLET_NOT_CONNECTED: chunkBF67LVVM_js.WalletErrorType.CONNECTION_FAILED,
|
|
38
|
+
WALLET_NOT_FOUND: chunkBF67LVVM_js.WalletErrorType.WALLET_NOT_FOUND,
|
|
39
|
+
CONNECTION_FAILED: chunkBF67LVVM_js.WalletErrorType.CONNECTION_FAILED,
|
|
40
|
+
USER_REJECTED: chunkBF67LVVM_js.WalletErrorType.USER_REJECTED,
|
|
41
|
+
RPC_ERROR: chunkBF67LVVM_js.WalletErrorType.NETWORK_ERROR,
|
|
42
|
+
NETWORK_TIMEOUT: chunkBF67LVVM_js.WalletErrorType.NETWORK_ERROR,
|
|
43
|
+
SIGNING_FAILED: chunkBF67LVVM_js.WalletErrorType.TRANSACTION_FAILED,
|
|
44
|
+
SEND_FAILED: chunkBF67LVVM_js.WalletErrorType.TRANSACTION_FAILED
|
|
44
45
|
};
|
|
45
46
|
return {
|
|
46
47
|
...error,
|
|
47
|
-
type: typeMapping[error.code] ||
|
|
48
|
+
type: typeMapping[error.code] || chunkBF67LVVM_js.WalletErrorType.UNKNOWN_ERROR,
|
|
48
49
|
recoverable: error.recoverable,
|
|
49
50
|
context: error.context
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
let walletError = error;
|
|
53
54
|
if (walletError.type) return walletError;
|
|
54
|
-
let type =
|
|
55
|
-
return error.message.includes("User rejected") || error.message.includes("User denied") ? (type =
|
|
55
|
+
let type = chunkBF67LVVM_js.WalletErrorType.UNKNOWN_ERROR, recoverable = false;
|
|
56
|
+
return error.message.includes("User rejected") || error.message.includes("User denied") ? (type = chunkBF67LVVM_js.WalletErrorType.USER_REJECTED, recoverable = true) : error.message.includes("Insufficient funds") ? (type = chunkBF67LVVM_js.WalletErrorType.INSUFFICIENT_FUNDS, recoverable = false) : error.message.includes("Network") || error.message.includes("fetch") ? (type = chunkBF67LVVM_js.WalletErrorType.NETWORK_ERROR, recoverable = true) : error.message.includes("Wallet not found") || error.message.includes("not installed") ? (type = chunkBF67LVVM_js.WalletErrorType.WALLET_NOT_FOUND, recoverable = true) : (error.message.includes("Failed to connect") || error.message.includes("Connection")) && (type = chunkBF67LVVM_js.WalletErrorType.CONNECTION_FAILED, recoverable = true), {
|
|
56
57
|
...error,
|
|
57
58
|
type,
|
|
58
59
|
recoverable,
|
|
@@ -62,8 +63,8 @@ function classifyError(error) {
|
|
|
62
63
|
var ConnectorErrorBoundary = class extends React4.Component {
|
|
63
64
|
constructor(props) {
|
|
64
65
|
super(props);
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
chunkL5FWMNWO_js.__publicField(this, "retryTimeouts", /* @__PURE__ */ new Set());
|
|
67
|
+
chunkL5FWMNWO_js.__publicField(this, "retry", () => {
|
|
67
68
|
let { maxRetries = 3 } = this.props;
|
|
68
69
|
this.state.retryCount >= maxRetries || this.setState((prevState) => ({
|
|
69
70
|
hasError: false,
|
|
@@ -114,28 +115,28 @@ function DefaultErrorFallback({ error, onRetry }) {
|
|
|
114
115
|
});
|
|
115
116
|
}, [onRetry]), { title, message, actionText, showRetry } = React4.useMemo(() => {
|
|
116
117
|
switch (error.type) {
|
|
117
|
-
case
|
|
118
|
+
case chunkBF67LVVM_js.WalletErrorType.USER_REJECTED:
|
|
118
119
|
return {
|
|
119
120
|
title: "Transaction Cancelled",
|
|
120
121
|
message: "You cancelled the transaction. No problem!",
|
|
121
122
|
actionText: "Try Again",
|
|
122
123
|
showRetry: true
|
|
123
124
|
};
|
|
124
|
-
case
|
|
125
|
+
case chunkBF67LVVM_js.WalletErrorType.WALLET_NOT_FOUND:
|
|
125
126
|
return {
|
|
126
127
|
title: "Wallet Not Found",
|
|
127
128
|
message: "Please install a supported Solana wallet to continue.",
|
|
128
129
|
actionText: "Check Wallets",
|
|
129
130
|
showRetry: true
|
|
130
131
|
};
|
|
131
|
-
case
|
|
132
|
+
case chunkBF67LVVM_js.WalletErrorType.NETWORK_ERROR:
|
|
132
133
|
return {
|
|
133
134
|
title: "Network Error",
|
|
134
135
|
message: "Having trouble connecting. Please check your internet connection.",
|
|
135
136
|
actionText: "Retry",
|
|
136
137
|
showRetry: true
|
|
137
138
|
};
|
|
138
|
-
case
|
|
139
|
+
case chunkBF67LVVM_js.WalletErrorType.INSUFFICIENT_FUNDS:
|
|
139
140
|
return {
|
|
140
141
|
title: "Insufficient Funds",
|
|
141
142
|
message: "You don't have enough SOL for this transaction.",
|
|
@@ -312,8 +313,8 @@ function useWalletConnectUri() {
|
|
|
312
313
|
}
|
|
313
314
|
};
|
|
314
315
|
}
|
|
315
|
-
var logger2 =
|
|
316
|
-
|
|
316
|
+
var logger2 = chunkBF67LVVM_js.createLogger("ConnectorProvider");
|
|
317
|
+
chunkTRSJSU33_js.installPolyfills();
|
|
317
318
|
var ConnectorContext = React4.createContext(null);
|
|
318
319
|
ConnectorContext.displayName = "ConnectorContext";
|
|
319
320
|
function ConnectorProviderInternal({
|
|
@@ -324,7 +325,7 @@ function ConnectorProviderInternal({
|
|
|
324
325
|
let clientRef = React4.useRef(null), client = React4__default.default.useCallback(() => {
|
|
325
326
|
if (!clientRef.current)
|
|
326
327
|
try {
|
|
327
|
-
clientRef.current = new
|
|
328
|
+
clientRef.current = new chunkTRSJSU33_js.ConnectorClient(config), typeof window < "u" && (window.__connectorClient = clientRef.current), config?.debug && logger2.info("Client initialized successfully");
|
|
328
329
|
} catch (error) {
|
|
329
330
|
let err = error;
|
|
330
331
|
logger2.error("Failed to initialize client", { error: err });
|
|
@@ -567,7 +568,7 @@ function useCluster() {
|
|
|
567
568
|
[client]
|
|
568
569
|
);
|
|
569
570
|
return React4.useMemo(() => {
|
|
570
|
-
let isMainnet = cluster ?
|
|
571
|
+
let isMainnet = cluster ? chunkTRSJSU33_js.isMainnetCluster(cluster) : false, isDevnet = cluster ? chunkTRSJSU33_js.isDevnetCluster(cluster) : false, isTestnet = cluster ? chunkTRSJSU33_js.isTestnetCluster(cluster) : false, isLocal = cluster ? chunkTRSJSU33_js.isLocalCluster(cluster) : false, explorerUrl = cluster ? chunkTRSJSU33_js.getClusterExplorerUrl(cluster) : "", type = cluster ? chunkTRSJSU33_js.getClusterType(cluster) : null;
|
|
571
572
|
return {
|
|
572
573
|
cluster,
|
|
573
574
|
clusters,
|
|
@@ -585,7 +586,7 @@ function useAccount() {
|
|
|
585
586
|
let { selectedAccount, accounts, connected, selectAccount } = useConnector(), [copied, setCopied] = React4.useState(false), copyTimeoutRef = React4__default.default.useRef(void 0), account = React4.useMemo(
|
|
586
587
|
() => accounts.find((a) => a.address === selectedAccount) ?? null,
|
|
587
588
|
[accounts, selectedAccount]
|
|
588
|
-
), formatted = React4.useMemo(() => selectedAccount ?
|
|
589
|
+
), formatted = React4.useMemo(() => selectedAccount ? chunkTRSJSU33_js.formatAddress(selectedAccount) : "", [selectedAccount]), copy = React4.useCallback(async () => selectedAccount ? (copyTimeoutRef.current && clearTimeout(copyTimeoutRef.current), await chunkTRSJSU33_js.copyAddressToClipboard(selectedAccount, {
|
|
589
590
|
onSuccess: () => {
|
|
590
591
|
setCopied(true), copyTimeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
591
592
|
}
|
|
@@ -615,7 +616,7 @@ function useWalletInfo() {
|
|
|
615
616
|
() => wallets.map(
|
|
616
617
|
(walletInfo) => ({
|
|
617
618
|
name: walletInfo.wallet.name,
|
|
618
|
-
connectorId:
|
|
619
|
+
connectorId: chunkTRSJSU33_js.createConnectorId(walletInfo.wallet.name),
|
|
619
620
|
icon: walletInfo.wallet.icon,
|
|
620
621
|
installed: walletInfo.installed,
|
|
621
622
|
connectable: walletInfo.connectable
|
|
@@ -652,7 +653,7 @@ function useTransactionSigner() {
|
|
|
652
653
|
let { selectedWallet, selectedAccount, accounts, cluster, connected } = useConnector(), client = useConnectorClient(), account = React4.useMemo(
|
|
653
654
|
() => accounts.find((a) => a.address === selectedAccount)?.raw ?? null,
|
|
654
655
|
[accounts, selectedAccount]
|
|
655
|
-
), signer = React4.useMemo(() => !connected || !selectedWallet || !account ? null :
|
|
656
|
+
), signer = React4.useMemo(() => !connected || !selectedWallet || !account ? null : chunkTRSJSU33_js.createTransactionSigner({
|
|
656
657
|
wallet: selectedWallet,
|
|
657
658
|
account,
|
|
658
659
|
cluster: cluster ?? void 0,
|
|
@@ -680,20 +681,20 @@ function useTransactionSigner() {
|
|
|
680
681
|
function useKitTransactionSigner() {
|
|
681
682
|
let { signer: connectorSigner, ready } = useTransactionSigner();
|
|
682
683
|
return {
|
|
683
|
-
signer: React4.useMemo(() => connectorSigner ?
|
|
684
|
+
signer: React4.useMemo(() => connectorSigner ? chunkTRSJSU33_js.createKitTransactionSigner(connectorSigner) : null, [connectorSigner]),
|
|
684
685
|
ready
|
|
685
686
|
};
|
|
686
687
|
}
|
|
687
688
|
var useGillTransactionSigner = useKitTransactionSigner;
|
|
688
|
-
var logger3 =
|
|
689
|
+
var logger3 = chunkBF67LVVM_js.createLogger("useSolanaClient");
|
|
689
690
|
function useSolanaClient() {
|
|
690
691
|
let { type } = useCluster(), connectorClient = useConnectorClient(), client = React4.useMemo(() => {
|
|
691
692
|
if (!type || !connectorClient) return null;
|
|
692
693
|
try {
|
|
693
694
|
let rpcUrl = connectorClient.getRpcUrl();
|
|
694
|
-
return rpcUrl ?
|
|
695
|
+
return rpcUrl ? chunkBF67LVVM_js.createSolanaClient({
|
|
695
696
|
urlOrMoniker: rpcUrl
|
|
696
|
-
}) : type !== "custom" ?
|
|
697
|
+
}) : type !== "custom" ? chunkBF67LVVM_js.createSolanaClient({
|
|
697
698
|
urlOrMoniker: type
|
|
698
699
|
}) : null;
|
|
699
700
|
} catch (error) {
|
|
@@ -714,8 +715,8 @@ function useTransactionPreparer() {
|
|
|
714
715
|
let { client, ready } = useSolanaClient(), prepare = React4.useCallback(
|
|
715
716
|
async (transaction, options = {}) => {
|
|
716
717
|
if (!client)
|
|
717
|
-
throw new
|
|
718
|
-
return
|
|
718
|
+
throw new chunkBF67LVVM_js.NetworkError("RPC_ERROR", "Solana client not available. Cannot prepare transaction.");
|
|
719
|
+
return chunkBF67LVVM_js.prepareTransaction({
|
|
719
720
|
transaction,
|
|
720
721
|
rpc: client.rpc,
|
|
721
722
|
computeUnitLimitMultiplier: options.computeUnitLimitMultiplier,
|
|
@@ -1065,7 +1066,7 @@ function getBalanceQueryKey(rpcUrl, address) {
|
|
|
1065
1066
|
}
|
|
1066
1067
|
var LAMPORTS_PER_SOL2 = 1000000000n;
|
|
1067
1068
|
function formatTokenAccount(account) {
|
|
1068
|
-
let formatted =
|
|
1069
|
+
let formatted = chunkTRSJSU33_js.formatBigIntBalance(account.amount, account.decimals, {
|
|
1069
1070
|
maxDecimals: Math.min(account.decimals, 6)
|
|
1070
1071
|
});
|
|
1071
1072
|
return {
|
|
@@ -1109,7 +1110,7 @@ function useBalance(options = {}) {
|
|
|
1109
1110
|
refetchIntervalMs: autoRefresh ? refreshInterval : false,
|
|
1110
1111
|
client: clientOverride,
|
|
1111
1112
|
select: selectBalance
|
|
1112
|
-
}), lamports = data?.lamports ?? 0n, tokens = data?.tokens ?? [], solBalance = React4.useMemo(() => Number(lamports) / Number(LAMPORTS_PER_SOL2), [lamports]), formattedSol = React4.useMemo(() =>
|
|
1113
|
+
}), lamports = data?.lamports ?? 0n, tokens = data?.tokens ?? [], solBalance = React4.useMemo(() => Number(lamports) / Number(LAMPORTS_PER_SOL2), [lamports]), formattedSol = React4.useMemo(() => chunkTRSJSU33_js.formatLamportsToSolSafe(lamports, { maxDecimals: 4, suffix: true }), [lamports]), visibleError = updatedAt ? null : error, refetch = React4.useCallback(
|
|
1113
1114
|
async (opts) => {
|
|
1114
1115
|
await sharedRefetch(opts);
|
|
1115
1116
|
},
|
|
@@ -1578,7 +1579,7 @@ function useTransactions(options = {}) {
|
|
|
1578
1579
|
blockTimeNum,
|
|
1579
1580
|
Number(sig.slot),
|
|
1580
1581
|
sig.err,
|
|
1581
|
-
|
|
1582
|
+
chunkTRSJSU33_js.getTransactionUrl(String(sig.signature), currentCluster)
|
|
1582
1583
|
);
|
|
1583
1584
|
});
|
|
1584
1585
|
} else
|
|
@@ -1593,7 +1594,7 @@ function useTransactions(options = {}) {
|
|
|
1593
1594
|
type: "unknown",
|
|
1594
1595
|
formattedDate: date,
|
|
1595
1596
|
formattedTime: time,
|
|
1596
|
-
explorerUrl:
|
|
1597
|
+
explorerUrl: chunkTRSJSU33_js.getTransactionUrl(String(sig.signature), currentCluster)
|
|
1597
1598
|
};
|
|
1598
1599
|
});
|
|
1599
1600
|
let mintsToFetch = [
|
|
@@ -1607,7 +1608,7 @@ function useTransactions(options = {}) {
|
|
|
1607
1608
|
throwIfAborted(signal);
|
|
1608
1609
|
let tokenMetadata = await fetchTransactionTokenMetadata(mintsToFetch, {
|
|
1609
1610
|
signal,
|
|
1610
|
-
cluster:
|
|
1611
|
+
cluster: chunkTRSJSU33_js.getClusterType(currentCluster)
|
|
1611
1612
|
});
|
|
1612
1613
|
tokenMetadata.size > 0 && (newTransactions = newTransactions.map((tx) => {
|
|
1613
1614
|
let enrichedTx = { ...tx };
|
|
@@ -1714,10 +1715,10 @@ function getTokensQueryKey(rpcUrl, address) {
|
|
|
1714
1715
|
}
|
|
1715
1716
|
var CACHE_MAX_SIZE = 500, PRICE_CACHE_TTL = 6e4, STALE_CLEANUP_INTERVAL = 12e4, COINGECKO_DEFAULT_MAX_RETRIES = 3, COINGECKO_DEFAULT_BASE_DELAY = 1e3, COINGECKO_DEFAULT_MAX_TIMEOUT = 3e4, COINGECKO_API_BASE_URL = "https://api.coingecko.com/api/v3", LRUCache = class {
|
|
1716
1717
|
constructor(maxSize, options) {
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1718
|
+
chunkL5FWMNWO_js.__publicField(this, "cache", /* @__PURE__ */ new Map());
|
|
1719
|
+
chunkL5FWMNWO_js.__publicField(this, "maxSize");
|
|
1720
|
+
chunkL5FWMNWO_js.__publicField(this, "getTtl");
|
|
1721
|
+
chunkL5FWMNWO_js.__publicField(this, "getTimestamp");
|
|
1721
1722
|
this.maxSize = maxSize, this.getTtl = options?.getTtl, this.getTimestamp = options?.getTimestamp;
|
|
1722
1723
|
}
|
|
1723
1724
|
get(key) {
|
|
@@ -1887,12 +1888,12 @@ async function fetchTokenMetadataHybrid(mints, coingeckoConfig, options) {
|
|
|
1887
1888
|
return didUpdatePrices && options?.onUpdate?.(), didUpdate;
|
|
1888
1889
|
}
|
|
1889
1890
|
function formatBalance(amount, decimals) {
|
|
1890
|
-
return
|
|
1891
|
+
return chunkTRSJSU33_js.formatBigIntBalance(amount, decimals, {
|
|
1891
1892
|
maxDecimals: Math.min(decimals, 6)
|
|
1892
1893
|
});
|
|
1893
1894
|
}
|
|
1894
1895
|
function formatUsd(amount, decimals, usdPrice) {
|
|
1895
|
-
return
|
|
1896
|
+
return chunkTRSJSU33_js.formatBigIntUsd(amount, decimals, usdPrice);
|
|
1896
1897
|
}
|
|
1897
1898
|
function selectTokens(assets, address) {
|
|
1898
1899
|
return {
|
|
@@ -2109,7 +2110,7 @@ function AccountElement({
|
|
|
2109
2110
|
variant = "compact",
|
|
2110
2111
|
render
|
|
2111
2112
|
}) {
|
|
2112
|
-
let { account, connectorId } = useWallet(), connectors = useWalletConnectors(), address = React4__default.default.useMemo(() => account ? String(account) : null, [account]), formatted = React4__default.default.useMemo(() => address ?
|
|
2113
|
+
let { account, connectorId } = useWallet(), connectors = useWalletConnectors(), address = React4__default.default.useMemo(() => account ? String(account) : null, [account]), formatted = React4__default.default.useMemo(() => address ? chunkTRSJSU33_js.formatAddress(address) : "", [address]), connector = React4__default.default.useMemo(() => connectorId ? connectors.find((c) => c.id === connectorId) ?? null : null, [connectors, connectorId]), walletName = connector?.name ?? null, walletIcon = connector?.icon ? connector.icon : null, [copied, setCopied] = React4__default.default.useState(false), copyTimeoutRef = React4__default.default.useRef(void 0), copy = React4__default.default.useCallback(async () => address ? (copyTimeoutRef.current && clearTimeout(copyTimeoutRef.current), await chunkTRSJSU33_js.copyAddressToClipboard(address, {
|
|
2113
2114
|
onSuccess: () => {
|
|
2114
2115
|
setCopied(true), copyTimeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
2115
2116
|
}
|
|
@@ -3308,5 +3309,5 @@ exports.useWalletConnectUri = useWalletConnectUri;
|
|
|
3308
3309
|
exports.useWalletConnectors = useWalletConnectors;
|
|
3309
3310
|
exports.useWalletInfo = useWalletInfo;
|
|
3310
3311
|
exports.withErrorBoundary = withErrorBoundary;
|
|
3311
|
-
//# sourceMappingURL=chunk-
|
|
3312
|
-
//# sourceMappingURL=chunk-
|
|
3312
|
+
//# sourceMappingURL=chunk-VVLY6QPI.js.map
|
|
3313
|
+
//# sourceMappingURL=chunk-VVLY6QPI.js.map
|