@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.
Files changed (110) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/SolanaProvider.d.ts +0 -1
  3. package/dist/cjs/actions/getSolanaBalance.d.ts +0 -1
  4. package/dist/cjs/actions/getSolanaBalance.js.map +1 -1
  5. package/dist/cjs/actions/sendAndConfirmBundle.d.ts +7 -8
  6. package/dist/cjs/actions/sendAndConfirmTransaction.d.ts +6 -7
  7. package/dist/cjs/core/SolanaStepExecutor.d.ts +0 -1
  8. package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +0 -1
  9. package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.d.ts +0 -1
  10. package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.js +6 -2
  11. package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.js.map +1 -1
  12. package/dist/cjs/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +0 -1
  13. package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.d.ts +0 -1
  14. package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.js +1 -4
  15. package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.js.map +1 -1
  16. package/dist/cjs/errors/parseSolanaErrors.d.ts +0 -1
  17. package/dist/cjs/rpc/jito/api/getBundleStatuses.d.ts +3 -4
  18. package/dist/cjs/rpc/jito/api/getTipAccounts.d.ts +4 -5
  19. package/dist/cjs/rpc/jito/api/sendBundle.d.ts +10 -11
  20. package/dist/cjs/rpc/jito/api/simulateBundle.d.ts +12 -8
  21. package/dist/cjs/rpc/jito/createJitoRpc.d.ts +0 -1
  22. package/dist/cjs/rpc/jito/types.d.ts +2 -2
  23. package/dist/cjs/rpc/registry.d.ts +11 -9
  24. package/dist/cjs/rpc/registry.js +16 -2
  25. package/dist/cjs/rpc/registry.js.map +1 -1
  26. package/dist/cjs/rpc/types.d.ts +0 -1
  27. package/dist/cjs/rpc/utils.d.ts +53 -54
  28. package/dist/cjs/types.d.ts +5 -1
  29. package/dist/cjs/types.js.map +1 -1
  30. package/dist/cjs/utils/KeypairWalletAdapter.d.ts +9 -10
  31. package/dist/cjs/utils/getWalletFeature.d.ts +15 -16
  32. package/dist/cjs/utils/solanaErrorCause.d.ts +4 -4
  33. package/dist/cjs/version.d.ts +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/cjs/version.js.map +1 -1
  36. package/dist/esm/SolanaProvider.d.ts +0 -1
  37. package/dist/esm/SolanaProvider.d.ts.map +1 -1
  38. package/dist/esm/actions/getSNSAddress.d.ts.map +1 -1
  39. package/dist/esm/actions/getSolanaBalance.d.ts +0 -1
  40. package/dist/esm/actions/getSolanaBalance.d.ts.map +1 -1
  41. package/dist/esm/actions/resolveSolanaAddress.d.ts.map +1 -1
  42. package/dist/esm/actions/sendAndConfirmBundle.d.ts +7 -8
  43. package/dist/esm/actions/sendAndConfirmBundle.d.ts.map +1 -1
  44. package/dist/esm/actions/sendAndConfirmTransaction.d.ts +6 -7
  45. package/dist/esm/actions/sendAndConfirmTransaction.d.ts.map +1 -1
  46. package/dist/esm/core/SolanaStepExecutor.d.ts +0 -1
  47. package/dist/esm/core/SolanaStepExecutor.d.ts.map +1 -1
  48. package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +0 -1
  49. package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts.map +1 -1
  50. package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts +0 -1
  51. package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts.map +1 -1
  52. package/dist/esm/core/tasks/SolanaSignAndExecuteTask.js +6 -2
  53. package/dist/esm/core/tasks/SolanaSignAndExecuteTask.js.map +1 -1
  54. package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +0 -1
  55. package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts.map +1 -1
  56. package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts +0 -1
  57. package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts.map +1 -1
  58. package/dist/esm/core/tasks/SolanaWaitForTransactionTask.js +1 -4
  59. package/dist/esm/core/tasks/SolanaWaitForTransactionTask.js.map +1 -1
  60. package/dist/esm/errors/parseSolanaErrors.d.ts +0 -1
  61. package/dist/esm/errors/parseSolanaErrors.d.ts.map +1 -1
  62. package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts +3 -4
  63. package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts.map +1 -1
  64. package/dist/esm/rpc/jito/api/getTipAccounts.d.ts +4 -5
  65. package/dist/esm/rpc/jito/api/getTipAccounts.d.ts.map +1 -1
  66. package/dist/esm/rpc/jito/api/sendBundle.d.ts +10 -11
  67. package/dist/esm/rpc/jito/api/sendBundle.d.ts.map +1 -1
  68. package/dist/esm/rpc/jito/api/simulateBundle.d.ts +12 -8
  69. package/dist/esm/rpc/jito/api/simulateBundle.d.ts.map +1 -1
  70. package/dist/esm/rpc/jito/createJitoRpc.d.ts +0 -1
  71. package/dist/esm/rpc/jito/createJitoRpc.d.ts.map +1 -1
  72. package/dist/esm/rpc/jito/types.d.ts +2 -2
  73. package/dist/esm/rpc/jito/types.d.ts.map +1 -1
  74. package/dist/esm/rpc/registry.d.ts +11 -9
  75. package/dist/esm/rpc/registry.d.ts.map +1 -1
  76. package/dist/esm/rpc/registry.js +16 -2
  77. package/dist/esm/rpc/registry.js.map +1 -1
  78. package/dist/esm/rpc/types.d.ts +0 -1
  79. package/dist/esm/rpc/types.d.ts.map +1 -1
  80. package/dist/esm/rpc/utils.d.ts +53 -54
  81. package/dist/esm/rpc/utils.d.ts.map +1 -1
  82. package/dist/esm/types.d.ts +5 -1
  83. package/dist/esm/types.d.ts.map +1 -1
  84. package/dist/esm/types.js.map +1 -1
  85. package/dist/esm/utils/KeypairWallet.unit.helpers.d.ts.map +1 -1
  86. package/dist/esm/utils/KeypairWalletAdapter.d.ts +9 -10
  87. package/dist/esm/utils/KeypairWalletAdapter.d.ts.map +1 -1
  88. package/dist/esm/utils/base64ToUint8Array.d.ts.map +1 -1
  89. package/dist/esm/utils/getWalletFeature.d.ts +15 -16
  90. package/dist/esm/utils/getWalletFeature.d.ts.map +1 -1
  91. package/dist/esm/utils/solanaErrorCause.d.ts +4 -4
  92. package/dist/esm/utils/solanaErrorCause.d.ts.map +1 -1
  93. package/dist/esm/version.d.ts +1 -1
  94. package/dist/esm/version.d.ts.map +1 -1
  95. package/dist/esm/version.js +1 -1
  96. package/dist/esm/version.js.map +1 -1
  97. package/package.json +2 -2
  98. package/src/core/tasks/SolanaSignAndExecuteTask.ts +9 -5
  99. package/src/core/tasks/SolanaWaitForTransactionTask.ts +5 -11
  100. package/src/rpc/registry.ts +18 -2
  101. package/src/types.ts +5 -0
  102. package/src/version.ts +1 -1
  103. package/dist/cjs/utils/shouldUseJitoBundle.d.ts +0 -8
  104. package/dist/cjs/utils/shouldUseJitoBundle.js +0 -12
  105. package/dist/cjs/utils/shouldUseJitoBundle.js.map +0 -1
  106. package/dist/esm/utils/shouldUseJitoBundle.d.ts +0 -8
  107. package/dist/esm/utils/shouldUseJitoBundle.d.ts.map +0 -1
  108. package/dist/esm/utils/shouldUseJitoBundle.js +0 -11
  109. package/dist/esm/utils/shouldUseJitoBundle.js.map +0 -1
  110. package/src/utils/shouldUseJitoBundle.ts +0 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @lifi/sdk-provider-solana
2
2
 
3
+ ## 4.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#409](https://github.com/lifinance/sdk/pull/409) [`f6f8865`](https://github.com/lifinance/sdk/commit/f6f88653ead19f0f2279d7ad9af6851892211912) Thanks [@chybisov](https://github.com/chybisov)! - Fix Solana Jito bundle execution (EMB-462). The executor now routes by the shape of the backend's `transactionRequest.data` — an array is submitted via `sendBundle`, a string via `sendTransaction` — instead of inferring it from the signed-transaction count. The Jito-capable RPC probe now uses `getBundleStatuses` instead of `getTipAccounts`, so providers such as Helius (which support `sendBundle`/`getBundleStatuses` but not `getTipAccounts`) are correctly detected and bundles submit successfully.
8
+
9
+ - Updated dependencies [[`d8b7adb`](https://github.com/lifinance/sdk/commit/d8b7adb6f797734f25d8c7d458121752a2567998), [`08b54da`](https://github.com/lifinance/sdk/commit/08b54dadebef063bc20af06630f0e43ec5850dca)]:
10
+ - @lifi/sdk@4.3.0
11
+
12
+ ## 4.0.4
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`0990a5d`](https://github.com/lifinance/sdk/commit/0990a5d2dcb148c113e41aeeab38eb1bcc5c684e)]:
17
+ - @lifi/sdk@4.2.0
18
+
3
19
  ## 4.0.3
4
20
 
5
21
  ### Patch Changes
@@ -1,5 +1,4 @@
1
1
  import { SolanaProviderOptions, SolanaSDKProvider } from "./types.js";
2
-
3
2
  //#region src/SolanaProvider.d.ts
4
3
  declare function SolanaProvider(options?: SolanaProviderOptions): SolanaSDKProvider;
5
4
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { SDKClient, Token, TokenAmount } from "@lifi/sdk";
2
-
3
2
  //#region src/actions/getSolanaBalance.d.ts
4
3
  declare const getSolanaBalance: (client: SDKClient, walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getSolanaBalance.js","names":["callSolanaRpcsWithRetry"],"sources":["../../../src/actions/getSolanaBalance.ts"],"sourcesContent":["import type { SDKClient } from '@lifi/sdk'\nimport {\n type ChainId,\n type Token,\n type TokenAmount,\n withDedupe,\n} from '@lifi/sdk'\nimport { address, type JsonParsedTokenAccount } from '@solana/kit'\n\nimport { callSolanaRpcsWithRetry } from '../rpc/utils.js'\n\nconst SolSystemProgram = '11111111111111111111111111111111'\nconst TokenProgramId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'\nconst Token2022ProgramId = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'\n\nexport const getSolanaBalance = async (\n client: SDKClient,\n walletAddress: string,\n tokens: Token[]\n): Promise<TokenAmount[]> => {\n if (tokens.length === 0) {\n return []\n }\n const { chainId } = tokens[0]\n for (const token of tokens) {\n if (token.chainId !== chainId) {\n console.warn('Requested tokens have to be on the same chain.')\n }\n }\n\n return getSolanaBalanceDefault(client, chainId, tokens, walletAddress)\n}\n\nconst getSolanaBalanceDefault = async (\n client: SDKClient,\n _chainId: ChainId,\n tokens: Token[],\n walletAddress: string\n): Promise<TokenAmount[]> => {\n // Convert addresses to Solana Kit's address type\n const accountAddress = address(walletAddress)\n const tokenProgramAddress = address(TokenProgramId)\n const token2022ProgramAddress = address(Token2022ProgramId)\n\n // Use Solana Kit's RPC API with the retry wrapper\n const [slot, balance, tokenAccountsByOwner, token2022AccountsByOwner] =\n await Promise.allSettled([\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc.getSlot({ commitment: 'confirmed' }).send()\n ),\n { id: `${getSolanaBalanceDefault.name}.getSlot` }\n ),\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc.getBalance(accountAddress, { commitment: 'confirmed' }).send()\n ),\n { id: `${getSolanaBalanceDefault.name}.getBalance` }\n ),\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc\n .getTokenAccountsByOwner(\n accountAddress,\n {\n programId: tokenProgramAddress,\n },\n {\n commitment: 'confirmed',\n encoding: 'jsonParsed',\n }\n )\n .send()\n ),\n {\n id: `${getSolanaBalanceDefault.name}.getTokenAccountsByOwner.${TokenProgramId}`,\n }\n ),\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc\n .getTokenAccountsByOwner(\n accountAddress,\n {\n programId: token2022ProgramAddress,\n },\n {\n commitment: 'confirmed',\n encoding: 'jsonParsed',\n }\n )\n .send()\n ),\n {\n id: `${getSolanaBalanceDefault.name}.getTokenAccountsByOwner.${Token2022ProgramId}`,\n }\n ),\n ])\n const blockNumber = slot.status === 'fulfilled' ? BigInt(slot.value) : 0n\n const nativeBalanceOk = balance.status === 'fulfilled'\n const solBalance = nativeBalanceOk ? BigInt(balance.value.value) : 0n\n const tokenProgramOk = tokenAccountsByOwner.status === 'fulfilled'\n const token2022ProgramOk = token2022AccountsByOwner.status === 'fulfilled'\n\n const walletTokenAmounts = [\n ...(tokenProgramOk ? tokenAccountsByOwner.value.value : []),\n ...(token2022ProgramOk ? token2022AccountsByOwner.value.value : []),\n ].reduce(\n (tokenAmounts: Record<string, bigint>, value) => {\n const tokenAccount: JsonParsedTokenAccount =\n value.account.data.parsed.info\n const amount = BigInt(tokenAccount.tokenAmount.amount)\n if (amount > 0n) {\n tokenAmounts[tokenAccount.mint] =\n (tokenAmounts[tokenAccount.mint] ?? 0n) + amount\n }\n return tokenAmounts\n },\n {} as Record<string, bigint>\n )\n\n // We can only confidently report 0n for an SPL mint when both Token and\n // Token2022 program queries succeeded — otherwise the mint may live in the\n // program whose query failed (e.g. PYUSD on Token2022).\n const splZeroIsKnown = tokenProgramOk && token2022ProgramOk\n\n const tokenAmounts: TokenAmount[] = tokens.map((token) => {\n const isNative = token.address === SolSystemProgram\n if (isNative) {\n if (!nativeBalanceOk) {\n return { ...token, blockNumber }\n }\n return { ...token, amount: solBalance, blockNumber }\n }\n const found = walletTokenAmounts[token.address]\n if (found !== undefined) {\n return { ...token, amount: found, blockNumber }\n }\n if (splZeroIsKnown) {\n return { ...token, amount: 0n, blockNumber }\n }\n return { ...token, blockNumber }\n })\n return tokenAmounts\n}\n"],"mappings":";;;;;AAWA,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAE3B,MAAa,mBAAmB,OAC9B,QACA,eACA,WAC2B;CAC3B,IAAI,OAAO,WAAW,GACpB,OAAO,CAAC;CAEV,MAAM,EAAE,YAAY,OAAO;CAC3B,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,YAAY,SACpB,QAAQ,KAAK,gDAAgD;CAIjE,OAAO,wBAAwB,QAAQ,SAAS,QAAQ,aAAa;AACvE;AAEA,MAAM,0BAA0B,OAC9B,QACA,UACA,QACA,kBAC2B;CAE3B,MAAM,kBAAA,GAAA,YAAA,QAAA,CAAyB,aAAa;CAC5C,MAAM,uBAAA,GAAA,YAAA,QAAA,CAA8B,cAAc;CAClD,MAAM,2BAAA,GAAA,YAAA,QAAA,CAAkC,kBAAkB;CAG1D,MAAM,CAAC,MAAM,SAAS,sBAAsB,4BAC1C,MAAM,QAAQ,WAAW;kCAGnBA,kBAAAA,wBAAwB,SAAS,QAC/B,IAAI,QAAQ,EAAE,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CAChD,GACF,EAAE,IAAI,GAAG,wBAAwB,KAAK,UAAU,CAClD;kCAGIA,kBAAAA,wBAAwB,SAAS,QAC/B,IAAI,WAAW,gBAAgB,EAAE,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CACnE,GACF,EAAE,IAAI,GAAG,wBAAwB,KAAK,aAAa,CACrD;kCAGIA,kBAAAA,wBAAwB,SAAS,QAC/B,IACG,wBACC,gBACA,EACE,WAAW,oBACb,GACA;GACE,YAAY;GACZ,UAAU;EACZ,CACF,CAAC,CACA,KAAK,CACV,GACF,EACE,IAAI,GAAG,wBAAwB,KAAK,2BAA2B,iBACjE,CACF;kCAGIA,kBAAAA,wBAAwB,SAAS,QAC/B,IACG,wBACC,gBACA,EACE,WAAW,wBACb,GACA;GACE,YAAY;GACZ,UAAU;EACZ,CACF,CAAC,CACA,KAAK,CACV,GACF,EACE,IAAI,GAAG,wBAAwB,KAAK,2BAA2B,qBACjE,CACF;CACF,CAAC;CACH,MAAM,cAAc,KAAK,WAAW,cAAc,OAAO,KAAK,KAAK,IAAI;CACvE,MAAM,kBAAkB,QAAQ,WAAW;CAC3C,MAAM,aAAa,kBAAkB,OAAO,QAAQ,MAAM,KAAK,IAAI;CACnE,MAAM,iBAAiB,qBAAqB,WAAW;CACvD,MAAM,qBAAqB,yBAAyB,WAAW;CAE/D,MAAM,qBAAqB,CACzB,GAAI,iBAAiB,qBAAqB,MAAM,QAAQ,CAAC,GACzD,GAAI,qBAAqB,yBAAyB,MAAM,QAAQ,CAAC,CACnE,CAAC,CAAC,QACC,cAAsC,UAAU;EAC/C,MAAM,eACJ,MAAM,QAAQ,KAAK,OAAO;EAC5B,MAAM,SAAS,OAAO,aAAa,YAAY,MAAM;EACrD,IAAI,SAAS,IACX,aAAa,aAAa,SACvB,aAAa,aAAa,SAAS,MAAM;EAE9C,OAAO;CACT,GACA,CAAC,CACH;CAKA,MAAM,iBAAiB,kBAAkB;CAmBzC,OAjBoC,OAAO,KAAK,UAAU;EAExD,IADiB,MAAM,YAAY,kBACrB;GACZ,IAAI,CAAC,iBACH,OAAO;IAAE,GAAG;IAAO;GAAY;GAEjC,OAAO;IAAE,GAAG;IAAO,QAAQ;IAAY;GAAY;EACrD;EACA,MAAM,QAAQ,mBAAmB,MAAM;EACvC,IAAI,UAAU,KAAA,GACZ,OAAO;GAAE,GAAG;GAAO,QAAQ;GAAO;EAAY;EAEhD,IAAI,gBACF,OAAO;GAAE,GAAG;GAAO,QAAQ;GAAI;EAAY;EAE7C,OAAO;GAAE,GAAG;GAAO;EAAY;CACjC,CACkB;AACpB"}
1
+ {"version":3,"file":"getSolanaBalance.js","names":["callSolanaRpcsWithRetry"],"sources":["../../../src/actions/getSolanaBalance.ts"],"sourcesContent":["import type { SDKClient } from '@lifi/sdk'\nimport {\n type ChainId,\n type Token,\n type TokenAmount,\n withDedupe,\n} from '@lifi/sdk'\nimport { address, type JsonParsedTokenAccount } from '@solana/kit'\n\nimport { callSolanaRpcsWithRetry } from '../rpc/utils.js'\n\nconst SolSystemProgram = '11111111111111111111111111111111'\nconst TokenProgramId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'\nconst Token2022ProgramId = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'\n\nexport const getSolanaBalance = async (\n client: SDKClient,\n walletAddress: string,\n tokens: Token[]\n): Promise<TokenAmount[]> => {\n if (tokens.length === 0) {\n return []\n }\n const { chainId } = tokens[0]\n for (const token of tokens) {\n if (token.chainId !== chainId) {\n console.warn('Requested tokens have to be on the same chain.')\n }\n }\n\n return getSolanaBalanceDefault(client, chainId, tokens, walletAddress)\n}\n\nconst getSolanaBalanceDefault = async (\n client: SDKClient,\n _chainId: ChainId,\n tokens: Token[],\n walletAddress: string\n): Promise<TokenAmount[]> => {\n // Convert addresses to Solana Kit's address type\n const accountAddress = address(walletAddress)\n const tokenProgramAddress = address(TokenProgramId)\n const token2022ProgramAddress = address(Token2022ProgramId)\n\n // Use Solana Kit's RPC API with the retry wrapper\n const [slot, balance, tokenAccountsByOwner, token2022AccountsByOwner] =\n await Promise.allSettled([\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc.getSlot({ commitment: 'confirmed' }).send()\n ),\n { id: `${getSolanaBalanceDefault.name}.getSlot` }\n ),\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc.getBalance(accountAddress, { commitment: 'confirmed' }).send()\n ),\n { id: `${getSolanaBalanceDefault.name}.getBalance` }\n ),\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc\n .getTokenAccountsByOwner(\n accountAddress,\n {\n programId: tokenProgramAddress,\n },\n {\n commitment: 'confirmed',\n encoding: 'jsonParsed',\n }\n )\n .send()\n ),\n {\n id: `${getSolanaBalanceDefault.name}.getTokenAccountsByOwner.${TokenProgramId}`,\n }\n ),\n withDedupe(\n () =>\n callSolanaRpcsWithRetry(client, (rpc) =>\n rpc\n .getTokenAccountsByOwner(\n accountAddress,\n {\n programId: token2022ProgramAddress,\n },\n {\n commitment: 'confirmed',\n encoding: 'jsonParsed',\n }\n )\n .send()\n ),\n {\n id: `${getSolanaBalanceDefault.name}.getTokenAccountsByOwner.${Token2022ProgramId}`,\n }\n ),\n ])\n const blockNumber = slot.status === 'fulfilled' ? BigInt(slot.value) : 0n\n const nativeBalanceOk = balance.status === 'fulfilled'\n const solBalance = nativeBalanceOk ? BigInt(balance.value.value) : 0n\n const tokenProgramOk = tokenAccountsByOwner.status === 'fulfilled'\n const token2022ProgramOk = token2022AccountsByOwner.status === 'fulfilled'\n\n const walletTokenAmounts = [\n ...(tokenProgramOk ? tokenAccountsByOwner.value.value : []),\n ...(token2022ProgramOk ? token2022AccountsByOwner.value.value : []),\n ].reduce(\n (tokenAmounts: Record<string, bigint>, value) => {\n const tokenAccount: JsonParsedTokenAccount =\n value.account.data.parsed.info\n const amount = BigInt(tokenAccount.tokenAmount.amount)\n if (amount > 0n) {\n tokenAmounts[tokenAccount.mint] =\n (tokenAmounts[tokenAccount.mint] ?? 0n) + amount\n }\n return tokenAmounts\n },\n {} as Record<string, bigint>\n )\n\n // We can only confidently report 0n for an SPL mint when both Token and\n // Token2022 program queries succeeded — otherwise the mint may live in the\n // program whose query failed (e.g. PYUSD on Token2022).\n const splZeroIsKnown = tokenProgramOk && token2022ProgramOk\n\n const tokenAmounts: TokenAmount[] = tokens.map((token) => {\n const isNative = token.address === SolSystemProgram\n if (isNative) {\n if (!nativeBalanceOk) {\n return { ...token, blockNumber }\n }\n return { ...token, amount: solBalance, blockNumber }\n }\n const found = walletTokenAmounts[token.address]\n if (found !== undefined) {\n return { ...token, amount: found, blockNumber }\n }\n if (splZeroIsKnown) {\n return { ...token, amount: 0n, blockNumber }\n }\n return { ...token, blockNumber }\n })\n return tokenAmounts\n}\n"],"mappings":";;;;;AAWA,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;AAE3B,MAAa,mBAAmB,OAC9B,QACA,eACA,WAC2B;CAC3B,IAAI,OAAO,WAAW,GACpB,OAAO,CAAC;CAEV,MAAM,EAAE,YAAY,OAAO;CAC3B,KAAK,MAAM,SAAS,QAClB,IAAI,MAAM,YAAY,SACpB,QAAQ,KAAK,gDAAgD;CAIjE,OAAO,wBAAwB,QAAQ,SAAS,QAAQ,aAAa;AACvE;AAEA,MAAM,0BAA0B,OAC9B,QACA,UACA,QACA,kBAC2B;CAE3B,MAAM,kBAAA,GAAA,YAAA,QAAA,CAAyB,aAAa;CAC5C,MAAM,uBAAA,GAAA,YAAA,QAAA,CAA8B,cAAc;CAClD,MAAM,2BAAA,GAAA,YAAA,QAAA,CAAkC,kBAAkB;CAG1D,MAAM,CAAC,MAAM,SAAS,sBAAsB,4BAC1C,MAAM,QAAQ,WAAW;GAGnBA,GAAAA,UAAAA,WAAAA,OAAAA,kBAAAA,wBAAwB,SAAS,QAC/B,IAAI,QAAQ,EAAE,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CAChD,GACF,EAAE,IAAI,GAAG,wBAAwB,KAAK,UAAU,CAClD;GAGIA,GAAAA,UAAAA,WAAAA,OAAAA,kBAAAA,wBAAwB,SAAS,QAC/B,IAAI,WAAW,gBAAgB,EAAE,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CACnE,GACF,EAAE,IAAI,GAAG,wBAAwB,KAAK,aAAa,CACrD;GAGIA,GAAAA,UAAAA,WAAAA,OAAAA,kBAAAA,wBAAwB,SAAS,QAC/B,IACG,wBACC,gBACA,EACE,WAAW,oBACb,GACA;GACE,YAAY;GACZ,UAAU;EACZ,CACF,CAAC,CACA,KAAK,CACV,GACF,EACE,IAAI,GAAG,wBAAwB,KAAK,2BAA2B,iBACjE,CACF;GAGIA,GAAAA,UAAAA,WAAAA,OAAAA,kBAAAA,wBAAwB,SAAS,QAC/B,IACG,wBACC,gBACA,EACE,WAAW,wBACb,GACA;GACE,YAAY;GACZ,UAAU;EACZ,CACF,CAAC,CACA,KAAK,CACV,GACF,EACE,IAAI,GAAG,wBAAwB,KAAK,2BAA2B,qBACjE,CACF;CACF,CAAC;CACH,MAAM,cAAc,KAAK,WAAW,cAAc,OAAO,KAAK,KAAK,IAAI;CACvE,MAAM,kBAAkB,QAAQ,WAAW;CAC3C,MAAM,aAAa,kBAAkB,OAAO,QAAQ,MAAM,KAAK,IAAI;CACnE,MAAM,iBAAiB,qBAAqB,WAAW;CACvD,MAAM,qBAAqB,yBAAyB,WAAW;CAE/D,MAAM,qBAAqB,CACzB,GAAI,iBAAiB,qBAAqB,MAAM,QAAQ,CAAC,GACzD,GAAI,qBAAqB,yBAAyB,MAAM,QAAQ,CAAC,CACnE,CAAC,CAAC,QACC,cAAsC,UAAU;EAC/C,MAAM,eACJ,MAAM,QAAQ,KAAK,OAAO;EAC5B,MAAM,SAAS,OAAO,aAAa,YAAY,MAAM;EACrD,IAAI,SAAS,IACX,aAAa,aAAa,SACvB,aAAa,aAAa,SAAS,MAAM;EAE9C,OAAO;CACT,GACA,CAAC,CACH;CAKA,MAAM,iBAAiB,kBAAkB;CAmBzC,OAjBoC,OAAO,KAAK,UAAU;EAExD,IADiB,MAAM,YAAY,kBACrB;GACZ,IAAI,CAAC,iBACH,OAAO;IAAE,GAAG;IAAO;GAAY;GAEjC,OAAO;IAAE,GAAG;IAAO,QAAQ;IAAY;GAAY;EACrD;EACA,MAAM,QAAQ,mBAAmB,MAAM;EACvC,IAAI,UAAU,KAAA,GACZ,OAAO;GAAE,GAAG;GAAO,QAAQ;GAAO;EAAY;EAEhD,IAAI,gBACF,OAAO;GAAE,GAAG;GAAO,QAAQ;GAAI;EAAY;EAE7C,OAAO;GAAE,GAAG;GAAO;EAAY;CACjC,CACkB;AACpB"}
@@ -1,6 +1,5 @@
1
1
  import { SDKClient } from "@lifi/sdk";
2
2
  import { Commitment, Signature, Transaction, TransactionError } 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,6 +1,5 @@
1
1
  import { SDKClient } from "@lifi/sdk";
2
2
  import { Commitment, Transaction, TransactionError } 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,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,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,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>;
@@ -11,7 +11,8 @@ var SolanaSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecutionTask {
11
11
  const action = statusManager.findAction(step, isBridgeExecution ? "CROSS_CHAIN" : "SWAP");
12
12
  if (!action) throw new _lifi_sdk.TransactionError(_lifi_sdk.LiFiErrorCode.TransactionUnprepared, "Unable to prepare transaction. Action not found.");
13
13
  const transactionRequestData = await (0, _lifi_sdk.getTransactionRequestData)(step, executionOptions);
14
- const transactionBytesArray = (Array.isArray(transactionRequestData) ? transactionRequestData : [transactionRequestData]).map((data) => require_utils_base64ToUint8Array.base64ToUint8Array(data));
14
+ const isBundleExecution = Array.isArray(transactionRequestData);
15
+ const transactionBytesArray = (isBundleExecution ? transactionRequestData : [transactionRequestData]).map((data) => require_utils_base64ToUint8Array.base64ToUint8Array(data));
15
16
  const signedTransactionOutputs = await (0, _lifi_sdk.withTimeout)(async () => {
16
17
  const { signTransaction } = require_utils_getWalletFeature.getWalletFeature(wallet, _solana_wallet_standard_features.SolanaSignTransaction);
17
18
  return signTransaction(...transactionBytesArray.map((transaction) => ({
@@ -27,7 +28,10 @@ var SolanaSignAndExecuteTask = class extends _lifi_sdk.BaseStepExecutionTask {
27
28
  const transactionCodec = (0, _solana_kit.getTransactionCodec)();
28
29
  return {
29
30
  status: "COMPLETED",
30
- context: { signedTransactions: signedTransactionOutputs.map((output) => transactionCodec.decode(output.signedTransaction)) }
31
+ context: {
32
+ signedTransactions: signedTransactionOutputs.map((output) => transactionCodec.decode(output.signedTransaction)),
33
+ isBundleExecution
34
+ }
31
35
  };
32
36
  }
33
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SolanaSignAndExecuteTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","base64ToUint8Array","getWalletFeature","SolanaSignTransaction"],"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 // Handle both single transaction (string) and multiple transactions (array)\n const transactionDataArray = Array.isArray(transactionRequestData)\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 },\n }\n }\n}\n"],"mappings":";;;;;;;AAcA,IAAa,2BAAb,cAA8CA,UAAAA,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,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAGF,MAAM,yBAAyB,OAAA,GAAA,UAAA,0BAAA,CAC7B,MACA,gBACF;EAOA,MAAM,yBAJuB,MAAM,QAAQ,sBAAsB,IAC7D,yBACA,CAAC,sBAAsB,EAAA,CAEwB,KAAK,SACtDC,iCAAAA,mBAAmB,IAAI,CACzB;EAEA,MAAM,2BAA2B,OAAA,GAAA,UAAA,YAAA,CAC/B,YAAY;GACV,MAAM,EAAE,oBAAoBC,+BAAAA,iBAC1B,QACAC,iCAAAA,qBACF;GAEA,OAAO,gBACL,GAAG,sBAAsB,KAAK,iBAAiB;IAC7C,SAAS;IACT;GACF,EAAE,CACJ;EACF,GACA;GAGE,SAAS;GACT,eAAe,IAAIJ,UAAAA,iBACjBC,UAAAA,cAAc,oBACd,gEACF;EACF,CACF;EAEA,IAAI,yBAAyB,WAAW,GACtC,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,uBACd,6CACF;EAGF,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW,EACvD,UAAU,KAAK,IAAI,EACrB,CAAC;EAED,MAAM,oBAAA,GAAA,YAAA,oBAAA,CAAuC;EAO7C,OAAO;GACL,QAAQ;GACR,SAAS,EAAE,oBANc,yBAAyB,KAAK,WACvD,iBAAiB,OAAO,OAAO,iBAAiB,CAKpB,EAAE;EAChC;CACF;AACF"}
1
+ {"version":3,"file":"SolanaSignAndExecuteTask.js","names":["BaseStepExecutionTask","TransactionError","LiFiErrorCode","base64ToUint8Array","getWalletFeature","SolanaSignTransaction"],"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,cAA8CA,UAAAA,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,IAAIC,UAAAA,iBACRC,UAAAA,cAAc,uBACd,kDACF;EAGF,MAAM,yBAA0B,OAAA,GAAA,UAAA,0BAAA,CAC9B,MACA,gBACF;EAKA,MAAM,oBAAoB,MAAM,QAAQ,sBAAsB;EAM9D,MAAM,yBAJuB,oBACzB,yBACA,CAAC,sBAAsB,EAAA,CAEwB,KAAK,SACtDC,iCAAAA,mBAAmB,IAAI,CACzB;EAEA,MAAM,2BAA2B,OAAA,GAAA,UAAA,YAAA,CAC/B,YAAY;GACV,MAAM,EAAE,oBAAoBC,+BAAAA,iBAC1B,QACAC,iCAAAA,qBACF;GAEA,OAAO,gBACL,GAAG,sBAAsB,KAAK,iBAAiB;IAC7C,SAAS;IACT;GACF,EAAE,CACJ;EACF,GACA;GAGE,SAAS;GACT,eAAe,IAAIJ,UAAAA,iBACjBC,UAAAA,cAAc,oBACd,gEACF;EACF,CACF;EAEA,IAAI,yBAAyB,WAAW,GACtC,MAAM,IAAID,UAAAA,iBACRC,UAAAA,cAAc,uBACd,6CACF;EAGF,cAAc,aAAa,MAAM,OAAO,MAAM,WAAW,EACvD,UAAU,KAAK,IAAI,EACrB,CAAC;EAED,MAAM,oBAAA,GAAA,YAAA,oBAAA,CAAuC;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,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,14 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils_shouldUseJitoBundle = require("../../utils/shouldUseJitoBundle.js");
3
2
  const require_core_tasks_SolanaJitoWaitForTransactionTask = require("./SolanaJitoWaitForTransactionTask.js");
4
3
  const require_core_tasks_SolanaStandardWaitForTransactionTask = require("./SolanaStandardWaitForTransactionTask.js");
5
4
  let _lifi_sdk = require("@lifi/sdk");
6
5
  //#region src/core/tasks/SolanaWaitForTransactionTask.ts
7
6
  var SolanaWaitForTransactionTask = class extends _lifi_sdk.BaseStepExecutionTask {
8
7
  async run(context) {
9
- const { client, signedTransactions: contextSignedTransactions } = context;
10
- const signedTransactions = contextSignedTransactions ?? [];
11
- if (require_utils_shouldUseJitoBundle.shouldUseJitoBundle(client.config.routeOptions, signedTransactions)) return new require_core_tasks_SolanaJitoWaitForTransactionTask.SolanaJitoWaitForTransactionTask().run(context);
8
+ if (context.isBundleExecution) return new require_core_tasks_SolanaJitoWaitForTransactionTask.SolanaJitoWaitForTransactionTask().run(context);
12
9
  return new require_core_tasks_SolanaStandardWaitForTransactionTask.SolanaStandardWaitForTransactionTask().run(context);
13
10
  }
14
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SolanaWaitForTransactionTask.js","names":["BaseStepExecutionTask","shouldUseJitoBundle","SolanaJitoWaitForTransactionTask","SolanaStandardWaitForTransactionTask"],"sources":["../../../../src/core/tasks/SolanaWaitForTransactionTask.ts"],"sourcesContent":["import { BaseStepExecutionTask, type TaskResult } from '@lifi/sdk'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport { shouldUseJitoBundle } from '../../utils/shouldUseJitoBundle.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 const { client, signedTransactions: contextSignedTransactions } = context\n\n const signedTransactions = contextSignedTransactions ?? []\n\n const useJitoBundle = shouldUseJitoBundle(\n client.config.routeOptions,\n signedTransactions\n )\n\n if (useJitoBundle) {\n return new SolanaJitoWaitForTransactionTask().run(context)\n }\n return new SolanaStandardWaitForTransactionTask().run(context)\n }\n}\n"],"mappings":";;;;;;AAMA,IAAa,+BAAb,cAAkDA,UAAAA,sBAAsB;CACtE,MAAM,IAAI,SAAyD;EACjE,MAAM,EAAE,QAAQ,oBAAoB,8BAA8B;EAElE,MAAM,qBAAqB,6BAA6B,CAAC;EAOzD,IALsBC,kCAAAA,oBACpB,OAAO,OAAO,cACd,kBAGc,GACd,OAAO,IAAIC,oDAAAA,iCAAiC,CAAC,CAAC,IAAI,OAAO;EAE3D,OAAO,IAAIC,wDAAAA,qCAAqC,CAAC,CAAC,IAAI,OAAO;CAC/D;AACF"}
1
+ {"version":3,"file":"SolanaWaitForTransactionTask.js","names":["BaseStepExecutionTask","SolanaJitoWaitForTransactionTask","SolanaStandardWaitForTransactionTask"],"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,cAAkDA,UAAAA,sBAAsB;CACtE,MAAM,IAAI,SAAyD;EAKjE,IAAI,QAAQ,mBACV,OAAO,IAAIC,oDAAAA,iCAAiC,CAAC,CAAC,IAAI,OAAO;EAE3D,OAAO,IAAIC,wDAAAA,qCAAqC,CAAC,CAAC,IAAI,OAAO;CAC/D;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { ExecutionAction, LiFiStep, SDKError } from "@lifi/sdk";
2
-
3
2
  //#region src/errors/parseSolanaErrors.d.ts
4
3
  declare const parseSolanaErrors: (e: Error, step?: LiFiStep, action?: ExecutionAction) => Promise<SDKError>;
5
4
  //#endregion
@@ -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
- * Returns the status of submitted bundle(s).
21
- * @see https://www.quicknode.com/docs/solana/getBundleStatuses
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,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
- * Fetches the tip accounts designated for tip payments for bundles.
9
- * Returns an array of 8 tip account addresses that can receive tips for transaction prioritization.
10
- * @see https://www.quicknode.com/docs/solana/getTipAccounts
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,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
- * Submits a bundle of signed transactions (base-64 encoded) to the cluster for atomic processing.
10
- * If any transaction fails, the entire bundle is rejected.
11
- * This method relays the bundle to the leader without modifications.
12
- * If the bundle expires after the next Jito-Solana leader, it returns a success response with a bundle_id,
13
- * indicating receipt but not guaranteeing processing or on-chain landing.
14
- * Check the bundle status with getBundleStatuses using the bundle_id.
15
- *
16
- * Note: A tip is required for the bundle to be considered. The tip must transfer SOL to one of the 8 tip accounts.
17
- * @see https://www.quicknode.com/docs/solana/sendBundle
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,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
- * Simulates a Jito bundle - runs simulation on the bundle to check if it will succeed
43
- * @see https://www.quicknode.com/docs/solana/simulateBundle
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 */simulationBank?: string; /** Skips signature verification during simulation */
49
- skipSigVerify?: boolean; /** Replaces the recent blockhash in transactions */
50
- replaceRecentBlockhash?: boolean; /** Specifies accounts to inspect before execution */
51
- preExecutionAccountsConfigs?: AccountConfig[]; /** Specifies accounts to inspect after execution */
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
  };
@@ -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,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,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 getTipAccounts.
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 };
@@ -6,11 +6,25 @@ let _solana_kit = require("@solana/kit");
6
6
  const solanaRpcs = new _lifi_sdk.LruMap(12);
7
7
  const jitoRpcs = new _lifi_sdk.LruMap(12);
8
8
  /**
9
- * Checks if an RPC URL supports Jito methods by calling getTipAccounts.
9
+ * A well-formed but non-existent Jito bundle id used solely to probe RPC
10
+ * capability. It forces `getBundleStatuses` to actually execute, so we can tell
11
+ * a Jito-capable RPC (resolves with `{ value: [null] }` — bundle not found)
12
+ * apart from a standard Solana RPC (throws "Method not found").
13
+ *
14
+ * Uses all `1`s: 64 chars, valid as both hex and base-58 (base-58 excludes
15
+ * `0`/`O`/`I`/`l`), so a provider that validates the id in either encoding
16
+ * still accepts it and performs the lookup instead of rejecting the probe.
17
+ */
18
+ const PROBE_BUNDLE_ID = "1111111111111111111111111111111111111111111111111111111111111111";
19
+ /**
20
+ * Checks if an RPC URL supports Jito methods by calling getBundleStatuses.
21
+ * We probe with getBundleStatuses (rather than getTipAccounts) because it is the
22
+ * method actually used during bundle confirmation, and providers such as Helius
23
+ * support sendBundle/getBundleStatuses without exposing getTipAccounts.
10
24
  */
11
25
  const isJitoRpc = async (rpcUrl) => {
12
26
  try {
13
- await require_rpc_jito_createJitoRpc.createJitoRpc(rpcUrl).getTipAccounts().send();
27
+ await require_rpc_jito_createJitoRpc.createJitoRpc(rpcUrl).getBundleStatuses([PROBE_BUNDLE_ID]).send();
14
28
  return true;
15
29
  } catch {
16
30
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","names":["LruMap","createJitoRpc","ChainId"],"sources":["../../../src/rpc/registry.ts"],"sourcesContent":["import { ChainId, LruMap, type SDKClient } from '@lifi/sdk'\nimport { createSolanaRpc } from '@solana/kit'\nimport { createJitoRpc } from './jito/createJitoRpc.js'\nimport type { JitoRpcType, SolanaRpcType } from './types.js'\n\nconst solanaRpcs = new LruMap<SolanaRpcType>(12)\nconst jitoRpcs = new LruMap<JitoRpcType>(12)\n\n/**\n * Checks if an RPC URL supports Jito methods by calling getTipAccounts.\n */\nexport const isJitoRpc = async (rpcUrl: string): Promise<boolean> => {\n try {\n const rpc = createJitoRpc(rpcUrl)\n await rpc.getTipAccounts().send()\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Initializes Solana RPCs for all available RPC URLs if they haven't been cached yet.\n * @param client - The SDK client used to fetch RPC URLs.\n */\nconst ensureSolanaRpcs = async (client: SDKClient): Promise<string[]> => {\n const rpcUrls = await client.getRpcUrlsByChainId(ChainId.SOL)\n for (const rpcUrl of rpcUrls) {\n if (!solanaRpcs.has(rpcUrl)) {\n solanaRpcs.set(rpcUrl, createSolanaRpc(rpcUrl))\n }\n }\n return rpcUrls\n}\n\n/**\n * Detects and caches Jito-capable RPCs by checking if they support the getTipAccounts method.\n * @param client - The SDK client used to fetch RPC URLs.\n */\nconst ensureJitoRpcs = async (client: SDKClient): Promise<string[]> => {\n const rpcUrls = await client.getRpcUrlsByChainId(ChainId.SOL)\n for (const rpcUrl of rpcUrls) {\n if (!jitoRpcs.has(rpcUrl) && (await isJitoRpc(rpcUrl))) {\n jitoRpcs.set(rpcUrl, createJitoRpc(rpcUrl))\n }\n }\n return rpcUrls\n}\n\n/**\n * Wrapper around getting the Solana RPCs\n * @returns - Solana RPCs\n */\nexport const getSolanaRpcs = async (\n client: SDKClient\n): Promise<SolanaRpcType[]> => {\n const rpcUrls = await ensureSolanaRpcs(client)\n return rpcUrls\n .map((rpcUrl) => solanaRpcs.get(rpcUrl))\n .filter((rpc): rpc is SolanaRpcType => Boolean(rpc))\n}\n\n/**\n * Wrapper around getting the Jito RPCs\n * @returns - Jito RPCs\n */\nexport const getJitoRpcs = async (\n client: SDKClient\n): Promise<JitoRpcType[]> => {\n const rpcUrls = await ensureJitoRpcs(client)\n return rpcUrls\n .map((rpcUrl) => jitoRpcs.get(rpcUrl))\n .filter((rpc): rpc is JitoRpcType => Boolean(rpc))\n}\n"],"mappings":";;;;;AAKA,MAAM,aAAa,IAAIA,UAAAA,OAAsB,EAAE;AAC/C,MAAM,WAAW,IAAIA,UAAAA,OAAoB,EAAE;;;;AAK3C,MAAa,YAAY,OAAO,WAAqC;CACnE,IAAI;EAEF,MADYC,+BAAAA,cAAc,MAClB,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK;EAChC,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;;;;AAMA,MAAM,mBAAmB,OAAO,WAAyC;CACvE,MAAM,UAAU,MAAM,OAAO,oBAAoBC,UAAAA,QAAQ,GAAG;CAC5D,KAAK,MAAM,UAAU,SACnB,IAAI,CAAC,WAAW,IAAI,MAAM,GACxB,WAAW,IAAI,SAAA,GAAA,YAAA,gBAAA,CAAwB,MAAM,CAAC;CAGlD,OAAO;AACT;;;;;AAMA,MAAM,iBAAiB,OAAO,WAAyC;CACrE,MAAM,UAAU,MAAM,OAAO,oBAAoBA,UAAAA,QAAQ,GAAG;CAC5D,KAAK,MAAM,UAAU,SACnB,IAAI,CAAC,SAAS,IAAI,MAAM,KAAM,MAAM,UAAU,MAAM,GAClD,SAAS,IAAI,QAAQD,+BAAAA,cAAc,MAAM,CAAC;CAG9C,OAAO;AACT;;;;;AAMA,MAAa,gBAAgB,OAC3B,WAC6B;CAE7B,QAAO,MADe,iBAAiB,MAAM,EAAA,CAE1C,KAAK,WAAW,WAAW,IAAI,MAAM,CAAC,CAAC,CACvC,QAAQ,QAA8B,QAAQ,GAAG,CAAC;AACvD;;;;;AAMA,MAAa,cAAc,OACzB,WAC2B;CAE3B,QAAO,MADe,eAAe,MAAM,EAAA,CAExC,KAAK,WAAW,SAAS,IAAI,MAAM,CAAC,CAAC,CACrC,QAAQ,QAA4B,QAAQ,GAAG,CAAC;AACrD"}
1
+ {"version":3,"file":"registry.js","names":["LruMap","createJitoRpc","ChainId"],"sources":["../../../src/rpc/registry.ts"],"sourcesContent":["import { ChainId, LruMap, type SDKClient } from '@lifi/sdk'\nimport { createSolanaRpc } from '@solana/kit'\nimport { createJitoRpc } from './jito/createJitoRpc.js'\nimport type { JitoRpcType, SolanaRpcType } from './types.js'\n\nconst solanaRpcs = new LruMap<SolanaRpcType>(12)\nconst jitoRpcs = new LruMap<JitoRpcType>(12)\n\n/**\n * A well-formed but non-existent Jito bundle id used solely to probe RPC\n * capability. It forces `getBundleStatuses` to actually execute, so we can tell\n * a Jito-capable RPC (resolves with `{ value: [null] }` — bundle not found)\n * apart from a standard Solana RPC (throws \"Method not found\").\n *\n * Uses all `1`s: 64 chars, valid as both hex and base-58 (base-58 excludes\n * `0`/`O`/`I`/`l`), so a provider that validates the id in either encoding\n * still accepts it and performs the lookup instead of rejecting the probe.\n */\nconst PROBE_BUNDLE_ID =\n '1111111111111111111111111111111111111111111111111111111111111111'\n\n/**\n * Checks if an RPC URL supports Jito methods by calling getBundleStatuses.\n * We probe with getBundleStatuses (rather than getTipAccounts) because it is the\n * method actually used during bundle confirmation, and providers such as Helius\n * support sendBundle/getBundleStatuses without exposing getTipAccounts.\n */\nexport const isJitoRpc = async (rpcUrl: string): Promise<boolean> => {\n try {\n const rpc = createJitoRpc(rpcUrl)\n await rpc.getBundleStatuses([PROBE_BUNDLE_ID]).send()\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Initializes Solana RPCs for all available RPC URLs if they haven't been cached yet.\n * @param client - The SDK client used to fetch RPC URLs.\n */\nconst ensureSolanaRpcs = async (client: SDKClient): Promise<string[]> => {\n const rpcUrls = await client.getRpcUrlsByChainId(ChainId.SOL)\n for (const rpcUrl of rpcUrls) {\n if (!solanaRpcs.has(rpcUrl)) {\n solanaRpcs.set(rpcUrl, createSolanaRpc(rpcUrl))\n }\n }\n return rpcUrls\n}\n\n/**\n * Detects and caches Jito-capable RPCs by checking if they support the getTipAccounts method.\n * @param client - The SDK client used to fetch RPC URLs.\n */\nconst ensureJitoRpcs = async (client: SDKClient): Promise<string[]> => {\n const rpcUrls = await client.getRpcUrlsByChainId(ChainId.SOL)\n for (const rpcUrl of rpcUrls) {\n if (!jitoRpcs.has(rpcUrl) && (await isJitoRpc(rpcUrl))) {\n jitoRpcs.set(rpcUrl, createJitoRpc(rpcUrl))\n }\n }\n return rpcUrls\n}\n\n/**\n * Wrapper around getting the Solana RPCs\n * @returns - Solana RPCs\n */\nexport const getSolanaRpcs = async (\n client: SDKClient\n): Promise<SolanaRpcType[]> => {\n const rpcUrls = await ensureSolanaRpcs(client)\n return rpcUrls\n .map((rpcUrl) => solanaRpcs.get(rpcUrl))\n .filter((rpc): rpc is SolanaRpcType => Boolean(rpc))\n}\n\n/**\n * Wrapper around getting the Jito RPCs\n * @returns - Jito RPCs\n */\nexport const getJitoRpcs = async (\n client: SDKClient\n): Promise<JitoRpcType[]> => {\n const rpcUrls = await ensureJitoRpcs(client)\n return rpcUrls\n .map((rpcUrl) => jitoRpcs.get(rpcUrl))\n .filter((rpc): rpc is JitoRpcType => Boolean(rpc))\n}\n"],"mappings":";;;;;AAKA,MAAM,aAAa,IAAIA,UAAAA,OAAsB,EAAE;AAC/C,MAAM,WAAW,IAAIA,UAAAA,OAAoB,EAAE;;;;;;;;;;;AAY3C,MAAM,kBACJ;;;;;;;AAQF,MAAa,YAAY,OAAO,WAAqC;CACnE,IAAI;EAEF,MADYC,+BAAAA,cAAc,MAClB,CAAC,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK;EACpD,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;;;;AAMA,MAAM,mBAAmB,OAAO,WAAyC;CACvE,MAAM,UAAU,MAAM,OAAO,oBAAoBC,UAAAA,QAAQ,GAAG;CAC5D,KAAK,MAAM,UAAU,SACnB,IAAI,CAAC,WAAW,IAAI,MAAM,GACxB,WAAW,IAAI,SAAA,GAAA,YAAA,gBAAA,CAAwB,MAAM,CAAC;CAGlD,OAAO;AACT;;;;;AAMA,MAAM,iBAAiB,OAAO,WAAyC;CACrE,MAAM,UAAU,MAAM,OAAO,oBAAoBA,UAAAA,QAAQ,GAAG;CAC5D,KAAK,MAAM,UAAU,SACnB,IAAI,CAAC,SAAS,IAAI,MAAM,KAAM,MAAM,UAAU,MAAM,GAClD,SAAS,IAAI,QAAQD,+BAAAA,cAAc,MAAM,CAAC;CAG9C,OAAO;AACT;;;;;AAMA,MAAa,gBAAgB,OAC3B,WAC6B;CAE7B,QAAO,MADe,iBAAiB,MAAM,EAAA,CAE1C,KAAK,WAAW,WAAW,IAAI,MAAM,CAAC,CAAC,CACvC,QAAQ,QAA8B,QAAQ,GAAG,CAAC;AACvD;;;;;AAMA,MAAa,cAAc,OACzB,WAC2B;CAE3B,QAAO,MADe,eAAe,MAAM,EAAA,CAExC,KAAK,WAAW,SAAS,IAAI,MAAM,CAAC,CAAC,CACrC,QAAQ,QAA4B,QAAQ,GAAG,CAAC;AACrD"}
@@ -1,6 +1,5 @@
1
1
  import { JitoRpcApi } from "./jito/createJitoRpc.js";
2
2
  import { Rpc, createSolanaRpc } from "@solana/kit";
3
-
4
3
  //#region src/rpc/types.d.ts
5
4
  type SolanaRpcType = ReturnType<typeof createSolanaRpc>;
6
5
  type JitoRpcType = Rpc<JitoRpcApi>;
@@ -1,66 +1,65 @@
1
1
  import { JitoRpcType, SolanaRpcType } from "./types.js";
2
2
  import { SDKClient } from "@lifi/sdk";
3
-
4
3
  //#region src/rpc/utils.d.ts
5
4
  type RetryFn<Rpc> = <R>(client: SDKClient, fn: (rpc: Rpc) => Promise<R>) => Promise<R>;
6
5
  /**
7
- * Calls a function on RPC instances with retry logic.
8
- * Tries each RPC in sequence until one succeeds.
9
- *
10
- * @typeParam T - The type of the RPC instance.
11
- * @typeParam R - The return type of the function.
12
- * @param rpcs - An array of RPC instances to try.
13
- * @param fn - The async function to execute on each RPC until one succeeds.
14
- * @returns The result from the first successful RPC call.
15
- * @throws {Error} If no RPCs are available.
16
- * @throws {AggregateError} If all RPCs fail, containing all individual errors.
17
- *
18
- * @example
19
- * ```ts
20
- * const rpcs = await getSolanaRpcs(client)
21
- * const result = await callWithRetry(rpcs, (rpc) =>
22
- * rpc.getBalance(address).send()
23
- * )
24
- * ```
25
- */
6
+ * Calls a function on RPC instances with retry logic.
7
+ * Tries each RPC in sequence until one succeeds.
8
+ *
9
+ * @typeParam T - The type of the RPC instance.
10
+ * @typeParam R - The return type of the function.
11
+ * @param rpcs - An array of RPC instances to try.
12
+ * @param fn - The async function to execute on each RPC until one succeeds.
13
+ * @returns The result from the first successful RPC call.
14
+ * @throws {Error} If no RPCs are available.
15
+ * @throws {AggregateError} If all RPCs fail, containing all individual errors.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const rpcs = await getSolanaRpcs(client)
20
+ * const result = await callWithRetry(rpcs, (rpc) =>
21
+ * rpc.getBalance(address).send()
22
+ * )
23
+ * ```
24
+ */
26
25
  declare function callWithRetry<T, R>(rpcs: T[], fn: (rpc: T) => Promise<R>): Promise<R>;
27
26
  /**
28
- * Calls a function on Solana RPC instances with retry logic.
29
- * Automatically fetches available Solana RPCs and tries each in sequence.
30
- *
31
- * @typeParam R - The return type of the function.
32
- * @param client - The SDK client used to fetch RPC URLs.
33
- * @param fn - The async function to execute on each RPC until one succeeds.
34
- * @returns The result from the first successful RPC call.
35
- * @throws {Error} If no Solana RPCs are available.
36
- * @throws {AggregateError} If all RPCs fail.
37
- *
38
- * @example
39
- * ```ts
40
- * const balance = await callSolanaRpcsWithRetry(client, (rpc) =>
41
- * rpc.getBalance(address).send()
42
- * )
43
- * ```
44
- */
27
+ * Calls a function on Solana RPC instances with retry logic.
28
+ * Automatically fetches available Solana RPCs and tries each in sequence.
29
+ *
30
+ * @typeParam R - The return type of the function.
31
+ * @param client - The SDK client used to fetch RPC URLs.
32
+ * @param fn - The async function to execute on each RPC until one succeeds.
33
+ * @returns The result from the first successful RPC call.
34
+ * @throws {Error} If no Solana RPCs are available.
35
+ * @throws {AggregateError} If all RPCs fail.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const balance = await callSolanaRpcsWithRetry(client, (rpc) =>
40
+ * rpc.getBalance(address).send()
41
+ * )
42
+ * ```
43
+ */
45
44
  declare const callSolanaRpcsWithRetry: RetryFn<SolanaRpcType>;
46
45
  /**
47
- * Calls a function on Jito RPC instances with retry logic.
48
- * Automatically fetches available Jito RPCs and tries each in sequence.
49
- *
50
- * @typeParam R - The return type of the function.
51
- * @param client - The SDK client used to fetch RPC URLs.
52
- * @param fn - The async function to execute on each RPC until one succeeds.
53
- * @returns The result from the first successful RPC call.
54
- * @throws {Error} If no Jito RPCs are available.
55
- * @throws {AggregateError} If all RPCs fail.
56
- *
57
- * @example
58
- * ```ts
59
- * const tipAccounts = await callJitoRpcsWithRetry(client, (rpc) =>
60
- * rpc.getTipAccounts().send()
61
- * )
62
- * ```
63
- */
46
+ * Calls a function on Jito RPC instances with retry logic.
47
+ * Automatically fetches available Jito RPCs and tries each in sequence.
48
+ *
49
+ * @typeParam R - The return type of the function.
50
+ * @param client - The SDK client used to fetch RPC URLs.
51
+ * @param fn - The async function to execute on each RPC until one succeeds.
52
+ * @returns The result from the first successful RPC call.
53
+ * @throws {Error} If no Jito RPCs are available.
54
+ * @throws {AggregateError} If all RPCs fail.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const tipAccounts = await callJitoRpcsWithRetry(client, (rpc) =>
59
+ * rpc.getTipAccounts().send()
60
+ * )
61
+ * ```
62
+ */
64
63
  declare const callJitoRpcsWithRetry: RetryFn<JitoRpcType>;
65
64
  //#endregion
66
65
  export { callJitoRpcsWithRetry, callSolanaRpcsWithRetry, callWithRetry };
@@ -1,7 +1,6 @@
1
1
  import { SDKProvider, StepExecutorContext, StepExecutorOptions } from "@lifi/sdk";
2
2
  import { Transaction } from "@solana/kit";
3
3
  import { Wallet, WalletAccount } from "@wallet-standard/base";
4
-
5
4
  //#region src/types.d.ts
6
5
  interface SolanaProviderOptions {
7
6
  getWallet?: () => Promise<Wallet>;
@@ -9,6 +8,11 @@ interface SolanaProviderOptions {
9
8
  }
10
9
  interface SolanaTaskContext {
11
10
  signedTransactions?: Transaction[];
11
+ /**
12
+ * Whether the backend returned a Jito bundle (array `transactionRequest.data`)
13
+ * that must be submitted via `sendBundle` instead of `sendTransaction`.
14
+ */
15
+ isBundleExecution?: boolean;
12
16
  }
13
17
  interface SolanaStepExecutorContext extends StepExecutorContext, SolanaTaskContext {
14
18
  wallet: Wallet;