@lifi/sdk-provider-solana 4.0.3 → 4.0.5
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/CHANGELOG.md +16 -0
- package/dist/cjs/SolanaProvider.d.ts +0 -1
- package/dist/cjs/actions/getSolanaBalance.d.ts +0 -1
- package/dist/cjs/actions/getSolanaBalance.js.map +1 -1
- package/dist/cjs/actions/sendAndConfirmBundle.d.ts +7 -8
- package/dist/cjs/actions/sendAndConfirmTransaction.d.ts +6 -7
- package/dist/cjs/core/SolanaStepExecutor.d.ts +0 -1
- package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.d.ts +0 -1
- package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.js +6 -2
- package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.js.map +1 -1
- package/dist/cjs/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.js +1 -4
- package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/errors/parseSolanaErrors.d.ts +0 -1
- package/dist/cjs/rpc/jito/api/getBundleStatuses.d.ts +3 -4
- package/dist/cjs/rpc/jito/api/getTipAccounts.d.ts +4 -5
- package/dist/cjs/rpc/jito/api/sendBundle.d.ts +10 -11
- package/dist/cjs/rpc/jito/api/simulateBundle.d.ts +12 -8
- package/dist/cjs/rpc/jito/createJitoRpc.d.ts +0 -1
- package/dist/cjs/rpc/jito/types.d.ts +2 -2
- package/dist/cjs/rpc/registry.d.ts +11 -9
- package/dist/cjs/rpc/registry.js +16 -2
- package/dist/cjs/rpc/registry.js.map +1 -1
- package/dist/cjs/rpc/types.d.ts +0 -1
- package/dist/cjs/rpc/utils.d.ts +53 -54
- package/dist/cjs/types.d.ts +5 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/KeypairWalletAdapter.d.ts +9 -10
- package/dist/cjs/utils/getWalletFeature.d.ts +15 -16
- package/dist/cjs/utils/solanaErrorCause.d.ts +4 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/SolanaProvider.d.ts +0 -1
- package/dist/esm/SolanaProvider.d.ts.map +1 -1
- package/dist/esm/actions/getSNSAddress.d.ts.map +1 -1
- package/dist/esm/actions/getSolanaBalance.d.ts +0 -1
- package/dist/esm/actions/getSolanaBalance.d.ts.map +1 -1
- package/dist/esm/actions/resolveSolanaAddress.d.ts.map +1 -1
- package/dist/esm/actions/sendAndConfirmBundle.d.ts +7 -8
- package/dist/esm/actions/sendAndConfirmBundle.d.ts.map +1 -1
- package/dist/esm/actions/sendAndConfirmTransaction.d.ts +6 -7
- package/dist/esm/actions/sendAndConfirmTransaction.d.ts.map +1 -1
- package/dist/esm/core/SolanaStepExecutor.d.ts +0 -1
- package/dist/esm/core/SolanaStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts +0 -1
- package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaSignAndExecuteTask.js +6 -2
- package/dist/esm/core/tasks/SolanaSignAndExecuteTask.js.map +1 -1
- package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaWaitForTransactionTask.js +1 -4
- package/dist/esm/core/tasks/SolanaWaitForTransactionTask.js.map +1 -1
- package/dist/esm/errors/parseSolanaErrors.d.ts +0 -1
- package/dist/esm/errors/parseSolanaErrors.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts +3 -4
- package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/getTipAccounts.d.ts +4 -5
- package/dist/esm/rpc/jito/api/getTipAccounts.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/sendBundle.d.ts +10 -11
- package/dist/esm/rpc/jito/api/sendBundle.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/simulateBundle.d.ts +12 -8
- package/dist/esm/rpc/jito/api/simulateBundle.d.ts.map +1 -1
- package/dist/esm/rpc/jito/createJitoRpc.d.ts +0 -1
- package/dist/esm/rpc/jito/createJitoRpc.d.ts.map +1 -1
- package/dist/esm/rpc/jito/types.d.ts +2 -2
- package/dist/esm/rpc/jito/types.d.ts.map +1 -1
- package/dist/esm/rpc/registry.d.ts +11 -9
- package/dist/esm/rpc/registry.d.ts.map +1 -1
- package/dist/esm/rpc/registry.js +16 -2
- package/dist/esm/rpc/registry.js.map +1 -1
- package/dist/esm/rpc/types.d.ts +0 -1
- package/dist/esm/rpc/types.d.ts.map +1 -1
- package/dist/esm/rpc/utils.d.ts +53 -54
- package/dist/esm/rpc/utils.d.ts.map +1 -1
- package/dist/esm/types.d.ts +5 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/KeypairWallet.unit.helpers.d.ts.map +1 -1
- package/dist/esm/utils/KeypairWalletAdapter.d.ts +9 -10
- package/dist/esm/utils/KeypairWalletAdapter.d.ts.map +1 -1
- package/dist/esm/utils/base64ToUint8Array.d.ts.map +1 -1
- package/dist/esm/utils/getWalletFeature.d.ts +15 -16
- package/dist/esm/utils/getWalletFeature.d.ts.map +1 -1
- package/dist/esm/utils/solanaErrorCause.d.ts +4 -4
- package/dist/esm/utils/solanaErrorCause.d.ts.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +2 -2
- package/src/core/tasks/SolanaSignAndExecuteTask.ts +9 -5
- package/src/core/tasks/SolanaWaitForTransactionTask.ts +5 -11
- package/src/rpc/registry.ts +18 -2
- package/src/types.ts +5 -0
- package/src/version.ts +1 -1
- package/dist/cjs/utils/shouldUseJitoBundle.d.ts +0 -8
- package/dist/cjs/utils/shouldUseJitoBundle.js +0 -12
- package/dist/cjs/utils/shouldUseJitoBundle.js.map +0 -1
- package/dist/esm/utils/shouldUseJitoBundle.d.ts +0 -8
- package/dist/esm/utils/shouldUseJitoBundle.d.ts.map +0 -1
- package/dist/esm/utils/shouldUseJitoBundle.js +0 -11
- package/dist/esm/utils/shouldUseJitoBundle.js.map +0 -1
- package/src/utils/shouldUseJitoBundle.ts +0 -18
package/dist/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ChainType"],"sources":["../../src/types.ts"],"sourcesContent":["import {\n ChainType,\n type SDKProvider,\n type StepExecutorContext,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport type { Transaction } from '@solana/kit'\nimport type { Wallet, WalletAccount } from '@wallet-standard/base'\n\nexport interface SolanaProviderOptions {\n getWallet?: () => Promise<Wallet>\n skipSimulation?: boolean\n}\n\nexport interface SolanaTaskContext {\n signedTransactions?: Transaction[]\n}\n\nexport interface SolanaStepExecutorContext\n extends StepExecutorContext,\n SolanaTaskContext {\n wallet: Wallet\n walletAccount: WalletAccount\n skipSimulation: boolean\n}\n\nexport interface SolanaSDKProvider extends SDKProvider {\n setOptions(options: SolanaProviderOptions): void\n}\n\nexport function isSolanaProvider(\n provider: SDKProvider\n): provider is SolanaSDKProvider {\n return provider.type === ChainType.SVM\n}\n\nexport interface SolanaStepExecutorOptions extends StepExecutorOptions {\n wallet: Wallet\n skipSimulation?: boolean\n}\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","names":["ChainType"],"sources":["../../src/types.ts"],"sourcesContent":["import {\n ChainType,\n type SDKProvider,\n type StepExecutorContext,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport type { Transaction } from '@solana/kit'\nimport type { Wallet, WalletAccount } from '@wallet-standard/base'\n\nexport interface SolanaProviderOptions {\n getWallet?: () => Promise<Wallet>\n skipSimulation?: boolean\n}\n\nexport interface SolanaTaskContext {\n signedTransactions?: Transaction[]\n /**\n * Whether the backend returned a Jito bundle (array `transactionRequest.data`)\n * that must be submitted via `sendBundle` instead of `sendTransaction`.\n */\n isBundleExecution?: boolean\n}\n\nexport interface SolanaStepExecutorContext\n extends StepExecutorContext,\n SolanaTaskContext {\n wallet: Wallet\n walletAccount: WalletAccount\n skipSimulation: boolean\n}\n\nexport interface SolanaSDKProvider extends SDKProvider {\n setOptions(options: SolanaProviderOptions): void\n}\n\nexport function isSolanaProvider(\n provider: SDKProvider\n): provider is SolanaSDKProvider {\n return provider.type === ChainType.SVM\n}\n\nexport interface SolanaStepExecutorOptions extends StepExecutorOptions {\n wallet: Wallet\n skipSimulation?: boolean\n}\n"],"mappings":";;;AAmCA,SAAgB,iBACd,UAC+B;CAC/B,OAAO,SAAS,SAASA,UAAAA,UAAU;AACrC"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { Wallet, WalletAccount } from "@wallet-standard/base";
|
|
2
2
|
import { SolanaSignTransactionFeature } from "@solana/wallet-standard-features";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/KeypairWalletAdapter.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* This keypair wallet adapter is unsafe to use on the frontend and is only included to provide an easy way for applications to test
|
|
7
|
-
* Wallet Adapter without using a third-party wallet.
|
|
8
|
-
*/
|
|
5
|
+
* This keypair wallet adapter is unsafe to use on the frontend and is only included to provide an easy way for applications to test
|
|
6
|
+
* Wallet Adapter without using a third-party wallet.
|
|
7
|
+
*/
|
|
9
8
|
declare class KeypairWalletAdapter implements Wallet {
|
|
10
9
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
* Storing a keypair locally like this is not safe because any application using this adapter could retrieve the
|
|
11
|
+
* secret key, and because the keypair will be lost any time the wallet is disconnected or the window is refreshed.
|
|
12
|
+
*/
|
|
14
13
|
private _signer;
|
|
15
14
|
private _account;
|
|
16
15
|
private readonly _secretKeyBytes;
|
|
17
|
-
readonly version
|
|
18
|
-
readonly name
|
|
19
|
-
readonly icon
|
|
16
|
+
readonly version: "1.0.0";
|
|
17
|
+
readonly name: "Keypair Wallet";
|
|
18
|
+
readonly icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48L3N2Zz4=";
|
|
20
19
|
constructor(secretKeyBase58: string);
|
|
21
20
|
get chains(): readonly ["solana:mainnet", "solana:devnet", "solana:testnet"];
|
|
22
21
|
get accounts(): readonly WalletAccount[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Wallet } from "@wallet-standard/base";
|
|
2
2
|
import { SolanaSignAndSendTransaction, SolanaSignAndSendTransactionFeature, SolanaSignIn, SolanaSignInFeature, SolanaSignMessage, SolanaSignMessageFeature, SolanaSignTransaction, SolanaSignTransactionFeature } from "@solana/wallet-standard-features";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/getWalletFeature.d.ts
|
|
5
4
|
type FeatureMap = {
|
|
6
5
|
[SolanaSignTransaction]: SolanaSignTransactionFeature[typeof SolanaSignTransaction];
|
|
@@ -9,21 +8,21 @@ type FeatureMap = {
|
|
|
9
8
|
[SolanaSignIn]: SolanaSignInFeature[typeof SolanaSignIn];
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
|
-
* Helper function to safely extract a feature's properties from a wallet.
|
|
13
|
-
*
|
|
14
|
-
* This handles the TypeScript union type issue where wallet.features is typed as a union
|
|
15
|
-
* but at runtime is actually a record containing multiple features.
|
|
16
|
-
*
|
|
17
|
-
* @param wallet - The wallet instance
|
|
18
|
-
* @param featureName - The feature identifier constant
|
|
19
|
-
* @returns The feature's properties object
|
|
20
|
-
* @throws Error if the wallet doesn't support the requested feature
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* import { SolanaSignTransaction } from '@solana/wallet-standard-features'
|
|
24
|
-
*
|
|
25
|
-
* const { signTransaction } = getWalletFeature(wallet, SolanaSignTransaction)
|
|
26
|
-
*/
|
|
11
|
+
* Helper function to safely extract a feature's properties from a wallet.
|
|
12
|
+
*
|
|
13
|
+
* This handles the TypeScript union type issue where wallet.features is typed as a union
|
|
14
|
+
* but at runtime is actually a record containing multiple features.
|
|
15
|
+
*
|
|
16
|
+
* @param wallet - The wallet instance
|
|
17
|
+
* @param featureName - The feature identifier constant
|
|
18
|
+
* @returns The feature's properties object
|
|
19
|
+
* @throws Error if the wallet doesn't support the requested feature
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* import { SolanaSignTransaction } from '@solana/wallet-standard-features'
|
|
23
|
+
*
|
|
24
|
+
* const { signTransaction } = getWalletFeature(wallet, SolanaSignTransaction)
|
|
25
|
+
*/
|
|
27
26
|
declare function getWalletFeature<K extends keyof FeatureMap>(wallet: Wallet, featureName: K): FeatureMap[K];
|
|
28
27
|
//#endregion
|
|
29
28
|
export { getWalletFeature };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/utils/solanaErrorCause.d.ts
|
|
2
2
|
declare const safeStringifyBigInt: (value: unknown) => string;
|
|
3
3
|
/**
|
|
4
|
-
* Carries the structured payload of a failed Solana RPC simulation or
|
|
5
|
-
* confirmation so consumers can inspect `err` and `logs` directly from
|
|
6
|
-
* the thrown `TransactionError`'s `cause`, without re-simulating.
|
|
7
|
-
*/
|
|
4
|
+
* Carries the structured payload of a failed Solana RPC simulation or
|
|
5
|
+
* confirmation so consumers can inspect `err` and `logs` directly from
|
|
6
|
+
* the thrown `TransactionError`'s `cause`, without re-simulating.
|
|
7
|
+
*/
|
|
8
8
|
declare class SolanaTransactionDetailsError extends Error {
|
|
9
9
|
readonly err: unknown;
|
|
10
10
|
readonly logs: readonly string[] | null;
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-solana'\nexport const version = '4.0.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk-provider-solana'\nexport const version = '4.0.5'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaProvider.d.ts","names":[],"sources":["../../src/SolanaProvider.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolanaProvider.d.ts","names":[],"sources":["../../src/SolanaProvider.ts"],"mappings":";;iBAYgB,eACd,UAAU,wBACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSNSAddress.d.ts","names":[],"sources":["../../../src/actions/getSNSAddress.ts"],"mappings":";cASa,
|
|
1
|
+
{"version":3,"file":"getSNSAddress.d.ts","names":[],"sources":["../../../src/actions/getSNSAddress.ts"],"mappings":";cASa,gBACX,iBACC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSolanaBalance.d.ts","names":[],"sources":["../../../src/actions/getSolanaBalance.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSolanaBalance.d.ts","names":[],"sources":["../../../src/actions/getSolanaBalance.ts"],"mappings":";;cAea,mBACX,QAAQ,WACR,uBACA,QAAQ,YACP,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSolanaAddress.d.ts","names":[],"sources":["../../../src/actions/resolveSolanaAddress.ts"],"mappings":";iBAEsB,
|
|
1
|
+
{"version":3,"file":"resolveSolanaAddress.d.ts","names":[],"sources":["../../../src/actions/resolveSolanaAddress.ts"],"mappings":";iBAEsB,qBACpB,eACC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Commitment, Signature, Transaction, TransactionError as TransactionError$1 } from "@solana/kit";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/sendAndConfirmBundle.d.ts
|
|
5
4
|
type SignatureStatus = {
|
|
6
5
|
slot: bigint;
|
|
@@ -19,13 +18,13 @@ type BundleResult = {
|
|
|
19
18
|
signatureResults: (SignatureStatus | null)[];
|
|
20
19
|
};
|
|
21
20
|
/**
|
|
22
|
-
* Send and confirm a bundle of transactions using Jito.
|
|
23
|
-
* Automatically selects a Jito-enabled RPC connection and polls for confirmation
|
|
24
|
-
* across multiple Jito RPCs in parallel.
|
|
25
|
-
* @param client - The SDK client.
|
|
26
|
-
* @param signedTransactions - Array of signed transactions to bundle.
|
|
27
|
-
* @returns BundleResult containing Bundle ID, transaction signatures, and confirmation results.
|
|
28
|
-
*/
|
|
21
|
+
* Send and confirm a bundle of transactions using Jito.
|
|
22
|
+
* Automatically selects a Jito-enabled RPC connection and polls for confirmation
|
|
23
|
+
* across multiple Jito RPCs in parallel.
|
|
24
|
+
* @param client - The SDK client.
|
|
25
|
+
* @param signedTransactions - Array of signed transactions to bundle.
|
|
26
|
+
* @returns BundleResult containing Bundle ID, transaction signatures, and confirmation results.
|
|
27
|
+
*/
|
|
29
28
|
declare function sendAndConfirmBundle(client: SDKClient, signedTransactions: Transaction[]): Promise<BundleResult>;
|
|
30
29
|
//#endregion
|
|
31
30
|
export { BundleResult, sendAndConfirmBundle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendAndConfirmBundle.d.ts","names":[],"sources":["../../../src/actions/sendAndConfirmBundle.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendAndConfirmBundle.d.ts","names":[],"sources":["../../../src/actions/sendAndConfirmBundle.ts"],"mappings":";;;KAWK;EACH;EACA;EACA,KAAK;EACL,oBAAoB;EACpB,QAAQ;IAAW,KAAK;OAAsB;IAAW;;;KAG/C;EACV;EACA,cAAc;EACd,mBAAmB;;;;;;;;;;iBAaC,qBACpB,QAAQ,WACR,oBAAoB,gBACnB,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient } from "@lifi/sdk";
|
|
2
2
|
import { Commitment, Transaction, TransactionError as TransactionError$1 } from "@solana/kit";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/sendAndConfirmTransaction.d.ts
|
|
5
4
|
type SignatureStatus = {
|
|
6
5
|
slot: bigint;
|
|
@@ -18,12 +17,12 @@ type ConfirmedTransactionResult = {
|
|
|
18
17
|
txSignature: string;
|
|
19
18
|
};
|
|
20
19
|
/**
|
|
21
|
-
* Sends a Solana transaction to multiple RPC endpoints and returns the confirmation
|
|
22
|
-
* as soon as any of them confirm the transaction.
|
|
23
|
-
* @param client - The SDK client.
|
|
24
|
-
* @param signedTransaction - The signed transaction to send.
|
|
25
|
-
* @returns - The confirmation result of the transaction.
|
|
26
|
-
*/
|
|
20
|
+
* Sends a Solana transaction to multiple RPC endpoints and returns the confirmation
|
|
21
|
+
* as soon as any of them confirm the transaction.
|
|
22
|
+
* @param client - The SDK client.
|
|
23
|
+
* @param signedTransaction - The signed transaction to send.
|
|
24
|
+
* @returns - The confirmation result of the transaction.
|
|
25
|
+
*/
|
|
27
26
|
declare function sendAndConfirmTransaction(client: SDKClient, signedTransaction: Transaction): Promise<ConfirmedTransactionResult>;
|
|
28
27
|
//#endregion
|
|
29
28
|
export { sendAndConfirmTransaction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendAndConfirmTransaction.d.ts","names":[],"sources":["../../../src/actions/sendAndConfirmTransaction.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendAndConfirmTransaction.d.ts","names":[],"sources":["../../../src/actions/sendAndConfirmTransaction.ts"],"mappings":";;;KAUK;EACH;EACA;EACA,KAAK;EACL,oBAAoB;EACpB,QAAQ;IAAW,KAAK;OAAsB;IAAW;;;KAGtD;EACH,iBAAiB;EACjB;;;;;;;;;iBAcoB,0BACpB,QAAQ,WACR,mBAAmB,cAClB,QAAQ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext, SolanaStepExecutorOptions } from "../types.js";
|
|
2
2
|
import { BaseStepExecutor, ExecutionAction, LiFiStepExtended, SDKError, StepExecutorBaseContext, TaskPipeline } from "@lifi/sdk";
|
|
3
3
|
import { WalletAccount } from "@wallet-standard/base";
|
|
4
|
-
|
|
5
4
|
//#region src/core/SolanaStepExecutor.d.ts
|
|
6
5
|
declare class SolanaStepExecutor extends BaseStepExecutor {
|
|
7
6
|
private wallet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaStepExecutor.d.ts","names":[],"sources":["../../../src/core/SolanaStepExecutor.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolanaStepExecutor.d.ts","names":[],"sources":["../../../src/core/SolanaStepExecutor.ts"],"mappings":";;;;cAsBa,2BAA2B;UAC9B;UACA;EAER,YAAY,SAAS;EAMrB,mBAAoB,MAAM,qBAAmB;WAepC,cACP,OAAO,OACP,OAAO,kBACP,SAAS,oBACR,QAAQ;WAEF,gBACP,aAAa,4BACZ,QAAQ;WAaF,iBACP,SAAS,8BACR"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/SolanaJitoWaitForTransactionTask.d.ts
|
|
5
4
|
declare class SolanaJitoWaitForTransactionTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaJitoWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaJitoWaitForTransactionTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolanaJitoWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaJitoWaitForTransactionTask.ts"],"mappings":";;;cAUa,yCAAyC;EACpD,IAAU,SAAS,4BAA4B,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/SolanaSignAndExecuteTask.d.ts
|
|
5
4
|
declare class SolanaSignAndExecuteTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaSignAndExecuteTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolanaSignAndExecuteTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaSignAndExecuteTask.ts"],"mappings":";;;cAca,iCAAiC;EAC5C,IAAU,SAAS,4BAA4B,QAAQ"}
|
|
@@ -10,7 +10,8 @@ var SolanaSignAndExecuteTask = class extends BaseStepExecutionTask {
|
|
|
10
10
|
const action = statusManager.findAction(step, isBridgeExecution ? "CROSS_CHAIN" : "SWAP");
|
|
11
11
|
if (!action) throw new TransactionError(LiFiErrorCode.TransactionUnprepared, "Unable to prepare transaction. Action not found.");
|
|
12
12
|
const transactionRequestData = await getTransactionRequestData(step, executionOptions);
|
|
13
|
-
const
|
|
13
|
+
const isBundleExecution = Array.isArray(transactionRequestData);
|
|
14
|
+
const transactionBytesArray = (isBundleExecution ? transactionRequestData : [transactionRequestData]).map((data) => base64ToUint8Array(data));
|
|
14
15
|
const signedTransactionOutputs = await withTimeout(async () => {
|
|
15
16
|
const { signTransaction } = getWalletFeature(wallet, SolanaSignTransaction);
|
|
16
17
|
return signTransaction(...transactionBytesArray.map((transaction) => ({
|
|
@@ -26,7 +27,10 @@ var SolanaSignAndExecuteTask = class extends BaseStepExecutionTask {
|
|
|
26
27
|
const transactionCodec = getTransactionCodec();
|
|
27
28
|
return {
|
|
28
29
|
status: "COMPLETED",
|
|
29
|
-
context: {
|
|
30
|
+
context: {
|
|
31
|
+
signedTransactions: signedTransactionOutputs.map((output) => transactionCodec.decode(output.signedTransaction)),
|
|
32
|
+
isBundleExecution
|
|
33
|
+
}
|
|
30
34
|
};
|
|
31
35
|
}
|
|
32
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaSignAndExecuteTask.js","names":[],"sources":["../../../../src/core/tasks/SolanaSignAndExecuteTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n getTransactionRequestData,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n withTimeout,\n} from '@lifi/sdk'\nimport { getTransactionCodec } from '@solana/kit'\nimport { SolanaSignTransaction } from '@solana/wallet-standard-features'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport { base64ToUint8Array } from '../../utils/base64ToUint8Array.js'\nimport { getWalletFeature } from '../../utils/getWalletFeature.js'\n\nexport class SolanaSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: SolanaStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n wallet,\n walletAccount,\n statusManager,\n executionOptions,\n isBridgeExecution,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n const transactionRequestData = await getTransactionRequestData(\n step,\n executionOptions\n )\n\n //
|
|
1
|
+
{"version":3,"file":"SolanaSignAndExecuteTask.js","names":[],"sources":["../../../../src/core/tasks/SolanaSignAndExecuteTask.ts"],"sourcesContent":["import {\n BaseStepExecutionTask,\n getTransactionRequestData,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n withTimeout,\n} from '@lifi/sdk'\nimport { getTransactionCodec } from '@solana/kit'\nimport { SolanaSignTransaction } from '@solana/wallet-standard-features'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport { base64ToUint8Array } from '../../utils/base64ToUint8Array.js'\nimport { getWalletFeature } from '../../utils/getWalletFeature.js'\n\nexport class SolanaSignAndExecuteTask extends BaseStepExecutionTask {\n async run(context: SolanaStepExecutorContext): Promise<TaskResult> {\n const {\n step,\n wallet,\n walletAccount,\n statusManager,\n executionOptions,\n isBridgeExecution,\n } = context\n\n const action = statusManager.findAction(\n step,\n isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'\n )\n if (!action) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Action not found.'\n )\n }\n\n const transactionRequestData = (await getTransactionRequestData(\n step,\n executionOptions\n )) as string | string[]\n\n // The backend returns an array when it produced a Jito bundle and a string\n // for a single transaction. The shape determines how we submit it later:\n // array -> sendBundle, string -> sendTransaction.\n const isBundleExecution = Array.isArray(transactionRequestData)\n\n const transactionDataArray = isBundleExecution\n ? transactionRequestData\n : [transactionRequestData]\n\n const transactionBytesArray = transactionDataArray.map((data) =>\n base64ToUint8Array(data)\n )\n\n const signedTransactionOutputs = await withTimeout(\n async () => {\n const { signTransaction } = getWalletFeature(\n wallet,\n SolanaSignTransaction\n )\n // Spread the inputs to sign all transactions at once\n return signTransaction(\n ...transactionBytesArray.map((transaction) => ({\n account: walletAccount,\n transaction,\n }))\n )\n },\n {\n // https://solana.com/docs/advanced/confirmation#transaction-expiration\n // Use 2 minutes to account for fluctuations\n timeout: 120_000,\n errorInstance: new TransactionError(\n LiFiErrorCode.TransactionExpired,\n 'Transaction has expired: blockhash is no longer recent enough.'\n ),\n }\n )\n\n if (signedTransactionOutputs.length === 0) {\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'No signed transaction returned from signer.'\n )\n }\n\n statusManager.updateAction(step, action.type, 'PENDING', {\n signedAt: Date.now(),\n })\n\n const transactionCodec = getTransactionCodec()\n\n // Decode all signed transactions\n const signedTransactions = signedTransactionOutputs.map((output) =>\n transactionCodec.decode(output.signedTransaction)\n )\n\n return {\n status: 'COMPLETED',\n context: { signedTransactions, isBundleExecution },\n }\n }\n}\n"],"mappings":";;;;;;AAcA,IAAa,2BAAb,cAA8C,sBAAsB;CAClE,MAAM,IAAI,SAAyD;EACjE,MAAM,EACJ,MACA,QACA,eACA,eACA,kBACA,sBACE;EAEJ,MAAM,SAAS,cAAc,WAC3B,MACA,oBAAoB,gBAAgB,MACtC;EACA,IAAI,CAAC,QACH,MAAM,IAAI,iBACR,cAAc,uBACd,kDACF;EAGF,MAAM,yBAA0B,MAAM,0BACpC,MACA,gBACF;EAKA,MAAM,oBAAoB,MAAM,QAAQ,sBAAsB;EAM9D,MAAM,yBAJuB,oBACzB,yBACA,CAAC,sBAAsB,EAAA,CAEwB,KAAK,SACtD,mBAAmB,IAAI,CACzB;EAEA,MAAM,2BAA2B,MAAM,YACrC,YAAY;GACV,MAAM,EAAE,oBAAoB,iBAC1B,QACA,qBACF;GAEA,OAAO,gBACL,GAAG,sBAAsB,KAAK,iBAAiB;IAC7C,SAAS;IACT;GACF,EAAE,CACJ;EACF,GACA;GAGE,SAAS;GACT,eAAe,IAAI,iBACjB,cAAc,oBACd,gEACF;EACF,CACF;EAEA,IAAI,yBAAyB,WAAW,GACtC,MAAM,IAAI,iBACR,cAAc,uBACd,6CACF;EAGF,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW,EACvD,UAAU,KAAK,IAAI,EACrB,CAAC;EAED,MAAM,mBAAmB,oBAAoB;EAO7C,OAAO;GACL,QAAQ;GACR,SAAS;IAAE,oBANc,yBAAyB,KAAK,WACvD,iBAAiB,OAAO,OAAO,iBAAiB,CAKpB;IAAG;GAAkB;EACnD;CACF;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/SolanaStandardWaitForTransactionTask.d.ts
|
|
5
4
|
declare class SolanaStandardWaitForTransactionTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaStandardWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaStandardWaitForTransactionTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolanaStandardWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaStandardWaitForTransactionTask.ts"],"mappings":";;;cAYa,6CAA6C;EACxD,IAAU,SAAS,4BAA4B,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/SolanaWaitForTransactionTask.d.ts
|
|
5
4
|
declare class SolanaWaitForTransactionTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaWaitForTransactionTask.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolanaWaitForTransactionTask.d.ts","names":[],"sources":["../../../../src/core/tasks/SolanaWaitForTransactionTask.ts"],"mappings":";;;cAKa,qCAAqC;EAChD,IAAU,SAAS,4BAA4B,QAAQ"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { shouldUseJitoBundle } from "../../utils/shouldUseJitoBundle.js";
|
|
2
1
|
import { SolanaJitoWaitForTransactionTask } from "./SolanaJitoWaitForTransactionTask.js";
|
|
3
2
|
import { SolanaStandardWaitForTransactionTask } from "./SolanaStandardWaitForTransactionTask.js";
|
|
4
3
|
import { BaseStepExecutionTask } from "@lifi/sdk";
|
|
5
4
|
//#region src/core/tasks/SolanaWaitForTransactionTask.ts
|
|
6
5
|
var SolanaWaitForTransactionTask = class extends BaseStepExecutionTask {
|
|
7
6
|
async run(context) {
|
|
8
|
-
|
|
9
|
-
const signedTransactions = contextSignedTransactions ?? [];
|
|
10
|
-
if (shouldUseJitoBundle(client.config.routeOptions, signedTransactions)) return new SolanaJitoWaitForTransactionTask().run(context);
|
|
7
|
+
if (context.isBundleExecution) return new SolanaJitoWaitForTransactionTask().run(context);
|
|
11
8
|
return new SolanaStandardWaitForTransactionTask().run(context);
|
|
12
9
|
}
|
|
13
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaWaitForTransactionTask.js","names":[],"sources":["../../../../src/core/tasks/SolanaWaitForTransactionTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport {
|
|
1
|
+
{"version":3,"file":"SolanaWaitForTransactionTask.js","names":[],"sources":["../../../../src/core/tasks/SolanaWaitForTransactionTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport { SolanaJitoWaitForTransactionTask } from './SolanaJitoWaitForTransactionTask.js'\nimport { SolanaStandardWaitForTransactionTask } from './SolanaStandardWaitForTransactionTask.js'\n\nexport class SolanaWaitForTransactionTask extends BaseStepExecutionTask {\n async run(context: SolanaStepExecutorContext): Promise<TaskResult> {\n // The submission method is determined by the shape of the backend's\n // `transactionRequest.data` (resolved in SolanaSignAndExecuteTask):\n // a bundle (array) must go through `sendBundle`, a single transaction\n // (string) through `sendTransaction`.\n if (context.isBundleExecution) {\n return new SolanaJitoWaitForTransactionTask().run(context)\n }\n return new SolanaStandardWaitForTransactionTask().run(context)\n }\n}\n"],"mappings":";;;;AAKA,IAAa,+BAAb,cAAkD,sBAAsB;CACtE,MAAM,IAAI,SAAyD;EAKjE,IAAI,QAAQ,mBACV,OAAO,IAAI,iCAAiC,CAAC,CAAC,IAAI,OAAO;EAE3D,OAAO,IAAI,qCAAqC,CAAC,CAAC,IAAI,OAAO;CAC/D;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseSolanaErrors.d.ts","names":[],"sources":["../../../src/errors/parseSolanaErrors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseSolanaErrors.d.ts","names":[],"sources":["../../../src/errors/parseSolanaErrors.ts"],"mappings":";;cAWa,oBACX,GAAG,OACH,OAAO,UACP,SAAS,oBACR,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JitoRegion } from "../types.js";
|
|
2
2
|
import { Signature } from "@solana/kit";
|
|
3
|
-
|
|
4
3
|
//#region src/rpc/jito/api/getBundleStatuses.d.ts
|
|
5
4
|
type BundleStatus = {
|
|
6
5
|
bundle_id: string;
|
|
@@ -17,9 +16,9 @@ type GetBundleStatusesResponse = {
|
|
|
17
16
|
};
|
|
18
17
|
type GetBundleStatusesApi = {
|
|
19
18
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
* Returns the status of submitted bundle(s).
|
|
20
|
+
* @see https://www.quicknode.com/docs/solana/getBundleStatuses
|
|
21
|
+
*/
|
|
23
22
|
getBundleStatuses(bundleIds: string[], region?: JitoRegion): GetBundleStatusesResponse;
|
|
24
23
|
};
|
|
25
24
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBundleStatuses.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getBundleStatuses.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBundleStatuses.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getBundleStatuses.ts"],"mappings":";;;KAIK;EACH;EACA,cAAc;EACd;EACA;EACA;;KAGG;EACH;IACE;;EAEF,OAAO;;KAGG;;;;;EAKV,kBAEE,qBAEA,SAAS,aACR"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { JitoRegion } from "../types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/rpc/jito/api/getTipAccounts.d.ts
|
|
4
3
|
/** Array of tip account addresses (Solana public keys) */
|
|
5
4
|
type GetTipAccountsResponse = string[];
|
|
6
5
|
type GetTipAccountsApi = {
|
|
7
6
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
* Fetches the tip accounts designated for tip payments for bundles.
|
|
8
|
+
* Returns an array of 8 tip account addresses that can receive tips for transaction prioritization.
|
|
9
|
+
* @see https://www.quicknode.com/docs/solana/getTipAccounts
|
|
10
|
+
*/
|
|
12
11
|
getTipAccounts(region?: JitoRegion): GetTipAccountsResponse;
|
|
13
12
|
};
|
|
14
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTipAccounts.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getTipAccounts.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTipAccounts.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getTipAccounts.ts"],"mappings":";;;KAGK;KAEO;;;;;;EAMV,eAEE,SAAS,aACR"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { JitoRegion } from "../types.js";
|
|
2
2
|
import { Base64EncodedWireTransaction } from "@solana/kit";
|
|
3
|
-
|
|
4
3
|
//#region src/rpc/jito/api/sendBundle.d.ts
|
|
5
4
|
/** Bundle ID returned on successful submission */
|
|
6
5
|
type SendBundleResponse = string;
|
|
7
6
|
type SendBundleApi = {
|
|
8
7
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
* Submits a bundle of signed transactions (base-64 encoded) to the cluster for atomic processing.
|
|
9
|
+
* If any transaction fails, the entire bundle is rejected.
|
|
10
|
+
* This method relays the bundle to the leader without modifications.
|
|
11
|
+
* If the bundle expires after the next Jito-Solana leader, it returns a success response with a bundle_id,
|
|
12
|
+
* indicating receipt but not guaranteeing processing or on-chain landing.
|
|
13
|
+
* Check the bundle status with getBundleStatuses using the bundle_id.
|
|
14
|
+
*
|
|
15
|
+
* Note: A tip is required for the bundle to be considered. The tip must transfer SOL to one of the 8 tip accounts.
|
|
16
|
+
* @see https://www.quicknode.com/docs/solana/sendBundle
|
|
17
|
+
*/
|
|
19
18
|
sendBundle(transactions: Array<Base64EncodedWireTransaction>, region?: JitoRegion): SendBundleResponse;
|
|
20
19
|
};
|
|
21
20
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/sendBundle.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/sendBundle.ts"],"mappings":";;;;KAKK;KAEO;;;;;;;;;;;;EAYV,WAEE,cAAc,MAAM,+BAEpB,SAAS,aACR"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Base64EncodedWireTransaction } from "@solana/kit";
|
|
2
|
-
|
|
3
2
|
//#region src/rpc/jito/api/simulateBundle.d.ts
|
|
4
3
|
type AccountConfig = {
|
|
5
4
|
accountIndex: number;
|
|
@@ -39,16 +38,21 @@ type SimulateBundleResponse = {
|
|
|
39
38
|
};
|
|
40
39
|
type SimulateBundleApi = {
|
|
41
40
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
* Simulates a Jito bundle - runs simulation on the bundle to check if it will succeed
|
|
42
|
+
* @see https://www.quicknode.com/docs/solana/simulateBundle
|
|
43
|
+
*/
|
|
45
44
|
simulateBundle(params: Readonly<{
|
|
46
45
|
encodedTransactions: Array<Base64EncodedWireTransaction>;
|
|
47
46
|
}>, config?: Readonly<{
|
|
48
|
-
/** Specifies the bank state for simulation */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
/** Specifies the bank state for simulation */
|
|
48
|
+
simulationBank?: string;
|
|
49
|
+
/** Skips signature verification during simulation */
|
|
50
|
+
skipSigVerify?: boolean;
|
|
51
|
+
/** Replaces the recent blockhash in transactions */
|
|
52
|
+
replaceRecentBlockhash?: boolean;
|
|
53
|
+
/** Specifies accounts to inspect before execution */
|
|
54
|
+
preExecutionAccountsConfigs?: AccountConfig[];
|
|
55
|
+
/** Specifies accounts to inspect after execution */
|
|
52
56
|
postExecutionAccountsConfigs?: AccountConfig[];
|
|
53
57
|
}>): SimulateBundleResponse;
|
|
54
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulateBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/simulateBundle.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"simulateBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/simulateBundle.ts"],"mappings":";;KAEK;EACH;EACA;;KAGG;EACH;EACA;EACA;EACA;EACA;;KAGG;EACH;IACE;IACA;;EAEF;IACE;MAAyB;QAAU;QAAgB;;;IACnD,oBAAoB;MAClB;MACA;MACA;MACA;QACE;QACA;;MAEF,sBAAsB;MACtB,uBAAuB;;;;KAKjB;;;;;EAKV,eACE,QAAQ;IACN,qBAAqB,MAAM;MAE7B,SAAS;;IAEP;;IAEA;;IAEA;;IAEA,8BAA8B;;IAE9B,+BAA+B;OAEhC"}
|
|
@@ -3,7 +3,6 @@ import { GetTipAccountsApi } from "./api/getTipAccounts.js";
|
|
|
3
3
|
import { SendBundleApi } from "./api/sendBundle.js";
|
|
4
4
|
import { SimulateBundleApi } from "./api/simulateBundle.js";
|
|
5
5
|
import { ClusterUrl, Rpc, RpcTransport, SolanaRpcApi, createDefaultRpcTransport } from "@solana/kit";
|
|
6
|
-
|
|
7
6
|
//#region src/rpc/jito/createJitoRpc.d.ts
|
|
8
7
|
type JitoBundleApi = GetBundleStatusesApi & GetTipAccountsApi & SendBundleApi & SimulateBundleApi;
|
|
9
8
|
type JitoRpcApi = JitoBundleApi & SolanaRpcApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createJitoRpc.d.ts","names":[],"sources":["../../../../src/rpc/jito/createJitoRpc.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createJitoRpc.d.ts","names":[],"sources":["../../../../src/rpc/jito/createJitoRpc.ts"],"mappings":";;;;;;KAeY,gBAAgB,uBAC1B,oBACA,gBACA;KAGU,aAAa,gBAAgB;iBAQzB,2BAA2B,mBAAmB,cAC5D,WAAW,aACV,IAAI;iBAQS,cAAc,oBAAoB,YAChD,YAAY,aACZ,SAAS,KACP,kBAAkB,0BAA0B,2BAG7C,IAAI"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/rpc/jito/types.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Available Jito regions for routing requests.
|
|
4
|
-
*/
|
|
3
|
+
* Available Jito regions for routing requests.
|
|
4
|
+
*/
|
|
5
5
|
type JitoRegion = "mainnet" | "amsterdam" | "frankfurt" | "ny" | "tokyo" | "slc" | "london" | "singapore";
|
|
6
6
|
//#endregion
|
|
7
7
|
export { JitoRegion };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/rpc/jito/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/rpc/jito/types.ts"],"mappings":";;;;KAGY"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { JitoRpcType, SolanaRpcType } from "./types.js";
|
|
2
2
|
import { SDKClient } from "@lifi/sdk";
|
|
3
|
-
|
|
4
3
|
//#region src/rpc/registry.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Checks if an RPC URL supports Jito methods by calling
|
|
7
|
-
|
|
5
|
+
* Checks if an RPC URL supports Jito methods by calling getBundleStatuses.
|
|
6
|
+
* We probe with getBundleStatuses (rather than getTipAccounts) because it is the
|
|
7
|
+
* method actually used during bundle confirmation, and providers such as Helius
|
|
8
|
+
* support sendBundle/getBundleStatuses without exposing getTipAccounts.
|
|
9
|
+
*/
|
|
8
10
|
declare const isJitoRpc: (rpcUrl: string) => Promise<boolean>;
|
|
9
11
|
/**
|
|
10
|
-
* Wrapper around getting the Solana RPCs
|
|
11
|
-
* @returns - Solana RPCs
|
|
12
|
-
*/
|
|
12
|
+
* Wrapper around getting the Solana RPCs
|
|
13
|
+
* @returns - Solana RPCs
|
|
14
|
+
*/
|
|
13
15
|
declare const getSolanaRpcs: (client: SDKClient) => Promise<SolanaRpcType[]>;
|
|
14
16
|
/**
|
|
15
|
-
* Wrapper around getting the Jito RPCs
|
|
16
|
-
* @returns - Jito RPCs
|
|
17
|
-
*/
|
|
17
|
+
* Wrapper around getting the Jito RPCs
|
|
18
|
+
* @returns - Jito RPCs
|
|
19
|
+
*/
|
|
18
20
|
declare const getJitoRpcs: (client: SDKClient) => Promise<JitoRpcType[]>;
|
|
19
21
|
//#endregion
|
|
20
22
|
export { getJitoRpcs, getSolanaRpcs, isJitoRpc };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","names":[],"sources":["../../../src/rpc/registry.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","names":[],"sources":["../../../src/rpc/registry.ts"],"mappings":";;;;;;;;;cA2Ba,YAAmB,mBAAiB;;;;;cA0CpC,gBACX,QAAQ,cACP,QAAQ;;;;;cAWE,cACX,QAAQ,cACP,QAAQ"}
|