@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.
@@ -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), finality);
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));
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.9.0",
2
+ "version": "2.10.0-beta.0",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.9.0",
3
+ "version": "2.10.0-beta.0",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -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(transaction: TransactionResponse): Log {
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
- finality
69
+ {
70
+ commitment: finality,
71
+ maxSupportedTransactionVersion: 0,
72
+ }
67
73
  );
68
74
 
69
75
  return transactions.reduce((logs, transaction) => {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.9.0",
2
+ "version": "2.10.0-beta.0",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {