@lifi/sdk-provider-solana 4.3.5 → 4.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/actions/sendAndConfirmBundle.d.ts +8 -7
- package/dist/cjs/actions/sendAndConfirmBundle.js +22 -16
- package/dist/cjs/actions/sendAndConfirmBundle.js.map +1 -1
- package/dist/cjs/confirmation/confirmBundle.d.ts +18 -19
- package/dist/cjs/confirmation/confirmBundle.js +10 -23
- package/dist/cjs/confirmation/confirmBundle.js.map +1 -1
- package/dist/cjs/confirmation/confirmSignature.d.ts +2 -2
- package/dist/cjs/confirmation/confirmSignature.js +2 -2
- package/dist/cjs/confirmation/confirmSignature.js.map +1 -1
- package/dist/cjs/confirmation/createConfirmationDeadline.d.ts +1 -1
- package/dist/cjs/confirmation/createConfirmationDeadline.js.map +1 -1
- package/dist/cjs/confirmation/types.d.ts +1 -1
- package/dist/cjs/confirmation/types.js.map +1 -1
- package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.js +9 -18
- package/dist/cjs/core/tasks/SolanaJitoWaitForTransactionTask.js.map +1 -1
- package/dist/cjs/rpc/registry.d.ts +4 -3
- package/dist/cjs/rpc/registry.js +4 -3
- package/dist/cjs/rpc/registry.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/actions/sendAndConfirmBundle.d.ts +8 -7
- package/dist/esm/actions/sendAndConfirmBundle.d.ts.map +1 -1
- package/dist/esm/actions/sendAndConfirmBundle.js +24 -18
- package/dist/esm/actions/sendAndConfirmBundle.js.map +1 -1
- package/dist/esm/confirmation/confirmBundle.d.ts +18 -19
- package/dist/esm/confirmation/confirmBundle.d.ts.map +1 -1
- package/dist/esm/confirmation/confirmBundle.js +10 -23
- package/dist/esm/confirmation/confirmBundle.js.map +1 -1
- package/dist/esm/confirmation/confirmSignature.d.ts +2 -2
- package/dist/esm/confirmation/confirmSignature.js +2 -2
- package/dist/esm/confirmation/confirmSignature.js.map +1 -1
- package/dist/esm/confirmation/createConfirmationDeadline.d.ts +1 -1
- package/dist/esm/confirmation/createConfirmationDeadline.js.map +1 -1
- package/dist/esm/confirmation/types.d.ts +1 -1
- package/dist/esm/confirmation/types.js.map +1 -1
- package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.js +10 -19
- package/dist/esm/core/tasks/SolanaJitoWaitForTransactionTask.js.map +1 -1
- package/dist/esm/rpc/registry.d.ts +4 -3
- package/dist/esm/rpc/registry.d.ts.map +1 -1
- package/dist/esm/rpc/registry.js +4 -3
- package/dist/esm/rpc/registry.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +2 -2
- package/src/actions/sendAndConfirmBundle.ts +48 -48
- package/src/confirmation/confirmBundle.ts +34 -69
- package/src/confirmation/confirmSignature.ts +2 -2
- package/src/confirmation/createConfirmationDeadline.ts +1 -1
- package/src/confirmation/types.ts +1 -1
- package/src/core/tasks/SolanaJitoWaitForTransactionTask.ts +13 -27
- package/src/rpc/registry.ts +4 -3
- package/src/version.ts +1 -1
|
@@ -20,45 +20,29 @@ import { resumeFromStore } from './resumeFromStore.js'
|
|
|
20
20
|
import {
|
|
21
21
|
canResendStored,
|
|
22
22
|
clearStoredTransactions,
|
|
23
|
+
failureOf,
|
|
23
24
|
getTxLink,
|
|
24
25
|
sendAndSettle,
|
|
25
26
|
} from './transactionOutcome.js'
|
|
26
27
|
|
|
27
28
|
// The `rpc-unavailable` message is distinct from the empty-list throw inside
|
|
28
29
|
// `sendAndConfirmBundle`: RPCs were configured and every one of them failed.
|
|
29
|
-
//
|
|
30
|
-
//
|
|
30
|
+
// Every read RPC confirms and waits for the one shared submission, so a
|
|
31
|
+
// refused submission fails every branch with the same error.
|
|
31
32
|
const MESSAGES: ConfirmationMessages = {
|
|
32
|
-
rpcUnavailable:
|
|
33
|
+
rpcUnavailable:
|
|
34
|
+
'Unable to confirm bundle: every configured Solana RPC failed.',
|
|
33
35
|
notConfirmed: 'Bundle was not confirmed before the SDK stopped waiting.',
|
|
34
|
-
allRpcsFailed: 'All
|
|
36
|
+
allRpcsFailed: 'All Solana RPCs failed',
|
|
35
37
|
someRpcsFailed:
|
|
36
|
-
'Some
|
|
38
|
+
'Some Solana RPCs failed while the confirmation window was open',
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
/**
|
|
40
|
-
* `{ Ok: null }`, so only an explicit `{ Err: … }` counts as a failure. */
|
|
41
|
-
function getBundleFailure(err: unknown): { failure: unknown } | undefined {
|
|
42
|
-
if (typeof err !== 'object' || err === null || !('Err' in err)) {
|
|
43
|
-
return undefined
|
|
44
|
-
}
|
|
45
|
-
return { failure: (err as { Err: unknown }).Err }
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** The failure of a landed bundle, if any. A `null` in `signatureResults` is
|
|
49
|
-
* indexing lag, never failure. The bundle-level `err` is checked first: it
|
|
50
|
-
* survives a failed `getSignatureStatuses` read. */
|
|
41
|
+
/** The failure of a landed bundle, if any: the first transaction `err`. */
|
|
51
42
|
function bundleFailureOf(
|
|
52
43
|
confirmation: BundleConfirmation
|
|
53
44
|
): { err: unknown } | undefined {
|
|
54
|
-
|
|
55
|
-
if (bundleFailure) {
|
|
56
|
-
return { err: bundleFailure.failure }
|
|
57
|
-
}
|
|
58
|
-
const failedResult = confirmation.signatureResults.find(
|
|
59
|
-
(signatureResult) => signatureResult?.err
|
|
60
|
-
)
|
|
61
|
-
return failedResult?.err ? { err: failedResult.err } : undefined
|
|
45
|
+
return confirmation.signatureResults.map(failureOf).find(Boolean)
|
|
62
46
|
}
|
|
63
47
|
|
|
64
48
|
export class SolanaJitoWaitForTransactionTask extends BaseStepExecutionTask {
|
|
@@ -126,8 +110,10 @@ export class SolanaJitoWaitForTransactionTask extends BaseStepExecutionTask {
|
|
|
126
110
|
|
|
127
111
|
/**
|
|
128
112
|
* Submits the signed bundle once, confirms it and applies the result rules
|
|
129
|
-
* of `sendAndSettle`, on the first run and on a resume alike. A bundle
|
|
130
|
-
* whole or not at all, so the first transaction's signature stands for
|
|
113
|
+
* of `sendAndSettle`, on the first run and on a resume alike. A Jito bundle
|
|
114
|
+
* lands whole or not at all, so the first transaction's signature stands for
|
|
115
|
+
* it. A sender that is not Jito can land the transactions one by one; a
|
|
116
|
+
* lookup by the first signature then misses a partial landing.
|
|
131
117
|
*/
|
|
132
118
|
function sendSigned(
|
|
133
119
|
context: SolanaStepExecutorContext,
|
package/src/rpc/registry.ts
CHANGED
|
@@ -120,9 +120,10 @@ const readProbeFailure = (error: unknown): JitoProbeResult => {
|
|
|
120
120
|
const PROBE_TIMEOUT_MS = 5_000
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* support it without exposing
|
|
123
|
+
* Picks the RPCs that may submit a bundle; confirmation reads signatures on
|
|
124
|
+
* every read RPC. Probes with `getBundleStatuses` rather than
|
|
125
|
+
* `getTipAccounts`: providers such as Helius support it without exposing
|
|
126
|
+
* `getTipAccounts`.
|
|
126
127
|
*/
|
|
127
128
|
export const probeJitoRpc = async (
|
|
128
129
|
rpcUrl: string
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk-provider-solana'
|
|
2
|
-
export const version = '4.3.
|
|
2
|
+
export const version = '4.3.6'
|