@lifi/sdk-provider-solana 4.3.7 → 4.3.8

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 (233) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/SolanaProvider.d.ts +1 -4
  3. package/dist/cjs/SolanaProvider.js +1 -2
  4. package/dist/cjs/SolanaProvider.js.map +1 -1
  5. package/dist/cjs/actions/getSNSAddress.d.ts +1 -4
  6. package/dist/cjs/actions/getSNSAddress.js +1 -2
  7. package/dist/cjs/actions/getSolanaBalance.d.ts +1 -4
  8. package/dist/cjs/actions/getSolanaBalance.js +1 -2
  9. package/dist/cjs/actions/lookupSignatureStatus.d.ts +1 -4
  10. package/dist/cjs/actions/lookupSignatureStatus.js +2 -3
  11. package/dist/cjs/actions/resolveSolanaAddress.d.ts +1 -4
  12. package/dist/cjs/actions/resolveSolanaAddress.js +1 -2
  13. package/dist/cjs/actions/sendAndConfirmBundle.d.ts +1 -4
  14. package/dist/cjs/actions/sendAndConfirmBundle.js +3 -4
  15. package/dist/cjs/actions/sendAndConfirmTransaction.d.ts +2 -5
  16. package/dist/cjs/actions/sendAndConfirmTransaction.js +3 -4
  17. package/dist/cjs/confirmation/abortableSleep.d.ts +1 -4
  18. package/dist/cjs/confirmation/abortableSleep.js +1 -2
  19. package/dist/cjs/confirmation/confirmBundle.d.ts +2 -5
  20. package/dist/cjs/confirmation/confirmBundle.js +1 -2
  21. package/dist/cjs/confirmation/confirmSignature.d.ts +2 -5
  22. package/dist/cjs/confirmation/confirmSignature.js +2 -3
  23. package/dist/cjs/confirmation/createConfirmationDeadline.d.ts +1 -4
  24. package/dist/cjs/confirmation/createConfirmationDeadline.js +1 -2
  25. package/dist/cjs/confirmation/pollUntilDeadline.d.ts +2 -5
  26. package/dist/cjs/confirmation/pollUntilDeadline.js +1 -2
  27. package/dist/cjs/confirmation/raceRpcs.d.ts +1 -4
  28. package/dist/cjs/confirmation/raceRpcs.js +1 -2
  29. package/dist/cjs/confirmation/raceRpcs.js.map +1 -1
  30. package/dist/cjs/confirmation/types.d.ts +1 -4
  31. package/dist/cjs/confirmation/types.js +1 -2
  32. package/dist/cjs/core/SolanaStepExecutor.d.ts +1 -4
  33. package/dist/cjs/core/SolanaStepExecutor.js +1 -2
  34. package/dist/cjs/core/SolanaStepExecutor.js.map +1 -1
  35. package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +1 -4
  36. package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.js +4 -5
  37. package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.js.map +1 -1
  38. package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.d.ts +1 -4
  39. package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.js +1 -2
  40. package/dist/cjs/core/tasks/SolanaSignAndExecuteTask.js.map +1 -1
  41. package/dist/cjs/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +1 -4
  42. package/dist/cjs/core/tasks/SolanaStandardWaitForTransactionTask.js +4 -5
  43. package/dist/cjs/core/tasks/SolanaStandardWaitForTransactionTask.js.map +1 -1
  44. package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.d.ts +1 -4
  45. package/dist/cjs/core/tasks/SolanaWaitForTransactionTask.js +1 -2
  46. package/dist/cjs/core/tasks/confirmationError.d.ts +1 -4
  47. package/dist/cjs/core/tasks/confirmationError.js +1 -2
  48. package/dist/cjs/core/tasks/readSignature.d.ts +1 -4
  49. package/dist/cjs/core/tasks/readSignature.js +1 -2
  50. package/dist/cjs/core/tasks/resumeFromStore.d.ts +2 -5
  51. package/dist/cjs/core/tasks/resumeFromStore.js +3 -4
  52. package/dist/cjs/core/tasks/resumeFromStore.js.map +1 -1
  53. package/dist/cjs/core/tasks/transactionOutcome.d.ts +3 -6
  54. package/dist/cjs/core/tasks/transactionOutcome.js +3 -4
  55. package/dist/cjs/core/tasks/transactionOutcome.js.map +1 -1
  56. package/dist/cjs/errors/parseSolanaErrors.d.ts +1 -4
  57. package/dist/cjs/errors/parseSolanaErrors.js +1 -2
  58. package/dist/cjs/index.d.ts +1 -1
  59. package/dist/cjs/index.js +1 -1
  60. package/dist/cjs/rpc/jito/api/getBundleStatuses.d.ts +1 -4
  61. package/dist/cjs/rpc/jito/api/getTipAccounts.d.ts +1 -4
  62. package/dist/cjs/rpc/jito/api/sendBundle.d.ts +1 -4
  63. package/dist/cjs/rpc/jito/api/simulateBundle.d.ts +1 -4
  64. package/dist/cjs/rpc/jito/createJitoRpc.d.ts +1 -4
  65. package/dist/cjs/rpc/jito/createJitoRpc.js +1 -2
  66. package/dist/cjs/rpc/jito/types.d.ts +1 -4
  67. package/dist/cjs/rpc/registry.d.ts +1 -4
  68. package/dist/cjs/rpc/registry.js +1 -2
  69. package/dist/cjs/rpc/types.d.ts +1 -4
  70. package/dist/cjs/rpc/utils.d.ts +1 -4
  71. package/dist/cjs/rpc/utils.js +1 -2
  72. package/dist/cjs/types.d.ts +1 -4
  73. package/dist/cjs/types.js +1 -2
  74. package/dist/cjs/types.js.map +1 -1
  75. package/dist/cjs/utils/KeypairWallet.unit.helpers.d.ts +1 -4
  76. package/dist/cjs/utils/KeypairWallet.unit.helpers.js +1 -2
  77. package/dist/cjs/utils/KeypairWalletAdapter.d.ts +1 -4
  78. package/dist/cjs/utils/KeypairWalletAdapter.js +1 -2
  79. package/dist/cjs/utils/KeypairWalletAdapter.js.map +1 -1
  80. package/dist/cjs/utils/base64ToUint8Array.d.ts +1 -4
  81. package/dist/cjs/utils/base64ToUint8Array.js +1 -2
  82. package/dist/cjs/utils/getTransactionLifetime.d.ts +1 -4
  83. package/dist/cjs/utils/getTransactionLifetime.js +1 -2
  84. package/dist/cjs/utils/getWalletFeature.d.ts +1 -4
  85. package/dist/cjs/utils/getWalletFeature.js +1 -2
  86. package/dist/cjs/utils/getWalletFeature.js.map +1 -1
  87. package/dist/cjs/utils/solanaErrorCause.d.ts +1 -4
  88. package/dist/cjs/utils/solanaErrorCause.js +1 -2
  89. package/dist/cjs/utils/solanaErrorCause.js.map +1 -1
  90. package/dist/cjs/utils/storedTransactions.d.ts +1 -4
  91. package/dist/cjs/utils/storedTransactions.js +1 -2
  92. package/dist/cjs/version.d.ts +1 -4
  93. package/dist/cjs/version.js +2 -3
  94. package/dist/cjs/version.js.map +1 -1
  95. package/dist/esm/SolanaProvider.d.ts +0 -2
  96. package/dist/esm/SolanaProvider.d.ts.map +1 -1
  97. package/dist/esm/SolanaProvider.js +1 -2
  98. package/dist/esm/actions/getSNSAddress.d.ts +0 -2
  99. package/dist/esm/actions/getSNSAddress.d.ts.map +1 -1
  100. package/dist/esm/actions/getSNSAddress.js +1 -2
  101. package/dist/esm/actions/getSolanaBalance.d.ts +0 -2
  102. package/dist/esm/actions/getSolanaBalance.d.ts.map +1 -1
  103. package/dist/esm/actions/getSolanaBalance.js +1 -2
  104. package/dist/esm/actions/lookupSignatureStatus.d.ts +0 -2
  105. package/dist/esm/actions/lookupSignatureStatus.d.ts.map +1 -1
  106. package/dist/esm/actions/lookupSignatureStatus.js +2 -3
  107. package/dist/esm/actions/resolveSolanaAddress.d.ts +0 -2
  108. package/dist/esm/actions/resolveSolanaAddress.d.ts.map +1 -1
  109. package/dist/esm/actions/resolveSolanaAddress.js +1 -2
  110. package/dist/esm/actions/sendAndConfirmBundle.d.ts +0 -2
  111. package/dist/esm/actions/sendAndConfirmBundle.d.ts.map +1 -1
  112. package/dist/esm/actions/sendAndConfirmBundle.js +3 -4
  113. package/dist/esm/actions/sendAndConfirmTransaction.d.ts +1 -3
  114. package/dist/esm/actions/sendAndConfirmTransaction.d.ts.map +1 -1
  115. package/dist/esm/actions/sendAndConfirmTransaction.js +3 -4
  116. package/dist/esm/confirmation/abortableSleep.d.ts +0 -2
  117. package/dist/esm/confirmation/abortableSleep.d.ts.map +1 -1
  118. package/dist/esm/confirmation/abortableSleep.js +1 -2
  119. package/dist/esm/confirmation/confirmBundle.d.ts +1 -3
  120. package/dist/esm/confirmation/confirmBundle.d.ts.map +1 -1
  121. package/dist/esm/confirmation/confirmBundle.js +1 -2
  122. package/dist/esm/confirmation/confirmSignature.d.ts +1 -3
  123. package/dist/esm/confirmation/confirmSignature.d.ts.map +1 -1
  124. package/dist/esm/confirmation/confirmSignature.js +2 -3
  125. package/dist/esm/confirmation/createConfirmationDeadline.d.ts +0 -2
  126. package/dist/esm/confirmation/createConfirmationDeadline.d.ts.map +1 -1
  127. package/dist/esm/confirmation/createConfirmationDeadline.js +1 -2
  128. package/dist/esm/confirmation/pollUntilDeadline.d.ts +1 -3
  129. package/dist/esm/confirmation/pollUntilDeadline.d.ts.map +1 -1
  130. package/dist/esm/confirmation/pollUntilDeadline.js +1 -2
  131. package/dist/esm/confirmation/raceRpcs.d.ts +0 -2
  132. package/dist/esm/confirmation/raceRpcs.d.ts.map +1 -1
  133. package/dist/esm/confirmation/raceRpcs.js +1 -2
  134. package/dist/esm/confirmation/raceRpcs.js.map +1 -1
  135. package/dist/esm/confirmation/types.d.ts +0 -2
  136. package/dist/esm/confirmation/types.d.ts.map +1 -1
  137. package/dist/esm/confirmation/types.js +1 -2
  138. package/dist/esm/core/SolanaStepExecutor.d.ts +0 -2
  139. package/dist/esm/core/SolanaStepExecutor.d.ts.map +1 -1
  140. package/dist/esm/core/SolanaStepExecutor.js +1 -2
  141. package/dist/esm/core/SolanaStepExecutor.js.map +1 -1
  142. package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts +0 -2
  143. package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts.map +1 -1
  144. package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.js +4 -5
  145. package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts +0 -2
  146. package/dist/esm/core/tasks/SolanaSignAndExecuteTask.d.ts.map +1 -1
  147. package/dist/esm/core/tasks/SolanaSignAndExecuteTask.js +1 -2
  148. package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts +0 -2
  149. package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.d.ts.map +1 -1
  150. package/dist/esm/core/tasks/SolanaStandardWaitForTransactionTask.js +4 -5
  151. package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts +0 -2
  152. package/dist/esm/core/tasks/SolanaWaitForTransactionTask.d.ts.map +1 -1
  153. package/dist/esm/core/tasks/SolanaWaitForTransactionTask.js +1 -2
  154. package/dist/esm/core/tasks/confirmationError.d.ts +0 -2
  155. package/dist/esm/core/tasks/confirmationError.d.ts.map +1 -1
  156. package/dist/esm/core/tasks/confirmationError.js +1 -2
  157. package/dist/esm/core/tasks/readSignature.d.ts +0 -2
  158. package/dist/esm/core/tasks/readSignature.d.ts.map +1 -1
  159. package/dist/esm/core/tasks/readSignature.js +1 -2
  160. package/dist/esm/core/tasks/resumeFromStore.d.ts +1 -3
  161. package/dist/esm/core/tasks/resumeFromStore.d.ts.map +1 -1
  162. package/dist/esm/core/tasks/resumeFromStore.js +3 -4
  163. package/dist/esm/core/tasks/resumeFromStore.js.map +1 -1
  164. package/dist/esm/core/tasks/transactionOutcome.d.ts +2 -4
  165. package/dist/esm/core/tasks/transactionOutcome.d.ts.map +1 -1
  166. package/dist/esm/core/tasks/transactionOutcome.js +3 -4
  167. package/dist/esm/core/tasks/transactionOutcome.js.map +1 -1
  168. package/dist/esm/errors/parseSolanaErrors.d.ts +0 -2
  169. package/dist/esm/errors/parseSolanaErrors.d.ts.map +1 -1
  170. package/dist/esm/errors/parseSolanaErrors.js +1 -2
  171. package/dist/esm/index.d.ts +1 -1
  172. package/dist/esm/index.js +1 -1
  173. package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts +0 -2
  174. package/dist/esm/rpc/jito/api/getBundleStatuses.d.ts.map +1 -1
  175. package/dist/esm/rpc/jito/api/getTipAccounts.d.ts +0 -2
  176. package/dist/esm/rpc/jito/api/getTipAccounts.d.ts.map +1 -1
  177. package/dist/esm/rpc/jito/api/sendBundle.d.ts +0 -2
  178. package/dist/esm/rpc/jito/api/sendBundle.d.ts.map +1 -1
  179. package/dist/esm/rpc/jito/api/simulateBundle.d.ts +0 -2
  180. package/dist/esm/rpc/jito/api/simulateBundle.d.ts.map +1 -1
  181. package/dist/esm/rpc/jito/createJitoRpc.d.ts +0 -2
  182. package/dist/esm/rpc/jito/createJitoRpc.d.ts.map +1 -1
  183. package/dist/esm/rpc/jito/createJitoRpc.js +1 -2
  184. package/dist/esm/rpc/jito/types.d.ts +0 -2
  185. package/dist/esm/rpc/jito/types.d.ts.map +1 -1
  186. package/dist/esm/rpc/registry.d.ts +0 -2
  187. package/dist/esm/rpc/registry.d.ts.map +1 -1
  188. package/dist/esm/rpc/registry.js +1 -2
  189. package/dist/esm/rpc/types.d.ts +0 -2
  190. package/dist/esm/rpc/types.d.ts.map +1 -1
  191. package/dist/esm/rpc/utils.d.ts +0 -2
  192. package/dist/esm/rpc/utils.d.ts.map +1 -1
  193. package/dist/esm/rpc/utils.js +1 -2
  194. package/dist/esm/types.d.ts +0 -2
  195. package/dist/esm/types.d.ts.map +1 -1
  196. package/dist/esm/types.js +1 -2
  197. package/dist/esm/types.js.map +1 -1
  198. package/dist/esm/utils/KeypairWallet.unit.helpers.d.ts +0 -2
  199. package/dist/esm/utils/KeypairWallet.unit.helpers.d.ts.map +1 -1
  200. package/dist/esm/utils/KeypairWallet.unit.helpers.js +1 -2
  201. package/dist/esm/utils/KeypairWalletAdapter.d.ts +0 -2
  202. package/dist/esm/utils/KeypairWalletAdapter.d.ts.map +1 -1
  203. package/dist/esm/utils/KeypairWalletAdapter.js +1 -2
  204. package/dist/esm/utils/KeypairWalletAdapter.js.map +1 -1
  205. package/dist/esm/utils/base64ToUint8Array.d.ts +0 -2
  206. package/dist/esm/utils/base64ToUint8Array.d.ts.map +1 -1
  207. package/dist/esm/utils/base64ToUint8Array.js +1 -2
  208. package/dist/esm/utils/getTransactionLifetime.d.ts +0 -2
  209. package/dist/esm/utils/getTransactionLifetime.d.ts.map +1 -1
  210. package/dist/esm/utils/getTransactionLifetime.js +1 -2
  211. package/dist/esm/utils/getWalletFeature.d.ts +0 -2
  212. package/dist/esm/utils/getWalletFeature.d.ts.map +1 -1
  213. package/dist/esm/utils/getWalletFeature.js +1 -2
  214. package/dist/esm/utils/getWalletFeature.js.map +1 -1
  215. package/dist/esm/utils/solanaErrorCause.d.ts +0 -2
  216. package/dist/esm/utils/solanaErrorCause.d.ts.map +1 -1
  217. package/dist/esm/utils/solanaErrorCause.js +1 -2
  218. package/dist/esm/utils/solanaErrorCause.js.map +1 -1
  219. package/dist/esm/utils/storedTransactions.d.ts +0 -2
  220. package/dist/esm/utils/storedTransactions.d.ts.map +1 -1
  221. package/dist/esm/utils/storedTransactions.js +1 -2
  222. package/dist/esm/version.d.ts +1 -3
  223. package/dist/esm/version.d.ts.map +1 -1
  224. package/dist/esm/version.js +2 -3
  225. package/dist/esm/version.js.map +1 -1
  226. package/package.json +3 -3
  227. package/src/confirmation/raceRpcs.ts +4 -3
  228. package/src/core/tasks/resumeFromStore.ts +1 -1
  229. package/src/core/tasks/transactionOutcome.ts +1 -1
  230. package/src/index.ts +1 -5
  231. package/src/types.ts +1 -2
  232. package/src/utils/getWalletFeature.ts +1 -0
  233. package/src/version.ts +1 -1
@@ -1,5 +1,4 @@
1
1
  import { Signature, Transaction } from "@solana/kit";
2
- //#region src/core/tasks/readSignature.d.ts
3
2
  /**
4
3
  * Reads a signed transaction's signature, restating a `@solana/kit` failure as
5
4
  * a `TransactionError`.
@@ -12,5 +11,4 @@ import { Signature, Transaction } from "@solana/kit";
12
11
  * unwrapped throw lands in the unknown bucket.
13
12
  */
14
13
  export declare function readSignature(transaction: Transaction): Signature;
15
- //#endregion
16
14
  //# sourceMappingURL=readSignature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"readSignature.d.ts","names":[],"sources":["../../../../src/core/tasks/readSignature.ts"],"mappings":";;;;;;;;;;;;;wBAkBgB,cAAc,aAAa,cAAc"}
1
+ {"version":3,"file":"readSignature.d.ts","names":[],"sources":["../../../../src/core/tasks/readSignature.ts"],"mappings":";;;;;;;;;;;;wBAkBgB,cAAc,aAAa,cAAc"}
@@ -1,6 +1,6 @@
1
1
  import { LiFiErrorCode, TransactionError } from "@lifi/sdk";
2
2
  import { getSignatureFromTransaction } from "@solana/kit";
3
- //#region src/core/tasks/readSignature.ts
3
+ // src/core/tasks/readSignature.ts
4
4
  /**
5
5
  * Reads a signed transaction's signature, restating a `@solana/kit` failure as
6
6
  * a `TransactionError`.
@@ -19,7 +19,6 @@ function readSignature(transaction) {
19
19
  throw new TransactionError(LiFiErrorCode.TransactionUnprepared, "Unable to prepare transaction. The signed transaction carries no fee payer signature.", error);
20
20
  }
21
21
  }
22
- //#endregion
23
22
  export { readSignature };
24
23
 
25
24
  //# sourceMappingURL=readSignature.js.map
@@ -1,9 +1,8 @@
1
1
  import { SolanaStepExecutorContext } from "../../types.js";
2
2
  import { TransactionLifetime } from "../../utils/getTransactionLifetime.js";
3
- import { ConfirmationMessages } from "./confirmationError.js";
4
3
  import { StoredTransactions } from "../../utils/storedTransactions.js";
4
+ import { ConfirmationMessages } from "./confirmationError.js";
5
5
  import { ExecutionAction, TaskResult } from "@lifi/sdk";
6
- //#region src/core/tasks/resumeFromStore.d.ts
7
6
  /**
8
7
  * Resume mode of both wait tasks: the sign task did not run in this session,
9
8
  * so the transaction comes from the action.
@@ -27,5 +26,4 @@ export declare function resumeFromStore(context: SolanaStepExecutorContext, acti
27
26
  * funds it already spent, would fail the simulation falsely. */
28
27
  send: (stored: StoredTransactions, lifetimes: TransactionLifetime[]) => Promise<TaskResult>;
29
28
  }): Promise<TaskResult>;
30
- //#endregion
31
29
  //# sourceMappingURL=resumeFromStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resumeFromStore.d.ts","names":[],"sources":["../../../../src/core/tasks/resumeFromStore.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;wBAyFsB,gBACpB,SAAS,2BACT,QAAQ,iBACR;EACE,UAAU;;;;EAIV,OACE,QAAQ,oBACR,WAAW,0BACR,QAAQ;IAEd,QAAQ"}
1
+ {"version":3,"file":"resumeFromStore.d.ts","names":[],"sources":["../../../../src/core/tasks/resumeFromStore.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAyFsB,gBACpB,SAAS,2BACT,QAAQ,iBACR;EACE,UAAU;;;;EAIV,OACE,QAAQ,oBACR,WAAW,0BACR,QAAQ;IAEd,QAAQ"}
@@ -1,11 +1,11 @@
1
- import { decodeStoredTransactions } from "../../utils/storedTransactions.js";
1
+ import { lookupSignatureStatus } from "../../actions/lookupSignatureStatus.js";
2
2
  import { isConfirmedCommitment } from "../../confirmation/types.js";
3
3
  import { getTransactionLifetime } from "../../utils/getTransactionLifetime.js";
4
- import { lookupSignatureStatus } from "../../actions/lookupSignatureStatus.js";
4
+ import { decodeStoredTransactions } from "../../utils/storedTransactions.js";
5
5
  import { confirmationError } from "./confirmationError.js";
6
6
  import { canResendStored, clearStoredTransactions, failureOf, recordLanded, resolveUnconfirmed } from "./transactionOutcome.js";
7
7
  import { LiFiErrorCode, TransactionError } from "@lifi/sdk";
8
- //#region src/core/tasks/resumeFromStore.ts
8
+ // src/core/tasks/resumeFromStore.ts
9
9
  function readResumeSource(context, action) {
10
10
  if (action.txHex) {
11
11
  const stored = decodeStoredTransactions(action.txHex);
@@ -74,7 +74,6 @@ async function resumeFromStore(context, action, options) {
74
74
  failure: failureOf(status)
75
75
  });
76
76
  }
77
- //#endregion
78
77
  export { resumeFromStore };
79
78
 
80
79
  //# sourceMappingURL=resumeFromStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resumeFromStore.js","names":[],"sources":["../../../../src/core/tasks/resumeFromStore.ts"],"sourcesContent":["import {\n type ExecutionAction,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Signature } from '@solana/kit'\nimport { lookupSignatureStatus } from '../../actions/lookupSignatureStatus.js'\nimport { isConfirmedCommitment } from '../../confirmation/types.js'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport {\n getTransactionLifetime,\n type TransactionLifetime,\n} from '../../utils/getTransactionLifetime.js'\nimport {\n decodeStoredTransactions,\n type StoredTransactions,\n} from '../../utils/storedTransactions.js'\nimport {\n type ConfirmationMessages,\n confirmationError,\n} from './confirmationError.js'\nimport {\n canResendStored,\n clearStoredTransactions,\n failureOf,\n recordLanded,\n resolveUnconfirmed,\n} from './transactionOutcome.js'\n\n/** What a resumed wait task can work from. */\ntype ResumeSource =\n /** Signed bytes that may still need to be sent. */\n | { kind: 'bytes'; stored: StoredTransactions }\n /** A broadcast signature alone: a route stored before the upgrade, or\n * bytes that no longer decode. */\n | { kind: 'hash'; signature: Signature }\n /** Bytes whose first signature is not the stored txHash (damaged\n * storage). They prove nothing about that transaction, and they may have\n * been sent: nothing is sent and nothing is dropped. */\n | { kind: 'mismatch'; signature: Signature }\n\nfunction readResumeSource(\n context: SolanaStepExecutorContext,\n action: ExecutionAction\n): ResumeSource {\n if (action.txHex) {\n const stored = decodeStoredTransactions(action.txHex)\n if (stored) {\n if (action.txHash && action.txHash !== stored.signature) {\n return { kind: 'mismatch', signature: action.txHash as Signature }\n }\n return { kind: 'bytes', stored }\n }\n // The sign task stores only bytes that decode, so these were damaged\n // after the write - by the integrator's storage, say. They would fail\n // every resume the same way.\n clearStoredTransactions(context, action)\n }\n\n if (action.txHash) {\n return { kind: 'hash', signature: action.txHash as Signature }\n }\n\n // Without a hash no RPC ever accepted a send - `txHash` is written on the\n // first accepted one - so nothing can land. No final marker: \"Try again\"\n // signs again.\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Signed transactions are not found.'\n )\n}\n\n/**\n * Resume mode of both wait tasks: the sign task did not run in this session,\n * so the transaction comes from the action.\n *\n * 1. Look the signature up on every RPC. A confirmed status goes straight to\n * the result rules: the transaction may have landed after the page closed.\n * This look only has to find, so it asks for no canary.\n * 2. Otherwise resend the stored bytes through `send` when that is allowed -\n * the task's normal send path, without simulation.\n * 3. Otherwise - a hash alone, or bytes past the resend age cap - nothing is\n * sent, and only the dropped rule can make the outcome final.\n *\n * Bytes that are not the stored txHash's transaction are never sent, and the\n * dropped rule never runs for them: the outcome stays unknown unless the\n * lookup by txHash finds it confirmed.\n */\nexport async function resumeFromStore(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: {\n messages: ConfirmationMessages\n /** Sends the stored bytes and applies the result rules, as the first\n * run does, but never simulates: a transaction that already landed, or\n * funds it already spent, would fail the simulation falsely. */\n send: (\n stored: StoredTransactions,\n lifetimes: TransactionLifetime[]\n ) => Promise<TaskResult>\n }\n): Promise<TaskResult> {\n const { client, step } = context\n const source = readResumeSource(context, action)\n const signature =\n source.kind === 'bytes' ? source.stored.signature : source.signature\n\n const lookup = await lookupSignatureStatus(client, signature)\n if (\n lookup.kind === 'found' &&\n isConfirmedCommitment(lookup.status.confirmationStatus)\n ) {\n return recordLanded(context, action, {\n signature,\n failure: failureOf(lookup.status),\n })\n }\n\n const lifetimes =\n source.kind === 'bytes'\n ? await Promise.all(\n source.stored.transactions.map((transaction) =>\n getTransactionLifetime(transaction)\n )\n )\n : []\n\n // A `processed` status resends too: a signature executes at most once.\n if (\n source.kind === 'bytes' &&\n canResendStored(lifetimes, step.execution?.signedAt)\n ) {\n return options.send(source.stored, lifetimes)\n }\n\n // No RPC answered at all: an outage, as today. Otherwise the transaction\n // was simply not seen.\n const silent = lookup.kind === 'unknown' && !lookup.answered\n const error = confirmationError(\n silent\n ? { kind: 'rpc-unavailable', errors: lookup.errors }\n : { kind: 'not-confirmed', errors: [] },\n options.messages\n )\n if (source.kind === 'mismatch') {\n // Damaged storage: no dropped rule, so the outcome stays unknown.\n throw error\n }\n const status = await resolveUnconfirmed(context, action, {\n signature,\n error,\n expiredAtSlot: undefined,\n messages: options.messages,\n })\n return recordLanded(context, action, {\n signature,\n failure: failureOf(status),\n })\n}\n"],"mappings":";;;;;;;;AA0CA,SAAS,iBACP,SACA,QACc;CACd,IAAI,OAAO,OAAO;EAChB,MAAM,SAAS,yBAAyB,OAAO,KAAK;EACpD,IAAI,QAAQ;GACV,IAAI,OAAO,UAAU,OAAO,WAAW,OAAO,WAC5C,OAAO;IAAE,MAAM;IAAY,WAAW,OAAO;GAAoB;GAEnE,OAAO;IAAE,MAAM;IAAS;GAAO;EACjC;EAIA,wBAAwB,SAAS,MAAM;CACzC;CAEA,IAAI,OAAO,QACT,OAAO;EAAE,MAAM;EAAQ,WAAW,OAAO;CAAoB;CAM/D,MAAM,IAAI,iBACR,cAAc,uBACd,mEACF;AACF;;;;;;;;;;;;;;;;;AAkBA,eAAsB,gBACpB,SACA,QACA,SAUqB;CACrB,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,SAAS,iBAAiB,SAAS,MAAM;CAC/C,MAAM,YACJ,OAAO,SAAS,UAAU,OAAO,OAAO,YAAY,OAAO;CAE7D,MAAM,SAAS,MAAM,sBAAsB,QAAQ,SAAS;CAC5D,IACE,OAAO,SAAS,WAChB,sBAAsB,OAAO,OAAO,kBAAkB,GAEtD,OAAO,aAAa,SAAS,QAAQ;EACnC;EACA,SAAS,UAAU,OAAO,MAAM;CAClC,CAAC;CAGH,MAAM,YACJ,OAAO,SAAS,UACZ,MAAM,QAAQ,IACZ,OAAO,OAAO,aAAa,KAAK,gBAC9B,uBAAuB,WAAW,CACpC,CACF,IACA,CAAC;CAGP,IACE,OAAO,SAAS,WAChB,gBAAgB,WAAW,KAAK,WAAW,QAAQ,GAEnD,OAAO,QAAQ,KAAK,OAAO,QAAQ,SAAS;CAK9C,MAAM,SAAS,OAAO,SAAS,aAAa,CAAC,OAAO;CACpD,MAAM,QAAQ,kBACZ,SACI;EAAE,MAAM;EAAmB,QAAQ,OAAO;CAAO,IACjD;EAAE,MAAM;EAAiB,QAAQ,CAAC;CAAE,GACxC,QAAQ,QACV;CACA,IAAI,OAAO,SAAS,YAElB,MAAM;CAER,MAAM,SAAS,MAAM,mBAAmB,SAAS,QAAQ;EACvD;EACA;EACA,eAAe,KAAA;EACf,UAAU,QAAQ;CACpB,CAAC;CACD,OAAO,aAAa,SAAS,QAAQ;EACnC;EACA,SAAS,UAAU,MAAM;CAC3B,CAAC;AACH"}
1
+ {"version":3,"file":"resumeFromStore.js","names":[],"sources":["../../../../src/core/tasks/resumeFromStore.ts"],"sourcesContent":["import {\n type ExecutionAction,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Signature } from '@solana/kit'\nimport { lookupSignatureStatus } from '../../actions/lookupSignatureStatus.js'\nimport { isConfirmedCommitment } from '../../confirmation/types.js'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport {\n getTransactionLifetime,\n type TransactionLifetime,\n} from '../../utils/getTransactionLifetime.js'\nimport {\n decodeStoredTransactions,\n type StoredTransactions,\n} from '../../utils/storedTransactions.js'\nimport {\n confirmationError,\n type ConfirmationMessages,\n} from './confirmationError.js'\nimport {\n canResendStored,\n clearStoredTransactions,\n failureOf,\n recordLanded,\n resolveUnconfirmed,\n} from './transactionOutcome.js'\n\n/** What a resumed wait task can work from. */\ntype ResumeSource =\n /** Signed bytes that may still need to be sent. */\n | { kind: 'bytes'; stored: StoredTransactions }\n /** A broadcast signature alone: a route stored before the upgrade, or\n * bytes that no longer decode. */\n | { kind: 'hash'; signature: Signature }\n /** Bytes whose first signature is not the stored txHash (damaged\n * storage). They prove nothing about that transaction, and they may have\n * been sent: nothing is sent and nothing is dropped. */\n | { kind: 'mismatch'; signature: Signature }\n\nfunction readResumeSource(\n context: SolanaStepExecutorContext,\n action: ExecutionAction\n): ResumeSource {\n if (action.txHex) {\n const stored = decodeStoredTransactions(action.txHex)\n if (stored) {\n if (action.txHash && action.txHash !== stored.signature) {\n return { kind: 'mismatch', signature: action.txHash as Signature }\n }\n return { kind: 'bytes', stored }\n }\n // The sign task stores only bytes that decode, so these were damaged\n // after the write - by the integrator's storage, say. They would fail\n // every resume the same way.\n clearStoredTransactions(context, action)\n }\n\n if (action.txHash) {\n return { kind: 'hash', signature: action.txHash as Signature }\n }\n\n // Without a hash no RPC ever accepted a send - `txHash` is written on the\n // first accepted one - so nothing can land. No final marker: \"Try again\"\n // signs again.\n throw new TransactionError(\n LiFiErrorCode.TransactionUnprepared,\n 'Unable to prepare transaction. Signed transactions are not found.'\n )\n}\n\n/**\n * Resume mode of both wait tasks: the sign task did not run in this session,\n * so the transaction comes from the action.\n *\n * 1. Look the signature up on every RPC. A confirmed status goes straight to\n * the result rules: the transaction may have landed after the page closed.\n * This look only has to find, so it asks for no canary.\n * 2. Otherwise resend the stored bytes through `send` when that is allowed -\n * the task's normal send path, without simulation.\n * 3. Otherwise - a hash alone, or bytes past the resend age cap - nothing is\n * sent, and only the dropped rule can make the outcome final.\n *\n * Bytes that are not the stored txHash's transaction are never sent, and the\n * dropped rule never runs for them: the outcome stays unknown unless the\n * lookup by txHash finds it confirmed.\n */\nexport async function resumeFromStore(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: {\n messages: ConfirmationMessages\n /** Sends the stored bytes and applies the result rules, as the first\n * run does, but never simulates: a transaction that already landed, or\n * funds it already spent, would fail the simulation falsely. */\n send: (\n stored: StoredTransactions,\n lifetimes: TransactionLifetime[]\n ) => Promise<TaskResult>\n }\n): Promise<TaskResult> {\n const { client, step } = context\n const source = readResumeSource(context, action)\n const signature =\n source.kind === 'bytes' ? source.stored.signature : source.signature\n\n const lookup = await lookupSignatureStatus(client, signature)\n if (\n lookup.kind === 'found' &&\n isConfirmedCommitment(lookup.status.confirmationStatus)\n ) {\n return recordLanded(context, action, {\n signature,\n failure: failureOf(lookup.status),\n })\n }\n\n const lifetimes =\n source.kind === 'bytes'\n ? await Promise.all(\n source.stored.transactions.map((transaction) =>\n getTransactionLifetime(transaction)\n )\n )\n : []\n\n // A `processed` status resends too: a signature executes at most once.\n if (\n source.kind === 'bytes' &&\n canResendStored(lifetimes, step.execution?.signedAt)\n ) {\n return options.send(source.stored, lifetimes)\n }\n\n // No RPC answered at all: an outage, as today. Otherwise the transaction\n // was simply not seen.\n const silent = lookup.kind === 'unknown' && !lookup.answered\n const error = confirmationError(\n silent\n ? { kind: 'rpc-unavailable', errors: lookup.errors }\n : { kind: 'not-confirmed', errors: [] },\n options.messages\n )\n if (source.kind === 'mismatch') {\n // Damaged storage: no dropped rule, so the outcome stays unknown.\n throw error\n }\n const status = await resolveUnconfirmed(context, action, {\n signature,\n error,\n expiredAtSlot: undefined,\n messages: options.messages,\n })\n return recordLanded(context, action, {\n signature,\n failure: failureOf(status),\n })\n}\n"],"mappings":";;;;;;;;AA0CA,SAAS,iBACP,SACA,QACc;CACd,IAAI,OAAO,OAAO;EAChB,MAAM,SAAS,yBAAyB,OAAO,KAAK;EACpD,IAAI,QAAQ;GACV,IAAI,OAAO,UAAU,OAAO,WAAW,OAAO,WAC5C,OAAO;IAAE,MAAM;IAAY,WAAW,OAAO;GAAoB;GAEnE,OAAO;IAAE,MAAM;IAAS;GAAO;EACjC;EAIA,wBAAwB,SAAS,MAAM;CACzC;CAEA,IAAI,OAAO,QACT,OAAO;EAAE,MAAM;EAAQ,WAAW,OAAO;CAAoB;CAM/D,MAAM,IAAI,iBACR,cAAc,uBACd,mEACF;AACF;;;;;;;;;;;;;;;;;AAkBA,eAAsB,gBACpB,SACA,QACA,SAUqB;CACrB,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,SAAS,iBAAiB,SAAS,MAAM;CAC/C,MAAM,YACJ,OAAO,SAAS,UAAU,OAAO,OAAO,YAAY,OAAO;CAE7D,MAAM,SAAS,MAAM,sBAAsB,QAAQ,SAAS;CAC5D,IACE,OAAO,SAAS,WAChB,sBAAsB,OAAO,OAAO,kBAAkB,GAEtD,OAAO,aAAa,SAAS,QAAQ;EACnC;EACA,SAAS,UAAU,OAAO,MAAM;CAClC,CAAC;CAGH,MAAM,YACJ,OAAO,SAAS,UACZ,MAAM,QAAQ,IACZ,OAAO,OAAO,aAAa,KAAK,gBAC9B,uBAAuB,WAAW,CACpC,CACF,IACA,CAAC;CAGP,IACE,OAAO,SAAS,WAChB,gBAAgB,WAAW,KAAK,WAAW,QAAQ,GAEnD,OAAO,QAAQ,KAAK,OAAO,QAAQ,SAAS;CAK9C,MAAM,SAAS,OAAO,SAAS,aAAa,CAAC,OAAO;CACpD,MAAM,QAAQ,kBACZ,SACI;EAAE,MAAM;EAAmB,QAAQ,OAAO;CAAO,IACjD;EAAE,MAAM;EAAiB,QAAQ,CAAC;CAAE,GACxC,QAAQ,QACV;CACA,IAAI,OAAO,SAAS,YAElB,MAAM;CAER,MAAM,SAAS,MAAM,mBAAmB,SAAS,QAAQ;EACvD;EACA;EACA,eAAe,KAAA;EACf,UAAU,QAAQ;CACpB,CAAC;CACD,OAAO,aAAa,SAAS,QAAQ;EACnC;EACA,SAAS,UAAU,MAAM;CAC3B,CAAC;AACH"}
@@ -1,11 +1,10 @@
1
- import { SolanaStepExecutorContext } from "../../types.js";
1
+ import { RaceResult } from "../../confirmation/raceRpcs.js";
2
2
  import { SignatureStatus } from "../../confirmation/types.js";
3
+ import { SolanaStepExecutorContext } from "../../types.js";
3
4
  import { TransactionLifetime } from "../../utils/getTransactionLifetime.js";
4
- import { RaceResult } from "../../confirmation/raceRpcs.js";
5
5
  import { ConfirmationMessages } from "./confirmationError.js";
6
6
  import { ExecutionAction, TaskResult } from "@lifi/sdk";
7
7
  import { Signature } from "@solana/kit";
8
- //#region src/core/tasks/transactionOutcome.d.ts
9
8
  /** Explorer link for a signature, as both wait tasks write it. */
10
9
  export declare function getTxLink(context: Pick<SolanaStepExecutorContext, "fromChain">, signature: string): string;
11
10
  /**
@@ -103,5 +102,4 @@ export declare function sendAndSettle<T>(context: SolanaStepExecutorContext, act
103
102
  resuming: boolean;
104
103
  messages: ConfirmationMessages;
105
104
  }): Promise<TaskResult>;
106
- //#endregion
107
105
  //# sourceMappingURL=transactionOutcome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transactionOutcome.d.ts","names":[],"sources":["../../../../src/core/tasks/transactionOutcome.ts"],"mappings":";;;;;;;;;wBA0BgB,UACd,SAAS,KAAK,yCACd;;;;;;;;wBAYc,gBACd,WAAW,uBACX,8BACA;;;;;;;;;;;;;;;wBAsBc,kBAAkB;EAChC;EACA;EACA;;;wBAMc,wBACd,SAAS,2BACT,QAAQ;;wBAQM,UACd,QAAQ,KAAK;EACV;;;;;;;;;;wBAYW,aACd,SAAS,2BACT,QAAQ,iBACR;EAAW,WAAW;EAAW;IAAW;;IAC3C;;;;;;;;;;;;;wBAuCmB,mBACpB,SAAS,2BACT,QAAQ,iBACR;EACE,WAAW;;EAEX;;EAEA;EACA,UAAU;IAEX,QAAQ;;;;;;;;;;;;;;;;wBA8DW,cAAc,GAClC,SAAS,2BACT,QAAQ,iBACR;EACE,WAAW;;;EAGX,YAAY,QAAQ,WAAW;;EAE/B,mBAAmB,OAAO;IAAQ;;;EAElC;EACA,UAAU;IAEX,QAAQ"}
1
+ {"version":3,"file":"transactionOutcome.d.ts","names":[],"sources":["../../../../src/core/tasks/transactionOutcome.ts"],"mappings":";;;;;;;;wBA0BgB,UACd,SAAS,KAAK,yCACd;;;;;;;;wBAYc,gBACd,WAAW,uBACX,8BACA;;;;;;;;;;;;;;;wBAsBc,kBAAkB;EAChC;EACA;EACA;;;wBAMc,wBACd,SAAS,2BACT,QAAQ;;wBAQM,UACd,QAAQ,KAAK;EACV;;;;;;;;;;wBAYW,aACd,SAAS,2BACT,QAAQ,iBACR;EAAW,WAAW;EAAW;IAAW;;IAC3C;;;;;;;;;;;;;wBAuCmB,mBACpB,SAAS,2BACT,QAAQ,iBACR;EACE,WAAW;;EAEX;;EAEA;EACA,UAAU;IAEX,QAAQ;;;;;;;;;;;;;;;;wBA8DW,cAAc,GAClC,SAAS,2BACT,QAAQ,iBACR;EACE,WAAW;;;EAGX,YAAY,QAAQ,WAAW;;EAE/B,mBAAmB,OAAO;IAAQ;;;EAElC;EACA,UAAU;IAEX,QAAQ"}
@@ -1,9 +1,9 @@
1
- import { isConfirmedCommitment } from "../../confirmation/types.js";
2
1
  import { lookupSignatureStatus } from "../../actions/lookupSignatureStatus.js";
3
- import { confirmationError } from "./confirmationError.js";
2
+ import { isConfirmedCommitment } from "../../confirmation/types.js";
4
3
  import { SolanaTransactionDetailsError } from "../../utils/solanaErrorCause.js";
4
+ import { confirmationError } from "./confirmationError.js";
5
5
  import { CLOCK_SKEW_MARGIN_MS, LiFiErrorCode, TransactionError, isKnownToStatusApi, isOldEnoughToDrop, isResendAllowed } from "@lifi/sdk";
6
- //#region src/core/tasks/transactionOutcome.ts
6
+ // src/core/tasks/transactionOutcome.ts
7
7
  /** Explorer link for a signature, as both wait tasks write it. */
8
8
  function getTxLink(context, signature) {
9
9
  return `${context.fromChain.metamask.blockExplorerUrls[0]}tx/${signature}`;
@@ -144,7 +144,6 @@ async function sendAndSettle(context, action, options) {
144
144
  });
145
145
  return settleUnconfirmed(confirmationError(result, messages), result.kind === "expired" ? result.slot : void 0);
146
146
  }
147
- //#endregion
148
147
  export { canResendStored, cannotLandAnymore, clearStoredTransactions, failureOf, getTxLink, recordLanded, resolveUnconfirmed, sendAndSettle };
149
148
 
150
149
  //# sourceMappingURL=transactionOutcome.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transactionOutcome.js","names":[],"sources":["../../../../src/core/tasks/transactionOutcome.ts"],"sourcesContent":["import {\n CLOCK_SKEW_MARGIN_MS,\n type ExecutionAction,\n isKnownToStatusApi,\n isOldEnoughToDrop,\n isResendAllowed,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Signature } from '@solana/kit'\nimport { lookupSignatureStatus } from '../../actions/lookupSignatureStatus.js'\nimport type { RaceResult } from '../../confirmation/raceRpcs.js'\nimport {\n isConfirmedCommitment,\n type SignatureStatus,\n} from '../../confirmation/types.js'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport type { TransactionLifetime } from '../../utils/getTransactionLifetime.js'\nimport { SolanaTransactionDetailsError } from '../../utils/solanaErrorCause.js'\nimport {\n type ConfirmationMessages,\n confirmationError,\n} from './confirmationError.js'\n\n/** Explorer link for a signature, as both wait tasks write it. */\nexport function getTxLink(\n context: Pick<SolanaStepExecutorContext, 'fromChain'>,\n signature: string\n): string {\n return `${context.fromChain.metamask.blockExplorerUrls[0]}tx/${signature}`\n}\n\n/**\n * May stored bytes be sent (again)? A blockhash transaction always: the\n * chain rejects it once the blockhash dies, and the deadline's probe tells\n * when. Anything else - a durable nonce, a lifetime that did not decode -\n * only inside the resend age cap, so a page load hours later cannot execute\n * a swap on an old quote.\n */\nexport function canResendStored(\n lifetimes: TransactionLifetime[],\n signedAt: number | undefined,\n now?: number\n): boolean {\n const expiresOnItsOwn =\n lifetimes.length > 0 &&\n lifetimes.every((lifetime) => lifetime.kind === 'blockhash')\n return expiresOnItsOwn || isResendAllowed(signedAt, now)\n}\n\n/**\n * Condition (a) of the dropped rule in `resolveUnconfirmed`: the chain says\n * the transaction can no longer land.\n *\n * - An `expired` verdict: the blockhash probe saw it dead.\n * - Without a verdict, `isOldEnoughToDrop` for every lifetime. For a\n * blockhash transaction that is the five-minute time fallback. For a\n * durable nonce or an undecodable lifetime it is the age cap passed plus a\n * margin: sends stop at the cap, and the three minutes after it put the\n * lookup's current-slot head safely past any slot the transaction could\n * still land in.\n *\n * An unknown signing time never holds by time.\n */\nexport function cannotLandAnymore(options: {\n expired: boolean\n signedAt: number | undefined\n now?: number\n}): boolean {\n return options.expired || isOldEnoughToDrop(options.signedAt, options.now)\n}\n\n/** Drops the stored bytes: never sent, landed, or final. */\nexport function clearStoredTransactions(\n context: SolanaStepExecutorContext,\n action: ExecutionAction\n): void {\n context.statusManager.updateAction(context.step, action.type, 'PENDING', {\n txHex: undefined,\n })\n}\n\n/** A signature status's `err` as the failure `recordLanded` takes. */\nexport function failureOf(\n status: Pick<SignatureStatus, 'err'>\n): { err: unknown } | undefined {\n return status.err ? { err: status.err } : undefined\n}\n\n/**\n * Result rule for a transaction the chain has: writes `txHash` and `txLink`,\n * clears the stored bytes, then completes - or throws the final\n * `TransactionFailed` for one that failed on chain.\n *\n * The hash is written for a failed transaction too: it exists on chain, and\n * a resume that found it by lookup has no `txHash` yet.\n */\nexport function recordLanded(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: { signature: Signature; failure: { err: unknown } | undefined }\n): TaskResult {\n const { step, statusManager, isBridgeExecution } = context\n const { signature, failure } = options\n\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: signature,\n txLink: getTxLink(context, signature),\n txHex: undefined,\n })\n\n if (failure) {\n const cause = new SolanaTransactionDetailsError(failure.err)\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n `Transaction failed: ${cause.message}`,\n cause,\n { final: true }\n )\n }\n\n if (isBridgeExecution) {\n statusManager.updateAction(step, action.type, 'DONE')\n }\n\n return { status: 'COMPLETED' }\n}\n\n/**\n * Decides what a transaction that did not confirm is: landed after all\n * (returns its status), dropped (throws a final `TransactionExpired`), or\n * unknown (rethrows `error`, the error the task built for today's outcome).\n *\n * Dropped (see the resume rules in `transactionState.ts`) = (a)\n * `cannotLandAnymore`, AND (b) a lookup that proves the absence - a covering\n * RPC whose head is past the landing window answered `null` in the same\n * response, and no RPC has the transaction - AND (c) the status API does not\n * know the hash. The status API only vetoes: it answers 404 for landed\n * transactions it does not index too, so a miss there proves nothing.\n */\nexport async function resolveUnconfirmed(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: {\n signature: Signature\n /** What the integrator sees when the outcome stays unknown. */\n error: unknown\n /** The slot of the `expired` verdict; `undefined` without one. */\n expiredAtSlot: bigint | undefined\n messages: ConfirmationMessages\n }\n): Promise<SignatureStatus> {\n const { client, step } = context\n const { signature, error, expiredAtSlot } = options\n const signedAt = step.execution?.signedAt\n\n // (a) The local check runs first, so a young transaction costs no request.\n if (!cannotLandAnymore({ expired: expiredAtSlot !== undefined, signedAt })) {\n throw error\n }\n // Without a signing time there is no anchor, so no canary can prove that a\n // node's history covers the transaction.\n if (signedAt === undefined) {\n throw error\n }\n\n // (b) Absence, proven by the same response that proves coverage and head.\n // Every other lookup result - also `unknown` with `answered: false`, an\n // outage - keeps the outcome unknown.\n const lookup = await lookupSignatureStatus(client, signature, {\n anchor: signedAt - CLOCK_SKEW_MARGIN_MS,\n expiredAtSlot,\n })\n if (\n lookup.kind === 'found' &&\n isConfirmedCommitment(lookup.status.confirmationStatus)\n ) {\n return lookup.status\n }\n if (lookup.kind !== 'not-found') {\n throw error\n }\n\n // (c) The veto.\n if (await isKnownToStatusApi(client, step, signature)) {\n throw error\n }\n\n clearStoredTransactions(context, action)\n // Today's expiry code and text: only the marker is new.\n throw new TransactionError(\n LiFiErrorCode.TransactionExpired,\n options.messages.notConfirmed,\n error instanceof Error ? error : undefined,\n { final: true }\n )\n}\n\n/**\n * The send-and-settle tail both wait tasks share: runs `send`, then applies\n * the result rules to what it reports.\n *\n * - A confirmation goes to `recordLanded`, with `confirmedFailure` reading\n * its on-chain failure.\n * - Every other result - `rpc-unavailable` included - goes to\n * `resolveUnconfirmed`. Only an `expired` verdict passes its slot: the\n * dropped check reads any defined slot as a verdict.\n * - A rejection comes before the first send of this run. On the first run\n * nothing ever left the SDK, so the bytes are cleared and the error is\n * rethrown: \"Try again\" signs again. On a resume an earlier run may have\n * sent the same bytes: they stay, and only the chain can make the outcome\n * final.\n */\nexport async function sendAndSettle<T>(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: {\n signature: Signature\n /** Sends and races the confirmation. Rejects only before its first\n * send; the race itself never rejects. */\n send: () => Promise<RaceResult<T>>\n /** The on-chain failure of a confirmed value. */\n confirmedFailure: (value: T) => { err: unknown } | undefined\n /** An earlier run may already have sent these bytes. */\n resuming: boolean\n messages: ConfirmationMessages\n }\n): Promise<TaskResult> {\n const { signature, messages } = options\n\n /** `resolveUnconfirmed` throws for an unknown or dropped outcome, so only\n * a confirmed status reaches `recordLanded`. */\n const settleUnconfirmed = async (\n error: unknown,\n expiredAtSlot: bigint | undefined\n ): Promise<TaskResult> => {\n const status = await resolveUnconfirmed(context, action, {\n signature,\n error,\n expiredAtSlot,\n messages,\n })\n return recordLanded(context, action, {\n signature,\n failure: failureOf(status),\n })\n }\n\n let result: RaceResult<T>\n try {\n result = await options.send()\n } catch (error) {\n if (!options.resuming) {\n clearStoredTransactions(context, action)\n throw error\n }\n return settleUnconfirmed(error, undefined)\n }\n\n if (result.kind === 'confirmed') {\n return recordLanded(context, action, {\n signature,\n failure: options.confirmedFailure(result.value),\n })\n }\n\n return settleUnconfirmed(\n confirmationError(result, messages),\n // The head a covering RPC has to reach before its `null` counts.\n result.kind === 'expired' ? result.slot : undefined\n )\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"transactionOutcome.js","names":[],"sources":["../../../../src/core/tasks/transactionOutcome.ts"],"sourcesContent":["import {\n CLOCK_SKEW_MARGIN_MS,\n type ExecutionAction,\n isKnownToStatusApi,\n isOldEnoughToDrop,\n isResendAllowed,\n LiFiErrorCode,\n type TaskResult,\n TransactionError,\n} from '@lifi/sdk'\nimport type { Signature } from '@solana/kit'\nimport { lookupSignatureStatus } from '../../actions/lookupSignatureStatus.js'\nimport type { RaceResult } from '../../confirmation/raceRpcs.js'\nimport {\n isConfirmedCommitment,\n type SignatureStatus,\n} from '../../confirmation/types.js'\nimport type { SolanaStepExecutorContext } from '../../types.js'\nimport type { TransactionLifetime } from '../../utils/getTransactionLifetime.js'\nimport { SolanaTransactionDetailsError } from '../../utils/solanaErrorCause.js'\nimport {\n confirmationError,\n type ConfirmationMessages,\n} from './confirmationError.js'\n\n/** Explorer link for a signature, as both wait tasks write it. */\nexport function getTxLink(\n context: Pick<SolanaStepExecutorContext, 'fromChain'>,\n signature: string\n): string {\n return `${context.fromChain.metamask.blockExplorerUrls[0]}tx/${signature}`\n}\n\n/**\n * May stored bytes be sent (again)? A blockhash transaction always: the\n * chain rejects it once the blockhash dies, and the deadline's probe tells\n * when. Anything else - a durable nonce, a lifetime that did not decode -\n * only inside the resend age cap, so a page load hours later cannot execute\n * a swap on an old quote.\n */\nexport function canResendStored(\n lifetimes: TransactionLifetime[],\n signedAt: number | undefined,\n now?: number\n): boolean {\n const expiresOnItsOwn =\n lifetimes.length > 0 &&\n lifetimes.every((lifetime) => lifetime.kind === 'blockhash')\n return expiresOnItsOwn || isResendAllowed(signedAt, now)\n}\n\n/**\n * Condition (a) of the dropped rule in `resolveUnconfirmed`: the chain says\n * the transaction can no longer land.\n *\n * - An `expired` verdict: the blockhash probe saw it dead.\n * - Without a verdict, `isOldEnoughToDrop` for every lifetime. For a\n * blockhash transaction that is the five-minute time fallback. For a\n * durable nonce or an undecodable lifetime it is the age cap passed plus a\n * margin: sends stop at the cap, and the three minutes after it put the\n * lookup's current-slot head safely past any slot the transaction could\n * still land in.\n *\n * An unknown signing time never holds by time.\n */\nexport function cannotLandAnymore(options: {\n expired: boolean\n signedAt: number | undefined\n now?: number\n}): boolean {\n return options.expired || isOldEnoughToDrop(options.signedAt, options.now)\n}\n\n/** Drops the stored bytes: never sent, landed, or final. */\nexport function clearStoredTransactions(\n context: SolanaStepExecutorContext,\n action: ExecutionAction\n): void {\n context.statusManager.updateAction(context.step, action.type, 'PENDING', {\n txHex: undefined,\n })\n}\n\n/** A signature status's `err` as the failure `recordLanded` takes. */\nexport function failureOf(\n status: Pick<SignatureStatus, 'err'>\n): { err: unknown } | undefined {\n return status.err ? { err: status.err } : undefined\n}\n\n/**\n * Result rule for a transaction the chain has: writes `txHash` and `txLink`,\n * clears the stored bytes, then completes - or throws the final\n * `TransactionFailed` for one that failed on chain.\n *\n * The hash is written for a failed transaction too: it exists on chain, and\n * a resume that found it by lookup has no `txHash` yet.\n */\nexport function recordLanded(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: { signature: Signature; failure: { err: unknown } | undefined }\n): TaskResult {\n const { step, statusManager, isBridgeExecution } = context\n const { signature, failure } = options\n\n statusManager.updateAction(step, action.type, 'PENDING', {\n txHash: signature,\n txLink: getTxLink(context, signature),\n txHex: undefined,\n })\n\n if (failure) {\n const cause = new SolanaTransactionDetailsError(failure.err)\n throw new TransactionError(\n LiFiErrorCode.TransactionFailed,\n `Transaction failed: ${cause.message}`,\n cause,\n { final: true }\n )\n }\n\n if (isBridgeExecution) {\n statusManager.updateAction(step, action.type, 'DONE')\n }\n\n return { status: 'COMPLETED' }\n}\n\n/**\n * Decides what a transaction that did not confirm is: landed after all\n * (returns its status), dropped (throws a final `TransactionExpired`), or\n * unknown (rethrows `error`, the error the task built for today's outcome).\n *\n * Dropped (see the resume rules in `transactionState.ts`) = (a)\n * `cannotLandAnymore`, AND (b) a lookup that proves the absence - a covering\n * RPC whose head is past the landing window answered `null` in the same\n * response, and no RPC has the transaction - AND (c) the status API does not\n * know the hash. The status API only vetoes: it answers 404 for landed\n * transactions it does not index too, so a miss there proves nothing.\n */\nexport async function resolveUnconfirmed(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: {\n signature: Signature\n /** What the integrator sees when the outcome stays unknown. */\n error: unknown\n /** The slot of the `expired` verdict; `undefined` without one. */\n expiredAtSlot: bigint | undefined\n messages: ConfirmationMessages\n }\n): Promise<SignatureStatus> {\n const { client, step } = context\n const { signature, error, expiredAtSlot } = options\n const signedAt = step.execution?.signedAt\n\n // (a) The local check runs first, so a young transaction costs no request.\n if (!cannotLandAnymore({ expired: expiredAtSlot !== undefined, signedAt })) {\n throw error\n }\n // Without a signing time there is no anchor, so no canary can prove that a\n // node's history covers the transaction.\n if (signedAt === undefined) {\n throw error\n }\n\n // (b) Absence, proven by the same response that proves coverage and head.\n // Every other lookup result - also `unknown` with `answered: false`, an\n // outage - keeps the outcome unknown.\n const lookup = await lookupSignatureStatus(client, signature, {\n anchor: signedAt - CLOCK_SKEW_MARGIN_MS,\n expiredAtSlot,\n })\n if (\n lookup.kind === 'found' &&\n isConfirmedCommitment(lookup.status.confirmationStatus)\n ) {\n return lookup.status\n }\n if (lookup.kind !== 'not-found') {\n throw error\n }\n\n // (c) The veto.\n if (await isKnownToStatusApi(client, step, signature)) {\n throw error\n }\n\n clearStoredTransactions(context, action)\n // Today's expiry code and text: only the marker is new.\n throw new TransactionError(\n LiFiErrorCode.TransactionExpired,\n options.messages.notConfirmed,\n error instanceof Error ? error : undefined,\n { final: true }\n )\n}\n\n/**\n * The send-and-settle tail both wait tasks share: runs `send`, then applies\n * the result rules to what it reports.\n *\n * - A confirmation goes to `recordLanded`, with `confirmedFailure` reading\n * its on-chain failure.\n * - Every other result - `rpc-unavailable` included - goes to\n * `resolveUnconfirmed`. Only an `expired` verdict passes its slot: the\n * dropped check reads any defined slot as a verdict.\n * - A rejection comes before the first send of this run. On the first run\n * nothing ever left the SDK, so the bytes are cleared and the error is\n * rethrown: \"Try again\" signs again. On a resume an earlier run may have\n * sent the same bytes: they stay, and only the chain can make the outcome\n * final.\n */\nexport async function sendAndSettle<T>(\n context: SolanaStepExecutorContext,\n action: ExecutionAction,\n options: {\n signature: Signature\n /** Sends and races the confirmation. Rejects only before its first\n * send; the race itself never rejects. */\n send: () => Promise<RaceResult<T>>\n /** The on-chain failure of a confirmed value. */\n confirmedFailure: (value: T) => { err: unknown } | undefined\n /** An earlier run may already have sent these bytes. */\n resuming: boolean\n messages: ConfirmationMessages\n }\n): Promise<TaskResult> {\n const { signature, messages } = options\n\n /** `resolveUnconfirmed` throws for an unknown or dropped outcome, so only\n * a confirmed status reaches `recordLanded`. */\n const settleUnconfirmed = async (\n error: unknown,\n expiredAtSlot: bigint | undefined\n ): Promise<TaskResult> => {\n const status = await resolveUnconfirmed(context, action, {\n signature,\n error,\n expiredAtSlot,\n messages,\n })\n return recordLanded(context, action, {\n signature,\n failure: failureOf(status),\n })\n }\n\n let result: RaceResult<T>\n try {\n result = await options.send()\n } catch (error) {\n if (!options.resuming) {\n clearStoredTransactions(context, action)\n throw error\n }\n return settleUnconfirmed(error, undefined)\n }\n\n if (result.kind === 'confirmed') {\n return recordLanded(context, action, {\n signature,\n failure: options.confirmedFailure(result.value),\n })\n }\n\n return settleUnconfirmed(\n confirmationError(result, messages),\n // The head a covering RPC has to reach before its `null` counts.\n result.kind === 'expired' ? result.slot : undefined\n )\n}\n"],"mappings":"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"}
@@ -1,5 +1,3 @@
1
1
  import { ExecutionAction, LiFiStep, SDKError } from "@lifi/sdk";
2
- //#region src/errors/parseSolanaErrors.d.ts
3
2
  export declare const parseSolanaErrors: (e: Error, step?: LiFiStep, action?: ExecutionAction) => Promise<SDKError>;
4
- //#endregion
5
3
  //# sourceMappingURL=parseSolanaErrors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseSolanaErrors.d.ts","names":[],"sources":["../../../src/errors/parseSolanaErrors.ts"],"mappings":";;qBAWa,oBACX,GAAG,OACH,OAAO,UACP,SAAS,oBACR,QAAQ"}
1
+ {"version":3,"file":"parseSolanaErrors.d.ts","names":[],"sources":["../../../src/errors/parseSolanaErrors.ts"],"mappings":";qBAWa,oBACX,GAAG,OACH,OAAO,UACP,SAAS,oBACR,QAAQ"}
@@ -1,5 +1,5 @@
1
1
  import { BaseError, ErrorMessage, LiFiErrorCode, SDKError, TransactionError, UnknownError } from "@lifi/sdk";
2
- //#region src/errors/parseSolanaErrors.ts
2
+ // src/errors/parseSolanaErrors.ts
3
3
  const parseSolanaErrors = async (e, step, action) => {
4
4
  if (e instanceof SDKError) {
5
5
  e.step = e.step ?? step;
@@ -26,7 +26,6 @@ const handleSpecificErrors = (e) => {
26
26
  if (e instanceof BaseError) return e;
27
27
  return new UnknownError(e.message || ErrorMessage.UnknownError, e);
28
28
  };
29
- //#endregion
30
29
  export { parseSolanaErrors };
31
30
 
32
31
  //# sourceMappingURL=parseSolanaErrors.js.map
@@ -1,5 +1,5 @@
1
- import { SolanaProviderOptions, SolanaSDKProvider, isSolanaProvider } from "./types.js";
2
1
  import { SolanaProvider } from "./SolanaProvider.js";
2
+ import { SolanaProviderOptions, SolanaSDKProvider, isSolanaProvider } from "./types.js";
3
3
  import { KeypairWalletAdapter } from "./utils/KeypairWalletAdapter.js";
4
4
  import { SolanaTransactionDetailsError } from "./utils/solanaErrorCause.js";
5
5
  import { address as toAddress } from "@solana/kit";
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { SolanaTransactionDetailsError } from "./utils/solanaErrorCause.js";
2
1
  import { SolanaProvider } from "./SolanaProvider.js";
3
2
  import { isSolanaProvider } from "./types.js";
4
3
  import { KeypairWalletAdapter } from "./utils/KeypairWalletAdapter.js";
4
+ import { SolanaTransactionDetailsError } from "./utils/solanaErrorCause.js";
5
5
  import { address as toAddress } from "@solana/kit";
6
6
  export { KeypairWalletAdapter, SolanaProvider, SolanaTransactionDetailsError, isSolanaProvider, toAddress };
@@ -1,6 +1,5 @@
1
1
  import { JitoRegion } from "../types.js";
2
2
  import { Signature } from "@solana/kit";
3
- //#region src/rpc/jito/api/getBundleStatuses.d.ts
4
3
  type BundleStatus = {
5
4
  bundle_id: string;
6
5
  /** Optional: unvalidated wire data, so the reader must handle its absence. */
@@ -23,6 +22,5 @@ export type GetBundleStatusesApi = {
23
22
  */
24
23
  getBundleStatuses(bundleIds: string[], region?: JitoRegion): GetBundleStatusesResponse;
25
24
  };
26
- //#endregion
27
25
  export {};
28
26
  //# sourceMappingURL=getBundleStatuses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBundleStatuses.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getBundleStatuses.ts"],"mappings":";;;KAIK;EACH;;EAEA,eAAe;EACf;EACA;EACA;;KAGG;EACH;IACE;;;EAGF,QAAQ;;YAGE;;;;;EAKV,kBAEE,qBAEA,SAAS,aACR"}
1
+ {"version":3,"file":"getBundleStatuses.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getBundleStatuses.ts"],"mappings":";;KAIK;EACH;;EAEA,eAAe;EACf;EACA;EACA;;KAGG;EACH;IACE;;;EAGF,QAAQ;;YAGE;;;;;EAKV,kBAEE,qBAEA,SAAS,aACR"}
@@ -1,5 +1,4 @@
1
1
  import { JitoRegion } from "../types.js";
2
- //#region src/rpc/jito/api/getTipAccounts.d.ts
3
2
  /** Array of tip account addresses (Solana public keys) */
4
3
  type GetTipAccountsResponse = string[];
5
4
  export type GetTipAccountsApi = {
@@ -10,6 +9,5 @@ export type GetTipAccountsApi = {
10
9
  */
11
10
  getTipAccounts(region?: JitoRegion): GetTipAccountsResponse;
12
11
  };
13
- //#endregion
14
12
  export {};
15
13
  //# sourceMappingURL=getTipAccounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getTipAccounts.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getTipAccounts.ts"],"mappings":";;;KAGK;YAEO;;;;;;EAMV,eAEE,SAAS,aACR"}
1
+ {"version":3,"file":"getTipAccounts.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/getTipAccounts.ts"],"mappings":";;KAGK;YAEO;;;;;;EAMV,eAEE,SAAS,aACR"}
@@ -1,6 +1,5 @@
1
1
  import { JitoRegion } from "../types.js";
2
2
  import { Base64EncodedWireTransaction } from "@solana/kit";
3
- //#region src/rpc/jito/api/sendBundle.d.ts
4
3
  /** Bundle ID returned on successful submission */
5
4
  type SendBundleResponse = string;
6
5
  export type SendBundleApi = {
@@ -17,6 +16,5 @@ export type SendBundleApi = {
17
16
  */
18
17
  sendBundle(transactions: Array<Base64EncodedWireTransaction>, region?: JitoRegion): SendBundleResponse;
19
18
  };
20
- //#endregion
21
19
  export {};
22
20
  //# sourceMappingURL=sendBundle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sendBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/sendBundle.ts"],"mappings":";;;;KAKK;YAEO;;;;;;;;;;;;EAYV,WAEE,cAAc,MAAM,+BAEpB,SAAS,aACR"}
1
+ {"version":3,"file":"sendBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/sendBundle.ts"],"mappings":";;;KAKK;YAEO;;;;;;;;;;;;EAYV,WAEE,cAAc,MAAM,+BAEpB,SAAS,aACR"}
@@ -1,5 +1,4 @@
1
1
  import { Base64EncodedWireTransaction } from "@solana/kit";
2
- //#region src/rpc/jito/api/simulateBundle.d.ts
3
2
  type AccountConfig = {
4
3
  accountIndex: number;
5
4
  addresses: string[];
@@ -56,6 +55,5 @@ export type SimulateBundleApi = {
56
55
  postExecutionAccountsConfigs?: AccountConfig[];
57
56
  }>): SimulateBundleResponse;
58
57
  };
59
- //#endregion
60
58
  export {};
61
59
  //# sourceMappingURL=simulateBundle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simulateBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/simulateBundle.ts"],"mappings":";;KAEK;EACH;EACA;;KAGG;EACH;EACA;EACA;EACA;EACA;;KAGG;EACH;IACE;IACA;;EAEF;IACE;MAAyB;QAAU;QAAgB;;;IACnD,oBAAoB;MAClB;MACA;MACA;MACA;QACE;QACA;;MAEF,sBAAsB;MACtB,uBAAuB;;;;YAKjB;;;;;EAKV,eACE,QAAQ;IACN,qBAAqB,MAAM;MAE7B,SAAS;;IAEP;;IAEA;;IAEA;;IAEA,8BAA8B;;IAE9B,+BAA+B;OAEhC"}
1
+ {"version":3,"file":"simulateBundle.d.ts","names":[],"sources":["../../../../../src/rpc/jito/api/simulateBundle.ts"],"mappings":";KAEK;EACH;EACA;;KAGG;EACH;EACA;EACA;EACA;EACA;;KAGG;EACH;IACE;IACA;;EAEF;IACE;MAAyB;QAAU;QAAgB;;;IACnD,oBAAoB;MAClB;MACA;MACA;MACA;QACE;QACA;;MAEF,sBAAsB;MACtB,uBAAuB;;;;YAKjB;;;;;EAKV,eACE,QAAQ;IACN,qBAAqB,MAAM;MAE7B,SAAS;;IAEP;;IAEA;;IAEA;;IAEA,8BAA8B;;IAE9B,+BAA+B;OAEhC"}
@@ -3,10 +3,8 @@ 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
- //#region src/rpc/jito/createJitoRpc.d.ts
7
6
  export type JitoBundleApi = GetBundleStatusesApi & GetTipAccountsApi & SendBundleApi & SimulateBundleApi;
8
7
  export type JitoRpcApi = JitoBundleApi & SolanaRpcApi;
9
8
  export declare function createJitoRpcFromTransport<TTransport extends RpcTransport>(transport: TTransport): Rpc<JitoRpcApi>;
10
9
  export declare function createJitoRpc<TClusterUrl extends ClusterUrl>(clusterUrl: TClusterUrl, config?: Omit<Parameters<typeof createDefaultRpcTransport<TClusterUrl>>[0], "url">): Rpc<JitoRpcApi>;
11
- //#endregion
12
10
  //# sourceMappingURL=createJitoRpc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createJitoRpc.d.ts","names":[],"sources":["../../../../src/rpc/jito/createJitoRpc.ts"],"mappings":";;;;;;YAeY,gBAAgB,uBAC1B,oBACA,gBACA;YAGU,aAAa,gBAAgB;wBAQzB,2BAA2B,mBAAmB,cAC5D,WAAW,aACV,IAAI;wBAQS,cAAc,oBAAoB,YAChD,YAAY,aACZ,SAAS,KACP,kBAAkB,0BAA0B,2BAG7C,IAAI"}
1
+ {"version":3,"file":"createJitoRpc.d.ts","names":[],"sources":["../../../../src/rpc/jito/createJitoRpc.ts"],"mappings":";;;;;YAeY,gBAAgB,uBAC1B,oBACA,gBACA;YAGU,aAAa,gBAAgB;wBAQzB,2BAA2B,mBAAmB,cAC5D,WAAW,aACV,IAAI;wBAQS,cAAc,oBAAoB,YAChD,YAAY,aACZ,SAAS,KACP,kBAAkB,0BAA0B,2BAG7C,IAAI"}
@@ -1,5 +1,5 @@
1
1
  import { createDefaultRpcTransport, createRpc, createSolanaRpcApi } from "@solana/kit";
2
- //#region src/rpc/jito/createJitoRpc.ts
2
+ // src/rpc/jito/createJitoRpc.ts
3
3
  function createJitoRpcApi() {
4
4
  return createSolanaRpcApi();
5
5
  }
@@ -15,7 +15,6 @@ function createJitoRpc(clusterUrl, config) {
15
15
  ...config
16
16
  }));
17
17
  }
18
- //#endregion
19
18
  export { createJitoRpc, createJitoRpcFromTransport };
20
19
 
21
20
  //# sourceMappingURL=createJitoRpc.js.map
@@ -1,7 +1,5 @@
1
- //#region src/rpc/jito/types.d.ts
2
1
  /**
3
2
  * Available Jito regions for routing requests.
4
3
  */
5
4
  export type JitoRegion = "mainnet" | "amsterdam" | "frankfurt" | "ny" | "tokyo" | "slc" | "london" | "singapore";
6
- //#endregion
7
5
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/rpc/jito/types.ts"],"mappings":";;;;YAGY"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/rpc/jito/types.ts"],"mappings":";;;YAGY"}
@@ -1,6 +1,5 @@
1
1
  import { JitoRpcType, SolanaRpcType } from "./types.js";
2
2
  import { SDKClient } from "@lifi/sdk";
3
- //#region src/rpc/registry.d.ts
4
3
  /** Both leave the endpoint out of the Jito list, but only `unsupported` is a
5
4
  * configuration gap the integrator can act on. */
6
5
  export type JitoProbeOutcome = "supported" | "unsupported" | "unreachable";
@@ -65,5 +64,4 @@ export declare const getJitoCapableRpcs: (rpcUrls: string[]) => Promise<{
65
64
  rpcs: JitoRpcType[];
66
65
  unreachable: number;
67
66
  }>;
68
- //#endregion
69
67
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","names":[],"sources":["../../../src/rpc/registry.ts"],"mappings":";;;;;YAyBY;;;;YAKA;EACV,SAAS;;EAET;;;;;qBAMW;;;;;;;;qBASA;;;;;;;qBA+EA,eACX,mBACC,QAAQ;;;;;qBAyHE,gBACX,QAAQ,cACP,QAAQ;;;;;;;;qBAWE,qBAAsB,sBAAoB;;;;;;qBAU1C,cACX,QAAQ,cACP;EAAU,MAAM;EAAe;;;;;;;;;;qBAarB,qBACX,sBACC;EAAU,MAAM;EAAe"}
1
+ {"version":3,"file":"registry.d.ts","names":[],"sources":["../../../src/rpc/registry.ts"],"mappings":";;;;YAyBY;;;;YAKA;EACV,SAAS;;EAET;;;;;qBAMW;;;;;;;;qBASA;;;;;;;qBA+EA,eACX,mBACC,QAAQ;;;;;qBAyHE,gBACX,QAAQ,cACP,QAAQ;;;;;;;;qBAWE,qBAAsB,sBAAoB;;;;;;qBAU1C,cACX,QAAQ,cACP;EAAU,MAAM;EAAe;;;;;;;;;;qBAarB,qBACX,sBACC;EAAU,MAAM;EAAe"}
@@ -1,7 +1,7 @@
1
1
  import { createJitoRpc } from "./jito/createJitoRpc.js";
2
2
  import { ChainId, LruMap, withDedupe } from "@lifi/sdk";
3
3
  import { createSolanaRpc } from "@solana/kit";
4
- //#region src/rpc/registry.ts
4
+ // src/rpc/registry.ts
5
5
  const solanaRpcs = new LruMap(64);
6
6
  const jitoRpcs = new LruMap(64);
7
7
  /**
@@ -186,7 +186,6 @@ const getJitoCapableRpcs = async (rpcUrls) => {
186
186
  unreachable
187
187
  };
188
188
  };
189
- //#endregion
190
189
  export { JITO_PROBE_GATEWAY_RETRY_MS, JITO_PROBE_RETRY_MS, getJitoCapableRpcs, getJitoRpcs, getSolanaRpcs, getSolanaWriteRpcs, probeJitoRpc };
191
190
 
192
191
  //# sourceMappingURL=registry.js.map
@@ -1,7 +1,5 @@
1
1
  import { JitoRpcApi } from "./jito/createJitoRpc.js";
2
2
  import { Rpc, createSolanaRpc } from "@solana/kit";
3
- //#region src/rpc/types.d.ts
4
3
  export type SolanaRpcType = ReturnType<typeof createSolanaRpc>;
5
4
  export type JitoRpcType = Rpc<JitoRpcApi>;
6
- //#endregion
7
5
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/rpc/types.ts"],"mappings":";;;YAGY,gBAAgB,kBAAkB;YAClC,cAAc,IAAI"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/rpc/types.ts"],"mappings":";;YAGY,gBAAgB,kBAAkB;YAClC,cAAc,IAAI"}
@@ -1,6 +1,5 @@
1
1
  import { JitoRpcType, SolanaRpcType } from "./types.js";
2
2
  import { SDKClient } from "@lifi/sdk";
3
- //#region src/rpc/utils.d.ts
4
3
  type RetryFn<Rpc> = <R>(client: SDKClient, fn: (rpc: Rpc) => Promise<R>) => Promise<R>;
5
4
  /**
6
5
  * Calls a function on RPC instances with retry logic.
@@ -61,6 +60,5 @@ export declare const callSolanaRpcsWithRetry: RetryFn<SolanaRpcType>;
61
60
  * ```
62
61
  */
63
62
  export declare const callJitoRpcsWithRetry: RetryFn<JitoRpcType>;
64
- //#endregion
65
63
  export {};
66
64
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/rpc/utils.ts"],"mappings":";;;KAIK,QAAQ,QAAQ,GACnB,QAAQ,WACR,KAAK,KAAK,QAAQ,QAAQ,OACvB,QAAQ;;;;;;;;;;;;;;;;;;;;;wBAsBS,cAAc,GAAG,GACrC,MAAM,KACN,KAAK,KAAK,MAAM,QAAQ,KACvB,QAAQ;;;;;;;;;;;;;;;;;;;qBA8CE,yBAAyB,QAAQ;;;;;;;;;;;;;;;;;;;qBAqBjC,uBAAuB,QAAQ"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/rpc/utils.ts"],"mappings":";;KAIK,QAAQ,QAAQ,GACnB,QAAQ,WACR,KAAK,KAAK,QAAQ,QAAQ,OACvB,QAAQ;;;;;;;;;;;;;;;;;;;;;wBAsBS,cAAc,GAAG,GACrC,MAAM,KACN,KAAK,KAAK,MAAM,QAAQ,KACvB,QAAQ;;;;;;;;;;;;;;;;;;;qBA8CE,yBAAyB,QAAQ;;;;;;;;;;;;;;;;;;;qBAqBjC,uBAAuB,QAAQ"}
@@ -1,5 +1,5 @@
1
1
  import { getJitoRpcs, getSolanaRpcs } from "./registry.js";
2
- //#region src/rpc/utils.ts
2
+ // src/rpc/utils.ts
3
3
  /**
4
4
  * Calls a function on RPC instances with retry logic.
5
5
  * Tries each RPC in sequence until one succeeds.
@@ -75,7 +75,6 @@ const callSolanaRpcsWithRetry = createRetryFn(getSolanaRpcs);
75
75
  * ```
76
76
  */
77
77
  const callJitoRpcsWithRetry = createRetryFn(async (client) => (await getJitoRpcs(client)).rpcs);
78
- //#endregion
79
78
  export { callJitoRpcsWithRetry, callSolanaRpcsWithRetry, callWithRetry };
80
79
 
81
80
  //# sourceMappingURL=utils.js.map
@@ -1,7 +1,6 @@
1
1
  import { LiFiStepExtended, SDKProvider, StepExecutorContext, StepExecutorOptions } from "@lifi/sdk";
2
2
  import { Transaction } from "@solana/kit";
3
3
  import { Wallet, WalletAccount } from "@wallet-standard/base";
4
- //#region src/types.d.ts
5
4
  export interface SolanaProviderOptions {
6
5
  getWallet?: () => Promise<Wallet>;
7
6
  skipSimulation?: boolean;
@@ -38,5 +37,4 @@ export interface SolanaStepExecutorOptions extends StepExecutorOptions {
38
37
  wallet: Wallet;
39
38
  skipSimulation?: boolean;
40
39
  }
41
- //#endregion
42
40
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"mappings":";;;;iBAUiB;EACf,kBAAkB,QAAQ;EAC1B;;iBAGe;;;;;EAKf,qBAAqB;;;;;;EAMrB;;iBAGe,kCACP,qBACN;EACF,QAAQ;;;;;;;EAOR,mBAAmB,MAAM,qBAAqB;EAC9C;;iBAGe,0BAA0B;EACzC,WAAW,SAAS;;wBAGN,iBACd,UAAU,cACT,YAAY;iBAIE,kCAAkC;EACjD,QAAQ;EACR"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"mappings":";;;iBAUiB;EACf,kBAAkB,QAAQ;EAC1B;;iBAGe;;;;;EAKf,qBAAqB;;;;;;EAMrB;;iBAGe,kCACP,qBAAqB;EAC7B,QAAQ;;;;;;;EAOR,mBAAmB,MAAM,qBAAqB;EAC9C;;iBAGe,0BAA0B;EACzC,WAAW,SAAS;;wBAGN,iBACd,UAAU,cACT,YAAY;iBAIE,kCAAkC;EACjD,QAAQ;EACR"}
package/dist/esm/types.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import { ChainType } from "@lifi/sdk";
2
- //#region src/types.ts
2
+ // src/types.ts
3
3
  function isSolanaProvider(provider) {
4
4
  return provider.type === ChainType.SVM;
5
5
  }
6
- //#endregion
7
6
  export { isSolanaProvider };
8
7
 
9
8
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import {\n ChainType,\n type LiFiStepExtended,\n type SDKProvider,\n type StepExecutorContext,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport type { Transaction } from '@solana/kit'\nimport type { Wallet, WalletAccount } from '@wallet-standard/base'\n\nexport interface SolanaProviderOptions {\n getWallet?: () => Promise<Wallet>\n skipSimulation?: boolean\n}\n\nexport interface SolanaTaskContext {\n /**\n * Set by the sign task. Absent on a resume: the wait tasks then read the\n * signed bytes from the action's `txHex`.\n */\n signedTransactions?: Transaction[]\n /**\n * Whether the backend returned a Jito bundle (array `transactionRequest.data`)\n * that must be submitted via `sendBundle` instead of `sendTransaction`.\n * Absent on a resume: a leading `[` in `txHex` marks a bundle then.\n */\n isBundleExecution?: boolean\n}\n\nexport interface SolanaStepExecutorContext\n extends StepExecutorContext,\n SolanaTaskContext {\n wallet: Wallet\n /**\n * Resolves the account that requested the quote. Only the sign task calls\n * it, so a resume that only waits does not need the wallet to have\n * reconnected. Throws `WalletChangedDuringExecution` when the account is\n * gone.\n */\n getWalletAccount: (step: LiFiStepExtended) => WalletAccount\n skipSimulation: boolean\n}\n\nexport interface SolanaSDKProvider extends SDKProvider {\n setOptions(options: SolanaProviderOptions): void\n}\n\nexport function isSolanaProvider(\n provider: SDKProvider\n): provider is SolanaSDKProvider {\n return provider.type === ChainType.SVM\n}\n\nexport interface SolanaStepExecutorOptions extends StepExecutorOptions {\n wallet: Wallet\n skipSimulation?: boolean\n}\n"],"mappings":";;AA+CA,SAAgB,iBACd,UAC+B;CAC/B,OAAO,SAAS,SAAS,UAAU;AACrC"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import {\n ChainType,\n type LiFiStepExtended,\n type SDKProvider,\n type StepExecutorContext,\n type StepExecutorOptions,\n} from '@lifi/sdk'\nimport type { Transaction } from '@solana/kit'\nimport type { Wallet, WalletAccount } from '@wallet-standard/base'\n\nexport interface SolanaProviderOptions {\n getWallet?: () => Promise<Wallet>\n skipSimulation?: boolean\n}\n\nexport interface SolanaTaskContext {\n /**\n * Set by the sign task. Absent on a resume: the wait tasks then read the\n * signed bytes from the action's `txHex`.\n */\n signedTransactions?: Transaction[]\n /**\n * Whether the backend returned a Jito bundle (array `transactionRequest.data`)\n * that must be submitted via `sendBundle` instead of `sendTransaction`.\n * Absent on a resume: a leading `[` in `txHex` marks a bundle then.\n */\n isBundleExecution?: boolean\n}\n\nexport interface SolanaStepExecutorContext\n extends StepExecutorContext, SolanaTaskContext {\n wallet: Wallet\n /**\n * Resolves the account that requested the quote. Only the sign task calls\n * it, so a resume that only waits does not need the wallet to have\n * reconnected. Throws `WalletChangedDuringExecution` when the account is\n * gone.\n */\n getWalletAccount: (step: LiFiStepExtended) => WalletAccount\n skipSimulation: boolean\n}\n\nexport interface SolanaSDKProvider extends SDKProvider {\n setOptions(options: SolanaProviderOptions): void\n}\n\nexport function isSolanaProvider(\n provider: SDKProvider\n): provider is SolanaSDKProvider {\n return provider.type === ChainType.SVM\n}\n\nexport interface SolanaStepExecutorOptions extends StepExecutorOptions {\n wallet: Wallet\n skipSimulation?: boolean\n}\n"],"mappings":";;AA8CA,SAAgB,iBACd,UAC+B;CAC/B,OAAO,SAAS,SAAS,UAAU;AACrC"}
@@ -1,7 +1,5 @@
1
- //#region src/utils/KeypairWallet.unit.helpers.d.ts
2
1
  export declare const generateTestKeypair: () => Promise<{
3
2
  secretKey: string;
4
3
  publicKey: Uint8Array;
5
4
  }>;
6
- //#endregion
7
5
  //# sourceMappingURL=KeypairWallet.unit.helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeypairWallet.unit.helpers.d.ts","names":[],"sources":["../../../src/utils/KeypairWallet.unit.helpers.ts"],"mappings":";qBAKa,2BAAgC;EAC3C;EACA,WAAW"}
1
+ {"version":3,"file":"KeypairWallet.unit.helpers.d.ts","names":[],"sources":["../../../src/utils/KeypairWallet.unit.helpers.ts"],"mappings":"A,qBAKa,2BAAgC;EAC3C;EACA,WAAW"}
@@ -1,5 +1,5 @@
1
1
  import { getBase58Codec } from "@solana/kit";
2
- //#region src/utils/KeypairWallet.unit.helpers.ts
2
+ // src/utils/KeypairWallet.unit.helpers.ts
3
3
  const nativeCrypto = globalThis.crypto;
4
4
  const generateTestKeypair = async () => {
5
5
  if (!nativeCrypto?.subtle) throw new Error("SubtleCrypto is not available in this environment");
@@ -13,7 +13,6 @@ const generateTestKeypair = async () => {
13
13
  publicKey
14
14
  };
15
15
  };
16
- //#endregion
17
16
  export { generateTestKeypair };
18
17
 
19
18
  //# sourceMappingURL=KeypairWallet.unit.helpers.js.map
@@ -1,6 +1,5 @@
1
1
  import { SolanaSignTransactionFeature } from "@solana/wallet-standard-features";
2
2
  import { Wallet, WalletAccount } from "@wallet-standard/base";
3
- //#region src/utils/KeypairWalletAdapter.d.ts
4
3
  /**
5
4
  * This keypair wallet adapter is unsafe to use on the frontend and is only included to provide an easy way for applications to test
6
5
  * Wallet Adapter without using a third-party wallet.
@@ -24,5 +23,4 @@ export declare class KeypairWalletAdapter implements Wallet {
24
23
  disconnect(): Promise<void>;
25
24
  private _signTransactionFeature;
26
25
  }
27
- //#endregion
28
26
  //# sourceMappingURL=KeypairWalletAdapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeypairWalletAdapter.d.ts","names":[],"sources":["../../../src/utils/KeypairWalletAdapter.ts"],"mappings":";;;;;;;qBAsBa,gCAAgC;;;;;UAKnC;UACA;mBACS;WAER;WACA;WACA;EAGT,YAAY;MAqBR;MAIA,qBAAqB;MAIrB,YAAY;EAUhB,WAAiB;EAejB,cAAoB;UAMN"}
1
+ {"version":3,"file":"KeypairWalletAdapter.d.ts","names":[],"sources":["../../../src/utils/KeypairWalletAdapter.ts"],"mappings":";;;;;;qBAsBa,gCAAgC;;;;;UAKnC;UACA;mBACS;WAER;WACA;WACA;EAGT,YAAY;MAqBR;MAIA,qBAAqB;MAIrB,YAAY;EAUV,WAAW;EAeX,cAAc;UAMN"}
@@ -1,7 +1,7 @@
1
1
  import { base64ToUint8Array } from "./base64ToUint8Array.js";
2
2
  import { assertIsTransactionWithinSizeLimit, createKeyPairSignerFromBytes, getBase58Codec, getBase64EncodedWireTransaction, getTransactionCodec } from "@solana/kit";
3
3
  import { SolanaSignTransaction } from "@solana/wallet-standard-features";
4
- //#region src/utils/KeypairWalletAdapter.ts
4
+ // src/utils/KeypairWalletAdapter.ts
5
5
  /**
6
6
  * This keypair wallet adapter is unsafe to use on the frontend and is only included to provide an easy way for applications to test
7
7
  * Wallet Adapter without using a third-party wallet.
@@ -81,7 +81,6 @@ var KeypairWalletAdapter = class {
81
81
  return results;
82
82
  }
83
83
  };
84
- //#endregion
85
84
  export { KeypairWalletAdapter };
86
85
 
87
86
  //# sourceMappingURL=KeypairWalletAdapter.js.map