@indigo-labs/indigo-sdk 0.5.8 → 0.5.10
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 +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +139 -143
- package/dist/index.mjs +127 -131
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3111,7 +3111,6 @@ function parseExecuteDatumOrThrow(datum) {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
|
|
3113
3113
|
// src/contracts/gov/helpers.ts
|
|
3114
|
-
var import_function = require("fp-ts/lib/function");
|
|
3115
3114
|
var import_fp_ts10 = require("fp-ts");
|
|
3116
3115
|
var import_lucid8 = require("@lucid-evolution/lucid");
|
|
3117
3116
|
var import_cardano_offchain_common10 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
@@ -3144,7 +3143,7 @@ async function findRelativeAssetForInsertion(newAsset, allIAssetOrefs, lucid, as
|
|
|
3144
3143
|
return { datum, utxo };
|
|
3145
3144
|
})
|
|
3146
3145
|
);
|
|
3147
|
-
return
|
|
3146
|
+
return import_fp_ts10.function.pipe(
|
|
3148
3147
|
parsedUtxos,
|
|
3149
3148
|
// Sort by the asset names
|
|
3150
3149
|
import_fp_ts10.array.sort(
|
|
@@ -3206,7 +3205,7 @@ async function findFirstAsset(allIAssetOrefs, lucid, assetOrd, getComparisonAsse
|
|
|
3206
3205
|
return { datum, utxo };
|
|
3207
3206
|
})
|
|
3208
3207
|
);
|
|
3209
|
-
return
|
|
3208
|
+
return import_fp_ts10.function.pipe(
|
|
3210
3209
|
parsedUtxos,
|
|
3211
3210
|
// Sort by the asset names
|
|
3212
3211
|
import_fp_ts10.array.sort(
|
|
@@ -5606,7 +5605,6 @@ async function collectorFeeTx(fee, lucid, params, tx, collectorOref) {
|
|
|
5606
5605
|
var import_lucid23 = require("@lucid-evolution/lucid");
|
|
5607
5606
|
var import_cardano_offchain_common17 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
5608
5607
|
var import_lucid24 = require("@lucid-evolution/lucid");
|
|
5609
|
-
var import_function2 = require("fp-ts/lib/function");
|
|
5610
5608
|
var import_fp_ts17 = require("fp-ts");
|
|
5611
5609
|
var import_ts_pattern17 = require("ts-pattern");
|
|
5612
5610
|
|
|
@@ -6076,7 +6074,7 @@ async function createProposal(proposalContent, treasuryWithdrawal, sysParams, lu
|
|
|
6076
6074
|
allIAssetOrefs,
|
|
6077
6075
|
lucid
|
|
6078
6076
|
);
|
|
6079
|
-
|
|
6077
|
+
import_fp_ts17.function.pipe(
|
|
6080
6078
|
relativeIAsset,
|
|
6081
6079
|
import_fp_ts17.option.match(
|
|
6082
6080
|
() => {
|
|
@@ -6563,7 +6561,7 @@ async function executeProposal(executeOref, govOref, treasuryWithdrawalOref, all
|
|
|
6563
6561
|
getInlineDatumOrThrow(executeUtxo)
|
|
6564
6562
|
);
|
|
6565
6563
|
const tx = lucid.newTx();
|
|
6566
|
-
await
|
|
6564
|
+
await import_fp_ts17.function.pipe(
|
|
6567
6565
|
import_fp_ts17.option.fromNullable(executeDatum.treasuryWithdrawal),
|
|
6568
6566
|
import_fp_ts17.option.match(
|
|
6569
6567
|
() => {
|
|
@@ -7553,7 +7551,7 @@ function mkOneShotPolicy(params) {
|
|
|
7553
7551
|
}
|
|
7554
7552
|
|
|
7555
7553
|
// src/contracts/one-shot/transactions.ts
|
|
7556
|
-
var
|
|
7554
|
+
var import_fp_ts18 = require("fp-ts");
|
|
7557
7555
|
async function oneShotMintTx(lucid, params) {
|
|
7558
7556
|
const oneShotPolicy = mkOneShotPolicy(params);
|
|
7559
7557
|
const policyId = (0, import_lucid32.mintingPolicyToId)(oneShotPolicy);
|
|
@@ -7570,7 +7568,7 @@ async function oneShotMintTx(lucid, params) {
|
|
|
7570
7568
|
);
|
|
7571
7569
|
return [
|
|
7572
7570
|
lucid.newTx().collectFrom([refUtxo]).mintAssets(
|
|
7573
|
-
|
|
7571
|
+
import_fp_ts18.array.reduce(
|
|
7574
7572
|
{},
|
|
7575
7573
|
(acc, entry) => (0, import_lucid32.addAssets)(acc, {
|
|
7576
7574
|
[(0, import_lucid32.toUnit)(policyId, entry.tokenName)]: entry.amount
|
|
@@ -7681,7 +7679,7 @@ async function feedInterestOracle(params, newInterestRate, lucid, assetClass, ut
|
|
|
7681
7679
|
tx.readFrom([scriptRef2]);
|
|
7682
7680
|
} else {
|
|
7683
7681
|
const validator = scriptOverrideCborHex ? {
|
|
7684
|
-
type: "
|
|
7682
|
+
type: "PlutusV2",
|
|
7685
7683
|
script: (0, import_lucid34.applyParamsToScript)(scriptOverrideCborHex, [
|
|
7686
7684
|
castInterestOracleParams(params)
|
|
7687
7685
|
])
|
|
@@ -7790,7 +7788,7 @@ var mkInterestCollectionValidatorFromSP = (params) => {
|
|
|
7790
7788
|
};
|
|
7791
7789
|
|
|
7792
7790
|
// src/contracts/interest-collection/queries.ts
|
|
7793
|
-
var
|
|
7791
|
+
var import_fp_ts19 = require("fp-ts");
|
|
7794
7792
|
var import_cardano_offchain_common21 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
7795
7793
|
async function findAllInterestCollectors(lucid, sysParams) {
|
|
7796
7794
|
return lucid.utxosAt(
|
|
@@ -7825,11 +7823,11 @@ async function findRandomNonAdminInterestCollector(lucid, sysParams) {
|
|
|
7825
7823
|
)
|
|
7826
7824
|
)
|
|
7827
7825
|
);
|
|
7828
|
-
return
|
|
7829
|
-
|
|
7830
|
-
|
|
7826
|
+
return import_fp_ts19.function.pipe(
|
|
7827
|
+
import_fp_ts19.option.fromNullable((0, import_cardano_offchain_common21.getRandomElement)(allCollectors)),
|
|
7828
|
+
import_fp_ts19.option.match(() => {
|
|
7831
7829
|
throw new Error("Expected some non-admin interest collector UTXOs.");
|
|
7832
|
-
},
|
|
7830
|
+
}, import_fp_ts19.function.identity)
|
|
7833
7831
|
);
|
|
7834
7832
|
}
|
|
7835
7833
|
|
|
@@ -7915,7 +7913,7 @@ var mkTreasuryValidatorFromSP = (params) => {
|
|
|
7915
7913
|
};
|
|
7916
7914
|
|
|
7917
7915
|
// src/contracts/treasury/queries.ts
|
|
7918
|
-
var
|
|
7916
|
+
var import_fp_ts20 = require("fp-ts");
|
|
7919
7917
|
var import_cardano_offchain_common22 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
7920
7918
|
async function findAllTreasuryUtxos(lucid, sysParams) {
|
|
7921
7919
|
return lucid.utxosAt({
|
|
@@ -7925,11 +7923,11 @@ async function findAllTreasuryUtxos(lucid, sysParams) {
|
|
|
7925
7923
|
}
|
|
7926
7924
|
async function findRandomTreasuryUtxo(lucid, sysParams) {
|
|
7927
7925
|
const treasuryUtxos = await findAllTreasuryUtxos(lucid, sysParams);
|
|
7928
|
-
return
|
|
7929
|
-
|
|
7930
|
-
|
|
7926
|
+
return import_fp_ts20.function.pipe(
|
|
7927
|
+
import_fp_ts20.option.fromNullable((0, import_cardano_offchain_common22.getRandomElement)(treasuryUtxos)),
|
|
7928
|
+
import_fp_ts20.option.match(() => {
|
|
7931
7929
|
throw new Error("Expected some treasury UTXOs.");
|
|
7932
|
-
},
|
|
7930
|
+
}, import_fp_ts20.function.identity)
|
|
7933
7931
|
);
|
|
7934
7932
|
}
|
|
7935
7933
|
async function findRandomTreasuryUtxoWithOnlyAda(lucid, sysParams) {
|
|
@@ -7937,11 +7935,11 @@ async function findRandomTreasuryUtxoWithOnlyAda(lucid, sysParams) {
|
|
|
7937
7935
|
const adaOnlyTreasuryUtxos = treasuryUtxos.filter(
|
|
7938
7936
|
(utxo) => Object.keys(utxo.assets).length == 1
|
|
7939
7937
|
);
|
|
7940
|
-
return
|
|
7941
|
-
|
|
7942
|
-
|
|
7938
|
+
return import_fp_ts20.function.pipe(
|
|
7939
|
+
import_fp_ts20.option.fromNullable((0, import_cardano_offchain_common22.getRandomElement)(adaOnlyTreasuryUtxos)),
|
|
7940
|
+
import_fp_ts20.option.match(() => {
|
|
7943
7941
|
throw new Error("Expected some treasury UTXOs.");
|
|
7944
|
-
},
|
|
7942
|
+
}, import_fp_ts20.function.identity)
|
|
7945
7943
|
);
|
|
7946
7944
|
}
|
|
7947
7945
|
async function findRandomTreasuryUtxoWithAsset(lucid, sysParams, asset, max_number_of_assets = 2n) {
|
|
@@ -7952,11 +7950,11 @@ async function findRandomTreasuryUtxoWithAsset(lucid, sysParams, asset, max_numb
|
|
|
7952
7950
|
const validTreasuryUtxos = treasuryUtxos.filter(
|
|
7953
7951
|
(utxo) => Object.keys(utxo.assets).length <= max_number_of_assets
|
|
7954
7952
|
);
|
|
7955
|
-
return
|
|
7956
|
-
|
|
7957
|
-
|
|
7953
|
+
return import_fp_ts20.function.pipe(
|
|
7954
|
+
import_fp_ts20.option.fromNullable((0, import_cardano_offchain_common22.getRandomElement)(validTreasuryUtxos)),
|
|
7955
|
+
import_fp_ts20.option.match(() => {
|
|
7958
7956
|
throw new Error("Expected some treasury UTXOs.");
|
|
7959
|
-
},
|
|
7957
|
+
}, import_fp_ts20.function.identity)
|
|
7960
7958
|
);
|
|
7961
7959
|
}
|
|
7962
7960
|
async function findAllTreasuryUtxosWithNonAdaAsset(lucid, sysParams, includeDaoToken = true) {
|
|
@@ -8094,7 +8092,7 @@ function castPriceOracleParams(params) {
|
|
|
8094
8092
|
// src/contracts/stability-pool/queries.ts
|
|
8095
8093
|
var import_lucid46 = require("@lucid-evolution/lucid");
|
|
8096
8094
|
var import_cardano_offchain_common23 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
8097
|
-
var
|
|
8095
|
+
var import_fp_ts21 = require("fp-ts");
|
|
8098
8096
|
async function findStabilityPool(lucid, sysParams, iassetName) {
|
|
8099
8097
|
const spUtxos = await lucid.utxosAtWithUnit(
|
|
8100
8098
|
{ hash: sysParams.validatorHashes.stabilityPoolHash, type: "Script" },
|
|
@@ -8103,21 +8101,21 @@ async function findStabilityPool(lucid, sysParams, iassetName) {
|
|
|
8103
8101
|
)
|
|
8104
8102
|
);
|
|
8105
8103
|
return (0, import_cardano_offchain_common23.matchSingle)(
|
|
8106
|
-
|
|
8104
|
+
import_fp_ts21.function.pipe(
|
|
8107
8105
|
spUtxos.map(
|
|
8108
|
-
(utxo) =>
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8106
|
+
(utxo) => import_fp_ts21.function.pipe(
|
|
8107
|
+
import_fp_ts21.option.fromNullable(utxo.datum),
|
|
8108
|
+
import_fp_ts21.option.flatMap(parseStabilityPoolDatum),
|
|
8109
|
+
import_fp_ts21.option.flatMap((datum) => {
|
|
8112
8110
|
if ((0, import_lucid46.toHex)(datum.iasset) == (0, import_lucid46.toHex)(iassetName)) {
|
|
8113
|
-
return
|
|
8111
|
+
return import_fp_ts21.option.some({ utxo, datum });
|
|
8114
8112
|
} else {
|
|
8115
|
-
return
|
|
8113
|
+
return import_fp_ts21.option.none;
|
|
8116
8114
|
}
|
|
8117
8115
|
})
|
|
8118
8116
|
)
|
|
8119
8117
|
),
|
|
8120
|
-
|
|
8118
|
+
import_fp_ts21.array.compact
|
|
8121
8119
|
),
|
|
8122
8120
|
(res) => new Error(
|
|
8123
8121
|
"Expected a single Stability Pool UTXO.: " + JSON.stringify(res)
|
|
@@ -8130,21 +8128,21 @@ async function findStabilityPoolAccount(lucid, sysParams, owner, iassetName) {
|
|
|
8130
8128
|
type: "Script"
|
|
8131
8129
|
});
|
|
8132
8130
|
return (0, import_cardano_offchain_common23.matchSingle)(
|
|
8133
|
-
|
|
8131
|
+
import_fp_ts21.function.pipe(
|
|
8134
8132
|
spUtxos.map(
|
|
8135
|
-
(utxo) =>
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8133
|
+
(utxo) => import_fp_ts21.function.pipe(
|
|
8134
|
+
import_fp_ts21.option.fromNullable(utxo.datum),
|
|
8135
|
+
import_fp_ts21.option.flatMap(parseAccountDatum),
|
|
8136
|
+
import_fp_ts21.option.flatMap((datum) => {
|
|
8139
8137
|
if ((0, import_lucid46.toHex)(datum.iasset) == (0, import_lucid46.toHex)(iassetName) && (0, import_lucid46.toHex)(datum.owner) == owner) {
|
|
8140
|
-
return
|
|
8138
|
+
return import_fp_ts21.option.some({ utxo, datum });
|
|
8141
8139
|
} else {
|
|
8142
|
-
return
|
|
8140
|
+
return import_fp_ts21.option.none;
|
|
8143
8141
|
}
|
|
8144
8142
|
})
|
|
8145
8143
|
)
|
|
8146
8144
|
),
|
|
8147
|
-
|
|
8145
|
+
import_fp_ts21.array.compact
|
|
8148
8146
|
),
|
|
8149
8147
|
(res) => new Error("Expected a single Account UTXO.: " + JSON.stringify(res))
|
|
8150
8148
|
);
|
|
@@ -8158,21 +8156,21 @@ async function findE2s2sSnapshots(lucid, sysParams, iassetName) {
|
|
|
8158
8156
|
)
|
|
8159
8157
|
)
|
|
8160
8158
|
);
|
|
8161
|
-
return
|
|
8159
|
+
return import_fp_ts21.function.pipe(
|
|
8162
8160
|
spUtxos.map(
|
|
8163
|
-
(utxo) =>
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8161
|
+
(utxo) => import_fp_ts21.function.pipe(
|
|
8162
|
+
import_fp_ts21.option.fromNullable(utxo.datum),
|
|
8163
|
+
import_fp_ts21.option.flatMap(parseSnapshotEpochToScaleToSumDatum),
|
|
8164
|
+
import_fp_ts21.option.flatMap((datum) => {
|
|
8167
8165
|
if ((0, import_lucid46.toHex)(datum.iasset) == (0, import_lucid46.toHex)(iassetName)) {
|
|
8168
|
-
return
|
|
8166
|
+
return import_fp_ts21.option.some({ utxo, datum });
|
|
8169
8167
|
} else {
|
|
8170
|
-
return
|
|
8168
|
+
return import_fp_ts21.option.none;
|
|
8171
8169
|
}
|
|
8172
8170
|
})
|
|
8173
8171
|
)
|
|
8174
8172
|
),
|
|
8175
|
-
|
|
8173
|
+
import_fp_ts21.array.compact
|
|
8176
8174
|
);
|
|
8177
8175
|
}
|
|
8178
8176
|
|
|
@@ -8844,7 +8842,7 @@ var import_lucid48 = require("@lucid-evolution/lucid");
|
|
|
8844
8842
|
// src/contracts/rob/types-new.ts
|
|
8845
8843
|
var import_evolution19 = require("@evolution-sdk/evolution");
|
|
8846
8844
|
var import_cardano_offchain_common25 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
8847
|
-
var
|
|
8845
|
+
var import_fp_ts22 = require("fp-ts");
|
|
8848
8846
|
var RobOrderTypeSchema = import_evolution19.TSchema.Union(
|
|
8849
8847
|
import_evolution19.TSchema.Struct(
|
|
8850
8848
|
{
|
|
@@ -8900,21 +8898,21 @@ var RobRedeemerSchema = import_evolution19.TSchema.Union(
|
|
|
8900
8898
|
);
|
|
8901
8899
|
function parseRobDatum(datum) {
|
|
8902
8900
|
try {
|
|
8903
|
-
return
|
|
8901
|
+
return import_fp_ts22.option.some(
|
|
8904
8902
|
import_evolution19.Data.withSchema(RobDatumSchema, DEFAULT_SCHEMA_OPTIONS).fromCBORHex(
|
|
8905
8903
|
datum
|
|
8906
8904
|
)
|
|
8907
8905
|
);
|
|
8908
8906
|
} catch (_) {
|
|
8909
|
-
return
|
|
8907
|
+
return import_fp_ts22.option.none;
|
|
8910
8908
|
}
|
|
8911
8909
|
}
|
|
8912
8910
|
function parseRobDatumOrThrow(datum) {
|
|
8913
|
-
return
|
|
8911
|
+
return import_fp_ts22.function.pipe(
|
|
8914
8912
|
parseRobDatum(datum),
|
|
8915
|
-
|
|
8913
|
+
import_fp_ts22.option.match(() => {
|
|
8916
8914
|
throw new Error("Expected an ROB datum.");
|
|
8917
|
-
},
|
|
8915
|
+
}, import_fp_ts22.function.identity)
|
|
8918
8916
|
);
|
|
8919
8917
|
}
|
|
8920
8918
|
function serialiseRobDatum(d) {
|
|
@@ -8927,26 +8925,26 @@ function serialiseRobRedeemer(r) {
|
|
|
8927
8925
|
}
|
|
8928
8926
|
function parseRobRedeemer(redeemerCborHex) {
|
|
8929
8927
|
try {
|
|
8930
|
-
return
|
|
8928
|
+
return import_fp_ts22.option.some(
|
|
8931
8929
|
import_evolution19.Data.withSchema(RobRedeemerSchema, DEFAULT_SCHEMA_OPTIONS).fromCBORHex(
|
|
8932
8930
|
redeemerCborHex
|
|
8933
8931
|
)
|
|
8934
8932
|
);
|
|
8935
8933
|
} catch (_) {
|
|
8936
|
-
return
|
|
8934
|
+
return import_fp_ts22.option.none;
|
|
8937
8935
|
}
|
|
8938
8936
|
}
|
|
8939
8937
|
function parseRobRedeemerOrThrow(redeemerCborHex) {
|
|
8940
|
-
return
|
|
8938
|
+
return import_fp_ts22.function.pipe(
|
|
8941
8939
|
parseRobRedeemer(redeemerCborHex),
|
|
8942
|
-
|
|
8940
|
+
import_fp_ts22.option.match(() => {
|
|
8943
8941
|
throw new Error("Expected an ROB redeemer.");
|
|
8944
|
-
},
|
|
8942
|
+
}, import_fp_ts22.function.identity)
|
|
8945
8943
|
);
|
|
8946
8944
|
}
|
|
8947
8945
|
|
|
8948
8946
|
// src/contracts/rob/helpers.ts
|
|
8949
|
-
var
|
|
8947
|
+
var import_fp_ts23 = require("fp-ts");
|
|
8950
8948
|
var import_ts_pattern19 = require("ts-pattern");
|
|
8951
8949
|
var import_cardano_offchain_common26 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
8952
8950
|
var import_decimal = __toESM(require("decimal.js"));
|
|
@@ -9071,9 +9069,9 @@ function isFullyRedeemed(robAssets, robOrderType, robIasset) {
|
|
|
9071
9069
|
}).exhaustive();
|
|
9072
9070
|
}
|
|
9073
9071
|
function buildRedemptionsTx(redemptions, iasset, collateralAsset, price, redemptionReimbursementRatio, sysParams, tx, txOutputsBeforeCount, collateralAssetRefInputIdx, iassetRefInputIdx, oracleIdx) {
|
|
9074
|
-
return
|
|
9072
|
+
return import_fp_ts23.function.pipe(
|
|
9075
9073
|
redemptions,
|
|
9076
|
-
|
|
9074
|
+
import_fp_ts23.array.reduceWithIndex(
|
|
9077
9075
|
tx,
|
|
9078
9076
|
(idx, acc, [robUtxo, payoutAmt]) => {
|
|
9079
9077
|
const robDatum = parseRobDatumOrThrow(getInlineDatumOrThrow(robUtxo));
|
|
@@ -9107,12 +9105,12 @@ function buildRedemptionsTx(redemptions, iasset, collateralAsset, price, redempt
|
|
|
9107
9105
|
);
|
|
9108
9106
|
return [resultVal, 0n];
|
|
9109
9107
|
}).with({ SellIAssetOrder: import_ts_pattern19.P.select() }, (content) => {
|
|
9110
|
-
const allowedAssetIdx =
|
|
9108
|
+
const allowedAssetIdx = import_fp_ts23.function.pipe(
|
|
9111
9109
|
content.allowedCollateralAssets,
|
|
9112
|
-
|
|
9110
|
+
import_fp_ts23.readonlyArray.findIndex(
|
|
9113
9111
|
([asset, _]) => (0, import_cardano_offchain_common26.isSameAssetClass)(asset, collateralAsset)
|
|
9114
9112
|
),
|
|
9115
|
-
|
|
9113
|
+
import_fp_ts23.option.getOrElse(() => {
|
|
9116
9114
|
throw new Error("Doesn't allow required collateral asset.");
|
|
9117
9115
|
})
|
|
9118
9116
|
);
|
|
@@ -9173,26 +9171,26 @@ function buildRedemptionsTx(redemptions, iasset, collateralAsset, price, redempt
|
|
|
9173
9171
|
);
|
|
9174
9172
|
}
|
|
9175
9173
|
function calculateTotalCollateralForRedemption(iasset, collateralAsset, iassetPrice, allRobs, maxRobsInTx) {
|
|
9176
|
-
return
|
|
9174
|
+
return import_fp_ts23.function.pipe(
|
|
9177
9175
|
allRobs,
|
|
9178
|
-
|
|
9176
|
+
import_fp_ts23.array.filterMap(([utxo, datum]) => {
|
|
9179
9177
|
const isCorrectOrder = (0, import_ts_pattern19.match)(datum.orderType).returnType().with(
|
|
9180
9178
|
{ BuyIAssetOrder: import_ts_pattern19.P.select() },
|
|
9181
9179
|
(content) => (0, import_cardano_offchain_common26.isSameAssetClass)(content.collateralAsset, collateralAsset) && rationalToFloat(content.maxPrice) >= rationalToFloat(iassetPrice) && !isBuyOrderFullyRedeemed(utxo.assets, datum.orderType, iassetPrice)
|
|
9182
9180
|
).otherwise(() => false);
|
|
9183
9181
|
if ((0, import_lucid48.toHex)(datum.iasset) !== (0, import_lucid48.toHex)(iasset) || !isCorrectOrder) {
|
|
9184
|
-
return
|
|
9182
|
+
return import_fp_ts23.option.none;
|
|
9185
9183
|
}
|
|
9186
9184
|
const collateralToSpend = robCollateralAmtToSpend(
|
|
9187
9185
|
utxo.assets,
|
|
9188
9186
|
datum.orderType
|
|
9189
9187
|
);
|
|
9190
|
-
return
|
|
9188
|
+
return import_fp_ts23.option.some(collateralToSpend);
|
|
9191
9189
|
}),
|
|
9192
9190
|
// From largest to smallest
|
|
9193
|
-
|
|
9191
|
+
import_fp_ts23.array.sort(import_fp_ts23.ord.reverse(BigIntOrd)),
|
|
9194
9192
|
// We can fit only this number of redemptions with CDP open into a single Tx.
|
|
9195
|
-
|
|
9193
|
+
import_fp_ts23.array.takeLeft(maxRobsInTx),
|
|
9196
9194
|
sum
|
|
9197
9195
|
);
|
|
9198
9196
|
}
|
|
@@ -9201,9 +9199,9 @@ function randomRobsSubsetSatisfyingTargetCollateral(iasset, collateralAsset, tar
|
|
|
9201
9199
|
throw new Error("Must redeem and payout more than 0.");
|
|
9202
9200
|
}
|
|
9203
9201
|
const shuffled = randomiseFn(
|
|
9204
|
-
|
|
9202
|
+
import_fp_ts23.function.pipe(
|
|
9205
9203
|
allLrps,
|
|
9206
|
-
|
|
9204
|
+
import_fp_ts23.array.filter(
|
|
9207
9205
|
([utxo, datum]) => (0, import_lucid48.toHex)(datum.iasset) === (0, import_lucid48.toHex)(iasset) && (0, import_ts_pattern19.match)(datum.orderType).with(
|
|
9208
9206
|
{ BuyIAssetOrder: import_ts_pattern19.P.select() },
|
|
9209
9207
|
(content) => (0, import_cardano_offchain_common26.isSameAssetClass)(collateralAsset, content.collateralAsset) && rationalToFloat(content.maxPrice) >= rationalToFloat(iassetPrice)
|
|
@@ -9241,10 +9239,10 @@ function randomRobsSubsetSatisfyingTargetCollateral(iasset, collateralAsset, tar
|
|
|
9241
9239
|
result = insertSorted(
|
|
9242
9240
|
result,
|
|
9243
9241
|
element,
|
|
9244
|
-
|
|
9242
|
+
import_fp_ts23.ord.contramap(
|
|
9245
9243
|
([utxo, dat]) => robCollateralAmtToSpend(utxo.assets, dat.orderType)
|
|
9246
9244
|
// From highest to lowest
|
|
9247
|
-
)(
|
|
9245
|
+
)(import_fp_ts23.ord.reverse(BigIntOrd))
|
|
9248
9246
|
);
|
|
9249
9247
|
runningSum += lovelacesToSpend;
|
|
9250
9248
|
if (result.length > maxLrpsInTx) {
|
|
@@ -9281,8 +9279,7 @@ function castRobParams(params) {
|
|
|
9281
9279
|
|
|
9282
9280
|
// src/contracts/rob/transactions.ts
|
|
9283
9281
|
var import_lucid50 = require("@lucid-evolution/lucid");
|
|
9284
|
-
var
|
|
9285
|
-
var import_Array2 = require("fp-ts/lib/Array");
|
|
9282
|
+
var import_fp_ts24 = require("fp-ts");
|
|
9286
9283
|
var import_cardano_offchain_common27 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
9287
9284
|
var import_ts_pattern20 = require("ts-pattern");
|
|
9288
9285
|
async function openRob(assetTokenNameAscii, depositAmt, orderType, lucid, sysParams, robStakeCredential) {
|
|
@@ -9362,7 +9359,7 @@ async function redeemRob(redemptionRobsData, priceOracleOutRef, iassetOutRef, co
|
|
|
9362
9359
|
const collateralAssetDatum = parseCollateralAssetDatumOrThrow(
|
|
9363
9360
|
getInlineDatumOrThrow(collateralAssetUtxo)
|
|
9364
9361
|
);
|
|
9365
|
-
const [robsToRedeemOutRefs, robRedemptionIAssetAmt] =
|
|
9362
|
+
const [robsToRedeemOutRefs, robRedemptionIAssetAmt] = import_fp_ts24.array.unzip(redemptionRobsData);
|
|
9366
9363
|
const [adjustedPrice, _] = await retrieveAdjustedPrice(
|
|
9367
9364
|
iassetDatum.assetName,
|
|
9368
9365
|
collateralAssetDatum.collateralAsset,
|
|
@@ -9373,7 +9370,7 @@ async function redeemRob(redemptionRobsData, priceOracleOutRef, iassetOutRef, co
|
|
|
9373
9370
|
sysParams.pythConfig,
|
|
9374
9371
|
lucid
|
|
9375
9372
|
);
|
|
9376
|
-
const redemptionRobs = await lucid.utxosByOutRef(robsToRedeemOutRefs).then((val) =>
|
|
9373
|
+
const redemptionRobs = await lucid.utxosByOutRef(robsToRedeemOutRefs).then((val) => import_fp_ts24.array.zip(val, robRedemptionIAssetAmt));
|
|
9377
9374
|
const allRefInputs = [robScriptRefUtxo, iassetUtxo, collateralAssetUtxo];
|
|
9378
9375
|
const tx = lucid.newTx();
|
|
9379
9376
|
const { interval, referenceInputs } = await attachOracle(
|
|
@@ -9449,9 +9446,9 @@ async function adjustRob(lucid, robOutRef, adjustmentAmt, newLimitPrice, sysPara
|
|
|
9449
9446
|
const reward = (0, import_cardano_offchain_common27.assetClassValueOf)(robUtxo.assets, iassetAc);
|
|
9450
9447
|
return [buyContent.collateralAsset, (0, import_cardano_offchain_common27.mkAssetsOf)(iassetAc, reward)];
|
|
9451
9448
|
}).with({ SellIAssetOrder: import_ts_pattern20.P.select() }, (content) => {
|
|
9452
|
-
const reward =
|
|
9449
|
+
const reward = import_fp_ts24.function.pipe(
|
|
9453
9450
|
content.allowedCollateralAssets,
|
|
9454
|
-
|
|
9451
|
+
import_fp_ts24.readonlyArray.reduce(
|
|
9455
9452
|
{},
|
|
9456
9453
|
(acc, [asset, _]) => {
|
|
9457
9454
|
const amt = (0, import_cardano_offchain_common27.assetClassValueOf)(robUtxo.assets, asset) - // in case of ADA, the min has to stay.
|
|
@@ -9489,12 +9486,12 @@ async function adjustRob(lucid, robOutRef, adjustmentAmt, newLimitPrice, sysPara
|
|
|
9489
9486
|
return {
|
|
9490
9487
|
SellIAssetOrder: {
|
|
9491
9488
|
allowedCollateralAssets: content.allowedCollateralAssets.map(
|
|
9492
|
-
(entry) =>
|
|
9489
|
+
(entry) => import_fp_ts24.function.pipe(
|
|
9493
9490
|
newPrices,
|
|
9494
|
-
|
|
9491
|
+
import_fp_ts24.array.findFirst(
|
|
9495
9492
|
(newPrice) => (0, import_cardano_offchain_common27.isSameAssetClass)(newPrice[0], entry[0])
|
|
9496
9493
|
),
|
|
9497
|
-
|
|
9494
|
+
import_fp_ts24.option.match(
|
|
9498
9495
|
() => entry,
|
|
9499
9496
|
(newPrice) => [
|
|
9500
9497
|
entry[0],
|
|
@@ -9559,7 +9556,7 @@ var mkRobValidatorFromSP = (params) => {
|
|
|
9559
9556
|
var import_lucid52 = require("@lucid-evolution/lucid");
|
|
9560
9557
|
|
|
9561
9558
|
// src/contracts/rob-leverage/helpers.ts
|
|
9562
|
-
var
|
|
9559
|
+
var import_fp_ts25 = require("fp-ts");
|
|
9563
9560
|
var import_decimal2 = require("decimal.js");
|
|
9564
9561
|
var MAX_REDEMPTIONS_WITH_CDP_OPEN = 4;
|
|
9565
9562
|
function approximateLeverageRedemptions(baseCollateral, targetLeverage, redemptionReimbursementRatio, debtMintingFeeRatio) {
|
|
@@ -9585,9 +9582,9 @@ function approximateLeverageRedemptions(baseCollateral, targetLeverage, redempti
|
|
|
9585
9582
|
};
|
|
9586
9583
|
}
|
|
9587
9584
|
function summarizeActualLeverageRedemptions(lovelacesForRedemptionWithReimbursement, redemptionReimbursementRatio, iassetPrice, redemptionLrps) {
|
|
9588
|
-
const redemptionDetails =
|
|
9585
|
+
const redemptionDetails = import_fp_ts25.function.pipe(
|
|
9589
9586
|
redemptionLrps,
|
|
9590
|
-
|
|
9587
|
+
import_fp_ts25.array.reduce(
|
|
9591
9588
|
{
|
|
9592
9589
|
remainingCollateralToSpend: lovelacesForRedemptionWithReimbursement,
|
|
9593
9590
|
redemptions: []
|
|
@@ -9641,9 +9638,9 @@ function summarizeActualLeverageRedemptions(lovelacesForRedemptionWithReimbursem
|
|
|
9641
9638
|
}
|
|
9642
9639
|
)
|
|
9643
9640
|
);
|
|
9644
|
-
const res =
|
|
9641
|
+
const res = import_fp_ts25.function.pipe(
|
|
9645
9642
|
redemptionDetails.redemptions,
|
|
9646
|
-
|
|
9643
|
+
import_fp_ts25.array.reduce(
|
|
9647
9644
|
{
|
|
9648
9645
|
redeemedCollateral: 0n,
|
|
9649
9646
|
payoutIAssets: 0n,
|
|
@@ -10147,7 +10144,7 @@ var mkIAssetValidatorFromSP = (params) => {
|
|
|
10147
10144
|
var import_ts_pattern21 = require("ts-pattern");
|
|
10148
10145
|
|
|
10149
10146
|
// tests/test-helpers.ts
|
|
10150
|
-
var
|
|
10147
|
+
var import_fp_ts26 = require("fp-ts");
|
|
10151
10148
|
async function runAndAwaitTxBuilder(lucid, transaction, extraSigners = []) {
|
|
10152
10149
|
const bTx = await transaction.complete();
|
|
10153
10150
|
const signatures = [await bTx.partialSign.withWallet()];
|
|
@@ -10583,7 +10580,7 @@ function castStableswapParams(params) {
|
|
|
10583
10580
|
var _stableswapValidator = {
|
|
10584
10581
|
type: "PlutusScriptV3",
|
|
10585
10582
|
description: "Generated by Aiken",
|
|
10586
|
-
cborHex: "5923e65923e3010100229800aba4aba2aba1aba0aab9faab9eaab9dab9cab9a488888888a60022a660049201343c65787065637465643e2054686520646174756d2069732074686520737461626c657377617020706f6f6c20636f6e74656e742e00168a99801249233c65787065637465643e204d7573742068617665206120706f6f6c20636f6e74656e7400168a99801249333c65787065637465643e2054686520706f6f6c206d75737420686176652074686520636f72726563742072656465656d65722e00168a99801249333c65787065637465643e20546865206d61696e206f72646572206861732074686520636f72726563742072656465656d65722e00168a998012491e3c65787065637465643e204f7264657220697320746f6f20736d616c6c2e00168a998012491d3c65787065637465643e2053696e676c6520706f6f6c20696e7075742e001648888896600264653001300f00198079808000cdc3a4005300f00248889660026004601e6ea800e3300130103754007370e90034dc3a4011370e90024dc3a4001300f37540089111111991192cc004c0140122b30013019375401b0018b20348acc004c02c012264646644b30013021003802c5901e1bad301e001375a603c004603c00260326ea80362b300130060048acc004c064dd5006c0062c80d22b300130080048acc004c064dd5006c0062c80d22b300130070048acc004c064dd5006c0062c80d22c80b1016202c405880b06600246038603a603a603a603a603a603a603a603a0032301c301d00191119199119801001000912cc004006007132325980099b910060018acc004cdc7803000c4dd69810001401501d44cc010010c09000d01d1bae301e0013021001407c64646600200200c44b3001001801c4c8c96600266e440200062b30013371e0100031375660420050054079133004004302500340786eb8c07c004c0880050200a5eb7bdb18052000911919800800801912cc004006297ae0899912cc004c01400a26604000466008008003133004004001406c603e002604000280ea6e21200092cc004c018c060dd5000c4c070c064dd5000c5901648c070c074c074c074c07400646038603a603a603a603a603a603a603a603a603a003370290004dd2a40012598009802980c1baa001891919baf301e301b3754603c60366ea8008004c074c068dd5001448c8cdd7980f180d9baa002001301d301a375400480b246038603a603a0032301c301d301d301d0019baf4c103d87a8000912cc004006200315330180021001405d222332233004337046eb4c080008dd69810181080099b82375a60400026eb4c080c084008c06cdd5001980d9baa0019ba54800a602e6ea80326e9520049b89480112222222222222222222298009119198008009bac3017302f375400644b30010018a508acc004cdc79bae30330010038a51899801001181a000a05a40c52232330010010032259800800c5a264b30013375e606860626ea80040122603060626ea8006266006006606a0048170c0cc0050314888c8cc0540108c008c060c0c4dd5000acc004c06cc0b8dd5000c48c08a60026eacc05cc0c0dd5000cdd7181998181baa0039bae30173030375400680b224602930013756602e60606ea80066eb8c0ccc0c0dd5001cdd7180b98181baa00340588162464b3001301a302d375400313031302e3754003153302c491263c65787065637465643e2044656e6f6d696e61746f722063616e6e6f74206265207a65726f2e001640ac6644b3001301b0018a6103d87a80008acc004cdc4000a40011300e33031300e330313750601e004660626ea0c03c0052f5c097ae089807198189807198189ba800233031375000297ae04bd70205840b06eb4c0c0c0b4dd50009bad3014302d375400322233229800992cc004c078c0c4dd5000c4dd69819181a9bab30353032375400314800102f181a000cdd58014dd7981a181a800c8966002604a60646ea8016266e2400400a2b30013371200200513371200466e0000520809bee028a5040c08181222259800801c566002600400d13300100448002294103244c96600266ebd30101400030350018acc004cc008014dd6981b181c9bab3036001898019ba6303a0048a5040cd15980099801002a4001130030078a5040cc8198c0e000d0360dd3001194c004006009223303400233034374c00297ae04004444b3001002899800a6103d87a80004bd6f7b63044c8cc896600266e452201000028acc004cdc7a44100002899802180a1981b981a801a5eb80006266008980103d87a800000540c9198008034006446600c0046607200a00280310321bae30320013037003303500240cd2300c3302f37500026605e98010101004bd70488c8c8cc00400400c88c96600266ebc010c0c400626064003133003003303600240bc6068002600c6606000497ae048888888c96600260460171323259800acc004c088c0d4dd500fc5284528a0668992cc00400605d13259800981e00144c96600200315980099b8748040c0e0dd5000c4c9660020030348992cc00400606b03581ac4c966002608000713259800800c566002605e60786ea8006264b300100181cc4c9660020031598009821801466002003132598009816181f9baa00189919912cc00400a2b300130353042375400513259800800c102264b30010018acc004c12400a330010018acc004cc07d2401155369676e656420627920666565206d616e6167657200330190360038acc004cc8966002660429201274d696e74696e672066656520726174696f206973206265747765656e205b30252c20313030255d0059800cc005300106d8799f0001ff009119b8900200180120408cc00400a4466e24008006602c900120408a50411113302149012a526564656d7074696f6e2066656520726174696f206973206265747765656e205b30252c20313030255d0059800cc005300106d8799f0001ff009119b89002001800a0408cc0040064466e24008006602c900120408a50411114a08220c058c084c114dd5000980b181398229baa00189980fa4916537461626c657377617020706f6f6c206f7574707574009800802cc074cc11cc120c114dd5181618229baa00e4bd704c06ccc11cc074cc11cc8c8c8c09ccc128c12c00ccc128c12c008cc128c12c004cc128c090c120dd500219825181518241baa004304c304c304c001304b001304a0013045375400e97ae04bd704dd5981618229baa302c3045375401d4c103d8798000404914a082122941042410501041050464106083041820a0943047001411460866ea800a07e820207f03f81fc0fd0481812180f18209baa001375c608860826ea8008c10cdd6180e98201baa0318a9981f24812a3c65787065637465643e2054686520666565206d616e61676572206d75737420686176652076616c7565001640f460846086608660866086608660866086607e6ea80060748052074820207503a81d40e90441820800a07e303d375400303840e903881c40e20708210c07cc064c0f0dd51811981e1baa00581b207a375a0030354100607a00281d8c0e4dd5000c0cd03640ce067033819a07c33006303b303837540026eacc064c0e0dd5014c0bd039181d000a07098009bac30393036375404f301d3036375407b4c103d879800040211533034491203c65787065637465643e20446174756d206d757374206265204e6f446174756d001640cc444b300130243037375400713259800800c00a264b3001001801c00e007003899912cc00400600b13259800800c4c9660020030078992cc004006264b3001001804c4c96600200313259800800c02e264b30010018992cc00400601b13259800800c4c966002608c003159800980d9822800c03e26644b3001001808c4c966002003132598009825000c566002603e6092003013899912cc00400602b13259800800c4c9660020030178992cc00400603101880c44cc896600200301a8992cc00400603701b80dc4cc896600200301d8992cc00400603d01e80f407a264b3001305a0038acc004c108c154dd500d44c9660020030208992cc004006043021810c08626644b3001001811c4c9660020030248124092049132598009830001c6600203d1980080e466002035132598009824800c4c9660020030278992cc00400605102881440a2264b3001306400381540a50611bae001419060c200282f8c174dd5008c566002609e003159800982e9baa011813c09905e409905a20b4305b375402102540a102540a102540a102541746eb8005060182e800a0b6375c00260b800482e8c168005058182b1baa01a80fa0a680fa0ae375c00282d0c15c0050551bad001305600280da0ae305400141486eb4004c14c00a03082a0c14400504f1828801405a02d01680b20a4304f001413460786092002609c006823a0268258dd5000c04a025012809209c304b00141246070608a0026094006821a01e8238dd5000c03a01d00e807209430470014114608e00500c80640320188240c1140050431822801402a01500a805208c30430014104608600500880440220108220c10400503f1820801401a00d0068032084303f00140f46eb8004c0f800903f181e000a0743038375400700140d4444b300130233036375400713259800800c00a264b3001001801c00e0071332259800800c016264b3001001803401a00d132598009820801c02200e81f0dd6800c019041181f000a078375a002607a00500340f8607600281c8c0dcdd5001c005034456600260440171323322598009814981b1baa001899912cc004c0f4006264b30013026303937540031323322598009820800c4c8cc004004dd61820801112cc004006264b3001302c303f3754003132324a2b30013233001001300d3756604860846ea80cc896600266e3cdd71823000801c528c4cc008008c11c00504045268b207c375c608660806ea80062c81e8c8cc004004dd6181398201baa0072259800800c530103d87a80008992cc0066002603a0034a14a281fa2003133003003304600240fc64b30013371e6eb8c11400402e2604266088608a608c00297ae08a6103d87a800040fc6eb0c11000504244c8c8cc8966002608e00713300600630470058b2088375c60880026eb8c110008c110004dd61821000a0808b207c375a607c002607e00260746ea80062c81b8c070c058c0e4dd51810181c9baa303c0018b2074375c6074606e6ea800660026eb0c078c0dcdd50144c050c0dcdd501f530103d879800040251640d060020026070606a6ea8c0e0c0d4dd5198041bac30383035375404c03e44b30010018a5eb82266070606a607200266004004607400281ba2b300130203033375403b19800981b981a1baa01d91192cc004c08c00626464b3001303d00280245903a1bae303b001303737540071598009814800c4c8c966002607a0050048b2074375c6076002606e6ea800e2c81a1034181a9baa002912cc004c088c0d4dd500144c8c8cc8966002607c0070058b2076375c60760026eb8c0ec008c0ec004c0d8dd5001459033489660026044606a6ea800a264646644b3001303e003802c5903b1bad303b001375a60760046076002606c6ea800a2c819922223233001005132598009813000c66002446607c66ec0dd48011ba80014bd6f7b630488cc88c074cc100dd419b82375a60820046eb4c104004cc100dd419b82375a608260840046eb4c104c1080052f5c060786ea8008c0f0dd5000c88cc0840088cdd79820181e9baa3040303d37546048607a6ea800400a4607c607e607e607e607e607e607e003232337066eb4c0fc004dd6981f9820000981d9baa0019181f181f981f981f981f981f800c8966002605060766ea800a260246607c607e60786ea80092f5c1130123303e374e6607c98011150496e6469676f537461626c6573776170003303e0014bd7025eb810394a600200348900a44100408598009bac303d303a37540573021303a37540834c0103d879800040309111111114c004888966002606600310048991919800800803112cc00400626609866ec0dd48031ba60034bd6f7b63044c8cc896600266e4402400a2b30013371e0120051325980099baf4c101a000374c003100289982819bb037520146e9800400904b19198008009bab304e0042259800800c4cc144cdd81ba900a375001297adef6c6089919912cc004cdc8806801456600266e3c03400a264b30013370e002606601b100289982a99bb0375201c6ea0cdc000080680120a0375a60a4007133054337606ea4034dd4006002209e89982a00199802802800a09e375c609e00260a800460a4002828226609e66ec0dd48049ba6006004412913304f0033300500500141286eb8c128004c13c008c13400504b19806801000a0889112cc004c0c8006297adef6c6089982419bb037520066e98cc0300080052f5bded8c0821a4464b300130383045375400314c103d87a8000898129982419805801982498231baa0014bd7020863233225980099b88002480022604e66094604e660946ea0c0a0004cc128dd4181400125eb812f5c1159800981600144c09ccc128c09ccc128dd4000998251ba80024bd7025eb82298103d87a800041148228dd698248009bad3049304a00130453754003225980099b89001480022900044c01ccc028c0500040090422444464b300100681fc4c966002609a00f15980099baf304c30493754609860926ea8c0c0c124dd5000981099825981298249baa0504bd7044c96600266e1d201030493754003132598009827800c4cc8966002607e60986ea8006264b30013052001899192cc004c0f0c13cdd500144c8c8c8c8c8c8c8c8c8c8ca60026eb8c1780066eb8c17802e60bc013305e008982f003cc96600260b80031598009818982d800c5a2609c60b600282ca2c82e8dd5182f0034c96600260b80031598009818982d800c5a2609c60b600282ca2c82e8dd5182f002cc1780126eb4c17800e6eb4c1780092222222222598009834805c4cc0bcc1a00504cc0b80204cc0b801c4cc0b80184c96600260a40031323259800983600140662c8348dd7183500098331baa0048acc004c1600062b3001306637540090178b20ce8b20c6418c60c86ea800e2c833060bc00260ba00260b800260b600260b400260b200260b000260ae00260ac00260aa00260a06ea800a2c82684c8c8c8c8c8c8c8cc896600266064921274e6f7420656e6f75676820636f6c6c61746572616c20617373657420696e2074686520706f6f6c0033712607000330013756607e60b06ea8c0fcc160dd50084dd7182d982c1baa303f30583754015375c607e60b06ea8c0fcc160dd5005207c8acc004cc0c92411957726f6e67206d696e7465642f6275726e65642076616c7565003375e6e9a60026eb8c16cc160dd502fcdd7182d982c1baa02499b80337026eb4c16c010dd6982d8030012028303a305837540931598009981924811c57726f6e672061646465642f72656465656d656420746f20706f6f6c009800982d9bac30353058375409330303305a305b30583754607e60b06ea80412f5c1303530583754607e60b06ea804330013756607e60b06ea8c0fcc160dd50084dd7182d982c1baa303f30583754015375c607e60b06ea8c0fcc160dd500540050155300103d8798000409513303249011b57726f6e672070616964206665657320746f2074726561737572790098009bac305b305837540933758606a60b06ea81266eacc0e4c160dd5024cdd7181d182c1baa05f9982d181b9982d182d982c1baa05f3305a305b3058375401497ae03305a375066e00008dd6982d982e001a5eb8260b660b06ea8041222222323298009bad30630019bad3063306400198318012444b30013047003899192cc00400626530013044001cc00660026eb8c1a4c198dd50024dd7182698331baa0048032044a4500a44100802a046981e1983418229983426103d87a8000330680094bd7025eb8122232330010010112259800800c528456600264b300130060018acc004cdd7982498361baa0010048acc00660026eacc14cc1b0dd5000c016980103d87a800040f1130473048306c375400314a0834a2941069452820d2306e0018a518998010011837800a0d041b03044330670024bd70456600260d2003132332259800982a000c56600260d06ea800e0051641a5159800982d000c56600260d06ea800e0051641a5159800982a800c56600260d06ea800e0051641a5159800982b800c56600260d06ea800e0051641a5159800982b000c4c8c8c8ca600260de003375a60de007375a60de0049112cc004c1cc01226607260e400e2b3001305b306e375400713232332259800983b801c0362c83a0dd6983a0009bae30740023074001306f37540071641b11641c0306f001306e001306d0013068375400715980099b87480280062b3001306837540070028b20d28b20ca4194832906520ca4194266ebc004cdd2a4010660d0008660d06ea0018cc1a0dd400299834004a5eb80c194dd500099819983418329baa306800100b8b20cc4198660500180026076660ca6ea40212f5c114a2830060c600264b30015980099b89001480022942294105c44cc18530106d8799f4040ff00330614c1010000330614c10100004bd7044cc184c18800ccc184dd400099830a610100004bd7020b8375a60c260c40048a50415514a082aa29410551bad3059001337026eb4c164014dd6982c801982c800982c000982b800982b000994c0040066602c6eb0c154c148dd5021982a98291baa3055305237546604a6eb0c154c148dd502181e4cc151301010000330544c1010000330544c1010000330544c1010000330544c1010000330544c101000033054374e60ac6eb0c0bcc148dd5021a5eb810011112cc00400a200319800801cc16000a66453001305a0019bad30590019bab303d30563754607a60ac6ea800a6072606660ac6ea8c0f4c158dd5001244446464653001375a60c0003375860c060c2003375a60c0015375a60c000f375a60c0007375a60c0004911111198158050992cc004c1a0006264653001375c60d2003375a60d260d4003375c60d20049112cc0056600266e3cdd7183618349baa01b375c60d860d26ea8042266ebcc140c1a4dd500d982818349baa0108a504199198009836005cc1b402e6074605860d26ea804122259800acc0056600266e3c010dd7183798361baa3053306c375402713371e00c6eb8c14cc1b0dd5182998361baa0138a5041a514a3159800acc004cdc78021bae306f306c37540e713371e00c6eb8c1bcc1b0dd5009c52820d28a508a9983524811457726f6e6720737570706c696564206173736574001641a4834a26644646644b3001306330703754606460e26ea808e2b3001337126eb4c164c1c4dd5011805456600330010049119b8900200180320948acc0066002011304933073304d3071375403097ae099818982998389baa01830743071375403b9800981519b813030375660b060e26ea8c160c1c4dd500e9bad303230713754031375c60e860e26ea81e26eb8c1d0c1c4dd500c400902e5300103d87a800040f9133073375066e00048004cc1ccdd400d198399ba801133073375066e00040008cc1ccdd419b8000f003330733750028660e66e9c01d2f5c1153306f4913b3c65787065637465643e204d696e74656420616d6f756e742077726f6e676c792073656e7420746f206f726465722064657374696e6174696f6e2e001641b9153306f491383c65787065637465643e20506f6f6c206d696e74696e67206665652065786365656473206f72646572206d61782066656520726174696f2e001641b906941b9153306f4901223c65787065637465643e204d696e74696e67206973206e6f7420656e61626c65642e001641b866e0400c0056600203f1008899192cc004c174c1c0dd5000c56600330013370e606660e860e26ea800401694294506e4402a200483722c8370cc0acc0fc004084c0c4cc0d0c0f800c08106c198140008012cc004072200b13259800982c98361baa00189817983818369baa0018b20d433027303b00501d41a4607a609060d86ea807a26464646464b3001306330703754606860e26ea808e2b3001337126eb4c148c1c4dd5011805456600330010059119b8900200180320948acc0066002011304933073304d3071375403097ae099818982998389baa01830743071375403b9800981519b813030375660b060e26ea8c160c1c4dd500e9bad303230713754031375c60e860e26ea8c160c1c4dd5011cdd7182c18389baa30583071375404700240b94c103d87a800040f91330733750024660e66ea0cdc000d000998399ba833700022004660e66ea0040cc1ccdd4007998399ba833700028008660e66e9c01d2f5c1153306f4913d3c65787065637465643e2052656465656d656420616d6f756e742077726f6e676c792073656e7420746f206f726465722064657374696e6174696f6e2e001641b9153306f4913b3c65787065637465643e20506f6f6c20726564656d7074696f6e206665652065786365656473206f72646572206d61782066656520726174696f2e001641b906941b9153306f4901243c65787065637465643e2052656465656d696e67206973206e6f7420656e61626c65642e001641b8b3001020880144c96600260ba60e06ea8006264b3001980099b873034330373041001023003a50a5141bd10048800a0de30333074307137540031641b866056607e00204283696600203f1001898189981a181f00081020d83370200e0026604e00200c607a609c60d86ea807906922a660ce9212b3c65787065637465643e2057726f6e67206f72646572203c3e20706f6f6c20636f6d62696e6174696f6e2e001641983069001375860ce0031641946466002002646600200201a44b30010018a5eb7bdb1822646644b3001337229101000028acc004cdc7a441000028800c401106644cc1ac00ccc0140140050661bae3066001306b0023069001419c44b30010018a5eb82264664466446600400400244b30010018801c4c8cc1b4dd3998369ba90053306d306a0013306d306b0014bd701980180198378011836800a0d6375660d00066eb8c194004cc00c00cc1a8008c1a00050660c180004c17c004c17801060ae00460b000280190551815999119912cc004cdc4001000c5300103d87980008acc004cdc40008014530103d87b80008a6103d87a800041448288cdc11bad3055002375a60aa60ac00266e08dd6982a8009bad305530560023050375400260a06ea8c07d20023020302c304f375400260a200316413c609a6ea80062c8250dd698270009817181418259baa3032304b375400716413060946ea80062c8238cc05cc130c124dd50009bab302a3049375407515330474911a3c65787065637465643e204d697865642076657273696f6e732e001641190404128609600c8248a600291100a44100800a00822b3001302c0018991991192cc004cdd79820981f1baa00102889919912cc00400a2b3001302d3040375400515980098209baa00289980da4811057726f6e67206d61696e206f72646572003375e608860826ea8c110c104dd5181418209baa00300181d208481d207c81d40ea07503a41186601a6084607e6ea8004dd59810181f9baa0303042303f37546084607e6ea8c098c0fcdd5001198019bac3041303e375405e6eb4c104c10800a2a66078921413c65787065637465643e205468652070726f766964656420696e70757420696e64657820636f72726573706f6e647320746f20746865206f776e20696e7075742e001640ec660046eb0c100c0f4dd50171bad30400013001001303b375405e444b300130120018cc00400e60826082005337000029001a0068acc004cdc4a400400319800801cc10400a66e000052001400d1598009814800c4c10000a2a66076921146578706563745f61743a206e6f7420666f756e64001640e881d103a4566002604e0031330144911854782069736e2774207369676e6564206279206f776e6572003300e02b375c602e60746ea801a2a6607092010452646d72001640dc81b9037181c1baa02d22598009813181c9baa0028991919191919194c004c1100066eb8c11001e6eb8c110016608800930440039bad3044002488888966002609600f133011304a00c13259800981a18239baa00489919192cc004c13c00a26602c609c006264b300130380018992cc004c14400626464b3001303b0018992cc004c15000626603660a6002013164144609e6ea800a2b3001304100189919194c004dd6982a800cdd6982a801cdd6982a8012444b300130590048074590560c154004c150004c13cdd500145904c2098304d375400260a000316413860986ea800a2b3001303e0018acc004c130dd500140162c826a2c824904918251baa0018b2098304d001304d0013048375400916411426644b30013035001899192cc004c13c00a009164130609a00260926ea80122b3001303b0018acc004c124dd5002400a2c82522c823104609980800300718231baa0028b209018220009821800982100098208009820000981f800981d1baa0028b206e459031206240c444444b3001330160040058acc004cdd7980a981c1baa0050038acc00660026eacc07cc0e0dd5002c00a002804226026602860706ea801629410354528206a8a5040d4180c803180c980d00322c8068601e00260146ea804229344d9590071"
|
|
10583
|
+
cborHex: "59240d59240a010100229800aba4aba2aba1aba0aab9faab9eaab9dab9cab9a488888888a60022a660049201343c65787065637465643e2054686520646174756d2069732074686520737461626c657377617020706f6f6c20636f6e74656e742e00168a99801249233c65787065637465643e204d7573742068617665206120706f6f6c20636f6e74656e7400168a99801249333c65787065637465643e2054686520706f6f6c206d75737420686176652074686520636f72726563742072656465656d65722e00168a99801249333c65787065637465643e20546865206d61696e206f72646572206861732074686520636f72726563742072656465656d65722e00168a998012491e3c65787065637465643e204f7264657220697320746f6f20736d616c6c2e00168a998012491d3c65787065637465643e2053696e676c6520706f6f6c20696e7075742e001648888896600264653001300f00198079808000cdc3a4005300f00248889660026004601e6ea800e3300130103754007370e90034dc3a4011370e90024dc3a4001300f37540089111111991192cc004c0140122b30013019375401b0018b20348acc004c02c012264646644b30013021003802c5901e1bad301e001375a603c004603c00260326ea80362b300130060048acc004c064dd5006c0062c80d22b300130080048acc004c064dd5006c0062c80d22b300130070048acc004c064dd5006c0062c80d22c80b1016202c405880b06600246038603a603a603a603a603a603a603a603a0032301c301d00191119199119801001000912cc004006007132325980099b910060018acc004cdc7803000c4dd69810001401501d44cc010010c09000d01d1bae301e0013021001407c64646600200200c44b3001001801c4c8c96600266e440200062b30013371e0100031375660420050054079133004004302500340786eb8c07c004c0880050200a5eb7bdb18052000911919800800801912cc004006297ae0899912cc004c01400a26604000466008008003133004004001406c603e002604000280ea6e21200092cc004c018c060dd5000c4c070c064dd5000c5901648c070c074c074c074c07400646038603a603a603a603a603a603a603a603a603a003370290004dd2a40012598009802980c1baa001891919baf301e301b3754603c60366ea8008004c074c068dd5001448c8cdd7980f180d9baa002001301d301a375400480b246038603a603a0032301c301d301d301d0019baf4c103d87a8000912cc004006200315330180021001405d222332233004337046eb4c080008dd69810181080099b82375a60400026eb4c080c084008c06cdd5001980d9baa0019ba54800a602e6ea80326e9520049b89480112222222222222222222298009119198008009bac3017302f375400644b30010018a508acc004cdc79bae30330010038a51899801001181a000a05a40c52232330010010032259800800c5a264b30013375e606860626ea80040122603060626ea8006266006006606a0048170c0cc0050314888c8cc0540108c008c060c0c4dd5000acc004c06cc0b8dd5000c48c08a60026eacc05cc0c0dd5000cdd7181998181baa0039bae30173030375400680b224602930013756602e60606ea80066eb8c0ccc0c0dd5001cdd7180b98181baa00340588162464b3001301a302d375400313031302e3754003153302c491263c65787065637465643e2044656e6f6d696e61746f722063616e6e6f74206265207a65726f2e001640ac6644b3001301b0018a6103d87a80008acc004cdc4000a40011300e33031300e330313750601e004660626ea0c03c0052f5c097ae089807198189807198189ba800233031375000297ae04bd70205840b06eb4c0c0c0b4dd50009bad3014302d375400322233229800992cc004c078c0c4dd5000c4dd69819181a9bab30353032375400314800102f181a000cdd58014dd7981a181a800c8966002604a60646ea8016266e2400400a2b30013371200200513371200466e0000520809bee028a5040c08181222259800801c566002600400d13300100448002294103244c96600266ebd30101400030350018acc004cc008014dd6981b181c9bab3036001898019ba6303a0048a5040cd15980099801002a4001130030078a5040cc8198c0e000d0360dd3001194c004006009223303400233034374c00297ae04004444b3001002899800a6103d87a80004bd6f7b63044c8cc896600266e452201000028acc004cdc7a44100002899802180a1981b981a801a5eb80006266008980103d87a800000540c9198008034006446600c0046607200a00280310321bae30320013037003303500240cd2300c3302f37500026605e98010101004bd70488c8c8cc00400400c88c96600266ebc010c0c400626064003133003003303600240bc6068002600c6606000497ae048888888c96600260460171323259800acc004c088c0d4dd500fc5284528a0668992cc00400605d13259800981e00144c96600200315980099b8748040c0e0dd5000c4c9660020030348992cc00400606b03581ac4c966002608000713259800800c566002605e60786ea8006264b300100181cc4c9660020031598009821801466002003132598009816181f9baa00189919912cc00400a2b300130353042375400513259800800c102264b30010018acc004c12400a330010018acc004cc07d2401155369676e656420627920666565206d616e6167657200330190360038acc004cc8966002660429201274d696e74696e672066656520726174696f206973206265747765656e205b30252c20313030255d0059800cc005300106d8799f0001ff009119b8900200180120408cc00400a4466e24008006602c900120408a50411113302149012a526564656d7074696f6e2066656520726174696f206973206265747765656e205b30252c20313030255d0059800cc005300106d8799f0001ff009119b89002001800a0408cc0040064466e24008006602c900120408a50411114a08220c058c084c114dd5000980b181398229baa0018acc004cc07d2410a4e6f206d696e74696e67003375e604e608a6ea80d9300101a00089980fa48116537461626c657377617020706f6f6c206f7574707574009800802cc074cc11cc120c114dd5181618229baa00e4bd704c06ccc11cc074cc11cc8c8c8c09ccc128c12c00ccc128c12c008cc128c12c004cc128c090c120dd500219825181518241baa004304c304c304c001304b001304a0013045375400e97ae04bd704dd5981618229baa302c3045375401d4c103d8798000404914a08212294104245282084820a020820a08c820c1060830414128608e0028228c10cdd500140fd04040fe07f03f81fa0903024301e304137540026eb8c110c104dd500118219bac301d30403754063153303e49012a3c65787065637465643e2054686520666565206d616e61676572206d75737420686176652076616c7565001640f460846086608660866086608660866086607e6ea80060748052074820207503a81d40e90441820800a07e303d375400303840e903881c40e20708210c07cc064c0f0dd51811981e1baa00581b207a375a0030354100607a00281d8c0e4dd5000c0cd03640ce067033819a07c33006303b303837540026eacc064c0e0dd5014c0bd039181d000a07098009bac30393036375404f301d3036375407b4c103d879800040211533034491203c65787065637465643e20446174756d206d757374206265204e6f446174756d001640cc444b300130243037375400713259800800c00a264b3001001801c00e007003899912cc00400600b13259800800c4c9660020030078992cc004006264b3001001804c4c96600200313259800800c02e264b30010018992cc00400601b13259800800c4c966002608c003159800980d9822800c03e26644b3001001808c4c966002003132598009825000c566002603e6092003013899912cc00400602b13259800800c4c9660020030178992cc00400603101880c44cc896600200301a8992cc00400603701b80dc4cc896600200301d8992cc00400603d01e80f407a264b3001305a0038acc004c108c154dd500d44c9660020030208992cc004006043021810c08626644b3001001811c4c9660020030248124092049132598009830001c6600203d1980080e466002035132598009824800c4c9660020030278992cc00400605102881440a2264b3001306400381540a50611bae001419060c200282f8c174dd5008c566002609e003159800982e9baa011813c09905e409905a20b4305b375402102540a102540a102540a102541746eb8005060182e800a0b6375c00260b800482e8c168005058182b1baa01a80fa0a680fa0ae375c00282d0c15c0050551bad001305600280da0ae305400141486eb4004c14c00a03082a0c14400504f1828801405a02d01680b20a4304f001413460786092002609c006823a0268258dd5000c04a025012809209c304b00141246070608a0026094006821a01e8238dd5000c03a01d00e807209430470014114608e00500c80640320188240c1140050431822801402a01500a805208c30430014104608600500880440220108220c10400503f1820801401a00d0068032084303f00140f46eb8004c0f800903f181e000a0743038375400700140d4444b300130233036375400713259800800c00a264b3001001801c00e0071332259800800c016264b3001001803401a00d132598009820801c02200e81f0dd6800c019041181f000a078375a002607a00500340f8607600281c8c0dcdd5001c005034456600260440171323322598009814981b1baa001899912cc004c0f4006264b30013026303937540031323322598009820800c4c8cc004004dd61820801112cc004006264b3001302c303f3754003132324a2b30013233001001300d3756604860846ea80cc896600266e3cdd71823000801c528c4cc008008c11c00504045268b207c375c608660806ea80062c81e8c8cc004004dd6181398201baa0072259800800c530103d87a80008992cc0066002603a0034a14a281fa2003133003003304600240fc64b30013371e6eb8c11400402e2604266088608a608c00297ae08a6103d87a800040fc6eb0c11000504244c8c8cc8966002608e00713300600630470058b2088375c60880026eb8c110008c110004dd61821000a0808b207c375a607c002607e00260746ea80062c81b8c070c058c0e4dd51810181c9baa303c0018b2074375c6074606e6ea800660026eb0c078c0dcdd50144c050c0dcdd501f530103d879800040251640d060020026070606a6ea8c0e0c0d4dd5198041bac30383035375404c03e44b30010018a5eb82266070606a607200266004004607400281ba2b300130203033375403b19800981b981a1baa01d91192cc004c08c00626464b3001303d00280245903a1bae303b001303737540071598009814800c4c8c966002607a0050048b2074375c6076002606e6ea800e2c81a1034181a9baa002912cc004c088c0d4dd500144c8c8cc8966002607c0070058b2076375c60760026eb8c0ec008c0ec004c0d8dd5001459033489660026044606a6ea800a264646644b3001303e003802c5903b1bad303b001375a60760046076002606c6ea800a2c819922223233001005132598009813000c66002446607c66ec0dd48011ba80014bd6f7b630488cc88c074cc100dd419b82375a60820046eb4c104004cc100dd419b82375a608260840046eb4c104c1080052f5c060786ea8008c0f0dd5000c88cc0840088cdd79820181e9baa3040303d37546048607a6ea800400a4607c607e607e607e607e607e607e003232337066eb4c0fc004dd6981f9820000981d9baa0019181f181f981f981f981f981f800c8966002605060766ea800a260246607c607e60786ea80092f5c1130123303e374e6607c98011150496e6469676f537461626c6573776170003303e0014bd7025eb810394a600200348900a44100408598009bac303d303a37540573021303a37540834c0103d879800040309111111114c004888966002606600310048991919800800803112cc00400626609866ec0dd48031ba60034bd6f7b63044c8cc896600266e4402400a2b30013371e0120051325980099baf4c101a000374c003100289982819bb037520146e9800400904b19198008009bab304e0042259800800c4cc144cdd81ba900a375001297adef6c6089919912cc004cdc8806801456600266e3c03400a264b30013370e002606601b100289982a99bb0375201c6ea0cdc000080680120a0375a60a4007133054337606ea4034dd4006002209e89982a00199802802800a09e375c609e00260a800460a4002828226609e66ec0dd48049ba6006004412913304f0033300500500141286eb8c128004c13c008c13400504b19806801000a0889112cc004c0c8006297adef6c6089982419bb037520066e98cc0300080052f5bded8c0821a4464b300130383045375400314c103d87a8000898129982419805801982498231baa0014bd7020863233225980099b88002480022604e66094604e660946ea0c0a0004cc128dd4181400125eb812f5c1159800981600144c09ccc128c09ccc128dd4000998251ba80024bd7025eb82298103d87a800041148228dd698248009bad3049304a00130453754003225980099b89001480022900044c01ccc028c0500040090422444464b300100681fc4c966002609a00f15980099baf304c30493754609860926ea8c0c0c124dd5000981099825981298249baa0504bd7044c96600266e1d201030493754003132598009827800c4cc8966002607e60986ea8006264b30013052001899192cc004c0f0c13cdd500144c8c8c8c8c8c8c8c8c8c8ca60026eb8c1780066eb8c17802e60bc013305e008982f003cc96600260b80031598009818982d800c5a2609c60b600282ca2c82e8dd5182f0034c96600260b80031598009818982d800c5a2609c60b600282ca2c82e8dd5182f002cc1780126eb4c17800e6eb4c1780092222222222598009834805c4cc0bcc1a00504cc0b80204cc0b801c4cc0b80184c96600260a40031323259800983600140662c8348dd7183500098331baa0048acc004c1600062b3001306637540090178b20ce8b20c6418c60c86ea800e2c833060bc00260ba00260b800260b600260b400260b200260b000260ae00260ac00260aa00260a06ea800a2c82684c8c8c8c8c8c8c8cc896600266064921274e6f7420656e6f75676820636f6c6c61746572616c20617373657420696e2074686520706f6f6c0033712607000330013756607e60b06ea8c0fcc160dd50084dd7182d982c1baa303f30583754015375c607e60b06ea8c0fcc160dd5005207c8acc004cc0c92411957726f6e67206d696e7465642f6275726e65642076616c7565003375e6e9a60026eb8c16cc160dd502fcdd7182d982c1baa02499b80337026eb4c16c010dd6982d8030012028303a305837540931598009981924811c57726f6e672061646465642f72656465656d656420746f20706f6f6c009800982d9bac30353058375409330303305a305b30583754607e60b06ea80412f5c1303530583754607e60b06ea804330013756607e60b06ea8c0fcc160dd50084dd7182d982c1baa303f30583754015375c607e60b06ea8c0fcc160dd500540050155300103d8798000409513303249011b57726f6e672070616964206665657320746f2074726561737572790098009bac305b305837540933758606a60b06ea81266eacc0e4c160dd5024cdd7181d182c1baa05f9982d181b9982d182d982c1baa05f3305a305b3058375401497ae03305a375066e00008dd6982d982e001a5eb8260b660b06ea8041222222323298009bad30630019bad3063306400198318012444b30013047003899192cc00400626530013044001cc00660026eb8c1a4c198dd50024dd7182698331baa0048032044a4500a44100802a046981e1983418229983426103d87a8000330680094bd7025eb8122232330010010112259800800c528456600264b300130060018acc004cdd7982498361baa0010048acc00660026eacc14cc1b0dd5000c016980103d87a800040f1130473048306c375400314a0834a2941069452820d2306e0018a518998010011837800a0d041b03044330670024bd70456600260d2003132332259800982a000c56600260d06ea800e0051641a5159800982d000c56600260d06ea800e0051641a5159800982a800c56600260d06ea800e0051641a5159800982b800c56600260d06ea800e0051641a5159800982b000c4c8c8c8ca600260de003375a60de007375a60de0049112cc004c1cc01226607260e400e2b3001305b306e375400713232332259800983b801c0362c83a0dd6983a0009bae30740023074001306f37540071641b11641c0306f001306e001306d0013068375400715980099b87480280062b3001306837540070028b20d28b20ca4194832906520ca4194266ebc004cdd2a4010660d0008660d06ea0018cc1a0dd400299834004a5eb80c194dd500099819983418329baa306800100b8b20cc4198660500180026076660ca6ea40212f5c114a2830060c600264b30015980099b89001480022942294105c44cc18530106d8799f4040ff00330614c1010000330614c10100004bd7044cc184c18800ccc184dd400099830a610100004bd7020b8375a60c260c40048a50415514a082aa29410551bad3059001337026eb4c164014dd6982c801982c800982c000982b800982b000994c0040066602c6eb0c154c148dd5021982a98291baa3055305237546604a6eb0c154c148dd502181e4cc151301010000330544c1010000330544c1010000330544c1010000330544c1010000330544c101000033054374e60ac6eb0c0bcc148dd5021a5eb810011112cc00400a200319800801cc16000a66453001305a0019bad30590019bab303d30563754607a60ac6ea800a6072606660ac6ea8c0f4c158dd5001244446464653001375a60c0003375860c060c2003375a60c0015375a60c000f375a60c0007375a60c0004911111198158050992cc004c1a0006264653001375c60d2003375a60d260d4003375c60d20049112cc0056600266e3cdd7183618349baa01b375c60d860d26ea8042266ebcc140c1a4dd500d982818349baa0108a504199198009836005cc1b402e6074605860d26ea804122259800acc0056600266e3c010dd7183798361baa3053306c375402713371e00c6eb8c14cc1b0dd5182998361baa0138a5041a514a3159800acc004cdc78021bae306f306c37540e713371e00c6eb8c1bcc1b0dd5009c52820d28a508a9983524811457726f6e6720737570706c696564206173736574001641a4834a26644646644b3001306330703754606460e26ea808e2b3001337126eb4c164c1c4dd5011805456600330010049119b8900200180320948acc0066002011304933073304d3071375403097ae099818982998389baa01830743071375403b9800981519b813030375660b060e26ea8c160c1c4dd500e9bad303230713754031375c60e860e26ea81e26eb8c1d0c1c4dd500c400902e5300103d87a800040f9133073375066e00048004cc1ccdd400d198399ba801133073375066e00040008cc1ccdd419b8000f003330733750028660e66e9c01d2f5c1153306f4913b3c65787065637465643e204d696e74656420616d6f756e742077726f6e676c792073656e7420746f206f726465722064657374696e6174696f6e2e001641b9153306f491383c65787065637465643e20506f6f6c206d696e74696e67206665652065786365656473206f72646572206d61782066656520726174696f2e001641b906941b9153306f4901223c65787065637465643e204d696e74696e67206973206e6f7420656e61626c65642e001641b866e0400c0056600203f1008899192cc004c174c1c0dd5000c56600330013370e606660e860e26ea800401694294506e4402a200483722c8370cc0acc0fc004084c0c4cc0d0c0f800c08106c198140008012cc004072200b13259800982c98361baa00189817983818369baa0018b20d433027303b00501d41a4607a609060d86ea807a26464646464b3001306330703754606860e26ea808e2b3001337126eb4c148c1c4dd5011805456600330010059119b8900200180320948acc0066002011304933073304d3071375403097ae099818982998389baa01830743071375403b9800981519b813030375660b060e26ea8c160c1c4dd500e9bad303230713754031375c60e860e26ea8c160c1c4dd5011cdd7182c18389baa30583071375404700240b94c103d87a800040f91330733750024660e66ea0cdc000d000998399ba833700022004660e66ea0040cc1ccdd4007998399ba833700028008660e66e9c01d2f5c1153306f4913d3c65787065637465643e2052656465656d656420616d6f756e742077726f6e676c792073656e7420746f206f726465722064657374696e6174696f6e2e001641b9153306f4913b3c65787065637465643e20506f6f6c20726564656d7074696f6e206665652065786365656473206f72646572206d61782066656520726174696f2e001641b906941b9153306f4901243c65787065637465643e2052656465656d696e67206973206e6f7420656e61626c65642e001641b8b3001020880144c96600260ba60e06ea8006264b3001980099b873034330373041001023003a50a5141bd10048800a0de30333074307137540031641b866056607e00204283696600203f1001898189981a181f00081020d83370200e0026604e00200c607a609c60d86ea807906922a660ce9212b3c65787065637465643e2057726f6e67206f72646572203c3e20706f6f6c20636f6d62696e6174696f6e2e001641983069001375860ce0031641946466002002646600200201a44b30010018a5eb7bdb1822646644b3001337229101000028acc004cdc7a441000028800c401106644cc1ac00ccc0140140050661bae3066001306b0023069001419c44b30010018a5eb82264664466446600400400244b30010018801c4c8cc1b4dd3998369ba90053306d306a0013306d306b0014bd701980180198378011836800a0d6375660d00066eb8c194004cc00c00cc1a8008c1a00050660c180004c17c004c17801060ae00460b000280190551815999119912cc004cdc4001000c5300103d87980008acc004cdc40008014530103d87b80008a6103d87a800041448288cdc11bad3055002375a60aa60ac00266e08dd6982a8009bad305530560023050375400260a06ea8c07d20023020302c304f375400260a200316413c609a6ea80062c8250dd698270009817181418259baa3032304b375400716413060946ea80062c8238cc05cc130c124dd50009bab302a3049375407515330474911a3c65787065637465643e204d697865642076657273696f6e732e001641190404128609600c8248a600291100a44100800a00822b3001302c0018991991192cc004cdd79820981f1baa00102889919912cc00400a2b3001302d3040375400515980098209baa00289980da4811057726f6e67206d61696e206f72646572003375e608860826ea8c110c104dd5181418209baa00300181d208481d207c81d40ea07503a41186601a6084607e6ea8004dd59810181f9baa0303042303f37546084607e6ea8c098c0fcdd5001198019bac3041303e375405e6eb4c104c10800a2a66078921413c65787065637465643e205468652070726f766964656420696e70757420696e64657820636f72726573706f6e647320746f20746865206f776e20696e7075742e001640ec660046eb0c100c0f4dd50171bad30400013001001303b375405e444b300130120018cc00400e60826082005337000029001a0068acc004cdc4a400400319800801cc10400a66e000052001400d1598009814800c4c10000a2a66076921146578706563745f61743a206e6f7420666f756e64001640e881d103a4566002604e0031330144911854782069736e2774207369676e6564206279206f776e6572003300e02b375c602e60746ea801a2a6607092010452646d72001640dc81b9037181c1baa02d22598009813181c9baa0028991919191919194c004c1100066eb8c11001e6eb8c110016608800930440039bad3044002488888966002609600f133011304a00c13259800981a18239baa00489919192cc004c13c00a26602c609c006264b300130380018992cc004c14400626464b3001303b0018992cc004c15000626603660a6002013164144609e6ea800a2b3001304100189919194c004dd6982a800cdd6982a801cdd6982a8012444b300130590048074590560c154004c150004c13cdd500145904c2098304d375400260a000316413860986ea800a2b3001303e0018acc004c130dd500140162c826a2c824904918251baa0018b2098304d001304d0013048375400916411426644b30013035001899192cc004c13c00a009164130609a00260926ea80122b3001303b0018acc004c124dd5002400a2c82522c823104609980800300718231baa0028b209018220009821800982100098208009820000981f800981d1baa0028b206e459031206240c444444b3001330160040058acc004cdd7980a981c1baa0050038acc00660026eacc07cc0e0dd5002c00a002804226026602860706ea801629410354528206a8a5040d4180c803180c980d00322c8068601e00260146ea804229344d9590071"
|
|
10587
10584
|
};
|
|
10588
10585
|
|
|
10589
10586
|
// src/contracts/stableswap/scripts.ts
|
|
@@ -11325,7 +11322,7 @@ async function init(lucid, defaultInitialAssets, mkPythBasedAssets = () => [], p
|
|
|
11325
11322
|
// src/contracts/iasset/queries.ts
|
|
11326
11323
|
var import_lucid65 = require("@lucid-evolution/lucid");
|
|
11327
11324
|
var import_cardano_offchain_common33 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
11328
|
-
var
|
|
11325
|
+
var import_fp_ts27 = require("fp-ts");
|
|
11329
11326
|
async function findIAsset(lucid, sysParams, iassetName) {
|
|
11330
11327
|
const iassetUtxos = await lucid.utxosAtWithUnit(
|
|
11331
11328
|
createScriptAddress(
|
|
@@ -11337,21 +11334,21 @@ async function findIAsset(lucid, sysParams, iassetName) {
|
|
|
11337
11334
|
)
|
|
11338
11335
|
);
|
|
11339
11336
|
return (0, import_cardano_offchain_common33.matchSingle)(
|
|
11340
|
-
|
|
11337
|
+
import_fp_ts27.function.pipe(
|
|
11341
11338
|
iassetUtxos.map(
|
|
11342
|
-
(utxo) =>
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
|
|
11339
|
+
(utxo) => import_fp_ts27.function.pipe(
|
|
11340
|
+
import_fp_ts27.option.fromNullable(utxo.datum),
|
|
11341
|
+
import_fp_ts27.option.flatMap(parseIAssetDatum),
|
|
11342
|
+
import_fp_ts27.option.flatMap((datum) => {
|
|
11346
11343
|
if ((0, import_lucid65.toHex)(datum.assetName) === (0, import_lucid65.toHex)(iassetName)) {
|
|
11347
|
-
return
|
|
11344
|
+
return import_fp_ts27.option.some({ utxo, datum });
|
|
11348
11345
|
} else {
|
|
11349
|
-
return
|
|
11346
|
+
return import_fp_ts27.option.none;
|
|
11350
11347
|
}
|
|
11351
11348
|
})
|
|
11352
11349
|
)
|
|
11353
11350
|
),
|
|
11354
|
-
|
|
11351
|
+
import_fp_ts27.array.compact
|
|
11355
11352
|
),
|
|
11356
11353
|
(res) => new Error("Expected a single IAsset UTXO.: " + JSON.stringify(res))
|
|
11357
11354
|
);
|
|
@@ -11367,21 +11364,21 @@ async function findCollateralAsset(lucid, sysParams, iassetName, collateralAsset
|
|
|
11367
11364
|
)
|
|
11368
11365
|
);
|
|
11369
11366
|
return (0, import_cardano_offchain_common33.matchSingle)(
|
|
11370
|
-
|
|
11367
|
+
import_fp_ts27.function.pipe(
|
|
11371
11368
|
collateralAssetUtxos.map(
|
|
11372
|
-
(utxo) =>
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11369
|
+
(utxo) => import_fp_ts27.function.pipe(
|
|
11370
|
+
import_fp_ts27.option.fromNullable(utxo.datum),
|
|
11371
|
+
import_fp_ts27.option.flatMap(parseCollateralAssetDatum),
|
|
11372
|
+
import_fp_ts27.option.flatMap((datum) => {
|
|
11376
11373
|
if ((0, import_cardano_offchain_common33.isSameAssetClass)(datum.collateralAsset, collateralAsset) && (0, import_lucid65.toHex)(iassetName) === (0, import_lucid65.toHex)(datum.iasset)) {
|
|
11377
|
-
return
|
|
11374
|
+
return import_fp_ts27.option.some({ utxo, datum });
|
|
11378
11375
|
} else {
|
|
11379
|
-
return
|
|
11376
|
+
return import_fp_ts27.option.none;
|
|
11380
11377
|
}
|
|
11381
11378
|
})
|
|
11382
11379
|
)
|
|
11383
11380
|
),
|
|
11384
|
-
|
|
11381
|
+
import_fp_ts27.array.compact
|
|
11385
11382
|
),
|
|
11386
11383
|
(res) => new Error(
|
|
11387
11384
|
"Expected a single Collateral Asset UTXO.: " + JSON.stringify(res)
|
|
@@ -11391,12 +11388,12 @@ async function findCollateralAsset(lucid, sysParams, iassetName, collateralAsset
|
|
|
11391
11388
|
|
|
11392
11389
|
// src/contracts/stableswap/helpers.ts
|
|
11393
11390
|
var import_lucid66 = require("@lucid-evolution/lucid");
|
|
11394
|
-
var
|
|
11391
|
+
var import_fp_ts29 = require("fp-ts");
|
|
11395
11392
|
|
|
11396
11393
|
// src/contracts/stableswap/types-new.ts
|
|
11397
11394
|
var import_cardano_offchain_common34 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
11398
11395
|
var import_evolution20 = require("@evolution-sdk/evolution");
|
|
11399
|
-
var
|
|
11396
|
+
var import_fp_ts28 = require("fp-ts");
|
|
11400
11397
|
var import_effect3 = require("effect");
|
|
11401
11398
|
var OpaqueData4 = import_effect3.Schema.typeSchema(import_evolution20.Data.DataSchema);
|
|
11402
11399
|
var StableswapOrderDatumSchema = import_evolution20.TSchema.Struct({
|
|
@@ -11438,22 +11435,22 @@ function serialiseStableswapOrderDatum(d) {
|
|
|
11438
11435
|
}
|
|
11439
11436
|
function parseStableswapOrderDatum(datum) {
|
|
11440
11437
|
try {
|
|
11441
|
-
return
|
|
11438
|
+
return import_fp_ts28.option.some(
|
|
11442
11439
|
import_evolution20.Data.withSchema(
|
|
11443
11440
|
StableswapOrderDatumSchema,
|
|
11444
11441
|
DEFAULT_SCHEMA_OPTIONS
|
|
11445
11442
|
).fromCBORHex(datum)
|
|
11446
11443
|
);
|
|
11447
11444
|
} catch (_) {
|
|
11448
|
-
return
|
|
11445
|
+
return import_fp_ts28.option.none;
|
|
11449
11446
|
}
|
|
11450
11447
|
}
|
|
11451
11448
|
function parseStableswapOrderDatumOrThrow(datum) {
|
|
11452
|
-
return
|
|
11449
|
+
return import_fp_ts28.function.pipe(
|
|
11453
11450
|
parseStableswapOrderDatum(datum),
|
|
11454
|
-
|
|
11451
|
+
import_fp_ts28.option.match(() => {
|
|
11455
11452
|
throw new Error("Expected a Stableswap Order datum.");
|
|
11456
|
-
},
|
|
11453
|
+
}, import_fp_ts28.function.identity)
|
|
11457
11454
|
);
|
|
11458
11455
|
}
|
|
11459
11456
|
function serialiseStableswapOutputDatum(d) {
|
|
@@ -11470,22 +11467,22 @@ function serialiseStableswapOrderRedeemer(r) {
|
|
|
11470
11467
|
}
|
|
11471
11468
|
function parseStableswapOrderRedeemer(redeemerCborHex) {
|
|
11472
11469
|
try {
|
|
11473
|
-
return
|
|
11470
|
+
return import_fp_ts28.option.some(
|
|
11474
11471
|
import_evolution20.Data.withSchema(
|
|
11475
11472
|
StableswapOrderRedeemerSchema,
|
|
11476
11473
|
DEFAULT_SCHEMA_OPTIONS
|
|
11477
11474
|
).fromCBORHex(redeemerCborHex)
|
|
11478
11475
|
);
|
|
11479
11476
|
} catch (_) {
|
|
11480
|
-
return
|
|
11477
|
+
return import_fp_ts28.option.none;
|
|
11481
11478
|
}
|
|
11482
11479
|
}
|
|
11483
11480
|
function parseStableswapOrderRedeemerOrThrow(redeemerCborHex) {
|
|
11484
|
-
return
|
|
11481
|
+
return import_fp_ts28.function.pipe(
|
|
11485
11482
|
parseStableswapOrderRedeemer(redeemerCborHex),
|
|
11486
|
-
|
|
11483
|
+
import_fp_ts28.option.match(() => {
|
|
11487
11484
|
throw new Error("Expected a Stableswap Order redeemer.");
|
|
11488
|
-
},
|
|
11485
|
+
}, import_fp_ts28.function.identity)
|
|
11489
11486
|
);
|
|
11490
11487
|
}
|
|
11491
11488
|
|
|
@@ -11741,25 +11738,25 @@ function pickValidSatisfiableOrders(lucid, orders, pool, sysParams, psmProcessin
|
|
|
11741
11738
|
return [];
|
|
11742
11739
|
}
|
|
11743
11740
|
});
|
|
11744
|
-
const { left: mintingOrders, right: redeemingOrdersSortedDesc } =
|
|
11741
|
+
const { left: mintingOrders, right: redeemingOrdersSortedDesc } = import_fp_ts29.function.pipe(
|
|
11745
11742
|
validOrders,
|
|
11746
|
-
|
|
11743
|
+
import_fp_ts29.array.partition((o) => o.orderType === "REDEEMING"),
|
|
11747
11744
|
({ left, right }) => ({
|
|
11748
11745
|
left,
|
|
11749
11746
|
// Sort the redeeming orders descending.
|
|
11750
|
-
right:
|
|
11747
|
+
right: import_fp_ts29.function.pipe(
|
|
11751
11748
|
right,
|
|
11752
|
-
|
|
11753
|
-
|
|
11749
|
+
import_fp_ts29.array.sort(
|
|
11750
|
+
import_fp_ts29.ord.contramap(
|
|
11754
11751
|
(o) => o.swapInfo.owedCollateralAsset
|
|
11755
|
-
)(
|
|
11752
|
+
)(import_fp_ts29.ord.reverse(BigIntOrd))
|
|
11756
11753
|
)
|
|
11757
11754
|
)
|
|
11758
11755
|
})
|
|
11759
11756
|
);
|
|
11760
|
-
const totalCollateralDiff =
|
|
11757
|
+
const totalCollateralDiff = import_fp_ts29.function.pipe(
|
|
11761
11758
|
validOrders,
|
|
11762
|
-
|
|
11759
|
+
import_fp_ts29.array.reduce(
|
|
11763
11760
|
0n,
|
|
11764
11761
|
(acc, order) => acc + order.swapInfo.suppliedCollateralAsset - order.swapInfo.owedCollateralAsset
|
|
11765
11762
|
)
|
|
@@ -11767,13 +11764,13 @@ function pickValidSatisfiableOrders(lucid, orders, pool, sysParams, psmProcessin
|
|
|
11767
11764
|
if (psmAvailableLiq + totalCollateralDiff >= 0n) {
|
|
11768
11765
|
return validOrders.map((o) => o.order);
|
|
11769
11766
|
}
|
|
11770
|
-
const collateralFromMinting =
|
|
11767
|
+
const collateralFromMinting = import_fp_ts29.function.pipe(
|
|
11771
11768
|
mintingOrders,
|
|
11772
|
-
|
|
11769
|
+
import_fp_ts29.array.reduce(0n, (acc, o) => acc + o.swapInfo.suppliedCollateralAsset)
|
|
11773
11770
|
);
|
|
11774
|
-
const { selected } =
|
|
11771
|
+
const { selected } = import_fp_ts29.function.pipe(
|
|
11775
11772
|
redeemingOrdersSortedDesc,
|
|
11776
|
-
|
|
11773
|
+
import_fp_ts29.array.reduce(
|
|
11777
11774
|
{
|
|
11778
11775
|
intermediateCollateralAmt: psmAvailableLiq + collateralFromMinting,
|
|
11779
11776
|
selected: []
|
|
@@ -11790,8 +11787,7 @@ function pickValidSatisfiableOrders(lucid, orders, pool, sysParams, psmProcessin
|
|
|
11790
11787
|
// src/contracts/stableswap/transactions.ts
|
|
11791
11788
|
var import_lucid67 = require("@lucid-evolution/lucid");
|
|
11792
11789
|
var import_cardano_offchain_common36 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
11793
|
-
var
|
|
11794
|
-
var import_Array3 = require("fp-ts/lib/Array");
|
|
11790
|
+
var import_fp_ts30 = require("fp-ts");
|
|
11795
11791
|
async function createStableswapOrder(iasset, collateralAsset, amount, minting, poolDatum, params, lucid, destinationAddress, destinationInlineDatum, maxExecutionFee = BASE_MAX_EXECUTION_FEE, additionalLovelaces = 0n, maxFeeRatio) {
|
|
11796
11792
|
const myAddress = await lucid.wallet().address();
|
|
11797
11793
|
const pkh = (0, import_lucid67.paymentCredentialOf)(myAddress);
|
|
@@ -11879,7 +11875,7 @@ async function batchProcessStableswapOrders(stableswapOrderOrefs, stableswapPool
|
|
|
11879
11875
|
]),
|
|
11880
11876
|
(_) => new Error("Expected a single iasset token policy Ref Script UTXO")
|
|
11881
11877
|
);
|
|
11882
|
-
if (
|
|
11878
|
+
if (import_fp_ts30.array.isEmpty(stableswapOrderOrefs)) {
|
|
11883
11879
|
throw new Error("At least one order must be provided.");
|
|
11884
11880
|
}
|
|
11885
11881
|
const stableswapOrderUtxos = await lucid.utxosByOutRef(stableswapOrderOrefs);
|
|
@@ -11926,9 +11922,9 @@ async function batchProcessStableswapOrders(stableswapOrderOrefs, stableswapPool
|
|
|
11926
11922
|
return res.result;
|
|
11927
11923
|
}
|
|
11928
11924
|
);
|
|
11929
|
-
const totalSwapInfo =
|
|
11925
|
+
const totalSwapInfo = import_fp_ts30.function.pipe(
|
|
11930
11926
|
ordersInfo,
|
|
11931
|
-
|
|
11927
|
+
import_fp_ts30.array.reduce(
|
|
11932
11928
|
{
|
|
11933
11929
|
suppliedCollateralAsset: 0n,
|
|
11934
11930
|
suppliedIasset: 0n,
|
|
@@ -11982,9 +11978,9 @@ async function batchProcessStableswapOrders(stableswapOrderOrefs, stableswapPool
|
|
|
11982
11978
|
if (amountToMint !== 0n) {
|
|
11983
11979
|
tx.mintAssets((0, import_cardano_offchain_common36.mkAssetsOf)(iassetAc, amountToMint), import_lucid67.Data.void());
|
|
11984
11980
|
}
|
|
11985
|
-
|
|
11981
|
+
import_fp_ts30.function.pipe(
|
|
11986
11982
|
ordersInfo,
|
|
11987
|
-
|
|
11983
|
+
import_fp_ts30.array.reduce(tx, (acc, orderInfo) => {
|
|
11988
11984
|
return acc.collectFrom(
|
|
11989
11985
|
[orderInfo.order.utxo],
|
|
11990
11986
|
(0, import_cardano_offchain_common36.isSameOutRef)(orderInfo.order.utxo, mainOrderUtxo) ? serialiseStableswapOrderRedeemer("BatchProcessStableswapOrders") : {
|