@solana/connector 0.1.6 → 0.1.7
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 +45 -45
- package/dist/{chunk-VMSZJPR5.mjs → chunk-APQGEW7S.mjs} +82 -11
- package/dist/chunk-APQGEW7S.mjs.map +1 -0
- package/dist/{chunk-3STZXVXD.mjs → chunk-JK47EFJT.mjs} +940 -381
- package/dist/chunk-JK47EFJT.mjs.map +1 -0
- package/dist/{chunk-QKVL45F6.mjs → chunk-TQRJYZNK.mjs} +5 -3
- package/dist/chunk-TQRJYZNK.mjs.map +1 -0
- package/dist/{chunk-JUZVCBAI.js → chunk-VA6LKXCQ.js} +85 -10
- package/dist/chunk-VA6LKXCQ.js.map +1 -0
- package/dist/{chunk-NQXK7PGX.js → chunk-VZ5Y6DIM.js} +19 -17
- package/dist/chunk-VZ5Y6DIM.js.map +1 -0
- package/dist/{chunk-ULUYX23Q.js → chunk-Z22V3D4E.js} +949 -388
- package/dist/chunk-Z22V3D4E.js.map +1 -0
- package/dist/compat.d.mts +1 -1
- package/dist/compat.d.ts +1 -1
- package/dist/headless.d.mts +99 -7
- package/dist/headless.d.ts +99 -7
- package/dist/headless.js +128 -112
- package/dist/headless.mjs +2 -2
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +163 -139
- package/dist/index.mjs +3 -3
- package/dist/react.d.mts +179 -13
- package/dist/react.d.ts +179 -13
- package/dist/react.js +36 -28
- package/dist/react.mjs +2 -2
- package/dist/{transaction-signer-D9d8nxwb.d.mts → transaction-signer-CpGEvp7S.d.mts} +1 -1
- package/dist/{transaction-signer-D9d8nxwb.d.ts → transaction-signer-CpGEvp7S.d.ts} +1 -1
- package/dist/{wallet-standard-shim--YcrQNRt.d.ts → wallet-standard-shim-D4CYG5sU.d.mts} +35 -6
- package/dist/{wallet-standard-shim-Dx7H8Ctf.d.mts → wallet-standard-shim-DiMvGjOk.d.ts} +35 -6
- package/package.json +1 -1
- package/dist/chunk-3STZXVXD.mjs.map +0 -1
- package/dist/chunk-JUZVCBAI.js.map +0 -1
- package/dist/chunk-NQXK7PGX.js.map +0 -1
- package/dist/chunk-QKVL45F6.mjs.map +0 -1
- package/dist/chunk-ULUYX23Q.js.map +0 -1
- package/dist/chunk-VMSZJPR5.mjs.map +0 -1
package/dist/compat.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SolanaTransaction, j as TransactionSigner } from './transaction-signer-
|
|
1
|
+
import { S as SolanaTransaction, j as TransactionSigner } from './transaction-signer-CpGEvp7S.mjs';
|
|
2
2
|
import { Connection, SendOptions } from '@solana/web3.js';
|
|
3
3
|
import '@wallet-standard/base';
|
|
4
4
|
import '@wallet-ui/core';
|
package/dist/compat.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SolanaTransaction, j as TransactionSigner } from './transaction-signer-
|
|
1
|
+
import { S as SolanaTransaction, j as TransactionSigner } from './transaction-signer-CpGEvp7S.js';
|
|
2
2
|
import { Connection, SendOptions } from '@solana/web3.js';
|
|
3
3
|
import '@wallet-standard/base';
|
|
4
4
|
import '@wallet-ui/core';
|
package/dist/headless.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as ClusterType, B as StorageOptions, S as StorageAdapter, F as EnhancedStorageAccountOptions, G as EnhancedStorageClusterOptions, H as EnhancedStorageWalletOptions } from './wallet-standard-shim-
|
|
2
|
-
export { q as AccountAddress, A as AccountInfo, T as ClipboardErrorType, V as ClipboardResult, j as ConnectorClient, d as ConnectorConfig, v as ConnectorDebugMetrics, x as ConnectorDebugState, y as ConnectorEvent, z as ConnectorEventListener, t as ConnectorHealth, e as ConnectorState, X as CopyOptions, R as CreateSolanaClientArgs, D as DefaultConfigOptions, E as ExtendedConnectorConfig, L as Listener, M as MobileWalletAdapterConfig, P as ModifiedClusterUrl, af as PUBLIC_RPC_ENDPOINTS, Q as SolanaClient, O as SolanaClusterMoniker, ae as SolanaNetwork, h as UnifiedConfig, U as UnifiedConfigOptions, J as WalletError, I as WalletErrorType, W as WalletInfo, p as WalletName, g as WalletStandardAccount, f as WalletStandardWallet, _ as copyAddressToClipboard, $ as copySignatureToClipboard, Z as copyToClipboard, n as createConfig, N as createSolanaClient, a3 as getAddressUrl, a5 as getBlockUrl, ad as getChainIdForWalletStandard, ac as getClusterChainId, a1 as getClusterExplorerUrl, aa as getClusterName, a0 as getClusterRpcUrl, ab as getClusterType, l as getDefaultConfig, m as getDefaultMobileConfig, ai as getDefaultRpcUrl, an as getNetworkDisplayName, K as getPublicSolanaRpcUrl, a4 as getTokenUrl, a2 as getTransactionUrl, k as getWalletsRegistry, s as isAccountAddress, Y as isClipboardAvailable, ak as isDevnet, a7 as isDevnetCluster, a9 as isLocalCluster, am as isLocalnet, aj as isMainnet, a6 as isMainnetCluster, al as isTestnet, a8 as isTestnetCluster, o as isUnifiedConfig, r as isWalletName, ag as normalizeNetwork, ah as toClusterId } from './wallet-standard-shim-
|
|
3
|
-
import { j as TransactionSigner } from './transaction-signer-
|
|
4
|
-
export { l as ConfigurationError, x as ConfigurationErrorCode, k as ConnectionError, v as ConnectionErrorCode, C as ConnectorError, E as Errors, N as NetworkError, y as NetworkErrorCode, a as SignedTransaction, S as SolanaTransaction, c as TransactionActivity, d as TransactionActivityStatus, m as TransactionError, z as TransactionErrorCode, f as TransactionMetadata, e as TransactionMethod, b as TransactionSignerCapabilities, T as TransactionSignerConfig, h as TransactionSignerError, V as ValidationError, w as ValidationErrorCode, g as createTransactionSigner, u as getUserFriendlyMessage, q as isConfigurationError, o as isConnectionError, n as isConnectorError, r as isNetworkError, s as isTransactionError, i as isTransactionSignerError, p as isValidationError, t as toConnectorError } from './transaction-signer-
|
|
1
|
+
import { i as ClusterType, B as StorageOptions, S as StorageAdapter, F as EnhancedStorageAccountOptions, G as EnhancedStorageClusterOptions, H as EnhancedStorageWalletOptions } from './wallet-standard-shim-D4CYG5sU.mjs';
|
|
2
|
+
export { q as AccountAddress, A as AccountInfo, T as ClipboardErrorType, V as ClipboardResult, j as ConnectorClient, d as ConnectorConfig, v as ConnectorDebugMetrics, x as ConnectorDebugState, y as ConnectorEvent, z as ConnectorEventListener, t as ConnectorHealth, e as ConnectorState, X as CopyOptions, R as CreateSolanaClientArgs, D as DefaultConfigOptions, E as ExtendedConnectorConfig, L as Listener, M as MobileWalletAdapterConfig, P as ModifiedClusterUrl, af as PUBLIC_RPC_ENDPOINTS, Q as SolanaClient, O as SolanaClusterMoniker, ae as SolanaNetwork, h as UnifiedConfig, U as UnifiedConfigOptions, J as WalletError, I as WalletErrorType, W as WalletInfo, p as WalletName, g as WalletStandardAccount, f as WalletStandardWallet, _ as copyAddressToClipboard, $ as copySignatureToClipboard, Z as copyToClipboard, n as createConfig, N as createSolanaClient, a3 as getAddressUrl, a5 as getBlockUrl, ad as getChainIdForWalletStandard, ac as getClusterChainId, a1 as getClusterExplorerUrl, aa as getClusterName, a0 as getClusterRpcUrl, ab as getClusterType, l as getDefaultConfig, m as getDefaultMobileConfig, ai as getDefaultRpcUrl, an as getNetworkDisplayName, K as getPublicSolanaRpcUrl, a4 as getTokenUrl, a2 as getTransactionUrl, k as getWalletsRegistry, s as isAccountAddress, Y as isClipboardAvailable, ak as isDevnet, a7 as isDevnetCluster, a9 as isLocalCluster, am as isLocalnet, aj as isMainnet, a6 as isMainnetCluster, al as isTestnet, a8 as isTestnetCluster, o as isUnifiedConfig, r as isWalletName, ag as normalizeNetwork, ah as toClusterId } from './wallet-standard-shim-D4CYG5sU.mjs';
|
|
3
|
+
import { j as TransactionSigner } from './transaction-signer-CpGEvp7S.mjs';
|
|
4
|
+
export { l as ConfigurationError, x as ConfigurationErrorCode, k as ConnectionError, v as ConnectionErrorCode, C as ConnectorError, E as Errors, N as NetworkError, y as NetworkErrorCode, a as SignedTransaction, S as SolanaTransaction, c as TransactionActivity, d as TransactionActivityStatus, m as TransactionError, z as TransactionErrorCode, f as TransactionMetadata, e as TransactionMethod, b as TransactionSignerCapabilities, T as TransactionSignerConfig, h as TransactionSignerError, V as ValidationError, w as ValidationErrorCode, g as createTransactionSigner, u as getUserFriendlyMessage, q as isConfigurationError, o as isConnectionError, n as isConnectorError, r as isNetworkError, s as isTransactionError, i as isTransactionSignerError, p as isValidationError, t as toConnectorError } from './transaction-signer-CpGEvp7S.mjs';
|
|
5
5
|
import { TransactionModifyingSigner, MessageModifyingSigner, TransactionSendingSigner, SignatureDictionary } from '@solana/signers';
|
|
6
6
|
export { MessageModifyingSigner, MessageModifyingSignerConfig, SignableMessage, SignatureDictionary, TransactionSendingSigner, TransactionSendingSignerConfig, createSignableMessage } from '@solana/signers';
|
|
7
7
|
import { SolanaCluster, SolanaClusterId, Storage } from '@wallet-ui/core';
|
|
@@ -10,6 +10,7 @@ import { Address } from '@solana/addresses';
|
|
|
10
10
|
export { Address, address } from '@solana/addresses';
|
|
11
11
|
import { SignatureBytes } from '@solana/keys';
|
|
12
12
|
export { SignatureBytes } from '@solana/keys';
|
|
13
|
+
import { Transaction } from '@solana/transactions';
|
|
13
14
|
export { Transaction } from '@solana/transactions';
|
|
14
15
|
import { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
15
16
|
export { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
@@ -17,6 +18,7 @@ import { Connection, SendOptions } from '@solana/web3.js';
|
|
|
17
18
|
import { TransactionMessage, TransactionMessageWithFeePayer, Rpc, GetLatestBlockhashApi, TransactionMessageWithBlockhashLifetime } from '@solana/kit';
|
|
18
19
|
import 'react';
|
|
19
20
|
import 'react/jsx-runtime';
|
|
21
|
+
import '@solana-mobile/wallet-standard-mobile';
|
|
20
22
|
import '@solana/transaction-messages';
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -93,6 +95,91 @@ declare function formatTokenAmount(amount: number | bigint, decimals: number, op
|
|
|
93
95
|
minimumDecimals?: number;
|
|
94
96
|
maximumDecimals?: number;
|
|
95
97
|
}): string;
|
|
98
|
+
/**
|
|
99
|
+
* Format a bigint balance with decimals, avoiding Number precision loss.
|
|
100
|
+
* Uses string manipulation for precision beyond Number.MAX_SAFE_INTEGER.
|
|
101
|
+
*
|
|
102
|
+
* @param amount - The bigint amount in smallest units
|
|
103
|
+
* @param decimals - Number of decimal places for the token
|
|
104
|
+
* @param options - Formatting options
|
|
105
|
+
* @returns Formatted string representation
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* // Small amounts (uses Number for speed)
|
|
109
|
+
* formatBigIntBalance(1000000n, 6) // Returns: '1'
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // Large amounts (uses string manipulation for precision)
|
|
113
|
+
* formatBigIntBalance(12345678901234567890n, 18) // Returns: '12.345678901234567890'
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* // With options
|
|
117
|
+
* formatBigIntBalance(1500000n, 6, { maxDecimals: 2 }) // Returns: '1.5'
|
|
118
|
+
*/
|
|
119
|
+
declare function formatBigIntBalance(amount: bigint, decimals: number, options?: {
|
|
120
|
+
/** Maximum number of decimal places to show (default: min(decimals, 6)) */
|
|
121
|
+
maxDecimals?: number;
|
|
122
|
+
/** Minimum number of decimal places to show (default: 0) */
|
|
123
|
+
minDecimals?: number;
|
|
124
|
+
/** Locale for number formatting (default: undefined, uses browser locale) */
|
|
125
|
+
locale?: string;
|
|
126
|
+
/** Whether to use grouping separators like commas (default: true) */
|
|
127
|
+
useGrouping?: boolean;
|
|
128
|
+
}): string;
|
|
129
|
+
/**
|
|
130
|
+
* Convert lamports to SOL string representation with BigInt safety.
|
|
131
|
+
*
|
|
132
|
+
* @param lamports - Amount in lamports (bigint)
|
|
133
|
+
* @param options - Formatting options
|
|
134
|
+
* @returns Formatted SOL string
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* formatLamportsToSolSafe(1000000000n) // Returns: '1'
|
|
138
|
+
* formatLamportsToSolSafe(1500000000n, { maxDecimals: 4 }) // Returns: '1.5'
|
|
139
|
+
* formatLamportsToSolSafe(1000000000n, { suffix: true }) // Returns: '1 SOL'
|
|
140
|
+
*/
|
|
141
|
+
declare function formatLamportsToSolSafe(lamports: bigint, options?: {
|
|
142
|
+
/** Maximum decimal places (default: 4) */
|
|
143
|
+
maxDecimals?: number;
|
|
144
|
+
/** Minimum decimal places (default: 0) */
|
|
145
|
+
minDecimals?: number;
|
|
146
|
+
/** Add ' SOL' suffix (default: false) */
|
|
147
|
+
suffix?: boolean;
|
|
148
|
+
/** Locale for formatting */
|
|
149
|
+
locale?: string;
|
|
150
|
+
}): string;
|
|
151
|
+
/**
|
|
152
|
+
* Format USD value from bigint amount with BigInt safety.
|
|
153
|
+
* Uses the USD price to calculate the value.
|
|
154
|
+
*
|
|
155
|
+
* @param amount - Token amount in smallest units (bigint)
|
|
156
|
+
* @param decimals - Token decimals
|
|
157
|
+
* @param usdPrice - Current USD price per token
|
|
158
|
+
* @param options - Formatting options
|
|
159
|
+
* @returns Formatted USD string
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* formatBigIntUsd(1000000000n, 9, 150.50) // Returns: '$150.50'
|
|
163
|
+
*/
|
|
164
|
+
declare function formatBigIntUsd(amount: bigint, decimals: number, usdPrice: number, options?: {
|
|
165
|
+
/** Locale for formatting (default: undefined) */
|
|
166
|
+
locale?: string;
|
|
167
|
+
/** Currency code (default: 'USD') */
|
|
168
|
+
currency?: string;
|
|
169
|
+
}): string;
|
|
170
|
+
/**
|
|
171
|
+
* Format a token balance for display with BigInt safety.
|
|
172
|
+
* Convenience wrapper around formatBigIntBalance.
|
|
173
|
+
*
|
|
174
|
+
* @param amount - Token amount in smallest units
|
|
175
|
+
* @param decimals - Token decimals
|
|
176
|
+
* @param options - Formatting options
|
|
177
|
+
* @returns Formatted balance string
|
|
178
|
+
*/
|
|
179
|
+
declare function formatTokenBalanceSafe(amount: bigint, decimals: number, options?: {
|
|
180
|
+
maxDecimals?: number;
|
|
181
|
+
locale?: string;
|
|
182
|
+
}): string;
|
|
96
183
|
|
|
97
184
|
declare const SOLANA_CHAIN_IDS: {
|
|
98
185
|
readonly mainnet: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
@@ -466,7 +553,7 @@ declare function createMessageSignerFromWallet(walletAddress: Address<string>, s
|
|
|
466
553
|
* const signatures = await signer.signAndSendTransactions([transaction]);
|
|
467
554
|
* ```
|
|
468
555
|
*/
|
|
469
|
-
declare function createTransactionSendingSignerFromWallet(walletAddress: Address<string>, chain: `solana:${string}`, sendTransactionFn: (transaction:
|
|
556
|
+
declare function createTransactionSendingSignerFromWallet(walletAddress: Address<string>, chain: `solana:${string}`, sendTransactionFn: (transaction: Transaction) => Promise<string>): TransactionSendingSigner<string>;
|
|
470
557
|
|
|
471
558
|
/**
|
|
472
559
|
* @solana/connector - Kit Integration Helper
|
|
@@ -525,6 +612,11 @@ declare function base58ToSignatureBytes(signature: string): SignatureBytes;
|
|
|
525
612
|
declare function signatureBytesToBase58(bytes: SignatureBytes): string;
|
|
526
613
|
|
|
527
614
|
type Commitment = 'processed' | 'confirmed' | 'finalized';
|
|
615
|
+
interface KitSendTransactionOptions {
|
|
616
|
+
commitment?: Commitment;
|
|
617
|
+
skipPreflight?: boolean;
|
|
618
|
+
maxRetries?: number;
|
|
619
|
+
}
|
|
528
620
|
type KitRpc = {
|
|
529
621
|
getLatestBlockhash(options?: {
|
|
530
622
|
commitment?: Commitment;
|
|
@@ -536,7 +628,7 @@ type KitRpc = {
|
|
|
536
628
|
};
|
|
537
629
|
}>;
|
|
538
630
|
};
|
|
539
|
-
sendTransaction(bytes: Uint8Array | string, options?:
|
|
631
|
+
sendTransaction(bytes: Uint8Array | string, options?: KitSendTransactionOptions): {
|
|
540
632
|
send(): Promise<string>;
|
|
541
633
|
};
|
|
542
634
|
send?: () => unknown;
|
|
@@ -640,4 +732,4 @@ declare function formatSignature(signature: string, chars?: number): string;
|
|
|
640
732
|
*/
|
|
641
733
|
declare function copySignature(signature: string): Promise<boolean>;
|
|
642
734
|
|
|
643
|
-
export { ClusterType, type Commitment, type DualConnection, EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, type GetExplorerLinkArgs, type KitSignersFromWallet, LAMPORTS_PER_SOL, type PrepareTransactionConfig, SOLANA_CHAIN_IDS, StorageAdapter, StorageOptions, TransactionSigner, base58ToSignatureBytes, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitSignersFromWallet, createKitTransactionSigner, createMessageSignerFromWallet, createTransactionSendingSignerFromWallet, detectMessageModification, formatAddress, formatNumber, formatSOL, formatSignature, formatTokenAmount, freezeSigner, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getExplorerLink, getLatestBlockhash, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isKitConnection, isKnownSolanaChain, isLegacyConnection, isPolyfillInstalled, isSolanaChain, lamportsToSol, prepareTransaction, sendRawTransaction, signatureBytesToBase58, solToLamports, truncate, updateSignatureDictionary, validateKnownSolanaChain };
|
|
735
|
+
export { ClusterType, type Commitment, type DualConnection, EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, type GetExplorerLinkArgs, type KitSignersFromWallet, LAMPORTS_PER_SOL, type PrepareTransactionConfig, SOLANA_CHAIN_IDS, StorageAdapter, StorageOptions, TransactionSigner, base58ToSignatureBytes, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitSignersFromWallet, createKitTransactionSigner, createMessageSignerFromWallet, createTransactionSendingSignerFromWallet, detectMessageModification, formatAddress, formatBigIntBalance, formatBigIntUsd, formatLamportsToSolSafe, formatNumber, formatSOL, formatSignature, formatTokenAmount, formatTokenBalanceSafe, freezeSigner, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getExplorerLink, getLatestBlockhash, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isKitConnection, isKnownSolanaChain, isLegacyConnection, isPolyfillInstalled, isSolanaChain, lamportsToSol, prepareTransaction, sendRawTransaction, signatureBytesToBase58, solToLamports, truncate, updateSignatureDictionary, validateKnownSolanaChain };
|
package/dist/headless.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as ClusterType, B as StorageOptions, S as StorageAdapter, F as EnhancedStorageAccountOptions, G as EnhancedStorageClusterOptions, H as EnhancedStorageWalletOptions } from './wallet-standard-shim
|
|
2
|
-
export { q as AccountAddress, A as AccountInfo, T as ClipboardErrorType, V as ClipboardResult, j as ConnectorClient, d as ConnectorConfig, v as ConnectorDebugMetrics, x as ConnectorDebugState, y as ConnectorEvent, z as ConnectorEventListener, t as ConnectorHealth, e as ConnectorState, X as CopyOptions, R as CreateSolanaClientArgs, D as DefaultConfigOptions, E as ExtendedConnectorConfig, L as Listener, M as MobileWalletAdapterConfig, P as ModifiedClusterUrl, af as PUBLIC_RPC_ENDPOINTS, Q as SolanaClient, O as SolanaClusterMoniker, ae as SolanaNetwork, h as UnifiedConfig, U as UnifiedConfigOptions, J as WalletError, I as WalletErrorType, W as WalletInfo, p as WalletName, g as WalletStandardAccount, f as WalletStandardWallet, _ as copyAddressToClipboard, $ as copySignatureToClipboard, Z as copyToClipboard, n as createConfig, N as createSolanaClient, a3 as getAddressUrl, a5 as getBlockUrl, ad as getChainIdForWalletStandard, ac as getClusterChainId, a1 as getClusterExplorerUrl, aa as getClusterName, a0 as getClusterRpcUrl, ab as getClusterType, l as getDefaultConfig, m as getDefaultMobileConfig, ai as getDefaultRpcUrl, an as getNetworkDisplayName, K as getPublicSolanaRpcUrl, a4 as getTokenUrl, a2 as getTransactionUrl, k as getWalletsRegistry, s as isAccountAddress, Y as isClipboardAvailable, ak as isDevnet, a7 as isDevnetCluster, a9 as isLocalCluster, am as isLocalnet, aj as isMainnet, a6 as isMainnetCluster, al as isTestnet, a8 as isTestnetCluster, o as isUnifiedConfig, r as isWalletName, ag as normalizeNetwork, ah as toClusterId } from './wallet-standard-shim
|
|
3
|
-
import { j as TransactionSigner } from './transaction-signer-
|
|
4
|
-
export { l as ConfigurationError, x as ConfigurationErrorCode, k as ConnectionError, v as ConnectionErrorCode, C as ConnectorError, E as Errors, N as NetworkError, y as NetworkErrorCode, a as SignedTransaction, S as SolanaTransaction, c as TransactionActivity, d as TransactionActivityStatus, m as TransactionError, z as TransactionErrorCode, f as TransactionMetadata, e as TransactionMethod, b as TransactionSignerCapabilities, T as TransactionSignerConfig, h as TransactionSignerError, V as ValidationError, w as ValidationErrorCode, g as createTransactionSigner, u as getUserFriendlyMessage, q as isConfigurationError, o as isConnectionError, n as isConnectorError, r as isNetworkError, s as isTransactionError, i as isTransactionSignerError, p as isValidationError, t as toConnectorError } from './transaction-signer-
|
|
1
|
+
import { i as ClusterType, B as StorageOptions, S as StorageAdapter, F as EnhancedStorageAccountOptions, G as EnhancedStorageClusterOptions, H as EnhancedStorageWalletOptions } from './wallet-standard-shim-DiMvGjOk.js';
|
|
2
|
+
export { q as AccountAddress, A as AccountInfo, T as ClipboardErrorType, V as ClipboardResult, j as ConnectorClient, d as ConnectorConfig, v as ConnectorDebugMetrics, x as ConnectorDebugState, y as ConnectorEvent, z as ConnectorEventListener, t as ConnectorHealth, e as ConnectorState, X as CopyOptions, R as CreateSolanaClientArgs, D as DefaultConfigOptions, E as ExtendedConnectorConfig, L as Listener, M as MobileWalletAdapterConfig, P as ModifiedClusterUrl, af as PUBLIC_RPC_ENDPOINTS, Q as SolanaClient, O as SolanaClusterMoniker, ae as SolanaNetwork, h as UnifiedConfig, U as UnifiedConfigOptions, J as WalletError, I as WalletErrorType, W as WalletInfo, p as WalletName, g as WalletStandardAccount, f as WalletStandardWallet, _ as copyAddressToClipboard, $ as copySignatureToClipboard, Z as copyToClipboard, n as createConfig, N as createSolanaClient, a3 as getAddressUrl, a5 as getBlockUrl, ad as getChainIdForWalletStandard, ac as getClusterChainId, a1 as getClusterExplorerUrl, aa as getClusterName, a0 as getClusterRpcUrl, ab as getClusterType, l as getDefaultConfig, m as getDefaultMobileConfig, ai as getDefaultRpcUrl, an as getNetworkDisplayName, K as getPublicSolanaRpcUrl, a4 as getTokenUrl, a2 as getTransactionUrl, k as getWalletsRegistry, s as isAccountAddress, Y as isClipboardAvailable, ak as isDevnet, a7 as isDevnetCluster, a9 as isLocalCluster, am as isLocalnet, aj as isMainnet, a6 as isMainnetCluster, al as isTestnet, a8 as isTestnetCluster, o as isUnifiedConfig, r as isWalletName, ag as normalizeNetwork, ah as toClusterId } from './wallet-standard-shim-DiMvGjOk.js';
|
|
3
|
+
import { j as TransactionSigner } from './transaction-signer-CpGEvp7S.js';
|
|
4
|
+
export { l as ConfigurationError, x as ConfigurationErrorCode, k as ConnectionError, v as ConnectionErrorCode, C as ConnectorError, E as Errors, N as NetworkError, y as NetworkErrorCode, a as SignedTransaction, S as SolanaTransaction, c as TransactionActivity, d as TransactionActivityStatus, m as TransactionError, z as TransactionErrorCode, f as TransactionMetadata, e as TransactionMethod, b as TransactionSignerCapabilities, T as TransactionSignerConfig, h as TransactionSignerError, V as ValidationError, w as ValidationErrorCode, g as createTransactionSigner, u as getUserFriendlyMessage, q as isConfigurationError, o as isConnectionError, n as isConnectorError, r as isNetworkError, s as isTransactionError, i as isTransactionSignerError, p as isValidationError, t as toConnectorError } from './transaction-signer-CpGEvp7S.js';
|
|
5
5
|
import { TransactionModifyingSigner, MessageModifyingSigner, TransactionSendingSigner, SignatureDictionary } from '@solana/signers';
|
|
6
6
|
export { MessageModifyingSigner, MessageModifyingSignerConfig, SignableMessage, SignatureDictionary, TransactionSendingSigner, TransactionSendingSignerConfig, createSignableMessage } from '@solana/signers';
|
|
7
7
|
import { SolanaCluster, SolanaClusterId, Storage } from '@wallet-ui/core';
|
|
@@ -10,6 +10,7 @@ import { Address } from '@solana/addresses';
|
|
|
10
10
|
export { Address, address } from '@solana/addresses';
|
|
11
11
|
import { SignatureBytes } from '@solana/keys';
|
|
12
12
|
export { SignatureBytes } from '@solana/keys';
|
|
13
|
+
import { Transaction } from '@solana/transactions';
|
|
13
14
|
export { Transaction } from '@solana/transactions';
|
|
14
15
|
import { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
15
16
|
export { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
@@ -17,6 +18,7 @@ import { Connection, SendOptions } from '@solana/web3.js';
|
|
|
17
18
|
import { TransactionMessage, TransactionMessageWithFeePayer, Rpc, GetLatestBlockhashApi, TransactionMessageWithBlockhashLifetime } from '@solana/kit';
|
|
18
19
|
import 'react';
|
|
19
20
|
import 'react/jsx-runtime';
|
|
21
|
+
import '@solana-mobile/wallet-standard-mobile';
|
|
20
22
|
import '@solana/transaction-messages';
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -93,6 +95,91 @@ declare function formatTokenAmount(amount: number | bigint, decimals: number, op
|
|
|
93
95
|
minimumDecimals?: number;
|
|
94
96
|
maximumDecimals?: number;
|
|
95
97
|
}): string;
|
|
98
|
+
/**
|
|
99
|
+
* Format a bigint balance with decimals, avoiding Number precision loss.
|
|
100
|
+
* Uses string manipulation for precision beyond Number.MAX_SAFE_INTEGER.
|
|
101
|
+
*
|
|
102
|
+
* @param amount - The bigint amount in smallest units
|
|
103
|
+
* @param decimals - Number of decimal places for the token
|
|
104
|
+
* @param options - Formatting options
|
|
105
|
+
* @returns Formatted string representation
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* // Small amounts (uses Number for speed)
|
|
109
|
+
* formatBigIntBalance(1000000n, 6) // Returns: '1'
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // Large amounts (uses string manipulation for precision)
|
|
113
|
+
* formatBigIntBalance(12345678901234567890n, 18) // Returns: '12.345678901234567890'
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* // With options
|
|
117
|
+
* formatBigIntBalance(1500000n, 6, { maxDecimals: 2 }) // Returns: '1.5'
|
|
118
|
+
*/
|
|
119
|
+
declare function formatBigIntBalance(amount: bigint, decimals: number, options?: {
|
|
120
|
+
/** Maximum number of decimal places to show (default: min(decimals, 6)) */
|
|
121
|
+
maxDecimals?: number;
|
|
122
|
+
/** Minimum number of decimal places to show (default: 0) */
|
|
123
|
+
minDecimals?: number;
|
|
124
|
+
/** Locale for number formatting (default: undefined, uses browser locale) */
|
|
125
|
+
locale?: string;
|
|
126
|
+
/** Whether to use grouping separators like commas (default: true) */
|
|
127
|
+
useGrouping?: boolean;
|
|
128
|
+
}): string;
|
|
129
|
+
/**
|
|
130
|
+
* Convert lamports to SOL string representation with BigInt safety.
|
|
131
|
+
*
|
|
132
|
+
* @param lamports - Amount in lamports (bigint)
|
|
133
|
+
* @param options - Formatting options
|
|
134
|
+
* @returns Formatted SOL string
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* formatLamportsToSolSafe(1000000000n) // Returns: '1'
|
|
138
|
+
* formatLamportsToSolSafe(1500000000n, { maxDecimals: 4 }) // Returns: '1.5'
|
|
139
|
+
* formatLamportsToSolSafe(1000000000n, { suffix: true }) // Returns: '1 SOL'
|
|
140
|
+
*/
|
|
141
|
+
declare function formatLamportsToSolSafe(lamports: bigint, options?: {
|
|
142
|
+
/** Maximum decimal places (default: 4) */
|
|
143
|
+
maxDecimals?: number;
|
|
144
|
+
/** Minimum decimal places (default: 0) */
|
|
145
|
+
minDecimals?: number;
|
|
146
|
+
/** Add ' SOL' suffix (default: false) */
|
|
147
|
+
suffix?: boolean;
|
|
148
|
+
/** Locale for formatting */
|
|
149
|
+
locale?: string;
|
|
150
|
+
}): string;
|
|
151
|
+
/**
|
|
152
|
+
* Format USD value from bigint amount with BigInt safety.
|
|
153
|
+
* Uses the USD price to calculate the value.
|
|
154
|
+
*
|
|
155
|
+
* @param amount - Token amount in smallest units (bigint)
|
|
156
|
+
* @param decimals - Token decimals
|
|
157
|
+
* @param usdPrice - Current USD price per token
|
|
158
|
+
* @param options - Formatting options
|
|
159
|
+
* @returns Formatted USD string
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* formatBigIntUsd(1000000000n, 9, 150.50) // Returns: '$150.50'
|
|
163
|
+
*/
|
|
164
|
+
declare function formatBigIntUsd(amount: bigint, decimals: number, usdPrice: number, options?: {
|
|
165
|
+
/** Locale for formatting (default: undefined) */
|
|
166
|
+
locale?: string;
|
|
167
|
+
/** Currency code (default: 'USD') */
|
|
168
|
+
currency?: string;
|
|
169
|
+
}): string;
|
|
170
|
+
/**
|
|
171
|
+
* Format a token balance for display with BigInt safety.
|
|
172
|
+
* Convenience wrapper around formatBigIntBalance.
|
|
173
|
+
*
|
|
174
|
+
* @param amount - Token amount in smallest units
|
|
175
|
+
* @param decimals - Token decimals
|
|
176
|
+
* @param options - Formatting options
|
|
177
|
+
* @returns Formatted balance string
|
|
178
|
+
*/
|
|
179
|
+
declare function formatTokenBalanceSafe(amount: bigint, decimals: number, options?: {
|
|
180
|
+
maxDecimals?: number;
|
|
181
|
+
locale?: string;
|
|
182
|
+
}): string;
|
|
96
183
|
|
|
97
184
|
declare const SOLANA_CHAIN_IDS: {
|
|
98
185
|
readonly mainnet: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
@@ -466,7 +553,7 @@ declare function createMessageSignerFromWallet(walletAddress: Address<string>, s
|
|
|
466
553
|
* const signatures = await signer.signAndSendTransactions([transaction]);
|
|
467
554
|
* ```
|
|
468
555
|
*/
|
|
469
|
-
declare function createTransactionSendingSignerFromWallet(walletAddress: Address<string>, chain: `solana:${string}`, sendTransactionFn: (transaction:
|
|
556
|
+
declare function createTransactionSendingSignerFromWallet(walletAddress: Address<string>, chain: `solana:${string}`, sendTransactionFn: (transaction: Transaction) => Promise<string>): TransactionSendingSigner<string>;
|
|
470
557
|
|
|
471
558
|
/**
|
|
472
559
|
* @solana/connector - Kit Integration Helper
|
|
@@ -525,6 +612,11 @@ declare function base58ToSignatureBytes(signature: string): SignatureBytes;
|
|
|
525
612
|
declare function signatureBytesToBase58(bytes: SignatureBytes): string;
|
|
526
613
|
|
|
527
614
|
type Commitment = 'processed' | 'confirmed' | 'finalized';
|
|
615
|
+
interface KitSendTransactionOptions {
|
|
616
|
+
commitment?: Commitment;
|
|
617
|
+
skipPreflight?: boolean;
|
|
618
|
+
maxRetries?: number;
|
|
619
|
+
}
|
|
528
620
|
type KitRpc = {
|
|
529
621
|
getLatestBlockhash(options?: {
|
|
530
622
|
commitment?: Commitment;
|
|
@@ -536,7 +628,7 @@ type KitRpc = {
|
|
|
536
628
|
};
|
|
537
629
|
}>;
|
|
538
630
|
};
|
|
539
|
-
sendTransaction(bytes: Uint8Array | string, options?:
|
|
631
|
+
sendTransaction(bytes: Uint8Array | string, options?: KitSendTransactionOptions): {
|
|
540
632
|
send(): Promise<string>;
|
|
541
633
|
};
|
|
542
634
|
send?: () => unknown;
|
|
@@ -640,4 +732,4 @@ declare function formatSignature(signature: string, chars?: number): string;
|
|
|
640
732
|
*/
|
|
641
733
|
declare function copySignature(signature: string): Promise<boolean>;
|
|
642
734
|
|
|
643
|
-
export { ClusterType, type Commitment, type DualConnection, EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, type GetExplorerLinkArgs, type KitSignersFromWallet, LAMPORTS_PER_SOL, type PrepareTransactionConfig, SOLANA_CHAIN_IDS, StorageAdapter, StorageOptions, TransactionSigner, base58ToSignatureBytes, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitSignersFromWallet, createKitTransactionSigner, createMessageSignerFromWallet, createTransactionSendingSignerFromWallet, detectMessageModification, formatAddress, formatNumber, formatSOL, formatSignature, formatTokenAmount, freezeSigner, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getExplorerLink, getLatestBlockhash, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isKitConnection, isKnownSolanaChain, isLegacyConnection, isPolyfillInstalled, isSolanaChain, lamportsToSol, prepareTransaction, sendRawTransaction, signatureBytesToBase58, solToLamports, truncate, updateSignatureDictionary, validateKnownSolanaChain };
|
|
735
|
+
export { ClusterType, type Commitment, type DualConnection, EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, type GetExplorerLinkArgs, type KitSignersFromWallet, LAMPORTS_PER_SOL, type PrepareTransactionConfig, SOLANA_CHAIN_IDS, StorageAdapter, StorageOptions, TransactionSigner, base58ToSignatureBytes, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitSignersFromWallet, createKitTransactionSigner, createMessageSignerFromWallet, createTransactionSendingSignerFromWallet, detectMessageModification, formatAddress, formatBigIntBalance, formatBigIntUsd, formatLamportsToSolSafe, formatNumber, formatSOL, formatSignature, formatTokenAmount, formatTokenBalanceSafe, freezeSigner, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getExplorerLink, getLatestBlockhash, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isKitConnection, isKnownSolanaChain, isLegacyConnection, isPolyfillInstalled, isSolanaChain, lamportsToSol, prepareTransaction, sendRawTransaction, signatureBytesToBase58, solToLamports, truncate, updateSignatureDictionary, validateKnownSolanaChain };
|