@solana/connector 0.1.7 → 0.1.8
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 +83 -5
- package/dist/{chunk-APQGEW7S.mjs → chunk-6F6M6L7R.mjs} +73 -165
- package/dist/chunk-6F6M6L7R.mjs.map +1 -0
- package/dist/{chunk-VZ5Y6DIM.js → chunk-AOIXHVRH.js} +80 -235
- package/dist/chunk-AOIXHVRH.js.map +1 -0
- package/dist/chunk-DSUCH44G.js +678 -0
- package/dist/chunk-DSUCH44G.js.map +1 -0
- package/dist/{chunk-VA6LKXCQ.js → chunk-FTXIXM43.js} +157 -263
- package/dist/chunk-FTXIXM43.js.map +1 -0
- package/dist/{chunk-TQRJYZNK.mjs → chunk-G575OAT4.mjs} +71 -218
- package/dist/chunk-G575OAT4.mjs.map +1 -0
- package/dist/chunk-J7DHGLW6.mjs +638 -0
- package/dist/chunk-J7DHGLW6.mjs.map +1 -0
- package/dist/{chunk-Z22V3D4E.js → chunk-K3BNIGPX.js} +95 -37
- package/dist/chunk-K3BNIGPX.js.map +1 -0
- package/dist/{chunk-JK47EFJT.mjs → chunk-TTOKQAPX.mjs} +65 -14
- package/dist/chunk-TTOKQAPX.mjs.map +1 -0
- package/dist/compat.d.mts +1 -1
- package/dist/compat.d.ts +1 -1
- package/dist/compat.js +40 -39
- package/dist/compat.js.map +1 -1
- package/dist/compat.mjs +39 -38
- package/dist/compat.mjs.map +1 -1
- package/dist/headless.d.mts +447 -151
- package/dist/headless.d.ts +447 -151
- package/dist/headless.js +214 -194
- package/dist/headless.mjs +3 -3
- package/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +268 -224
- package/dist/index.mjs +4 -4
- package/dist/react.d.mts +108 -7
- package/dist/react.d.ts +108 -7
- package/dist/react.js +54 -30
- package/dist/react.mjs +2 -2
- package/dist/{wallet-standard-shim-DiMvGjOk.d.ts → standard-shim-CT49DM5l.d.mts} +38 -247
- package/dist/{wallet-standard-shim-D4CYG5sU.d.mts → standard-shim-D9guL5fz.d.ts} +38 -247
- package/dist/{transaction-signer-CpGEvp7S.d.mts → transaction-signer-T-KVQFi8.d.mts} +1 -1
- package/dist/{transaction-signer-CpGEvp7S.d.ts → transaction-signer-T-KVQFi8.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-APQGEW7S.mjs.map +0 -1
- package/dist/chunk-I64FD2EH.js +0 -312
- package/dist/chunk-I64FD2EH.js.map +0 -1
- package/dist/chunk-JK47EFJT.mjs.map +0 -1
- package/dist/chunk-QL3IT3TS.mjs +0 -299
- package/dist/chunk-QL3IT3TS.mjs.map +0 -1
- package/dist/chunk-TQRJYZNK.mjs.map +0 -1
- package/dist/chunk-VA6LKXCQ.js.map +0 -1
- package/dist/chunk-VZ5Y6DIM.js.map +0 -1
- package/dist/chunk-Z22V3D4E.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { EnhancedStorage, EnhancedStorageAdapter, SOLANA_CHAIN_IDS, address,
|
|
2
|
-
export { AccountElement,
|
|
3
|
-
export { ClipboardErrorType,
|
|
4
|
-
export { LAMPORTS_PER_SOL, createSolanaClient, getExplorerLink, getPublicSolanaRpcUrl, lamportsToSol, prepareTransaction, solToLamports } from './chunk-
|
|
1
|
+
export { EnhancedStorage, EnhancedStorageAdapter, SOLANA_CHAIN_IDS, address, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createSignableMessage, createSolanaDevnet, createSolanaLocalnet, createSolanaMainnet, createSolanaTestnet, formatSignature, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getDefaultConfig, getDefaultMobileConfig, getLatestBlockhash, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, isAccountAddress, isKitConnection, isKnownSolanaChain, isLegacyConnection, isSolanaChain, isWalletName, parseConfigOptions, sendRawTransaction, validateConfigOptions, validateKnownSolanaChain } from './chunk-G575OAT4.mjs';
|
|
2
|
+
export { AccountElement, AppProvider, BalanceElement, ClusterElement, ConnectorProvider, DisconnectElement, SkeletonShine, TokenListElement, TransactionHistoryElement, UnifiedProvider, WalletListElement, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnector, useConnectorClient, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletInfo } from './chunk-TTOKQAPX.mjs';
|
|
3
|
+
export { ClipboardErrorType, ConnectorClient, ConnectorErrorBoundary, PUBLIC_RPC_ENDPOINTS, TransactionSignerError, WalletErrorType, copyAddressToClipboard, copySignatureToClipboard, copyToClipboard, createGillTransactionSigner, createKitTransactionSigner, createTransactionSigner, formatAddress, formatBigIntBalance, formatBigIntUsd, formatLamportsToSolSafe, formatNumber, formatSOL, formatTokenAmount, formatTokenBalanceSafe, getAddressUrl, getBlockUrl, getChainIdForWalletStandard, getClusterChainId, getClusterExplorerUrl, getClusterName, getClusterRpcUrl, getClusterType, getDefaultRpcUrl, getNetworkDisplayName, getPolyfillStatus, getTokenUrl, getTransactionUrl, getWalletsRegistry, installPolyfills, isClipboardAvailable, isCryptoAvailable, isDevnet, isDevnetCluster, isLocalCluster, isLocalnet, isMainnet, isMainnetCluster, isPolyfillInstalled, isTestnet, isTestnetCluster, isTransactionSignerError, normalizeNetwork, ready, toClusterId, truncate, withErrorBoundary } from './chunk-6F6M6L7R.mjs';
|
|
4
|
+
export { ConfigurationError, ConnectionError, ConnectorError, Errors, LAMPORTS_PER_SOL, NetworkError, TransactionError, ValidationError, base58ToSignatureBytes, createKitSignersFromWallet, createMessageSignerFromWallet, createSolanaClient, createTransactionSendingSignerFromWallet, detectMessageModification, freezeSigner, getExplorerLink, getPublicSolanaRpcUrl, getUserFriendlyMessage, isConfigurationError, isConnectionError, isConnectorError, isFailure, isNetworkError, isSuccess, isTransactionError, isValidationError, lamportsToSol, prepareTransaction, signatureBytesToBase58, solToLamports, toConnectorError, tryCatch, tryCatchSync, updateSignatureDictionary } from './chunk-J7DHGLW6.mjs';
|
|
5
5
|
//# sourceMappingURL=index.mjs.map
|
|
6
6
|
//# sourceMappingURL=index.mjs.map
|
package/dist/react.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as ConnectorErrorBoundary, C as ConnectorProvider, c as ConnectorSnapshot, e as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig,
|
|
1
|
+
import { d as ConnectorConfig, M as MobileWalletAdapterConfig, h as ClusterType, A as AccountInfo, T as ClipboardResult, s as SolanaClient } from './standard-shim-CT49DM5l.mjs';
|
|
2
|
+
export { b as ConnectorErrorBoundary, C as ConnectorProvider, c as ConnectorSnapshot, e as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig, W as WalletInfo, g as WalletStandardAccount, f as WalletStandardWallet, u as useConnector, a as useConnectorClient, w as withErrorBoundary } from './standard-shim-CT49DM5l.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode, ComponentType, PropsWithChildren } from 'react';
|
|
5
5
|
import { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
|
|
6
6
|
export { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
|
|
7
|
-
import {
|
|
7
|
+
import { a as TransactionSigner, v as TransactionSignerCapabilities } from './transaction-signer-T-KVQFi8.mjs';
|
|
8
8
|
import { TransactionModifyingSigner } from '@solana/signers';
|
|
9
9
|
import { TransactionMessage, TransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime } from '@solana/kit';
|
|
10
10
|
export { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
@@ -14,17 +14,23 @@ import '@solana-mobile/wallet-standard-mobile';
|
|
|
14
14
|
import '@solana/transaction-messages';
|
|
15
15
|
import '@solana/web3.js';
|
|
16
16
|
|
|
17
|
-
interface
|
|
17
|
+
interface AppProviderProps {
|
|
18
18
|
children: ReactNode;
|
|
19
|
-
|
|
19
|
+
/** ConnectorKit configuration */
|
|
20
20
|
connectorConfig?: ConnectorConfig;
|
|
21
|
+
/** Mobile Wallet Adapter configuration */
|
|
21
22
|
mobile?: MobileWalletAdapterConfig;
|
|
23
|
+
/** Optional additional providers to wrap around children */
|
|
22
24
|
providers?: Array<{
|
|
23
25
|
component: ComponentType<PropsWithChildren>;
|
|
24
26
|
props?: Record<string, unknown>;
|
|
25
27
|
}>;
|
|
26
28
|
}
|
|
27
|
-
declare function
|
|
29
|
+
declare function AppProvider({ children, connectorConfig, mobile, providers }: AppProviderProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
/** @deprecated Use `AppProvider` instead */
|
|
31
|
+
declare const UnifiedProvider: typeof AppProvider;
|
|
32
|
+
/** @deprecated Use `AppProviderProps` instead */
|
|
33
|
+
type UnifiedProviderProps = AppProviderProps;
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* @solana/connector - useCluster hook
|
|
@@ -496,6 +502,24 @@ interface UseTransactionPreparerReturn {
|
|
|
496
502
|
*/
|
|
497
503
|
declare function useTransactionPreparer(): UseTransactionPreparerReturn;
|
|
498
504
|
|
|
505
|
+
/**
|
|
506
|
+
* Generate the query key for balance data.
|
|
507
|
+
* Use this to invalidate the balance cache externally.
|
|
508
|
+
*
|
|
509
|
+
* Note: Balance and tokens share the same underlying cache (wallet-assets).
|
|
510
|
+
*
|
|
511
|
+
* @param rpcUrl - The RPC URL being used
|
|
512
|
+
* @param address - The wallet address
|
|
513
|
+
* @returns The query key string, or null if params are invalid
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```tsx
|
|
517
|
+
* // Invalidate balance after sending a transaction
|
|
518
|
+
* const key = getBalanceQueryKey(rpcUrl, address);
|
|
519
|
+
* if (key) invalidateSharedQuery(key);
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
522
|
+
declare function getBalanceQueryKey(rpcUrl: string | null, address: string | null): string | null;
|
|
499
523
|
interface TokenBalance {
|
|
500
524
|
/** Token mint address */
|
|
501
525
|
mint: string;
|
|
@@ -611,6 +635,35 @@ interface UseBalanceReturn {
|
|
|
611
635
|
*/
|
|
612
636
|
declare function useBalance(options?: UseBalanceOptions): UseBalanceReturn;
|
|
613
637
|
|
|
638
|
+
/**
|
|
639
|
+
* Options for generating the transactions query key
|
|
640
|
+
*/
|
|
641
|
+
interface TransactionsQueryKeyOptions {
|
|
642
|
+
rpcUrl: string;
|
|
643
|
+
address: string;
|
|
644
|
+
clusterId: SolanaClusterId;
|
|
645
|
+
limit?: number;
|
|
646
|
+
fetchDetails?: boolean;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Generate the query key for transactions data.
|
|
650
|
+
* Use this to invalidate the transactions cache externally.
|
|
651
|
+
*
|
|
652
|
+
* @param options - Query key options
|
|
653
|
+
* @returns The query key string, or null if required params are missing
|
|
654
|
+
*
|
|
655
|
+
* @example
|
|
656
|
+
* ```tsx
|
|
657
|
+
* // Invalidate transactions after sending a new transaction
|
|
658
|
+
* const key = getTransactionsQueryKey({
|
|
659
|
+
* rpcUrl: 'https://api.mainnet-beta.solana.com',
|
|
660
|
+
* address: 'ABC123...',
|
|
661
|
+
* clusterId: 'solana:mainnet',
|
|
662
|
+
* });
|
|
663
|
+
* if (key) invalidateSharedQuery(key);
|
|
664
|
+
* ```
|
|
665
|
+
*/
|
|
666
|
+
declare function getTransactionsQueryKey(options: TransactionsQueryKeyOptions): string | null;
|
|
614
667
|
interface TransactionInfo {
|
|
615
668
|
/** Transaction signature */
|
|
616
669
|
signature: string;
|
|
@@ -739,6 +792,24 @@ interface UseTransactionsReturn {
|
|
|
739
792
|
*/
|
|
740
793
|
declare function useTransactions(options?: UseTransactionsOptions): UseTransactionsReturn;
|
|
741
794
|
|
|
795
|
+
/**
|
|
796
|
+
* Generate the query key for tokens data.
|
|
797
|
+
* Use this to invalidate the tokens cache externally.
|
|
798
|
+
*
|
|
799
|
+
* Note: Balance and tokens share the same underlying cache (wallet-assets).
|
|
800
|
+
*
|
|
801
|
+
* @param rpcUrl - The RPC URL being used
|
|
802
|
+
* @param address - The wallet address
|
|
803
|
+
* @returns The query key string, or null if params are invalid
|
|
804
|
+
*
|
|
805
|
+
* @example
|
|
806
|
+
* ```tsx
|
|
807
|
+
* // Invalidate tokens after receiving new tokens
|
|
808
|
+
* const key = getTokensQueryKey(rpcUrl, address);
|
|
809
|
+
* if (key) invalidateSharedQuery(key);
|
|
810
|
+
* ```
|
|
811
|
+
*/
|
|
812
|
+
declare function getTokensQueryKey(rpcUrl: string | null, address: string | null): string | null;
|
|
742
813
|
interface Token {
|
|
743
814
|
/** Token mint address */
|
|
744
815
|
mint: string;
|
|
@@ -807,6 +878,10 @@ interface UseTokensReturn {
|
|
|
807
878
|
/** Total number of token accounts */
|
|
808
879
|
totalAccounts: number;
|
|
809
880
|
}
|
|
881
|
+
/**
|
|
882
|
+
* Clear all token caches. Called on disconnect/session end.
|
|
883
|
+
*/
|
|
884
|
+
declare function clearTokenCaches(): void;
|
|
810
885
|
/**
|
|
811
886
|
* Hook for fetching wallet token holdings.
|
|
812
887
|
* Fetches metadata (name, symbol, icon) from Solana Token List API and USD prices from CoinGecko.
|
|
@@ -872,6 +947,23 @@ declare function invalidateSharedQuery(key: string): void;
|
|
|
872
947
|
*/
|
|
873
948
|
declare function clearSharedQueryCache(): void;
|
|
874
949
|
|
|
950
|
+
/**
|
|
951
|
+
* Generate the query key for wallet assets.
|
|
952
|
+
* Use this to invalidate the cache externally.
|
|
953
|
+
*
|
|
954
|
+
* @param rpcUrl - The RPC URL being used
|
|
955
|
+
* @param address - The wallet address
|
|
956
|
+
* @returns The stringified query key, or null if params are invalid
|
|
957
|
+
*
|
|
958
|
+
* @example
|
|
959
|
+
* ```tsx
|
|
960
|
+
* // Invalidate wallet assets after a transaction
|
|
961
|
+
* const key = getWalletAssetsQueryKey(rpcUrl, address);
|
|
962
|
+
* if (key) invalidateSharedQuery(key);
|
|
963
|
+
* ```
|
|
964
|
+
*/
|
|
965
|
+
declare function getWalletAssetsQueryKey(rpcUrl: string | null, address: string | null): string | null;
|
|
966
|
+
|
|
875
967
|
interface DisconnectElementProps {
|
|
876
968
|
/** Display variant */
|
|
877
969
|
variant?: 'button' | 'menuitem' | 'link';
|
|
@@ -1299,4 +1391,13 @@ declare namespace TokenListElement {
|
|
|
1299
1391
|
var displayName: string;
|
|
1300
1392
|
}
|
|
1301
1393
|
|
|
1302
|
-
|
|
1394
|
+
/**
|
|
1395
|
+
* Shine overlay component for skeleton loading states.
|
|
1396
|
+
* Injects CSS styles once and provides the animated shine effect.
|
|
1397
|
+
*/
|
|
1398
|
+
declare function SkeletonShine(): react_jsx_runtime.JSX.Element;
|
|
1399
|
+
declare namespace SkeletonShine {
|
|
1400
|
+
var displayName: string;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export { AccountElement, type AccountElementProps, type AccountElementRenderProps, AccountInfo, AppProvider, type AppProviderProps, BalanceElement, type BalanceElementProps, type BalanceElementRenderProps, ClusterElement, type ClusterElementProps, type ClusterElementRenderProps, ClusterType, ConnectorConfig, DisconnectElement, type DisconnectElementProps, MobileWalletAdapterConfig, SkeletonShine, type Token, type TokenBalance, TokenListElement, type TokenListElementProps, type TokenListElementRenderProps, TransactionHistoryElement, type TransactionHistoryElementProps, type TransactionHistoryElementRenderProps, type TransactionInfo, type TransactionPrepareOptions, type TransactionsQueryKeyOptions, UnifiedProvider, type UnifiedProviderProps, type UseAccountReturn, type UseBalanceOptions, type UseBalanceReturn, type UseClusterReturn, type UseGillSolanaClientReturn, type UseGillTransactionSignerReturn, type UseKitTransactionSignerReturn, type UseSolanaClientReturn, type UseTokensOptions, type UseTokensReturn, type UseTransactionPreparerReturn, type UseTransactionSignerReturn, type UseTransactionsOptions, type UseTransactionsReturn, type UseWalletInfoReturn, type WalletDisplayInfo, WalletListElement, type WalletListElementProps, type WalletListElementRenderProps, type WalletListElementWalletProps, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletInfo };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as ConnectorErrorBoundary, C as ConnectorProvider, c as ConnectorSnapshot, e as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig,
|
|
1
|
+
import { d as ConnectorConfig, M as MobileWalletAdapterConfig, h as ClusterType, A as AccountInfo, T as ClipboardResult, s as SolanaClient } from './standard-shim-D9guL5fz.js';
|
|
2
|
+
export { b as ConnectorErrorBoundary, C as ConnectorProvider, c as ConnectorSnapshot, e as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig, W as WalletInfo, g as WalletStandardAccount, f as WalletStandardWallet, u as useConnector, a as useConnectorClient, w as withErrorBoundary } from './standard-shim-D9guL5fz.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode, ComponentType, PropsWithChildren } from 'react';
|
|
5
5
|
import { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
|
|
6
6
|
export { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
|
|
7
|
-
import {
|
|
7
|
+
import { a as TransactionSigner, v as TransactionSignerCapabilities } from './transaction-signer-T-KVQFi8.js';
|
|
8
8
|
import { TransactionModifyingSigner } from '@solana/signers';
|
|
9
9
|
import { TransactionMessage, TransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime } from '@solana/kit';
|
|
10
10
|
export { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
@@ -14,17 +14,23 @@ import '@solana-mobile/wallet-standard-mobile';
|
|
|
14
14
|
import '@solana/transaction-messages';
|
|
15
15
|
import '@solana/web3.js';
|
|
16
16
|
|
|
17
|
-
interface
|
|
17
|
+
interface AppProviderProps {
|
|
18
18
|
children: ReactNode;
|
|
19
|
-
|
|
19
|
+
/** ConnectorKit configuration */
|
|
20
20
|
connectorConfig?: ConnectorConfig;
|
|
21
|
+
/** Mobile Wallet Adapter configuration */
|
|
21
22
|
mobile?: MobileWalletAdapterConfig;
|
|
23
|
+
/** Optional additional providers to wrap around children */
|
|
22
24
|
providers?: Array<{
|
|
23
25
|
component: ComponentType<PropsWithChildren>;
|
|
24
26
|
props?: Record<string, unknown>;
|
|
25
27
|
}>;
|
|
26
28
|
}
|
|
27
|
-
declare function
|
|
29
|
+
declare function AppProvider({ children, connectorConfig, mobile, providers }: AppProviderProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
/** @deprecated Use `AppProvider` instead */
|
|
31
|
+
declare const UnifiedProvider: typeof AppProvider;
|
|
32
|
+
/** @deprecated Use `AppProviderProps` instead */
|
|
33
|
+
type UnifiedProviderProps = AppProviderProps;
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* @solana/connector - useCluster hook
|
|
@@ -496,6 +502,24 @@ interface UseTransactionPreparerReturn {
|
|
|
496
502
|
*/
|
|
497
503
|
declare function useTransactionPreparer(): UseTransactionPreparerReturn;
|
|
498
504
|
|
|
505
|
+
/**
|
|
506
|
+
* Generate the query key for balance data.
|
|
507
|
+
* Use this to invalidate the balance cache externally.
|
|
508
|
+
*
|
|
509
|
+
* Note: Balance and tokens share the same underlying cache (wallet-assets).
|
|
510
|
+
*
|
|
511
|
+
* @param rpcUrl - The RPC URL being used
|
|
512
|
+
* @param address - The wallet address
|
|
513
|
+
* @returns The query key string, or null if params are invalid
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```tsx
|
|
517
|
+
* // Invalidate balance after sending a transaction
|
|
518
|
+
* const key = getBalanceQueryKey(rpcUrl, address);
|
|
519
|
+
* if (key) invalidateSharedQuery(key);
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
522
|
+
declare function getBalanceQueryKey(rpcUrl: string | null, address: string | null): string | null;
|
|
499
523
|
interface TokenBalance {
|
|
500
524
|
/** Token mint address */
|
|
501
525
|
mint: string;
|
|
@@ -611,6 +635,35 @@ interface UseBalanceReturn {
|
|
|
611
635
|
*/
|
|
612
636
|
declare function useBalance(options?: UseBalanceOptions): UseBalanceReturn;
|
|
613
637
|
|
|
638
|
+
/**
|
|
639
|
+
* Options for generating the transactions query key
|
|
640
|
+
*/
|
|
641
|
+
interface TransactionsQueryKeyOptions {
|
|
642
|
+
rpcUrl: string;
|
|
643
|
+
address: string;
|
|
644
|
+
clusterId: SolanaClusterId;
|
|
645
|
+
limit?: number;
|
|
646
|
+
fetchDetails?: boolean;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Generate the query key for transactions data.
|
|
650
|
+
* Use this to invalidate the transactions cache externally.
|
|
651
|
+
*
|
|
652
|
+
* @param options - Query key options
|
|
653
|
+
* @returns The query key string, or null if required params are missing
|
|
654
|
+
*
|
|
655
|
+
* @example
|
|
656
|
+
* ```tsx
|
|
657
|
+
* // Invalidate transactions after sending a new transaction
|
|
658
|
+
* const key = getTransactionsQueryKey({
|
|
659
|
+
* rpcUrl: 'https://api.mainnet-beta.solana.com',
|
|
660
|
+
* address: 'ABC123...',
|
|
661
|
+
* clusterId: 'solana:mainnet',
|
|
662
|
+
* });
|
|
663
|
+
* if (key) invalidateSharedQuery(key);
|
|
664
|
+
* ```
|
|
665
|
+
*/
|
|
666
|
+
declare function getTransactionsQueryKey(options: TransactionsQueryKeyOptions): string | null;
|
|
614
667
|
interface TransactionInfo {
|
|
615
668
|
/** Transaction signature */
|
|
616
669
|
signature: string;
|
|
@@ -739,6 +792,24 @@ interface UseTransactionsReturn {
|
|
|
739
792
|
*/
|
|
740
793
|
declare function useTransactions(options?: UseTransactionsOptions): UseTransactionsReturn;
|
|
741
794
|
|
|
795
|
+
/**
|
|
796
|
+
* Generate the query key for tokens data.
|
|
797
|
+
* Use this to invalidate the tokens cache externally.
|
|
798
|
+
*
|
|
799
|
+
* Note: Balance and tokens share the same underlying cache (wallet-assets).
|
|
800
|
+
*
|
|
801
|
+
* @param rpcUrl - The RPC URL being used
|
|
802
|
+
* @param address - The wallet address
|
|
803
|
+
* @returns The query key string, or null if params are invalid
|
|
804
|
+
*
|
|
805
|
+
* @example
|
|
806
|
+
* ```tsx
|
|
807
|
+
* // Invalidate tokens after receiving new tokens
|
|
808
|
+
* const key = getTokensQueryKey(rpcUrl, address);
|
|
809
|
+
* if (key) invalidateSharedQuery(key);
|
|
810
|
+
* ```
|
|
811
|
+
*/
|
|
812
|
+
declare function getTokensQueryKey(rpcUrl: string | null, address: string | null): string | null;
|
|
742
813
|
interface Token {
|
|
743
814
|
/** Token mint address */
|
|
744
815
|
mint: string;
|
|
@@ -807,6 +878,10 @@ interface UseTokensReturn {
|
|
|
807
878
|
/** Total number of token accounts */
|
|
808
879
|
totalAccounts: number;
|
|
809
880
|
}
|
|
881
|
+
/**
|
|
882
|
+
* Clear all token caches. Called on disconnect/session end.
|
|
883
|
+
*/
|
|
884
|
+
declare function clearTokenCaches(): void;
|
|
810
885
|
/**
|
|
811
886
|
* Hook for fetching wallet token holdings.
|
|
812
887
|
* Fetches metadata (name, symbol, icon) from Solana Token List API and USD prices from CoinGecko.
|
|
@@ -872,6 +947,23 @@ declare function invalidateSharedQuery(key: string): void;
|
|
|
872
947
|
*/
|
|
873
948
|
declare function clearSharedQueryCache(): void;
|
|
874
949
|
|
|
950
|
+
/**
|
|
951
|
+
* Generate the query key for wallet assets.
|
|
952
|
+
* Use this to invalidate the cache externally.
|
|
953
|
+
*
|
|
954
|
+
* @param rpcUrl - The RPC URL being used
|
|
955
|
+
* @param address - The wallet address
|
|
956
|
+
* @returns The stringified query key, or null if params are invalid
|
|
957
|
+
*
|
|
958
|
+
* @example
|
|
959
|
+
* ```tsx
|
|
960
|
+
* // Invalidate wallet assets after a transaction
|
|
961
|
+
* const key = getWalletAssetsQueryKey(rpcUrl, address);
|
|
962
|
+
* if (key) invalidateSharedQuery(key);
|
|
963
|
+
* ```
|
|
964
|
+
*/
|
|
965
|
+
declare function getWalletAssetsQueryKey(rpcUrl: string | null, address: string | null): string | null;
|
|
966
|
+
|
|
875
967
|
interface DisconnectElementProps {
|
|
876
968
|
/** Display variant */
|
|
877
969
|
variant?: 'button' | 'menuitem' | 'link';
|
|
@@ -1299,4 +1391,13 @@ declare namespace TokenListElement {
|
|
|
1299
1391
|
var displayName: string;
|
|
1300
1392
|
}
|
|
1301
1393
|
|
|
1302
|
-
|
|
1394
|
+
/**
|
|
1395
|
+
* Shine overlay component for skeleton loading states.
|
|
1396
|
+
* Injects CSS styles once and provides the animated shine effect.
|
|
1397
|
+
*/
|
|
1398
|
+
declare function SkeletonShine(): react_jsx_runtime.JSX.Element;
|
|
1399
|
+
declare namespace SkeletonShine {
|
|
1400
|
+
var displayName: string;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export { AccountElement, type AccountElementProps, type AccountElementRenderProps, AccountInfo, AppProvider, type AppProviderProps, BalanceElement, type BalanceElementProps, type BalanceElementRenderProps, ClusterElement, type ClusterElementProps, type ClusterElementRenderProps, ClusterType, ConnectorConfig, DisconnectElement, type DisconnectElementProps, MobileWalletAdapterConfig, SkeletonShine, type Token, type TokenBalance, TokenListElement, type TokenListElementProps, type TokenListElementRenderProps, TransactionHistoryElement, type TransactionHistoryElementProps, type TransactionHistoryElementRenderProps, type TransactionInfo, type TransactionPrepareOptions, type TransactionsQueryKeyOptions, UnifiedProvider, type UnifiedProviderProps, type UseAccountReturn, type UseBalanceOptions, type UseBalanceReturn, type UseClusterReturn, type UseGillSolanaClientReturn, type UseGillTransactionSignerReturn, type UseKitTransactionSignerReturn, type UseSolanaClientReturn, type UseTokensOptions, type UseTokensReturn, type UseTransactionPreparerReturn, type UseTransactionSignerReturn, type UseTransactionsOptions, type UseTransactionsReturn, type UseWalletInfoReturn, type WalletDisplayInfo, WalletListElement, type WalletListElementProps, type WalletListElementRenderProps, type WalletListElementWalletProps, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletInfo };
|
package/dist/react.js
CHANGED
|
@@ -1,121 +1,145 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkK3BNIGPX_js = require('./chunk-K3BNIGPX.js');
|
|
4
|
+
var chunkFTXIXM43_js = require('./chunk-FTXIXM43.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "AccountElement", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkK3BNIGPX_js.AccountElement; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "AppProvider", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkK3BNIGPX_js.AppProvider; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "BalanceElement", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkK3BNIGPX_js.BalanceElement; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ClusterElement", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkK3BNIGPX_js.ClusterElement; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "ConnectorProvider", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkK3BNIGPX_js.ConnectorProvider; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "DisconnectElement", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkK3BNIGPX_js.DisconnectElement; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "SkeletonShine", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return chunkK3BNIGPX_js.SkeletonShine; }
|
|
31
35
|
});
|
|
32
36
|
Object.defineProperty(exports, "TokenListElement", {
|
|
33
37
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkK3BNIGPX_js.TokenListElement; }
|
|
35
39
|
});
|
|
36
40
|
Object.defineProperty(exports, "TransactionHistoryElement", {
|
|
37
41
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkK3BNIGPX_js.TransactionHistoryElement; }
|
|
39
43
|
});
|
|
40
44
|
Object.defineProperty(exports, "UnifiedProvider", {
|
|
41
45
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkK3BNIGPX_js.UnifiedProvider; }
|
|
43
47
|
});
|
|
44
48
|
Object.defineProperty(exports, "WalletListElement", {
|
|
45
49
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkK3BNIGPX_js.WalletListElement; }
|
|
47
51
|
});
|
|
48
52
|
Object.defineProperty(exports, "clearSharedQueryCache", {
|
|
49
53
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkK3BNIGPX_js.clearSharedQueryCache; }
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "clearTokenCaches", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () { return chunkK3BNIGPX_js.clearTokenCaches; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "getBalanceQueryKey", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunkK3BNIGPX_js.getBalanceQueryKey; }
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "getTokensQueryKey", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return chunkK3BNIGPX_js.getTokensQueryKey; }
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "getTransactionsQueryKey", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () { return chunkK3BNIGPX_js.getTransactionsQueryKey; }
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "getWalletAssetsQueryKey", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () { return chunkK3BNIGPX_js.getWalletAssetsQueryKey; }
|
|
51
75
|
});
|
|
52
76
|
Object.defineProperty(exports, "invalidateSharedQuery", {
|
|
53
77
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkK3BNIGPX_js.invalidateSharedQuery; }
|
|
55
79
|
});
|
|
56
80
|
Object.defineProperty(exports, "useAccount", {
|
|
57
81
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkK3BNIGPX_js.useAccount; }
|
|
59
83
|
});
|
|
60
84
|
Object.defineProperty(exports, "useBalance", {
|
|
61
85
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkK3BNIGPX_js.useBalance; }
|
|
63
87
|
});
|
|
64
88
|
Object.defineProperty(exports, "useCluster", {
|
|
65
89
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkK3BNIGPX_js.useCluster; }
|
|
67
91
|
});
|
|
68
92
|
Object.defineProperty(exports, "useConnector", {
|
|
69
93
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkK3BNIGPX_js.useConnector; }
|
|
71
95
|
});
|
|
72
96
|
Object.defineProperty(exports, "useConnectorClient", {
|
|
73
97
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkK3BNIGPX_js.useConnectorClient; }
|
|
75
99
|
});
|
|
76
100
|
Object.defineProperty(exports, "useGillSolanaClient", {
|
|
77
101
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkK3BNIGPX_js.useGillSolanaClient; }
|
|
79
103
|
});
|
|
80
104
|
Object.defineProperty(exports, "useGillTransactionSigner", {
|
|
81
105
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkK3BNIGPX_js.useGillTransactionSigner; }
|
|
83
107
|
});
|
|
84
108
|
Object.defineProperty(exports, "useKitTransactionSigner", {
|
|
85
109
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkK3BNIGPX_js.useKitTransactionSigner; }
|
|
87
111
|
});
|
|
88
112
|
Object.defineProperty(exports, "useSolanaClient", {
|
|
89
113
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkK3BNIGPX_js.useSolanaClient; }
|
|
91
115
|
});
|
|
92
116
|
Object.defineProperty(exports, "useTokens", {
|
|
93
117
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkK3BNIGPX_js.useTokens; }
|
|
95
119
|
});
|
|
96
120
|
Object.defineProperty(exports, "useTransactionPreparer", {
|
|
97
121
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkK3BNIGPX_js.useTransactionPreparer; }
|
|
99
123
|
});
|
|
100
124
|
Object.defineProperty(exports, "useTransactionSigner", {
|
|
101
125
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkK3BNIGPX_js.useTransactionSigner; }
|
|
103
127
|
});
|
|
104
128
|
Object.defineProperty(exports, "useTransactions", {
|
|
105
129
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkK3BNIGPX_js.useTransactions; }
|
|
107
131
|
});
|
|
108
132
|
Object.defineProperty(exports, "useWalletInfo", {
|
|
109
133
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkK3BNIGPX_js.useWalletInfo; }
|
|
111
135
|
});
|
|
112
136
|
Object.defineProperty(exports, "ConnectorErrorBoundary", {
|
|
113
137
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkFTXIXM43_js.ConnectorErrorBoundary; }
|
|
115
139
|
});
|
|
116
140
|
Object.defineProperty(exports, "withErrorBoundary", {
|
|
117
141
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkFTXIXM43_js.withErrorBoundary; }
|
|
119
143
|
});
|
|
120
144
|
//# sourceMappingURL=react.js.map
|
|
121
145
|
//# sourceMappingURL=react.js.map
|
package/dist/react.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AccountElement,
|
|
2
|
-
export { ConnectorErrorBoundary, withErrorBoundary } from './chunk-
|
|
1
|
+
export { AccountElement, AppProvider, BalanceElement, ClusterElement, ConnectorProvider, DisconnectElement, SkeletonShine, TokenListElement, TransactionHistoryElement, UnifiedProvider, WalletListElement, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnector, useConnectorClient, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletInfo } from './chunk-TTOKQAPX.mjs';
|
|
2
|
+
export { ConnectorErrorBoundary, withErrorBoundary } from './chunk-6F6M6L7R.mjs';
|
|
3
3
|
//# sourceMappingURL=react.mjs.map
|
|
4
4
|
//# sourceMappingURL=react.mjs.map
|