@indigo-labs/indigo-sdk 0.5.10 → 0.5.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.
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +40 -41
- package/dist/index.mjs +40 -41
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _lucid_evolution_lucid from '@lucid-evolution/lucid';
|
|
2
2
|
import { Data, UTxO, Credential, OutRef, LucidEvolution, TxBuilder, Assets, WithdrawalValidator, SpendingValidator, MintingPolicy, Address, PolicyId, Network, ScriptHash, ProtocolParameters, OutputDatum, Script, Datum } from '@lucid-evolution/lucid';
|
|
3
3
|
export { _lucid_evolution_lucid as Lucid };
|
|
4
|
-
import { AssetClass } from '@
|
|
5
|
-
import * as cardanoOffchainCommon from '@
|
|
4
|
+
import { AssetClass } from '@indigo-labs/cardano-offchain-common';
|
|
5
|
+
import * as cardanoOffchainCommon from '@indigo-labs/cardano-offchain-common';
|
|
6
6
|
export { cardanoOffchainCommon as OffchainCommon };
|
|
7
7
|
import * as Core from '@evolution-sdk/evolution';
|
|
8
8
|
import { TSchema, Schema, Data as Data$1 } from '@evolution-sdk/evolution';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _lucid_evolution_lucid from '@lucid-evolution/lucid';
|
|
2
2
|
import { Data, UTxO, Credential, OutRef, LucidEvolution, TxBuilder, Assets, WithdrawalValidator, SpendingValidator, MintingPolicy, Address, PolicyId, Network, ScriptHash, ProtocolParameters, OutputDatum, Script, Datum } from '@lucid-evolution/lucid';
|
|
3
3
|
export { _lucid_evolution_lucid as Lucid };
|
|
4
|
-
import { AssetClass } from '@
|
|
5
|
-
import * as cardanoOffchainCommon from '@
|
|
4
|
+
import { AssetClass } from '@indigo-labs/cardano-offchain-common';
|
|
5
|
+
import * as cardanoOffchainCommon from '@indigo-labs/cardano-offchain-common';
|
|
6
6
|
export { cardanoOffchainCommon as OffchainCommon };
|
|
7
7
|
import * as Core from '@evolution-sdk/evolution';
|
|
8
8
|
import { TSchema, Schema, Data as Data$1 } from '@evolution-sdk/evolution';
|
package/dist/index.js
CHANGED
|
@@ -413,7 +413,7 @@ __export(index_exports, {
|
|
|
413
413
|
});
|
|
414
414
|
module.exports = __toCommonJS(index_exports);
|
|
415
415
|
var Lucid = __toESM(require("@lucid-evolution/lucid"));
|
|
416
|
-
var OffchainCommon = __toESM(require("@
|
|
416
|
+
var OffchainCommon = __toESM(require("@indigo-labs/cardano-offchain-common"));
|
|
417
417
|
var Evo = __toESM(require("@evolution-sdk/evolution"));
|
|
418
418
|
|
|
419
419
|
// src/contracts/cdp/transactions.ts
|
|
@@ -861,7 +861,7 @@ function calculateFeeFromRatio(feeRatio, amount) {
|
|
|
861
861
|
}
|
|
862
862
|
|
|
863
863
|
// src/contracts/cdp/helpers.ts
|
|
864
|
-
var import_cardano_offchain_common = require("@
|
|
864
|
+
var import_cardano_offchain_common = require("@indigo-labs/cardano-offchain-common");
|
|
865
865
|
function iassetValueOfCollateral(collateralAmt, oraclePrice) {
|
|
866
866
|
return rationalFloor(
|
|
867
867
|
rationalDiv(rationalFromInt(collateralAmt), oraclePrice)
|
|
@@ -946,7 +946,7 @@ function adjustPriceToDecimals(extraDecimals, price) {
|
|
|
946
946
|
var import_evolution4 = require("@evolution-sdk/evolution");
|
|
947
947
|
var import_ts_pattern6 = require("ts-pattern");
|
|
948
948
|
var import_fp_ts2 = require("fp-ts");
|
|
949
|
-
var import_cardano_offchain_common2 = require("@
|
|
949
|
+
var import_cardano_offchain_common2 = require("@indigo-labs/cardano-offchain-common");
|
|
950
950
|
var SPIntegerSchema = import_evolution4.TSchema.Struct({
|
|
951
951
|
value: import_evolution4.TSchema.Integer
|
|
952
952
|
});
|
|
@@ -1230,7 +1230,7 @@ function spZeroNegatives(a) {
|
|
|
1230
1230
|
// src/contracts/stability-pool/helpers.ts
|
|
1231
1231
|
var import_lucid6 = require("@lucid-evolution/lucid");
|
|
1232
1232
|
var import_fp_ts4 = require("fp-ts");
|
|
1233
|
-
var import_cardano_offchain_common3 = require("@
|
|
1233
|
+
var import_cardano_offchain_common3 = require("@indigo-labs/cardano-offchain-common");
|
|
1234
1234
|
|
|
1235
1235
|
// src/utils/array-utils.ts
|
|
1236
1236
|
var import_fp_ts3 = require("fp-ts");
|
|
@@ -2044,12 +2044,12 @@ function serialiseInterestCollectionDatum(datum) {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
|
|
2046
2046
|
// src/contracts/interest-collection/transactions.ts
|
|
2047
|
-
var import_cardano_offchain_common6 = require("@
|
|
2047
|
+
var import_cardano_offchain_common6 = require("@indigo-labs/cardano-offchain-common");
|
|
2048
2048
|
|
|
2049
2049
|
// src/contracts/cdp/types-new.ts
|
|
2050
2050
|
var import_evolution8 = require("@evolution-sdk/evolution");
|
|
2051
2051
|
var import_fp_ts5 = require("fp-ts");
|
|
2052
|
-
var import_cardano_offchain_common4 = require("@
|
|
2052
|
+
var import_cardano_offchain_common4 = require("@indigo-labs/cardano-offchain-common");
|
|
2053
2053
|
var import_ts_pattern8 = require("ts-pattern");
|
|
2054
2054
|
|
|
2055
2055
|
// src/contracts/price-oracle/types-new.ts
|
|
@@ -2333,7 +2333,7 @@ var import_fp_ts7 = require("fp-ts");
|
|
|
2333
2333
|
// src/contracts/iasset/types.ts
|
|
2334
2334
|
var import_evolution10 = require("@evolution-sdk/evolution");
|
|
2335
2335
|
var import_fp_ts6 = require("fp-ts");
|
|
2336
|
-
var import_cardano_offchain_common5 = require("@
|
|
2336
|
+
var import_cardano_offchain_common5 = require("@indigo-labs/cardano-offchain-common");
|
|
2337
2337
|
var import_ts_pattern9 = require("ts-pattern");
|
|
2338
2338
|
var IAssetPriceInfoSchema = import_evolution10.TSchema.Union(
|
|
2339
2339
|
import_evolution10.TSchema.Struct(
|
|
@@ -2745,7 +2745,7 @@ async function updatePermissions(interestAdminOutRef, govOref, newAdminPermissio
|
|
|
2745
2745
|
|
|
2746
2746
|
// src/contracts/gov/types-new.ts
|
|
2747
2747
|
var import_evolution11 = require("@evolution-sdk/evolution");
|
|
2748
|
-
var import_cardano_offchain_common7 = require("@
|
|
2748
|
+
var import_cardano_offchain_common7 = require("@indigo-labs/cardano-offchain-common");
|
|
2749
2749
|
var import_fp_ts8 = require("fp-ts");
|
|
2750
2750
|
var ProtocolParamsSchema = import_evolution11.TSchema.Struct({
|
|
2751
2751
|
proposalDeposit: import_evolution11.TSchema.Integer,
|
|
@@ -2971,11 +2971,11 @@ function parseGovDatumOrThrow(datum) {
|
|
|
2971
2971
|
}
|
|
2972
2972
|
|
|
2973
2973
|
// src/contracts/cdp/transactions.ts
|
|
2974
|
-
var import_cardano_offchain_common13 = require("@
|
|
2974
|
+
var import_cardano_offchain_common13 = require("@indigo-labs/cardano-offchain-common");
|
|
2975
2975
|
|
|
2976
2976
|
// src/contracts/cdp-creator/types-new.ts
|
|
2977
2977
|
var import_evolution12 = require("@evolution-sdk/evolution");
|
|
2978
|
-
var import_cardano_offchain_common8 = require("@
|
|
2978
|
+
var import_cardano_offchain_common8 = require("@indigo-labs/cardano-offchain-common");
|
|
2979
2979
|
var CDPCreatorDatumSchema = import_evolution12.TSchema.Struct({
|
|
2980
2980
|
creatorInputOref: import_cardano_offchain_common8.OutputReferenceSchema
|
|
2981
2981
|
});
|
|
@@ -3017,11 +3017,11 @@ function serialiseCDPCreatorRedeemer(r) {
|
|
|
3017
3017
|
|
|
3018
3018
|
// src/contracts/treasury/transactions.ts
|
|
3019
3019
|
var import_lucid9 = require("@lucid-evolution/lucid");
|
|
3020
|
-
var import_cardano_offchain_common11 = require("@
|
|
3020
|
+
var import_cardano_offchain_common11 = require("@indigo-labs/cardano-offchain-common");
|
|
3021
3021
|
|
|
3022
3022
|
// src/contracts/treasury/types-new.ts
|
|
3023
3023
|
var import_evolution13 = require("@evolution-sdk/evolution");
|
|
3024
|
-
var import_cardano_offchain_common9 = require("@
|
|
3024
|
+
var import_cardano_offchain_common9 = require("@indigo-labs/cardano-offchain-common");
|
|
3025
3025
|
var WithdrawalOutputDatumSchema = import_evolution13.TSchema.Tuple([
|
|
3026
3026
|
import_evolution13.TSchema.ByteArray,
|
|
3027
3027
|
import_cardano_offchain_common9.OutputReferenceSchema
|
|
@@ -3113,7 +3113,7 @@ function parseExecuteDatumOrThrow(datum) {
|
|
|
3113
3113
|
// src/contracts/gov/helpers.ts
|
|
3114
3114
|
var import_fp_ts10 = require("fp-ts");
|
|
3115
3115
|
var import_lucid8 = require("@lucid-evolution/lucid");
|
|
3116
|
-
var import_cardano_offchain_common10 = require("@
|
|
3116
|
+
var import_cardano_offchain_common10 = require("@indigo-labs/cardano-offchain-common");
|
|
3117
3117
|
function proposalDeposit(baseDeposit, activeProposals) {
|
|
3118
3118
|
return baseDeposit * 2n ** activeProposals;
|
|
3119
3119
|
}
|
|
@@ -4153,7 +4153,7 @@ function attachOracle(iasset, collateralAsset, priceInfo, priceOracleOref, pythS
|
|
|
4153
4153
|
|
|
4154
4154
|
// src/utils/oracle-helpers.ts
|
|
4155
4155
|
var import_ts_pattern13 = require("ts-pattern");
|
|
4156
|
-
var import_cardano_offchain_common12 = require("@
|
|
4156
|
+
var import_cardano_offchain_common12 = require("@indigo-labs/cardano-offchain-common");
|
|
4157
4157
|
async function retrieveAdjustedPrice(iasset, collateralAsset, priceInfo, extraDecimals, priceOracleOref, pythMessage, pythConfig, lucid) {
|
|
4158
4158
|
const [oraclePrice, maybePriceOracleUtxo] = await (0, import_ts_pattern13.match)(priceInfo).with({ OracleNft: import_ts_pattern13.P.any }, async () => {
|
|
4159
4159
|
if (!priceOracleOref) throw new Error("Missing price oracle");
|
|
@@ -5448,7 +5448,7 @@ var mkCDPCreatorValidatorFromSP = (params) => {
|
|
|
5448
5448
|
};
|
|
5449
5449
|
|
|
5450
5450
|
// src/contracts/cdp-creator/queries.ts
|
|
5451
|
-
var import_cardano_offchain_common14 = require("@
|
|
5451
|
+
var import_cardano_offchain_common14 = require("@indigo-labs/cardano-offchain-common");
|
|
5452
5452
|
var import_fp_ts14 = require("fp-ts");
|
|
5453
5453
|
async function findRandomCdpCreator(lucid, sysParams) {
|
|
5454
5454
|
const cdpCreatorUtxos = await lucid.utxosAtWithUnit(
|
|
@@ -5581,7 +5581,7 @@ function serialiseCollectorRedeemer(r) {
|
|
|
5581
5581
|
}
|
|
5582
5582
|
|
|
5583
5583
|
// src/contracts/collector/transactions.ts
|
|
5584
|
-
var import_cardano_offchain_common15 = require("@
|
|
5584
|
+
var import_cardano_offchain_common15 = require("@indigo-labs/cardano-offchain-common");
|
|
5585
5585
|
async function collectorFeeTx(fee, lucid, params, tx, collectorOref) {
|
|
5586
5586
|
const collectorUtxo = matchSingle(
|
|
5587
5587
|
await lucid.utxosByOutRef([collectorOref]),
|
|
@@ -5603,7 +5603,7 @@ async function collectorFeeTx(fee, lucid, params, tx, collectorOref) {
|
|
|
5603
5603
|
|
|
5604
5604
|
// src/contracts/gov/transactions.ts
|
|
5605
5605
|
var import_lucid23 = require("@lucid-evolution/lucid");
|
|
5606
|
-
var import_cardano_offchain_common17 = require("@
|
|
5606
|
+
var import_cardano_offchain_common17 = require("@indigo-labs/cardano-offchain-common");
|
|
5607
5607
|
var import_lucid24 = require("@lucid-evolution/lucid");
|
|
5608
5608
|
var import_fp_ts17 = require("fp-ts");
|
|
5609
5609
|
var import_ts_pattern17 = require("ts-pattern");
|
|
@@ -5875,7 +5875,7 @@ function serialiseVersionRecordDatum(d) {
|
|
|
5875
5875
|
|
|
5876
5876
|
// src/contracts/poll/types-poll-new.ts
|
|
5877
5877
|
var import_evolution18 = require("@evolution-sdk/evolution");
|
|
5878
|
-
var import_cardano_offchain_common16 = require("@
|
|
5878
|
+
var import_cardano_offchain_common16 = require("@indigo-labs/cardano-offchain-common");
|
|
5879
5879
|
var import_fp_ts16 = require("fp-ts");
|
|
5880
5880
|
var import_ts_pattern16 = require("ts-pattern");
|
|
5881
5881
|
var PollStatusSchema = import_evolution18.TSchema.Struct({
|
|
@@ -6029,7 +6029,7 @@ function serialisePollDatum(d) {
|
|
|
6029
6029
|
}
|
|
6030
6030
|
|
|
6031
6031
|
// src/contracts/gov/transactions.ts
|
|
6032
|
-
var import_cardano_offchain_common18 = require("@
|
|
6032
|
+
var import_cardano_offchain_common18 = require("@indigo-labs/cardano-offchain-common");
|
|
6033
6033
|
async function createProposal(proposalContent, treasuryWithdrawal, sysParams, lucid, govOref, allIAssetOrefs) {
|
|
6034
6034
|
const network = lucid.config().network;
|
|
6035
6035
|
const currentTime = BigInt(lucid.slotToUnixTime(lucid.currentSlot()));
|
|
@@ -7255,7 +7255,7 @@ var mkGovValidatorFromSP = (params) => {
|
|
|
7255
7255
|
|
|
7256
7256
|
// src/contracts/staking/transactions.ts
|
|
7257
7257
|
var import_lucid27 = require("@lucid-evolution/lucid");
|
|
7258
|
-
var import_cardano_offchain_common19 = require("@
|
|
7258
|
+
var import_cardano_offchain_common19 = require("@indigo-labs/cardano-offchain-common");
|
|
7259
7259
|
async function openStakingPosition(amount, params, lucid, stakingManagerRef) {
|
|
7260
7260
|
const [pkh, _] = await addrDetails(lucid);
|
|
7261
7261
|
const stakingManagerOut = stakingManagerRef ? await findStakingManagerByOutRef(stakingManagerRef, lucid) : await findStakingManager(params, lucid);
|
|
@@ -7607,7 +7607,7 @@ function mkInterestOracleValidator(params) {
|
|
|
7607
7607
|
}
|
|
7608
7608
|
|
|
7609
7609
|
// src/contracts/interest-oracle/queries.ts
|
|
7610
|
-
var import_cardano_offchain_common20 = require("@
|
|
7610
|
+
var import_cardano_offchain_common20 = require("@indigo-labs/cardano-offchain-common");
|
|
7611
7611
|
async function findInterestOracle(lucid, interestNft) {
|
|
7612
7612
|
return lucid.utxoByUnit((0, import_cardano_offchain_common20.assetClassToUnit)(interestNft));
|
|
7613
7613
|
}
|
|
@@ -7789,7 +7789,7 @@ var mkInterestCollectionValidatorFromSP = (params) => {
|
|
|
7789
7789
|
|
|
7790
7790
|
// src/contracts/interest-collection/queries.ts
|
|
7791
7791
|
var import_fp_ts19 = require("fp-ts");
|
|
7792
|
-
var import_cardano_offchain_common21 = require("@
|
|
7792
|
+
var import_cardano_offchain_common21 = require("@indigo-labs/cardano-offchain-common");
|
|
7793
7793
|
async function findAllInterestCollectors(lucid, sysParams) {
|
|
7794
7794
|
return lucid.utxosAt(
|
|
7795
7795
|
createScriptAddress(
|
|
@@ -7914,12 +7914,13 @@ var mkTreasuryValidatorFromSP = (params) => {
|
|
|
7914
7914
|
|
|
7915
7915
|
// src/contracts/treasury/queries.ts
|
|
7916
7916
|
var import_fp_ts20 = require("fp-ts");
|
|
7917
|
-
var import_cardano_offchain_common22 = require("@
|
|
7917
|
+
var import_cardano_offchain_common22 = require("@indigo-labs/cardano-offchain-common");
|
|
7918
7918
|
async function findAllTreasuryUtxos(lucid, sysParams) {
|
|
7919
|
-
|
|
7919
|
+
const res = await lucid.utxosAt({
|
|
7920
7920
|
type: "Script",
|
|
7921
7921
|
hash: sysParams.validatorHashes.treasuryHash
|
|
7922
7922
|
});
|
|
7923
|
+
return res.filter((utxo) => utxo.datumHash == null);
|
|
7923
7924
|
}
|
|
7924
7925
|
async function findRandomTreasuryUtxo(lucid, sysParams) {
|
|
7925
7926
|
const treasuryUtxos = await findAllTreasuryUtxos(lucid, sysParams);
|
|
@@ -7947,9 +7948,7 @@ async function findRandomTreasuryUtxoWithAsset(lucid, sysParams, asset, max_numb
|
|
|
7947
7948
|
{ hash: sysParams.validatorHashes.treasuryHash, type: "Script" },
|
|
7948
7949
|
(0, import_cardano_offchain_common22.assetClassToUnit)(asset)
|
|
7949
7950
|
);
|
|
7950
|
-
const validTreasuryUtxos = treasuryUtxos.filter(
|
|
7951
|
-
(utxo) => Object.keys(utxo.assets).length <= max_number_of_assets
|
|
7952
|
-
);
|
|
7951
|
+
const validTreasuryUtxos = treasuryUtxos.filter((utxo) => Object.keys(utxo.assets).length <= max_number_of_assets).filter((utxo) => utxo.datumHash == null);
|
|
7953
7952
|
return import_fp_ts20.function.pipe(
|
|
7954
7953
|
import_fp_ts20.option.fromNullable((0, import_cardano_offchain_common22.getRandomElement)(validTreasuryUtxos)),
|
|
7955
7954
|
import_fp_ts20.option.match(() => {
|
|
@@ -8091,7 +8090,7 @@ function castPriceOracleParams(params) {
|
|
|
8091
8090
|
|
|
8092
8091
|
// src/contracts/stability-pool/queries.ts
|
|
8093
8092
|
var import_lucid46 = require("@lucid-evolution/lucid");
|
|
8094
|
-
var import_cardano_offchain_common23 = require("@
|
|
8093
|
+
var import_cardano_offchain_common23 = require("@indigo-labs/cardano-offchain-common");
|
|
8095
8094
|
var import_fp_ts21 = require("fp-ts");
|
|
8096
8095
|
async function findStabilityPool(lucid, sysParams, iassetName) {
|
|
8097
8096
|
const spUtxos = await lucid.utxosAtWithUnit(
|
|
@@ -8176,7 +8175,7 @@ async function findE2s2sSnapshots(lucid, sysParams, iassetName) {
|
|
|
8176
8175
|
|
|
8177
8176
|
// src/contracts/stability-pool/transactions.ts
|
|
8178
8177
|
var import_lucid47 = require("@lucid-evolution/lucid");
|
|
8179
|
-
var import_cardano_offchain_common24 = require("@
|
|
8178
|
+
var import_cardano_offchain_common24 = require("@indigo-labs/cardano-offchain-common");
|
|
8180
8179
|
var import_ts_pattern18 = require("ts-pattern");
|
|
8181
8180
|
async function requestSpAccountCreation(assetAscii, amount, sysParams, lucid) {
|
|
8182
8181
|
const [pkh, _skh] = await addrDetails(lucid);
|
|
@@ -8841,7 +8840,7 @@ var import_lucid48 = require("@lucid-evolution/lucid");
|
|
|
8841
8840
|
|
|
8842
8841
|
// src/contracts/rob/types-new.ts
|
|
8843
8842
|
var import_evolution19 = require("@evolution-sdk/evolution");
|
|
8844
|
-
var import_cardano_offchain_common25 = require("@
|
|
8843
|
+
var import_cardano_offchain_common25 = require("@indigo-labs/cardano-offchain-common");
|
|
8845
8844
|
var import_fp_ts22 = require("fp-ts");
|
|
8846
8845
|
var RobOrderTypeSchema = import_evolution19.TSchema.Union(
|
|
8847
8846
|
import_evolution19.TSchema.Struct(
|
|
@@ -8946,7 +8945,7 @@ function parseRobRedeemerOrThrow(redeemerCborHex) {
|
|
|
8946
8945
|
// src/contracts/rob/helpers.ts
|
|
8947
8946
|
var import_fp_ts23 = require("fp-ts");
|
|
8948
8947
|
var import_ts_pattern19 = require("ts-pattern");
|
|
8949
|
-
var import_cardano_offchain_common26 = require("@
|
|
8948
|
+
var import_cardano_offchain_common26 = require("@indigo-labs/cardano-offchain-common");
|
|
8950
8949
|
var import_decimal = __toESM(require("decimal.js"));
|
|
8951
8950
|
var MIN_ROB_COLLATERAL_AMT = 3000000n;
|
|
8952
8951
|
var MAX_SELL_ROB_REDEMPTIONS_COUNT = 18;
|
|
@@ -9280,7 +9279,7 @@ function castRobParams(params) {
|
|
|
9280
9279
|
// src/contracts/rob/transactions.ts
|
|
9281
9280
|
var import_lucid50 = require("@lucid-evolution/lucid");
|
|
9282
9281
|
var import_fp_ts24 = require("fp-ts");
|
|
9283
|
-
var import_cardano_offchain_common27 = require("@
|
|
9282
|
+
var import_cardano_offchain_common27 = require("@indigo-labs/cardano-offchain-common");
|
|
9284
9283
|
var import_ts_pattern20 = require("ts-pattern");
|
|
9285
9284
|
async function openRob(assetTokenNameAscii, depositAmt, orderType, lucid, sysParams, robStakeCredential) {
|
|
9286
9285
|
const network = lucid.config().network;
|
|
@@ -9733,7 +9732,7 @@ function calculateLeverageFromCollateralRatio(iasset, collateralAsset, collatera
|
|
|
9733
9732
|
}
|
|
9734
9733
|
|
|
9735
9734
|
// src/contracts/rob-leverage/transactions.ts
|
|
9736
|
-
var import_cardano_offchain_common28 = require("@
|
|
9735
|
+
var import_cardano_offchain_common28 = require("@indigo-labs/cardano-offchain-common");
|
|
9737
9736
|
var import_decimal3 = __toESM(require("decimal.js"));
|
|
9738
9737
|
async function leverageCdpWithRob(leverage, baseCollateral, priceOracleOutRef, iassetOutRef, collateralAssetOutRef, cdpCreatorOref, interestOracleOref, treasuryOref, sysParams, lucid, allRobs, pythMessage = void 0, pythStateOref = void 0) {
|
|
9739
9738
|
const network = lucid.config().network;
|
|
@@ -10006,7 +10005,7 @@ function mkPriceOracleValidator(params) {
|
|
|
10006
10005
|
}
|
|
10007
10006
|
|
|
10008
10007
|
// src/contracts/price-oracle/transactions.ts
|
|
10009
|
-
var import_cardano_offchain_common29 = require("@
|
|
10008
|
+
var import_cardano_offchain_common29 = require("@indigo-labs/cardano-offchain-common");
|
|
10010
10009
|
var Core2 = __toESM(require("@evolution-sdk/evolution"));
|
|
10011
10010
|
async function startPriceOracleTx(lucid, assetName, startPrice, oracleParams, refOutRef, auxiliaryData) {
|
|
10012
10011
|
const now = BigInt(lucid.slotToUnixTime(lucid.currentSlot()));
|
|
@@ -10088,7 +10087,7 @@ async function runCreateScriptRefTx(lucid, scriptRefValidator, network) {
|
|
|
10088
10087
|
|
|
10089
10088
|
// src/contracts/initialize/helpers.ts
|
|
10090
10089
|
var import_lucid59 = require("@lucid-evolution/lucid");
|
|
10091
|
-
var import_cardano_offchain_common30 = require("@
|
|
10090
|
+
var import_cardano_offchain_common30 = require("@indigo-labs/cardano-offchain-common");
|
|
10092
10091
|
|
|
10093
10092
|
// src/scripts/auth-token-policy.ts
|
|
10094
10093
|
var import_lucid56 = require("@lucid-evolution/lucid");
|
|
@@ -10542,7 +10541,7 @@ async function mintAuthTokenDirect(lucid, asset, tokenName, amount) {
|
|
|
10542
10541
|
|
|
10543
10542
|
// src/contracts/initialize/actions.ts
|
|
10544
10543
|
var import_lucid64 = require("@lucid-evolution/lucid");
|
|
10545
|
-
var import_cardano_offchain_common32 = require("@
|
|
10544
|
+
var import_cardano_offchain_common32 = require("@indigo-labs/cardano-offchain-common");
|
|
10546
10545
|
|
|
10547
10546
|
// src/scripts/iasset-policy.ts
|
|
10548
10547
|
var import_lucid60 = require("@lucid-evolution/lucid");
|
|
@@ -10647,7 +10646,7 @@ var alwaysSucceedValidator = {
|
|
|
10647
10646
|
};
|
|
10648
10647
|
|
|
10649
10648
|
// tests/pyth/endpoints.ts
|
|
10650
|
-
var import_cardano_offchain_common31 = require("@
|
|
10649
|
+
var import_cardano_offchain_common31 = require("@indigo-labs/cardano-offchain-common");
|
|
10651
10650
|
var TEST_TRUSTED_SIGNER_PUB_KEY = "4a50d7c3d16b2be5c16ba996109a455a34cce08a81b3e15b86ef407e2f72e71f";
|
|
10652
10651
|
async function initPyth(lucid) {
|
|
10653
10652
|
const pythStateName = (0, import_lucid63.fromText)("Pyth State");
|
|
@@ -11321,7 +11320,7 @@ async function init(lucid, defaultInitialAssets, mkPythBasedAssets = () => [], p
|
|
|
11321
11320
|
|
|
11322
11321
|
// src/contracts/iasset/queries.ts
|
|
11323
11322
|
var import_lucid65 = require("@lucid-evolution/lucid");
|
|
11324
|
-
var import_cardano_offchain_common33 = require("@
|
|
11323
|
+
var import_cardano_offchain_common33 = require("@indigo-labs/cardano-offchain-common");
|
|
11325
11324
|
var import_fp_ts27 = require("fp-ts");
|
|
11326
11325
|
async function findIAsset(lucid, sysParams, iassetName) {
|
|
11327
11326
|
const iassetUtxos = await lucid.utxosAtWithUnit(
|
|
@@ -11391,7 +11390,7 @@ var import_lucid66 = require("@lucid-evolution/lucid");
|
|
|
11391
11390
|
var import_fp_ts29 = require("fp-ts");
|
|
11392
11391
|
|
|
11393
11392
|
// src/contracts/stableswap/types-new.ts
|
|
11394
|
-
var import_cardano_offchain_common34 = require("@
|
|
11393
|
+
var import_cardano_offchain_common34 = require("@indigo-labs/cardano-offchain-common");
|
|
11395
11394
|
var import_evolution20 = require("@evolution-sdk/evolution");
|
|
11396
11395
|
var import_fp_ts28 = require("fp-ts");
|
|
11397
11396
|
var import_effect3 = require("effect");
|
|
@@ -11488,7 +11487,7 @@ function parseStableswapOrderRedeemerOrThrow(redeemerCborHex) {
|
|
|
11488
11487
|
|
|
11489
11488
|
// src/contracts/stableswap/helpers.ts
|
|
11490
11489
|
var import_evolution21 = require("@evolution-sdk/evolution");
|
|
11491
|
-
var import_cardano_offchain_common35 = require("@
|
|
11490
|
+
var import_cardano_offchain_common35 = require("@indigo-labs/cardano-offchain-common");
|
|
11492
11491
|
var BASE_MAX_EXECUTION_FEE = 1620000n;
|
|
11493
11492
|
var defaultPSMProcessingConfig = {
|
|
11494
11493
|
enforceMaxExecutionFeeConstraint: true,
|
|
@@ -11786,7 +11785,7 @@ function pickValidSatisfiableOrders(lucid, orders, pool, sysParams, psmProcessin
|
|
|
11786
11785
|
|
|
11787
11786
|
// src/contracts/stableswap/transactions.ts
|
|
11788
11787
|
var import_lucid67 = require("@lucid-evolution/lucid");
|
|
11789
|
-
var import_cardano_offchain_common36 = require("@
|
|
11788
|
+
var import_cardano_offchain_common36 = require("@indigo-labs/cardano-offchain-common");
|
|
11790
11789
|
var import_fp_ts30 = require("fp-ts");
|
|
11791
11790
|
async function createStableswapOrder(iasset, collateralAsset, amount, minting, poolDatum, params, lucid, destinationAddress, destinationInlineDatum, maxExecutionFee = BASE_MAX_EXECUTION_FEE, additionalLovelaces = 0n, maxFeeRatio) {
|
|
11792
11791
|
const myAddress = await lucid.wallet().address();
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import * as Lucid from "@lucid-evolution/lucid";
|
|
3
|
-
import * as OffchainCommon from "@
|
|
3
|
+
import * as OffchainCommon from "@indigo-labs/cardano-offchain-common";
|
|
4
4
|
import * as Evo from "@evolution-sdk/evolution";
|
|
5
5
|
|
|
6
6
|
// src/contracts/cdp/transactions.ts
|
|
@@ -469,7 +469,7 @@ function calculateFeeFromRatio(feeRatio, amount) {
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
// src/contracts/cdp/helpers.ts
|
|
472
|
-
import { assetClassValueOf } from "@
|
|
472
|
+
import { assetClassValueOf } from "@indigo-labs/cardano-offchain-common";
|
|
473
473
|
function iassetValueOfCollateral(collateralAmt, oraclePrice) {
|
|
474
474
|
return rationalFloor(
|
|
475
475
|
rationalDiv(rationalFromInt(collateralAmt), oraclePrice)
|
|
@@ -558,7 +558,7 @@ import {
|
|
|
558
558
|
AddressSchema,
|
|
559
559
|
AssetClassSchema,
|
|
560
560
|
OutputReferenceSchema
|
|
561
|
-
} from "@
|
|
561
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
562
562
|
var SPIntegerSchema = TSchema4.Struct({
|
|
563
563
|
value: TSchema4.Integer
|
|
564
564
|
});
|
|
@@ -858,7 +858,7 @@ import {
|
|
|
858
858
|
isSameAssetClass,
|
|
859
859
|
isSameOutRef,
|
|
860
860
|
mkAssetsOf
|
|
861
|
-
} from "@
|
|
861
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
862
862
|
|
|
863
863
|
// src/utils/array-utils.ts
|
|
864
864
|
import {
|
|
@@ -1688,7 +1688,7 @@ import {
|
|
|
1688
1688
|
assetClassValueOf as assetClassValueOf2,
|
|
1689
1689
|
getInlineDatumOrThrow as getInlineDatumOrThrow3,
|
|
1690
1690
|
mkAssetsOf as mkAssetsOf2
|
|
1691
|
-
} from "@
|
|
1691
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
1692
1692
|
|
|
1693
1693
|
// src/contracts/cdp/types-new.ts
|
|
1694
1694
|
import { TSchema as TSchema8, Data as Data9 } from "@evolution-sdk/evolution";
|
|
@@ -1696,7 +1696,7 @@ import { option as O4, function as F4 } from "fp-ts";
|
|
|
1696
1696
|
import {
|
|
1697
1697
|
AssetClassSchema as AssetClassSchema3,
|
|
1698
1698
|
OutputReferenceSchema as OutputReferenceSchema2
|
|
1699
|
-
} from "@
|
|
1699
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
1700
1700
|
import { match as match7, P as P8 } from "ts-pattern";
|
|
1701
1701
|
|
|
1702
1702
|
// src/contracts/price-oracle/types-new.ts
|
|
@@ -1980,7 +1980,7 @@ import { array as A4, function as F6 } from "fp-ts";
|
|
|
1980
1980
|
// src/contracts/iasset/types.ts
|
|
1981
1981
|
import { TSchema as TSchema10, Data as Data11 } from "@evolution-sdk/evolution";
|
|
1982
1982
|
import { option as O5, function as F5 } from "fp-ts";
|
|
1983
|
-
import { AssetClassSchema as AssetClassSchema4 } from "@
|
|
1983
|
+
import { AssetClassSchema as AssetClassSchema4 } from "@indigo-labs/cardano-offchain-common";
|
|
1984
1984
|
import { match as match8, P as P9 } from "ts-pattern";
|
|
1985
1985
|
var IAssetPriceInfoSchema = TSchema10.Union(
|
|
1986
1986
|
TSchema10.Struct(
|
|
@@ -2395,7 +2395,7 @@ import { TSchema as TSchema11, Data as Data13 } from "@evolution-sdk/evolution";
|
|
|
2395
2395
|
import {
|
|
2396
2396
|
AddressSchema as AddressSchema2,
|
|
2397
2397
|
AssetClassSchema as AssetClassSchema5
|
|
2398
|
-
} from "@
|
|
2398
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
2399
2399
|
import { option as O6, function as F7 } from "fp-ts";
|
|
2400
2400
|
var ProtocolParamsSchema = TSchema11.Struct({
|
|
2401
2401
|
proposalDeposit: TSchema11.Integer,
|
|
@@ -2626,11 +2626,11 @@ import {
|
|
|
2626
2626
|
assetClassValueOf as assetClassValueOf3,
|
|
2627
2627
|
mkAssetsOf as mkAssetsOf5,
|
|
2628
2628
|
negateAssets as negateAssets2
|
|
2629
|
-
} from "@
|
|
2629
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
2630
2630
|
|
|
2631
2631
|
// src/contracts/cdp-creator/types-new.ts
|
|
2632
2632
|
import { TSchema as TSchema12, Data as Data14 } from "@evolution-sdk/evolution";
|
|
2633
|
-
import { OutputReferenceSchema as OutputReferenceSchema3 } from "@
|
|
2633
|
+
import { OutputReferenceSchema as OutputReferenceSchema3 } from "@indigo-labs/cardano-offchain-common";
|
|
2634
2634
|
var CDPCreatorDatumSchema = TSchema12.Struct({
|
|
2635
2635
|
creatorInputOref: OutputReferenceSchema3
|
|
2636
2636
|
});
|
|
@@ -2682,14 +2682,14 @@ import {
|
|
|
2682
2682
|
mkAssetsOf as mkAssetsOf4,
|
|
2683
2683
|
mkLovelacesOf,
|
|
2684
2684
|
negateAssets
|
|
2685
|
-
} from "@
|
|
2685
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
2686
2686
|
|
|
2687
2687
|
// src/contracts/treasury/types-new.ts
|
|
2688
2688
|
import { TSchema as TSchema13, Data as Data15 } from "@evolution-sdk/evolution";
|
|
2689
2689
|
import {
|
|
2690
2690
|
AssetClassSchema as AssetClassSchema6,
|
|
2691
2691
|
OutputReferenceSchema as OutputReferenceSchema4
|
|
2692
|
-
} from "@
|
|
2692
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
2693
2693
|
var WithdrawalOutputDatumSchema = TSchema13.Tuple([
|
|
2694
2694
|
TSchema13.ByteArray,
|
|
2695
2695
|
OutputReferenceSchema4
|
|
@@ -2791,7 +2791,7 @@ import {
|
|
|
2791
2791
|
toHex as toHex5,
|
|
2792
2792
|
toText as toText2
|
|
2793
2793
|
} from "@lucid-evolution/lucid";
|
|
2794
|
-
import { mkAssetsOf as mkAssetsOf3 } from "@
|
|
2794
|
+
import { mkAssetsOf as mkAssetsOf3 } from "@indigo-labs/cardano-offchain-common";
|
|
2795
2795
|
function proposalDeposit(baseDeposit, activeProposals) {
|
|
2796
2796
|
return baseDeposit * 2n ** activeProposals;
|
|
2797
2797
|
}
|
|
@@ -3840,7 +3840,7 @@ import { match as match12, P as P13 } from "ts-pattern";
|
|
|
3840
3840
|
import {
|
|
3841
3841
|
getInlineDatumOrThrow as getInlineDatumOrThrow4,
|
|
3842
3842
|
matchSingle as matchSingle2
|
|
3843
|
-
} from "@
|
|
3843
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
3844
3844
|
async function retrieveAdjustedPrice(iasset, collateralAsset, priceInfo, extraDecimals, priceOracleOref, pythMessage, pythConfig, lucid) {
|
|
3845
3845
|
const [oraclePrice, maybePriceOracleUtxo] = await match12(priceInfo).with({ OracleNft: P13.any }, async () => {
|
|
3846
3846
|
if (!priceOracleOref) throw new Error("Missing price oracle");
|
|
@@ -5140,7 +5140,7 @@ var mkCDPCreatorValidatorFromSP = (params) => {
|
|
|
5140
5140
|
import {
|
|
5141
5141
|
assetClassToUnit,
|
|
5142
5142
|
getRandomElement
|
|
5143
|
-
} from "@
|
|
5143
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
5144
5144
|
import { option as O10, function as F13 } from "fp-ts";
|
|
5145
5145
|
async function findRandomCdpCreator(lucid, sysParams) {
|
|
5146
5146
|
const cdpCreatorUtxos = await lucid.utxosAtWithUnit(
|
|
@@ -5276,7 +5276,7 @@ function serialiseCollectorRedeemer(r) {
|
|
|
5276
5276
|
}
|
|
5277
5277
|
|
|
5278
5278
|
// src/contracts/collector/transactions.ts
|
|
5279
|
-
import { mkLovelacesOf as mkLovelacesOf2 } from "@
|
|
5279
|
+
import { mkLovelacesOf as mkLovelacesOf2 } from "@indigo-labs/cardano-offchain-common";
|
|
5280
5280
|
async function collectorFeeTx(fee, lucid, params, tx, collectorOref) {
|
|
5281
5281
|
const collectorUtxo = matchSingle(
|
|
5282
5282
|
await lucid.utxosByOutRef([collectorOref]),
|
|
@@ -5313,7 +5313,7 @@ import {
|
|
|
5313
5313
|
mkAssetsOf as mkAssetsOf6,
|
|
5314
5314
|
mkLovelacesOf as mkLovelacesOf3,
|
|
5315
5315
|
negateAssets as negateAssets3
|
|
5316
|
-
} from "@
|
|
5316
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
5317
5317
|
import { Data as Data30 } from "@lucid-evolution/lucid";
|
|
5318
5318
|
import { array as A9, option as O13, function as F16 } from "fp-ts";
|
|
5319
5319
|
import { match as match16, P as P17 } from "ts-pattern";
|
|
@@ -5595,7 +5595,7 @@ import { TSchema as TSchema18, Data as Data29 } from "@evolution-sdk/evolution";
|
|
|
5595
5595
|
import {
|
|
5596
5596
|
AddressSchema as AddressSchema3,
|
|
5597
5597
|
OutputReferenceSchema as OutputReferenceSchema5
|
|
5598
|
-
} from "@
|
|
5598
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
5599
5599
|
import { option as O12, function as F15 } from "fp-ts";
|
|
5600
5600
|
import { match as match15, P as P16 } from "ts-pattern";
|
|
5601
5601
|
var PollStatusSchema = TSchema18.Struct({
|
|
@@ -5752,7 +5752,7 @@ function serialisePollDatum(d) {
|
|
|
5752
5752
|
import {
|
|
5753
5753
|
addressFromBech32,
|
|
5754
5754
|
addressToBech32
|
|
5755
|
-
} from "@
|
|
5755
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
5756
5756
|
async function createProposal(proposalContent, treasuryWithdrawal, sysParams, lucid, govOref, allIAssetOrefs) {
|
|
5757
5757
|
const network = lucid.config().network;
|
|
5758
5758
|
const currentTime = BigInt(lucid.slotToUnixTime(lucid.currentSlot()));
|
|
@@ -6989,7 +6989,7 @@ import {
|
|
|
6989
6989
|
getInlineDatumOrThrow as getInlineDatumOrThrow5,
|
|
6990
6990
|
mkAssetsOf as mkAssetsOf7,
|
|
6991
6991
|
mkLovelacesOf as mkLovelacesOf4
|
|
6992
|
-
} from "@
|
|
6992
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
6993
6993
|
async function openStakingPosition(amount, params, lucid, stakingManagerRef) {
|
|
6994
6994
|
const [pkh, _] = await addrDetails(lucid);
|
|
6995
6995
|
const stakingManagerOut = stakingManagerRef ? await findStakingManagerByOutRef(stakingManagerRef, lucid) : await findStakingManager(params, lucid);
|
|
@@ -7354,7 +7354,7 @@ function mkInterestOracleValidator(params) {
|
|
|
7354
7354
|
// src/contracts/interest-oracle/queries.ts
|
|
7355
7355
|
import {
|
|
7356
7356
|
assetClassToUnit as assetClassToUnit2
|
|
7357
|
-
} from "@
|
|
7357
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
7358
7358
|
async function findInterestOracle(lucid, interestNft) {
|
|
7359
7359
|
return lucid.utxoByUnit(assetClassToUnit2(interestNft));
|
|
7360
7360
|
}
|
|
@@ -7541,7 +7541,7 @@ import {
|
|
|
7541
7541
|
assetClassValueOf as assetClassValueOf6,
|
|
7542
7542
|
getRandomElement as getRandomElement2,
|
|
7543
7543
|
matchSingle as matchSingle3
|
|
7544
|
-
} from "@
|
|
7544
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
7545
7545
|
async function findAllInterestCollectors(lucid, sysParams) {
|
|
7546
7546
|
return lucid.utxosAt(
|
|
7547
7547
|
createScriptAddress(
|
|
@@ -7672,12 +7672,13 @@ import {
|
|
|
7672
7672
|
assetClassToUnit as assetClassToUnit4,
|
|
7673
7673
|
assetClassValueOf as assetClassValueOf7,
|
|
7674
7674
|
getRandomElement as getRandomElement3
|
|
7675
|
-
} from "@
|
|
7675
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
7676
7676
|
async function findAllTreasuryUtxos(lucid, sysParams) {
|
|
7677
|
-
|
|
7677
|
+
const res = await lucid.utxosAt({
|
|
7678
7678
|
type: "Script",
|
|
7679
7679
|
hash: sysParams.validatorHashes.treasuryHash
|
|
7680
7680
|
});
|
|
7681
|
+
return res.filter((utxo) => utxo.datumHash == null);
|
|
7681
7682
|
}
|
|
7682
7683
|
async function findRandomTreasuryUtxo(lucid, sysParams) {
|
|
7683
7684
|
const treasuryUtxos = await findAllTreasuryUtxos(lucid, sysParams);
|
|
@@ -7705,9 +7706,7 @@ async function findRandomTreasuryUtxoWithAsset(lucid, sysParams, asset, max_numb
|
|
|
7705
7706
|
{ hash: sysParams.validatorHashes.treasuryHash, type: "Script" },
|
|
7706
7707
|
assetClassToUnit4(asset)
|
|
7707
7708
|
);
|
|
7708
|
-
const validTreasuryUtxos = treasuryUtxos.filter(
|
|
7709
|
-
(utxo) => Object.keys(utxo.assets).length <= max_number_of_assets
|
|
7710
|
-
);
|
|
7709
|
+
const validTreasuryUtxos = treasuryUtxos.filter((utxo) => Object.keys(utxo.assets).length <= max_number_of_assets).filter((utxo) => utxo.datumHash == null);
|
|
7711
7710
|
return F18.pipe(
|
|
7712
7711
|
O15.fromNullable(getRandomElement3(validTreasuryUtxos)),
|
|
7713
7712
|
O15.match(() => {
|
|
@@ -7859,7 +7858,7 @@ import { toHex as toHex11 } from "@lucid-evolution/lucid";
|
|
|
7859
7858
|
import {
|
|
7860
7859
|
assetClassToUnit as assetClassToUnit5,
|
|
7861
7860
|
matchSingle as matchSingle4
|
|
7862
|
-
} from "@
|
|
7861
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
7863
7862
|
import { option as O16, array as A11, function as F19 } from "fp-ts";
|
|
7864
7863
|
async function findStabilityPool(lucid, sysParams, iassetName) {
|
|
7865
7864
|
const spUtxos = await lucid.utxosAtWithUnit(
|
|
@@ -7962,7 +7961,7 @@ import {
|
|
|
7962
7961
|
mkAssetsOf as mkAssetsOf8,
|
|
7963
7962
|
mkLovelacesOf as mkLovelacesOf5,
|
|
7964
7963
|
negateAssets as negateAssets4
|
|
7965
|
-
} from "@
|
|
7964
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
7966
7965
|
import { match as match17, P as P18 } from "ts-pattern";
|
|
7967
7966
|
async function requestSpAccountCreation(assetAscii, amount, sysParams, lucid) {
|
|
7968
7967
|
const [pkh, _skh] = await addrDetails(lucid);
|
|
@@ -8634,7 +8633,7 @@ import { TSchema as TSchema19, Data as Data43 } from "@evolution-sdk/evolution";
|
|
|
8634
8633
|
import {
|
|
8635
8634
|
AssetClassSchema as AssetClassSchema7,
|
|
8636
8635
|
OutputReferenceSchema as OutputReferenceSchema6
|
|
8637
|
-
} from "@
|
|
8636
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
8638
8637
|
import { option as O17, function as F20 } from "fp-ts";
|
|
8639
8638
|
var RobOrderTypeSchema = TSchema19.Union(
|
|
8640
8639
|
TSchema19.Struct(
|
|
@@ -8751,7 +8750,7 @@ import {
|
|
|
8751
8750
|
isSameAssetClass as isSameAssetClass3,
|
|
8752
8751
|
lovelacesAmt as lovelacesAmt3,
|
|
8753
8752
|
mkAssetsOf as mkAssetsOf9
|
|
8754
|
-
} from "@
|
|
8753
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
8755
8754
|
import Decimal from "decimal.js";
|
|
8756
8755
|
var MIN_ROB_COLLATERAL_AMT = 3000000n;
|
|
8757
8756
|
var MAX_SELL_ROB_REDEMPTIONS_COUNT = 18;
|
|
@@ -9103,7 +9102,7 @@ import {
|
|
|
9103
9102
|
mkAssetsOf as mkAssetsOf10,
|
|
9104
9103
|
mkLovelacesOf as mkLovelacesOf6,
|
|
9105
9104
|
negateAssets as negateAssets5
|
|
9106
|
-
} from "@
|
|
9105
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
9107
9106
|
import { match as match19, P as P20 } from "ts-pattern";
|
|
9108
9107
|
async function openRob(assetTokenNameAscii, depositAmt, orderType, lucid, sysParams, robStakeCredential) {
|
|
9109
9108
|
const network = lucid.config().network;
|
|
@@ -9561,7 +9560,7 @@ function calculateLeverageFromCollateralRatio(iasset, collateralAsset, collatera
|
|
|
9561
9560
|
}
|
|
9562
9561
|
|
|
9563
9562
|
// src/contracts/rob-leverage/transactions.ts
|
|
9564
|
-
import { mkAssetsOf as mkAssetsOf11 } from "@
|
|
9563
|
+
import { mkAssetsOf as mkAssetsOf11 } from "@indigo-labs/cardano-offchain-common";
|
|
9565
9564
|
import Decimal3 from "decimal.js";
|
|
9566
9565
|
async function leverageCdpWithRob(leverage, baseCollateral, priceOracleOutRef, iassetOutRef, collateralAssetOutRef, cdpCreatorOref, interestOracleOref, treasuryOref, sysParams, lucid, allRobs, pythMessage = void 0, pythStateOref = void 0) {
|
|
9567
9566
|
const network = lucid.config().network;
|
|
@@ -9842,7 +9841,7 @@ function mkPriceOracleValidator(params) {
|
|
|
9842
9841
|
}
|
|
9843
9842
|
|
|
9844
9843
|
// src/contracts/price-oracle/transactions.ts
|
|
9845
|
-
import { mkAssetsOf as mkAssetsOf12 } from "@
|
|
9844
|
+
import { mkAssetsOf as mkAssetsOf12 } from "@indigo-labs/cardano-offchain-common";
|
|
9846
9845
|
import * as Core2 from "@evolution-sdk/evolution";
|
|
9847
9846
|
async function startPriceOracleTx(lucid, assetName, startPrice, oracleParams, refOutRef, auxiliaryData) {
|
|
9848
9847
|
const now = BigInt(lucid.slotToUnixTime(lucid.currentSlot()));
|
|
@@ -9940,7 +9939,7 @@ import {
|
|
|
9940
9939
|
lovelacesAmt as lovelacesAmt4,
|
|
9941
9940
|
mkAssetsOf as mkAssetsOf13,
|
|
9942
9941
|
mkLovelacesOf as mkLovelacesOf7
|
|
9943
|
-
} from "@
|
|
9942
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
9944
9943
|
|
|
9945
9944
|
// src/scripts/auth-token-policy.ts
|
|
9946
9945
|
import {
|
|
@@ -10410,7 +10409,7 @@ import {
|
|
|
10410
10409
|
import {
|
|
10411
10410
|
mkAssetsOf as mkAssetsOf15,
|
|
10412
10411
|
mkLovelacesOf as mkLovelacesOf8
|
|
10413
|
-
} from "@
|
|
10412
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
10414
10413
|
|
|
10415
10414
|
// src/scripts/iasset-policy.ts
|
|
10416
10415
|
import {
|
|
@@ -10525,7 +10524,7 @@ var alwaysSucceedValidator = {
|
|
|
10525
10524
|
};
|
|
10526
10525
|
|
|
10527
10526
|
// tests/pyth/endpoints.ts
|
|
10528
|
-
import { mkAssetsOf as mkAssetsOf14 } from "@
|
|
10527
|
+
import { mkAssetsOf as mkAssetsOf14 } from "@indigo-labs/cardano-offchain-common";
|
|
10529
10528
|
var TEST_TRUSTED_SIGNER_PUB_KEY = "4a50d7c3d16b2be5c16ba996109a455a34cce08a81b3e15b86ef407e2f72e71f";
|
|
10530
10529
|
async function initPyth(lucid) {
|
|
10531
10530
|
const pythStateName = fromText12("Pyth State");
|
|
@@ -11203,7 +11202,7 @@ import {
|
|
|
11203
11202
|
assetClassToUnit as assetClassToUnit7,
|
|
11204
11203
|
isSameAssetClass as isSameAssetClass5,
|
|
11205
11204
|
matchSingle as matchSingle6
|
|
11206
|
-
} from "@
|
|
11205
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
11207
11206
|
import { option as O21, array as A16, function as F25 } from "fp-ts";
|
|
11208
11207
|
async function findIAsset(lucid, sysParams, iassetName) {
|
|
11209
11208
|
const iassetUtxos = await lucid.utxosAtWithUnit(
|
|
@@ -11281,7 +11280,7 @@ import {
|
|
|
11281
11280
|
AddressSchema as AddressSchema4,
|
|
11282
11281
|
AssetClassSchema as AssetClassSchema8,
|
|
11283
11282
|
OutputReferenceSchema as OutputReferenceSchema7
|
|
11284
|
-
} from "@
|
|
11283
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
11285
11284
|
import { TSchema as TSchema20, Data as Data51 } from "@evolution-sdk/evolution";
|
|
11286
11285
|
import { option as O22, function as F26 } from "fp-ts";
|
|
11287
11286
|
import { Schema as Schema4 } from "effect";
|
|
@@ -11382,7 +11381,7 @@ import {
|
|
|
11382
11381
|
addressToBech32 as addressToBech323,
|
|
11383
11382
|
assetClassValueOf as assetClassValueOf12,
|
|
11384
11383
|
lovelacesAmt as lovelacesAmt5
|
|
11385
|
-
} from "@
|
|
11384
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
11386
11385
|
var BASE_MAX_EXECUTION_FEE = 1620000n;
|
|
11387
11386
|
var defaultPSMProcessingConfig = {
|
|
11388
11387
|
enforceMaxExecutionFeeConstraint: true,
|
|
@@ -11699,7 +11698,7 @@ import {
|
|
|
11699
11698
|
lovelacesAmt as lovelacesAmt6,
|
|
11700
11699
|
isSameOutRef as isSameOutRef2,
|
|
11701
11700
|
assetClassValueOf as assetClassValueOf13
|
|
11702
|
-
} from "@
|
|
11701
|
+
} from "@indigo-labs/cardano-offchain-common";
|
|
11703
11702
|
import { array as A18, function as F28 } from "fp-ts";
|
|
11704
11703
|
async function createStableswapOrder(iasset, collateralAsset, amount, minting, poolDatum, params, lucid, destinationAddress, destinationInlineDatum, maxExecutionFee = BASE_MAX_EXECUTION_FEE, additionalLovelaces = 0n, maxFeeRatio) {
|
|
11705
11704
|
const myAddress = await lucid.wallet().address();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigo-labs/indigo-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
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",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"lucid-evolution",
|
|
36
36
|
"cdp"
|
|
37
37
|
],
|
|
38
|
-
"author": "
|
|
38
|
+
"author": "Indigo Labs",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@
|
|
41
|
+
"@indigo-labs/cardano-offchain-common": "1.5.2",
|
|
42
42
|
"@evolution-sdk/evolution": "^0.3.22",
|
|
43
43
|
"@harmoniclabs/crypto": "^0.3.0",
|
|
44
44
|
"@lucid-evolution/lucid": "0.6.2",
|