@atomiqlabs/chain-solana 12.0.11 → 12.0.12
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.
|
@@ -303,6 +303,7 @@ class SolanaSwapProgram extends SolanaProgramBase_1.SolanaProgramBase {
|
|
|
303
303
|
latestBlockheight = tx.slot;
|
|
304
304
|
events.push({ event, tx });
|
|
305
305
|
}, undefined, undefined, startBlockheight);
|
|
306
|
+
this.logger.debug(`getHistoricalSwaps(): Found ${events.length} atomiq related events!`);
|
|
306
307
|
const swapsOpened = {};
|
|
307
308
|
const resultingSwaps = {};
|
|
308
309
|
events.reverse();
|
|
@@ -320,7 +321,7 @@ class SolanaSwapProgram extends SolanaProgramBase_1.SolanaProgramBase {
|
|
|
320
321
|
}
|
|
321
322
|
const initIx = instructions.find(ix => ix != null && (ix.name === "offererInitializePayIn" || ix.name === "offererInitialize"));
|
|
322
323
|
if (initIx == null) {
|
|
323
|
-
this.logger.warn(`getHistoricalSwaps(): Skipping tx ${txSignature} because
|
|
324
|
+
this.logger.warn(`getHistoricalSwaps(): Skipping tx ${txSignature} because init instruction not found!`);
|
|
324
325
|
continue;
|
|
325
326
|
}
|
|
326
327
|
swapsOpened[escrowHash] = {
|
|
@@ -365,6 +366,8 @@ class SolanaSwapProgram extends SolanaProgramBase_1.SolanaProgramBase {
|
|
|
365
366
|
};
|
|
366
367
|
}
|
|
367
368
|
}
|
|
369
|
+
this.logger.debug(`getHistoricalSwaps(): Found ${Object.keys(resultingSwaps).length} settled swaps!`);
|
|
370
|
+
this.logger.debug(`getHistoricalSwaps(): Found ${Object.keys(swapsOpened).length} unsettled swaps!`);
|
|
368
371
|
for (let escrowHash in swapsOpened) {
|
|
369
372
|
const foundSwapData = swapsOpened[escrowHash];
|
|
370
373
|
const isExpired = await this.isExpired(signer, foundSwapData.data);
|
package/package.json
CHANGED
|
@@ -403,6 +403,8 @@ export class SolanaSwapProgram
|
|
|
403
403
|
events.push({event, tx});
|
|
404
404
|
}, undefined, undefined, startBlockheight);
|
|
405
405
|
|
|
406
|
+
this.logger.debug(`getHistoricalSwaps(): Found ${events.length} atomiq related events!`);
|
|
407
|
+
|
|
406
408
|
const swapsOpened: {[escrowHash: string]: {
|
|
407
409
|
data: SolanaSwapData,
|
|
408
410
|
getInitTxId: () => Promise<string>,
|
|
@@ -444,7 +446,7 @@ export class SolanaSwapProgram
|
|
|
444
446
|
ix => ix!=null && (ix.name === "offererInitializePayIn" || ix.name === "offererInitialize")
|
|
445
447
|
) as InitInstruction;
|
|
446
448
|
if(initIx == null) {
|
|
447
|
-
this.logger.warn(`getHistoricalSwaps(): Skipping tx ${txSignature} because
|
|
449
|
+
this.logger.warn(`getHistoricalSwaps(): Skipping tx ${txSignature} because init instruction not found!`);
|
|
448
450
|
continue;
|
|
449
451
|
}
|
|
450
452
|
|
|
@@ -493,6 +495,9 @@ export class SolanaSwapProgram
|
|
|
493
495
|
}
|
|
494
496
|
}
|
|
495
497
|
|
|
498
|
+
this.logger.debug(`getHistoricalSwaps(): Found ${Object.keys(resultingSwaps).length} settled swaps!`);
|
|
499
|
+
this.logger.debug(`getHistoricalSwaps(): Found ${Object.keys(swapsOpened).length} unsettled swaps!`);
|
|
500
|
+
|
|
496
501
|
for(let escrowHash in swapsOpened) {
|
|
497
502
|
const foundSwapData = swapsOpened[escrowHash];
|
|
498
503
|
const isExpired = await this.isExpired(signer, foundSwapData.data);
|