nara-sdk 1.0.79 → 1.0.80

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tx.ts +7 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nara-sdk",
3
- "version": "1.0.79",
3
+ "version": "1.0.80",
4
4
  "description": "SDK for the Nara chain (Solana-compatible)",
5
5
  "module": "index.ts",
6
6
  "main": "index.ts",
package/src/tx.ts CHANGED
@@ -196,19 +196,16 @@ export async function sendTx(
196
196
  });
197
197
  }
198
198
 
199
- // Poll for confirmation (avoid confirmTransaction which uses WebSocket)
200
- const startTime = Date.now();
199
+ // Wait a couple of seconds for the validator to see and process the tx,
200
+ // then poll getSignatureStatuses every 2s until confirmed or timeout.
201
201
  const TIMEOUT_MS = 20_000;
202
- const POLL_INTERVAL_MS = 1_000;
202
+ const POLL_INTERVAL_MS = 2_000;
203
+ const INITIAL_DELAY_MS = 2_000;
203
204
 
204
- while (Date.now() - startTime < TIMEOUT_MS) {
205
- const currentBlockHeight = await connection.getBlockHeight("confirmed");
206
- if (currentBlockHeight > lastValidBlockHeight) {
207
- throw new Error(
208
- `Transaction ${signature} expired: block height exceeded`
209
- );
210
- }
205
+ await new Promise((r) => setTimeout(r, INITIAL_DELAY_MS));
211
206
 
207
+ const startTime = Date.now();
208
+ while (Date.now() - startTime < TIMEOUT_MS) {
212
209
  const statusResult = await connection.getSignatureStatuses([signature]);
213
210
  const status = statusResult?.value?.[0];
214
211