@lifi/sdk 3.15.6 → 3.15.7
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/package.json +4 -4
- package/src/_cjs/core/Solana/connection.js +6 -3
- package/src/_cjs/core/Solana/connection.js.map +1 -1
- package/src/_cjs/version.js +1 -1
- package/src/_esm/core/Solana/connection.js +6 -4
- package/src/_esm/core/Solana/connection.js.map +1 -1
- package/src/_esm/version.js +1 -1
- package/src/_types/core/Solana/connection.d.ts.map +1 -1
- package/src/_types/version.d.ts +1 -1
- package/src/core/Solana/connection.ts +9 -4
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"url": "https://github.com/lifinance/sdk/issues"
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@bigmi/core": "^0.
|
|
6
|
+
"@bigmi/core": "^0.7.0",
|
|
7
7
|
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
8
|
-
"@lifi/types": "17.
|
|
8
|
+
"@lifi/types": "17.65.0",
|
|
9
9
|
"@mysten/sui": "^1.45.2",
|
|
10
10
|
"@mysten/wallet-standard": "^0.19.9",
|
|
11
11
|
"@noble/curves": "^1.9.7",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"bech32": "^2.0.0",
|
|
15
15
|
"bitcoinjs-lib": "^7.0.1",
|
|
16
16
|
"bs58": "^6.0.0",
|
|
17
|
-
"viem": "^2.
|
|
17
|
+
"viem": "^2.46.3"
|
|
18
18
|
},
|
|
19
19
|
"description": "LI.FI Any-to-Any Cross-Chain-Swap SDK",
|
|
20
20
|
"exports": {
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"sideEffects": false,
|
|
71
71
|
"types": "./src/_types/index.d.ts",
|
|
72
72
|
"typings": "./src/_types/index.d.ts",
|
|
73
|
-
"version": "3.15.
|
|
73
|
+
"version": "3.15.7"
|
|
74
74
|
}
|
|
@@ -4,6 +4,7 @@ exports.getJitoConnections = exports.getSolanaConnections = void 0;
|
|
|
4
4
|
exports.callSolanaWithRetry = callSolanaWithRetry;
|
|
5
5
|
const types_1 = require("@lifi/types");
|
|
6
6
|
const web3_js_1 = require("@solana/web3.js");
|
|
7
|
+
const config_js_1 = require("../../config.js");
|
|
7
8
|
const rpc_js_1 = require("../rpc.js");
|
|
8
9
|
const JitoConnection_js_1 = require("./jito/JitoConnection.js");
|
|
9
10
|
const connections = new Map();
|
|
@@ -11,7 +12,9 @@ const ensureConnections = async () => {
|
|
|
11
12
|
const rpcUrls = await (0, rpc_js_1.getRpcUrls)(types_1.ChainId.SOL);
|
|
12
13
|
for (const rpcUrl of rpcUrls) {
|
|
13
14
|
if (!connections.get(rpcUrl)) {
|
|
14
|
-
const
|
|
15
|
+
const isJitoConnection = Boolean(config_js_1.config.get().routeOptions?.jitoBundle) &&
|
|
16
|
+
(await JitoConnection_js_1.JitoConnection.isJitoRpc(rpcUrl));
|
|
17
|
+
const connection = isJitoConnection
|
|
15
18
|
? new JitoConnection_js_1.JitoConnection(rpcUrl)
|
|
16
19
|
: new web3_js_1.Connection(rpcUrl);
|
|
17
20
|
connections.set(rpcUrl, connection);
|
|
@@ -29,9 +32,9 @@ const getJitoConnections = async () => {
|
|
|
29
32
|
};
|
|
30
33
|
exports.getJitoConnections = getJitoConnections;
|
|
31
34
|
async function callSolanaWithRetry(fn) {
|
|
32
|
-
await
|
|
35
|
+
const solanaConnections = await (0, exports.getSolanaConnections)();
|
|
33
36
|
let lastError = null;
|
|
34
|
-
for (const connection of
|
|
37
|
+
for (const connection of solanaConnections) {
|
|
35
38
|
try {
|
|
36
39
|
const result = await fn(connection);
|
|
37
40
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../core/Solana/connection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../core/Solana/connection.ts"],"names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WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAC5C,CAAC,IAAI,EAA0B,EAAE,CAAC,IAAI,YAAY,kCAAc,CACjE,CAAA;AACH,CAAC,CAAA;AALY,QAAA,kBAAkB,sBAK9B;AAOM,KAAK,UAAU,mBAAmB,CACvC,EAA0C;IAE1C,MAAM,iBAAiB,GAAG,MAAM,IAAA,4BAAoB,GAAE,CAAA;IACtD,IAAI,SAAS,GAAQ,IAAI,CAAA;IACzB,KAAK,MAAM,UAAU,IAAI,iBAAiB,EAAE,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,CAAA;YACnC,OAAO,MAAM,CAAA;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,GAAG,KAAK,CAAA;QACnB,CAAC;IACH,CAAC;IAED,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;AACrE,CAAC"}
|
package/src/_cjs/version.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChainId } from '@lifi/types';
|
|
2
2
|
import { Connection } from '@solana/web3.js';
|
|
3
|
+
import { config } from '../../config.js';
|
|
3
4
|
import { getRpcUrls } from '../rpc.js';
|
|
4
5
|
import { JitoConnection } from './jito/JitoConnection.js';
|
|
5
6
|
const connections = new Map();
|
|
@@ -11,7 +12,9 @@ const ensureConnections = async () => {
|
|
|
11
12
|
const rpcUrls = await getRpcUrls(ChainId.SOL);
|
|
12
13
|
for (const rpcUrl of rpcUrls) {
|
|
13
14
|
if (!connections.get(rpcUrl)) {
|
|
14
|
-
const
|
|
15
|
+
const isJitoConnection = Boolean(config.get().routeOptions?.jitoBundle) &&
|
|
16
|
+
(await JitoConnection.isJitoRpc(rpcUrl));
|
|
17
|
+
const connection = isJitoConnection
|
|
15
18
|
? new JitoConnection(rpcUrl)
|
|
16
19
|
: new Connection(rpcUrl);
|
|
17
20
|
connections.set(rpcUrl, connection);
|
|
@@ -41,10 +44,9 @@ export const getJitoConnections = async () => {
|
|
|
41
44
|
* @returns - The result of the function call.
|
|
42
45
|
*/
|
|
43
46
|
export async function callSolanaWithRetry(fn) {
|
|
44
|
-
|
|
45
|
-
await ensureConnections();
|
|
47
|
+
const solanaConnections = await getSolanaConnections();
|
|
46
48
|
let lastError = null;
|
|
47
|
-
for (const connection of
|
|
49
|
+
for (const connection of solanaConnections) {
|
|
48
50
|
try {
|
|
49
51
|
const result = await fn(connection);
|
|
50
52
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../core/Solana/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuC,CAAA;AAElE;;;GAGG;AACH,MAAM,iBAAiB,GAAG,KAAK,IAAmB,EAAE;IAClD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,MAAM,
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../core/Solana/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO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CAC5C,CAAC,IAAI,EAA0B,EAAE,CAAC,IAAI,YAAY,cAAc,CACjE,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,EAA0C;IAE1C,MAAM,iBAAiB,GAAG,MAAM,oBAAoB,EAAE,CAAA;IACtD,IAAI,SAAS,GAAQ,IAAI,CAAA;IACzB,KAAK,MAAM,UAAU,IAAI,iBAAiB,EAAE,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,CAAA;YACnC,OAAO,MAAM,CAAA;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,GAAG,KAAK,CAAA;QACnB,CAAC;IACH,CAAC;IACD,mCAAmC;IACnC,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;AACrE,CAAC"}
|
package/src/_esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../core/Solana/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../core/Solana/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAyBzD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,UAAU,EAAE,CAMjE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,cAAc,EAAE,CAKnE,CAAA;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GACzC,OAAO,CAAC,CAAC,CAAC,CAaZ"}
|
package/src/_types/version.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChainId } from '@lifi/types'
|
|
2
2
|
import { Connection } from '@solana/web3.js'
|
|
3
|
+
import { config } from '../../config.js'
|
|
3
4
|
import { getRpcUrls } from '../rpc.js'
|
|
4
5
|
import { JitoConnection } from './jito/JitoConnection.js'
|
|
5
6
|
|
|
@@ -13,9 +14,14 @@ const ensureConnections = async (): Promise<void> => {
|
|
|
13
14
|
const rpcUrls = await getRpcUrls(ChainId.SOL)
|
|
14
15
|
for (const rpcUrl of rpcUrls) {
|
|
15
16
|
if (!connections.get(rpcUrl)) {
|
|
16
|
-
const
|
|
17
|
+
const isJitoConnection =
|
|
18
|
+
Boolean(config.get().routeOptions?.jitoBundle) &&
|
|
19
|
+
(await JitoConnection.isJitoRpc(rpcUrl))
|
|
20
|
+
|
|
21
|
+
const connection = isJitoConnection
|
|
17
22
|
? new JitoConnection(rpcUrl)
|
|
18
23
|
: new Connection(rpcUrl)
|
|
24
|
+
|
|
19
25
|
connections.set(rpcUrl, connection)
|
|
20
26
|
}
|
|
21
27
|
}
|
|
@@ -53,10 +59,9 @@ export const getJitoConnections = async (): Promise<JitoConnection[]> => {
|
|
|
53
59
|
export async function callSolanaWithRetry<R>(
|
|
54
60
|
fn: (connection: Connection) => Promise<R>
|
|
55
61
|
): Promise<R> {
|
|
56
|
-
|
|
57
|
-
await ensureConnections()
|
|
62
|
+
const solanaConnections = await getSolanaConnections()
|
|
58
63
|
let lastError: any = null
|
|
59
|
-
for (const connection of
|
|
64
|
+
for (const connection of solanaConnections) {
|
|
60
65
|
try {
|
|
61
66
|
const result = await fn(connection)
|
|
62
67
|
return result
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk'
|
|
2
|
-
export const version = '3.15.
|
|
2
|
+
export const version = '3.15.7'
|