@lifi/sdk-provider-solana 4.1.2 → 4.2.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/CHANGELOG.md +17 -0
- package/dist/cjs/SolanaProvider.d.ts +1 -2
- package/dist/cjs/SolanaProvider.js +1 -0
- package/dist/cjs/SolanaProvider.js.map +1 -1
- package/dist/cjs/actions/getSNSAddress.d.ts +1 -2
- package/dist/cjs/actions/getSolanaBalance.d.ts +1 -2
- package/dist/cjs/actions/resolveSolanaAddress.d.ts +1 -2
- package/dist/cjs/actions/sendAndConfirmBundle.d.ts +1 -2
- package/dist/cjs/actions/sendAndConfirmTransaction.d.ts +1 -2
- package/dist/cjs/confirmation/abortableSleep.d.ts +1 -2
- package/dist/cjs/confirmation/confirmBundle.d.ts +3 -4
- package/dist/cjs/confirmation/confirmSignature.d.ts +2 -3
- package/dist/cjs/confirmation/createConfirmationDeadline.d.ts +10 -11
- package/dist/cjs/confirmation/pollUntilDeadline.d.ts +4 -5
- package/dist/cjs/confirmation/raceRpcs.d.ts +2 -3
- package/dist/cjs/confirmation/types.d.ts +3 -4
- package/dist/cjs/core/SolanaStepExecutor.d.ts +1 -2
- package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +1 -2
- package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.d.ts +1 -2
- package/dist/cjs/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +1 -2
- package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.d.ts +1 -2
- package/dist/cjs/core/tasks/readSignature.d.ts +1 -2
- package/dist/cjs/core/tasks/unwrapConfirmation.d.ts +2 -3
- package/dist/cjs/errors/parseSolanaErrors.d.ts +1 -2
- package/dist/cjs/rpc/jito/api/getBundleStatuses.d.ts +1 -2
- package/dist/cjs/rpc/jito/api/getTipAccounts.d.ts +1 -2
- package/dist/cjs/rpc/jito/api/sendBundle.d.ts +1 -2
- package/dist/cjs/rpc/jito/api/simulateBundle.d.ts +1 -2
- package/dist/cjs/rpc/jito/createJitoRpc.d.ts +4 -5
- package/dist/cjs/rpc/jito/types.d.ts +1 -2
- package/dist/cjs/rpc/registry.d.ts +7 -8
- package/dist/cjs/rpc/types.d.ts +2 -3
- package/dist/cjs/rpc/utils.d.ts +3 -4
- package/dist/cjs/types.d.ts +6 -7
- package/dist/cjs/utils/KeypairWallet.unit.helpers.d.ts +1 -2
- package/dist/cjs/utils/KeypairWalletAdapter.d.ts +1 -2
- package/dist/cjs/utils/base64ToUint8Array.d.ts +1 -2
- package/dist/cjs/utils/getTransactionLifetime.d.ts +2 -3
- package/dist/cjs/utils/getWalletFeature.d.ts +1 -2
- package/dist/cjs/utils/solanaErrorCause.d.ts +2 -3
- package/dist/cjs/version.d.ts +2 -3
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/SolanaProvider.d.ts +1 -2
- package/dist/esm/SolanaProvider.d.ts.map +1 -1
- package/dist/esm/SolanaProvider.js +1 -0
- package/dist/esm/SolanaProvider.js.map +1 -1
- package/dist/esm/actions/getSNSAddress.d.ts +1 -2
- package/dist/esm/actions/getSNSAddress.d.ts.map +1 -1
- package/dist/esm/actions/getSolanaBalance.d.ts +1 -2
- package/dist/esm/actions/getSolanaBalance.d.ts.map +1 -1
- package/dist/esm/actions/resolveSolanaAddress.d.ts +1 -2
- package/dist/esm/actions/resolveSolanaAddress.d.ts.map +1 -1
- package/dist/esm/actions/sendAndConfirmBundle.d.ts +1 -2
- package/dist/esm/actions/sendAndConfirmBundle.d.ts.map +1 -1
- package/dist/esm/actions/sendAndConfirmTransaction.d.ts +1 -2
- package/dist/esm/actions/sendAndConfirmTransaction.d.ts.map +1 -1
- package/dist/esm/confirmation/abortableSleep.d.ts +1 -2
- package/dist/esm/confirmation/abortableSleep.d.ts.map +1 -1
- package/dist/esm/confirmation/confirmBundle.d.ts +3 -4
- package/dist/esm/confirmation/confirmBundle.d.ts.map +1 -1
- package/dist/esm/confirmation/confirmSignature.d.ts +2 -3
- package/dist/esm/confirmation/confirmSignature.d.ts.map +1 -1
- package/dist/esm/confirmation/createConfirmationDeadline.d.ts +10 -11
- package/dist/esm/confirmation/createConfirmationDeadline.d.ts.map +1 -1
- package/dist/esm/confirmation/pollUntilDeadline.d.ts +4 -5
- package/dist/esm/confirmation/pollUntilDeadline.d.ts.map +1 -1
- package/dist/esm/confirmation/raceRpcs.d.ts +2 -3
- package/dist/esm/confirmation/raceRpcs.d.ts.map +1 -1
- package/dist/esm/confirmation/types.d.ts +3 -4
- package/dist/esm/confirmation/types.d.ts.map +1 -1
- package/dist/esm/core/SolanaStepExecutor.d.ts +1 -2
- package/dist/esm/core/SolanaStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +1 -2
- package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts +1 -2
- package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +1 -2
- package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts +1 -2
- package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/readSignature.d.ts +1 -2
- package/dist/esm/core/tasks/readSignature.d.ts.map +1 -1
- package/dist/esm/core/tasks/unwrapConfirmation.d.ts +2 -3
- package/dist/esm/core/tasks/unwrapConfirmation.d.ts.map +1 -1
- package/dist/esm/errors/parseSolanaErrors.d.ts +1 -2
- package/dist/esm/errors/parseSolanaErrors.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts +1 -2
- package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/getTipAccounts.d.ts +1 -2
- package/dist/esm/rpc/jito/api/getTipAccounts.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/sendBundle.d.ts +1 -2
- package/dist/esm/rpc/jito/api/sendBundle.d.ts.map +1 -1
- package/dist/esm/rpc/jito/api/simulateBundle.d.ts +1 -2
- package/dist/esm/rpc/jito/api/simulateBundle.d.ts.map +1 -1
- package/dist/esm/rpc/jito/createJitoRpc.d.ts +4 -5
- package/dist/esm/rpc/jito/createJitoRpc.d.ts.map +1 -1
- package/dist/esm/rpc/jito/types.d.ts +1 -2
- package/dist/esm/rpc/jito/types.d.ts.map +1 -1
- package/dist/esm/rpc/registry.d.ts +7 -8
- package/dist/esm/rpc/registry.d.ts.map +1 -1
- package/dist/esm/rpc/types.d.ts +2 -3
- package/dist/esm/rpc/types.d.ts.map +1 -1
- package/dist/esm/rpc/utils.d.ts +3 -4
- package/dist/esm/rpc/utils.d.ts.map +1 -1
- package/dist/esm/types.d.ts +6 -7
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/utils/KeypairWallet.unit.helpers.d.ts +1 -2
- package/dist/esm/utils/KeypairWallet.unit.helpers.d.ts.map +1 -1
- package/dist/esm/utils/KeypairWalletAdapter.d.ts +1 -2
- package/dist/esm/utils/KeypairWalletAdapter.d.ts.map +1 -1
- package/dist/esm/utils/base64ToUint8Array.d.ts +1 -2
- package/dist/esm/utils/base64ToUint8Array.d.ts.map +1 -1
- package/dist/esm/utils/getTransactionLifetime.d.ts +2 -3
- package/dist/esm/utils/getTransactionLifetime.d.ts.map +1 -1
- package/dist/esm/utils/getWalletFeature.d.ts +1 -2
- package/dist/esm/utils/getWalletFeature.d.ts.map +1 -1
- package/dist/esm/utils/solanaErrorCause.d.ts +2 -3
- package/dist/esm/utils/solanaErrorCause.d.ts.map +1 -1
- package/dist/esm/version.d.ts +2 -3
- 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 +3 -3
- package/src/SolanaProvider.ts +1 -0
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @lifi/sdk-provider-solana
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#471](https://github.com/lifinance/sdk/pull/471) [`a57b439`](https://github.com/lifinance/sdk/commit/a57b4391b52d9bc535577dcbfad1523ab4d2e32f) Thanks [@chybisov](https://github.com/chybisov)! - Add optional `SDKProvider.isTokenAddress`, so callers can validate a token identifier without knowing how each ecosystem shapes one: `C…` contract ids on Stellar, `0x…::module::TYPE` coin types on Sui, an address in any letter case on Ethereum, and the wallet format on Solana and Tron. `BitcoinProvider` omits the method, because the token list names its native coin `bitcoin` rather than giving it an address. A missing method means the ecosystem has no token address format, so a caller must not fall back to `isAddress`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`d7d8abb`](https://github.com/lifinance/sdk/commit/d7d8abb776aa943aafda62d17926b8575f770478), [`a57b439`](https://github.com/lifinance/sdk/commit/a57b4391b52d9bc535577dcbfad1523ab4d2e32f)]:
|
|
12
|
+
- @lifi/sdk@4.7.0
|
|
13
|
+
|
|
14
|
+
## 4.1.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#460](https://github.com/lifinance/sdk/pull/460) [`44a83e8`](https://github.com/lifinance/sdk/commit/44a83e80cd4b4145b45c5b41b09a17cb6382cc3d) Thanks [@chybisov](https://github.com/chybisov)! - Bump runtime dependencies: `@solana/kit` to 8.2.0, `@mysten/sui` to 2.27.1.
|
|
19
|
+
|
|
3
20
|
## 4.1.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SolanaProviderOptions, SolanaSDKProvider } from "./types.js";
|
|
2
2
|
//#region src/SolanaProvider.d.ts
|
|
3
|
-
declare function SolanaProvider(options?: SolanaProviderOptions): SolanaSDKProvider;
|
|
3
|
+
export declare function SolanaProvider(options?: SolanaProviderOptions): SolanaSDKProvider;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { SolanaProvider };
|
|
6
5
|
//# sourceMappingURL=SolanaProvider.d.ts.map
|
|
@@ -12,6 +12,7 @@ function SolanaProvider(options) {
|
|
|
12
12
|
return _lifi_sdk.ChainType.SVM;
|
|
13
13
|
},
|
|
14
14
|
isAddress: _solana_kit.isAddress,
|
|
15
|
+
isTokenAddress: _solana_kit.isAddress,
|
|
15
16
|
resolveAddress: require_actions_resolveSolanaAddress.resolveSolanaAddress,
|
|
16
17
|
getBalance: require_actions_getSolanaBalance.getSolanaBalance,
|
|
17
18
|
async getStepExecutor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaProvider.js","names":["ChainType","resolveSolanaAddress","getSolanaBalance","ProviderError","LiFiErrorCode","SolanaStepExecutor"],"sources":["../../src/SolanaProvider.ts"],"sourcesContent":["import {\n ChainType,\n LiFiErrorCode,\n ProviderError,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport { isAddress } from '@solana/kit'\nimport { getSolanaBalance } from './actions/getSolanaBalance.js'\nimport { resolveSolanaAddress } from './actions/resolveSolanaAddress.js'\nimport { SolanaStepExecutor } from './core/SolanaStepExecutor.js'\nimport type { SolanaProviderOptions, SolanaSDKProvider } from './types.js'\n\nexport function SolanaProvider(\n options?: SolanaProviderOptions\n): SolanaSDKProvider {\n const _options: SolanaProviderOptions = options ?? {}\n return {\n get type() {\n return ChainType.SVM\n },\n isAddress,\n resolveAddress: resolveSolanaAddress,\n getBalance: getSolanaBalance,\n async getStepExecutor(\n options: StepExecutorOptions\n ): Promise<SolanaStepExecutor> {\n if (!_options.getWallet) {\n throw new ProviderError(\n LiFiErrorCode.ConfigError,\n 'SolanaProvider requires a getWallet function'\n )\n }\n\n const wallet = await _options.getWallet()\n\n const executor = new SolanaStepExecutor({\n wallet,\n routeId: options.routeId,\n skipSimulation: _options.skipSimulation,\n executionOptions: {\n ...options.executionOptions,\n },\n })\n\n return executor\n },\n setOptions(options: SolanaProviderOptions) {\n Object.assign(_options, options)\n },\n }\n}\n"],"mappings":";;;;;;;AAYA,SAAgB,eACd,SACmB;CACnB,MAAM,WAAkC,WAAW,CAAC;CACpD,OAAO;EACL,IAAI,OAAO;GACT,OAAOA,UAAAA,UAAU;EACnB;EACA,WAAA,YAAA;EACA,gBAAgBC,qCAAAA;EAChB,YAAYC,iCAAAA;EACZ,MAAM,gBACJ,SAC6B;GAC7B,IAAI,CAAC,SAAS,WACZ,MAAM,IAAIC,UAAAA,cACRC,UAAAA,cAAc,aACd,8CACF;GAGF,MAAM,SAAS,MAAM,SAAS,UAAU;GAWxC,OAAO,IATcC,gCAAAA,mBAAmB;IACtC;IACA,SAAS,QAAQ;IACjB,gBAAgB,SAAS;IACzB,kBAAkB,EAChB,GAAG,QAAQ,iBACb;GACF,CAEc;EAChB;EACA,WAAW,SAAgC;GACzC,OAAO,OAAO,UAAU,OAAO;EACjC;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"SolanaProvider.js","names":["ChainType","isAddress","resolveSolanaAddress","getSolanaBalance","ProviderError","LiFiErrorCode","SolanaStepExecutor"],"sources":["../../src/SolanaProvider.ts"],"sourcesContent":["import {\n ChainType,\n LiFiErrorCode,\n ProviderError,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport { isAddress } from '@solana/kit'\nimport { getSolanaBalance } from './actions/getSolanaBalance.js'\nimport { resolveSolanaAddress } from './actions/resolveSolanaAddress.js'\nimport { SolanaStepExecutor } from './core/SolanaStepExecutor.js'\nimport type { SolanaProviderOptions, SolanaSDKProvider } from './types.js'\n\nexport function SolanaProvider(\n options?: SolanaProviderOptions\n): SolanaSDKProvider {\n const _options: SolanaProviderOptions = options ?? {}\n return {\n get type() {\n return ChainType.SVM\n },\n isAddress,\n isTokenAddress: isAddress,\n resolveAddress: resolveSolanaAddress,\n getBalance: getSolanaBalance,\n async getStepExecutor(\n options: StepExecutorOptions\n ): Promise<SolanaStepExecutor> {\n if (!_options.getWallet) {\n throw new ProviderError(\n LiFiErrorCode.ConfigError,\n 'SolanaProvider requires a getWallet function'\n )\n }\n\n const wallet = await _options.getWallet()\n\n const executor = new SolanaStepExecutor({\n wallet,\n routeId: options.routeId,\n skipSimulation: _options.skipSimulation,\n executionOptions: {\n ...options.executionOptions,\n },\n })\n\n return executor\n },\n setOptions(options: SolanaProviderOptions) {\n Object.assign(_options, options)\n },\n }\n}\n"],"mappings":";;;;;;;AAYA,SAAgB,eACd,SACmB;CACnB,MAAM,WAAkC,WAAW,CAAC;CACpD,OAAO;EACL,IAAI,OAAO;GACT,OAAOA,UAAAA,UAAU;EACnB;EACA,WAAA,YAAA;EACA,gBAAgBC,YAAAA;EAChB,gBAAgBC,qCAAAA;EAChB,YAAYC,iCAAAA;EACZ,MAAM,gBACJ,SAC6B;GAC7B,IAAI,CAAC,SAAS,WACZ,MAAM,IAAIC,UAAAA,cACRC,UAAAA,cAAc,aACd,8CACF;GAGF,MAAM,SAAS,MAAM,SAAS,UAAU;GAWxC,OAAO,IATcC,gCAAAA,mBAAmB;IACtC;IACA,SAAS,QAAQ;IACjB,gBAAgB,SAAS;IACzB,kBAAkB,EAChB,GAAG,QAAQ,iBACb;GACF,CAEc;EAChB;EACA,WAAW,SAAgC;GACzC,OAAO,OAAO,UAAU,OAAO;EACjC;CACF;AACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/actions/getSNSAddress.d.ts
|
|
2
|
-
declare const getSNSAddress: (name: string) => Promise<string | undefined>;
|
|
2
|
+
export declare const getSNSAddress: (name: string) => Promise<string | undefined>;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { getSNSAddress };
|
|
5
4
|
//# sourceMappingURL=getSNSAddress.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SDKClient, Token, TokenAmount } from "@lifi/sdk";
|
|
2
2
|
//#region src/actions/getSolanaBalance.d.ts
|
|
3
|
-
declare const getSolanaBalance: (client: SDKClient, walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
3
|
+
export declare const getSolanaBalance: (client: SDKClient, walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { getSolanaBalance };
|
|
6
5
|
//# sourceMappingURL=getSolanaBalance.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/actions/resolveSolanaAddress.d.ts
|
|
2
|
-
declare function resolveSolanaAddress(name: string): Promise<string | undefined>;
|
|
2
|
+
export declare function resolveSolanaAddress(name: string): Promise<string | undefined>;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { resolveSolanaAddress };
|
|
5
4
|
//# sourceMappingURL=resolveSolanaAddress.d.ts.map
|
|
@@ -15,10 +15,9 @@ import { Transaction } from "@solana/kit";
|
|
|
15
15
|
* deadline starts on the same clock as `BRANCH_TIMEOUT_MS` instead of after
|
|
16
16
|
* the submission returns.
|
|
17
17
|
*/
|
|
18
|
-
declare function sendAndConfirmBundle(client: SDKClient, signedTransactions: Transaction[], options?: {
|
|
18
|
+
export declare function sendAndConfirmBundle(client: SDKClient, signedTransactions: Transaction[], options?: {
|
|
19
19
|
/** Runs once, when the first Jito RPC accepts the submission. */
|
|
20
20
|
onBroadcast?: () => void;
|
|
21
21
|
}): Promise<RaceResult<BundleConfirmation>>;
|
|
22
22
|
//#endregion
|
|
23
|
-
export { sendAndConfirmBundle };
|
|
24
23
|
//# sourceMappingURL=sendAndConfirmBundle.d.ts.map
|
|
@@ -12,10 +12,9 @@ import { Transaction } from "@solana/kit";
|
|
|
12
12
|
* least one endpoint in the default LI.FI set answers that call with the slot
|
|
13
13
|
* number.
|
|
14
14
|
*/
|
|
15
|
-
declare function sendAndConfirmTransaction(client: SDKClient, signedTransaction: Transaction, options?: {
|
|
15
|
+
export declare function sendAndConfirmTransaction(client: SDKClient, signedTransaction: Transaction, options?: {
|
|
16
16
|
/** Runs once, when the first RPC accepts a send. */
|
|
17
17
|
onBroadcast?: () => void;
|
|
18
18
|
}): Promise<RaceResult<SignatureStatus>>;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { sendAndConfirmTransaction };
|
|
21
20
|
//# sourceMappingURL=sendAndConfirmTransaction.d.ts.map
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* through their own loop condition, so a rejection here would only add a
|
|
14
14
|
* catch to every call site.
|
|
15
15
|
*/
|
|
16
|
-
declare function abortableSleep(ms: number, signal: AbortSignal): Promise<void>;
|
|
16
|
+
export declare function abortableSleep(ms: number, signal: AbortSignal): Promise<void>;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { abortableSleep };
|
|
19
18
|
//# sourceMappingURL=abortableSleep.d.ts.map
|
|
@@ -6,8 +6,8 @@ import { Signature } from "@solana/kit";
|
|
|
6
6
|
/** Slower than the signature poller's 400 ms: Jito documents 1 req/s per IP
|
|
7
7
|
* per region. At 2 s this holds 0.5 req/s, leaving room for the deadline's
|
|
8
8
|
* blockhash probes on the same endpoint. */
|
|
9
|
-
declare const BUNDLE_POLL_INTERVAL_MS = 2e3;
|
|
10
|
-
type BundleConfirmation = {
|
|
9
|
+
export declare const BUNDLE_POLL_INTERVAL_MS = 2e3;
|
|
10
|
+
export type BundleConfirmation = {
|
|
11
11
|
/** The submission's own id, carried for diagnostics. */
|
|
12
12
|
bundleId: string;
|
|
13
13
|
/** Never read for a `txHash` - its order is Jito's to choose. Kept so the
|
|
@@ -25,7 +25,7 @@ type BundleConfirmation = {
|
|
|
25
25
|
* deadline starts before submission rather than after it. A `send` failure
|
|
26
26
|
* throws, which `raceRpcs` buckets as `rpc-unavailable`.
|
|
27
27
|
*/
|
|
28
|
-
declare function confirmBundle(options: {
|
|
28
|
+
export declare function confirmBundle(options: {
|
|
29
29
|
rpc: JitoRpcType;
|
|
30
30
|
signal: AbortSignal;
|
|
31
31
|
lifetimes: TransactionLifetime[];
|
|
@@ -39,5 +39,4 @@ declare function confirmBundle(options: {
|
|
|
39
39
|
onBroadcast?: () => void;
|
|
40
40
|
}): Promise<ConfirmationOutcome<BundleConfirmation>>;
|
|
41
41
|
//#endregion
|
|
42
|
-
export { BUNDLE_POLL_INTERVAL_MS, BundleConfirmation, confirmBundle };
|
|
43
42
|
//# sourceMappingURL=confirmBundle.d.ts.map
|
|
@@ -8,10 +8,10 @@ import { Signature } from "@solana/kit";
|
|
|
8
8
|
* RPCs tolerate 2.5 req/s of status reads; the Jito bundle poller runs slower
|
|
9
9
|
* because its endpoints do not (see `confirmBundle`).
|
|
10
10
|
*/
|
|
11
|
-
declare const SIGNATURE_POLL_INTERVAL_MS = 400;
|
|
11
|
+
export declare const SIGNATURE_POLL_INTERVAL_MS = 400;
|
|
12
12
|
/** Confirms one transaction against one RPC. Holds no policy: the deadline
|
|
13
13
|
* decides when to stop, and the resend loop only observes an `AbortSignal`. */
|
|
14
|
-
declare function confirmSignature(options: {
|
|
14
|
+
export declare function confirmSignature(options: {
|
|
15
15
|
rpc: SolanaRpcType;
|
|
16
16
|
signal: AbortSignal;
|
|
17
17
|
signature: Signature;
|
|
@@ -25,5 +25,4 @@ declare function confirmSignature(options: {
|
|
|
25
25
|
onBroadcast?: () => void;
|
|
26
26
|
}): Promise<ConfirmationOutcome<SignatureStatus>>;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { SIGNATURE_POLL_INTERVAL_MS, confirmSignature };
|
|
29
28
|
//# sourceMappingURL=confirmSignature.d.ts.map
|
|
@@ -3,31 +3,31 @@ import { TransactionLifetime } from "../utils/getTransactionLifetime.js";
|
|
|
3
3
|
//#region src/confirmation/createConfirmationDeadline.d.ts
|
|
4
4
|
/** Give-up point for a branch's polling. Read between iterations only, so a
|
|
5
5
|
* hung RPC call needs `BRANCH_TIMEOUT_MS` to close the gap. */
|
|
6
|
-
declare const CONFIRMATION_TIMEOUT_MS = 9e4;
|
|
6
|
+
export declare const CONFIRMATION_TIMEOUT_MS = 9e4;
|
|
7
7
|
/** Head-room for the final probe after the deadline.
|
|
8
8
|
* `STATUS_RETRY_BACKOFF_CAP_MS` must stay below it. */
|
|
9
|
-
declare const FINAL_PROBE_MARGIN_MS = 5e3;
|
|
9
|
+
export declare const FINAL_PROBE_MARGIN_MS = 5e3;
|
|
10
10
|
/** Hard bound on a branch, in-flight requests included. Above the ceiling so
|
|
11
11
|
* an abort cannot pre-empt the final probe. */
|
|
12
|
-
declare const BRANCH_TIMEOUT_MS: number;
|
|
12
|
+
export declare const BRANCH_TIMEOUT_MS: number;
|
|
13
13
|
/** How long a healthy-but-lagging node may need to catch up. A premise, not a
|
|
14
14
|
* knob: `isBlockhashValid` answers `false` for lag and for death alike, so no
|
|
15
15
|
* verdict may land inside this window. */
|
|
16
|
-
declare const NODE_LAG_WINDOW_MS = 12e3;
|
|
16
|
+
export declare const NODE_LAG_WINDOW_MS = 12e3;
|
|
17
17
|
/** Gap between `isBlockhashValid` probes. Spacing them is what makes the
|
|
18
18
|
* consecutive-`false` rule meaningful: quantized to the 400 ms tick, probes
|
|
19
19
|
* land at 0.4/7.6/14.8 s, so no verdict lands inside `NODE_LAG_WINDOW_MS`. */
|
|
20
|
-
declare const EXPIRY_PROBE_INTERVAL_MS = 7e3;
|
|
20
|
+
export declare const EXPIRY_PROBE_INTERVAL_MS = 7e3;
|
|
21
21
|
/** Consecutive `false` results before a blockhash is believed dead. Derived so
|
|
22
22
|
* a change to either premise moves it automatically; `+ 2` keeps the
|
|
23
23
|
* inequality strict when the window divides exactly. */
|
|
24
|
-
declare const EXPIRY_CONFIRMATIONS: number;
|
|
24
|
+
export declare const EXPIRY_CONFIRMATIONS: number;
|
|
25
25
|
/** Probe failures per blockhash before that blockhash stops being probed.
|
|
26
26
|
* Prober-only; the status pollers have `MAX_STATUS_READ_SILENCE_MS`. */
|
|
27
|
-
declare const MAX_PROBE_ERRORS = 5;
|
|
27
|
+
export declare const MAX_PROBE_ERRORS = 5;
|
|
28
28
|
/** Structural, so one implementation serves both the Solana and Jito RPC. */
|
|
29
|
-
type BlockhashProbeRpc = Pick<SolanaRpcType, "isBlockhashValid">;
|
|
30
|
-
interface ConfirmationDeadline {
|
|
29
|
+
export type BlockhashProbeRpc = Pick<SolanaRpcType, "isBlockhashValid">;
|
|
30
|
+
export interface ConfirmationDeadline {
|
|
31
31
|
/** Checked at the top of every poll iteration. */
|
|
32
32
|
reached(): boolean;
|
|
33
33
|
/** Advances the policy; never throws. Probes at most once per
|
|
@@ -41,11 +41,10 @@ interface ConfirmationDeadline {
|
|
|
41
41
|
* the slot number, making any `lastValidBlockHeight` comparison false on its
|
|
42
42
|
* first evaluation.
|
|
43
43
|
*/
|
|
44
|
-
declare function createConfirmationDeadline(options: {
|
|
44
|
+
export declare function createConfirmationDeadline(options: {
|
|
45
45
|
lifetimes: TransactionLifetime[];
|
|
46
46
|
rpc: BlockhashProbeRpc;
|
|
47
47
|
now?: () => number;
|
|
48
48
|
}): ConfirmationDeadline;
|
|
49
49
|
//#endregion
|
|
50
|
-
export { BRANCH_TIMEOUT_MS, BlockhashProbeRpc, CONFIRMATION_TIMEOUT_MS, ConfirmationDeadline, EXPIRY_CONFIRMATIONS, EXPIRY_PROBE_INTERVAL_MS, FINAL_PROBE_MARGIN_MS, MAX_PROBE_ERRORS, NODE_LAG_WINDOW_MS, createConfirmationDeadline };
|
|
51
50
|
//# sourceMappingURL=createConfirmationDeadline.d.ts.map
|
|
@@ -3,13 +3,13 @@ import { ConfirmationDeadline } from "./createConfirmationDeadline.js";
|
|
|
3
3
|
//#region src/confirmation/pollUntilDeadline.d.ts
|
|
4
4
|
/** Cadence of the detached deadline-advance loop. Independent of the
|
|
5
5
|
* status-poll interval, which each caller sets for its own rate limits. */
|
|
6
|
-
declare const DEADLINE_TICK_INTERVAL_MS = 400;
|
|
6
|
+
export declare const DEADLINE_TICK_INTERVAL_MS = 400;
|
|
7
7
|
/** How long an endpoint may go without answering a status read before its
|
|
8
8
|
* branch gives up. Measured in wall-clock time, not in failures: a count is
|
|
9
9
|
* coupled to the backoff curve, and ten failures spanned only ~16.4 s, so a
|
|
10
10
|
* routine 20 s throttling window ended the branch 74 s inside the 90 s ceiling
|
|
11
11
|
* and reported an already-broadcast transaction as an outage. */
|
|
12
|
-
declare const MAX_STATUS_READ_SILENCE_MS = 3e4;
|
|
12
|
+
export declare const MAX_STATUS_READ_SILENCE_MS = 3e4;
|
|
13
13
|
/** Ceiling on one backoff sleep. Squeezed between two bounds:
|
|
14
14
|
* - Above `BUNDLE_POLL_INTERVAL_MS`, the largest base interval any caller
|
|
15
15
|
* uses. At 2 s the two were equal, so `Math.max(pollIntervalMs, ...)` below
|
|
@@ -26,7 +26,7 @@ declare const MAX_STATUS_READ_SILENCE_MS = 3e4;
|
|
|
26
26
|
* backoff is a single step rather than a curve. Widening it means raising
|
|
27
27
|
* `FINAL_PROBE_MARGIN_MS`, which lengthens the branch bound the SDK
|
|
28
28
|
* documents. */
|
|
29
|
-
declare const STATUS_RETRY_BACKOFF_CAP_MS = 3e3;
|
|
29
|
+
export declare const STATUS_RETRY_BACKOFF_CAP_MS = 3e3;
|
|
30
30
|
/**
|
|
31
31
|
* Polls one probe against one RPC until the deadline, and owns the verdict
|
|
32
32
|
* rules shared by the signature and bundle branches.
|
|
@@ -35,7 +35,7 @@ declare const STATUS_RETRY_BACKOFF_CAP_MS = 3e3;
|
|
|
35
35
|
* nothing", and rejects for a failed read. The deadline advances on a detached
|
|
36
36
|
* loop so a hung blockhash probe cannot stop status polling.
|
|
37
37
|
*/
|
|
38
|
-
declare function pollUntilDeadline<T>(options: {
|
|
38
|
+
export declare function pollUntilDeadline<T>(options: {
|
|
39
39
|
deadline: ConfirmationDeadline;
|
|
40
40
|
signal: AbortSignal;
|
|
41
41
|
/** Sleep between two status reads that answered. */
|
|
@@ -54,5 +54,4 @@ declare function pollUntilDeadline<T>(options: {
|
|
|
54
54
|
now?: () => number;
|
|
55
55
|
}): Promise<ConfirmationOutcome<T>>;
|
|
56
56
|
//#endregion
|
|
57
|
-
export { DEADLINE_TICK_INTERVAL_MS, MAX_STATUS_READ_SILENCE_MS, STATUS_RETRY_BACKOFF_CAP_MS, pollUntilDeadline };
|
|
58
57
|
//# sourceMappingURL=pollUntilDeadline.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfirmationOutcome } from "./types.js";
|
|
2
2
|
//#region src/confirmation/raceRpcs.d.ts
|
|
3
|
-
type RaceResult<T> = {
|
|
3
|
+
export type RaceResult<T> = {
|
|
4
4
|
kind: "confirmed";
|
|
5
5
|
value: T;
|
|
6
6
|
} | {
|
|
@@ -18,9 +18,8 @@ type RaceResult<T> = {
|
|
|
18
18
|
* never answered - the defect that reported live swaps as `TransactionExpired`.
|
|
19
19
|
* `timeoutMs` is the caller's; this module holds no confirmation policy.
|
|
20
20
|
*/
|
|
21
|
-
declare function raceRpcs<Rpc, T>(rpcs: Rpc[], run: (rpc: Rpc, signal: AbortSignal) => Promise<ConfirmationOutcome<T>>, options: {
|
|
21
|
+
export declare function raceRpcs<Rpc, T>(rpcs: Rpc[], run: (rpc: Rpc, signal: AbortSignal) => Promise<ConfirmationOutcome<T>>, options: {
|
|
22
22
|
timeoutMs: number;
|
|
23
23
|
}): Promise<RaceResult<T>>;
|
|
24
24
|
//#endregion
|
|
25
|
-
export { RaceResult, raceRpcs };
|
|
26
25
|
//# sourceMappingURL=raceRpcs.d.ts.map
|
|
@@ -4,15 +4,14 @@ import { Commitment } from "@solana/kit";
|
|
|
4
4
|
type SignatureStatusesResponse = Awaited<ReturnType<ReturnType<SolanaRpcType["getSignatureStatuses"]>["send"]>>;
|
|
5
5
|
/** Derived from the RPC type rather than hand-written, which removes every
|
|
6
6
|
* `as SignatureStatus` cast. A `JitoRpcType` response assigns without one. */
|
|
7
|
-
type SignatureStatus = NonNullable<SignatureStatusesResponse["value"][number]>;
|
|
7
|
+
export type SignatureStatus = NonNullable<SignatureStatusesResponse["value"][number]>;
|
|
8
8
|
/** What a single RPC branch is allowed to report. Failure is a throw. */
|
|
9
|
-
type ConfirmationOutcome<T> = {
|
|
9
|
+
export type ConfirmationOutcome<T> = {
|
|
10
10
|
kind: "confirmed";
|
|
11
11
|
value: T;
|
|
12
12
|
} | {
|
|
13
13
|
kind: "not-confirmed";
|
|
14
14
|
};
|
|
15
|
-
declare function isConfirmedCommitment(status: Commitment | string | null | undefined): boolean;
|
|
15
|
+
export declare function isConfirmedCommitment(status: Commitment | string | null | undefined): boolean;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { ConfirmationOutcome, SignatureStatus, isConfirmedCommitment };
|
|
18
17
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { SolanaStepExecutorContext, SolanaStepExecutorOptions } from "../types.j
|
|
|
2
2
|
import { BaseStepExecutor, ExecutionAction, LiFiStepExtended, SDKError, StepExecutorBaseContext, TaskPipeline } from "@lifi/sdk";
|
|
3
3
|
import { WalletAccount } from "@wallet-standard/base";
|
|
4
4
|
//#region src/core/SolanaStepExecutor.d.ts
|
|
5
|
-
declare class SolanaStepExecutor extends BaseStepExecutor {
|
|
5
|
+
export declare class SolanaStepExecutor extends BaseStepExecutor {
|
|
6
6
|
private wallet;
|
|
7
7
|
private skipSimulation;
|
|
8
8
|
constructor(options: SolanaStepExecutorOptions);
|
|
@@ -12,5 +12,4 @@ declare class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
12
12
|
override createPipeline: (context: SolanaStepExecutorContext) => TaskPipeline;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
|
-
export { SolanaStepExecutor };
|
|
16
15
|
//# sourceMappingURL=SolanaStepExecutor.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
3
|
//#region src/core/tasks/SolanaJitoWaitForTransactionTask.d.ts
|
|
4
|
-
declare class SolanaJitoWaitForTransactionTask extends BaseStepExecutionTask {
|
|
4
|
+
export declare class SolanaJitoWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
export { SolanaJitoWaitForTransactionTask };
|
|
9
8
|
//# sourceMappingURL=SolanaJitoWaitForTransactionTask.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
3
|
//#region src/core/tasks/SolanaSignAndExecuteTask.d.ts
|
|
4
|
-
declare class SolanaSignAndExecuteTask extends BaseStepExecutionTask {
|
|
4
|
+
export declare class SolanaSignAndExecuteTask extends BaseStepExecutionTask {
|
|
5
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
export { SolanaSignAndExecuteTask };
|
|
9
8
|
//# sourceMappingURL=SolanaSignAndExecuteTask.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
3
|
//#region src/core/tasks/SolanaStandardWaitForTransactionTask.d.ts
|
|
4
|
-
declare class SolanaStandardWaitForTransactionTask extends BaseStepExecutionTask {
|
|
4
|
+
export declare class SolanaStandardWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
export { SolanaStandardWaitForTransactionTask };
|
|
9
8
|
//# sourceMappingURL=SolanaStandardWaitForTransactionTask.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SolanaStepExecutorContext } from "../../types.js";
|
|
2
2
|
import { BaseStepExecutionTask, TaskResult } from "@lifi/sdk";
|
|
3
3
|
//#region src/core/tasks/SolanaWaitForTransactionTask.d.ts
|
|
4
|
-
declare class SolanaWaitForTransactionTask extends BaseStepExecutionTask {
|
|
4
|
+
export declare class SolanaWaitForTransactionTask extends BaseStepExecutionTask {
|
|
5
5
|
run(context: SolanaStepExecutorContext): Promise<TaskResult>;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
export { SolanaWaitForTransactionTask };
|
|
9
8
|
//# sourceMappingURL=SolanaWaitForTransactionTask.d.ts.map
|
|
@@ -11,7 +11,6 @@ import { Signature, Transaction } from "@solana/kit";
|
|
|
11
11
|
* someone else. Integrator error branching switches on `LiFiErrorCode`, so an
|
|
12
12
|
* unwrapped throw lands in the unknown bucket.
|
|
13
13
|
*/
|
|
14
|
-
declare function readSignature(transaction: Transaction): Signature;
|
|
14
|
+
export declare function readSignature(transaction: Transaction): Signature;
|
|
15
15
|
//#endregion
|
|
16
|
-
export { readSignature };
|
|
17
16
|
//# sourceMappingURL=readSignature.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RaceResult } from "../../confirmation/raceRpcs.js";
|
|
2
2
|
//#region src/core/tasks/unwrapConfirmation.d.ts
|
|
3
3
|
/** Only the nouns differ between the standard and bundle paths. */
|
|
4
|
-
type ConfirmationMessages = {
|
|
4
|
+
export type ConfirmationMessages = {
|
|
5
5
|
/** Every branch failed: an outage, not a verdict about the transaction. */
|
|
6
6
|
rpcUnavailable: string;
|
|
7
7
|
/** A branch polled to its deadline and saw nothing. */
|
|
@@ -19,7 +19,6 @@ type ConfirmationMessages = {
|
|
|
19
19
|
* stay distinct: collapsing them reported a live RPC defect as an expired
|
|
20
20
|
* transaction.
|
|
21
21
|
*/
|
|
22
|
-
declare function unwrapConfirmation<T>(result: RaceResult<T>, messages: ConfirmationMessages): T;
|
|
22
|
+
export declare function unwrapConfirmation<T>(result: RaceResult<T>, messages: ConfirmationMessages): T;
|
|
23
23
|
//#endregion
|
|
24
|
-
export { ConfirmationMessages, unwrapConfirmation };
|
|
25
24
|
//# sourceMappingURL=unwrapConfirmation.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ExecutionAction, LiFiStep, SDKError } from "@lifi/sdk";
|
|
2
2
|
//#region src/errors/parseSolanaErrors.d.ts
|
|
3
|
-
declare const parseSolanaErrors: (e: Error, step?: LiFiStep, action?: ExecutionAction) => Promise<SDKError>;
|
|
3
|
+
export declare const parseSolanaErrors: (e: Error, step?: LiFiStep, action?: ExecutionAction) => Promise<SDKError>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { parseSolanaErrors };
|
|
6
5
|
//# sourceMappingURL=parseSolanaErrors.d.ts.map
|
|
@@ -16,7 +16,7 @@ type GetBundleStatusesResponse = {
|
|
|
16
16
|
/** Jito answers with `null` for a bundle id it does not know. */
|
|
17
17
|
value: (BundleStatus | null)[];
|
|
18
18
|
};
|
|
19
|
-
type GetBundleStatusesApi = {
|
|
19
|
+
export type GetBundleStatusesApi = {
|
|
20
20
|
/**
|
|
21
21
|
* Returns the status of submitted bundle(s).
|
|
22
22
|
* @see https://www.quicknode.com/docs/solana/getBundleStatuses
|
|
@@ -24,5 +24,4 @@ type GetBundleStatusesApi = {
|
|
|
24
24
|
getBundleStatuses(bundleIds: string[], region?: JitoRegion): GetBundleStatusesResponse;
|
|
25
25
|
};
|
|
26
26
|
//#endregion
|
|
27
|
-
export { GetBundleStatusesApi };
|
|
28
27
|
//# sourceMappingURL=getBundleStatuses.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { JitoRegion } from "../types.js";
|
|
|
2
2
|
//#region src/rpc/jito/api/getTipAccounts.d.ts
|
|
3
3
|
/** Array of tip account addresses (Solana public keys) */
|
|
4
4
|
type GetTipAccountsResponse = string[];
|
|
5
|
-
type GetTipAccountsApi = {
|
|
5
|
+
export type GetTipAccountsApi = {
|
|
6
6
|
/**
|
|
7
7
|
* Fetches the tip accounts designated for tip payments for bundles.
|
|
8
8
|
* Returns an array of 8 tip account addresses that can receive tips for transaction prioritization.
|
|
@@ -11,5 +11,4 @@ type GetTipAccountsApi = {
|
|
|
11
11
|
getTipAccounts(region?: JitoRegion): GetTipAccountsResponse;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { GetTipAccountsApi };
|
|
15
14
|
//# sourceMappingURL=getTipAccounts.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { Base64EncodedWireTransaction } from "@solana/kit";
|
|
|
3
3
|
//#region src/rpc/jito/api/sendBundle.d.ts
|
|
4
4
|
/** Bundle ID returned on successful submission */
|
|
5
5
|
type SendBundleResponse = string;
|
|
6
|
-
type SendBundleApi = {
|
|
6
|
+
export type SendBundleApi = {
|
|
7
7
|
/**
|
|
8
8
|
* Submits a bundle of signed transactions (base-64 encoded) to the cluster for atomic processing.
|
|
9
9
|
* If any transaction fails, the entire bundle is rejected.
|
|
@@ -18,5 +18,4 @@ type SendBundleApi = {
|
|
|
18
18
|
sendBundle(transactions: Array<Base64EncodedWireTransaction>, region?: JitoRegion): SendBundleResponse;
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
|
-
export { SendBundleApi };
|
|
22
21
|
//# sourceMappingURL=sendBundle.d.ts.map
|
|
@@ -36,7 +36,7 @@ type SimulateBundleResponse = {
|
|
|
36
36
|
}>;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
type SimulateBundleApi = {
|
|
39
|
+
export type SimulateBundleApi = {
|
|
40
40
|
/**
|
|
41
41
|
* Simulates a Jito bundle - runs simulation on the bundle to check if it will succeed
|
|
42
42
|
* @see https://www.quicknode.com/docs/solana/simulateBundle
|
|
@@ -57,5 +57,4 @@ type SimulateBundleApi = {
|
|
|
57
57
|
}>): SimulateBundleResponse;
|
|
58
58
|
};
|
|
59
59
|
//#endregion
|
|
60
|
-
export { SimulateBundleApi };
|
|
61
60
|
//# sourceMappingURL=simulateBundle.d.ts.map
|
|
@@ -4,10 +4,9 @@ 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
6
|
//#region src/rpc/jito/createJitoRpc.d.ts
|
|
7
|
-
type JitoBundleApi = GetBundleStatusesApi & GetTipAccountsApi & SendBundleApi & SimulateBundleApi;
|
|
8
|
-
type JitoRpcApi = JitoBundleApi & SolanaRpcApi;
|
|
9
|
-
declare function createJitoRpcFromTransport<TTransport extends RpcTransport>(transport: TTransport): Rpc<JitoRpcApi>;
|
|
10
|
-
declare function createJitoRpc<TClusterUrl extends ClusterUrl>(clusterUrl: TClusterUrl, config?: Omit<Parameters<typeof createDefaultRpcTransport<TClusterUrl>>[0], "url">): Rpc<JitoRpcApi>;
|
|
7
|
+
export type JitoBundleApi = GetBundleStatusesApi & GetTipAccountsApi & SendBundleApi & SimulateBundleApi;
|
|
8
|
+
export type JitoRpcApi = JitoBundleApi & SolanaRpcApi;
|
|
9
|
+
export declare function createJitoRpcFromTransport<TTransport extends RpcTransport>(transport: TTransport): Rpc<JitoRpcApi>;
|
|
10
|
+
export declare function createJitoRpc<TClusterUrl extends ClusterUrl>(clusterUrl: TClusterUrl, config?: Omit<Parameters<typeof createDefaultRpcTransport<TClusterUrl>>[0], "url">): Rpc<JitoRpcApi>;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { JitoBundleApi, JitoRpcApi, createJitoRpc, createJitoRpcFromTransport };
|
|
13
12
|
//# sourceMappingURL=createJitoRpc.d.ts.map
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Available Jito regions for routing requests.
|
|
4
4
|
*/
|
|
5
|
-
type JitoRegion = "mainnet" | "amsterdam" | "frankfurt" | "ny" | "tokyo" | "slc" | "london" | "singapore";
|
|
5
|
+
export type JitoRegion = "mainnet" | "amsterdam" | "frankfurt" | "ny" | "tokyo" | "slc" | "london" | "singapore";
|
|
6
6
|
//#endregion
|
|
7
|
-
export { JitoRegion };
|
|
8
7
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -3,11 +3,11 @@ import { SDKClient } from "@lifi/sdk";
|
|
|
3
3
|
//#region src/rpc/registry.d.ts
|
|
4
4
|
/** Both leave the endpoint out of the Jito list, but only `unsupported` is a
|
|
5
5
|
* configuration gap the integrator can act on. */
|
|
6
|
-
type JitoProbeOutcome = "supported" | "unsupported" | "unreachable";
|
|
6
|
+
export type JitoProbeOutcome = "supported" | "unsupported" | "unreachable";
|
|
7
7
|
/** An outcome plus how long it may be trusted. The classifier decides both,
|
|
8
8
|
* because how long an answer is worth is a property of the evidence that
|
|
9
9
|
* produced it, not of the outcome alone. */
|
|
10
|
-
type JitoProbeResult = {
|
|
10
|
+
export type JitoProbeResult = {
|
|
11
11
|
outcome: JitoProbeOutcome;
|
|
12
12
|
/** `Infinity` for an answer that cannot change. */
|
|
13
13
|
retryMs: number;
|
|
@@ -15,7 +15,7 @@ type JitoProbeResult = {
|
|
|
15
15
|
/** Retry window for a probe that failed without naming the method unknown.
|
|
16
16
|
* An outage heals, so a permanent entry would keep a recovered endpoint out of
|
|
17
17
|
* the Jito list for the whole process. */
|
|
18
|
-
declare const JITO_PROBE_RETRY_MS = 3e4;
|
|
18
|
+
export declare const JITO_PROBE_RETRY_MS = 3e4;
|
|
19
19
|
/** Retry window for a bare HTTP 401/403. Longer than an outage's, shorter than
|
|
20
20
|
* forever. The refusal never reached the JSON-RPC layer, so it proves nothing
|
|
21
21
|
* about capability: a plan gate, a provider deploy and an allowlist entry
|
|
@@ -23,27 +23,26 @@ declare const JITO_PROBE_RETRY_MS = 3e4;
|
|
|
23
23
|
* one transient 403 removed a working endpoint for the process lifetime;
|
|
24
24
|
* treating it as a 30 s outage would re-probe a real plan gate on the
|
|
25
25
|
* pre-submission latency path twice a minute, forever. */
|
|
26
|
-
declare const JITO_PROBE_GATEWAY_RETRY_MS: number;
|
|
26
|
+
export declare const JITO_PROBE_GATEWAY_RETRY_MS: number;
|
|
27
27
|
/**
|
|
28
28
|
* Probes with `getBundleStatuses` rather than `getTipAccounts`: it is the
|
|
29
29
|
* method bundle confirmation actually uses, and providers such as Helius
|
|
30
30
|
* support it without exposing `getTipAccounts`.
|
|
31
31
|
*/
|
|
32
|
-
declare const probeJitoRpc: (rpcUrl: string) => Promise<JitoProbeResult>;
|
|
32
|
+
export declare const probeJitoRpc: (rpcUrl: string) => Promise<JitoProbeResult>;
|
|
33
33
|
/**
|
|
34
34
|
* Wrapper around getting the Solana RPCs
|
|
35
35
|
* @returns - Solana RPCs
|
|
36
36
|
*/
|
|
37
|
-
declare const getSolanaRpcs: (client: SDKClient) => Promise<SolanaRpcType[]>;
|
|
37
|
+
export declare const getSolanaRpcs: (client: SDKClient) => Promise<SolanaRpcType[]>;
|
|
38
38
|
/** `unreachable` counts endpoints whose probe failed without naming the
|
|
39
39
|
* method unknown. Empty `rpcs` with a non-zero count is usually an outage, but
|
|
40
40
|
* not always: a bare 401/403 lands here too, and that can be a plan gate the
|
|
41
41
|
* integrator has to fix. `sendAndConfirmBundle`'s message names both, because
|
|
42
42
|
* this count cannot tell them apart. */
|
|
43
|
-
declare const getJitoRpcs: (client: SDKClient) => Promise<{
|
|
43
|
+
export declare const getJitoRpcs: (client: SDKClient) => Promise<{
|
|
44
44
|
rpcs: JitoRpcType[];
|
|
45
45
|
unreachable: number;
|
|
46
46
|
}>;
|
|
47
47
|
//#endregion
|
|
48
|
-
export { JITO_PROBE_GATEWAY_RETRY_MS, JITO_PROBE_RETRY_MS, JitoProbeOutcome, JitoProbeResult, getJitoRpcs, getSolanaRpcs, probeJitoRpc };
|
|
49
48
|
//# sourceMappingURL=registry.d.ts.map
|
package/dist/cjs/rpc/types.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { JitoRpcApi } from "./jito/createJitoRpc.js";
|
|
2
2
|
import { Rpc, createSolanaRpc } from "@solana/kit";
|
|
3
3
|
//#region src/rpc/types.d.ts
|
|
4
|
-
type SolanaRpcType = ReturnType<typeof createSolanaRpc>;
|
|
5
|
-
type JitoRpcType = Rpc<JitoRpcApi>;
|
|
4
|
+
export type SolanaRpcType = ReturnType<typeof createSolanaRpc>;
|
|
5
|
+
export type JitoRpcType = Rpc<JitoRpcApi>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { JitoRpcType, SolanaRpcType };
|
|
8
7
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/cjs/rpc/utils.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ type RetryFn<Rpc> = <R>(client: SDKClient, fn: (rpc: Rpc) => Promise<R>) => Prom
|
|
|
22
22
|
* )
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare function callWithRetry<T, R>(rpcs: T[], fn: (rpc: T) => Promise<R>): Promise<R>;
|
|
25
|
+
export declare function callWithRetry<T, R>(rpcs: T[], fn: (rpc: T) => Promise<R>): Promise<R>;
|
|
26
26
|
/**
|
|
27
27
|
* Calls a function on Solana RPC instances with retry logic.
|
|
28
28
|
* Automatically fetches available Solana RPCs and tries each in sequence.
|
|
@@ -41,7 +41,7 @@ declare function callWithRetry<T, R>(rpcs: T[], fn: (rpc: T) => Promise<R>): Pro
|
|
|
41
41
|
* )
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
declare const callSolanaRpcsWithRetry: RetryFn<SolanaRpcType>;
|
|
44
|
+
export declare const callSolanaRpcsWithRetry: RetryFn<SolanaRpcType>;
|
|
45
45
|
/**
|
|
46
46
|
* Calls a function on Jito RPC instances with retry logic.
|
|
47
47
|
* Automatically fetches available Jito RPCs and tries each in sequence.
|
|
@@ -60,7 +60,6 @@ declare const callSolanaRpcsWithRetry: RetryFn<SolanaRpcType>;
|
|
|
60
60
|
* )
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
|
-
declare const callJitoRpcsWithRetry: RetryFn<JitoRpcType>;
|
|
63
|
+
export declare const callJitoRpcsWithRetry: RetryFn<JitoRpcType>;
|
|
64
64
|
//#endregion
|
|
65
|
-
export { callJitoRpcsWithRetry, callSolanaRpcsWithRetry, callWithRetry };
|
|
66
65
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { SDKProvider, StepExecutorContext, StepExecutorOptions } from "@lifi/sdk
|
|
|
2
2
|
import { Transaction } from "@solana/kit";
|
|
3
3
|
import { Wallet, WalletAccount } from "@wallet-standard/base";
|
|
4
4
|
//#region src/types.d.ts
|
|
5
|
-
interface SolanaProviderOptions {
|
|
5
|
+
export interface SolanaProviderOptions {
|
|
6
6
|
getWallet?: () => Promise<Wallet>;
|
|
7
7
|
skipSimulation?: boolean;
|
|
8
8
|
}
|
|
9
|
-
interface SolanaTaskContext {
|
|
9
|
+
export interface SolanaTaskContext {
|
|
10
10
|
signedTransactions?: Transaction[];
|
|
11
11
|
/**
|
|
12
12
|
* Whether the backend returned a Jito bundle (array `transactionRequest.data`)
|
|
@@ -14,19 +14,18 @@ interface SolanaTaskContext {
|
|
|
14
14
|
*/
|
|
15
15
|
isBundleExecution?: boolean;
|
|
16
16
|
}
|
|
17
|
-
interface SolanaStepExecutorContext extends StepExecutorContext, SolanaTaskContext {
|
|
17
|
+
export interface SolanaStepExecutorContext extends StepExecutorContext, SolanaTaskContext {
|
|
18
18
|
wallet: Wallet;
|
|
19
19
|
walletAccount: WalletAccount;
|
|
20
20
|
skipSimulation: boolean;
|
|
21
21
|
}
|
|
22
|
-
interface SolanaSDKProvider extends SDKProvider {
|
|
22
|
+
export interface SolanaSDKProvider extends SDKProvider {
|
|
23
23
|
setOptions(options: SolanaProviderOptions): void;
|
|
24
24
|
}
|
|
25
|
-
declare function isSolanaProvider(provider: SDKProvider): provider is SolanaSDKProvider;
|
|
26
|
-
interface SolanaStepExecutorOptions extends StepExecutorOptions {
|
|
25
|
+
export declare function isSolanaProvider(provider: SDKProvider): provider is SolanaSDKProvider;
|
|
26
|
+
export interface SolanaStepExecutorOptions extends StepExecutorOptions {
|
|
27
27
|
wallet: Wallet;
|
|
28
28
|
skipSimulation?: boolean;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
export { SolanaProviderOptions, SolanaSDKProvider, SolanaStepExecutorContext, SolanaStepExecutorOptions, SolanaTaskContext, isSolanaProvider };
|
|
32
31
|
//# sourceMappingURL=types.d.ts.map
|