From 1a810477b253b524d6a99cae444a2ad2cdba62fd Mon Sep 17 00:00:00 2001 From: filipzeta <103913117+filipzeta@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:06:47 +1000 Subject: [PATCH] Respect Exchange.skipRpcConfirmation everywhere (#384) --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/exchange.ts | 12 +----------- src/utils.ts | 5 ++--- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a7bc1dc3..15604eeb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. Version changes are pinned to SDK releases. +## [1.26.4] + +- Respect Exchange.skipRpcConfirmation everywhere. ([#384](https://github.com/zetamarkets/sdk/pull/384)) + ## [1.26.3] - Add crank market generation util. ([#383](https://github.com/zetamarkets/sdk/pull/383)) diff --git a/package.json b/package.json index bb7ae224d..5db53618e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@zetamarkets/sdk", "repository": "https://github.com/zetamarkets/sdk/", - "version": "1.26.3", + "version": "1.26.4", "description": "Zeta SDK", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/exchange.ts b/src/exchange.ts index 2880b060c..2b4dc898f 100644 --- a/src/exchange.ts +++ b/src/exchange.ts @@ -1125,17 +1125,7 @@ export class Exchange { try { await Promise.all( txs.map(async (tx) => { - let txSig = await utils.processTransaction( - this._provider, - tx, - undefined, - undefined, - undefined, - undefined, - undefined, - undefined, - this.skipRpcConfirmation - ); + let txSig = await utils.processTransaction(this._provider, tx); console.log(`[REBALANCE INSURANCE VAULT]: ${txSig}`); }) ); diff --git a/src/utils.ts b/src/utils.ts index 35cc243e1..bc94c8f8f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -958,8 +958,7 @@ export async function processTransaction( useLedger: boolean = false, lutAccs?: AddressLookupTableAccount[], blockhash?: { blockhash: string; lastValidBlockHeight: number }, - retries?: number, - skipConfirmation?: boolean + retries?: number ): Promise { let failures = 0; while (true) { @@ -1042,7 +1041,7 @@ export async function processTransaction( // Poll the tx confirmation for N seconds // Polling is more reliable than websockets using confirmTransaction() let currentBlockHeight = 0; - if (!skipConfirmation) { + if (!Exchange.skipRpcConfirmation) { while (currentBlockHeight < recentBlockhash.lastValidBlockHeight) { // Keep resending to maximise the chance of confirmation await provider.connection.sendRawTransaction(rawTx, {