Skip to content

Commit

Permalink
fix: prettier formatting on drift client
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasDeco committed Nov 20, 2024
1 parent 4468c9a commit d7a41de
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions sdk/src/driftClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3794,8 +3794,9 @@ export class DriftClient {
subAccountId?: number
): Promise<TransactionSignature> {
const { txSig } = await this.sendTransaction(
(await this.preparePlaceOrdersTx(params, txParams, subAccountId))
.placeOrdersTx,
(
await this.preparePlaceOrdersTx(params, txParams, subAccountId)
).placeOrdersTx,
[],
this.opts,
false
Expand Down Expand Up @@ -3988,8 +3989,9 @@ export class DriftClient {
subAccountId?: number
): Promise<TransactionSignature> {
const { txSig, slot } = await this.sendTransaction(
(await this.preparePlaceSpotOrderTx(orderParams, txParams, subAccountId))
.placeSpotOrderTx,
(
await this.preparePlaceSpotOrderTx(orderParams, txParams, subAccountId)
).placeSpotOrderTx,
[],
this.opts,
false
Expand Down Expand Up @@ -6717,7 +6719,6 @@ export class DriftClient {
mode: SettlePnlMode,
txParams?: TxParams
): Promise<TransactionSignature[]> {

// need multiple TXs because settling more than 4 markets won't fit in a single TX
const txsToSign: (Transaction | VersionedTransaction)[] = [];
const marketIndexesInFourGroups: number[][] = [];
Expand All @@ -6732,10 +6733,7 @@ export class DriftClient {
marketIndexes,
mode
);
const computeUnits = Math.min(
300_000 * marketIndexes.length,
1_400_000
);
const computeUnits = Math.min(300_000 * marketIndexes.length, 1_400_000);
const tx = await this.buildTransaction(ix, {
...txParams,
computeUnits,
Expand All @@ -6750,21 +6748,13 @@ export class DriftClient {
i++;
}
const signedTxs = (
await this.txHandler.getSignedTransactionMap(
txsMap,
this.provider.wallet
)
await this.txHandler.getSignedTransactionMap(txsMap, this.provider.wallet)
).signedTxMap;

const txSigs: TransactionSignature[] = [];
for (const key in signedTxs) {
const tx = signedTxs[key];
const { txSig } = await this.sendTransaction(
tx,
[],
this.opts,
true
);
const { txSig } = await this.sendTransaction(tx, [], this.opts, true);
txSigs.push(txSig);
}

Expand Down

0 comments on commit d7a41de

Please sign in to comment.