@solana/react-hooks 0.3.0 → 0.5.0
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 +10 -3
- package/dist/index.browser.cjs +149 -97
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +144 -95
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +144 -95
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +149 -97
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +144 -95
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/QueryProvider.d.ts.map +1 -1
- package/dist/types/context.d.ts +3 -0
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/hooks.d.ts +59 -17
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/query.d.ts +2 -1
- package/dist/types/query.d.ts.map +1 -1
- package/dist/types/queryHooks.d.ts +18 -10
- package/dist/types/queryHooks.d.ts.map +1 -1
- package/dist/types/queryKeys.d.ts +8 -0
- package/dist/types/queryKeys.d.ts.map +1 -0
- package/dist/types/ui.d.ts +10 -11
- package/dist/types/ui.d.ts.map +1 -1
- package/dist/types/useClientStore.d.ts +4 -3
- package/dist/types/useClientStore.d.ts.map +1 -1
- package/package.json +2 -7
package/dist/types/hooks.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { type AccountCacheEntry, type AddressLike, type AsyncState, type ClientState, type ConfirmationCommitment, type SignatureLike, type SolanaClient, type SolTransferHelper, type SolTransferInput, type SolTransferSendOptions, type SplTokenBalance, type SplTokenHelper, type SplTokenHelperConfig, type SplTransferInput, type TransactionHelper, type TransactionInstructionInput, type TransactionInstructionList, type TransactionPoolPrepareAndSendOptions, type TransactionPoolPrepareOptions, type TransactionPoolSendOptions, type TransactionPoolSignOptions, type TransactionPrepareAndSendRequest, type TransactionPrepared, type TransactionSendOptions, type
|
|
1
|
+
import { type AccountCacheEntry, type AddressLike, type AsyncState, type ClientState, type ConfirmationCommitment, type SignatureLike, type SolanaClient, type SolTransferHelper, type SolTransferInput, type SolTransferSendOptions, type SplTokenBalance, type SplTokenHelper, type SplTokenHelperConfig, type SplTransferInput, type TransactionHelper, type TransactionInstructionInput, type TransactionInstructionList, type TransactionPoolPrepareAndSendOptions, type TransactionPoolPrepareOptions, type TransactionPoolSendOptions, type TransactionPoolSignOptions, type TransactionPrepareAndSendRequest, type TransactionPrepared, type TransactionSendOptions, type WalletSession, type WalletStatus } from '@solana/client';
|
|
2
2
|
import type { Commitment, Lamports, Signature } from '@solana/kit';
|
|
3
|
+
import { type BareFetcher, type SWRConfiguration } from 'swr';
|
|
3
4
|
import { type SolanaQueryResult, type UseSolanaRpcQueryOptions } from './query';
|
|
4
|
-
import { type
|
|
5
|
+
import { type UseLatestBlockhashParameters, type UseLatestBlockhashReturnType } from './queryHooks';
|
|
5
6
|
type ClusterState = ClientState['cluster'];
|
|
6
7
|
type ClusterStatus = ClientState['cluster']['status'];
|
|
7
|
-
export type WalletStandardDiscoveryOptions = Parameters<typeof watchWalletStandardConnectors>[1];
|
|
8
|
-
type WalletStandardDiscoveryConfig = WalletStandardDiscoveryOptions & Readonly<{
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}>;
|
|
11
8
|
type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
|
|
12
9
|
type RpcInstance = SolanaClient['runtime']['rpc'];
|
|
13
10
|
type SignatureStatusesPlan = ReturnType<RpcInstance['getSignatureStatuses']>;
|
|
@@ -81,6 +78,7 @@ type UseSplTokenOptions = Readonly<{
|
|
|
81
78
|
config?: Omit<SplTokenHelperConfig, 'commitment' | 'mint'>;
|
|
82
79
|
owner?: AddressLike;
|
|
83
80
|
revalidateOnFocus?: boolean;
|
|
81
|
+
swr?: Omit<SWRConfiguration<SplTokenBalanceResult, unknown, BareFetcher<SplTokenBalanceResult>>, 'fallback' | 'suspense'>;
|
|
84
82
|
}>;
|
|
85
83
|
/**
|
|
86
84
|
* Simplified SPL token hook that scopes helpers by mint and manages balance state.
|
|
@@ -115,13 +113,9 @@ export declare function useBalance(addressLike?: AddressLike, options?: UseBalan
|
|
|
115
113
|
lamports: Lamports | null;
|
|
116
114
|
slot: bigint | null | undefined;
|
|
117
115
|
}>;
|
|
118
|
-
/**
|
|
119
|
-
* Collect Wallet Standard connectors and keep the list in sync with registration changes.
|
|
120
|
-
*/
|
|
121
|
-
export declare function useWalletStandardConnectors(options?: WalletStandardDiscoveryConfig): readonly WalletConnector[];
|
|
122
116
|
type UseTransactionPoolConfig = Readonly<{
|
|
123
117
|
instructions?: TransactionInstructionList;
|
|
124
|
-
latestBlockhash?:
|
|
118
|
+
latestBlockhash?: UseLatestBlockhashParameters;
|
|
125
119
|
}>;
|
|
126
120
|
type UseTransactionPoolPrepareOptions = TransactionPoolPrepareOptions;
|
|
127
121
|
type UseTransactionPoolSignOptions = TransactionPoolSignOptions;
|
|
@@ -152,7 +146,7 @@ export declare function useTransactionPool(config?: UseTransactionPoolConfig): R
|
|
|
152
146
|
prepareAndSend(request?: UseTransactionPoolPrepareAndSendOptions, sendOptions?: TransactionSendOptions): Promise<TransactionSignature>;
|
|
153
147
|
sign(options?: UseTransactionPoolSignOptions): ReturnType<TransactionHelper['sign']>;
|
|
154
148
|
toWire(options?: UseTransactionPoolSignOptions): ReturnType<TransactionHelper['toWire']>;
|
|
155
|
-
latestBlockhash:
|
|
149
|
+
latestBlockhash: UseLatestBlockhashReturnType;
|
|
156
150
|
}>;
|
|
157
151
|
type SendTransactionSignature = Signature;
|
|
158
152
|
type UseSendTransactionResult = Readonly<{
|
|
@@ -168,17 +162,22 @@ type UseSendTransactionResult = Readonly<{
|
|
|
168
162
|
* General-purpose helper that prepares and sends arbitrary transactions through {@link TransactionHelper}.
|
|
169
163
|
*/
|
|
170
164
|
export declare function useSendTransaction(): UseSendTransactionResult;
|
|
171
|
-
export type UseSignatureStatusOptions =
|
|
165
|
+
export type UseSignatureStatusOptions = Readonly<{
|
|
172
166
|
config?: SignatureStatusConfig;
|
|
167
|
+
disabled?: boolean;
|
|
168
|
+
swr?: UseSolanaRpcQueryOptions<SignatureStatusValue | null>['swr'];
|
|
169
|
+
}>;
|
|
170
|
+
export type UseSignatureStatusParameters = UseSignatureStatusOptions & Readonly<{
|
|
171
|
+
signature?: SignatureLike;
|
|
173
172
|
}>;
|
|
174
|
-
|
|
173
|
+
type SignatureStatusState = SolanaQueryResult<SignatureStatusValue | null> & Readonly<{
|
|
175
174
|
confirmationStatus: ConfirmationCommitment | null;
|
|
176
175
|
signatureStatus: SignatureStatusValue | null;
|
|
177
176
|
}>;
|
|
178
177
|
/**
|
|
179
178
|
* Fetch the RPC status for a transaction signature.
|
|
180
179
|
*/
|
|
181
|
-
export declare function useSignatureStatus(signatureInput?: SignatureLike, options?: UseSignatureStatusOptions):
|
|
180
|
+
export declare function useSignatureStatus(signatureInput?: SignatureLike, options?: UseSignatureStatusOptions): SignatureStatusState;
|
|
182
181
|
export type SignatureWaitStatus = 'error' | 'idle' | 'success' | 'waiting';
|
|
183
182
|
export type UseWaitForSignatureOptions = Omit<UseSignatureStatusOptions, 'disabled'> & Readonly<{
|
|
184
183
|
commitment?: ConfirmationCommitment;
|
|
@@ -186,7 +185,7 @@ export type UseWaitForSignatureOptions = Omit<UseSignatureStatusOptions, 'disabl
|
|
|
186
185
|
subscribe?: boolean;
|
|
187
186
|
watchCommitment?: ConfirmationCommitment;
|
|
188
187
|
}>;
|
|
189
|
-
|
|
188
|
+
type WaitForSignatureState = SignatureStatusState & Readonly<{
|
|
190
189
|
isError: boolean;
|
|
191
190
|
isSuccess: boolean;
|
|
192
191
|
isWaiting: boolean;
|
|
@@ -196,6 +195,49 @@ export type WaitForSignatureResult = SignatureStatusResult & Readonly<{
|
|
|
196
195
|
/**
|
|
197
196
|
* Polls signature status data until the desired commitment (or subscription notification) is reached.
|
|
198
197
|
*/
|
|
199
|
-
export declare function useWaitForSignature(signatureInput?: SignatureLike, options?: UseWaitForSignatureOptions):
|
|
198
|
+
export declare function useWaitForSignature(signatureInput?: SignatureLike, options?: UseWaitForSignatureOptions): WaitForSignatureState;
|
|
199
|
+
export type UseAccountParameters = Readonly<{
|
|
200
|
+
address?: AddressLike;
|
|
201
|
+
options?: UseAccountOptions;
|
|
202
|
+
}>;
|
|
203
|
+
export type UseAccountReturnType = ReturnType<typeof useAccount>;
|
|
204
|
+
export type UseBalanceParameters = Readonly<{
|
|
205
|
+
address?: AddressLike;
|
|
206
|
+
options?: UseBalanceOptions;
|
|
207
|
+
}>;
|
|
208
|
+
export type UseBalanceReturnType = ReturnType<typeof useBalance>;
|
|
209
|
+
export type UseClusterStateParameters = undefined;
|
|
210
|
+
export type UseClusterStateReturnType = ReturnType<typeof useClusterState>;
|
|
211
|
+
export type UseClusterStatusParameters = undefined;
|
|
212
|
+
export type UseClusterStatusReturnType = ReturnType<typeof useClusterStatus>;
|
|
213
|
+
export type UseConnectWalletParameters = undefined;
|
|
214
|
+
export type UseConnectWalletReturnType = ReturnType<typeof useConnectWallet>;
|
|
215
|
+
export type UseDisconnectWalletParameters = undefined;
|
|
216
|
+
export type UseDisconnectWalletReturnType = ReturnType<typeof useDisconnectWallet>;
|
|
217
|
+
export type UseSendTransactionParameters = undefined;
|
|
218
|
+
export type UseSendTransactionReturnType = ReturnType<typeof useSendTransaction>;
|
|
219
|
+
export type UseSignatureStatusReturnType = SignatureStatusState;
|
|
220
|
+
export type UseWaitForSignatureParameters = Readonly<{
|
|
221
|
+
options?: UseWaitForSignatureOptions;
|
|
222
|
+
signature?: SignatureLike;
|
|
223
|
+
}>;
|
|
224
|
+
export type UseWaitForSignatureReturnType = WaitForSignatureState;
|
|
225
|
+
export type UseSolTransferParameters = undefined;
|
|
226
|
+
export type UseSolTransferReturnType = ReturnType<typeof useSolTransfer>;
|
|
227
|
+
export type UseSplTokenParameters = Readonly<{
|
|
228
|
+
mint: AddressLike;
|
|
229
|
+
options?: UseSplTokenOptions;
|
|
230
|
+
}>;
|
|
231
|
+
export type UseSplTokenReturnType = ReturnType<typeof useSplToken>;
|
|
232
|
+
export type UseTransactionPoolParameters = Readonly<{
|
|
233
|
+
config?: UseTransactionPoolConfig;
|
|
234
|
+
}>;
|
|
235
|
+
export type UseTransactionPoolReturnType = ReturnType<typeof useTransactionPool>;
|
|
236
|
+
export type UseWalletParameters = undefined;
|
|
237
|
+
export type UseWalletReturnType = ReturnType<typeof useWallet>;
|
|
238
|
+
export type UseWalletSessionParameters = undefined;
|
|
239
|
+
export type UseWalletSessionReturnType = ReturnType<typeof useWalletSession>;
|
|
240
|
+
export type UseWalletActionsParameters = undefined;
|
|
241
|
+
export type UseWalletActionsReturnType = ReturnType<typeof useWalletActions>;
|
|
200
242
|
export {};
|
|
201
243
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAW3B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAE/B,KAAK,oCAAoC,EACzC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,E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
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
export type { SolanaClientProviderProps, UseSolanaClientParameters, UseSolanaClientReturnType, } from './context';
|
|
1
2
|
export { SolanaClientProvider, useSolanaClient } from './context';
|
|
2
|
-
export {
|
|
3
|
+
export type { SignatureWaitStatus, UseAccountParameters, UseAccountReturnType, UseBalanceParameters, UseBalanceReturnType, UseClusterStateParameters, UseClusterStateReturnType, UseClusterStatusParameters, UseClusterStatusReturnType, UseConnectWalletParameters, UseConnectWalletReturnType, UseDisconnectWalletParameters, UseDisconnectWalletReturnType, UseSendTransactionParameters, UseSendTransactionReturnType, UseSignatureStatusOptions, UseSignatureStatusParameters, UseSignatureStatusReturnType, UseSolTransferParameters, UseSolTransferReturnType, UseSplTokenParameters, UseSplTokenReturnType, UseTransactionPoolParameters, UseTransactionPoolReturnType, UseWaitForSignatureOptions, UseWaitForSignatureParameters, UseWaitForSignatureReturnType, UseWalletActionsParameters, UseWalletActionsReturnType, UseWalletParameters, UseWalletReturnType, UseWalletSessionParameters, UseWalletSessionReturnType, } from './hooks';
|
|
4
|
+
export { useAccount, useBalance, useClusterState, useClusterStatus, useConnectWallet, useDisconnectWallet, useSendTransaction, useSignatureStatus, useSolTransfer, useSplToken, useTransactionPool, useWaitForSignature, useWallet, useWalletActions, useWalletSession, } from './hooks';
|
|
3
5
|
export { SolanaQueryProvider } from './QueryProvider';
|
|
6
|
+
export type { QueryStatus, SolanaQueryResult, UseSolanaRpcQueryOptions } from './query';
|
|
7
|
+
export type { UseLatestBlockhashParameters, UseLatestBlockhashReturnType, UseProgramAccountsParameters, UseProgramAccountsReturnType, UseSimulateTransactionParameters, UseSimulateTransactionReturnType, } from './queryHooks';
|
|
4
8
|
export { useLatestBlockhash, useProgramAccounts, useSimulateTransaction } from './queryHooks';
|
|
9
|
+
export type { QueryKey } from './queryKeys';
|
|
10
|
+
export { getLatestBlockhashKey, getProgramAccountsKey, getSignatureStatusKey, getSimulateTransactionKey, } from './queryKeys';
|
|
5
11
|
export { SolanaProvider } from './SolanaProvider';
|
|
12
|
+
export type { UseWalletConnectionParameters, UseWalletConnectionReturnType, UseWalletModalStateParameters, UseWalletModalStateReturnType, WalletModalState, } from './ui';
|
|
6
13
|
export { useWalletConnection, useWalletModalState, WalletConnectionManager } from './ui';
|
|
14
|
+
export type { UseClientStoreParameters, UseClientStoreReturnType, UseClientStoreSelector, } from './useClientStore';
|
|
7
15
|
export { useClientStore } from './useClientStore';
|
|
8
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EACN,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACX,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAClE,YAAY,EACX,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EAC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AAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/types/query.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { SolanaClient } from '@solana/client';
|
|
2
2
|
import { type BareFetcher, type SWRConfiguration, type SWRResponse } from 'swr';
|
|
3
3
|
export type QueryStatus = 'error' | 'idle' | 'loading' | 'success';
|
|
4
|
-
export type UseSolanaRpcQueryOptions<Data> =
|
|
4
|
+
export type UseSolanaRpcQueryOptions<Data> = Readonly<{
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
swr?: Omit<SWRConfiguration<Data, unknown, BareFetcher<Data>>, 'fallback' | 'suspense'>;
|
|
6
7
|
}>;
|
|
7
8
|
export type SolanaQueryResult<Data> = Readonly<{
|
|
8
9
|
data: Data | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAe,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAQxF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,wBAAwB,CAAC,IAAI,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAe,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAQxF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,wBAAwB,CAAC,IAAI,IAAI,QAAQ,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;CACxF,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,CAAC,IAAI,IAAI,QAAQ,CAAC;IAC9C,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,WAAW,CAAC;CACpB,CAAC,CAAC;AAEH,wBAAgB,iBAAiB,CAAC,IAAI,EACrC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,EAChD,OAAO,GAAE,wBAAwB,CAAC,IAAI,CAAM,GAC1C,iBAAiB,CAAC,IAAI,CAAC,CAmDzB"}
|
|
@@ -10,34 +10,42 @@ type ProgramAccountsResponse = Awaited<ReturnType<ProgramAccountsPlan['send']>>;
|
|
|
10
10
|
type SimulateTransactionPlan = ReturnType<RpcInstance['simulateTransaction']>;
|
|
11
11
|
type SimulateTransactionConfig = Parameters<RpcInstance['simulateTransaction']>[1];
|
|
12
12
|
type SimulateTransactionResponse = Awaited<ReturnType<SimulateTransactionPlan['send']>>;
|
|
13
|
-
export type
|
|
13
|
+
export type UseLatestBlockhashParameters = Readonly<{
|
|
14
14
|
commitment?: Commitment;
|
|
15
|
+
disabled?: boolean;
|
|
15
16
|
minContextSlot?: bigint | number;
|
|
16
17
|
refreshInterval?: number;
|
|
18
|
+
swr?: UseSolanaRpcQueryOptions<LatestBlockhashResponse>['swr'];
|
|
17
19
|
}>;
|
|
18
|
-
export type
|
|
20
|
+
export type UseLatestBlockhashReturnType = SolanaQueryResult<LatestBlockhashResponse> & Readonly<{
|
|
19
21
|
blockhash: string | null;
|
|
20
22
|
contextSlot: bigint | null | undefined;
|
|
21
23
|
lastValidBlockHeight: bigint | null;
|
|
22
24
|
}>;
|
|
23
|
-
export declare function useLatestBlockhash(options?:
|
|
24
|
-
export type
|
|
25
|
+
export declare function useLatestBlockhash(options?: UseLatestBlockhashParameters): UseLatestBlockhashReturnType;
|
|
26
|
+
export type UseProgramAccountsParameters = Readonly<{
|
|
25
27
|
commitment?: Commitment;
|
|
26
28
|
config?: ProgramAccountsConfig;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
programAddress?: AddressLike;
|
|
31
|
+
swr?: UseSolanaRpcQueryOptions<ProgramAccountsResponse>['swr'];
|
|
27
32
|
}>;
|
|
28
|
-
export type
|
|
33
|
+
export type UseProgramAccountsReturnType = SolanaQueryResult<ProgramAccountsResponse> & Readonly<{
|
|
29
34
|
accounts: ProgramAccountsResponse;
|
|
30
35
|
}>;
|
|
31
|
-
export declare function useProgramAccounts(programAddress?: AddressLike, options?:
|
|
32
|
-
export type
|
|
36
|
+
export declare function useProgramAccounts(programAddress?: AddressLike, options?: UseProgramAccountsParameters): UseProgramAccountsReturnType;
|
|
37
|
+
export type UseSimulateTransactionParameters = Readonly<{
|
|
33
38
|
commitment?: Commitment;
|
|
34
39
|
config?: SimulateTransactionConfig;
|
|
40
|
+
disabled?: boolean;
|
|
35
41
|
refreshInterval?: number;
|
|
42
|
+
swr?: UseSolanaRpcQueryOptions<SimulateTransactionResponse>['swr'];
|
|
43
|
+
transaction?: SimulationInput | null;
|
|
36
44
|
}>;
|
|
37
|
-
|
|
45
|
+
type SimulationInput = (SendableTransaction & Transaction) | Base64EncodedWireTransaction | string;
|
|
46
|
+
export type UseSimulateTransactionReturnType = SolanaQueryResult<SimulateTransactionResponse> & Readonly<{
|
|
38
47
|
logs: readonly string[];
|
|
39
48
|
}>;
|
|
40
|
-
|
|
41
|
-
export declare function useSimulateTransaction(transaction?: SimulationInput | null, options?: UseSimulateTransactionOptions): SimulateTransactionQueryResult;
|
|
49
|
+
export declare function useSimulateTransaction(transaction?: SimulationInput | null, options?: UseSimulateTransactionParameters): UseSimulateTransactionReturnType;
|
|
42
50
|
export {};
|
|
43
51
|
//# sourceMappingURL=queryHooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryHooks.d.ts","sourceRoot":"","sources":["../../src/queryHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"queryHooks.d.ts","sourceRoot":"","sources":["../../src/queryHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAa,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,UAAU,EAEf,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAI3E,KAAK,WAAW,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;AAElD,KAAK,mBAAmB,GAAG,UAAU,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC;AACzE,KAAK,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEhF,KAAK,mBAAmB,GAAG,UAAU,CAAC,W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C/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,GAAG,CAAC,EAAE,wBAAwB,CAAC,uBAAuB,CAAC,CAAC,KAAK,CAAC,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,GACpF,QAAQ,CAAC;IACR,QAAQ,EAAE,uBAAuB,CAAC;CAClC,CAAC,CAAC;AAEJ,wBAAgB,kBAAkB,CACjC,cAAc,CAAC,EAAE,WAAW,EAC5B,OAAO,CAAC,EAAE,4BAA4B,GACpC,4BAA4B,CAgC9B;AAED,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC;IACvD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,CAAC,KAAK,CAAC,CAAC;IACnE,WAAW,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACrC,CAAC,CAAC;AAEH,KAAK,eAAe,GAAG,CAAC,mBAAmB,GAAG,WAAW,CAAC,GAAG,4BAA4B,GAAG,MAAM,CAAC;AAEnG,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAAC,2BAA2B,CAAC,GAC5F,QAAQ,CAAC;IACR,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACxB,CAAC,CAAC;AAEJ,wBAAgB,sBAAsB,CACrC,WAAW,CAAC,EAAE,eAAe,GAAG,IAAI,EACpC,OAAO,CAAC,EAAE,gCAAgC,GACxC,gCAAgC,CA4ClC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UseSignatureStatusOptions, UseSignatureStatusParameters } from './hooks';
|
|
2
|
+
import type { UseLatestBlockhashParameters, UseProgramAccountsParameters, UseSimulateTransactionParameters } from './queryHooks';
|
|
3
|
+
export type QueryKey = readonly unknown[];
|
|
4
|
+
export declare function getLatestBlockhashKey(params?: UseLatestBlockhashParameters): QueryKey;
|
|
5
|
+
export declare function getProgramAccountsKey(params?: UseProgramAccountsParameters): QueryKey;
|
|
6
|
+
export declare function getSimulateTransactionKey(params?: UseSimulateTransactionParameters): QueryKey;
|
|
7
|
+
export declare function getSignatureStatusKey(params?: UseSignatureStatusParameters | UseSignatureStatusOptions): QueryKey;
|
|
8
|
+
//# sourceMappingURL=queryKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryKeys.d.ts","sourceRoot":"","sources":["../../src/queryKeys.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,KAAK,EACX,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,QAAQ,GAAG,SAAS,OAAO,EAAE,CAAC;AAE1C,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,4BAAiC,GAAG,QAAQ,CAGzF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,4BAAiC,GAAG,QAAQ,CAMzF;AAED,wBAAgB,yBAAyB,CAAC,MAAM,GAAE,gCAAqC,GAAG,QAAQ,CAKjG;AAED,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,4BAA4B,GAAG,yBAA8B,GAAG,QAAQ,CAKrH"}
|
package/dist/types/ui.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { WalletConnector, WalletSession, WalletStatus } from '@solana/client';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import { type WalletStandardDiscoveryOptions } from './hooks';
|
|
4
3
|
type WalletConnectionState = Readonly<{
|
|
5
4
|
connect(connectorId: string, options?: Readonly<{
|
|
6
5
|
autoConnect?: boolean;
|
|
@@ -8,33 +7,31 @@ type WalletConnectionState = Readonly<{
|
|
|
8
7
|
connected: boolean;
|
|
9
8
|
connecting: boolean;
|
|
10
9
|
connectors: readonly WalletConnector[];
|
|
10
|
+
currentConnector?: WalletConnector;
|
|
11
11
|
connectorId?: string;
|
|
12
12
|
disconnect(): Promise<void>;
|
|
13
13
|
error: unknown;
|
|
14
14
|
status: WalletStatus['status'];
|
|
15
15
|
wallet: WalletSession | undefined;
|
|
16
16
|
}>;
|
|
17
|
-
type
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
}>;
|
|
20
|
-
type UseWalletConnectionOptions = Readonly<{
|
|
17
|
+
type WalletConnectionOptions = Readonly<{
|
|
21
18
|
connectors?: readonly WalletConnector[];
|
|
22
|
-
discoveryOptions?: WalletDiscoveryOptions;
|
|
23
19
|
}>;
|
|
20
|
+
export type UseWalletConnectionParameters = WalletConnectionOptions;
|
|
21
|
+
export type UseWalletConnectionReturnType = WalletConnectionState;
|
|
24
22
|
/**
|
|
25
23
|
* Collects everything needed to build wallet connection UIs into a single hook.
|
|
26
24
|
*/
|
|
27
|
-
export declare function useWalletConnection(options?:
|
|
25
|
+
export declare function useWalletConnection(options?: WalletConnectionOptions): WalletConnectionState;
|
|
28
26
|
type WalletConnectionManagerProps = Readonly<{
|
|
29
27
|
children: (state: WalletConnectionState) => ReactNode;
|
|
30
28
|
connectors?: readonly WalletConnector[];
|
|
31
|
-
discoveryOptions?: WalletStandardDiscoveryOptions;
|
|
32
29
|
}>;
|
|
33
30
|
/**
|
|
34
31
|
* Render-prop helper that lets you easily wire wallet status into custom UIs.
|
|
35
32
|
*/
|
|
36
|
-
export declare function WalletConnectionManager({ children, connectors
|
|
37
|
-
type
|
|
33
|
+
export declare function WalletConnectionManager({ children, connectors }: WalletConnectionManagerProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
type WalletModalStateOptions = WalletConnectionOptions & Readonly<{
|
|
38
35
|
closeOnConnect?: boolean;
|
|
39
36
|
initialOpen?: boolean;
|
|
40
37
|
}>;
|
|
@@ -46,10 +43,12 @@ export type WalletModalState = WalletConnectionState & Readonly<{
|
|
|
46
43
|
select(connectorId: string | null): void;
|
|
47
44
|
toggle(): void;
|
|
48
45
|
}>;
|
|
46
|
+
export type UseWalletModalStateParameters = WalletModalStateOptions;
|
|
47
|
+
export type UseWalletModalStateReturnType = WalletModalState;
|
|
49
48
|
/**
|
|
50
49
|
* Small state machine for wallet selection modals – keeps track of modal visibility and the currently
|
|
51
50
|
* highlighted connector while reusing the connection state returned by {@link useWalletConnection}.
|
|
52
51
|
*/
|
|
53
|
-
export declare function useWalletModalState(options?:
|
|
52
|
+
export declare function useWalletModalState(options?: WalletModalStateOptions): WalletModalState;
|
|
54
53
|
export {};
|
|
55
54
|
//# sourceMappingURL=ui.d.ts.map
|
package/dist/types/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/ui.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/ui.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,KAAK,qBAAqB,GAAG,QAAQ,CAAC;IACrC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3F,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,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AM,GAAG,IAAI,GAAG,IAAI,CAAC;IACzC,MAAM,IAAI,IAAI,CAAC;CACf,CAAC,CAAC;AAEJ,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AACpE,MAAM,MAAM,6BAA6B,GAAG,gBAAgB,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAgC3F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ClientState } from '@solana/client';
|
|
2
|
-
type
|
|
2
|
+
export type UseClientStoreSelector<T> = (state: ClientState) => T;
|
|
3
|
+
export type UseClientStoreParameters<T = ClientState> = UseClientStoreSelector<T> | undefined;
|
|
4
|
+
export type UseClientStoreReturnType<T = ClientState> = T extends undefined ? ClientState : T;
|
|
3
5
|
export declare function useClientStore(): ClientState;
|
|
4
|
-
export declare function useClientStore<T>(selector:
|
|
5
|
-
export {};
|
|
6
|
+
export declare function useClientStore<T>(selector: UseClientStoreSelector<T>): T;
|
|
6
7
|
//# sourceMappingURL=useClientStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClientStore.d.ts","sourceRoot":"","sources":["../../src/useClientStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,
|
|
1
|
+
{"version":3,"file":"useClientStore.d.ts","sourceRoot":"","sources":["../../src/useClientStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,KAAK,CAAC,CAAC;AAGlE,MAAM,MAAM,wBAAwB,CAAC,CAAC,GAAG,WAAW,IAAI,sBAAsB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAC9F,MAAM,MAAM,wBAAwB,CAAC,CAAC,GAAG,WAAW,IAAI,CAAC,SAAS,SAAS,GAAG,WAAW,GAAG,CAAC,CAAC;AAE9F,wBAAgB,cAAc,IAAI,WAAW,CAAC;AAC9C,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/react-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "React hooks for the @solana/client Solana client",
|
|
5
5
|
"exports": {
|
|
6
6
|
"edge-light": {
|
|
@@ -56,15 +56,10 @@
|
|
|
56
56
|
"@solana/signers": "^5.0.0",
|
|
57
57
|
"@solana/transaction-messages": "^5.0.0",
|
|
58
58
|
"@solana/transactions": "^5.0.0",
|
|
59
|
-
"@solana/wallet-standard-features": "^1.3.0",
|
|
60
59
|
"@solana/kit": "^5.0.0",
|
|
61
60
|
"swr": "^2.3.6",
|
|
62
61
|
"zustand": "^5.0.0",
|
|
63
|
-
"@
|
|
64
|
-
"@wallet-standard/errors": "^0.1.1",
|
|
65
|
-
"@wallet-standard/ui": "^1.0.1",
|
|
66
|
-
"@wallet-standard/ui-registry": "^1.0.1",
|
|
67
|
-
"@solana/client": "0.2.1"
|
|
62
|
+
"@solana/client": "0.2.2"
|
|
68
63
|
},
|
|
69
64
|
"devDependencies": {
|
|
70
65
|
"@types/react": "^19",
|