@indigo-labs/indigo-sdk 0.5.1 → 0.5.3

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.
@@ -0,0 +1 @@
1
+ pnpm-lock.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigo-labs/indigo-sdk",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Indigo SDK for interacting with Indigo endpoints via lucid-evolution",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "@3rd-eye-labs/cardano-offchain-common": "1.4.7",
32
32
  "@evolution-sdk/evolution": "^0.3.22",
33
33
  "@harmoniclabs/crypto": "^0.3.0",
34
- "@lucid-evolution/lucid": "0.6.0",
34
+ "@lucid-evolution/lucid": "0.6.1",
35
35
  "@noble/ed25519": "^3.0.0",
36
36
  "@pythnetwork/pyth-lazer-sdk": "^6.0.0",
37
37
  "decimal.js": "^10.6.0",
@@ -267,8 +267,10 @@ async function processSpRequestAuxiliary(
267
267
  sysParams: SystemParams,
268
268
  lucid: LucidEvolution,
269
269
  txFee: bigint,
270
+ currentSlot?: number,
270
271
  ): Promise<TxBuilder> {
271
- const currentTime = BigInt(lucid.slotToUnixTime(lucid.currentSlot()));
272
+ const slot = currentSlot !== undefined ? currentSlot : lucid.currentSlot();
273
+ const currentTime = BigInt(lucid.slotToUnixTime(slot));
272
274
 
273
275
  const stabilityPoolScriptRef = matchSingle(
274
276
  await lucid.utxosByOutRef([
@@ -289,7 +291,7 @@ async function processSpRequestAuxiliary(
289
291
 
290
292
  const baseRefInputs = [iAssetUtxo, stabilityPoolScriptRef];
291
293
 
292
- const validFrom = lucid.slotToUnixTime(lucid.currentSlot() - 1);
294
+ const validFrom = lucid.slotToUnixTime(slot - 1);
293
295
  const tx = lucid
294
296
  .newTx()
295
297
  .validFrom(validFrom)
@@ -767,6 +769,7 @@ export async function processSpRequest(
767
769
  allE2s2sSnapshotOrefs: OutRef[],
768
770
  sysParams: SystemParams,
769
771
  lucid: LucidEvolution,
772
+ currentSlot?: number,
770
773
  ): Promise<TxBuilder> {
771
774
  const draftTx = processSpRequestAuxiliary(
772
775
  stabilityPoolUtxo,
@@ -777,6 +780,7 @@ export async function processSpRequest(
777
780
  lucid,
778
781
  // Placeholder transation fee
779
782
  1n,
783
+ currentSlot,
780
784
  );
781
785
 
782
786
  const fee = (await (await draftTx).complete()).toTransaction().body().fee();
@@ -789,6 +793,7 @@ export async function processSpRequest(
789
793
  sysParams,
790
794
  lucid,
791
795
  fee,
796
+ currentSlot,
792
797
  );
793
798
  }
794
799