@indigo-labs/indigo-sdk 0.3.11 → 0.3.13

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.
package/dist/index.js CHANGED
@@ -253,6 +253,10 @@ __export(index_exports, {
253
253
  parseIAssetDatumOrThrow: () => parseIAssetDatumOrThrow,
254
254
  parseInterestCollectionDatum: () => parseInterestCollectionDatum,
255
255
  parseInterestOracleDatum: () => parseInterestOracleDatum,
256
+ parsePollManager: () => parsePollManager,
257
+ parsePollManagerOrThrow: () => parsePollManagerOrThrow,
258
+ parsePollShard: () => parsePollShard,
259
+ parsePollShardOrThrow: () => parsePollShardOrThrow,
256
260
  parsePriceOracleDatum: () => parsePriceOracleDatum,
257
261
  parsePythStateDatum: () => parsePythStateDatum,
258
262
  parseRobDatum: () => parseRobDatum,
@@ -313,6 +317,9 @@ __export(index_exports, {
313
317
  serialiseInterestCollectionDatum: () => serialiseInterestCollectionDatum,
314
318
  serialiseInterestCollectionRedeemer: () => serialiseInterestCollectionRedeemer,
315
319
  serialiseInterestOracleDatum: () => serialiseInterestOracleDatum,
320
+ serialisePollDatum: () => serialisePollDatum,
321
+ serialisePollManagerRedeemer: () => serialisePollManagerRedeemer,
322
+ serialisePollShardRedeemer: () => serialisePollShardRedeemer,
316
323
  serialisePriceOracleDatum: () => serialisePriceOracleDatum,
317
324
  serialisePriceOracleRedeemer: () => serialisePriceOracleRedeemer,
318
325
  serialisePythFeedParams: () => serialisePythFeedParams,
@@ -5976,7 +5983,9 @@ async function createProposal(proposalContent, treasuryWithdrawal, sysParams, lu
5976
5983
  )
5977
5984
  )
5978
5985
  )
5979
- ).validFrom(Number(currentTime) - ONE_SECOND).validTo(Number(currentTime + sysParams.govParams.gBiasTime) - ONE_SECOND).addSigner(ownAddr),
5986
+ ).validFrom(Number(currentTime) - ONE_SECOND).validTo(
5987
+ Number(currentTime) + Number(sysParams.govParams.gBiasTime) - ONE_SECOND
5988
+ ).addSigner(ownAddr),
5980
5989
  newPollId
5981
5990
  ];
5982
5991
  }
@@ -6018,7 +6027,7 @@ async function createShardsChunks(chunkSize, pollManagerOref, sysParams, current
6018
6027
  );
6019
6028
  const pollNft = fromSystemParamsAsset(sysParams.govParams.pollToken);
6020
6029
  const tx = lucid.newTx().validFrom(Number(currentTime) - ONE_SECOND).validTo(
6021
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6030
+ Number(currentTime) + Number(sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6022
6031
  ).mintAssets((0, import_cardano_offchain_common16.mkAssetsOf)(pollNft, shardsCount), import_lucid26.Data.void()).readFrom([pollAuthTokenPolicyRefScriptUtxo, pollManagerRefScriptUtxo]).collectFrom(
6023
6032
  [pollManagerUtxo],
6024
6033
  serialisePollManagerRedeemer({ CreateShards: { currentTime } })
@@ -6198,7 +6207,7 @@ async function mergeShards(pollManagerOref, shardsOutRefs, sysParams, lucid, cur
6198
6207
  )(shardUtxos);
6199
6208
  const pollNft = fromSystemParamsAsset(sysParams.govParams.pollToken);
6200
6209
  return lucid.newTx().validFrom(Number(currentTime) - ONE_SECOND).validTo(
6201
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6210
+ Number(currentTime) + Number(sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6202
6211
  ).readFrom([
6203
6212
  pollShardRefScriptUtxo,
6204
6213
  pollManagerRefScriptUtxo,
@@ -6297,7 +6306,7 @@ async function endProposal(pollManagerOref, govOref, sysParams, lucid, currentSl
6297
6306
  1n
6298
6307
  );
6299
6308
  const tx = lucid.newTx().validFrom(Number(currentTime) - ONE_SECOND).validTo(
6300
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6309
+ Number(currentTime) + Number(sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6301
6310
  ).readFrom([
6302
6311
  pollManagerRefScriptUtxo,
6303
6312
  govRefScriptUtxo,
@@ -11580,6 +11589,10 @@ async function updateStableswapPoolFees(stableswapPoolOutRef, stableswapFeeOutRe
11580
11589
  parseIAssetDatumOrThrow,
11581
11590
  parseInterestCollectionDatum,
11582
11591
  parseInterestOracleDatum,
11592
+ parsePollManager,
11593
+ parsePollManagerOrThrow,
11594
+ parsePollShard,
11595
+ parsePollShardOrThrow,
11583
11596
  parsePriceOracleDatum,
11584
11597
  parsePythStateDatum,
11585
11598
  parseRobDatum,
@@ -11640,6 +11653,9 @@ async function updateStableswapPoolFees(stableswapPoolOutRef, stableswapFeeOutRe
11640
11653
  serialiseInterestCollectionDatum,
11641
11654
  serialiseInterestCollectionRedeemer,
11642
11655
  serialiseInterestOracleDatum,
11656
+ serialisePollDatum,
11657
+ serialisePollManagerRedeemer,
11658
+ serialisePollShardRedeemer,
11643
11659
  serialisePriceOracleDatum,
11644
11660
  serialisePriceOracleRedeemer,
11645
11661
  serialisePythFeedParams,
package/dist/index.mjs CHANGED
@@ -5752,7 +5752,9 @@ async function createProposal(proposalContent, treasuryWithdrawal, sysParams, lu
5752
5752
  )
5753
5753
  )
5754
5754
  )
5755
- ).validFrom(Number(currentTime) - ONE_SECOND).validTo(Number(currentTime + sysParams.govParams.gBiasTime) - ONE_SECOND).addSigner(ownAddr),
5755
+ ).validFrom(Number(currentTime) - ONE_SECOND).validTo(
5756
+ Number(currentTime) + Number(sysParams.govParams.gBiasTime) - ONE_SECOND
5757
+ ).addSigner(ownAddr),
5756
5758
  newPollId
5757
5759
  ];
5758
5760
  }
@@ -5794,7 +5796,7 @@ async function createShardsChunks(chunkSize, pollManagerOref, sysParams, current
5794
5796
  );
5795
5797
  const pollNft = fromSystemParamsAsset(sysParams.govParams.pollToken);
5796
5798
  const tx = lucid.newTx().validFrom(Number(currentTime) - ONE_SECOND).validTo(
5797
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
5799
+ Number(currentTime) + Number(sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
5798
5800
  ).mintAssets(mkAssetsOf6(pollNft, shardsCount), Data30.void()).readFrom([pollAuthTokenPolicyRefScriptUtxo, pollManagerRefScriptUtxo]).collectFrom(
5799
5801
  [pollManagerUtxo],
5800
5802
  serialisePollManagerRedeemer({ CreateShards: { currentTime } })
@@ -5974,7 +5976,7 @@ async function mergeShards(pollManagerOref, shardsOutRefs, sysParams, lucid, cur
5974
5976
  )(shardUtxos);
5975
5977
  const pollNft = fromSystemParamsAsset(sysParams.govParams.pollToken);
5976
5978
  return lucid.newTx().validFrom(Number(currentTime) - ONE_SECOND).validTo(
5977
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
5979
+ Number(currentTime) + Number(sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
5978
5980
  ).readFrom([
5979
5981
  pollShardRefScriptUtxo,
5980
5982
  pollManagerRefScriptUtxo,
@@ -6073,7 +6075,7 @@ async function endProposal(pollManagerOref, govOref, sysParams, lucid, currentSl
6073
6075
  1n
6074
6076
  );
6075
6077
  const tx = lucid.newTx().validFrom(Number(currentTime) - ONE_SECOND).validTo(
6076
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6078
+ Number(currentTime) + Number(sysParams.pollManagerParams.pBiasTime) - ONE_SECOND
6077
6079
  ).readFrom([
6078
6080
  pollManagerRefScriptUtxo,
6079
6081
  govRefScriptUtxo,
@@ -11529,6 +11531,10 @@ export {
11529
11531
  parseIAssetDatumOrThrow,
11530
11532
  parseInterestCollectionDatum,
11531
11533
  parseInterestOracleDatum,
11534
+ parsePollManager,
11535
+ parsePollManagerOrThrow,
11536
+ parsePollShard,
11537
+ parsePollShardOrThrow,
11532
11538
  parsePriceOracleDatum,
11533
11539
  parsePythStateDatum,
11534
11540
  parseRobDatum,
@@ -11589,6 +11595,9 @@ export {
11589
11595
  serialiseInterestCollectionDatum,
11590
11596
  serialiseInterestCollectionRedeemer,
11591
11597
  serialiseInterestOracleDatum,
11598
+ serialisePollDatum,
11599
+ serialisePollManagerRedeemer,
11600
+ serialisePollShardRedeemer,
11592
11601
  serialisePriceOracleDatum,
11593
11602
  serialisePriceOracleRedeemer,
11594
11603
  serialisePythFeedParams,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigo-labs/indigo-sdk",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
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",
@@ -254,7 +254,11 @@ export async function createProposal(
254
254
  ),
255
255
  )
256
256
  .validFrom(Number(currentTime) - ONE_SECOND)
257
- .validTo(Number(currentTime + sysParams.govParams.gBiasTime) - ONE_SECOND)
257
+ .validTo(
258
+ Number(currentTime) +
259
+ Number(sysParams.govParams.gBiasTime) -
260
+ ONE_SECOND,
261
+ )
258
262
  .addSigner(ownAddr),
259
263
  newPollId,
260
264
  ];
@@ -323,7 +327,9 @@ export async function createShardsChunks(
323
327
  .newTx()
324
328
  .validFrom(Number(currentTime) - ONE_SECOND)
325
329
  .validTo(
326
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND,
330
+ Number(currentTime) +
331
+ Number(sysParams.pollManagerParams.pBiasTime) -
332
+ ONE_SECOND,
327
333
  )
328
334
  .mintAssets(mkAssetsOf(pollNft, shardsCount), Data.void())
329
335
  // Ref scripts
@@ -576,7 +582,9 @@ export async function mergeShards(
576
582
  .newTx()
577
583
  .validFrom(Number(currentTime) - ONE_SECOND)
578
584
  .validTo(
579
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND,
585
+ Number(currentTime) +
586
+ Number(sysParams.pollManagerParams.pBiasTime) -
587
+ ONE_SECOND,
580
588
  )
581
589
  .readFrom([
582
590
  pollShardRefScriptUtxo,
@@ -705,7 +713,9 @@ export async function endProposal(
705
713
  .newTx()
706
714
  .validFrom(Number(currentTime) - ONE_SECOND)
707
715
  .validTo(
708
- Number(currentTime + sysParams.pollManagerParams.pBiasTime) - ONE_SECOND,
716
+ Number(currentTime) +
717
+ Number(sysParams.pollManagerParams.pBiasTime) -
718
+ ONE_SECOND,
709
719
  )
710
720
  .readFrom([
711
721
  pollManagerRefScriptUtxo,
package/src/index.ts CHANGED
@@ -46,6 +46,7 @@ export * from './contracts/stability-pool/types';
46
46
  export * from './contracts/stability-pool/types-new';
47
47
  export * from './contracts/poll/types-poll-shard';
48
48
  export * from './contracts/poll/types-poll-manager';
49
+ export * from './contracts/poll/types-poll-new';
49
50
  export * from './types/generic';
50
51
  export * from './types/rational';
51
52
  export * from './types/system-params';
@@ -1996,7 +1996,7 @@ describe('Stability pool', () => {
1996
1996
 
1997
1997
  await runAndAwaitTx(
1998
1998
  context.lucid,
1999
- createSpAccount(
1999
+ requestSpAccountCreation(
2000
2000
  iusdAssetInfo.iassetTokenNameAscii,
2001
2001
  BigInt(initialAssets.length + 2) * LIQUIDATED_DEBT,
2002
2002
  sysParams,