@solana/web3-compat 0.0.6 → 0.0.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/dist/index.browser.cjs +91 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +91 -4
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +91 -4
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +91 -4
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +91 -4
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/client/src/actions.d.ts +71 -0
- package/dist/types/client/src/actions.d.ts.map +1 -0
- package/dist/types/client/src/client/actions.d.ts +18 -0
- package/dist/types/client/src/client/actions.d.ts.map +1 -0
- package/dist/types/client/src/client/createClient.d.ts +9 -0
- package/dist/types/client/src/client/createClient.d.ts.map +1 -0
- package/dist/types/client/src/client/createClientHelpers.d.ts +3 -0
- package/dist/types/client/src/client/createClientHelpers.d.ts.map +1 -0
- package/dist/types/client/src/client/createClientStore.d.ts +29 -0
- package/dist/types/client/src/client/createClientStore.d.ts.map +1 -0
- package/dist/types/client/src/client/defaultClient.d.ts +26 -0
- package/dist/types/client/src/client/defaultClient.d.ts.map +1 -0
- package/dist/types/client/src/client/watchers.d.ts +16 -0
- package/dist/types/client/src/client/watchers.d.ts.map +1 -0
- package/dist/types/client/src/controllers/solTransferController.d.ts +21 -0
- package/dist/types/client/src/controllers/solTransferController.d.ts.map +1 -0
- package/dist/types/client/src/controllers/splTransferController.d.ts +24 -0
- package/dist/types/client/src/controllers/splTransferController.d.ts.map +1 -0
- package/dist/types/client/src/controllers/stakeController.d.ts +37 -0
- package/dist/types/client/src/controllers/stakeController.d.ts.map +1 -0
- package/dist/types/client/src/features/sol.d.ts +41 -0
- package/dist/types/client/src/features/sol.d.ts.map +1 -0
- package/dist/types/client/src/features/spl.d.ts +59 -0
- package/dist/types/client/src/features/spl.d.ts.map +1 -0
- package/dist/types/client/src/features/stake.d.ts +115 -0
- package/dist/types/client/src/features/stake.d.ts.map +1 -0
- package/dist/types/client/src/features/transactions.d.ts +79 -0
- package/dist/types/client/src/features/transactions.d.ts.map +1 -0
- package/dist/types/client/src/index.d.ts +32 -0
- package/dist/types/client/src/index.d.ts.map +1 -0
- package/dist/types/client/src/logging/logger.d.ts +24 -0
- package/dist/types/client/src/logging/logger.d.ts.map +1 -0
- package/dist/types/client/src/numeric/amounts.d.ts +30 -0
- package/dist/types/client/src/numeric/amounts.d.ts.map +1 -0
- package/dist/types/client/src/numeric/lamports.d.ts +46 -0
- package/dist/types/client/src/numeric/lamports.d.ts.map +1 -0
- package/dist/types/client/src/numeric/math.d.ts +74 -0
- package/dist/types/client/src/numeric/math.d.ts.map +1 -0
- package/dist/types/client/src/numeric/rational.d.ts +27 -0
- package/dist/types/client/src/numeric/rational.d.ts.map +1 -0
- package/dist/types/client/src/rpc/createSolanaRpcClient.d.ts +42 -0
- package/dist/types/client/src/rpc/createSolanaRpcClient.d.ts.map +1 -0
- package/dist/types/client/src/serialization/json.d.ts +31 -0
- package/dist/types/client/src/serialization/json.d.ts.map +1 -0
- package/dist/types/client/src/serialization/state.d.ts +25 -0
- package/dist/types/client/src/serialization/state.d.ts.map +1 -0
- package/dist/types/client/src/signatures/status.d.ts +12 -0
- package/dist/types/client/src/signatures/status.d.ts.map +1 -0
- package/dist/types/client/src/signers/walletTransactionSigner.d.ts +33 -0
- package/dist/types/client/src/signers/walletTransactionSigner.d.ts.map +1 -0
- package/dist/types/client/src/state/asyncState.d.ts +12 -0
- package/dist/types/client/src/state/asyncState.d.ts.map +1 -0
- package/dist/types/client/src/transactions/base64.d.ts +12 -0
- package/dist/types/client/src/transactions/base64.d.ts.map +1 -0
- package/dist/types/client/src/transactions/prepareTransaction.d.ts +16 -0
- package/dist/types/client/src/transactions/prepareTransaction.d.ts.map +1 -0
- package/dist/types/client/src/transactions/referenceKeys.d.ts +10 -0
- package/dist/types/client/src/transactions/referenceKeys.d.ts.map +1 -0
- package/dist/types/client/src/transactions/transactionPoolController.d.ts +53 -0
- package/dist/types/client/src/transactions/transactionPoolController.d.ts.map +1 -0
- package/dist/types/client/src/types.d.ts +291 -0
- package/dist/types/client/src/types.d.ts.map +1 -0
- package/dist/types/client/src/utils/addressLike.d.ts +5 -0
- package/dist/types/client/src/utils/addressLike.d.ts.map +1 -0
- package/dist/types/client/src/utils/cluster.d.ts +14 -0
- package/dist/types/client/src/utils/cluster.d.ts.map +1 -0
- package/dist/types/client/src/utils/stableStringify.d.ts +2 -0
- package/dist/types/client/src/utils/stableStringify.d.ts.map +1 -0
- package/dist/types/client/src/utils.d.ts +21 -0
- package/dist/types/client/src/utils.d.ts.map +1 -0
- package/dist/types/client/src/wallet/connectors.d.ts +29 -0
- package/dist/types/client/src/wallet/connectors.d.ts.map +1 -0
- package/dist/types/client/src/wallet/registry.d.ts +9 -0
- package/dist/types/client/src/wallet/registry.d.ts.map +1 -0
- package/dist/types/client/src/wallet/standard.d.ts +37 -0
- package/dist/types/client/src/wallet/standard.d.ts.map +1 -0
- package/dist/types/web3-compat/src/bridges.d.ts.map +1 -0
- package/dist/types/web3-compat/src/connection.d.ts.map +1 -0
- package/dist/types/web3-compat/src/index.d.ts.map +1 -0
- package/dist/types/web3-compat/src/programs/system-program.d.ts.map +1 -0
- package/dist/types/web3-compat/src/utils.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/types/bridges.d.ts.map +0 -1
- package/dist/types/connection.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/programs/system-program.d.ts.map +0 -1
- package/dist/types/utils.d.ts.map +0 -1
- /package/dist/types/{bridges.d.ts → web3-compat/src/bridges.d.ts} +0 -0
- /package/dist/types/{connection.d.ts → web3-compat/src/connection.d.ts} +0 -0
- /package/dist/types/{index.d.ts → web3-compat/src/index.d.ts} +0 -0
- /package/dist/types/{programs → web3-compat/src/programs}/system-program.d.ts +0 -0
- /package/dist/types/{utils.d.ts → web3-compat/src/utils.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../../../client/src/serialization/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,iBAAiB,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAE5D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SerializableSolanaState, SolanaClient, SolanaClientConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Derive the minimal serializable state for a client based on its config.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getInitialSerializableState(config: SolanaClientConfig): SerializableSolanaState;
|
|
6
|
+
/**
|
|
7
|
+
* Applies persisted serializable state on top of a base client config.
|
|
8
|
+
*
|
|
9
|
+
* This is a pure helper; it does not mutate the client. Callers can use the returned
|
|
10
|
+
* config object to construct a hydrated client instance.
|
|
11
|
+
*/
|
|
12
|
+
export declare function applySerializableState(config: SolanaClientConfig, state: SerializableSolanaState | null | undefined): SolanaClientConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Serializes a {@link SerializableSolanaState} to a JSON string.
|
|
15
|
+
*/
|
|
16
|
+
export declare function serializeSolanaState(state: SerializableSolanaState): string;
|
|
17
|
+
/**
|
|
18
|
+
* Safely deserializes persisted state into a {@link SerializableSolanaState}.
|
|
19
|
+
*/
|
|
20
|
+
export declare function deserializeSolanaState(json: string | null | undefined): SerializableSolanaState | null;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribes to client state changes and emits a serializable snapshot when relevant fields change.
|
|
23
|
+
*/
|
|
24
|
+
export declare function subscribeSolanaState(client: SolanaClient, listener: (state: SerializableSolanaState) => void): () => void;
|
|
25
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../../client/src/serialization/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI1F;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,kBAAkB,GAAG,uBAAuB,CAU/F;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,uBAAuB,GAAG,IAAI,GAAG,SAAS,GAC/C,kBAAkB,CAUpB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,CAE3E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,uBAAuB,GAAG,IAAI,CAkBtG;AAyBD;;GAEG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,GAChD,MAAM,IAAI,CAaZ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Commitment, type Signature } from '@solana/kit';
|
|
2
|
+
export type SignatureLike = Signature | string;
|
|
3
|
+
export type ConfirmationCommitment = Extract<Commitment, 'confirmed' | 'finalized' | 'processed'>;
|
|
4
|
+
export type SignatureStatusLike = Readonly<{
|
|
5
|
+
confirmationStatus?: ConfirmationCommitment | null;
|
|
6
|
+
confirmations?: number | bigint | null;
|
|
7
|
+
}> | null;
|
|
8
|
+
export declare const SIGNATURE_STATUS_TIMEOUT_MS = 20000;
|
|
9
|
+
export declare function normalizeSignature(input?: SignatureLike): Signature | undefined;
|
|
10
|
+
export declare function deriveConfirmationStatus(status: SignatureStatusLike): ConfirmationCommitment | null;
|
|
11
|
+
export declare function confirmationMeetsCommitment(confirmation: ConfirmationCommitment | null, target: ConfirmationCommitment): boolean;
|
|
12
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../../client/src/signatures/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAA+B,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE3F,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;AAElG,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IAC1C,kBAAkB,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACnD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACvC,CAAC,GAAG,IAAI,CAAC;AAQV,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAK/E;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG,sBAAsB,GAAG,IAAI,CAkBnG;AAED,wBAAgB,2BAA2B,CAC1C,YAAY,EAAE,sBAAsB,GAAG,IAAI,EAC3C,MAAM,EAAE,sBAAsB,GAC5B,OAAO,CAKT"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Commitment, type TransactionSigner } from '@solana/kit';
|
|
2
|
+
import type { WalletSession } from '../types';
|
|
3
|
+
type WalletTransactionSignerMode = 'partial' | 'send';
|
|
4
|
+
export type WalletTransactionSigner = Readonly<{
|
|
5
|
+
mode: WalletTransactionSignerMode;
|
|
6
|
+
signer: TransactionSigner;
|
|
7
|
+
}>;
|
|
8
|
+
export type WalletTransactionSignerConfig = Readonly<{
|
|
9
|
+
commitment?: Commitment;
|
|
10
|
+
}>;
|
|
11
|
+
/** Type guard that determines whether the provided value is a {@link WalletSession}. */
|
|
12
|
+
export declare function isWalletSession(value: unknown): value is WalletSession;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a {@link TransactionSigner} wrapper around a {@link WalletSession}.
|
|
15
|
+
*
|
|
16
|
+
* The returned signer implements the most capable interface supported by the underlying wallet:
|
|
17
|
+
* - if the wallet exposes `signTransaction`, a partial signer is returned;
|
|
18
|
+
* - otherwise, if the wallet only exposes `sendTransaction`, a sending signer is returned.
|
|
19
|
+
*
|
|
20
|
+
* @param session - Connected wallet session used to sign or send transactions.
|
|
21
|
+
* @param config - Optional configuration that propagates commitment preferences when the wallet sends transactions.
|
|
22
|
+
* @returns Object containing the wrapped {@link TransactionSigner} and the strategy it supports.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createWalletTransactionSigner(session: WalletSession, config?: WalletTransactionSignerConfig): WalletTransactionSigner;
|
|
25
|
+
/**
|
|
26
|
+
* Resolves the most capable signing strategy for a {@link TransactionSigner}.
|
|
27
|
+
*
|
|
28
|
+
* @param signer - Arbitrary transaction signer.
|
|
29
|
+
* @returns Strategy descriptor indicating whether the signer can partially sign transactions.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveSignerMode(signer: TransactionSigner): WalletTransactionSignerMode;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=walletTransactionSigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletTransactionSigner.d.ts","sourceRoot":"","sources":["../../../../../../client/src/signers/walletTransactionSigner.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,UAAU,EAWf,KAAK,iBAAiB,EAGtB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,KAAK,2BAA2B,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC9C,IAAI,EAAE,2BAA2B,CAAC;IAClC,MAAM,EAAE,iBAAiB,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IACpD,UAAU,CAAC,EAAE,UAAU,CAAC;CACxB,CAAC,CAAC;AAEH,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAKtE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,aAAa,EACtB,MAAM,GAAE,6BAAkC,GACxC,uBAAuB,CAuFzB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,2BAA2B,CASxF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AsyncStatus = 'error' | 'idle' | 'loading' | 'success';
|
|
2
|
+
export type AsyncState<T> = Readonly<{
|
|
3
|
+
data?: T;
|
|
4
|
+
error?: unknown;
|
|
5
|
+
status: AsyncStatus;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function createInitialAsyncState<T>(): AsyncState<T>;
|
|
8
|
+
export declare function createAsyncState<T>(status: AsyncStatus, payload?: Readonly<{
|
|
9
|
+
data?: T;
|
|
10
|
+
error?: unknown;
|
|
11
|
+
}>): AsyncState<T>;
|
|
12
|
+
//# sourceMappingURL=asyncState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncState.d.ts","sourceRoot":"","sources":["../../../../../../client/src/state/asyncState.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC;IACpC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;CACpB,CAAC,CAAC;AAEH,wBAAgB,uBAAuB,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAE1D;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,QAAQ,CAAC;IAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAM,GACnD,UAAU,CAAC,CAAC,CAAC,CAMf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Base64EncodedWireTransaction, Transaction, TransactionMessage, TransactionMessageWithFeePayer } from '@solana/kit';
|
|
2
|
+
type Base64ConvertibleTransaction = (TransactionMessage & TransactionMessageWithFeePayer) | Transaction;
|
|
3
|
+
/**
|
|
4
|
+
* Serializes a transaction message or fully signed transaction to a base64-encoded wire format string.
|
|
5
|
+
*/
|
|
6
|
+
export declare function transactionToBase64(tx: Base64ConvertibleTransaction): Base64EncodedWireTransaction;
|
|
7
|
+
/**
|
|
8
|
+
* Serializes a transaction after ensuring all attached signers have produced signatures.
|
|
9
|
+
*/
|
|
10
|
+
export declare function transactionToBase64WithSigners(tx: Base64ConvertibleTransaction): Promise<Base64EncodedWireTransaction>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=base64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../../../../client/src/transactions/base64.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,4BAA4B,EAC5B,WAAW,EACX,kBAAkB,EAClB,8BAA8B,EAC9B,MAAM,aAAa,CAAC;AAOrB,KAAK,4BAA4B,GAAG,CAAC,kBAAkB,GAAG,8BAA8B,CAAC,GAAG,WAAW,CAAC;AAExG;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,4BAA4B,GAAG,4BAA4B,CAKlG;AAED;;GAEG;AACH,wBAAsB,8BAA8B,CACnD,EAAE,EAAE,4BAA4B,GAC9B,OAAO,CAAC,4BAA4B,CAAC,CAMvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GetLatestBlockhashApi, Rpc, SimulateTransactionApi, TransactionMessage, TransactionMessageWithBlockhashLifetime, TransactionMessageWithFeePayer } from '@solana/kit';
|
|
2
|
+
export type PrepareTransactionMessage = TransactionMessage & TransactionMessageWithFeePayer;
|
|
3
|
+
export type PrepareTransactionOptions<TMessage extends PrepareTransactionMessage> = Readonly<{
|
|
4
|
+
transaction: TMessage;
|
|
5
|
+
computeUnitLimitMultiplier?: number;
|
|
6
|
+
computeUnitLimitReset?: boolean;
|
|
7
|
+
blockhashReset?: boolean;
|
|
8
|
+
logRequest?: (payload: {
|
|
9
|
+
base64WireTransaction: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
}>;
|
|
12
|
+
export type PrepareTransactionConfig<TMessage extends PrepareTransactionMessage> = PrepareTransactionOptions<TMessage> & Readonly<{
|
|
13
|
+
rpc: Rpc<GetLatestBlockhashApi & SimulateTransactionApi>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function prepareTransaction<TMessage extends PrepareTransactionMessage>(config: PrepareTransactionConfig<TMessage>): Promise<TMessage & TransactionMessageWithBlockhashLifetime>;
|
|
16
|
+
//# sourceMappingURL=prepareTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareTransaction.d.ts","sourceRoot":"","sources":["../../../../../../client/src/transactions/prepareTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,qBAAqB,EACrB,GAAG,EACH,sBAAsB,EACtB,kBAAkB,EAClB,uCAAuC,EACvC,8BAA8B,EAC9B,MAAM,aAAa,CAAC;AAWrB,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,GAAG,8BAA8B,CAAC;AAE5F,MAAM,MAAM,yBAAyB,CAAC,QAAQ,SAAS,yBAAyB,IAAI,QAAQ,CAAC;IAC5F,WAAW,EAAE,QAAQ,CAAC;IACtB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,qBAAqB,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClE,CAAC,CAAC;AAEH,MAAM,MAAM,wBAAwB,CAAC,QAAQ,SAAS,yBAAyB,IAAI,yBAAyB,CAAC,QAAQ,CAAC,GACrH,QAAQ,CAAC;IACR,GAAG,EAAE,GAAG,CAAC,qBAAqB,GAAG,sBAAsB,CAAC,CAAC;CACzD,CAAC,CAAC;AAyDJ,wBAAsB,kBAAkB,CAAC,QAAQ,SAAS,yBAAyB,EAClF,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GACxC,OAAO,CAAC,QAAQ,GAAG,uCAAuC,CAAC,CAkD7D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Address, BaseTransactionMessage } from '@solana/kit';
|
|
2
|
+
/**
|
|
3
|
+
* Appends reference address metadata to the first non-memo instruction in a transaction.
|
|
4
|
+
*/
|
|
5
|
+
export declare function insertReferenceKey<T extends BaseTransactionMessage>(reference: Address, transaction: T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Appends multiple reference addresses to the first non-memo instruction in a transaction.
|
|
8
|
+
*/
|
|
9
|
+
export declare function insertReferenceKeys<T extends BaseTransactionMessage>(references: Address[], transaction: T): T;
|
|
10
|
+
//# sourceMappingURL=referenceKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceKeys.d.ts","sourceRoot":"","sources":["../../../../../../client/src/transactions/referenceKeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAgBnE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,sBAAsB,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,CAE1G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,sBAAsB,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,CAa9G"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { TransactionHelper, TransactionInstructionInput, TransactionPrepareAndSendRequest, TransactionPrepared, TransactionPrepareRequest, TransactionSendOptions, TransactionSignOptions } from '../features/transactions';
|
|
2
|
+
import { type AsyncState } from '../state/asyncState';
|
|
3
|
+
type Listener = () => void;
|
|
4
|
+
export type TransactionInstructionList = readonly TransactionInstructionInput[];
|
|
5
|
+
type TransactionSignature = Awaited<ReturnType<TransactionHelper['send']>>;
|
|
6
|
+
export type LatestBlockhashCache = Readonly<{
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
value: NonNullable<TransactionPrepareRequest['lifetime']>;
|
|
9
|
+
}>;
|
|
10
|
+
export type TransactionPoolConfig = Readonly<{
|
|
11
|
+
blockhashMaxAgeMs?: number;
|
|
12
|
+
helper: TransactionHelper;
|
|
13
|
+
initialInstructions?: TransactionInstructionList;
|
|
14
|
+
}>;
|
|
15
|
+
export type TransactionPoolPrepareOptions = Readonly<Partial<Omit<TransactionPrepareRequest, 'instructions'>> & {
|
|
16
|
+
instructions?: TransactionInstructionList;
|
|
17
|
+
}>;
|
|
18
|
+
export type TransactionPoolSignOptions = Readonly<TransactionSignOptions & {
|
|
19
|
+
prepared?: TransactionPrepared;
|
|
20
|
+
}>;
|
|
21
|
+
export type TransactionPoolSendOptions = Readonly<TransactionSendOptions & {
|
|
22
|
+
prepared?: TransactionPrepared;
|
|
23
|
+
}>;
|
|
24
|
+
export type TransactionPoolPrepareAndSendOptions = Readonly<Omit<TransactionPrepareAndSendRequest, 'instructions'> & {
|
|
25
|
+
instructions?: TransactionInstructionList;
|
|
26
|
+
}>;
|
|
27
|
+
export type TransactionPoolController = Readonly<{
|
|
28
|
+
addInstruction(instruction: TransactionInstructionInput): void;
|
|
29
|
+
addInstructions(instructionSet: TransactionInstructionList): void;
|
|
30
|
+
clearInstructions(): void;
|
|
31
|
+
getInstructions(): TransactionInstructionList;
|
|
32
|
+
getPrepareState(): AsyncState<TransactionPrepared>;
|
|
33
|
+
getPrepared(): TransactionPrepared | null;
|
|
34
|
+
getSendState(): AsyncState<TransactionSignature>;
|
|
35
|
+
getLatestBlockhashCache(): LatestBlockhashCache | undefined;
|
|
36
|
+
prepare(options?: TransactionPoolPrepareOptions): Promise<TransactionPrepared>;
|
|
37
|
+
prepareAndSend(request?: TransactionPoolPrepareAndSendOptions, sendOptions?: TransactionSendOptions): Promise<TransactionSignature>;
|
|
38
|
+
removeInstruction(index: number): void;
|
|
39
|
+
replaceInstructions(instructionSet: TransactionInstructionList): void;
|
|
40
|
+
reset(): void;
|
|
41
|
+
send(options?: TransactionPoolSendOptions): Promise<TransactionSignature>;
|
|
42
|
+
setLatestBlockhashCache(cache: LatestBlockhashCache | undefined): void;
|
|
43
|
+
sign(options?: TransactionPoolSignOptions): ReturnType<TransactionHelper['sign']>;
|
|
44
|
+
subscribeInstructions(listener: Listener): () => void;
|
|
45
|
+
subscribePrepareState(listener: Listener): () => void;
|
|
46
|
+
subscribePrepared(listener: Listener): () => void;
|
|
47
|
+
subscribeSendState(listener: Listener): () => void;
|
|
48
|
+
toWire(options?: TransactionPoolSignOptions): ReturnType<TransactionHelper['toWire']>;
|
|
49
|
+
get helper(): TransactionHelper;
|
|
50
|
+
}>;
|
|
51
|
+
export declare function createTransactionPoolController(config: TransactionPoolConfig): TransactionPoolController;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=transactionPoolController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactionPoolController.d.ts","sourceRoot":"","sources":["../../../../../../client/src/transactions/transactionPoolController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,2BAA2B,EAC3B,gCAAgC,EAChC,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,UAAU,EAA6C,MAAM,qBAAqB,CAAC;AAEjG,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,MAAM,MAAM,0BAA0B,GAAG,SAAS,2BAA2B,EAAE,CAAC;AAEhF,KAAK,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC,CAAC;CAC1D,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CACnD,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,cAAc,CAAC,CAAC,GAAG;IAC1D,YAAY,CAAC,EAAE,0BAA0B,CAAC;CAC1C,CACD,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC,sBAAsB,GAAG;IAAE,QAAQ,C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C;IACvE,IAAI,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAAC;IACtD,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAAC;IACtD,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAAC;IAClD,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAAC;IACnD,MAAM,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtF,IAAI,MAAM,IAAI,iBAAiB,CAAC;CAChC,CAAC,CAAC;AAEH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,qBAAqB,GAAG,yBAAyB,CAuNxG"}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import type { Address, ClusterUrl, Commitment, Lamports, SendableTransaction, Signature, Transaction, TransactionMessageWithBlockhashLifetime } from '@solana/kit';
|
|
2
|
+
import type { TransactionWithLastValidBlockHeight } from '@solana/transaction-confirmation';
|
|
3
|
+
import type { StoreApi } from 'zustand/vanilla';
|
|
4
|
+
import type { SolTransferHelper } from './features/sol';
|
|
5
|
+
import type { SplTokenHelper, SplTokenHelperConfig } from './features/spl';
|
|
6
|
+
import type { StakeHelper } from './features/stake';
|
|
7
|
+
import type { TransactionHelper } from './features/transactions';
|
|
8
|
+
import type { SolanaRpcClient } from './rpc/createSolanaRpcClient';
|
|
9
|
+
import type { PrepareTransactionMessage, PrepareTransactionOptions } from './transactions/prepareTransaction';
|
|
10
|
+
import type { ClusterMoniker } from './utils/cluster';
|
|
11
|
+
type SolanaRpcInstance = ReturnType<typeof import('@solana/kit')['createSolanaRpc']>;
|
|
12
|
+
type SolanaSubscriptionsInstance = ReturnType<typeof import('@solana/kit')['createSolanaRpcSubscriptions']>;
|
|
13
|
+
export type LogLevel = 'debug' | 'error' | 'info' | 'warn';
|
|
14
|
+
export type ClientLogger = (event: {
|
|
15
|
+
data?: Record<string, unknown>;
|
|
16
|
+
level: LogLevel;
|
|
17
|
+
message: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
export type WalletConnectorMetadata = Readonly<{
|
|
20
|
+
canAutoConnect?: boolean;
|
|
21
|
+
icon?: string;
|
|
22
|
+
id: string;
|
|
23
|
+
kind?: string;
|
|
24
|
+
name: string;
|
|
25
|
+
ready?: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
export type WalletAccount = Readonly<{
|
|
28
|
+
address: Address;
|
|
29
|
+
label?: string;
|
|
30
|
+
publicKey: Uint8Array;
|
|
31
|
+
}>;
|
|
32
|
+
export type WalletSession = Readonly<{
|
|
33
|
+
account: WalletAccount;
|
|
34
|
+
connector: WalletConnectorMetadata;
|
|
35
|
+
disconnect(): Promise<void>;
|
|
36
|
+
onAccountsChanged?: (listener: (accounts: WalletAccount[]) => void) => () => void;
|
|
37
|
+
sendTransaction?(transaction: SendableTransaction & Transaction, config?: Readonly<{
|
|
38
|
+
commitment?: Commitment;
|
|
39
|
+
}>): Promise<Signature>;
|
|
40
|
+
signMessage?(message: Uint8Array): Promise<Uint8Array>;
|
|
41
|
+
signTransaction?(transaction: SendableTransaction & Transaction): Promise<SendableTransaction & Transaction>;
|
|
42
|
+
}>;
|
|
43
|
+
export type WalletConnector = WalletConnectorMetadata & {
|
|
44
|
+
connect(opts?: Readonly<{
|
|
45
|
+
autoConnect?: boolean;
|
|
46
|
+
allowInteractiveFallback?: boolean;
|
|
47
|
+
}>): Promise<WalletSession>;
|
|
48
|
+
disconnect(): Promise<void>;
|
|
49
|
+
isSupported(): boolean;
|
|
50
|
+
};
|
|
51
|
+
type WalletStatusConnected = Readonly<{
|
|
52
|
+
autoConnect?: boolean;
|
|
53
|
+
connectorId: string;
|
|
54
|
+
session: WalletSession;
|
|
55
|
+
status: 'connected';
|
|
56
|
+
}>;
|
|
57
|
+
type WalletStatusConnecting = Readonly<{
|
|
58
|
+
autoConnect?: boolean;
|
|
59
|
+
connectorId: string;
|
|
60
|
+
status: 'connecting';
|
|
61
|
+
}>;
|
|
62
|
+
type WalletStatusDisconnected = Readonly<{
|
|
63
|
+
status: 'disconnected';
|
|
64
|
+
}>;
|
|
65
|
+
type WalletStatusError = Readonly<{
|
|
66
|
+
autoConnect?: boolean;
|
|
67
|
+
connectorId?: string;
|
|
68
|
+
error: unknown;
|
|
69
|
+
status: 'error';
|
|
70
|
+
}>;
|
|
71
|
+
export type WalletStatus = WalletStatusConnected | WalletStatusConnecting | WalletStatusDisconnected | WalletStatusError;
|
|
72
|
+
type ClusterStatusConnecting = Readonly<{
|
|
73
|
+
status: 'connecting';
|
|
74
|
+
}>;
|
|
75
|
+
type ClusterStatusError = Readonly<{
|
|
76
|
+
error: unknown;
|
|
77
|
+
status: 'error';
|
|
78
|
+
}>;
|
|
79
|
+
type ClusterStatusIdle = Readonly<{
|
|
80
|
+
status: 'idle';
|
|
81
|
+
}>;
|
|
82
|
+
type ClusterStatusReady = Readonly<{
|
|
83
|
+
latencyMs?: number;
|
|
84
|
+
status: 'ready';
|
|
85
|
+
}>;
|
|
86
|
+
export type ClusterStatus = ClusterStatusConnecting | ClusterStatusError | ClusterStatusIdle | ClusterStatusReady;
|
|
87
|
+
export type ClusterState = Readonly<{
|
|
88
|
+
commitment: Commitment;
|
|
89
|
+
endpoint: ClusterUrl;
|
|
90
|
+
status: ClusterStatus;
|
|
91
|
+
websocketEndpoint?: ClusterUrl;
|
|
92
|
+
}>;
|
|
93
|
+
export type AccountCacheEntry = Readonly<{
|
|
94
|
+
address: Address;
|
|
95
|
+
data?: unknown;
|
|
96
|
+
error?: unknown;
|
|
97
|
+
fetching: boolean;
|
|
98
|
+
lamports: Lamports | null;
|
|
99
|
+
lastFetchedAt?: number;
|
|
100
|
+
slot: bigint | null;
|
|
101
|
+
}>;
|
|
102
|
+
export type AccountCache = Record<string, AccountCacheEntry>;
|
|
103
|
+
export type AddressLookupTableData = Readonly<{
|
|
104
|
+
addresses: readonly Address[];
|
|
105
|
+
authority?: Address;
|
|
106
|
+
deactivationSlot: bigint;
|
|
107
|
+
lastExtendedSlot: bigint;
|
|
108
|
+
lastExtendedSlotStartIndex: number;
|
|
109
|
+
}>;
|
|
110
|
+
export type NonceAccountData = Readonly<{
|
|
111
|
+
authority: Address;
|
|
112
|
+
blockhash: string;
|
|
113
|
+
}>;
|
|
114
|
+
export type TransactionRecord = Readonly<{
|
|
115
|
+
error?: unknown;
|
|
116
|
+
lastUpdatedAt: number;
|
|
117
|
+
signature?: Signature;
|
|
118
|
+
status: 'confirmed' | 'failed' | 'idle' | 'sending' | 'waiting';
|
|
119
|
+
}>;
|
|
120
|
+
export type TransactionState = Record<string, TransactionRecord>;
|
|
121
|
+
type SubscriptionStatusActivating = Readonly<{
|
|
122
|
+
status: 'activating';
|
|
123
|
+
}>;
|
|
124
|
+
type SubscriptionStatusActive = Readonly<{
|
|
125
|
+
status: 'active';
|
|
126
|
+
}>;
|
|
127
|
+
type SubscriptionStatusError = Readonly<{
|
|
128
|
+
error: unknown;
|
|
129
|
+
status: 'error';
|
|
130
|
+
}>;
|
|
131
|
+
type SubscriptionStatusInactive = Readonly<{
|
|
132
|
+
status: 'inactive';
|
|
133
|
+
}>;
|
|
134
|
+
export type SubscriptionStatus = SubscriptionStatusActivating | SubscriptionStatusActive | SubscriptionStatusError | SubscriptionStatusInactive;
|
|
135
|
+
export type SubscriptionState = Readonly<{
|
|
136
|
+
account: Record<string, SubscriptionStatus>;
|
|
137
|
+
signature: Record<string, SubscriptionStatus>;
|
|
138
|
+
}>;
|
|
139
|
+
export type ClientState = Readonly<{
|
|
140
|
+
accounts: AccountCache;
|
|
141
|
+
cluster: ClusterState;
|
|
142
|
+
lastUpdatedAt: number;
|
|
143
|
+
subscriptions: SubscriptionState;
|
|
144
|
+
transactions: TransactionState;
|
|
145
|
+
wallet: WalletStatus;
|
|
146
|
+
}>;
|
|
147
|
+
export type ClientStore = StoreApi<ClientState>;
|
|
148
|
+
export type CreateStoreFn = (state: ClientState) => ClientStore;
|
|
149
|
+
export type SolanaClientConfig = Readonly<{
|
|
150
|
+
cluster?: ClusterMoniker;
|
|
151
|
+
commitment?: Commitment;
|
|
152
|
+
createStore?: CreateStoreFn;
|
|
153
|
+
endpoint?: ClusterUrl;
|
|
154
|
+
initialState?: SerializableSolanaState;
|
|
155
|
+
logger?: ClientLogger;
|
|
156
|
+
rpc?: ClusterUrl;
|
|
157
|
+
rpcClient?: SolanaRpcClient;
|
|
158
|
+
walletConnectors?: readonly WalletConnector[];
|
|
159
|
+
websocket?: ClusterUrl;
|
|
160
|
+
websocketEndpoint?: ClusterUrl;
|
|
161
|
+
}>;
|
|
162
|
+
export type SerializableSolanaState = Readonly<{
|
|
163
|
+
autoconnect?: boolean;
|
|
164
|
+
commitment?: Commitment;
|
|
165
|
+
endpoint?: ClusterUrl;
|
|
166
|
+
lastConnectorId?: string | null;
|
|
167
|
+
lastPublicKey?: string | null;
|
|
168
|
+
version: number;
|
|
169
|
+
websocketEndpoint?: ClusterUrl;
|
|
170
|
+
}>;
|
|
171
|
+
export type SolanaClientRuntime = {
|
|
172
|
+
rpc: SolanaRpcInstance;
|
|
173
|
+
rpcSubscriptions: SolanaSubscriptionsInstance;
|
|
174
|
+
};
|
|
175
|
+
export type BalanceWatcherConfig = Readonly<{
|
|
176
|
+
address: Address;
|
|
177
|
+
commitment?: Commitment;
|
|
178
|
+
}>;
|
|
179
|
+
export type AccountWatcherConfig = Readonly<{
|
|
180
|
+
address: Address;
|
|
181
|
+
commitment?: Commitment;
|
|
182
|
+
}>;
|
|
183
|
+
export type SignatureWatcherConfig = Readonly<{
|
|
184
|
+
commitment?: Commitment;
|
|
185
|
+
enableReceivedNotification?: boolean;
|
|
186
|
+
signature: Signature;
|
|
187
|
+
}>;
|
|
188
|
+
export type WatchSubscription = Readonly<{
|
|
189
|
+
abort(): void;
|
|
190
|
+
}>;
|
|
191
|
+
export type ConnectWalletParameters = Readonly<{
|
|
192
|
+
connectorId: string;
|
|
193
|
+
options?: Readonly<{
|
|
194
|
+
autoConnect?: boolean;
|
|
195
|
+
allowInteractiveFallback?: boolean;
|
|
196
|
+
}>;
|
|
197
|
+
}>;
|
|
198
|
+
export type ConnectWalletReturnType = Promise<void>;
|
|
199
|
+
export type DisconnectWalletParameters = undefined;
|
|
200
|
+
export type DisconnectWalletReturnType = Promise<void>;
|
|
201
|
+
export type FetchAccountParameters = Readonly<{
|
|
202
|
+
address: Address;
|
|
203
|
+
commitment?: Commitment;
|
|
204
|
+
}>;
|
|
205
|
+
export type FetchAccountReturnType = Promise<AccountCacheEntry>;
|
|
206
|
+
export type FetchBalanceParameters = Readonly<{
|
|
207
|
+
address: Address;
|
|
208
|
+
commitment?: Commitment;
|
|
209
|
+
}>;
|
|
210
|
+
export type FetchBalanceReturnType = Promise<Lamports>;
|
|
211
|
+
export type FetchLookupTableParameters = Readonly<{
|
|
212
|
+
address: Address;
|
|
213
|
+
commitment?: Commitment;
|
|
214
|
+
}>;
|
|
215
|
+
export type FetchLookupTableReturnType = Promise<AddressLookupTableData>;
|
|
216
|
+
export type FetchLookupTablesParameters = Readonly<{
|
|
217
|
+
addresses: readonly Address[];
|
|
218
|
+
commitment?: Commitment;
|
|
219
|
+
}>;
|
|
220
|
+
export type FetchLookupTablesReturnType = Promise<readonly AddressLookupTableData[]>;
|
|
221
|
+
export type FetchNonceAccountParameters = Readonly<{
|
|
222
|
+
address: Address;
|
|
223
|
+
commitment?: Commitment;
|
|
224
|
+
}>;
|
|
225
|
+
export type FetchNonceAccountReturnType = Promise<NonceAccountData>;
|
|
226
|
+
export type RequestAirdropParameters = Readonly<{
|
|
227
|
+
address: Address;
|
|
228
|
+
lamports: Lamports;
|
|
229
|
+
}>;
|
|
230
|
+
export type RequestAirdropReturnType = Promise<Signature>;
|
|
231
|
+
export type SendTransactionParameters = Readonly<{
|
|
232
|
+
commitment?: Commitment;
|
|
233
|
+
transaction: SendableTransaction & Transaction & TransactionWithLastValidBlockHeight;
|
|
234
|
+
}>;
|
|
235
|
+
export type SendTransactionReturnType = Promise<Signature>;
|
|
236
|
+
export type SetClusterParameters = Readonly<{
|
|
237
|
+
config?: Readonly<{
|
|
238
|
+
commitment?: Commitment;
|
|
239
|
+
websocketEndpoint?: ClusterUrl;
|
|
240
|
+
}>;
|
|
241
|
+
endpoint: ClusterUrl;
|
|
242
|
+
}>;
|
|
243
|
+
export type SetClusterReturnType = Promise<void>;
|
|
244
|
+
export type ClientActions = Readonly<{
|
|
245
|
+
connectWallet(connectorId: ConnectWalletParameters['connectorId'], options?: ConnectWalletParameters['options']): ConnectWalletReturnType;
|
|
246
|
+
disconnectWallet(): DisconnectWalletReturnType;
|
|
247
|
+
fetchAccount(address: FetchAccountParameters['address'], commitment?: FetchAccountParameters['commitment']): FetchAccountReturnType;
|
|
248
|
+
fetchBalance(address: FetchBalanceParameters['address'], commitment?: FetchBalanceParameters['commitment']): FetchBalanceReturnType;
|
|
249
|
+
fetchLookupTable(address: FetchLookupTableParameters['address'], commitment?: FetchLookupTableParameters['commitment']): FetchLookupTableReturnType;
|
|
250
|
+
fetchLookupTables(addresses: FetchLookupTablesParameters['addresses'], commitment?: FetchLookupTablesParameters['commitment']): FetchLookupTablesReturnType;
|
|
251
|
+
fetchNonceAccount(address: FetchNonceAccountParameters['address'], commitment?: FetchNonceAccountParameters['commitment']): FetchNonceAccountReturnType;
|
|
252
|
+
requestAirdrop(address: RequestAirdropParameters['address'], lamports: RequestAirdropParameters['lamports']): RequestAirdropReturnType;
|
|
253
|
+
sendTransaction(transaction: SendTransactionParameters['transaction'], commitment?: SendTransactionParameters['commitment']): SendTransactionReturnType;
|
|
254
|
+
setCluster(endpoint: SetClusterParameters['endpoint'], config?: SetClusterParameters['config']): SetClusterReturnType;
|
|
255
|
+
}>;
|
|
256
|
+
export type ClientWatchers = Readonly<{
|
|
257
|
+
watchAccount(config: AccountWatcherConfig, listener: (account: AccountCacheEntry) => void): WatchSubscription;
|
|
258
|
+
watchBalance(config: BalanceWatcherConfig, listener: (lamports: Lamports) => void): WatchSubscription;
|
|
259
|
+
watchSignature(config: SignatureWatcherConfig, listener: (notification: unknown) => void): WatchSubscription;
|
|
260
|
+
}>;
|
|
261
|
+
export type ClientHelpers = Readonly<{
|
|
262
|
+
solTransfer: SolTransferHelper;
|
|
263
|
+
splToken(config: SplTokenHelperConfig): SplTokenHelper;
|
|
264
|
+
stake: StakeHelper;
|
|
265
|
+
transaction: TransactionHelper;
|
|
266
|
+
prepareTransaction<TMessage extends PrepareTransactionMessage>(config: PrepareTransactionOptions<TMessage>): Promise<TMessage & TransactionMessageWithBlockhashLifetime>;
|
|
267
|
+
}>;
|
|
268
|
+
export type WalletRegistry = Readonly<{
|
|
269
|
+
all: readonly WalletConnector[];
|
|
270
|
+
get(id: string): WalletConnector | undefined;
|
|
271
|
+
}>;
|
|
272
|
+
export type SolanaClient = Readonly<{
|
|
273
|
+
actions: ClientActions;
|
|
274
|
+
config: SolanaClientConfig;
|
|
275
|
+
connectors: WalletRegistry;
|
|
276
|
+
destroy(): void;
|
|
277
|
+
runtime: Readonly<SolanaClientRuntime>;
|
|
278
|
+
store: ClientStore;
|
|
279
|
+
watchers: ClientWatchers;
|
|
280
|
+
helpers: ClientHelpers;
|
|
281
|
+
solTransfer: SolTransferHelper;
|
|
282
|
+
SolTransfer: SolTransferHelper;
|
|
283
|
+
splToken(config: SplTokenHelperConfig): SplTokenHelper;
|
|
284
|
+
SplToken(config: SplTokenHelperConfig): SplTokenHelper;
|
|
285
|
+
SplHelper(config: SplTokenHelperConfig): SplTokenHelper;
|
|
286
|
+
stake: StakeHelper;
|
|
287
|
+
transaction: TransactionHelper;
|
|
288
|
+
prepareTransaction: ClientHelpers['prepareTransaction'];
|
|
289
|
+
}>;
|
|
290
|
+
export {};
|
|
291
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@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iB,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAAC;IACvD,QAAQ,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAAC;IACvD,SAAS,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAAC;IACxD,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,kBAAkB,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CACxD,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Address } from '@solana/kit';
|
|
2
|
+
export type AddressLike = Address | string;
|
|
3
|
+
export declare function toAddress(addressLike: AddressLike): Address;
|
|
4
|
+
export declare function toAddressString(addressLike: AddressLike): string;
|
|
5
|
+
//# sourceMappingURL=addressLike.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addressLike.d.ts","sourceRoot":"","sources":["../../../../../../client/src/utils/addressLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAA2B,MAAM,aAAa,CAAC;AAEpE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,wBAAgB,SAAS,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAE3D;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ClusterUrl } from '@solana/kit';
|
|
2
|
+
export type ClusterMoniker = 'mainnet' | 'mainnet-beta' | 'testnet' | 'devnet' | 'localnet' | 'localhost';
|
|
3
|
+
type ResolvedCluster = Readonly<{
|
|
4
|
+
endpoint: ClusterUrl;
|
|
5
|
+
moniker: ClusterMoniker | 'custom';
|
|
6
|
+
websocketEndpoint: ClusterUrl;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function resolveCluster(config: Readonly<{
|
|
9
|
+
endpoint?: ClusterUrl;
|
|
10
|
+
moniker?: ClusterMoniker;
|
|
11
|
+
websocketEndpoint?: ClusterUrl;
|
|
12
|
+
}>): ResolvedCluster;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=cluster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../../../../../client/src/utils/cluster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAE1G,KAAK,eAAe,GAAG,QAAQ,CAAC;IAC/B,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,cAAc,GAAG,QAAQ,CAAC;IACnC,iBAAiB,EAAE,UAAU,CAAC;CAC9B,CAAC,CAAC;AAsDH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,QAAQ,CAAC;IAAE,QAAQ,CAAC,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAAC,iBAAiB,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC,GACnG,eAAe,CAajB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stableStringify.d.ts","sourceRoot":"","sources":["../../../../../../client/src/utils/stableStringify.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAWtD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively freezes a value to avoid accidental mutation of initial state snapshots.
|
|
3
|
+
*
|
|
4
|
+
* @param value - Value to freeze in place.
|
|
5
|
+
* @returns The same value with all nested objects frozen.
|
|
6
|
+
*/
|
|
7
|
+
export declare function deepFreeze<T>(value: T): T;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the current timestamp in milliseconds.
|
|
10
|
+
*
|
|
11
|
+
* @returns Millisecond timestamp provided by {@link Date.now}.
|
|
12
|
+
*/
|
|
13
|
+
export declare function now(): number;
|
|
14
|
+
/**
|
|
15
|
+
* Converts optional errors to a serializable string for logging.
|
|
16
|
+
*
|
|
17
|
+
* @param error - Arbitrary error value to format.
|
|
18
|
+
* @returns String representation of the provided error.
|
|
19
|
+
*/
|
|
20
|
+
export declare function toErrorMessage(error: unknown): string;
|
|
21
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../client/src/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAUzC;AAED;;;;GAIG;AACH,wBAAgB,GAAG,IAAI,MAAM,CAE5B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAYrD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Wallet } from '@wallet-standard/base';
|
|
2
|
+
import type { WalletConnector } from '../types';
|
|
3
|
+
import { createWalletStandardConnector } from './standard';
|
|
4
|
+
type DiscoveryOptions = Readonly<{
|
|
5
|
+
overrides?: (wallet: Wallet) => Parameters<typeof createWalletStandardConnector>[1];
|
|
6
|
+
filter?: (wallet: Wallet) => boolean;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns connectors for all Wallet Standard wallets currently registered.
|
|
10
|
+
*/
|
|
11
|
+
export declare function autoDiscover(options?: DiscoveryOptions): readonly WalletConnector[];
|
|
12
|
+
/**
|
|
13
|
+
* Creates a connector for any Wallet Standard wallet that supports connect.
|
|
14
|
+
*/
|
|
15
|
+
export declare function injected(options?: Parameters<typeof createWalletStandardConnector>[1]): WalletConnector;
|
|
16
|
+
/**
|
|
17
|
+
* Factory for a Phantom-only connector.
|
|
18
|
+
*/
|
|
19
|
+
export declare function phantom(options?: Parameters<typeof createWalletStandardConnector>[1]): readonly WalletConnector[];
|
|
20
|
+
/**
|
|
21
|
+
* Factory for a Solflare-only connector.
|
|
22
|
+
*/
|
|
23
|
+
export declare function solflare(options?: Parameters<typeof createWalletStandardConnector>[1]): readonly WalletConnector[];
|
|
24
|
+
/**
|
|
25
|
+
* Factory for a Backpack-only connector.
|
|
26
|
+
*/
|
|
27
|
+
export declare function backpack(options?: Parameters<typeof createWalletStandardConnector>[1]): readonly WalletConnector[];
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=connectors.d.ts.map
|