@solana/connector 0.1.0 → 0.1.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-52WUWW5R.mjs → chunk-4K6QY4HR.mjs} +60 -174
- package/dist/chunk-4K6QY4HR.mjs.map +1 -0
- package/dist/{chunk-7TADXRFD.mjs → chunk-F2QJH5ED.mjs} +3 -3
- package/dist/chunk-F2QJH5ED.mjs.map +1 -0
- package/dist/chunk-JS4KJ2KK.js +706 -0
- package/dist/chunk-JS4KJ2KK.js.map +1 -0
- package/dist/{chunk-ZLPQUOFK.js → chunk-RIBOPAOD.js} +61 -173
- package/dist/chunk-RIBOPAOD.js.map +1 -0
- package/dist/{chunk-SGAIPK7Q.js → chunk-SJEZHNYF.js} +11 -11
- package/dist/chunk-SJEZHNYF.js.map +1 -0
- package/dist/chunk-WXYUUCSD.mjs +635 -0
- package/dist/chunk-WXYUUCSD.mjs.map +1 -0
- package/dist/compat.d.mts +1 -60
- package/dist/compat.d.ts +1 -60
- package/dist/compat.js.map +1 -1
- package/dist/compat.mjs.map +1 -1
- package/dist/headless.d.mts +222 -107
- package/dist/headless.d.ts +222 -107
- package/dist/headless.js +201 -81
- package/dist/headless.mjs +2 -2
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +216 -96
- package/dist/index.mjs +3 -3
- package/dist/react.d.mts +5 -154
- package/dist/react.d.ts +5 -154
- package/dist/react.js +16 -16
- package/dist/react.mjs +2 -2
- package/dist/{transaction-signer-BtJPGXIg.d.ts → transaction-signer-D3csM_Mf.d.mts} +1 -175
- package/dist/{transaction-signer-BtJPGXIg.d.mts → transaction-signer-D3csM_Mf.d.ts} +1 -175
- package/dist/{wallet-standard-shim-BGlvGRbB.d.ts → wallet-standard-shim-C1tisl9S.d.ts} +5 -169
- package/dist/{wallet-standard-shim-Af7ejSld.d.mts → wallet-standard-shim-Cg0GVGwu.d.mts} +5 -169
- package/package.json +7 -1
- package/dist/chunk-52WUWW5R.mjs.map +0 -1
- package/dist/chunk-5NSUFMCB.js +0 -393
- package/dist/chunk-5NSUFMCB.js.map +0 -1
- package/dist/chunk-7TADXRFD.mjs.map +0 -1
- package/dist/chunk-ACFSCMUI.mjs +0 -359
- package/dist/chunk-ACFSCMUI.mjs.map +0 -1
- package/dist/chunk-SGAIPK7Q.js.map +0 -1
- package/dist/chunk-ZLPQUOFK.js.map +0 -1
package/dist/headless.d.mts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { 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, K as ClipboardErrorType, N as ClipboardResult,
|
|
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-Cg0GVGwu.mjs';
|
|
2
|
+
export { q as AccountAddress, A as AccountInfo, K as ClipboardErrorType, N 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, O as CopyOptions, D as DefaultConfigOptions, E as ExtendedConnectorConfig, L as Listener, M as MobileWalletAdapterConfig, a9 as PUBLIC_RPC_ENDPOINTS, a8 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, R as copyAddressToClipboard, T as copySignatureToClipboard, Q as copyToClipboard, n as createConfig, Z as getAddressUrl, $ as getBlockUrl, a7 as getChainIdForWalletStandard, a6 as getClusterChainId, X as getClusterExplorerUrl, a4 as getClusterName, V as getClusterRpcUrl, a5 as getClusterType, l as getDefaultConfig, m as getDefaultMobileConfig, ac as getDefaultRpcUrl, ah as getNetworkDisplayName, _ as getTokenUrl, Y as getTransactionUrl, k as getWalletsRegistry, s as isAccountAddress, P as isClipboardAvailable, ae as isDevnet, a1 as isDevnetCluster, a3 as isLocalCluster, ag as isLocalnet, ad as isMainnet, a0 as isMainnetCluster, af as isTestnet, a2 as isTestnetCluster, o as isUnifiedConfig, r as isWalletName, aa as normalizeNetwork, ab as toClusterId } from './wallet-standard-shim-Cg0GVGwu.mjs';
|
|
3
|
+
import { j as TransactionSigner } from './transaction-signer-D3csM_Mf.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-D3csM_Mf.mjs';
|
|
5
5
|
import { TransactionModifyingSigner } from 'gill';
|
|
6
|
-
import {
|
|
6
|
+
import { SolanaCluster, SolanaClusterId, Storage } from '@wallet-ui/core';
|
|
7
7
|
export { SolanaCluster, SolanaClusterId, createSolanaDevnet, createSolanaLocalnet, createSolanaMainnet, createSolanaTestnet } from '@wallet-ui/core';
|
|
8
|
+
import { MessageModifyingSigner, TransactionSendingSigner, SignatureDictionary } from '@solana/signers';
|
|
9
|
+
export { MessageModifyingSigner, MessageModifyingSignerConfig, SignableMessage, SignatureDictionary, TransactionSendingSigner, TransactionSendingSignerConfig, createSignableMessage } from '@solana/signers';
|
|
10
|
+
import { Address } from '@solana/addresses';
|
|
11
|
+
export { Address, address } from '@solana/addresses';
|
|
12
|
+
import { SignatureBytes } from '@solana/keys';
|
|
13
|
+
export { SignatureBytes } from '@solana/keys';
|
|
14
|
+
export { Transaction } from '@solana/transactions';
|
|
15
|
+
import { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
8
16
|
export { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
17
|
+
import { Connection, SendOptions } from '@solana/web3.js';
|
|
9
18
|
import 'react';
|
|
10
19
|
import 'react/jsx-runtime';
|
|
11
|
-
import '@solana/web3.js';
|
|
12
20
|
|
|
13
21
|
/**
|
|
14
22
|
* @solana/connector - Formatting utilities
|
|
@@ -85,6 +93,25 @@ declare function formatTokenAmount(amount: number | bigint, decimals: number, op
|
|
|
85
93
|
maximumDecimals?: number;
|
|
86
94
|
}): string;
|
|
87
95
|
|
|
96
|
+
declare const SOLANA_CHAIN_IDS: {
|
|
97
|
+
readonly mainnet: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
98
|
+
readonly devnet: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
99
|
+
readonly testnet: "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";
|
|
100
|
+
};
|
|
101
|
+
declare function getChainIdFromCluster(cluster: SolanaCluster): `solana:${string}` | null;
|
|
102
|
+
declare function getChainIdFromClusterId(clusterId: SolanaClusterId): `solana:${string}` | null;
|
|
103
|
+
declare function getChainIdFromClusterType(type: ClusterType): `solana:${string}` | null;
|
|
104
|
+
declare function getClusterTypeFromChainId(chainId: string): ClusterType | null;
|
|
105
|
+
declare function getClusterIdFromChainId(chainId: string): SolanaClusterId | null;
|
|
106
|
+
declare function isSolanaChain(chain: string): chain is `solana:${string}`;
|
|
107
|
+
declare function isKnownSolanaChain(chain: string): boolean;
|
|
108
|
+
declare function validateKnownSolanaChain(chain: string): asserts chain is `solana:${string}`;
|
|
109
|
+
declare function getClusterTypeFromConnection(connection: Connection | null): ClusterType | null;
|
|
110
|
+
declare function getChainIdFromConnection(connection: Connection | null, network?: 'mainnet' | 'devnet' | 'testnet'): `solana:${string}` | null;
|
|
111
|
+
declare function clusterToChainId(cluster: SolanaCluster): `solana:${string}` | null;
|
|
112
|
+
declare function chainIdToClusterType(chainId: string): ClusterType | null;
|
|
113
|
+
declare function chainIdToClusterId(chainId: string): SolanaClusterId | null;
|
|
114
|
+
|
|
88
115
|
/**
|
|
89
116
|
* @solana/connector - Gill/Kit Transaction Signer Adapter
|
|
90
117
|
*
|
|
@@ -126,15 +153,7 @@ declare function formatTokenAmount(amount: number | bigint, decimals: number, op
|
|
|
126
153
|
declare function createGillTransactionSigner<TAddress extends string = string>(connectorSigner: TransactionSigner): TransactionModifyingSigner<TAddress>;
|
|
127
154
|
|
|
128
155
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* Extended version of @wallet-ui/core Storage with additional features:
|
|
132
|
-
* - Validation hooks
|
|
133
|
-
* - Error handling and recovery
|
|
134
|
-
* - SSR/memory fallback
|
|
135
|
-
* - Transform utilities
|
|
136
|
-
* - Migration support
|
|
137
|
-
* - Storage availability checks
|
|
156
|
+
* Enhanced Storage
|
|
138
157
|
*/
|
|
139
158
|
|
|
140
159
|
/**
|
|
@@ -147,112 +166,21 @@ declare class EnhancedStorage<T> extends Storage<T> {
|
|
|
147
166
|
private validators;
|
|
148
167
|
private memoryFallback;
|
|
149
168
|
constructor(key: string, initial: T, options?: StorageOptions<T> | undefined);
|
|
150
|
-
/**
|
|
151
|
-
* Enhanced set with validation and error handling
|
|
152
|
-
* @returns boolean indicating success
|
|
153
|
-
*/
|
|
154
169
|
set(value: T): boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Enhanced get with error handling and fallback
|
|
157
|
-
*/
|
|
158
170
|
get(): T;
|
|
159
|
-
/**
|
|
160
|
-
* Validate a value against all registered validators
|
|
161
|
-
*/
|
|
162
171
|
validate(value: T): boolean;
|
|
163
|
-
/**
|
|
164
|
-
* Add a validation rule (chainable)
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```ts
|
|
168
|
-
* storage
|
|
169
|
-
* .addValidator((addr) => addr?.length === 44)
|
|
170
|
-
* .addValidator((addr) => addr?.startsWith('5'))
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
172
|
addValidator(validator: (value: T) => boolean): this;
|
|
174
|
-
/**
|
|
175
|
-
* Add error handler (chainable)
|
|
176
|
-
*/
|
|
177
173
|
onError(handler: (error: Error) => void): this;
|
|
178
|
-
/**
|
|
179
|
-
* Transform the stored value
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* ```ts
|
|
183
|
-
* const formatted = storage.transform(
|
|
184
|
-
* (address) => address ? formatAddress(address) : ''
|
|
185
|
-
* )
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
174
|
transform<U>(transformer: (value: T) => U): U;
|
|
189
|
-
/**
|
|
190
|
-
* Reset to initial value
|
|
191
|
-
*/
|
|
192
175
|
reset(): void;
|
|
193
|
-
/**
|
|
194
|
-
* Clear storage (remove from localStorage)
|
|
195
|
-
*/
|
|
196
176
|
clear(): void;
|
|
197
|
-
/**
|
|
198
|
-
* Check if storage is available (not in private mode, quota not exceeded)
|
|
199
|
-
*/
|
|
200
177
|
isAvailable(): boolean;
|
|
201
|
-
/**
|
|
202
|
-
* Migrate from old key to new key
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* ```ts
|
|
206
|
-
* EnhancedStorage.migrate(
|
|
207
|
-
* 'old-connector:account',
|
|
208
|
-
* createEnhancedStorageAccount()
|
|
209
|
-
* )
|
|
210
|
-
* ```
|
|
211
|
-
*/
|
|
212
178
|
static migrate<T>(oldKey: string, newStorage: EnhancedStorage<T>): boolean;
|
|
213
179
|
private handleError;
|
|
214
180
|
}
|
|
215
|
-
/**
|
|
216
|
-
* Create a storage instance for wallet account persistence
|
|
217
|
-
*
|
|
218
|
-
* @example
|
|
219
|
-
* ```ts
|
|
220
|
-
* const storage = createEnhancedStorageAccount({
|
|
221
|
-
* validator: (address) => {
|
|
222
|
-
* if (!address) return true
|
|
223
|
-
* return isAddress(address)
|
|
224
|
-
* }
|
|
225
|
-
* })
|
|
226
|
-
* ```
|
|
227
|
-
*/
|
|
228
181
|
declare function createEnhancedStorageAccount(options?: EnhancedStorageAccountOptions): EnhancedStorage<string | undefined>;
|
|
229
|
-
/**
|
|
230
|
-
* Create a storage instance for cluster selection persistence
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```ts
|
|
234
|
-
* const storage = createEnhancedStorageCluster({
|
|
235
|
-
* initial: 'solana:mainnet',
|
|
236
|
-
* validClusters: ['solana:mainnet', 'solana:devnet']
|
|
237
|
-
* })
|
|
238
|
-
* ```
|
|
239
|
-
*/
|
|
240
182
|
declare function createEnhancedStorageCluster(options?: EnhancedStorageClusterOptions): EnhancedStorage<SolanaClusterId>;
|
|
241
|
-
/**
|
|
242
|
-
* Create a storage instance for wallet name persistence
|
|
243
|
-
*
|
|
244
|
-
* @example
|
|
245
|
-
* ```ts
|
|
246
|
-
* const storage = createEnhancedStorageWallet({
|
|
247
|
-
* onError: (error) => console.error('Wallet storage error:', error)
|
|
248
|
-
* })
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
183
|
declare function createEnhancedStorageWallet(options?: EnhancedStorageWalletOptions): EnhancedStorage<string | undefined>;
|
|
252
|
-
/**
|
|
253
|
-
* Adapter to make EnhancedStorage compatible with StorageAdapter interface
|
|
254
|
-
* Exposes both the basic interface and enhanced methods for advanced usage
|
|
255
|
-
*/
|
|
256
184
|
declare class EnhancedStorageAdapter<T> implements StorageAdapter<T> {
|
|
257
185
|
private storage;
|
|
258
186
|
constructor(storage: EnhancedStorage<T>);
|
|
@@ -351,6 +279,193 @@ declare function getPolyfillStatus(): {
|
|
|
351
279
|
environment: 'browser' | 'server';
|
|
352
280
|
};
|
|
353
281
|
|
|
282
|
+
/**
|
|
283
|
+
* @solana/connector - Kit Signer Factories
|
|
284
|
+
*
|
|
285
|
+
* Framework-agnostic factory functions to create Kit-compatible signers from wallet functions.
|
|
286
|
+
* These factories enable pure Kit integration without React or framework dependencies.
|
|
287
|
+
*/
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Create a MessageModifyingSigner from a wallet's sign message function
|
|
291
|
+
*
|
|
292
|
+
* This is a pure, framework-agnostic factory function that can be used anywhere.
|
|
293
|
+
* Enables message signing (SIWS, auth) without React.
|
|
294
|
+
*
|
|
295
|
+
* @param walletAddress - The address of the wallet
|
|
296
|
+
* @param signMessageFn - Function to sign a message (from wallet adapter)
|
|
297
|
+
* @returns A frozen MessageModifyingSigner object
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* import { address } from '@solana/addresses';
|
|
302
|
+
* import { createMessageSignerFromWallet } from '@solana/connector/headless';
|
|
303
|
+
*
|
|
304
|
+
* const signer = createMessageSignerFromWallet(
|
|
305
|
+
* address('...'),
|
|
306
|
+
* async (msg) => await wallet.signMessage(msg)
|
|
307
|
+
* );
|
|
308
|
+
*
|
|
309
|
+
* // Use with Kit message signing
|
|
310
|
+
* import { createSignableMessage } from '@solana/signers';
|
|
311
|
+
* const signed = await signer.modifyAndSignMessages([createSignableMessage(messageBytes)]);
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
declare function createMessageSignerFromWallet(walletAddress: Address<string>, signMessageFn: (message: Uint8Array) => Promise<Uint8Array>): MessageModifyingSigner<string>;
|
|
315
|
+
/**
|
|
316
|
+
* Create a TransactionSendingSigner from a wallet's send transaction function
|
|
317
|
+
*
|
|
318
|
+
* This is a pure, framework-agnostic factory function that can be used anywhere.
|
|
319
|
+
* Enables sign + send in one operation (wallets like Phantom support this).
|
|
320
|
+
*
|
|
321
|
+
* @param walletAddress - The address of the wallet
|
|
322
|
+
* @param chain - The Solana chain identifier (e.g., 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1')
|
|
323
|
+
* @param sendTransactionFn - Function to send a transaction (from wallet adapter)
|
|
324
|
+
* @returns A frozen TransactionSendingSigner object
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```typescript
|
|
328
|
+
* import { address } from '@solana/addresses';
|
|
329
|
+
* import { createTransactionSendingSignerFromWallet } from '@solana/connector/headless';
|
|
330
|
+
*
|
|
331
|
+
* const signer = createTransactionSendingSignerFromWallet(
|
|
332
|
+
* address('...'),
|
|
333
|
+
* 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1',
|
|
334
|
+
* async (tx) => await wallet.sendTransaction(tx, connection)
|
|
335
|
+
* );
|
|
336
|
+
*
|
|
337
|
+
* // Use with Kit transaction sending
|
|
338
|
+
* const signatures = await signer.signAndSendTransactions([transaction]);
|
|
339
|
+
* ```
|
|
340
|
+
*/
|
|
341
|
+
declare function createTransactionSendingSignerFromWallet(walletAddress: Address<string>, chain: `solana:${string}`, sendTransactionFn: (transaction: any) => Promise<string>): TransactionSendingSigner<string>;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* @solana/connector - Kit Integration Helper
|
|
345
|
+
*
|
|
346
|
+
* High-level helper to create Kit signers from Wallet Standard wallets.
|
|
347
|
+
* Framework-agnostic and works in any JavaScript environment.
|
|
348
|
+
*/
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Result of creating Kit signers from a Wallet Standard wallet
|
|
352
|
+
*/
|
|
353
|
+
interface KitSignersFromWallet {
|
|
354
|
+
/** Kit Address type (null if wallet not connected) */
|
|
355
|
+
address: Address<string> | null;
|
|
356
|
+
/** Plain address string (null if wallet not connected) */
|
|
357
|
+
addressString: string | null;
|
|
358
|
+
/** Message signer (null if wallet doesn't support signing or not connected) */
|
|
359
|
+
messageSigner: MessageModifyingSigner<string> | null;
|
|
360
|
+
/** Transaction sending signer (null if wallet doesn't support or not connected) */
|
|
361
|
+
transactionSigner: TransactionSendingSigner<string> | null;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Create Kit-compatible signers from a Wallet Standard wallet
|
|
365
|
+
*
|
|
366
|
+
* This function bridges Wallet Standard wallets with modern Kit architecture.
|
|
367
|
+
* It's framework-agnostic and can be used in any JavaScript environment.
|
|
368
|
+
*
|
|
369
|
+
* The network is automatically detected from the connection's RPC endpoint.
|
|
370
|
+
* For custom RPC URLs, you can override detection with the optional `network` parameter.
|
|
371
|
+
*
|
|
372
|
+
* @param wallet - The Wallet Standard wallet instance
|
|
373
|
+
* @param account - The wallet account to use (first account if not provided)
|
|
374
|
+
* @param connection - Optional connection for network detection and transaction sending
|
|
375
|
+
* @param network - Optional network override ('mainnet' | 'devnet' | 'testnet')
|
|
376
|
+
* @returns Kit signers object with address and signer instances
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```typescript
|
|
380
|
+
* import { Connection } from '@solana/web3.js';
|
|
381
|
+
* import { createKitSignersFromWallet } from '@solana/connector/headless';
|
|
382
|
+
*
|
|
383
|
+
* const connection = new Connection('https://api.devnet.solana.com');
|
|
384
|
+
* const { address, messageSigner, transactionSigner } = createKitSignersFromWallet(
|
|
385
|
+
* wallet,
|
|
386
|
+
* account,
|
|
387
|
+
* connection
|
|
388
|
+
* );
|
|
389
|
+
* ```
|
|
390
|
+
*/
|
|
391
|
+
declare function createKitSignersFromWallet(wallet: Wallet | null, account?: WalletAccount | null, connection?: Connection | null, network?: 'mainnet' | 'devnet' | 'testnet'): KitSignersFromWallet;
|
|
392
|
+
|
|
393
|
+
declare function detectMessageModification(original: Uint8Array, modified: Uint8Array): boolean;
|
|
394
|
+
declare function updateSignatureDictionary(original: Uint8Array, signed: Uint8Array, originalSignatures: SignatureDictionary, address: Address<string>, signature: Uint8Array): SignatureDictionary;
|
|
395
|
+
declare function freezeSigner<T extends object>(signer: T): Readonly<T>;
|
|
396
|
+
declare function base58ToSignatureBytes(signature: string): SignatureBytes;
|
|
397
|
+
declare function signatureBytesToBase58(bytes: SignatureBytes): string;
|
|
398
|
+
|
|
399
|
+
type Commitment = 'processed' | 'confirmed' | 'finalized';
|
|
400
|
+
type KitRpc = {
|
|
401
|
+
getLatestBlockhash(options?: {
|
|
402
|
+
commitment?: Commitment;
|
|
403
|
+
}): {
|
|
404
|
+
send(): Promise<{
|
|
405
|
+
value: {
|
|
406
|
+
blockhash: string;
|
|
407
|
+
lastValidBlockHeight: number;
|
|
408
|
+
};
|
|
409
|
+
}>;
|
|
410
|
+
};
|
|
411
|
+
sendTransaction(bytes: Uint8Array | string, options?: any): {
|
|
412
|
+
send(): Promise<string>;
|
|
413
|
+
};
|
|
414
|
+
send?: () => unknown;
|
|
415
|
+
};
|
|
416
|
+
type DualConnection = Connection | KitRpc;
|
|
417
|
+
declare function isLegacyConnection(conn: DualConnection): conn is Connection;
|
|
418
|
+
declare function isKitConnection(conn: DualConnection): conn is KitRpc;
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @solana/connector - Connection Helpers
|
|
422
|
+
*
|
|
423
|
+
* Abstraction layer for working with both legacy @solana/web3.js Connection
|
|
424
|
+
* and modern Kit/gill Rpc objects.
|
|
425
|
+
*/
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Get latest blockhash from either legacy Connection or Kit Rpc
|
|
429
|
+
*
|
|
430
|
+
* Abstracts the differences between web3.js 1.x and Kit/gill APIs.
|
|
431
|
+
*
|
|
432
|
+
* @param connection - Legacy Connection or Kit Rpc
|
|
433
|
+
* @param commitment - Optional commitment level (default: 'confirmed')
|
|
434
|
+
* @returns Latest blockhash and last valid block height
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* ```typescript
|
|
438
|
+
* // Works with both Connection and Rpc
|
|
439
|
+
* const { blockhash, lastValidBlockHeight } = await getLatestBlockhash(connection);
|
|
440
|
+
* ```
|
|
441
|
+
*/
|
|
442
|
+
declare function getLatestBlockhash(connection: DualConnection, commitment?: Commitment): Promise<{
|
|
443
|
+
blockhash: string;
|
|
444
|
+
lastValidBlockHeight: number;
|
|
445
|
+
}>;
|
|
446
|
+
/**
|
|
447
|
+
* Send raw transaction bytes to either legacy Connection or Kit Rpc
|
|
448
|
+
*
|
|
449
|
+
* Abstracts the differences between web3.js 1.x and Kit/gill APIs.
|
|
450
|
+
*
|
|
451
|
+
* @param connection - Legacy Connection or Kit Rpc
|
|
452
|
+
* @param bytes - Raw transaction bytes
|
|
453
|
+
* @param options - Optional send options (skipPreflight, maxRetries, etc.)
|
|
454
|
+
* @returns Transaction signature string
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```typescript
|
|
458
|
+
* // Works with both Connection and Rpc
|
|
459
|
+
* const signature = await sendRawTransaction(connection, transactionBytes, {
|
|
460
|
+
* skipPreflight: false,
|
|
461
|
+
* maxRetries: 3
|
|
462
|
+
* });
|
|
463
|
+
* ```
|
|
464
|
+
*/
|
|
465
|
+
declare function sendRawTransaction(connection: DualConnection, bytes: Uint8Array, options?: SendOptions & {
|
|
466
|
+
commitment?: Commitment;
|
|
467
|
+
}): Promise<string>;
|
|
468
|
+
|
|
354
469
|
/**
|
|
355
470
|
* @solana/connector - Explorer URL Utilities
|
|
356
471
|
*
|
|
@@ -397,4 +512,4 @@ declare function formatSignature(signature: string, chars?: number): string;
|
|
|
397
512
|
*/
|
|
398
513
|
declare function copySignature(signature: string): Promise<boolean>;
|
|
399
514
|
|
|
400
|
-
export { EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, StorageAdapter, StorageOptions, TransactionSigner, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, formatAddress, formatNumber, formatSOL, formatSignature, formatTokenAmount, getAllExplorerUrls, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isPolyfillInstalled, truncate };
|
|
515
|
+
export { ClusterType, type Commitment, type DualConnection, EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, type KitSignersFromWallet, SOLANA_CHAIN_IDS, StorageAdapter, StorageOptions, TransactionSigner, base58ToSignatureBytes, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitSignersFromWallet, createMessageSignerFromWallet, createTransactionSendingSignerFromWallet, detectMessageModification, formatAddress, formatNumber, formatSOL, formatSignature, formatTokenAmount, freezeSigner, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getLatestBlockhash, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isKitConnection, isKnownSolanaChain, isLegacyConnection, isPolyfillInstalled, isSolanaChain, sendRawTransaction, signatureBytesToBase58, truncate, updateSignatureDictionary, validateKnownSolanaChain };
|