@lifi/sdk 3.14.0-alpha.0 → 3.14.1
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/LICENSE +201 -165
- package/package.json +7 -7
- package/src/_cjs/core/EVM/EVMStepExecutor.js +14 -11
- package/src/_cjs/core/EVM/EVMStepExecutor.js.map +1 -1
- package/src/_cjs/core/Solana/SolanaStepExecutor.js +13 -12
- package/src/_cjs/core/Solana/SolanaStepExecutor.js.map +1 -1
- package/src/_cjs/core/Solana/connection.js +4 -15
- package/src/_cjs/core/Solana/connection.js.map +1 -1
- package/src/_cjs/core/Solana/jito/JitoConnection.js +51 -21
- package/src/_cjs/core/Solana/jito/JitoConnection.js.map +1 -1
- package/src/_cjs/core/Solana/jito/constants.js +10 -23
- package/src/_cjs/core/Solana/jito/constants.js.map +1 -1
- package/src/_cjs/core/Solana/jito/sendAndConfirmBundle.js +36 -84
- package/src/_cjs/core/Solana/jito/sendAndConfirmBundle.js.map +1 -1
- package/src/_cjs/core/utils.js +0 -5
- package/src/_cjs/core/utils.js.map +1 -1
- package/src/_cjs/index.js +2 -4
- package/src/_cjs/index.js.map +1 -1
- package/src/_cjs/request.js +7 -3
- package/src/_cjs/request.js.map +1 -1
- package/src/_cjs/services/api.js +1 -2
- package/src/_cjs/services/api.js.map +1 -1
- package/src/_cjs/version.js +1 -1
- package/src/_cjs/version.js.map +1 -1
- package/src/_esm/core/EVM/EVMStepExecutor.js +11 -8
- package/src/_esm/core/EVM/EVMStepExecutor.js.map +1 -1
- package/src/_esm/core/Solana/SolanaStepExecutor.js +13 -12
- package/src/_esm/core/Solana/SolanaStepExecutor.js.map +1 -1
- package/src/_esm/core/Solana/connection.js +7 -20
- package/src/_esm/core/Solana/connection.js.map +1 -1
- package/src/_esm/core/Solana/jito/JitoConnection.js +72 -23
- package/src/_esm/core/Solana/jito/JitoConnection.js.map +1 -1
- package/src/_esm/core/Solana/jito/constants.js +10 -23
- package/src/_esm/core/Solana/jito/constants.js.map +1 -1
- package/src/_esm/core/Solana/jito/sendAndConfirmBundle.js +45 -104
- package/src/_esm/core/Solana/jito/sendAndConfirmBundle.js.map +1 -1
- package/src/_esm/core/utils.js +0 -11
- package/src/_esm/core/utils.js.map +1 -1
- package/src/_esm/index.js +0 -1
- package/src/_esm/index.js.map +1 -1
- package/src/_esm/request.js +7 -3
- package/src/_esm/request.js.map +1 -1
- package/src/_esm/services/api.js +3 -4
- package/src/_esm/services/api.js.map +1 -1
- package/src/_esm/version.js +1 -1
- package/src/_esm/version.js.map +1 -1
- package/src/_types/core/EVM/EVMStepExecutor.d.ts.map +1 -1
- package/src/_types/core/Solana/SolanaStepExecutor.d.ts.map +1 -1
- package/src/_types/core/Solana/connection.d.ts +4 -3
- package/src/_types/core/Solana/connection.d.ts.map +1 -1
- package/src/_types/core/Solana/jito/JitoConnection.d.ts +35 -5
- package/src/_types/core/Solana/jito/JitoConnection.d.ts.map +1 -1
- package/src/_types/core/Solana/jito/constants.d.ts +1 -2
- package/src/_types/core/Solana/jito/constants.d.ts.map +1 -1
- package/src/_types/core/Solana/jito/sendAndConfirmBundle.d.ts +2 -2
- package/src/_types/core/Solana/jito/sendAndConfirmBundle.d.ts.map +1 -1
- package/src/_types/core/utils.d.ts +1 -10
- package/src/_types/core/utils.d.ts.map +1 -1
- package/src/_types/index.d.ts +2 -3
- package/src/_types/index.d.ts.map +1 -1
- package/src/_types/request.d.ts.map +1 -1
- package/src/_types/services/api.d.ts +1 -1
- package/src/_types/services/api.d.ts.map +1 -1
- package/src/_types/services/types.d.ts +0 -3
- package/src/_types/services/types.d.ts.map +1 -1
- package/src/_types/types/internal.d.ts +3 -0
- package/src/_types/types/internal.d.ts.map +1 -1
- package/src/_types/version.d.ts +1 -1
- package/src/_types/version.d.ts.map +1 -1
- package/src/core/EVM/EVMStepExecutor.ts +12 -7
- package/src/core/Solana/SolanaStepExecutor.ts +13 -12
- package/src/core/Solana/connection.ts +12 -25
- package/src/core/Solana/jito/JitoConnection.ts +97 -29
- package/src/core/Solana/jito/constants.ts +10 -25
- package/src/core/Solana/jito/sendAndConfirmBundle.ts +50 -135
- package/src/core/utils.ts +1 -13
- package/src/index.ts +6 -3
- package/src/request.ts +9 -3
- package/src/services/api.ts +4 -6
- package/src/services/types.ts +0 -4
- package/src/types/internal.ts +6 -0
- package/src/version.ts +1 -1
- package/src/_cjs/core/Solana/jito/isJitoRpc.js +0 -23
- package/src/_cjs/core/Solana/jito/isJitoRpc.js.map +0 -1
- package/src/_esm/core/Solana/jito/isJitoRpc.js +0 -21
- package/src/_esm/core/Solana/jito/isJitoRpc.js.map +0 -1
- package/src/_types/core/Solana/jito/isJitoRpc.d.ts +0 -2
- package/src/_types/core/Solana/jito/isJitoRpc.d.ts.map +0 -1
- package/src/core/Solana/jito/isJitoRpc.ts +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,aAAa,EACb,aAAa,GACd,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,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AA2B,EAC3B,eAAe,EACf,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,YAAY,EACV,wBAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,kBAAkB,EAClB,OAAO,EACP,aAAa,EACb,SAAS,GACV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../request.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAI7D,eAAO,MAAM,eAAe;;CAE3B,CAAA;AASD,eAAO,MAAM,OAAO,GAAU,CAAC,GAAG,QAAQ,EACxC,KAAK,WAAW,GAAG,GAAG,EACtB,UAAS,mBAER,KACA,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../request.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAI7D,eAAO,MAAM,eAAe;;CAE3B,CAAA;AASD,eAAO,MAAM,OAAO,GAAU,CAAC,GAAG,QAAQ,EACxC,KAAK,WAAW,GAAG,GAAG,EACtB,UAAS,mBAER,KACA,OAAO,CAAC,CAAC,CA0EX,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChainId, type ChainKey, type ChainsRequest, type ConnectionsRequest, type ConnectionsResponse, type ContractCallsQuoteRequest, type ExtendedChain, type GasRecommendationRequest, type GasRecommendationResponse, type LiFiStep, type RelayRequest, type RelayResponseData, type RelayStatusRequest, type RelayStatusResponseData, type RequestOptions, type RoutesRequest, type RoutesResponse, type SignedLiFiStep, type StatusResponse, type TokenExtended, type TokensExtendedResponse, type TokensRequest, type TokensResponse, type ToolsRequest, type ToolsResponse, type TransactionAnalyticsRequest, type TransactionAnalyticsResponse } from '@lifi/types';
|
|
2
2
|
import type { GetStatusRequestExtended, QuoteRequestFromAmount, QuoteRequestToAmount } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Get a quote for a token transfer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../services/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../services/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,QAAQ,EACb,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAG9B,KAAK,QAAQ,EAEb,KAAK,YAAY,EAEjB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAEvB,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,E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GAMG;AACH,eAAO,MAAM,SAAS,GACpB,SAAS,aAAa,EACtB,UAAU,cAAc,KACvB,OAAO,CAAC,aAAa,EAAE,CAsBzB,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,MAAM,CAAC,EAAE,aAAa,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,EACzD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,cAAc,CAAC,CAAA;AAC1B,wBAAsB,SAAS,CAC7B,MAAM,EAAE,aAAa,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,sBAAsB,CAAC,CAAA;AA4BlC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GACnB,OAAO,QAAQ,GAAG,OAAO,EACzB,OAAO,MAAM,EACb,UAAU,cAAc,KACvB,OAAO,CAAC,aAAa,CAoBvB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,YAAY,EACrB,UAAU,cAAc,KACvB,OAAO,CAAC,aAAa,CAgBvB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,wBAAwB,EAChC,UAAU,cAAc,KACvB,OAAO,CAAC,yBAAyB,CAkBnC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,mBAAmB,kBAAkB,EACrC,UAAU,cAAc,KACvB,OAAO,CAAC,mBAAmB,CAmC7B,CAAA;AAED,eAAO,MAAM,qBAAqB,GAChC,gDAAgD,2BAA2B,EAC3E,UAAU,cAAc,KACvB,OAAO,CAAC,4BAA4B,CA2BtC,CAAA"}
|
|
@@ -2,9 +2,6 @@ import type { GetStatusRequest, QuoteRequest as QuoteRequestBase } from '@lifi/t
|
|
|
2
2
|
export type GetStatusRequestExtended = GetStatusRequest & {
|
|
3
3
|
fromAddress?: string;
|
|
4
4
|
};
|
|
5
|
-
export type GetStepTransactionRequest = {
|
|
6
|
-
jitoBundle?: boolean;
|
|
7
|
-
};
|
|
8
5
|
export type QuoteRequestFromAmount = QuoteRequestBase;
|
|
9
6
|
export type QuoteRequestToAmount = Omit<QuoteRequestBase, 'fromAmount'> & {
|
|
10
7
|
toAmount: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../services/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,IAAI,gBAAgB,EACjC,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IACxD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../services/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,IAAI,gBAAgB,EACjC,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IACxD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAA;AAErD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,GAAG;IACxE,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,sBAAsB,GAAG,oBAAoB,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ChainId, ExtendedChain, RouteOptions } from '@lifi/types';
|
|
2
2
|
import type { SDKProvider } from '../core/types.js';
|
|
3
|
+
import type { ExtendedRequestInit } from './request.js';
|
|
4
|
+
export type RequestInterceptor = (request: ExtendedRequestInit) => ExtendedRequestInit | Promise<ExtendedRequestInit>;
|
|
3
5
|
export interface SDKBaseConfig {
|
|
4
6
|
apiKey?: string;
|
|
5
7
|
apiUrl: string;
|
|
@@ -13,6 +15,7 @@ export interface SDKBaseConfig {
|
|
|
13
15
|
widgetVersion?: string;
|
|
14
16
|
preloadChains: boolean;
|
|
15
17
|
debug: boolean;
|
|
18
|
+
requestInterceptor?: RequestInterceptor;
|
|
16
19
|
}
|
|
17
20
|
export interface SDKConfig extends Partial<Omit<SDKBaseConfig, 'integrator'>> {
|
|
18
21
|
integrator: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../types/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../types/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAEvD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,mBAAmB,KACzB,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAEvD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,WAAW,EAAE,CAAA;IACxB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,OAAO,CAAA;IACtB,KAAK,EAAE,OAAO,CAAA;IACd,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;CACxC;AAED,MAAM,WAAW,SAAU,SAAQ,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC3E,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA"}
|
package/src/_types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,cAAc,CAAA;AAC/B,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,cAAc,CAAA;AAC/B,eAAO,MAAM,OAAO,WAAW,CAAA"}
|
|
@@ -35,7 +35,6 @@ import type {
|
|
|
35
35
|
TransactionMethodType,
|
|
36
36
|
TransactionParameters,
|
|
37
37
|
} from '../types.js'
|
|
38
|
-
import { isTokenMessageSigningAllowed } from '../utils.js'
|
|
39
38
|
import { waitForDestinationChainTransaction } from '../waitForDestinationChainTransaction.js'
|
|
40
39
|
import { checkAllowance } from './checkAllowance.js'
|
|
41
40
|
import { getActionWithFallback } from './getActionWithFallback.js'
|
|
@@ -222,6 +221,7 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
222
221
|
}
|
|
223
222
|
|
|
224
223
|
private prepareUpdatedStep = async (
|
|
224
|
+
client: Client,
|
|
225
225
|
step: LiFiStepExtended,
|
|
226
226
|
signedTypedData?: SignedTypedData[]
|
|
227
227
|
) => {
|
|
@@ -280,6 +280,7 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
280
280
|
let transactionRequest: TransactionParameters | undefined
|
|
281
281
|
if (step.transactionRequest) {
|
|
282
282
|
transactionRequest = {
|
|
283
|
+
chainId: step.transactionRequest.chainId,
|
|
283
284
|
to: step.transactionRequest.to,
|
|
284
285
|
from: step.transactionRequest.from,
|
|
285
286
|
data: step.transactionRequest.data,
|
|
@@ -296,8 +297,8 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
296
297
|
// ? BigInt(step.transactionRequest.maxFeePerGas as string)
|
|
297
298
|
// : undefined,
|
|
298
299
|
maxPriorityFeePerGas:
|
|
299
|
-
|
|
300
|
-
? await getMaxPriorityFeePerGas(
|
|
300
|
+
client.account?.type === 'local'
|
|
301
|
+
? await getMaxPriorityFeePerGas(client)
|
|
301
302
|
: step.transactionRequest.maxPriorityFeePerGas
|
|
302
303
|
? BigInt(step.transactionRequest.maxPriorityFeePerGas)
|
|
303
304
|
: undefined,
|
|
@@ -425,9 +426,7 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
425
426
|
// We also disable message signing for custom steps
|
|
426
427
|
const disableMessageSigning =
|
|
427
428
|
this.executionOptions?.disableMessageSigning ||
|
|
428
|
-
step.type !== 'lifi'
|
|
429
|
-
// We disable message signing for tokens with '₮' symbol
|
|
430
|
-
!isTokenMessageSigningAllowed(step.action.fromToken)
|
|
429
|
+
step.type !== 'lifi'
|
|
431
430
|
|
|
432
431
|
// Check if chain has Permit2 contract deployed. Permit2 should not be available for atomic batch.
|
|
433
432
|
const permit2Supported =
|
|
@@ -525,9 +524,15 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
525
524
|
|
|
526
525
|
await checkBalance(this.client.account!.address, step)
|
|
527
526
|
|
|
527
|
+
// Make sure that the client and chain is still correct
|
|
528
|
+
const updatedClient = await this.checkClient(step, process)
|
|
529
|
+
if (!updatedClient) {
|
|
530
|
+
return step
|
|
531
|
+
}
|
|
532
|
+
|
|
528
533
|
// Try to prepare a new transaction request and update the step with typed data
|
|
529
534
|
let { transactionRequest, isRelayerTransaction } =
|
|
530
|
-
await this.prepareUpdatedStep(step, signedTypedData)
|
|
535
|
+
await this.prepareUpdatedStep(updatedClient, step, signedTypedData)
|
|
531
536
|
|
|
532
537
|
process = this.statusManager.updateProcess(
|
|
533
538
|
step,
|
|
@@ -198,7 +198,7 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
198
198
|
)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
let
|
|
201
|
+
let confirmedTransaction: any
|
|
202
202
|
|
|
203
203
|
if (shouldUseJitoBundle) {
|
|
204
204
|
// Use Jito bundle for multiple transactions
|
|
@@ -235,17 +235,17 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
235
235
|
|
|
236
236
|
// Use the first transaction's signature result for reporting
|
|
237
237
|
// (all transactions succeeded if we reach here)
|
|
238
|
-
|
|
238
|
+
confirmedTransaction = {
|
|
239
239
|
signatureResult: bundleResult.signatureResults[0],
|
|
240
240
|
txSignature: bundleResult.txSignatures[0],
|
|
241
241
|
bundleId: bundleResult.bundleId,
|
|
242
242
|
}
|
|
243
243
|
} else {
|
|
244
244
|
// Use regular transaction for single transaction
|
|
245
|
-
const
|
|
245
|
+
const signedTransaction = signedTransactions[0]
|
|
246
246
|
|
|
247
247
|
const simulationResult = await callSolanaWithRetry((connection) =>
|
|
248
|
-
connection.simulateTransaction(
|
|
248
|
+
connection.simulateTransaction(signedTransaction, {
|
|
249
249
|
commitment: 'confirmed',
|
|
250
250
|
replaceRecentBlockhash: true,
|
|
251
251
|
})
|
|
@@ -258,21 +258,22 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
258
258
|
)
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
confirmedTransaction =
|
|
262
|
+
await sendAndConfirmTransaction(signedTransaction)
|
|
262
263
|
}
|
|
263
264
|
|
|
264
|
-
if (!
|
|
265
|
+
if (!confirmedTransaction.signatureResult) {
|
|
265
266
|
throw new TransactionError(
|
|
266
267
|
LiFiErrorCode.TransactionExpired,
|
|
267
268
|
'Transaction has expired: The block height has exceeded the maximum allowed limit.'
|
|
268
269
|
)
|
|
269
270
|
}
|
|
270
271
|
|
|
271
|
-
if (
|
|
272
|
+
if (confirmedTransaction.signatureResult.err) {
|
|
272
273
|
const reason =
|
|
273
|
-
typeof
|
|
274
|
-
? JSON.stringify(
|
|
275
|
-
:
|
|
274
|
+
typeof confirmedTransaction.signatureResult.err === 'object'
|
|
275
|
+
? JSON.stringify(confirmedTransaction.signatureResult.err)
|
|
276
|
+
: confirmedTransaction.signatureResult.err
|
|
276
277
|
throw new TransactionError(
|
|
277
278
|
LiFiErrorCode.TransactionFailed,
|
|
278
279
|
`Transaction failed: ${reason}`
|
|
@@ -285,8 +286,8 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
285
286
|
process.type,
|
|
286
287
|
'PENDING',
|
|
287
288
|
{
|
|
288
|
-
txHash:
|
|
289
|
-
txLink: `${fromChain.metamask.blockExplorerUrls[0]}tx/${
|
|
289
|
+
txHash: confirmedTransaction.txSignature,
|
|
290
|
+
txLink: `${fromChain.metamask.blockExplorerUrls[0]}tx/${confirmedTransaction.txSignature}`,
|
|
290
291
|
}
|
|
291
292
|
)
|
|
292
293
|
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import { ChainId } from '@lifi/types'
|
|
2
|
-
import {
|
|
2
|
+
import { Connection } from '@solana/web3.js'
|
|
3
3
|
import { getRpcUrls } from '../rpc.js'
|
|
4
|
-
import { isJitoRpc } from './jito/isJitoRpc.js'
|
|
5
4
|
import { JitoConnection } from './jito/JitoConnection.js'
|
|
6
5
|
|
|
7
|
-
/**
|
|
8
|
-
* Detect the cluster (network) from an RPC URL
|
|
9
|
-
*/
|
|
10
|
-
const detectCluster = (rpcUrl: string): Cluster => {
|
|
11
|
-
const url = rpcUrl.toLowerCase()
|
|
12
|
-
if (url.includes('devnet')) {
|
|
13
|
-
return 'devnet'
|
|
14
|
-
}
|
|
15
|
-
if (url.includes('testnet')) {
|
|
16
|
-
return 'testnet'
|
|
17
|
-
}
|
|
18
|
-
return 'mainnet-beta'
|
|
19
|
-
}
|
|
20
|
-
|
|
21
6
|
const connections = new Map<string, Connection | JitoConnection>()
|
|
22
7
|
|
|
23
8
|
/**
|
|
@@ -28,8 +13,8 @@ const ensureConnections = async (): Promise<void> => {
|
|
|
28
13
|
const rpcUrls = await getRpcUrls(ChainId.SOL)
|
|
29
14
|
for (const rpcUrl of rpcUrls) {
|
|
30
15
|
if (!connections.get(rpcUrl)) {
|
|
31
|
-
const connection = (await isJitoRpc(rpcUrl))
|
|
32
|
-
? new JitoConnection(rpcUrl
|
|
16
|
+
const connection = (await JitoConnection.isJitoRpc(rpcUrl))
|
|
17
|
+
? new JitoConnection(rpcUrl)
|
|
33
18
|
: new Connection(rpcUrl)
|
|
34
19
|
connections.set(rpcUrl, connection)
|
|
35
20
|
}
|
|
@@ -38,17 +23,19 @@ const ensureConnections = async (): Promise<void> => {
|
|
|
38
23
|
|
|
39
24
|
/**
|
|
40
25
|
* Wrapper around getting the connection (RPC provider) for Solana
|
|
41
|
-
*
|
|
26
|
+
* Returns only non-Jito RPC connections (excludes JitoConnection instances)
|
|
27
|
+
* @returns - Solana RPC connections (excluding Jito connections)
|
|
42
28
|
*/
|
|
43
|
-
export const getSolanaConnections = async (): Promise<
|
|
44
|
-
(Connection | JitoConnection)[]
|
|
45
|
-
> => {
|
|
29
|
+
export const getSolanaConnections = async (): Promise<Connection[]> => {
|
|
46
30
|
await ensureConnections()
|
|
47
|
-
return Array.from(connections.values())
|
|
31
|
+
return Array.from(connections.values()).filter(
|
|
32
|
+
(conn): conn is Connection =>
|
|
33
|
+
conn instanceof Connection && !(conn instanceof JitoConnection)
|
|
34
|
+
)
|
|
48
35
|
}
|
|
49
36
|
|
|
50
37
|
/**
|
|
51
|
-
* Get Jito-enabled connections only
|
|
38
|
+
* Get Jito-enabled connections only.
|
|
52
39
|
* @returns - Array of JitoConnection instances
|
|
53
40
|
*/
|
|
54
41
|
export const getJitoConnections = async (): Promise<JitoConnection[]> => {
|
|
@@ -78,5 +65,5 @@ export async function callSolanaWithRetry<R>(
|
|
|
78
65
|
}
|
|
79
66
|
}
|
|
80
67
|
// Throw the last encountered error
|
|
81
|
-
throw lastError
|
|
68
|
+
throw lastError || new Error('No Solana RPC connections available')
|
|
82
69
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Cluster,
|
|
3
|
-
Connection,
|
|
4
|
-
type VersionedTransaction,
|
|
5
|
-
} from '@solana/web3.js'
|
|
1
|
+
import { Connection, type VersionedTransaction } from '@solana/web3.js'
|
|
6
2
|
import { uint8ArrayToBase64 } from '../../../utils/uint8ArrayToBase64.js'
|
|
7
3
|
import { JITO_TIP_ACCOUNTS } from './constants.js'
|
|
8
4
|
|
|
@@ -17,41 +13,92 @@ export type SimulateBundleResult = {
|
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
|
|
16
|
+
export type BundleStatus = {
|
|
17
|
+
bundle_id: string
|
|
18
|
+
transactions: string[]
|
|
19
|
+
slot: number
|
|
20
|
+
confirmation_status: 'processed' | 'confirmed' | 'finalized'
|
|
21
|
+
err:
|
|
22
|
+
| {
|
|
23
|
+
Ok: null
|
|
24
|
+
}
|
|
25
|
+
| any
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type BundleStatusResult = {
|
|
29
|
+
context: {
|
|
30
|
+
slot: number
|
|
31
|
+
}
|
|
32
|
+
value: BundleStatus[]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Makes a direct RPC request to an endpoint
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
async function rpcRequest<T>(
|
|
40
|
+
endpoint: string,
|
|
41
|
+
method: string,
|
|
42
|
+
params: any[]
|
|
43
|
+
): Promise<T> {
|
|
44
|
+
const response = await fetch(endpoint, {
|
|
45
|
+
method: 'POST',
|
|
46
|
+
headers: {
|
|
47
|
+
'Content-Type': 'application/json',
|
|
48
|
+
},
|
|
49
|
+
body: JSON.stringify({
|
|
50
|
+
jsonrpc: '2.0',
|
|
51
|
+
id: 1,
|
|
52
|
+
method,
|
|
53
|
+
params,
|
|
54
|
+
}),
|
|
55
|
+
})
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
throw new Error(`Jito RPC Error: ${response.status} ${response.statusText}`)
|
|
58
|
+
}
|
|
59
|
+
const data = await response.json()
|
|
60
|
+
if (data.error) {
|
|
61
|
+
throw new Error(`Jito RPC Error: ${data.error.message}`)
|
|
62
|
+
}
|
|
63
|
+
return data.result
|
|
64
|
+
}
|
|
65
|
+
|
|
20
66
|
/**
|
|
21
67
|
* Extended Connection class with Jito bundle support
|
|
22
68
|
* Adds simulateBundle, sendBundle, and getTipAccounts methods
|
|
23
69
|
*/
|
|
24
70
|
export class JitoConnection extends Connection {
|
|
25
71
|
private tipAccountsCache: string[] | null = null
|
|
26
|
-
private cluster: Cluster
|
|
27
72
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Check if an RPC endpoint supports Jito bundles
|
|
75
|
+
* @param rpcUrl - The RPC endpoint URL to check
|
|
76
|
+
* @returns true if the endpoint supports Jito bundle methods
|
|
77
|
+
*/
|
|
78
|
+
static async isJitoRpc(rpcUrl: string): Promise<boolean> {
|
|
79
|
+
try {
|
|
80
|
+
// method exists if the request is successfull and doesn't throw an error
|
|
81
|
+
await rpcRequest(rpcUrl, 'getTipAccounts', [])
|
|
82
|
+
return true
|
|
83
|
+
} catch {
|
|
84
|
+
return false
|
|
85
|
+
}
|
|
31
86
|
}
|
|
32
87
|
|
|
33
88
|
/**
|
|
34
89
|
* Makes a direct RPC request to the Jito-enabled endpoint
|
|
35
90
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
method
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
body: JSON.stringify({
|
|
43
|
-
jsonrpc: '2.0',
|
|
44
|
-
id: 1,
|
|
45
|
-
method,
|
|
91
|
+
protected async rpcRequest<T>(method: string, params: any[]): Promise<T> {
|
|
92
|
+
try {
|
|
93
|
+
return await rpcRequest(this.rpcEndpoint, method, params)
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error(`Jito RPC request failed: ${method}`, {
|
|
96
|
+
endpoint: this.rpcEndpoint,
|
|
46
97
|
params,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const data = await response.json()
|
|
51
|
-
if (data.error) {
|
|
52
|
-
throw new Error(`Jito RPC Error: ${data.error.message}`)
|
|
98
|
+
error,
|
|
99
|
+
})
|
|
100
|
+
throw error
|
|
53
101
|
}
|
|
54
|
-
return data.result
|
|
55
102
|
}
|
|
56
103
|
|
|
57
104
|
/**
|
|
@@ -62,7 +109,7 @@ export class JitoConnection extends Connection {
|
|
|
62
109
|
}
|
|
63
110
|
|
|
64
111
|
/**
|
|
65
|
-
* Get the tip accounts from the Jito endpoint
|
|
112
|
+
* Get the tip accounts from the Jito endpoint, using fallbacks if results are empty
|
|
66
113
|
* Results are cached to avoid repeated RPC calls
|
|
67
114
|
*/
|
|
68
115
|
async getTipAccounts(): Promise<string[]> {
|
|
@@ -72,12 +119,15 @@ export class JitoConnection extends Connection {
|
|
|
72
119
|
|
|
73
120
|
try {
|
|
74
121
|
const accounts = await this.rpcRequest<string[]>('getTipAccounts', [])
|
|
122
|
+
if (!accounts.length) {
|
|
123
|
+
throw new Error('RPC has no tip accounts')
|
|
124
|
+
}
|
|
75
125
|
this.tipAccountsCache = accounts
|
|
76
126
|
return accounts
|
|
77
127
|
} catch (error) {
|
|
78
|
-
const fallbackAccounts = JITO_TIP_ACCOUNTS
|
|
128
|
+
const fallbackAccounts = JITO_TIP_ACCOUNTS
|
|
79
129
|
console.warn(
|
|
80
|
-
`Failed to fetch tip accounts from RPC, using
|
|
130
|
+
`Failed to fetch tip accounts from RPC, using fallback`,
|
|
81
131
|
error
|
|
82
132
|
)
|
|
83
133
|
return fallbackAccounts
|
|
@@ -92,6 +142,15 @@ export class JitoConnection extends Connection {
|
|
|
92
142
|
return accounts[Math.floor(Math.random() * accounts.length)]
|
|
93
143
|
}
|
|
94
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Manually refresh the tip accounts cache
|
|
147
|
+
* Useful for long-running processes that may need updated tip accounts
|
|
148
|
+
*/
|
|
149
|
+
async refreshTipAccounts(): Promise<string[]> {
|
|
150
|
+
this.tipAccountsCache = null
|
|
151
|
+
return this.getTipAccounts()
|
|
152
|
+
}
|
|
153
|
+
|
|
95
154
|
/**
|
|
96
155
|
* Simulate a bundle before sending it
|
|
97
156
|
* @param bundle - Array of signed transactions
|
|
@@ -119,4 +178,13 @@ export class JitoConnection extends Connection {
|
|
|
119
178
|
)
|
|
120
179
|
return this.rpcRequest<string>('sendBundle', [encodedTransactions])
|
|
121
180
|
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Get the status of submitted bundles
|
|
184
|
+
* @param bundleIds - Array of bundle UUIDs to check
|
|
185
|
+
* @returns Bundle status information
|
|
186
|
+
*/
|
|
187
|
+
async getBundleStatuses(bundleIds: string[]): Promise<BundleStatusResult> {
|
|
188
|
+
return this.rpcRequest<BundleStatusResult>('getBundleStatuses', [bundleIds])
|
|
189
|
+
}
|
|
122
190
|
}
|
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
import type { Cluster } from '@solana/web3.js'
|
|
2
|
-
|
|
3
1
|
// Jito Tip accounts gotten from https://jito-foundation.gitbook.io/mev/mev-payment-and-distribution/on-chain-addresses
|
|
4
|
-
export const JITO_TIP_ACCOUNTS
|
|
5
|
-
'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
],
|
|
15
|
-
devnet: [],
|
|
16
|
-
testnet: [
|
|
17
|
-
'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