@drift-labs/sdk 2.9.0 → 2.10.0-beta.0
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/lib/events/fetchLogs.js +4 -1
- package/lib/idl/drift.json +1 -1
- package/package.json +1 -1
- package/src/events/fetchLogs.ts +8 -2
- package/src/idl/drift.json +1 -1
package/lib/events/fetchLogs.js
CHANGED
|
@@ -21,7 +21,10 @@ async function fetchLogs(connection, programId, finality, beforeTx, untilTx, lim
|
|
|
21
21
|
}
|
|
22
22
|
const chunkedSignatures = chunk(filteredSignatures, 100);
|
|
23
23
|
const transactionLogs = (await Promise.all(chunkedSignatures.map(async (chunk) => {
|
|
24
|
-
const transactions = await connection.getTransactions(chunk.map((confirmedSignature) => confirmedSignature.signature),
|
|
24
|
+
const transactions = await connection.getTransactions(chunk.map((confirmedSignature) => confirmedSignature.signature), {
|
|
25
|
+
commitment: finality,
|
|
26
|
+
maxSupportedTransactionVersion: 0,
|
|
27
|
+
});
|
|
25
28
|
return transactions.reduce((logs, transaction) => {
|
|
26
29
|
if (transaction) {
|
|
27
30
|
logs.push(mapTransactionResponseToLog(transaction));
|
package/lib/idl/drift.json
CHANGED
package/package.json
CHANGED
package/src/events/fetchLogs.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
PublicKey,
|
|
6
6
|
TransactionResponse,
|
|
7
7
|
TransactionSignature,
|
|
8
|
+
VersionedTransactionResponse,
|
|
8
9
|
} from '@solana/web3.js';
|
|
9
10
|
import { WrappedEvents } from './types';
|
|
10
11
|
|
|
@@ -18,7 +19,9 @@ type FetchLogsResponse = {
|
|
|
18
19
|
mostRecentBlockTime: number | undefined;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
function mapTransactionResponseToLog(
|
|
22
|
+
function mapTransactionResponseToLog(
|
|
23
|
+
transaction: TransactionResponse | VersionedTransactionResponse
|
|
24
|
+
): Log {
|
|
22
25
|
return {
|
|
23
26
|
txSig: transaction.transaction.signatures[0],
|
|
24
27
|
slot: transaction.slot,
|
|
@@ -63,7 +66,10 @@ export async function fetchLogs(
|
|
|
63
66
|
chunkedSignatures.map(async (chunk) => {
|
|
64
67
|
const transactions = await connection.getTransactions(
|
|
65
68
|
chunk.map((confirmedSignature) => confirmedSignature.signature),
|
|
66
|
-
|
|
69
|
+
{
|
|
70
|
+
commitment: finality,
|
|
71
|
+
maxSupportedTransactionVersion: 0,
|
|
72
|
+
}
|
|
67
73
|
);
|
|
68
74
|
|
|
69
75
|
return transactions.reduce((logs, transaction) => {
|
package/src/idl/drift.json
CHANGED